02-10-2013, 10:43 PM
I've managed to remove all the coding that had errors in it, but now I'm not quite sure how to write the function I want. The timers in the code (what I removed) was causing the error "main (11, 1): INFO: Compiling void Script_VisionTrigger(string&in, string&in, int)"
Where do I put the timers if I want them to run only when the player is in the specified area?
Edit: if it helps, I was trying to get the timers to fade the screen to black, then teleport the player to a second start area and fade back in, have the event play, then teleport him back.
Where do I put the timers if I want them to run only when the player is in the specified area?
Code:
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");
}
if(alState == -1)
{
StopMusic(3, 7);
}
}
void OnLeave()
{
}
Edit: if it helps, I was trying to get the timers to fade the screen to black, then teleport the player to a second start area and fade back in, have the event play, then teleport him back.