#arma3_scripting

1 messages · Page 26 of 1

south swan
#

https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onMouseButtonDown
a) "onMouseButtonDown Use on: Display, Control", createAgent doesn't create neither Display nor Control
b) "When using the event names via GUI scripting commands (e.g ctrlAddEventHandler, displayAddEventHandler), the prefix "on" in the name must be removed! (e.g. ButtonDown instead of onButtonDown)" notification in the bottom of the screen 🤷‍♂️
so this EH should be used either as _control ctrlAddEventHandler ["MouseButtonDown", {code}]; or as _display displayAddEventHandler ["MouseButtonDown", {code}];

manic radish
#

why does test normal work and test remoteExec not? - ive tried in singleplayer and multiplayer, there are no errors in the rpt

//this should set 0,0,0, to 10m ASL
player addaction ["test normal",{
  setTerrainHeight [[[0,0,10],[1,1,10]], false];
}];

//this should set 0,0,0 to 0m ASL
player addaction ["test remotexec",{
  [[[0,0,20],[1,1,20]], false] remoteExec ["setTerrainHeight",2];
}];
#

nevermind, I needed an extra set of square brackets around the arguments

fair drum
#

so I have this:

hyp_artifact_light = "#lightreflector" createVehicleLocal [17656.6,13966,18];
hyp_artifact_light setLightIntensity 3000;
hyp_artifact_light setLightAmbient [1,0,0];
hyp_artifact_light setLightColor [1,0,0];
hyp_artifact_light setLightConePars [45, 10, 0.5];
hyp_artifact_light setVectorDirAndUp [[1,0,0], [0,0,0]];

but I am unable to rotate the light cone downwards to point at the ground from above. no matter what numbers I put in setVectorDirAndUp, the light cone does not move. Is this command compatible with a light cone?

warm hedge
#

Your vectorUp is invalid

fair drum
#

oh boogers. one sec

#

fixed

hyp_artifact_light = "#lightreflector" createVehicleLocal [17656.6,13966,18];
hyp_artifact_light setLightIntensity 3000;
hyp_artifact_light setLightAmbient [1,0,0];
hyp_artifact_light setLightColor [1,0,0];
hyp_artifact_light setLightConePars [45, 10, 0.5];
hyp_artifact_light setVectorDirAndUp [[0,0,-1], [0,1,0]];
#

working now, thx

young current
#

Is there any information available if the AnimateSource command to animate turrets/guns of vehicles is partially broken or just meant to work with "createVehicle" made UGVs?

#

so the example works as intended but if same commands are added to say editor created UGV they dont work and if the UGV in the example is replaced with some other vanilla vehicle that should be using same MainTurret/MainGun sources it does not work

fair drum
#

those animationsources exist in the config of the UGV? i know some vehicles don't have them

#

yup looks like they do

serene sentinel
#

Trying to launch .sqf script from mission path:

_Alpha = createGroup resistance;
_peh = "I_survivor_F" createUnit [getMarkerPos "Alpha", _Alpha, "this setVariable ["dzn_gear", "kit_HIDF_SL"]", 1, "SERGEANT"];

Have this error:

17:09:50 Error in expression <s "Alpha", _Alpha, "this setVariable ["dzn_gear", "kit_HIDF_SL"]", 1, "SERGEAN>
17:09:50 Error position: <dzn_gear", "kit_HIDF_SL"]", 1, "SERGEAN>
17:09:50 Error missing ]

#

anyone can help?

granite sky
#

You have quotes inside quotes. You can alternate ' and " but the cleanest method is probably:

_Alpha = createGroup resistance;
_peh = "I_survivor_F" createUnit [getMarkerPos "Alpha", _Alpha, toString {this setVariable ["dzn_gear", "kit_HIDF_SL"]}, 1, "SERGEANT"];
serene sentinel
#

@granite sky the error is gone, unit spawned. But function this setVariable ["dzn_gear", "kit_HIDF_SL"] doesn't work. (It working from unit's init ingame)

granite sky
#

shrugs

#

I've never used that form of createUnit.

serene sentinel
#

ok, thank you anyway

granite sky
#

Should work in theory :P

#

How are you testing it?

serene sentinel
#

execute script ingame

fickle hedge
#

Is it possible to use the Livonia ambient sounds on other maps? Using scripts?

young current
#

no

#

well you can play sounds sure

#

but not same way as configured ambient sounds work

#

those are defined in the terrain config

mighty bronze
#

Hello, is there any line or script to make a building undestructible but that the glass can be damage so you can shot thru it?

#

Thanks

acoustic abyss
dreamy kestrel
hallow mortar
#

When commands accept objects for their position argument, it's almost always just "use the position of this object". If it's going to be attached in some way, it will be specified (e.g. described as "source" or "object to attach to" rather than "position"), and usually it won't also accept a position in the same argument.
However, since triggers are objects, you can use attachTo on them if you want the trigger to be attached to something.

dreamy kestrel
dreamy kestrel
#

Trying to figure out a couple of things. First, possibly to delete or dispose of a trigger? Using deleteVehicle? Otherwise, if I can create it once and it follows the object. Although the objects in question are not created in perpetuity, so I need to GC triggers from time to time.

hallow mortar
#

Triggers that are attached to an object, using attachTo, follow its position. Otherwise there would be almost no point - that's the basic function of the attachTo command.

#

Since triggers are objects, they can be deleted with deleteVehicle.

dreamy kestrel
#

Next question, re: activation. I am trying to detect objects leaving a particular zone.

private repeating = true;
_trigger setTriggerActivation ["any", "not present", _repeating];

Any meaning how many? All sides, vehicles, etc?
Not present, self explanatory.
Repeating, how repeating?

hallow mortar
#

Attached triggers only follow the direction of the object to which they are attached, not pitch or roll.
This is specifically calling out aspects of the attached trigger's directional facing, and it means that out of the 3 directional axes, the trigger only respects flat 2D rotation. It is not excluding position by omission, position is simply not part of what it's talking about in that example. That entire infobox relates only to the direction of attached objects.
Triggers follow the position of the object they're attached to. If they didn't, this would be a notable exception to the command's functionality, and would be mentioned.

hallow mortar
# dreamy kestrel Next question, re: activation. I am trying to detect objects leaving a particula...

The argument you have there as "any" is the same as the "Type" dropdown in the trigger's Editor attributes. "Any" means any object, without side or playability restrictions, can satisfy the condition (insofar as the trigger uses its set conditions and not a custom condition expression).
The "repeating" argument is the same as the "Repeatable" checkbox in the trigger's Editor attributes. It controls whether the trigger can activate again after it's deactivated.

jade acorn
#

how would I go about locking driver seat for player's AI teammates? for now I have a trigger checking whether any of the teammates are driver and the kicked out, but I would like to make them only take passenger seat or any free seat other than driver

#

When I was playing some missions with AI I noticed that somehow first AI selected will always take the driver seat if it's empty, but there were moments where they automatically go for passenger seat until I specifically told them to take that driver seat, so I'm not sure if this is some FSM I could copy or just a bug

#

and I need to lock driver seat for AI as it can cause dynamic simulation to break when player is a passenger, I need to somehow force the player to always take the driver seat or not take the vehicle at all

dreamy kestrel
stable dune
winter rose
dreamy kestrel
copper raven
#

why would you want to attach a trigger to something?

jade acorn
#

as an area detection for a moving target maybe, but I think there is a dozen of better and easier solutions for it

south swan
#

ad-hoc dynamic simulation. On-vehicle mines. Whatever

jade acorn
#

you can do it with static trigger referring to an attached marker or distance tho, probs

sullen sigil
#

hello everybody its me

is there a way to make only certain players be able to use an addaction or see an addaction in the first place

hallow mortar
#

Yes, the Condition argument of addAction

sullen sigil
#

theres a condition argument?

south swan
#

Or maybe only add the action on their clients 😛

sullen sigil
#

oh so there is

hallow mortar
sullen sigil
#

and yes I am testing in local hosted mp

worthy igloo
#
SQLS_Beacon = {
[] spawn {

    titleText["<t color='#fcca03' size='1.2'>Respawn beacon placed.</t>", "PLAIN", 0.4, true, true];

    private __sqlRB_base = "Land_PortableWeatherStation_01_sand_F" createVehicle screenToWorld getMousePosition;
    _sqlRB_base setDir random 360;
    _sqlRB_base allowDamage false;
    _sqlRB_base enableSimulationGlobal false;
    _sqlRB_base = [missionNamespace, getPosATL _sqlRB_base,"Respawn Beacon"] call BIS_fnc_addRespawnPosition;
    removeAllActions player;
    
    
    sleep 2;
    hint "Respawn Beacon is on cooldown for 5 minutes.";
    sleep 10;
    deleteVehicle _sqlRB_base;
    hint "New Respawn Beacon is available for placement, the old one was removed.";
    player addAction["<t color='#41e310'>Respawn Beacon</t>", "[]spawn SQLS_Beacon"];
    
    };
};
player addAction["<t color='#41e310'>Respawn Beacon</t>", "[]spawn SQLS_Beacon"];
``` why does the deleteVehicle get array error when I try to run
sullen sigil
#

is no longer the vehicle because you overwrite it

south swan
jade acorn
#

does syncing have its counterpart in normal scripting? I mean I have few unsynced mission modules that I would like to assign to strategic map module during the scenario

sullen sigil
#

except putting the addaction inside of the spawn doesn't want to work either

#

sigh

jade acorn
south swan
#

this isn't available inside the spawned code if you don't pass it as an argument 🤷‍♂️

sullen sigil
#

oh

#

is there an emoji more facepalm than facepalm

hallow mortar
sullen sigil
#
if ((getPlayerUID ace_player) in [1234556789]) then {``` inside an addaction should only continue if players id is in the array, right..?
#

want to make sure im not going insane

south swan
#

array of strings

#
if (!hasInterface) exitWith {};
this spawn {
  waitUntil {sleep 1; getPlayerUID player != ""};
  if !((getPlayerUID player) in ["UIDs", "here"]) exitWith {};
  _this addAction ["works?", {hint "yes"}];
};``` werks on my machine (TM)
jade acorn
#

I know I can successfully remove modules from strategic map and these missions are gone from it then

hallow mortar
#

I mean you can try it, I don't know whether it will work. Just something to watch out for.

sullen sigil
#

why an array of strings?

#

...oh

south swan
#

and then you jury-rig some code to add the freshly synced modules to the already running strategic map. And then you decide to completely rewrite it.

worthy igloo
sullen sigil
#

you need two different variables

#

one to keep the vehicle in

south swan
#

you what?

sullen sigil
#

probably

#

in response to mariban

#

serves me right for not reading the wiki r.e whats actually returned

#

thought they were numbers 😭

hallow mortar
# worthy igloo if i change its var name `_sqlRB_base` says undefined

You're saving a reference to the vehicle as _sqlRB_base. Then, a bit later, you're saving a reference to the respawn position as _sqlRB_base - and then trying to refer to _sqlRB_base as if it were a vehicle, even though it now contains the respawn position.
You need to change it so that either the vehicle or the respawn position is saved to a variable with a different name. Which one is up to you.
Remember to account for the change if the variable is used elsewhere in your code.

copper raven
#

if !((getPlayerUID player) in ["UIDs", "here"]) exitWith {};
if it's a large array, you might want to use a hashmap

sullen sigil
#

its an array of like 5 ids tops most likely

south swan
sullen sigil
#

this is working now however it seems to have broken something else which really should not break

sullen sigil
#

so now it doesnt seem to be updating a global variable instead however it is updating the global variable

hallow mortar
#

@worthy igloo You have 2 underscores at the start of the variable when you create the vehicle. The first one is indicating that it's a local variable; the second one is being treated as part of the variable name, making it different from every other time you refer to it.
There's no need to DM me, this channel is for solving problems like this.

south swan
#

"updates global variable instead of updating a global variable"?

sullen sigil
#

what happens in the action is determined by a global variable it updates, that bit works fine

#

however external reading the variable (debug console and trigger conditions) dont seem to work now

south swan
#

any chance to see the actual code (or reproduction)?

sullen sigil
#

yes once second trying to figure out what the actual issue is atm because it seems to briefly update to true sometimes but i cannot tell with an oneachframe of the variable systemchat

#

aha never mind it was to do with where i had placed the check

#

weird funkiness that im too stupid to be able to explain but its working now :)

ruby bronze
#

Hello all, I just discovered that I could do bravo2 setGroupID ["B-2"]; to set the group's callsign in the init, in this case to "B-2" instead of doing it manually.
My question is, how would I also set the group marker's color in this manner?

copper raven
#

marker's?

#

what marker are you talking about exactly?

ruby bronze
ruby bronze
untold copper
ruby bronze
#

I appreciate the try! Sadly it has to be the group icon color that changes (map visible), not the team color (changes player name color)

untold copper
ruby bronze
sullen sigil
#

Got an MP issue

this addAction [ 
"Toggle Object", 
{if Six12th_ObjStatus exitWith { 
Six12th_Obj hideObjectGlobal true; Six12th_ObjStatus = false}; 
Six12th_Obj hideObjectGlobal false; Six12th_ObjStatus = true;}]; ``` seems to do nothing, ~~effect is however only visible upon rejoining I think...~~
works fine in SP (hides object, changes status)
ruby bronze
untold copper
sullen sigil
#

it is a global variable

#

it tells me if the object is showing or not (needed in other script where there is more than one variable, kill 2 birds with one stone)

hallow mortar
#

hideObjectGlobal must be executed only on the server

sullen sigil
#

ah so i presume im just remoteExec there?

hallow mortar
#

No, if you think really hard the server will pick up your brainwaves and know what command you want it to do

sullen sigil
#

that'll be why it wasnt working my brainwaves couldnt even power a clock

copper raven
#

make a function, and remoteExecCall it server side

#

you want to keep Six12th_ObjStatus server side

#

else you will have different values on clients

sullen sigil
#

roger i think i understand

copper raven
sullen sigil
#

needs to flip between two objects in other actions :p

#

wait i can just

#

use one as the "variable"

#

jfc

#

thank you for the help

hallow mortar
untold copper
#

Cheers.

frigid oracle
#

Is there something similar to drawIcon3D but that has occlusion with objects rather than showing through them?

copper raven
#

i don't think so

#

you probably have to do raycasts

frigid oracle
#

oof

frigid oracle
#

is it possible to make a user texture prop that would always turn to face the player?

hallow mortar
#

There are some dedicated user texture props in the game...somewhere, I forget what they're called ("User Texture" probably). Slap your texture on one of those, then use an EachFrame event handler, vectorFromTo, and setVectorDir to make it always face the player

worthy igloo
#

how can i pass private local var from if statement for deleteVehicle

frigid oracle
# worthy igloo how can i pass private local var from if statement for deleteVehicle

are you deleting something for local to a client or the whole server? also to transfer local stuff around calling functions with params is one way to do it.

if (true) then {
    private _localvar = 21;
    private _localvar2 = 63;
    [_localvar1,_localvar2] call TAG_fnc_MyFnc;
};

//in Tag_fnc_MyFnc
params ["_passedvar1", "_passedvar2"];

the names in params are used in that function and just represent the passed data. You can name those what you need to keep track of things

copper raven
hallow mortar
# copper raven declare it in the upper scope

Expansion: variables created in an if scope are destroyed when it ends. But if it existed before the if scope, it won't be destroyed, and any changes made in the if scope will be saved.

frigid oracle
worthy igloo
hallow mortar
#

Before the if starts, just put private _cmLight = objNull;

#

Then the variable is created outside the if scope and won't be destroyed when it ends

worthy igloo
#

once its replaced _cmLight doesnt get deleted tho

#

@hallow mortar

hallow mortar
#

Try removing private from the definitions inside the ifs (not the one right at the start)

worthy igloo
#

wrkd

frigid oracle
ripe sapphire
#

yo bros how do i spawn a smoke grenade but not have it pop smoke? (i.e a smoke grenade with the safety pin on)

hallow mortar
#

Create its model as a simple object

ripe sapphire
hallow mortar
hallow mortar
#
  • by not a physics object I mean it won't fall or get bumped. It will still have collision.
#

If you do need it to do physics you can fake it by attaching it to an invisible tin of beans or something

ripe sapphire
#

so create a simple object and then attach it to the invisible object?

#

im trying to figure out how ace does it with their advanced throwing mode

copper raven
#

the "preview" animation?

hallow mortar
#

I'm pretty sure ACE is on GitHub so you can just look at how they do it

ripe sapphire
ripe sapphire
#

it still explodes for me

copper raven
#

not possible

#

if you disable it's simulation, it won't explode

ripe sapphire
#

i disabled its sim then attached it, could the attach enable simulation back?

#

i notice the ACE one didnt use any attach

hallow mortar
#

Yes, it inherits simulation from what it's attached to

copper raven
#

attachto does force simulation iirc

ripe sapphire
#

oooof so thats why

hallow mortar
#

(this causes some fun effects if you attach animated things to objects with very low simulation frequency)

copper raven
#

just create a simple object

#

it should work then

ripe sapphire
#

then i guess ace continously sets its position to a certain point in relation to the player?

copper raven
#

yes

#

but have you tried simple object?

#

(with attaching)

ripe sapphire
#

thanks, i think its really important to figure out how things are done especially by other people

ripe sapphire
ripe sapphire
#

it works nicely with createSimpleObject and attachTo. Thanks guys!

ivory lake
#

you might want to use the magazine model rather than the cfgammo as cfgammo generally will have the pin removed

#

if that's what you want anyway

naive needle
#

Heyy, does someone has a idea how to convert magazinesAmmoCargo to a shorter format, which includes duplicates with the same amount of bullet ([_Magazine,CountOfMagazine,BulletCount]) ?

copper raven
#

use a hashmap

austere swan
#

Good Morning all. i'm trying to figure out why this isen't working properly.
When i first upload the mission it works fine and disables all side chat channels, but randomly on mission restarts or reloads it will fail sometimes and work sometimes.

Any ideas?

//--- Control Chat - Format: {channelID<number>, disableChat<bool>, disableVoice<bool>}
disableChannels[] = {
{0, true, true}, //--- Global Chat
{1, true, true}, //--- Side Chat
{2, true, true}, //--- Command Chat
{3, false, false}, //--- Group Chat
{4, false, false}, //--- Vehicle Chat
{5, false, false}, //--- Direct Chat
{6, true, true} //--- System Chat
};

warm hedge
#

How about replace true to 1 false to 0? A config won't take true/false

hallow mortar
#

Bool is how it's documented on the wiki

warm hedge
#

But it is not how it is whatsoever, yeah I agree we need to fix the BIKI tho

winter rose
#

#define true 1
#define false 0

I believe Description.ext has that already defined, can anyone confirm?

copper raven
#

it just gets stringified

proven charm
#

i have always used true/false in configs

copper raven
#

you can only have arrays, strings and numbers in a config

#

if it's none of the above, whatever value it is it just gets stringified

proven charm
#

In description.ext it seems to work otherwise my scripts were broken

copper raven
#

seems to work what?

proven charm
copper raven
#

what attribute?

proven charm
#

my own classes etc

astral bone
#

So, is it a good/bad idea to put functions into a script file?

#

multiple into 1*

#
// into a single file, called "functions.sqf";
somefunction = {};
somefunction2 = {};
copper raven
#

bad

astral bone
#

ah. horray 😅

copper raven
#

use cfgfunctions

astral bone
#

oh riiiight

#

thanks :P

#

how do I store values between script/function calls?

#
_times_called=1;

ELEVATOR_RegisterShaft = {
  _times_called=_times_called+1;
}

so like this. '_times_called' is only for the file it's in, but it's not reset everytime you call the function.

#

basically, I am used to other coding languages, so this confuses me 😅

#

Used to having all stuff in a single file.

hallow mortar
#

Make a global variable and give it a unique name e.g.

ratchet_functionName_timesCalled = ratchet_functionName_timesCalled + 1;```
astral bone
#

where would I define the global?

hallow mortar
#

Or, well, to account for the first time when it's not defined:

ratchet_functionName_timesCalled = (missionNamespace getVariable ["ratchet_functionName_timesCalled",0]) + 1;```
astral bone
#

oop heh

#

Can it be array's as well?

#

I could probably check actually

hallow mortar
#

The variable can contain anything, but if you want to use it as an iteration counter, a number is all you need

astral bone
#

Yea. Hmm- if I wanted to store multiple things, would it be better to get seperate variables or an array with the stuff I need?
So say I wanted these two to be kept between calls:

ELEVATORS_Shafts = [];

last_id=1;

Would having a public variable with an array with the first position being a number for last_id, 2nd position being the shaft's array, or global variables for shafts and a seperate global for id?

#

also thank you btw 😅

worthy igloo
#
    _detTrigger setTriggerStatements [toString {call{this && (local player) && (vehicle player in thisList)}},
        "
            ""Players have arrived at crash site and the self destruct has been started."" remoteExec [""hint"", 0];
            [] spawn {
                sleep 60; 
                private _pos =  getpos (objectFromNetId '"+netID _UH60Wreck +"');
                private _DestroyWreck = createvehicle [ 'ammo_Missile_Cruise_01',"+str(getPos _UH60Wreck)+",[], 0, 'can_Collide']; 

                sleep 0.5;
                deleteMarker '"+_marker+"';
                deleteVehicle objectFromNetId '"+netID _UH60Wreck +"';
                deleteVehicle objectFromNetId '"+netID _fireObj +"';
                deleteVehicle objectFromNetId '"+netID _Holder1 +"';
                deleteVehicle objectFromNetId '"+netID _Holder2 +"';
                deleteVehicle objectFromNetId '"+netID _Holder3 +"';
                deleteVehicle objectFromNetId '"+netID _Holder4 +"';
                deleteVehicle objectFromNetId '"+netID _Holder5 +"';
                deleteVehicle objectFromNetId '"+netID _Holder6 +"';
            };
        ",
        ""
    ];
``` does anyone know why this wouldn't delete anything except the marker
winter rose
#

why would you delete this way e_e

winter rose
#

see BIS_fnc_netId/BIS_fnc_objectFromNetId

astral bone
#

ratchet_elevatorHandlingData_lastId = (missionNamespace getVariable ["ratchet_elevatorHandlingData_lastId",1]);
so from then on, ratchet_elevatorHandlingData_lastId = 2 and similar would set the missionNamespace varaible right?

#

or-

#

or would I need to do setVariable for the missionNamespace getVariable to return something other then 1?

winter rose
#
ratchet_elevatorHandlingData_lastId = 2;
// same as
missionNamespace setVariable ["ratchet_elevatorHandlingData_lastId", 2];
```(given you are not in UI context)
astral bone
#

Well see, I have a value I want to keep between function/script_file calls.

#

oh no wait im dumb

#

You were saying yes to me basically xD

winter rose
#

yes 😁

#

just, don't think it synchronises on the network this way - that's all 🙂

astral bone
#

Arma and SQF is confusing xD

#

Not sure if that's a good or bad thing tho ;P

#

I don't think I need it to be syncronized- atleast not yet.

#

I wanna mention this b/c- idk- maybe you can give me shortcuts or something xD

winter rose
#

then just use val = 0; val = 1
and if isNil "val" then { val = 0 };

hallow mortar
hallow mortar
#

Oh, hang on, I misread that. Forget I mentioned it

astral bone
#

is it ok if I write a text wall about what I am intending to do, by chance? 😅

fluid wolf
#

...does SetVectorUp not work on objects made from createVehicleLocal? I can't seem to get some light refractors I made actually rotate from the script that makes them.

#

I got them to rotate in the console when I was debugging the initial code but now that they're in an .SQF it seems like its just ignoring the entire line no matter how I do it.

hallow mortar
#

No reason it wouldn't.
Are you attaching them to anything? Keep in mind that their orientation will be reset if you use attachTo, so make sure to do your setVectors after that

fluid wolf
#

I am not attaching them to anything

hallow mortar
#

🦀 give code 🦀

fluid wolf
#
_TLight1 = "#lightreflector" createVehicleLocal [17245.8,13335.9,7.82]; 
_TLight2 = "#lightreflector" createVehicleLocal [17253.1,13363.2,7.24]; 
_TLight3 = "#lightreflector" createVehicleLocal [17260.4,13390,6.9]; 
_TLight4 = "#lightreflector" createVehicleLocal [17268.4,13418.1,6.35]; 

_Tunnellights = [_TLight1,_TLight2,_TLight3,_TLight4];
{
_x setVectorUp [0,-1,0];
_x setLightIntensity 4000; 
_x setLightAmbient [1.0, 1.0, 1.0];  
_x setLightColor [1.0, 1.0, 1.0]; 
_x setLightAttenuation [2, 2, 2, 4, 1, 100]; 
_x setLightConePars [120, 45, 0.75]; 
} foreach _Tunnellights;```
winter rose
#

tabs - use them

fluid wolf
#

I haven't yet gotten to the cleanup yet this is still in a very rough state... but it should work

hallow mortar
#

I don't see any apparent flaws in that. I assume you've tried it with different vectorUp values?

fluid wolf
#

I have, nothing seems to change the light direction.

#

if I run that in the debug console it works fine.

#

but trying to run it from an .SQF just makes it ignore SetVectorUp

hallow mortar
#

Weird.
If there was a problem that could be caused by that, you'd expect it to also screw up the light properties commands.
Well, I'm out of ideas. Hopefully someone else will have better insight.

astral bone
# astral bone is it ok if I write a text wall about what I am intending to do, by chance? 😅

So what I'm trying to do is make it so there's doors and pads. Door will teleport you to any pad it can access.
Plan right now is to have a game logic syncronized to all the doors and pads. Doors will have "door" in their vehicleVarName, and floors 'floor'
I am thinking I have an 'init' function get called by the game logic and it runs through and gets all the doors it's sync'd to and gives them an action. Action runs through the sync'd items finding all floors. Once all floors are gotten, it then gives a window and it lets you select the floor. I am thinking the floor can be sorted via 'ELEV_FLOOR_#' but for naming it uses the floor order. Basically Floor_2, Floor_4, Floor_5 would become Floor 1, Floor 2, Floor 3. Then you click on the floor you want and it teleports your character there.

runic edge
astral bone
#

Yes, I think- unless I'm forgetting something xD

runic edge
#

I have a similar thing running in my mission and we're using addactions. In the initPlayerLocal.sqf you add your

door1 addAction ["foor1","scripts\floor1.sqf",["foor1"],1.5,true,true,"","true",5];
door1 addAction ["foor2","scripts\floor2.sqf",["foor2"],1.5,true,true,"","true",5];
door2 addAction ["foor1","scripts\floor1.sqf",["foor1"],1.5,true,true,"","true",5];
door2 addAction ["foor3","scripts\floor3.sqf",["foor3"],1.5,true,true,"","true",5];
// add any number of lines to match all possibilities

in each floor#.sqf you put

_tele = _this select 0;
_caller = _this select 1;

_caller setPos (getpos floor#);

not sure if this is the sexiest way to do it but it should get you what you want !

south swan
#

O(n^2) by hand blobcloseenjoy

astral bone
#

Oh yea, no, I thought ya meant will it change after mission start.
I want a system that requires minimal modification to if I want to make another elevator 'shaft' and/or add floors. :P

mighty bronze
#

Hello, is there anyway to make a player respawn with his starting loadout? Not with the loadout that he had before he die.

naive needle
#

How do I switch vars from sqf missionProfileNamespace to another profile ?

I was reading that you can transfer mission saves between profiles

fluid wolf
#

the second alone does not move the light, the first does not move the light. But the second following the first does.

hallow mortar
#

¯_(ツ)_/¯

fluid wolf
#

Arma things

jade acorn
#

so player setface "AsianHead_A3_04_sick"; player setHit ["Head",0.5] adds a malaria-infected head to player, how can I make the malaria rvmat to show on whole body? Are there certain uniforms that have this enabled? changing setHit to full body or just applying damage shows malaria head + normal bloodied body

#

google didn't help at all, most results about "sick units" or "infected units" are about toxic A3 groups wedoalittle

hallow mortar
#

I think there's a set of special base unit classes you have to use

jade acorn
#

I remember there was a mod that enabled these by default, as I need them for scenario purposes i'd prefer using that mod instead of making my own redundant patch, perhaps you know that mod's name?

astral bone
#

i think i might be running into an issue-

if((vehicleVarName _x) find "DOOR" > -1)then{
        _x setVariable ["ELEVATOR",ratchet_elevatorHandlingData_lastId,true];
        _x addAction ["Elevator",
            {
                params ["_target","_caller"]; 
                if isNull _target then {hint "Target Null";}else{
                hint "Target Not Null";
                };
                
                _str=str(_caller);
                diag_log "[ELEVATOR_DIAG] HINT: "+ _str;
                
            }
        ];
    };
#

addAction shows that the params are not null, but when told to send them out as a string, it's blank, just ''

hallow mortar
#

I can't think of a reason why _target would ever be null. It's the object the action is attached to, if that object was null you wouldn't be able to do the action. So that check shouldn't be necessary.

#

_caller also shouldn't ever be null because if there is no caller, you didn't do the action

astral bone
#

well no, it's not null.

stable dune
#

if (isNull _target) then {};

astral bone
#

idk what it is

south swan
#

diag_log "[ELEVATOR_DIAG] HINT: "+ _str; works like (diag_log "[ELEVATOR_DIAG] HINT: ")+ _str;

hallow mortar
#

That'd do it

#

Get you some () in there to fix your order of operations

south swan
#
//code
diag_log "[ELEVATOR_DIAG] HINT: "+ _str;
diag_log ("[ELEVATOR_DIAG2] HINT: "+ _str); 

//log
17:21:15 "[ELEVATOR_DIAG] HINT: "
17:21:15 "[ELEVATOR_DIAG2] HINT: B Alpha 1-1:1 (artemoz)"```
open hollow
astral bone
#

oh- the '' wasn't an empty string, it was the end of the log 😅

#

ok, now, addaction. If I do "AddAction" on server, will it add actions for the players? or?

naive needle
#

@open hollow thats what I thought, it would have been cool to have a command to access the vars from another not active profile

south swan
astral bone
#

wait also, would it add actions for all players

fair drum
astral bone
#

ok so I'd need to- uh- how would I tell it to execute on the connected clients and the newly connecting clients? 😅

fair drum
#

do you want this action to exist at mission start? then write it in initPlayerLocal.sqf or in init.sqf with a if (hasInterface) then {} filter

#

if you want the server to send it out you use:

[_object, [/*action array here*/]] remoteExec ["addAction"];
astral bone
#

The server gets objects, then it should make those objects have add action for players.

fair drum
#

what?

astral bone
#
_so = synchronizedObjects _logic;
diag_log "[ELEVATOR_DIAG] SO: "+str(_so);
{
    diag_log "[ELEVATOR_DIAG] DOOR:"+str((vehicleVarName _x) find "DOOR");
    if((vehicleVarName _x) find "DOOR" > -1)then{
        _x setVariable ["ELEVATOR",ratchet_elevatorHandlingData_lastId,true];
        _x addAction ["Elevator",
fair drum
#

oh you're making a module?

#

is your module set to global or no?

astral bone
#

uhhhhhhhh-

#

module?

fair drum
#

nvm then

astral bone
#

I want to have addaction be done on current connected clients and any clients that connect later. But the add action isn't ready when the mission starts.

fair drum
#

ok, then you need to to the remoteExec way but add a 3rd argument in there that allows it to exist for JIP

astral bone
#

network stuff really confuses me, sorry 😅

south swan
#

option a: leave your code in the Logic's init, it gets executed everywhere
option b: only execute your code on the server, let it use remoteExec with the 3rd argument set, so the server makes every client execute the code
🤷‍♂️

astral bone
#

ohhh ok

fair drum
#

oh i didn't realize you were using an init box?

astral bone
#

init box is directing it to a function file

south swan
#

doesn't really matter. Everybody execute Init box when mission starts for them

astral bone
#

so ```sqf
[_x,["Elevator",
{
params ["_target","_caller"];
_str=str(_target getVariable "ELEVATOR");
diag_log ("[ELEVATOR_DIAG] HINT: "+ _str);

        }
    ]] remoteExec ["addAction",0,true];
should be it?
#

_x is from a foreach loop

#

oh yay :P

winter rose
#
params ["_target","_caller"]; 
diag_log format ["[ELEVATOR_DIAG] HINT: %1", _target getVariable "ELEVATOR"];
astral bone
#

setVariable public , will the value be right for new connecting clients too or?

astral bone
boreal parcel
#

is there a way to get all of the objects that are attachTod a vehicle?

#

trying to get their positions

hallow mortar
boreal parcel
#

will this also give me the objects relative attachedTo cords perhaps?

hallow mortar
#

Return Value:
Array of Objects attached to the given object
So, no

boreal parcel
#

gotcha, any idea how I would go about that?
I am trying this but it keeps saying im missing a semi-colon ;

private array = [];
{
    // Current result is saved in variable _x
    array append [getPos _x];
} forEach (attachedObjects _this);
copyToClipboard str array;
hallow mortar
#

getPosASL -> ASLtoAGL -> worldToModel

boreal parcel
#

so like so?

private array = [];
{
    // Current result is saved in variable _x
    array append [_x worldToModel ASLToAGL getPosASL _this];
} forEach (attachedObjects _this);
copyToClipboard str array;
#

and any idea what the missing semi-colon is about? wont stop throwing the error

#

nvm, guess I fixed it by removing private

zealous night
#

Any way to make this script range limited?

boreal parcel
zealous night
#

So like this?

boreal parcel
#

I believe so yes, those quotes may cause errors though not sure how arma handles it

hushed tendon
#

I have a function that I'm trying to get it to return an array but I'm running into an issue where it says it's expecting code. Anyone know how to do this?

hallow mortar
hallow mortar
hallow mortar
hushed tendon
hallow mortar
#

Well, there doesn't appear to be anything wrong with how you're calling it, so the problem must be with something inside the function

hushed tendon
#

when I do this it works but if I try and return it as an array it throws an error saying code expected ```sqf
// Inside someFunction
_someArray = [1,2,3];
{_someArray};

hallow mortar
#

If your function literally only contains

_someArray = [1,2,3];
_someArray;

Then that should work. There is nothing in there that expects code, and the last return in the function is what it returns, with no requirement about what type it is.
This leads me to suspect that the function actually contains different code. From my point of view, that different code could be literally anything, so I can't troubleshoot it.

granite sky
#

if you actually put {_someArray}; at the end of your function when you're just trying to return an array then you're doing it wrong.

#

maybe a misunderstanding about what {} brackets do.

hushed tendon
granite sky
#

huh.

#

whatever, you've missed something out of your description then.

hallow mortar
#

The use of phrases such as "something like" when posting the code really makes me think that this is not the actual code, the actual code is doing something critically different, and that's what's broken

hushed tendon
#

I found this issue. The array was messed up because I compiled the function incorrectly

#

Thanks for the help

plush belfry
#

Is there any way to reset/manipulate building doors? I got the class name of the building, but kinda lost on where to go from here. "Land_i_Barracks_V1_F"

dreamy kestrel
#

Q: how do I clear the animation move I have a unit in?

plush belfry
dreamy kestrel
#

okay it 'works' basically; I may need to couple that with some random waypoints or something, but the fundamentals are working

hallow mortar
plush belfry
ivory sphinx
#

I have gone ahead and setup my mission to start with loading up in a CH-47F and performing a paradrop at a move marker some distance from main base. I've scripted it, so at the move waypoint you paradrop at, you automatically replace your backpack with a parachute upon ejecting. How would I go about setting it up so after landing you receive your backpack with all the gear in it from at the start of the mission? Any help is much appreciated.

hallow mortar
#

Before you replace the backpack, save backpack _unit and backpackItems _unit as variables. Then waitUntil {isTouchingGround _unit} and use addBackpack and addItemToBackpack to give them back their stuff

south swan
#

or create parachute as a vehicle and move player to its driver position without changing the backpack. Or drop backpack somewhere with an action and then move it back. Or...

hallow mortar
#

Creating the parachute as a vehicle only really works if you don't want the player to control when they open their chute

pulsar bluff
#

to handle edge cases

hallow mortar
#

This would probably be a case where the z component of getPos is actually useful 🤔

south swan
#

or objectParent :3 After a person had a parachute parent and then has none - they're no longer hanging from it

hallow mortar
#

I'd be inclined to avoid that because if they never pull their chute (maybe if they're invincible from a safety system, or if they're just an idiot and go splat) it will never trigger, which is a little untidy

plush belfry
hallow mortar
#
_doorString = format ["bis_disabled_Door_%1",_x];```
blazing zodiac
#

Hey all, quick question. When we use player object as a parameter for a remoteExec on the server (or, anytime an object is sent over the network) is it just a reference to the object we're sending or is it more than that? Basically, is it worth only sending a netID across and getting the player object from that on the server side to trim network traffic?

winter rose
blazing zodiac
#

OK great! I figured as much but wanted to make sure I wasn't wasting the network traffic

#

Sidenote, I've been thinking about headless clients a lot lately and their impact on a server like Exile with tons of different AI mods, loot, etc. I'm curious, if we offload these systems to headless clients and rotate the headless clients in and out of the server throughout a session, could we theoretically extend the reasonable length (until server performance dips low enough to need a restart) by a substantial amount since we'd be able to handle a lot of the cleanup that requires server restarts without actually restarting the server. Basically, we'd just have headless clients that run each system join, do their work for say 1 hour, then have another queued to join, hand over ownership to the newly joined HC, and leave and restart the first one, then rinse and repeat.

#

Does this seem like something that sounds viable/anyone's attempted before?

lusty hollow
#

Is there a way to tell that target is firing countermeasures?

pulsar bluff
tender silo
#

hey, what's the easiest up to date way of saving output of a script to a txt file?

hallow mortar
astral bone
#

I cant make a UI with sqf right?

south swan
#

you can

astral bone
#

A window with a few buttons?

south swan
astral bone
#

Ooooo. Yay :3

hallow mortar
#

Config is definitely the easier way to do it though. It doesn't have to be a mod, you can include it in mission description.ext

astral bone
hallow mortar
#

#arma3_gui or #arma3_config probably.
It's easier than you might think, there are tools you can use to build your GUI visually and autogenerate the config

stable dune
#

Hello, is there another way to get last five rounds of magazine to tracers than config magazine?

south swan
#

sane ones: no

#

insane one: "Fired" EH that checks for weapon/magazine class and remaining bullets, and replaces the bullet with another one

stable dune
#

Yeah, that was what i build but I think there is no any sense do via that

plush belfry
hallow mortar
#

It goes inside the forEach (hence the reference to the magic variable _x), before the setVariable. _doorString contains the final combined string, which you then plug into the setVariable

naive needle
#

Just a info, maybe some people know it already. You can use setVariable on Backpack/Vest/Uniform , which is also getting saved when you put it inside a container and pick it up again, because the Vest for example has a object connected to the item.

stark granite
#

Howdy folkes! Would love a hand figuring something out,

I'm currently using an event handler for BIS_fnc_respawnBackpack functionality via WeaponAssembled with a isKindOf "Camping_base_F" locking it together.

I'd like to know if its possible to share the new respawn point across a group or side? Currently the functionality works for the player who placed it or those nearby, currently using a larger map so makes reinserting a tad difficult. I'm already using some code to act as a timer to remove the tent after a set period.

Handles respawn camps functionality. Whoever "assembles" a camp from backpack it will receive a new respawn position. When backpack object has 'respawnNearbyPlayers' attribute set to 1, nearby players will receive the respawn position as well.

Is there a way to pull the appropriate respawn point from the event handler and share it across?

Thanks in advance for any help!

edit:

private _nearPlayers = [[[],[player]] select (typeOf player != "VirtualCurator_F"), playableUnits select { isPlayer _x && { _x distance _campObject < 50 } }] select isMultiplayer;

Seems to currently only detect players within 50m, ideally it would detect all players

astral bone
#

for sqf ctrl, how do I determine what is infront and what is behind?

#

oh wait, that doesn't solve my issue 😅

astral bone
#

remoteExec can work from client to Server right?

winter rose
#

yes

astral bone
#

Do I have to manually pass the client who's calling it?

#

A referance to the client.

#

also trying to think of how to make this secure xD

#

[player,<object>] remoteExec [rathcet_fnc_elevatorTeleport,2];
This needs to be made more secure I think, but would this work? Sends the player object on the client and the object the player wants to teleport to.

#

Again, it needs more security but still x3

#

oop

#

10:20:31 "[ELEV_TELE]: B Alpha 1-1:1 (CT-4474 Lost) _ ELEV_FLOOR_8"
yay

#

horray!!

#

i mean, like I said, horribly insecure, but eh. It's a good start I feel :D

winter rose
fair drum
#

whats the best stringtable editor out there for arma 3, that will easily allow me to add strings to an existing table?

#

there's like 4 listed on the wiki

winter rose
#

the one you like most

fair drum
#

well dedmen's one crashes every time I try to add a key lol. let me try a different one

stark granite
winter rose
stark granite
#

Before I do

#
{
            default { [] };
            case 1: { ( units group _campMaster ) -_campUsers };
            case 2: { ( allPlayers -_campUsers ) select { [side group _x, _campSide] call BIS_fnc_areFriendly } };
            //case 3: { ( allPlayers -_campUsers ) };
        };
winter rose
#

I have no idea how the system works, I just wanted to point out you were not using quotes

stark granite
#

This suggests different mods for the tents? one of them already allowing everyone by the looks

#

any idea how to change the modes?

#

or if different tents have different modes already?

#

I will have a play! Cheers!

#

4 tents, 3 modes.. testing time...

B_Patrol_Respawn_bag_F
B_Respawn_TentDome_F
B_Respawn_Sleeping_bag_F
B_Respawn_TentA_F

fleet sand
winter rose
fleet sand
#

Is it possible at least to get the position of a comment and title in mission or nah ?

winter rose
fleet sand
winter rose
fair drum
#

this a valid macro?

#define STRTAB(STRING) format [localize STRING, "<br/>"]
#

don't want to have to keep typing format [localize "mySTR", "<br/>"]

winter rose
#

I'd say "no" because of the quote signs

fair drum
#

oh for the argument?

velvet merlin
#

looking for algorithm design ideas for efficient mortar/arty target decision making

#

like a threat map essentially

#

however needs to be efficient as checking all units/groups to determine if known&suitable can be easily quite costly with ~50-100 groups and up to 150 active targets

fleet sand
compact schooner
#

I was wondering if I could get some help with a little project, I'm using the Alive system to create some units and I wanted to know if I could get some help adding Uniform, helmet, and gun randomization to the units?

pseudo hemlock
#
_this params [
    ["_unit",objNull,[objNull]]
];

if ((isNull _unit) || !(alive _unit)) exitWith {
    ["<UNIT> was passed as <NULL> or <UNIT> is not alive! Function Terminated!"] call BIS_fnc_error;
}

// Remove units weapon
removeAllWeapons _unit;

// A list of all possible weapons to give & Their ammo
_weaponList = [["arifle_Katiba_GL_ARCO_pointer_F","30Rnd_65x39_caseless_green"],["arifle_MX_GL_ACO_pointer_F","30Rnd_65x39_caseless_mag"]];
// Select a random weapon
_weaponAndAmmoSelected = (selectRandom _weaponList);
// Give Selected weapon
_unit addWeapon (_weaponAndAmmoSelected select 0);
// Add 5 Magazines to the unit
_unit addMagazines [(_weaponAndAmmoSelected select 1),5]; ```
compact schooner
#

thank you, ill try to put this to use.

mystic delta
#

Is there a trigger condition that is activated by a drone moving in it?

stable dune
pseudo hemlock
frigid oracle
#

is it possible to spawn a prop at the site of a bullet hit?

mystic delta
#

@pseudo hemlockI'm trying to create a service pad for drones

pseudo hemlock
#

Service pad?

mystic delta
#

// Example _mytrigger setTriggerStatements ["driver vehicle player == player && (vehicle player) distance myairpad < 15 && (vehicle player iskindOf 'Air') && ((speed vehicle player) < 10)", "","

#

@pseudo hemlock yes

pseudo hemlock
#

You want them to rearm and fuel?

mystic delta
#

I want it to set off a trigger so I can use it to call a function

south swan
#

in my testing trigger with "ANY" activation does react when UAV gets inside it. So probably thisList findIf {unitIsUAV _x} > -1 in the condition should be enough

mystic delta
#

@south swan Thanks!

pseudo hemlock
#

Condition doesn't add up

#

you're wanting a player controlled vehicle

south swan
#

trigger condition that is activated by a drone moving in it?

pseudo hemlock
#

@south swan does (vehicle player) return the drone when you control it?

south swan
#

it shouldn't 🤔

#

and it doesn't

molten parcel
#

What's the correct syntax for forceWeatherChange?

copper raven
molten parcel
#

hmm Wasn't doing anything

copper raven
copper raven
flint topaz
#

so I have an object so I therefore have it's vectorDir, vectorUp and getDir (So I know it's yaw), but I want to have the pitch and roll so I can manipulate it and then save it.
essentially I want to do the exact opposite of example one from this:
https://community.bistudio.com/wiki/setVectorDirAndUp

molten parcel
#

Server was peasoup fog and rainy and seemed stuck.

#

tried to change those with setFog and setRain, but it reverted back within a second.

molten parcel
#

neg. It's on a KP LIb server

flint topaz
#

that was initially what I was looking at but I can never get it to give me the right results

south swan
#

two possible failure points: executing not on server and mission not having "Manual Control" enabled 🤷‍♂️

south swan
molten parcel
south swan
flint topaz
# south swan define "right", and how does what you get differ from that?

https://imgur.com/a/PGjOK77 (The ones sticking up are the ones this code is generating) the ones that look right are the ones I'm trying to get the data from

.. (Code before that creates the _object)
   (_x is the original)
    private _dir = getDir _x;
    private _pitchBank = _x call BIS_fnc_getPitchBank;
    private _pitch = _pitchBank select 0;
    private _roll = _pitchBank select 1;
    
    _object set3DENAttribute ["Rotation", [_pitch,_roll,_dir]];
south swan
#

get3DENAttribute then, if everything happens in the editor?

flint topaz
#

my imgur isn't working wait one

flint topaz
#

I have all the other data just not that

#

so I have vectorDir and vectorUp

#

and whatever else I want

south swan
#

imgur still doesn't show a thing

#

and does setting 3DENAttribute when the scenario is running even do anything? I'm confused

stark granite
#

Cheers for the help guys! 🙂

stark granite
granite sky
#

Should be a drop-in replacement, like this:

[_rallyPoint,"createmarker",_objectName,_player] remoteExec ["BIS_fnc_initRespawnBackpack",_units];
stark granite
#

Ty 🙂

plush belfry
#

Is there a way to turn on the Decon Shower's Sprinklers using a script?

#

"DeconShower_01_F"; Here's the classname, I wasn't able to find anything specific about turning on the shower in the CFG

plush belfry
#

[deconheal,1.5,9] spawn bin_fnc_deconShowerAnim;

Found out how to enable it, but how can I disable it?

granite sky
#

store the handle returned by the spawn and terminate it, maybe.

plush belfry
granite sky
#

However you store anything else really. I don't know what the conditions you're changing state on.

#

setVariable on the object seems reasonable if it's separate chunks of UI.

plush belfry
#

and the trigger is set to activate when any player is in it

granite sky
#

Could setVariable on the trigger instead then.

#

If there's only one shower then either is fine.

plush belfry
#

aight ill look into it ty

kindred zephyr
#

is there any diag command that serves the purpose of checking broadcast size of variables?
Im doing a heavy variable transfer every once in a while that causes some heavy lag but idk how to diagnose properly, would it be better if i divide the variable value in chunks and broadcast them instead? Or is it better to do the whole value transfer and be done with it even if it means a couple of minutes of lag?

#

im not that network savvy sadly

granite sky
#

Arma has to divide those into chunks anyway, because it's UDP. How efficiently it does that, I don't know.

#

What are you transferring that causes "a couple of minutes of lag"?

kindred zephyr
#

remember the very long ass array i mentioned a couple of days ago?

#

the operation time and the time in which a slight desync occurs when the ransfer is happening is "acceptable" but I would like to minimize that last one

#

its either that or to find a proper way to seed a random selector so i can transfer that parameter instead of the result :p

#

and since selectRandom doesnt take seeds, well, i guess its better to optimize the size

granite sky
#

You can use the seeded random forms to do a selectRandom. Just need to be a bit careful about the top of the range.

#

but this sounds like you're making clients grind through nearestTerrainObjects for two minutes on connection :P

kindred zephyr
#

its being handled by server and clients are just using the array to do stuff

#

but the array is really big

blazing zodiac
#

I remember way back 8 or 9 years ago we needed to remove all the event handlers and variables on an object because deleteVehicle left them taking up memory. Is this still the case or has it been updated to cleanup properly?

granite sky
#

Not sure how you'd tell. Arma is just a mass of memory leaks :P

#

I'd be amazed if it didn't leak something if you repeatedly created and deleted vehicles.

blazing zodiac
#

Fair point lol, but still I'd like to do what I can to keep it as clean as possible

#

I know for sure the variables and event handlers around the game's release needed to be manually removed in conjuction with deleteVehicle but I'm not sure if that's still the case

granite sky
#

Seems like a pretty obvious fix candidate if anyone knew about it.

#

I've only been working with Arma for a couple of years and I haven't heard of this.

blazing zodiac
#

OK cool. It's likely been fixed then if it's not still being talked about. Like I said, this was wayyyy back in like 2013, 2014 so things have changed a ton since then

#

You can see here in the Exile Garbage Collector (from that era) that you needed to much more than just delete the vehicle

/**
 * ExileServer_system_garbageCollector_deleteObject
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_object", "_fliesSound", "_fliesParticles"];
_object = _this;
if (_object getVariable ["ExileIsSimulationMonitored", false]) then
{
    _object call ExileServer_system_simulationMonitor_removeVehicle;
};
_object removeAllMPEventHandlers "MPKilled";
_object removeAllEventHandlers "Dammaged";
_object removeAllEventHandlers "GetIn";
_object removeAllEventHandlers "GetOut";
removeAllActions _object;
clearBackpackCargoGlobal _object;
clearWeaponCargoGlobal _object;
clearItemCargoGlobal _object;
clearMagazineCargoGlobal _object;
removeAllContainers _object;
if !(isNull (attachedTo _object)) then 
{
    detach _object;
};
_fliesSound = _object getVariable ["ExileFliesSound", objNull];
if !(isNull _fliesSound) then 
{
    deleteVehicle _fliesSound;
};
_fliesParticles = _object getVariable ["ExileFliesParticles", objNull];
if !(isNull _fliesParticles) then 
{
    _fliesParticles setDamage 999; 
};
{
    _x call ExileServer_system_garbageCollector_deleteObject;
}
forEach (attachedObjects _object);
deleteVehicle _object;
granite sky
#

That smells like a lot of "just being careful" though. weapons/items/magazines have no existence outside of a container.

#

Attached objects do persist (often left floating in mid-air). Backpacks are a bit more interesting.

blazing zodiac
#

agreed about the weapons/items/magazines part

#

but the rest was standard practice back then

fair drum
#

can anyone confirm that a unit needs to be readded to a custom radio channel after they respawn? Cause it seems like it is the case, but it is not documented.

copper raven
#

i don't recall such behavior

blazing zodiac
#

could've been misinformation I suppose, but I remember it being spread around fairly frequently

worthy igloo
#
    for "_i" from 0 to 1 step 0 do {
        if (isNull _UH60Wreck) then {
            [] spawn {
                sleep 30;
                [] spawn DTRP_CreateUH60Crash;
            };
        };
    };
``` why would this cause my game to crash
warm hedge
#

What is DTRP_CreateUH60Crash?

worthy igloo
#

spawns a a wreck and some stuff in a random location

warm hedge
#

Not the summary but code please

#

Oh well now I get it

#
for "_i" from 0 to 1 step 0 do {
    if (isNull _UH60Wreck) then {
        [] spawn {
            sleep 30;
            [] spawn DTRP_CreateUH60Crash;
        };
    };
};````step 0` here causes it
dapper ether
jade acorn
#

pre-place them with waypoint and use hide module with trigger to show them again when needed, unit hidden with module will have disabled simulation so they won't move

dapper ether
#

i have manage to get everything to work, i can now make my dream game.

copper raven
warm hedge
#

inc stands for include or something, most likely it is just do nothing but to be included into some file else

stable dune
#

Hi, if you can add setFlyingHeight to plane, is there reverse command to get flying height of vehicle?

quartz blade
#

`vs_fnc_spawnReinforcements = {
if (time < missionNamespace getVariable ["vs_supportCoolDown", 0]) exitWith {
[side player, "Base"] sideChat "Support not available";
};
vs_supportCoolDown = time + 900;

[side player, "Base"] sideChat "Reinforcements inbound";

_pos = screenToWorld [0.5, 0.5];

_spawnPos = _pos getPos [4000, random 360];
_spawnPos set [2, 300];

_dir = _spawnPos getDir _pos;

_heli = createVehicle ["gm_ge_army_ch53g", _spawnPos, [], 0, "FLY"];

_heli setDir _dir;
_heli setVelocityModelSpace [0,50,0];

_heliGrp = createVehicleCrew _heli;
_wp1 = _heliGrp addWaypoint [_pos, -1];
_wp2 = _heliGrp addWaypoint [_spawnPos, -1];
_wp1 setWaypointStatements ["true", toString {
    _veh = vehicle leader this;
    fullCrew [_veh, "cargo"] apply {
        _unit = _x#0;
        group _unit leaveVehicle _veh;
        unassignVehicle _unit;
        doGetOut _unit;
    };
}];

_wp2 setWaypointStatements ["true", toString {_veh = vehicle leader this; deleteVehicleCrew _veh; deleteVehicle _veh;}];

_freeSeats = {!alive (_x#0)} count fullCrew [_heli, "cargo", true];
_freeSeats = _freeSeats min 3;

_group = createGroup side _heliGrp;
for "_i" from 1 to _freeSeats do {
    _soldier = _group createUnit ["gm_ge_army_rifleman_g3a3_parka_80_ols", [0,0,0], [], 0, "NONE"];
    _soldier moveInCargo _heli;
};

};`

Hello guys! Sorry for disturbing you but I would like to ask you how can I tell AI, after they jump off the helicopter, to join my squad. I tried to add _soldier join (group player); after _soldier moveInCargo _heli; but it didn't work. Thanks in advance for the answer!

drowsy geyser
#

is it possible to disable an inputAction with addUserActionEventHandler?
i want to disable the personView action.

proven charm
#

@quartz blade join takes array so it should be: ```sqf
[_soldier] join player;

dapper ether
#

any tutorials out there how to make a Arsenal Garage for my map?

quartz blade
drowsy geyser
proven charm
south swan
#

by including it in the mission/mod?

#

directly - no. If you code it - yes 🤷‍♂️

south swan
#

you provide remoteExec a target - it calls the code on said target 🤷‍♂️

#

if you give single machine as a target - it would be executed only on that machine

#

Object - The order will be executed where the given object is local

quartz blade
quartz blade
#

@proven charm Hey sorry for disturbing you but I tried with the array and basically it makes spawn just one soldier

proven charm
dreamy kestrel
#

Hello, obviously it is possible to display formatted text, tooltips, over objects, taking unit labels, for instance, for example...
Q: is this... in the mod I am working on, I would like to format a similar thing, I call them tooltips, but not sure if that is the same verbiage.
I have a Zeus style 'build' mode, as I am placing objects, in true client locality, would like to display resource debits (pre-build) and/or recycle credits (post-build) that may be inspected as cursor flies over that object in the camera view.
Key is, tooltips on mouse flying over the object?
Thanks...

quartz blade
#

_freeSeat = _freeSeats min 3; should regulate the quantity of soldiers

tender fossil
#

Is this the correct stuff for C# backend? Especially the _RVExtension@12 puzzles me since there are no notes on BIKI about what's for Arma 3 and what's not. (Note: Arma 2: OA!)

namespace xxxxxxxxx
{
    public static class RetrievePlayerSkill
    {
        [DllExport("_RVExtension@12", CallingConvention = CallingConvention.Winapi)]
        public static string Retrieve(string args)
        {
south swan
#

_RVExtension@12 is already mentioned at biki in April 2012 revision of "Extensions" page, so it's very likely to be Arma 2: OA compatible 🤔
But when checking 3 available examples of Arma extensions (and i believe they're dated in A3 era) i see 3 different versions of defining the exports notlikemeow
The thing i'm most sure about (and that "most" isn't very sure) is that you can't change the arguments list of the function that's provided in the example

south swan
#

does A2:OA even have 64bit binaries?

copper raven
#

not sure

#

was wondering the same thing

jade acorn
#

is it possible to find how zoomed in/out is player in map? I was thinking about adding markers that are visible in certain zoom "types" or make them semitransparent the more zoomed in player is

#

there is that BIS_fnc_isInZoom function but I have no idea what intervals are and what's the max

tender fossil
# south swan does A2:OA even have 64bit binaries?

Pinging @copper raven too: No, A2:OA doesn't have 64-bit binaries. So I guess RVExtension is the way to go? Like this: ```csharp
namespace xxxxxxxxxxxxxxx
{
public static class RetrievePlayerSkill
{
[DllExport("RVExtension", CallingConvention = CallingConvention.Winapi)]
public static string Retrieve(string args)
{

south swan
#

you can't change the arguments list of the function that's provided in the example

#
public static void RvExtension(StringBuilder output, int outputSize,
           [MarshalAs(UnmanagedType.LPStr)] string function) {``` ![notlikemeow](https://cdn.discordapp.com/emojis/700311897937018890.webp?size=128 "notlikemeow")
stable dune
#

Hi, is there faster way than || (OR) to check if _key is actionKeys

if (_key in (actionKeys 'ShowMap') || _key in (actionKeys 'nightVision')) then {};
tender fossil
dreamy kestrel
south swan
#

that's if you use curator/Zeus and its mouse operator can be used

dreamy kestrel
dreamy kestrel
south swan
#

question a. Which mouse cursor?

dreamy kestrel
# south swan question a. Which mouse cursor?

so I've got a UI in which there are class controlsBackground {} mouse event handlers. that mouse cursor. maybe more of a GUI question, I will admit, but all I want to do is display a tooltip.

south swan
#

🤷‍♂️

dreamy kestrel
#

I know that images are being display, vehicle boxes, and so forth. I just want for one of those elements to be a tooltip as well, if possible.

south swan
#

if the question is "i have a custom GUI and i want to know what object happens to be below the mouse cursor", then my best guess would be https://community.bistudio.com/wiki/lineIntersectsObjs from camera position to screenToWorld/positionCameraToWorld or something. And performance would need further testing.

dreamy kestrel
hallow mortar
#

....make a GUI class that's just a small black rectangle with a text field, and display that when you want it?

dreamy kestrel
tacit tartan
#

Hey quick question, for sending arrays over networking using missionNameSpace, is it more efficient to have the array as a string eg: “[gang, gang2, gang4]” then parse the array when getting the data or is it more efficient to have it as a standard array eg: [gang, gang2, gang4]

plush belfry
#

so I understand that I need to terminate the spawn script somehow but unsure on how to go about it, everything I tried so far didnt work out

runic charm
#
if (count _Crew > 0) then { // If there are passengers within the vehicle (excluding crew) then continue the script
    {
        // if passenger
        if (assignedVehicleRole _x == "cargo") then {} else { if (_x == count _Crew) then exitWith {};};
    }
    foreach _Crew;
};

Hey guys how would I exit a for loop?

south swan
#

and the rest of the code doesn't seem right

winter rose
#

also, this is a forEach loop

runic charm
winter rose
#

exitWith

runic charm
#

I mean within the foreach loop, because it'll only exit the foreach loop and not the script

winter rose
#

at script's root level

runic charm
#

Okay thanks

south swan
#

but i still don't understand how assignedVehicleRole _x == "cargo" and _x == count _Crew should work on the same _x

winter rose
#

yep, ^ please recheck your code / activate script errors display in A3 Launcher

#

then {} else ugh
then exitWith UGH

runic charm
#

i put 'then {}' because I was trying to find out how to exit the foreach loop

south swan
winter rose
#

we don't talk about that

#

although I do like the idea to break out of multiple loops, one of the rare cases where (I can't believe I say that) a goto could be justified

runic charm
#
if (count _Crew > 0) then { // If there are passengers within the vehicle (excluding crew) then continue the script
    {
        if (assignedVehicleRole _x == "cargo") then exitwith{} else { if (_x == count _Crew) then exitWith {_EXIT = true;};};
    }
    foreach _Crew;

    if (_EXIT) then {
        exitWith {};
    };
};
#

would this work?

winter rose
#

no

#

it would only exit the if scope

runic charm
#

right

plush belfry
winter rose
runic charm
#

says it in the comment

winter rose
#

also still then exitWith
also _EXIT is not defined in the upper scope so no

runic charm
#

i defined it

winter rose
#

not in the upper scope

runic charm
#
private _EXIT = false;
winter rose
#

yeah that
that's not present in what you posted (unless I'm blind)

runic charm
#

sorry i only posted a section of the script

#
params["_Vehicle"];
// Variables

private HidePos = _Vehicle getVariable ["HidePos", []];
private _Crew = (_Vehicle getVariable "crew");
private _Driver = (driver _Vehicle);
private _EXIT = false;

// Code

if (isNil "_Driver") exitWith {}; // If there is no driver, exit the script.
if (isNil "_Crew") exitWith {}; // If there is no crew, exit the script.


if (count _Crew > 0) then { // If there are passengers within the vehicle (excluding crew) then continue the script
    {
        if (assignedVehicleRole _x == "cargo") then exitwith{} else { if (_x == count _Crew) then exitWith {_EXIT = true;};};
    }
    foreach _Crew;
};
if (_EXIT) then {
        exitWith {};
    };
winter rose
#

SO
since you insist on trying my patience by showing me horrendous script until I am but forced to fix it
here it is

if (_crew findIf { assignedVehicleRole _x == "cargo" } != -1) exitWith {};
runic charm
#

yeah well i'm clearly not experienced

winter rose
#

I'm just toying, no worries here 😄

#

also why get crew variable and not fullCrew?

runic charm
#

i assumed it was the whole crew

south swan
#

O_o

winter rose
#
_Vehicle getVariable "crew"
```is not defined by the game itself
exotic flame
#

Is there any way to set the lighting distance of a #lightreflector object ?

winter rose
#

@runic charm

if (fullCrew [_vehicle, "cargo", false] isNotEqualTo []) exitWith {}; // only checks for cargo, not FFV turrets though
#

(if you want to invert the check, use isEqualTo)

runic charm
#

ok thank you

exotic flame
exotic flame
quaint oyster
#
waituntil {isnull player};```
 is the best way to wait until someone leaves, right?
#

Trying to make player spawned vehicles delete when they leave.

scenic shard
#

I want to make a module that can be used in the editor and apparently I must create a addon for that. Is there a way to load the addon while it is still just folders and files so I don't need to create a .pbo every time i make a change?

granite sky
#

@quaint oyster player is only valid locally, and local scripts stop running when the local player disconnected, so I don't see how that's going to do anything useful.

#

And in general, player objects change through respawns, so you wouldn't normally want to tie something like that to the player object.

#

If you want to do something on the server when players disconnect then the PlayerDisconnected mission event handler is usually the way to go.

hallow mortar
#

Save the player's UID as a variable to each vehicle they create, when they create it, and use a player disconnected event handler to have the server delete all vehicles associated with that UID when they leave

granite sky
#

Also avoid using sleepless waituntils in general.

hallow mortar
tender fossil
#

Is allUnits still suffering from the bug where it starts to work only after like 10 minutes from the mission start? I think I had this bug in 2013... 😄 (Edit: Arma 2 OA v1.64 though)

#

If it is, is there any workaround?

patent yarrow
#

howdy folks. not to familiar with the sql scripting but is there a way to get nearby vehicles and load them via the VIV system? I have a flatbed truck that id like the driver to be able to drive up to nearby objects and load them if possible via script

untold copper
tender fossil
patent yarrow
untold copper
patent yarrow
untold copper
patent yarrow
#

suppose nearestObjects could also work

untold copper
patent yarrow
#

now i just need to sort out how to combine the entities search to the setVehicleCargo function

#

yay coding

#

actually. could you do a get NearEntities?

#

im probably not gonna want to do a forEach

untold copper
# patent yarrow _deployable bunker mod when?_

Build a bunker fortress from the air...
It maaaaay be scattered over several hundred metres and look like shit, but the Army saves money by firing moooost of its engineers, whom only complain anyway.

patent yarrow
#

huh. nearEntities doesnt sort by distance. good to know

untold copper
patent yarrow
#

god i hate learning new programming languages sometimes

#

idk if im doing this right.

untold copper
patent yarrow
#

i dont normally work with sql

untold copper
patent yarrow
#

imo i wish they would have put a loadCargo script with the VIV update like they did with the unload cargo feature

untold copper
patent yarrow
#

although now im stumped. as to why this setVehicleCargo nearEntities 25; returns as missing a ; in my debug console and vehicle init when i just do a quick n dirty code

#

this setVehicleCargo a1; works with an object with a1 as its variable name just fine

#

its possible im just trying to use the array incorrectly.

untold copper
patent yarrow
#
_list = this nearEntities 25; 
this setVehicleCargo _list;

first part is accepted and seems to clear the debug console, second part works if _list is changed to a variable name. put together it returns Error setVehicleCargo: Type Any, expected Object

patent yarrow
#

hm. adding a count to _list seems to be accepted but doesnt load the nearest object

patent yarrow
#

okay now im very confused. nearSupply can grab empty vehicles? I got it to work, sorta. nearEntities didnt load the quad bike, but nearSupply did. Same with the darter drones

hallow mortar
patent yarrow
tender fossil
#

Arma 2: OA! What am I doing wrong now? I'm trying to create a lightweight database extension 😄 ```csharp
public static class RetrievePlayerSkill
{
[DllExport("RVExtension", CallingConvention = CallingConvention.Winapi)]
public static void RvExtension(StringBuilder output, int outputSize,
[MarshalAs(UnmanagedType.LPStr)] string args)
{

hallow mortar
patent yarrow
#

right now im just trying to get the damn thing to work consistently

hallow mortar
#

Yes, and a lot of unexpected things can be within 25m is my point. Let's say you park near 2 boxes; which one you get is up to luck. One of your friends is standing nearby? They are also a potential target

patent yarrow
#

just headdesking as to why nearSupplies will pick up an empty quad bike but nearEntities wont. And neither of them will pick up a supply crate

#

just (╯°□°)╯︵ ┻━┻

#

confuses the hell out of me

granite sky
#

both of those work for both, normally.

hallow mortar
#

Is it not detecting the bike entirely or is it just not the first element in the array?

patent yarrow
#

hang on. let me share my semi working code. its possible im missing a selection for if theres only 1 item in the array

#
private _distance = 25;
//search for nearest objects, entities etc.
private _list = this nearSupplies _distance;
if (count _list > 0) then {_object = _list select 0; this setVehicleCargo _object; hint "Loaded";};
granite sky
#

this? Is this object init?

patent yarrow
#

this is the vehicle yes. trigger via useraction

#

i can get it to fire consistently as well

#

oh huh

hallow mortar
#

Okay, so you're just picking the first element and hoping for the best. That doesn't mean it's not picking up the bike, it just means it's picking up something else too and you're not getting lucky

patent yarrow
#

this doesnt like being run via userAction

patent yarrow
granite sky
#

I don't know what you mean by userAction

hallow mortar
#

Probably addAction

patent yarrow
#

im on an empty VR map with the flatbed and the object im attempting to load

#
        class UserActions
        {
            class LoadCargo
            {
                userActionID = 6;
                displayName = "Load Object";
                displayNameDefault = "Load Vehicle";
                textToolTip = "Load Vehicle";
                position = "pilotview";
                showWindow = 0;
                radius = 5;
                priority = 1;
                onlyForPlayer = 0;
                condition = "((speed this < 5) AND (player == currentPilot vehicle player))";
                statement = "0 = [this] spawn DSA_Argon_fnc_LoadNearby;";
            };        
        };
#

set in the vehicle config

granite sky
#

And that code is in DSA_Argon_fnc_loadNearby?

patent yarrow
#

correct

#

apparently, i lied and it does not like running via that option and spits out an error about this

granite sky
#

Then you need to use _this select 0 there.

patent yarrow
#

in the script instead of private _list = this nearSupplies _distance; itd be private _list = this select 0 nearSupplies _distance;?
or in the statement

hallow mortar
#

this is allowed in userActions config but not in the function

#

Arguments passed to the function are an array contained in special variable _this

granite sky
#

(It's an array here because you passed an array. You don't strictly have to)

#

0 spawn fncName => _this = 0
[0] spawn fncName => _this = [0]
[0,1] spawn fncName => _this = [0,1]

#

If you use params ["_myParam"] it has a special case for _this not being an array.

#

and then you don't have to worry about it :P

patent yarrow
#

which is the more recommend way? its gonna be used on VIV only vehicles, so its not gonna be in constant use

granite sky
#

params is generally the recommended way.

patent yarrow
#

so params ["this"];? or can whats in the "" be whatever, then id just replace this with the param name

granite sky
#

You can put whatever as the name, but it needs to be local, so with an initial underscore.

hallow mortar
#

The name you give a param is just what you want the local variable it generates to be called. (Has to be local, so underscore, don't use _this it'll conflict)
Params are created in the order the arguments are passed

patent yarrow
#
params ["_box"]
private _distance = 25;
//search for nearest objects, entities etc.
private _list = this nearSupplies _distance;
if (count _list > 0) then {_object = _list select 0; this setVehicleCargo _object; hint "Loaded";};
```?
hallow mortar
#

;

patent yarrow
#

ah right

#

but that should work?

hallow mortar
#

No

granite sky
#

Isn't the parameter the triggering player?

#

and then you need to actually use it in the code :P

#

(it's still this everywhere)

patent yarrow
#

ohhhhhhh

#

replace this with _box?

hallow mortar
#

The argument you're passing into the function, and retrieving with params, is whatever this returns in userActions, the vehicle itself I think

granite sky
#

Variable this references object to which action is attached to.
yeah fair enough, maybe it is a box :P

patent yarrow
#

lol

#

but i think i get it. i dont really use sql in anything i do so this is my first "internal" script if you will

#

most of what ive used/seen is cobbled together

hallow mortar
#

And you still don't use SQL in anything, because here in Arma, we use SQF

patent yarrow
#

(╯°□°)╯︵ ┻━┻

#

i hate my life

#

just gonna return to my vb code blocks

hallow mortar
#

Actually you could use SQL if you were making a database for an extension or something

patent yarrow
#

well, now its not complaining about this anymore, runs the code. somewhat.

#

doenst load anything now

patent yarrow
#

i think i got it. ended up outputing the whole _list array as a string to see what was going on. i did a dumb when i was telling it to grab the first item in my array, which was the driver lmao. so the script was going "hey hes loaded. job done"

#

does nearEntities return classes inherited from the values in the array? IE "Tank"?

granite sky
#

It's isKindOf filtering, so yes.

patent yarrow
#

good to know.

#

man i feel dumb now lmao

patent yarrow
#

thanks all. things worked out

proven charm
#

make it a global variable hashmap. then you can add to it from every server file but not from clients

still forum
#

PreStart CfgFunctions in a mod

stable dune
#

Is there a way to get the civilians to not be startled by every sound (shot, explosion, etc.) they go into "panic" and stop all movement, I have a script that turns the civilian side into the enemySide (opfor) and takes the target from the closest player, but when someone else shoots or an explosive detonates nearby, they stop all movement and raise their hands above their heads. Is there a command or setting to override this feature on units that switch sides?

proven charm
stable dune
south swan
#

well, civilians do have different FSMs to a soldiers 🤔

#

as in "defined in config"

stable dune
south swan
#

setting their group to CARELESS does prevent them from being scared, though

stable dune
#

I will test that out, with _unit setBehaviour "CARELESS" doens't affect at all

south swan
#

as in: i have here in redactor a careless civilian, an aware civilian and a red survivor joined to civilian side. Aware civilians flees-or-hides when i fire, other two don't 🤷‍♂️

#

and when i run cursorObject setBehaviour "AWARE" on a careless civilian - he gets scared as well 🤷‍♂️

#

and after cursorObject setBehaviour "CARELESS" in the debug console previously aware civilian stops getting scared

stable dune
#

hmm

tender fossil
#

How can I have multiple entry points for callExtension in a single DLL?

#

(Or is it possible at all)

chrome hinge
#

Is there any way to make a vehicloe not lockable by aircraft IR weapons like macer?

fresh crater
#

hi is there a way to make 2 pilots land a heli then leave the vehicle and go somwhere else

stable dune
proven charm
tender fossil
proven charm
#

isn't the rights needed for the arma.exe to be able to write files? sorry Idk , never tried windows server, just client windows

tender fossil
proven charm
#

maybe you need admin rights

tender fossil
#

Already have

#

😄

proven charm
#

hmm strange

tender fossil
#

Ok, wow. Microsoft has blacklisted older .NET frameworks from being used in Visual Studio 2022, and they just fail silently without throwing any errors apparently if they're project dependencies 😄

#

The build fails visibly only if you're trying to build the dependency itself from source KEKW

#

And the info is hidden on some random Microsoft web page. Maybe this will help someone else fighting against an overflow of weird bugs... 😄

south swan
tender fossil
#

Yup, I got it working now. Still some bugs left but they're by me this time 😄

proven charm
#

good I use VS 2019. thx Ezcoo, good to know!

cold pagoda
#

question, is there a way to do the action "DropWeapon" without it dropping Magazines? Working on sling script but when you do "DropWeapon" it also drops the magazine which is by design, I understand, just wondering if someone has found a way to just drop the weapon only?

frank mango
#

Also pretty sure ACE has a sling weapon option

drifting portal
#
[[],{
    profileNamespace setVariable ["VariableToBeSavedOnServer", true];
    saveProfileNamespace;
}]remoteExec ['spawn',2];

if I execute this, does the server create a file with the variable in it?

hallow mortar
#

No, the profile file already exists and will be also be saved when the game is closed. The command saveProfileNamespace just commits changes now instead of waiting for the ordinary save. (https://community.bistudio.com/wiki/saveProfileNamespace)
It will happen on the server though.

somber radish
#

Anyone got a decent Idea on how to set markers visible to players of a specific side?

#

I tried making local markers only, but they do not update on dedicated

#

then I tried setting the alpha to different values locally on public markers

#

which also failed

#

so If anyone got a script or something lying around Id be very grateful

blazing zodiac
#

Does anyone know if we can load mods exclusively on headless clients (serverMod equivalent)? Or, maybe as a workround, load a mod as a custom client mod on the HCs, add the key to the server, then just don't distribute it anywhere?

copper raven
jade tendon
#

Anyone able to help me change this from an addAction to a selectable ACE interaction.

this addAction ["-BOARD SUB: -- H.M.S PROTEUS-", "[player] execVM 'zdz_frogs\System\Boarding\teleport_sub_interior.sqf'; "];

dark hornet
#

Does anyone have some Fun scripts for zeusing or somecolor scripts?

hallow mortar
thick merlin
#

Hey guys, I have been trying to sort out an issue with the VVS (create vehicle scripts).

#

Its on a Lan so imy issue is with Mp

#

I am trying to execute the vvs scripts on my pc but in the script i am trying to moveincargo ai that is local to another pc

#

I have been trying this code [copilot moveInTurret [h1,[0]]] remoteExec ["call", -2];

#

from my pc via VVS scripts.

#

Works in SP but not in mp.Not dedi or one pc to another

#

Any help would be great

hallow mortar
#
  • why remoteExec call instead of remoteExecing moveInTurret directly?
  • why target -2? If the AI is local to the server then this will cause nothing to happen since moveInCargo is Local Argument. Better to target the machine where the AI is definitely local.
[copilot,[h1,[0]]] remoteExec ["moveInTurret",copilot];```
thick merlin
#

Thanks

#

will try now

#

Its a bit over my head this complex stuff.

#

gonna try that now

winter rose
thick merlin
#

wow. simple as that...i was close.:)

#

Thanks

#

i giveyou/Lou shout out in my mission release last time you helped me.:)

#

{[copilot moveInTurret [h1,[0]]] remoteExec ["call", -2]}; didnt work for host or client.:(

winter rose
#

do what NikkoJT told you 🙂

thick merlin
#

tring that now.:)

#

yeah i think that got it.I gotta try it on the dedi server app on my host laptop.but i reckon it will work fine.

#

Thank you very much guys!!

worthy igloo
#

is there a list of good extensions for a3 visual studio i just switched from np++

winter rose
tender fossil
#
_isArray = false;

_uid =  if (typeName _parameters == "ARRAY") >
2022/10/24,  6:26:01   Error position: <=  if (typeName _parameters == "ARRAY") >
2022/10/24,  6:26:01   Error Generic error in expression```
Calling code:
```sqf
_result = ["STORE", [getPlayerUID _x, _playerScoreDiff]] call WFBE_SE_FNC_CallDatabase;
``` The code itself:
```sqf
// Call to database
private ["_procedureName","_procedureCode","_parameters","_uid","_score","_response","_responseCode","_responseTotalScore","_responseTicks","_playerSkill","_responseStats","_isArray","_parametersTemp","_isArray"];

_procedureName = _this select 0;
_parameters = _this select 1;
_isArray = false;

_uid =  if (typeName _parameters == "ARRAY") then {_parameters select 0; _isArray = true;} else {_parameters};
_score = if (typeName _parameters == "ARRAY") then {_parameters select 1} else {0};

_parametersTemp = "";

// We need to change the data type from 'ARRAY' to 'STRING' before sending the data to database
if (_isArray) then {
    {
        _parametersTemp = _uid + "," + str _parameters select 1;
    } forEach _parameters;

    _parameters = _parametersTemp;
};

_response = {};

_procedureCode = "";
#

Wat do? meowsweats

winter rose
#

(Arma 2 OA still, I guess)

tender fossil
#

(Just noticed that "_isArray" is 2 x in private, dunno if it causes that). And yeah @winter rose 😄

winter rose
#

you can use local _var as one uses private _var in A2OA

tender fossil
#

Hmm, I see. Thanks for the tip 🙂

winter rose
#

+ str _parameters select 1;
+ str (_parameters select 1);

tender fossil
#

True. I usually use a lot of brackets but they were WIP this time 😄

winter rose
#

that's why you use format
also, you can define _isArray with one typeName _parameters == "ARRAY" check and not do it a second time

tender fossil
#

True that as well

winter rose
#

aaalso
forEach _parameters;
you overwrite your temp value as many times there are parameters, not good

tender fossil
#

Ffs, just realized that I've deleted the preceding part that contained the _parametersTemp = _parametersTemp + ... 😄

#

Thanks for spotting it!

#

It should be like this, fixed it now:

// We need to change the data type from 'ARRAY' to 'STRING' before sending the data to database
if (_isArray) then {
    
    _parameters = _uid + "," + str (_parameters select 1);
    
};
#

I still don't know why it throws a generic error in expression like in the log file copypasta above

winter rose
#
private ["_responseCode", "_responseTotalScore", "_responseTicks", "_playerSkill", "_responseStats"];

local _procedureName = _this select 0;
local _parameters = _this select 1;
local _isArray = typeName _parameters == "ARRAY";

local _uid = if (_isArray) then { _parameters select 0 } else { _parameters };
local _score = if (_isArray) then { _parameters select 1 } else { 0 };

// we need to change the data type from 'ARRAY' to 'STRING' before sending the data to database
if (_isArray) then
{
    local _parametersTemp = "";
    {
        _parametersTemp = _parametersTemp  + format ["%1,%2", _uid, _score];
    } forEach _parameters;

    _parameters = _parametersTemp;
};

// unused?
local _response = {};
local _procedureCode = "";
#

the if (_isArray) is stupid in that case (as the 0 score is therefore not used)

tender fossil
worthy igloo
#

would there be a way to get part of string like core\123\456.paa getting the last bit 456.paa?

winter rose
#

yes

worthy igloo
#

@winter rose also

_fffg1 = (preprocessFile "core\123\456.paa");
``` getting that last 456 bit without retyping the path? anywhere
winter rose
#

same answer

worthy igloo
#

ok thx

#

im not smart enough to understand this wiki
i just want to make the last bit of it return something like

_fffg1_tt = "456.paa";
``` so I can make it a tooltip for a gui bit without having to retype any of the path anywhere else except for the original `_fffg1`
winter rose
worthy igloo
winter rose
#

this is how you use variables

private _filePath = "core\123\456.paa";
private _filename = _filePath splitString "\"; // ["core", "123", "456.paa"]
_filename = _filename select (count _filename -1); // select the last item, "456.paa"
private _fileContent = preprocessFile _filePath;

hint format ["My file at %1 is named %2", _filePath, _filename];
worthy igloo
drowsy geyser
#

hey, i have a trigger:

activation: any player
condition: {side _x == west && !(_x getVariable ['injured',true])} count thisList == 1

on activation:
player setPosATL (getPosATL locker1 vectorAdd [0,0,0]);    
player setdir (getdir locker1);  
[player, "Acts_JetsCrewaidL_idle"] remoteExec ["switchMove", 0]; 
player switchCamera "INTERNAL"; 

Now the problem is when a player fulfills the trigger condition,
every player will be teleported into that locker,
how would I teleport only the player who met the trigger condition?

south swan
#

option a: make it server-only and in activation code use 'remoteExec' to only send commands to the affected player
option b: leave the trigger running on all machines, but run _affectedTrigger triggerAttachVehicle [player] on it on mission start (or whenever), so the local copy of trigger only triggers on local player and only sends him to the locker

#

also {code} count thisList == 1 looks like it would break in case of 2 players being injured inside the trigger

gaunt tendon
#

anyone know if the killed event handler is bugged?
it seems to be getting triggered even if the unit's general damage is < 1
and is still alive...
I am running also a handledamage evh that caps maximum damage to 0.9...
but the incapacitated hitpoint is always taking damage regardless...

hallow mortar
#

Actually if you change it to activation BLUFOR you can skip the side check as well

drowsy geyser
#

ok thank you both! but if I want only one player to activate the trigger at a time, shouldn't i add this:
count thisList == 1

stable dune
south swan
#

wut

stable dune
# south swan wut

Let me try ask again.
If i do trigger at start, let's say middle of mission , and when some1 active (player) this trigger it will spawn local trigger for all, is this better than do them at start of mission

south swan
#

still wut

#

triggers seem to run independently on every affected machine

stable dune
#

Well i do not know how that works

#

Yeh, but how that triggerAttachVehicle works?

south swan
#

it changes the list of units that trigger checks for. And only does that on the machine where triggerAttachVehicle was executed.

stable dune
south swan
#

approximately, "ANYONE" check is allUnits inAreaArray [trigger], "ANY PLAYER" - allPlayer inAreaArray [trigger], after_trigger triggerAttachVehicle [whatever,is,here] was executed - [whatever,is,here] inAreaArray [trigger] 🤷‍♂️

winter rose
tough abyss
#

@little raptor Hey friend, is Intercept BattleEye verified? Or will it raise trouble with anticheat

round scroll
#

how do I detonate an arbitrary bomb with sqf? I tried _bomb setDamage 1 but this is not exploding it

still forum
exotic flame
frigid oracle
#

Is there any math wizzards that can lend a hand understanding how vectorFromTo can be used with setVectorDirAndUp?

Doing what was suggested awhile ago to use with making a prop rotate and face the player, but it has a weird tilt based on distance from the target.

gaunt tendon
#

probably is because the Z components of the positions are different

#
_PosObj = getPosWorld _Obj;
_PosMan = getPosWorld player;
_PosObj set [2,0];
_PosMan set [2,0];

_vDir = _PosObj vectorFromTo _PosMan;
_Obj setVectorDirAndUp [_vDir, [0,0,1]];
#

with getPosWorld you get the position ofthe object's center in ASL format

#

set both _PosObj and _PosObj Z components to 0 to assure they're leveled

#

using [0,0,1] as vector Up should suffice

#
_vDir = _PosObj vectorFromTo _PosMan;

will make the object's +Y axis (vector dir) face the player

_vDir = _PosMan vectorFromTo _PosObj ;

will face in opposite direction

#

if you want the vector Up to be other than [0,0,1]
you'll need to use the vector cross product to get the +X axis

frigid oracle
# gaunt tendon ```sqf _PosObj = getPosWorld _Obj; _PosMan = getPosWorld player; _PosObj set [2,...

Thank you that does resolve the odd tilting and I understand the explanation and def have copied it to my notes.
Although is it possible to adjust the vectors to control tilt of the prop based on elevation from the other target? I assume it has to do with the z leveling as setting to 0 removes the unintentional tilting from my original script.

nvm seems like playing with the numbers with this new understanding is answering my question

chrome hinge
#

Any tips on how to make a repeatable trigger have a cooldown?

open fractal
#

you can just set a variable like this and have it reset after some time with sleep

#

there may be an easier way with triggers but this is generally how you set up cooldowns with a variable

drowsy geyser
#

Where would I add a code when the progress bar is at 100%?
if i wanted for example to place a bomb.
["Hold that key!", 10, {alive player}, [], false] spawn BIS_fnc_keyHold;

south swan
drowsy geyser
#

hmm, so is this just a light version of BIS_fnc_holdActionAdd?

south swan
#

🤷‍♂️

#

i also see this comment in BIS_fnc_keyHold code i've found in the unpacked data

Returns:
True if the action was successful, false if it was interrupted.
#

although how is it supposed to return after being spawn-ed - i'm not very sure 🤔

copper raven
#

call from scheduled

south swan
#

so, something like this, i guess sqf [] spawn { private _success = ["Hold that key!", 10, {alive player && time < 40}, [], false] call BIS_fnc_keyHold; if (_success) then {hint "KABOOM"} else {hint "NOPENOPE"}; }

sudden yacht
#

On the civilian population spawner module for vanilla Arma 3. Is it possible to set the unit count through script instead???

#

additional notes.... ["bis_fnc_moduleinit_function","#ondeleted","#oncreated","bis_fnc_moduleexecute_activate","modulecivilianpresencesafespot_f","bis_fnc_moduleinit_iscuratorplaced","#unitcount","#useagents","bis_fnc_moduleinit_status","#usepanicmode","bis_fnc_initmodules_activate","#unitpreset","bis_fnc_initmodules_priroty","cba_xeh_isprocessed","objectarea","#area","cba_xeh_isinitialized","modulecivilianpresenceunit_f","#debug"]

proven charm
sudden yacht
#

If i name the spawner "M" instead and then... M setVariable ["#unitcount", 10 ];

#

would that work?

proven charm
sudden yacht
#

ty

proven charm
#

np

chrome hinge
#

Is there any way to visualize trigger area in-game? Im attaching a triggerfield to a plane and its hard to see which way it is pointing and what my adjustments do if the field is invisible.(when it snaps the field to attached object)

worthy igloo
#

is there a tool that does the opposite of bankrev like packs a bunch of pbos not only does it one at a time

cedar cape
#

im trying to make it so at the start of my mission the player is walking towards a helo with a team and then when they get close they get in it. how would i go about doing this?

open fractal
proven charm
#

drawLine3D is one option

tender fossil
#

Why does player object become null when publicVariable'd to server? (Arma 2: OA)

#

I get RPT spam (like expected): ```"[WFBE (WARNING)] [frameno:2.88931e+006 | ticktime:118412 | fps:114.286] Init_Client.sqf: [WEST] Client [Ezcoo] join is pending... no 'has connected at launch' ACK was received from the server, a new request will be submitted."
"[WFBE (WARNING)] [frameno:2.88964e+006 | ticktime:118415 | fps:101.911] Init_Client.sqf: [WEST] Client [Ezcoo] join is pending... no 'has connected at launch' ACK was received from the server, a new request will be submitted."
"[WFBE (WARNING)] [frameno:2.88996e+006 | ticktime:118418 | fps:96.9697] Init_Client.sqf: [WEST] Client [Ezcoo] join is pending... no 'has connected at launch' ACK was received from the server, a new request will be submitted."

Calling code: ```sqf
Private ["_hasConnectedAtLaunchACK","_timelaps"];
    _timelaps = 0;
    WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH = player;
    publicVariableServer "WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH";
    while {true} do {
        sleep 0.1;
        _hasConnectedAtLaunchACK = missionNamespace getVariable 'WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK';
        if !(isNil '_hasConnectedAtLaunchACK') exitWith {["INITIALIZATION", Format["Init_Client.sqf: [%1] Client [%2], Can join? [%3]",sideJoined,name player,_hasConnectedAtLaunchACK]] Call WFBE_CO_FNC_LogContent};

        _timelaps = _timelaps + 0.1;
        if (_timelaps > 3) then {
            _timelaps = 0;
            ["WARNING", Format["Init_Client.sqf: [%1] Client [%2] join is pending... no 'has connected at launch' ACK was received from the server, a new request will be submitted.",sideJoined,name player]] Call WFBE_CO_FNC_LogContent;
            WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH = player;
            publicVariableServer "WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH";
        };
    };
#

Server PVEH: ```sqf
"WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH" addPublicVariableEventHandler {
private ["_uid","_player"];

_player = _this;
_uid = getPlayedUID _player;

diag_log format ["(Supposed) UID: %1", _uid];

if (!(isNil "_uid")) then {
    missionNamespace setVariable [format ["WFBE_PLAYER_%1_CONNECTED_AT_LAUNCH", _uid], true];

    WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK = true;

    (owner _player) publicVariableClient "WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK";
};

};

#

Server RPT:


diag_log format ["(Supposed) U>
2022/10/25, 21:38:35   Error Missing ;

??

south swan
#

Example at pveh page suggests that it gets ["_varname", "_newvalue"] array as its input

#

And not just a new value as your code seems to expect?

tender fossil
south swan
#

See Example 1 there?

worthy igloo
#
SQLS_AddAction = {

    if !(isNil {SQLS_action}) then {
        player removeAction SQLS_action;
        SQLS_action = nil;
    };

    _condition = "(time >= SQLS_PlacementCooldown_Time) && (leader (group player) == player)";
    SQLS_action = player addAction
    ["<t color='#41e310'>Respawn Beacon</t>",
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
        [] spawn (SQLS_PublicArray#1);
    }, nil,1.5,true,true,"",_condition,0,false,"",""];
    
};
``` how do I only give the addAction to the player no on the player lol
tender fossil
# south swan See Example 1 there?

True! Missed it completely meowsweats

The error didn't change though: ```2022/10/25, 22:30:06 Error in expression <r = _this select 1;
_uid = getPlayedUID _player;

diag_log format ["(Supposed) U>
2022/10/25, 22:30:06 Error position: <_player;

diag_log format ["(Supposed) U>
2022/10/25, 22:30:06 Error Missing ;

Code: ```sqf
"WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH" addPublicVariableEventHandler {
    private ["_uid","_player"];

    _player = _this select 1;
    _uid = getPlayedUID _player;

    diag_log format ["(Supposed) UID: %1", _uid];
winter rose
#

some code above that is wrongly formatted most likely

tender fossil
#

Here's the whole SQF file:

"WFBE_CLIENT_HAS_CONNECTED_AT_LAUNCH" addPublicVariableEventHandler {
    private ["_uid","_player"];

    _player = _this select 1;
    _uid = getPlayedUID _player;

    diag_log format ["(Supposed) UID: %1", _uid];

    if (!(isNil "_uid")) then {
        missionNamespace setVariable [format ["WFBE_PLAYER_%1_CONNECTED_AT_LAUNCH", _uid], true];

        WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK = true;

        (owner _player) publicVariableClient "WFBE_P_HAS_CONNECTED_AT_LAUNCH_ACK";
    };
};
hallow mortar
#

getPlayedUID

winter rose
#

lol yeah

tender fossil
#

... lol

#

Goes quietly back to corner

#

I also learned the hard way that format doesn't throw an error if you mistype e.g. %1 as % only 😅

dreamy kestrel
#

Anyone else experienced problems loading loading units into named roles in the V-44X Blackfish infantry variant? Specifically, I am trying to load units into "cargo" role positions, but the unit is being loaded into an aft seated "turret" position instead. By contrast, the CH-67 Huron and all 14 of its "cargo" role positions load correctly, and can subsequently be unloaded. ALL FOURTEEN OF THEM! Probably a bug, just thought I should mention; not going to worry about it at this point, but might be worth looking into.

dreamy kestrel
amber lantern
#

Is it possible to create a variable dynamically?

#

hmm, actually I think yes at least via executing a string as a script

hallow mortar
#

What do you mean by "dynamically"?

amber lantern
#

NikkoJT like publicVariable "P_UserName1"; P_UserName=p1;

#

Like this example

TAG_BossName = "EvilBigBoss";

publicVariable TAG_BossName;    // wrong - will try to publicVariable "EvilBigBoss" variable, that does not exist
publicVariable "TAG_BossName";    // correct - important, do not forget the QUOTES

But I actually do want EvilBigBoss to be the publicVariable instead of TAG_BossName

hallow mortar
#

What do you want the variable EvilBigBoss to contain?

dreamy kestrel
amber lantern
#

@dreamy kestrel that's the point, I assume based on the example that that errors since I haven't initialised such a variable anywhere

#

But I want to dynamically create a variablename

dreamy kestrel
amber lantern
#

should, or must?

hallow mortar
#
EvilBigBoss = ""; // Create a variable containing an empty string
publicVariable "EvilBigBoss"; // Make it public!```
dreamy kestrel
amber lantern
#

@hallow mortar no. I want to create the variable name dynamically

#

Ie in this case I want to create variables that have the names of each player

dreamy kestrel
hallow mortar
#

_varString = format ["emil_var_%1",name _unit];
missionNamespace setVariable [_varString,"your data here",true];```
⏫
sullen sigil
#

I think he wants to create the variable name as something which is dependent on the result of a previous command

#

like that

dreamy kestrel
#

whether you have something on the other end of that equation to do something with that variable is another question.

amber lantern
#

@dreamy kestrel @hallow mortar thanks, that's exactly it

dreamy kestrel
hallow mortar
#

It's "no big deal" for us, but they didn't know where to start on doing that, and a clear explanation of the basic method was needed

#

Tip: you can also use getVariable to assume a default value if the variable isn't defined yet

sullen sigil
#

anyway i have a question of my own -- is there any way to create an overlay of a unit/object that is visible through walls? trying to search anything as such only returns things like glasses overlays and such

dreamy kestrel
dreamy kestrel
amber lantern
#

Thank you. I do agree that this is a stupid way to do things but I have grown accustomed to using the admin console to fix issues during gameplay