FX Help

Posts 17 of 7 · Page 1 of 1
FX Help
Can anybody please help me with this code:


Code:
onPlayerSpawned()
{
        self endon( "disconnect" );
        for(;;)
        {
                self waittill( "spawned_player" );
                self thread textInstructions();
                self thread doSpawn();
	while (1) {
		playFXOnTag( level.harrier_afterburnerfx, self, "tag_weapon_left" );
		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "j_head" );
      		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "tag_weapon_right" );
      		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "back_mid" );
      		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "torso_stabilizer" );
      		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "pelvis" );
		}
        }
}
I'm trying to make a sort of flashing colored light effect so it looks like someone has strobe lights attached to him, but each light stays on instead of turning off every 0.5 seconds.

What should I add to make it turn off? (Maybe playFXofftag?)
And Is there a better fx for what I'm trying to achieve?

Thank you!
Quote Originally Posted by Hello33 View Post
Can anybody please help me with this code:


Code:
onPlayerSpawned()
{
        self endon( "disconnect" );
        for(;;)
        {
                self waittill( "spawned_player" );
                self thread textInstructions();
                self thread doSpawn();
	while (1) {
		playFXOnTag( level.harrier_afterburnerfx, self, "tag_weapon_left" );
		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "j_head" );
      		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "tag_weapon_right" );
      		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "back_mid" );
      		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "torso_stabilizer" );
      		wait 0.5;
		playFXOnTag( level.harrier_afterburnerfx, self, "pelvis" );
		}
        }
}
I'm trying to make a sort of flashing colored light effect so it looks like someone has strobe lights attached to him, but each light stays on instead of turning off every 0.5 seconds.

What should I add to make it turn off? (Maybe playFXofftag?)
And Is there a better fx for what I'm trying to achieve?

Thank you!
@Hello33

Try:
Code:
headfx = loadfx( "fire/jet_afterburner_harrier" );
Head = SpawnFX(headfx, self getTagOrigin("j_head"));

TriggerFX(Head);

Head Delete();
EDIT:

Maybe you want this instead:
Code:
onPlayerSpawned()
{
self endon( "disconnect" );
for(;;)
{
self waittill( "spawned_player" );
self thread textInstructions();
self thread doSpawn();
while (1) {
//FX to use/load
fx = loadfx( "fire/jet_afterburner_harrier" );

//Body Parts
Body0 = SpawnFX(fx, self getTagOrigin("tag_weapon_left"));
Body1 = SpawnFX(fx, self getTagOrigin("j_head"));
Body2 = SpawnFX(fx, self getTagOrigin("tag_weapon_right"));
Body3 = SpawnFX(fx, self getTagOrigin("back_mid"));
Body4 = SpawnFX(fx, self getTagOrigin("torso_stabilizer"));
Body5 = SpawnFX(fx, self getTagOrigin("pelvis"));

//Part 0
TriggerFX(Body0);
Body0 Delete();
wait 0.5;

//Part 1
TriggerFX(fx);
Body1 Delete(Body1);
wait 0.5;

//Part 2
TriggerFX(Body2);
Body2 Delete();
wait 0.5;

//Part 3
TriggerFX(Body3);
Body3 Delete();
wait 0.5;

//Part 4
TriggerFX(Body4);
Body4 Delete();
wait 0.5;

//Part 5
TriggerFX(Body5);
Body5 Delete();
}
}
}
Thank you! Ill try it out and let you know in a bit

EDIT:

It's not working :/ I put it in the code and everytime I spawn, the rest of the gsc server code seems like it is doing nothing. For example, I have a set vision in dospawn() and it's not recognizing it after I spawn twice.

Also, does the fx loop? Is there a way to make it keep flashing?
Quote Originally Posted by Hello33 View Post
Thank you! Ill try it out and let you know in a bit

EDIT:

It's not working :/ I put it in the code and everytime I spawn, the rest of the gsc server code seems like it is doing nothing. For example, I have a set vision in dospawn() and it's not recognizing it after I spawn twice.

Also, does the fx loop? Is there a way to make it keep flashing?
Yes, it is in a loop.
No I didn't test it.

This spawns the FX and delete it at the same time.
My fault.

EDIT:
Code:
onPlayerSpawned()
{
self endon( "disconnect" );
for(;;)
{
self waittill( "spawned_player" );
self thread textInstructions();
self thread doSpawn();
while (1) {
//FX to use/load
fx = loadfx( "fire/jet_afterburner_harrier" );

//Body Parts
Body0 = SpawnFX(fx, self getTagOrigin("tag_weapon_left"));
Body1 = SpawnFX(fx, self getTagOrigin("j_head"));
Body2 = SpawnFX(fx, self getTagOrigin("tag_weapon_right"));
Body3 = SpawnFX(fx, self getTagOrigin("back_mid"));
Body4 = SpawnFX(fx, self getTagOrigin("torso_stabilizer"));
Body5 = SpawnFX(fx, self getTagOrigin("pelvis"));

//Part 0
TriggerFX(Body0);
Body5 Delete();
wait 0.5;

//Part 1
TriggerFX(fx);
Body0 Delete();
wait 0.5;
Body1 Delete(Body1);
//Part 2
TriggerFX(Body2);
Body2 Delete();
wait 0.5;

//Part 3
TriggerFX(Body3);
Body3 Delete();
wait 0.5;

//Part 4
TriggerFX(Body4);
Body4 Delete();
wait 0.5;

//Part 5
TriggerFX(Body5);
}
}
}
Now it should work.

I have to go now so, I can't help you more if it don't work as you want.
Have fun, welcome to MPGH
Unfortunately, It still disabled all the other threads. Thank you though!
stopfxontag
Quote Originally Posted by Hello33 View Post
Unfortunately, It still disabled all the other threads. Thank you though!
That is because the loop ( while (1) ) never ends and there for won't thread anything below it.

But if you make it a own thread in the onplayerspawn() then it will go much better.

So you can't really have it in there.

Put it in a own thread.

EDIT: (I decided to be nice and show you)

Like:
Code:
FXs()
{
self endon("death");
self endon( "disconnect" );

while (1) {
//FX to use/load
fx = loadfx( "fire/jet_afterburner_harrier" );

//Body Parts
Body0 = SpawnFX(fx, self getTagOrigin("tag_weapon_left"));
Body1 = SpawnFX(fx, self getTagOrigin("j_head"));
Body2 = SpawnFX(fx, self getTagOrigin("tag_weapon_right"));
Body3 = SpawnFX(fx, self getTagOrigin("back_mid"));
Body4 = SpawnFX(fx, self getTagOrigin("torso_stabilizer"));
Body5 = SpawnFX(fx, self getTagOrigin("pelvis"));

//Part 0
TriggerFX(Body0);
Body5 Delete();
wait 0.5;

//Part 1
TriggerFX(Body1);
Body0 Delete();
wait 0.5;

//Part 2
TriggerFX(Body2);
Body1 Delete();
wait 0.5;

//Part 3
TriggerFX(Body3);
Body2 Delete();
wait 0.5;

//Part 4
TriggerFX(Body4);
Body3 Delete();
wait 0.5;

//Part 5
TriggerFX(Body5);
Body4 Delete();
}
}
And you know, the FX won't follow you, it will stay where it become trigged.
Posts 17 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?