-
Content Count
711 -
Joined
-
Last visited
-
Medals
Everything posted by opusfmspol
-
Init code/script for AI to hunt the nearest player
opusfmspol replied to He'sCalledTheStig's topic in ARMA 3 - MISSION EDITING & SCRIPTING
See if this works for dedicated: if (isServer) then { _null = this spawn { Hunt_players_fnc = { _player = objNull; _players = +(allPlayers - (entities "HeadlessClient_F")); _distance = 100000; { if (alive _x && _x distance (Leader _this) < _distance) then { _distance = _x distance (Leader _this); _player = _x; }; } foreach _players; if !(isNull _player) then { _wp = (Group _this) addWaypoint [getPos _player, (50 + (floor(random 70)))]; _wp setWaypointStatements ["true","_null = this spawn Hunt_players_fnc;"]; _wp setWaypointType "SAD"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; }; }; _null = _this spawn Hunt_players_fnc; }; }; -
Need Help Adding a waypoint to the closest Enemy or Uncaptured Sector
opusfmspol replied to Blitzen88's topic in ARMA 3 - MISSION EDITING & SCRIPTING
_index = _sectors findIf { _x params[ "", "_sector" ]; _sectorOwner = _sector getVariable[ "owner", sideUnknown ]; _sectorOwner isEqualTo sideUnknown || _sectorOwner isEqualTo West }; //Find a flat position around the LZ marker & create an HPad there. _flatPos = [getPos ( _sectors select _index select 1 ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; Yeah, the _index findIf would return -1 as _index when Opfor or Independent holds all. You could test for that. If that's the case you could exit the script, if that's what you want to happen. if (_index < 0) exitWith {}; -
Dynamic AI Spawning *Dedicated server*
opusfmspol replied to razzored's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Checking "Server Only" is correct. Condition breaks it on dedi because Player is objNull on a dedicated server. Try using: ({_x In thisList} count AllPlayers > 0) as condition. -- edit: Also check the script for "player", that would have to target a _unit instead on dedi. -
_owner = objNull; {if (player distance (_x select 1) < 5) then {_owner = _x select 0};} forEach _Array; 5 is just suggestive radius for "inside a house". Houses will be bigger or smaller. Or use 1 or 0 if you want player right on the spot.
-
joinSilent on dedi server
opusfmspol replied to jo spanner's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try this: [_this select 0] joinSilent (Group (_this select 1)); -
Need Help Adding a waypoint to the closest Enemy or Uncaptured Sector
opusfmspol replied to Blitzen88's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Maybe an Order of Operations issue, maybe not? If so, I would think it should occur consistently. What it means is confusion might occur over which command to run first, when multiple commands are in an expression and precedence is not conditioned ( ). Example: _flatPos = [getPos ( _sectors select _index select 1 ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; // Could get run as: _flatPos = [getPos ( (_sectors select _index) select 1 ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; // or: _flatPos = [getPos ( _sectors select (_index select 1) ), 0, 550, 10, 0, 0.3, 0] call BIS_fnc_findSafePos; -
Init code/script for AI to hunt the nearest player
opusfmspol replied to He'sCalledTheStig's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try this: -
AI won't shoot with rockets on vehicle target.
opusfmspol replied to Euroworldnetworks Yun2k's topic in ARMA 3 - MISSION EDITING & SCRIPTING
addVehicle -
Are the set variables still available after an FSM has completed (reached end state)? I've never tested for that.
-
Not tested, but try this: _fsm setFSMVariable ["_handle", _fsm]; _fsm setFSMVariable ["_result", false]; and inside the running _fsm: _handle setFSMVariable ["_result", true];
-
When creating a scenario in A2's 3d Editor, two files get created, the mission.biedi and the mission.sqf. The setPlayable command can be seen used in the mission.sqf, when a unit is placed and set as playable. So maybe it's a deprecated editor-only command, or maybe it's usable only in 3DEN or 2D setup, I dunno.
-
Have you tried to use setFSMVariable ?
-
Whitelisting 'addAction'?
opusfmspol replied to BigSnek's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Condition for addAction is a "string", not {code}. And for a string inside the string (i.e., "whitePlayer"), you would use 'semiquotes' (i.e., 'whitePlayer'). -
How to make an enemy group spawn if you kill a civilian?
opusfmspol replied to quickdagger's topic in ARMA 3 - MISSION EDITING & SCRIPTING
From COS Armaholic page : -
object ignore script
opusfmspol replied to dan ling-yang's topic in ARMA 3 - MISSION EDITING & SCRIPTING
setVariable in the dead body objects, and modify the cleanup script to look for the variable. If nil or false, clean up but if found true don't clean up. Or modify the cleanup script to include an object blacklist to check, and add the bodies to the blacklist. Probably other ways also. -
HELP Check if any unit form a specified group is in the area
opusfmspol replied to Spriterfight's topic in ARMA 3 - MISSION EDITING & SCRIPTING
For trigger condition, count the living units of each group to see whether at least one from each group is in the trigger list, and when count is correct the condition returns true, else false. Example (not tested): grpsPresent = []; {if ({Alive _x && _x In thisList} Count (Units _x) > 0) then {grpsPresent pushBack _x};} forEach [grpTeam1,grpTeam2,grpTeam3,grpTeam4,grpTeam5]; Count grpsPresent >= 5 -
Keep waypoints after respawn
opusfmspol replied to SirBa5terD's topic in ARMA 3 - MISSION EDITING & SCRIPTING
1. Use a Respawn event handler. Don't use "player" for setVariable / getVariable, because the player object will change. Refer to _unit and _corpse as given in the example. 2. Waypoints are a group function, they belong to the group. When a team gets wiped out, the group is subject to getting deleted. Waypoints get deleted with the group. There are various ways to prevent this sort of thing happening. What kind of activation effects are you saying happened? -
If using the BIS_fnc_kbTell method, recommend you check the function in Function Viewer and review your params versus how they get used by the function. BIS_fnc_kbTell adds a lot of plumbing to what should often be a simple flush using kbTell. Best I've ever gotten from it, it helps in understanding what the "argumentArray" argumentValue (which is typically an empty code) might be for. I've never found anything else explaining the argumentValue. And if unaware, review Conversations page to ensure the description.ext and .bikb are set up correctly, since it includes comments the given video never mentioned. Haven't used BIS_fnc_kbTell that I can recall, so can't suggest more on that. As far as kbTell used directly per the original post, I just realized that in your script file was this: james kbTell [kerry, "briefing", "T1","SIDE"]; waitUntil { james kbWasSaid [kerry, "br1iefing", "T1", 5]}; A typo existed, you had James speaking from topic "briefing" but then wait for him to speak from topic "br1iefing". So the waitUntil would never be satisfied. Explains why you got first subtitle and nothing further. Also, using sleep or waitUntil with a kbTell conversation, you have to consider whether the conversation script is running in scheduled or unscheduled environment. Needs to run in scheduled environment where suspension (i.e., sleep or waitUntil) is allowed. BIS_fnc_kbTell page mentions it will spawn a new thread, which ensures its conversation handling doesn't run in unscheduled environment. Would think neither of those would explain the sound not playing though, so might also suggest to verify the given file paths to the sounds are correct.
-
Seems cfgMarkers is not listed on Description.ext page, so might not be one of the supported classes.
-
scope 0 is private. Needs to be scope 1 or 2.
-
1.98 Infected Characters, where?
opusfmspol replied to BRPVP's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Perhaps the DLC 'watermarks' appear when one doesn't have it? Couldn't say, since I do have Apex. -
Synchronizing units spawned via script to Editor placed Module
opusfmspol replied to EchoTwoZero's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try synchronizing both ways, each to the other: MODULENAME synchronizeObjectsAdd [vehicle1]; vehicle1 synchronizeObjectsAdd [MODULENAME]; -
1.98 Infected Characters, where?
opusfmspol replied to BRPVP's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Might be the units in the config viewer cfgVehicles who have "_sick" at end of their typename. They have config scope 1, which is protected access. -
Stringtable.xml problem
opusfmspol replied to Casio91Fin's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Assuming you have your mission's stringtable.xml set up correctly as per the examples given, and STR_CAS_Text1 is the correct Key ID given, the usage in the call should be: [allPlayers, ["task1"],[Localize "STR_CAS_Text1","Oreokastro",""],[4600,21400], true, 99, true, "attack", true] call BIS_fnc_taskCreate; $ is used when setting the string text in a config (e.g., Description.ext is a config). Running a script or scripted function, localize is used to get the string text. For a little more clarity, although BIS_fnc_taskCreate is a defined config function, its code is compiled from script and you're calling its code.