#arma3_scripting
1 messages · Page 603 of 1
and can we create a camera for the player and keep the "player moving" ? because when i create a camera i can't move the player
maybe by playing with switchCamera and remoteControl @faint oasis
you should be able to move player when camera is created, of course depends on the type of camera, some take control of the movement keys
it's cameraEffect ["internal", back"] that takes the controls away
You're right
_cam setDir getDir player;
switchcamera _cam;```
ooooooh nice trick
@unique sundial thx i will try
So what happens with that script? It creates a camera that follows the player around?
no - your PoV remains on the camera, while the character you control gets away from it
Oh
@unique sundial do you know how to get the player camera as object ? because i have tried : _cam = "camera" camCreate (player modeltoworld [0, -5, 2]); _cam setDir getDir player; switchcamera _cam; but i can't fire with my weapon i can only move so how to do the same thing as a player cam ?
i dont know
@unique sundial oh ok thx
and no need to tag me with every reply
yes i'm sorry
No need to DM me either
Is it possible to do switch-do inside if-then ? Am testing with this sqf if (side _unit == WEST) then { switch (true) do { case (_index == 0): {hint "It is WEST SIDE index 0!"}; case (_index == 1): {hint "It is WEST SIDE index 1!"}; default {}; } } else { switch (true) do { case (_index == 0): {hint "It is ANY OTHER SIDE index 0!"}; case (_index == 1): {hint "It is ANY OTHER SIDE index 1!"}; default {}; } };
but not achieving desired results
sure it is
switch (true) do {
case (_index == 0)
I hope thats just some "show whats intended" code and not actual code, because that'd be pretty stupid
kk thanks ded for the quick reply and uhhh don't know what to say to your remark 😰 😄
switch _index → case 0 / case 1 ^^
Lou, can you please elaborate on that? Am getting already mixed here what to put and where..
oh you mean just directly sqf case 0: {hint "It is WEST SIDE index 0!"}; ?
switch _index do {
case 0: {hint "It is ANY OTHER SIDE index 0!"};
case 1: {hint "It is ANY OTHER SIDE index 1!"};
default {};
}
This is how switch/case is supposed to work, and works in most languages.
It accepting a boolean and conditions as cases is a SQF specialty
not to mention it adds a lot of unnecessary overhead
ahh ok, brilliant and now got the hang of it with that example 🙏🏼
It accepting a boolean and conditions as cases is a SQF specialty
not only
it accepts basically anything, booleans, strings, ints, probably also floats
It literally takes the type called "Anything"
Anyone else having issues with reaching https://community.bistudio.com ?
yes
That sucks, i just started out arma scripting so I havent memorized or even seen most of the commands yet
Is there any alternative library?
haha, well yeah that works i guess. Thanks 🙂
I've tried finding a solution but is there a simple way of checking whenever A player is in a vehicle rather then checking if the vehicle has a player ?
as everything I have found so far revolves around the vehicle
See ObjectParent
Oh thanks, that is useful for a number of things 😄
You can also use this:
if (vehicle player != player) then {hint "Player is in a vehicle"};
Oh i see, i've tried that one before but it appears I fooled myself with a typo, thanks 🙂
due to some scripting the zombie spawn script I have keeps putting spawns in queue whenever the player is in a vehicle and spawns then all at once when the player steps out. Im happy to have tested that as I really didnt saw that one coming lol
almosth done replacing ravage zombies with ryan zombies 😄
- screamers added
I have a trigger activated by the presence of one unit. It's supposed to show titletext to the unit that activates it and not globally. How would I go about this? Thanks!
For that you should use getoutman eventhandler @sonic thicket
Oh, i meant I have that and wanted to get rid of it 😛
player addEventHandler ["GetOutMan", {
params ["_unit", "_role", "_vehicle", "_turret"];
call spawnZombies
}];```
so adding in this check it makes sure the spawnscript doesnt queues up spawns
thanks for the tip though 🙂
So, it feels like if variables are not carried from one container to the other container.
if (vehicle _randomPlayer == player) then {
systemchat "Defined";
_typezombie = [1, 2, 3, 4] call BIS_fnc_selectRandom;
systemChat (format ["%1",_typezombie]);
} else {
systemchat "Defined";
_typezombie = [1, 2, 3, ] call BIS_fnc_selectRandom;
systemChat (format ["%1",_typezombie]);
};
systemChat (format ["%1",_typezombie]);
Displays:
1
any
while it should be
1
1
What am i missing?
you are setting the variable in the inner scope
it goes out of scope and gets deleted
then you try referencing a now deleted variable in a higher scope
we should have a pinned message about variable scope
all right so it is what I suspected
https://web.archive.org/web/20200605075501/https://community.bistudio.com/wiki/Variables#Scopes there even has a nice graphic
Thanks 🙂
anyone know of a work around for really quiet say3D sounds when inside a vehicle in first person ?
I am everything but a expert, let alone a novice on this but have you tried adusting the soundvolume? E.G. db-10 in the description.ext ?
class sound
{
name = "sound";
sound[] = {"\sound\sound.ogg", db-10, 1};
titles[] = {1, ""};
};
but my thought it it would then make the sound even louder on the outside
it seems to only happen in 3rd person
1st is quiet inside a vehicle, 3rd is loud.
_vehicle say3D ["sound", 200, 1];
is noticible on 200m, perhaps change that to let's say 3m? see if that works out
I do hope i am correct on that one ^
its set to 20m right now, because we want to hear it outside, but not louder then the inside aha
I have only used it for sirens so far and ganking demon zombies which all come from far, I can notice the distance having an effect on sound volume but I am not sure on how that works when working with short distances
i was going to try other methods, like playSound3d, but wiki seems to be down
bc, im pretty sure playSound3d has an isInside param
Yeah, i had the same issue but dedboop came with a solution :D
https://web.archive.org/web/20200606213358/https://community.bistudio.com/wiki/playSound3D
web archive, gotta love this age we live in 😄
Yeah aha
seems like ill have to get the path from the config,
rather then the sound class
I wonder if such a thing exists, looking for a script that can draw a line that follows a unit (player unit) is this a thing thats a possible, and b exists?
Yep and maybe
oh
Any pointers on how I could do it?
Is it a marker thing, or a 3D line you want?
A 3D/2D mapline, that just shows where the unit has been
Just some way to trace where the unit has been, nothing like ultra fancy
map? You can e.g drop a dot every meter/second 🙂
prevPos = false;
while {true} do {
newPos = getPos player;
if (prevPos) then {
// draw line between newPos and PrevPos
};
prevPos = newPos;
sleep 1;
};
probably not the best solution, but it should work without a lot of overhead
and depending on map or 3D you need to add the proper code to draw the line(s)
while {} do {}
sorry, have 3 other languages in my head 
prevPos = newPos;
setting bool to vector
I'm fixing the offline wiki 😛
what do you want to use it for
Simply for a main menu
(in the next 1 or 2 months I suppose)
ok. Will be a while still. but the older script method will keep working
Yeah aight
Btw regarding rules in monetization
Must it be a website post when it comes to the monetization program or could it be a discord post?
post?
The monetization program
Could it be a discord message/post instead of on a website
@exotic flax sorry, what do I put this in?
Aight nvm don’t think u get me
How does canVehicleCargo work? Is it possible to calculate the result without spawning an instance of the cargo?
yep, as I just said I don't ^^
Ahah yeah aight
@digital hollow maybe by spawning simple object
but you need the object present somewhere
@warm iris Depends, you can add it in the units init field, in the mission init files or in a function which gets called for each unit/player
Ok. createSimpleObject doesn't seem to return the correct result, but createVehicleLocal seems to be good enough.
Apparently its got a generic error in expression
well, it was a quick version which needs to be extended (and fixed) based on your specific needs
Time to fiddle! Literally just to draw a line (or markers every so often) to follow where a unit has been. Hoping it'll be simple
Also odd, seems like its not been done yet, at least from what I can find realtime tracking yeah, tracing a units movements, no o-o
for most people it's not needed, because the current location is what matters
Yeah, it is a bit of an odd'un but its for a point, ish. Not got much of a clue where to start tho
and having lines all over the map (or worse, in 3D) can be very distracting while playing a mission 😉
Yeah, that was the issue but it's at least for small scale, if it was big scale it'd be tonnes harder
If you use decaying lines it would be better in such scenario.
say, you will only keep an history of lines for past 10 mins
that would require to store all points for 10 minutes, which can be a lot... especially if you want to do it for all players, it would mean thousands of locations to be stored
At the minute, I'm trying to get a line that stays forever to follow 1 unit (as its a group, I really am only focusing on the group leader) or for it to place dots every 10-30 seconds
dots are easy, simply use createMarker and setMarkerType, which will put a dot on the map for everyone
Slot it into the previous code I'm guessing?
I'm also guessing to do it for more than 1 unit attempt to convert it to use a variable name?
not needed, because every unit will run the code for itself (but will put dots on all maps)
Is the bi wiki down?
yes
I also cant really see how I'd slot this in tbh
[] spawn {
while {true} do {
_tmpMarker = createMarker [format ["dot_%1_%2_%3_%4", profileName player, (getPos player) select 0, (getPos player) select 1, (getPos player) select 2], player];
_tmpMarker setMarkerType "hd_dot";
sleep 1;
};
Try this in the init field of the player (not tested)
Its not having it, for no reason apparently
errors or just not doing anything?
Throws up a box that just says Init :
that would require to store all points for 10 minutes, which can be a lot... especially if you want to do it for all players, it would mean thousands of locations to be stored
@exotic flax That would be up to how you want to script it, usually this sort of features take point A and B over a fixed time, so you would not add a line for each moment but per 1-2 min(just an ex, up to scripter) , because you do not need precise movement, you just need a rough idea. Of course I assume he just wants to give a rough idea what the player has done recently and not something detailed.
hmm... I do see the issue, although it's a bit annoying because you need the spawn to use sleep, but the init field doesn't seem to like that (and I can't check the wiki/forums for a better solution atm)
because if I run the following in the console it works (it adds a dot every second on the map):
[player] spawn {
params ["_unit"];
while {true} do {
_tmpMarker = createMarker [format ["dot_%1_%2_%3_%4", name _unit, (getPos _unit) select 0, (getPos _unit) select 1, (getPos _unit) select 2], _unit];
_tmpMarker setMarkerType "hd_dot";
sleep 1;
};
};
trying to run the same script in the init field breaks...
How does remoteExecCall work? Cant use wiki atm 🙁
My guess ["param_1", param_2] remoteExecCall somefunction; would work in theory?
or if someone has a quick example to provide, it would be much appriciated
["param_1", param_2] remoteExecCall ["someFunction"];
[leftparam, rightparam] remoteExec ["functionname", target]
how do I keep a plane that is supposed to fly in the same position in-air?
ie i want the players to parachute but as they aren't exactly bright they take time and if the plane moves they will miss the landing area
I believe _vehicle enableSimulation false will do the trick
iirc that made the player vision black and there were no engine sounds
well, with simulation it will try to fly (or drop down), without simulation it will stay in place but without any fancy stuff like engines
but perhaps there's another solution I don't know
although something I did in a mission was simply kicking all players out of the plane the moment it was at the drop zone
i wonder if i can place an invisible object, then attach the plane to it
heh the wiki gives 502 bad gateway
yup, wiki (and forums) are down at the moment
yep it seems attachto do the work
Is there an fnc for finding the point on a line closest to another point?
Yes, but biki down
*Up
Of course it is up, because it has to be down to be up -again- (sentence not to be used outside of context)
Any leads on that fnc? =)
@digital hollow BIS_fnc_nearestPoint 🙂
@digital hollow yeah, it's called vector math

Or arithmetic geometry
Pick your poison
the best thing is you only have to (have someone to) figure it out once - then all you need is to use this function
Hi, There is a way to get the current ip and port of the server that I am connected? Thanks
not through scripting afaik
is the combat patrol module used by players, AI or both?
i want the AIs to randomly patrol an area without laying down the possible paths myself so i'm wondering if this does the job
The Combat Patrol modules are related to the multiplayer Combat Patrol mission type, not to actual patrols
You want this: https://community.bistudio.com/wiki/BIS_fnc_taskPatrol
is there a module that do the same that you know of?
the old man modules seems interesting but i can't find any tutorial on how to use them
You could try looking under the Site modules, but they work by spawning units rather than giving instructions to existing ones.
The Old Man modules were added quite recently and don't have complete documentation. There's also some risk of problems when using them in multiplayer since they were designed for a singleplayer scenario.
Hi, I'm trying to get some soldiers to train at the shooting range. I would like the code to work in multiplayer but I'm new and I don't understand everything.
Sorry, just not wanted to spam 😄
Edit your post is always your friend 🙂
Hi there! I tried to use this code to make a camera circle around an object...
Now I got the problem, that the camera is automaticly adjusting its height related to the ground.
I want it to be at the same height all the time.
Camrunning = true; // set to false to stop the camera
_radius = 50; // circle radius
_angle = 180; // starting angle
_altitude = 10; // camera altitude
_dir = 0; //Direction of camera movement 0: anti-clockwise, 1: clockwise
_speed = 0.02; //lower is faster
_coords = [cameratarget, _radius, _angle] call BIS_fnc_relPos;
_coords set [2, _altitude];
_camera = "camera" camCreate _coords;
_camera cameraEffect ["INTERNAL","BACK"];
_camera camPrepareFOV 0.700;
_camera camPrepareTarget cameratarget;
_camera camCommitPrepared 0;
while {Camrunning} do {
_coords = [cameratarget, _radius, _angle] call BIS_fnc_relPos;
_coords set [2, _altitude];
_camera camPreparePos _coords;
_camera camCommitPrepared _speed;
waitUntil {camCommitted _camera || !(Camrunning)};
_camera camPreparePos _coords;
_camera camCommitPrepared 0;
_angle = if (_dir == 0) then {_angle - 1} else {_angle + 1};
};
Thanks for your help! 🙂
do you know how to loop this animation ?
willie playMove "AmovPercMstpSnonWnonDnon_exercisePushup";
Use animDone EH
Right at the end?
I started yesterday trying to create a mission. I never tried before
I'm just trying to do something clean
You can play an animation and add an eventhandler to the person doing the animation to execute code once the animation is done
this way you can execute code exactly when its done and just play the animation again
I think it exceeds my current level of programming
this playMove "AmovPercMstpSnonWnonDnon_exercisePushup";
this addEventHandler ["AnimDone", {
params ["_unit", "_anim"];
_unit playMove "AmovPercMstpSnonWnonDnon_exercisePushup";
}];
try that
thanks
it has to be ```sqf
willie playMove "AmovPercMstpSnonWnonDnon_exercisePushup";
willie addEventHandler ["AnimDone", {
params ["_unit", "_anim"];
_unit playMove _anim;
}];```
In Development Branch (for now), is there anyway to detect all addons (pbos) from a MOD/DLC?
no
you can iterate CfgPatches
and use maybe configSourceMod to get back to the modlist thing I added
Hmm maybe that'll do
I am probably missing something big here, my own theory is because the "rain" & "overcast" are executed from the wrong script or need a attachment to an object but I cant figure it out.
Could someone tell me why the following script in init.sqf does not work:
if ((rain >= 0.6) && (overcast >= 0.6)) then {
systemchat "RainOvercast";
};
I remember it working when i finished that script but have made some changes since then
rain & overcast are both set at 100%
and if I execute it in-game it works
systemChat may not be ready, be sure to have some delay first
What happens if you introduce a sleep 0.1; immediately before that in init.sqf?
That is extremely strange, I am sure I did tried that. However... it worked, not sure what went wrong the previous time I tried that
Thanks 😄 I've been working on it for a couple hours already haha
Ahh, something is wrong with the "while {true} do {" string in which the if ((rain >= 0.6) && (overcast >= 0.6)) then { resides
…rephrase plz?
sleep 0.1;
systemchat "1";
while {true} do {
systemchat "2";
if ((rain >= 0.6) && (overcast >= 0.6)) then {
systemchat "3";
};
sleep 600;
};
It activates the "1" but neither the "2" and "3"
Oh! now it did activate the 2
(```sqf)
well, it should yeah
but not the 3 lol, well getting closer and closer
ill simplify the script, its probably something further down
systemchat those rain and overcast values before the while otherwise you have to wait god knows how long at 5min intervals
figured it out, the script didnt worked because of a rogue "
it was in a hidy hidy spot
i placed a marker with alpha 0, then in a trigger i call it with APCMarker setMarkerAlpha 1; but the marker does not appear 🤔
the marker name should be a string
"APCMarker" setMarkerAlpha 1;
also, when doing things with scripting, make sure you turn on "show script errors" in the launcher options
🤦♂️
how does remotexec determine if the parameters i am giving have to be put before or after the command itself?
[before, after] remoteExec..
there are two ways to call it, one is param1 sideChat param2 the other is [param1, param2] sideChat param3
but i guess [param1, param2] sideChat param3 is still a param1 sideChat param2 for the engine maybe?
there are only three cases
command
command arg1
arg1 command arg2
but i guess
[param1, param2] sideChat param3is still aparam1 sideChat param2for the engine maybe?
yes, left argument is an array, right argument is... whatever param3 is
one is
[param1, param2] remoteExec
other is
[[param1, param2], param3] remoteExec
now i have it clear
is there a way for format to print just part of a string? i have a device (microDAGR from ACE) that wants the input of a position as 0XY0ZT but the getpos gives me XYRF,K ZTOP,Q so i want to prepend 0 (and i can already do it) but limit the print to 2 character (XY and ZT) and discard the rest
could you give example? format is not very clear
but yes you can use select on a string to get part of it
sure, i have a vehicle that is at let's say 9874,3 N 1586,6 E
the microDAGR wants the waypoint as 098 015
so i have to sidechat "0" + getPos obj select 0 + " 0" + getPos obj select 1 but also trim the getPos return
if it's indeed what you need, then yes, you can use select
with C i would printf %1.2s
oh wait, you want a different precision
there is a command for that
toFixed 2 I think
uhm no? the numbers are before the decimal not after
🤔 I read your message as %1.2f thinking you needed a float format, sorry
CBA rescued me:
X = [str (getPos APC select 0), 0, 2] call CBA_fnc_substr; Y = [str (getPos APC select 1), 0, 2] call CBA_fnc_substr; [Angel1CoPilot,"The APC have landed in a wrong position, new position 0" + X + " North 0" + Y + " West"] remoteExec["sideChat", 0];
format is more efficient than string+string+string+string+string
I don't really understand how your code makes sense
mmh what part bothers you?
the microDAGR wants the waypoint as 098 015
those are grid coordinates.
getPos doesn't return grid coordinates
Use this to turn a position into a grid https://community.bistudio.com/wiki/mapGridPosition
mapGridPosition APC
returns for example 098015
then you split it apart into X and Y and done.
Or something like https://community.bistudio.com/wiki/BIS_fnc_posToGrid
The getPos position of
600x500 might be grid 060 050 yes..
but your code also causes position 60x50 -> 060 050, although its really 006 005
(not actually the correct math, but you get what i mean)
How would one go about moving trees? ( wind effect ) im trying to figure out how it's done and possibly increase it under some circumstances
Thanks 🙂 time to find the ceiling of that function
I've seen completely flattened trees 😄
if you use a vietnam map the trees might even speak 😛
on that note it would be interesting to know if you can technically make the trees lose the foliage or it's part of the model and you cannot
part of model
can you swap the model during runtime?
It's part of the model, although you can fake the effect with leaf models as particles 😉
A mask to hide leaves would be interesting, or to change color of leafs 😄
You could theoretically swap the model, but custom spawned models might not have the wind effect
Defoliated trees probably wouldn't move too much in the wind tbh
The real tree wishlist item is being able to choose which way they fall when destroyed via script
can't you offset the base when you destroy it and physix will do the job?
tree's are not physx
you destroy it then you manipulate the rotation and the orientation, sounds like doable
Trees have no velocity
Hmm, whatever command i put in it gets automatically overwritten by the default weather, I have no idea on how to turn that off
Note: I am not actually trying to do it. It would be useful for some things like the Achilles nuke and other scripts that simulate environmental damage, but I'm not personally doing anything with trees.
Changing vectorDir would change the direction it falls to tho
I've used a combo of the following commands;
0 setWindForce 1;
0 setWindStr 1;
setWind [10, 10, true];
hi, i have a little question ? can i launch a script as "eventhandler init" but not when the mission is launched but when i'm in the 3den editor ?
Is there a way to go past 0 setWindStr 1; and basically do 0 setWindStr 2; ?
@faint oasis If i understand you correctly then yes you can do that 🙂 take a look at this page: https://community.bistudio.com/wiki/Event_Scripts#init3DEN.sqf ( it runs as soon as you load a scenario in eden )
init3DEN.sqf
lol SetWind [50000,90000,true];
If i only knew how to make that last longer then .5 sec
Well, ace weather was the culprit
. . . oh, really? mods have an impact? -___-
does anyone know if the driverless/1-man tank script is no longer working?
…which one?
The Tank DLC one?
@digital hollow wat? which one?
Anyway to force collision between AI and an editor placed object?
like an object with no collisions and an AI?
Like a wall for instance. Typical behaviour with AI pathing will cause the AI to move through walls/doors/fences. Pretty much any object other than terrain. I want to AI to be able to path but not travel through objects.
I vaguely remember a command existing for it but I can't find anything.
setBehaviour "safe" ?
https://feedback.bistudio.com/T58683 Ticked was closed 4 years ago but repeatability is incredibly easy.
oh, a unit, not a vehicle.
Yes sorry.
on a similar note
is there a way to not have collisionchecks with a vehicle?
Yeah disablecollision
that disables the collision but does it disable the collisioncheck aswell?
Oof, actually I think that command can only be used with specified objects anyways.
yeah I need it between vehicle and static prop
and its just causing me frameloss
You would probably be able to accomplish something with Intercept C++ but I think we're out of luck with SQF and collison/pathing changes.
But I'm sure someone has a solution.
not sure honestly
I'd be fine with the collisions to be completely missing
my problem is that an helicopter is going through various collision checks without ever colliding with anything
and the checks seem to brutalize framerate
You could do it the hard way and just make it a unitCapture.
though exactly of that
but I'd still have to fly through it and unitcapture records only during frames
and even then I'm not sure if there will still be collision checks during unitplay
I don't believe so but I've never tested it. Should be pretty easy* to debug.
no idea how
line intersects maybe.
plan c would be to unitcapture without the objects that cause issues
and then add the objects
but I'm clueless on wheter I'll hit anything during recording
Does anyone know how to get an array of Turret units like assignedCargo?
@smoky verge EpeContact https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#EpeContact
I wish there was a "ExplosionNear" event handler.
does it count as collision if I'm not actually colliding?
@warped shuttle https://community.bistudio.com/wiki/assignedVehicleRole Have you tried this?
I don't believe so Sanchez.
But if you just assign that EH and have it pop a hint when it's fired then you will know.
In the event that it's still firing and your framerate is better during the unitCapture that would be a solid indicator as well.
A system log would be better than a hint though if you've got a lot of potential collisions.
yeah
so annoying though
@tough abyss I've tried, but this is not what I'm looking for as it returns the unit's role and path.
This one is ... _turret = assignedVehicleRole vehicle player; hint str _turret; //["Turret",[0]];
What is your desired output?
I desired turret(FFV) units list like a "assignedCargo"
https://community.bistudio.com/wiki/assignedCargo
@tough abyss
Self-resolved. Thanks for the suggestion and help.
_Turrets = allTurrets _vehicle;
_units = _Turrets apply {_vehicle turretUnit _x};
hint str _units;//[Alpha 1-1:1,Alpha 1-1:2,...]
hey i'm trying to lock at door at the start of the mission with this code
build1 setVariable["bis_disabled_Door_5",1,true];
that seems to work.
how would i unlock it as this one i run on another trigger doesn't unlock it.
build1 setVariable["bis_disabled_Door_5",1,false ];
I'm down with it just swinging open, better than nothing.
Not sure if its this
build1 setVariable["bis_disabled_Door_5",0,true ];
Yes, 1/0 is the lock state. The true/false part controls whether the variable should be broadcast globally (so you want it to be true)
is there a way to exit the game via command?
Like, close the game if the command gets executed?
possibly this
ctrlActivate(findDisplay 0 displayCtrl 106);
{_x closeDisplay 2} forEach allDisplays;
it "clicks" the exit button on the main menu, but it doesnt seem to take effect with other displays open.
@winter rose
tank script
I was just saying they can 1-man without a script now =p
@winter rose
I was just saying they can 1-man without a script now =p
@digital hollow how?
You just be group leader and press wasd
Thats not the solution i need tbh.. i want it as before in OFP like the T-80 auto. My mod doesnt need 3 crews for any tank vehicles, isnt needed and some game perfomance can be safed too with 1-man controlled tank/vehicle
is the DoWatch command not usable for Helicopter gunners?
It works fine for tanks
tried with both normal AI and an agent
(tried that on both Tank and Helicopter)
@timid niche if you can, please test if connectToServer on dev branch works as you want it to work, once its out its hard to fix.
Only had one tester so far
Sure ill test it
@still forum should it work with localhost?
Or does it require an actual ip like 127.0.0.1
Well ill try with 127.0.0.1 cause didnt work with localhost
it should atleast go into the connecting screen, and then probably fail if domains don't work
Seems to go to loading screen but doesnt actually connect with either
I can't seem to hide or visually break the main rotors on the Mi-24 from either CUP or RHS. Anyone know how to do that or a Hind mod with rotors that break?
Thanks @carmine sand @hallow mortar
Hey guys, i am trying to spawn a zombie_walker ( which is part of civ ) and force it under the flag of independent with the following code:
_ryanzombies = creategroup independent;
_zombie = _ryanzombies createunit ["zombie_walker",position player,[],0,"form"];
_zombie addEventHandler ["FiredNear", { _zombiegroup = group _zombie; systemchat (format ["%1",_zombiegroup]);}];
Then when i fire near I still got C Alpha-something in the sidechat.
What did i miss?
Use joinSilent.
https://community.bistudio.com/wiki/joinSilent
I've been fiddeling around with that but it spits out generic errors;
_ryanzombies = creategroup independent;
_zombie = _ryanzombies createunit ["zombie_walker",position player,[],0,"form"];
_zombie joinSilent independent;
_zombie addEventHandler ["FiredNear", { _zombiegroup = group _zombie; systemchat (format ["%1",_zombiegroup]);}];
Wrong syntax.
[_zombie] joinSilent _ryanZombies;
not
_zombie joinSilent independent;
ah ofcourse, makes sense
god, even while being in the same group the nutheads still attack each other
yeah, ryans zombies mod is very weird when it comes to that
there is just no way to communicate with anything that happens within that mod. I thought ravage had the better spawn system and ryan had the better zombies but I am starting to doubt this
Hi guys, me again. Back with another question about holdActions, but this time it's when it's run on a server. It works in singleplayer and LAN multiplayer, but not on a server for some reason?
So the issue we get is that we get three of the same action on the computer it's supposed to be on, and none of them actually do the full thing they're supposed to do. No errors, it counts down to one, but then nothing happens.
This is the important script for the computer:
[
manual_override_computer_six,
"Initiate Detonation Sequence",
"\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) && ((missionNamespace getVariable ['actionCompleteSix',false]) isEqualTo true)",
"_caller distance _target < 4",
{},
{},
{0 = [] spawn {
hint "WARNING! DETONATION SEQUENCE INITIATED... PLEASE STAND BACK...";
sleep 7;
hint "THREE...";
sleep 1;
hint "TWO...";
sleep 1;
hint "ONE...";
sleep 1;
hintSilent "";
explosiveSix1 setDamage 1;
sleep 1;
explosiveSix2 setDamage 1;
sleep 1;
explosiveSix3 setDamage 1;
sleep 1;
explosiveSix4 setDamage 1;
explosiveSix5 setDamage 1;
sleep 1;
explosiveSix6 setDamage 1;
};},
{},
[],
2,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, manual_override_computer_six]; //Adds the new hold action to the computer
It's saved as a composition, so it's identical to every other test case we've done so far
Another piece of information is that the script's in the init for the computer, not in a .sqf file
and that's why you have dupes.
Hm?
init field runs for every machine, connected or to be connected
remoteExec × players number + 1 (server) = number of actions
... Ah. Didn't know that. I'm assuming that could be leading to the script not executing properly in the next step either?
Since I have three of them and none of them execute properly
dunno
... Is there a way around this without putting it into a .sqf? The point is to make it easier for mission makers to implement the script.
sure, remove the remoteExec usage
adding the action is local
but
the init field is executed on every connecting/connected machine
therefore
the action is added to every machine
Ah, so go for "... call BIS_fnc_holdActionAdd" instead?
just that, yes
also, no need for 0 = , this is an Editor field limitation
and no need to spawn the action code as it is already spawned
Thanks, Lou. I'll try these suggestions out and come back with the results 🙂
Do all players get access to the holdAction even if it's run this way?
every single one of them.
is it possible player connected missioneventhandler is completly broken in SP ?
huh?? 😄
sounds possible
sometimes there are no arguments passed at all 😄
"PlayerConnected"
huh
{
diag_log "Client connected";
diag_log _this;
}];```
well it is what i noticed trying to make some scripts sp compatible to let users work on editor stuff without problems
lol

Ah, need to disable whole word filter 🧠
ah no actually, only called in one place, no argument orer mnixups+
i will try a workaround with advanced params stuff xD
params [
["_id", 0, [0]],
["_uid", str random 100000, [""]],
["_name", "Singleplayerman", [""]],
["_jip", true, [false]],
["_owner", player call BIS_fnc_netId, [""]]
];
okay it doesnt work because at position _uid a boolean is passed
welp
impossibru
arams [
["_id", 0, [0]],
["_uid", str r>
20:49:03 Error position: <params [
["_id", 0, [0]],
["_uid", str r>
20:49:03 Error Params: Type Bool, expected String
┬─┬ ノ( ゜-゜ノ)
hmm anyone knows the stringtable names of the months by chance?
january, february, etc
@west grove synixebrett has a stringtable browser
@sleek token youa re misisng one arg
what's that
ye
he has like a million repos 😄
thanks
wowww, useful!
id, uid, name, jip, playerid, struid
you no have playerid after jip
Ye I just posted that link Lexx
oh right, i just saw the github link :>
i refered to it as owner :>
no
wrong order then
wiki
params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
you
["_id", 0, [0]],
["_uid", str random 100000, [""]],
["_name", "Singleplayerman", [""]],
["_jip", true, [false]],
["_owner", player call BIS_fnc_netId, [""]]
defuq. to sum up. There is nothing wrong with the eventhandler, i executed the code inside it from a differend location. That is way there is no parameter passed
🔨 grrr debug first before calling for a game issue :@
well totaly didn't see that remaining code puzzle
heh, happens.
never clean up your code... :<
you almost went on my paddlin' list, up with people that say the game is broken then tell you at the end "oh yeah, I also use X mod" :@ :@ :@
hehe at least i am not using any mods right now 😛
you better! 😄
I return! This time, a completely unrelated question. I'm gonna make a script that decreases the AI skill of all EAST units when their leader dies. I've found the BIS_fnc_EXP_camp_setSkill function that I think should work, so I've written the following:
if (!alive enemyGeneral) then {
[EAST,0.1,0.1,0.4,0.4] call BIS_fnc_EXP_camp_setSkill;
};
My question is.... How do I check if it actually works?
systemChat "it works, britneys!"; ?
Oh yeah, but that just checks if the code reaches that point, not verifying that the skill levels actually change. Is there a way to check that?
at one point you have to trust the code… and if you don't, read the function to see what it does?
otherwise, you can check that a specific unit has its skill altered
random features intensify
systemChat format ["Skill is %1",(myTestUnit skill "general")]
Oooh, thanks
I found a way to check it though. Go into zeus, pull a unit's skill slider up to 1, shoot the general, check that same unit's skill. It had moved, so it works. 😄
Right, so. Back to the holdAction situation I'm in. The script works on the server now. All the way up until I want the explosives to go off. It does the countdown, which is executed in the same code block, but the explosives don't actually, well, blow up.
{
hint "WARNING! DETONATION SEQUENCE INITIATED... PLEASE STAND BACK...";
sleep 7;
hint "THREE...";
sleep 1;
hint "TWO...";
sleep 1;
hint "ONE...";
sleep 1;
hintSilent "";
explosiveSix1 setDamage 1;
sleep 1;
explosiveSix2 setDamage 1;
sleep 1;
explosiveSix3 setDamage 1;
sleep 1;
explosiveSix4 setDamage 1;
sleep 1;
explosiveSix5 setDamage 1;
sleep 1;
explosiveSix6 setDamage 1;
};
I'm not getting an error that it's not finding the explosives objects, so I'm unsure what's causing it at this point
yeah, what are your explosives?
I'm using Explosive Charge (DemoCharge_F)
they won't explode on setDamage - use "DemoCharge_Remote_Ammo_Scripted" (maybe triggerAmmo works, don't know)
@surreal anvil ↑
.... But it works in local multiplayer angry huffing
really? funny
It works in singleplayer, local multiplayer, but not on the server. I'll give it a go with that script instead
Globals defined in the editor using the Variable Name field do not propagate to clients automatically.
huh, they do? or at least, they should
huh
@surreal anvil
oh I get it
you didn't publicVariable after creating them on the server?
you create them with createVehicle right?
publicVariable the explosives? I did not
Oh
No
They're created as a custom composition that a mission editor plonks down. It contains the computer, a man with the keycode holdAction, and six explosive charges with premade variable names
Then they can move the bombs around to where they want them to be
@winter rose I believe it is restricted to static object globals not being broadcast/read from the mission file by my testing. AI are available, however.
I believe there was a bug with simple objects, but that's it 🤔
Shouldn't the script be complaining that it can't find the objects if they're in the wrong scope, though?
So uh. Did I stumble upon a weird one?
definitely 😄
I'm not privy to the debugger's internals. Definitely don't always get error reporting for undefined variables in certain situations.
@surreal anvil
The quick check in your case would be to run:
hint str (isNil "explosiveSix1"); on the client and see if true comes up. Then you know you need to make that var available to the clients.
Sandbags show up so I suppose it's just explosive names that don't get networked. 
😦
I just want explosives to go boom when I click a button
Is that too much to ask?
But yeah, I'll use that script and see what it returns
As Lou said, make them publicvariables. Easy fix.
Okay. I spawn an explosive in the editor, I change its variable name. How do I make it public from there?
Somewhere on the server, run publicVariable "myExplosiveVariable"; for each of the charges.
Could put it in the init field of each of them as:
if (isServer) then {publicVariable "myExplosiveVariable"};
Oh, that's really useful
And then I call them as "explosive1 setDamage 1;", right?
Yeah.
Thanks, I'll give it a try! Can't do it tonight though, the server's busy, but I'll get back to you if it worked or not
Appreciate the help a bunch, once again
The idea that editor-placed variable names are not global seems quite bizarre
every client should be loading the mission.sqm that tells you about the variable names
I'm aware that editor callsigns aren't global, but variable names? what a weirdly basic thing to break and never fix
Right?
It would appear to be just that explosive block at the moment. I had trouble with it in a mission I was making and just confirmed only that block had the issue. Need to test more.
So the block I picked mainly due to its modest explosion radius happened to be the very one that currently has issues. Cool
Seems like anything of the "mineBase" class is subject to it, at least that's the commonality I've found. Whether it is intentional or not 🤷♂️.
Well, I'll get back to you guys with the result of our testing, probably tomorrow
are variables publicly setVariable'd on a unit available to JIP players?
ye
i.e. if I set a variable on a unit and a player later JIPs into it, will that variable be present on that player's client?
If the unit was a AI and never despawned, yeah, should
Hey guys, where/how in this init script would I add cuttext to fade in from black for 5 seconds?
this addAction ["Enter Galley", {player setPosATL (getPosATL galley)}]
Looked cuttext up on the BIKI but cant quite figure it out
what's the page I should go to to learn about using classes for setting up a bunch of dialog?
i mean for dialog for just quickly referencing stuff. I heard you could create a class of ingame radio texts you want to use then call them so you don't have to have a separate sqf for every single one.
I think you're talking about triggers using Radio Alpha/Bravo/etc Activation.
nah, something with class cfgs and stuff
idk why I'm drawing a blank. let me see if i can figure out how to use search well enough on discord. this was weeks ago
i found it...
params ["_case"];
switch _case do {
case "event1" : { dialogue, sleep etc. };
So would this be a good start? I would then add more params and stuff?
["dialog1"] execVM "script.sqf";
params ["_truckTrigger","_survivorTrigger"];
switch _truckTrigger do {
case "dialog1" : {
[Headquarters,"Looks like some sort of battle happened here. There are 5.56mm magazines on the ground. Nato?"] remoteExec ["sideChat",-2,true]
};
};
switch _survivorTrigger do {
case "dialog2" : {
[natoSoldier,"Namalsk, get to namalsk"] remoteExec ["globalChat",-2,true];
sleep 3;
natoSoldier setDamage 1;
};
};
switch is for choosing between different values (cases) of a single variable. What you have now you should just do
if (_truckTrigger isEqualTo "dialog1") then {
};
this is what I am referencing for background btw
https://discordapp.com/channels/105462288051380224/105462984087728128/716195475497156700
Look at Example 2 and make your stuff like that.
okay
params ["_dialog"];
switch _dialog do {
case "truckFound" : {
[hq,"There must have been some sort of battle here. Look, 5.56mm magazines on the ground. NATO?"] remoteExec ["globalChat",0,true];
};
case "soldierFound" : {
[natoSoldier,"Namalsk, get to Namalsk!"] remoteExec ["globalChat",0,true];
sleep 3;
natoSoldier setDamage 1;
};
};
something more like this then.
why do you need JIP flag? it is a message that is relevant only at the time of sending it
@fair drum you mean "dialogue" (conversation), not "dialog" (UI)
See https://community.bistudio.com/wiki/Conversations for (aaargh!) the A2 Conversation system
Otherwise yep, simply use *chat commands
wow, that Conversations system looks absolutely hateful
it is nice though… but requires the will to setup a full system for "some" sentences
Using BIS_fnc functions, voices play themselves in order, waiting for the previous one to end - no "sleep 3" etc
Can anyone help me with this script? Its meant to make a zeus and add me as the curator, but when I do, when I oepn up Zues, and try to double click a unit to edit its properties nothing shows up, and modules from Zeus Enhanced just stay there and dont have their pop up either, however, if I do it through the editor instead of an SQF, it works fine. Here is the script
{if ((name _x) == "Agent34") then {charac = _x; publicVariable "charac";};} forEach allPlayers;
moduleGroup = createGroup sideLogic;
publicVariable "moduleGroup";
zeus_module = "ModuleCurator_F" createUnit [getPos charac, moduleGroup, "charac assignCurator this;"];
publicVariable "zeus_module";```
It used to work fine like a charm but recently after I got back from a 2 week trip out of town, it started giving me this issue, I've tried past scripts and running it past TypeSQF to check the syntax but I cant find anything. I'm not sure what the count in tbe debug console means but it always gave me a 3/10000. I ran this on a singleplayer scenario using Local Exec
you have to also assign all Event handlers IIRC
private _zeusModule = (creategroup sideLogic) createUnit ["ModuleCurator_F",[0,0,0],[],10,"NONE"];
player assignCurator _zeusModule;
//Add Interface EHs (Workaround)
_zeusModule addCuratorEditableObjects [entities "", true];
_zeusModule addeventhandler ["curatorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}];
_zeusModule addeventhandler ["curatorPinged",{_this call bis_fnc_curatorPinged;}];
_zeusModule addeventhandler ["curatorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}];
_zeusModule addeventhandler ["curatorObjectEdited",{_this call bis_fnc_curatorObjectEdited;}];
_zeusModule addeventhandler ["curatorWaypointPlaced",{_this call bis_fnc_curatorWaypointPlaced;}];
_zeusModule addeventhandler ["curatorObjectDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
_zeusModule addeventhandler ["curatorGroupDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
_zeusModule addeventhandler ["curatorWaypointDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];
_zeusModule addeventhandler ["curatorMarkerDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}];``` That's the way I used to do it. No sure if there is a better one by now
i got a bit of a problem with play music script or activation idk what its called
i have this in a description.ext
class CfgSounds
{
sounds[] = {};
class music1
{
name = "music1";
sound[] = {"\sounds\HALO.wav", 300, 1};
titles[] = {0,""};
};
};
and
this in an objects init
h1 addAction [ "halo 3 music?", {
h1 say3D ["music1", 1000, 1];
} ];
i also have a folder called sounds and the location fine. i get no error but yet im hearing nothing and i checked the sound file its self and it sounds fine
Does it work with say2d?
the action works its jsut the music it doesnt work
So I'm currently trying to understand locality with event handlers. As far as I can tell it looks like the only event handlers that I need to treat specially are "Hit", "Killed", and "Respawn". Let's assume I am running a dedicated server with a script TAG_fnc_server_script that only exists on the server. If I run this on the server (where player is a player unit):
player addEventHandler ["Respawn", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
[_unit, _killer, _instigator, _useEffects] call TAG_fnc_server_script;
}];
Then am I correct in assuming that the event handler will never fire because it only fires when local to the player?
try addmpeventhandler mphit mpkilled mprespawn
I read from the community wiki mission optimisation page https://community.bistudio.com/wiki/Mission_Optimisation that using while is likely bad scripting
This script here I use is designed to prevent people from loading unwanted items from Warlords arsenal and loadouts
_uniform spawn {
waitUntil {!isNull (uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull])};
while {!isNull (uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull])} do {
if ("RHS_Podnos_Gun_Bag" in backpack player) then {
removeBackpack player; " RHS_Podnos_Gun_Bag";
cutText ["<t color='#ff0000' size='2'>THIS BACKPACK IS NOT ALLOWED!!!</t><br/><t color='#FFFFFF' size='1.5'>PICK A DIFFERENT ONE...", "PLAIN DOWN", -1, true, true];
};```
Is it logical to think if I add a sleep people can exploit the sleep to load unwanted items? Or is my concept of sleep (which i believe to just be a delay before the script runs again) incorrect. If anyone has a better direction for this script can it be recommended?
use arsenalrestricteditems[] ={} mission param to restrict unwanted items in loadouts
@unique sundial So something like this?
player addMPEventHandler ["MPKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
[_unit, _killer, _instigator, _useEffects] remoteExecCall ["TAG_fnc_server_script", 2];
}];
Will that event trigger for every pc though? So if there's 3 players connected the server script gets executed 3 times?
you don’t need remote exec
read description
it fires globally
it fires once on every pc and server
better option is to use mission event handler entitykilled
Oh ok, I understand what you're saying. So since the server script only exists on the server will it will only get run there?
you need if (isServer) then {...} to run on server only
it runs globally but only on server isServer is true
Ah ok that'd work.
if you add missionEH entitykilled on server only you get server only execution
Ok so I can use EntityKilled and EntityRespawned to replace their respective events but I still need to be able to execute an event for "Hit" on the server, which I take it can be accomplished using MPHit and addMPEventHandler.
thanks @unique sundial will try
doing what killzone said, I looked into Mission params in the wiki, and guessed part of the issue Im having now is I dont know what classname to put the mission param in. How would I properly search for which I need?
atm im using
{
arsenalrestricteditems[] ={RHS_Podnos_Gun_Bag};
};```
And also a screenie of the error ivemade https://gyazo.com/9b407f6b77d062723bba3b6ea1c82a9d
oof wont work
I had it similar to that before but wait, so the reason it wasnt working originally was because i forgot to put quotations around the classname? 😠
that too yeah.
🤔 still borked nothing happens
¯_(ツ)_/¯
It doesn't appear to go into any class. You just put that line on its own outside of all classes.
Hey Guys,
I could need some quick help cause somehow I cant find the command on the BI-Wiki.
I would like to negate the "isEqualTo" Command ....
I did it this way, but I dont find this very elegant
if [((driver (vehicle driver)) isEqualTo player) == false] then {
hmmm ok. and now i need to find out how to do quotes in discord 😉 .... ignore "´please 😉
== false <- get rid of this
ok. thats what my question is a about. but how do i negate the logic then?
the goal is that I want to get the people in the vehicle that are NOT the driver 🙂
- Check pin message to format
!(false)ornot (false)is trueiftakes no array but boolean
ok thanks !( ) will help 🙂
I think from there I can go on. Thanks for your help.
Also thanks for the hint with the pinned-messages
hey there, is there any way you can modify the URL attribute of a RscButton via SQF?
i dont believe so.
Not available, no
okay thank you
what is the format/path for A3 particles?
e.g \A3\data_f\ParticleEffects\Universal\Universal?
it seems so
"\A3\data_f\ParticleEffects\Universal\Universal"
Yes, without extension will work
@cosmic lichen Quite odd, it used to work just fine without it, thanks for it anyways, I'll try it now
Wow, it worked, thank you so much!
yw
huh, since when can't you eject an AI helicopter cargo mid-flight 🤔 while the player can
_x action ["eject", vehicle _x]
```I'll use `moveOut` \=|
arrrrrrgh, the helicopter lands to allow units to come back in, even if they were unassignVehicle'd…!
even when leaveVehicle'd, too
Welcome to helicopter AI hell
Trying to have helicopter transport interactions of any kind is a nightmare. It doesn't ever get any better.
Fun fact: getting out of an AI helicopter that's idling on the ground causes it to immediately lift straight up 25 metres before coming back down. That's if you can get it to land at all; another favourite helo pastime is hovering over a completely clear LZ going up and down forever without landing
@winter rose you might want to take a look at this forum topic: https://forums.bohemia.net/forums/topic/222950-ai-keep-getting-back-into-helicopters/ (including solution and known(?) bug in VCOM)
@winter rose i just spawned the AI outside the helicopter in flight and deleted them from the seats

But im notoriously pissy about the AI and AI-commands and tend to try and avoid them whenever possible
hellooo anyone knows how to change what coordinates are showed on the GPS ?
all this display and title effects thing is kindda hard :c where i can find some documentation to understund it?
is there a script out there to keep players map markers to each other and then share the map marker threw an interaction ect.? (bad description)
@hallow sphinx if you draw in "direct comunication" only people arround you can see what you drew, you want that or something more "global" ?
i want to limit drawing on the map to be seen only by the person who draws it and an interaction to share what he has drawn on the map threw interaction if possible threw mods or a script
you can limit it in that way, and then save and broadcast your marker to all the other players, the only problem i see... i dont know how lines work
if can be stored and draw again in some way
@open hollow the 3d model or the display?
I think there's already a script running that updates it
So if you change the value, you'll be competing with that other script
Your best bet would be hiding the original ones and then creating your own one in its place
What exactly are you trying to accomplish @open hollow
jamming gps basically
Yeah, then youre best off doing what i said
The other option is to replace the gps with a "broken" gps item
Or "jammed" gps item that doesnt function as a gps
This would make it not possible for players tp use gps functions
yea... thats a good one
hello all, would anyone be able to help with the radioChannelCreate? I cant for the life of me get a CustomChat script to work
if anyone can help
Well without your code, I doubt anyone can help you
all i have is the basic
_unit customChat [1, "Hi, I am a custom chat message"];
not sure how to even start to use the other RadioChannelCreate
@vernal dust if you mean creating a tfar channel on teamspeak there's a task force radio module in the editor. just double click it. put the info in. make sure the ts channel name matches the channel you designate in the module
if that's not what you mean then disregard
What? no he doesn't mean that
what he means was posted right above your message, 4 hours ago
could I easily set the size of a trigger to match the size of a pre-placed marker in a short and similar way to this? since getMarkerSize returns [x, y] size and setTriggerArea's parameters use [x, y, angle, isrectangle] i thought i could do something like "_trg setTriggerArea [(getMarkerSize "mrk1"), 0, false];", but this throws an error saying it expects 5 elements but only 3 were provided
Try
_trg setTriggerArea [(getMarkerSize "mrk1") select 0, (getMarkerSize "mrk1") select 1, 0, false];
@hidden talon
You can also use markerDir to dynamically fill in the third value
thank you @cosmic lichen, works great now
@hallow mortar markerdir isn't needed for what i'm doing though, just the marker x and y scale
what is the correct way to rearm a vehicle?
setVehicleAmmo can only remove magazines from the gunner, and setVehicleAmmoDef 1 correctly restores full ammo but leaves the gun inoperable until you switch seats / get out and back in
addMagazine / addMagazineTurret
alright, I'll try that
does sqf have some kind of list function?
i would like to avoid having a multi level array
Hmm what do you mean?
i worked on a strategic map long ago that creates coloured markers according to terrain type, and i want to revitalize that. each marker needs to store information, like trees, houses, units etc. best would probably be to create a marker class with fields that hold that info, but i want all markes in a list where i can access the marker and the info.
in the past that was a huge multi level array
but i have come to like c# lists recently so i was wondering if sqf has that too
list is a map string -> something, right?
you could create some dummy object and use setvariable
thats actually a good idea
you could use my OOP and treat all these elements as OOP objects 😜
whats oop
😮
orkisch orgasm puppet
no, i play around in unity and my knowledge isnt very deep
ah object oriented programming?
so wdym use your oop?
list is a map string -> something, right?
That would be a dictionary in C#
well I have some macros which simulate OOP in SQF and it suits your task (or pretty much any task)
well.. we have lots of code written with it
https://github.com/Sparker95/Vindicta/blob/development/src/UI/MapMarker/MapMarkerLocation.sqf
this one is a class of a map marker which creates some marker and allows other stuff to happen with it (like having overlayed markers) and store extra data
wait i know that
where do i know that from
looks sick. even has a mouseOver function
yes it becomes bigger when you hover mouse over it so you can click on it, it's clickable... but anyway it's just an example, that adds general OOP capabilities
does it support square markers?
im using square area markers
lets see if i can find a screenshot of the old program
the MapMarker class I gave is just an example of generic OOP capabilities (objects, inheritence, variables, etc)
I didn't mean to relate it to your problem really
is it possible to expand the fields?
and methods?
sorry, your OOP markers is far beyond anyhting i have coded in sqf
expand like... what?
each marker needs to store information, like trees, houses, units etc. best would probably be to create a marker class with fields that hold that info
just create a location for each marker, locations have a namespace that you can store variables in
Of course, you code your own class like in C#, add your own methods and variables like in C#, inherit from other classes like in C#, there are even variable attributes like in C# 😄
cool
just create a location for each marker, locations have a namespace that you can store variables in
I suggested that already. Actually if you use CBA, it has a handy function for itCBA_fnc_createNamespace
location != marker?
yeah
createLocation vs createMarker
but locations can have icons too? I think? but only a limited set
I suggested that already.
you suggested dummy objects, which would be quite inefficient compared to locations
i will need dummy objects anyways for visual presentation
so probably location + square area marker
lol wth is that for a field: fakeTown
you suggested dummy objects, which would be quite inefficient compared to locations
yes you are right, I forgot that
although there is also createVehicleLocal
now, if i have dummy objects anyways, do locations offer an advantage that justifies adding them anyways?
although there is also createVehicleLocal
thats the inefficient thing I was talking about
my dummies will be map markers, not vehicles
Yes? Even local?
Yes... As I said..
do locations offer an advantage that justifies adding them anyways?
basically zero cost? And having one location per marker is easier to code than choosing a random one of these objects that you place for visuals
_var = "";
_var params [["_scope",0,[0]]];
_var
Gives error: type string expected number. Shouldn't it just default to 0 and not give any errors? Or am i using this wrong?
Well you didn't say why, I thought that only network traffic will be different, but you ahve the source code, not me 😄
@sturdy sage should print error AND default to zero I think.
zero is also default when undefined is passed
Nah just gives empty string
@astral dawn objects are rendered, simulated, culled, seen by entities, iterated over as nearby objects, network traffic just goes on top for non-local objects
@sturdy sage yes because thats what _var is, check _scope variable
Oh oops i forgot to change that
@astral dawn objects are rendered, simulated, culled, seen by entities, iterated over as nearby objects, network traffic just goes on top for non-local objects
That's good to know. I doubt it would make much difference unless he created an amount of them comparable with objects from the map, right?
Ok yeah its returning 0 now. Hm didn't expect it to also complain with script errors, need something different then
I doubt it would make much difference
As far as I understood he's talking about hundreds, not dozens
im gonna fill the complete map with markers 100m side length
so for 10x10km thats 100x100 markers
One object per 100x100 meters, that's average density of takistan desert I guess 😄
terrain objects are much different from non-terrain objects
In which way?
Are they not rendered, not simulated, not culled, not seen, or not iterated?
If you are far away, they don't even exist.
They are not really simulated, no network traffic
Hmm interesting
So basicly in his scene he will always have 10 thousand extra objects?
yeah
nice
🦆
now make a loop that checks all 10k objects each second
Yeah I am starting to worry about my own code then 😅😅😅

luckily that uncalled for. terrain info wont change as settlements and mountains odont suddenly appear
if you need to check them periodically, you'd have to build a system that prioritizes them, instead of just blindly iterating over all of them while 90% of them either don't matter or do nothing
and for dynamic information like garrison im gonna have the unit check their quare, not the square check for unit
So... it means that objects like fences or similar placed in editor add more load than same objects which already were there at the map?
Server still must simulate these fences from the map?
objects like fences or similar placed in editor add more load than same objects which already were there at the map?
yes
Simulation for static fences is not that expensive tho, but yeah they are always there
how performance heavy is it to have fields that dont change in MP.
?*
like, is there an advantage to keep the number of fields low?
what fields?
they are called variables here, not fields (in conversations and in SQF commands too)
If they don't even change and they are public, then they are only broadcasted to client when he joins
So I'd say impact is around zero
variables don't impact performance if they just lay around in memory
Only when you get/set them, then the size of the hashtable might make a difference depending on how far it is from being rebuilt
How is a logic impacting performance though? It doesn't have an AI, but is still created with createUnit and can use waypoints…
logic is simulated, more than objects even. It does have a AI brain actually.
but I don't think it actually does anything
ouch, so it should not be used for modules? Or are modules something else?
modules are logics yeah
I don't know why they use that
simple invisible "Static" objects would be better
such as the object CBA uses/used for its object type namespace
Ctrl+H "Logic" -> "HeliHEmpty" ^^
It's very strange considering that logics are used in BI code sometimes
in BIS ambient anim code for instance
Every module is one, and yeah I was about to reference ambientAnim too
I'd guess its legacy, as logics have simulation
and if you have a couple dozen it really doesn't matter enough
Is it possible to add markers to the drop down menu on the map and to make markers turnable?
Through mods, yes. Adding markers would be a config thing; I think ACE has turnable markers but it's a bit of a hack.
Hey everyone,
I'm trying to set the condition of a trigger to only activate when a player is NOT in a vehicle and in the trigger area so it's not accidentally triggered by someone flying over it.
The trigger will also set off another trigger and wait for the player to leave the area where it set off the first trigger.
Enter Trigger (Name: enterArea)
In the first trigger when the player gets to the area, I set this as the Condition: (isNull objectParent player) && (player in thisList);
Leave Trigger (Name: leaveArea)
In the second trigger, I have this set as the Condition: triggerActivated enterArea && !(player in thisList);
But for some reason it triggers BOTH at the same time and doesn't wait for the player to leave the trigger area. Both triggers are overlapping each other with the leaveArea trigger slightly larger.
Anyone know what's wrong?
DERP please disregard my idiocy I fixed it....
I had a duplicate trigger (leaveArea) which I copy pasted elsewhere on the map as "backup" in case I accidentally screwed up the triggers...
I deleted the duplicate leaveArea trigger and it's fixed. 
there are a couple of things you can try:
- use the 'deactivation' field to run a script when the player leaves the area again (only runs after it has been activated)
- to fix the fly-over version; set the height of the trigger to 5m or so
keep in mind that 1) only works when the trigger is set to "repeat"
Can't use option 1 since my trigger needs to be triggered only once. I'll do your second option though. Make things easier.
in BIS ambient anim code for instance
@astral dawn
They are used there to attach the unit to it and since logics have simulation, the animation will play fluently. Unfortunately BIS_fnc_ambientAnimations has never gotten a rewrite for better performance.
okay so:
- logic modules have an AI brain
- HeliHEmpty is logic
what haha
that sounds like some whacky stuff
- HeliHEmpty is logic
empty helipad is not a logic @spark turret
Ctrl+H "Logic" -> "HeliHEmpty" ^^ -> so its listed as logic?
still, locations are logic modules arent they?
no no, I meant "replace logic usage in code by empty helipad"
locations modules are logics, yes. locations themselves, no
ah now that makes more sense
Ctrl+F is search,
Ctrl+H is search & replace :p
yeah i know it just didnt klick
still, locations are logic modules arent they?
editor categories don't say much about the type of object
we could save visual editor mission performance by replacing most modules with locations 😄
do it!
a quick fix could be to disable their simulation - scripts would run, get/setVariables would work, but AI would stop 🤔
most modules are literally just scripts that execute once
you could just adjust the script and have them delete themselves after they are done
no, you could 😄
(tbh, I would place that in the low priority rn - partly because I don't use that many modules, and also because 1000s of modules is the minority)
oh man I want my emoji now 😆
meaning dadjoked or wiki'd 😁
how do simple agents differ from regular AI?
are they worth using for like a civilian crowd?
no combat AI afaik, simpler FSMs
Hey guys me again!

Goal: Have a certain screen show a random picture.
Issue: Always just show's the first option in the array (Computer_Monitor_1.jpg).
private _ScreenArray = [
"Images\Screens\Computer_Monitor_1.jpg",
"Images\Screens\Computer_Monitor_2.jpg",
"Images\Screens\Computer_Monitor_3.jpg",
"Images\Screens\Computer_Monitor_4.jpg"
];
_ScreenTexture = selectRandom [_ScreenArray];
Screen setObjectTexture [0, _ScreenTexture select 0];
Note: Object/Monitor/Screen is called "Screen"
selectRandom _ScreenArray
Does anyone know how to actually select a random one?
I am from the future
selectRandom [_ScreenArray] selects a random element out of the array [_ScreenArray]
The array [_ScreenArray] has a SINGLE element, and that is _ScreenArray if you select a random element out of 1 total elements, you can only get one element out, always the same
_ScreenTexture = selectRandom [_ScreenArray];
Screen setObjectTexture [0, _ScreenTexture select 0];
// turns into
Screen setObjectTexture [0, selectRandom _ScreenArray];
D'oh
you randomly selected from [ [tex1, tex2] ]
which returned [tex1, tex2]
and did a select 0 on it
which returned tex1
can i get the x and y size of a map with: https://community.bistudio.com/wiki/worldSize ?
it returns a simple number, which seems abstract
7680 for bukovina.
alright
wait - I don't remember
not saying anything now
lol
🔇
you could be right about the square side length
map is roughly 7.5 km on the sides
yup mapsize returns the side length of the square map in meters. 15360 for chernaus.
@winter rose care to update the wiki?
cool beans
how do i stop markers or location symbols from scaling with map zoom?
i found a solution that adjusts markers scale to zero out the zoom level but that seems performance heavy
Has anyone got any experience with Sarge AI, or had it working recently, I'm trying to drop it into a scenario but it keeps throwing up "Undefined variable in expression" Errors, I'm asking here as the author seems to have dropped off of the forums and Github
@spark turret KillzoneKid is your best bet. AFAIK there is no eventhandler for map zoom change so a loop makes sense.
actually KillzoneKid used draw eventhahndler
That shouldn't be too bad then performance wise
Easy solution woud be to only resize the markers when the map is opened, not every frame
Or have like a user action available on the map screen that runs the resizing function at the players discretion
well i dont need super fancy markers, small area markers will do i guess
they dont scale by default
so it puts me at 8 fps lol
it should only do resizing if you change the zoom, meaning lag spikes but overall fps staying same
I am looking for a way to detect if the string content is a number (without any letters mixed in). So for example:
"3" //This is needed to return true
"b3c" //This is needed to return false
"banana" //This is needed to return false
I am having trouble coming up with suitable ideas. typename will obviously only return "STRING" so its a no-go. parseNumber will convert any letters mized in into numbers as well which I do not want. call compile cannot process anythign random like "b3c" so its useless. Any tips will be appreciated.
parseNumber
str parseNumber _x == _x
"3" -> parseNumber -> 3 -> str -> "3" -> "3" == "3" -> ✅
"3abc" -> parseNumber -> 3 -> str -> "3" -> "3" == "3abc" -> ❌
"b4nana" -> parseNumber -> 0 -> str -> "0" -> "0" == "b4nana" -> ❌
might cause issues with numbers with many decimal places, depends on what input you expect
or splitString, remove all numbers and if there's stuff leftover, its wrong.
_x splitString "0123456789."
"3" -> []
"312.34234242" -> []
"3242342.31432 abc" -> [" abc"]
array not empty, its not a number
The first apporach has a problem with zeroes if one is the first character
str parseNumber "0a" == "0" // will return true
No it won't
My code will do
str parseNumber "0a" == "0a"
but the str only returns "0" which is != "0a"
Oh yeah sorry my mistake
Doesn't parseNumber only return the first occurrence of a number in the string? (as stated on the wiki) or has this behaviour been changed?
Hello,im a noob when it comes to any sort of scripting and i hope that you guys could assist me with your knowledge 🙂 Im trying to trigger a show/hide module by interacting with an npc.Is there a way to use the addAction with this or do i need a proper script?
although BIS_fnc_parseNumber seems do the job to identify numbers (even when stringified)
That is actually technically true, although its is looking for a number, string, code or config. The only problem with that is my aversion of having unnecessary errors in my logs.
BIS_fnc_parseNumber was made for a different purpose
BIS_fnc_parseNumberSafe does that splitString trick I mentioned above
BIS_fnc_parseNumber won't do the stuff mentioned above, it will just error
@arctic lake The module only hides the unit models and disables simulation. You are better of using enableSimulation/enableSimulationGlobal and hideObject/hideObjectGlobal commands.
@wet shadow I set up my whole mission with the modules since im doing a "wave defend" type deal😅 .My hope was that im able to talk to an npc to start the whole thing(wich is to trigger the show/hide module that sends the first wave in).And im sorry if this is not the right place to seek help for this kind of thing.
Upon recommendation, bringing this discussion here: is it possible to make ammunition that tracks infantry?
Basically, if I can just get a rocket to track infantry, that would be good enough, and I can make all of the other adjustments there...
Yes you would.
Here a script I used as inspiration for my own homing missiles.
https://forums.bohemia.net/forums/topic/218830-script-cruise-missile/
Let me put it this way, I want to be able to shoot smoll rockets moving at barely 70 m/s, fires at about 500rpm, and tracks infantry targets
And use it as a primary and/or secondary weapon
And they will be ponk.
@arctic lake You can't easily interact with editor modules while in-game. Hence the scripting commands instead.
@wet shadow So then how do I make that work?
Its an example mission, not sure what else to tell you.😅
Worth mentioning:
(^this guy is a noob^)
So I should ask instead, How do I Use it in the first place
That was just an example of user made homing script. Making a custom weapon config is far more difficult task.
I've actually got some experience with the latter though.
I can pretty much make everything I mentioned here:
Let me put it this way, I want to be able to shoot smoll rockets moving at barely 70 m/s, fires at about 500rpm, and tracks infantry targets
And use it as a primary and/or secondary weapon
And they will be ponk.
With the exception of how to make the rounds target infantry
Assuming you dont want to make a whole new projectile I'd use a 'fired' evenhadler to do whatever, in this case spawn the rocket when firing.
That's why I went to #arma3_config First! xD Then they told me to go here!
And actually, I will be making a whole new projectile
Yes well they did not quite understand what you wanted
Projectile matters very little
Yes well they did not quite understand what you wanted
Fair.
The config of ammunition and weapon define the flight characteristics
Yeah. I just need to figure out how I can get weaponLockSystem to lock onto squishy smoll bits of flesh.
Any way to remove the bullet points from the hintC command when using the 2nd syntax?
Or an alternative way to achieve an similar UI without the bulletpoints but with an continue button?
I want to use structedText btw, so first syntax isn't available.
instead of using an array on the right, simply use a string with <br /> for linebreaks.
so something like this:
_texts = [
"some structured text",
"more text"
];
"title" hintC (_texts joinString "<br />");
It would still show the first bullet point
That's what I'm trying to get rid of 😛
Hi all, can I get some help on a simple script i'm working on but I'm a noob so having trouble. How do params work? Let me explain further. I have a trigger set up and in it I have an addaction that runs a script. This script is supposed to teleport the player using setPos to a marker whose name I want to be able to control as an argument in the addAction. Now, I don't know how to use addaction properly to set that argument and I don't know if my script is setting the params correctly
I can paste my code if needed
You should to paste
this in the trigger
player addAction ["test TP", "teleport.sqf", "marker1"];
this in the script
params [_destmarker];
player setPos (getMarkerPos _destmarker);
without the '
Check pinned message to formatting
channel description to find out how to properly do formatting
params takes a string in the array, you are not giving it a string, you are missing the quotes
addAction doesn't pass the marker name directly, arguments are the 4th element, not the first. See here https://community.bistudio.com/wiki/addAction
so, "_destmarker" instead?
He meant not argument
params ["","","","_destmarker"];
player setPos (getMarkerPos _destmarker);
since you don't need _target, _caller, _actionId leave them empty.
Seems fine
Also the reason we're leaving the 3 empty ones is cause addaction already has params built in, correct?
is it an singleplayer mission?
...Oh, wait isn't
make sure trigger is not only server executable, should work then
I thought 4th element was priority?
huh? what does that mean?
Also the reason we're leaving the 3 empty ones is cause addaction already has params built in, correct?
no, its because you want the 4th argument. if you leave 3 empty, the next one will be 4
Yeah, that's what I meant
And I misunderstood thinking elements were the things in the syntax
params just grabs values out of _this, what _this will contain depends on what calls that code and what it passes to it
in this case _this grabs values from addaction?
So _this select 1 would return player?
Sorry if these are stupid questions this is my first foray into code of any sort
it would return the caller so in a way yes.
Yes, exactly. Thank you!
_this doesn't grab anything. Its just a variable.
addAction sets _this, _this is just a variable, usually an array that contains parameters that were passed to a function
addAction is passing 4 parameters, that it puts into _this variable, that you can then read
Got it, thank you
well _this is the standard variable used to access values from the script.
https://community.bistudio.com/wiki/Magic_Variables
look up the others, they come in quite handy
in C#, continue
in SQF, wrap with if
if (true) continue {}; ?
i think you mean wrap the whole code into an if statement as you cant skip
yes
continue?!
THERE IS NO CONTINUE IN SQF
if then continue
for "_i" from 0 to 10 do
{
if (_i != 3) then {
// do stuff
};
};
yeah that works.
umm so for locations, setVarialbe doesnt have a public? boolean. are they public by default then?
it has
it throws an error if i give more than 2 values
Syntax:
varspace setVariable [name, value]
Parameters:
varspace: Namespace, Object, Group, Team_Member, Task, Location, Control, Display - variable space in which variable can be set
remoteExec
oh cmon really
you can make a ticket on the #arma3_feedback_tracker
and maybe have it next patch… or the other
so Locations are indeed local, therefore no "public" thing available
no remoteExec for you btw
?
you cannot have any public thing related to locations, since they are local and not shared over the network
yeah i need to remoteExec the locaton creation as well
if you do sqf [location1, ["myVar", 42] remoteExec ["setVariable"]; your client won't know your location1 at all
and you would also target different objects, sooo…
why do you need public vars?
Can make a script function, that takes some kind of descriptor and varname and value.
remoteExec that, use descriptor to find proper location on clientside and set variable onto it
well im gonna move to dummy objects. there is absolutely no advantage in creating local locations if i can just use a global helipad or sth
i just use them to store data
How would I go about making a simple script which deletes dropped inventory after a certain amount of elapsed time?
I think you can do that with the garbage collection system in eden without having to do a script
Anyways, how can I have a bar gate to be set as open when the game is started?
Anyway_, look around animationSource @spare mauve
(and animationNames)
@spare mauve If you use 3den enhanced, you can do that with the Attributes option on right click.
setVariable does have an optional public flag
Alternative Syntax
Syntax:
varspace setVariable [name, value, public]
(and I know it's not just on the wiki because I've used it myself)
@hallow mortar yes, he meant with Locations
Sorry I can't check now. Is it possible to use setPos kind of commands on locations?
@astral dawn setPosition
Sets the position of a location.
Hmm yes how did I not infer it from function name 🤔
Thanks Lou
function? which function?

