#arma3_scripting

1 messages · Page 4 of 1

granite sky
#

We have some code that does this for continuous medic animations. Works fine:

private _animHandler = _medic addEventHandler ["AnimDone",
{
    private _medic = _this select 0;
    _medic playMoveNow selectRandom medicAnims;
}];
past wagon
#

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.
granite sky
#

Aren't you running a finish animation on them at the end?

past wagon
#

no...?

past wagon
# granite sky Aren't you running a finish animation on them at the end?
        _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?
granite sky
#

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.

past wagon
#

ok

granite sky
winter panther
#

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?

granite sky
#

You'd probably need to make your own respawn UI.

mighty jackal
#

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

meager granite
#

Use pastebin for bigger scripts

#

And you didn't post code that makes this one run, one that uses useraction

drowsy token
#

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;
    };```
rough summit
#

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?

warm hedge
#

Probably by checking typeOf. HC should have its own special class am I right?

rough summit
#

allUsers select {(getUserInfo _x select 7) == false}

warm hedge
#

Oh, completely forgot about it, wise

cedar cape
#

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

rough summit
#
[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?

cedar cape
#

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

tough abyss
#

@drowsy token looks fine to me

#

@cedar cape code above should work fine

cedar cape
#

it doesent

#

the player rappels

#

but cinema borders dont go away

tough abyss
#

Is that the only thing that isn't working?

#

Just the cinema border?

cedar cape
#

yeah

#

so like when i finish rappeling i still cant move

tough abyss
#

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

cedar cape
#

alr

cedar cape
#

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

tough abyss
#

Put a sleep 3; at the beginning of the trigger code

cedar cape
#

alr thanks

tough abyss
#

Also report back if the new code works

cedar cape
#

im doing it now

tough abyss
#

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

cedar cape
#

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

tough abyss
#

Ah right forgot that trigger code is unscheduled

#

That would also explain why your waitUntil isn't working

cedar cape
#

ah i see

tough abyss
#

Wrap the whole thing in [] spawn {} and it should work

#

With the code in the {}

cedar cape
#

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

cedar cape
tough abyss
#

Either but I'd go with schaer's as it doesn't use the unnecessary cba function

cedar cape
#

ah

tough abyss
#

No reason to use a cba function for waitUntil when its built in to begin with

cedar cape
#
 
["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

cedar cape
#

like where

tough abyss
#
[] 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

cedar cape
#

ah

tough abyss
#

As in the code probably doesn't look pretty since I edited it on mobile

#

Won't matter though

cedar cape
#

doesent work

#

i cant even press ok

#

it just says on activation:

tough abyss
#

You can't just paste it in like before?

cedar cape
#

no

#

wont let me

#

i put it in and thats what it says

tough abyss
#

Looks like it didn't copy the closing }

cedar cape
#

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

tough abyss
#

I'm going to bed so I may not be available when you do

#

It should work now though

#

No problem

cedar cape
#

Hopefully

#

Yeah bye

pulsar bluff
#

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?```
distant oyster
pulsar bluff
#

dang i didnt see that , been awhile since checking that page

slim verge
#

stack overflow is down, this means coding worldwide is now on hold

winter rose
#

we even lost sqfbin 😢

little raptor
tough abyss
#

Stack overflow's stack finally overflowed notlikemeowcry

cedar cape
#

bruh

#

it doesent work

#

the code u gave me @tough abyss

agile pumice
#

Does anyone know off the top of their head how to return the ACE cargo for a box?

#

getVariable of some sort maybe?

distant egret
#

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?

agile pumice
#

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

cedar cape
#

anyone able to help?

opal zephyr
#

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[] = {};
 };
 
};
winter rose
#
// filename, volume, pitch, distance (optional)
opal zephyr
#

if you're referencing the 0, it doesnt work if I put any number for volume. And yes ive read that wiki page lol

winter rose
#

try 1, save the file, save the mission, then try again

#

(try removing the starting \ too perhaps)

opal zephyr
#

Nothin

#

Folder structure has the "sound" Folder inside the mission root, with the sounds in it

winter rose
#

aaand which one do you try to play, and how do you try to play it?

opal zephyr
winter rose
cedar cape
winter rose
cedar cape
#

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

winter rose
#

¯_(ツ)_/¯

#

IDK anything about ACE
ACE Discord should know better
unless you run an obsolete version of ACE ofc

