#arma3_scripting
1 messages · Page 4 of 1
ohh
hmm
I tried "AnimChanged"
yeah it's not working
the player is getting stuck on the animation
params ["_vehicle", "_caller", "_actionID"];
_caller setVariable ["repairing", true];
private _repairTime = 20;
private _repairDistance = _caller distance _vehicle;
[_vehicle, _caller, _repairDistance] spawn {
params ["_vehicle", "_caller", "_repairDistance"];
waitUntil { !(_caller getVariable "repairing") || { _caller distance _vehicle > (_repairDistance + 2) || { _caller distance _vehicle > 5 || { !(alive _caller) } } } };
_caller setVariable ["repairing", false];
};
_caller playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
_caller addEventHandler ["AnimDone", {
_caller = _this select 0;
if !(_caller getVariable "repairing") exitWith {
_caller removeEventHandler ["AnimDone", _thisEventHandler];
};
_caller playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
}];
for "_i" from 1 to 100 do {
if !(_caller getVariable "repairing") exitWith {
hintSilent "Repair Failed";
_caller switchMove (switch (currentWeapon _caller) do {
case "": {"AmovPknlMstpSnonWnonDnon"};
case primaryWeapon _caller: {"AmovPknlMstpSrasWrflDnon"};
case secondaryWeapon _caller: {"AmovPknlMstpSrasWlnrDnon"};
case handgunWeapon _caller: {"AmovPknlMstpSrasWpstDnon"};
case binocular _caller: {"AmovPknlMstpSoptWbinDnon"};
});
};
hintSilent ("Repairing: " + str _i + "%");
sleep (_repairTime / 100);
if (_i == 100) exitWith {
_vehicle setDamage 0;
hintSilent "Repair Finished";
_caller switchMove (switch (currentWeapon _caller) do {
case "": {"AmovPknlMstpSnonWnonDnon"};
case primaryWeapon _caller: {"AmovPknlMstpSrasWrflDnon"};
case secondaryWeapon _caller: {"AmovPknlMstpSrasWlnrDnon"};
case handgunWeapon _caller: {"AmovPknlMstpSrasWpstDnon"};
case binocular _caller: {"AmovPknlMstpSoptWbinDnon"};
});
};
};
_caller setVariable ["repairing", false];
player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
player addEventHandler ["AnimDone", {
player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
}];
```This code just doesnt work. The player gets stuck when the animation is over.
Aren't you running a finish animation on them at the end?
no...?
_caller switchMove (switch (currentWeapon _caller) do {
case "": {"AmovPknlMstpSnonWnonDnon"};
case primaryWeapon _caller: {"AmovPknlMstpSrasWrflDnon"};
case secondaryWeapon _caller: {"AmovPknlMstpSrasWlnrDnon"};
case handgunWeapon _caller: {"AmovPknlMstpSrasWpstDnon"};
case binocular _caller: {"AmovPknlMstpSoptWbinDnon"};
});
``` you mean this?
I don't know. I don't know of an animation reference. In our case we inherited the animation names from the old code so it wasn't a problem.
ok
You might wanna check Leopard's comment on the bottom here:
https://community.bistudio.com/wiki/switchMove
yep, that fixed it. thanks
what would be the best way to allow both respawn at custom position and take control of AI teammate at the same time? Currently, in my mission, when the player dies, the map is shown, and he can select a spawn point. But I don't know how to also allow taking control of an AI teammate when you die, since you can't set two respawn methods at the same time. Any ideas?
You'd probably need to make your own respawn UI.
Anybody know how i could edit the firewill ECM script to where you can't keep clicking the useraction when its active cause people can make like infinite ecms run at the same time
new ECM System
each aircraft has own ECM capability. default value is 50
ECM POD gives more ECM values.
*/
private _heli = _this select 0;
private _helitype = typeOf _heli;
private _ecm = "";
private _ecm_type = "internal";
private _jammer_c = 0;
private _ex_time = 120;
private _ex_cool = 60;
private _ex_value = 0;
private _ex_ecm_stat = 0;
private _ex_ecm_stat_stack = 0;
private _stat = getNumber (configFile >> "CfgVehicles" >> _helitype >> "AWS_ECM_STAT");
if(_stat == 0) then
{
_stat = 50;
};
_heli setVariable ["ECMJAMMER","no",true];
_pylon = GetPylonMagazines _heli;
_pylon_count = count _pylon;
for "_i" from 0 to _pylon_count-1 do
{
_mag = _pylon select _i;
_ecm = getNumber (configFile >> "CfgMagazines" >> _mag >> "AWS_ECMJAMMER");
if (_ecm == 1) then
{
_ecm_type = "external";
_jammer_c = _jammer_c + 1;
_ex_ecm_stat = getNumber (configFile >> "CfgMagazines" >> _mag >> "AWS_ECM_STAT");
_ex_ecm_stat_stack = _ex_ecm_stat_stack + _ex_ecm_stat;
};
};
private _ecm_vehicle_type = getText (configFile >> "CfgVehicles" >> _helitype >> "FIR_AWS_ECM");
if (_ecm_vehicle_type == "External") then
{
_ecm_type = "external";
private _ecm_vehicle_count = getNumber (configFile >> "CfgVehicles" >> _helitype >> "FIR_AWS_ECM_Count");
private _ecm_vehicle_stat = getNumber (configFile >> "CfgVehicles" >> _helitype >> "FIR_AWS_ECM_STAT");
_jammer_c = _ecm_vehicle_count;
_ex_ecm_stat_stack = _ex_ecm_stat_stack + (_ecm_vehicle_stat * _ecm_vehicle_count);
};
if (_stat > 90) then
{
_stat = 90;
};
_heli setVariable ["AWS_ECM_STAT",_stat,true];
_heli vehiclechat "SYSTEM : ECM JAMMER ON";
_ecmhandle = _heli addEventHandler ["incomingMissile", {[_this] execVM "\uh60\scripts\ECM.sqf"}];
if (_ecm_type == "external") then
{
_heli vehiclechat "SYSTEM : EXTERNAL ECM SYSTEM";
_ex_time = _ex_time + (10 *_jammer_c);
sleep _ex_time;
}
else
{
_heli vehiclechat "SYSTEM : INTERNAL ECM SYSTEM";
sleep 60;
};
_heli removeEventHandler ["incomingMissile", _ecmhandle];
if (_ecm_type == "external") then
{
_ex_cool = _ex_cool - (7 * _jammer_c);
_heli vehiclechat format ["SYSTEM : ECM IS OFF. STANDBY FOR RECHARGING in %1SEC",_ex_cool];
sleep _ex_cool;
}
else
{
_heli vehiclechat "SYSTEM : ECM IS OFF. STANDBY FOR RECHARGING in 40SEC";
sleep 40;
};
_heli setVariable ["ECMJAMMER","yes",true];
_heli vehiclechat "SYSTEM : ECM IS STANDBY.";```
i had to split it in half cause it was over 2000 characters
Use pastebin for bigger scripts
https://pastebin.pl/ or something (pastebin.com sucks now)
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
And you didn't post code that makes this one run, one that uses useraction
Very new to scripting here., just started learning yesterday. I'm trying to create a script that will edit a marker so that the text will read the minutes data from the systemTimeUTC array. This is what I have so far, hoping for someone to point me in the right direction.
_minutesUTC = (_timeUTC select 4);
if (triggerActivated cocaineField_markerTrigger) then
{
"marker_2" setMarkerText str(_minutesUTC);
"marker_2" setMarkerAlpha 1;
};```
Im executing in server side script, which checks players count, but hc is also included in 'allPlayers'. How can i remove hc from this array?
Probably by checking typeOf. HC should have its own special class am I right?
allUsers select {(getUserInfo _x select 7) == false}
Oh, completely forgot about it, wise
small problem, im using this script here ```[blackHawk] call ace_fastroping_fnc_deployAI;
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
[{isTouchingGround player}, {
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
}] call CBA_fnc_waitUntilAndExecute;``` however when the player hits the ground the cinema borders are still there and i cant move
[blackHawk] call ace_fastroping_fnc_deployAI;
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
waitUntil { isTouchingGround player};
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
and why u using ace function?
wdym
so i can get the player to rappel
its for a mission
heli flys over a certian zone, player gets rappeled, when they touch the ground ace interact should be re-enabled again and the cinema borders should dissapear
So it's not just the border then it's the input too
Try using Schaer's version of the code if you aren't already
Also tell where you're running the code from
alr
a trigger
also how do i make it wait before the trigger happens
so when the player is inside the area it waits like 3 seconds before the code executes
Put a sleep 3; at the beginning of the trigger code
alr thanks
Also report back if the new code works
im doing it now
The code is fairly simple so if it's still not working there's a good chance it's something else set up wrong and not the trigger code itself
yeah
just getting a bit fed up with arma 3 as ive spent so long on this one bit lol
i still have the rest of the mission to do, like putting down enemies and objectives
ok so
the rappeling works
but
sleep doesent, as it says that sleep isnt allowed in this context and the cinema borders still didnt disapear
Ah right forgot that trigger code is unscheduled
That would also explain why your waitUntil isn't working
ah i see
the old one the people on the ace discord gave me worked on its own with no other waypoints and no cutscene at the start but as soon as the cutscene was there it stopped working
which one, my code or the one schear gave me
Either but I'd go with schaer's as it doesn't use the unnecessary cba function
ah
No reason to use a cba function for waitUntil when its built in to begin with
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
waitUntil { isTouchingGround player};
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus; }``` would this be it?
@tough abyss
i put { at the start and the end
[] spawn {
sleep 3;
[blackHawk] call ace_fastroping_fnc_deployAI;
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
waitUntil { isTouchingGround player };
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
};
On mobile so you'll have to forgive the lack of formatting
ah
As in the code probably doesn't look pretty since I edited it on mobile
Won't matter though
You can't just paste it in like before?
Looks like it didn't copy the closing }
Ah my bad I missed it
I’ll try it when I get home as I’m going out now
Thanks for the help btw
I'm going to bed so I may not be available when you do
It should work now though
No problem
whats up with the weird use of https://community.bistudio.com/wiki/collisionDisabledWith
seems not feasible to find collision state between any two vehicles
you put in the target vehicle as an argument and it returns a single other vehicle
was hoping for something like _v1 collisionDisabledWith _v2
was midway thru writing nice script for this command, and realized how limited it is 😂
_v1 disableCollisionWith _v3;
_result = collisionDisabledWith _v1;
// return: [_v3,true]
// what happened to _v2?```
Each object can contain only 1 reference to the object it disabled collision with. Thus trying to disable collisions with multiple objects will overwrite object previously set for disable collision
https://community.bistudio.com/wiki/disableCollisionWith
dang i didnt see that , been awhile since checking that page
stack overflow is down, this means coding worldwide is now on hold
we even lost sqfbin 😢
it is? 
it works for me
Stack overflow's stack finally overflowed 
this one
Does anyone know off the top of their head how to return the ACE cargo for a box?
getVariable of some sort maybe?
What do you mean with return? You want to know how much cargo is possible/available? Or want to know what is in the cargo?
I got it nevermind
cursortarget getvariable "ace_arsenal_virtualitems"
used allVariables to find it
unfortunately I'm not sure how to return the ace arsenal object the player is interacting with
anyone able to help?
Im having some issues with playing a sound in game. I'm defining the sound in cfgSounds and then testing it with playSound, with the end goal being using it in ace ambient sounds module. No matter how I define it in cfgSounds in the description.ext nothing plays in game. I know the sound file is good becuase It plays when I use playSound3d and reference the entire path. Here is the description:
class CfgSounds
{
sounds[] = {};
class AngryCrowd
{
name = "AngryCrowd";
sound[] = {"\sound\AngryCrowd.ogg", 0,1};
titles[] = {};
};
class HorrorSound
{
name = "HorrorSound";
sound[] = {"\sound\HorrorSound.ogg", 0,1};
titles[] = {};
};
class Test1
{
name = "coords";
sound[] = {"\sound\invalidCoords.ogg", 0,1};
titles[] = {};
};
};
have you heard of our lord and saviour the wiki? 👼
https://community.bistudio.com/wiki/Description.ext#CfgSounds
// filename, volume, pitch, distance (optional)
if you're referencing the 0, it doesnt work if I put any number for volume. And yes ive read that wiki page lol
try 1, save the file, save the mission, then try again
(try removing the starting \ too perhaps)
Nothin
Folder structure has the "sound" Folder inside the mission root, with the sounds in it
aaand which one do you try to play, and how do you try to play it?
I've tried all 3, for the 3rd one I tried both the class name and "name". Im just executing it in the Extended Debug Console that comes up when you press esc. That code looks like this
playSound "AngryCrowd";```
try asking in ACE Discord perhaps
i have already and the script i was given didnt work, so someone on here adapted it so it should work and it still doesent
classname it should be
then wait or try and error more by yourself 🤷♂️
its also not a problem with ace its something else, what is supposed to happen is ace interact gets disabled, player rappels, as soon as they touch the ground cinema borders go away and ace interact re enables
but it doesent and the cinema borders and ace interact get disabled
¯_(ツ)_/¯
IDK anything about ACE
ACE Discord should know better
unless you run an obsolete version of ACE ofc
isTouchingGround can be buggy sometimes
they told me only to ask ace related questions and nothing to do with scripting
try ```sqf
0 spawn {
sleep 0.5;
playSound "AngryCrowd";
};
is there anything i can use instead
waitUntil { getPos player select 2 < 1 };
Try checking if atl is less than like 0.5
Or that
Ill try that in a sec Lou, thanks
where would i put this in the script i have already
shouldn't need to add a sleep for playSound
instead of the isTouchingGround, no?
ill give it a go
no, but I fear some Debug Console issue or whatever
just in case
[blackHawk] call ace_fastroping_fnc_deployAI;
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
waitUntil { getPos player select 2 < 1 };
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
};``` so this?
Frazzle where are you putting this code?
[] spawn {
[blackHawk] call ace_fastroping_fnc_deployAI;
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
waitUntil { sleep 0.1; getPos player select 2 < 1 };
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
};
```yeah
if it's leopard's or CBA's, playSound on its own is a reliable test for me, can't speak for anything else though
alr
nope still didnt work
still cant move when i hit the ground
how can I make this code work?
_display closeDisplay 1;
sleep 0.5;
(findDisplay 46) createDisplay "_display";
do I need waituntil displayclosed trickery?
is _display an actual resource name?
or are you just trying to "reopen" the display you closed?
reopen the display I closed
well, you have to create it the same way you created it originally, what you're trying will not work
i guess you can maybe fade it's controls if that's a possible alternative for you instead of closing it
#1127001 is the display code
use the actual resource name you opened it with
Its the ace arsenal display. I'm removing contents and want to "refresh" the display
I'm not opening the display with the script
@cedar cape try getPosATL instead of getPos
If it still doesn't work after that it must be ACE being weird because all of that code other than the ACE stuff is stupidly simple
alr
the ace stuff should be simple aswell
its just disabling user interactions so they cant cut the ropes mid rappel
Relatively to the other stuff it is not simple
Especially as it has a lot more going on in the background than, say, a simple waitUntil call
then you should find the display name from the config (or ACE repo on github)
its fine, I just did
_display closeDisplay 1;
sleep 0.1;
[_box, player] call ace_arsenal_fnc_openBox;
Nothin
remove the leading \
you can probably look more in depth into their source, i'm sure you could find some "refresh" functions, reopening entire arsenal might not be the best, all you though
nope still doesent work
doesnt help :(
you've set the volume to 0 :\
changed that aswell
currently looks like this
class CfgSounds
{
sounds[] = {};
class AngryCrowd
{
name = "AngryCrowd";
sound[] = {"sound\AngryCrowd.ogg", 1,1};
titles[] = {};
};
class HorrorSound
{
name = "HorrorSound";
sound[] = {"sound\HorrorSound.ogg", 1,1};
titles[] = {};
};
class Test1
{
name = "coords";
sound[] = {"sound\invalidCoords.ogg", 1,1};
titles[] = {};
};
};
say3D doesn't work either right?
have you closed the mission after updating description.ext?
This problem was handed off to me by a friend who was having the same issues, I cant figure it out
I have starting it again, ill try going back to the main menu
which eventhandler triggers for creating groundholders on the ground? I thought put would work?
put should work
Restarting mission didnt work either, the debug console says "NOID <no shape>" When I execute playSound "Test1";
@cedar cape Alright time to figure out if this is just ACE being stupid or not
ive asked on ace discord, still waiting for a response
lets try and figure it out here for now though
that function just switches disableUserInput on and off, error is probably elsewhere
Frazzle can you explain what exactly you want to happen?
bassicly
Are the sound files actually in a folder called sound inside the mission folder?
[] spawn {
[blackHawk] call ace_fastroping_fnc_deployAI;
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
waitUntil { sleep 0.1; getPosATL player select 2 < 1 };
hint "waitUntil finished successfully";
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
};
Try that
yes
If we don't see the hint then it's something with the condition
Otherwise something else is wrong, most likely with ACE
@copper raven Indeed I agree
Though going to make absolutely sure regardless
and they are really .ogg files, that were definitely properly converted to .ogg and not just by changing the file extension manually?
yup, one of the ones I was testing is right from the arma files
player gets to waypoint, ace interact is disabled, player rappels out of heli, when rappeling is finished and they are on the ground cinema border from the starting cutscene dissapears and ace interact is re-enabled and they can play the mission
alr
broken how?
it's not removing the item and is returning false
ill join one of the vcs and screenshare so you can see if im doing anything wrong
ooooooooooo
Cannot vc at the moment as I'm at work
Doubt but sure
As earlier versions of your code wouldn't have had that issue and still didn't work
that's not the issue
yeah
relational < has even lower precedence than select in that case 😄
something to look at
@cedar cape Best to just see if that hint works or not
I’m doing it now
I think I figured out my sounds issue, thanks for the help everyone. I believe the sound files are broken and a little error on my part prevented me from seeing that during testing
would this not work for uniforms?
No anything on units is not considered Cargo. Vehicles and ammo boxes are considered Cargo.
check the rpt to see what it's outputting
It just came back 
it works
@tough abyss what now
removeWeapon doesn't work either
One last thing you could try is putting a sleep 3; or something after the hint but it seems like a pretty cut-and-dry ACE issue to me
alr
no wait nvm, it deletes everything
indeed it does
ahh yeah i remember that, the only way to remove stuff like that seperately you literally have to remove everything and readd everything but what you want to "delete"
there's no mention of "uniform" in the removeItemCargo cba function
gonna relaunch arma and try it
A uniform is an item when added to a cargo object.
What are you trying to achieve? Might make it easier to find the correct function for you.
👍
I need help editing firewills ECM script i want it to be where you click the action then it goes away runs the ECM process then after its over and recharges you get the useraction back instead of being able to click it infinite about of times with multiple ECMs running
https://pastebin.com/05un5y2Q
{
displayName = "<t color='#ffa500'>AN/AAR-47 ECM ON</t>";
position = "pilotcontrol";
radius = 2;
condition = "alive this and (driver this == player or gunner this == player)";
statement = "[this] execVM ""\uh60\scripts\ECM_ON.sqf"";";
onlyforplayer = "False";
};```
thats the useraction
Is there an off action?
Probably not, just wondering
i saw in the script theres this in the beginning and this at the end _heli setVariable ["ECMJAMMER","true",true]; and _heli setVariable ["ECMJAMMER","true",true];
Is the script running itself again on incoming missile?
_ecmhandle = _heli addEventHandler ["incomingMissile", {[_this] execVM "\uh60\scripts\ECM.sqf"}];
does one of those need to be a false?
weeeeee 🥳
here is the script that is called to run
"yes" and "no"?
private _heliarray = _this select 0;
private _heli = _heliarray select 0;
private _enemyweapon = _heliarray select 1;
private _enemy = _heliarray select 2;
if (not alive _heli) exitWith {};
/*
new ECM system based on SensorsManagerComponent
if enemy missile has Active/PassiveRadarComponent, Missile will be jammed. if not, missile will be not jammed and warn to player for drop the flares.
*/
private _r = floor random 100;
private _stat = _heli getVariable ["AWS_ECM_STAT",50];
private _missile_sensor_list = (configProperties [configFile >> "cfgammo" >> _enemyweapon >> "Components" >> "SensorsManagerComponent" >> "Components", "isClass _x"]) apply {gettext (_x >> "componentType")};
private _missile_sensor_act = _missile_sensor_list find "ActiveRadarSensorComponent";
private _missile_sensor_pas = _missile_sensor_list find "PassiveRadarSensorComponent";
if (_missile_sensor_act >= 0 or _missile_sensor_pas >= 0) then
{
if (_r > _stat) exitWith {_heli vehiclechat "SYSTEM: JAMMING FAILED - DROP COUNTERMEASURE NOW!!";};
_mssl = nearestobject [_enemy, _enemyweapon];
waitUntil {_mssl distance _heli < 500};
_ewdir = getdir _mssl;
_ewdir = _ewdir - 180;
_mssl setdir _ewdir;
_heli vehiclechat "SYSTEM: MISSILE JAMMED";
deletevehicle _mssl;
}
else
{
_heli vehiclechat "SYSTEM: IR MSSL DETECTED - DROP COUNTERMEASURE NOW!!";
};
I think
condition = "alive this and (driver this == player or gunner this == player) and (this getVariable ['ECMJAMMER', 'yes'] == 'yes')";
will do the trick for you
in the UserActions
but should i do an on and off?
i just want to stop it where a player can't spam turn on the jammer
like if they try to click it again like make it check and be like "ecm already running"
This should have the action disappear when you press it
what does the yes yes do in the condition if he has true true?
There are delays in the script and once it reaches
_heli setVariable ["ECMJAMMER","yes",true];
line
it sets it to "yes" and "no" strings
true is MP broadcast flag
so your saying i should change the first line of setvariable which is _heli setVariable ["ECMJAMMER","no",true]; to _heli setVariable ["ECMJAMMER","yes",true];
this getVariable ['ECMJAMMER', 'yes'] == 'yes'
means to check if ECMJAMMER variable is equal to yes with yes being default if not set (script didn't run before)
No you shouldn't change anything, just try my condition
_heli setVariable ["ECMJAMMER","yes",true]; is also at the end of the script
Script sets this string flag already at the start and end of the script
"yes" probably means "yes, available"
bad idea to use strings for true/false flag, but I'm not offering to improve the script, just make it work as is
what i'm saying is is it setup correctly in the script like the first one is no and the last variable check is yes
Just use the condition I gave you, it should make it all work
Condition in the action config
ok i'll test it
And there you can add just
["ECHJAMMER",true,true]
and add in condition
this getVariable "ECHJAMMER"
And add that off
this
setVariable ["ECHJAMMER",false,true]
Script itself already sets ECMJAMMER variable to no in the beginning and yes once its done
just check it in condition
Okey
thank you so much it worked
👌
so to do an off do i just do condition = "alive this and (driver this == player or gunner this == player) and (this getVariable ['ECMJAMMER', 'no'] == 'no')";
No, script doesn't support it being turned off
ok
Won't work without modifying the script
i'll atleast try to tell firewill to add the condition to his useraction for it because thats a real problem that you can spam it
Is it possible to use _forEachIndex, or retrieve an index, with apply?
As apply is similar to JS map, or .NET LINQ Select, I'd like to use it to transform an array but also require the index.
Of course, I could use forEach. I'm just wondering if apply will also work in this case as it reads a bit less verbose.
… use foreach 😄
I was waiting for it 😂
Thank you
Hi all,
I'm trying to figure out if it's possible to make a mod that keeps the player's view level with the horizon in helicopter flight, possibly by tilting and rolling against the helicopter. I think it might provide better kinesthetic sense at the extremes: precise hovering and high angle / high speed / high altitude maneuvers.
I'm starting to get the idea that the answer is 'not really'. The wiki seems to suggest that the camera object is only used in cutscenes where player input is dismissed. My guess is that it also won't preserve the HUD. Would anyone know if that's correct?
The other approach I can think of is modding the behavior at the level of the helicopter. This also seems unfeasible.
Agreed, wish there was _applyIndex and _selectIndex, constantly finding myself needing the index when doing applys and selects
private _milCarLocations = [
[//Area/Location
2.75, //Count modifier
[[1703.59,5007.7,-0.000293255],216.15], //Position and direction
[[1867.74,5571,-0.000293255],118.081],
[[1909.58,5798.86,-0.000277996],92.4968],
[[2026.64,5266.28,-0.000293255],282.165],
[[2077.57,5489.16,-1.28746e-005],190.73],
[[2103.14,5734.3,0.00021553],25.1],
[[2115.67,5881.79,7.34329e-005],283.724],
[[2147.01,5357.28,-0.000211716],193.983],
[[2177.71,5723.84,-0.000293255],192.282],
[[2265.93,5776.85,-8.44002e-005],101.199]
],
[
0.625,
[[4342.61,3876.16,-0.000305176],282.69],
[[4365.64,3751.7,0.00434875],140.78],
[[4384.76,3818.31,0.00698853],357.376]
],
[
0.625,
[[6407.38,5389.96,-0.000181675],220.869],
[[6484.69,5358.4,-0.0099287],137.236],
[[6592.03,5327.42,-0.000579834],65.1515]
],
];
private _milCars = [
"B_LSV_01_unarmed_F", 2,
"O_T_LSV_02_unarmed_black_F", 2,
"B_Quadbike_01_F", 1
];
{
_location = _x;
for "_i" from 1 to (1 + (_location deleteAt 0)) do {
_posAndDir = selectRandom _location;
_location deleteAt (_location find _posAndDir);
_posAndDir params ["_position", "_direction"];
private _carType = selectRandomWeighted _milCars;
private _car = createVehicle [_carType, _position];
_car setDir _direction;
};
} forEach _milCarLocations;
```I'm trying to use this script to randomly spawn vehicles in some places, but no vehicles are being created. I'm not sure what the problem is, can anyone tell?
],
];
USE SQFBIN, IT'S BACK! 😄
_posAndDir = selectRandom _location;
_location deleteAt (_location find _posAndDir);
why? generate a random number and use it in the deleteAt
thanks, but that's actually not the issue. I trimmed the massive array that I had down to post in here.
and your "count modifier" doesn't make a lot of sense, it won't round, so for the last two in your array, you are always looping once
oh, I forgot to round. let me fix that
_posAndDir = _location deleteAt (floor (random (count _location)));
```like this?
use floor and remove the -1
Hey, im trying to get a car with a bunch of AI civilians driving around the mission AO while blasting some music on a loop
in a MP coop
what's the best way of making this happen?
i've been messing around with remoteExec'ing a while loop with say3D and sleep <song duration>
however there's some issues with the song looping again before its finished, resulting in two songs playing at the same time
the exact code is while { alive datsun1 } do { datsun1 say3D ["01bashar", 500, 1, false, 0];uiSleep 215;};
which is then remoteExec'd in a regular "civilian present" trigger
if you're using it in a trigger, why remote exec?
don't make it server only
for the issue, you need to store a state if sound is playing right now or no, preferably, get/setVariable
Could also just use a sound source so it loops automatically
Then delete the sound source when the object dies
i tried using playSound3D but the sound didnt follow the car
can your trigger be reactivated?
it's not set to be repeatable if that's what you mean
then remove the remote exec and the issue should be fixed
ok, and i assume instead i'd just put the code into the init field of the trig?
activation field you mean
yes
alright i'll give it a go when i have the moment
thank you very much for the advice 🙂
appreciate it
private _milCarLocations = [
[//Location
1 + round random 0.625, //Count modifier
[[4342.61,3876.16,-0.000305176],282.69], //Position and direction
[[4365.64,3751.7,0.00434875],140.78],
[[4384.76,3818.31,0.00698853],357.376]
],
[
1 + round random 0.625,
[[6407.38,5389.96,-0.000181675],220.869],
[[6484.69,5358.4,-0.0099287],137.236],
[[6592.03,5327.42,-0.000579834],65.1515]
],
[
1,
[[4898.18,5888.98,0.0282898],18.8506],
[[5022.66,5905.18,0.000427246],321.174]
],
[
1 + round random 0.625,
[[3261.8,2907.89,-6.10352e-005],124.623],
[[3283.09,2930.63,-0.000305176],332.484],
[[3336.28,2896.5,-0.00233459],91.6926],
[[3386.77,2995.05,0.0181274],253.161]
],
[
1,
[[1920.55,3561.64,0.00286341],201.366],
[[1971.29,3527.46,-0.000224829],89.3082]
],
[
1,
[[2985.41,1871.83,-0.000335693],193.987]
],
];
private _milCars = [
"B_LSV_01_unarmed_F", 2,
"O_T_LSV_02_unarmed_black_F", 2,
"B_Quadbike_01_F", 1
];
{
_location = _x;
for "_i" from 1 to (_location deleteAt 0) do {
_posAndDir = _location deleteAt (floor (random (count _location)));
_posAndDir params ["_position", "_direction"];
private _carType = selectRandomWeighted _milCars;
private _car = createVehicle [_carType, _position];
_car setDir _direction;
};
} forEach _milCarLocations;
```Okay, so this is my updated code, and still no cars...
Oh my
I can say I certainly can't recommend selecting randomly using deleteAt whilst also iterating over the array you're deleting from
also, https://sqfbin.com/ is still back
it's not iterating over the array that's being deleted
No it's not but the sub arrays are being altered
round random 0.625 what is this 😄
the script most likely doesn't do anything afterwards, the _milCarLocations is always redefined when this is called, i see no issue here
Just bad practice, arrays should be immutable while iterating ideally
it is though, the one that is actually "being iterated" over
the for loop is just randomly picking elements, not iterating over anything
Just don't think it's good to be deleting elements out of the sub-arrays even if the parent array is the one being iterated, feel free to disagree
It's not the core issue anyways
if you didn't want to delete them out of subarrays, you either have to do a deep copy, or have something that tracks what has been selected so far, so it's a waste of perf
I would say 12.5% chance for having 2 instead of 1 
actually it's not 12.5% due to the distribution of the bell curve, but anyway it's something like that
anyway, I don't see anything wrong either
unless the positions are wrong
@copper raven Indeed, I meant moreso that I think there's a cleaner way to do it overall rather than maintaining the current structure without deleteAt
Curious that it isn't working though
(there is no bell curve with this syntax?)
Pretty sure random follows bell curve regardless
well whatever random uses then 
But dunno what psuedoRNG system random is using
the code should work, do player setPosATL getPosATL _car; after you create it, it should put you right next to it
Also keep in mind createVehicle with that syntax expects ATL positioning
yeah
is this the issue? Is it skipping anything?
No it's not the issue
it was supposed to be a 25% chance of there being 2 instead of 1, but I realized it was incorrect and was too lazy to change it actually I think it's correct
oh my god
guess what guys
turns out I actually wasn't running the script
🤪
or```sqf
selectRandom [1, 1, 1, 2];
yeah or that
yeah, that 😄
I have the following text:
/*
Description:
This is the multiline
description.
Includes:
None
Included by:
- TER_VASS\addons\3den\Cfg3den.hpp
*/
``` what is the correct regex to capture
This is the multiline
description.
(can be python regex or sqf regex)
discard, found the solution, will post shortly
(?<=Description:\n)(?:^\t.*$\n)+
i already know that \n is going to bite me in the ass with needing \r\n on Windows
I had something like that yeah Description:(.*?)^[^\s]
or you can regex all line returns to \n for the time being ^^
$input = preg_replace('/(\r\n|\r[^\n])$/m', "\n", $input);
```straight from SQF Highlighter
i am still wondering if regex will ever be replaced
this syntax is just horrible to read and understand
it's lovely and everyone should know it ❤️
(I removed the m modifier from it btw)
Not that it's particularly needed but this website is a godsend for working with and/or learning RegEx and I recommend it to everyone
https://regexr.com/
I use regex101.com, but I encounter more regexr subscribers indeed!
It's just the first one I used (and continue to use) so it left an impression on me :P
does anyone know why this might not be working?
player allowDamage false;
I have this in initPlayerLocal after waitUntil { !isNull player } and I am still taking fall damage
mods
other scripts then.
I don't use allowDamage anywhere else
you don't run the script once more then 🙃
and this was working fine yesterday, I don't know what I changed
nah it's initPlayerLocal lol, the rest of it is running
respawn on start
nope
¯_(ツ)_/¯
no respawn
check it runs with a systemChat or something
ok
should be your first reflexxx
[] spawn {
sleep 5;
systemChat str isDamageAllowed player;
};
``` This is printing "false" and I am still dying to fall damage
don't fall then 😂
Hey ya all, I am back for some questions, sadly not simple enough this time and. And maybe slightly offtopic, but can't think of a better channel for them.
This thing happened two weeks ago and this week again (it's a event played once every week).
The server crashed with simple Array index out of range in the server logs, even 4 times.
Any idea what could have caused it? It was pretty heavily modded, but I am not sure if to look into mods (sqf parts), extensions, mission file.
This did not happen last week, so there's one mod I am thinking about that was the same for those two and wasn't in last week, but I checked it and all "array ops" it does is with in, so I don't know where else to look, as it could be anywhere.
TLDR - Array index out of range in rpt of the server, where should I start looking for the culprit? What can cause this to be in the rpt?
are aircraft carriers special or something?
some event handler, other than that you'll have to check what you changed
Since Arma 3 v1.56 arrays are limited to maximum of 9,999,999 (sometimes 10,000,000) elements
Even with the 170 players there were two weeks ago, I highly doubt anything could have gone over 10mil.
This week, it was around 110 iirc.
Also after server restart two weeks ago, we managed to finish the mission, only with slight (read really big) desync at the start.
This week, it crashed even faster (during 5 min warmup/freezetime) the second time (first time it crashed after like 8 minutes or so)
Array index out of range
are you sure it is related to the crash and not just a script error?
nope, it's one-life mission, so everything was as new as it get's
all three times, this is one of the last things inside the rpt
then #server_admins
SQF array index out of range gives you a divide by zero anyway
so yeah, server issue
player addEventHandler ["HandleDamage", {
params ["_player", "", "_damage", "_source"];
switch (true) do {
case ((vehicle _player) isKindOf "Car" && (isNull _source || _source isEqualTo _player)): { (_damage / 3) };
case ((vehicle _player) isKindOf "Steerable_Parachute_F" && (isNull _source || _source isEqualTo _player)): { 0 };
};
}];
```would this be what was causing the bug?
^
would this be what was causing the bug?
remove it and try?
That's the thing, what if it was caused by an extension. Using ACE, TFAR, (really old) OCAP and custom stats addon (the whole extension is in try-catch, so I highly doubt it would be it).
Main thing I wanted to try to find out here is where to look. Scripts, mods, or something else. If anyone knows what could cause Array index out of range to be inside the logs.
Dedmen might but he probably won't tell you :P
see https://forums.bohemia.net/forums/topic/92506-array-index-out-of-range/ scripting-side
Yeah, that would be really appreciated if he could. Makes me wanna join BI, take a look, fix it, leave 
if you said the mods might have extensions, it could be the extension crashing the game aswell
I was mainly hoping to see, if someone experienced this before.
I am afraid I might need to start creating a big test-suite trying to figure out what could cause it
Of that I am aware, hence why (my) stats plugin has the entire extension inside
try {
} catch (...) {
}
And the others, TFAR, ACE and OCAP were being used for a long time. (Mine for only ~two months), but this started to happen recently
maybe it's related to the output size, are you aware of that?
an extension can only return a certain buffer length, if you write more than that, the game crashes, but i'm not sure if this is the same error, just guessing 😄
For the extensions, into the output char*?
yea
I am just returning whatever it was called with. I am not checking it, but it is never longer than ~60 chars 
yeah, nvm then, that's fine
Apparently trying to make a >10m entry array just throws Error Max array size would be reached
into the RPT? 
sure, if you enabled logging.
Various wildly bad indexes just throw Error Zero divisor
but no Array index out of bounds...
Sometimes, I miss C++ compiler errors (hope at least someone get's the joke)
I'm not 100% on whether this is what's getting past allowDamage false, but this itself will not do what it's supposed to.
The _damage variable returned by handleDamage is the total damage state of the selection after the new damage is applied (if the original incoming damage isn't overridden in the EH). So let's say your player has 0.2 damage, then receives 0.3 damage. _damage would be 0.5. And that's what you're dividing by 3 in the EH. In that case, it would result in the player ending up with 0.17 damage - less than they started with!
If you want to reduce only the incoming damage, you need to getHit the affected selection to return the pre-impact state, and compare it to the new damage value to determine the delta (_damageAmount = _damage - _oldDamage), and then operate on that. (And then add your modified value back on to oldDamage before you return it)
Also when the other case returns 0, that means setting the selection's damage to 0, meaning a guaranteed full heal, not just blocking damage
ohhhhh thank you
that is really helpful
I had no clue
I have respawn timer hidden in my mission, but I can't find out how I did it 
Anybody remembers how its done?
Talking about default respawn timer you see below the scoreboard when you die in MP
Could be the result of a COUNTER respawn template or setPlayerRespawnTime
anyone know why this script isnt working? ```[] spawn {
[blackHawk] call ace_fastroping_fnc_deployAI;
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
waitUntil { sleep 0.1; getPosATL player select 2 < 1 };
hint "hint";
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
showCinemaBorder false;
};
vague
still stuck on that eh
respawn=3;
respawnDelay=2e6;
Setting low\high setPlayerRespawnTime doesn't do anything, just displays minuses instead of time
Somehow I managed to hide the actual counter and I can't remember how
i feel like it works
i tried it in a test world
with only that and when im finished i can move
and use ace interact
i think its the cinema borders causing the problem
Why is your respawnDelay 2e6 
Gotta punish the player for dying somehow 
Just kidding, I just manually trigger the respawn when needed with setPlayerRespawnTime 0 later
hm
@cedar cape Perhaps, why not just try a test without the borders?
I dug up the source code for that ace disable inputs function you're using
thats the thing
/*
* Author: Glowbal * Disables the user input. Works stacked. *
* Arguments:
* 0: id
* 1: disable
* * Return Value:
* None
* * Example:
*["id", true] call ace_common_fnc_setDisableUserInputStatus
* * Public: Yes
*/
params [["_id", "#", [""]], ["_disable", false, [false]]];
if (isNil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then {
GVAR(DISABLE_USER_INPUT_COLLECTION) = [];
};
if (_disable) then {
GVAR(DISABLE_USER_INPUT_COLLECTION) pushBack _id;
[true] call FUNC(disableUserInput);
} else {
GVAR(DISABLE_USER_INPUT_COLLECTION) = GVAR(DISABLE_USER_INPUT_COLLECTION) - [_id];
if (GVAR(DISABLE_USER_INPUT_COLLECTION) isEqualTo []) then {
[false] call FUNC(disableUserInput);
};
};
seems like it shouldn't be breaking
using the original script
with cinema borders true, they dont enable in the first place
like that script on its own
what I mean is just rip out the borders entirely
narrow the problem down to just the ace code
[] spawn {
[blackHawk] call ace_fastroping_fnc_deployAI;
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
waitUntil { sleep 0.1; getPosATL player select 2 < 1 };
hint "hint";
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
};
try just that ^
if it still doesn't work then something is going wrong with ace_common_fnc_setDisableUserInputStatus
alr
seems like "Show respawn counter" flag in the attributes is that?
in the "Rulesets" list
nope it works fine
hint plays, ace interact is enabled again
its a problem with the cinema borders not ace i would say
Okay
what i could do is disable the cinema borders when the player is flying to the mission area
but if i did do that they could shoot out the heli and use keybinds
and break the mission and stuff
I don't see why you are so worried about using the cinema borders and the ace disable interact
borders themselves don't do anything to input it's entirely visual
True, it must be some mission.sqm setting
true, but for ace interact they could cut the ropes mid rappel which would break the mission
Is that not blocked with ace_common_fnc_setDisableUserInputStatus?
just having cinema borders wouldn't stop it either
respawnDialog=0; probably
it is i think
so im not sure whats going on
alright how about this
this script here [] spawn { [blackHawk] call ace_fastroping_fnc_deployAI; ["cutscene", true] call ace_common_fnc_setDisableUserInputStatus; waitUntil { sleep 0.1; getPosATL player select 2 < 1 }; hint "hint"; ["cutscene", false] call ace_common_fnc_setDisableUserInputStatus; }; works fine
so does the old one
idk
that you want the borders?
yeah
idk if this is the issue
but
the trigger goes all the way down to the ground so when the player has finished rappeling they are still inside the trigger zone
Is the trigger set to allow multiple activations?
whereas on all of the test missions the trigger doesent touch the ground and is only on the heli
no it isnt
shouldn't be an issue then
but it might be the issue, unlikley but thats the only thing that has changed
how about this
right where you're doing
showCinemaBorder true;
add
disableUserInput true;
afterwards
oh, how do i love the Eden "CustomAttributes" structure. It seems to include a string with value="Counter" when the counter is enabled 🤦♂️
and then change your trigger code to
[] spawn {
[blackHawk] call ace_fastroping_fnc_deployAI;
waitUntil { sleep 0.1; getPosATL player select 2 < 1 };
hint "hint";
disableUserInput false;
showCinemaBorder false;
};
alr
this is already in the init, ill add disable user input
Oh, so having nothing there disables it
Forces drawing of cinema borders when using custom camera camCreate.
does it even work without a custom camera? Doesn't seem to in my editor
Yes I meant add it after since it's already there
yep
honestly I'm not sure, that could frankly be the issue
@cedar cape have the borders ever worked?
does that cutscene use a separate camera from when you rappel
wdym
starting one?
yes
dont think so
blackhawk engineOn true;
[blackhawk, parseSimpleArray loadFile "data.txt"] spawn BIS_fnc_unitPlay;
cutText ["","BLACK FADED"];
waitUntil {!isNull findDisplay 46};
cutText ["","BLACK IN"];
[0,0,false] spawn BIS_fnc_cinemaBorder;
player1 switchMove "Acts_welcomeOnHUB01_PlayerWalk_5";
_EH = player1 addEventHandler ["AnimStateChanged", {
params ["_unit"];
_unit switchMove "Acts_welcomeOnHUB01_PlayerWalk_5";
}];
while {player1 distance2D blackhawk >= 5} do {
_dir = getPosWorld player1 vectorFromTo getPosWorld blackhawk;
_dir set [2, 0];
_dir = vectorNormalized _dir;
player1 setVectorDirAndUp [_dir, [0,0,1]];
sleep 0.1;
};
player1 removeEventHandler ["AnimStateChanged", _EH];
_cam = "camera" camCreate (blackhawk modelToWorld [5, 5, 0]);
_cam attachTo [player1, [0.2, 0, 0.05], "head", true];
player1 switchMove "GetInHelicopterCargoRfl";
player1 action ["GetInCargo", blackhawk];
while {!(player1 in blackhawk)} do {
sleep 0.1;
};
switchCamera player1;
camDestroy _cam;```
thats the starting one
so the cutscene is using a custom camera
_cam = "camera" camCreate (blackhawk modelToWorld [5, 5, 0]);
^ that's a custom camera
oh ok
that's why the borders work
borders only work with a custom camera, not player cam, apparently
_cam is not the player's cam
[0,0,false] spawn BIS_fnc_cinemaBorder; doesn't seem to have anything to do with showCinemaBorder, though
honestly I can't even tell what's going on because I never see _cam even being switched to now that I'm looking more closely
yeah you're also spawning BIS_fnc_cinemaBorder which is supposed to be called
which I don't get because you should just be using showCinemaBorder anyways
[0,0,false] spawn BIS_fnc_cinemaBorder; is disabled by [1,0,false] spawn BIS_fnc_cinemaBorder; 🤷♂️
the yt vid i was watching said to use spawn
ooooo
i can try that
Dunno, wiki says to use call so I'm relaying that
oh, wow, looks like hax. BIS_fnc_cinemaBorder does use showCinemaBorder but also manually creates the border with ("BIS_fnc_cinemaBorder" call BIS_fnc_rscLayer) cutRsc ["RscCinemaBorder", "PLAIN"]; (and destroys it with ("BIS_fnc_cinemaBorder" call BIS_fnc_rscLayer) cutText ["", "PLAIN"];) on top of other magic
Would explain why trying to disable it with normal showCinemaBorder doesn't work at least
yep
im gonna use [1,0,false] spawn BIS_fnc_cinemaBorder; instead and see if it works
ono
i cant close mission now
and return to eden
o shit
so i just use [] spawn { [blackHawk] call ace_fastroping_fnc_deployAI; ["cutscene", true] call ace_common_fnc_setDisableUserInputStatus; waitUntil { sleep 0.1; getPosATL player select 2 < 1 }; hint "waitUntil finished successfully"; showCinemaBorder false; ["cutscene", false] call ace_common_fnc_setDisableUserInputStatus; }; and replace the showcinemaborder with the other one?
LETS FUCKING GO
IT WORKED
LETS GO
WOWOWOWOOWEWSO=DW
POG
Let's not spam.
What is the practical usage of if (isServer) then when I am doing a MP mission.
If you want to execute something that has to done only in server, that's the usage. Some script commands needs to be executed in server side
Do I have to use it if saying like, I am enabling an AI's simulation with a trigger?
Yes that would crash, but thats not a script error, thats a engine error which.. indeed will force crash itself after printing it
No thats wrong
Just report the crash with crash dumps on feedback tracker, like the Arma launcher already tells you if it detects a crash.
its not
Will do once I get them. The server admin is on holidays and noone else has access to the files itself, only RPT through web interface.
But thank you for confirming my hunch, that this isn't normal and isn't something I can easily find and fix. Saved me some time and tears.
morning, stupid question if I want to group songs in 'folders' with my mod will this work?
class CfgMusic
{
odd[] =
{
title, oddOne,
};
veryOdd[] =
{
title1, title2,
};
};
class CfgMusicClasses
{
class songs
{
displayName = "some music";
};
};
no.
ehhh
what is "group song in folders"?
group song in folder?
as in if I create a folder structure it will reflect on zeus GUI?
I do not think you can
does Zeus have music directories?
so, it seems you can
It gives me this error File: music\config.cpp, line 21: /CfgMusic/: o encountered instead of { Here you have the code. #include BIS_AddonInfo.hpp class CfgPatches { class WWII { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {}; }; class Prueba { units[] = {}; weapons[] =...
something like
class CfgMusicClasses
{
class DirClassName { displayName = "Directory Display Name"; };
};
class CfgMusic
{
class MyMusic
{
name = "Music Display Name";
sound[] = { "\music\path.ogg", 1, 1 };
duration = "123";
musicClass = "DirClassName";
};
appreciated!
and it is a mod thing indeed - there is no such thing in Vanilla (though I wished)
music player in Zeus?
enemyUnits = ["TK_INS_Soldier_EP1","TK_INS_Soldier_Sniper_EP1","TK_INS_Warlord_EP1","TK_INS_Soldier_4_EP1","TK_INS_Soldier_MG_EP1"];
enemySpawnPnt = ["marker_1","marker_2","marker_3","marker_4"];
_i = count enemyUnits;
_j = count enemySpawnPnt;
infantryNumbers = 0;
while{true} do {
while{infantryNumbers < 15} do {
enemyUnits[random _i] createUnit [getMarkerPos enemySpawnPnt[random _j], enemyGroup];
infantryNumbers = infantryNumbers + 1;
};
_wp = enemyGroup addWaypoint [getPos player, 10];
sleep 30;
};```
I keep getting "missing ;" error on line 11 :(( what im doing wrong?
enemyUnits[random _i] createUnit [getMarkerPos enemySpawnPnt[random _j], enemyGroup];
on this line 👆
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
a sometimes wise man once said
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
Yes, I want to spawn randomly type of soldiers in an array
enemySpawnPnt[random _j] is not how you select random 🙂
I used getPos 🥺

selectRandom enemySpawnPnt 😉
Doesn't random integer gives random number 🤔
enemySpawnPnt[random _j] is not a syntax in SQF
here you are setting enemySpawnPnt then creating an array [random _j]
- Use
selectto get an element of an array - Indeed as Lou says you'll just need to use
selectRandomin order to get a random element of an array
plus it would be floor random _i
Oooh I see, thanks :D
Also, try not to use global variable too often. Use _ prefix to make your variable alive only in your script
wait, @fading magnet, A2OA or A3?
https://community.bistudio.com/wiki/Variables
Some references
Arma 2 oa
Ooh
so no selectRandom for you
Isn't BIS_fnc_selectRandom a thing already there?
Array select random length works?
Speaking of, I don't really know how select behaves if I throw a number like 1.3
Random gives out an integer right?
*A number, there is no int or scalar but only number
Which is basically equivalent of scalar
Use floor, ceil or round to make it a natural number
Ohh thanks 😊
private ["_group", "_classes", "_spawnPoints", "_i", "_j", "_amount"];
_group = createGroup east;
_classes = ["TK_INS_Soldier_EP1", "TK_INS_Soldier_Sniper_EP1", "TK_INS_Warlord_EP1", "TK_INS_Soldier_4_EP1", "TK_INS_Soldier_MG_EP1"];
_spawnPoints = ["marker_1", "marker_2", "marker_3", "marker_4"];
_i = count _classes;
_j = count _spawnPoints;
_amount = 15;
for "_i" from 0 to _amount -1 do
{
_classes select floor random _i createUnit [getMarkerPos (_spawnPoints select floor random _j), _group];
};
[group player, _group, 30, 10] spawn BIS_fnc_stalk;
```@fading magnet 😉
If index has decimal places it gets rounded down for fractions less than or equal .5, otherwise it gets rounded up.
Hmm I barely remembered that
I like the "technical limitations" challenge sometimes 😉
B-but since you're a green gang why not just hit Dedmen up and forces him to implement something
I am not sure I would be allowed near Dedmen again if I asked him to merge A3 into A2OA :x
dedmen executeTimeMachine [2001,6,22]
What's a good way to remove an addAction from players upon death? I've set up a script that gives squad leaders the ability to drop a rally point from an addAction, but there's an issue where when they die other people can also access the action. I assume I can do this from onPlayerKilled.sqf but how would I actually write that?
You can setVariable getVariable to pass/reuse an action ID
this ↑ is the best solution for this case 🙂
additionally
when they die other people can also access the action
that's weird, death should not impact the action's conditions.
are you sure the action is not already available when the unit is alive?
also - it means that the action is added globally (like in an init field) and not locally (as it should for a personal action)
Ok, let me break down how I've got this set up currently. I'm applying it in onPlayerRespawn.sqf, so that it'll apply to players as required both on mission start (using respawnOnStart = 0) and when they respawn, so that dying doesn't take away their ability to drop it. The way I've got it set up currently:
if (player in [GERSL1,GERSL2]) then { player addAction ["Set Rally", {GER_spawn1 setPos screenToWorld[0.5,0.5]}]; };
Where GERSL1 (or 2) is the player using the action, and GER_spawn1 is the object which has a respawn marker attached to it through another script.
I'm terribad at scripting so if you guys have a better way of doing this, please enlighten me.
😋
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
well, onPlayerRespawn.sqf executes locally so this addAction should not be replicated anywhere else
It's not that it's replicated per se, more that the action remains on the corpse of the first player unit.
ah, if the player respawns he can access his own old action, right? this yes
Yeah correct
So it means that they have both their own, current action, but can then also get at the one on their body, cluttering things.
yep 🙂
well you could either use the condition parameter
https://community.bistudio.com/wiki/addAction
or indeed remove the action, that's neater
(I am of the lazy kind myself)
How would I go about doing that? Like I said, I'm really bad at scripting. Most of what I've got so far is butchered out of other scripts.
lemme du eet
A3, correct?
if (player in [GERSL1, GERSL2]) then
{
private _actionId = player addAction ["Set Rally", { GER_spawn1 setPosASL AGLToASL screenToWorld [0.5, 0.5]; }];
player setVariable ["FUZ_rallyActionId", _actionId];
player addEventHandler ["Killed", {
params ["_unit"];
private _actionId = _unit getVariable ["FUZ_rallyActionId", -1];
_unit removeAction _actionId;
_unit removeEventHandler ["Killed", _thisEventHandler];
}];
};
```@quiet geyser
in human language:
- add the action and grab its ID
- set the ID as an object's variable
- add an event handler where on death, the action ID is obtained, the action is removed, and the event handler is removed
Nice. Does it allow for those players to respawn and they'll still have their addAction available?
the same as before, the safety included
yes, just where you previous script was
no other changes required, keys in hand, windshield wiped and oil levels checked, good to go!
(but the brake cables are cut, muahuahua)
hey that's the chef's surprise, don't spoil it!
pls no ban
!burgerpan @tough abyss 0 revealing my dark plans
@winter rose
Also, I assume that if I wanted this to work in several different places (ie having this action available for different characters and different spawn objects) I could do something like below:
if (player in [GERSL1, GERSL2]) then
{
private _actionId = player addAction ["Set Rally", { GER_spawn1 setPosASL AGLToASL screenToWorld [0.5, 0.5]; }];
player setVariable ["FUZ_rallyActionId1", _actionId];
player addEventHandler ["Killed", {
params ["_unit"];
private _actionId = _unit getVariable ["FUZ_rallyActionId1", -1];
_unit removeAction _actionId;
_unit removeEventHandler ["Killed", _thisEventHandler];
}];
};
if (player in [USSL1, USSL2]) then
{
private _actionId = player addAction ["Set Rally", { US_spawn1 setPosASL AGLToASL screenToWorld [0.5, 0.5]; }];
player setVariable ["FUZ_rallyActionId2", _actionId];
player addEventHandler ["Killed", {
params ["_unit"];
private _actionId = _unit getVariable ["FUZ_rallyActionId2", -1];
_unit removeAction _actionId;
_unit removeEventHandler ["Killed", _thisEventHandler];
}];
};```
please
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
yes (but name the vars better please :D)
yeah that was really more for proof of concept lol
Thanks a bunch.
On the off chance this isn't a large-ish undertaking, is there an easy way to make it so that this also can't be used when OPFOR is within a certain distance?
east countSide (_caller nearEntities [["Man", "Air", "Land", "Ship"], 200]) == 0
Where would I put that into the above script?
player addAction ["Set Rally", {...}, nil,
1.5,
true,
true,
"",
toString {east countSide (_this nearEntities [["Man", "Air", "Land", "Ship"], 200]) == 0}
];
the above will hide the action when enemies are nearby tho
so it's kind of like cheating 
you can do it like Lou said instead
and kinda heavy on perfs, nooo? 😋
yeah 
Sorry to keep bothering you for a spoonfeed, but where in the code should that go?
Hey guys, does anyone have the python code with opencv to plot the Armas 3 boundingbox in the image (print)?
if (player in [GERSL1, GERSL2]) then
{
private _actionId = player addAction ["Set Rally", if (east countSide (_caller nearEntities [["Man", "Air", "Land", "Ship"], 200]) == 0) then
{ GER_spawn1 setPosASL AGLToASL screenToWorld [0.5, 0.5]; }];
player setVariable ["FUZ_rallyActionId1", _actionId];
player addEventHandler ["Killed", {
params ["_unit"];
private _actionId = _unit getVariable ["FUZ_rallyActionId1", -1];
_unit removeAction _actionId;
_unit removeEventHandler ["Killed", _thisEventHandler];
}];
};
like so?
aaalmost
private _actionId = player addAction ["Set Rally", {
if (east countSide (_caller nearEntities [["Man", "Air", "Land", "Ship"], 200]) == 0) then
{
GER_spawn1 setPosASL AGLToASL screenToWorld [0.5, 0.5];
};
}];
if (player in [GERSL1, GERSL2]) then
{
private _actionId = player addAction ["Set Rally", {
if (east countSide (_caller nearEntities [["Man", "Air", "Land", "Ship"], 200]) == 0) then
{
GER_spawn1 setPosASL AGLToASL screenToWorld [0.5, 0.5];
};
}];
player setVariable ["FUZ_rallyActionId1", _actionId];
player addEventHandler ["Killed", {
params ["_unit"];
private _actionId = _unit getVariable ["FUZ_rallyActionId1", -1];
_unit removeAction _actionId;
_unit removeEventHandler ["Killed", _thisEventHandler];
}];
};
?
is there an easy way of seeing what types of objects you can sort through using nearentities?
it accepts all the classes; see the doc for parent classes like "CAManBase", "Air", etc
https://community.bistudio.com/wiki/nearEntities
where is the doc? im not familiar with bi wiki
Of course the typeless syntax includes butterflies :P
I just linked it
what do you want in that case?
a way to sort for a tree if that doesnt need config to be sorted
Can't parse that.
nearEntities are for living entities (+ vehicles) afaik
it's for "normally" simulated objects
PhysX + units
for trees, see https://community.bistudio.com/wiki/nearestTerrainObjects
aaaaah ok
Got the following script error upon trying to test out the addAction:
0:35:58 Error in expression < if (east countSide (_caller nearEntities [["Man", "Air", "La> 0:35:58 Error position: <_caller nearEntities [["Man", "Air", "La> 0:35:58 Error Undefined variable in expression: _caller
replace _caller with player
you haven't defined it
Yep that fixed it up, cheers.
If you ask me, merge should overwrite left operand keys with right operand keys
Sounds like a bug that it doesn't and it might be better to face it and fix it now
All my usages of merge needed left hashmap to be overwritten with right operand hashmap
how could i create a scripted checkpoint for an ai vehicle to pass through, so the ai will drive up to the checkpoint, and some other ai will walk around the vehicle checking it and then the gate will open, like in old man
I want to emit sound from some invisible object
"Logic" classname for some reason does not works for me
is there any classname that suits this need?
yes, a logic (or any other thing like invisible helipad)
what did you try so far?
I copied Game Logic classname with Eden Enhanced tools (it outputted the "Logic" classname) and it didn't work
Oh, I forgot about invisible helipad, usually it worked, brb
Completely unrelated to my last question; does anyone have a good script lying around for an addAction that just spawns a given classname of unit and then adds them to the player that used the action's group?
Yeah, it works
Thanks for suggestion again!
i just remembered why you dont use sleep in the debug console
Is there a way to open a link when player is kicked for missing mod?
doable here
no, AFAIK
player addAction ["Add moar manpowah!", {
group player createUnit ["B_Soldier_F", getPosATL player, [], 5, "NONE"];
}];
2 questions, first one, how can i created an ai checkpoint that will check an ai vehicle coming through and then open a gate to let it through, second question how can i create an optional stealth objective that fails when the enemy is alerted
Think the first player up there is supposed to be this etc. but otherwise this works beautifully, thanks again!
the group player below should also be replace by```sqf
params ["_target"];
group _target
What does that change/improve?
1/ plenty of animation setup, script management, exception handling (what if the vehicle moves, gets shot at by something else, etc)
2/ make it fail if enemy groups become alerted (check with behaviour)
well, if you replace with this it makes the "add unit" target the action caller, not player
so a scripted checkpoint is pretty hard to do?
yes
alr
Like so?
GER_Rec1 addAction ["Recruit AI crewman", {
params ["_target"];
group _target createUnit ["B_NATOCENTAG_GER_Crewman_WDL_01", getPosATL player, [], 5, "NONE"];
}];
(GER_Rec1 is the var name of the object it'll be on)
for behaviour would it be like behaviour combat; and then it fails
no.
oh ok
don't guess, read the doc instead 😉
https://community.bistudio.com/wiki/behaviour
or combatBehaviour for a group, it seems 
so like for set task state the condition would be combatBehaviour group1; //combat;
actually I would use behaviour leader group1; instead
and replace that last player with _target, I just realised 🤣
GER_Rec1 addAction ["Recruit AI crewman", {
params ["_target"];
group _target createUnit ["B_NATOCENTAG_GER_Crewman_WDL_01", getPosATL _target, [], 5, "NONE"];
}];
Good?
yep, no more fixes 😛 until next notice!
My man, you're an absolute hero
okie, another thing can i make it so if the hvt target gets shot at/alerted they would flee to a heli or a car and the mission fails when they get away without getting killed
yes, yes you can
I shall allow it
I would:
- make a HVT waypoint 1m from its position
- lock this HVT with a trigger and in its condition
behaviour HVT == "COMBAT"and type would be "sync" or something - add other waypoints for fleeing
- in HVT's last fleeing waypoint, make a failure condition (e.g
["fail", false] remoteExec ["BIS_fnc_endMission"];)
alr thanks
Upon testing, for whatever reason, this doesn't seem to be working. Was working before with the previous version. Anything I buggered up in my formatting, or would reverting it be fine?
No script errors or anything, it's just not spawning anything.
Have tried it with both:
US_Rec2 addAction ["Recruit AI Bradley crewman", {
params ["_target"];
group _target createUnit ["B_NATOCENTAG_US_Crewman_M2_WDL_01", getPosATL player, [], 5, "NONE"];
}];
as well as
US_Rec2 addAction ["Recruit AI Bradley crewman", {
params ["_target"];
group _target createUnit ["B_NATOCENTAG_US_Crewman_M2_WDL_01", getPosATL _target, [], 5, "NONE"];
}];
where do you put the code?
The idea came to me to try to do something like a scene where the camera would follow the fighter as if he had a Go Pro on his head. I have never worked with cameras, can anyone suggest an option how this can be make?
I hope it's singleplayer, for PiP and remote units don't go well together
This scene for small video, nothing more (:
ok! then see https://community.bistudio.com/wiki/Camera_Tutorial, and perhaps attachTo as well 🙂
tyvm
Just in the init of the object which people are interacting with.
No, it's the object on which the addAction is present. Normally I would use this but I've found there can be reliability issues on dedicated servers like that, var names on the other hand never seem to go wrong.
can you make a single player leave currently occupied slot in MP when he returns to the lobby, after mission end for example?
... wouldn't the group being referenced here belong to the player initiating the addAction, rather than the object which it's activated from?
use:
this addAction ["Recruit AI Bradley crewman", {
params ["_target", "_caller"];
group _caller createUnit ["B_NATOCENTAG_US_Crewman_M2_WDL_01", getPosATL _target, [], 5, "NONE"];
}];
no. _target is who-/whatever you added the action to
Cheers, that last snippet got it working. Was still able to use the var name instead of this at the start as well. Thanks
there is no need
this works just fine
if you had issues with this before it was most likely a different problem (this acts like a local variable, and you probably tried it in a different scope)
aight homies im doin something wrong again here
if (player distance oryx < 4) then {hint "you are in range";
get1 = player addAction ["I want this one!", {player setPos getPos oryx_spawn; Vic1 = 1; player removeAction get1; }];
} else {
player removeAction get1;
};
im not getting any errors
its just not doing anything
is it because i cant check player distance from an object in an "if" statement?
how would i set a variable to true when the player is in range of the object?
Hi guys, question about capturing unit's fire data
i am able to record and replay the movement and the fire data from the gunner of the vehicle but not from the pilot or the other gunners
im using: rec = [jet1, 180, 1] spawn BIS_fnc_UnitCaptureFiring; [jet1, 180, 1] spawn BIS_fnc_UnitCapture;
wp1 = <paste copied flight data here>;
[jet1, wp1] spawn BIS_fnc_Unitplay;
_capturedData = <paste copied firing data here>;
[ jet1, _capturedData, true ] spawn BIS_fnc_UnitPlayFiring;
On Activation: rec = [] spawn wp1;
The huey fires the rockets from the co-pilot but not the machine guns from the pilot's seat
would it be something like this?
player distance oryx <4 setVariable ["_oryxget",true,true];
you can
then why isnt it working? ;A;
it is working
straight up copying your code into empty mission with only player, "oryx" and "oryx_spawn" objects works 🤷♂️
run the code near the "oryx" - action gets added. Run the code far from "oryx" - action gets deleted. Activate the action - player gets teleported and action gets deleted 🤷♂️
yea that is what its supposed to do
trying to remove triggers all together to learn more code x-x
🤷♂️ what are you trying to achieve and how are you running the code?
the unitCapture function is so limited. it doesn't capture all firing turrets
mmmm i have a game logic down so the code is just going but because of its nature only activates if the "if" check clears
i have it working via triggers, mind if i send you the clip to show what im tryna do?
why not
sent
@winter rose is there something like nearterrainobjects so i can use that instead of nearestterrainobject?
haaaaaah capitalisation haaaaaah
never!
you have nearestTerrainObjects, plural, what more do you want?
is just that a command?
i must of removed the s on accident
wait no
it gives an array of objects
i want an object
wait no
what do i want?
while {true} do {
uisleep 2;
_tree = nearestTerrainObjects [player, ["Tree"], 200];
hint str _tree;
_Ladder = "" createVehicle position _tree;
};
ok
from the start
don't start from code then to logic, it's the other way around 😛
i basically want to recognize trees
then create a ladder to climb ontop of the tree
or into it (that can be done later with position commands)
without a platform up there, thou and your idea shalt fall flat
thats where your wrong using enhanced movemant the mod i was able to climb ontop of a tree
i think the model is too large on the top
cheater!
and can be walked on
i guess i would want a player so that players dont float
maybe an invisible one
(the hint and while true are for getting it working)
that would create a latter every 2s 😄
Now having a small issue with the earlier implementation of that addAction we put together:
2:50:33 Error in expression <hisEventHandler]; }]; }; if (player in [GERSL2]) then { private _actionId = play> 2:50:33 Error position: <GERSL2]) then { private _actionId = play> 2:50:33 Error Undefined variable in expression: gersl2
if it were a submarine then i would have no problem
@winter rose
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
That's from the .rpt, not a code segment
oh, true xD
I'm also (and I'm unsure if this is connected) having problems with the respawn_west markers being moved to their respective objects; seems like they're getting their wires crossed occasionally. I have:
4x objects with var names of
US_spawn1 US_spawn2 GER_spawn1 GER_spawn2
and then 4x markers named
respawn_west respawn_west1 respawn_west2 respawn_west3
which correspond to the respective objects above, and have marker text as appropriate.
I then have respawn.sqf, which consists of:
while {true} do
{
"respawn_west" setmarkerpos getpos GER_spawn1;
"respawn_west1" setmarkerpos getpos GER_spawn2;
"respawn_west2" setmarkerpos getpos US_spawn1;
"respawn_west3" setmarkerpos getpos US_spawn2;
sleep 10;
};```
I can't do anything without the code though
This is called in initServer.sqf with:
[] execVM "respawn.sqf";```
(use getPosWorld, it's the fastest)
why do you do this?
you can move the marker when the spawn point is moved, no loop needed
Because I googled a mobile respawn script and out of several that I looked at, this is what all of them used. As I've said a bunch of times, I'm not a programmer/any good at this lol
As for this it's the same as before, but for posterity:
if (player in [GERSL1]) then
{
private _actionId = player addAction ["Place Rally Point", {
if (east countSide (player nearEntities [["Man", "Air", "Land"], 200]) == 0) then
{
GER_spawn1 setPosASL AGLToASL screenToWorld [0.5, 0.5];
};
}];
player setVariable ["FUZ_rallyActionId_Ger1", _actionId];
player addEventHandler ["Killed", {
params ["_unit"];
private _actionId = _unit getVariable ["FUZ_rallyActionId_Ger1", -1];
_unit removeAction _actionId;
_unit removeEventHandler ["Killed", _thisEventHandler];
}];
};
if (player in [GERSL2]) then
{
private _actionId = player addAction ["Place Rally Point", {
if (east countSide (player nearEntities [["Man", "Air", "Land"], 200]) == 0) then
{
GER_spawn2 setPosASL AGLToASL screenToWorld [0.5, 0.5];
};
}];
player setVariable ["FUZ_rallyActionId_Ger2", _actionId];
player addEventHandler ["Killed", {
params ["_unit"];
private _actionId = _unit getVariable ["FUZ_rallyActionId_Ger2", -1];
_unit removeAction _actionId;
_unit removeEventHandler ["Killed", _thisEventHandler];
}];
};
if (player in [USSL1]) then
{
private _actionId = player addAction ["Place Rally Point", {
if (east countSide (player nearEntities [["Man", "Air", "Land"], 200]) == 0) then
{
US_spawn1 setPosASL AGLToASL screenToWorld [0.5, 0.5];
};
}];```
player setVariable ["FUZ_rallyActionId_Us1", _actionId];
player addEventHandler ["Killed", {
params ["_unit"];
private _actionId = _unit getVariable ["FUZ_rallyActionId_Us1", -1];
_unit removeAction _actionId;
_unit removeEventHandler ["Killed", _thisEventHandler];
}];
};
if (player in [USSL2]) then
{
private _actionId = player addAction ["Place Rally Point", {
if (east countSide (player nearEntities [["Man", "Air", "Land"], 200]) == 0) then
{
US_spawn2 setPosASL AGLToASL screenToWorld [0.5, 0.5];
};
}];
player setVariable ["FUZ_rallyActionId_Us2", _actionId];
player addEventHandler ["Killed", {
params ["_unit"];
private _actionId = _unit getVariable ["FUZ_rallyActionId_Us2", -1];
_unit removeAction _actionId;
_unit removeEventHandler ["Killed", _thisEventHandler];
}];
};```
(non-Nitro havin' ass)
text file > nitro
@quiet geyser havin' https://sqfbin.com/ though 😉
if you, ahem, indented properly
you would see
I take the solution back, but I maintain this indentation's criticism 😂
Yeah not a programmer in any way, I know that indentation is important and all that but it honestly goes pretty over my head. Regardless, can you see what the issue is bad formatting aside?
Undefined variable in expression: gersl2 does kinda sound self-explanatory, though? Are you sure you have a GERSL2 variable? If it's assigned to player slot then i'm pretty sure it wouldn't be defined if there's no one filling said slot
did it 4 u
https://sqfbin.com/xotexudiwimayarivexa
and what artemoz said 🙂
I've checked and those classnames are definitely present in the mission, however when I'm testing yeah not all of those slots are occupied.
if they are not occupied, the unit is not created, right?
sooo the variable doesn't even exist 🙂
Yeah that makes plenty of sense, I get you
Will give that a go and report back
Well, I got a script error, but weirdly enough it's working anyway:
3:15:27 Error in expression <che\onPlayerRespawn.sqf"
if (player in [GERSL1]) then
{
private _actionId = play>
3:15:27 Error position: <GERSL1]) then
{
private _actionId = play>
3:15:27 Error Undefined variable in expression: gersl1
i wonder what would be the good solution for this, though. vehicleVarName player?
try this @quiet geyser
https://sqfbin.com/ajotecabojikayedihay
so you can configure as many as you like
Out of curiosity, what's the enemySide parameter for? All spawn points/playable units are BLUFOR.
(Cold War campaign, not WW2 :P)
oh, OK! then no need
https://sqfbin.com/ekocomirafibuxazuxap here @quiet geyser
I believe the spawn points exist whatever happen
only units may not
3:32:06 Error in expression < 0) exitWith {};
private _rallyPoint = _unit getVariable "FUZ_rallyPoint";
_ral>
3:32:06 Error position: <_unit getVariable "FUZ_rallyPoint";
_ral>
3:32:06 Error Undefined variable in expression: _unit```
omg babe new error just dropped
This time the object doesn't get moved at all either
instead of _unit?
well yes
Undefined variable in expression: _unit
means that at this point, the script has no idea of this value
_target or _caller, though
So is it specifically just in line 15, and that location of the script in the following versions? Change that to _target?
_caller is not defined here
yyyyyyup
script: String or Code
...
params ["_target", "_caller", "_actionId", "_arguments"];
target: Object - the object which the action is assigned to
caller: Object - the unit that activated the action
https://community.bistudio.com/wiki/addAction
ah, sorry, it's just me brainfarting, the target and caller are the same when the action is on player himself
Ok this worked, cheers. On to the next issue...
nope, nopenopenope
I'm sorry but this really is the last one probably
Just need to get these respawn_west markers behaving correctly. For whatever reason, they're not going where they're needed.
How and where would I put that into the version we've now got where we're defining parameters? I've got not clue with this version
4:10:36 Error in expression < 0) exitWith {};
private _rallyPoint = _unit getVariable "FUZ_rallyPoint";
_ral>
4:10:36 Error position: <_unit getVariable "FUZ_rallyPoint";
_ral>
4:10:36 Error Undefined variable in expression: _unit
ah yeah, well, same thing as before, I didn't fix
sqfbin is back??
Ok, it's all officially working, and you are officially the fucking man. Appreciate you answering my endless questions all night long, you've gotten a system in place I've wanted for an extremely long time. A per-player cooldown on the rally point system would be neat, but I think I'll have to leave that for another time as it's now extremely late (early?) and I'm about to pass out. Massive kudos again.
I did up a trailer for unit for this op actually, is there a channel which would be more appropriate to drop it in?
ty
the cooldown can be set quite easily, too ;-)
if you have any easy ideas swing em at me with a tag, I can chuck them in and test in the morning. Again, really appreciate the help
the idea would be to store the last usage time and wait for a big enough time difference in the action's condition
does anyone know why using setVelocityTransformation on a vehicle might make it extremely wobbly/laggy/buggy for non-server players?
are you calling it where the vehicle is local?
it's on the server
yeah I was thinking it was a locality issue
do I need to remoteExec createVehicle??
using that command remotely makes no sense
as in getting x client to tell y client to run setVelocityTransformation once
you want to remoteexec a function that does all the calling for the setVelocityTransformation, so it's nice and smooth
ok
so I just wanna put the setVelocityTransformation command inside a function and remoteExec that?
i don't really know what exactly you're trying to do
but you can't calculate the interpolation server side(or whatever) and tell some other machine to setVelocityTransformation based on that, it will look laggy
this is my code, which I'm running on the server: https://sqfbin.com/ifaxaqulemumefadanoy
currently, the plane only looks smooth for the server. all the other players see it wobbling up and down and stuff, which shouldn't happen at all because the setVelocityTransformation path is completely level
show a video of this wobbling
ok
I keep telling my players it's just turbulence but I think they're beginning to suspect something
have you created an AI for it?
Yeah are you using an AI pilot
which is most likely not local to the server
And is going to be fighting the code's movement
tho then that means the plane is not local either 
I thought that might be the problem
but I deleted the pilot and same stuff
wait
maybe not lemme try again
why delete the pilot? just don't create it in the first place
Just make sure nothing else is controlling it while you're moving it via sqf, they'll end up fighting each other
yeah that's what I mean
I deleted it from my code
but yeah it is still happening with no pilot
but it seems to be MUCH less intense...
maybe that's just it's tendency to crash without a pilot?
another theory is the sync rate
Also are you running setVelocityTransform where the vehicle is local?
You should be if not already
how do I make the vehicle local if it's created on the server?
setvelocity seems overkill here imo, you can for sure make an ai fly that straight path, disable their combat, set them to careless, etc
the reason I say this is that afaik PhysX simulation is local
so even remote objects are simulated using PhysX
Then it's local to the server
that would make them fly in a perfectly straight line?
oh, then yes
Good
That would be network sync
then this is the problem
Not a ton you can do about that