Thread: FX Help

Results 1 to 7 of 7
  1. #1
    Hello33's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0

    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!

  2. #2
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,675
    Reputation
    905
    Thanks
    18,543
    My Mood
    Angelic
    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();
    }
    }
    }
    Last edited by Jorndel; 07-11-2011 at 03:54 PM.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  3. The Following User Says Thank You to Jorndel For This Useful Post:

    Hello33 (07-11-2011)

  4. #3
    Hello33's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    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?
    Last edited by Hello33; 07-11-2011 at 04:51 PM.

  5. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,675
    Reputation
    905
    Thanks
    18,543
    My Mood
    Angelic
    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
    Last edited by Jorndel; 07-11-2011 at 04:56 PM.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  6. The Following User Says Thank You to Jorndel For This Useful Post:

    Hello33 (07-11-2011)

  7. #5
    Hello33's Avatar
    Join Date
    Jul 2011
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    Unfortunately, It still disabled all the other threads. Thank you though!

  8. #6
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed
    stopfxontag

  9. #7
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,675
    Reputation
    905
    Thanks
    18,543
    My Mood
    Angelic
    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.
    Last edited by Jorndel; 07-12-2011 at 05:46 AM.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

Similar Threads

  1. [Help Request] Combat arms Vid help
    By djw111 in forum Combat Arms Help
    Replies: 4
    Last Post: 12-24-2011, 06:06 PM
  2. [Help Request] AFK Bot [help]
    By fet in forum Combat Arms Help
    Replies: 7
    Last Post: 04-28-2011, 04:17 AM
  3. [Help Request] Injector Admin help
    By asdfgas in forum Combat Arms Help
    Replies: 4
    Last Post: 04-27-2011, 07:12 PM
  4. [Help Request] Ajuda / Help
    By - Battery' in forum Combat Arms BR Coding Help
    Replies: 3
    Last Post: 04-22-2011, 08:15 PM
  5. [Help Request] Help my!
    By Windowns7 in forum Combat Arms BR Coding Help
    Replies: 2
    Last Post: 04-18-2011, 02:41 PM