Search the Community
Showing results for tags 'agents'.
Found 6 results
-
Agents not moving to position on Dedicated Server
Majestic Madman posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've made attack dogs. Everything works on local hosts or singleplayer, but the agents won't move to a position when they're being create and directed on a dedicated server. Created a simple script for the sake of test: This runs in the init.sqf for testing so I get 2 dogs, one for the server and one for the client to observe the behaviour. The 3 move commands aren't required, but just showing that the server doesn't work with any of them mm_fnc_SpawnDog = { params ["_pos"]; // Variables ============================================================= _Class = "Alsatian_Random_F"; _Anim = "Dog_Sprint"; // Create Unit ============================================================= private _newDog = createAgent [_Class, _pos , [], 0, "NONE"]; _newDog setVariable ["BIS_fnc_animalBehaviour_disable", true]; _newDog setVariable [ "AgentObj" , _newDog , true ]; // Behaviour ======================================= _newDog playMoveNow _Anim; // Indicator ======================================= _Class = "Sign_Arrow_Green_F"; if ( isServer ) then { _Class = "Sign_Arrow_F" }; _Indicator = createVehicle [ _Class , getPos _NewDog , [] , 0 , "NONE" ]; _Indicator attachTo [ _NewDog , [ 0 , 0 , 2 ] ]; _newDog; }; Sleep 3; _Player = allPlayers select 0; MM_TestDog = [ _Player getRelPos [ 15 , 0 ] ] call mm_fnc_SpawnDog; WHile { True } do { _PlayerPos = getPos _Player; MM_TestDog setDestination [ _PlayerPos , "LEADER PLANNED", true]; MM_TestDog moveTo _PlayerPos; MM_TestDog doMove _PlayerPos; Sleep 5; }; The client dog (Green) starts running north (Expected Behaviour) then turns around and heads straight back to the client. The server dog (Red) keepings running north ( Spawns facing north, and setting the run animation keeps it moving indefeinelty ) but will never turn or re-direct. It also doesn't matter if I use an absolute position [ 0,0,0] , [ 10000 , 10000 , 0 ] etc. Edit: The server logs show that the server isn't actually applying the move commands, rather than it just being desync between client and server Server Side Logs: 11:50:51 Agent Destination Player: B Alpha 1-1:1 (Madman) REMOTE 11:50:51 Agent Spawn Pos: [7212.9,3036.77,0] 11:50:51 Agent Created: Agent 0x2c500180 11:50:51 Initiated Move From | To: [7212.9,3036.77,0] | [7212.9,3021.77,0.00143909] 11:50:51 Agent Position: [7212.9,3036.77,0] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 15 11:50:52 Agent Position: [7212.9,3038.36,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 16.5959 11:50:53 Agent Position: [7212.9,3041.58,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 19.8105 11:50:54 Agent Position: [7212.9,3045.15,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 23.3823 11:50:55 Agent Position: [7212.9,3048.72,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 26.9541 11:50:56 Agent Position: [7212.9,3052.29,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 30.5259 11:50:57 Agent Position: [7212.9,3055.86,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 34.0977 11:50:58 Agent Position: [7212.9,3060.15,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 38.3838 11:50:59 Agent Position: [7212.9,3063.72,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 41.9556 11:51:00 Agent Position: [7212.9,3067.29,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 45.5273 11:51:01 Agent Position: [7212.9,3070.87,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 49.0991 11:51:02 Agent Position: [7212.9,3074.44,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 52.6709 11:51:03 Agent Position: [7212.9,3078.01,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 56.2427 11:51:04 Agent Position: [7212.9,3081.58,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 59.8145 11:51:05 Agent Position: [7212.9,3085.15,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 63.3862 11:51:06 Agent Position: [7212.9,3088.72,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 66.958 11:51:07 Agent Position: [7212.9,3092.3,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 70.5298 11:51:08 Agent Position: [7212.9,3095.87,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 74.1016 11:51:09 Agent Position: [7212.9,3099.44,0.00143862] | Destination [7212.9,3021.77,0.00143909] | Distance From Destination: 77.6733-
- agents
- dedicated server
-
(and 1 more)
Tagged with:
-
Excluding certain vehicles from a list
chow86 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I want to disable the ability of civilian units to move within a certain trigger area when the player is also in this trigger area (as these units tend to do weird things/ be distracting/get themselves killed). However, I want to except from this two vehicles that are vital to the mission. The following script works to disable the AI of civilians when the player is in the area, and enable it when he is not. However, it doesn't work to except the two vehicles. The only theory I have got so far is that it is something to do with agents, but I am not sure how to handle these. while {planeattack==false} do { { if ((_x != offroad1) or (_x != offroad2) or (vehicle _x != offroad1) or (vehicle _x != offroad2) or (_x != driver1) or (_x != driver2)) then { if (canproceed==false) then { _x disableai "path"; } else { _x enableai "path"; }; }; } foreach civiliansindanger; sleep 4; }; offroad1 and offroad2 = the vehicles driver1 and driver2 = their drivers civiliansindanger = a repeating trigger of all civilians in the area canproceed = determined by 2 triggers. It's true if the player is out of the trigger area. Any help would be appreciated. -
I am working on turning @maxjoiner xenomorphs into agents so they can be faster, deadlier and also use up to 3 times less system resources! Later Max will be able to use this Agent Ai for his other mods such as the crocodile, the predator etc. @maxjoiner What I need to know is the name of the alien animations for: - Walking - Jogging - Running - Attacking - Any other relevant animation state.
-
hideObjectGlobal preventing Ai targeting... (WORKAROUND FOUND!)
LSValmont posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Agent dogs with an attached invisible unit so that other Ai can attack them... The problem is... as soon as I hide their models using hideObjectGlobal the Ai no longer targets them... as the below pic shows when unhidden the Ai shoots at them just fine. This is how I create the hidden agent: vVirtualEnemy = { params ["_unit"]; _ai = createAgent ["I_Survivor_F", [0,0,0], [], 0, "CAN_COLLIDE"]; _ai setFace ""; //hideObjectGlobal _ai; _ai disableAI "ALL"; //{_ai enableAI _x} forEach ["ANIM","TEAMSWITCH","CHECKVISIBLE"]; [_ai, "Acts_AidlPsitMstpSsurWnonDnon01"] remoteExec ["switchMove", 0]; _ai enableStamina false; _ai setUnitPos "MIDDLE"; _ai disablecollisionwith _unit; _unit disablecollisionwith _ai; _ai attachTo [_unit, [0,0,0]]; _unit setVariable ["_attAi", _ai, true]; _unit addEventHandler ["Killed", {deleteVehicle ((_this # 0) getVariable "_attAi")}]; //_ai forceSpeed 2; //_ai setAnimSpeedCoef 3; [_ai] join (group _unit); _ai addRating -100000; // Make sure is renegade! _ai allowdamage false; _ai setSpeaker "NoVoice"; _ai setSkill 0; }; How can I hide the virtual unit's models yet still be targeteable by other enemy ai?- 13 replies
-
- hideobjectglobal
- hideobject
-
(and 2 more)
Tagged with:
-
So with the latest release of Arma, and the new CIV modules, I wanted to look into further enhancing my mission MOD that populates CIV units. I'm thinking the AGENTs may help performance, but have a couple questions I don't know if would work in my mission design. In my mission, the CIVs play the following roles: 1. They have addactions in some cases 2. They have waypoints assigned to travel from building to building (for ambient affect) 3. They can be spawned as enemy threats 4. They play animations I know agent types have some limited functionality to them. I'm just not sure with the mentioned features, if Agents would really be the way to go for my MOD. In addition, i like the civilian behavior they added to the latest patch, but cannot find how i may implement that into my mission on the civilian units. Found the following, but not as simple as just adding it to the units INIT code...: _ID = _unit execFSM "A3\Modules_F_Tacops\Ambient\CivilianPresence\FSM\behavior.fsm"; Because of the roles above, I still need control over spawning and adding code to each unit, so using the modules, or scripting them would not work for me. Thanks for all your help as always.
-
So, I'm having some serious problems with agents. Objectives: 1. Spawn 200 fish near three markers 2. Have the fish roam freely about within around 100m of the marker. 3. Have fish visible on all clients simultaneously. I've tested performance, and there's no impact from the initial 600 fish that get generated... the problem I have is, they all swim north continuously, and no matter what I script in, the fish don't respond in any way. The monitor script then sees that there aren't 200 fish near the markers anymore, so spawns another 200 fish... For reference, these are both executed on the server only. /* filename: fn_generateFish.sqf Author: Stevo Description: Generates additional fish at server startup */ Private ["_fish","_markers","_fishIndex","_markerPos","_fishExist","_fishCount","_index","_type","_posDiff1","_posDiff2","_fishPos","_newFish"]; _fish = ["Salema_F","Ornate_random_F","Mackerel_F","Tuna_F","Mullet_F","CatShark_F","Turtle_F"]; _fishIndex = 6; _markers = ["m_fish_1","m_fish_2","m_fish_3"]; { _marker = _x; _markerPos = getMarkerPos _x; _fishExist = nearestObjects [_markerPos, _fish, 125, false]; _fishCount = count _fishExist; if (_fishCount < 200) then { while {_fishcount < 200} do { _index = round(random(_fishIndex)); _type = _fish select _index; _posDiff1 = round(random(25)); _posDiff2 = round(random(25)); if (round(random(1)) == 0) then { _posDiff1 = (_posDiff1 - _posDiff1) - _posDiff1; }; if (round(random(1)) == 0) then { _posDiff2 = (_posDiff2 - _posDiff2) - _posDiff2; }; _fishPos = [(_markerPos select 0) + _posDiff1, (_markerPos select 1) + _posDiff2, (_markerPos select 2) - 5]; _newfish = createAgent [_type, _fishPos,[],0,"NONE"]; _newFish setVariable ["BIS_fnc_animalBehaviour_disable",true]; _newFish disableAI "FSM"; _newFish setVariable ["home",_marker]; _newFish enableSimulation true; _newFish allowDamage true; _fishCount = _fishCount + 1; }; }; } forEach _markers; [] spawn life_fnc_monitorFish; /* filename: fn_monitorFish.sqf Author: Stevo Description: Recreates fish that have been "caught" in another location. */ Private ["_markers"]; _markers = ["m_fish_1","m_fish_2","m_fish_3"]; { [_x] spawn { Private ["_fish","_marker","_fishIndex","_markerPos","_fishExist","_fishCount","_index","_type","_posDiff1","_posDiff2","_fishPos","_newFish"]; _fish = ["Salema_F","Ornate_random_F","Mackerel_F","Tuna_F","Mullet_F","CatShark_F","Turtle_F"]; _fishIndex = 6; _marker = _this select 0; _markerPos = getMarkerPos _marker; while {true} do { sleep 600; _fishExist = nearestObjects [_markerPos, _fish, 125, false]; _fishCount = count _fishExist; if (_fishCount < 200) then { while {_fishcount < 200} do { _units = []; _index = round(random(_fishIndex)); _type = _fish select _index; _tooNear = true; while {_tooNear} do { _posDiff1 = round(random(100)); _posDiff2 = round(random(100)); if (round(random(1)) == 0) then { _posDiff1 = (_posDiff1 - _posDiff1) - _posDiff1; }; if (round(random(1)) == 0) then { _posDiff2 = (_posDiff2 - _posDiff2) - _posDiff2; }; _fishPos = [(_markerPos select 0) + _posDiff1, (_markerPos select 1) + _posDiff2, (_markerPos select 2) - 5]; { if (_x distance2D _fishPos < 20) then {_units pushBack _x;}; } forEach playableUnits; if (count _units != 0) then {_tooNear = true} else {_tooNear = false}; }; _newfish = createAgent [_type, _fishPos,[],0,"NONE"]; _newFish setVariable ["home",_marker]; _newFish enableSimulation true; _newFish allowDamage true; _fishCount = _fishCount + 1; }; }; }; }; } forEach _markers; while {true} do { { _marker = _x getVariable ["home","m_fish_1"]; _pos = [(getMarkerPos _marker) select 0,(getMarkerPos _marker) select 1,-1]; if (_x distance2D _pos > 100) then { _x MoveTo _pos; }; } forEach entities "Fish_Base_F"; sleep 10; };
- 1 reply
-
- ai movement
- agents
-
(and 2 more)
Tagged with: