-
Content Count
530 -
Joined
-
Last visited
-
Medals
Everything posted by Zenophon
-
How complex is Arma 3's scripting language?
Zenophon replied to Cathrynn's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The AI are mainly driven by FSM's. http://community.bistudio.com/wiki/FSM I don't know how much experience you have with programming and AI, but the harassing behavior that you describe would not be simple to implement. As is stands, the AI sometimes struggle to take cover properly or apply any simple military tactic, and other times they can flank, take cover, and advance with suppressing fire very well. AI is one of the hardest parts of game development; making a computer imitate human behavior is extremely difficult. Why BIS has not borrowed some features from some of the good ArmA 2 AI mods is a mystery though. People who criticize the AI as stupid and helpless do not understand what an FSM is or why procedural AI is so difficult, nor do they see how much good AI code is already there. As to sqf itself, it is dependent upon the command API offered by the engine. If a command does not exist, for example 'unitVest' (which needs to be added), then accessing a unit's vest (as a container, not the classname) directly is impossible. Luckily there are a lot of very useful commands, and what you can do often comes down to your logic in looking at data from the game world. It would definitely be possible to make a function that forced the AI to take cover behind rocks, but there are many factors that you must consider for it to look remotely realistic. As kylania said, the proof of what can be done is out there. Scripts that control the AI are running parallel to AI FSM's, and often the AI will simply chose to obey the FSM over your script. Often a lot of time and effort is required to get the script working without issues and without 'fighting' the AI. The amount of micromanagement and level of awareness that you want also plays a large part. It is easy to order an AI group to flank, but harder to determine if and where they should throw a smoke grenade. -
How can i disband a group?
Zenophon replied to della36's topic in ARMA 3 - MISSION EDITING & SCRIPTING
With these: http://community.bistudio.com/wiki/nearestBuilding http://community.bistudio.com/wiki/buildingPos http://community.bistudio.com/wiki/move http://community.bistudio.com/wiki/setPosATL Not sure if you want to instantly teleport him or order him to move. The 'nearestBuilding' command causes my game to CTD on Altis, but maybe it will work for you (I am not using dev branch). -
Help Needed With Simple Script
Zenophon replied to Katash's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I assume that you need them to stop or keep moving any number of times. You would need to script two actions that appear exclusively and are visible to everyone in multiplayer. They need to switch for every player when one is called by a player. The action must then tell the vehicle to move or stop where the vehicle is local (the server I assume). This is not simple, but can be done fairly quickly. I would set up the init.sqf like this: AllPlayers = [...]; Fnc_AddStopAction = { LeadVehicle addAction ["Stop", Fnc_StopConvoy]; }; Fnc_AddMoveAction = { LeadVehicle addAction ["Move", fnc_MoveConvoy]; }; Fnc_RemoveAction = { private ["_object", "_actionID"]; _object = _this select 0; _actionID = _this select 1; _object removeAction _actionID; }; Fnc_Move = { private ["_group", "_destination"]; _group = _this select 0; _destination = _this select 1; _group commandMove _destination; }; Fnc_StopConvoy = { private ["_vehicle", "_actionID"]; _vehicle = _this select 0; _actionID = _this select 2; 0 = [[_vehicle, _actionID], "Fnc_RemoveAction", AllPlayers] call BIS_fnc_MP; 0 = [[_vehicle, _actionID], "Fnc_AddMoveAction", AllPlayers] call BIS_fnc_MP; { commandStop _x; } forEach (units group _vehicle); }; fnc_MoveConvoy = { private ["_vehicle", "_actionID"]; _vehicle = _this select 0; _actionID = _this select 2; 0 = [[_vehicle, _actionID], "Fnc_RemoveAction", AllPlayers] call BIS_fnc_MP; 0 = [[_vehicle, _actionID], "Fnc_AddStopAction", AllPlayers] call BIS_fnc_MP; 0 = [[(driver _vehicle), (getMarkerPos "mkConvoyDestination")], "Fnc_Move", _vehicle] call BIS_fnc_MP; }; 0 = [] call Fnc_AddStopAction; I assume that you have limited experience scripting, so this is what you need to get this working: a convoy with a lead vehicle named 'LeadVehicle', a marker where the convoy should go named 'mkConvoyDestination', and you must fill in the names of all of the players. You must also group all of the units in the convoy together and make sure they are not grouped with anything else. If you have all that, the functions should put the action on the vehicle from the start and handle everything. None of this is tested in multiplayer, but it looks to me like it should work fine so long as BIS_fnc_MP does its job. It works well in singleplayer, so there are not syntax errors. -
Optimizing Scripts for Multiplayer
Zenophon replied to Woodpeckersam's topic in ARMA 3 - MISSION EDITING & SCRIPTING
First, how are you testing this? With a dedicated server and client on one machine or with a local host and another client machine? To answer the questions in order: 1. Creating a constant is simply defining that value to be the same on all machines. All machines run the init.sqf. Therefore, you would simply declare your constant near the beginning of the init as a global variable and everyone would have that value. There is not need to Public Variable (PV) anything. 2. Did you save the mission to reload the description.ext? If yes, then I do not know what the problem is. I do not see anything wrong with the description.ext. 3. hintSilent 4. titleParam% is obsolete, params is what you would use: http://community.bistudio.com/wiki/Description.ext#params_2 5. All machines will run all code in the init (and in all functions called there and so on) unless you control who executes what. I am of the opinion that the server should do everything and that the clients should only do the minimum that is necessary, due to locality. For example, a spawning function should run only the server. Things that have global effect, like those BIS functions for respawn inventory and position, will automatically be sent over the network to clients. Only the server needs to call those functions, and everyone will see the effect. There are also functions and commands that only have local effect, or require that their arguments be local. In that case, you would have the server remotely execute the function or command on the client machine. For example, a countdown hint function. 6. http://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Respawn On to the code, there is no need to use PV unless you are updating data on the clients that they are actively accessing, or if you need the clients to execute a function. There is no need to use a global variable unless it is critical that other functions share the data. Also, I always thought that you could not PV a local variable, but apparently you can. In the init, I have added a line for JIP, and put everything that the server can do in the if-block. if !(isServer) then {waitUntil {!(isNull player)};}; waitUntil {BIS_fnc_init}; finishMissionInit; FNC_Timer = compileFinal preprocessFileLineNumbers "Scripts\Timer.sqf"; FNC_Groups = compileFinal preprocessFileLineNumbers "Scripts\Groups.sqf"; FNC_Waves = compileFinal preprocessFileLineNumbers "Waves.sqf"; Multiplier = 1.7; TimerDone = false; 0 setFog [1,0.019,100]; if (isServer) then { _waveCount = 30; _waveTypeMultiplier = 2; _waveSpawnDelay = 5; _timer = 30; 0 = [_waveCount, _waveTypeMultiplier, Multiplier, _waveSpawnDelay, _timer] spawn FNC_Waves; [west, "WEST1"] call BIS_fnc_addRespawnInventory; [west, "WEST2"] call BIS_fnc_addRespawnInventory; [west, "WEST3"] call BIS_fnc_addRespawnInventory; [west, "WEST4"] call BIS_fnc_addRespawnInventory; [west, getMarkerPos "Respawn1"] call BIS_fnc_addRespawnPosition; [west, getMarkerPos "Respawn2"] call BIS_fnc_addRespawnPosition; [west, getMarkerPos "Respawn3"] call BIS_fnc_addRespawnPosition; }; sleep 1; setViewDistance 1500; setTerrainGrid 40; You have described your mission, but not what the functions you posted are supposed to do. I am going to be honest and say that there are a lot of strange things and likely mistakes that are hard to decipher. I am going to assume that you want to spawn waves of enemies and show a timer to all the players that counts down until the next wave. Only the server should spawn the waves, and it would remotely execute the hint function on clients. Based upon that, I would write the scripts like this: #define Spawn_Multiplier 1.7 private ["_waveCount", "_waveTypeMultiplier", "_waveSpawnDelay", "_timer", "_spawnType", "_randomSquad", "_type", "_spawnMarkers", "_attackGroup", "_i", "_j"]; _waveCount = _this select 0; _waveTypeMultiplier = _this select 1; _waveSpawnDelay = _this select 2; _timer = _this select 3; For "_j" from 1 to _waveCount do { 0 = [[_timer], "FNC_Timer"] spawn BIS_fnc_MP; sleep _timer; hintSilent Format ["Wave %1 Commencing",_i]; sleep 5; for "_i" from 1 to (round (Spawn_Multiplier * Multiplier)) do { _spawnType = if (count _this > 2) then {_this select 2;} else {"infantry";}; if (_i < round (_waveCount / _waveTypeMultiplier + (Multiplier)) then {_spawnType = ["infantry"] call BIS_fnc_selectRandom;}; if (_i > round (_waveCount / _waveTypeMultiplier + (Multiplier / 0.5))) then {_spawnType = ["infantry","support"] call BIS_fnc_selectRandom;}; if (_i > round (_waveCount / _waveTypeMultiplier + (Multiplier / 0.4))) then {_spawnType = ["infantry","support","motorized"] call BIS_fnc_selectRandom;}; switch (_spawnType) do { case "infantry": { _randomSquad = ["OIA_InfSquad", "OIA_InfSquad_Weapons", "OIA_InfTeam", "OIA_InfTeam_AT"] call BIS_fnc_selectRandom; _type = "Infantry"; }; case "motorized": { _randomSquad = ["OIA_MotInf_AT", "OIA_MotInf_Team"] call BIS_fnc_selectRandom; }; case "support": { _randomSquad = ["OI_support_CLS", "OI_support_ENG", "OI_support_EOD"] call BIS_fnc_selectRandom; _type = "Support"; }; }; if (_spawnType == "motorized") then { _spawnMarkers = ["RoadSpawn1","RoadSpawn2","RoadSpawn3"] call BIS_fnc_selectRandom; _attackGroup = [(getMarkerPos _spawnMarkers), east, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Motorized_MTP" >> _randomSquad)] call BIS_fnc_spawnGroup; } else { _spawnMarkers = ["Spawn1","Spawn2","Spawn3","Spawn4","Spawn5","Spawn6","Spawn7","Spawn8"] call BIS_fnc_selectRandom; _attackGroup = [(getMarkerPos _spawnMarkers), east, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> _type >> _randomSquad)] call BIS_fnc_spawnGroup; }; 0 = [_attackGroup, (getMarkerPos "Defend"), 150] call CBA_fnc_taskAttack; _attackGroup allowFleeing false; sleep _waveSpawnDelay; }; waitUntil {sleep 2; !(Opfor_Present)}; }; if (true) exitWith {}; private ["_timer", "_i"]; _timer = _this select 0; for "_i" from _timer to 0 step -1 do { hintSilent format ["%1 Seconds left until next Wave", _i]; sleep 1; }; TimerDone = true; publicVariable "TimerDone"; sleep 5; TimerDone = false; publicVariable "TimerDone"; if (true) exitWith {}; Parameters and local variables are better than using global variables, as there is less to keep track of and less chance for hard-to-find bugs to occur. Also, you used a nested for loop that iterates over the same variable as the other for loop, and then a for loop that does not use the iterating variable when it should. Instead of 'exit', it should be 'if (true) exitWith {};' at the end of functions. There are some strange things about the multipliers and getting the number and type of enemies to spawn. If you explained what exactly you want in terms of probabilities, I could help with the math. I also renamed some of the variables and strings, and I moved some code around to avoid repeating it. All of this is untested, as I cannot test your mission, and there are probably typos etc. There are other functions and triggers running in your mission besides what you have posted there, so I cannot really determine if this will work. Consider this general advice and a different style of coding. To be clear, copying and pasting that code will probably not work. I also made some global variables local, as they do not need to be global based upon the code you posted. I am going to be honest and say that I do not know what will work with JIP and what will not. I suspect that the respawn inventory might not work for JIP clients, but they will be able to see the waves of enemies and the timer. You might want to consider using VAS for the inventory, as that would work well with JIP (at least it should). These are some good resources: http://community.bistudio.com/wiki/6thSense.eu:EG http://community.bistudio.com/wiki/Code_Optimisation -
Spawn enemy group that knows player position and hunts them down.
Zenophon replied to anthonyfromtheuk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Instead of creating the waypoint and setting all its properties, just spawn the group and use this command on them: http://community.bistudio.com/wiki/move If you want them to hunt down the enemy, try this: http://community.bistudio.com/wiki/setCombatMode That command probably works well with 'reveal' to make them go after a known enemy. A seek and destroy waypoint only makes them search in a small radius around the waypoint position and then stop and do nothing. -
set captive to false when i get out of a car after first trigger activated.
Zenophon replied to anthonyfromtheuk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It should be: (triggerActivated trig1) && !(BLU1 in car1) The ';' is not used in trigger conditions; it ends a statement. -
Need some help with resupplying vehicles on a timer
Zenophon replied to Rileyiri's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I would put this in the vehicle's init: 0 = this spawn { while {true} do { sleep 30; _this setVehicleAmmo 1; }; }; This is tested and working in the editor. You do not need to set the ammo to 0 first. You cannot use the 'sleep' command in an object's init, so you must spawn a separate thread for the loop. If you want to learn sqf, these pages deal with those concepts: http://community.bistudio.com/wiki/Control_Structures http://community.bistudio.com/wiki/spawn -
You could save the current weather state before skipping time, and then restore it using commands like: http://community.bistudio.com/wiki/overcast http://community.bistudio.com/wiki/setOvercast Also applies to fog, waves, rain, wind, and gusts.
-
Marker showing the direction the unit is facing or moving in real time
Zenophon replied to anthonyfromtheuk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Maybe these: http://community.bistudio.com/wiki/getDir http://community.bistudio.com/wiki/setMarkerDir Depending on the marker type you are using, you may also need to make it asymmetrical with this: http://community.bistudio.com/wiki/setMarkerSize -
CAS Helo Orbit Script Ideas
Zenophon replied to StrongHarm's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Polar coordinates are your friend: Zen_ExtendPosition = { /* Returns a position that is a variable distance and direction from a given position, angle is trigonometric Params: 1. Position, the center 2. Scalar, the distance in meters 3. Scalar, the angle in degrees Return: Position */ private ["_center","_distance","_phi", "_dx", "_dy"]; _center = _this select 0; _distance = _this select 1; _phi = _this select 2; _dx = _distance * (cos _phi); _dy = _distance * (sin _phi); [(_center select 0) + _dx, (_center select 1) + _dy, 0] }; You might also be interested in the notes on this page regarding finding 2d angles: http://community.bistudio.com/wiki/atan2 Also, when I said waypoints, I did not mean real waypoints, I meant this: http://community.bistudio.com/wiki/move -
CAS Helo Orbit Script Ideas
Zenophon replied to StrongHarm's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I assume that you that you want to do this entirely in a script and not with editor waypoints. There might be a way to do it easily in the editor, but I don't know about. Hopefully some else saves you from a lot of coding. Anyway, this is how I would approach it. You would need to generate positions around the center and use them as waypoints for the helicopter. The number of points, angle from the center, and order of points is determined by where the helicopter starts. If the target moves, you need to account for that and recalculate the orbit. You also need to keep the helicopter moving smoothly from one waypoint to the next without stopping. There has to be enough waypoints to make the path appear circular, but too many and you waste cpu time and will have more trouble making the helicopter move smoothly. You must also decide how many points you want to calculate in advance, based upon if the target is stationary or not. You could even go a step further and calculate an ellipse (or half of one rather) based upon the target having a constant velocity, thus keep the helicopter the same distance as it orbits a moving target. You must also consider if the helicopter will be facing the target, otherwise it cannot fire. You could even consider the terrain and make sure the gunner has a clear line-of-sight to the target. Finally, you need to be able to switch to orbiting a new target once one is destroyed. This last point makes me think that this is not possible in the editor. I think I made that sound more difficult than it is. It comes down to what features you want and if there any unforeseen problems in implementation. I do not know how much scripting experience you have, so if you do not have the inclination or ability to code all this (and you can't find another way), I can post some code to get you started. -
Need help wth a spawning script
Zenophon replied to JamesonD's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I could not think of what was wrong (it was working for me), so I started over and followed my own steps exactly. When renaming the functions, I forgot to tell you to change what function the ok button called when you click on it. In the description.ext, in class doodialog.controls (near the end), there are two lines (one in doodialog.controls.mylistbox and one in doodialog.controls.okbutton, lines 82 and 89) that look like these: onlbdblclick = "[] spawn doobuy"; ... onbuttonclick = "[] spawn doobuy"; 'doobuy' is no longer a function. Those lines should be changed to use 'BuyVehicle' like so: onlbdblclick = "[] spawn BuyVehicle"; .. onbuttonclick = "[] spawn BuyVehicle"; Sorry for missing that and causing confusion. -
Say function playing sound but not displaying text
Zenophon replied to Zombitch's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have got it working (in dev branch) using these steps: Make a new mission in the editor with two blufor soldiers exactly 100 meters apart. One is the player, the other named 'Y'. They are not grouped. In the description.ext, copy this: class CfgSounds { sounds[] = {Test}; class Test { name = "Test"; sound[] = {"Test.ogg", 1, 1}; titles[] = {0, "Test"}; }; }; In the debug console in game, execute this: Y say ["Test", 101]; Using 99 as the number does not work, and using 101 does, so the game is very strict about range. There is no 'test.ogg' file in the mission, so that cannot be an issue. I added a '0' in front of the string in the titles[] array, according to this guide: http://ofp.toadlife.net/downloads/tutorials/tutorial_sound/tutorial_sound.html Lastly, remember to save the mission every time you change the description.ext to reload it. -
Need help wth a spawning script
Zenophon replied to JamesonD's topic in ARMA 3 - MISSION EDITING & SCRIPTING
As much fun as it is to write complex scripts, having something that works is more fun. So I removed some parts so that I could get it working in a reasonable amount of time. I or someone else could add them back later if you really need them. I have got it working using these steps: Create an object (I used a laptop) and place this in its init field: this addAction ["Spawn Vehicle", "OpenVehicleDialog.sqf"]; this addEventHandler ["HandleDamage", {0}]; Then in the init.sqf, I have this: #define STORECFG(x) [x, gettext (configfile >> "CfgVehicles" >> x >> "displayName") + " (" + gettext (configFile >> "CfgFactionClasses" >> gettext (configfile >> "CfgVehicles" >> x >> "faction") >> "displayName") + ")", gettext (configfile >> "CfgVehicles" >> x >> "picture")] BuyArray = [ STORECFG("B_quadbike_01_f"), STORECFG("B_mrap_01_f") ]; BuyVehicle = { _lbdata = lbData [3002, lbCurSel 3002]; if (_lbdata == "") exitwith {[playerSide, "hq"] sidechat "No item selected"}; _item = BuyArray select (parseNumber _lbdata); _v = createVehicle [(_item select 0), (getPosATL player), [], 5, "NONE"]; closeDialog 3000; }; I have the script file "OpenVehicleDialog.sqf", with contents like so: if (dialog) exitwith {closeDialog 3000}; if !(createDialog "doodialog") exitwith {}; uiNamespace setVariable ["doolb", (finddisplay 3000 displayctrl 3002)]; private ["_i", "_index", "_item"]; for "_i" from 0 to (count BuyArray - 1) do { _item = BuyArray select _i; _index = (uiNamespace getVariable "doolb") lbAdd (_item select 1); (uiNamespace getVariable "doolb") lbSetData [_index, str _i]; (uiNamespace getVariable "doolb") lbSetPicture [_index, _item select 2]; }; lbSetCurSel [3002, 0]; The description.ext is the same, except in class doolistbox, I added this statement: colorDisabled[] = {0.95, 0.95, 0.95, 1}; This is tested and working well on dev branch. Changes include removing the factory entirely, altering and renaming the #define macro, changing classnames, and defining the buy function in the init. Also, I had to remove 'processInitCommands' from what was 'buy.sqf', as that is no longer a command. There is also a public variable called 'dooreveal' that I removed. If there is some multiplayer issue that required those statements, I suggest looking in this function to replace them: http://community.bistudio.com/wiki/BIS_fnc_MP I hope that was what you needed, good luck with your mission. -
Why do I keep losing control of my AI squad?
Zenophon replied to GregP's topic in ARMA 3 - BETA DISCUSSION
Are you sure that you are no longer in the squad, or that you are no longer in command? I have seen AI take command of the squad from you if they have a higher rank. I seems random when they decide to do it. Also the radio cannot be damaged. Regarding backspace, it does not show any conflicts when mapped to something in the control menu, so it seems like a permanent binding. I also cannot remap 0-9. -
This is a good guide on how to set it up: http://forums.bistudio.com/showthread.php?101421-OA-UnitCapture-amp-UnitPlay-Functions&p=1666316#post1666316 It is working for me when using this from the debug console: [player, 10] spawn BIS_fnc_UnitCapture; Using call instead of spawn does not work for me. I tested it in dev branch and was able to play back the captured data (after saving it to a variable) like so: [player, MoveData] spawn BIS_fnc_UnitPlay;
-
Basic hint script not working
Zenophon replied to ablueslime's topic in ARMA 3 - MISSION EDITING & SCRIPTING
What does 'not working' mean exactly? Is there an error? Nothing happens? I have replicated exactly what you describe exactly, and it works fine. You could try coping and pasting the contents of 'hint.sqf' into the debug console and executing it. You also do not need the waitUntil loop, and you could just use 'player' in the hint instead of defining '_me'. You could try defining and calling the function directly in the init like so: HintFunction = { hint format ["player: %1", player]; }; 0 = [] call HintFunction; -
Need help wth a spawning script
Zenophon replied to JamesonD's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you posted the script that was working, that would probably help. Anyway, you could try something simple like this: player addAction ["Spawn ATV", {createVehicle [(_this select 3), (getPosATL player), [], 5, "NONE"]}, "b_quadbike_01_f"]; Regarding a spawning script, you will have to be more specific. Otherwise, I can only suggest this: http://community.bistudio.com/wiki/BIS_fnc_spawnGroup -
Say function playing sound but not displaying text
Zenophon replied to Zombitch's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You could try: theCharacter say ["willEnableLightHouseSound", 15]; The '15' is the range in meters than the titles will be displayed. I do not know what the default is, so you might have been out of range. -
Objects being towed by Helicopters
Zenophon replied to thdman1511's topic in ARMA 3 - MISSION EDITING & SCRIPTING
As a very simple start you could try this: http://community.bistudio.com/wiki/attachTo That will not look very realistic though. I do not play wasteland, so I do not know exactly what you want it to look like. You could use actions for the pilot to attach the vehicle then release it. -
Enemy to attack players
Zenophon replied to Ice_Rhino's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You would need to loop through the targets of the helicopter and determine if a player is a target. You could try this: Zen_AIShareIntel = { /* Uses the given object's target list to guide the given array of groups towards the given array of objects, infinite loop Params: 1. Object, the source of intel 2. Array of objects, the targets 3. Array of groups, groups guided to the target Return: Null */ private ["_players", "_patrolGroups", "_target", "_heli"]; _heli = _this select 0; _players = _this select 1; _patrolGroups = _this select 2; while {true} do { { _target = _x select 4; if ((_target in _players) && {(((_heli knowsAbout _target) > 2) && (side _target != side _heli) && (_target isKindOf "Man") && (alive _target))}) then { { _x move getPosATL _target; _x reveal [_target, 3]; } forEach _patrolGroups; }; } forEach (_heli nearTargets 1000); sleep 2; }; }; You could declare that function in your init.sqf and call the function like so: 0 = [Heli, (units group player), [...]] spawn Zen_AIShareIntel; Obviously you need to fill in the correct arguments. I have not tested this function, but I have used this technique before and it has worked. Regarding a timer for AI attacking: waitUntil { sleep 2; time > X; }; _group move _position; Just spawn that loop somewhere. Again, you must fill in the correct values based upon your mission. You could also use a forEach loop like in the function to move multiple groups. -
How to enable spectator mode?
Zenophon replied to alleycat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I didn't get the memo about that feature; you learn something new everyday. Anyway, that page says it is enabled by default, so have you tested this and it is not working? To be sure, execute this statement somewhere: RscSpectator_allowFreeCam = true; -
How to enable spectator mode?
Zenophon replied to alleycat's topic in ARMA 3 - MISSION EDITING & SCRIPTING
To stop them from respawning: http://community.bistudio.com/wiki/description.ext#respawn The default spectator mode (bird/seagull) is not that amazing. You could probably search google for a spectator script and find something. -
Detecting use of first aid kit
Zenophon replied to celery's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You could find the animation that is played when healing, then try this: http://community.bistudio.com/wiki/Arma_3:_Event_Handlers#AnimChanged There might be multiple animations, but not too many. -
Random AI attacks that are controlled by the color of the marker
Zenophon replied to total's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I was thinking of sectors in general when I wrote that, my mistake. The correct variable is '_currentSector', sorry about the confusion. I was also wrong about BIS_fnc_taskPatrol generating waypoints only within the marker. I assumed that it always created waypoints around the given center (a reasonable assumption I think, from just reading the documentation). However, that is not the case. BIS_fnc_taskPatrol calls BIS_fnc_findSafePos to calculate the random waypoint positions. BIS_fnc_taskPatrol is using the last position it got from BIS_fnc_findSafePos as the argument for the center in the next call to BIS_fnc_findSafePos (it is in a for loop). That means that there is an unpredictable amount of drift from the center originally given in the arguments to BIS_fnc_taskPatrol. I do not agree with this design, but so it goes. Unfortunately, the only real solution to this is to create your own patrol function or find one that some else made. You could make the distance a very small number, thus decreasing the chances of the random drift going outside the marker, but you would then have very small patrol routes.