Jump to content

Recommended Posts

2 hours ago, Grumpy Old Man said:

 

If you ask me there's no such thing as overpowered in terms of script performance /CPU time needed.

 

 

 

I get what you're saying BUT, and this might be what Saro meant, when you're in a team of one with life, job and mortgage on you as well as your beloved mission, sometimes the first bit of working code you bash out is good enough.

God, I sound maudlin!

 

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, Tankbuster said:

I get what you're saying BUT, and this might be what Saro meant, when you're in a team of one with life, job and mortgage on you as well as your beloved mission, sometimes the first bit of working code you bash out is good enough.

God, I sound maudlin!

 

Well said.

It always comes down to how much effort you put into it and how big the performance gain is.

 

Is it important to squeeze every last bit of performance out of a snippet that's being run only once during mission init? Couldn't care less!

Is it important to do the same for something that's time critical and being run every frame? Then you want to pull all the strings to make the snippet as performant as possible.

 

If you've optimized a few functions as far as possible then you know most of the tricks,

which saves time further down the line, because the next time you start writing something you already know the ropes, the do and don'ts.

 

Cheers

Share this post


Link to post
Share on other sites

Absolutely, finding the trade off is the trick.

1 minute ago, Grumpy Old Man said:

Well said.

It always comes down to how much effort you put into it and how big the performance gain is.

 

 

 

Absolutely. The trade off is the trick, for sure.

Personally, I'm wading through my mission looking where I can crowbar in some lazy evaluation.

Share this post


Link to post
Share on other sites

Hello everyone, I thank you all for helping me create script for a safe zone. Through the past few days I've tested several different scripts that were sent to me, but unfortunately, none of them were fully successful. Until now! Through the help of someone who has much experience and is very talented at coding, we were able to create a script for a safe zone that works 100%. Once again, thanks to everyone who participated in this thread.

 

Safe Zone Script:   (place in mission's init.sqf file) (create two markers labeled "blufor_safe_zone" & "opfor_safe_zone" (-quotations))

 

0 = [] spawn {
_safeZones = [["blufor_safe_zone", west], ["opfor_safe_zone", east]];
while {true} do {
{
_unit = _x;
_exit = true;
{
_unitSide = side _unit;
if(_unit inArea (_x select 0) && _unitSide isEqualTo (_x select 1) || _unitSide isEqualTo civilian) exitWith {
_exit = false;
_unit allowDamage false;
};
}forEach _safeZones;

if(_exit) then {
_unit allowDamage true;
};
}forEach (allUnits + vehicles);
sleep 1;
};
};

 

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

×