copper raven
cedar cape
winter rose
cedar cape
winter rose
#
waitUntil { getPos player select 2 < 1 };
opal zephyr
#

Try checking if atl is less than like 0.5

#

Or that

#

Ill try that in a sec Lou, thanks

cedar cape
open fractal
#

shouldn't need to add a sleep for playSound

winter rose
cedar cape
#

ill give it a go

winter rose
cedar cape
#
 
[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?
opal zephyr
#

Frazzle where are you putting this code?

winter rose
open fractal
#

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

cedar cape
#

nope still didnt work

#

still cant move when i hit the ground

agile pumice
#

how can I make this code work?

            _display closeDisplay 1;
            sleep 0.5;
            (findDisplay 46) createDisplay "_display";

do I need waituntil displayclosed trickery?

copper raven
#

is _display an actual resource name?

#

or are you just trying to "reopen" the display you closed?

agile pumice
#

reopen the display I closed

copper raven
#

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

agile pumice
#

#1127001 is the display code

copper raven
#

use the actual resource name you opened it with

agile pumice
#

Its the ace arsenal display. I'm removing contents and want to "refresh" the display

#

I'm not opening the display with the script

tough abyss
#

@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

cedar cape
#

alr

#

the ace stuff should be simple aswell

#

its just disabling user interactions so they cant cut the ropes mid rappel

tough abyss
#

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

little raptor
agile pumice
#

its fine, I just did

            _display closeDisplay 1;
            sleep 0.1;
            [_box, player] call ace_arsenal_fnc_openBox;
copper raven
cedar cape
#

nope still doesent work

opal zephyr
little raptor
opal zephyr
#

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[] = {};
 };
 
};
little raptor
#

say3D doesn't work either right?

opal zephyr
#

Ill try it now

#

nah didnt work when I used the player as the object

little raptor
#

have you closed the mission after updating description.ext?

opal zephyr
#

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

agile pumice
#

which eventhandler triggers for creating groundholders on the ground? I thought put would work?

opal zephyr
#

Restarting mission didnt work either, the debug console says "NOID <no shape>" When I execute playSound "Test1";

tough abyss
#

@cedar cape Alright time to figure out if this is just ACE being stupid or not

cedar cape
#

ive asked on ace discord, still waiting for a response

#

lets try and figure it out here for now though

copper raven
opal zephyr
#

Frazzle can you explain what exactly you want to happen?

cedar cape
#

bassicly

hallow mortar
tough abyss
#
[] 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

tough abyss
#

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

hallow mortar
# opal zephyr yes

and they are really .ogg files, that were definitely properly converted to .ogg and not just by changing the file extension manually?

opal zephyr
#

yup, one of the ones I was testing is right from the arma files

cedar cape
copper raven
#

broken how?

agile pumice
#

it's not removing the item and is returning false

cedar cape
#

ooooooooooo

tough abyss
#

Cannot vc at the moment as I'm at work

cedar cape
#

ive had a response from ppl on ace3 discord

#

ah

#

thats what theyve said

tough abyss
#

Doubt but sure

#

As earlier versions of your code wouldn't have had that issue and still didn't work

copper raven
#

that's not the issue

cedar cape
#

yeah

copper raven
#

relational < has even lower precedence than select in that case 😄

copper raven
#

something to look at

tough abyss
#

@cedar cape Best to just see if that hint works or not

cedar cape
#

I’m doing it now

opal zephyr
#

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

agile pumice
distant egret
cedar cape
#

alr

#

so the hint plays

#

but the border wont go away

copper raven
finite dirge
cedar cape
#

@tough abyss what now

tough abyss
#

So then the issue is not the condition failing

#

So probably an issue with ACE

agile pumice
tough abyss
#

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

agile pumice
#

does this work for cargo containers?

#

parameter says unit

agile pumice
#

indeed it does

copper raven
#

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"

agile pumice
#

there's no mention of "uniform" in the removeItemCargo cba function

#

gonna relaunch arma and try it

distant egret
#

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.

agile pumice
#

ah I see

#

yeah that worked

distant egret
#

👍

mighty jackal
#

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

meager granite
#

Check _condition

#

Do you do addAction on the vehicle or the unit?

mighty jackal
#
            {
                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

meager granite
#

Is there an off action?

mighty jackal
#

there is not

#

but would the script support that?

meager granite
#

Probably not, just wondering

mighty jackal
#

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];

