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 Timer doesn't work, I think... ?
Lontasm Offline
Junior Member

Posts: 27
Threads: 7
Joined: Feb 2011
Reputation: 0
#1
Timer doesn't work, I think... ?

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);
}

Current Project: Depths of Shadows(Mapper)
11-08-2011, 06:57 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Timer doesn't work, I think... ?

(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?

(This post was last modified: 11-08-2011, 07:09 PM by Statyk.)
11-08-2011, 07:08 PM
Find
Lontasm Offline
Junior Member

Posts: 27
Threads: 7
Joined: Feb 2011
Reputation: 0
#3
RE: Timer doesn't work, I think... ?

(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

Current Project: Depths of Shadows(Mapper)
(This post was last modified: 11-08-2011, 07:48 PM by Lontasm.)
11-08-2011, 07:17 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#4
RE: Timer doesn't work, I think... ?

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

11-08-2011, 07:49 PM
Find




Users browsing this thread: 1 Guest(s)