#arma3_scripting
1 messages Β· Page 775 of 1
That will probably work, but I want to know what I'm missing exactly
Just found a way to reproduce it somewhat reliably, thought maybe getClientState will return something, but nope its at proper value at the moment of cutRsc
["getClientState","BRIEFING READ","getClientStateNumber",10]
If game loads while not focused, findDisplay 46 and PreloadFinished conditions pass yet cutRsc does nothing π€
Does it change depending on whether the game is set to pause when unfocused?
Testing as MP listen server so it doesn't pause.
["player",C Alpha 1-3:1 (Sa-Matra),"player == player",true,"local player",true]
```at the moment of failure
That's with the game focused as well?
probably everyone just throws in a short sleep and moves on :P
sleep is like duct tape lol
Ideally you understand exactly why you're using it, but I have no idea what cutRsc's dependencies would be.
So, after more investigation it turns out it wasn't cutRsc but addMissionEventHandler ["EachFrame" getting removed thus my loading waiting stopped. Trying to figure if its because of my mess up.
hello, ive been told there is a script to disable the alt click on map to teleport function?
Yes, its my mess up, loading event handler got removed after other stuff got loaded, it didn't check if display stuff got done, so if I started the game unfocused everything but display stuff loaded and loading each frame got removed.
Sorry for false alarm, cutRsc is realiable after findDisplay 46 after all
not guaranteed, but try this in e.g init.sqf:
if (is3DENPreview) then
{
onMapSingleClick { _alt };
};
Does anyone use string in or find with a search pattern that is longer than 80 characters?
if yes whats the usecase?
Are config classnames allowed to be longer than 80 characters?
Yes but I don't think thats common
I guess that'd be the _string in _array form for us anyway.
_x addEventHandler ["Dammaged", {[_this select 0]; this spawn {
//code
sleep 1;
};
}];
} forEach vehicles; ```
how do i make this event handler in scheduled environment ?
its not working
Not sure if strings are limited, but more of a silly idea: use a string as some sort of array and use find/in for your delimeters?
So you can store a long string and in an array and pack more data into it
Similar to storing json data into a database
Specifically asking if someone is using in or find to search large strings for a substring thats longer than 80 characters.
if anyone is doing that in their scripts
yeah copied it wrong, still not working even with the bracket
Well, this spawn { } is also wrong. Maybe _this but it's not clear what you're trying to pass to the spawn.
im trying to pass the EH investigator i think
my main question would be "why 80" π
{
_x addEventHandler ["Dammaged", {
_this spawn {
params ["_unit", "_selection", "_damage", "_hitIndex", "_hitPoint", "_shooter", "_projectile"];
// do what you like with those
sleep 1;
};
}];
} forEach vehicles;
that did it thanks :^)
what number for finddisplay should I use to get the inventory display?
player addEventHandler ["InventoryOpened", {
params ["_unit", "_container"];
with uiNamespace do {
_display = (findDisplay 602) createDisplay 'RscDisplayEmpty';
_RepackMagazineButton = _display ctrlCreate ["RscButton", 1600];
_RepackMagazineButton ctrlSetText "Repack Magazines";
_RepackMagazineButton ctrlSetPosition [0.448493 * safezoneW + safezoneX, 0.742 * safezoneH + safezoneY, 0.0669591 * safezoneW, 0.033 * safezoneH];
_RepackMagazineButton ctrlSetBackgroundColor [0,0,0,1];
_RepackMagazineButton ctrlSetTooltip "Repacks Magazine";
_RepackMagazineButton ctrlAddEventHandler ["ButtonClick",{
}];
_RepackMagazineButton ctrlCommit 0;
};
}];
GUI doesn't show up
IDD for the menu is correct 602 but the menu isn't open on "InventoryOpened" event yet, only much later
sleep time
Its probably tied to animations or something, use waitUntil instead
what condition, isNull display?
!isNull findDisplay 602
You can have both: waitUntil {sleep 0.01; !isNull findDisplay 602}
Also you'll need to spawn
yeah of course
I just wanted to make sure if its isNull
thanks
I'd suggest to use each frame EH though, so your controls don't appear with delay which looks ugly
nah waitUntil without sleep is better in my opinion
we are stretching it too much with eachframe lol
Up to you
IDK everytime I leave it up to me I end up getting STATUS_VIOLATION
/s
Check out my custom killfeed 
https://steamuserimages-a.akamaihd.net/ugc/1885333626043959281/D064BD4A3CC9FD1DEE7D66E4780DD92304A50AA4/
Sweet.
Wish we could force control to choose best mip to fit size though, resized 0 mip of a big picture to small size always looks ugly
Or enable prettier resampling algorithm where needed
I honestly don't like the enemy player thing
Its test lines
Who can help...
I need to add a 3rd side to the victory, resistance
What I have now:
[east, west]
} else {
[west, east]
} params ["_winner", "_loser"];
["SideLost", false] remoteExec ["BIS_fnc_endMission", _loser];
["SideWon"] remoteExec ["BIS_fnc_endMission", _winner];```
Resistance allies with Blufor but don't have Respawn, there are two units with one life. I need that when the blues run out of tickets, they lose together with the blues, and the reds win, and vice versa, if the reds run out of tickets, then the blues and greens win.
if(_winner == blufor) then {
["SideWon"] remoteExec ["BIS_fnc_endMission", independent];
} else {
["SideLost", false] remoteExec ["BIS_fnc_endMission", independent];
};
``` add to the end
or
if(_winner == blufor) then {["SideWon"]} else {["SideLost", false]} remoteExec ["BIS_fnc_endMission", independent];
```for a one-liner
This post was made by blufor, opfor, independent gang
private _logo_width_pixels = _logo_width / pixelW;
_ctrl_logo ctrlSetText (switch(true) do {
case (_logo_width_pixels > 256): {"i\logo512.paa"};
case (_logo_width_pixels > 128): {"i\logo256.paa"};
default {"i\logo128.paa"};
});
Poor man's MIP selector 
Nice!
Too bad I'm civilian
@spiral zealot there might be a mission EH for unit spawned, and you can remove items in there
What is eh?, and yes I can manually remove maps from every unit, but when I'm spawning in 100 units π
what is the problem with 100 units?
I mean, scripting does that for you ^^
EH = Event Handler
Oh, sorry to say but I have no idea how to use the eh
no probz! we may help π
so are your units spawned dynamically, from Eden only, or both? Are they spawned only once or randomly across the mission duration?
I spawn units in my ops both in zeus and Eden editor.
I'm not sure what the best solution to this issue is, I guess I just don't want enemy AI to have maps.
I'll check one thing (I'm on mobile)
No rush, just ping me whenever you have an idea) thank you
I have, but won't be able to code on mobile ^^
you can use a single line of script to remove the map from Eden-placed units, then use an event handler for Zeus-placed units π
I call for the sympathy of other users for this!
By the power of friendship! \o/
Whats the EH Lou?
CuratorGroupPlaced
and maybe CuratorObjectPlaced, to be confirmed
just the group should be fine
And then getting the units of the group and removing their maps?
yesh please :3
Ill give it a shot, one sec
this addEventHandler ["CuratorGroupPlaced", {
params ["_curator", "_group"];
[
_items = assignedItems _x;
_x removeItem _items select 0;;
] forEach units _group;
}];
I think this would be sufficient for ai placed in zeus
correct
idk what the eventHandler itself is supposed to be attached to though, the wiki doesnt say
Maybe the curator module or something
yes
(getAssignedCuratorLogic player)
but how will he run the script?
oh well
is there a command to get mission objects in a marker?
i dont really want to use allMissionObjects if I can help it
Hey @spiral zealot We've got a solution to your removing maps from zeus placed ai
yeah
?
what is the final code
I was gonna ask some more details
I think he should just place this in the curator module init
Worth a shot
@spiral zealot Try adding this to the curator module's init and see if it works
hmm. does https://community.bistudio.com/wiki/nearEntities work with placed mission objects (i.e. things that may be of type HOUSE)?
nearestObjects?
nearestObjects or nearEntities?
does _pos nearEntities ["House", 150] not work?
seems the answer is no
yes i tried it
Neither of those will get you objects that are apart of the map, but both should give you objects placed in eden or in zeus
nearObjects doesn't work, let me try nearestObjects
what
nearObjects isnt a thing
nearestObjects should get you it
It wont get you a house thats apart of the map
nearestobjects also doesn't get me everything
damn
Use nearestTerrainObjects
yeah
dont want terrain houses
was about to suggest that
only placed
ah ok
Have you confirmed that _pos is correct, and maybe try capitalizing HOUSE
if the house is 50 meters for example
any ideas on this one: if I do this [typeof cursorObject, cursorObject call bis_fnc_objecttype] while looking at this water source I get this: ["Land_Water_source_F",["Object","House"]]
nearest objects scans for center position
but. if I try to do nearestObjects [player, ["House"], 200];
so you should do radius = distance that you want + 50
when I am right next to the water source
I only get the slide that's next to it: [1b647dceb00# 7: slide_f.p3d]
Its possible that the actual waters object center is far away and wont read with nearestObjects, but when looking at it the bounding box is used and therefore would return it
i dont see how, I'm right next to it
How big is the body of water?
yeah try
yes this works: nearestObjects [player, ["Building"], 200];
also works w/ nearObjects
sorry, what does Curator Module's Init mean?
when you double click on the curator module in eden editor
really odd. I figured that out by looking at the objects in the config viewer btw and seeing what they inherited from. oddly only the slide inherited from "House"
the others inherited from "Building" but not "House"
weird
yeah I expected that lol
is this the build menu thing you are working on?
sorry i have no idea what the curator module is.
Ok so
You have a player placed down in the eden editor right?
The only way to access zeus is if you have also placed down a zeus module and linked it to the player. Have you done that?
yeah of course
i can access zeus no problem
ok, so double click on the zeus module
Tell me, I need that in the trigger it would be impossible to shoot from equipment, in my case it is a ZSU air defense system...
How can i do this?
I'm interested in such an option, so that when you press the left mouse button, the ZSU would simply not be able to shoot while in this trigger.
yes
paste the code I wrote above into the large "init" field
and then just press ok at the bottom somewhere
alrighty, and what will this do?
It makes it so that when that zeus places a unit down the map will be removed from its inventory
Havn't gotten to that yet. Lou says a single line of code can be used, but I cant think of how to execute it without adding it to every init field. Or running a similar script to the one I just wrote at the start of the mission
alrighty, anyways thank you sm!
np, let us know if that code doesnt work
kind of related, this is to make it so that players building humanitarian buildings get something from those being built
possible to have subtitles while using https://community.bistudio.com/wiki/BIS_fnc_playVideo ?
You could remove the ammo or disable left click, I don't know how to make the weapon not fire
allUnits I guess
ya
Of course, its just a RscPicture that engine renders the video to
You can have any UI over it
Hacky SQF:
["A3\Missions_F_EPA\video\A_in_intro.ogv"] spawn BIS_fnc_playVideo;
0 spawn {
waitUntil {!isNull(uiNamespace getVariable ["RscTitleDisplayEmpty", displayNull])};
private _ctrl_subtitles = uiNamespace getVariable ["RscTitleDisplayEmpty", displayNull] ctrlCreate ["RscStructuredText", -1];
_ctrl_subtitles ctrlSetPosition [
0,
0.5 - 0.05,
SafeZoneW,
0.1
];
_ctrl_subtitles ctrlSetFontHeight 0.1;
_ctrl_subtitles ctrlSetStructuredText parseText "My subtitles here!";
_ctrl_subtitles ctrlCommit 0;
};
Probably can be done better through scripted events as BIS_fnc_playVideo does
[missionNamespace, "BIS_fnc_playVideo_started", [_videoContent]] call (missionNamespace getVariable "BIS_fnc_callScriptedEventHandler");
```but you might as well make your own function.
πββοΈ
May I ask you?
Sure
I need that in the trigger it would be impossible to shoot from equipment, in my case it is a ZSU air defense system...
How can i do this?
I'm interested in such an option, so that when you press the left mouse button, the ZSU would simply not be able to shoot while in this trigger.
Pretty difficult task to be honest
Easier solution: Delete projectiles when you fire inside trigger: You'll be able to fire, spend ammo, but nothing will happen
Medium solution: Delete weapons on trigger enter, add them back when you leave the trigger
Hard solution: Use new actionKeysEx command to get all controls set combinations for firing and handle them with displayAddEventHandler (not sure if possible completely)
You may ask quiksilver
He has done something like that
Oh, there is also ProtectionZone_F and ProtectionZone_Invisible_F which are objects that you can go through but they stop projectiles.
Again, you'll be able to waste ammo
Quiksilver has Invade and annex mode
He has has a safe zone where you can't fire
Wonder how he did that, probably through display event handlers
I'm too lazy and just do projectile deletion on Fired
Yeah pretty sure
I hope I'm not pinging you with replies
All good
doesn't that have some hang time between weapon fire and projectile deletion?
No
No, you can delete projectile right inside the event handler
I thought there was a frame of delay so bullets have a bit of travel?
Just make sure its real one and not network fake one
Nope
It fires as soon as the projectile is created
If I recall correctly that is
Oops
Corrected a mistake
Forgive me dear Artisan foods maker
I might be thinking of my own scripts being slower than deleteVehicle alone
Actually I don't think network shots even have a entity handle? Don't recall the details.
Well network projectile are just effects
Not a real object
Calculations and all that type of stuff is done locally
IIRC slow shots (missiles and such) ones have null object in the EH attached to remote entity, don't remember how remote fast shots are handled.
you probably can just deleteVehicle whatever is being provided and you're good
display event handler is probably the best way for the original problem imo
Yeah I can't tag Quiksilver for some reason
It's probably not rocket science anyway to get it to work how mfive wants
Hm...
My real confusion is how to override fire action
You can't override actions but you can override keys
And how will you do that?
Here is what I found
But I didnβt manage to remake it for a trigger, namely when not the player himself, but the ZU transport is in the trigger.
if ({(_this select 0) distance getMarkerPos (_x select 0) < _x select 1} count SAFETY_ZONES > 0) then
{
deleteVehicle (_this select 6);
titleText [MESSAGE, "PLAIN", 3];
};
}]; ```
If anything, shells are not a problem. They can be recharged, we have such an opportunity.
I don't really understand scripts, but I can edit small things. But I can't handle it. I'm trying to convert it to trigger, but it doesn't work for me.
I don't recall if mouse has a key dikCode but yeah that probably works, you wouldn't want players to get around it by remapping though
So add both
KeyDown and mousebuttondown
https://community.bistudio.com/wiki/actionKeys I think you can grab it from here?
Yes but what I meant is
How do you not make it fire
Like in Quiksilver invade and annex
If you press it nothing happens
UI event handlers can override keys used for actions
Looks like MouseButtonDown can't override mouse actions
Lovely
I think killzonekid wrote a guide on overriding mouse? Might have been someone else
I think the way quiksilver done it is through addaction
Hacky solution with invisible addAction
So i was correct
Lol
yeah that must be the ticket
That's one less loose end
Hmmm i'ts nice
Thanks to. But how do I use it correctly in a trigger? I need not all players to be able to shoot, but specifically the crew of the anti-aircraft ZSU, and only while inside the vehicle.
Edit the condition parameter of the addaction
You can also add/remove the action with getIn/getOut event handlers on the vehicle
Nah
Not needed
It will be invisible outside the trigger or outside the vehicle if he does the condition correctly
Wouldn't it be more efficient to remove the action entirely instead of testing a condition the whole way through?
I honestly haven't used addaction conditions
Idk how the action checks the condition tbh
If it loops it or other ways
But regardless he has to have condition for the addaction to check if its outside the trigger
So might as well add if player is in the ZU
If action is added to player, condition is evaluated all the time.
might be able to get away with a lazy eval approach
Remove action when ZU leaves trigger...
Or, delete if ZU is in trigger but the player has left ZU
Yeah
this AND (ZSU_1 in thislist)
Condition
you can just set the zsu as the trigger owner
You can write a function to remoteExec the addaction on the crew
and store the id for removal locally
This is too hard for me...
f
Lol
Yeah I know its inefficient
But its not like going to kill your fps
You must have a really hard to evaluate condition for that or maybe lots of actions
Except If I make it so that the code that returns the condition in the addaction locally spawns a submarine
That will tank it
- spawn submarine
- check if submarine in trigger area
Ideal method
most efficient sqf script
if (_ZSU1E == (vehicle _ZSU)) or (_ZSU2E == (vehicle _ZSU)) then { ...
Am I going in the right direction to check if the unit is in the vehicle?
ZSU1E - unit variable name
ZSU - vehicle variable name
No
lol
Do uno reverse
What is it like?
_ZSU == (vehicle _ZSU1E)
Oh, I messed up where the unit should be?
Yes
Ok, thx
if (_ZSU == (vehicle _ZSU1E)) or (_ZSU == (vehicle _ZSU2E)) then { ...
Ok.
Now I need to run fire.sqf on one player or two (that's the crew) who are in ZSU.
But I do not quite understand how to run it for them.
@lapis ivy i went back and figured out a clean way to do it if you would like the code
So they canβt be like 512x256?
I would like to...
Will it work in multiplayer?
yeah, only works for one vehicle as-is
and the trigger is a little messy actually but
works in my testing
ok
no
Bruh
why don't you go to photoshop and make it
Thatβs so dumb
I can but what if I donβt want a square
no
I mean I guess but
you must have a square dear player
Any idea how the w and h values work?
Like why is h 0.5 not half of the original image
Itβs basically impossible to make a proportional control
I would rather use safezone
basically it scales up or down the GUI depending on the resolution
so if you have a gaint box in a 1980x1080, people with 480p will still see it as a gaint box
first two blocks have to be defined as functions and last one is the trigger
Hmmmmβ¦
Right but like
As far as sizing goes how do I know what to set values to to make it proportional
if (!isNil "art_safeZone_actionID") exitWith {};
this will cause issues if the player dies and respawns, so either set that to nil when the player dies or just remove the line since it's a redundant safeguard
in the second function with the first if statement
Using arma dialog creator
ok, thanks. i check it
wait i thought of something I did wrong
well idk in that case
average GUI editor enjoyer here
nevermind it's fine
Like how am I supposed to know what safeZoneX + safeZoneW * 0.41875 means
A bit left of center? :P
"rocket_fire_stage_1_hide"
I want to run this animation on a simple object
how would I do that?
@drifting portal Is it bad to put onMouseButtonDown events on pictures or should I put an invisible button over top the image?
what are you trying to do
then try 0 Β―_(γ)_/Β―
Phone menu buttons
The buttons have icons
But idk if I should put an invisible button over the icons or
Just add the event directly to the pictures
same thing
well
is there a way i can get ai helicopter to land on carrier
you should have set the button background to the icons themselves
but now just place invisible buttons
well
that was a misclick
I think try putting an invisible helipad on the deck?
then give it a land order on that
Oh wait lemme try that
Man it didnβt workβ¦ π
the chopper tapped the deck and flew up lol
well I don't know then
I had to raise the helipad level to the deck and it worked. nvm that was my bad
alright lol
Now that u got them to land ima see if i can get them to pick up units and drop them off
@drifting portal Any idea why my invisible buttons are like..pulsing when im not hovering on them?
Because you clicked them?
_light_emitter_0 = "#lightpoint" createVehicleLocal getpos this;
_light_emitter_0 setLightColor [1,1,1];
_light_emitter_0 setLightAmbient [1,1,1];
_light_emitter_0 setLightIntensity 5000;
_light_emitter_0 setLightUseFlare false;
_light_emitter_0 setLightDayLight true;
_light_emitter_0 setLightAttenuation [15, 4, 5, 0];
_pos1 = this modelToWorldVisual (this selectionPosition "light_1_pos");
_pos2 = this modelToWorldVisual (this selectionPosition "light_1_dir");
_light_emitter_0 lightAttachObject [this, (this selectionPosition "light_1_pos")];
_light_emitter_0 setdir ( _pos1 getdir _pos2);
am I doing something wrong? this is in an init of a light object,
setLightDayLight true seems to not be taking effect?
I take it you've confirmed that it does work at night?
Yep
Bright as a flashbang at night
What's arma stable version number?
A3 stable is 2.08, devbranch 2.10
ok thx, was googling but for some reason it is hard to find (I'm in prof)
Is there a way to remote execute serverCommand from a client script to the server?
I tried like this but not too sure if my syntax is correct:
"xyzxyz" serverCommand format ["#kick %1",_playername];
I know that running this command in debug and executing on the server via debug menu works but not when running via a script loaded in the mission.
Have also tried this but is not returning any Boolean value or kicking:
["xyzxyz"]remoteExec [_msg, 2] ```
wrong format, see https://community.bistudio.com/wiki/remoteExec π
serverCommand is not even mentioned in your second code
"xyz" serverCommand format ["#kick %1", _playername];
// becomes
["xyz", format ["#kick %1", _playername]] remoteExec ["serverCommand", 2];
Still confused about this one
Is there a way to stop game from ending on respawn=0 when everyone dies?
Nevermind, having respawn=0 and dying removes lobby slots
Yep which is what confused me about your question sir
If you want
Make it the custom respawn mode
What I want is: Player dies, nothing happens.
But without a respawn point when someone spawns
They remain in control of their dead body and stock scripts do nothing
And lobby slot doesn't get disabled if they rejoin
nothing, just remain as dead body
Spectate then
Not spectate but nothing
I guess your best way is a custom respawn mode without a respawn point once one dies
wont that just respawn you on your body?
I don't want any of the stock menus
Darn
You die and that's it, player is dead body
In other words, I want to disable any of the pre-scripted and pre-defined death logics
Yeah you can activate spectate if that's what you want
^
Well
You know it kinda boring staring at a dead body right?
I think you can try making a cut scene where they get buried
Or something
OnKilled.sqf
EDIT: onPlayerKilled.sqf
Can't you just use that
To create an agent like a bird
Selectplayer that agent
Then create a camera on the player's body?
perhaps a "handleDamage" handler to override fatal damage combined with a ragdoll script?
I don't know how you would get the player to stay ragdolled but the camera will stay on the player and you can disable ui inputs
why disable ui input?
if someone wants to disconnect he will have to alt + f4
I didn't say all ui inputs
I need proper unit death
The main goal is - have game don't do anything once player dies
then check this?
No spectators, no respawns, no nothing
thing is
I think you have to do some workaround for this
I don't think there is a "proper way"
I use that (onPlayerKilled.sqf)
was it something similar?
yeah
yeah I think its way easier that way
can you selectPlayer after the player is killed?
yes
copy from my onPlayerKilled.sqf: ```
_group = createGroup civilian;
_newPlr = _group createUnit ["B_Soldier_F", getmarkerpos "rp", [], 0, "NONE"];
selectPlayer _newPlr;
_newPlr setPos [0,0,1000];
_newPlr hideObjectGlobal true;
_newPlr enableSimulation false;
_newPlr allowDamage false;
That's what it uses until player chooses new teammate to control
Yeah in my case I would prefer an agent
Creating a segaul
never used an agent...
I always turn people into dogs in zeus
And make them play as dogs whenever they annoy me
hello! i need some help please
im using this script to make an object loadable, and its giving me the error "missing ;"
seems more suitable for #arma3_config
Am I blind or there is no command to return all 3DEN layers? (while in editor)
(Not getMissionLayers)
https://community.bistudio.com/wiki/all3DENEntities contains layers
Oh, thank you.
Is there a better way to do it? remoteExec xD
if (!(isNull _flashlight)) then {
//player setVariable ['flashlight', objNull, true];
[player, ['flashlight', objNull, true]] remoteExec ["setVariable"];
[[getMissionPath "sounds\flashlightButtonClick.ogg", _target]] remoteExec ["playSound3D"];
[_flashlight] remoteExec ["detach", player];
[_flashlight] remoteExec ["deleteVehicle", player];
} else {
[[getMissionPath "sounds\flashlightButtonClick.ogg", _target]] remoteExec ["playSound3D"];
_flashlight = "#lightreflector" createVehicle position player;
[_flashlight, [70, 40, 10]] remoteExec ["setLightConePars"];
[_flashlight, [5, 4, 4, 0, 6, 40]] remoteExec ["setLightAttenuation"];
[_flashlight, 90] remoteExec ["setLightIntensity"];
[_flashlight, [1,0.81,0.62]] remoteExec ["setLightAmbient"];
[_flashlight, [1,0.81,0.62]] remoteExec ["setLightColor"];
[_flashlight, true] remoteExec ["setLightUseFlare"];
[_flashlight, 0.5] remoteExec ["setLightFlareSize"];
[_flashlight, 500] remoteExec ["setLightFlareMaxDistance"];
[_flashlight,[player, [-0.05,0.04,0.2], "head",true]] remoteExec ["attachTo"];
[_flashlight,-15] remoteExec ["setDir"];
[player, ['flashlight', _flashlight, true]] remoteExec ["setVariable"];
}
_flashlight = "#lightreflector" createVehicle position player;
it will only be created on the player where the code is being executed
instead of all the remoteExec mess
why don't you do something like
[[],{
//code that runs locally (without remoteExec)
}]remoteExec ["spawn",0];
OR
You can make it into a function and remoteExec that function (which is way better)
because a function is more network-friendly than sending code over the network like that
fear me π
How to create shortcut for addAction
"Left Ctrl+W", // shortcut or i need to use DIK_KeyCodes
_x addEventHandler ["GetIn",{[_this select 0];
hint "Test";
_x removeEventHandler [_thisEvent, _thisEventHandler];
}];
} forEach vehicles;```
how does removeEH work ?
am still receiving the hint every time i Get in
https://community.bistudio.com/wiki/removeEventHandler
_x removeEventHandler ["GetIn", 0];
I think this is what you are looking for
hits can also be removed by using
hintSilent ""``` but this will keep the event handler running.
I have before but it was a very niche scenario.
(Sorry for the ping, forgot to un-check the button)
for me all EHs are keeping running
you need to set 0 to your index of the addEventHandler
ok i will give that a try though i think _thisEventHandler returns Index 0
_thisEventHandler is a local variable so you would have to define it yourself.
in the wiki it says they are Magic Variables
it is a magic variable it's already defined in the EH expression
ah right, this should work then{ _x addEventHandler ["GetIn",{ hint "Test"; (_this select 0]) removeEventHandler [_thisEvent, _thisEventHandler]; }]; } forEach vehicles;
bear in mind vehicles returns a lot of stuff so that loop is redundant
that worked π
though you are missing a bracket there
yeah, its just for testing, i have different code for it π
if you want to loop the event handler removal as well you need a separate forEach loop inside the {} event handler expression, in case that was your intention the first time around
since _x won't otherwise be defined
ah ok, got it π
How do I find a position in the sea/ocean?
posATL?
?
I don't want it underneath the terrain
Outside of land mass
I want to spawn a boat
In a random spot
Many thanks
is there a way to get spawn positions on the USS liberty?
how do I get coordinates relative to a model?
and then how do I translate that to worldspace coordinates?
worldToModel
vectorWorldToModel
modelToWorldWorld
vectorModelToWorld
@little raptor if i have 2 objects with names a and b how do I get b's relative coordinates w/r/t a?
is there a function for that or do I need to calculate it myself
yeah ok so I need to calculate that myself
well the calculations are being done by the game... 
note that it's in AGL format
also always use getPosWorld / setPosWorld for those commands
yeah I think AGL is what I want here anyway
since it's going to be botes
ASL changes with waves right
getposworld doesn't work, odd. Maybe it's because i'm in the editor
ah that'll do it
Still confused
They work at night but not at day
is it because they are underwater?
I'm sorry for mentioning it too much but this problem has been holding me for 3 days
did you try above water?
Nope (they do work underwater at night)
Sorry for ping too
tried now and they do too only at night
what's the locality of clearAllItemsFromBackpack?
Hello Smart people.
Does any one here think they can code a script that when ever my server side FPS hits under 10 for 60 consecutive seconds, It takes a snapshot and builds a log file for all Vics in use on my server?
Im not a rich politician, BUT I am willing to pay someone some sort financial currency. I need a starving coding student, Tag someone ya know. π
Can I post a link to my servers here @PeopleInCharge?
Probably not, They are exile servers
Sorry lots of channels, But Thanks!
@drifting portal Do you know of a way to have a control with rounded corners...?
Nope, go to gui channel
Anyone ever experience enableSimulation false just not working?
define "not working"
Its simply not disabling the simulation on an object, in particular its collision
The object is created during runtime, and only one of them exists
enableSimulation never disables collision tho
other objects can still collide with it
Man am I just dumb?
Sheesh I must be tired if I'm messing that up, I use that code all the time. Sorry Leopard, brain just skipped a beat on this one I think
well just for future reference, remember that enableSimulation only tells the engine whether it should update the object
the collision stuff is handled by disableCollisionWith and hideObject
Thankyou
Hi Chaps - I'm working on a paratrooper multiplayer mission and need some advice. I have posted my predicament here : https://forums.bohemia.net/forums/topic/239049-teleport-different-group-of-players-into-different-vehicles/?tab=comments#comment-3461983 Since its a rather quite complex script I figured it would be easier to see it in full on the Forum. Am I correct ?
Or is my teleport sqf wrong ?
are you aware that your code is missing 40-some closing brackets?
it's a bit nonsensical dude
why are you doing it by individual player instead of groups
why is JIP required?
a. no I wasn't aware - writing this from work computer bound to happen. b. Don't know how to do that c. Don't want any player who is late to the game to be teleported once they connect.
you made it so they only get teleported if they were late
ok well then I didn't understand that other post that spoke about teleporters.
I tried inspiring myself from previous posts with a similar request - obviously I was wrong then.
fn_teleport = {
if didJIP exitWith {}; //aborts if JIP
//title effect starts here
private _group = group player;
if ( _group == group1 ) exitWith { player moveInCargo plane1 };
if ( _group == group2 ) exitWith { player moveInCargo plane2 };
if ( _group == group3 ) exitWith { player moveInCargo plane3 };
//sleep then end effect
};
so group1 would be Alpha 1-1 with a variable name group1 correct ?
yes
also a couple other things
there is hardly ever any reason to individually define that many variables for units
if you're doing that chances are there's a better way
if you're writing the same line of code over and over like you did, there is almost certainly a better way
truth be told this is the first time I script for something multiplayer so its a bit intimidating.
But you are correct - I'm still learning the syntax of arma 3 and all.
I figured if I showed I tried i'd show i'm not sitting on my arse waiting for another kind soul to do the job.
oh I understand 100% you can't learn without trying
I'm glad you shared it so you don't have to work with that big ol script
essentially what you did was define in-line functions as instructions for each player's machine to execute the teleportation
Well my work is all about screening enormous pages of code so I am biased ahahah
except you defined the same function and overwrote it 45 times
fn_teleport = { if (didJIP) then { Player45 moveincargo Plane3};
and these are the only instructions that would ultimately be accessible
can I ask the purpose of the titleCut?
the titleCut is for another sqf file - I just edited it out of the post.
I want to have a fade to black and title when players are teleported
but that's another problem i think i can solve on my own
you would do that inside the fn_teleport code here
is there a chance that teleporting 45 players in one go isn't gonna crash the server? Or cause a lag ? Apologies if its a dumb question i've never done this as such large scale.
I doubt it - but I'm told that the word ASSUME is an acronym for making an ASS at ouf U and ME π
I think it's more likely that there is some brief lag/desync and then the mission will go on
but I'm not experienced with writing scripts for groups that large
Anyway thanks for the help on that.
yw
I'll add a couple notes where you can put in fade effects in the code block I posted
Sure thing - I figured the forum post would be a good pay it forward move for future research.
Huh, apparently player respawn stops loading screen for some reason 
I'm kind of outdated, but is there a neat way to do unscheduled calls from scheduled threads? Right now I'd doing hacky stuff like:
addMissionEventHandler ["EachFrame", {
removeMissionEventHandler [_thisEvent, _thisEventHandler];
// Unscheduled code here
}];
@still forum Any real reason why we can't have something like callUnscheduled <Code> to run blocks of code inside scheduled environment?
You already have it, its called isNil
Unless there is already a neat way and I'm just outdated
Thanks, outdated I am then.
Updating @meager granite: update 2 of 54, please do not turn off your PC

Sorry for another ping but I'm just dumbfounded that I didn't know about it. Is this a somewhat recent feature?
no, pretty sure since A2
I remember asking for something like this back in like 2014 and got told off that it would be against scheduler philosophy or something.
I guess they didn't know about it either.
Or I'm just ignorant to read through docs thoroughly
could use better name for it.. a new command
Yeah, it wasn't in the docs till 2017:
https://community.bistudio.com/wiki?title=Scheduler&diff=103914&oldid=103905
hello guys, I have a question regarding positions getters.
Every getter besides
modelToWorld, modelToWorldWorld, getPosWorld
works with the objects bounding box center defined by config? Or do they have their coordinates relative to box origin in one of the corners?
Im trying to find the most effective way to replace some buildings and it seems to be kind of hit or miss depending on the sloping, like it looks like the offsets become more or less according to orientation too.
Positions are either center of object, or landContact point of object
Pretty sure the model commands are all center
thank you, just wanted to be sure
anyone know where (class) the Hack UAV useraction is added ?
still clinging into this
does anyone know the reason why its not working?
Maybe it bugged
I tried it multiple times, as well as putting setlightdaylight at the last line
What else can cause such a bug?
I guess I can never do my underwater horror mission then
Make a ticket
Alright sir
if https://community.bistudio.com/wiki/Lightpoint_Tutorial can't help, then underwater or something else is an issue yeah
no even on land
have you tried just creating it on player's position for test purpose?
yes
without the attach and all that stuff
from debug on player position
nighttime?
So i am trying to put a dday mission together and i want to make the us lcvp ramp open when the boat hits the beach. I used the ifa module but that only works half the time how do i make the ramps open when the lcvp lands so the soldiers can get out and storm the beach? Using ifa mod
_light_emitter_0 setLightDayLight true; :((
it was known not working for the flare afaik (but should work for the ambient light)
_light_emitter_0 setLightUseFlare false;
light system doesn't want me to do my silly diving mission (probably game knows everyone hates diving and is preventing me from doing it)
fair guess
Hi, is there a way to add sleep pauses to this script? I don't want to execute the code before the screen is black.
cutText ["", "BLACK OUT"];
{
_x moveInCargo golf1;
_x assignAsCargo golf1;
}forEach units group player;
cutText ["", "BLACK IN"];
```#
yes, use sleep
cutText ["", "BLACK OUT"];
sleep 3;
{
_x assignAsCargo golf1;
_x moveInCargo golf1;
} forEach units group player;
cutText ["", "BLACK IN"];
because debug console runs scripts unschd
gotcha
if it's scheduled yes
if you want to run scripts schd in debug console, wrap them in spawn:
[] spawn {
cutText ["", "BLACK OUT"];
sleep 3;
{
_x assignAsCargo golf1;
_x moveInCargo golf1;
} forEach units group player;
cutText ["", "BLACK IN"];
}
his tools are based
especially syntax checker
On a different note, is anyone aware of a script where the player can select a location on the map and the player+ai squad would be teleported to this spot?
For gameplay or debug?
for debug this is fine but if you're using it for the mission there's a stackable event handler linked on that page
Quick question ya'll:
I'd like to set the hunger & thirst values manually:
Meaning I want to make the player hungry as the mission inits.
I've searched around, but I can't find any concrete way to tweak this.
Thanks β€οΈ
only at the beginning or continuously at your own float increment?
And you mean ace hunger and thirst?
{
_x setVariable ["acex_field_rations_hunger",10,true]; // Hunger 10/100 at start
_x setVariable ["acex_field_rations_thirst",10,true]; // Thirst 10/100 at start
} forEach AllPlayers;
Thank you!
I need to init this from a script?
i used from init.sqf
Thanks!
pulling my hair out with this:
["zen_common_addObjects", [[_dog]]] call CBA_fnc_serverEvent;
_dog setName ([selectRandom ["Fluffy", "Doggo", "Cuddles", "Santa's Little Helper", "Biter", "Foxer", "Boxy", "Death", "SirKillsALot"], _name]);
_dogMan setName _dog;
// If no side to be attacked are provided, dog is peaceful
if (count _attackSides == 0) exitWith {
// If dog is peaceful, dog can be allowed to have own AI
_dog setVariable ["BIS_fnc_animalBehaviour_disable", false];
};
// Turn off AI in dog
_dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
This is a snippet of code,
20:28:39 Error in expression <BIS_fnc_animalBehaviour_disable", false];
>
20:28:39 Error position: <", false];
>
20:28:39 Error Missing ;
This is the error.
If the error isnt here I can do a SQFBin
Last time I ran this code was about a year and a half ago and I thought it worked... Aparently not
what am I doing wrong here?
There is no hunger or thirst in vanilla Arma 3
Alright, now im confused. If I comment out the offending lines, I get the same error
hi Fred, how are you calling the code?
debug console
as a function or pasting straight in?
https://sqfbin.com/oconotalocemuharuraz Copy and pasting all of this
remove the comments
will remove all comments in code
or use better debug consoles
vanilla one does
mine doesn't
https://steamcommunity.com/sharedfiles/filedetails/?id=2001134086&searchtext=Better+Debug+Console This one? Better doesnt show up with anything
TBH you might as well pin that since it will be very useful
I meant for ACE
Holy Balony, this is amazing
Forgive me ignoranse fellas: I wanted to create a simple untie script where the player (p1) first has to untie himself the remove his blindfolds.
I tried to do it like this, but I am getting some errors π
[] spawn {
Private _BlindfoldRemoved = 0;
[p1, ["Remove blindfold",
{
hint "You removed your blindfold.";
p1 unassignItem "G_Blindfold_01_black_F";
_BlindfoldRemoved = 1;
removeAllActions p1;
}]] remoteExec ["addAction", 0, true];
sleep 3;
if (_BlindfoldRemoved == 1) then
{
[p1, ["Untie yourself",
{
hint "You successfully untied your hands.";
p1 enablesimulation true;
p1 switchMove "";
removeAllActions p1;
}]] remoteExec ["addAction", 0, true];
};
};
if the player has to untie himself why do you remoteExec for everyone?
I used other actions that was meant for that purpose ..
idk what you mean
if the player has to untie himself you shouldn't show the action to other players
I copied the addaction function from another scenario I had where it was operating on all players.
But yeah - I don't need this one to work on all
ok. well in this case you don't need that
just put a simply addAction in initPlayerLocal
Thanks - I will fix that - But I don't think that causing the error?
as for the problem, your scopes are wrong
yes, the problem is the scopes
the correct way to do it would be to add the other action inside the first action
Roger - I think I get it
This was a hasty script - but I should probably learn more about scopes π
Thanks for your time
How can I spawn a helicopter via sqf script and assign a variable name to this object?
_Helicopter = createvehicle [... ];
missionnamespace setvariable ["VariableName", _Helicopter, true];
If you want to delete it for example
DeleteVehicle VariableName;
Thank you. So if want to move the player as cargo into this object I would use:
player moveInCargo _Helicopter;
As soon as it has been created
Yes then true
Put that line you wrote after all of this
helicopter explodes
What do I have to use to delete the he;licopter crew?
deleteVehicleCrew
Got it all sorted
The last problem which I have is that the Heli already departs before my team could exit the chopper
It basically just lands for 1-2 sec and then departs again
Not sure why
Is it waypointed or what?
TR UNLOAD?
waypoint type.
It's the one where it unloads any AI cargo.
If you're talking about player cargo then that may not work anyway.
_wp = _heliGrp addWaypoint [_posToLand, 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointCombatMode "GREEN";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointFormation "COLUMN";
is the waypoint
how do i change it to cargo unload?
think i found it
testing it
Sometimes the land command works better since it forces them to turn off the engine, so they can't instantly take off again.
I'd also keep an eye out for 2.10 because this note was in the latest dev branch changelog:
Fixed: Helicopters 'hopping' when landing due to telling AI to disembark
my favorite ai quirk is when the pilot goes to land and utterly pranks the cargo by lifting off as they get out
tbf though I might've only seen that happen when I manually put the helicopter down on the helipad
That's one I had to deal with quite recently for a mission intro. Even using land command in addition to "LAND" waypoints it doesn't seem to be completely solved. Hopefully this 2.10 fix will clear it up.
I would suggest using waitUntil and touching ground then disabling crew AI
Istouchingground*
We have a combat landing script that has the same issue. It lands on rails with flyInHeight 0, but some helis still have a bit too much rotor speed on landing, so they can shift around a bit.
Well
I usually saw that glitch a lot in pub zeus
They land and immediately lift off
Pranking the cargo in the process
Resulting in the zeus vaporizing the helicopter and putting a new respawn point because he is too sick of AI now
at this point i just use unit capture to script qrf landings
because the ai never land with any urgency
This won't sleep, says its not allowed... is there another way to do it?
[]spawn{
testFunction = {
sleep 0.5;
};
};
Another thing, if I try and call a function inside of itself my game crashes... the actual line passes a variable into the call function
Ok with some more testing it looks like passing the variable into that recursion call is what was making it crash... I think
it doesn't even execute. how does it say sleep not allowed?
That was solely an example
because you're creating an infinite loop
well I can't say what you're doing wrong without seeing the actual code
one sec
but what you posted has no issues itself
I can't get it to replicate the crash now, jeez this has been doing it for almost an hour and now it doesnt. Great...
Going back to the sleep issue, the function is being called from an EH, would that possible contribute to its failure?
If it has sleep spawn it
I am spawning it
Please send code
_vehicle addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
[_unit] call planeKilled;
}];
[]spawn {
planeKilled =
{
sleep 0.5;
};
};
What
yeah you don't need spawn to define a function
That seems to have done it, thanks
Just don't kill too many vehicles it hurts
I am having trouble with controlling a script. Specifically, creating a and deleting a say3D sound.
My aim is to have a radio object play a default sound ("Radiostatic") that switches to a tuning sound ("Radiotuning") during a holdAction, to finally a radio message ("Radiomessage"). With the complication, that when the player interrupts the holdAction, that the default sound starts again.
This is in the init of the radio object:
radiostat = [this] spawn
{while {true} do
{(_this select 0) say3D "Radiostatic";
sleep 36
};
};
And the holdAction is:
[
radio1, // object the action is attached to
"check radio", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen
"_this distance _target < 3", // Condition for the action to be shown
"_caller distance _target < 3", // Condition for the action to progress
{
terminate radiostat;
radio1 say3D "Radiotuning"}, // Code executed when action starts
{terminate radiostat;}, // Code executed on every progress tick
{radio1 say3D "Radiomessage";}, // Code executed on completion
{radiostat =
[] spawn {while {true} do
{radio1 say3D "Radiostatic";
sleep 36;
};
}
}, // Code executed on interrupted
[], // Arguments passed to the scripts as _this select 3
14, // action duration in seconds
0, // priority
true, // Remove on completion
false // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, radio1]; // MP compatible implementation
Result is that the default sound (script handle radiostat) plays fine, and stops fine during the holdAction. But when I interrupt the holdaction, I get duplicate default sounds playing. And these duplicates don't terminate (probably because I am not tracking the new script handles).
What's an elegant way to close this?
delete the sound object
the elegant way is using functions that handle everything
//fn_loopSoundOnRadio.sqf
params ["_obj", "_sound"];
terminate (_obj getVariable ["soundScript", scriptNull]);
deleteVehicle (_obj getVariable ["soundObj", objNull]);
_obj setVariable ["soundScript", _thisScript];
while {true} do {
_soundObj = _obj playSound3D _sound;
_obj setVariable ["soundObj", _soundObj];
sleep getNumber(configFile >> "CfgSounds" >> _sound >> "duration")
};
[radio1, "Radiomessage"] spawn my_fnc_loopSoundOnRadio
I see, deleteVehicle the radio1 object? So I'd basically make and delete a dummy object every time?
Thank you
I am using custom made sounds.
sleep getNumber(configFile >> "CfgSounds" >> _sound >> "duration")```
Is there another way of getting the duration of a sound file?
add another parameter
Fair enough
params ["_obj", "_sound", "_duration"];
...
sleep _duration
just a warning: that script is not 100% foolproof if your mission already has many scripts
Because of the sleep?
no I mean the terminate part
it does:
_obj setVariable ["soundScript", _thisScript];
in scheduled environment
which if the scheduler doesn't see in time before you cancel your hold action it might never happen
a safer way would be to do it in unscheduled environment
or doesn't have to be unscheduled
as long as the script is registered before it executes
this will 100% guarantee it:
//fn_loopSoundOnRadio.sqf
isNil {
params ["_obj"];
terminate (_obj getVariable ["soundScript", scriptNull]);
deleteVehicle (_obj getVariable ["soundObj", objNull]);
_handle = _this spawn {
params ["_obj", "_sound", "_duration"];
private _soundObj = _obj getVariable ["soundObj", objNull];
while {true} do {
deleteVehicle _soundObj;
isNil {
_soundObj = _obj say3D _sound;
_obj setVariable ["soundObj", _soundObj];
};
sleep _duration;
};
};
_obj setVariable ["soundScript", _handle];
}
call as:
[radio1, "Radiomessage", 10] call my_fnc_loopSoundOnRadio
isNil makes codes unschd
the reason I put them there is to make sure that those parts in isNil happen together
Interesting. And _this:
_handle = _this spawn {
Gives the script handle? Also new to me.
e.g. :
isNil {
_soundObj = _obj say3D _sound;
_obj setVariable ["soundObj", _soundObj];
};
if you terminated the script when engine had executed say3D but before the setVariable you would never be able to delete that object
no
spawn does
_this were the parameters you passed to the function
which I'm just forwarding to the spawn
Thank you for explaining.
is there a way to increase a player's running speed?
Change animation speed I understand.
setAnimSpeedCoef 
It was a very vague memory
that's why I asked lol
There's about a dozen scripts on the forums.
knew Leo will supply me directly with it so I posted here lol
One of these days we will have to bake Leo a cake for this efforts in getting our missions and mods to work.
_cake setObjectScale 20
speaking of setObjectScale, does it not work on objects created with createSimpleObject?
It should work
if it works with anything it's gotta be those
hmm
it says simple + attached objects on the label π
Thats why im confused. I know its apparently possible to do to simulated objects with a loop, but im tying it with a simpleobject rn to no luck
what kind of object is it?
"CraterLong"
nah, its the 3d plane crater
is that its class name?
yup
I just tested calling the script with the console and it worked fine... interesting
The test script I was using calls it the exact same way
works fine
works with these too
Ahah I think I got it
If you make any adjustments to its position after scaling it, it resets
like setDir or setVectorUp for example
Basically everything that tweaks its position/direction resets the scale
I doubt position does 
with direction it makes sense
because it likely normalizes the dirs
Keyframe animation resets it for simple object as far as I know
which means scale in transformation matrix becomes 1
If thats position update?
it has everything
It sets vectors too?
position, velo, orientation
I thought there is mode to it
Where it doesn't change anything but the position
Damn
yeah position works fine
Hm
well it makes sense to have a single part function that does everything than dividing a function into parts (which makes maintenance harder)
True
Another question out if curiosity: what exactly is the reason you wrapped it inside an isNil? I thought just spawn the function is already unscheduled
spawn is scheduled
isNil is unscheduled
if you meant call, call doesn't change the environment
call in schd -> schd
call in unschd -> unschd
Oooooh
So calling a function with call inside a spawned function won't make it wait till the called function is finished?
Thanks for making it super clear for me π
as if the code was there
Aah
it just doesn't create a new "thread" (sqf is single threaded tho)
it's the perfect way to execute a function and wait for it to finish, as opposed to doing:
_handle = [] spawn ...
waitUntil {scriptDone _handle}
which is super wasteful
Ok got it. So using isNil is more comparable to asynchronous functions in JavaScript?
Or do I mix up something now
Yeah I see that
no. nothing is truly "async" in sqf. they're more like non-preemptive multitasking
a scheduled script is like a coroutine, which can be "paused"
isNil is like calling a normal function (subroutine)
Thanks for making that clear to me π€©
Im playing with the setscale thing some more, and its possible to set the scale of an object that isnt a simpleObject. Not only that, but it also retains a properish collision. Where as making it a simple object and then scaling it actually removes its collision
Very interesting. I wonder if the wiki just hasnt been updated in a long time
it can be used on non simple objects
but in some cases it might cause problems
or not work at all
A comment on the page mentions the ability to, but that is has to be every frame. But im putting it in the init of an object and it works fine
yeah I should add that it does work on static non-simple objects
I am trying to spawn a group of planes in the air.
However, I cannot get BIS_fnc_spawnGroup to spawn above terrain. Eg:
[[1792.98,5530.61,500] , west, (configfile >> "CfgGroups" >> "West" >> "BLU_CTRG_F" >> "Infantry" >> "CTRG_InfSentry")] call BIS_fnc_spawnGroup;
// on Stratis airbase
Groups always seem to spawn at terrain level regardless of Z value. Have tried getting the position of a logic or marker object.
How can this be compensated?
You can probably just setPosWorld them all afterwards
Simply setPosATL the third value for them after they've spawned?
Right.
It's suprising to me: you'd think BIS would want to be able to spawn paratroopers or whatnot. I couldn't find any previous question in the forum or Discord. I suppose I will have to do it the hard way π
not in MP
setScale won't get you the same results outside the editor
I am now having trouble setPosATL-ing them. When wrapped in a forEach:
{_x setPosATL [(getPosATL _x select 0), (getPosATL _x select 1), 200 ]} forEach units _grp;
The group will now spawn with planes on the ground, and the pilots parachuting.
I tried identifying the planes beforehand, with:
{ if (!(vehicle _x iskindof "man")) then { _veh= _veh + [vehicle _x]} } foreach units _grp;
And then using the setPosATL on the _veh array. No dice.
change veh to _veh
You're a genius! π
I'm going to change my above entry, so others can use my work to specify height above terrain for BIS_fnc_spawnGroup. Sankyoo.
for performance reasons i like to make some SP scenario on a dedicated server. is this onPlayerKilled.sqf script still possible? https://pastebin.com/Y8QnNtn3
Why do you make an array to iterate over all over again? Just do the setPosXXX in there
Using ATL is wrong
Many vanilla terrains have 200m deep waters...
Also use set to change array elements...
And in there you could use pushBack instead of +
pushBackUnique in fact
So, I use a fairly simple teleportation addAction
It works perfectly for me 100% of the time. How would I modify it to both: a) select a randomized marker from a list, and b) make it so it's within a say 100m horizontal radius of the marker?
selectRandom, getPos alternative syntax π
I have a question. i'm wondering if setTriggerStatements changes the trigger condition locally to the player who run the script or to every player
https://community.bistudio.com/wiki/setTriggerStatements
local effect π
thanks
Also, im trying to find reverse to player in thisList something like
player !in thisList. may someone know?
!(player in thisList)
thanks again, didn't think of that π
is it possible to enable PIP for clients?
so that they can see the render 2 texture instead of a white picture
no
hmm
I guess we will have to fake it then
static image combination with isPiPEnabled
if enabled go ahead and run the r2t
if not show the static image
Hm any chance any of you peeps have experience with the virtual arsenal interface?
When I open the normal arma 3 virtual arsenal mission the interface at the bottom has an exit and a try option
But when I make a seperate virtual arsenal mission based on that one it only has a close option which closes the arsenal interface, making the mission an inescapable hell 
I don't know if the Virtual Arsenal mission does it like this, but you can work with the Arsenal UI (without modifying its source code) to some degree using the arsenalOpened Scripted Event Handler.
For example, I wrote the following code to prevent players from accessing certain features of the Arsenal:
[missionNamespace, "arsenalOpened", {
disableSerialization;
params ["_arsenalDisplay"];
//Disable certain buttons:
{
private _button = _arsenalDisplay displayCtrl _x;
_button ctrlEnable false;
_button ctrlSetTooltip "";
} forEach [44146, 44147, 44148, 44149, 44150]; //Save, Load, Export, Import, Random
//Override the corresponding keyboard shortcuts (all involve the Ctrl key):
_arsenalDisplay displayAddEventHandler ["KeyDown", {
_this # 3
}];
}] call BIS_fnc_addScriptedEventHandler;
Hm interetsing, thanks for the info 
I am trying to get a trigger to detect and place markers for specific building types:
Land_Cargo_Tower_V1_No1_F Land_Cargo_Tower_V1_No2_F Land_Cargo_Tower_V1_No3_F Land_Cargo_Tower_V1_No4_F Land_Cargo_Tower_V1_No5_F Land_Cargo_Tower_V1_No6_F
I found this post:
tried the following in condition, but gives me an invalid number in expression
"count nearestObjects [getPos thisTrigger, [
"Land_Cargo_Tower_V1_No1_F",
],( triggerArea thisTrigger ) select 0 ] > 0"
Hello, I am attempting to detect housing within a trigger, and if one of the models selected it should place a marker overhead. I dont seem to be getting any errors, however it is not doing anything. Any insight would be helpful. Type None Activation Anybody Once Present Condition this iskindof i...
any way you can set up a respawn camp from the tent instead of the backpack
like, a function you call on the tent
not what I'm asking
?
I specifically want the way the tent works, but by spawning the tent instead of the backpack
remind me?
if you spawn B_Respawn_TentA_F, you can take it as your backpack
and then you can place it down, and there'll be another action to pack it back up into a backpack
that's what I want, that backpack functionality
nvm figured it out
@stuck palm You have an array with a trailing comma, which isn't allowed in SQF. You shouldn't be doing anything that complicated in a trigger condition anyway though, and I'm not sure why you'd use a trigger for houses at all. They don't normally move.
{
params [
["_centre", position player, [[]]],
["_radius", 250, [0]],
["_dir", random 360, [0]]
];
_pos = _centre getPos [_radius, _dir];
_bolt = createVehicle ["LightningBolt", _pos, [], 0, "CAN_COLLIDE"];
_bolt setPosATL _pos;
_bolt setDamage 1;
_light = "#lightpoint" createVehicle _pos;
_light setPosATL (_pos vectorAdd [0,0,10]);
_light setLightDayLight true;
_light setLightBrightness 300;
_light setLightAmbient [0.05, 0.05, 0.1];
_light setlightcolor [1, 1, 2];
sleep 0.1;
_light setLightBrightness 0;
sleep (random 0.1);
_lightning = (selectRandom ["lightning1_F","lightning2_F"]) createVehicle [100,100,100];
_lightning setdir _dir;
_lightning setpos _pos;
for "_i" from 0 to (3 + random 1) do {
_time = time + 0.1;
_light setLightBrightness (100 + random 100);
waituntil {
time > _time
};
};
deletevehicle _lightning;
deletevehicle _light;
};
while {true} do {
_intensity = 2 + floor (random 3);
for "_i" from 0 to (_intensity -1) do {
[position player, linearConversion [0, 1, random 1, 300, 800]] call _fncLightning;
};
sleep 2 + (random 2);
};
};```
in its current state lightning hits the bottom of the ocean is it possible to make it target the top of the water
don't use ATL
and most certainly don't use position and getPos commands...
atl is exact position right? the player is on a platform just above the water
ATL stands for altitude above terrain
the z of _pos in your code is 0
so if you use setPosATL you end up at the bottom of the ocean as you said
setPosATL [x, y, 0] is under water?
yes
because the terrain is under water
yes
Ah ok
I was worried for a bit
Lol
Is there a way to workaround zeus destroying all cameras?
Basically a way to recreate them when interface is closed?
(Is there an eventhandler for interfaceClosed?)
you can use the unload EH on the curator display
so i change the radius z?
z is height not radius
the z value of posATL is height above the ground, setting it to zero puts the position on the ground or the bottom of the ocean.
ye but im trying to get it give or take on the surface of water i looked at getPosASLW
if you want height above water use posASL (or posASLW to include waves)
and why not just use that?
no. just set the Z value back on _pos