meager granite
#

Is the script running itself again on incoming missile?

_ecmhandle = _heli addEventHandler ["incomingMissile", {[_this] execVM "\uh60\scripts\ECM.sqf"}];
mighty jackal
#

does one of those need to be a false?

winter rose
mighty jackal
mighty jackal
#

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!!";
};

meager granite
#

Please move it to pastebin

#

Oh its different scripts, "ECM_ON.sqf" and "ECM.sqf"

mighty jackal
meager granite
#

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

mighty jackal
#

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"

meager granite
#

This should have the action disappear when you press it

mighty jackal
#

what does the yes yes do in the condition if he has true true?

meager granite
#

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

mighty jackal
#

so your saying i should change the first line of setvariable which is _heli setVariable ["ECMJAMMER","no",true]; to _heli setVariable ["ECMJAMMER","yes",true];

meager granite
#

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

mighty jackal
#

_heli setVariable ["ECMJAMMER","yes",true]; is also at the end of the script

meager granite
#

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

mighty jackal
meager granite
#

Just use the condition I gave you, it should make it all work

#

Condition in the action config

mighty jackal
#

ok i'll test it

stable dune
#

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]
meager granite
#

Script itself already sets ECMJAMMER variable to no in the beginning and yes once its done

#

just check it in condition

stable dune
#

Okey

meager granite
#

👌

mighty jackal
#

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')";

meager granite
#

No, script doesn't support it being turned off

mighty jackal
#

ok

meager granite
#

Won't work without modifying the script

mighty jackal
#

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

short anchor
#

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.

winter rose
#

… use foreach 😄

short anchor
#

I was waiting for it 😂

Thank you

timid torrent
#

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.

meager granite
past wagon
#
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?
winter rose
copper raven
#
        _posAndDir = selectRandom _location;
        _location deleteAt (_location find _posAndDir);

why? generate a random number and use it in the deleteAt

past wagon
copper raven
#

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

past wagon
past wagon
copper raven
#

use floor and remove the -1

plain jackal
#

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

copper raven
#

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

tough abyss
#

Could also just use a sound source so it loops automatically

#

Then delete the sound source when the object dies

plain jackal
#

i tried using playSound3D but the sound didnt follow the car

copper raven
plain jackal
#

it's not set to be repeatable if that's what you mean

copper raven
#

then remove the remote exec and the issue should be fixed

plain jackal
#

ok, and i assume instead i'd just put the code into the init field of the trig?

copper raven
#

activation field you mean

plain jackal
#

yep yep, mbad

#

the activation field, yeah

copper raven
#

yes

plain jackal
#

alright i'll give it a go when i have the moment

#

thank you very much for the advice 🙂

#

appreciate it

past wagon
#
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...
tough abyss
#

Oh my

#

I can say I certainly can't recommend selecting randomly using deleteAt whilst also iterating over the array you're deleting from

winter rose
copper raven
#

it's not iterating over the array that's being deleted

tough abyss
#

No it's not but the sub arrays are being altered

winter rose
#

round random 0.625 what is this 😄

copper raven
tough abyss
#

Just bad practice, arrays should be immutable while iterating ideally

copper raven
#

it is though, the one that is actually "being iterated" over

#

the for loop is just randomly picking elements, not iterating over anything

tough abyss
#

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

copper raven
#

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

little raptor
#

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

tough abyss
#

@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

winter rose
tough abyss
#

Pretty sure random follows bell curve regardless

little raptor
#

well whatever random uses then meowsweats

tough abyss
#

But dunno what psuedoRNG system random is using

copper raven
tough abyss
#

Also keep in mind createVehicle with that syntax expects ATL positioning

past wagon
#

yeah

past wagon
tough abyss
#

No it's not the issue

past wagon
#

oh my god

#

guess what guys

#

turns out I actually wasn't running the script

#

🤪

tough abyss
#

and no it's not a 25% chance

#

you want 0.666 for a 25% chance of getting 2

winter rose
#

or```sqf
selectRandom [1, 1, 1, 2];

tough abyss
#

yeah or that

winter rose
#

yeah, that 😄

tough abyss
#

Uhhhh

#

NaN

distant oyster
#

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

winter rose
#

I had something like that yeah Description:(.*?)^[^\s]

winter rose
#
$input = preg_replace('/(\r\n|\r[^\n])$/m', "\n", $input);
```straight from SQF Highlighter
distant oyster
#

