Results 1 to 7 of 7

Thread: Playing a FX with a use_Touch_trigger in a map

  1. #1
    ... connecting
    Join Date
    Jul 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Playing a FX with a use_Touch_trigger in a map

    Hey guys,

    following problem: As you can see below, I posted the script. If I start the map, only the music gets played, and no FX appears.
    Is it proper, if I take player.origin?
    I already used developer, but no errors. Music plays fine, only the FX doesn't appear. I need it only in one room, so I thought it would be okay to play the FX on the player which used the use_Touch_trigger.
    I've added a few wait commands between the FXs, because I want to play the FXs in certain moments of the song, so I've calculated when which FX is needed. Did I do that in the correct way? Or is there any other way?
    Do I have to add any .csv file to load the FXs ? In Call of Duty 4 actually you always have to type in the mod.csv the effects you need.

    Please help me.
    Thanks in advance!

    Code:
    main()
    {
    maps\mp\_load::main();
    
    thread _PrecacheFX();
    thread song1();
    thread song2();
    
    
    setExpFog(0.0001, 0.55, 0.6, 0.55, 0);
    // setCullFog(0, 16500, 0.55, 0.6, 0.55, 0);
    ambientPlay("ambient_france");
    
    game["allies"] = "american";
    game["axis"] = "german";
    game["attackers"] = "allies";
    game["defenders"] = "axis";
    game["american_soldiertype"] = "normandy";
    game["german_soldiertype"] = "normandy";
    
    setCvar("r_glowbloomintensity0", ".25");
    setCvar("r_glowbloomintensity1", ".25");
    setcvar("r_glowskybleedintensity0",".3") ;
    
    }
    
    _PrecacheFX()
    {
    	level._effect["mp_lmfao_blinking_diff_colors"]				= loadfx ("fx/fire/mp_lmfao_blinking_diff_colors.efx");
    	level._effect["mp_lmfao_blue_circle_5sec"]				= loadfx ("fx/fire/mp_lmfao_blue_circle_5sec.efx");
    	level._effect["mp_lmfao_cyan_smoke_40_sec"]				= loadfx ("fx/fire/mp_lmfao_cyan_smoke_40_sec.efx");
    	level._effect["mp_lmfao_flash_light_7sec_blue"]				= loadfx ("fx/fire/mp_lmfao_flash_light_7sec_blue.efx");
    	level._effect["mp_lmfao_flash_light_7sec_pink"]				= loadfx ("fx/fire/mp_lmfao_flash_light_7sec_pink.efx");
    	level._effect["mp_lmfao_flash_light_7sec_red"]				= loadfx ("fx/fire/mp_lmfao_flash_light_7sec_red.efx");
    	level._effect["mp_lmfao_flash_light_7sec_white"]			= loadfx ("fx/fire/mp_lmfao_flash_light_7sec_white.efx");
    	level._effect["mp_lmfao_flash_light_7sec_yellow"]			= loadfx ("fx/fire/mp_lmfao_flash_light_7sec_yellow.efx");
    	level._effect["mp_lmfao_green_smoke_40_sec"]				= loadfx ("fx/fire/mp_lmfao_green_smoke_40_sec.efx");
    	level._effect["mp_lmfao_pink_circle_5sec"]				= loadfx ("fx/fire/mp_lmfao_pink_circle_5sec.efx");
    	level._effect["mp_lmfao_red_circle_5sec"]				= loadfx ("fx/fire/mp_lmfao_red_circle_5sec.efx");
    	level._effect["mp_lmfao_white_circle_5sec"]				= loadfx ("fx/fire/mp_lmfao_white_circle_5sec.efx");
    	level._effect["mp_lmfao_yellow_circle_5sec"]				= loadfx ("fx/fire/mp_lmfao_yellow_circle_5sec.efx");
    }
    
    song1()
    {
    	music = getEnt("trigger_roll", "targetname");
    	while(1)
    	{
    	
    		music waittill("trigger");
    		musicStop();
    		musicPlay("song1");
    		wait 1;
    	}
    }
    
    song2()
    
    {
    	music = getEnt("trigger_bang", "targetname");
    	player = getent("player","classname");
    	while(1)
    	{
    		music waittill("trigger");
    		wait 26;
    		player iprintlnbold("Disco!");
    		musicStop();
    		musicPlay("song2");
    		
    		playfx ( level._effect["mp_lmfao_cyan_smoke_40_sec"], player.origin );
    		playfx ( level._effect["mp_lmfao_flash_light_7sec_blue"], player.origin );
    		playfx ( level._effect["mp_lmfao_flash_light_7sec_white"], player.origin );
    		wait 18;
    		
    		playfx ( level._effect["mp_lmfao_yellow_circle_5sec"], player.origin );
    		playfx ( level._effect["mp_lmfao_green_smoke_40_sec"], player.origin );
    		wait 5;
    		playfx ( level._effect["mp_lmfao_flash_light_7sec_yellow"], player.origin );
    		wait 7;
    		playfx ( level._effect["mp_lmfao_white_circle_5sec"], player.origin );
    		playfx ( level._effect["mp_lmfao_cyan_smoke_40_sec"], player.origin );
    		wait 34;
    		
    		playfx ( level._effect["mp_lmfao_blinking_diff_colors"], player.origin );
    		wait 10;
    		playfx ( level._effect["mp_lmfao_red_circle_5sec"], player.origin );
    		playfx ( level._effect["mp_lmfao_flash_light_7sec_red"], player.origin );
    		wait 5;
    		playfx ( level._effect["mp_lmfao_pink_circle_5sec"], player.origin );
    		playfx ( level._effect["mp_lmfao_flash_light_7sec_white"], player.origin );
    		wait 7;
    		playfx ( level._effect["mp_lmfao_flash_light_7sec_pink"], player.origin );
    		wait 7;
    		playfx ( level._effect["mp_lmfao_blue_circle_5sec"], player.origin );	
    		playfx ( level._effect["mp_lmfao_green_smoke_40_sec"], player.origin );
    		wait 10;
    		playfx ( level._effect["mp_lmfao_blinking_diff_colors"], player.origin );
    		wait 1;
    	}
    }
    Last edited by lovemakers; 30th July 2013 at 18:15.

  2. #2
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    113
    Thanks
    10
    Thanked 74 Times in 45 Posts
    What the hell it is????
    player = getent("player","classname");

    Use getEntArray(). And dont try to play the effects on all players, because the fps will fall to 0.

  3. #3
    ... connecting
    Join Date
    Jul 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    So I only have to change

    player = getent("player","classname");

    to

    player getEntArray("player", "classname");

    ?

  4. #4
    ... connecting
    Join Date
    Jul 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    So I only have to change

    player = getent("player","classname");

    to

    player getEntArray("player", "classname");

    ?

  5. #5
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    113
    Thanks
    10
    Thanked 74 Times in 45 Posts
    Yes, and you will get an array, NOT an object! But i think the simplest way if you change this line:
    music waittill("trigger");
    to this:
    music waittill("trigger", player);

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

    lovemakers (30th July 2013)

  7. #6
    ... connecting
    Join Date
    Jul 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Awesome, it works now!

    I just changed the music waittill("trigger"); to music waittill("trigger", player); and changed player = getent("player","classname"); to player getEntArray("player", "classname");

    Thank you randall!

  8. #7
    Private
    Join Date
    Jul 2013
    Posts
    14
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by lovemakers View Post
    I just changed the music waittill("trigger"); to music waittill("trigger", player); and changed player = getent("player","classname"); to player getEntArray("player", "classname");
    You definitely should gain a better understanding of coding - before coding. The latter change is not only unnecessary, it is wrong in general:
    Code:
    player getEntArray("player", "classname");
    This doesn't make sense at all. You'd better remove this line from your script and try to find out by yourself why it's wrong.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •