Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deactivating/activating billboards
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#4
RE: Deactivating/activating billboards

Hi. That worked perfectly, but I need some help with the code. I'll try posting what I've put together, but it is VERY sloppy, and actually crashed the game.

//BACKUP SHADOWRUN

void OnStart()
{
    AddEntityCollideCallback("Player", "triggershadowrun", "ShadowRun", false, 1);
    
    GiveItemFromFile("lantern", "lantern.ent");
            SetPlayerLampOil(100.0f);
}



//SHADOW RUN

//This is horrendous. It crashed the game. Haha. Anyways, my idea is to start a loop which checks a timer (which in the ideal event will actually only be about 0.5 sec long. And it sequentially disables each light source (there are 14) across the 0.5 seconds, and turns them back on shortly after. This will look like something flies past the window, and will hopefully scare peoples' socks off.


void ShadowRun(string &in asParent, string &in asChild, int alState)
{
    AddTimer("LightSequence", 15.0, "ASDF");
    AddLocalVarFloat("sequence", 0.0);
    SetLocalVarString("sequence", "s");
    AddLocalVarInt("timerinteger", GetTimerTimeLeft("LightSequence"));
    SetLocalVarString("timerinteger", "t");
    for(float s = 1; s < 2.4; s++)
    {
        AddTimer("Timer_"+s, -0.139+s, "deactivate_"+(14-t));
        AddTimer("reactivatetimer_"+(14-t), 14-t, "reactivatebb_"+(14-t));
    }
}

//OK all this mumbo jumbo below is the individual functions to disable each light source, and the billboards as well. I couldn't find any clever way to wrap this up into a single function. Help! :D


void deactivate_1(string &in asTimer)
{
    SetLightVisible("PointLight_1", false);
}

void deactivate_2(string &in asTimer)
{
    SetLightVisible("PointLight_2", false);
}

void deactivate_3(string &in asTimer)
{
    SetLightVisible("PointLight_3", false);
}

void deactivate_4(string &in asTimer)
{
    SetLightVisible("PointLight_4", false);
}

void deactivate_5(string &in asTimer)
{
    SetLightVisible("PointLight_5", false);
}

void deactivate_6(string &in asTimer)
{
    SetLightVisible("PointLight_6", false);
}

void deactivate_7(string &in asTimer)
{
    SetLightVisible("PointLight_7", false);
}

void deactivate_8(string &in asTimer)
{
    SetLightVisible("PointLight_8", false);
}

void deactivate_9(string &in asTimer)
{
    SetLightVisible("PointLight_9", false);
}

void deactivate_10(string &in asTimer)
{
    SetLightVisible("PointLight_10", false);
}

void deactivate_11(string &in asTimer)
{
    SetLightVisible("PointLight_11", false);
}

void deactivate_12(string &in asTimer)
{
    SetLightVisible("PointLight_12", false);
}

void deactivate_13(string &in asTimer)
{
    SetLightVisible("PointLight_13", false);
}

void deactivate_14(string &in asTimer)
{
    SetLightVisible("PointLight_14", false);
}

void reactivatebb_1(string &in asTimer)
{
    SetLightVisible("PointLight_1", true);
}

void reactivatebb_2(string &in asTimer)
{
    SetLightVisible("PointLight_2", true);
}

void reactivatebb_3(string &in asTimer)
{
    SetLightVisible("PointLight_3", true);
}

void reactivatebb_4(string &in asTimer)
{
    SetLightVisible("PointLight_4", true);
}

void reactivatebb_5(string &in asTimer)
{
    SetLightVisible("PointLight_5", true);
}

void reactivatebb_6(string &in asTimer)
{
    SetLightVisible("PointLight_6", true);
}

void reactivatebb_7(string &in asTimer)
{
    SetLightVisible("PointLight_7", true);
}

void reactivatebb_8(string &in asTimer)
{
    SetLightVisible("PointLight_8", true);
}

void reactivatebb_9(string &in asTimer)
{
    SetLightVisible("PointLight_9", true);
}

void reactivatebb_10(string &in asTimer)
{
    SetLightVisible("PointLight_10", true);
}

void reactivatebb_11(string &in asTimer)
{
    SetLightVisible("PointLight_11", true);
}

void reactivatebb_12(string &in asTimer)
{
    SetLightVisible("PointLight_12", true);
}

void reactivatebb_13(string &in asTimer)
{
    SetLightVisible("PointLight_13", false);
}

void reactivatebb_14(string &in asTimer)
{
    SetLightVisible("PointLight_14", false);
}

I'm looking over the code I posted. It's bad. I'm gonna have to start from scratch with the help of you guys Big Grin
(This post was last modified: 03-24-2011, 02:18 AM by palistov.)
03-24-2011, 02:17 AM
Find


Messages In This Thread
Deactivating/activating billboards - by palistov - 03-23-2011, 08:35 AM
RE: Deactivating/activating billboards - by palistov - 03-24-2011, 02:17 AM



Users browsing this thread: 1 Guest(s)