-
Content Count
2231 -
Joined
-
Last visited
-
Medals
Everything posted by shuko
-
Thanks, this is exactly what I was looking for.
-
The code above does both, add and remove the action from all players. Well, technically it doesn't remove it, but just hides it. That's the beauty of the condition parameter, you can easily show and hide an action. example mission That IF in init.sqf is to initialize the variable which is used in the condition. It's put inside an IF just incase JIP joins after the alarm is fired.
-
Simple mission which might end up not being so easy after all. Two Force Recon groups are sent to capture a rebel commander. - 5 difficulty levels (selectable via parameter), which scales the amount of enemy and their skill levels. - Players' starting location is semi-random. - Respawn type is group. Steam Workshop Direct download Armaholic
-
I know you already found a solution. However, you didn't quite use the condition the way I meant. Below's how I would have done it. If you want to be clean and/or worry about performance, you can save the action ID to the player with setVariable and then remove the action after the alarm is fired with getVariable + removeAction. init.sqf if (isNil "evacuationStarted") then {evacuationStarted = false}; [] spawn { waituntil {evacuationStarted}; // do something when alarm is fired hint "run baby run!"; }; initPlayerLocal.sqf fnc_alarm = { evacuationStarted = true; publicVariable "evacuationStarted"; }; player addAction ["Alarm",fnc_alarm,[],7,true,true,"","[trg1, player] call BIS_fnc_inTrigger && !evacuationStarted"];
-
Old favorite from A2 that I've ported for A3 a long time ago already. People on Steam's Workshop seem to like it so I thought I'd share it here as well. Mission Overview A UH-80 Ghost Hawk (Jolly Green 28) was forced to land in enemy territory due to being damaged by ground fire. The JFC decided there was no time for a TRAP mission, so they have ordered a CSAR instead. Enemy forces are very likely to search for the crash site. Tasks CSAR: Your mission is a Combat Search and Rescue. Jolly Green 28 went down, at a location we haven't been able to confirm yet. Your task is to pick them up once they are located or they are able to radio in an extraction zone. Crash survivors: Your mission is to Escape and Evade (EE) the enemy, find an extraction zone and contact base with the location of it. Notes Crash site and enemies are random. Meant to be played with the least amount of UI cheating as possible (server settings). Obviously GPS would ruin the fun etc. There is no predefined extraction zone for the players need to find. You need at least one player in both groups to play this mission. Download Direct download Steam Workshop Armaholic
-
Passing Value outside isServer
shuko replied to Romanze's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Clicking Export to MP mission in editor already makes it a PBO and saves to mpmissions. I can't see how your way would be faster. ;) -
addAction ["Alarm",fnc_alarm,[],7,true,true,"","[alarmBell, player] call BIS_fnc_inTrigger"]; That way you dont need to add and remove the action every time player goes in and out of the trigger area.
-
I've never understood the need to add and remove, when it's so much easier to use the condition parameter of the addaction.
-
"call compile format" doesnt seem to work ?
shuko replied to kennychr's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Since it's just a loadout/gear script. Why not use the playerclass as a case in a switch-case instead? That would avoid dynamic variables. -
How to Disable looting/Looting gear from killed players
shuko replied to fortun's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Delete the item at the death. Re-add it at revive? -
Executing Eventhandler Globally
shuko replied to driftingnitro's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I don't know where you are running this, but give this a go: (_this select 0) addEventhandler ["Take",{ _unit = _this select 0; _container = _this select 1; _item = _this select 2; if(_container == desk) then { keys = true; publicvariable "keys"; }; } ]; In init.sqf initialize the variable, just to make sure. if (isnil "keys") then {keys = false}; In initServer.sqf start a thread to wait for the variable to be sent from player to the server. [] spawn { waituntil {keys}; // do something on server after keys have been obtained }; Once player picks up the keys, he will send the changed state of the variable via publicvariable to all players and server. Server will catch it with the waituntil. -
count objects in an array
shuko replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Could have told us that you have an array of strings and not objects (like in your example). :rolleyes: -
count objects in an array
shuko replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If they are objects, then based on what value should they be sorted by? -
Executing Eventhandler Globally
shuko replied to driftingnitro's topic in ARMA 3 - MISSION EDITING & SCRIPTING
publicVariable -
Yep https://community.bistudio.com/wiki/Initialization_Order
-
I'd say it doesn't matter, but I'm sure smarter people will correct me. That if isserver is/was done because initserver.sqf didnt exist.
-
Help with my hostage script
shuko replied to CptDezusa's topic in ARMA 3 - MISSION EDITING & SCRIPTING
foreach playableUnits -
The marker created when the task is given does not get deleted. Any Ideas? How are you creating the task and marker? Does this happen in editor, single player, hosted server or dedicated server?
-
This script just uses the BIS function directly, not much you can do to affect the outcome. In every case, it is very CPU heavy search function, especially if used with large areas. I added the feature, because someone really wanted it. However, I don't really like it or think it's fail-proof.
-
Fixed the links.
-
Random object placement spawning as set
shuko replied to redarmy's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Here's the A3 thread of that script: https://forums.bistudio.com/topic/154531-shk-moveobjects/ Here's how it works: -
How to remove prone for an AI?
shuko replied to commandercaleb's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Everyone go vote: http://feedback.arma3.com/view.php?id=15249 -
You need to name the units in the editor as well. However, I don't know what exactly you are trying to do, but having rigid system like that is not very elegant, and not exactly MP-proof. If all the slots are playable, what happens if one is an AI, JIP, or doesn't exists at all? Are you trying to add same action to all playable units?
-
If it needs to work in MP as well. Then make the server do the random and spawning. Client(s) should only "order" a mission from the server. Once a client orders and accepts a new mission, the server would either disable ordering until the current is done or for a predefined amount of time. Oh and that switch is not needed. execvm (["mission2.sqf","mission3.sqf","mission4.sqf","mission5.sqf"] call BIS_fnc_selectRandom);
-
init.sqf executed for jip
shuko replied to mr-blizzard's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Well, init.sqf is run when the "mission is first started"... for the JIP. ;) To "fix" it, you take it into account when scripting.