Jump to content
Sign in to follow this  
banky

Best use of trigger?

Recommended Posts

I'm just wondering, what is the most efficient, less taxing way to have a ton of stuff happen at once with a trigger? Like I have five or six things I want to happen when something is destroyed. Is it best to put all the commands in the OnAct of the trigger, put them all in an .sqf and have the trigger call it, or maybe even use game logic to string the commands together? Is any one way going to use less resources than another to keep performance optimal?

Share this post


Link to post
Share on other sites
I'm just wondering, what is the most efficient, less taxing way to have a ton of stuff happen at once with a trigger? Like I have five or six things I want to happen when something is destroyed. Is it best to put all the commands in the OnAct of the trigger, put them all in an .sqf and have the trigger call it, or maybe even use game logic to string the commands together? Is any one way going to use less resources than another to keep performance optimal?

it depends on what that "things" re.. and if the trigger can be activated multiple times..

anyway... basically u should create your own function...

the native way to do so...

1. create .sqf file with your method and place it somewhere is your mission folder..

( missionFolder\scripts\banky\BN_fnc_functionName.sqf )

2. on mission initialization (init.sqf) compile the function

BN_fnc_functionName = compileFinal preprocessFileLineNumbers "scripts\banky\BN_fnc_functionName.sqf";

3. call or spawn your function with trigger

http://community.bistudio.com/wiki/Code_Optimisation

Edited by LoonyWarrior

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×