#arma3_scripting
1 messages · Page 671 of 1
{
private _owner = _x getVariable ["owner", ""];
if (isNull getAssignedCuratorUnit _x && {_owner isNotEqualTo ""}) then {
private _ownerObj = missionNameSpace getVariable [_owner, objNull];
if !isNull _ownerObj then {
_ownerObj assignCurator _x;
}
}
} forEach allCurators;
Uhhhhh
idk
Will this work?
i think what you input in "owner" box in editor, is saved in "owner" @ logics namespace
Or sorry, find and un/reassign
it should assign units to their corresponding curator logics
yes
Wilco
private _ownerObj = missionNameSpace getVariable [_ownerObj, objNull];
???
@robust brook thx
@tidal ferry edited, sorry brain stopped working
yea then it won't
player UID is just a number
you can just search among players and find the uid
yup
I think that's what it is
I think it might work
Can be an object's variable name, player UID or you can use #adminLogged or #adminVoted to give access to the server admin. In singleplayer, player will automatically assume control of game master module when this field is left blank.
how can i flag or tag some different units in the editor with the same value to send them into a array?
@little raptor Thanks for the huge amount of help you gave me with this. Here is the pretty much finished product.
https://vimeo.com/532711065
np
btw what mod do you use for the lighting? it looks cool!
I think it's Real Engine. I can send you the modpack if you want
I honestly don't know if that's a mod or not
I think it's base game arma just at the "Golden hour" time for arma.
I see. thanks
this code works, but it seems wrong:
private _hcgroups = [
[x1],
[x1a],
[xbd1],
[xbd2],
[xbd3],
[xbd4],
[xbds1]
];
{
_x params ["_xItem"];
player hcRemoveGroup _xItem;
} forEach _lootTable;
yeah i just filled the _loottable with a dummy for now.
guerilla coding.

