//Blue Trigger 1
_SectorFIA_1 = createTrigger ["EmptyDetector", markerPos "Sector_1", false];
_SectorFIA_1 setTriggerActivation ["ANY", "PRESENT", true];
_SectorFIA_1 setTriggerArea [100, 100, getDir this, true];
_SectorFIA_1 setTriggerInterval 5;
_SectorFIA_1 setTriggerStatements [
toString {East countSide thisList < 0.4*(West countSide thisList);},
toString {
DeleteMarker 'Objective_1';
_Flag = createMarker ['Objective_1', markerPos 'Sector_1'];
_Flag setMarkerType 'Flag_FIA';
private _lastOwner = thisTrigger getVariable ['currentOwner', sideUnknown];
If (_lastOwner == East) then {
RedZones = RedZones -1;
PublicVariable 'RedZones';
};
thisTrigger setVariable ["currentOwner", West, true];
BluZones = BluZones +1;
PublicVariable 'BluZones';
},""
];
};```
#arma3_scripting
1 messages · Page 766 of 1
Sorry, can’t format from phone. Will fix.
The script has been looked at on this channel before. Its goal is to create sectors for control, as I don't like the vanilla sector system and don't know how to modify it.
This script is adding zones appropriately, but it is not deleting zones as intended, which is necessary for my ticket bleed script.
Aren't they simply different triggers, so _SectorFIA_1 never has currentOwner east and _SectorAAF_1 never has currentOwner west?
That's a distinct likelihood. I don't really understand the scope here.
You're creating two separate triggers but you need a single toggle variable, right
Indeed.
If they're related to a single objective marker name then you could chuck those in a hashmap, maybe
They are able to communicate about the marker...
Yeah sadly there's no marker object to put vars on.
Yeah, they delete and recreate the same marker. Idk why I didn't think of it earlier, My scoring system could literally just count which types of flags are on the map.
I think so. I've got hd_objective_noShadow which means no one owns the zone, and I've got Flag_Altis and Flag_FIA representing opfor and blufor respectively.
They are already deleted and recreated perfectly in game using this script.
Not sure why you don't just setMarkerType in those triggers.
Because I didn't know any better. There is likely a more elegant way to do every single portion of this script. I am not a coder.
hmm, that's pretty good for a non-coder :P
It's a combination of copy/past/trial/error from the BIS Wiki and then coming here for help when I'm not getting an error to tell me what to do next.
(this is what coders do)
Fair enough. Would you have any tips on how to count by marker types?
BRB, going to check on setting the marker type without the deletion and creation. Maybe there is a reason I did it that way.
There's a JIP bug with changing the same marker multiple times, so that might be a thing. I should probably make a replication case for that.
Oh! No kidding. Well, that’s good to know.
There also appears to be an issue with scope. It’s not working without using the local _Flag tag inside the trigger.
well, you'd do 'Objective_1' setMarkerType 'Flag_FIA'
Markers are a bit odd in SQF because they're not a separate type. They're just a string that can reference a bunch of internal data.
Setmarkertype is working now. I’m a bit concerned about the JIP bug, and may save this revision for later.
In either case, I think some method of counting flag types MAY be the solution I need, unless what you’re telling me about them being odd strings is an obstacle.
Where I've seen the JIP bug it was specific to marker colour, so type might be fine.
That’s good to know! Would greatly reduce the size of my script by cutting two lines forty eight times.
well, if you have a list of your objective markers, you'd just do something like:
{ markerType _x == "Flag_FIA" } count mytag_objectiveMarkers;
If you're actually pasting all this trigger code for every objective then there are definitely better ways to do that :P
A list?
Oh, trust me, I know there are better ways, I just don’t know them. There is probably a way to get everything I need from thirty lines of code, rather than hundreds of repasted lines.
Yes, they are.
So first you could make an array of them, like this:
allMapMarkers select { _x find "Sector_" };
Oh for fuck's sake, why doesn't this work sometimes
That is intriguing.
So then you can forEach over that array to generate your triggers.
Generating the objective markers at the same time, and attaching them to the relevant triggers with setVariable.
I’ve tried something like this before, but I didn’t understand and reverted to what was working for me.
If I COULD get that to work appropriately, then we’d really be saving me some work in the future.
what doesn't?
Discord syntax colouring
"sqf" should be on the same line as ```
hint "hello world";
"sqf" turns green when it's right, then you're good to go. Also no space ```sqf
Now I've got this, which works and is, I think, easier to read.
I'm not creative enough to know how to capture the marker types and count them.
If (isServer) then {
'Sector_1' setMarkerType 'hd_objective_noShadow';
//Red Trigger 1
_SectorAAF_1 = createTrigger ["EmptyDetector", markerPos "Sector_1", false];
_SectorAAF_1 setTriggerActivation ["ANY", "PRESENT", true];
_SectorAAF_1 setTriggerArea [100, 100, getDir this, true];
_SectorAAF_1 setTriggerInterval 5;
_SectorAAF_1 setTriggerStatements [
toString {West countSide thisList < 0.4(East countSide thisList);},
toString {'Sector_1' setMarkerType 'Flag_Altis';},""
];
//Blue Trigger 1
_SectorFIA_1 = createTrigger ["EmptyDetector", markerPos "Sector_1", false];
_SectorFIA_1 setTriggerActivation ["ANY", "PRESENT", true];
_SectorFIA_1 setTriggerArea [100, 100, getDir this, true];
_SectorFIA_1 setTriggerInterval 5;
_SectorFIA_1 setTriggerStatements [
toString {East countSide thisList < 0.4(West countSide thisList);},
toString {'Sector_1' setMarkerType 'Flag_FIA';},""
];
};```
3DEN mission right?
Yes.
Just create your markers , separate them into layers, then get them from https://community.bistudio.com/wiki/getMissionLayerEntities on start, apply whatever you want with forEach.
Easier to manage, easier to modify when you want a change.
I don't even know what layers are.
check left hand side on 3den, each folder is called "layer"
Oh! It's just editor object groups. Cool.
every object is listed inside a layer basically. Although not sure if default ones are counted as layers too...
but yeah just create a new folder there, then reach to it by calling its name with the command I linked above.
Defaults appear to be called as layers, but not "returned" as layers. So likely not "counted."
No need to categorize anything. No need to remember anything in case of modification. If you are afraid to forget, slip a "Comment" inside the layer too.
Once done, hide them, live happily ever after.
@tranquil jasper I'm aware of that. There's just some discord bug where it decides it's going to ignore it, and you have to rewrite the whole comment from scratch to kick it into life.
Just keep in mind for locality that you've restricted the trigger to only get created on, and local to, the server
That's intentional.
What might be the advantage of having these triggers evaluated elsewhere?
saving some server processing in return for dealing with a lot more locality bullshit
Thanks, I'm reading about creating and manipulating layers now.
Which locality issues do you foresee?
you probably put the ```sqf in the same line as the text before it?
personally never experienced any bug with that tho 
hey i wonder
is there a script that would automatically deploy your parachutes, the moment you exit from a trigger?
kinda like a static line, but i cant use ones that are already in game
what do you mean by static line? 
remove the backpack, create the parachute vehicle, move the player into the "driver" seat
no no, not like that
i meant as in, when the player jumps out, the chute automatically deploys, like a static line chute
we have backpack on chest, so the first part isnt necessary(?)
GetOut event handler
and no the players do not start in the vehicle passenger seat
its on a static plane, inside the cargo bay
Ah
Well
you helped me script this last week if you remember XD
You could have a loop that checks every 2.5 seconds or so if their altitude is lower than the aircraft's altitude
Then when thats true you deploy the parachute and break the loop
But I'm trying to think of a better way
leopard helped me write a script (or the condition to activate said script) last week, that i think we could replicate, where the moment the player enters a halo animation, the script is exceuted
You can use animchanged event handler
(i think) i just need the second part which opens the parachute thats on the players back once that condition is filled
But I'm not sure if they will halo jump or will just fall like a stone
yeah i already have that part
anything related to the jump itself is handled, we just need the parachutes
And compare the _anim parameter to it
also i need to mention: i know very little about scripting, besides the very basic stuff
so talk to me like im 5(?)
dang
You see that _anim?
yes
First jump off the the thing yourself and
When the halo animation starts
Put in debug
animationState player;
It should give you the animation name for halo jump
Then simply put in the evnt handler an if Statment that checks if _anim == halo jump then the parachute
again look: like i said i have everything related to the animations handled(ish)
i just need to know if you can open a parachute on someones back, with a script
ok, go for it
this is the eventhandler, leopard wrote, i already have this part
if ("halo" in _this#1) then { script goes here }};```
i just need the script goes here, where the parachutes are opened
_chute = createVehicle ['Steerable_Parachute_F', position Player, [], 0, 'CAN_COLLIDE'];
player moveInDriver _chute;
thank you!
wait, so question, if the player has a parachute on his back does that, interfere with that?
No
ok perfect
It just
Spawns a parachute
And moves you into its driver seat
No matter what backpack you have
Seems like its going bad
ok, didnt spawn the parachutes
ok just to make sure, you put this in...initplayerlocal.sqf correct?
Yep
yeah didnt spawn the parachutes
bare in mind its working with another event handler thats got the same conditions
Try
_chute = createVehicle ['Steerable_Parachute_F', position Player, [], 0, 'CAN_COLLIDE'];
In debug
heres what the entire file looks like
player setVariable["loadout", getUnitLoadout player];
hint "Selected gear saved!"
}] call CBA_fnc_addEventHandler;
sleep 10;
player addEventHandler ["animStateChanged", {
if ("halo" in _this#1) then {
_this#0 setVelocity (plane1 vectorModelToWorld [0, -150, -3]);
_this#0 removeEventHandler ["animStateChanged", _thisEventHandler]
}
}];
sleep 10;
player addEventHandler ["animStateChanged", {
if ("halo" in _this#1) then {
_chute = createVehicle ['CUP_T10_Parachute_backpack', position Player, [], 0, 'CAN_COLLIDE'];
player moveInDriver _chute;
}
}];
Does it spawn a parachute when you execute it?
you want to spawn the chute at [0,0,0] then move it to the player
and yes i've tried with the base game parachute
Try that
yeah...what do i have to write...exactly?
_chute = createVehicle ['Steerable_Parachute_F', [0,0,0], [], 0, 'CAN_COLLIDE'];
_chute setpos (getpos player);
player moveInDriver _chute;
nope
Try?
yep, trying
still nope
F
!quote 5
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
I hate ASL i hate ASL
setposatl or asl?
doesn't matter. just not setPos
THEN WHY IS IT STILL IN THE GAME MAGIC MAN

