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
Script Help So many errors
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#5
RE: So many errors

void OnStart()
{
AddEntityCollideCallback("Player", "Area_VisionTrigger", "Script_VisionTrigger", false, 0);
}

void OnEnter()
{

}

void Script_VisionTrigger (string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
PlayMusic("vision_music", true, 1, 6, 7, false);
CreateParticleSystemAtEntity("Area_VisionWind", "ps_dust_whirl.ps", "Area_VisionWind", false);
SetLampLit("candlestick_floor_1", false, true);
SetLampLit("candle_floor_small_1", false, true);
PlaySoundAtEntity("blow", "general_wind_whirl", "Player", 0.0f, false);

AddTimer("fadescreen", 18.1f, "timer_fade");
AddTimer("visionstarter", 19.2f, "timer_vision_start");
AddTimer("visionender", 203.53f, "timer_vision_end");
SetLocalVarInt("IsPlayerInArea", 1); // where 1 is yes and 0 is no
}
if(alState == -1)
{
StopMusic(3, 7);
SetLocalVarInt("IsPlayerInArea", 0); // where 1 is yes and 0 is no
}
}

void Potential_Timer_Function(string &in strTimer)
{
if (GetLocalVarInt("IsPlayerInArea") == 1)
{
// do the stuff
}
}


void OnLeave()
{

}

This is all assuming you want those timers to expire with nothing happening if the player has left that area.
(This is also all assuming you know that you haven't written any functions for those timer callbacks Tongue)

If you want those timers to work even if you have left the area, well they should do now!

[disclaimer: this is provided untested, therefore I will not be held liable for damage to computer and/or persons including but not limited to dramatic loss of life etc.]

(This post was last modified: 02-11-2013, 11:38 AM by Adrianis.)
02-11-2013, 11:22 AM
Find


Messages In This Thread
So many errors - by CarnivorousJelly - 02-10-2013, 10:43 PM
RE: So many errors - by FlawlessHappiness - 02-10-2013, 11:13 PM
RE: So many errors - by CarnivorousJelly - 02-11-2013, 12:54 AM
RE: So many errors - by FlawlessHappiness - 02-11-2013, 07:48 AM
RE: So many errors - by CarnivorousJelly - 02-11-2013, 07:52 PM
RE: So many errors - by Adrianis - 02-11-2013, 08:55 PM
RE: So many errors - by CarnivorousJelly - 02-12-2013, 06:45 AM
RE: So many errors - by Adrianis - 02-11-2013, 11:22 AM
RE: So many errors - by FlawlessHappiness - 02-11-2013, 08:36 PM
RE: So many errors - by Adrianis - 02-12-2013, 06:14 PM
RE: So many errors - by CarnivorousJelly - 02-13-2013, 12:54 AM
RE: So many errors - by CarnivorousJelly - 02-14-2013, 05:23 AM
RE: So many errors - by TheGreatCthulhu - 02-14-2013, 01:23 PM



Users browsing this thread: 3 Guest(s)