no need for params or []
thx
how frequent is too much to send a public variable. even if the public variable is something simple like a single string?
cause I kinda need to send it every 2 seconds... if that's too much i'll have to think of another way
2 seconds is ok I guess
I think you should also consider the ping
the maximum (normal) ping I've seen is around 350
i guess i could rewrite stuff so it runs locally on every machine. just wanted to minimize the loops running on each client
Better to run a loop on a client than on the server. Really depends tho
well its either have...2, two second loops running on every machine, or 2 loops running on the server and a public variable being sent out for many units every 2 seconds
Every machine as in all clients ?
yeah
Spamming a PVAR every 2 seconds would be worse
mk gotcha
Hello, I have a question, how can I get the AI to make an animation of an addon?
do you have the class names of the animations that the addon created?
I don't remember at the moment but it belongs to a ww2 static animations addon
well once you figure them out, you can use playMove or switchMove or BIS_fnc_ambientAnim
Tried with switchMove but the animation takes a second and turns off
use loop animation that stays
Thanks
looking into more advanced module stuff. is there a way I can get all the available stored variables in a logic? I have the logic object to reference it.
And i'm back, new day new issue; Creating a toggle Follow/Stay add action and keep getting an error about values not created when trying to remove the remoateStay and removeFollow actions, i understand why that's not working however i hope someone has a better idea to getting this working, or how to empty define the remoateStay and removeFollow objects to curb the error
object = _this select 0;
_stay = false;
if (_stay) then {
removeStay = object addAction ["Stay",
{
_stay = true;
object removeAction removeFollow;
}];
} else {
removeFollow = object addAction ["Follow",
{
_stay = false;
object removeAction removeStay;
}];
};
whats the context. whats the parameters fed to this?
So the removeStay or removeFollow gets called on every run, however the first run it will be blank so errors out
^ that's the issue if he calls the script multiple times
also you get all the arguments required to remove the action on use within the action code itself
change object to something like _weener. just something else lol
For context, (Sorry i missed it). The scripts runs as many times as needed to flip between showing Follow or Stay
ye just a bad var name
why not use a single action and just change the text?
(_this#0) addAction ["Follow",{
params ["_object","","_actionID"];
private _following = _object getVariable ["following",false];
_following = !_following;
_object setVariable ["following",_following];
_object setUserActionText [_actionID,["Follow","Stay"] select _following];
// I assume you need to do more than change the action text
if _following then {/* something */} else {/* something else */};
}];
That sounds like a much better way to handle it 😆 Class! will take a look
Also could you explain a little more? How would a remove the action without using the var = method?
https://community.bistudio.com/wiki/addAction look at "script" argument
that would be for removing that action, but Mac was using one action to remove the other
ahhh, yeah, mb
Well much appreciated peeps!
@hushed tendon Its Hopecore, most likely
It does look a bit washed out, though, not sure why, as he said its probably just the perfect time
Is there any way to thicken up lines drawn with drawpolygon and also to make them appear on the GPS display?
iirc there isnt any good way. there was a similar question a few months ago about thickness, and the options were to either draw muliple lines (polygons) with a slight offset, or to try modifying the line image
#arma3_scripting message
you should be able to draw to the gps by adding the ui event to the gps map ctrl instead of the main map
Any chance you know that one off the top of your head?
uiNamespace getVariable "rsccustominfominimap" displayCtrl 13301 i think
I don't really know what to do with that. I've got
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
params ["_control"];
_control drawPolygon [sector_a, [0.85,0.4,0,1]];
}];
drawing out lines currently would I just replace the bit before the event handler with what you sent?
replace findDisplay 12 displayCtrl 51 with it
It's not worked
uiNamespace getVariable "rsccustominfominimap" displayCtrl 101 try this instead
Still not seeing lines on GPS
😦 i am
uiNamespace getVariable "rsccustominfominimap" displayCtrl 101 ctrlAddEventHandler ["Draw",
{
params ["_control"];
_control drawPolygon [sector_e, [0.4,0,0.5,1]];
}];
This is what I'm supposed to have, yeah?
yep
https://imgur.com/gallery/QanE8PN
That's what I see on my GPS
Yup, works a-ok on the map
is your gps display modified? it doesnt have grid lines like mine does
I can't think of any mods that'd do that. Would ACE/CBA have an influence on it?
That's what I see on the map
https://imgur.com/a/W55y6zE
i wouldnt have thought so.
Idk then. It still seems to have grid lines at 1 Km intervals though
https://community.bistudio.com/wiki/Arma_3:_IDD_List I've found this list might be able to work something from that
Can someone help me with something? I'm wondering if doing multiple [] call function; 's from a [] spawn { }; will queue them and wait for the call function to end before progressing? I'm having problems with a script which is nothing but call functions, and it seems to be queuing them, not proceeding till it finishes.
[] spawn {
[] call function1;
[] call function2;
[] call function3;
[] call function1;//again
};```
example.
it will finish one call before starting the next, but they are all executed in scheduled environment so it possibly wont finish them all in a single frame.
ty
The script does work but can someone help me with making it more efficient? It hogs a lot and sometimes the animals target each other for a second or two.
https://www.sqfbin.com/wocewekimiyuvugixuti
switch do's hog a ton as it has to read every case, every time. try using a FSM instead
Where do I edit the radarTargetSize
Not by script -> #arma3_config
O
hi, any change to get better building center position than this (cyan arrowm with getposATL): https://steamuserimages-a.akamaihd.net/ugc/1727668185568568284/F37B6227B0CDB8AD13BA8B0A8F11AD8E0D97D897/
nm this code seems to be more accurate: https://www.sqfbin.com/buvopenihipacebacamu
[
VRTable,
"Turn on table",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{},
{},
{ TRIGGERWORK=true },
{},
[],
3,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, VRTable];
Hey so I was using this on a locally hosted server, players could use it like a normal hold action however when it got completed it just duplicated the action.
So once they completed it there was now 2 hold actions, And on top of that it didn't execute any code.
However when I held the action down, even after they had duplicated the action 10 times, it worked first try every time.
Any ideas? I thought this was the MP compatible version.
I suspect the issue is that this code block is executed multiple times.
TRIGGERWORK = true is not broadcast across the network to the other machines. When one client completes the hold action TRIGGERWORK is set to true on his machine, but not on the server and not on any other machine. If the same client then has the same hold action added again (for whatever reason, probably because the code block you posted is executed multiple times), completing it doesn't change anything on that client machine because TRIGGERWORK is already true.
Messing around with the spectrum device and for some reason i can't set #EM_Values using this missionNamespace setVariable ["#EM_Values", TargetSigsArray]; It actually doesn't set and it's the only one being called. TargetSigArrays is valid array.
guys... more really large number precision questions
whena server has been running for weeks... last session, mine started on 9th march and we stopped it yesterday
serverTime was 2.06117e+006
if I do something like
'''_st = serverTime;
if (_st > serverTime + 30) etc etc'''
is that going to fail?
in other words ... is 2.06117e+006 + 30 nonsense?
Why don't you try it lol
yeah, ill wait another 3 weeks lol
What
yes yes, i know what you mean, i intentionally misunderstood for comedy
Just use 2.06117e+006 + 30 in the Debug Console
ok so it doesnt appear to be nonsense in that debug does return expected answers
i can add 30 to it, and take it away again and I do arrive at the original number
I dont understand this way of writing numbers.. I always thought that in order to represent really big numbers, some precision was lost
thats why I asked
It will be lost at some point
2.06117e+006 is scientific notation, some online converter told me that it's 2061170
checks to see if thats more or less the number of seconds in 3 weeks
it isnt
bah.. im confuzzled.. not even sure if I'm asking the right question now
This test is flawed though.
Suppose 30 does get swallowed by 2.06117e+006: You add 30, arrive back at 2.06117e+006, subtract 30, and if you're unlucky, that gets swallowed too and you get 2.06117e+006 in the end.
What you have to do instead is something more like (30 + 2.06117e+006) - 2.06117e+006 == 30: If 30 gets swallowed, the result of the subtraction is 0 instead of 30.
yes, i think thats part of what I'm getting at
I suppose the answer is.. dont leave your mission running for 3 weeks lol
thanks for your time, @willow hound 🙂
Is there any way to force player to witch to AI?
Whenever a player dies, I want him to force spawn into the UAV so he can help his teammates using the UAV
There is https://community.bistudio.com/wiki/selectPlayer, but how well this works with death / respawn is a different question.
Think im getting close, though ive had to frankenstein my scripts together, a little publicVariable magic did a lot of work since I was setting important staging variables serverside and waiting for them clientside t_t
I cant seem to figure on this, though; is BIS_fnc_EXP_camp_playSubtitles local? It seems to be, but doesnt specify on the biki.
any ideas on how to set a bool as true server side in such an instance.
I thought the remoteExec ["BIS_fnc_holdActionAdd", 0, VRTable];
at the end would have run this whole thing server side.
haven't found anything google wise yet but I'll keep looking
would i need BIS_fnc_MP in the code somewhere?
https://community.bistudio.com/wiki/Arma_3:_Remote_Execution
Read the first two sections of that while I type something
The goals of BIS_fnc_MP and remoteExec (and remoteExecCall) are completely the same, and remoteExec is advanced/enhanced/improved. No point to use BIS_fnc_MP
ah right need the , 0 parts and stuff
Is there a way to get the idd of a display I am hovering over / interacting with?
I need the display for the briefing screen for MP. I know the IDD for it in SP but it seems to not be the same for MP.
wait no, that's wrong whoops. i'll let you type will i keep reading
@delicate lotus see: https://community.bistudio.com/wiki/allDisplays
Ah nice. There seems to also be a command to add tooltips so I can add tooltips to all controls of all displays with idd / idc. Thank you!
What your code does is it runs BIS_fnc_holdActionAdd with the parameters you provide for it on every machine (indicated by the 0 parameter for remoteExec). So far so good, this needs to be done because BIS_fnc_holdActionAdd has local effect, meaning executing it on one client only adds a hold action on that client (other players won't be able to see it).
At this point I have to speculate because I don't know the specifics of your mission, but because you said that the hold action duplicates, I assume (as I also said earlier) that the code block that contains remoteExec ["BIS_fnc_holdActionAdd", 0] runs multiple times, because running that code multiple times will obviously add the same hold action multiple times.
It doesn't need to run multiple times on the same machine though: Again, because of the 0 parameter for remoteExec, BIS_fnc_holdActionAdd is executed on every machine every time that code block runs. So if client A runs that code block, he adds one hold action, if afterwards client B runs the code, he adds another hold action.
So the duplication problem should come from another piece of code, for instance a trigger that runs on multiple machines.
When the hold action is completed, it executes TRIGGERWORK = true. As I explained earlier, that sets TRIGGERWORK to true on the machine where the hold action was completed. By using publicVariable afterwards, we can broadcast the current state of TRIGGERWORK to every machine, so then one player completing the hold action will set TRIGGERWORK to true everywhere. After that, we have to find a way to remove the hold action on the other machines, but let's deal with that later.
right gotcha.
Looking at the wiki there should be a way for this to only execute on the server by changing the 0 in ["BIS_fnc_holdActionAdd", 0] to something right? or would that not work because of the hold function needing to do stuff locally?
I'm also seeing stuff about it calling a script instead and having that run code on the server instead.
So instead of just having TRIGGERWORK = true you have execVM "SubFolder\test.sqf"
though that's on what I assume is a virtual machine, and I'm running a server locally on my own PC.
actually wait no, reading execVM now.
If I just put TRIGGERWORK=TRUE in a file called Script1.sqf and had the hold action execute
(example straight from the wiki lol)
_handle = execVM "test.sqf";
would that work
What is the effect of TRIGGERWORK = true in your mission?
It just set's a bool to true, and that bool is the condition for another trigger
The player is interacting with a computer, and doing so creates a task (trigger linked to task module)
all triggers have the Server only box ticked. is that a problem?
had an issue with things only happening for 1 person in the past and server only seemed to fix that
If you did remoteExec ["BIS_fnc_holdActionAdd", 2], the hold action would only be available on the server machine, so it would at most only be available to the player who is hosting the mission.
right, so do not that then haha
I know I could probably just create the task instead of making a bool true.
But I've got other missions I'm working, and PVP modes, and other things where if I can set a bool to true server side with a hold action or even just an addaction that would make a lot of stuff infinitely easier and more stream lined.
another example would be a pallet stacked with boxes is broken down with a hold action button that activates a trigger that would use the hold/show module to hide the original pallet, and then show a dismantled one (and unblocking the way down a narrow hallway)
[VRTable, "Turn on table",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3 && !TRIGGERWORK", //Lazy solution to hide the Hold Action on all machines after it has been completed once
"_caller distance _target < 3 && !TRIGGERWORK",
{}, {},
{
TRIGGERWORK = true;
publicVariable "TRIGGERWORK";
},
{}, [], 3, 0
] remoteExec ["BIS_fnc_holdActionAdd", 0, VRTable];
```This way, `TRIGGERWORK` gets updated on all machines.
What this doesn't fix is the hold action duplication, but all duplicates will be hidden after the hold action has been completed once. To properly fix the duplication, you have to find out why the `remoteExec` code runs multiple times.
does the TRIGGERWORK need to be defined as a a public variable in the code, or can i put it in the mission init?
like
publicVariable "TRIGGERWORK";
TRIGGERWORK=False;
Depends on which init file you mean. init.sqf?
uh yeah i should probably be doing it there right? not in the init field in the options menu thing in editor.
esp if I have and init.sqf because that would override the editor one right?
That's something I don't know; I've never used the Editor one.
But if you put TRIGGERWORK = false; into init.sqf, that's going to work (until we start looking at JIP behaviour, then it might not work anymore, not sure).
if we can get the hold action to set the TRIGGERWORK bool to true on the server when a connected client executes the code and the bool being true activates the conditions for a trigger then I am one very happy man
I'll have a play around with it when i get home from work tomorrow when I can drag some people along to help me test. I'll post back here with the results
thanks a ton for the help ansin11, saving my bacon here
This would have been helpful a few days ago, i had to discover it myself this morning x_x
Can anyone figure out why this isn't working? Trying to drop the backpack but it doesn't show up on the ground, it works fine with vests and uniforms and hats.
_holder = createVehicle ["GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE"];
_container = backpack player;
_holder addItemCargoGlobal [_container, 1];
_droppedContainer = (((everyContainer _holder) select 0) select 1);
{
_droppedContainer addItemCargoGlobal [_x, 1];
}forEach (backpackItems player);
removeBackpack player;
Hey, anyone here familiar enough with ACRE2 API to know how to make a rack-mounted radio have speakers? Looking to make an intercom system for our ship
So I took a look at the optimization page and I’m going to try and optimize my code. But could you help me with making the target section of the code faster so the animals don’t target each other? Because the goats blow up if they spawn next to another animal
Yeah. finally ended up using lineIntersectsSurfaces [eyePos player, screenToWorld [0.5,0.5]]
Works like a charm when getting the position of "the first surface" the player is aiming at
Actually I figured it out. With optimizing the code and putting a sleep between the targeting and the attack gives the code enough time to realize the animals shouldn't attack each other.
Found a function in ACRE that lets you set speaker audio source for a radio, but it only works for the 148, 152, SEM52, and SEM70
Which IIRC aren't rack-mountable
Anyone know how to get the specific radio ID of a rackmounted radio?
May have got it
Is this correct?
if (playerSide == east) then {
_plr = player;
};
maybe? 🤷♂️
Not an expert, but I don't think that'll return anything since _plr is local to the expression
Unless you've defined it earlier in the script, but no clue what the context or intended function si ;P
if (playerSide == east) then {
_plr = player;
};
_plr setDir (player getDir centerZONE);
_actionid = _plr addAction ["1", "scripts\spawnvehicle.sqf"];
_actionid1 = _plr addAction ["2", "scripts\getAsGunner1.sqf"];
_actionid2 = _plr addAction ["3", "scripts\getAsGunner2.sqf"];
if (playerSide == resistance) then {
_dm = player;
};
_dmArsenal = _dm addAction ["VA", {["Open", true] spawn BIS_fnc_arsenal;}];
_plr is then undefined
same with _dm
see https://community.bistudio.com/wiki/Variables#Local_Variables_Scope
@quasi sedge if player is east then { do all the east operations }
@winter rose this good?
if ((side player == east)) then
{
player setDir (player getDir centerZONE);
_actionid = player addAction ["1", "scripts\spawnvehicle.sqf"];
_actionid1 = player addAction ["2", "scripts\getAsGunner1.sqf"];
_actionid2 = player addAction ["3", "scripts\getAsGunner2.sqf"];
};
if ((side player == resistance)) then
{
_dmArsenal = player addAction ["VA", {["Open", true] spawn BIS_fnc_arsenal;}];
};
Q: is there better documentation for the https://community.bistudio.com/wiki/BIS_fnc_showNotification function, arguments, etc? for instance, would like to connect string replaced arguments, potentially in the scope of a configuration, i.e. "%1 ... %2 ... %3", are these the actual arguments being passed in?
nope.
just read the function file and see what it does.
apparently my assumption was accurate, https://pasteimg.com/image/image.clq2J
["KPLIB_notification_TestParams", [mapGridPosition getPos player, "This is a test", 10]] call BIS_fnc_showNotification;
How to "refresh" ammo on this loadout?
onPlayerKilled.sqf:
player setVariable ["Saved_Loadout",getUnitLoadout player];
onPlayerRespawn.sqf:
player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
like if i launched all my RPG rounds, but when i respawn i want full backpack
Also assuming that works across the breadth, title, iconPicture, description, etc
can you give an example? afterburner script for jet
Q: how might I get the thing, or at least a vector, down the sights of the player weapon, scope, etc? I just need a straight line vector, I think, that can be used to determine what the player might be targeting.
ah I think I found it, https://community.bistudio.com/wiki/cursorTarget
I'm trying to add custom marker that should be shown in the briefing map before starting the mission. However, the code used below won't trigger any actual marker until I'm in-game and run the code through the console. Any tips on what I'm doing wrong? Thanks in advance!
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", "
_this select 0 drawIcon [
getMissionPath 'media\my_image.paa',
[0,0,0,1],
[3041.649,7352.639],
24,
24,
0,
'',
1,
0.03,
'TahomaB',
'right'
]
"];
where are you executing this?
I've tried on the init.sqf of the mission.
does that display even exit?
try:
systemChat str findDisplay 12;
before that code
@little raptor cheers, will give it a go!
@little raptor the code you gave me gave me a "No display" system message.
so it doesn't exit
try a waitUntil:
if (!hasInterface) exitWith {};
waitUntil {!isNull findDisplay 12};
put it before that code
Cheers again, will give it a go!
How does magic variables behave if you got a loop inside a loop? Will _x always point to the inner most loops variable?
So to get the outer-loop variable I should save it in a private _temp = _x; before going into the inner loop?
yes innermost
and yes, good solution 🙂
Thanks for the quick reply 🙂
{
private _array = _x;
{
hint _x;
} forEach _array; // _x would work too
} forEach [
["1", "2"],
["one", "two"]
];
any ideas?
it can't really be scripted
you can try addForce or setVelocityModelSpace (with gradual increase) for the increased speed
the exhaust effects may not be possible. idk
I have code that's trying to draw on the GPS side panel referencing ```sqf
private _display = uiNamespace getVariable "RscCustomInfoMiniMap";
private _control = _display displayCtrl 101;
what doesn't work?
It doesn't draw anything on the GPS
Yup,
systemChat str (uiNamespace getVariable "RscCustomInfoMiniMap")
``` returns `Display #311`
what code do you use for draw?
private _gpsdisplay = uiNamespace getVariable "RscCustomInfoMiniMap";
private _gpscontrol = _gpsdisplay displayCtrl 101;
_gpscontrol ctrlAddEventHandler ["Draw",
{
params ["_control"];
_control drawtriangle [[sector_a select 0,sector_a select 1,sector_a select 2], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 2,sector_a select 3,sector_a select 4], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 4,sector_a select 5,sector_a select 0], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 0,sector_a select 2,sector_a select 4], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
}];
Works fine when it's run on the map as
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
params ["_control"];
_control drawtriangle [[sector_a select 0,sector_a select 1,sector_a select 2], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 2,sector_a select 3,sector_a select 4], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 4,sector_a select 5,sector_a select 0], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 0,sector_a select 2,sector_a select 4], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
}];
map is not gps
I know but that shows that the drawing part is fine it's something to do with the display
draw event handler only works on map
But it works fine in a different mission file.
Yes
Doesn't return anything when run in the debug but _gpsdisplay is a private variable so isn't it inaccessible for this?
put it in a systemChat in that code
Still nothing
I mean systemChat str ctrlType _gpscontrol;
Still nothing
did you try it in your code before the draw?
No.
I thought it wouldn't and said that earlier
Running it in the main draw thing returns 101. "in that code" is quite vague
But yeah, the same code works just fine for the GPS in a different mission file and since _gpsdisplay and _gpscontrol are both private variables I don't see how they'd be impacted by anything outside the script.
if that's all of your code and sectors are defined then it's fine
but I'm now 99% sure the problem is the sector_a variable
What I'm confused by is that
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
params ["_control"];
_control drawtriangle [[sector_a select 0,sector_a select 1,sector_a select 2], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 2,sector_a select 3,sector_a select 4], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 4,sector_a select 5,sector_a select 0], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 0,sector_a select 2,sector_a select 4], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
}];
works a-ok whilst referencing sector_a in the same way
maybe the control is disabled then
try this:
private _gpsdisplay = uiNamespace getVariable "RscCustomInfoMiniMap";
private _gpscontrol = _gpsdisplay displayCtrl 101;
gpscontrol = [_gpscontrol];
onEachFrame {
gpscontrol params ["_control"];
_control drawtriangle [[sector_a select 0,sector_a select 1,sector_a select 2], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 2,sector_a select 3,sector_a select 4], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 4,sector_a select 5,sector_a select 0], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
_control drawtriangle [[sector_a select 0,sector_a select 2,sector_a select 4], [1,1,0,1], "#(rgb,1,1,1)color(1,1,0,0.25)"];
}
if it works then the problem is the event handler
It does not work
what does this give?
private _gpsdisplay = uiNamespace getVariable "RscCustomInfoMiniMap";
private _gpscontrol = _gpsdisplay displayCtrl 101;
gpscontrol = [_gpscontrol];
onEachFrame {
gpscontrol params ["_control"];
hintSilent str _control;
}```
A hint showing Control #101
then it should work 🤷
it's probably because either you're targeting the wrong display, or some mod is preventing it from working
What could I have done in the mission file that would have changed the GPS display?
you're targeting the wrong display
what happens when you do this?
uiNamespace getVariable "RscCustomInfoMiniMap" closeDisplay 2?
or try this:
uiNamespace getVariable "RscCustomInfoMiniMap" ctrlCreate ["RscText", -1] ctrlSetText "WTF"
Also not seeing anything
then you're targeting the wrong display
you should see the word "WTF" in the upper left corner
it's not the same display 
?
is it part of ACE or something?
The GPS side panel?
yes
its vanilla...
No? But targeting it with _gps control works just fine in a different mission file with identical mods
then I have no clue
whatever it is it's not the same display
either that or you're executing the code wrong (in MP)
It's single player :/
I just wish we could draw polygons in the editor like we can for rectangles and circles.
does the gps change if you do this?
uiNamespace getVariable "rsccustominfominimap" displayCtrl 101 ctrlSetBackgroundColor [1,0,0,1]
It should go red yeah?
yea
It doesn't go red
and you say it works fine in a new/clean mission?
Yeah
so.. have you considered disabling things in your mission until it works?
I was thinking about that but wasn't sure what I should start with.
anything to do with a ui/hud
addactions?
I'd start with the mods
I'm not wanting to touch the modlist. I'm planning on making the mission for the unit I play with and I'd rather not have to alter the modlist for this. If it's not gonna work then I'll just need to cut my losses.
maybe, but if you want to fix an issue you have to identify it first
if you identify it's the mods, then keep the mods and forget your script/find another way
private _displays = uiNameSpace getVariable "igui_displays";
private _ctrlGPS = _displays select (_displays findIf {!isNull (_x displayCtrl 101)}) displayCtrl 101;
try that
A2OA: 3 questions. 1) Can I reload a specific mod while in game? Including FSM that are in that mod? 2) Are FSM scheduled or unscheduled? 3) Are _ local variables local to the entire FSM?
- Can I reload a specific mod while in game?
reload?
if you mean scripts and fsm yes (obviously)- Are FSM scheduled or unscheduled?
https://community.bistudio.com/wiki/FSM- Are _ local variables local to the entire FSM?
🤷
What is that supposed to do?
it's supposed to find the first display that has a control#101
Doesn't return or change anything
can I reload an FSM or the mod in which it is contained, while the game is running? So that it reflects changes that I've made.
you're supposed to use it with your own code
gonna take a look in a sec, what exactly are you trying to do?
_ctrlGPS is your _gpscontrol thing
- Are _ local variables local to the entire FSM?
yes
IT WORKS!
you can't modify scripts in a mod if it's loaded (unless it's unpacked)
you can try your FSM in a mission first
now see what the actual display was
what do you mean by "you can try your FSM in a mission first"
just put it in a mission an use execFSM
not fully tested, but the display holding the 101 control seems to be at index 12 in the array, atleast it's hardcoded in my code, but haven't used it for a long time (hence the findIf solution)
I cannot determine why I'm getting the error that "_timeout is undefined" in the suppressfor espression. if (_know <= 0.1) then { _timeout = time + 2 + random 3; } else { _timeout = time + 1 + random 1; }; _this suppressFor _timeout; This is in a state's InitCode field.
@cerulean cloak ```sqf
private _displays = uiNameSpace getVariable "igui_displays";
_disp = _displays select (_displays findIf {!isNull (_x displayCtrl 101)});
{if (uiNamespace getVariable [_x, ""] isEqualTo _disp) then {breakWith _x}} forEach allVariables uiNamespace;
you might need to define timeout before the if statement first so it exists in that scope
reading the above chat, you already had the control 101 reference?
so display should be the same then
🤔
time for some testing
private _displays = uiNameSpace getVariable "igui_displays";
_disp = _displays select (_displays findIf {!isNull (_x displayCtrl 101)});
_disp isEqualTo (uiNamespace getVariable "rsccustominfominimap")
prints true
no need
it's modified by some other mod
ahhh, that explains it then
I bet ACE?
if not a mod then it's a game bug
it creates a display but doesn't set the variable
anyone know if it is possible to spawn a module (Game master) using the console? and set the right(owner) to me with all addon mode?
@digital torrent seek the curator's functions on the wiki, you should be able to make yourself Zeus I think
private _logic = createGroup sideLogic createUnit ["ModuleCurator_F", [0, 0, 0], [], 0, "NONE"];
_logic setVariable ["addons", 3, true];
_logic setVariable ["owner", getPlayerUID player, true];
[player, _logic] remoteExec ["assignCurator", 2];
should work i guess? (run on client)
can i make a danger.fsm in my mission, and set it to run on a unit, while overriding the danger.fsm implemented by a mod?
@copper raven i will teest it out sharp. thx a lot
@winter rose thx for the reply
Hi, anyone who knows how to swap out the 2× Minigun 6.5 mm on the Ghost Hawk for something else?
addWeaponTurret ["2000Rnd_65x39_Belt_Tracer_Red", [-1]]; or
addWeaponTurret ["2000Rnd_65x39_Belt_Tracer_Red", [-0]];
Only creates an imaginary turret shooting straight forward.
hey fellas, cant remember how to do it with high accuracy ... How to save an object composition so it can be used anywhere? not using BIS_fnc_objectsGrabber (not accurate enough with Z-axis)
nm sorta hacked it together
anyone here very familiar with FSM's?
possibly. what do you need to know?
Timer based condition is not firing. I need help figuring out why.
What've you got so far?
this state is firing (code in initCode):
_stopUntil = 0;
if (_know <= 0.1) then {
_stopUntil = time + 2 + random 4;
} else {
_stopUntil = time + 1 + random 2;
};
_this suppressFor _stopUntil;
player sideChat format["PRONE, _stopUntil %1",_stopUntil];```
A condition from this state to the next is:
time > _stopUntil
and for debug purposes it has this action:
```player sideChat "DONE PRONE";```
That message is never displayed.
and the code in the next state is never executed
I do see the first message "PRONE, _stopUntil: x"
but I never see the second message, "DONE PRONE"
would probably need to see the fsm file. side note: suppressFor takes the duration in seconds, but you provide elapsed mission time + n + n. is that intentional?
this is in a danger.fsm
oh right, nice spotting, but that shouldn't prevent the condition from firing, correct?
like... if you have played for half an hour, that unit is going to suppress for half an hour and a few seconds
no it shouldnt
but just in case i'm going to fix that and then test it.
if you are willing to look at the file, i'll post it after
hmm, i can't post it here, can i?
not as a file, no
Throw it on somewhere like pastebin or ghostbin
Here it is as a text file, if you save it as .fsm, you can see it in the editor.
the last state that works correctly is captioned "GO PRONE"
the condition that is failing is captioned "go prone timeout"
wouldnt it always go to the rest condition as it is true?
shit... didn't see that! egg on face
thanks for spotting that
does anybody know when exactly the danger caused by "can fire" will be triggered?
can i call a function defined in init.sqf inside of danger.fsm?
yea
it's not working for some reason.
is your function a global variable? eg TAG_fnc_xyz = {...
Figured it out.
Left door gunner is 1 and right gunner is 2.
iirc no, but i will double check
yea, no. fsms are executed in the scheduler, but they dont support suspending.
hmmm...
do you know how frequently conditions are tested?
or if there is a way to adjust the frequency?
every frame unless the scheduler is super busy i guess. read the warning box here
https://community.bistudio.com/wiki/FSM#FSM_Class
but I could spawn a function which itself does allow suspension, and through that piece of code, set a variable used to evaluate a condition in the fsm. Does that check out?
if the variable is global then sure, but you would need to be sure the spawn has set the variable before the fsm tries to use it
i'm going to use a variable set to the unit
just so im clear in what i mean. if you do this in an fsm
diag_log format["fsm 1 %1",diag_frameno];
[] spawn {diag_log format["spawn 1 %1",diag_frameno];};
diag_log format["fsm 2 %1",diag_frameno];
it will log like this
12:09:02 "fsm 1 5200"
12:09:02 "fsm 2 5200"
12:09:02 "spawn 1 5201"
so the spawn may not set that variable before you try to use it. seeing as you are using an fsm i'd go for the time out method like you used elsewhere but if the delay isnt an issue then it doesnt matter 👌
the system I've set up is working
however, I don't seem to be able to force the ai to stop shooting and to move
hmm... so, how do I tell the vector the player is aiming towards?
I thought perhaps cursorTarget might possibly tell me, but it is not returning anything useful.
player weaponDirection "";
nice thanks!
what's the function to get the sign of a number?
Meant plus or minus? Not directly, you can use >or some command to detect
also abs can be helpful
['+', '-'] select (_myNumber < 0)
Is probably the shortest way to get the sign as a symbol, off the top of my head
Otherwise yeah, what POLPOX said if you just need to test
does anyone have a halo jump script that works? the ATM airdrop script i had been using broke after an update i think
just something simple you can go to a flagpole, select halo jump, set your altitude and location on the map the click to drop
Good day. How do you set up event handler order? I want mine to be executed last of all
it goes in the order it was added, last added first executed
Yeah, that's the problem, I want it to be executed AFTER system EHs
huh til
remove system events, add yours then readd system events after
not at all ideal but there isnt any other way that i know of
is it necessary to have your events at start? maybe run the event script after a delay?
Nah, not very applying as it will stack, but I guess I'll go with two event handlers, one (MousButtonUp) will set up the flag and another (MouseMove) will execute the logic if the flag is set
Thanks, but it's too much since I'm working in user's inventory.
Does anyone know why EM values for the spectrum device is not being set? I'm giving it a single valid array with valid elements and it's not being set. missionNamespace setVariable ["#EM_Values", TargetSigsArray]; This is called inside a while(true) statement with some maths to generate signal frequency and strength. I can actually set it via triggers and init scripts but not inside my script.
Are you sure? afaik first added first executed
that doesn't seem valid
it may only be for a specific event or type of events, but im sure ive read it somewhere
What do you mean?
but if you add e.g multiple handleDamage event handlers to the unit only the last one has effect
I mean the # symbol
it's not valid for a variable name
It's straight from the wiki
@robust hollow
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
This allows for safe stacking of this event handler. Only the return value of the last added "HandleDamage" EH is considered.
it is when you use setvariable
even in missionNamespace?
yep
you just cant reference it directly like #EM_Values = [];
needs to use get/setVariable
are you using the vanilla spectrum device?
wat?
systemChat str missionNamespace getVariable "#EM_Values"; returns Namespace
Should be an array
im thinking of ui events 😩
https://community.bistudio.com/wiki/displayAddEventHandler
Display EHs are processed in reversed order, i.e. last added: first, first added: last. So if you have an override it should be set up in the 1st added EH.
I'm not getting any errors with it
But i tried it and now it's giving me nothing
systemChat str (missionNamespace getVariable "#EM_Values");
which means the variable isnt defined
or this one isn't defined TargetSigsArray
It is
because you set it here #arma3_scripting message
what does systemchat str TargetSigsArray show?
then your code is wrong
if it was working this should've given you something:
#arma3_scripting message
set the variable manually in debug console
see if it works
missionNamespace setVariable ["#EM_Values",[140.8,-10,141.8,-18]]; no effect
I can do it with triggers weirdly enough
And the code is the same
missionNamespace setVariable ["#EM_Values",[140.8,-10,141.8,-18]];
that makes no sense
^^ trigger code
did you stop the loop?
are you doing just that line in debug or in your script? i can set that variable fine in debug
Debug
kinda sounds like you have something wiping the var
That's the only thing that sets it
does any contact code wipe it? i dont own it so cant check myself
i imagine there is a functions_f_contact folder or something
And it shouldn't
maybe try the functions viewer first, if you dont want to mess with the pbos
Because the values stay when i trigger it with the trigger
they are encrypted, so he couldn't even if he wanted 
mmmmmmm 😦
does your while loop have a sleep?
Yes
did you try without your loop or the trigger?
just this
#arma3_scripting message
in debug console
Sorry to butt in,
Any reason why this would work in debug and not when called from a script?
[_vehicle, _weapon] call BIS_FNC_FIRE;```
variables not defined?
I wish it was that easy
well... based on that snippet alone the variables arent defined sooooooooooooo
🤦♂️
Disregard, I just realized I was exiting before it got called
is there any difference for bis_fnc_fire and forceWeaponFire in mp? (or at all)
I'll boot up vanilla and make a map so you can play around with it
forceWeaponFire only takes local arguments
If it was just a mod thing messing with it i'll be extremely mad
Thanks
@little raptor Are you still keen of helping me? I have a vanilla map, same script and it's still not working
I'm out of ideas 
what about:
onEachFrame {missionNamespace setVariable ["#EM_Values",[140.8,-10,141.8,-18]];};
(exec in debug console)
onEachFrame {missionNamespace setVariable ["#EM_Values",[140.8,-10,141.8,-18]];
hintSilent str (missionNamespace getVariable "#EM_Values");
};
what about that?
Nothing
@ornate quest I think I got it
try this:
missionNamespace setVariable ['#EM_Values',[140.8,-10,141.8,-18]];
Nothing
which debug console do you use?
hmm 
But imma take a break and try it again tomorrow
try this too:
_str = toString [35,69,77,95,86,97,108,117,101,115];
missionNamespace setVariable [_str ,[140.8,-10,141.8,-18]];
I closed my game but i'll send you the map
and this:
onEachFrame {
_str = toString [35,69,77,95,86,97,108,117,101,115];
missionNamespace setVariable [_str,[140.8,-10,141.8,-18]];
hintSilent str [missionNamespace getVariable _str];
};
It's just vanilla no mods needed
Will do
worked fine for me 😦 BI uses # in variable names in a lot of modules
can some one tell me whats wrong here:
{
if (side _x == "EAST") then {
_x addEventHandler ["Killed",
{
_count = 1;
dreResourcesW = dreResourcesW + _count;
hint str dreResourcesW;
}];
};
} foreach allunits;
could be a debug console bug
did you try the vanilla debug console?
yea
I tried with CBA and vanilla
this should've given you something
With and without mods
(side _x == "EAST") side _x returns type side, "EAST" is a string. they arent comparable like that
it's setting the variable and reading it immediately
Yeah it didn't
unscheduled
oh
wait did you say global exec?
Yeah
and you never tried local?
if you can just try this:
#arma3_scripting message
it will definitely show something
I'm not in the game anymore but i'll try it tomorrow
ok
trying to add a flag to a vehicle via the config file in the pbo file
init = "_this forceFlagTexture ""\A3\Data_F\Flags\Flag_red_CO.paa""";
is this what needs to go in it because so far its not working and I dont know why
im not sure im fairly new to the whole scripting thing but ill give it a try and see what works
doesnt seem to be working either
have you put the init line in the right config class?
no i dont think thats right
needs to be in
class Eventhandlers {
init = "...";
};```
no, you put that class in the 102_SdKfz251 class
this code works, but the later one not, but its identical for me.
{
if (side group BLUFORHC == west) then {
_x addEventHandler ["Killed",
{
_count = 1;
dreResourcesW = dreResourcesW - _count;
hint str dreResourcesW;
}];
};
} foreach allunits;
the not working code:
{
if (side group REDFORHC == east) then {
_x addEventHandler ["Killed",
{
_count = 1;
dreResourcesW = dreResourcesW + _count;
hint str dreResourcesW;
}];
};
} foreach allunits;
also [_this] forceFlagTexture still isnt right. you want (_this select 0) forceFlagTexture
bluforhc is a west soldier, redforhc is a east soldier.
those loops would add events to every unit? because BLUFORHC will always be side west no matter who _x is
also use units <side> instead of allUnits
oh boy
thx
well i just like a count where i get +1 for resi/east kills and -1 for west kills
well seems like that code won't take respawned units into account:
{
if (side group REDFORHC == east) then {
_x addEventHandler ["Killed",
{
_count = 1;
dreResourcesW = dreResourcesW + _count;
hint str dreResourcesW;
}];
};
} foreach units east;
i don't understand "EntityKilled" that well. here i have a code, but i can't flag it to sides:
addMissionEventHandler ["EntityKilled",
{
params ["_killed", "_killer", "_instigator"];
if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0}; // UAV/UGV player operated road kill
if (isNull _instigator) then {_instigator = _killer}; // player driven vehicle road kill
_count = 1;
dreResourcesW = dreResourcesW + _count;
hint str dreResourcesW;
}];
addMissionEventHandler ["EntityKilled",
{
params ["_killed"];
_count = [-1,1] select (side _killed isequalto east);
dreResourcesW = dreResourcesW + _count;
hint str dreResourcesW;
}];
🤷
you would probably want to take into account the side of the killer too though? maybe.
cool thx!
Does anyone know how to attach an animation to an addAction script on an object? I am trying to have a person in multiplayer be able to repair something. I have this addAction ["Repair Generator", "addSurvivorScore.sqf"]; but I need to use this code? from a different sqf file? sleep 20; p1 switchMove "Acts_carFixingWheel";.If anyone could give me some guidance that would be great I'm lost at the moment. Thank
You're wondering that if there's a way not to use an .sqf file to run that code, right?
Im not sure to be frank. I know I need to have an addAction that makes the player switch into an animation, but as far as accomplishing that, I'm confused. My friend earlier helped me setup another script for counting up every time the addAction on the generator is placed. Can you call two in one command line for addAction?
Uhh uhh? Can you explain what exactly is your issue and the goal?
Just put the switch move at the start (or end) of the script. I haven't seen the script but unless you have a loop it'll (probably) work
not in MP tho
I'm trying to get into scripting atm lol, beginner project. Basically dead by daylight is basic premise. Survivor goes around and turns on generators right. I want the player to be able to walk up to the generator and 1) have an option to enter a animation for repair (20 seconds) and when that is done 2) to add to a counter for all the generators. Once the count is met, the survivors win
the anim im using is 20 seconds which is more than enough
can anyone give me directions where to find the definition / function / whatever to incomingMissileDetectionSystem?
please ping me if one has an idea
In multiplayer you never use the init like that
I know of an event handler but it doesn't work very well
uhhh IM so sorry, I don't know my way around. What should I use instead?
@little raptor
thx, but i look for the vanilla stuff
Yeah vanilla 
what does multi require?
https://community.bistudio.com/wiki/Arma_3:_Countermeasures
Looks like it's defined in vehicle? Not sure the goal tho
I'm on my phone but take a look at the event handler page. You'll find it
@warm hedge
thanks, i know about that. i need to find out how that is build and rewrite it to something else
@little raptor
much appreciated
Init field gets executed for everyone on every client connecting to the server. Do you see the issue now?
Does that mean I have to use ExecVM?
wait ohhhhhhhhh so it would not be good I see
im calling the animation in a seperate sqf
it wouldn't be good because you get duplicate add actions
@little raptor can I call 2 animations from 1 addAction
Yes
How?
What's your code?
this addAction ["Repair Generator", "addSurvivorScore.sqf", "repair.sqf"];
Sooorrry
I mean what is the contents of those files 
ok
addSurvivorscore.sqf: scoreSurvivor = (scoreSurvivor + 1); hintSilent str scoreSurvivor; if (scoreSurvivor >= 5) then {survivorsWin = true;};
repair.sqf sleep 20; p1 switchMove "Acts_carFixingWheel";
i need to change sleep value lol
Why you put sleep first and switchMove last?
I dont know
should it be the other way? I want the animation to play and the player is like locked but can exit the anim
Anyway, there's nothing special going on. Just append the two codes into a single file
Well you have to play the anim first
Why wait 20 seconds before playing the anim
thats a bad idea, youre right
So what?
They're not even related
im sorry how do i combine them?
Copy paste 
Just like you combine several commands in a sqf file
ok
im sorry my brain is so bad at processing information so I have to keep everything segmented. Should I be combining the SurvivorScore.sqf and the Repair? So the addaction adds 1 to the score AND plays the anim?
Yes
Ahhhhh
1 more question. In multiplayer, is there any other var i can use for the player other than p1? because don't in that case i have to make different copies of the code for each player? p2, p3 etc
player is the command to return player unit on their computer
so should I replace the p1 with player or no?
scoreSurvivor = (scoreSurvivor + 1); hintSilent str scoreSurvivor; if (scoreSurvivor >= 5) then {survivorsWin = true;}; player switchMove "Acts_carFixingWheel"; sleep 15;
thats what I have now
Prolly works
gotcha
ill test now
@warm hedge thank you for all you’ve done for me and the community.
hmmm it goes into the animation for a second and then quits?
Try not to move your mouse and your player unit
Basically some animations aren't intended to be used by player, might not work properly
alright. Im not moving anything and he quits. Can I somehow lock the player out of controls during the duration of the animation.
and force the animation to play?
private target1 = myAmmoBox;
private charge1 = "DemoCharge_Remote_Ammo_Scripted"; createVehicle position player;
charge1 attachTo [target1, [0, 0, 0.2]];
charge1 setVectorDirAndUp [[0.5,0.5,0], [-0.5,0.5,0]];
detach charge1;
charge1 setDamage 1;
hint "good!";
Error missing ;
Wut can anyone help please
(messing around with attachto to learn)
"DemoCharge_Remote_Ammo_Scripted"; createVehicle position player; More like unnecessary ;
"DemoCharge_Remote_Ammo_Scripted" createVehicle position player;
more like this ?
private target1 = myAmmoBox;
private charge1 = "DemoCharge_Remote_Ammo_Scripted" createVehicle position player;
charge1 attachTo [target1, [0, 0, 0.2]];
charge1 setVectorDirAndUp [[0.5,0.5,0], [-0.5,0.5,0]];
detach charge1;
charge1 setDamage 1;
still got the 'error missing ;' 😕 , can u see the issue at all please?
Suspect that target1 and charge1, they can't be a global variable if you wanted to use private, so try to put _
it is possible hide player model from server?
What do you mean by from server?
Dedicated server
I want hide player model on my dedicated server, for spectating others
it is possible?
now it backtracks to the initial error , 'local variable in global space'
(original code source: https://community.bistudio.com/wiki/attachTo - Pixinger)
(code below extracted from https://community.bistudio.com/wiki/attachTo)
private _target = myAmmoBox;
// create and attach charge
private _charge = "DemoCharge_Remote_Ammo_Scripted" createVehicle position player;
_charge attachTo [_target, [0, 0, 0.2]];
_charge setVectorDirAndUp [[0.5,0.5,0], [-0.5,0.5,0]];
// now detonate charge
detach _charge; // Important!
_charge setDamage 1;
hint "good!";
Lemme try my luck on my end
Thanks
I found it a second before you
re-read hideObject doc
this addAaction ["Stop", {if (player getVariable 'anim' != '') then { [player, ''] remoteExecCall ["switchMove", -2, true]; player removeAllEventHandlers "AnimDone"; player setVariable ["anim", ""]}, "", 21, false, true, "", "_target==_this && _this getVariable 'anim' != ''"];
do you guys see an error with this? Arma says im missing a semi colon before Addaction??
Worked completely fine for me...
nevermind
How did you run it, fur?
@warm hedge now Im getting a blank error Init:
?
on the code I used ^ up there. I got it off the internet
addAaction -> addAction, missing }
Bruhhhh. Type code expected if??
paste your code in e.g notepad++, and (over)indent it - you will see
what does over indent mean sir
@winter rose
i did that
i didnt see anything amiss
im going too bed gn
this code , copied and pasted? 😕
Yeah
Why is it not working? 🤔
_GUI_ListFrom ctrlAddEventHandler ["MouseEnter",
{
systemChat "HERE!!!";
}];
it's because…
Oooooooooooh
https://forums.bohemia.net/forums/topic/227905-onmouseenter-eh/
Just... why....
so, once again, I'm trying to fix the line numbers being reported on a script error in ALiVE but I can't get it fixed.. Moved the #include "script_component.hpp" to the top of the file but it's not doing anything else :/
anyone got any clues? 🙁
when I preprocessFileLineNumbers the script there's a ton of white space from all the CBA includes and what not
initialy put in init of player character? now this time, put into trigger, but still error 'local variable in global space' (https://imgur.com/65ZeRK9)
Now that makes sense... You can't use local (aka _) variable in such places
I am looking for a way to convert shortcuts[] = {"512 + 0x2E"};
To a string which actually shows the shortcut e.g ALT + X Has anyone ever seen such a function? I don't wanna reinvent the wheel 😄
[missionNamespace, "arsenalClosed", {
player setVariable ["Saved_Loadout",getUnitLoadout player];
hint "Selected gear saved!"
}] call BIS_fnc_addScriptedEventHandler;
player addEventHandler ["Respawn",{
0 = [_this select 0] spawn {
params [["_player",objNull,[objNull]]];
waitUntil {sleep .2; alive _player};
_player setUnitLoadout (_player getVariable ["Saved_Loadout",[]]);
};
}];
if i change "missionNamespace" to "profileNamespace" that means that everytime player join server with this mission, he gets his already saved loadout?
Doesn't sound right to save that in profileNamespace 😄
player setVariable ["Saved_Loadout",getUnitLoadout player];
You can save it to profileNamespace here instead to the player's namespace
@cosmic lichen sqf profileNamespace setVariable ["Saved_Loadout",getUnitLoadout player];
smth like that?
yes
_player setUnitLoadout (_player getVariable ["Saved_Loadout",[]]);
to
profileNamespace setUnitLoadout (profileNamespace getVariable ["Saved_Loadout",[]]);
? @cosmic lichen
Yes
setUnitLoadout needs an object on the left hand side
_player setUnitLoadout (profileNamespace getVariable ["Saved_Loadout",[]]);
in the init.sqf
publicVariable "PART1";
PART1=False;
On the object:
[VRTable, "Turn on table",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3 && !PART1", //Lazy solution to hide the Hold Action on all machines after it has been completed once
"_caller distance _target < 3 && !PART1",
{}, {},
{
PART1=true;
},
{}, [], 3, 0
] remoteExec ["BIS_fnc_holdActionAdd", 0, VRTable];
Uh so I was working through this with ansin11 yesterday. Just trying to get it to work for a player connected to a locally hosted server and it actually change a variable on the server (so it effects all players connected).
this worked fine on both lan and internet when i'm playing by myself. but I just had someone else connect to test it and then I couldn't see the actions. they could though but completing it did nothing. (executing PART1=True on the server though did do what was supposed to happen though)
[this, ["Activate Marker", { PART3=True; }]] remoteExec ["addAction"]
this also didn't work, but showed up for both of us (twice for some reason)
publicVariable broadcasts the variable in it's current state.
So your sending PART1 = false; to everybody, then changing it locally within the action to true.
You need to publicVariable after you've made the changes to the variable.
so
in the init.sqf
publicVariable "PART1";
PART1=False;
On the object:
[VRTable, "Turn on table",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3 && !PART1", //Lazy solution to hide the Hold Action on all machines after it has been completed once
"_caller distance _target < 3 && !PART1",
{}, {},
{
PART1=true;
publicVariable "PART1";
},
{}, [], 3, 0
] remoteExec ["BIS_fnc_holdActionAdd", 0, VRTable];
uh like this?
[missionNamespace, "arsenalClosed", {
profileNamespace setVariable ["Saved_Loadout",getUnitLoadout player];
hint "Selected gear saved!"
}] call BIS_fnc_addScriptedEventHandler;
player addEventHandler ["Respawn",{
0 = [_this select 0] spawn {
params [["_player",objNull,[objNull]]];
waitUntil {sleep .2; alive _player};
_player setUnitLoadout (profileNamespace getVariable ["Saved_Loadout",[]]);
};
}];
if i respawn it works just fine, ammo replenished. But if i reload mission, game doesnt give me my saved gear
Yes, now when the action is run, it changes PART1 to true then broadcasts it to everybody.
getting someone to test with me now
You'll probably find that scripted event handlers are not serialized when the mission is saved.
Which means when the mission is loaded those event handlers no longer exist.
You'll want to test which event handlers don't exist after loading the mission, then setup a way to re-add them once the mission is loaded.
Ok, so with 1 other person on the server it worked fine for them and they could see the prompt, they could see it but i could not.
However after a second person joined no one could see the hold action prompt.
in singleplayer it works fine
Your probably running into an issue where when a player joins, it runs all the code again for them, which means it adds the actions again and publicvariables everything again.
yeah i'd say it was a probably to do with the amount of players on the server
we all joined before the mission started, no join in progress
which kind of sucks because I am completely out of ideas lol
why the remote exec in object's init?
publicVariable "PART1";
PART1=False;
? broadcasting and then setting? why?
true i guess i could put it somewhere else, wasn't sure that would do anything though.
and I just wanted to make sure it's false
what? no 😆 you don't want to set unit loadout to profileNamespace 😄
so putting the code in the init.sqf might fix this?
[] spawn {
sleep 15;
kh1s1 switchmove 'Acts_Executioner_Backhand';
};
hint "good!";
what is wrong with this code? apparently, (ERROR: on activation, type script, expected nothing) (or do i need to go back to arma 3 profiling?)
no, that's just a thing that doesn't make sense, you remote exec on every client for every client, it's useless(just dont remoteexec there). anyway, if thats all you got in your init.sqf, the two lines, rename it to initServer.sqf, you don't want that code running on clients
@torpid quartz
oh and public variable after you set the variable(not the other way around)
use CBA(or profiling branch :D), or store script handle, e.g furb_handle = [] spawn ...
so wait, remove the remote exec part?
how will it change the bool's state on the server then?
oooooh, right. I'll give that a go once i can get some people to test it again, thanks so much for the help
good morning!
good afternoon
@warm hedge is your mod Virtual Reality replace compatibole with multiplayeR?
🤣 Yeah I kinda missed that
Whenever i start an Arma3 mission and open to LAN my friend can join, but if we fail the mission or restart, he keeps disconnecting. Chat says he connects then disconnects. On his screen, he just disconnects.. What can cause this? Nothing really helps on Google
Anyone got a creative way to run switchWeapon without any animation or skipping the animation?
maybe #arma3_troubleshooting
Good day, is there a way to get all numbers from a string?
parseNumber maybe
yes - but you would have to work through the string itself and see if each char is a number
Yeah, that's what I ended up doing, thanks
How would one get the classname of a dynamic sound?
typeOf (allMissionObjects "#dynamicsound" select 0)
only returns "#dynamicsound"
I was using
(get3DENSelected "object" # 0) setObjectScale 2;
to see previews of my scaled objects in eden, but it only works on one object each
is there a way to use it in mass?
yes, forEach
{ _x setObjectScale 2 } forEach (get3DENSelected "object")```
oh I guess that exists
I'm not used to using the console in eden so not sure what works and what doesn't
thanks
You dont
Thanks
you can use this (it's what I use in my mod). you can use it as a hashmap (needs a bit of modification)
all key codes are less than 256. so the modifier is the number > 256
I think it was 512 (ctrl), 1024 (shift) and 2048 (alt) 
so you can read the modifier flags using 2^11, 2^10 and 2^9
what remains is the key
also that list of dik codes only goes up to 237
hashmap variant: (use with createhashmapfromarray)
I am unable to change the size of the USS Liberty (Aircraft Carrier) even when turning it into a simple object
[ac1] spawn {
params [
["_object", objNull, [objNull]]
];
_position = getPosWorld _object;
_vectorDirUp = [vectorDir _object, vectorUp _object];
_model = getModelInfo _object select 1;
deleteVehicle _object;
_simpleObject = createSimpleObject [_model, _position];
_simpleObject setVectorDirAndUp _vectorDirUp; _simpleObject setObjectScale 0.2;
}; ```
The name of the aircraft carrier is ac1
the carrier is a multi part object
hey, how do you detect if the player is already done loading and ready to play.. been trying to make mission intros but couldn't find a reliable way to detect this
you mean the loading screen is done?
yea, 'all of them', for some reason my arma has 2 loading screens so idk if this is even normal
i do have a waitUntil to detect when the briefing is read
maybe something like this?
waitUntil {isNull findDisplay 102}
I'll have to try, don't even know what this does 😆
yea well just tested and the loop will end after the briefing is read
so the intro stuff will play while the graphics and stuff is loading after the briefing
so? isn't it what you wanted?
no, because after the briefing is read, theres another loading screen wich depends on the size of the mission, i guess. I've been trying to find a way to play stuff after this, when the player is actually playing.
my current way of doing this is, after the briefing i wait around 10 seconds or so, wich is bad because the loading screen takes an arbitrary amount of time
so start another one
this is one of the questions that has plagued mission makers for years
its so tough to do
thr finddisplay isnt good enough
theres isbriefingread or similar that is better
cant remember the exact command
waitUntil {!isNull player};
is what I do, but even that isn't quite good enough
the power of the player PC has an effect here
do you want them to read the briefing? I turn it off
i got a okish effect with
waitUntil { getClientState == "BRIEFING READ"}; sleep 5; waitUntil {isNull findDisplay 102};
I'm really not sure if it will be consistent
thats the one, yes
my players are teleported to a custom start location
so its important they dont get visual until after that happens
but even then, a player with a fast PC often sees their original spawn and then teleports to my planned start pos
yup, well, I got a somewhat good effect by fading the screen to black as the first thing on the init
yes, another good move
but i think ACE bugs that
keep the screen black... ah, i dont use ace
i dunno if its ACE, but here the fade functions are like a blink, some mod affecting it 😆
I make the screen black, play an intro movie, black the screen again, dont show briefing, remove their map so they dont see that and then black the screen again with some text. "mission is loading, please wait"
its MUCH worse on the first run of the mission, when players JIP after (its persistent battlefield) it's less of an issue
eh, i guess there's not much we can do
not really.. theres a couple of good threads on forums, but no definitive answer
ask again tomorow lol
👍 well, ty for explaining why its hard tho
NP mate, if you make it work reliably across players with differing PC's I'll beer you if you tell me
🙂
Hey there! simple question, when creating a vehicle, how do you set their speedmode and behaviour?
also, is there a way to spawn a unit x meters from the ground?
_disN = h1 getRelPos [400,0];
_disE = h1 getRelPos [200,90];
_disS = h1 getRelPos [600,180];
_disSW = h1 getRelPos [2000,225];
BRDM1 = "UK3CB_TKA_O_BRDM2" createVehicle _disN;
createVehicleCrew BRDM1;
BRDM1 doMove (getPosATL h1);
BRDM1 limitSpeed 60;
HIND1 = "UK3CB_CW_SOV_O_LATE_Mi_24V" createVehicle _disSW;
createVehicleCrew HIND1;
HIND1 doMove (getPosATL h1);```
this is what i have at the minute, but the hind often spawns underwater, and the BRDM only follows roads due to its behaviour mode
use the other syntax of createvehicle when making the helicopter
hind1 = createvehicle ["UK3CB_CW_SOV_O_LATE_Mi_24V", _disSW,[],0,"FLY"]
I think brdm1 setbehaviour "SAFE" will make him go cross country.. not sure
I thought it was Combat
Safe means driving on road
but i will use the other syntax, thank you
Evening all!
Trying to get a Scroll Wheel Loadout Selection system to work (very early stages atm)
For background, I'm very inexperienced with scripting.
Using the Script below I can get one action i.e. Remove Headgear to work, but not a string of commands. How would one do this?
this addAction
[
"Give Rifleman Loadout",
{
params [Bill, Player, 1, {"RemoveAllPrimaryweaponItems player", "RemoveHeadgear Player"}];
},
nil,
1.5,
true,
true,
"",
"true",
50,
false,
"",
""
];
Safe will stay on roads
h1 allowDamage true;
_dis = h1 getRelPos [400,0];
_disE = h1 getRelPos [200,90];
_disS = h1 getRelPos [600,180];
_disSW = h1 getRelPos [2000,225];
BRDM1 = "UK3CB_TKA_O_BRDM2" createVehicle _dis;
createVehicleCrew BRDM1;
BRDM1 doMove (getPosATL h1);
BRDM1 limitSpeed 60;
BRDM1 setbehaviour "COMBAT";
hind1 = createvehicle ["UK3CB_CW_SOV_O_LATE_Mi_24V", _disSW,[],0,"FLY"]
createVehicleCrew HIND1;
HIND1 doMove (getPosATL h1);
_group1 = createGroup [EAST, true];
_group1 createUnit ["UK3CB_TKM_O_RIF_1", _disE, [], 25, "NONE"];
_group1 createUnit ["UK3CB_TKM_O_RIF_1", _disE, [], 25, "NONE"];
_group1 createUnit ["UK3CB_TKM_O_RIF_1", _disE, [], 25, "NONE"];
_group1 createUnit ["UK3CB_TKM_O_RIF_1", _disE, [], 25, "NONE"];
_group1 createUnit ["UK3CB_TKM_O_RIF_1", _disE, [], 25, "NONE"];
_group1 createUnit ["UK3CB_TKM_O_RIF_1", _disE, [], 25, "NONE"];
_group1 setFormation "LINE";
_group1 setSpeedMode "FULL";
_group1 setBehaviourStrong "COMBAT";
_wp1grp1 = _group1 addWaypoint [(getPosATL h1),0];
_wp1grp1 setWaypointType "MOVE";
_group2 = createGroup [EAST, true];
_group2 createUnit ["UK3CB_TKM_O_RIF_1", _disS, [], 25, "NONE"];
_group2 createUnit ["UK3CB_TKM_O_RIF_1", _disS, [], 25, "NONE"];
_group2 createUnit ["UK3CB_TKM_O_RIF_1", _disS, [], 25, "NONE"];
_group2 createUnit ["UK3CB_TKM_O_RIF_1", _disS, [], 25, "NONE"];
_group2 createUnit ["UK3CB_TKM_O_RIF_1", _disS, [], 25, "NONE"];
_group2 createUnit ["UK3CB_TKM_O_RIF_1", _disS, [], 25, "NONE"];
_group2 setFormation "LINE";
_group2 setSpeedMode "FULL";
_group2 setBehaviourStrong "COMBAT";
_wp2grp2 = _group2 addWaypoint [(getPosATL h1),0];
_wp2grp2 setWaypointType "MOVE";
```
added some more reinforcements
what is params [Bill, Player, 1, {"RemoveAllPrimaryweaponItems player", "RemoveHeadgear Player"}]; supposed to do?
Parse this select 0 into 1? DUH
I want to start by removing pretty much everything from the player on command, and then replacing uniform/weapon/etc with a chosen loadout from scroll wheel selection.
The passage selected is to remove all attachments from main Weapon and then Remove all headgear. Was trying to get a multiple to work before I go in-depth
As I said, I'm really new to scripting so any pointers would be extremely helpful 🙂
can i ask, is it something that you specifically want or are you able to use the virtual arsenal? I know its not what youre asking for, but im just making sure you know there is an easier way of choosing a loadout 😄
mmmkay. and what were you trying to do with [Bill, Player, 1... specifically?
In short, trying to further limit Role Specific kit, which with a limited arsenal they still have access to
Bill = Name of Object being Interacted with
Player = Actioned unit
1 = Action ID
i see. replace
{
params [Bill, Player, 1, {"RemoveAllPrimaryweaponItems player", "RemoveHeadgear Player"}];
}
with
{
params ["_target","_caller","_actionID"];
removeAllPrimaryweaponItems _caller;
removeHeadgear _caller;
}
and that should make what you have so far work as intended
Do we not have to specify the to's and who's? Genuine Question
Just Tried it.
You Sir are a Scholar and a Gent, will now try and go deeper into the rabbit hole 🙂
Can someone explain the difference between setBehaviour and setBehaviourStrong?
behaviour sets the behaviour mode for each unit. strong does that, plus it also sets the behaviour mode for the group
Alright, thank you
Thanks for that, but I wrote something myself now 😄
createVehicleCrew HIND1;
HIND1 doMove (getPosATL h1);```
Why is this not working? it was until 5 minutes ago
I havent changed anything in that part, but now its not spawning
Ah
ignore me
its because the variable name isnt capitalised...
so the vehicle is spawned. the crew isnt 😄
god i can be an idiot sometimes
…variables are case-insensitive?
It may not be a variable then
i dont know what its called 😦
i just guessed
but the script works soooo 😂
hmm
thats odd
because it works after i changed it 
aand its stopped working again
what the hell
use BIS_fnc_spawnVehicle
Ill try that
…it hopefully works with flying vehicles
the helis in arma are decent at working out that they need to take off to move
Yep, works, but spawns on the ground
Hello All. Came here hoping to get some help. Starting a server using the RHS warlords missions with a few extra mods. Everything is working great but for some reason the VA is not showing up on the asset buy menu. how do i fix this? someone said the VA script might not be running?
I just gotta hope when my units pilot actually flies this, it wont spawn in the ground 😄
Looking for the command to get a relative position between 2 given objects. In my dream world, it would be a relative [x,y,z] in meters - so if Obj 1 was five meters South of Object 2, it would return [0,-5,0].
I'd like to use it for two things:
1> replace an existing script that does brute-force animation/movement (i.e. "obj1 attachTo obj2 [0,0,0]; sleep 0.03; obj1 attacTo obj2 [0,-0.5,0], sleep 0.03...." etc, etc) with a simplified loop.
2> have the script check for a threshold and stop the loop once obj1 has reached a certain distance (8m?) from obj2 ... or [0,-8,0], relative, if the intent is direct South.
I was looking at GetRelPos in the wiki, but that doesn't seem to do quite what I'm hoping, unless I'm misreading.
Does my hoped for command exist, or will I need to do a work around with getPos on both objects and having them subtract from each other?
And if I need to do a work around, is there a way to feed that back into an 'attachTo'?
im no expert, but something like this might be what you want getpos a vectordiff getpos b
Hmmm. Thanks, I'll look into vectordiff - not familiar with it!
And then, if VectorDiff is returning in [x,y,z], if could obj1 attachTo obj2 [((getPos obj1) VectorDiff (getPos obj2)) select 0, (((getPos obj1) VectorDiff (getPos obj2)) select 1)-0.5,((getPos obj1) VectorDiff (getPos obj2)) select 2] to move it straight south, yes? (or simplify 'obj1 VectorDiff obj2' into a variable to check on iteration?)
getPos obj1 vectorDiff getPos obj2 vectorAdd [0,-0.5,0] to do it only using vectorDiff once but yea sounds right to me
Thanks!
Sorry for the additional questions - I'm learning new things and definitely stretching my minimal knowledge ("just enough to get in trouble").
I'm putting all the above into a function so it can be addressed flexibly in the script, and eliminate several hundred duplicated lines on repeat items.
I am defining three parameters with private variables - "_VicName", "_VicVel", "_IRPlace"... The lest two are x,y,z Arrays. Can private variables as parameters hold Arrays, or do I need to somehow define the variable type?
If so, I assume I'd call it as nested arrays on the function, so something like:
["VIC1",[0,-20,0],[0,-0.2,1.1]] call PABLO_fnc_EjectVic (or ExecVM spawn, as appropriate)
im not entirely sure what you're asking, but yes you can use arrays as arguments like any other data type
Yeah - maybe worrying over nothing. Reading the 'Functions' page, I was just unclear whether the param using a generic private variable could take an array, or if I needed to define it as a data type, which would require a bit more head scratching on my part.
Thanks for your help and speedy replies, @robust hollow !
Aaaaannnndddd... Getting an error on my waitUntil: "undefined behavior: waitUntil returned nil. True or False expected."
Not sure why, as I feel like _VicDistance should give an integer that can be compared w/ 7.99 easily?
the 'attachTo' loop doesn't seem to work, but maybe it's progressing ahead and throwing an error before it executes the movement?
params [["_VicVel","[0,-15,0]",[],3], ["_IRPlace","[0,0,1]",[],3]];
_VicPlace = [VIC1 modelToWorldWorld [0,0,0]];
_PlanePlace = [plane01 modelToWorldWorld [0,0,0]];
_VicDistance = ((_PlanePlace select 1) - (_VicPlace select 1));
hint str _VicDistance;
for "_n" from _VicDistance to 8 step 0.5 do
{
_VicName attachTo [plane01, [(_VicPlace select 0), ((_VicPlace select 1)-0.5), (_VicPlace select 2)]];
sleep 0.03;
hint str _VicDistance;
};
waitUntil {(_VicDistance) > 7.99};
....etc...
};```
(Side note, tried making the "for/from/to/step" a "while/do/else" loop, and that was also throwing errors...)
you never update _VicDistance after you set it?
Ah. Nope. I could see how that could be a problem.
I should.... Insert it at the front of the loop?
I guess none of those update.
Hrm.
Ah. _VicName is a variable between the two slots the vics can spawn in. I had it defined in the function as a param at first.
Ah, I spotted another error, that would have bit me later. VIC1 is the same as _VicName at this point.
(That's what I get for 4am amateur coding, I should probably sleep and look with fresh eyes tomorrow...)
yea you probably should. im going to explain all the issues instead so you can fix it yourself later
Thanks - honestly, that's better than fixing it. As I said, I'm trying to learn, albeit clumsily.
ended up doing both because the issue may not make sense on their own
These parameters are positions but you set their default value as strings and you don't provide any accepted data types (though I think you intended for it to accept arrays only)
params [["_VicVel","[0,-15,0]",[],3], ["_IRPlace","[0,0,1]",[],3]];
// vs
params [["_VicVel",[0,-15,0],[[]],3], ["_IRPlace",[0,0,1],[[]],3]];
You try to subtract the Y value from both position arrays but you have put the modelToWorldWorld command in an array, so it would return [[0,0,0]], not having a select 1. I'm also not sure you need to use modelToWorldWorld at all but i'll leave it.
_VicPlace = [VIC1 modelToWorldWorld [0,0,0]];
_PlanePlace = [plane01 modelToWorldWorld [0,0,0]];
// vs
_VicPlace = VIC1 modelToWorldWorld [0,0,0];
_PlanePlace = plane01 modelToWorldWorld [0,0,0];
You are attaching _VicName to plane01 using _VicName's position as the offset, which is wrong. You should be using some method to get _VicName's offset relative to plane01 (maybe vectorDiff as mentioned earlier) otherwise the object could end up attached thousands of meters away. You also don't update the offset in the for loop after reattaching so _VicName will only ever be (_VicPlace select 1)-0.5 behind plane01.
The waituntil wont be necessary once you fix the above issues because the loop will set the offset to -8 before exiting.
so the function might work properly if it did something like this
PABLO_fnc_EjectVic1 = {
params [["_VicVel",[0,-15,0],[[]],3], ["_IRPlace",[0,0,1],[[]],3]];
private _offset = getPos plane01 vectorDiff getPos VIC1;
while {(_offset#1) < 8} do {
_offset set [1,_offset#1 - 0.5];
VIC1 attachTo [plane01,_offset];
sleep 0.03;
};
....etc...
};
how would a command look to change stance of a whole group in trigger?
units <unit> apply {_x setUnitPos "UP";};
thanksalot
yourewelcome
Hey guys, looking for a way to teleport the player and his AI squad, but with the AI actually teleported a bit further from the player so they don't all clip into each other and cause a big freeze, help would be much appreciated, here iswhat my current script looks like
this addAction ["Fast travel to C.O.P Mike", {
params ["", "_caller"];
{
_x SetPos getMarkerPos "marker_cop1";
} forEach units _caller;
}];
maybe try https://community.bistudio.com/wiki/setVehiclePosition with a placement of a few meters?
hi all! sorry for noob question. im trying to force unit throw smoke grenade, if it has any.
skipTime 3; this forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"]; [this, "SmokeShellMuzzle"] call BIS_fnc_fire; this fire "SmokeShellMuzzle"; this fireAtTarget [player,"SmokeShellMuzzle"];
nothing of above works if i put it in unit`s "Init" field in editor.
init field?
you don't use the init field for something like that 
and let's say it worked
what'd you expect to happen?
just some smoke going in some random direction
thx for answer, Leopard! well, actually i've tryed that commands in script. but as it didnt work, i try to just get it work in editor.
i want to force unit throw any smoke grenade if it has some in its inventory. direction of throwing is the next task. 🙂 if it will just throw, i`ll be very happy already.
try this in debug console:
player forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"];
your player unit should throw the smoke if he has some
yes, it works for player. should it work fo side unit?
thx! i'll try. btw, got your Adv DevTool! it looks very COOL! it encourages to try scripting even such noob like me. 🙂
run, while you still can and SQF hasn't eaten your soul!
too late. i`ll die trying to force bots throw this fkn smokeshells. 🙂
Hello, working with camera and stacked on problem.
My camera is placed above object,.
I needed to set dir of my camera to object direction, but something going wrong:
cameraObj = "camera" camCreate [0,0,0];
cameraObj camPreparePos _pos;
cameraObj camPrepareTarget targetObj;
cameraObj cameraEffect ["internal", "back"];
cameraObj camCommitPrepared 0;
_objDir = (targetObj modelToWorld [0,-20,0]) vectorFromTo (targetObj modelToWorld [0,20,0]);
cameraObj camSetDir _objDir;
cameraObj camCommit 0;
maybe i doing something wrong?
camPrepareRelPos?
@winter rose little bit changed, but still - camera direction is not same to direction object (visual)
what exactly do you want - the camera to be 20m behind the object, right?
no, i trying to get direction of model (vector) to set camera direction
what is the end goal?
you are setting the cam's target @dusky pier, no need to camSetDir?
there is screenshot, i hope that will better show - what's going wrong 🙂
(yum)
i don't change object direction, cuz is not local (another players can see changes when player doing something with object)
i understand - rotate camera is not best solution, but i need to save direction of object
if you set the camera's target, you cannot camSetDir - the object will be targeted by the camera automatically
then you can do whatever you want?
but I still don't get what you want to do
do you want to have the camera above the thing?
ye, just camera above object
i create display and manipulate this object (with animations etc)
- prepare target targ
- prepare rel pos [0,0,10]
- commit
- ????
- profit
when close display - camera getting destroyed
ty, gonna try this one
idk why, but camera still don't get direction of target :\
why do you want it, I really don't get it
you want camera from above, here you go?
yep, camera above object
then by doing
- prepare target targ
- prepare rel pos [0,0,10]
- commit
you have it?
yep, but visual - their directions is not same
then try relPos [0,-0.01, 10]
this should force being slightly behind
nah, is the same
post simplest code plz?
_pos = getPosATL targetObj;
_pos set [2,1.8];
cameraObj = "camera" camCreate [0,0,0];
cameraObj camPreparePos _pos;
cameraObj camPrepareTarget targetObj;
cameraObj cameraEffect ["internal", "back"];
cameraObj camCommitPrepared 0;
cameraObj camPrepareRelPos [0,-0.01,1.8];
cameraObj camCommitPrepared 0;
and what is the end result plz?
the object is located on a hill (small slope), probably problem in that
aaah, yes
why was i half expecting atan2 to return radians instead of degrees
i find the way 😄
just added :
[targetObj,0,0] call BIS_fnc_setPitchBank;
before camera creation
and used camPrepareRelPos
cameraObj = "camera" camCreate [0,0,0];
cameraObj camPreparePos (targetObj modelToWorld [0, -0.01, 1.8]);
cameraObj camPrepareTarget targetObj;
cameraObj cameraEffect ["internal", "back"];
cameraObj camCommitPrepared 0;
```if this does not work, then you may have to `attachTo` and `setVectorDirAndUp` the camera (and I drop the ball here 😄)
ah yeah, you reset it!
targetObj setDir getDir targetObj works too 😉
thank you a lot! 🙂
mind, if it is in on a big slope, the object will then partially go through it
ye, probably :\
i will make with attachto then
or prevent players to place BBQs on slopes, it's dangerous anyway ^^
is possible to get info about slope? 0_o
i just tryed to find something about that, but didn't find
yes, see surfaceNormal
thank you
Good day. Why can this be not working?
_someButton ctrlSetTooltip "Click or use mouse wheel";
Might the control type doesn't support it?
It's a button, so it should be working according to biki
can you do systemChat str [ctrlType _someButton]?
hmmm, it prints '1'
Checked documentation - yeah that's a correct value then
🤔
Could it be related to enabling/disabling this thing over the script flow?
Make sure you're running the script, might sounds stupid but should double check it
Algun programador español para comentarle una cosilla??
hello, this discord speaks English only, but we can help 🙂
Just a quick question: why does this code skip one of the minute numbers?
waitUntil {!isnil "BIS_fnc_establishingShot_playing" && {!BIS_fnc_establishingShot_playing}};
any= ["Operation Hijack" ,
"PVP Hostage Extraction" ,
str (date select 3) + ":" + str (date select 4)]
spawn BIS_fnc_infoText;
example: https://cdn.discordapp.com/attachments/789257226032250921/829008304209657856/unknown.png
ah I was under the impression that it would display 00
For anyone reading this with the same problem: since my current mission has the starting time always be the top of the hour, I've successfully modified the code to be
str (date select 3) + ":00"]
Question for the seniors 👴 : what is the difference between a team: https://community.bistudio.com/wiki/Team
And a group: https://community.bistudio.com/wiki/Group ?
(Context: am looking for a way to make forEach loops easier for members of a group)
Groups are the thing to use, Teams were never finished as far as I'm aware.
with artillery units, there are the firemodes like Single1 with different charges and so on. How can i make the artillery select the specific firemode (charge) ?
Hey guys, is there a way i can spawn an AA missile to fire at a helicopter but delete it before it hits?
I dont want the missile to actually do any damage to the heli, that will be handled by another script
can some one help me with formating this:
addMissionEventHandler ["EntityKilled",
{
// params ["_unit", "_killer", "_instigator", "_useEffects"];
params ["_killed","_killer"];
_count = [20,1] select (side _killed isequalto resistance, side _killer isequalto west);
dreResourcesW = dreResourcesW + _count;
hint str dreResourcesW;
}];
it's not formatting, it's scripting that is required here
select takes Code as a right-hand argument for what you want to do btw
_disM = h1 getRelPos [1000,60];
_missile = createVehicle ["Missile_AGM_01_F",_disM,[],0,"FLY"];
_missile setDir getDir player;
_tgt = h1;
[_missile,_tgt] spawn {
params ["_missile","_tgt"];
sleep 0.1;
_missile setMissileTarget _tgt;
};
``` h1 is a helicopter, this doesnt appear to be shooting at it, and i cant find why
if the missile is not meant to lock on the target, it won't (don't know if that's the case here)
I'm gonna keep editing values and see if i can even see the missile
at the moment all i hear is a small explosion
The final part 'setMissileTarget' should mean it locks on.
However, i may be using the complete wrong function