i am still wondering if regex will ever be replaced

#

this syntax is just horrible to read and understand

winter rose
#

it's lovely and everyone should know it ❤️

winter rose
tough abyss
#

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/

RegExr

RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp).

winter rose
#

I use regex101.com, but I encounter more regexr subscribers indeed!

tough abyss
#

It's just the first one I used (and continue to use) so it left an impression on me :P

past wagon
#

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

winter rose
#

mods

past wagon
#

nope

#

no mods

winter rose
#

other scripts then.

past wagon
#

I don't use allowDamage anywhere else

winter rose
#

you don't run the script once more then 🙃

past wagon
#

and this was working fine yesterday, I don't know what I changed

#

nah it's initPlayerLocal lol, the rest of it is running

winter rose
past wagon
#

nope

winter rose
#

¯_(ツ)_/¯

past wagon
#

no respawn

winter rose
#

check it runs with a systemChat or something

past wagon
#

ok

winter rose
#

should be your first reflexxx

past wagon
#
[] spawn {
    sleep 5;
    systemChat str isDamageAllowed player;
};
``` This is printing "false" and I am still dying to fall damage
winter rose
#

don't fall then 😂

leaden ibex
#

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?

past wagon
#

are aircraft carriers special or something?

winter rose
past wagon
#

oh

#

yeah that would be it

granite sky
#

Since Arma 3 v1.56 arrays are limited to maximum of 9,999,999 (sometimes 10,000,000) elements

leaden ibex
#

Even with the 170 players there were two weeks ago, I highly doubt anything could have gone over 10mil.

granite sky
#

That's only ~1400 elements added per second :P

#

shrugs

leaden ibex
#

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)

granite sky
#

hmm

#

This is with some sort of state persistence between restarts?

winter rose
leaden ibex
leaden ibex
winter rose
granite sky
#

SQF array index out of range gives you a divide by zero anyway

#

so yeah, server issue

past wagon
#
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?
winter rose
#

would this be what was causing the bug?
remove it and try?

leaden ibex
leaden ibex
# winter rose then <#105464869226082304>

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.

granite sky
#

Dedmen might but he probably won't tell you :P

winter rose
leaden ibex
copper raven
#

if you said the mods might have extensions, it could be the extension crashing the game aswell

leaden ibex
leaden ibex
copper raven
#

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 😄

leaden ibex
#

For the extensions, into the output char*?

copper raven
#

yea

leaden ibex
#

I am just returning whatever it was called with. I am not checking it, but it is never longer than ~60 chars monkaHmm

copper raven
#

yeah, nvm then, that's fine

granite sky
#

Apparently trying to make a >10m entry array just throws Error Max array size would be reached

leaden ibex
#

into the RPT? monkaHmm

granite sky
#

sure, if you enabled logging.

#

Various wildly bad indexes just throw Error Zero divisor

leaden ibex
#

PES_Cry but no Array index out of bounds...
Sometimes, I miss C++ compiler errors (hope at least someone get's the joke)

hallow mortar
# past wagon ```sqf player addEventHandler ["HandleDamage", { params ["_player", "", "_da...

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

past wagon
#

that is really helpful

#

I had no clue

meager granite
#

I have respawn timer hidden in my mission, but I can't find out how I did it thronking

#

Anybody remembers how its done?

#

Talking about default respawn timer you see below the scoreboard when you die in MP

tough abyss
#

Could be the result of a COUNTER respawn template or setPlayerRespawnTime

cedar cape
#

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;
};

open fractal
#

vague

cedar cape
#

wdym

#

everything bellow the hint is broken

#

idk why

tough abyss
#

still stuck on that eh

cedar cape
#

yep

#

its pain

#

idk why its happeing

#

ima try the old script

meager granite
#

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

cedar cape
#

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

tough abyss
#

Why is your respawnDelay 2e6 meowsweats

meager granite
#

Gotta punish the player for dying somehow samatra

#

Just kidding, I just manually trigger the respawn when needed with setPlayerRespawnTime 0 later

tough abyss
#

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

cedar cape
#

thats the thing

tough abyss
#
/* 
* 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

cedar cape
#

using the original script

#

with cinema borders true, they dont enable in the first place

#

like that script on its own

tough abyss
#

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

cedar cape
#

alr

south swan
#

in the "Rulesets" list

cedar cape
#

nope it works fine

#

hint plays, ace interact is enabled again

#

its a problem with the cinema borders not ace i would say

tough abyss
#

Okay

cedar cape
#

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

tough abyss
#

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

meager granite
cedar cape
tough abyss
#

Is that not blocked with ace_common_fnc_setDisableUserInputStatus?

#

just having cinema borders wouldn't stop it either

meager granite
#

respawnDialog=0; probably

cedar cape
#

so im not sure whats going on

tough abyss
#

alright how about this

cedar cape
#

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

tough abyss
#

ok

#

so what's the issue

cedar cape
#

idk

tough abyss
#

that you want the borders?

cedar cape
#

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

tough abyss
#

Is the trigger set to allow multiple activations?

cedar cape
#

whereas on all of the test missions the trigger doesent touch the ground and is only on the heli

#

no it isnt

tough abyss
#

shouldn't be an issue then

cedar cape
#

but it might be the issue, unlikley but thats the only thing that has changed

tough abyss
#

how about this

#

right where you're doing

showCinemaBorder true;
#

add

disableUserInput true;

afterwards

south swan
tough abyss
#

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;
};
cedar cape
#

alr

cedar cape
meager granite
south swan
#

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

tough abyss
#

Yes I meant add it after since it's already there

south swan
tough abyss
#

honestly I'm not sure, that could frankly be the issue

#

@cedar cape have the borders ever worked?

cedar cape
#

ye

#

in the intro cutscene

#

they just dont go away when the player rappels

tough abyss
#

does that cutscene use a separate camera from when you rappel

cedar cape
#

wdym

tough abyss
#

does the cutscene use a custom camera

#

or is it all just player cam

cedar cape
#

starting one?

tough abyss
#

yes

cedar cape
#

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

tough abyss
#

so the cutscene is using a custom camera

#

_cam = "camera" camCreate (blackhawk modelToWorld [5, 5, 0]);

#

^ that's a custom camera

cedar cape
#

oh ok

tough abyss
#

that's why the borders work

#

borders only work with a custom camera, not player cam, apparently

cedar cape
#

wut

#

it works with player cam at start tho

tough abyss
#

_cam is not the player's cam

cedar cape
#

thats getting into the heli

#

the walk animation at the start is the player cam

south swan
#

[0,0,false] spawn BIS_fnc_cinemaBorder; doesn't seem to have anything to do with showCinemaBorder, though

tough abyss
#

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

south swan
#

[0,0,false] spawn BIS_fnc_cinemaBorder; is disabled by [1,0,false] spawn BIS_fnc_cinemaBorder; 🤷‍♂️

cedar cape
tough abyss
#

Dunno, wiki says to use call so I'm relaying that

south swan
#

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

tough abyss
#

Would explain why trying to disable it with normal showCinemaBorder doesn't work at least

south swan
#

yep

cedar cape
#

im gonna use [1,0,false] spawn BIS_fnc_cinemaBorder; instead and see if it works

cedar cape
#

i cant close mission now

#

and return to eden

#

o shit

tough abyss
#

Just close the game and revert

#

don't need to do that method anymore

cedar cape
#

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

warm hedge
#

Let's not spam.

cedar cape
#

my bad

#

sorry ive been tryna do this for 3 days

stiff isle
#

What is the practical usage of if (isServer) then when I am doing a MP mission.

warm hedge
#

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

stiff isle
#

Do I have to use it if saying like, I am enabling an AI's simulation with a trigger?

still forum
still forum
leaden ibex
tacit condor
#

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";
    };
};
tacit condor
#

ehhh

winter rose
#

what is "group song in folders"?

tacit condor
#

group song in folder?

#

as in if I create a folder structure it will reflect on zeus GUI?

winter rose
#

I do not think you can
does Zeus have music directories?

tacit condor
#

ZEN has it...

#

haven't used vanilla zeus since like 2017...

winter rose
#

so, it seems you can

tacit condor
#

🤔 thanks!

#

Will report at some point if it works

winter rose
#

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";
    };
winter rose
#

and it is a mod thing indeed - there is no such thing in Vanilla (though I wished)

tacit condor
#

music player in Zeus?

fading magnet
#
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 👆

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
warm hedge
#

And urm, assume you're trying to get an element of those arrays?

#

Like... in js

winter rose
#

a sometimes wise man once said

lyric schoonerBOT
fading magnet
winter rose
lyric schoonerBOT
winter rose
#

selectRandom enemySpawnPnt 😉

fading magnet
#

Doesn't random integer gives random number 🤔

winter rose
#

enemySpawnPnt[random _j] is not a syntax in SQF

#

here you are setting enemySpawnPnt then creating an array [random _j]

warm hedge
#
  1. Use select to get an element of an array
  2. Indeed as Lou says you'll just need to use selectRandom in order to get a random element of an array
winter rose
warm hedge
#

Also, try not to use global variable too often. Use _ prefix to make your variable alive only in your script

winter rose
#

wait, @fading magnet, A2OA or A3?

warm hedge
fading magnet
warm hedge
#

Ooh

winter rose
#

so no selectRandom for you

warm hedge
#

Isn't BIS_fnc_selectRandom a thing already there?

fading magnet
#

Array select random length works?

warm hedge
#

Speaking of, I don't really know how select behaves if I throw a number like 1.3

fading magnet
#

Random gives out an integer right?

warm hedge
#

*A number, there is no int or scalar but only number

#

Which is basically equivalent of scalar

fading magnet
#

:(

#

Is there a round function like round(1.4) = 1

warm hedge
#

Use floor, ceil or round to make it a natural number

fading magnet
#

Ohh thanks 😊

winter rose
#
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 😉
warm hedge
#

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

winter rose
#

I like the "technical limitations" challenge sometimes 😉

warm hedge
#

B-but since you're a green gang why not just hit Dedmen up and forces him to implement something

winter rose
#

I am not sure I would be allowed near Dedmen again if I asked him to merge A3 into A2OA :x

warm hedge
#

dedmen executeTimeMachine [2001,6,22]

quiet geyser
#

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?

warm hedge
#

You can setVariable getVariable to pass/reuse an action ID

winter rose
#

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)

quiet geyser
#

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.

winter rose
#

😋

lyric schoonerBOT
# winter rose 😋

stop using 'setPos' for the love of god notlikemeowcry
Leopard20; Tuesday, 10 August 2021

winter rose
#

well, onPlayerRespawn.sqf executes locally so this addAction should not be replicated anywhere else

quiet geyser
#

It's not that it's replicated per se, more that the action remains on the corpse of the first player unit.

winter rose
#

ah, if the player respawns he can access his own old action, right? this yes

quiet geyser
#

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.

winter rose
#

(I am of the lazy kind myself)

quiet geyser
#

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.

winter rose
#

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
quiet geyser
#

Nice. Does it allow for those players to respawn and they'll still have their addAction available?

winter rose
#

the same as before, the safety included

quiet geyser
#

Awesome, thanks!

#

Btw, should I be running this from onPlayerRespawn.sqf?

winter rose
#

yes, just where you previous script was

#

no other changes required, keys in hand, windshield wiped and oil levels checked, good to go!

tough abyss
#

(but the brake cables are cut, muahuahua)

winter rose
#

hey that's the chef's surprise, don't spoil it!

tough abyss
#

pls no ban

winter rose
#

!burgerpan @tough abyss 0 revealing my dark plans

quiet geyser
#

@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];
  }];
};```
winter rose
#

please

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
winter rose
quiet geyser
#

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?

little raptor
quiet geyser
#

Where would I put that into the above script?

winter rose
#

as a condition in your action's code 🙂

#

if -the code above- then -moveStuff-

little raptor
#
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 meowsweats

little raptor
winter rose
little raptor
#

yeah meowsweats

quiet geyser
winter rose
#

around your move stuff code

#
if (leopardsCondition) then
{
  moveTheBase;
};
slim venture
#

Hey guys, does anyone have the python code with opencv to plot the Armas 3 boundingbox in the image (print)?

quiet geyser
#
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];
  }];
};
winter rose
#

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];
    };
}];
quiet geyser
#
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];
  }];
};
#

?

winter rose
#

WTF is this indentation.

#

yes
I think

tough abyss
#

is there an easy way of seeing what types of objects you can sort through using nearentities?

winter rose
tough abyss
#

where is the doc? im not familiar with bi wiki

granite sky
#

Of course the typeless syntax includes butterflies :P

winter rose
#

what do you want in that case?

tough abyss
#

a way to sort for a tree if that doesnt need config to be sorted

granite sky
#

Can't parse that.

winter rose
#

nearEntities are for living entities (+ vehicles) afaik

little raptor
#

it's for "normally" simulated objects
PhysX + units

tough abyss
#

aaaaah ok

quiet geyser
# winter rose yes I _think_

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

little raptor
#

you haven't defined it

quiet geyser
#

Yep that fixed it up, cheers.

meager granite
#

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

cedar cape
#

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

smoky rune
#

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?

winter rose
#

yes, a logic (or any other thing like invisible helipad)
what did you try so far?

smoky rune
#

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

quiet geyser
#

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?

smoky rune
#

Yeah, it works
Thanks for suggestion again!

tough abyss
#

i just remembered why you dont use sleep in the debug console

fair gulch
#

Is there a way to open a link when player is kicked for missing mod?

winter rose
cedar cape
#

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

quiet geyser
#

Think the first player up there is supposed to be this etc. but otherwise this works beautifully, thanks again!

winter rose
quiet geyser
#

What does that change/improve?

winter rose
winter rose
cedar cape
winter rose
#

yes

cedar cape
#

alr

quiet geyser
#

(GER_Rec1 is the var name of the object it'll be on)

cedar cape
#

for behaviour would it be like behaviour combat; and then it fails

cedar cape
#

oh ok

winter rose
#

or combatBehaviour for a group, it seems think_turtle

cedar cape
#

so like for set task state the condition would be combatBehaviour group1; //combat;

winter rose
#

actually I would use behaviour leader group1; instead

winter rose
quiet geyser
#
GER_Rec1 addAction ["Recruit AI crewman", { 
  params ["_target"]; 
  group _target createUnit   ["B_NATOCENTAG_GER_Crewman_WDL_01", getPosATL _target, [], 5, "NONE"]; 
}];
winter rose
#

yep, no more fixes 😛 until next notice!

quiet geyser
#

My man, you're an absolute hero

cedar cape
winter rose
cedar cape
#

lol

#

let me rephrase that, how would i do it

winter rose
#

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"];)
cedar cape
#

alr thanks

quiet geyser
quiet geyser
#

No script errors or anything, it's just not spawning anything.

quiet geyser
little raptor
#

where do you put the code?

rough summit
#

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?

winter rose
rough summit
#

This scene for small video, nothing more (:

winter rose
rough summit
#

tyvm

quiet geyser
little raptor
#

then use this instead of the variable names

#

also is US_Rec2 a unit?

quiet geyser
#

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.

little raptor
#

objects don't have groups

#

that's why it's failing

proven charm
#

can you make a single player leave currently occupied slot in MP when he returns to the lobby, after mission end for example?

quiet geyser
#

... wouldn't the group being referenced here belong to the player initiating the addAction, rather than the object which it's activated from?

little raptor
little raptor
quiet geyser
#

Cheers, that last snippet got it working. Was still able to use the var name instead of this at the start as well. Thanks

little raptor
#

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)

rancid lance
#

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?

lethal turtle
#

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

rancid lance
#

would it be something like this?

player distance oryx <4 setVariable ["_oryxget",true,true];
rancid lance
south swan
#

it is working

#

straight up copying your code into empty mission with only player, "oryx" and "oryx_spawn" objects works 🤷‍♂️

rancid lance
#

ohhh

#

i wonder if the trigger i have near by is countering it

south swan
#

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 🤷‍♂️

rancid lance
#

yea that is what its supposed to do

#

trying to remove triggers all together to learn more code x-x

south swan
#

🤷‍♂️ what are you trying to achieve and how are you running the code?

little raptor
rancid lance
#

i have it working via triggers, mind if i send you the clip to show what im tryna do?

south swan
#

why not

rancid lance
#

sent

tough abyss
#

@winter rose is there something like nearterrainobjects so i can use that instead of nearestterrainobject?

winter rose
#

haaaaaah capitalisation haaaaaah

tough abyss
#

never!

winter rose
tough abyss
#

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?

tough abyss
#
while {true} do {
    uisleep 2;
    _tree = nearestTerrainObjects [player, ["Tree"], 200];
    hint str _tree;
    _Ladder = "" createVehicle position _tree;
};
#

ok

#

from the start

winter rose
#

don't start from code then to logic, it's the other way around 😛

tough abyss
#

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)

winter rose
#

without a platform up there, thou and your idea shalt fall flat

tough abyss
#

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

winter rose
#

cheater!

tough abyss
#

and can be walked on

#

i guess i would want a player so that players dont float

#

maybe an invisible one

tough abyss
winter rose
#

that would create a latter every 2s 😄

quiet geyser
#

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

tough abyss
#

if it were a submarine then i would have no problem

quiet geyser
#

@winter rose

winter rose
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
quiet geyser
#

That's from the .rpt, not a code segment

winter rose
#

oh, true xD

quiet geyser
#

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;
            };```
winter rose
#

I can't do anything without the code though

quiet geyser
#

This is called in initServer.sqf with:

[] execVM "respawn.sqf";```
winter rose
#

(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

quiet geyser
#

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

quiet geyser
# winter rose I can't do anything without the code though

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)

tough abyss
#

text file > nitro

winter rose
winter rose
#

if you, ahem, indented properly
you would see

#

I take the solution back, but I maintain this indentation's criticism 😂

quiet geyser
#

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?

south swan
#

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

quiet geyser
#

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.

winter rose
#

if they are not occupied, the unit is not created, right?

#

sooo the variable doesn't even exist 🙂

quiet geyser
#

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
south swan
#

i wonder what would be the good solution for this, though. vehicleVarName player?

winter rose
#

so you can configure as many as you like

quiet geyser
#

Out of curiosity, what's the enemySide parameter for? All spawn points/playable units are BLUFOR.

#

(Cold War campaign, not WW2 :P)

winter rose
#

oh, OK! then no need

#

I believe the spawn points exist whatever happen
only units may not

quiet geyser
#
 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

winter rose
#

ah yep, use _target

#

@quiet geyser

#

line 15

quiet geyser
#

instead of _unit?

winter rose
#

well yes

#

Undefined variable in expression: _unit
means that at this point, the script has no idea of this value

south swan
#

_target or _caller, though

quiet geyser
#

So is it specifically just in line 15, and that location of the script in the following versions? Change that to _target?

winter rose
south swan
#

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

winter rose
#

yep
IF you use the whole line, which I didn't

#

otherwise, it's _this select 1

south swan
#

ah, sorry, it's just me brainfarting, the target and caller are the same when the action is on player himself

quiet geyser
winter rose
#

nope, nopenopenope

quiet geyser
#

Just need to get these respawn_west markers behaving correctly. For whatever reason, they're not going where they're needed.

winter rose
#

move them in the action

#

when you setPosATL, setMarkerPos

quiet geyser
#

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

winter rose
quiet geyser
#
 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
winter rose
#

ah yeah, well, same thing as before, I didn't fix

open fractal
#

sqfbin is back??

quiet geyser
#

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?

quiet geyser
#

ty

winter rose
quiet geyser
#

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

winter rose
#

the idea would be to store the last usage time and wait for a big enough time difference in the action's condition

past wagon
#

does anyone know why using setVelocityTransformation on a vehicle might make it extremely wobbly/laggy/buggy for non-server players?

winter rose
past wagon
#

it's on the server

#

yeah I was thinking it was a locality issue

#

do I need to remoteExec createVehicle??

copper raven
#

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

past wagon
#

ok

past wagon
copper raven
#

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

past wagon
#

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

little raptor
past wagon
#

ok

#

I keep telling my players it's just turbulence but I think they're beginning to suspect something

little raptor
tough abyss
#

Yeah are you using an AI pilot

little raptor
#

which is most likely not local to the server

tough abyss
#

And is going to be fighting the code's movement

little raptor
#

tho then that means the plane is not local either thonk

past wagon
#

I thought that might be the problem

#

but I deleted the pilot and same stuff

#

wait

#

maybe not lemme try again

little raptor
#

why delete the pilot? just don't create it in the first place

tough abyss
#

Just make sure nothing else is controlling it while you're moving it via sqf, they'll end up fighting each other

past wagon
#

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?

little raptor
#

another theory is the sync rate

tough abyss
#

Also are you running setVelocityTransform where the vehicle is local?

#

You should be if not already

past wagon
copper raven
#

setvelocity seems overkill here imo, you can for sure make an ai fly that straight path, disable their combat, set them to careless, etc

little raptor
tough abyss
#

Then it's local to the server

past wagon
tough abyss
#

Good

past wagon
#

but it isnt wobbly for the server

#

only for other players

tough abyss
#

That would be network sync

tough abyss
#

Not a ton you can do about that