Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Inside the init.sqf add
Then create the squadReset.sqf inside the mission folder.
Add inside of squadReset.sqf
and why i dont use zeus is to avoid any possibilitis that i can see the enemy groups around my position, looking at balance aswell. And also if i enable zeus i might be tempted to use it, i use it when i test for more immediate changes.
Btw anyone know any good guides for arma 3 scripting, that handles arrays?
Here are some links (just for example):
https://community.bistudio.com/wiki/Array
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
I would also recommend using the scripting section in the official forums instead of this place.
Oh and I would also recommend getting the poseidon editor for scripting, If you haven't already.:
https://forums.bistudio.com/topic/155514-poseidon-advanced-text-editor-for-scripts-configs/
I use a trigger for each playable unit - repeatable;
Player is p1 - playable units are called p2,p3,pn etc.
Put the following into a script called ROSaistuck.sqf;
// Teleports AI that are stuck after they fall behind team leader (the human player) - p1 in this case.
// called via repeatable trigger cond. ie. p2 distance p1 > 150 && !isplayer p2
// nul = [p2] execvm "scripts\ROSaistuck.sqf";
_unit = _this select 0;
_tleader = leader (group _unit);
if ( !isnull _tleader
&& isPlayer _tleader
&& vehicle _tleader == _tleader
&& isTouchingGround _tleader
&& !isplayer _unit
&& isTouchingGround _unit
&& vehicle _unit == _unit )
then {
_dist = random -10;
_dir = direction _tleader;
_pos = getposATL _tleader;
_position = [(_pos select 0) + (sin _dir) * _dist, (_pos select 1) + (cos _dir) * _dist, 0];
_unit setPosATL [_position select 0, (_position select 1), _position select 2];
(group _tleader) setBehaviour "AWARE";
(group _tleader) setFormation "WEDGE";
_unit setUnitPos "up";
};
But i intend to try to make an unstuck script that would work only on the chosen soldier and just nudge him a few meters from his current position, and apply the command "joinsilent". This would work for my purpose, tend to have my Ai squadmates spread out at different positions to cover.
i have seen that the mod antistasi have this kind of unstuck function.
params ["_unit"];
if ( !isnull player && {vehicle player == player} && {isTouchingGround player} && {getPos player select 2 < 1} ) then {
_unit setPos (player getPos [random 10, direction player - 180]);
};
To setup create one trigger per playable unit in Eden editor. Doesn't matter that some units will be players - trigger cond and script doesn't run if unit == player. In this instance all units are named p1,p2,p3,p4..... with p1 the group leader and player (required position). Save the script into your scripts folder under your mission folder.
Example Trigger for p2: (make one for each playable unit)
Size: NA
Activation: Repeatable
Condition:
!isPlayer p2 && (p2 distance player) >= 150
Trigger: On Activation: (call the script)
null = [p2] execvm "scripts\ROSaistuck.sqf";
ie. you're calling the script for each AI unit via a separate trigger passing the unit name to the script. So edit trigger cond and activ above for each unit p2,p3,p4 ...etc
Create script in mission scripts folder and put this into it:
// AIstuck - by RickOShay
// Teleports AI to group leader that are stuck or fall behind
// Where units are named p1,p2,p3.... p1 is player and group leader
// called via repeatable trigger:
// condition: !isPlayer p2 && p2 distance leader p2 >= 150;
// activation: nul = [p2] execvm "scripts\ROSaistuck.sqf";
_unit = _this select 0;
_tleader = leader (group _unit);
if ( !isnull _tleader
&& isPlayer _tleader
&& vehicle _tleader == _tleader
&& isTouchingGround _tleader
&& !isplayer _unit
&& isTouchingGround _unit
&& vehicle _unit == _unit )
then {
_dist = random -10;
_dir = direction _tleader;
_pos = getposATL _tleader;
_position = [(_pos select 0) + (sin _dir) * _dist, (_pos select 1) + (cos _dir) * _dist, 0];
_unit setPosATL [_position select 0, (_position select 1), _position select 2];
(group _tleader) setBehaviour "AWARE";
(group _tleader) setFormation "WEDGE";
_unit setUnitPos "AUTO";
};
Set this at start of map:
BuggyStuck = 0;
Set this in a trigger that's activated once:
call{[] spawn {
_KphSpeed = (vectorMagnitude velocity HunterBuggy) * 3.6;
hint format ["HunterBuggy _KphSpeed = %1",_KphSpeed];
if ((StuckTimer < 8) && (_KphSpeed < 3) && (MountedBuggy)) then {
StuckTimer = StuckTimer + 1;
if (StuckTimer >= 8) then {
HunterBuggy setVelocity [0,0,20];
};
} else {
StuckTimer = 0;
};
sleep 1;
}}