magicpanda
Member-
Content Count
160 -
Joined
-
Last visited
-
Medals
Everything posted by magicpanda
-
Timed checkpoints and saving Variables.
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I was wondering if anyone can help with Larrows awesome timer script he kindly donated. I've been trying for days to get it to run properly from an trigger with execVM so I can have multiple timed courses across the same map but I cant for the life of me make it work. Still very new to scripting. Init.sqf call compile preprocessFileLineNumbers "fnc_time.sqf"; lapOver = false; dnf = false; player setVariable ["bestLap",(3*60)]; player setVariable ["currentLap",0]; sleep 10; player addAction ["RESTART RACE", { dnf = true; sleep 0.5; lapOver = true; (vehicle player) setPosATL getMarkerPos "start"; player setDamage 0; (vehicle player) setDamage 0; (vehicle player) setDir -125; }]; while {true} do { _bestLap = player getVariable "bestLap"; _currentLap = player getVariable "currentLap"; hintSilent format["Current Time\n%1\n\nBest Time\n%2", [_currentLap] call fnc_formatTime, [_bestLap] call fnc_formatTime]; sleep 0.1; }; fnc_time.sqf fnc_formatTime = { _totalTime = _this select 0; _formatTime = ""; { _timeUnit = call compile format["floor (_totalTime %1 %2 60)", _x, "%"]; if (_timeUnit < 10) then { _timeUnit = format["0%1",_timeUnit]; } else { _timeunit = str _timeUnit }; _formatTime = (_formatTime + ":" + _timeUnit); }forEach ["/60/60","/60",""]; _formatTime }; fnc_time = { _competitor = _this select 0; _startTime = time; waitUntil {player setVariable ["currentLap", (time - _startTime)]; lapOver}; player sideChat "lap finished"; if (!dnf) then { _totalTime = (time - _startTime); lapOver = false; _bestTime = player getVariable "bestLap"; if ( _totalTime < _bestTime) then { player setVariable ["bestLap",_totalTime]; }; }; dnf = false; }; Start Trigger repeatable lapOver = false; handle = [(thislist select 0)] spawn fnc_time; player sidechat "starting lap"; Finish Trigger repeatable lapOver = true; player sidechat "lap over"; Cheers. -
Timed checkpoints and saving Variables.
magicpanda posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm trying to make an Arma Rally but Im having trouble saving best times due to the way I'm currently doing things. (by terminating scripts) 3 triggers. A Start and End and a Reset Trigger (for when you inevitably put your Sport Hatchback through a tree at 200+kph). Start Trigger BLUFOR present. ONACT: cd = execvm "countdown.sqf" End Trigger Blufor Present ONACT: terminate cd; hint format["You Completed the Race in %1 seconds",timer]; Reset Trigger Radio Alpha ON ACT: terminate cd; hint "Time Reset"; vehicle player setDamage 0; vehicle player setPos (getMarkerPos "carspawn"); vehicle player setDir 260; It these 2 scripts. Countdown.sqs //countdown.sqf originally by Palyamerc //nul = execvm "countdown.sqf" sleep 0.01; timer = 0; publicvariable "timer"; waitUntil {!isnil "timer"}; while {(timer >= 0)} do { hintSilent parsetext format ["<t size='1.5' align='center'>%1</t>",(timer / 3600) call compile loadfile "time.sqf"]; timer = timer + 1; publicvariable "timer";; sleep 1; }; timer = 320; hint "Fail"; exit; //publicvariable "newvariable"; and time.sqf _playtime = _this; _h = (_playtime-(_playtime % 1)); _m = ((_playtime % 1)*60)-((_playtime % 1)*60) % 1; _s = (((_playtime % 1)*3600)-((_playtime % 1)*3600) % 1) - (_m*60); _hh = ""; if (_h < 10) then {_hh = "0"}; _mm = ""; if (_m < 10) then {_mm = "0"}; _ss = ""; if (_s < 10) then {_ss = "0"}; _playtimeHMS = format ["%1%2:%3%4:%5%6",_hh,_h,_mm,_m,_ss,_s]; _playtimeHMS; What I really need to do is save the timer variable elsewhere before the reset so I can call it with another Radio Trigger which has player globalChat format ["My Best Time for this Course is %1 seconds", savedTime] Does that make sense? I'm close but it's not there yet and I've got so many great ideas for presenting the whole package (Strategic map for Courses etc) Here is the mission. Cheers, any help is greatly appreciated! https://dl.dropboxusercontent.com/u/8154556/games/arma3/ARMA_RALLY.Altis.zip It's easiest to start the timer then alt click the map near the end of the course. -
How do I Initialize a Module Site Unit - to be on the OpFor side?
magicpanda replied to netsend's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm not even going to ask :) I dont think you can easily. -
Making the MLRS fire at single target on a trigger
magicpanda replied to Yeti1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here ya go. http://community.bistudio.com/wiki/commandArtilleryFire -
What are the options for displaying Variables on screen other than via Hint
magicpanda posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
As in the title really. Been digging around for the last hour but nothing. Maybe im using the wrong search terms. I've got a timer that displays on screen via hint but I would like to show the finished times at the end of a mission really. What are the options? The ideal one would be via the task description once it's completed. -
What are the options for displaying Variables on screen other than via Hint
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I wonder, is there a way to get a variable into the on screen Ticker Tape text in the recent showcases? Here's the code. Bis_printText = { private["_blocks","_block","_blockCount","_blockNr","_blockArray","_blockText","_blockTextF","_blockTextF_","_blockFormat","_formats","_inputData","_processedTextF","_char","_cursorBlinks","_cursorInvis"]; _blockCount = count _this; _invisCursor = "<t color ='#00000000' shadow = '0'>_</t>"; //process the input data _blocks = []; _formats = []; { _inputData = _x; _block = [_inputData, 0, "", [""]] call BIS_fnc_param; _format = [_inputData, 1, "<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>", [""]] call BIS_fnc_param; //convert strings into array of chars _blockArray = toArray _block; {_blockArray set [_forEachIndex, toString [_x]]} forEach _blockArray; _blocks = _blocks + [_blockArray]; _formats = _formats + [_format]; } forEach _this; //do the printing _processedTextF = ""; { _blockArray = _x; _blockNr = _forEachIndex; _blockFormat = _formats select _blockNr; _blockText = ""; _blockTextF = ""; _blockTextF_ = ""; { _char = _x; _blockText = _blockText + _char; _blockTextF = format[_blockFormat, _blockText + _invisCursor]; _blockTextF_ = format[_blockFormat, _blockText + "_"]; //print the output [(_processedTextF + _blockTextF_), 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; playSound "click"; sleep 0.08; [(_processedTextF + _blockTextF), 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep 0.02; } forEach _blockArray; if (_blockNr + 1 < _blockCount) then { _cursorBlinks = 5; } else { _cursorBlinks = 15; }; for "_i" from 1 to _cursorBlinks do { [_processedTextF + _blockTextF_, 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep 0.08; [_processedTextF + _blockTextF, 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; sleep 0.02; }; //store finished block _processedTextF = _processedTextF + _blockTextF; } forEach _blocks; //clean the screen ["", 0, 0.15, 5, 0, 0, 90] spawn BIS_fnc_dynamicText; }; Bis_printSampleText = { [ ["TACTICAL BACON HQ","<t align = 'center' shadow = '1' size = '1.0'>%1</t><br/>"], ["0500, ALTIS","<t align = 'center' shadow = '1' size = '0.7'>%1</t><br/>"] ] spawn Bis_printText; }; -
Access to the Firing Drill Stopclock?
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Anyone know if there are any plans to release the module into the editor? -
Timed checkpoints and saving Variables.
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
We need access to the firing drill stuff, anyone know if there has been any mention of it? http://i.imgur.com/TI4MGrT.png (209 kB) Gold Silver Bronze all that sheeit. I unpacked one of the Firing Drill and there is a module which cant be accessed in the editor. Some functions in the functions viewer. All the actual drills seem to be run from config files and names triggers. :( -
Check out the All in arma mod
-
Timed checkpoints and saving Variables.
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hats off Larrow, that is outstanding. Thanks very much for your time. I'm currently calling it all from a Trigger and I'm assuming I can rename scripts and the variables and functions slightly for each race. -
What are the options for displaying Variables on screen other than via Hint
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Bit harsh as it pauses the game. Cheers though, will come in useful :) -
Cant get rid of smoke effect.
magicpanda replied to YattaYatta's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you only need it a short time, use the smokeshell it only burns for about 30 secs. -
What are the options for displaying Variables on screen other than via Hint
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks for the help guys I've actually got a half decent rally game up and running. http://cloud-2.steampowered.com/ugc/903259359329001613/022B94E8C5EB4DCEC5215C7D310F8502F7C50D23/ Need some help with it but that's another thread :D -
What are the options for displaying Variables on screen other than via Hint
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Nice, cheers. player sidechat format ["%1",_variable]; Any others? ---------- Post added at 09:26 PM ---------- Previous post was at 09:17 PM ---------- Thanks LordHeart, ctRsc looks like a deep rabbit hole so to speak. GUI generation is a bit out of my ballpark at the moment. -
Simple fire / smoke effect added by script ?
magicpanda replied to YattaYatta's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This will make most of the vehicles start pouring out smoke in the right places.You can play with the [0,0,-1]]; values to get it exact. For any vehicle the player is in: Put this in a Trigger act smoketheEngine = "SmokeShell" createVehicle (position vehicle player); smoketheEngine attachto [vehicle player, [0,0,-1]]; For a specific vehicle smoketheEngine = "SmokeShell" createVehicle (position vehiclename); smoketheEngine attachto [vehiclename, [0,0,-1]]; This is the whole thing I used for a Truck Breakdown. Causes a truck the player is driving to swerve off the road with no engine power. If you don't take a wheel out the Truck can just coast along under its own momentum. vehicle player setHit ["motor", 1]; vehicle player sethit ["wheel_2_2_steering", 1]; smokeEngine = "SmokeShell" createVehicle (position vehicle player); smokeEngine attachto [vehicle player, [0,0,-1]]; I'd love to know about how to add fire. -
Firing a trigger when a unit is between 2 heights
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is as small as it gets. getPosATL jet1 select 2 < 50 && speed jet1 > 500 && jet1 in thislist The higher the speed the bigger the trigger has to be. -
Firing a trigger when a unit is between 2 heights
magicpanda posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok I've had a look around and nearly all the threads deal with when a unit is above or below a certain height not both at the same time. Here's an example scenario to help with my explanation of the Subject line. Recreating the Top Gun Tower flyby. So we have our Area Logic linked to the tower ready to blow out the windows :) We need a trigger that fires when a jet is close to the tower and between 2 altittudes. I understand this will fire when something is in the trigger above 5 metres? (getPos ((list triggername) select 0) select 2) >= 5 We need an additional condition that would exclude anything above, say, 10 metres. I'm scratching my head as to how to make it work. Would getPosATL come into play somehow? -
Firing a trigger when a unit is between 2 heights
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've kind of got this working.. It's for a jet flying through the solar towers at over 500 kph. You just need to be in the Trigger below 50m at over 500kmh Me in jet3 Trigger, anybody present. Trigger on act found = false; {if (getPosATL _x select 2 < 50) then {found = true;};} forEach thisList; found && speed jet3 > 500 && jet3 IN thislist; hint "You did it" However... The smaller the trigger (less then 50 x 50 it needs to be about 5 x 5) and the trigger just doesn't fire. Is there any way of getting it more precise? Specifically the first part as it's looking for a bunch of objects rather than just jet3. I think I might going too fast for the in thislist to pick me up. :) -
I'm confused as to how to get the AI to use the m4 scorcher
magicpanda replied to TacoTuesday's topic in ARMA 3 - MISSION EDITING & SCRIPTING
These should sort you out. http://forums.bistudio.com/showthread.php?150180-Enemy-AI-using-artillery http://community.bistudio.com/wiki/commandArtilleryFire -
HowTo Find nearest Mines in set radius around player?
magicpanda replied to Von Quest's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Noticed these earlier today funnily enough. Any use? http://community.bistudio.com/wiki/revealMine http://community.bistudio.com/wiki/mineActive -
Firing a trigger when a unit is between 2 heights
magicpanda replied to magicpanda's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks, I want a trigger to fire when jet is flying at a specific (but not exact) altitude basically. -
Setting Direction of a objects
magicpanda replied to thdman1511's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Remove the underscores from __Post1 http://community.bistudio.com/wiki/Variables -
Ambient Radio Chatter
magicpanda replied to Clarkey1's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Where are these RadioAmbient things stored? Would a say3D system like this work? -
TPW HOUSELIGHTS A3: ambient house lighting for Altis/Stratis
magicpanda replied to tpw's topic in ARMA 3 - ADDONS & MODS: COMPLETE
Nice! Ambient Combat next? :p -
Its say3d isn't it? unit1 say3d "alarm"