PDA

View Full Version : Playing FX on trigger



the_law
17th July 2016, 02:03
Hey guys,

Sorry I'm asking such a basic question - again, I've never tried doing this before and I don't seem to have much success after trying to copy the steps others take to play an effect, but maybe I'm missing something crucial.

So the setup is simple (SP map, by the way). I have a script_origin somewhere in my map with the targetname of "smokeorigin" and a trigger_multiple in my map with the targetname of "smoke_trig". What I want to do is begin playing the effect when the player triggers "smoke_trig".

So I've defined the entities and FX at the beginning of my script:



level.greensmoke = loadfx ("fx/smoke/marker_smoke_green.efx");
//Not sure if I'm doing this right, can someone please confirm?

level.smokeorigin = getent("smokeorigin","targetname");
level.smoketrig = getent("smoke_trig","targetname");

//Removed some unneccessary stuff here.

thread playsmoke();




playsmoke()
{
level.smoketrig waittill("trigger");
iprintlnbold ("PLAYING FX");//debug message
playfx(level.greensmoke,level.smokeorigin.origin);
}

The trigger is working since the debug message appears; however, the smoke isn't. Any clues as to where I went wrong?

Paho
17th July 2016, 11:02
wrong efx maybe. Give a link to effect. OR life fx of time low. Playfx in cycle.


level.smoketrig waittill("trigger");
iprintlnbold ("PLAYING FX");//debug message
for(i=0;i<second;i++)
{
playfx(level.greensmoke,level.smokeorigin.origin);
wait 0.*;//life time
}