Frictional Games Forum (read-only)
[SCRIPT] Timer doesn't work, I think... ? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Timer doesn't work, I think... ? (/thread-11250.html)



Timer doesn't work, I think... ? - Lontasm - 11-08-2011

So uh.... yeah, Im having like 2 scriptareas who have a timer on them that will trigger a windgust a little bit after a collapse.... the "ParticleSystem1" script goes off as soon as I go into the map, but I want it to go off after the "ParticleSystem" script... Please help?

anyway, here is the script:

void break_stairs(string &in asTimer)
{
PlaySoundAtEntity("KitchenNoise", "break_stairs.snt", "Collapse", 1, true);
AddTimer("", 2.0f, "ParticleSystem");
}

void ParticleSystem(string &in asTimer)
{
CreateParticleSystemAtEntity("Gust", "ps_dust_push.ps", "Tornado", false);
SetLampLit("torch_static01_3", false, true);
SetLampLit("chandelier_nice_2", false, true);
SetEntityActive("PointLight_8", false);
SetLightVisible("SpotLight_11", false);
AddTimer("", 2.0f, "ParticleSystem1");
}

void ParticleSystem1(string &in asTimer)
{
CreateParticleSystemAtEntity("Gust", "ps_dust_push.ps", "Gust", false);
SetLampLit("torch_static01_4", false, true);
SetLampLit("torch_static01_5", false, true);
SetLampLit("torch_static01_6", false, true);
SetLampLit("chandelier_nice_3", false, true);
SetEntityActive("PointLight_9", false);
SetLightVisible("SpotLight_21", false);
SetLightVisible("SpotLight_27", false);
}



RE: Timer doesn't work, I think... ? - Statyk - 11-08-2011

(11-08-2011, 06:57 PM)Lontasm Wrote: So uh.... yeah, Im having like 2 scriptareas who have a timer on them that will trigger a windgust a little bit after a collapse.... the "ParticleSystem1" script goes off as soon as I go into the map, but I want it to go off after the "ParticleSystem" script... Please help?
Big question....

Are the places you want the particle systems, PARTICLE SYSTEMS? or are they script areas? I think what you're going to need is areas that are inactive. then in the timers, activate the areas and run particle systems on them. understand?




RE: Timer doesn't work, I think... ? - Lontasm - 11-08-2011

(11-08-2011, 07:08 PM)Statyk Wrote:
(11-08-2011, 06:57 PM)Lontasm Wrote: So uh.... yeah, Im having like 2 scriptareas who have a timer on them that will trigger a windgust a little bit after a collapse.... the "ParticleSystem1" script goes off as soon as I go into the map, but I want it to go off after the "ParticleSystem" script... Please help?
Big question....

Are the places you want the particle systems, PARTICLE SYSTEMS? or are they script areas? I think what you're going to need is areas that are inactive. then in the timers, activate the areas and run particle systems on them. understand?
the "ParticleSystem" and "ParticleSystem1" are ScriptAreas. both are Active when the map starts... so ur saying I should uncheck the Active window in both scripts and add a "SetEntityActive" on "ParticleSystem" and "ParticleSystem1"?

I got it working Wink


RE: Timer doesn't work, I think... ? - Khyrpa - 11-08-2011

First of all, particle effects cant be set to active or unactive. You can only spawn them at entities, like in your case you are trying to spawn them into entities (script area can be used as an "entity" in this case so use them rather than objects) called "Tornado" and "Gust".

And when you have particle effects that wont loop, like ps_dust_push, when you set them in the level editor and play the map, the particle effect is spawned instantly and stops because it wont loop. That's why you need the CreateParticleSystemAtEntity.

edit. you got it working okay nvm