Fps lag with props_flamethrower


(-SSF-Sage) #1

Hi, i’m new to mapping and im working on my first map. I have a little problem. :frowning: I have 8 props_flamethrowers that are all the time firing. My probleme is that it drops me down by 250 fps. :´( I have tried target_delay and waits in every *king place i could figure out, to shoot with like 1 shot of flamer per 3 seconds. I tried to reduce the fpslag with the pulse, but couldnt get it pulsing. I dont know if that would have helped a lot! I put the flamers of and had no fps lag at all. Is there anyways to be able to keep them firing without fps lag? Btw i have them working with trigger_always (so they will work no matter what). If anybody could help me i would appreciate it! Sry for the bad english. :poke:


(Flippy) #2

To trigger them only once every 3 seconds for example i think you can use:


trigger shoot_fire
{
   wait 3000   //wait 3 secs
   alertentity flamethrower_targetname  //shoot fire
   trigger self shoot_fire   //re-trigger this, loop
}

Also, using props_flamethrower is not adviced. It’s merely a left-over of the old engine afaik and is not optimized for use and can be very buggy.
This is probably what’s causing the lag.


(-SSF-Sage) #3

Thx! I try it as soon as i figure out what to do with it. :? So i make a script file and name it samenamewiththemap.script and paste this script there. Then i put it in my pk3 at maps folder, or is it enough to put it only my wolfet’s folder (etmain/maps) while im testing it? Now is there something else i must do? I couldnt get it work with that only. Sorry for my noobish question but i tried to figure it out all night… :oops: Btw 99% of the brush and entity work done… :stuck_out_tongue:


(Flippy) #4

Basically that’s it, apart from some small things:

  • Create script file, and make sure it’s not called “.script.txt” when you save it.

  • Place the script file in etmain/maps for testing (same folder as your .map or .bsp file) and call it the same as your .bsp (or .map) file (except for the .script extension obviously)

  • In your map, add a “script_multiplayer” entity and give it the key “scriptname” with value “game_manager”. You ALWAYS need to add this entity if you want to have your script run.

  • Your script should start with the following:

game_manager
{
   spawn
   {
        //spawntime settings etc go in here
   }
}

The spawntime settings etc you can find in the script files for the original maps.

For the flamethrowers to work as well, you first need to place them in your map. Do not connect them with any target_delays or anything, only a info_notnull to aim them i guess.
Then give them a key “targetname” with value “flamethrower”.

Then you script could look like this:

game_manager
{
   spawn
   {
     //spawntime etc
     wait 300
     setstate flamethrower invisible
     trigger game_manager shoot_fire
   }

   trigger shoot_fire
   {
       wait 3000
       setstate flamethrower default
       wait 200
       setstatte flamethrower invisible
       trigger game_manager shoot_fire
    }
}

This will shoot your flamethrower for 200 milliseconds, once every 3 seconds.

If you don’t understand a clue of what im saying about the scripting, have a look at the stickies above and find Ifurita’s website which contains a very good scripting guide.


(-SSF-Sage) #5

Thanks for the help! After all they were too laggy so i deleted them. My map first beta is now released search at deception trickjump from the forums. :wink: