#arma3_scripting
1 messages · Page 508 of 1
that is already working, but i rather meant for scripts, like hitting restart when editing mission files
Oh sorry.
Maybe a for loop over the first n-1 elements and then add the last. Would at least get rid of the conditional. Needs to be benchmarked though.
@digital jacinth https://community.bistudio.com/wiki/BIS_fnc_recompile
with allowFunctionsRecompile = 1; maybe?
@languid tundra I'll try that,thanks
I actually think that would be slower. Since I do not have access to _x inside the loop and need to return the element everytime.
Yeah, that's why I said that it needs to be benchmarked.
Performance isn't really relevant here. Since it's only executed in the editor.
I guess I'll put that in a function so in the future it's a one liner to export things
You could just add the comma and new line every iteration and delete it at the end.
Thought about that too. Guess select should work?
Yes, it does.
Alternative to the for loop would be to feed froEach with the n-1 array, but that would internally allocate an extra array...
Have you tried joinString with the newlines?
_attributeValues apply {str _x} joinString (","+endl)
maybe @cosmic lichen ?
lol, go for joinString seriously!
shit
May not even need apply {str _x}
you mean [1,2,3] joinstring "" will work?
yes, it will
well maybe he wanted extra ""
could be done with the separator though
hey, i could use somehelp with some code im trying to get working. Im trying to execute code remotley on a client from a server side addon. I need to be able to pass values in to it.
this is the call to the function that is supposed to remotely execute the code on the client.
[_Msg, {systemChat _this}, 1, _squadname] call utility_6_fnc_apply;
this is the code in the function that is supposed to remotely execute on the client.
params ["_ValuesForClient","_codeForClient", "_targetClientType", "_targetClientFilter"];
private _allHCs = entities "HeadlessClient_F";
private _allHPs = allPlayers - _allHCs;
{
switch (_targetClientType) do {
case 1:
{
//this is for selecting players in squad
private _RoleDesc = roleDescription _x;
private _temp = _RoleDesc splitString " - ";
private _squadname = _temp select 0;
if (_squadname == _targetClientFilter) then
{
[_ValuesForClient, _codeForClient] remoteExec ["call", _x];
};
};
}
} forEach _allHPs;
error in getting
Error in expression <lter) then
{
[_ValuesForClient, _codeForClient] remoteExec ["call", _x];>
Error position: <_codeForClient] remoteExec ["call", _x];>
Error Undefined variable in expression: _codeforclient
If I create a unit on the server-side I can still do selectPlayer on that unit for a player to take it over aye? But it will be local to the player afterwards 4 ever?
Yes, you can and it will stay local to the player unless you have some scripts or he disconnects.
@exotic tinsel
It would probably be better to not use remoteExec in a loop, but use -2 as the target instead and do the exception for HC inside the code you pass.
@cosmic lichen https://discordapp.com/channels/105462288051380224/105462984087728128/530828162532245524 Uh.... apply and joinString?
@digital jacinth https://discordapp.com/channels/105462288051380224/105462984087728128/530828819050004481 cfgFunctions or CBA?
cfgfunctions
Mod CfgFunctions or mission CfgFunctions?
for mod you have to set allowFunctionsRecompile. And I think there is a BIS function that you can call to recompile all functions
BIS_fnc_recompile
yup
diag_mergeConfigFile ["P:\diwako_dui\config.cpp"];[] call BIS_fnc_recompile;
that is what i am doing, tho i believe i am missing allowFunctionsRecompile
tho no idea where to put that, i am only finding it for description.ext
in your description.ext
anywhere specific?
description.ext should be enough to restart the mission
they are only stored in missionNamespace, and that's cleared when you exit the mission. So it HAS to recompile anyway
nah, doesn't work i am doing something wrong...
https://community.bistudio.com/wiki/Arma_3_Functions_Library#Recompiling I think that might go into root config. Or into CfgFunctions
Do you have the files in correct path in your Arma directory?
pbo prefix is diwako_dui. I made a junction link in my root a3 folder called "diwako_dui" that links to the roo git folder where the config.cpp is located
same in the p drive
well starting up arma makes it load the unpacked files. For some reason I cannot make changes to sqf files and then restart the mission to make them apply.
wait a minute, when looking into the functions viewer they are recompiled but the systemchat command still shows the old value.. this is confusing
Yeah I am giving up on this. i put allowFunctionsRecompile = 1; inside the mod config, the mission, into cfgFunctions, in the class in cfgFunctions and inside the child class functions. even cfgpatches and root config. I do see the changes in the functions viewer after mission restart, but the old code is still executed.
anyone know a quick solution to allow for incapacitated player to show up on map?
At least you can already use links
discord needs a quote feature
like if you agree```
I hate the lack of shortening on the direct links
ugly
@exotic tinsel simple as to start off... you could then add condition to check player side etc
_drawOnMap = findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", { { if (!alive _x) then { private _name = name _x; _this select 0 drawIcon ["pictureheal",[1,1,1,1],getPos _x,26,26,getDir _x,_name,0,0.07,"PuristaSemiBold","right"]; }; } forEach playableUnits; }];
@frozen knoll thx mate, ill test now
also note comment at bottom of https://community.bistudio.com/wiki/alive when using !alive condition
for me i use variables to determine if a player is conscious or not and check that
@tough abyss i wasn't whining, don't be a bitch
Hello scripting people. I'm a little new to this. Can anyone tell me if it is possible to get 2D bounding boxes of objects on the screen? Similar to this image: https://i.imgur.com/4HUX6RK.jpg
But instead of actually drawing the boxes, save the coordinates of the box to a text file (also save an image of the screen)?
take the normal bounding box, and worldToScreen all points
sweet, thank you!
In case I need any detailed help (I have never modded a game), is it OK to offer to pay people here for help?
thanks again!
One potential challenge: how hard would it be to adjust the bounding box based on other objects blocking the view? For example, a soldier peeking above a barrier might only have a box around his head. Or a soldier completely behind a building would have no box.
oof
lineIntersects can probably kinda do it
but. It's basically just a single line from your camera to the target
so the more granularity you want, the more lines you need
yeah i figured it could be pretty tough
i at least don't have to run it in real time if that makes it more possible
@surreal vapor out of curiosity how do you intend to use the script? it does look like an interesting scifi-ish sensor input hud element
So I have a type 12 control (tree list) but I want to loop through the tree. But I am not sure what array to get in order to loop through it. My idea is that I add all players, then every now and then it refreshes the player list. My idea is why remove the list when u can just loop through them and see if they are online or not.
wouldnt checking each player be slower than just dropping a new list?
Wouldnt it look weird? It would kind of collapse everything
Its for an admin camera, and if an admin is "patroling" they would see the menu just collapse every now and then.
Id wager if the list isnt many hundreds long it should pretty much draw it in single frame
How would I loop through a tree anyways?
that I dont know. 😄
hmm
anyone have any ideas?
Loop through a tree - either depth first or breath first are the usual ways.
hey guys, im new to scripting in arma and i want to ask how i can get the number of kills a team (for example bluefor) has made ?
I think you should look into event handlers. Add a killed event handler, inside which you check who has killed the given unit and adjust the score array.
I might be wrong, probably it is already done in arma somehow, I don't know for sure
thanks,
if found this
https://community.bistudio.com/wiki/getPlayerScores
i think i just have to add all player scores of a team togehter with a for loop,
do you know how i can get all players in an team ?
@quartz oracle if you look at the commands listed in the see also section of that command you find this https://community.bistudio.com/wiki/scoreSide
would that be what you are after
oh yes thanks alot
Does anybody knows how to disable and heal players from the ACE hear ringing?
@astral tendon you should try to disable ringing by editing CBA Mission Settings
Its because I need to disalbe it for cutscenes
In editor try "Ctrl + Alt + S" shortcut
I dont wanna totaly disable that feature, only for that especific moment
So you want do disable this effect for small time interval?
Yes, or to cure the player from it before start the cutscene
Hmm
[0] call ace_hearing_fnc_earRinging;[] call ace_hearing_fnc_updateVolume to disable ringing after it happened
In this function i see 25 code line:
https://github.com/acemod/ACE3/blob/master/addons/hearing/functions/fnc_putInEarplugs.sqf
Try to set variable for player in cutscene like this:
player setVariable ["ACE_hasEarPlugsIn", true, true];
Or use @still forum variant(
Yours adds earplugs, mine stops ear ringing after it happened, so mine will still have players get their ears blown
@Dedmen your function only disalbe the ear ringing? is there a way to heal from it instead?
Heal, of course
His variant is more powerfull😀
it stops ringing
its take some time to work, is there a way to make it instant?
Mine should be instant. I thought
It seems to make it last shorter
Its has this line
if (_strength < 0.05) exitWith {};
Maybe it does not work calling with 0?
[0.06] call ace_hearing_fnc_earRinging;
[] call ace_hearing_fnc_updateVolume;
Calling like this also not work
Undefined variables
@astral tendon did you add script_component.hpp in your mission?
No
i think it's important
Isent that already in ACE it self?
#include "\z\ace\addons\hearing\script_component.hpp"
Isn't that right, @still forum ?
The problem is that I need to heal the ear ringing that the player might aready come and can have during the cutscene
About adding script_component.hpp
Hi guys im new to scripting in arma and somethink in this code doesnt work
i think its somewhere in the if statement but i dont know where it is exacly
player addMPEventHandler ["MPKilled",
{
if( side _instigator == east) then
{
GLB_Kills_east = GLB_Kills_east + 1;
};
if( side _instigator == west) then
{
GLB_Kills_west = GLB_Kills_west + 1;
};
if( side _instigator == resistance) then
{
GLB_Kills_guerrila = GLB_Kills_guerrila + 1;
};
hint parseText (str GLB_Kills_east + str GLB_Kills_west + str GLB_Kills_guerrila);
}]
I've already answered you
You have undefined variables. _instigator is undefined
Deleting and re-asking the question isn't going to give you a better answer
Use hint format
make sure you have a ; on the very end
Define instigator with params
params ["_unit", "_killer",”_instigator”];
hint format can keep the kills separate so you see how many kills for each unless you just want kills for all sides as a total
@ruby breach sorry but i dont know you meant me
hopefully you get what i mean valon.... you could also just go
_instigator = _this select 2;
`
player addMPEventHandler ["MPKilled",
{
_instigator = _this select 2;
if( side _instigator == east) then
{
GLB_Kills_east = GLB_Kills_east + 1;
};
if( side _instigator == west) then
{
GLB_Kills_west = GLB_Kills_west + 1;
};
if( side _instigator == resistance) then
{
GLB_Kills_guerrila = GLB_Kills_guerrila + 1;
};
hint parseText (str GLB_Kills_east + str GLB_Kills_west + str GLB_Kills_guerrila);
}];
`
yes ill try it
how do i do it that the hint is seperatet
do i just have to do more hints
hint format["East Kills %1 | West Kills %2 | Guer Kills %3",GLB_Kills_east ,GLB_Kills_west ,GLB_Kills_guerrila];
thx
when i shoot him and he goes intro knockout (or how its called in arma)(where a teammate can revive him / he can force respawn) does it count as kill in my script ?
i believe so.... test it and you will know 😃
where is GLB_Kills_east and your other 2 variables defined?
check your rpt for errors also
its defined in the same script as the eventhandler (init.sqf)
and whats the rpt and how i can acces it ?
for example defined like
GLB_Kills_east = 0;
before the eventhandler ?
yep
how do you get a units loadout from a server side addon script?
paste %localappdata%/arma 3
into a windows explorer address bar
and look for the latest while testing
i bought arma 3 from steam is it in the steam arma file or in the one in dukuments
%localappdata%/arma 3
There is an issue with getUnitLoadout returning "" on non-local machines. So it's best to remoteExec code on the client and send the result back.
crap
does the latest get generatet always or just if there are errors ?
if theres errors it will generally show
ohh
now it work
i havent changed anythink
at least half way...
it have registert my kill but not my friend kill (me: east, myfriend: resistance)
@languid tundra do you have a link, curious to read about this issue
seems like your on the right path valon .... good luck
The original issue is that when you change the locality of a unit, it can lose all its gear. There are countless threads in forums etc. When I investigated the issue in more detail, I noticed that you can predict if the unit will lose its gear, when you see that the machine you will it transfer to returns "" for getUnitLoadout.
I mean for the developer this should be extremely easy to track. The command returns array, so in order to return "" it has to literally return type string, and to find which branch returns string should take like 10 seconds for someone with code
Oh wait, it probably was an empty array instead 🤦
Anyway thanks for the link, nothing to be concerned with, looks like the use of command with global effect in local field, resulting in execution for every client. If there is an undefined behaviour in SQF this will be it, results are totally unpredictable when this happens, there are tonnes of examples with setObjectTextureGlobal being placed in init an fucking up spectacularly and unpredictably, same shit different day.
Does any one know if setVariable ["tf_unable_to_use_radio", true] applies for both transmit and receive?
@frozen knoll idk i think not it just worked 3 times right now an we killed each other more than 6 times
@young current I'm hoping to use this for training/testing an object detector. Normally we have to draw boxes by hand on thousands of images. So if we can use a videogame and make the boxes automatically, it could be a huge help.
i dont know how you have it in your init.sqf but it should only be called on the server and added to player when connecting
GLB_Kills_east = 0;
GLB_Kills_west = 0;
GLB_Kills_guerrila = 0;
player addMPEventHandler ["MPKilled",
{
_instigator = _this select 2;
if( side _instigator == east) then
{
GLB_Kills_east = GLB_Kills_east + 1;
};
if( side _instigator == west) then
{
GLB_Kills_west = GLB_Kills_west + 1;
};
if( side _instigator == resistance) then
{
GLB_Kills_guerrila = GLB_Kills_guerrila + 1;
};
//hint parseText (str GLB_Kills_east + str GLB_Kills_west + str GLB_Kills_guerrila);
hint format["East Kills %1 | West Kills %2 | Guer Kills %3",GLB_Kills_east ,GLB_Kills_west ,GLB_Kills_guerrila];
}];
that is how it look right now @frozen knoll
remember running something in a inti.sqf will execute everytime a player joins
everytime you have a player join the kills will be reset to 0 for them
for me personally the way i handle this is server side i create addPublicVariableEventHandler
"getPlayerData" addPublicVariableEventHandler {_this select 1 spawn myScript_getPlayerData};
myScript_getPlayerData = {
_player = _this select 0;
_player addMPEventHandler ["MPKilled", {_this call myScript_fnc_onPlayerKilled}];
};
and then local (player side when connecting)
i call it
it shouldnt be just a scoreboard it should spawn vehicles if a teams get to many kills
Nothing you've given us would result in any vehicles being spawned.
the lines that spawn the vehicles are comming later
@surreal vapor quite clever, is Arma realistic enough for that?
Right now i just want to make the killcounter working
first mention of vehicles since ive been reading
basically you need to make sure the eventhandler is added to the player from the server when player connects
otherwise you will have issues
how can i make sure it is, is there some way I can check if the other player have the event handler on them ?
investigate what i wrote above as a starting point
Can anyone please help me im new to arma 3 scripting and i want to figure out how to attack an obj to a vehicle please pm me if you can help
some of that is taken from (but highly watered down) a working MP game mode im writing
also in which file do i have to put think that you shuld run from the debug console als lokal ?
depends if you want to just have a mission file or also create a server side folder for handling server functions
i would do the later but if your just making something not to complex and just want to use some MPevents then make use of the initServer.sqf
because i have this mod
https://steamcommunity.com/sharedfiles/filedetails/?id=1420266916
and he says:
publicVariable "DCON_Garage_Enabled";```
Put any of these somewhere in your mission file or run it locally on the console. By default this value is set to 1
and i want to have in on 0, when i do it via console run lokal it works but if i run it via init.sqf it just deactivates it for me
it should deactivate it for everyone
ok
look like its because of the reviving that you have to kill the player not just knock him out
your having 2 conversations one about ur mpKilled and one about vehicles tackle one thing at a time 😉
ive fixed it with the mpkilled it was because of the revive think
Is there any event handler that would fire when a mine detonates?
I'm surprised killed doesnt fire it
@dusty tulip Not 100% sure, but some people have had success using "synthetic data" from video games
is it possible to have command messages show up for all players and not just squadleads? if so any direction on how would be very appreciated
Command channel?
Sorry, that's a no. What you can do is either just use Side channel (like the rest of us scrubs) or make a custom channel.
Is there a way to remove the explosion crater decals that are left by mortars and such in an area?
for heli crashes i use
//delete craters made by heli crashes _crater = nearestObjects [player,["CraterLong"],250]; { deleteVehicle _x; } forEach _crater;
put it inside a loop
@tender vector I think you could just delete object of type ”#crater" at the explosion position
hello👋 does anyone know how to make an Event Handlers for injured players for example : " Player 1 was injured by Player2 " and i would also like one for ai's too for example "Player 1 was injured by AI"
Hi guys. I have my character's coordinates relative to the model. I received them: cursorObject worldToModel (getPosATL player)
and got: [-3.00928,2.45508,-4.37009]. How do I spawn the object at these coordinates, relative to the cursorObject.
_model = "Land_MetalBarrel_F" createVehicleLocal [3.00439,2.06445,-4.37009]; dont work
@fleet hazel modelToWorld iirc
@winter rose cursorObject modelToWorld [3.00439,2.06445,-4.37009] ?
is there a way can can add a event handler to all vehicles in the mission
i want to attach a GetOut event handler to every vehicle in the game thats starts a timer when the player exits the vehicle and respawns the vehicle after the vehicle doesnt got used for an amount of time. it should also be reatacht when the vehicle get respawnt and the timer should stop / reset when a player gets back in ?
@harsh vine pretty straightforward. The "hit" eventhandler already contains the type of damage and the origin of the injury
BTW, I was wondering if there is a way to identify a weapon uniquely ? I would like to keep track of an object even when it is placed on the ground by a player, or passed to another player. I know it's not possible for items, but as weapons can be passed directly with attachements, they can be differenciated from each others in a given WeaponHolder. So there might be a unique identifier ?
nevermind, I found the best way to do it : https://forums.bohemia.net/forums/topic/217638-mp-how-to-setvariable-to-inventorys-item/
I was originally thinking to create a hundred objects with different classnames but same appearance in order to track its state. Using the "magazine" solution is way more clever for that. Thx anyway 😃
I wrote a script that allows me to blacklist items depending on combat role and it works ok so far, but it simply removes the item from people's hands/inventory. Is there a way I could hide the items from the BIS arsenal instead? Cant do it in Eden since its supposed to adapt to the player's chosen role
You should look up there : https://community.bistudio.com/wiki/Arma_3_Arsenal#Modding
If I run that script in initPlayerLocal on every player's client they all get a different arsenal I'm guessing?
[object,itemClasses,removeGlobally] call BIS_fnc_removeVirtualItemCargo
removeGlobally parameter let you decide if the removal should be for everyone, or only on the runner's machine. So as long as you run it with this parameter set to "false", from the initPlayerLocal script, yes, each player will see it's "own" arsenal
@quartz oracle getOutMan evh on each player would work
@fleet hazel no, you pass the same value you got from worldToModel, unaltered.
@tough abyss What? I you dont undestend
@fleet hazel see https://community.bistudio.com/wiki/modelToWorld for syntax
{ params ["_vehicle", "_role", "_unit", "_turret"];
sleep 10;
_vehicle setdamage 1;
}];```
i do somethink wrong but i dont know what
please help
the error should be in line 3 btw
Is it possibile to select units to command by using scripts? I mean select a member of your squad like you select him using the F keys.
you can list all units in group, select any of them and run commands on them. But at least some of actions when they end will return the unit back to the formation/under squadleaders commnad
@quartz oracle You can't use sleep in EH body. Try to do this with spawn
I want only selection. I want to select a specific unit like you would do normally with a keybind.
how exacly ? im new to scripting in arma
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
(_vehicle) spawn {
sleep 10;
_this setdamage 1;
};
}];
ok thanks ill try it
I'm not sure, but this syntax should work
@thorn saffron https://community.bistudio.com/wiki/groupSelectUnit
trawling through scripting commands page is always helpful 😜
I wasnt sure if it would even be there. The arma command menu is kinda closed, like there is no way to trigger orders like take cover and such.
Still thanks, that is exactly what I needed.
There is AI scroll menu order for taking cover?
Yup under 1 IIRC
Well you could script commanding menu if this is what you’re asking https://community.bistudio.com/wiki/showCommandingMenu
The thing is there is no way to trigger the vanilla "Take Cover" function/ order. This leads to every AI mod having to script its own version of the command.
@lost copper doese the spawn do other thinks too because vehicles start spawning in each other ?
@quartz oracle did you change code inside "spawn" block?
whats the spawn block 😄 😦
spawn {
//code here
}
no i havent
And where you execute EH code?
In attributes of vehicle?
yep
Code, written in this field, executes on every client, include server. Also EH fires every time, when player get in the vehicle
So you can try to add this EH only on server side
but this vehicle havent spawn in it self just all the other
if (isServer) then {
this addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
(_vehicle) spawn {
sleep 10;
_this setdamage 1;
};
}];
};
@quartz oracle This vehicle doesnt spawn when mission starts?
no at the start of the mission al went right but after a few minutes and destoryed vehicles they startet to spawn on itself
Hmm. Can you check respawn of this vehicle without this code?
yes ive deletet the code and i test it again
Say I have 2 array like this [1, 2, 3] and [3, 1, 2] and I want to see if they have the same values inside, regardless of the order. How do I compare them?
are there duplicates in the arrays?
no
count (_array1 arrayIntersect _array2) == count _array2
This will only work if count arr1 == count arr2 to begin with
Normally you would sort both arrays and compare them
if they have the same values inside
If they don't have the same number of values, they cannot have the same values
Comparing [1,2,3,4] and [1,2,3] will return true using your method, no?
of the longer array is _array2 then yeah. If they ahve different number of elements it would be more efficient to compare lengths first
Question, with extdb3 is there a way to bypass the .ini file and just put in a query as a string? (For testing)
And comparing [1,2,3] with [1,2,3,4] will return false, yes?
if the longer array is _array1 yes
@tough abyss @frozen knoll I have tried using the script
private _craters = allMissionObjects "#crater";
for "_i" from 0 to ((count _craters) - 1) do
{
private ["_crater"];
_crater = _craters select _i;
deleteVehicle _crater;
};
``` But it does not seem to be removing craters caused by mortar strikes. Any ideas?
_craters = allMissionObjects "#crater";
{
deleteVehicle _x;
} forEach _craters;
Should be a little more concise.
It seems you cannot delete it with deleteVehicle. This works though
{ _x hideObject true } forEach allMissionObjects "#crater";
it is ok to hide it it will self delete when engine cleans craters up @tender vector
Nice observation M242
I thought craters were like any other object except their simulation was specifically "wreck" or some other static type.
Thanks a lot for your help
Anyone know how to continue playing mission music through the endMission screen vs the success music or an immediate silence as is currently the case?
why not?
lol man everything is such a pain in the butt
¯_(ツ)_/¯
don't end mission with endMission, simples
Never let it end :^)
lol
is it possible to make a certain respawn point only available for a certain group?
Yes, with base respawn option if you place respawn marker and name it with group leader then it will be used by that group. For example group leader name is bob then respawn marker named respawn_bob will be used by bob's group members
okay, thank you!
would it be possible to make the marker's name a variable? such as 'groupowner'? I have an action that creates a group and makes the caller the owner, which means the owner isnt one definite person
You can name the leader dynamically with setVehicleVarName
if ( "ACE_earplugs" find (getUnitLoadout player) ) then {
hint "Your Character already has a pair of Earplugs."
} else {
hint "Your Character doesn't have a pair of Earplugs, here you go."
player addItemToUniform "ACE_earplugs";
};``` How can I do this correctly? ` "ACE_earplugs" find (getUnitLoadout player)` Returns a Generic Error in Expression.
You know... I don't know how I cannot read the wiki...
Am I blind or something...
"ACE_earplugs" find (getUnitLoadout player) should be (getUnitLoadout player) find "ACE_earplugs" and getUnitLoadout returns a number.
You use wrong command @drowsy axle, gimme a minute
- find return the index of first element in array, which is equal to element, that you want to find. If command can't find it -1 returns.
So correct expression looks like:
((_array find _obj)>-1)
This code returns bool for "if" construction
- getUnitLoadout returns a Unit Loadout Array, specified in CfgVehicles or mission config. I think, that you want to analize current unit loadout, so you need to get all items from uniform, backpack and vest of the unit.
This containers can be getted by "everyContainer" (https://community.bistudio.com/wiki/everyContainer) and items from each container can getted by "itemCargo" (https://community.bistudio.com/wiki/itemCargo). In the end you will get 3 array of classnames you should only try to find "ACE_earplugs" in one of them, @drowsy axle.
I believe if ACE is to auto place EarPlugs that it's in the Uniform
By default ACE add ear plugs for units with heavy weapons (machineguns, AT launchers, etc.). But you always can add one ear plugs for each unit in mission 😁
This script is giving me a blank init error box. I'm trying to make it so you read enemy documents to get your next objective
this is the script in the init field of the documents: this addAction ["Read documents",{ player createDiaryRecord ["Diary", ["Intel", "Enemy forces are planning an attack on <marker name='attack'>Checkpoint Lima</marker> using suicide bombers"];
Thats all the code?
"Read documents",{
player createDiaryRecord [
"Diary",
["Intel", "Enemy forces are planning an attack on <marker name='attack'>Checkpoint Lima</marker> using suicide bombers"];
You are missing 2x] and 1x}
so at the very end it should be ]]};
[guy1] join grpNull
Does that makes the unit actually join a null group for one frame or he creates a new one and joins?
"To have a group member leave a group, join him with the grpNull group"
this anser is incompleted
Do they always keep in the grpNull? what is the side of grpNull? when do they leave it?
if you would read the full paragraph, you would come to the conclusion, that joining grpNull is impossible using join
but beware, as brand new group is created for the leaving unit and this could result in the number of groups in a mission growing out of control.
So, they don't actually join a grpNull, they create a new one and then join.
according to the biki, yes
Is there a way to know if a object have simulation? like I know that a ball in the have has simulation but the VR arrow does not have, is threre a way to check that?
should be this: https://community.bistudio.com/wiki/Arma_3_Cars_Config_Guidelines#Basic_parameters (simulation) but ... not sure actually
better cross check that
(can be done using discord bot sqf-vm ... but i do not have the class names for either of those you listed)
Its seems like objects that have the option in the editor to make they simple objects usualy have simulation but im not 100% sure
uhm ... what?
gimme the classes of those two ... i am not sure how that is actually done or consult #arma3_config as chances are, they actually know what makes an object have simulation
Land_Bodybag_01_empty_black_F (has simulation) and Sign_Arrow_Cyan_F (don't)
I was trying to use they to attach agents making animation as wounded.
@drowsy axle CBA_fnc_uniqueUnitItems
"ACE_earplugs" in (player call CBA_fnc_uniqueUnitItems) That's just about how ace does it
and by making the object invisible it does make it still with out disable the simulation, because swichmove in a non simulated attach object make the animaton akward
getText (configFile >> "CfgVehicles" >> "Sign_Arrow_Cyan_F" >> "simulation") => "house"
the other one is not in my config on discord actually
but this should give you some idea about how to check
Got a relatively simple question. I just want to define a group as the squad leader’s name (e.g. a1). I heard you can put the following in the init of the SL: a1 = group this . I think I might be doing something wrong.
So, when the SL passes through a trigger, it applies to the rest of the squad
The first part is fine. Second part: apply what?
A basic script like Combat
So setCombatMode when the group reaches a certain spot?
You can put that code in the waypoint as well, which would probably be simpler.
@digital hollow it isn’t that simple
The code that is
I need the trigger to apply to the whole group
The group is available in the waypoint script, im pretty sure.
It’s much more than that. I’ll have to test it later
This script is working properly, but the command "deleteVehicle intel" is happening right away. I'm trying to make it so you read the documents and then they disappear, which is tied to a trigger !alive intel;
this addAction ["Read Documents", deleteVehicle intel,{ player createDiaryRecord ["Diary", ["Intel", "Enemy forces are planning an attack on <marker name='attack2'>Checkpoint Lima</marker> using suicide bombers"]]}];
What's a good way to make it so the task is completed when the intel is picked up?
Basically, I want "deleteVehicle intel" to happen AFTER you select the "read documents" action
Please use the syntax below for making your code more readable:
```sqf
my code
```
Also your code has a syntax error, consult the BIKI https://community.bistudio.com/wiki/addAction.
Note that deleteVehicle intel does not count as type "CODE", but {deleteVehicle intel} does.
hi guys. Im running a script that is triggered with the engine eventhandler. this script start a while loop that keeps running as long as the engine is on, and takes a few seconds to loop once.
my problem is this. if (for some reason) someone turns on and off the engine very fast, I end up with having multiple instances of the same loop running. I would like to terminate the older ones if a new one starts. Can I detect instances of running scripts and terminate them?
@nocturne basalt you could via scriptDone and terminate for example
Or use something like CBA_fnc_addPerFrameHandler/CBA_fnc_removePerFrameHandler instead of a while-loop.
Ok thanks gonna check it out
@winter rose where would you store the script id? I run it with execVM in the eventhandler. So next time the EH is triggered I wont know what the last id was
Maybe diag_activeSQFScripts to fetch them?
Hi all I'm trying to add an 'addaction' to one unit, but everyone close to him can see and use the action. How can i make it private to a single player/unit.
sqf myPlayer2 addaction["Execute the file","test.sqf"]
sqm myPlayer2 addaction["Execute the file","test.sqf"]
sry, not sure of the tag for code.
@tame axle in the condition you could do something like "player == _originalTarget"... that might work?
using that in the init of the unit.
No, hold on a sec
ah, the 'condition' parameter of the addaction function...
@tame axle set the radius to 0.1
yeah, that would probably work too
thanks radius worked. cheers
this addAction ["<t color='#0000FF'>Commence Insertion","scripts\teleportGroup.sqf",nil,1,true, true, "", "true", 0.1, false];
have i completely overlooked something.... is there a quick way to get loaded magazine and ammo amount of a particular weapon... lets say primaryWeapon ???
i just got it by the below but it seems like there should be a fast way
`_magmagazinesAmmoArray = magazinesAmmoFull player;
_weaponMag = [];
{
if (((_magmagazinesAmmoArray select _forEachIndex) select 4) == (primaryWeapon player)) then
{
_weaponMag append [((_magmagazinesAmmoArray select _forEachIndex) select 0),((_magmagazinesAmmoArray select _forEachIndex) select 1)];
};
} forEach _magmagazinesAmmoArray;`
this is so i can remove the mag and add it back later with correct ammo amount
@frozen knoll Wouldn't it be easier to just use something like ```sqf
getUnitLoadout player param [0,[]] param [4,[]] param [1,-1]; //returns PrimaryWeapon's Primary Muzzle ammo count, or -1 if no weapon/magazine found
See https://community.bistudio.com/wiki/getUnitLoadout / https://community.bistudio.com/wiki/Unit_Loadout_Array - Always returned in the same format means you can just use param with a default value instead of looping
has anyone gotten a hold of the source for killzonekids make_file (file writing extension) or have a source i can use? i need to be able to write to a text file from a single player session. ive tried to make my own extension but for whatever reason, extensions i compile dont seem to have any effect in a3. made sure they are in 64 bit, release instead of debug, followed instructions on a3 site and on killzone kids.... but with all the updates to visual studio (im using the latest) it feels like there could be some crazy setting deeply baked into it that doesnt let it work for me!
at a glance ```// a3filewrite_64.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include <fstream>
#include <iostream>
__declspec(dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function);
void write(char *text);
int strncpy_safe(char *output, const char *src, int size)
{
int i;
size--;
for (i = 0; i < size && src[i] != '\0'; i++)
{
output[i] = src[i];
}
output[i] = '\0';
return i;
}
void write(char *text) {
std::ofstream myfile;
myfile.open("D:\1.txt");
myfile << "Face" <<"\n";
myfile.close();
}
void RVExtension(char *output, int outputSize, const char *function)
{
char message[] = "Hello";
//write(output);
write(message);
char outputs[] = "output";
//strncpy_safe(outputs, function, outputSize);
strncpy_s(output, outputSize, "IT WORKS!", _TRUNCATE);
}
i was unsure if a3 extensions needed to be named name_x64.dll and called with just the name part cause the doc was weird on that, so i tried renaming my dll to _x64 (its named _64 cause thats how i named the solution)
but that changed nothing
i dont know if its anything wrong in the DLL that just makes it not load on a3 startup, or if its not compiled properly. how even could i know?
and other extensions work - i dropped killzonekids make_file_x64.dll into aram3 root and it worked right away
ive also disabled battleEye
https://discordapp.com/channels/105462288051380224/105462984087728128/531987876649369600 🤦
Ya'll literally only need to copy paste what ya'll been told. https://discordapp.com/channels/105462288051380224/105462984087728128/531940186238615563 don't understand why so many people have problems with copy pasting
i need to be able to write to a text file @tough abyss https://github.com/pennyworth12345/ConfigDumpFileIO/releases
how even could i know? dependency walker. Check if the exports are correct and there are no missing libraries
Maybe compiled as /MD instead of /MT ? That adds a requirement on additional libraries
not sure what youre saying withe the first two links, i am using the code syntax, its clearly there
i'll give that configdump thing a look, cheers
the first two links are not targeted at you. Just processing all the backlog from while I was sleeping
the entire message block @ 'd me lol
I was wondering if someone might be able to kindly help me with the Animdone event handler?
@fringe widget Probably people can help you here if you describe your problem
Alright, so I am trying to use the push up animation "AmovPercMstpSnonWnonDnon_exercisePushup" in combination with the Animdone event handler to create a loop in which my ai unit does push ups continually. This is followed by romoteexec'ing this into mp.
My main concern is that the event handler doesn't loop this animation. My scripting knowledge is very poor so in the interim I gave the ai cycle waypoints and used this code on the move waypoint as a juryrigged method of making them repeat it. But I'd like to know for my future use how to make them repeat the animation.
My code:
if ( isServer ) then{ [this, "AmovPercMstpSnonWnonDnon_exercisePushup"] remoteExecCall ["playMoveNow", this, true];this addEventHandler ["AnimDone",{ params ["_unit", "_anim"];if ( _anim == "AmovPercMstpSnonWnonDnon_exercisePushup" ) then{ [_unit, " AmovPercMstpSnonWnonDnon_exercisePushup"] remoteExecCall ["playMoveNow", _unit, true]; };}];};
First of all make sure that your event handler gets fired at all, add some diag_log or systemChat into it
Also embed your code into discord like this: ''' at start of code block and ''' at the end.
''' are the ' at your ~ key actually, the one which is above tab
Also... waht is this and why do you have to remote call the code on the owner of the AI? Is AI owned by a separate machine, not by server?
Oh I think you add the code into the init field of the ai guy, right?
and... does this branch get activated? if ( _anim == "AmovPercMstpSnonWnonDnon_exercisePushup" ) in other words, does it return the proper animation name?
yeah I don't really know what I'm doing with diaglog or system chat within that script. should've been more upfront
just do systemChat format ["_unit: %1, _anim: %2", _unit, _anim]; inside the event handler or something of that kind. Also check how to use the .rpt file and how to use the diag_log command (it's really simple). This should be enough to debug your simple script for now.
yep so that branch is activated.
@fringe widget what do you need remote exec for?
@tough abyss running the animations in mp
And why do you need it to be persistent?
I want the ai to continue doing the animations if thats what you mean?
Playmove is global already
I couldn't get it to work
No I mean the use of persistent flag in remote exec
can you expand on that for me? haha
No, there is wiki for that which I assume you read before using the command, right?
I don't understand the term 'persistent flag'
The 3rd param in remote exec, right after the target param
Find out who owns your AIs. See owner on wiki.
If they are owned by server all the time then there is no use to use remoteExec at all, because they are local to the server already.
If they can join player's squad then they will be local to player as far as I know, then playMove must be executed on player's machine.
But I assume your AIs are owned just by server right now.
Or, create an agent on the server and loop it in animation and skip all malarkey with AI and ownership
returns a 0 for owner. @astral dawn
i was unsure if a3 extensions *needed* to be named name_x64.dll and called with just the *name* part cause the doc was weird on that, so i tried renaming my dll to _x64 (its named _64 cause thats how i named the solution) it needs to be compiled in 64-bit mode and it needs to be named name_x64.dll and it needs to be called "name" callExtension... which is clear as day from wiki https://community.bistudio.com/wiki/callExtension @tough abyss
Sorry I meant you should check the whole locality concept: @fringe widget
https://community.bistudio.com/wiki/Locality_in_Multiplayer
You only need to bother with it if you are in multiplayer
@fringe widget if it returns owner 0 in MP you are executing command on client and not server
okay so the leader isn't soing the animation because hes the drill sergeant or whatever. the others that are, aren't 'leaders' so therefore they will not be local? or have I ballsed that up?
all units in one group are local to one computer
but if your units are just local to the server, you don't need the remoteExec at all
What is the purpose of your animation @fringe widget ? You want a group of soldiers doing push-ups continuously for immersion?
yes @tough abyss thats it
Why didn't you say so straight away, very difficult to help someone with the XY Problem (google it if you want) . Anyway, you dont need AnimDone EH as pushup animation is endless. Put a group of AIs in editor and add this to the leader's init:
if (isServer) then
{
{
private _pos = getPosASL _x;
private _dir = getDir _x;
private _a = createAgent [typeOf _x, [1,1,1], [], 0, "NONE"];
deleteVehicle _x;
_a disableAI "ALL";
_a setDir _dir;
_a setPosASL _pos;
_a switchMove "AmovPercMstpSnonWnonDnon_exercisePushup";
}
forEach units group this;
};
can confirm JIP works. @tough abyss thanks for your help. I was a bit nervous posting for the first time. Is there an easy way to remove these ai of their weapons and vests?
I wasn't sure where to place the removeallweapons command or if it would work.
should work
place it after deletevehicle
removeAllWeapons _a
AAAAAAA! just noticed a little problem, this is hilarious!
After each set of push ups the unit gets up and then starts over. When unit gets up, it makes a tiny step forward. So after some time it "walks away" from original position
hahaha thats great
and if you have leader facing group you can see how it is going to go
i means its almost comical enough to leave in
yeah dont know if one would want to tackle this, might overcomplicate the code, not worth it
quick question, because I still have no idea what I'm doing. I've go barrels that need to be loaded onto a truck that are going to be an objective trigger. I have an event handler to check if they've been loaded with ace3 cargo. that works. but I cant figure out how to numerically count them. At the moment I've tried a few different things and havent gotten it to work. Currently I've got 4 barrels listed in an array _barrelarray_1 = [barrel1,barrel2,barrel3,barrel4]; and I should be able to use that to check if any of the barrels have been loaded?
quick question, because I still have no idea what I'm doing for a short time I thought my "second me" has an own discord account
Well... I did not expect the arma script pool to be this deep when i jumped in.
It is deeper
follow the white rabbit… 🐇
snorts I aaaaaaaaaaam, Im loving learning it all. Its just instances of 'oh this should be easy...." never are, and I havent learned that lesson yet, lol
really though, I can use an array set up like that to replace me going "this or this or this or this" becuase that's so... brutish.
do you have experience in other languages?
(I am tempted to add "forget about it" ^^)
Java, some C++ but its been a loooong time since i've had to use those. I'm slowly moving into scripts from the art and modeling side of things. turns out I like making missions a whole lot.
It looks like ace cargo keeps what a vehicle is carrying in an object scope variable. You can get it with
private _loaded = _interactionVehicle getVariable ["ace_cargo_loaded", []];
Are you already referencing the ace github?
had to leave for work, so I can't look at my code at the moment. Though here's the gist of the concept
_barrelarray_1 = [barrel1,barrel2,barrel3,barrel4]
["ace_cargoLoaded", barrel_loaded] call CBA_fnc_addEventHandler;
barrel_loaded = {
params ["_item", "_vehicle"];
if (_item isEqualto _barrelarray_1 && (!alive _item) then {
hint "barrel loaded", barrelcounter1 = barrelcounter1 + 1,
if (barrelcounter1 = 3 then {hint "Objective Complete"});
};
};```
The Hints are just visual checks that pop up when things happen. I've been able to get it to work with a single object instead of an array, but adding multiple objects has been stopping me.
https://discordapp.com/channels/105462288051380224/105462984087728128/523163631211380776 Found it!
@astral dawn
https://github.com/dedmen/Intercept_FastScript
Only took me a month to accidentally step on it. Could use this to ignore the 3ms limit of the scheduler or do something else fancy.
It's not really a scheduler though. It's the script VM evaluator.
That project was fun while it lasted... Something like 2x as fast script execution on AMD processors was the result I think. I should probably fix that up to get the FPS boost back.
uhm ... wut?
So... it's an alternative sqf VM? 😕
It's the evaluator part of the SQF VM inside the Arma engine
replaced virtual function calls by static lookup. That removed one or two memory jumps that had to wait for RAM to return results. That made scripts run a whole lot faster on AMD, almost no effect on Intel CPU's
Oh that looks fun... I think i've read something about C++ tables for virtual functions... so this addon messes with these tables?
Nope. It circumvents the lookup of these tables
I check what type a certain class is, and call the method directly instead of looking for the method in the vtable which would require a memory lookup
Honestly I have no idea how one would perform such a thing for a program which is already compiled and deployed (arma)
By writing Assembler 😄
Why does Intel handle this thing better than AMD?
does it still?
yeah. Not as much difference. But still enough difference
if one applies all fixes required to get them on a sane level i mean
in regards of their prediction cheating
Allright, so you mean that with this... almost hack of yours, you can potentially replace the scheduller method calls with something else and mess up arma to an unimaginable degree, right?
It's also interesting why C+ compiler doesn't perform such an optimization 🤔
It can't
and mess up arma to an unimaginable degree, right? sure. 😄 Very easy with Intercept
What if... reimplement the whole SQF machine, but make each command which alters a global state(or arma object) or accesses engine protected by a mutex, then we would be able to spawn scripts on separate cores?
Hmm... still will be bound to the single arma's thread on engine manipulations though... but might boost pure calculations without global variable access
Nvm I think we have discussed a similar thing here already
Wow I never felt so incompetent like when reading all the stuff you discuss here
but make each command which alters a global state That would be... every command.
So what use would that make if every single command was in a mutex but you could execute on multiple cores?
they do
You are limiting your understand of global/local on what you can observe in SQF
that's not all that exists though
the memory allocator for script values is a global pool allocator.
So you mean that when I do _a = 3; and _b = 6; in our supposed multithreaded SQF VM, they both would wait for a global allocator to allocate space for _a, then for _b? I guess It would need a local per-thread allocator then?
Yeah
I'd guess that making a local allocator is not so hard? Considering that @queen cargo already has an SQF virtual machine and there is an Intercept to potentially interface it with the engine 🤔
X39 is not using Arma data types
Intercept does.
How do you mean?
no
Intercept hacks it as it is
I prefer the term "interfaces"
When you say hack people always think of wallhacks and aimbots and that crap
People give words different meanings all the time
How can you potentially do that reliably? What if they decide to repack a few structs inside the RV code for whatever reason, won't this interface break?
It would break. But they don't
Yep
@astral dawn you can use SQF-VM and implement that ... actually, implementing everything threaded would be fairly simple without the rendering part (which is the actual reason why all of that is so "hard")
Some things could be multithreaded internally. Like nearestObjects and similar. That do lots of work in engine. That would be a fairly simple optimization. But because these commands are so slow, few scripts use them anyway
i still highly doubt that there is an actual need for keeping that on a single thread
why exactly does stuff like setPosition eg. need to run on a single thread? only reason that would come into my mind would be so that it does not alters eg. simulation stuff or when other commands use it
on the other hand, what if all of those "properties" that get changed max. on per frame basis, would then be mirrored?
in the end, there are ways to get everything multithreaded, i am fairly sure about that
Can you return a config of a control from an onLBSelChanged UI eventhandler? I am trying to set a var on onLBSelChanged change and get the name from the config property text. It works fine on attributeload/save because those EH return a config value. Is there some magical command or function I am missing?
hmm, no command/fnc to return the current config path? I could use the classname if I point directly to the attribute category config but I want to use this control in a few different attribute groups.
You can only have text in a listbox though?
what config path fo you want?
what is in that listbox?
same config as returned from attributeLoad eventhandler in an 3den attribute
what 3den attribute? what type?
no it inherits from combo
it just doesn't have any config values for the combo itself, all of the values/entries are added on attributeload
what config path do you expect?
similar to the way the combopreview for some of cfgmusic are
ace arsenal loadouts are not config values
in attributeSave and attributeLoad it gives the _config parameter which is a direct path to the current attribute entry
or do you want the mission.sqm config that contains the attribute?
that's engine code. No command or script for that afaik.
maybe getMissionConfigValue command? or similarly named. Don't know how you'd find that exact attribute with that though
I want it to be able to find the path without accessing mission.sqm since this is an addon for mission makers and for use in 3den
Hmm, i feared that
any good way to pass the _config attributeLoad parameter to other EH?
There's no namespace/var storage specifically for controls right?
oh no way
thanks arma 3
that was exactly what I needed, perfect
hmm, i wonder why EH on controls don't have _config passed to them anyways, since their attributeload will give them that
now I'm just going to give them a var for that and immediately access it, strange
because it doesn't make sense
true haha, thanks for the help
There being a config to fill the control is specific to 3DEN attributes
that's why you have the 2 special attribute functions
Why modify all dozens of eventhandlers for that single usecase
but EH can be different based on the config, so anything within Cfg3den could have a different EH...
my guess is that they just didnt see any use for it
since all the vanilla 3den stuff works off of saving/loading mission and expression on postInit
yes 😉
_Timer;
_TimerRunning;
this addEventHandler ["GetIn", {
_TimerRunning = 0;
_Timer = _TimerTime;
}];
this addEventHandler ["GetOut", {
_TimerRunning = 1;
_Timer = _TimerTime;
}];
while {(_TimerRunning == 1)} do
{
if(_Timer <= 0) then
{
this setDamage [1, false];
};
else
{
sleep 1;
_Timer = _Timer - 1;
};
};
i do somethink wrong but i dont know what please help
use the eventhandlers to call to a function that starts the timer and can exit when unit is out of vehicle
I have like.. Half a dozen or more problems in that stuff
Am I missing something obvious here? This is executed by the server but all players are not receiving the actions:
[player,
[
"Turn radio on",
{ ["radioOn"] execVM "radio.sqf"; },
"",
1.5,
false,
false,
"",
"'ItemRadio' in assignedItems player && !(player getVariable 'TFR_radioIsOn') && TFR_spawned"
]
] remoteExec ["addAction", 0, true];```
Only the player hosting is getting the actions
- use
privatekeyword when creating local variables. - Line 2 and 3 do nothing. If you want to create a variable you have to assign something.
- use booleans for _timerRunning.
- the parenthesis in the while condition are useless.
- invalid semicolon before
else - you should stop the timer once it get's to 0, not just on the GetOut eh.
- your local variables don't magically carry over to the eventhandlers. You probably want to setVariable onto the
thisobject. - your _TimerTime variable is kinda useless, you can just write the value directly when you set _timer.
- Why are you setting _timer when you stop the timer in getIn? It will be reset anyway when you restart the timer so that one set is useless.
- once your while loop exits once it will never run again. As _timerRunning is not set to 0 it will run the while condition once and then just exit
@vapid drift This is executed by the server There is no player on the server. You are telling everyone to add your action to.. nobody.
is that TFR aka TFAR? The radio mod?
@still forum doesn't the 0 flag in remoteExec tell it to execute on the server as well as each player? Also, no, TFR is a custom tag
Yes it does
But as I said. There is no player on server
you are executing objNull addAction ... on the server as well as each player
which adds the action to nobody. objNull is a non existent object
it will just be ignored
ok, I misunderstood the order of things
Also 0 doesn't make sense. adding a action on a server doesn't make sense, the server cannot execute actions
I thought it was a lazy way of doing it
_barrelarray_1 = ["barrel1","barrel2","barrel3","barrel4"];
["ace_cargoLoaded", barrel_loaded] call CBA_fnc_addEventHandler;
barrel_loaded = {
params ["_item", "_vehicle"];
if (_item isEqualto _barrelarray_1 && (!alive _item) then {
hint "Load Trigger Activates", barrelcounter1 = barrelcounter1 + 1,
if (barrelcounter1 = 3 then {hint "Objective Trigger Activated"});
};
};```
Maybe you can assist with this? the intent is to have a a trigger activate when the barrels are loaded into a truck via ace cargo. I can get it to work with a single barrel but not with multiple barrels.
barrelcounter1 = 3 that's not how you compare values
if (barrelcounter1 = 3 then missing closing parenthesis
then {hint "Objective Trigger Activated"}); one closing parenthesis too many
["ace_cargoLoaded", barrel_loaded] call CBA_fnc_addEventHandler;
barrel_loaded = {
You need to edfine the function BEFORE you add the eventhandler
_item isEqualto _barrelarray_1 that will never happen. A single object won't be equal to an array of strings
if (_item isEqualto _barrelarray_1 && (!alive _item) then missing closing parenthesis
&& (!alive _item) you only want dead barrels? Can barrels even be alive?
the !alive check if the barrel object has been physically removed.
@still forum Just a note, I've redefined all Cfg3den controls that inherit the title control class to have an additional EH to set the passed _config value to any child controls in 3den 😃 seems to work great. Adding a namespace for displays and controls was perfect
appreciate the assistance, btw mr Ded
if the barrel object has been physically removed. That means it will be objNull. isNull command checks that
Oh, i tried it with isNull and it didnt work, then with !alive and it triggered my text notifier
what?
yeah
object isEqualTo stringArray returned true? wtf
@still forum how do i do booleans ?
Wait
Oh, no. not that. So before I tried this code
your _barrelarray variable is undefined
@vapid drift the reason only hosting player get the action is because he is the server, all other players will also get the action when they approach hosting player
@quartz oracle true false
I made this code work using a sigle object, before I tried this array nonsense.
@tough abyss ok, that makes sense, thanks
and when I did that, I ended up using !alive instead of isNull becuase that's what worked on the check.
point 7 is made up of two sentences. The second one is telling you how to fix it
barrel_loaded = {
params ["_item", "_vehicle"];
if (_item isEqualto barrel1 && (!alive _item) then {
hint "Load Trigger Activates"};
};
``` the original code looked something like that before I tried to modifiy to work on multipled barrels.
If you want each player have own action you should pass other players as argument for add action, currently it is only hosting player on every pc @vapid drift
I'd recommend to just remoteExec "call" instead.
@still forum do you mean me ?
yea
i dont understand correctly (im still new to scripting in arma )
&& (!alive _item) you only want dead barrels? Can barrels even be alive? Damage destroyed objects and null objects both return false for alive so you could just combine it
Woah I just had an idea how I can easily circumvent bisign protection even with battleye 🤔 that's dumb...
So why doesn't THIS work then?
{ _player = _x;
[_player,
[
"Turn radio on",
{ ["radioOn"] execVM "radio.sqf"; },
"",
1.5,
false,
false,
"",
format ["'ItemRadio' in assignedItems %1 && !(%1 getVariable 'TFR_radioIsOn') && TFR_spawned", _player],
0.1
]
] remoteExec ["addAction", _player, true];
} forEach TFR_playableUnits;```
format You cannot format objects
It still only create the action on the server/player
I tried that initially... didn't work so I assumed it was still somehow referencing the player similar to earlier
setting JIP flag to true doesn't make sense if you target a specific player and if players will die/respawn when rejoining
the player will be a different object when he joins in later
where do you execute that code?
did you try adding diag_logs to check who you remoteExec too?
if that code executes before the other players joined. Then it will of course not execute on them
I'd still recommend just remoteExec'ing call, that's much easier
so what? Something like
{ player addAction [blah blah blah]; } remoteExec ["call", 0];```
or do I still need to reference the players as objects specifically?
yeah
do I still need to reference the players as objects specifically Huh? Your example is doing that already
Why not put that addAction into player init? Avoid all the hassle of remote exec and JIP
Yeah. just in initPlayerLocal.sqf. even easier. Didn't even think of that 😄
@still forum i still dont know how to fix number 7 :/
done, I will do that thing
Yes with a wait for TFR_spawned which is their init declare
The radio seems to be local so no point abusing network
Alright, I'll go tinker for a while
is there a dedicated discord channel for arma 3 alive?
so I setup the initPlayerLocal.sqf but it still seems to only be working on the host:
// Sets initial state of radio
player setVariable ["TFR_radioIsOn", false, true];
// Waits for the crash and spawn to take place
waitUntil { sleep 1; TFR_spawned };
// Adds actions once spawned
player addAction [
"Turn radio on",
{ ["radioOn"] execVM "radio.sqf"; },
"",
1.5,
false,
false,
"",
"'ItemRadio' in assignedItems player && !(player getVariable 'TFR_radioIsOn')"
];```
Arma 3 !alive 😂
It does as expected for the host, as soon as I set TFR_spawned = true I get the action but on the host player only
do you set that variable globally?
lol I believe so... TFR_spawned is set to false in the init.sqf by the server
should I do it in the missionNamespace and access it that way?
believe so is not confident enough
TFR_spawned = true is already in missionNamespace..
well... if you weren't asking me, it would be a hard yes
init.sqf is also missionNamespace
Don't think that moving stuff from missionNamespace to missionNamespace will change much
fair enough
in init.sqf:
if (!isServer) exitWith {};
// Definitions
TFR_spawned = false;```
that's not global
and that's why I said "I believe so"
Why broadcast player setvariable publicly to other pcs?
publicVariable or setVariable with public flag
@tough abyss What do you mean?
I guess I'm not sure what you mean. The intent was that each player stored whether or not their radio was on on themselves
Is this your code?
Yeah
So how could you not have any idea? You setVariable on player with public flag
What do you think public flag does?
Geez man, I just wasn't sure what you were talking about
I need whether or not the radio is on to be accessible to other things in the game
To me it looks like you need it to hide switching radio action when radio is on from the code you posted, that could be done locally
This is one section of code, but whether or not it's publicly available shouldn't affect the funcionality
I really do need it public accessible. There are things happening
All I'm really trying to figure out is why I can't get this action on each player
Ok but another variable that controls wether or not action is added is TFRspawned, do you publicly broadcast it to all clients?
Apparently I wasn't? I was under the impression that but declaring a variable outside of some limited scope, it was available publicly. If I understand publicVariable correctly, which I most likely don't along with everything else, this should have done the trick:
if (!isServer) exitWith {};
// Definitions
TFR_spawned = false;
publicVariable "TFR_spawned";```
But it didn't
I also tried:
waitUntil { sleep 1; (missionNamespace getVariable "TFR_spawned") };```
And again, only worked on the host
That’s because it is undefined on all clients
Because of the !isServer condition
You exit before you define it on clients
You should exit after you set it to false
There should be rpt logs complaining about undefined variable
Because of the !isServer condition no. publicVariable sends to everyone
but the setting to true also needs a publicVariable
I did it from the debug console
I also tried: that could work if you pass default value to getVariable
There is no guarantee server will finish before clients and clients will receive broadcast in time
But Dedmen is right, where is your broadcast setting the variable to true?
Or is it a typo and it was meant to say true instead of false?
for testing purposes, I'm setting it to true from the debug console
How?
Exec Global?
Yes
Check rpts on clients for undefined var errors
or just add diag_logs?
Or -showScriptErrors
I think I hate this game
Should I just go make a game
wtf... I completely eliminated the requirement for TFR_spawned and I still don't get the action on the client. initPlayerLocal.sqf:
// Sets initial state of radio
player setVariable ["TFR_radioIsOn", false, true];
// Adds actions once spawned
player addAction [
"Turn radio on",
{ ["radioOn"] execVM "radio.sqf"; },
"",
1.5,
false,
false,
"",
"'ItemRadio' in assignedItems player && !(player getVariable 'TFR_radioIsOn')"
];```
Yeah, I'm done
{
"scripts": [
{
"header": {
"cloudId": "touchdevelop.com",
"scriptId": "",
"userId": "",
"status": "unpublished",
"lastUse": 1534535521,
"editor": "touchdevelop",
"name": "asteroids",
"comment": ""
},
"source": "meta version "v2.2,js,ctx,refs,localcloud,unicodemodel,allasync,upperplex";\nmeta name "asteroids";\nmeta icon "Controller";\nmeta color "#ff9955bb";\nmeta rootId "brfq3jQUUoV5pYmDr4BjfPS2";\nmeta hasIds "yes";\nmeta platform "current";\nmeta parentIds "";\n#kHcffg3UF1mtmGhj\naction main() {\n #rbrir7DU6e20OfsW $board := @\u267b→game→start;\n #NEkof1X74vhoLYxa data→highscore := data→highscore;\n #MN4lxUN5J8YV9b9d $playership := @\u267b→game→create_sprite(art→ufo);\n #xWZLmPl4ywR03Cwd $startbutton := @\u267b→game→create_sprite(art→refresh);\n #lA8zbiUUnTA7z82t $movementFlag := $board→create_ellipse(10, 10);\n #bJLBjOaEFSPpHs1d $highscoretext := $board→create_text(100, 40, 20, "high score: " ∥ data→highscore→to_string);\n #PzpM4b02KiELQtnO $asteroid_set := $board→create_sprite_set;\n #IEXtk4Db6Z1pJPzX $laser_set := $board→create_sprite_set;\n #A6uG4SzMtV08nbtl $laser_count := 0;\n #FbEkNqajCRrsK4X4 $counter := 0;\n #SdszqjO72m72mVEx $asteroidsonfield := 0
I had to delete 29002 words fuck me
9000 characters
What the actual f...
initPlayerLocal.sqf:
// Adds actions once spawned
player addAction [
"Turn radio on",
{ ["radioOn"] execVM "radio.sqf"; },
"",
1.5,
false,
false
];```
STILL doesn't add it to each player. This is ridiculous
Idk
It’s probably one small thing you added that makes the code not work
I honestly don’t know
Thanks anyway
@iron sand you sure you’re in the right channel? Or even discord?
@vapid drift try to work with init.sqf and construction:
if (hasInterface) then {
//adding action to player
};
I understand that is the same, but 😅
okay so I want to draw a marker into 3D world space. I want to get the color of the marker for drawIcon3D.
I know how to return the config array of the marker color. But in some cases the array is not [R,G,B,A] but ["someStuff","someStuff","someStuff", "someStuff"] like for
color[] = {"(profilenamespace getvariable ['Map_BLUFOR_R',0])","(profilenamespace getvariable ['Map_BLUFOR_G',1])","(profilenamespace getvariable ['Map_BLUFOR_B',1])","(profilenamespace getvariable ['Map_BLUFOR_A',0.8])"};
How would I convert that array into a numerical RGBA array?
@delicate lotus i correctly understand, that now you returs array of strings? or what?
private _TimerTime = 5;
private _vehicle = _this select 0;
private _TimerRunning = false;
_vehicle addEventHandler ["GetIn", {
_TimerRunning = false;
}];
_vehicle addEventHandler ["GetOut", {
_TimerRunning = true;
_Timer = _TimerTime;
}];
while (_TimerRunning == true) do
{
if(_Timer <= 0) then
{
_vehicle setDamage [1, false];
_TimerRunning = false;
}
else
{
sleep 1;
_Timer = _Timer - 1;
};
};```
im doing somethink wrong i the while loop please help
@quartz oracle you can't use private variable in this scope
@lost copper it returns sometimes array of strings instead of numbers.
@delicate lotus can you give an example?
@lost copper so make it not private ?
@quartz oracle yep
@lost copper
["(profilenamespace getvariable ['Map_BLUFOR_R',0])","(profilenamespace getvariable ['Map_BLUFOR_G',1])","(profilenamespace getvariable ['Map_BLUFOR_B',1])","(profilenamespace getvariable ['Map_BLUFOR_A',0.8])"], the array for the BLUFOR marker color.
You want to create your personal repawn system for vehicles, @quartz oracle ?
@lost copper gives me still error
@delicate lotus thi is a code to execute or return array from some function?
@lost copper kindof, i want vehicle to respawn after a specific amount of time after they got abondend
its just the configFile entry for the marker Color
but now that you said code...
I just realized it has an obvious code structure
so I could just do array apply {call compile _x};
@delicate lotus you need specific color from player's settings?
yeah
but It works now
so all fine now ^^
though I guess I should call that piece of code not every frame. seems kind of expensive. Going to cache the result somewhere.
Yeah, that sounds good
@quartz oracle
why you can't use vanilla respawn system?
That do the same thing, that you want to realize
does the delay also work for respawn becaus too far away ?
Yes
ohh
Check the module in EDEN editor
you can edit radius to respawn and time to respawn
it works correctly in my polygon mission 🙂
but not for me
can you take a screenshot of your module settings?
hi guys. Is it possible to terminate the previously ran script once a new one is triggered?
Im having this in my eventhandler:
engine = "_this execVM '\WHwalkers\warhound\scripts\init_walk.sqf';";
Im trying to terminate the previous one if a new one is triggered. I know I can save the script handle when calling execVM but how can I use that for next time the EH is triggered?
@nocturne basalt You want to use "engine" variable every time?
And terminate script, if EH triggerered again?
yes
Im am trying to exitwith inside existing scripts, but they just keep stacking up
based on an animation value I set
Is "engine" variable global for missionNamespace?
no its not a variable, its an eventhandler
class Eventhandlers
{
engine = "_this execVM '\WHwalkers\warhound\scripts\init_walk.sqf';";
};
inside my config
cant I grab the handle from existing running scripts somehow?
like "execute engine EH, terminate all other scripts"
I am using diag_activeSQFScripts to display them
are they both running locally only? if so - set a local variable on the vehicle...
but its only strings
In description to execVM command i see this sentence:
The optional argument is passed to the script in private variable _this. In Arma 3 the script handle is also passed to the script in _thisScript variable.
If you are just doing a timeout or making sure EH scripts don't overlap a simple var declare will work
hmm, but the one passed is not the one I wanna terminate. I wanna terminate the previous one
@slim oyster how do you mean?
@austere hawk how would I use the local variable to check if I should terminate it?
You can try to create special variable in missionNamespace via sqf you running and save _thisScript value inside
oh. like storing them all in a global array and terminate them all before I start a new?
Yep
🤔 that may work
have your EH point to a spawned function that can save the scripthandle within it. If script is not done, terminate it and exec a new one, saving that new scripthandle.
I'd just declare that variable in an init EH right
ok thanks guys I got some new ideas now. gonna give it a go
I can call it inside the init_walk script which is execVM'd already cant I
must just be careful not to terminate the one I just called
@nocturne basalt try
engine = "params [""_veh"", ""_eng""]; if (_eng) then {_veh setVariable [""script"", _this execVM ""\WHwalkers\warhound\scripts\init_walk.sqf""] } else { terminate (_veh getVariable [""script"", scriptNull]) }";
cant use scriptDone since the ones Im terminating are running some loops
wow thanks @tough abyss 😁
@tough abyss seems tricky
straight forward, why?
Not for my level
worked like a charm @tough abyss thanks alot!
np
How i can create bug report? It's about module in EDEN editor.
@winter rose thx. Sorry, if i ask in wrong tread
more of a #general_chat_arma or #arma3_troubleshooting , but it's ok
@winter rose cause of bug was finded, when i try to help @quartz oracle in this thread 😀
don't worry about it really ^^ (it's night time, too)
["ace_cargoLoaded", loadtracker] call CBA_fnc_addEventHandler;
loadtracker = {
params ["_item", "_vehicle"];
if (_item isEqualTo barrel_1) then {
hint "Barrel Loaded";
};
};
so this code notifies me when I ace load a barrel on a truck. What I'd like to do is make it so that it activates when I load barrel_1, barrel_2 and barrel_3 on a truck. im trying to use a thisList but to no success. help, please?
You could use a switch statement
Or find to check if the object is present in an array.
hmmm I will learn these things. expressions I havent heard of yet. Still new in my scripting journey.
hmm how could one know if the mission is in (Single Player) preview?
is3DEN or is3DENMultiplayer both return false 🤔
problem solved isEqualTo needed to be EqualTypeAny
@marble pasture isEqualTypeAny (with your example of barrel_1 as a parameter) just returns whether the loaded item is an object, not that it is one of a specific object(s)
@ruby breach Oh nooooo, lol. that's a bummer, I was so excited there I failed to test farther than I needed.
appreciate the heads up, though!
@marble pasture ```sqf
if (_item in [barrel_1, barrel_2, barrel_3]) then { hint "yup!"; };
@winter rose <3333333 that's exactly what I was trying to do and had no idea how to do it, lol thanks much!
Anytime! 👍
hi guys, im spawning an ai unity and attempting to strip its gear then refit it
_grp = [getmarkerpos _SFHVTMarker, East, ["CUP_C_R_Functionary_01"],[],[],[],[],[],116] call BIS_Fnc_spawnGroup;
the unit spawns but when i pass
RemoveAllWeapons _grp; I get an error saying generic error in expression.
@cobalt idol Yep
Cause you use comamnd for group, but must use for each unit in group
why isnt it displaying
"It says: Type Group, Expected Object" for me?
{
removeAllWeapons _x;
} forEach (units _grp);
should i be spawning this one unit in not as a group?
Basically you’re trying to remove the weapons from the Group. Game is telling you that it can only remove weapons from one unit at a time
i get that, but can i spawn the unit and not have him be in a group?
@cobalt idol you can't
okay thanks!
every unit must be in the group
im trying to not ask why...
But if you’re just creating a single unit, use https://community.bistudio.com/wiki/createUnit
Then the return value is the created unit
(or Nothing, depending on syntax used)
@cobalt idol try using -showScriptErrors flag, available in the launcher's advanced options – saves your debugger's mind! 😉
awesome thank! why some of these options arent tick boxes in the UI.......
@winter rose or open a wonderful world, that no escape from them 😅
nvm ill try it befor i post lol
Nah, still feel free to post. Just try to report the full error (from the log file) in case it's less obvious what's gone wrong. 😁
but can i spawn the unit and not have him be in a group? You can createAgent, agents are groupless
#arma3_config <- addon editing channel @devout stag
But if your question is scripting related, which seems like it is, you are in the right channel, sorry for confusion
Basically
I have narrowed my issue down a bit
I want to make my array a global, per mission variable.
And or a general missionNamepace variable (editor)
That I can then use pushBack as a part of my attribute statement to add the selected object to the array
So that I can execute the code on it
Seems pretty straight forward, what are you having problem with?
I am trying to not call every single object in the missionNamepace
That is a fundamental requirement
someArray = []; to create array, someArray pushBack WHATEVER; to fill, {_x call someFunc} forEach someArray; to call a function for each element of array
This is also based upon editor attributes
Heh, if only it was that easy...
class UO_FW_ACRE_RACK_ENABLED {
property = "UO_FW_ACRE_RACK_ENABLED";
displayName = "Add Rack to Object";
tooltip = "Allows objects to be given radio racks defined by ACRE settings";
control = "CheckBox";
expression = "_this setVariable ['%s',_value,true]; ";
condition = "objectVehicle + (object * (1-objectBrain)) + (1 - objectControllable)";
defaultValue = "0";
};
Here are some of the editor attributes I'm working with.
I want to basically make these editor attributes, in this case the class UO_FW_ACRE_RACK_ENABLED
to when enabled, add the object the attribute is associated with
To an array of objects.
I just don't know where or how to create this array.
I'm meeting the standards of a repository I'm contributing to
So under no circumstances can I poll every single object in the mission to see if it has a certain variable and that variable is set to true
So you want to push _this into some sort of array which you would use on mission start to add whatever to the object?
Or an array that already exists within the missionNamespace
But yeah that's pretty much it
I'm just figuring out how to add the array that I need
I've determined I need an array that is kept within the missionNamespace and can be referenced consistently
This array also needs to be accessible through the editor somehow
Not one or the other
Alright nvm, thanks for the assistance @tough abyss I was just informed by a fellow collaborator that I can make calls to a function directly through the attribute expression.
Cheers though kek
No arrays then?
No need for compiling an array and then doing a foreach or apply on it, you can call functions directly from the attribute expression
expression = "_this setVariable ['%s',_value,true]; if (_value) then {[_this] call fnc_functionName;};";
Hey guys, looking for some help with the ace arsenal, I've added;
this addAction ["ACE Arsenal", {[box1, player, false] call ace_arsenal_fnc_openBox;}];
[box1, [ "fow_w_leeenfield_no4mk1","ITEM2...","ITEM3","etc...." ]] call ace_arsenal_fnc_addVirtualItems;
It functions, except the ammo tab that show ammo for your weapon, I'm assuming it has something to do with global vs local stuff but im not sure, my scripting skills are rather novice.
@slim oyster Assuming the _value is boolean, but it actually looks like number from that config.
@quartz oracle _TimerRunning == true makes no sense. Comparing a boolean to true is the same as the boolean itself.
And you still cannot use local variables in the eventhanlders. I already told you to use setVariable. Just look up setVariable on the wiki.
_TimerRunning == true makes no sense it should error
toFixed has a funny bug, if you mess up with syntax it might behave weird. For example I found out that using wrong syntax within one scope with text ctrls will make them all look 0.000000000000
Just fun info
what "wrong syntax" ?
what Dedmen asks @unborn ether
Sounds to me like you use toFixed NUMBER and wonder that it changes what str command outputs. That is expected behaviour
Should be number toFixed value. I've accidentally did toFixed number like it was unary.
that's not wrong syntax
Yeah, but why it did touch all text controls around?
because it influences all number to string conversions
Well, then it's expected. 😄
You didn’t check wiki before assuming it was a bug?
Does anyone know what causes a "C0000005 ACCESS_VIOLATION at F196F08A" error?
you mean a game crash
Yes
report a ticket and be done with it
But the issue is that it's not random
cool
so you can even reproduce and increased the chance of it getting fixed
I made something that adds buttons to the inventory and I'm not sure what's causing the crash in the code.
then things are fairly easy .. inventory is highly engine based
solution stays the same: create a ticket at the arma 3 feedback tracker
So could hiding any of the items in the inventory cause a crash?
are you removing UI eventhandlers inside a script maybe?
I've narrowed it down to this
while{player getVariable ["newMenuOpen",false]} do{
if(player getVariable "groundTabOpen") then {
ctrlShow [6321,true];
}else{
waitUntil{ctrlVisible 6321};
ctrlShow [6321,false];
};
};
Somehow that causes a game crash
But I'm going to add it to a spawn and see if that helps since I'm using waitUntil
if it is not in a spawn then it should error and exit
It's not erroring though is the weird thing
where you run this script from
From the inventoryOpened Event Handler. The thing is that the buttons are made properly but when I click on one it crashes. I'm messing with the code for a bit to see if I can fix it
Is there a difference between https://community.bistudio.com/wiki/ctrlVisible and https://community.bistudio.com/wiki/ctrlShown
ctrlVisibile takes the idc and ctrlShown a actual control
therefore ctrlVisible will only work with the currently active dialog
not with displays for example
You place the code in inventoryopened as it is, no [] spawn {....code...}?
It's being called from a buttonAction in inventoryOpened
eh?
And @tender root I think that's my issue is that I'm not using a dialog, I'm using a display. So I'm going to try with ctrlShown
inventoryopened is event handler it gets fired when inventory opened, there is no button action anything in it
so where you run this code from?
Actually, meh, I'm bored, your problem is UI context
I'm using ctrlCreate to make a new button and I'm executing the code from that
Don't make ticket, it will not be solved, find different way of doing what you want
That's what I'm doing now
Question in regards to params
I want a param to only accept an array as an input
["_configArray", "", [[]]],```
Is that the correct way to make this parameter?
default value string for something that should only be array?
yeah seems correct besides that
@devout stag sqf ["_configArray", [/*array default value*/], [[]]],
@winter rose cheers
Is there a way to get the vehicle init? like the one we put in the editor?
Can an FSM take preprocessor data? Can one #include a bunch of macros and have them used throughout the FSM or does the preprocessing work differently with the FSM states?
When creating a unit local to the client and then giving the client control over it with selectPlayer this unit will be synced with the server right? Like it would be the editor places player unit ?
synced with the server?
A local unit that the player controls will be local to the player
yea but it will appear for others players?
and the server can execute logic against it - that's my question
@slim oyster I think FSM preprocesses as well
You cannot create local unit @frigid raven
Didn't seem to work, Neither #include nor #define worked, states that statement not supported: #include directive not supported here
FSM's are not simple text files like everything else that supports preprocessor, so my guess would be no. But I never used FSM's
I’ll check it
Yeah, makes sense why it wouldn't. Makes the CBA statemachine tempting...
Do you really need that FSM editor? Probably you could do with switch statement
@tough abyss what does that mean? What happens if I execute createUnit local on my client? nothing? Or automagically delegated to server side?
Can you do complex forks in sqf without a bunch of extra variables? This is for AI state evaluation. I could use CBA statemachine which acts as a weirdly scheduled state machine
I thought about using it some time... before I read your comment an hour ago that it doesn't support preprocessor 😄
Complex forks... what is that?
AFAIK the BI's state machine is good because it eases condition reuse, but i might be wrong
Yes it supports complex forking
What are you doing with the poor AIs? I have a GOAP framework lying around... still didn't have enough time to play with it though
Many things
I just wanted CBA error logging macros to track errors and logs
sadly not possible without directly calling the functions
hmm... yes, you could make wrapper functions for these macros
probably i'd do it like this if I were in your place
The CBA statemachine can create "an almost FSM" from sqf or config, so preprocessors will work
wait, but it would generate callable code... :/ if you place call everywhere instead of a pure macro
The unit is created global, on every instance but control of the unit goes to your pc @frigid raven
It could be created on server but selectPlayer will transfer control to you with little delay, if you create it locally there will be no delay
So what are you asking exactly?
Unit is just like vehicle or turret, if it is user controlled user is the master
@tough abyss Well I have some "login" functionality. Want to create a new unit - give it some persisted variables and then teleport it to a position. After all of this is done I want to make the player control this unit. After the "setup" is done so to say. All this stuff happens on client side functions atm. I just want to be sure that the controlled unit afterwards hasn't any issues when playing in multiplayer like... dunno being invisible for other players? Just assuming since I have no XP with that.
No unit is global it doesn’t matter where you create it