#arma3_scripting
1 messages · Page 30 of 1
yes, that's proposed in the same paragraph on wiki 
was about to copy that here as well, but got distracted
I somehow got the impression initially that it would apply in case of unscheduled code only, but it seems like I was wrong 😛
Thanks for the reply! 🙂
scheduled vs unscheduled has 0 influence on how a command is executed, except things like while where an iter limit is introduced in unschd
commands dont control the allowed runtime per frame(they just execute their own thing without any time limit), scheduler does that, between each instruction
with "between" being an important word there.
Aren't all commands effectively blocking though?
if you do some parallel work in there, then yes
Like you'd have a similar issue with a really slow nearObjects call.
otherwise, no
correct, every command is blocking
yes, no different from callExtension
okay, i'll rephrase that
code called by callExtension isn't in the game and doesn't provide any run time (as in literal time spent) guarantees
which can move the nearest point where the scheduler (or VM time quota) can apply way outside the documented time limits 🤷♂️
it depends on what you do in the extension, if you put an infinite loop in there, you will just permanently hang the game. about the time limit, like i said, scheduler handles all of it.
do we have time left to run code this frame? if we do, run the next instruction, otherwise do nothing and let the game do what it needs to do. this instruction can be a command call for example, it can take 10 seconds, barely anything, it doesn't matter.
the "it can permamently hang the game" situation being exactly what Ezcoo suspected. With the solution he envisions (and doc independently proposes) being the async extension. To move time consuming stuff outside of game thread 🤷♂️
well yeah, that's the best thing to do if you are able to
Uh, there are certainly good and bad practices.
well what is causing the lag, is it your own code? or just too many things in the mission?
ah, "what is causing the lag". The most difficult question of them all 
paste it? need context in general, using less sleep won't change anything, rather have less scheduled code.
yes, use https://sqfbin.com
it could be better, but that's fine
if (typeOf _entity != ...) exitWith {};
MRTM_spawnedAPERSMine_Range_Ammo = MRTM_spawnedAPERSMine_Range_Ammo - [objNull];
if (count MRTM_spawnedAPERSMine_Range_Ammo < 50) exitWith { MRTM_spawnedAPERSMine_Range_Ammo pushBack _entity };
deleteVehicle _entity;
on phone, but something along those lines, edited, missread your code 
wheres that ui from?
refer to mod's docs
compared to what?
it's from contact DLC
well like your mission, which is lagging?
according to wiki
this works but it also disables left and right panels
yea I know. i was just thinking if your mission has lot of AI that also lags, possibly a lot
ty, I tried but but it shows this...
oh ok maybe it needs better garbage collection or something
verify your integrity? 🤔
by default, no
unless you use something that does that, is what i meant
thanks man, I did a search about it, apparently I need to be running the contact client to run BIN_ commands
it should be...
any idea how can i get a peek at the code of this BIN_fnc_showHorizontalCompass function?
I just need the IDD and IDC to disable them
start your game with contact and use the functions viewer
having lots of mines can lag too. maybe you should check how many entities your mission really has
oh right
thank you
"RscCompass" cuttext ["","plain"];
to remove contact DLC horizontal compass
Hey,
It seems that when you drag an object (ace drag), that dragged object does not take effect on the speed command
if (speed _object > 0) then {};
So what happens to an object when it's attached to something, I'm trying to figure out how to check if my object is moved/ has velocity.
if carry object the if speed command works
you just have to check the object position then, if it has moved
The code does need refactoring for that but it already communicates back and forth with status codes, so I think it's doable. Need to convert the methods to async and add polling/probing of the backend until proper reply in SQF 🙂
besides you cant really compare a mission like KOTH which is totally player based against literally anything that uses AI. KOTH besides optimization, uses the fact that it needs to compute very few things as everything is being done by the player and then comunicated to server, and not the other way around which is the usual case
Is it possible to disable night vision/thermal optics for vehicles?
for both players + AI
oh yes it is. I guess follow up: does the AI respect https://community.bistudio.com/wiki/disableNVGEquipment
is there a way to always pick a day that it's a full moon?
"always pick" in what manner, that instead of normal day-night cycle, game cycles only between full-moon days?
why u want full moon?
is it because the night is brighter?
yes
no i want to dynamically pick a night with a particular moonphase, but it's fine I found a snippet on the wiki
u can just create a light point to illuminate the night, something like
SKYLIGHT = "#lightpoint" createVehicleLocal [0,0,0];
SKYLIGHT setLightBrightness 1;
SKYLIGHT setLightDayLight false;
SKYLIGHT setLightAttenuation [10e10, 26, 4.31918e-005, 4.31918e-005];
SKYLIGHT setLightAmbient [0.1, 0.2, 0.4];
woudln't it be easier to check for moonPhase and use setApertureNew when it's less than 1?
just throwing out ideas, never tried that
interesting idea
or on 23:59:59 set date back to 00:00:00 same day, but if you or anyone uses skipTime it won't work
anyone know how I can disable or hide these interaction icons, without editing config files
use a unit that has an empty loadout (not emptied by you) and it should work
otherwise use ACE, it disables that icon
thanks👍
Is there anyway to retexture a vest from the mission? Not usesing a mod. I can retexture uniforms, but not vest or helmets
Anyone know if
``` affects all players or just the ones in that specific group
All units in the group of the local player.
So if the player is in Alpha 1 it wouldn't affect alpha 2?
Assuming that you're running the code local to the player in alpha 1.
It'll be mp based
Hi there!
I am self hosting a server with some friends and wanted to know how I could use the executable box (when you press esc) to spawn a box and then have items get created in that box
I believe I can find the item names on my own, just wanted to know how I might go about that in a non dedicated server
I believe the debug console is locked specifically to eden editor
The better option would be setting yourself as zues and spawning items that way
I have this for the eden editor;
private _testingCrateObject = this; if isServer then { private _itemsArray = [ ["ACE_1Rnd_82mm_Mo_HE_LaserGuided", 100], ["ACE_1Rnd_82mm_Mo_HE_Guided", 100], ["ACE_1Rnd_82mm_Mo_HE", 100], ["ACE_1Rnd_82mm_Mo_Smoke", 100], ["ACE_1Rnd_82mm_Mo_Illum", 100] ]; { _x params ["_stringItem", "_itemCount"]; _testingCrateObject addItemCargoGlobal [_stringItem, _itemCount]; } forEach _itemsArray; };
But i need to be able to do it while in game
The mission file doesn't have zues, otherwise I totally would aha
I could edit the mission file but I would like to avoid that
This would really suck
Anyone know an efficient way of getting all "EmptyDetector"s? entities doesn't return anything, and allMissonObjects is laggy as hell
I don't think there's an efficient way until 2.12 but some form of allObjects is probably best.
Is anyway to make a trigger an invisible wall or anyway to make an invisible wall? The current was is extremly small
Yeah just take a wall and in the properties uncheck visible but leave on simulation
does the invisible wall item not work for you as well?
You'd probably have to find one in a mod.
Hi, if you are self hosting you can change debug mode to shown for on sp/mp host.
And take the Dev tools to use when you can use easier your debug console. https://steamcommunity.com/sharedfiles/filedetails/?id=2369477168
https://community.bistudio.com/wiki/Arma_3:_Debug_Console
Ohh! Very cool!
Thank you!
This will allow me to spawn items and run scripts in game ye?
When you change 1st option from
Using Eden attribute Debug Console, available in Attributes > General > States > Debug Console
Then you choose
1 - Available in SP and for hosts / logged in admins in MP
So when you are host you can see debug console in MP hosted game when you press ESC.
And mod for debug console is just better than Eden editor own console.
Easier to use and alot of abilities
Sweet
If I am hosting, can another player also use these features or no
No, if you choose host/ logged admin. It only shown on you. Not another players
If you choose avaible for everyone, it will shown for all
private _testingCrateObject = cursorObject;
if (isServer) then {
private _itemsArray = [
["ACE_1Rnd_82mm_Mo_HE_LaserGuided", 100],
["ACE_1Rnd_82mm_Mo_HE_Guided", 100],
["ACE_1Rnd_82mm_Mo_HE", 100],
["ACE_1Rnd_82mm_Mo_Smoke", 100],
["ACE_1Rnd_82mm_Mo_Illum", 100]
];
{
_x params ["_stringItem", "_itemCount"];
_testingCrateObject addItemCargoGlobal [_stringItem, _itemCount];
} forEach _itemsArray;
};
You could try this, just point your object and add to watch list cursorObject and pin 📌 that to screen when you get your cursorObject what you are looking, then you should be able to spawn item via debug console to object which is yours cursor object in game.
Is there a good way of testing features requiring 2 people on a dedicated server by yourself?
There's the loopback server.cfg option, although I think you have to run the DS and both clients on the same machine, which needs a lot of RAM.
localhost + client also worked at some point but not the last time I tried.
params ["_element1", ["_element2", str ( _this select 0 )]];
Is there a guide for this somewhere? I'm wanting to test those sorta stuff and have more than enough pc resources to handle it.
https://community.bistudio.com/wiki/Arma_3:_Server_Config_File
Once you have the server set up, connecting with multiple clients is as simple as hitting "play" in the launcher twice
Good day, why can 'remoteExecutedOwner' return 0? 🤔
Context:
//Headless client request
remoteExec ['TAG_fnc_someFunc',2];
...
...
//Server check before response
TAG_fnc_someFunc =
{
if (remoteExecutedOwner == 0 && isDedicated) exitWith {
"TAG_fnc_someFunc: Caller is 0" call TAG_fnc_logError;
};
...
}
And like, every time it's 'Caller is 0'
Do I miss something?
Thank you, I've read it and it does not answer my question, my case is not SP and definetly should be considered remote executed context.
how can i get the animationList/Components for vehicle to use in a config?
this might give you the answer
https://feedback.bistudio.com/T128522
I need something like player switchCamera "Internal"; but instead of specifying Internal/External, I just want the player to return previous view. (So basically just close Gunner view). Is it possible?
Damn I love this game, one more nuance to keep in head. Thanks a ton for searching.
Thank you! I will check that
Can I record the previous cameraView with that first EH you posted and use player switchCamera prevView;
What I am trying to do is to close binocular view after a particular trigger
Sorry I am not experienced with EHs
this addEventHandler ["OpticsModeChanged", {
params ["_unit", "_opticsClass", "_newMode", "_oldMode", "_isADS"];
systemChat _opticsClass;
systemChat _newMode; systemChat _oldMode;
}];
So you get class to binocular and then you can use that in eh
this addEventHandler ["OpticsModeChanged", {
params ["_unit", "_opticsClass", "_newMode", "_oldMode", "_isADS"];
if (_opticsClass == "classOfBinoculsrs") then {
_unit switchCamera _oldMode
};
}];
Thank you ❤️
is doing unit positions on 2d map actually more efficient via markers compared to drawIcon ?
the latter you need per frame, while with markers you cache data, and update parts less frequently
plus only need to adjust the markers instead of remaking all the time with drawIcon
it'll be ugly imo
marker will be "lagging" basically 😄
while with markers you cache data
you can also cache the drawicon params
and just adjust position per frame
drawIcon is the most expensive part
you cant cache much either
you need position and direction
otherwise its non smooth either
for type and side (civ/captive) you dont want too much lag / you need to check that state
i never had any performance issues with drawIcon, it's also map related only
for drawIcon3d caching is useful
It's not uncommon to use markers for force tracker icons, at least. Having a low update frequency doesn't matter too much because perfect intel is unrealistic/too OP. Depends what you want, I guess.
200-300 entities with drawIcon is expensive (~5-10ms)
been using markers previously too (in A2 and till few years ago in A3)
however people suggested drawIcon to be "better"
benefit for non perframe drawing is also you can distribute the unit updates over multiple frame and thus have no spikes but instead some lower "permanent" load
far from perfect but works both with area markers or cover map module
add this at the end of initplayerlocal.sqf
//_ao = "marker_0";
_ao = "bis_fnc_moduleCoverMap_border";
while {true} do {
if !(alive player) then {seleep 3; continue};
_oldpos = getpos player;
sleep 1;
_newpos = getpos player;
if !(_newpos inarea _ao) then {
player setpos _oldpos;
hint "You left the AO";
};
};
markers are updated all the time on the server, so if there is a lot of them, probably is better using drawicon, it has 2 benefits:
- its only executed when the map is opened, so you can give all the load the player, 3 less fps on the map, wont hurt
- save ton of unnecessary network traffic
if you save all that data into an array and share it with publicvariable... probably is quite the same that using markers
they meant local markers im pretty sure
hmmm i had bad experiences moving/deleting a large amount of markers, and with drawicon its made instantly, out of that, its quite the same
Thank you! (gracias, lol)
I already find a mod, but I will give it a try.
Very noob question here.
In the init field of an object I have this:
[this] call myFunction;
and the function looks like:
myFunction = {
params ["_object"];
[_object, "TITLE", "\A3\Ui_f_oldman\data\IGUI\Cfg\HoldActions\map_ca.paa", "\A3\Ui_f_oldman\data\IGUI\Cfg\HoldActions\map_ca.paa", "true", "true", {}, {}, { SOMECODEHERE }, {}, [], 1, 800, false, false, true] call BIS_fnc_holdActionAdd;
};
Why is this not working?
Note: I am new to A3 scripting so I don't completely get function params
you probably define the variable later than using it
myFunction = { where is this part located?
in init.sqf
Thank you, I will learn this now
What would be a better place for the function call? I was trying to do this because I wanted to reuse this function for a lot of objects in the editor
preinit/cfgfunctions
The place for the function call is fine, you don't need to change that. It's defining the function that you need to do earlier, as sharp said.
test
oh it works
aircraft flyInHeight 30;
this command for whatever reason is ignored by a large aircraft when it reaches a waypoint that has this command in it
it worked on a map with relatively flat terrain, but not on chernarus
Aircraft of all types have a long history of.....inconsistent....compliance with flyInHeight commands. You can try setting it a bit lower or combining it with flyInHeightASL, but you may not be able to get exactly what you want.
https://community.bistudio.com/wiki/flyInHeightASL
aircraft flyInHeightASL [standardAltitude,combatAltitude,stealthAltitude];```
some wiki entries are outdated so I had to clarify
Commands don't usually change the format of their arguments, for backwards compatibility reasons. Sometimes they get new ones but the old one will still work.
If you find any outdated wiki entries, be sure to mention them in #community_wiki so they can be updated.
yeah that command doesn't work either, the map is Chernarus (Summer)
the aircrafts do the commands in the waypoints such as drop bombs and so forth, the altitude commands feels like they are completely broken
I guess there's no choise but to resort to Unit Capture
yeah marker would need to be created locally / in SP/Eden for testing purposes MP traffic is no concern either
Is BIS_fnc_buildingPositions deprecated with buildingPos -1?
yes
You tested this right - and it worked? Because I still can't get it to function at all.
this disableAI "PATH";
this addMPEventHandler ["MPHit", {
params ["_unit", "_causedBy", "_damage", "_instigator"];
hint "Hit!";
[_unit] joinSilent createGroup EAST;
_unit removeAllMPEventHandlers "MPHit";
[_unit, "IMS_Die_Spec_1"] remoteExec ["switchMove"];
[_unit, "IMS_Die_Spec_1"] remoteExec ["playMoveNow"];
sleep 6;
_unit setDir (getDir player);
[_unit, "IMS_Crawling_Away_Start"] remoteExec ["switchMove"];
[_unit, "IMS_Crawling_Away_Start"] remoteExec ["playMoveNow"];
sleep 1.4;
[_unit, "IMS_Crawling_Away"] remoteExec ["switchMove"];
[_unit, "IMS_Crawling_Away"] remoteExec ["playMoveNow"];
sleep 10;
if (alive _unit) then {
[_unit, "IMS_Crawling_Away_Stop"] remoteExec ["switchMove"];
[_unit, "IMS_Crawling_Away_Stop"] remoteExec ["playMoveNow"];
_unit setDamage 1;
};
}
];
Not even displaying the hit! hint.
you don't need mphit for this
infact your entire code is wrong with those remoteExecs
Tried it with regular hit -
What was happening was the unit went down for the guy who shot it. Everyone else saw him still there, still shooting.
Also - how so?
As far as I'm aware, that's the proper syntax for a animation change using remoteExec
Alright - tell you what
not even THIS is working
this disableAI "PATH";
this addMPEventHandler ["MPHit", {
params ["_unit", "_causedBy", "_damage", "_instigator"];
hint "Hit!";
}];
Nor
this disableAI "PATH";
this addMPEventHandler ["MPHit", {
params ["_unit", "_causedBy", "_damage", "_instigator"];
["Hit"] remoteExec ["hint"];
}];
Nothing on hit.
Does the unit have "allow damage" turned off in its Editor attributes? That can cause hit-type EHs to ignore events
how do I check again if something is ObjNull or not? 😅
Damage enabled.
boolean value. If not included, sohuld just return the current value
isNull
add a zeus module to your player and check ingame.
Hm- Also what mods ya go
Well-
A ton - none of which effect this though - considering this should be a vanilla function.
Damage enabled.
I mean- a mod I got gives ya a shield of sorts. I dunno if it affects the hit events
Although, conveniently, I am just trying to mess with it now xD
Melee system?
They might not affect the command itself but they could affect the way some things are interpreted. For example, CBA used to put a hidden call {} around anything you put in an init field, which was not terribly helpful
I'm not sure if it still does it but you should check.
Yeah but he doesn't have a melee weapon so it's not triggering IMS.
Could check this in the debug console:
ims_laf_shotstotakeoutoneguy
Probably not that tho
What - to see how many shots it would take to kill him if he had a melee weapon?
I would recommend unloading all your mods and trying just this in a blank mission with nothing else. That will prove the basic point of whether it's mods or something else.
oh yea that too.
Already have.
Try in a new senario in vanilla. Only what you need for the guy
Same effect
oh-
So not a mod issue.
So if either of you Copy and paste that code into a units init
Does it work?
Is this only a my machine issue with that code - or is that code just not working
is he dying or just getting injured?
Yeah you can kill him
What kind of damage is it.
takes like 3 shots
ah ok, so probably not this but-
Tried vanilla guns, regular guns, etc etc.
The hit EH will not necessarily fire if only minor damage occurred (e.g. firing a bullet at a tank), even though the damage increased.
I wouldn't say 3 shots is considered minor damage.
Okay, I did a blank VR mission with me and one guy. That guy had your code in his init. I shot him and got a "Hit!" hint.
Right - so it's a "My machine" error.
wait
Which one - top or bottom?
multiplayer or single
I've been trying on both
Editor SP. Wouldn't matter if it's top or bottom, there's no locality problem.
MPHit is supposed to trigger on every machine anyway so you shouldn't need remoteExec.
i feel that's really weird-
Interesting.
So without removing ANY mods
and just loading up VR
suddenly it works.
Begging the question
Why the fuck doesn't that work on that map?
huh-
Or, possibly, with that specific unit type
Try in VR with the unit type.
Nope - working fine there.
Ok, modded map?
Yeah but it wasn't when I unloaded all my mods to test this.
Plus why would a map conflict with an MPHit Event Handler
Try on altis
beats me. Maybe an event is added that is silently failing or something? I dunno
_unit removeAllMPEventHandlers "MPHit";
_unit removeAllMPEventHandlers "MPKilled";```
Found it
wha
Mission side script that has been bugging me for a few weeks now - that I had ported over for testing with the other ones to check they worked in vanilla at the same time.
Early version of fuckin' Project Injury Reaction.
So when you said you'd tried it in a blank mission with nothing else... 🤔
Yeah I didn't think the mission scripts would've been conflicting - Arma takes forever to boot on my laptop so I was trying to kill two birds with one stone.
Regadless - let me see if removing that'd fix it
Because theoretically that shouldn't be firing either.
Nope - that wasn't the issue.
right
Pulled that entire module out.
Something in it was doing it apparently - works now.
Is it && or and for if statements? 😅
oh seems it's either
ok, lets see if my force invincible script works :P
i have just realized the reason my clipboard is cleared whenever I ender zeus :I
PrintScreen is my zeus button xD
and is just an alias to &&
I notice the zeus gamemaster module doesn't give all playable units zeus access- How would I make it so I always have zeus access? :P
oh wait
Somethings have tool tips. Some do not. I was thinking I'd need to write something to manually make all playable units be zeus xD
Better way is to use isEqualTo it seems, to me?
isNull expects game types, I believe. Atleast, it doesn't expect bool values.
Way I got around this is isEqualTo.
Also, ["_newValue",objNull,[objNull,true]], means it will NEVER be undefined right? As in, I should need to do a isNil check on it?
wait, do if statements try everything? Or is this a mod?
if (not (isNil "_s")) and (hint "F") hints F even if _s is not defined?
interesting-
yes, because its not lazy eval
bruh
#creators_recruiting follow the template there
my second message didn't send for some reason
for lazy eval put right operand into code { ... } see https://community.bistudio.com/wiki/a_%26%26_b
Q: I have an EH responding to a user action, and I want to prompt the player using a call to BIS_fnc_guiMessage. but this apparently only works in the context of a spawn not a call... i.e. when I do something like:
// in a debug console
[] spawn{['test'] call BIS_fnc_guiMessage} // prompt okay
// versus:
['test'] call BIS_fnc_guiMessage; // nothing prompted
My base EH is something like:
// _okay defined aligned with _response(s)
private _prompt = {
// ...
private _response = [...] call BIS_fnc_guiMessage;
_response == _okay;
};
// ...
if (_baseCond && { [] call _prompt; }) then {
// ...
};
So should I be spawning the EH callback, not calling it? i.e. [...] spawn _callback versus [...] call _callback?
['test'] call BIS_fnc_guiMessage; // nothing prompted
BIS_fnc_guiMessageneed to becalled from scheduled environment
you can't spawn here either because you need the result, so just execute everything scheduled
not spawning the BIS_fnc_guiMessage itself, obviously, because like you said, I want the response...
I mean the calling context...
call from scheduled, that's what you need to do
0 spawn {
private _result = ... call BIS_fnc_guiMessage;
// or like yours, same thing
private _prompt = { ... call BIS_fnc_guiMessage == "whatever" };
private _isTrue = call _prompt;
}
so it's:
// this:
[] spawn {['test'] call BIS_fnc_guiMessage} // prompt okay
// and not this:
[] call {['test'] call BIS_fnc_guiMessage} // nothing prompted
latter might still work, if you're in scheduled env
call doesn't change the environment
well I can promise you having just tried it, it does not work. that is why I am clarifying here.
removeAllActions doesn't remove vehicle actions like "get out" or "turn off engine". How can I do it?
then you are executing it in unscheduled, you can test systemChat str canSuspend;
you can't remove engine actions
🥺
If you want to stop someone getting out you can lock the vehicle
I'm just trying to understand why spawn versus call, what is the difference.
Because that matters to the calling context how I handle not only the approach but the response to that prompt.
spawn creates a new independent scheduled thread.
call is like running the called code in-place in the existing context.
You could probably remove "turn off engine" by destroying the engine :P
so I need to consider relaying contextual bits to the spawned code, in other words. cannot depend on calling contextual state 'being there' when it happens. that sort of thing.
just throw a guard and call back the function in scheduled if called from unscheduled
if !canSuspend exitWith { _this spawn tag_fnc_thisFunctionBlabla; }
interesting, well I could do that, but I really do have a bit more control over that calling context than depending on it being a happy coincidence. still does not help the comprehension of the consequence, approach vs response, vis-a-vis spawn. anyway, thanks, I think I have a better idea now.
works fantastic. thanks all.
So i just learned that you shouldn't use deleteAt while iterating with foreach. 😅
Can you do it like that or is there a better way ?
while {ExileServerVehicleSaveQueue isNotEqualTo []} do
{
sleep 0.001;
{
private _vehicleObject = _x;
if (!isNull _vehicleObject) then
{
if (_vehicleObject getVariable ["ExileIsContainer", false]) then
{
_vehicleObject call ExileServer_object_container_database_update;
}
else
{
if (isNumber(configFile >> "CfgVehicles" >> typeOf _vehicleObject >> "exileIsDoor")) then
{
_vehicleObject call ExileServer_object_construction_database_lockUpdate;
}
else
{
_vehicleObject call ExileServer_object_vehicle_database_update;
};
};
};
ExileServerVehicleSaveQueue deleteAt _forEachIndex;
}
forEach ExileServerVehicleSaveQueue;
};
Err, I assume some other scheduled code is adding entries to this queue, possibly while that update loop is running?
And a single object could potentially be added multiple times?
It's to clear the Save buffers at mission end. An object can be only added once to ExileServerVehicleSaveQueue
I guess i can just do
if !(ExileServerVehicleSaveQueue isEqualTo []) then
{
{
_vehicleObject = _x;
if (!isNull _vehicleObject) then
{
if (_vehicleObject getVariable ["ExileIsContainer", false]) then
{
_vehicleObject call ExileServer_object_container_database_update;
}
else
{
if (isNumber(configFile >> "CfgVehicles" >> typeOf _vehicleObject >> "exileIsDoor")) then
{
_vehicleObject call ExileServer_object_construction_database_lockUpdate;
}
else
{
_vehicleObject call ExileServer_object_vehicle_database_update;
};
};
};
}
forEach ExileServerVehicleSaveQueue;
ExileServerVehicleSaveQueue = [];
};
Yea when i think about it i don't really need to. Most important is to get rid of the ExileServerVehicleSaveQueue deleteAt _forEachIndex
Because it's skipping entries in the array 
Thanks 👍
So next question, how would one handle this to avoid the problems mentioned above for other cases where i can't just empty the array but i still want to delete an element from an array 🤔
If it's a problem with concurrent access then you probably just want to go with a simple mutex system w/ a lock
if it's just not being able to delete stuff in an array while iterating over it.... just don't do that
there's alternative solutions to the latter, if that's the case
So just pushback the elements i don't want to delete into a new array and override the original array then ?
That's one way
could also just do a select {} on the original array and have a filter expression to filter out the ones you don't want
ideally a function for the filter if the code's complex
Thank you 👍
No problem
if (({ alive _x } count [Graf1T,Graf2T,Graf3T,Graf4T]) == 0) then
{
["TUTGRAF2","SUCCEEDED"] call BIS_fnc_taskSetState;
[(group _caller), ["TUTGRAF3","TUTGRAF"], ["Collect your payment at the terminal","Collect Bounty Payment.","download"], TutorialTerminal, "AUTOASSIGNED", -1, True, "download", False] call BIS_fnc_taskCreate;
TutorialTerminal addAction
[
"<t color='#0f4719'>Collect Bounty: Graffiti Maestro</t> - <t color='#b9bf00'>500 Credits</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
{
[_x, 50] call HALs_money_fnc_addFunds;
} forEach units group _caller;
[_this select 0,_this select 2] remoteExec ["removeAction", 0, true];
}
];
};
Am I being stupid again?
["TUTGRAF2","SUCCEEDED"] call BIS_fnc_taskSetState;
``` his fires - nothing below it does.
When executed seperately -
[(group _caller), ["TUTGRAF3","TUTGRAF"], ["Collect your payment at the terminal","Collect Bounty Payment.","download"], TutorialTerminal, "AUTOASSIGNED", -1, True, "download", False] call BIS_fnc_taskCreate;
TutorialTerminal addAction
[
"<t color='#0f4719'>Collect Bounty: Graffiti Maestro</t> - <t color='#b9bf00'>500 Credits</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
{
[_x, 50] call HALs_money_fnc_addFunds;
} forEach units group _caller;
[_this select 0,_this select 2] remoteExec ["removeAction", 0, true];
}
];
``` this creates the task and adds the action.
Nvm, mixed up my target numbers
firstly, cleaning the formatting
if (({ alive _x } count [Graf1T, Graf2T, Graf3T, Graf4T]) == 0) then
{
["TUTGRAF2","SUCCEEDED"] call BIS_fnc_taskSetState;
[
group _caller,
["TUTGRAF3","TUTGRAF"],
["Collect your payment at the terminal", "Collect Bounty Payment.", "download"],
TutorialTerminal,
"AUTOASSIGNED",
-1,
True,
"download",
False
] call BIS_fnc_taskCreate;
TutorialTerminal addAction
[
"<t color='#0f4719'>Collect Bounty: Graffiti Maestro</t> - <t color='#b9bf00'>500 Credits</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
{
[_x, 50] call HALs_money_fnc_addFunds;
} forEach units group _caller;
[_target, _actionId] remoteExec ["removeAction", 0, true];
}
];
};
Not sure why you're using [_target, _actionId] remoteExec ["removeAction", 0, true]; in the action code; the addAction only happens locally , so remoteExec'ing removeAction makes no sense
I suspect this confusion over locality is the overall issue
JIP removeAction makes even less sense :P
What am i doing wrong here. No errors, just doesn't show in editor
class C_Heli_Light_01_civil_F; // External class reference
class DSF_COP_MD500E: C_Heli_Light_01_civil_F
{
faction="DSF_COP";
scope = 2;
scopeCurator = 2;
side=1;
displayName="Police MD-500E";
vehicleClass = "DSF_COP_Helicopters";
author = "Pakeha";
hiddenSelections[] = {"camo1"};
hiddenSelectionsTextures[]=
{
"\DrongosSimpleFactions\Cops\Data\police_heli.paa",
""
};
crew="DSF_COP_pilot";
typicalCargo[]={"DSF_COP_pilot"};
};
More of a #arma3_config question, but if I had to guess, having more entries in hiddenSelectionsTextures than hiddenSelections could be upsetting things.
thanks i'll check it out and sry your right.
👍
hello, i have a little problem.
i want to make some downtime at start of the mission
init is executed, when role selection has pased, but i want to wait until briefing phase has ended ( i mean all players in map) but i dont know how to make an codition to handle that, any ideas?
i dont know if this can be used in server: https://community.bistudio.com/wiki/getClientState
Any suspension during init will be held until the end of briefing phase, i.e. sleep 5; will completely pause the code and only start its count to 5 when the mission begins
This doesn't account for clients still being in post-briefing loading screens - it starts when the map closes, not when the loading screen ends - but as long as your downtime is more than 10-15 seconds you should catch most cases of delayed loading without having to worry about it
https://i.imgur.com/XW8VCw6.png
so i have this trigger wich went really bad when multiple people where on the server
i wonder what went wrong, it got fired on every single machine, i think
should i tick "server only" maybe?
that, and don't remoteExec
i sadly cant just test this, as iam always alone, when tinkering in the editor 😄
You can launch multiple instances of Arma and local MP
Both, I would think
yea 😄
very much thanks
waitUntil { time > 0 } does that i think, but make sure you schedule a new script for that (so you don't suspend init script)
set to some dummy value instead of deleteAt (fx., objNull), then do ... = ... - [objNull]
yes
thanks!
Yea but I want a 5 minutes counter after I send the mission, now time in the map is included in that 5 minutes, and I don’t want that
[RadioHQ,["Send a RifleSquad to Hell", "scripts\sendRifle.sqf"]] remoteExec ["addAction", p1];
this is the init of a player unit (player 1 in this case), i wonder if i should remove the remoteExec too
Yeap that will work, I used servertime for so long I completly forget about time lol
there actually you want to exit the script if p1 isn't local
or just don't use initboxes for this
ah yes that is smart
well is there even a reason to have triggers, that are not server only? like what about triggers that skip waypoint for AI, should those be on the server only?
sorry this might be more #arma3_editor than scripting question
Time in the map if the client opens the map on their own after the briefing will be included, yes. Time in the forced map during the briefing phase is not included. As I said, the sleep counter only starts once the briefing ends and the mission starts.
It doesn't really matter if skip waypoint triggers aren't server only - you can only skip a given waypoint once so there's no fear of breaking anything.
The reason for non-server-only triggers is locality. Sometimes you want to evaluate conditions on each client, not for the mission overall. Sometimes you want to execute local code on each client, not only on the server.
thanks alot @hallow mortar
I have defined ogg files in a bikb document for a simple conversation, however the game doesn't play the sounds even though it appears to wait for the length of the sounds before moving to the next line. Any ideas where to look for ?
are you using bis_fnc_kbtell?
Yes, ["Briefing", "ConversationsAtBase"] call bis_fnc_kbtell;
The conversation text flows as I expected
Yes, the units are on the map, their id's are in my bikb file
Even their lips are movin
i never had issues with the conversations thing, you did something wrong somewhere, maybe your audio files are wrong format?
They are just .ogg files I downloaded from a tutorial and I can listen to them out of game with no problem
May be they are corrupted or something, idk
But the fact that engine is waiting equal to the time of ogg files makes me think I encountered a bug. May be not a common one
Maybe too obvious but have you checked your in-game volume settings?
@open hollow Check out allUsers + getUserInfo
how can I log large numbers 2.05217e+009 in decimal format ?
String them?
Use toFixed.
Is there a way to list all players that have activated the same trigger (triggerInterval is set to 0) and then sort from first to last?
Have activation be local player-specific (e.g. player in thisList rather than using this with Any player present) and have them pushBack themselves into a global array when they activate it
thank you i will try that
any player is fine i think, you can use https://community.bistudio.com/wiki/list to get the current units
You'd want the trigger attributes set to Any player but you wouldn't want to use that with this as the condition (the trigger activates when any player enters it); if it's non-repeatable that will mean it only gets the first one unless they all enter at once, and if it's repeatable that means a lot of unnecessary activations from players who have already been got (and duplicate executions of the trigger code, depending on what it is)
I failed so hard I even checked that XD Time to post details XD
This is in the descriptions.ext of my mission:
{
class ConversationsAtBase
{
class Briefing
{
file = "\brief.bikb";
#include "\brief.bikb"
};
};
};```
This is brief.bikb:
```class Sentences
{
class Brief_SQL_Line_1
{
text = "Merhaba hoşgeldin";
speech[] = { "\talk\test1.ogg" };
class Arguments {};
actor = "SQL";
};
class Brief_TL_Line_2
{
text = "Seni görmek ne güzel. Gördüğüme sevindim."
speech[] = { "\talk\test2.ogg" };
class Arguments {};
actor = "TL";
};
class Brief_PL_Line_3
{
text = "Hoşbulduk teşekkür ederim."
speech[] = { "\talk\test3.ogg" };
class Arguments {};
actor = "journalist";
};
};
class Arguments {};
class Special {};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university};```
I activate it from a trigger with:
`0 = execVM "StartTalk.sqf";`
This is the content of StartTalk.sqf: `["Briefing", "ConversationsAtBase"] call bis_fnc_kbTell;`
And finally, all my sounds are in `talk` folder inside the mission root.
Can anyone help me before I go completely crazy tryng to figure this out
yes, the trigger is set to repeatable, what if i disableSimulation of the trigger for the player who activated the trigger already once, that would prevent him from duplicating the code, right?
Sort of, but as long as the trigger is using Any player and this rather than a more specific condition, the trigger will activate on every client when any player enters it, not specifically when the local player enters it.
That's why I made the original suggestion I did; it neatly avoids all these problems.
condition is set to player in thislist and any player
That's fine. Do make sure it's set to non-repeatable unless you want players to be able to activate it more than once.
If you're using my suggestion of having each client add itself to an array when it activates, and you want it to be repeatable, you might want to use pushBackUnique if you want to record order of first activation rather than order of every activation.
private _step = 360 / _count;
private _offset = random _step;
for "_i" from 1 to _count do {
// Gaussian distribution avoids all waypoints ending up in the center
private _rad = _radius * random [0.1, 0.75, 1];
// Alternate sides of circle & modulate offset
private _theta = (_i % 2) * 180 + sin (deg (_step * _i)) * _offset + _step * _i;
// etc ommitted, not needed
};
so I understand the reasoning by using the gaussian distributions, I usually just do _radius * sqrt random 1 myself though... I understand alternating the sides of the circle on every other iteration by 180 degrees... what I don't understand is the math behind the modulated offset of theta and why it is needed?
Given the what looks like "let's convert degrees step from radians to degrees again and plop the result into sin" the most likely explanation is "because it looks kinda cool"
this was within CBA_fnc_taskPatrol
Replace with "less uniform" then 🤷♂️
Effectively "pseudorandomly rotate up to 1 step in any direction"
Correction, "up to some preselected part of one step"
um Hello! I suck at scripting this is my first time scripting anything good um I am trying to set up respawn with my current loadout but for some reason it spawns me on the position of death and my inventory is empty.
Here is some of my code:
and here is my error messages:
honestly idk what im doing and how to fix it some help would be greatly appreciated :/
seems fairly straightforward. P1_1 isn't defined.
Is that the variable name of a player unit, set in the editor?
This seems an awfully complicated way to respawn with your loadout that you had on when you died.
OnPlayedKilled.sqf
player setVariable["Saved_Loadout",getUnitLoadout player];```
OnPlayerRespawn.sqf
```sqf
_unit setUnitLoadout (configFile >> "EmptyLoadout");
player setUnitLoadout(player getVariable["Saved_Loadout",[]]);```
if you are using setUnitLoadout you don't have to clear anything. its going to set it to that loadout array you provide
I think it was added as a redundancy system, ensuring it was fully cleared and reloaded.
you can fully clear faster with _unit setUnitLoadout (configFile >> "EmptyLoadout");
Thank you for the enlightenment ❤️
Can I just replace the removeAllX
with that, then having the get loadout still as it is?
All you need is two lines. The empty loadout and then the new loadout
Q: given a custom camera, I want to show the marching ants circle (ellipse, etc) about a radius of the camera... somehow I 'lost' this, not sure was it a camera command, or something else custom drawn like PFH... thanks...
Infinite Repeating Loop Mission Success End Issue
camSetTarget, in a PFH camSetPos switching positions in a circle
I figured it out, sort of... thanks though.
the root cause is "Sign_Sphere100cm_F" objects are created, that much is happening. but they are not 'appearing', which I gather that a color needs to be set? after that, should it be PFH?
I checked the XYZ positions are all correct, should be appearing if they can appear. which leads me to believe that somehow I need to color them, 'once' or perhaps PFH is required, IDK...
got 'er sorted... https://pasteboard.co/TYXamYyMkgXz.jpg
How do I correctly exit out of the while loop:
// Check if Time Limit and type CBRN
if (_timeLimit && _cbrn) then {
while { _time > 0 } do {
_time = _time - 1;
uiSleep 1;
private _captives = [];
{
if (captive _x) then {
_captives pushBack _x;
hint str _captives;
}
} forEach _hostages;
if (_time <= 0) exitWith {
"SmokeShellYellow" createVehicle getMarkerPos _cbrnZone;
uiSleep 5;
{
_x setDamage 0.9;
_x playMove "acts_executionvictim_kill_end";
uiSleep 2.75;
_x setDamage 1;
} forEach _captives;
};
};
};
exit? what's the issue with the current code?
The while loop continues and doesn't exit for some reason
_time > 0
it should break once it's less than that, have you tried printing the value?
I've done a few test and I can hear that the smoke shell keeps being created and noticeably lagging the game. As well as the hint str _captives keeps being printed out every second even after the time has expired
print _time
just tried it and the time is all over the place as well as continues to count even after it hits 0. Looking further into it it seems as though it starts acting up once hostages start joining my group when I free them.
wat? you sure? did it print negative value?
No negative value
are you sure that you aren't running this script multiple times accidently?
It might be running multiple times, I'll have to figure out how to test for that
It's being executed from a script that registers the task and it re-runs the script checking the task conditions every 3 seconds.
If it's looping the above script every 3 seconds then that's your problem
Either only run the script once, or adjust the script to just work on the 3 second interval without a loop
Does Geiger counter sound presents in arma? Please ping me with className.
hello, any ideas why setObjectTexture on object's init in MP, on some clients it works and some clients dont?
none of the players are JIP
don't use setObjectTexture in object's init
why
"idk lol"

iirc it has to do with some initialisation
absolutely unplayable game
so i have to run a sqf? theres a bunch of units in different groups, would be a pain lol
or maybe i make it loop 10 times each second to be sure 
only?
😈
can you update the wiki entry with this so people dont get confused
not unless you do tests and I am sure I didn't say some bs
new rule #69: deal with it 😎 you're banned
noooooo we need you
its too late 😒
ok I was lying anyway
all jokes aside ❤️ I would wager it eventually has to do with initialisation order or randomisation, hence why it would be a good idea to have it externalised
I can't confirm it as of now
ight i'll do some testing with the global variant of the command
simply do a
waitUntil {obj setObjectTextureGlobal [0, "DESIRED_TEXTURE"]; "DESIRED_TEXTURE" in getObjectTextures obj};
in the init 😈
you expect me to trust the docs after all this BS 😈
thats absolutely clever mate keep hammering it until its true, will use it 😈
only if you buy the premium edition for 45$/month, don't trust the basic free version bro
the docs still don't auto-redirect the setPos page to a page explaining why setPos is bad so they're not to be trusted
the disclaimers aren't enough
!quote 5
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
even the game dont cost that much!
it's… the modding fee
does the premium version give access to
if !(call BIS_fnc_modWorks) then {
call BIS_fnc_makeModWork;
}
?
hey where did you get internal code, u leaker
I would never
!burgerpan @ripe sapphire telling me what to do 
I slipped lou $5 to never ban me
i made that internal code
he leaked my code
hey
im trying to make a leaderboard using a gui
i have a text widget on my gui
how to i set the text of the widget?
thanks!
any way to add an event listener for on unconscious?
or check if each enemy is unconscious?
https://community.bistudio.com/wiki/lifeState
( lifeState _unit ) isEqualTo "INCAPACITATED"
thanks 👍
I am looking for a way to override the invulnerability of units with hideObject true to enhance the future-soldier-like TTS Cloak script - basically I'd like to be able to deal damage to certain hidden units
im curious about the 'size' of data sent with public variables. is there any difference between
PUBLIC_VAR = player
PUBLIC_VAR = uid of player
PUBLIC_VAR = parseNumber uid of player
or does the scripting engine handle it all internally to keep things minimized
Is there a way to tell missile to stop tracking it's target? Similar in effect to successful flare.
It's all dependent on the way different values are serialized over the network -- I'm not certain of the specifics of those 3 cases, but generally things are kept minimized for better network performance.
Would probably want to ask Dedmen if you need actual specifics.
Is there a to define a vanilla sound as a music. I want to use the sound \A3\Sounds_F\environment\structures\church\worship with playMusic
I know how to add custom music with CfgMusic but I think just putting this file path doesn't work
it's not a file path if there's no file type in it
you implement it like any other sound, https://community.bistudio.com/wiki/Description.ext#CfgMusic, just have to provide the whole path including file type
What confuses me is, when I provide a path, root is mission folder, but this file is vanilla. Is there a way to do it other than moving it to my mission folder?
you just put @A3\Sounds_F\environment\structures\church\worship.ogg as the file path, not sure if with @ or \ at start but no need to copy it
Thank you! Will try
I saw that command, but i don't know if it will work with something like nil
objNull
nil will definitely not work, all commands fail upon nil input.
If the target is dead, it is ignored. The target has to be inside the missile's configured targeting cone for the command to work.
I don't thinkobjNullwill work, asalive objNullis alwaysfalseand as it resides at[0, 0, 0](if I remember correctly).
let's ask @still forum if there is an exception for objNull in the code
if object is null setMissileTarget does nothing and returns false
ah no
if arg1 is null.
If arg2 is null it "unlocks" the missile and returns true
\o/
@willow hound in yo face!
thanks - I will update the doc 😉
added, thanks y'all 🙂
hm
how come
when i do (side _unit)
on an opfor russian
it returns civ?
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
if (_killer isEqualTo player) then
{
hint str (side _unit);
};
}];
do they turn to civ once they die?
Yes somehow
is there a way to push the units id to an array, and then check if that id is in the array
/ identify the opfor by an array of ids
Yes but I wouldn't do it. I'll just store the original side using setVariable
ah thats smart
i only learnt sqf yesterday, does setVariable just give the unit an attribute?
and you can get it using _unit origionalSide?
Time to check BIKI - our beloved document
It could be a gibberish if you have a little clue to read the doc, but basically setVariable command does set a variable into some storage, getVariabledoes get
yea the docs are a bit confusing at times
i think i got it tho
_x setVariable ["originalSide", side _x];
_unit getVariable["originalSide", side _unit]) != east```
i didnt copy paste whole funcs
but they are in different bits of code
func too big to paste whole thing
Yup yup. You have an unwanted )but the basic idea is it
if ((_unit getVariable["originalSide", side _unit]) != east) then
mb
didnt paste whole line
thanks for the help 👍
side (group _unit) seems to be a frequently used workaround as well
I am trying to run this in the activation field of a trigger: baofficer doMove (getPosATL player); but it doesn't work at all. What could be the problem?
Greetings, anyone got insight on how to modify a variable? Im moving a marker on target every 10 minutes and i have side objectives that are supposed to shave a portion of that cooldown off. (im trying to make amount of sleep into a variable) What would be easiest way to do this or could i make every side objective reduce trigger timer by x amount and just repeat the trigger?
put a hint to check the trigger is actually triggered
what is the issue again?
Making sleep into a variable and having triggers reduce amount of sleep when triggered
and more broadly, player gets marked by a map marker every 10 minutes. Other players complete missions to make the marker update more often
HALI_SleepDuration = 600;
// ...
sleep HALI_SleepDuration;
// ...
HALI_SleepDuration = 60;
Okay thanks, ill try to get forward
If you know what factions are used in the mission you can use faction to determine who the unit belongs to - the unit's faction is always the faction of the base unit class, it doesn't change when dead/captive/regrouped/etc. You can find a unit's faction name by inspecting it in the config viewer.
why not just getNumber (configFile >> "CfgFactionClasses" >> (faction _unit) >> "side") then?
Not from the EntityKilled EH itself. You could combine it, or replace it, with an EH such as HitPart or Dammaged [sic] that does report the selection that was damaged.
Yes, that would work too.
I tend to use faction since in my use cases being more specific can be helpful, but if you want a more universal system then that's definitely the way to go.
I would still go with side group _unit
one could spawn an OPFOR group on blufor side for scenario purpose 🙂
Can i use count to count activated triggers from a list of triggers? Can i do something like this to process the sleep variable? _alltriggers = List[trigger1, trigger2, trigger3, trigger4,]; //list of triggers that complete tasks when triggered
_triggeredcount = count triggerActivated _alltriggers; // out of alltriggers, count the triggers that have been activated
MARKER_SleepDuration = 600*(1/(_triggeredcount2))-(_triggercount2); // uses amount of triggered triggers to reduce sleep amount
List[trigger1, trigger2]
list takes a trigger
private _list = [trg1, trg2, trg3];
private _activatedTriggers = _list select { triggerActivated _x };
private _activatedTriggersCount = count _activatedTriggers;
you cannot make up commands on the fly @chrome hinge
Oh that is very likely the case haha
can someone help me figure out how to do something...
want to have an addaction only appear on a unit if they are unconscious
this is very informative! can i also check at what time a trigger is activated and compare the activation time of that trg with the activation time of another trg?
Hey, I'm relatively new to this but have had some success. This one has me stumped I'm trying to get a trigger to replay a sound for a duration of time. Essentially "Playsound "soundx"; on repeat for about 2 minutes. What am I missing? This seems like it should be simple.
you could, but that's too much scripting for a trigger, better script everything, no?
What am I missing?
dunno, what have you tried?
everything has revolved around PlaySound within 200 meters of the trigger. I've set it to repeatable and set the trigger to be any player present
Also tried a "While True" scenario with a second or two sleep
Tried removing all scripts and using the build in sound trigger too on a timeout
Repeatable only means that the trigger can be triggered again
while true will run the sound forever (if spawned) but it could be the beginning of the solution IF the trigger is not set repeatable
what is the use case?
Don't understand the question, are you asking what I'm trying to do?
I've been scripting for like 2 weeks so I'm learning jargon still lol
what is the situation, your context, etc
in human words: don't tell me that you are trying to loop a sound every x seconds, tell me e.g "I want the alarm to sound as long as there is an enemy in the area"
Ah, okay I want players to get within a certain range of the trigger and then play a sound on repeat for 2 minutes
when they enter within 200 meters of the trigger, play sound
and if they leave, or leave & come back after these two minutes, it doesn't ring again, right?
Right, they won't based on mission goals so that's not important but technically yes
so have a trigger triggering on any player
and in its OnAct:
120 spawn { // 120 is the duration here
params ["_duration"];
private _timeLimit = time + _duration;
while { time < _timeLimit } do
{
playSound "mySuperSound";
sleep 2; // the sound duration
};
};
remove the comments ^^
got it
but yeah @heavy lily code has changed, time < _timeLimit
working perfectly thank you
damage handler and the the hit Selection
I put showWatch false; in initPlayerLocal.sqf, but I still can see watch when I press [O]. Then I tried run command via debug console, at after execution I no longer can see watch when pressing [O]. Is this command local or do I need to run it on server ( initServer.sqf ) ?
nope, it does not work with initServer.sqf either
same deal with showCompass false; it does not work until I run it via debug console
you need waitUntil {time > 1};
if it is mission-wide you could use description.ext
otherwise yes it might need a little timer
It does but still the code doesn't work.
Try using getPos player instead.
If it still doesn't work, it could be that either baofficer doesn't exist at the time the trigger is activated, or using baofficer with doMove isn't working because baofficer isn't local where the trigger code runs.
The latter could potentially be the issue if the trigger is set up to run client-side (if you're testing on dedi).
Thanks for the advice! It is a singleplayer mission I am working on.
Is there any way to check (before running doMove) if baofficer is available?
to move etc.
Available in what sense?
I mean, may be it is because baofficer is running an animation or something at the time of doMove?
If they're not unconscious or dead then they're typically going to try to follow a doMove.
Hmm. Then I will first check what Sysroot said
He definitely exists, the trigger is definitely activated and baofficer is reachable for other commands. Besides, I set up another soldier with the same commands, he moves. This is very confusing
Is there a way to stop the animation I set up in Eden editor? I suspect it is the reason
try move
_unit switchMove "" should reset animations when run locally to _unit
may or may not need _unit playMoveNow "" afterwards.
I tried move, I reset animatios as John Jordan suggested and even replaced the soldier. Still, it doesn't work in this particular situation
So what's the situation exactly?
setup how indeed
any clue on how to loop an animation?
hi, what's the current state of art process/script to populate a map with personnel at bases? Something available like https://community.bistudio.com/wiki/Arma_3:_Civilian_Presence for Civilians? I guess agents would be sufficient and preferred over full AI
Q: createVehicleLocal is creating "Sign_Sphere100cm_F" objects more or less like I expect, marking off a zone for 'FOB building' purposes. However, it appears to be changing the position "around" existing objects. Is there a way to avoid this without going to the createVehicle primitive? Note, these objects are for local machine area indication only, does not need to be a network object, in fact MUST NOT be. Or should I simply (re-)set its position after creation.
okay so short answer appears to be 'yes', but is there a way to create the object in the first place and not have it adjust for other objects.
Does anyone have experience with VisionModes from night vision goggles?
setPosASL it after creation
most likely someone on this server has
yessir, correct, post creation not during. seems to 'resolve' the issue. thanks...
not exactly, but you can ceil the legs damage with the HandleDamage event handler
It's the overall damage of the player and not the hitpoint damage of the legs.
that is incorrect, lou is right
I just tested it again, the speed of the character does get slower when the player has a higher damage value
I'm not talking about the limping
I'm talking about the animation speed of the running animation for example
You are slower when damaged over 0.1 damage and it gets slower with the damage value
did you try removing all damage from the legs and testing again?
yes
I have a question, where would be a good place to start looking into coding a script that uses persistence on a limited "virtual" arsenal, such as Jeroens Arsenal?
Ideally I'm trying to make it to where I can use a script I make to save all the items in said arsenal so I can just load it later in another mission.
Thank you for any answers 🙂
JNA stores all its persistent data in the jna_datalist variable.
Yea I search someone who can help me to create a new VisionMode for a Bodycam Overlay
Hi again. I think I got unitPlay working after some fiddling, but now I'm trying for a different effect.
I am attempting to make a repeatable trigger that teleports a player using setPosATL but nothing I've done has worked at all in the editor.
First I tried this...
Type: None
Activation: None
Repeatable: Yes
Server Only: No
Condition
player inArea thisTrigger && !(playerside == west);
On Activation
vehicle player setPosATL [10134.3,5202.73,5.31129];
And I've since tried various combinations of type/activation (anybody, any player, server only etc) along with vehicle player in thisList but no luck. Should I be trying this on my dedicated server or am I doing something wrong here beyond that? TY in advance btw.
baofficer is set to play animation "briefing point table" or something from Eden editor. In the trigger, I reset animations and use doMove. It doesn't work. I tested it without animation, it works everytime.
Why playerside? Should be side player.
I'm not sure; it was taken from the bohemia forums. Thank you, I will try that now 🙂
You can also optimize the condition, the magic variable thisList automatically contains a list of objects in the trigger's area.
Condition: player in thisList && side player != west
caveat being that you'll want the activation type to be Present
I really appreciate the help. For some reason, I still can't get it to teleport in the first place. Here's what I'm working with:
I also tried Activation: None,
and here's the actual trigger in the editor if that's any help.
You need select who you are teleporting.
_playersInThisList = []
{
if (isPlayer _x) then {_playersInThisList pushBackUnique _x}
} forEach thisList;
_playerInThisList setPos [10134.3,5202.73,5.31129];
And if you want teleport vehicle where player is then
To get vehicle (example from wiki
if (vehicle player != player) then { hint "Player is in a vehicle" };
Should be working fine with just player seeing as it's a local trigger.
Should I put the top one in On Activation, or Condition? my apologies, I am very very super novice
Do you think it could be a mod/terrain issue conflicting?
Aa true. Sry I miss that one, there is no server Only [✓]
Just tested it on my end. Switch the activation type to "anybody" instead of "any player" and it should work.
No luck 😦 does this look right?
You are testing with a player on the east/opfor side, yes?
oh no lol. I have been using blufor. != west means NOT blufor doesn't it?
Correct
🤦♂️ I am so sorry lmao
No worries 😛
if i get rid of ## side player != west will that fix the issue?
That will make it apply to any player regardless of side
yeah that's fine :)
👍
now I am well and truly confused. I removed ## side player != west from the Condition and tried it with activation None, Anybody and Any Player to no avail 😭
It's now Condition: player in thisList
and On Activation: vehicle player setPosATL [10134.3,5202.73,5.31129];
Do I have to test it on the running dedicated server or should it work in the editor?
ok so I finally got it to work and this is what fixed it:
the actual placed point of the trigger (the flag icon) was floating above the floor
Ah yeah that'll do it
and for it to work I think it has to literally be snapped to whatever surface it's on. I moved it outside on the grass and it worked
I thought it took the actual 3d shape (the cube or ellipse) to be the area it recognized
Some background for that -- the center of players' models from the game perspective is on the ground between their feet, not at their actual center of mass
and it's the center that triggers look for
ohhh my god
and i had it just barely above the floor yeah
again I seriously appreciate it @tough abyss you are a life saver
I will have many to come I'm sure, I just started integrating scripting into my zeus missions a couple weeks ago and the capabilities are astounding 😃
what namespace are global variables stored in?
missionNamespace by default
hmmm
welp time to check all my code and pull some hairs out
Can help you, if you want. What's the issue?
can help pulling hair
JFYI playerSide is more preferred in some cases over side player
Most common example is the renegade state. When BLUFOR player killed enough friendly bots or destroyed friendly vehicles their 'player side' will be 'enemy' (renegade) while 'playerSide' still be 'west'
tbh completely forgot that playerSide is an actual command, it not being camelcase didn't help
thanks :)
Hello guys, I need help really quick pls.
i´m currently scripting on a mission containg a trigger with long (i mean really long) TrigggerStatements. So at first i made everything with: setTriggerStatements ["","",""] and the code in between then quotes. The Problem is in Npp++ all the code becomes green because it being text. I know that it is possible to do it with code: setTriggerStatements [{},{},{}] and I have a trigger that works with code. But erverytime i´ll try to do it the second way i get an error that says: Type Code, expected String. does someone know why and can help me?
alternative syntax of https://community.bistudio.com/wiki/toString converts code to string
trg_maxfuel setTriggerStatements ["dynamic_fuel > max_fuel_storage", {dynamic_fuel = max_fuel_storage; hintSilent "maximaler Treibstoff erreicht";},""]; // -> this works
_nametrg setTriggerStatements ["this",{
_activated = thisTrigger getVariable "alreadySpawned";
_subarray = thisTrigger getVariable "_subarray";
_subArrayIndex = thistrigger getVariable "_subArrayIndex";
_countactivated = true;
thisTrigger setVariable ["alreadySpawned", "true"];
},"_countactivated = false;"];
// ->but this doesn´t
how to post in sqf again?
```sqf in one line
Does he need add in code block double " or single ' to strings
and another set of ``` to close it off afterwards
the second one always gives me the error Type Code, expected String, the first one doesn´t .Second one works fine in quotes but i cant keep overview when everything is green
and i just dont get why 😭
i also don't get why. The first version errors out on me just as well
i wrote the first one some versions ago but i know it worked. maybe different version?
and how can i make it work? any hints for that? because i definitely need that syntax highlighting
or maybe trg_maxfuel doesn't exist and the string gets skipped altogether 🤷♂️
no worktedfor sure
toString is the answer. ```sqf
_nametrg setTriggerStatements ["this",toString {
_activated = thisTrigger getVariable "alreadySpawned";
_subarray = thisTrigger getVariable "_subarray";
_subArrayIndex = thistrigger getVariable "_subArrayIndex";
_countactivated = true;
thisTrigger setVariable ["alreadySpawned", "true"];
},"_countactivated = false;"];``` doesn't error out 🤷♂️
thanks mate. hopefully that´ll do it. Since the tigger does contain about 200 lines of code when it´s ready 🥺
you can also call function from the trigger: ```sqf
_trg setTriggerStatements ["this", "call myTriggerCode", ""];
yeah, good idea as well thanks 🤔 🙂
thanks to all contributors. Now it works flawlessly and i´m able to keep track of my code since i have syntax highlighting
I have another Problem which is now occurring inside the trigger mentioned above: I have 4 While lops which do something according to 2 variable statuses. They work fine most times but triggering a certain problem with changing the variables in a special order the while loops get triggered even if their condition is not meet and the one which condition is meet does not trigger. I can post the code , but it´s to long for discord chat. So maybe someone could help me in a voice channel.
Hi All, using this script to create a task. But can't get the task hidden. Tried true and false in the last parameter but still same result, once the task is created it shows up on the map aand in 3d
[grp1,"task2",["Task 2 Briefing Description", "Briefing Title"],(getMarkerpos "mkr1"),"ASSIGNED",1,true,"SCOUT",false]Call BIS_fnc_taskCreate;"mkr1" setMarkerAlpha 1;
you can post pseudo code and/or use https://sqfbin.com (but don't post your whole stuff where we have to guess what is what, thanks)
don't create it
or set the destination to objNull - see https://community.bistudio.com/wiki/BIS_fnc_taskCreate
I did it in sqf bin. Something is of with the tabulators. Hope thats not a problem.
https://sqfbin.com/tukeximejazotemonayo
I also could explain the Problem more and show a stream if needed.
@winter rose Thanks for heads up re code. Let me try the objnull approach. I do need to create it since i need to be able to update its state.
a created task will appear in the tasks list - if you only want to hide the destination, then yes use objNull
any scripts for a full-heal zone? Tried making my own and failed miserably
{ _x setDamage 0; [objNull, _x ] call ace_medical_treatment_fnc_fullHeal;} foreach thislist; //-> this is perfect to put in a trigger if you use ACE
{_x setDamage 0} foreach thisList; //-> this is perfect to put in a trigger if you don´t run ACE
But the first one only works if u use ACE
Does this "full" heal with ace and wake up player which is unconscious state?
yes it does
That should work better. Just need to pass it the _thisTrigger and _subarray vars
thank you very much. I´ll have a look at it tommorw
👍
is someone really good at programming with ai to make them do what they are supposed to? Because I always hat a low of trouble since they weren´t really listening to orders via script. Nee dit for my current project which is going to involve a hell lot of ai programming
Q: am I correct in understanding the BIS_fnc_relativeDirTo function does the translation one object to another. i.e. _to being direct front of _from should yield 0, aft should be 180, correct? thanks...
https://community.bistudio.com/wiki/BIS_fnc_relativeDirTo
Looks like it, yes.
All of the AI commands are fairly approximate in their behavior. Getting AI to perform things in finely-tuned ways is difficult if not impossible in most scenarios.
If you provide details as to what you want them to do, people may be able to help you, but the AI have some unavoidable limitations at times.
And in some cases limitations that can only be bypassed in unreasonably painful ways.
As is the arma way
with Dynamic Groups is there a way to control what patches are assigned to the groups ?
I have a question 🙂 is there a way to prevent a trigger from activating/fulfilling its condition— like "locking" it. And then mid-mission (via Zeus) being able to "unlock" it and make it activatable again?
E.g. I have a trigger that is activated by someone being present inside it. But I don't want this trigger to be active right at the start of the mission. I would prefer to, at the right time, make it able to be activated and perhaps lure players to its activation region.
maybe giving the trigger a variable or something and using that? I am very new ofc
that's just brilliant 💡 function of...
private _defaultAlgorithm = { _x; };
params [
["_from",objNull, [objNull]]
, ["_to",objNull, [objNull, []]]
, ["_algorithm", _defaultAlgorithm, [{}]]
];
private _relativeDir = [_from, _to] call BIS_fnc_relativeDirTo;
private _x = _relativeDir;
[_from, _to, _relativeDir] call _algorithm;
which default passes the result back. or can be used to filter whether _aft...
private _aft = [_source, _target, { _x >= 90 && _x < 270; }] call MY_fnc_relativeDirTo;
Have its condition also include a variable being true/trigger being activated, then set that variable/activate that trigger.
(yourVariableName) && {this}```
^ requires that `yourVariableName` is `true` and that the trigger's configured condition be fulfilled
```sqf
(triggerActivated yourOtherTrigger) && {player in thisList}```
^ requires that `yourOtherTrigger` be activated and that the local player is in the trigger area
I'm not sure if there's anything to do it at the group level, but you can change the insignia for the units in the groups with https://community.bistudio.com/wiki/BIS_fnc_setUnitInsignia
So for example I could make a different trigger and make its fulfillment criteria, say, a unit being killed? And place that unit far off away somewhere. Then in my current trigger I put that bottom condition (triggerActivated yourOtherTrigger) && {player in thisList}
With the right names of course
Yes, that's the general principle. Obviously replace player in thisList with whatever you want the actual condition for activating the trigger to be, or this to use its configured condition
funny enough that's exactly what I'm using 😃 thank you very much
Note: pay attention to the ( ... ) && { ... } structure. This is used for lazy evaluation with the &&/and command. It means that the code on the right won't even be checked until the code on the left returns true. If you don't use it (e.g. condition1 && condition2) both pieces of code will be run every time it checks, which can be very frequently with triggers.
Using lazy evaluation is a great way to optimise for performance, since the right side doesn't have any perf drain when it's not being run at all, but you have to make sure you put things in the right order otherwise it may be pointless (or get blocked completely at the first stage, depending on what the code is).
that's incredibly good to know, I appreciate it, I'll write that down
while I'm at it, if I want to hide/show like 10+ objects at once, is there an easy way to put that in an array? instead of say, this:
b1 hideObject false; b2 hideObject false;
and so on and so forth
{
_x hideObject false;
} forEach [b1,b2,...];```
Be aware of the locality of the `hideObject` command; it has local effect, meaning that in a multiplayer game it will only cause a change on the the machine where the code is being run. In order to make global changes, you need to either have the code run on all machines, `remoteExec` the command, or use `hideObjectGlobal` (_only on the server_).
Q: if I have a camera object viewing in a particular vector (direction) to a target object, I want to get that direction, so I can do some translations involving the target object direction.
is it possible to do something like _camera getDir _object or is there a camera command I need to use?
may I ask how one would run hideObjectGlobal only on the server? I've been trying to find out how to do that but have come up empty with my searches 🙁
Thanks again btw
If it's a trigger, and it's safe for the condition to be evaluated only on the server, use the Server Only checkbox in its attributes. For other scripts, you can use initServer.sqf, or an if isServer then { ... safety check, or remoteExec with target 2.
huh interestingly...
_x = my_logic;
_camera = _x getvariable ['_camera', objnull];
_selection = _x getvariable ['_selection', []];
_y = _selection#0;
[typeof _y, _camera getdir _y, _camera distance2d _y, getdir _y];
// ["Land_HBarrierWall6_F",316.011,40.7009,276.671]
Amazing 😄 the trigger works perfectly btw.
You can use vectorFromTo (to get the direction from the camera to the object) or probably vectorDir to get the actual direction of the camera since there doesn't seem to be a special command for use with cameras. I would not recommend using getDir since it is in degrees, not vector.
Note: player in thisList is not an example of a condition that's safe to evaluate only on the server, since player does nothing on a dedicated server machine - it has no local player.
goal with all that is to calculate whether mouse to world position is 'above or below' on screen the object.
or perhaps I could go the other direction, object POSITION and convert to screen coordinates relative to mouse, but I am already converting mouse to world, so I am working in those units of measure.
can you help me ?
Well if you know the world position of the object, and you know the world position of the mouse, then this should be pretty easy, no? Just compare the Z component of the two positions. Maybe some checks on the X and Y also, to see if they're close enough to be "under" rather than "lower altitude but somewhere else horizontally", but that's also not too hard.
I was a little confused, my player in thisList trigger was actually a different one I had for teleporting (which does not have Server Only checked). The one I was working on with you actually just had a this condition with BLUFOR present.
Is there any documentation you could direct me towards on the concept of a 'safe' condition? just to make sure I can avoid those mistakes in the future, regardless :)
Hello, can you help me?
My problem is that I put mods on my server, when I log in I have access to the modder weapons, but the players do not have access to them
It's not really a specific defined concept, it's just a way in which you can describe things in this context. It depends on locality of the commands you want to use, and how you want the trigger to work.
It's not safe to evaluate only on the server if:
- you need the trigger to activate locally on one or all clients, because of locality requirements or because you want player-specific effects
- the trigger condition can only be true on one machine which may not be the server
- the trigger condition relies on a command that doesn't work on a dedicated server
It sounds like the mods are loaded on the server but the players don't have them installed. Mods that add new assets must be installed on all clients to work. However, this question isn't really to do with scripting, you'd be better off in #server_admins
assuming both are 'on the ground' that is one thing, but the object may be 'under cursor' yet also raised at altitude... so a bit more confusing.
Oh, you want above or below in screen space. Okay, well, in that case yeah just convert the object world position to screen position. https://community.bistudio.com/wiki/worldToScreen
It's super easy.
Yet the person who joins the mods activated on his game
Then you may have a deeper problem. However, the place to solve this problem is #server_admins
another attribute I need to leverage is in world real distance. mapping this as object Z component, relative distance to target. not unlike the A3 editor, holding the ALT key down, etc.
So.........distance between the mouse world pos and the object world pos?
I guess I'm not understanding why this is a difficulty. You can just...do that.
no worries, it is a couple of moving parts, just sorting it out now on paper
What's the possibility of making a drone that follows you around in game without the use of another player controlling it? Similar to an AI drone but it simply follows you based on commands given by a "control pad".
I was going to say "easy" and then you added "control pad" at the end.
The idea I'm thinking is having it being able to follow specific directives given by the control pad, "Stay Right" it'll keep drone on the right side of you. "Hold fire" pretty obvious. "Keep Front", drone will attempt to stay in front you.
Based on current facing or something fancier based on direction of recent travel or relative enemy position?
Imagine being in a street right, you got a big drone that can act as a wall as you advance up the street, or in an open field where you can put the drone between you and the zeus controlled AI who are hell bent on making you holier than swiss cheese.
Oh, like a UGV? That's much harder because ground vehicles are really bad at precise movement.
Doesn't have to be precise, just has to work. And yes, a UGV.
I'm currently working out the logistics on what a proper drone swarm or independent and or semi autonomous drone system would look like.
All drone stuff other than direct player control still relies on the usual Arma vehicle AI. So...don't expect too much.
What's the feasibility or if at all possibility to make it better?
zero, unless you are controlling the vectors/velocities yourself -- and then using it only in Singleplayer because controlling movement manually is not smooth in MP
Is there anyway to force the view distance on a MP mission? setViewDistance doesnt seem to work, it allwais takes the player vd
For who?
for all the player
Run setViewDistance on the server. Wait. Run setViewDistance on the clients. Don't run any mods :P
So, it can only be contrones on by the server config?
Server view distance caps client view distance.
But live setViewDistance does work, IIRC.
Just not sure on the propagation/negotiation mechanisms.
I just want to put the vd on 500m, and I cant change the server config
Nothing else
hmm. Reducing should work.
how?
You can always set clients lower than the server.
setViewDistance 500 on the clients.
but where I place it? on the mission init does not work
Well, check if it works in the debug console?
Some things don't work on mission init because it's too early.
it does work on console
do you use ace
Looks cool, but are the bullets still hitting the target? Or will they drop below it as they are aiming for a closer target? Couldn't really see it in the video.
yes, roughly as effective as the other. i did have to adjust elevation for distance. basically bumping the intermediate target up 0.1 for every 100m of range over 300m, roughly ...
how do you turn a c17 into a static object like the static c130 in CUP?
One way is at the config level, making it an "object" rather than a "vehicle". That requires a mod.
Another way is to make it a Simple Object. The easiest way is to use the Simple Object checkbox in the Editor, but scripted solutions like createSimpleObject exist. Simple Objects are static but not destructible or physics interactive. For a similar effect you can also disable simulation.
If you want it destructible and physics-y, but not accessible, just lock it.
Ok thank you!
greetings
private _music = list [Music_Battle_Human,LeadTrack03_F_EXP,LeadTrack02_F_EPA,LeadTrack03_F_EPA];
private _randommusic = _list select { _music };
thisTrigger setVariable ["TAG_cooldownmusic", true]; thisTrigger spawn {
[_randommusic, 0, 1] call BIS_fnc_playMusic;
sleep 300;
_this setVariable ["TAG_cooldownmusic", false];};
Im trying to pick a random music piece from a list, any insight on what im doing wrong?
list [array] isn't a thing in SQF afaik
_list variable isn't defined anywhere
_list select {_music} doesn't make much sense in general. This version of select takes array on the left and code that returns boolean on the right 🤷♂️
_randommusic wouldn't be defined inside the spawned code even if it actually contained anything
Music classnames have to be strings
private _musicList = ["classname1","classname2"];
private _randomMusic = selectRandom _musicList;```
There's a start on the basics. I don't have time to talk about the rest, but I'm sure artemoz has got you covered.
Hey there! Does anybody got an idea how to use "a3\characters_f\civil\data\c_cloth2_v3_co.paa"? I already found out, that the matching clothing is "U_C_HunterBody_grn". But unfortunately I am not able to get a texture on it. Any ideas? 
got 'er sorted, thanks... I lock on to a root mouse world translation, then track a mouse event current and take simple distance differences. works pretty decently actually.
And then come the drones
no drones in WW2 😛
Until somebody configurates a horse as one 🤣
does someone know a fast and easy way to spawn Compositions? everything i found online doesn´t really work or doesn´t save dependencies (position, attached objects and their rotation) or init code.
can sqf do if-else-if-else? such as
if ( buildtype == 99 ) then {
_classname = FOB_typename;
} else if (buildtype == 98) then {
_classname = CAMP_typename;
} else {
//...
}
It cannot, but for what you're doing, you could use a switch case
ahh ok that explains the error
cant´it ?
You can put another if inside the else case of the first if, but there is no actual if-else-if
and yeah your right a switch should work fine as well
//i mean you could use this as well:
if (condition) then
{
}
else
{
if (condition) then
{
}
else
{
};
};
true, would a switch or nested if-else be better/faster though?
This is what I would be doing
switch (buildtype) do {
case 99: { _classname = FOB_typename; };
case 98: { _classname = CAMP_typename; }
default {
_classname = ((KPLIB_buildList select buildtype) select buildindex) select 0;
_price_s = ((KPLIB_buildList select buildtype) select buildindex) select 1;
_price_a = ((KPLIB_buildList select buildtype) select buildindex) select 2;
_price_f = ((KPLIB_buildList select buildtype) select buildindex) select 3;
_nearfob = [] call KPLIB_fnc_getNearestFob;
_storage_areas = (_nearfob nearobjects (KP_liberation_FobRange * 2)) select {(_x getVariable ["KP_liberation_storage_type",-1]) == 0};
[_price_s, _price_a, _price_f, _classname, buildtype, _storage_areas] remoteExec ["build_remote_call",2];
};
};
I also wanted to check, in sqf switch doesnt need breaks?
i think switch is the cleaner version.
alright
It does need a ; after case 98
ah woops, thanks lmao you caught it as I started building the pbo
Q: with the communication menus, and the CMD argument, does the cmd_hide_menu (-3) option also invoke the script ["expression", "..."] when present?
https://community.bistudio.com/wiki/Arma_3:_Communication_Menu
is there anyway i can change the timeout threshold on ACE and its dll files?
ACE? you could try asking in the ACE discord... best of luck...
Could you send me a invite?
It's right there in the docs...
https://duckduckgo.com/?q=github+arma+3+ace&ia=web
DuckDuckGo. Privacy, Simplified.
can anyone help me understand why a variable I have certainly defined is nil?
I have 2 variables, im basically try to duplicate variable 1.
in save_manager.sqf on line 74-77 I have
// All FOBs
GRLIB_all_fobs = [];
// All CAMPs
KPLIB_all_camps = [];
in the same file on line 189-190 I assign those variables to the following array data
GRLIB_all_fobs = _saveData select 9;
KPLIB_all_camps = _saveData select 22;
finally on line 517 of that file I define both variables as public variables.
publicVariable "GRLIB_all_fobs";
publicVariable "KPLIB_all_camps";
why is KPLIB_all_camps nil in any other file I try to use it in?
it should at the very least be an empty array right?
Are there 10 items in the array? much less 23? unless you did something like:
_saveData params [
""
// for the first 22 items
, ""
, ["_camps", [], [[]]]
];
yes, its an array of arrays
[
kp_liberation_version,
date,
_objectsToSave,
_resourceStorages,
_stats,
_weights,
_aiGroups,
blufor_sectors,
combat_readiness,
GRLIB_all_fobs,
GRLIB_permissions,
GRLIB_vehicle_to_military_base_links,
KP_liberation_civ_rep,
KP_liberation_clearances,
KP_liberation_guerilla_strength,
KP_liberation_logistics,
KP_liberation_production,
KP_liberation_production_markers,
resources_intel,
_allMines,
_allCrates,
KPLIB_sectorTowers,
KPLIB_all_camps
]
the KPLIB_all_camps array will be empty in the beginning but that shouldnt matter right?
you do understand the LIB architecture right? loading from saved data, then saving periodically...
yes, even when saving after mission start there wont be camps in the beginning, camps are basically mini FOBs and will need to be built later on so until players build them KPLIB_all_camps should stay empty
or am I misunderstanding something here? I am not crazy familiar with sqf or game programming
I have been slowly learning it
HTH, you want to follow up with any germane questions, OT, in the LIB forums, or elsewise sidebar. cheers 🍻
been trying to get setWeaponReloadingTime to run on a fired event handler, but the first item in event handler array is returning the player that's and not the AT launcher turret i'm trying to apply the command to
this addEventHandler ["Fired",{
_vic = _this # 0;
hint str _vic;
}];```
like this debug code just returns the player instead of the object i'm running this from in the init
kinda confused
adding vehicle before the _vic variable just returns the exact same thing
It should return the vehicle if applied to a vehicle. Are you absolutely 100% certain you've put it in the init of the turret and not the unit in the turret?
when i run this it returns my player twice??
this addEventHandler ["Fired", {
private _vic = getShotParents (_this # 6);
(_vic # 1) setWeaponReloadingTime [_this # 0, _this # 2, 0];
hint str _vic;
}];
and then if i change the var name of the at launcher in the editor it returns [var name, player name]
yes
I have a funny feeling this is a behaviour of str when used on objects with no variable name, and not a problem with the EH. I think it's actually returning a reference to the correct object, but when a vehicle has no variable name, str uses the identifier of the effective commander.
Place an ordinary car with the player in it (no variable name for the car), play the mission, remain in the vehicle, and do str vehicle player in the debug console. See what it says.
yeah it's doing the same thing
Trying to chain together a couple of submenus, but not getting the -5 (cmd_exec) expression, only the linkage to the submenu...
How do I connect those dots? And I need to remember the choices, options, etc, at every menu choice.
Right, so that's a str thing so it's cosmetic only. The EH is returning a reference to the correct object and other commands will understand it properly.
I bet this AT launcher has 1rd magazines and you load a new magazine with each shot
_this select 0 setWeaponReloadingTime [_this select 7, _this select 2, 0] this should work, assuming you add the EH to the vehicle
that's what i've been using
this addEventHandler ["Fired", {
_this # 0 setWeaponReloadingTime [_this # 7, _this # 2, 0];
}];
no error messages but no change in reload time
It won't if the AT launcher has 1rd magazines and you load a new magazine with each shot, because setWeaponReloadingTime affects the intra-magazine reload, not the inter-magazine reload
how many shots does the magazine have?
i.e. time to load next shot in mag, not next mag
what Nikko said
remove and readd
I mean I guess the end goal is to add it slower
cause vanilla reload time is way too fast
there is no command to change reloading time between magazines - only between shots (what you are using)
on the bright side i've learned how to make the marshal have a minigun autocannon
The best you can do without changing the weapon's config is take away all the spare mags, and add a long sleep (in spawned code, no suspending in EH code) before giving them back. This will obviously not be reflected properly in the weapon HUD, so it may be confusing for players.
add some custom ui on top of that 😄
not worried about that, probably only going to use these with AI
It may also be confusing for the AI. Best to lock the turret so they can't abandon it because they think it's out of ammo.
Anyone have any idea? 'expression' and -5 (cmd_exec) do not seem to be working with a menu directing to a submenu.
Code snippet, not in CPP obviously: https://online-ide.com/I6Zs0rYlEd
The menus do show up correctly, that much I know is working. Also the player action kicking the whole process off, also works.
But I am finding the expressions are not being invoked.
Build and Run your code instantly. Online-Ide is a quick and easy tool that helps you to build, compile, test your programs online.
okay spoke too soon... the last expression, in the last menu in the chain, is invoked. the first two preceding that one, are not invoked.
I could work around it perhaps by disconnecting the submenus in name only, i.e. the chaining via the callbacks, etc.
@dreamy kestrel From my brief overview of the command menu system (as I've never personally worked with it before), I get the impression that menus with submenus don't have their expressions executed
which would match up with the fact that only your menu without a linked submenu seems to be executing
if I interpreted the situation correctly, that is
now, assuming the execution in that case is handed off to the submenu, you could check the id param passed to the expression to handle behavior switching
but once again, guessing based on various things
Just a general question but is there a sample of the AR-2 darter? I don't see any way of finding a drone sample if there isn't
what you mean by sample?
Arma 3 tools provides samples of animals, characters, cars, houses, helis, planes, tanks and more but there are no drone samples
so people can learn from how they're made
sure, appreciate the attempt. this is a not so often used area, I think. the what now? what args are you seeing? I could be missing something there...
Well what do you want to do? Modelling? or doing configs?
both lol
According to the communication menu page, the expression receives the following parameters: [caller, pos, target, is3D, id]
right I saw those, but I am not sure how that relates to the trailing expression.
so, assuming the parent triggers the expressions of the sub-menus, you could detect it by checking if the id matches that of the parent
but that assumption is not proven
either that or the parents of sub-menus just can't have expressions or something
in which case
¯_(ツ)_/¯
also I am not using any of the BIS functions... so SMH dunno... it would not be the worst thing to handle the forward and backward navigation manually and just drop the submenu linkage. I may just do that.
@tough abyss turns out as I suspected not such a big deal to wire up the menus manually in series, forwards and with back actions as well. cheers m8 ty for looking.
👍 glad you found a solution
need a way to get the exact position of the muzzle of a units weapon
Do you mean you want one?
Im a bit confused, and maybe the scripting channel is not the ideal place for this question itself but:
What would cause a group reported as "flag" entities (I assume virtual or logic?) to be created in the exact same place as another units?
Is
object1 attachTo [object2...];
creating some sort of AI logic in place to represent the attachment tot he object?
Or are helper objects considered AI logic?
Asking as that kind of groups return in the allGroups array and need this bit of info in order to accomodate code loop
Some helper objects may be logics, it really depends on their purpose and who made them.
Modules are logics but I don't know if they appear as groups/units. BIS_fnc_ambientAnim creates logics on unit positions if you're using that.
Some mods may use logics to do invisible stuff.
yeah, modules are, according to BIKI, not listed in allGroups.
Might be the helpers itself, im using the pointers from base A3 (triangular arrows) so that might be it
I'm pretty sure those are just normal objects
How do I check if a position point hits the geometry of an object
I want to measure the width of an object
of an fence
I guess with boundingBox ?
I use boundingBoxReal
private _p1 = _bbr select 0;
private _p2 = _bbr select 1;
private _maxWidth = abs ((_p2 select 0) - (_p1 select 0));
private _maxLength = abs ((_p2 select 1) - (_p1 select 1));
[_maxLength,_maxWidth]```
yea works
couple of https://community.bistudio.com/wiki/lineIntersectsSurfaces from opposing sides if you need the width over specific direction/line
boundingbox does the job
is there also a way to check if the object has workable surface ?
I have a question about the attachtTo command. Is it possible to attach a respawn (call BIS_fnc_addRespawnPosition;) to an object?
no but you can move/attach the object you give to BIS_fnc_addRespawnPosition as position
@torpid mica
but moving it every ... seconds does cost more performance that attaching it right?
Any way to smooth out door animations when using attachToRelative? doors open in steps. I tried setting the visual argument to both true and false to no avail
attaching to non-static objects, apparently 🤔
When an object is attached to something, it inherits the simulation type, and therefore simulation tickrate, of the object it's attached to. This affects animations.
Woah alright, i've always been using invisible helipads for this. thank you!
is it possible to get the submunition of ammo when it detonates?
Hello! is there any (easy?) way to make missiles such as HARMs visible on radars to give the ability to the SAM sites to intercept them?
nvm i found it
no
you'd have to make your own radar ui for that
//player1FinishTime etc. are the variable for the time when a player activates the finish trigger
_allFinishTimes = [[player1FinishTime, player2FinishTime, player3FinishTime, player4FinishTime, player5FinishTime], [], {_x}, "ASCEND"] call BIS_fnc_sortBy;
result: [any,any,any,12.352,13.363]
how would i exclude "any"?
well that sucks
isn't there a property to make a weapon visible to radars or is it like hardcoded to not show any arms ?
how can i change my respawn hight? I tried to playce the marker high up in the sky but even then i respawn on the ground.
I just need to set my respawn position (from only one respawn point which is moving) to a very precice location to activate a trigger when that respawn point is selected
hopefully someone can help me 🥺
theoretically I just need a trigger that is activated when I use a specific spawn Position
You should be able to set the height like this:```sqf
_mpos = markerpos "YourMarkerNameHere";
[west, [_mpos # 0, _mpos # 1, 700 ]] call BIS_fnc_addRespawnPosition;
700 is the height (ATL)
whats the difference between GroundWeaponHolder, WeaponHolder, WeaponHolder_Single_F etc?
thank you very much. How can i then move the created spawnpoint ? because setPos always outputs an error
WeaponHolder has scope=0 (private?)
GroundWeaponHolder is the same, but with scope=1 (hidden?)
WeaponHolder_Single_F has different p3d model that should (iirc) only show the first weapon in container and no ammo
for that I think you need object instead of the coordinates
don't forget WeaponHolderSimulated 😉
is there any way to return the object. because i definetly need to make it move with an vehicle
if you know what object you are adding to the BIS_fnc_addRespawnPosition then you must also have a handle (variable) to it
but doesn´t that object is only used for the start Position? If I move the object the spawnpoint stays in the startpoint i think
WeaponHolderSimulated has PhysX simulation, so your dropped RPG can roll down the cliff
it should follow the vehicle , maybe its different for static objects
if i set the position to a object directly i spawn besides the object.
For illustration: placed a vehicle, created a trigger on top of it, attached the trigger to the vehicle (including offset) then
used getPos and you code -> spawn at the perfect spot but when i move the trigger (aka the vehicle) the spawnpoint stays.
if i set a object as referenc (in my example the trigger) i spawn besides the car (under the trigger).
mybe you could give me another hint how to properly keep the position and also refer to the object. I´m just to dumb 😦
[west, myRespawnAPC] call BIS_fnc_addRespawnPosition;
myRespawnAPC setposATL [1000,1000,0]; // Should move the respawn position
I might have an idea here, can i make this radar(or any object) act like an actual radar and show up on planes' rwr?
blufor reportRemoteTarget [yourRadarObject, 60];
thanks mate! Can I use that command on missiles/bullets or do i have to create a separate object following the weapon?
This command cannot be used on projectiles
i don't think it will work on static objects like that
so i have rhs mod, i know that you can _anyWaypoint setWaypointType "SAD" for example
but how you set RHS infantryparadrop on a waypoint via script?
https://i.imgur.com/gtVPMSQ.png
that would be so cool to just spawn in Paradrop Planes via script 🙂
i tried to google this, but couldnt find anything about it
ok the type is "SCRIPTED" but now i wonder how to insert a script into a scripted waypoint 🤔
thanks! ❤️
_wp1 setWaypointType "SCRIPTED";
_wp1 setWaypointScript "\rhsafrf\addons\rhs_c_air\scripts\WP_ParaInf.sqf";
_wp1 setWaypointCompletionRadius 100;```
if you care