because there is still very specific usage for it
What is so bad about setPos?
There is tons of stuff left in the game that is mostly there just because it didn't exist when crucial scripts were written back in the day, yeah or nah?
its specificity is not enough
Ah, I gotcha.
unpredictable behavior
Yep
so which flavor of the month should i use here? ATL or ASL?
Hypoxic help the guy if you may my fingers are getting flattened
doesn't matter, as long as you are consistent
ok? atl i guess?
I don't want to barge into something here, so I can wait if needed, but would anyone be able to set me on the correct path to understand how to make something basically drain one ticket per second as long as a certain condition is true? My code might already be correct, but I'm not sure of the best way to check the conditions or trigger the function.
While {RedZones < (0.6*BluZones)} do {
Sleep 1;
RedTickets = RedTickets - 1;
PublicVariable 'RedZones';
};```
Still confused about the [0, 0,0], had a script that spawned it on player and worked normally hmmm
What is the debug returning
just do the chute itself, forget all the other animation stuff.
work backwards
get the pieces working first, then put it together
execute this in debug?
if it is returning something with null then that's the problem
yeah ok now it works
ok then back to one of my theories, there are 2 same eventhandlers in one file
is that the source of the peroblem?
its
player addEventHandler ["animStateChanged", {
if ("halo" in _this#1) then {
_this#0 setVelocity (plane1 vectorModelToWorld [0, -150, -3]);
_this#0 removeEventHandler ["animStateChanged", _thisEventHandler]
}
}];
sleep 10;
player addEventHandler ["animStateChanged", {
if ("halo" in _this#1) then {
_chute = createVehicle ['Steerable_Parachute_F', [0,0,0], [], 0, 'CAN_COLLIDE'];
_chute setposATL (getpos player);
player moveInDriver _chute;
}
}];```
I don't want to outright give you the answer, but rather show you how to get to the answer
so first, check to see if your event handlers are even firing when you want them to
yes the one above is firing
the one below isnt
the top one is to simulate inertia from jumping off an aircraft
i could feel it, so its working
Use systemchat "text"; to confirm
btw, if you are using setposATL you need to use getPosATL
player addEventHandler ["animStateChanged", {
if ("halo" in _this#1) then {
_chute = createVehicle ['Steerable_Parachute_F', [0,0,0], [], 0, 'CAN_COLLIDE'];
_chute setposATL (getpos player);
player moveInDriver _chute;
systemchat "text"
}
}];
``` making sure
ok done
getposASL must be added!
ahem
Does it say text?
havent tested, im doing it now
It should show in chat
He said it doesn't show text
Either that or the if Statment is wrong
Now
Try putting the systemchat "text";
Above the if Statment
But still inside the event handler
If it says text in chat, that means the event handler is firing
i did, but i also forgot the ;
so im testing again
Send home address
oh that
so basically the players starts off already in a halo anim for a brief second
before the game goes "wait im on solid ground"
so its to prevent the eventhandlers firing off too early
10 seconds?
changed it to 5
like this?
player addEventHandler ["animStateChanged", {
systemchat "text";
if ("halo" in _this#1) then {
_chute = createVehicle ['Steerable_Parachute_F', [0,0,0], [], 0, 'CAN_COLLIDE'];
_chute setposATL (getposATL player);
player moveInDriver _chute;
}
}];
hey if i did this wrong
you said above
Please try using
ok
params ["_unit", "_anim"];
And then change the if Statment to ("halo" in _anim)
somehow
I'm as confused as an AI helicopter trying to land on flat plains
depending on how important execution is to you, you might want to do unscheduled environment so that in case the scheduler gets full, that sleep doesn't get longer
Probably because I have been awake for 22 hours
i think its the timer
see, before i discover scripting this is what happened
so thats why im here
the first sqf i made to save loadouts, it took me 8.5 hours, i had 200 hours in the game and minimal 3den experience
wait, the damn thing stacks?
oh fuck
The bruh moment
i thought they both fire off at 10 seconds not one after the other
Lol no worries
In that case you put sleep 10; before both of them
yeah, thats...whats on there
Thanks! Ultimately, the execution's timing is barely important at all. It's a very long term thing.
setPos is fine as long as you understand how it works tbh
well I'm saying that sometimes that sleep might be... 2 seconds, 4 seconds, whatever depending on how many scheduled scripts you have running
Yep
But he wanted to be specific with a starter
Can't blame him
Right, I get that, and it's acceptable. The primary concern is server performance. In this scenario, the chances of even several minutes making a meaningful difference is quite low.
The script just isn't firing at all right now as far as I know. Speaking of that, I should probably go throw a hint or something to ensure that I've adequately identified the problem.
ok, NEW PROBLEM, that i kinda saw coming
so uhhhhh now with the chute deploying, its crashing into the plane, because it deployed immediately
but then, i put sleep in, to delay it, yeah...
not allowed
spawn it
player addEventHandler ["AnimStateChanged", {
_this spawn {
params ["_unit", "_anim"];
if ("halo" in _anim) then {
sleep 3;
private _chute = createVehicle ["Steerable_Parachute_F", [0,0,0], [], 0, "NONE"];
_chute setPosASL (getPosASL _unit);
_unit moveInDriver _chute;
};
};
}];
Great job
It's being executed in the server init with [] spawn and is apparently firing, as it's giving me the hint I was seeking.
ok, testing
that wasnt for you
Oh!
sorry
If Statment?
Nope, my fault.
I think it will spawn a parachute after each animation change?
yes i forgot the if statement, give me a sec
yeah was about to say
i was usually counts to 10
to make sure i dont outrun the sleep
fixed
also hey i did learnt that, from today
yep, everything works
thats it, you guys got it
thank you!
so much
ok i was wrong, so minor problem
switched the chute to, one from cup
its called CUP_T10_Parachute_backpack
_this spawn {
params ["_unit", "_anim"];
if ("halo" in _anim) then {
sleep 3;
private _chute = createVehicle ["CUP_T10_Parachute_backpack", [0,0,0], [], 0, "NONE"];
_chute setPosASL (getPosASL _unit);
_unit moveInDriver _chute;
};
};
}];
put this in, now its broken
fuck
i bet that's not the class you want
uhhhh wdym?
because that is referencing the backpack, not the functional parachute itself. just like steerable_parachute_f is one of the variants of steerable_parachute_blahblah
I would have to look through CUP's config to see what they have in there. For giggles, just remove the _backpack and try it
ok
honestly, im just looking through the config
wait how do you get to cfg backpacks (if theres one)
it only shows, vehicles, weapons, ammo and mags
nvm, got it
just right clicked and find in config viewer
ok so i got the parachute to spawn, but now its duplicated, it spawn in 2 chutes
because halo is in >8 different animations that change depending on player movement
fixed btw
and you also should remove the event handler
you only want it to fire once right? just in case the player ever goes into a halo animation again?
yeah
so jsut this?
params ["_unit", "_anim"];
if ("halo" in _anim) then {
sleep 3;
private _chute = createVehicle ["CUP_T10_Parachute", [0,0,0], [], 0, "NONE"];
_chute setPosASL (getPosASL _unit);
_unit moveInDriver _chute;
};
};
everything, in total```sleep 3;
player addEventHandler ["animStateChanged", {
if ("halo" in _this#1) then {
_this#0 setVelocity (plane1 vectorModelToWorld [0, -150, -3]);
_this#0 removeEventHandler ["animStateChanged", _thisEventHandler]
}
}];
_this spawn {
params ["_unit", "_anim"];
if ("halo" in _anim) then {
sleep 3;
private _chute = createVehicle ["CUP_T10_Parachute", [0,0,0], [], 0, "NONE"];
_chute setPosASL (getPosASL _unit);
_unit moveInDriver _chute;
};
};
technically you could just combine the two handlers into one anyways
testing
also duplicating parachutes is still a problem
parachute spawns in my face now
then just add some more delays
I'm just gonna consolidate this into one anyways
also: undefined variable in expression _thisEventHandler
yeah no worries
and this
the duplicating parachute thing, are you using CUPs automatic line feature or something?
no, im just walking off the aircraft
without the script, this already wont trigger
so its not a problem
the duplication happens with the base arma parachute too?
then it has something to do with that CUP parachute and backpack
it must automatically detect if you are falling and do something itself
take the backpacks off of everyone
already did, and uhhh still an issue
tried with an ace backpack, didnt have the same issue
prob, just a problem with the cup chute
found the culprit, that affects the cup chute, it is the backpack, not just one, its any really
ok so i feel like im fucking schizo now, cuz i tried with backpack on and its gone
prob because you merged the ehs
so thank you! you saved my bacon
worked PERFECTLY, thanks @fair drum !
Hello, I have a bunch of scripts which I would like to convert into a mod. Does anyone know about a manual how to do this?
Greetings, I am working on a simple script for a squad to move from waypoint to waypoint. I have it setup like this right now: ```_attackSquad01 setBehaviour "SAFE";
_waypoint01 = _attackSquad01 addWaypoint [_waypointPos01,0];
_waypoint02 = _attackSquad01 addWaypoint [_waypointPos02,0];
_waypoint02 setWaypointType "SAD";``` I basically want them to to switch from Safe/careless to Aware when they arrive at Waypointmarker 1. Is there an way to filter through their set waypoints to see which one they are walking to at the current time?
You could just double-click on the waypoint in the editor to set behaviors, pacing, formations, etc
On a waypoint by waypont basis
that's the thing. I dont spawn in the units until a specific thing is triggered
basically its a QRF attack group when my player team gets nearby the objective
is waypoint1 a marker?
thank you your a saint. That was exactly what i was looking for
Yes they are: _waypointPos01 = getMarkerPos "waypointMarker01"; _waypointPos02 = getMarkerPos "Encampment_01";
Hi all I am looking for someone to help me set up and script a 24/7 public server and just wondering if this is the right place to do this
thanks nica!
trying to find out what is giving me this error, and google wont help me :\ anyone know what DestructionEffects.side means? other than something is wrong with my DE structure or naming
Post full error
bin`config.bin/CfgVehicles/DestructionEffects.side'.
One of your mods is incorrectly configured
i guess since mikero packs with haleluja etc its fine, but probably named wrong on something
Halleluja is basic sanity check
haha
It doesnt stop you from making mistakes
true
I suppose that's no entry error
Somewhere you inherit DestructionEffects inside your cfgvehicles
Try inheriting it from outside cfgVehicles
but isnt it supposed to be redeclared?
im like a week old in this so trying to understand everything, you are probably right..
ill try
thanks!
DestructionEffects is declared inside your vehicle class
But i suppose your just inheriting it in cfgVehicles root
Dont do that
Probably not
i think lol
I tried your advice out, but it throws me this error: _vehicle (#)animateSource [_anim,_phase]; ... Error Type Any, ecpected String
Config.cpp
class Eventhandlers: Eventhandlers
class openHatches
{
TurnIn = "[_this#0, 0] call jzra_sb_fnc_openHatches";
TurnOut = "[_this#0, 1] call jzra_sb_fnc_openHatches";
};
class CfgFunctions
{
class jzra_sb
{
class scripts
{
file = "\jzra_sb\scripts";
class openHatches: lightToggleColl
{
file = "\jzra_sb\scripts\fn_openHatches.sqf";
};
};
};
};
fn_openHatches.sqf
params ["_vehicle", "_turret", "_phase"];
private _anim = call {
if (_turret isEqualTo [8]) exitWith {"door_left"};
if (_turret isEqualTo [2]) exitWith {"hatch_front"};
if (_turret isEqualTo [7]) exitWith {"door_right"};
//etc.
};
_vehicle animateSource [_anim, _phase];
looks like you have more turret paths than you specified
that means? 🤔
more than just [2] [8] and [7]
actually _turret is not even defined
your call is wrong
that's not what I told you to do
this is what I said
omg
Now its working great. yeah I dont know why I changed the call... 🤦
When I get in to the turret, he is already turned out how I change that so he is turned in when entered? Or is this more a config question?
use show hide module rigged up to a trigger
its way more simple than scripting
I guess config. idk
ou, I have a few more turrets that do not have hatches. the turn in and out is just for standing up or sit down. Here he is throwing the error again. What do I must add to change that? Nr 3 is one of the turrets sqf if (_turret isEqualTo [3]) exitWith {}; I must change smth at the exitWith?
just add a default value at the end
private _anim = call {
if (_turret isEqualTo [8]) exitWith {"door_left"};
if (_turret isEqualTo [2]) exitWith {"hatch_front"};
if (_turret isEqualTo [7]) exitWith {"door_right"};
"";
};
but idk why you say it's throwing an error because if the other turrets don't have turn in/turn out the function should never be called in the first place
this works fine 👍
how can i add more flares to a plane that belongs to a mod
?
I have a mod of a MIG35 only 30 flares, I want to add more but I don't know how
https://community.bistudio.com/wiki/weaponsTurret see if they show up here
put
vehicle player weaponsTurret [-1]
``` in the console and see if the classnames are returned
I want this to increase to 200, how do I do it?
does it give you the classnames?
this is what you need
then you can just addMagazinesTurret
Can you add a marker to a map based on idc? I have a map in my gui, made from CT_MAP_MAIN and I want to draw the position of a unit on it and only it, not drawing it on the main map. Is this possible through idc or something?
Edit: I think I can maybe attempt a seperate method to check if my gui is open and if it is then ill use drawIcon or something to draw the markers. Ill give this a shot
Anyone know of a way exit the current mission and open a differnt mission with code? It'd be similar to what Arma 1 did for its campaign, with the strategic map sending you to a different mission file
anyone know why this is giving me Invalid Number in Expression?
_pos = [_thisTrigger, 25, 50, 0, 0, 0.4, 0] call BIS_fnc_findSafePos;
_playersInArea = {(_x distance2d _pos) < 1000} count allPlayers;
where
at the end
why is there a random #
was just showing where it shows the |#| in the error log, not part of the code
put this
systemChat str _pos
```also post next line in script
also have you tried inAreaArray? probably quicker than distance2d
if the # was after ; then the error is on the next line
_pos = [_thisTrigger, 25, 50, 0, 0, 0.4, 0] call BIS_fnc_findSafePos;
_playersInArea = count (allPlayers inAreaArray [_pos,1000,1000,0,false]);
that worked, thx! I guess it was a problem with using distance2d
@undone dew _thisTrigger isn't the magic variable if you're using it for that btw, that would be thisTrigger without the underscore
i have "_thisTrigger" in params and pass [thistrigger] as an argument since the triggers are editor-placed, seems to work at least
i'm still in the functional > pretty stage of learning scripting lol
alright
i dont have an emulator on hand, but couldnt i check if a definition _x exists in CfgWeapons by doing
_x isKindOf [_x, configFile >> "CfgWeapons"]```?
Where are you getting _x from?
Also I think it should work
but you could also do
isClass (configFile >> "CfgWeapons" >> _x)
depending on where _x comes from this might not even be necessary though
does https://community.bistudio.com/wiki/removeMagazine have a global or local effect?
never mind, this is better
https://community.bistudio.com/wiki/removeMagazineGlobal
if i add BIS_fnc_holdActionAdd to an object and remoteExec it to everyone, how would i prevent that more than one player will be able activate the action at time?
example from BIS_fnc_holdActionAdd
[
_myLaptop,
"Hack Laptop",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{},
{},
{ _this call MY_fnc_hackingCompleted },
{},
[],
12,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop];
that's not how you remoteExec, please read the docs https://community.bistudio.com/wiki/remoteExec
your targets and JIP arguments are probably not what you mean them to be
but this is not my code its example 2 from here:
https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
yes, you are right
dont mind my comment
I didnt realize you could use Object as JIP
if you want it that no other person can use it at the same time, you could broadcast a public variable and check that variable in the condition for if the laptop is being hacked
use codeStart for setting the variable and codeInterrupted and codeCompleted for unsetting it
if you dont want the laptop to be hackable after completion, just dont reset the variable in codeCompleted
check your variable in conditionShow
thank you
you can use and statements there to check distance and your variable
do you want an example or do you know what youre doing?
an example is alway better for learning 🙂
give me a sec
[
_myLaptop,
"Hack Laptop",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3 and {!(_target getVariable ['MYTAG_hackInProgress', false])}",
"_caller distance _target < 3",
{
params ["_target", "_caller", "_actionId", "_arguments"];
_target setVariable ["MYTAG_hackInProgress", true, true];
},
{},
{
params ["_target", "_caller", "_actionId", "_arguments"];
_this call MY_fnc_hackingCompleted;
_target setVariable ["MYTAG_hackInProgress", false, true]; //comment this line out if you dont want it to reset!
},
{
params ["_target", "_caller", "_actionId", "_arguments"];
_target setVariable ["MYTAG_hackInProgress", false, true];
},
[],
12,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop];```
something like this
this is assuming you trust your client
thank you!
Any way to set an object to be invisible?
Cuz I tried just removing the objects textures to make it "per se" invisible
But aint worked for me
That should do, thanks lad
is there a way to createVehicleLocal with "CAN_COLLIDE" placement option?
it already creates with CAN_COLLIDE
well for me its not
i'm trying to place it inside a building
it spawns outside it
then do a setPosXXX
alright will try that in a bit and give feedback
cool stuff
I would like to also label myself as dumb for not thinking about this and going for more complex nonsense
thanks
Hello. I have a condition:
a3a_var_started && (([east,0] call BIS_fnc_respawnTickets) < 1 or ([west,0] call BIS_fnc_respawnTickets) < 1);
And activation
if ([west, 0] call BIS_fnc_respawnTickets <= 0) then {
[east, west]
} else {
[west, east]
} params ["_winner", "_loser"];
["SideLost", false] remoteExec ["BIS_fnc_endMissionServer", _loser];
["SideWon"] remoteExec ["BIS_fnc_endMissionServer", _winner];
When checking in a multiplayer game through the editor, everything works, but it does not work on a dedicated server.
All this is specified in the trigger. The trigger has a checkbox "only on the server"
it works great but it unfortunatly also hides the holdAction progress-icon, anyway i can still make it visible?
ok this is a little of an easy one, im planning on doing a looping script for a vehicle to automatically refill ammo back to full
i put some static aa in the background, shooting invisible drones to simulate flak
so i want the vehicles to never run out of ammo/needing me to mother over it
and/or use addMagazineTurret and just add like a 1000 boxes of ammo?
if it's a gun with multiple ammo per mag you can just do setAmmo
yeah tahts what im thinking, but then it does that, only once
its a zsu-23-4 btw
well loop like you said
yeah thats my problem, uhhh how do you loop a trigger without it lagging tf out?
you can't loop a trigger. you can only create a loop yourself
i got the script kinda in my head ish
zsu2 setAmmo 1;``` and so on
could you explain further?
[] spawn {
while {true} do {
{
_x setAmmo ["CUP_Vacannon_AZP23_veh", 1e30];
} forEach [zsu1, zsu2];
sleep 1;
};
}
gotcha, and just making sure, where would i put this?
you can put that in trigger activation
you can put this in the init field of the vehicles
this spawn {
while {sleep 1;true} do {
waitUntil {!(someAmmo _this)};
_this setAmmo 1;
};
};
if i use this, is there anything i'd need to change?
what you're doing is worse than just doing setAmmo
also I'm pretty sure setAmmo needed the weapon 
yeah
maybe setVehicleAmmo?
could i do setVehicleAmmo?
e.g. 1e30
its a spaag
no. only weapon
where would i find the weapon name? cant seem to find it in the config
you can always find it in config. but for newbies it's easier to use command to fetch them
in this case, currentWeaponTurret
yes, do you want me to make it for you?
in debug cursorObject currentWeaponTurret [0];?
idk if that's the turret path
you can try it
better do allTurrets to make sure
that would be great, really appreciate your effort.
btw in line 4, what does 1e30 mean?
1 * 10^30
yeah i shouldn't have slept through math class
goddammit XD
[
_myLaptop,
"Hack Laptop",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3 and {(_target getVariable ['MYTAG_hackInProgress', player]) isEqualTo player}",
"_caller distance _target < 3 and {(_target getVariable ['MYTAG_hackInProgress', player]) isEqualTo player}",
{
params ["_target", "_caller", "_actionId", "_arguments"];
_target setVariable ["MYTAG_hackInProgress", player, true];
},
{},
{
params ["_target", "_caller", "_actionId", "_arguments"];
_this call MY_fnc_hackingCompleted;
_target setVariable ["MYTAG_hackInProgress", nil, true]; //comment this line out if you dont want it to reset!
},
{
params ["_target", "_caller", "_actionId", "_arguments"];
_target setVariable ["MYTAG_hackInProgress", nil, true];
},
[],
12,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop];```
so @little raptor in conclusion here's the entire trigger, to make sure i got everything right
condition
triggerActivated doortrig1; //this is the trigger that starts the intro
on activation
zsu1 enableSimulation true; //enables sim for the zsu so they dont fire before mission start and not waste ammo
zsu2 enableSimulation true;
zsu3 enableSimulation true;
zsu4 enableSimulation true;
zsu5 enableSimulation true;
zsu6 enableSimulation true;
//your code
[] spawn {
while {true} do {
{
setAmmo ["CUP_Vacannon_AZP23_veh", 1e30];
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6];
sleep 1;
};
} ```
zsu1 enableSimulation true; //enables sim for the zsu so they dont fire before mission start and not waste ammo
zsu2 enableSimulation true;
zsu3 enableSimulation true;
zsu4 enableSimulation true;
zsu5 enableSimulation true;
zsu6 enableSimulation true;
use forEach...
also syntax highlighting should be sqf
idk what you're using (probably cpp?)
{
_x enablesimulation true;
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6];```
_x enablesimulation true;
yeah i only remembered that cuz of old, uhm group project
👍
never knew there was an sqf highlight XD
thank you very much!
_x is missing here too
👍
where? before setAmmo?
yes
[] spawn {
while {true} do {
{
_x setAmmo ["CUP_Vacannon_AZP23_veh", 1e30];
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6];
sleep 1;
};
} ```
yes?
yeah
perfect! testing it rn
hah, we beat Discord's syntax highlighting @little raptor 🏆
btw final question with the ammo script written, would this allow for the vic to fire pretty much non stop for...a 2-3 hour op?
yeah, so the vehicle now spawns without ammo
it does? 
idk what's wrong 
are you testing that in multiplayer?
ok so in mp
there is some setTurretAmmo thing no?
now it spawns with ammo
yes i was planning on using that, but leopard insisted on normal setAmmo
setMagazineTurretAmmo
nvm, its empty
Broken when vehicle has multiple magazines of the same type
imma just do
[] spawn {
while {true} do {
{
_x setVehicleAmmo 1e30];
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6];
sleep 1;
};
} ```
would this work? 
why not simply add a fired EH that resets ammo 😑
no, because setVehicleAmmo takes an argument between 0 and 1
never thought of that, granted i know jackshit about scripting beyond the surface level
(dw, the "😑" was aimed @ @little raptor 😛)
ah, fair enough
dont worry, surface is good
ya know, just a quick suggestion from a mission maker, maybe for "arma4" add like a module that simulate flaks/tracers, basically just an invisible module that just fires tracers + sound into the air
idk how appropriate this is to the channel but would do great for immersion
this exists already
@sage heath I just tested. looks like 1e30 was too big 🤣
real shit?
set a smaller value and it'll work
thatsss what she said
also, already tried ambient battle thing on steam ws if you're talking about that
yes, it's called ambient battlefield or something
no, it's in vanilla
ah
also "tracers"
ahhhh wait does taht also play sound?
ye
omfg, that solves EVERYTHINGGGGGGG
hey so quick quiz
for the tracer modules, it needs a weapon and magazine
- does this use vehicle weapons/mags?
- for weapons i put in
CUP_Vacannon_AZP23_vehand for magazines,CUP_2000rnd_23mm_AZP23_M
are these correct...?
sad and resounding, no after testing
awww it only works with infantry weapons...
so, i went back to the idea of this and dont know how event handlers work, really
or atleast dont know how to set one up
no worries, this channel is here for you
_x addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];```
this is my* final version of the reset ammo script
```sqf
_this spawn {
while {true} do {
{
_x setVehicleAmmo 1];
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6];
sleep 1; ```
im this far (this is only for ai btw, if i needed to mention)
(basically lifted from biki)
that's not the final version
like I said use what I wrote first
yep, noice!
https://community.bistudio.com/wiki/addEventHandler
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Fired
{
_x addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
_unit setAmmo [_muzzle, 100];
}];
} forEach _allTheZSUs;
just change 1e30 to a lower value
1e4 works too
an event handler is code you "attach" to an event, here "fired"
here the code is not costing anything to attach, and only runs when shots are fired 🙂
(correction my*)
that's wrong too
{
_x addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
_unit setAmmo [_muzzle, 100];
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6]; ```
so like this?
no need for sleep no
just use literally what Lou wrote
just replace my code's _allTheZSUs with the zsu array
why'd you change it?
i didnt? or atleast i thought i didnt, thats just all the zsus
{
_x addEventHandler ["Fired", {
params ["_unit", "", "_muzzle"];
_unit setAmmo [_muzzle, 10000];
}];
} forEach _allTheZSUs;
```check the indentation
wait, so i dont literally just put in "alltheZSUs?" right...?
replace _allTheZSUs with your array [] of zsus
yep, gotchaaa
{
_x addEventHandler ["Fired", {
params ["_unit", "_muzzle"];
_unit setAmmo [_muzzle, 10000];
}];
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6];```
final check
I reduced params to```sqf
params ["_unit", "", "_muzzle"];
and yeah, both versions should work 🙂
and i put this in a trigger...?
in e.g initServer.sqf
ah gotcha
ok testingggg
HOLY SHIT
THATS IT
THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
btw, final quesiton after a lot of testing @winter rose how performance intensive is this script?
it is run every time they fire
it should not be this much, but if you are concerned about it you can make it run "if _ammo < 100"
{
_x addEventHandler ["Fired", {
params ["_unit", "_muzzle"];
if _ammo < 100 then {
_unit setAmmo [_muzzle, 10000];
}];
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6];
};``` this?
INDENT YOUR COOODE
w-where...am i missing the indent...?
{
_x addEventHandler ["Fired", {
params ["_unit", "", "_muzzle", "", "_ammo"];
if _ammo < 100 then {
_unit setAmmo [_muzzle, 10000]; // HERE
}; // WHICH MAKES YOU PUT THE SCOPE END HERE
}];
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6];
// NOT HERE
also, I fixed the params 😉
thank you!
hey, problem: it says, expected string not boolean (line 4) sqf #_ammo < 100...
so i made it a string (ammo < 100) then now, it expects a number!
wait, this one's on me
_ammo is string here
I didn't check and thought it was the current ammo
params ["_unit", "", "_muzzle"];
if (_unit ammo _muzzle < 100) then {
_unit setAmmo [_muzzle, 10000]; // HERE
}
and don't forget if's ()
{
_x addEventHandler ["Fired", {
params ["_unit", "", "_muzzle"];
if (_unit ammo _muzzle < 100) then {
_unit setAmmo [_muzzle, 10000];
};
}];
} forEach [zsu1, zsu2, zsu3, zsu4, zsu5, zsu6];```
?
perhaps 🐮
alrightttt testing
yeah 😄
also just realized, the performance drop i had was because....ace distance view limiter
i limited the vd for vehicles to 4000, but it still lagged during the parachute intro, because! parachutes are considered aircrafts 💀
oh well thanks lou! ¯_(ツ)_/¯
glad you got it!
Is there a way to open a different mission file via a script? I’m trying to something similar to what Arma 1 does for its strategic map, where selecting a waypoint sends you a scenario
if you’re an admin, use #mission missionname_map
(in singleplayer, use a "hub" campaign structure)
Thx
it's not performance intensive at all
just maybe the network, I'm not sure 😬
(if updated every shot)
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#InventoryOpened
the secondaryContainer is never used
even when opening a container, it wont return the weaponholder of the ground-tab
When you open a container, the container itself is the targetContainer, but the secondarycontainer is empty
it is never used
It is used! You see the two lines above the inventory UI ?
https://gyazo.com/d7d552585e71287d05e633923c0ddb88
There is a groundholder created everytime you open a container.
What kind of inventory are you opening ?
same thing for me
https://gyazo.com/4a6938508f41cacf20107df6fa7aff3a
onInventoryOpened EH
params ["_player","_container","_secondaryContainer"];
I assumed it was only supposed to work on bodies?
You know how it shows you the dropped weapon as well as the corpse loadout.
probably invalid variable name or invalid call
make sure you're calling it by the inventoryOpened EH, not closed
well still it should return objNull
the inventory open EH works perfectly
just this one variable
and when i do it in a controlled environment, it works
so something is happening here that im not aware of
ill be back soonish
what is your "controlled environment"?
player addEventHandler ["inventoryOpened","params['_p1', '_p2', '_p3']; hint str [_p1, _p2, _p3];"];
like I said, this is the only way that could be happening:
probably invalid variable name or invalid call
there is no other way
there _p3 is the secondary container as it's meant to be
then what I said is most definitely the real reason it's not "defined" for you
?
this
no, it's most certainly defined
We do this and it works
player addEventHandler ["InventoryOpened", { _this call ExileClient_object_player_event_onInventoryOpened}];
yes, it works in the script i sent
in the EH at the end
ExileClientCurrentInventoryContainer = _container;
ExileClientCurrentInventorySecondaryContainer = _secondaryContainer;
And a corpse return objNull
https://gyazo.com/8b173ee77f50009ba91aec75b909d2ab
but it doesnt work in my script
so can you jsut settle down
i said im looking into what's causing it
this is what i have in my function:
params["_unit", "_container", "_secondaryContainer"];
player setVariable["TOM_currentInventoryOpen", _container, false];
private _override = False;
if (_container isKindOf "Man") then {
player action ["Gear", _container getVariable ["TOM_deadInventory", objNull]];
_override = True;
};
TOM_INVENTORY_CONTAINER_OPEN = _container;
TOM_INVENTORY_SECONDARYCONTAINER_OPEN = _secondaryContainer;```
and this is how i call my function and define the EH:
player addEventHandler ["inventoryOpened","_this call TOMDayZ_code_fnc_lockSlots"];```
TOM_INVENTORY_SECONDARYCONTAINER_OPEN is nil
and it's not mentioned anywhere else
and i doubt anyone else is going to land on that exact same variablename
no idea
it magically fixed itself
🤷♂️
the worst part is not that I know I made a mistake somewhere, but not knowing where
Leprechauns and cosmic background radiation
Sorry, i dont speak spanish
and everything works again
Is it possible to call this:
_actionID = player addAction ["Launch rocket",{[] spawn Dr_fnc_predator}];
from a CBA submenu?
I tried ["Test", [5], "", -5, {[] spawn Dr_fnc_predator}, "1"] but it does not work.
what is CBA submenu? 
MENU_COMMS_3 =
[
["Submenu", true],
["SpecOps", [2], "", -5, [["expression", "[units player - [player], screenToWorld [0.5, 0.5], 3] execVM ""\scripts\SpecOps.sqf"""]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
["Refresh", [3], "", -5, [["expression", "[units player - [player], screenToWorld [0.5, 0.5], 3] execVM ""\scripts\Refresh.sqf"""]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
["Teleport", [4], "", -5, [["expression", "[units player - [player], screenToWorld [0.5, 0.5]] execVM ""\scripts\Teleport.sqf"""]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
["Test", [5], "", -5, {[] spawn Dr_fnc_predator}, "1"]
];
showCommandingMenu "#USER:MENU_COMMS_3"
};
["Special Menu2","Menu_key2", "Menu Key2", {_this call mymod_fnc_showGameHint2}, "", [DIK_B, [false, false, false]]] call CBA_fnc_addKeybind;```
I am only calling sqf files from the menu and those are working fine
command menus take string, not code
Ok. So I guess there is no way then to call this somehow from the menu, right?
there is. like I said it has to be string, not code
I'm pretty sure I told you what a code is
and what's a string?
""
then you should know what to do now I guess
it has nothing to do with what you should do
""[] spawn \scripts\Dr_fnc_predator"""
no
first of all, I don't know why you keep removing the "expression" part:
[["expression", "[units player - [player], screenToWorld [0.5, 0.5], 3] execVM ""\scripts\SpecOps.sqf"""]]
that must be kept as it is, yet you keep removing it
it's a pattern. it has nothing to do with a code
and it's not optional
you MUST keep it
the only part you're allowed to modify is this string:
"[units player - [player], screenToWorld [0.5, 0.5], 3] execVM ""\scripts\SpecOps.sqf"""
yes
understood
thats what i did
["Test", [5], "", -5, [["expression", "[units player - [player], screenToWorld [0.5, 0.5]] execVM ""[] spawn \scripts\Dr_fnc_predator"""]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"]
but not sure where to point to the subfolder
what subfolder? if it's a function just execute the function directly:
[["expression", "[] spawn Dr_fnc_predator"]]
ok, trying
["Test", [5], "", -5, [["expression", "[] spawn Dr_fnc_predator"]]]
Not sure why but "Test" does not show up in the menu
added "1" now to see if this fixes it
Nah, it does not show up in the menu
Not sure why
Don't you need two "1"s
yeah
because you remove things from a pattern, which you shouldn't do
Got this one working
["Test", [5], "", -5, [["expression", "[] spawn Dr_fnc_predator"]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"],
Now i have one more left
["Launch rocket from map", [6], "", -5, [["expression", "["Launch",["fromMap"]] spawn Dr_fnc_predator"]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa"]
Somehow I get an error
Thought i've set the brackets correctly
!code
How to use SQF syntax highlighting in Discord
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
Anyone knows if ACE3 Field Rations system is easy to customize (as in replacing food and drink items by adding and removing classnames) or is it a bit more complicated?
afaik you'd have to edit the config file
ace is open source https://github.com/acemod/ACE3/tree/master/addons/field_rations
Does CBA caching provide any benefits if sqf bytecode is used?
Hmm will need to look into that, I see that food items come back in three files or more so that will require some tinkering
Username fits btw lol
yes
bytecode still needs to be loaded, its faster but still takes some time
Im trying to draw an icon on the map when the ui is open, ive used plenty of systemchat tests and the code seems to be running on each frame when the ui is open, however the drawIcon line isnt drawing anything... Anyone see something wrong with it?
[] spawn {
while
{
!(isNull findDisplay 1234)
}
do
{
onEachFrame
{
_selectedIndex = lbCurSel 1500;
if (_selectedIndex != -1) then {
_selectedGroup = RobotGroups select _selectedIndex;
{
((findDisplay 1234) displayCtrl 1700) drawIcon ["\A3\ui_f\data\map\mapcontrol\Bunker_CA.paa",[1,0,0,1],getPos _x, 24, 24, getDir _x];
systemChat (format ["Unit%1",_forEachIndex]);
} forEach (units _selectedGroup);
};
};
};
};
Why do you put onEachFrame in a while loop...? 
And why do you use getPos? 
cus im dumb, and getPos is accurate enough for 2d isnt it?
It has nothing to do with accuracy
It's slow as fuck
Oh, I didnt know that
What do you recommend thats faster? I normally use getPosASL or ATL for other stuff
Both of those are equally fast
But here you need the visual version
Same goes for getDir
Ok ill try and use both of those, one sec
Hmm changing those variables didnt help, the icons still dont display
I ditched the onEachFrame stuff as well
Ditch the while... 
ok
Apart from performance and the proper way of doing things, the issue of the drawIcon not working is separate isnt it?
Did you say your systemChat shows?
yup
This is what it currently looks like:
[] spawn {
onEachFrame
{
if !(isNull findDisplay 1234) then {
_selectedIndex = lbCurSel 1500;
if (_selectedIndex != -1) then {
_selectedGroup = RobotGroups select _selectedIndex;
{
((findDisplay 1234) displayCtrl 1700) drawIcon ["\A3\ui_f\data\map\mapcontrol\Bunker_CA.paa",[1,0,0,1],getPosVisual _x, 24, 24, getDirVisual _x];
systemChat (format ["Frame%1",diag_frameNo]);
} forEach (units _selectedGroup);
};
};
};
};
Why did you use getPosVisual? That's as slow as getPos...
Anyway, what's your map control type?
I did it based on this message, ill switch it to getPosASL then. Control type is CT_MAP_MAIN
I said the visual version of ASL or ATL
ah ok
getPosASLVisual or atl
I don't remember what main map was, but it should be 101
Are you referring to idc?
No
Type
The problem right now is the control
Either it doesn't exist or its type is wrong
Right now I have RscMapControl class in a defines.hpp, its type in there is CT_MAP_MAIN which is defined at the top of the file. And then I have a control.hpp file that contains my custom ui's idd as well as classes for each object in the ui. One of these is my map which has an idc of 1700. The idd of the ui is 1234 btw
That's not what I mean
I mean it's probably not defined in the loop
systemChat that to be sure
@little raptor Both the display and ctrl show with a systemchat just beneath the drawIcon line
Then I don't see any reason why it doesn't work 
Type ctrlType _ctrl and make sure it's 101
_ctrl being my displayctrl right?
Yes
yup, comes back as 101
Thanks for your help so far, ill give the size a try. But the file path should be correct as well I think? I got it off of https://community.bistudio.com/wiki/Arma_3:_CfgMarkers
Try some text to make sure
Not just icon
That way if the icon fails at least you get something
It's probably too small
Did you increase the size?
Also you probably want to scale the icon with map zoom
brought it up from 25 to 100, its absolutely massive though
Theres a comment on the page that does this I think (sizeInMeters * 0.15) * 10^(abs log (ctrlMapScale _ctrl))
Ill give it a try once I polish this up
It's nonsense. But sure
Hmm ok so, brining the size back down to 25 makes them appear still, it seems like the lack of text description in the drawIcon line was maybe what was causing the issue...? That being said the text still doesnt appear. I dont need it to but I find it odd nonetheless
Try changing the font size
But I text is not necessary at all
It's optional
@little raptor
The first line doesnt show anything, the second line shows just the icons... even though the things changed are optional and only refer to text?
((findDisplay 1234) displayCtrl 1700) drawIcon ["\A3\ui_f\data\map\mapcontrol\Bunker_CA.paa",[1,0,0,1],getPosASLVisual _x, 25, 25, getDirVisual _x];
((findDisplay 1234) displayCtrl 1700) drawIcon ["\A3\ui_f\data\map\mapcontrol\Bunker_CA.paa",[1,0,0,1],getPosASLVisual _x, 25, 25, getDirVisual _x, "test", 0, 50];
Hello. I have a condition:
a3a_var_started && (([east,0] call BIS_fnc_respawnTickets) < 1 or ([west,0] call BIS_fnc_respawnTickets) < 1);
And activation
if ([west, 0] call BIS_fnc_respawnTickets <= 0) then {
[east, west]
} else {
[west, east]
} params ["_winner", "_loser"];
["SideLost", false] remoteExec ["BIS_fnc_endMissionServer", _loser];
["SideWon"] remoteExec ["BIS_fnc_endMissionServer", _winner];
When checking in a multiplayer game through the editor, everything works, but it does not work on a dedicated server.
All this is specified in the trigger. The trigger has a checkbox "only on the server"
Anyway, thanks for all the help troubleshooting and info about the getPos Leopard. Much appreciated!
it works perfectly fine on vanilla map
what is a3a_var_started ?
This is my variable that turns on after freeze time. The condition code is fine, it works for me. Activation doesn't work.
I checked.
endMissonServer remoteExec usage seems wrong?
It's supposed to executed on the server, and it's remoteExec'd on clients.
How can I call it then correctly?
And is it correct that there are 2 endings for winners and losers? Will it work?
Seems like you're better off using endMission for custom stuff.
In which case your usage would also be correct, I think :P
I'm trying to have sideChat messages play for all connected clients. However, when I run my mission (currently testing as client hosted), I see all messages. Unfortunately, no other connected client can see the messages.
This is what is in my trigger Activation box:
handle = [] execVM "start.sqf";```
This is largely what my script boils down to:
```sqf
sleep 1; //00:01
phalanx sideChat "Attention all Posts";
[phalanx, "Attention all Posts"] remoteExec ["sideChat", -2];
sleep 4; //00:05
phalanx sideChat "As you already know, Red Star Forces have been moving throughout our towns, separating our families, and killing our brothers.";
[phalanx, "As you already know, Red Star Forces have been moving throughout our towns, separating our families, and killing our brothers."] remoteExec ["sideChat", -2];
//...```
I understand that `<object> sideChat "Message";` doesn't fire globally on it's own but even if I set the trigger to fire on everyone instead of just the server, The text doesn't show on their client, depspite their client running the `remoteExec` to make an additional message show up for me.
Is there something that I'm just over looking that would cause the text to not show?
do all the things have a radio?
also, you dont need to do two instances of sidechat
you can remoteExec once to all things
I'm aware that I don't need both. It used to just be those lines on their own. I plan on going back and removing extranieous lines later when other clients can see the messages.
I'll check for radios
how do you copy array?
_groupUnitsOut = +_groupUnits;
does not work
i don't want the same pointer
you mean append an array? to add to it?
i want to change one without changing the other
does this not work?
It's probably this since ACRE radios don't have simulation = "ItemRadio" in their CfgWeapons setup.
anger is felt.
seems to work on my end. May the reason be somewhere in the surrounding code? ```sqf
_a = [1,2,3];
_b = _a; // reference
_c = +_a; // value
_b pushBack 'b';
_c pushBack 'c';
[_a, _b, _c];
[[1,2,3,"b"],[1,2,3,"b"],[1,2,3,"c"]]```
it does work
If you want a proper deep copy, which it sounds like you do.
yeah. +_array working is no question
all I want is a proper deeper copy
made with a proper deeper copy code
I may be off my load
but I want a proper copy
with a deeper proper code
if he had _array + [] that would be another story and would depend on the contents of the array
In lieu of ACRE radios not being configured as "ItemRadio", I swapped the messages to globalChat. Still no messages on players that aren't the server.
"in lieu" is incorrect. it should be "in Lou" 😛
Well, I'm going to sleep on it for now. If anyone has further theories, I'm all ears to check them when I wake up. Just ping me for them. 
Is there a way to pass local var into Draw3D EH?
this might be what your looking for
["As you already know,
Red Star Forces have been moving throughout our towns,
separating our families, and killing our brothers."]
remoteExec ["sideChat",phalanx];
Anyone know how to make high command work on dedicated servers? Is this a scripting issue or a troubleshooting issue?
I've successfully created the modules, synched them, added units, all of that, but the subordinates are completely unresponsive and I don't understand why.
The subordinate units are perfectly responsive when used on a client hosted server (at least for the host).
Define unresponsive. ignoring waypoints?
Not even creating waypoints.
Select a subordinate unit, give them a waypoint command, get no response and no waypoint is created.
Pass the group ownership (setGroupOwner) of subordinates to whoever the commander is, it may fix. Although waypoints shouldnt be affected by group ownership.
Assuming you are talking about vanilla HC system.
I'm thinking the server owns the groups, given that is the only difference.
is unitReady the best way to check whether a createVehicle is finished?
I would think createVehicle would be finished when it gave you the object as it's return
it has nothing to do with createVehicle
as Hypoxic said, objects are always finished when you create them using createVehicle/createSimpleObject
there's preloadObject but that's for terrain objects afaik
or for use before creating a normal object
I’ve experimented with that already and it did not appear to help, but I’ll try it again and report back tomorrow.
To clarify, I was not sure whether createVehicle has any spawned scripts in it that would make some commands that work on a vehicle not return the expected value if executed on the next line.
Does anyone know how to hide the cursor in spectator mode or splendid camera (for video purposes)?
Thx I'll take a look
I'm looking for a way to place units in a random house in a marker, but not if there are enemies in that house. is there a best way to do this? I was originally planning on using nearestTerrainObjects or something similar to find all houses in an area and then use select to pick the ones that dont have any enemies within x meters of them, how bad of an idea would this be for something that runs on respawn?
took me a bit to find but here's something I coded years ago that may help. The code could probably be better but if I remember properly it does work
DE_inBuilding.sqf
[]spawn
{
while {true} do
{
_building = nearestBuilding player;
_buildBox = boundingBox _building;
_position = _building worldToModel getPosATL player;
if (_position select 0 > ((_buildBox select 0) select 0) && {_position select 0 < ((_buildBox select 1) select 0)} && {_position select 1 > ((_buildBox select 0) select 1)} && {_position select 1 < ((_buildBox select 1) select 1)} && {_position select 2 > ((_buildBox select 0) select 2)} && {_position select 2 < ((_buildBox select 1) select 2)}) then
{
hintSilent "Player is inside building";
}else
{
hintSilent "Player is not inside building";
};
};
};
and I don't see any reason why you shouldn't put this in a respawn EH
well im not sure if thats what i want
but i think i could use that for checking if AI are in buildings
Just paste that in init.sqf and run around a town for a bit and see if it works how you'd like. I remember there being something weird with bounding boxes in this game usually being much bigger in all axis than the actual model
and there is https://community.bistudio.com/wiki/boundingBoxReal which claims it can make a much tighter bounding box than the regular command
your usage of select makes me feel an array of emotions
I thought I was being slick and taking full advantage of lazy eval, only now do I see that I did it wrong 😒
keep in mind I wrote that 7 years ago when I was but a humble cashier, this would probably look very different if written today by your friendly neighborhood senior dev
if there's one thing I've learned in the following years, it's, if it's working and doesn't need new functionality or refactoring, don't touch it! Hence, dropping it here as-is 😛
ye-ye. "Don't fix what ain't broken" and "premature optimisations is the root of all evil" in the same package
well it's arguable at what point a lack of readability and maintainability constitutes broken, but eh I made the call (another one of your senior dev's responsibilities!)
i guess alternative syntax of https://community.bistudio.com/wiki/inAreaArray can be massaged to do the similar thing, but new code needs new testing (and new benchmarking, for that part) :3
don't forget new git branch, code review, trying to get a new low score of WTF's from team lead 😛
i'm looking if the sleek and modern inAreaArray can be used
oh arte already said it
private _unit = player;
private _house = nearestBuilding _unit;
private _centerASL = _house modelToWorldWorld [0,0,0];
private _radii = (boundingBox _house) # 1; //idk what exactly this gives you :slight_smile::thumbsup:
_radii params ["_a","_b","_c"];
_inArea = ([_unit] inAreaArray [_centerASL, _a, _b, getDir _house, true, _c]) != [];
//_inArea is boolean
no idea if this is faster
but boy howdy that other code could use params
heheh, that would've been nice, but that code is dated 6/26/2015, param and params didn't come until https://community.bistudio.com/wiki/Category:Introduced_with_Arma_3_version_1.48
Back in those days you had to use BIS_fnc_param, it does exactly the same thing, just not on an engine level, so it was extremely slow.
private also wasn't the superstar it is now, back then we didn't have same-line assignment 🙂
the dark ages of sqf
thankfully i never touched it for arma 2
those days must've been wild
I dabbled a little, but thankfully never had to learn too deeply. I used to play a lot of dayz mod, then A3 came out. Eventually tried making missions for my friends, didn't get too far with that but went off the deep end with sqf heh. Never finished a mission for my friend group to play, but I ended up as an employed programmer now so I still consider it a win 😛
sqf forcing me to optimize code so the game doesn't break is a good teaching tool id say
but damn, checking "building count" times "units count" cases doesn't sound very quick anyways, but sqf DERP_inBuilding = { params ["_objects", "_building"]; private _bbox = 0 boundingBoxReal _building; _bbox params ["_c1", "_c2", "_radius"]; _c1 params ["_x1", "_y1", "_z1"]; _c2 params ["_x2", "_y2", "_z2"]; private _centerModel = (_c1 vectorAdd _c2) vectorMultiply 0.5; private _centerWorld = _building modelToWorld _centerModel; private _dx = abs (_x1 - _x2) / 2; private _dy = abs (_y1 - _y2) / 2; private _dz = abs (_z1 - _z2) / 2; private _angle = getDir _building; _objects inAreaArray [_centerWorld, _dx, _dy, _angle, true, _dz]; }; [allUnits, _building] call DERP_inBuilding
this seems to take like 0.07-0.09 ms per building with 205 units on map (in VR with single building and some infantry), so checking like a hundred buildings on the spawn seems kinda viable?
And allUnits select {_x distance _building < _radius} is like 0.42 ms (wtf?).
allUnits select {side _x isEqualTo playerSide} is like 0.38 ms on my machine. Holy hell, it's slow.
and switching to _objects inAreaArray [_centerWorld, _radius, _radius] in the functions seems to save like 0.01-0.02 ms on my machine
and allUnits findIf {_building distance _x < _radius} is like 0.28 ms. Them sqf/engine implementations sure do defy expectations 🤦♂️ Looks like i have some code to change
i have no idea about the best way, but the code just above does sound like a somewhat decent starting point. Further testing and massaging to fit your need is expected
i wonder whether commands like allUnits are just refs or computed on the spot. math like that should be in nanoseconds.
well, missionNamespace getVariable "aaaa" is 0.0011 ms on my machine, just aaaa is 0.0007. I'd bet a dollar the engine/SQF boundary is the most hungry part at this point
i'm guessing namespace vars are in a hashmap
computed, allUnits collects all units from all groups from all sides
by computed i was thinking of something hungry like testing all objects on map to qualify as a "unit".
as opposed to the engine just pushing to a list every time a unit is created
well its cheap, copying out of the lists every group has, but its still not a direct copy from one list
anyone have any experience with extdb3?
Is there any way to insert a clickable Link (URL) into a diary record?
PS: <a href='http://arma3.com'>Arma 3</a> doesn't work.
how would i parse a string like this into an array, when my string are missing quotes
"[1,[[qU/FN5XEfbg7pKRJZt9ei0],[l5+17gktM3gq2oyqVAfX44]]"
parseSimpleArray is no good in this case
Regex
im not good enough at regex
and what would i even be looking for?
Pair up []s and store what's between them
There's no other way.
the strings arae not static
there could be any number of them and they could be changing
Did I say it was?
no, i just made sure it was clear
You have to pair them dynamically yourself
i dont know how to do that
It's very simple
Find all [s and ]s using 1 regex expression so that they're in order, then iterate over them
When you encounter a [ pushback its position into an array
When you encounter a ] pop back the last [ position and use it with the ] to make the string (using select)
to clarify, i dont know regex
and if i did, i would look for [ with 22 non-[ or ] characters in row and then an ending ]
and then replace it with the same text but add quotes inside the brackets
all the strings are 22 digits
i forgot to say that
If they have a fixed pattern just use select
overengineered solution
indexing through a string in sqf is not exactly what im looking for
maybe in python, but not in sqf
imagine if find had a regex-match
\[[^\[\]]{22}]
there's the regex i came up with
should be good enough
so i'll just iterate regex find and cut until i have no more hits
actually, just this is even ebtter : [^\[\]]{22}
wait, i dont even need to iterate
because regexfind pulls them into an array for me
all of the hits
now isnt this splendid
answering my own question:
((_theString regexFind ["[^\[\]]{22}"]) apply {_x#0#0});```
phalanx is who I want to be talking. It's not that the messages don't go off at all, they just only fire on the server no matter what I have been doing to get it to play on others.
Unrelated to that though...
Below is what I currently use to select spawn points. Is there something I can add to ensure that all selected points are unique?
_point1 = floor random count pointPool;
_point2 = floor random count pointPool;
_point3 = floor random count pointPool;
_sp1 = pointPool select _point1;
_sp2 = pointPool select _point2;
_sp3 = pointPool select _point3;```
I suppose this should work...but there is probably a better way to do it
_point1 = floor random count pointPool;
_point2 = floor random count pointPool;
while {_point2 == _point1} do {
_point2 = floor random count pointPool;
};
_point3 = floor random count pointPool;
while {_point3 == _point1 || _point3 == _point2} do {
_point3 = floor random count pointPool;
};```
Romove selected items
_pool = pointPool;
_point1 = selectRandom _pool;
_pool = _pool - [_point1]
You can also use deleteAt but make sure you copy the array
Then just append them back on at the end of the script if I want to still use them later?

