Search the Community
Showing results for tags 'negative'.
Found 2 results
-
numbers [SOLVED] Dealing with 20 minus 60 should be positive 40
thy_ posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Is there a way to skip a conditional to avoid negative numbers? _balance expected: _A = 20; _B = 10; _balance = _A - _B; // results 10 _balance reality: 😅 _A = 20; _B = 60; _balance = _A - _B; // results -40 A lazy solution: _A = 20; _B = 60; _balance = 0; if ( _A > _B ) then { _balance = _A - _B } else { _balance = _B - _A }; // results 40 always Show me what you got... -
I propose a community project for this thread, BAD LUCK. Write a script snippet that applies a negative effect on the player character whenever the variable Badluck==1. Example Engine overheat EngineStallh = [] spawn { waitUntil { sleep 0.5; Badluck==1 && (getPos xPLANE) select 2 > 300 && speed xPLANE > 400 }; xPLANE engineON false; vehicle player setHit ["motor", 1]; sleep 40; hint "Try the engine again"; vehicle player setHit ["motor", 0]; sleep 4; hint "": }; It could be anything. A fog cloud suddenly obscuring a target, equipment lost to a hole in a sack or weapon jams. Anything that makes the player hiss and say, "Damn-it! Bad luck!". Submit your script snippets below and let's see what kind of mean, gnarly challenges we can come up with. It would be hilarious to spawn a tank on the player's head but not very useful in a real mission. Try to keep it useful-- but still clever and fair. One more example, //naked player if (Badluck==1 && getdammage player > 0) then { hint "Your uniform is tattered and fell off"; removeUniform player; sleep 120; player addUniform "U_C_poloshirt_salmon"; hint "You found some common clothes"; sleep 4; hint ""; };