#arma3_scripting
1 messages · Page 512 of 1
maybe make your buttons semi-visible at least to check their position
i checked its position and its good.
what could be the problem
{
idc = -1;
type = 16;
style = "0x02 + 0xC0";
default = 0;
shadow = 0;
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
colorBackground[] = {0,0,0,0};
colorBackgroundFocused[] = {0,0,0,0};
colorBackground2[] = {0,0,0,0};
color[] = {0,0,0,0};
colorFocused[] = {0,0,0,0};
color2[] = {0,0,0,0};
colorText[] = {0,0,0,0};
colorDisabled[] = {1,1,1,0.25};
period = 1.2;
periodFocus = 1.2;
periodOver = 1.2;
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};;```
i couldn't send the whole class cause its long but this is it
¯_(ツ)_/¯
I can't help you on that, because I'm no UI expert, and because I don't really get the full issue
where can i post it to get helped?
here @verbal knoll , just with another person ^_^
I would say it is the right channel, that or #arma3_config maybe
(╯°□°)╯︵ ┻━┻
@tough abyss The car script
Anyone have a clue on the issue I had? I tried setting ctrlSetFocus then set the value to the MouseHandler idd. But still the same?
I set it to splendid camera instead and that worked but I dont want to use splendid camera
How stupid could I be!!! I used createDialog and not cutRsc lol, but now when clicking a player it wont select.
how can i put a cutrsc over a dialog? I try with layer 0 and with layer 9999 and not working
any ideas?
pretty sure dialogs are always on top
and can't put over?
not if its always on top... no.
i could be wrong, but im pretty sure this is the case.
hint is over the dialog 😦
hint isnt a cutrsc though, is it?
and what its?
uhh... cutrsc's are??
not sure what answer u are looking for there.
thanks for u help @robust hollow
He wants to display a CutRsc on top of a dialog
yea i got that.
Hey guys, I'm getting an error at: _atmbase |#|setVariable [_var,"",true]; Error Type Object, expected String
// Create Prefined Helipad Objects
private _atmLocationsBase = [
[atmOld_0,[3643.16,3848.06,0]],
[atmOld_1,[3675.59,3300.71,0]],
[atmOld_2,[2801.88,3722.89,0]],
[atmOld_3,[4073.57,4433.83,0]],
[atmOld_4,[3673.35,3104.09,0]],
[atmOld_5,[3621.02,3308.61,0]],
[atmOld_6,[5301.06,3396.56,0]],
[atmOld_7,[5441.65,2852.52,0]]
];
private _atmLocations = [];
{
_x params ["_var","_pos"];
_atmbase = createVehicle ["Land_HelipadEmpty_F",_pos];
private _varSTR = str _var;
_atmbase setVariable [_varSTR,"",true];
_atmLocations pushBack _var; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
// Hide all ATMs in a radius around the Helipad Objects
private _atmClassnames = [
"Land_Atm_01_F",
"Land_Atm_02_F",
"Land_ATM_01_malden_F",
"Land_ATM_02_malden_F"
];
{
private _pos = getPosATL _x;
private _atmList = nearestObjects [_pos,_atmClassnames,15,false];
{
_x hideObjectGlobal true;
} forEach _atmList;
} forEach _atmLocations;```
_atmbase setVariable [_varSTR,"",true]; 😉
lol I've done that so many times
what on earth? is _varStr reserved?
since you don't use it more than once, you could just do _atmbase setVariable [str _var,"",true];
for setVariable?
Same error.
// Create Prefined Helipad Objects
_atmLocationsBase = [
[atmOld_0,[3643.16,3848.06,0]],
[atmOld_1,[3675.59,3300.71,0]],
[atmOld_2,[2801.88,3722.89,0]],
[atmOld_3,[4073.57,4433.83,0]],
[atmOld_4,[3673.35,3104.09,0]],
[atmOld_5,[3621.02,3308.61,0]],
[atmOld_6,[5301.06,3396.56,0]],
[atmOld_7,[5441.65,2852.52,0]]
];
_atmLocations = [];
{
_x params ["_var","_pos"];
_atmbase = createVehicle ["Land_HelipadEmpty_F",_pos];
_atmbase setVariable [str _var,"",true];
_atmLocations pushBack _var; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
// Hide all ATMs in a radius around the Helipad Objects
_atmClassnames = [
"Land_Atm_01_F",
"Land_Atm_02_F",
"Land_ATM_01_malden_F",
"Land_ATM_02_malden_F"
];
{
_pos = getPosATL _x;
_atmList = nearestTerrainObjects [_pos,_atmClassnames,15,false];
{
_x hideObjectGlobal true;
} forEach _atmList;
} forEach _atmLocations;```
So it's not the actual line, I am assuming, that is the problem.
I've not stored objects in that way before, wonder if it's something weird with the string conversion
Do you spawn _atmbase for the sole purpose of storing the object list?
I spawn it to spawn it. I then get the _var and pass it into an array.
ah yeah, small screen formatting was throwing me
I just didn't want to define the
atmOld_1
atmOld_2
atmOld_3
atmOld_4
atmOld_5
atmOld_6
atmOld_7``` again
oh, so you want to create helipads and name them atmOld_0 through atmOld_7?
why not do somehting like this?
// Create Prefined Helipad Objects
_atmLocationsBase = [
[3643.16,3848.06,0],
[3675.59,3300.71,0],
[2801.88,3722.89,0],
[4073.57,4433.83,0],
[3673.35,3104.09,0],
[3621.02,3308.61,0],
[5301.06,3396.56,0],
[5441.65,2852.52,0]
];
_atmLocations = [];
{
private _var = format["atmOld_%1",_forEachIndex];
_atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
_atmbase setVariable [_var,"",true];
_atmLocations pushBack _var; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
.....
Yep, although I think he wants the object for the next loop:
{
private _var = format["atmOld_%1",_forEachIndex];
_atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
_atmbase setVehicleVarName _var;
_atmLocations pushBack _atmbase; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
// Create Predefined Helipad Objects
private _atmLocationsPos = [
[3643.16,3848.06,0],
[3675.59,3300.71,0],
[2801.88,3722.89,0],
[4073.57,4433.83,0],
[3673.35,3104.09,0],
[3621.02,3308.61,0],
[5301.06,3396.56,0],
[5441.65,2852.52,0]
];
{
private _atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
} forEach _atmLocationsPos;
// Hide all ATMs in a radius around the Helipad Objects
private _atmLocationsClassnames = [
atmOld_0,
atmOld_1,
atmOld_2,
atmOld_3,
atmOld_4,
atmOld_5,
atmOld_6,
atmOld_7
];
{
private _pos = getPosATL _x;
private _atmList = nearestTerrainObjects [_pos,["Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"],15,true,false];
{
_x hideObjectGlobal true;
} forEach _atmList;
} forEach _atmLocationsClassnames;
``` Errors with: `_atmList = |#|nearestTerrainObjects [_pos,["Land_At` `0 elements provided, 3 expected`
Changed
wait
I need the variable
as I am creating the objects
then referencing them
updated: sqf // Create Prefined Helipad Objects _atmLocationsBase = [ [atmOld_0,[3643.16,3848.06,0]], [atmOld_1,[3675.59,3300.71,0]], [atmOld_2,[2801.88,3722.89,0]], [atmOld_3,[4073.57,4433.83,0]], [atmOld_4,[3673.35,3104.09,0]], [atmOld_5,[3621.02,3308.61,0]], [atmOld_6,[5301.06,3396.56,0]], [atmOld_7,[5441.65,2852.52,0]] ]; _atmLocations = []; { _x params ["_var","_pos"]; _atmbase = createVehicle ["Land_HelipadEmpty_F",_pos]; _atmbase setVariable [str _var,"",true]; _atmLocations pushBack _var; // Passed Each atmOld_x so that it can be used later } forEach _atmLocationsBase; // Hide all ATMs in a radius around the Helipad Objects _atmClassnames = [ "Land_Atm_01_F", "Land_Atm_02_F", "Land_ATM_01_malden_F", "Land_ATM_02_malden_F" ]; { _atmList = nearestTerrainObjects [getPosATL _x,["Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"],15]; { _x hideObjectGlobal true; } forEach _atmList; } forEach _atmLocations;
_atmLocationsBase can't reference atmOld_x because they don't exist yet. This combines Connor's and my suggestions:
_atmLocationsBase = [
[3643.16,3848.06,0],
...
];
_atmLocations = [];
{
private _varStr = format["atmOld_%1",_forEachIndex];
_atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
missionNamespace setVariable [_varStr, _atmbase, true];
_atmLocations pushBack _atmbase; // Passed Each atmOld_x so that it can be used later
} forEach _atmLocationsBase;
...
although publicVariable may be needed to broadcast the object, can't remember
only if you need to reference it on other clients that is
like so? sqf // Create Prefined Helipad Objects _atmLocationsBase = [ [3643.16,3848.06,0], [3675.59,3300.71,0], [2801.88,3722.89,0], [4073.57,4433.83,0], [3673.35,3104.09,0], [3621.02,3308.61,0], [5301.06,3396.56,0], [5441.65,2852.52,0] ]; _atmLocations = []; { private _varStr = format["atmOld_%1",_forEachIndex]; _atmbase = createVehicle ["Land_HelipadEmpty_F",_x]; missionNamespace setVariable [_varStr, _atmbase, true]; publicVariable _varStr; _atmLocations pushBack _atmbase; // Passed Each atmOld_x so that it can be used later } forEach _atmLocationsBase; // Hide all ATMs in a radius around the Helipad Objects _atmClassnames = [ "Land_Atm_01_F", "Land_Atm_02_F", "Land_ATM_01_malden_F", "Land_ATM_02_malden_F" ]; { _atmList = nearestTerrainObjects [getPosATL _x,["Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"],15]; { _x hideObjectGlobal true; } forEach _atmList; } forEach _atmLocations;
There are no visible errors. However, nothing is hidden.
After running the script, with Global Vars...
Ah, misunderstood the intent, don't need publicvariable since the end goal is hideObjectGlobal
is _atmLocationsBase getting populated?
_atmLocations rather
// Create Prefined Helipad Objects
CAP_atmLocationsBase = [
[3643.16,3848.06,0],
[3675.59,3300.71,0],
[2801.88,3722.89,0],
[4073.57,4433.83,0],
[3673.35,3104.09,0],
[3621.02,3308.61,0],
[5301.06,3396.56,0],
[5441.65,2852.52,0]
];
CAP_atmLocations = [];
{
private _varStr = format["atmOld_%1",_forEachIndex];
CAP_atmbase = createVehicle ["Land_HelipadEmpty_F",_x];
missionNamespace setVariable [_varStr, CAP_atmbase, true];
CAP_atmLocations pushBack CAP_atmbase; // Passed Each atmOld_x so that it can be used later
} forEach CAP_atmLocationsBase;
// Hide all ATMs in a radius around the Helipad Objects
{
CAP_atmList = nearestTerrainObjects [getPosATL _x,["Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"],15];
{
_x hideObjectGlobal true;
} forEach CAP_atmList;
} forEach CAP_atmLocations;```currently running ^
I do keep restarting the sneario
I think it's working, but your types filter isn't returning anything
if I just look for "house" I get objects returned
right
is Land_Atm_01_F a house??
Welp it works
Just need to find the oh LAND
but then it would get all the stuff...? hm
what are you wanting to hide?
The ATM
all of these: "Land_Atm_01_F","Land_Atm_02_F","Land_ATM_01_malden_F","Land_ATM_02_malden_F"
🤦 I was thinking those were generic types for some reason
lol
xD
sorry
ffs mate @foggy moon https://gyazo.com/3df2781e61f757556897d4d69563e937
wow..
ha, forgot about that one
I spend more time with code than modules 😂
sure thing
I want to add a blacklist with 300m radius for every vehicle spawned (not sure if this is a good idea) but i need a way to restrict vehicles from spawning to close to each other.
So i was thinking about to "append" the blacklist array for BIS_fnc_findSafePos with the position of every spawnd car and these 300m distance. But i have no clue how to do it, anyone kind enough to help me out 😵
[[18313.8,15758.2,0], 4300 ],
[[8139.13,14254,0], 800 ],
[[12169.7,17815.9,0], 500 ],
[[4734.24,7539,0], 500]
];```
anyone knows if i can press a key via script? e.g. enter or whatever?
no, you cant
What are you trying to do @west grove
i want to switch the optics viewmode via script
e.g. start in a vehicle with optics mode and nvg on
going into optics mode is no big deal, but switching the view mode seems impossible
is only for player characters
what i'm looking for is a way to change the optics vision mode in vehicles
being able to switch to thermal, etc
@knotty arrow what are you trying to put over what dialog? You can get dialog display and ctrlCreate over it
@west grove you can make an Arduino project with servo motor and some contraption to press a key and activate it over callExtension 😂
made me smile
Then maybe you can generate Windows event for key press via extension
@west grove what's the actual thing you want to happen? On mission start players are in vehicle with certain type ov view mode on?
yes
i'm using switchCamera to get into the gunner optics, but that's all i can seem to do
there's quite some other camera related commands, but as far as i could see, it's only related to "real" created camera objects
this for example https://community.bistudio.com/wiki/cameraEffect
if it is possible to use on the gunner viewpoint, then i have no idea how to do it
Probably is not.
Not sure if I've ever seen mission start with certain type of view mode on.
Maybe via modding ? 😒 Probably not worth it
You could try If AI could remote control the player for a sec and if it would switch vision mode.
@barren spindle can't really see a solution that way either
if the only vision mode avaible is nvg
i guess it was simply never needed by anyone at BI, thus a command doesn't exist. is a bit weird to me, because there's commands for like anything else.
aggre
@west grove yeah. Typically in scenarios I've played we have managed to put on view mode that is appropriate
what vehicule are you using ? Wanna do some testing for the lolz
try the nato hunter
or any other, doesn't really matter. i think most vehicles have multiple view modes, no?
sucks that we can't press a key via script. would solve the issue easily.
@young current suggested to replace player with AI, make AI swtich to NV and then back to player, I don't know sh** about AI but maybe it could work ?
Could work yeah
but will the ai switch to nvg in vehicles? don't think i have ever seen that
no idea
They probably go straight to thermal
disable TI then
at least drones won't auto-switch the vision modes.
i mean, in the end, the drone gunner is just the normal ai as well, no?
Any way to add dynamic text to an image?
if the image is shown as part of a dialog you can put a text control over top of it, but no, can't add text directly to the image itself.
I wonder how they do it with license plates
they have an image for each letter and number
Is there any way I could unblock WASD keys or Make the player move when using createDialog. I have a display open that is the EGSpectator camera. I have tried doing createDisplay for the dialog but that doesnt work because the camera is a display. Doing a cutrsc for the "dialog" kinda works, the camera can move but u cant click anything on the "dialog".
is there a command to check if a unit is controlled via remoteControl command ? Im switching into a gunner from a terminal and want to block access if a player is already using the unit.
Guys. I'm capturing the flag. After the call addAction the script runs
for "_i" from 0 to _time step 1 do {
[_target,"inCapture",true] call CBA_fnc_setVarNet; //Setting the status flag to whoever was able to capture when the capture
hint format ["Capture %1 of %2",_i,_time];
if (speed player > 24 OR {player distance _pos > 20} OR {!alive player} OR {vehicle player != player} OR {isNull _caller}) exitWith {_exit = true;};
sleep 1;
};
When a person crashes When the person takes off the capture status does not change.
if (_exit) exitWith {
_target setVariable ["inCapture",nil,true];
};
@foggy moon what on earth? is _varStr reserved? No. "" is reserved. If _varStr is empty string... Error.
@radiant egret you can check who the player is remote controlling. But not whether a unit is currently being remote controlled
Maybe you can. I'll check out how it's done in the RC module.
@fleet hazel Parameters cba_fnc_setVarNet
_object Object namespace <OBJECT, GROUP>
_varName Name of the public variable STRING
_value Value to broadcast <ANY>
@lilac escarp [_target,"inCapture",true] call CBA_fnc_setVarNet;
addAction transfers params ["_target", "_caller", "_actionId", "_arguments"];
_broadcasted = [player, "somefish", 50] call CBA_fnc_setVarNet;
@lilac escarp I have no problem with that. I need. If a player is banned from the server use
[_target,"inCapture",false] call CBA_fnc_setVarNet;
or player disconnect
@radiant egret
Looks like there is no way as Dedmen already said, but the remote control module sets the variable "bis_fnc_moduleRemoteControl_owner" for the remote controlled unit. I would say this is the way to go. Just use this variable in your script for an exception handling.
@lilac escarp ???
ty for the help
But that variable is probably not globally set right?
@fleet hazel I don’t quite understand why this is necessary. but can try like that?
for "_i" from 0 to _time step 1 do {
hint format ["Capture %1 of %2",_i,_time];
if (speed player > 24 OR {player distance _pos > 20} OR {!alive player} OR {vehicle player != player} OR {isNull _caller}) exitWith {_exit = true;};
if (_i == _time) exitWith {
[_target,"inCapture",true] call CBA_fnc_setVarNet;
};
sleep 1;
};
It is set globally.
When the player calls the script, the flag is superimposed
[_target,"inCapture",true] call CBA_fnc_setVarNet;
If the player disconnect, you need to have
[_target,"inCapture",false] call CBA_fnc_setVarNet; @lilac escarp
[] spawn {
//create UXO
_uxo = "BombCluster_02_UXO1_Ammo_F" createVehicle position player;
//Check if bomb has blown up / been defused
waitUntil {
sleep 1;
!alive _uxo;
};
systemChat "Bomb defused!";
};
Doesn't work when defusing. Works fine with any mine but not UXO's. Seems to be because they're not deleted the same way when defused. Could be because devs didn't want people being able to pickup and "plant" UXO's? Anyone know a fix?
Can simple expressions be used in ParticleArray or setParticleParams? If not, can we choose which values override in config using setParticleParams?
@cold pebble Yup, for dev purpose
Then no, it won't be as it never is used by clients 😛
Getting an error that says 3 elements provided, 2 expected but setVariable is supposed to have/be able to have 3 right?
(findDisplay 999001) setVariable ["start", false, false];
no
public variable on a display makes no sense
also false is the default.. providing the public parameter false also makes no sense
https://community.bistudio.com/wiki/setVariable main syntax @coarse schooner
Additionally it makes no sense that Arma error's when more than required values were provided. Not like it breaks anything..
It makes sense it is a different syntax internally
Public is optional param in the same syntax for object but not control or display
Can anyone confirm that this works with non-local objects? 🤔
https://community.bistudio.com/wiki/targetKnowledge
I think I've checked it once and it seemed to work... but having some clarification about locality of this function would be great
It makes sense it is a different syntax internally Not really. It's DISPLAY setVariable ARRAY
How many elements the array has is irrelevant
It doesn't have to read the 3rd parameter if it doesn't use it. It being there doesn't break anything
just a stupid ==2 instead of >= 2 check
Don’t pass 3rd param where there is none required - problem sorted
@tough abyss i am trying put a cutrsc over a dialog
Try to pass more than 3 elements for position then and call it stupid if it errors
Why BI why u no give me pass 4
@knotty arrow yeah you said that before
I guess it's better to error in this case. What if we tried to set it to global with true global flag. It would ignore it and give no error. But currently it clearly shows that something is wrong.
its impossible i think, i try with layer 0 , -1 and 9999
What is so special about cutrsc?
Why can’t you just ctrlCreate whatever or createDisplay it for that matter?
Hello im making a holster trigger on my server so people cant spawnkill in base, but they still get forced holstered outside trigger can anyone help? :/
Am I right that when I deleteVehicle, the game doesn't erase all object data, but leaves some data to mark this object as deleted so that isNull command can work? If not, how does it still know that the object is Null if it does not exist any more? 🤔
Not sure about how it's done internally, but in theory the references could be reassigned to objNull when the deletion is handled.
Thx, I guess this is a better explanation (:
I was wondering if creating and instantly deleting an object leaks memory actually
Since Dedmen's reveal of the compile memory leak, I wouldn't be surprised anymore 😄
@crystal schooner more detail please.
@lilac escarp i fixed it, but is there a way to create map markers attached to group leaders? 😃
I want a map marker attached to squad leaders to mark their squads location is that possible
@crystal schooner try this:
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
{
_leader = leader _x;
_this select 0 drawIcon
[
"iconStaticMG",
[1,0,0,1],
getPos _leader,
24,
24,
getDir _leader,
"Leader",
1,
0.03,
"TahomaB",
"right"
]
} forEach allGroups;
}];
a quick check to see if I need to rethink my code structure, what will happen if i say: _unit addMagazineCargoGlobal [_smokegrenade, 0];
@thorn wraith error )
...crap
@lilac escarp wont that mark enemy groups aswell
if (side _leader == “WEST”) then {
_this select 0 drawIcon
[
...
...
how should i execute the script
insert into initPlayerLocal.sqf
Roger
Perhaps there are errors, because I wrote from the phone.
if (side _leader == west) no need for quotes here
side is a type itself, not a string
yeah. my mistake
Yeah, idk if its me doing something wrong or the script but still not working.. 😦 I'll send a pastebin of it in a sec
where are the mistakes? strange that they are not!)
you forgot to close if! };
@crystal schooner try this:
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
{
_leader = leader _x;
if (side _leader == WEST) then {
_this select 0 drawIcon
[
"iconStaticMG",
[1,0,0,1],
getPos _leader,
24,
24,
getDir _leader,
"Leader",
1,
0.03,
"TahomaB",
"right"
]
};
} forEach allGroups;
}];
)))
How to change the name of it to [Group Name, name leader _x] ?
And only for players
My English is very bad. Explain what Roger and ty mean))
Roger - Ok
TY - Thank you
“Leader” => str(name _leader)
Name returns string why do you want str it?
“Leader” => str([groupId _x, name _leader]);
Ok ill try
@tough abyss I do not know. I'm just scattered
str([groupId _x, name _leader]);,
Error missing ]
Obviously error, you cannot have ; inside array
Yep
Yep, works as a charm just want a different icon on it now
how can i remove or hide the tree after setDamage 1;?
I don’t remember the icon for the player. I can tell you later.
You can only hide it
hide does not work for some reason
Does it still have a bug when you destroy tree by script but for JIP it is still standing?
not. it falls and lies for all. but neither hideObject nor hideObjectGlobal works.
Well how about u use the script that removes buildings on it
or cant you just repair the tree and then hideObjectGlobal?
hide does not work on map objects. according to biki)
The edit terrain module works to remove trees
@young current I hack it. it disappears and firewood appears
that may not be possible in Arma. you can check what the hideTerrainObject module does
{ _x hideObjectGlobal true } foreach (nearestTerrainObjects [this,[],50])
create a game logic
@lilac escarp where does it say on biki it doesn’t work for map objects?
on tree pos
@crystal schooner never execute global commands from init field. Never
@tough abyss
sorry. I am confused.
Can be used on all objects with class names, i.e. (typeOf object != "").
@lilac escarp that could also be an old note, hide object had many modifications since it was introduced, I wouldn’t be surprised if you can hide those objects as well now
I try:
_tree setDamage 1;
deleteVehicle _tree;
And
_tree hideObjectGlobal true;
does not work
Of course it won’t work
Hmmm
God knows what deleteVehicle does to the reference
is there any script that can get the p3d location of a cursor target?
p3d?
arma's model format
Oh the path to the model?
thanks
What a fuck
is there a way to use the drawicon command for local markers or nah
Yeah it draws icon, like marker, don’t get the question
Does the drawicon command make makers globally or is it only local makers?
It draws it on your map only
Oh ok ty
drawicon doesn't make any markers. It draws an icon
Ye well you know what i mean
no I don't
😦
createMarker creates markers globally. createMarkerLocal creates a local marker
Ye i know
what are you trying to do
Well so know i got a drawicon for marking group leaders , but i want to make a drawicon for players that arent leaders aswell
so group leaders will be marked for everybody but players will only be marked for the player itself
You have to draw on every pc anyway and then you can put condition on what to draw
So you want each player to see themselves only + all leaders?
Ye, and if you're the group leader instead of getting the group leader marker on yourself you should get the player marker
You need 2 drawIcon commands one for player and one forEach leaders minus player
Would this work for the group leader marker
if (side _leader == WEST && isPlayer _leader && !(_leader == player)) then {
What so _leader !=Player
yyyup
Ah i see
! is not
well i'll fix that but elegant, when i test the script on editor it works but when my mate put it on a server noone saw the icons
Server logic vs client logic?
It was in Initplayerlocal
I havent done much arma stuff so im useless here
@crystal schooner help about?
["InitializePlayer", [player, true]] call BIS_fnc_dynamicGroups;
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
{
_leader = leader _x;
if (side _leader == WEST && isPlayer _leader && !(_leader == player)) then {
_this select 0 drawIcon
[
"iconman",
[0,0.3,0.6,1],
getPos _leader,
24,
24,
getDir _leader,
str([groupId _x, name _leader]),
1,
0.03,
"TahomaB",
"right"
]
};
} forEach allGroups;
}];
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",
{
_this select 0 drawIcon
[
"iconman",
[0,0.3,0.6,1],
getPos player,
24,
24,
getDir player,
name player,
1,
0.03,
"TahomaB",
"right"
]
}];
This is my initplayerlocal and it has the icons in it but it doesnt show the map icons on the server but it worked for me locally on editor
Try waitUntil {!isNull findDisplay 12}; before everything
yep, definitely
If there is briefing then one will need to wait for mission start
waituntil {!isnull cameraon && getClientState != "MISSION RECEIVED" && getClientState != "GAME LOADED" && alive player};
got that in start is that enough or no
Probably just time>0 would do
Any clue why I cant seem to retrieve my lbData?
{
_index = lbAdd [1500, _x select 2];
lbSetData [1500, _index, format ["%1", _x]];
} forEach _permissions;```
then this gets called when the listbox changes:
_control = _this select 0;
_value = _this select 1;
_data = lbData [_control, _value];
hint format ["%1 : %2 : %3", _control, _value, _data];```
Control and value both get returned so im pretty confused as to why I get lbData.
god damn it, fixed it
gotta do _control lbData _value
the other syntax is for explicit idc
Any easy way to get the real unit's side? I want to handle the condition when unit is captive and the game returns civilian side
_unit setVariable ["side",side _unit,true]; when the unit is created.
Allright... thought that maybe I can retrieve somehow without storing it myself. Thanks.
What side group unit returns?
good idea! Will check that.
side is also defined in the config
so you could use that
easiest way is to setVar when unit created 'tho
Are there any decent guides/tutorials for developing addons? I've seen a few good scripting series on YouTube, but they're all focused on mission making, and I'm a little confused about how that differs from addon development, especially in terms of architecture/file structure
I've tried looking through the source code for a few of the functionality addons I use but they're always gargantuan so it's really difficult to follow the trail of breadcrumbs and make sense of it all
So I'm trying to teleport a player to an identical house in the identical spot and am using this
_Unit setPos (HouseTarg01 modelToWorldVisual (_House worldToModelVisual getPos _Unit));
however it seems to teleport me about 1m low so I get stuck in the staircase
Attach detach unit instead
Unless the house is map house then you can’t, would only work with editor placed one
In any case setPos is the wrong command for the job
_Unit attachTo [HouseTarg01, [(HouseTarg01 modelToWorldVisual (_House worldToModelVisual getPos _Unit))]];
this is giving me 1 element provided, 3 expected error
because you put the position (modelToWorldVisual) into an array. so its basically [[0,0,0]]. 1 element.
Oh yeah, that fixed it. But even with attachTo it's still placing me low
I just went back to setPos but did vectorAdd [0,0,1] and it works fine now
👋 Hello everyone, new here!
player setVariable ["side",side player,true];
I've a question about this, i'm using something very similar but to have a reliable way of retrieving a unit's name.
I assign this variable in the initialization of my game-mode engine locally to each client.
It does happen from time to time (for JIP players) that, exclusively for them, a unit name variable is not defined to them.
The documentation states that the broadcasting of said variable should happen reliably and for JIP as well, but does any of you share the same experience with variables that are set only once at the beginning of a mission?
I did code a workaround to query from a client to another client specifically to retrieve its name:
scriptName "fn_getUnitName";
if (isRemoteExecuted) exitWith {
player setVariable ["name", name player, remoteExecutedOwner];
};
private _unit = param [0, objNull, [objNull]];
if (isNull _unit || !isPlayer _unit) exitWith {"ERROR: NULL UNIT"};
private _name = _unit getVariable ["name", ""];
if (_name isEqualTo "") then {
[] remoteExec ["client_fnc_getUnitName", _unit];
_name = "WARNING: Name Pending";
};
_name
Any thoughts?
I have run into a similar issue on a couple of occasions. it was quite rare, but when it happened, the unit the variables were set to was some kind of bugged out, eg: server didnt recognize the unit (netid returned null obj on server, even though it had a proper netid). Only happened after a the server had restarted the mission/switched to a new mission in the rotation.
If that isnt the circumstance your issue is occurring under then 🤷 i know ive had some JIP remoteexec messages go unreceived on the odd occasion but for the most part i find setVariable JIP to be quite reliable.
we'll see if this patches things up else I'll have to investigate further. I think > ideally < the setVariable is very reliable, however once you factor in network disruptions this might occur more often then we'd like to think. Most of the times I probably not notice it because from time to time I tend to refresh variables, however if they're only set once... there might be this chance 😦
Are there benefits to CBA function caching over the cfgFunctions library? I know CBA had a speed advantage over the standard preprocessfile function defines in the older games, is this the case with ArmA 3? Or is the main advantage the naming system?
cba compiles into uiNamespace once at gamestart
and then only "copies" the functions from there to missionnamespace
though afaik CfgFunctions does similar
over the standard preprocessfile function defines Usually every function is preprocessed, CBA and CfgFunctions both do that
The naming system is also the same
@slim oyster how do you figure CBA speed advantage?
Well technically CfgFunctions iterates through config. While CBA runs a script with constants.
So.. I guess technically it's faster? like.. a few microseconds or so?
Hello dear Multiplayer people; does any of you know, in the case of a loaded MP game, if client's didJIP returns true or false?
Did client JIP or not?
I don't remember how a loaded MP game happens, actually
let's say 4 players play a mission, the server saves. What happens if:
- server loads the save
- people disconnect, sleep, reconnect, server loads the save
I want to know the sneaky perks of didJIP
If people disconnect/reconnect they will be JIP obviously. As for save load one need to test
who feels like it? 👀
Afaik saving/loading MP scenarios is broken like hell, I remember ranting about it at the feedback tracker 😄
Well I can help you test it if you want, @winter rose
Or you can actually run two arma clients on your own computer
that's kind of you! well if anyone already has the info please tell me, else I will cook a test mission to check that someday
it would probably be safer and more reliable to make your own save script
I am actually trying to get didJIP behaviour for the wiki; the MP save system is a whole different story I am not sure I want to put my nose into!
I'd be surprised if didJIP would return true for loaded saves
I hope not, but who knows. Just to be safe!
I will mention on the biki it only if it is the case.
I'm gonna predict a definite no. Saves don't have to be played with the same players in the same slots or players at all. JIP status would have to be saved as some separate state that'd have to coded explicitly.
Noob question: Are there any shorthand operators in SQF for incrementing/decrementing, etc.? Like ++, --, or += / -=?
Nice, I'll have to look into macros
#define INCREASE_MY_STUFF_PLEASE(varName) varName = varName + 1
I've seen them used in other people's source code but I don't really get it
What? Macros? These are great. It's almost like C preprocessor, with some exceptions.
+= etc. wouldn't work in SQF without making them special constructs like the = "operator".
Maybe @still forum can add extra operators with Intercept 😄
I'm not really familiar with C, I'm coming from a JavaScript background which is just a little different, haha
Well... C preprocessor is like a tool above C which in theory can handle any files. It helps you replace strings with other strings, basicly. Most things which are valid for C preprocessor will be valid for SQF preprocessor, that's what I wanted to say.
I already told you in the past that it's not possible and why it's not
Gotcha, thanks!
Hmm... ok, don't remember, sorry
You can use =+
Arma preprocessor is not C preprocessor, it is made look like it but it is handrolled with own weirdness added @astral dawn
Most things which are valid for C preprocessor will be valid for SQF preprocessor quite a sweeping statement
Well, define, ifdef, else, endif work. Macro parameter passing is broken/different. Include paths are different. Most of the concept is still here, right?
Just because Arma preprocessor made to support some common C preprocessor directives doesn’t mean they are compatible
You probably missed lengthy discussions on here how fucked up Arma preprocessor is
I use it a lot in SQF (not configs), it's pretty dammaged, I know. I just wanted to guide the guy who has never experienced any preprocessor in the direction of C preprocessor explanation articles because there are much more articles about C preprocessor than about SQF
dammaged damaged*, you OFP-era coder :p
😂
Haha I have a friend who thought that it's the right way to write the word because of this command
Just to confirm, IsEqualTo can be used in an if statement with an Array attached and == can only deal with strings right?
Yeah... can easily test it in the debug console
== accepts a larger variety of variable types though
yeah, ta!
they fixed dammaged, yet we still have behaviour
== accepts a larger variety of variable types though I doubt that, since isEqualTo accepts anything
I meant 'a larger amount of types than what you have said (can only deal with strings)', not == accepts more types than isEqualTo 🤔
Ahh. Gotchya
@compact galleon who fixed dammaged?
@tough abyss I mean they added damaged to fix the spelling of dammaged
"STY_Item_CamoNet_BLUFOR" in uniformItems ACE_player```
would `uniformItems ACE_player` require parenthesis?
Yet we still only have behaviour instead of behavior
BI added setDamage but Dammaged is EH and it is not changed
getDammage
Not quite Dammaged
That's besides the point
Right on point, Dammaged is still Dammaged
Also there is no getDamage only getDammage
The correction for getDammage was damage
Very consistent
@vapid drift no. unary>binary
@still forum I don't know what that means but ok, thanks
@vapid drift Unary operators have precedence over binary
"STY_Item_CamoNet_BLUFOR" in uniformItems ACE_player is implicitly "STY_Item_CamoNet_BLUFOR" in (uniformItems ACE_player)
Alrighty
@compact galleon isn't behaviour British? therefore not wrong 😛
So I hope this isn't a ridiculous or overly broad question... I've been watching some scripting tutorials but they're all oriented towards mission making, whereas I'm mostly interested in making addons. Is there a big difference between the two in terms of project organization/architecture? Is there any structure that's considered standard or best practice? Where can I read or watch more about this topic?
@winter rose It's wrong because the rest is American English. like color
@winter rose technically wrong, sqf is American
inconsistent, but yep
@finite cloud I had a hell of a time with that man... I ended up just digging through other addons and trying to learn that way
SerialiZe
@finite cloud pretty much everytime I see something that I like, I try to take it apart and understand it
sometimes it works... most the time I end up here
I wish american english would adopt some things from british english, though
like tyre instead of tire
Are there any relatively simple but well-written mods that you would recommend I take a look at @vapid drift ? I've looked through like, ACE and C2 and obviously they're both monstrously complicated (well, C2 less so) so it's really hard for me to follow how all of the pieces link together
"I'm tired of tires" is american english, "I'm tired of tyres" is british english.
@finite cloud I don't have anything off the top of my head but you could always get on the workshop and look for mods that don't have too many features
Copy that, I'll peruse
sqf is American is it? isn't it czech? 😉
Thanks for the advice!
Hope it helps
A lot of the approaches to organisation and such I ended up lifting from CBA. That is a project that is small enough to understand and learn from and does things well
depends on what "sqf is American" means. I mean, SQ stands for Status Quo which is latin
Nice, I'll definitely check that out
Since you probably want to be using CBA anyway becoming familiar with it is kind of important.
And it's on GitHub, bless
lol
I'm so tired of unpacking PBOs and unbinarizing configs
There is a ACE sample project. That shows you how to build a project the ACE/CBA style
Oh shit!
It's ACE though, it uses ACE includes instead of CBA includes. For your own project you probably want to be dependant on CBA instead of ACE.
Basically just replace https://github.com/acemod/arma-project-template/blob/master/addons/main/script_macros.hpp#L1 that by the CBA one and you're golden
Well maybe a few other minor things here and there ^^
Gotcha
I stayed up all night to watch scripting videos and I got so bored with the 101 stuff I ended up spending most of the night rewriting the SQF syntax highlighter for VS Code
If ARMA 4 uses the Enfusion engine I sure hope they've rewritten the scripting engine for it
Otherwise, I'd prefer SQF
On the bright side, I have The Best syntax highlighting now
Pretty sure enfusion got rid of sqf didn't it?
wasn't that the big deal with one of these last updates of dayz?
It's still in Enfusion, but they got a new scripting engine with it when they bought the engine
but it's shit
Technically, it's retarded
Mostly separating control keywords like if/for/foreach etc. from the functions, highlighting a called function as a function instead of a variable, but most importantly adding syntax highlighting to expressions inside strings
Can somebody roast me to success? ```css
private['_chance','_blueprintArray','_blueprints','_check'];
_blueprints = ["Blueprint_P07","Blueprint_16Rnd_9x21_Mag"];
_check = nil;
{
if(!(player_itemClass in _x)) then {
_check = _x;
}
}forEach _blueprints;
if(isNil "_check") exitWith {["You do not have a blueprint in your hands!"]
oh nice dude... going to make that available?
Yeah I definitely could once it's a little more polished
I kind of hacked some things into places where they don't belong but it works for now
lol
I'm sure there are still bugs I haven't caught
It can't do threaded calls or even recursive calls, because the way it works, is that all parameters and return values in a functiono is global variables. So if you make a function like int Add(int a, int b); behind the scenes there's a int Add_ReturnValue; int Add_ParamA; int Add_ParamB; which get set before a call. So if the function calls itself, it'll overwrite the values from the original, and if multiple threads access it, you'll have race conditions. Ugh.
O.o
Effectively, this enfusion scripting language sample ```cpp
int Add(int a, int b)
{
return a + b;
}
void Main()
{
int result = Add(1, 2);
}
Is compiled to the equivalent of this
int Add_ReturnValue;
int Add_ParamA;
int Add_ParamB;
void Add()
{
Add_ReturnValue = Add_ParamA + Add_ParamB;
}
void Main()
{
Add_ParamA = 1;
Add_ParamB = 2;
Add();
int result = Add_ReturnValue;
}
And how do you know that
If ARMA 4 is gonna be on Enfusion, I just hope they've redesigned it
@tough abyss I reverse engineered it.
I don’t believe you
lol
BI bought Enfusion @tough abyss BI bought the company that made enfusion
🍿
Btw I tend to not talk that openly about that because it's still a EULA violation and might get you banned here
As a general game modder, I've broken every EULA out there already
Hell, Ubisoft's EULAs explicitly prohibit trainer making or usage even for purely singleplayer games
private['_chance','_blueprintArray','_blueprints','_check'];
_blueprints = ["Blueprint_P07","Blueprint_16Rnd_9x21_Mag"];
_check = false;
{
if(!(player_itemClass in _x)) exitWith {
_check = true;
}
}forEach _blueprints;
if(!_check) exitWith {["You do not have a blueprint in your hands!"]```
😦
in _x makes no sense. _x is a string
in in used to check if something exists inside an array
seems like you want something like player_itemClass in _blueprints
That code snippet makes perfect sense 😂
i was using that originally, but it wasn't doing what i wanted it to do
@mortal nacelle closing } is missing this will not run script and no error will be produced
can you explain what you want to do then?
"You do not have a blueprint in your hands!" Implies you just want to do an _x in assignedItems player check
I am trying to check if the item in the player's hand (player_itemClass) is in the array blueprints, if it isn't then exit the function
private _blueprints = ["Blueprint_P07","Blueprint_16Rnd_9x21_Mag"];
if !(player_itemClass in _blueprints) exitWith {["You do not have a blueprint in your hands!"]};
like that?
was about to say something before that edit xD
I'm no sure why you are returning array there. Don't know your api... It's weird but might very well be right
It's a pain in the arse to keep turning it on and off with TADST as well because with my shitbox PC it takes about 5 minutes to start..
@still forum That worked.. I'm an idiot and just over-complicate things apparently..
So my brain isn't functioning today. How do I get this script to work?
https://forums.bohemia.net/forums/topic/170383-release-vr-random-urban-area-generator-script/
It mentions marker, but doesn't state if thats a literal marker, I need to name something, do a trigger zone, ect
I tried just placing a marker down, setting variable name to "city" then tried running
0 = ["city", 500, 500] execVM "Zen_GenerateVRArea.sqf";
nothing
area marker
mine isn't really better, don't worry about that
you must be a bit damaged to use SQF after all, heheee
Can someone walk me off the edge. This nonsense is driving my nuts. Why is it changing the value for _var2 when I'm using set on _var1?
_var2 = _var1;
_var2 set [1,6];
systemchat str _var2;
// outputs ["somevalue",6]
_var1 set [1,7];
systemchat str _var2;
// outputs ["somevalue",7]```
cause both variables point to the same array (or something like that).
change line 2 to this _var2 = +_var1;
https://community.bistudio.com/wiki/Array#Copying
well that's interesting, can't believe I haven't run into this until now. Thanks!
Yeah, array variables are just references to the array in memory, not an actual copy of the array, so you have to explicitly make a copy of the array if you want two versions of it that can change values independently
So _var1 = _var2 in this case is just setting two different references to the same piece of data, change one and they both change
I know Connor already explained that but I figured I'd be more specific
yeah that's what I gathered, I somehow have never run into that with arma before so I didn't think it did that. Guess I've been lucky
@compact galleon I totally missed that earlier but that enfusion sample is fucking beautiful, it's so much more like a conventional strongly typed language
I really hate SQF syntax
@finite cloud Except the technical part
Who decided it was a good idea to put the parameters before the function name and the foreach after the code block, wtf
What technical part?
@finite cloud That it works like shit behind the scenes.
Ohh I see your post above that now
Also, SQF is the simplest language on the planet. It's purely expressions. Operators and operands, which is why forEach is after the code block. LEFT + RIGHT LEFT forEach RIGHT
I mean maybe that makes sense in terms of being semantic but it's completely backwards to every other programming language I've ever used, so as a programmer it's just needlessly confusing
Maybe there's some precedence to it though, idk, I've barely touched C++ and only programmed Arduinos with C
I do hope they fix the issue you brought up though, that's just really bizarre functionality. JavaScript has that weirdness too with for loops, where when you do this
for (var i = 0; i < something; i++) {
// something
}
the i var isn't local to the for block, it's actually defined globally right above it
@finite cloud sqf works perfectly fine
Everyone having trouble because "it is so unusual" did not bothered to actually learm the language but rather assumed it is just some language
But it's almost never an issue in the real world, most JS programmers don't even realize that
I mean I'm on day two of trying to learn it, I'm not trashing it necessarily I just think it has some unconventional design decisions that makes it a steeper learning curve than it needed to be
But maybe the opposite is true for people who don't have a background in programming and are starting with SQF, and maybe that was the point
It is as @compact galleon said
Only expressions and thats it
Plus the variable stuff on top 🤷
I don't think I follow what you mean by "only expressions" but maybe it'll become clear when I learn more
It's so simple. If you understand basic algebra, SQF is easy. 5 + 2 is no different from 5 setRain 2
Other than the fact that the setRain operator has different functionality from the + operator
I still don't really understand what's supposed to go on the left side of the function and what's supposed to go on the right, and how the two "sides" interact with one another
I've seen functions get called with the parameters passed in from the left but then I've definitely seen functions that do stuff with a value on the right
Binary
Unary and nular Operators
Binary have left and right parameters
Unary only right side
And nular none *
Unary and nulars are easy to understand
Ohhhh, that's what you meant when you said that everything is operators and operands
Nulary operators take non at all
Functions are binary operators
And Binary ones follow a simple predecene
Or some of them are?
Yeah @compact galleon 🙈🙈 it is late
functions are just variables
An operator taking only a left operand. That's a new one 😛
There are no functions in sqf
Only Code type Variables
And a hell to parse
😂 😂 but be just a lil bit different
Should not be that hard 🤔🤔
So what's the difference between a function defined in, say, C#, and one in SQF besides in the syntax? Re: the "code type variables" thing
Operators can at most take 2 operands. But these can also be arrays, which some operators use to work around that limit
Well there are ternary operators in most languages 😉
@finite cloud that Code is literally a value type that gets used
Foo = { hint "Bar"; };
If true then Foo;
This eg.
SQF is just an expression evaluator. It parses expressions that consist purely of operators that take zero or more operands. Even if and else are operators cleverly used together in a way that makes them resemble traditional if-statements from "normal" languages
Else literally just Puts the code into an array... 😂😂
This is perfectly valid csharp _condition = if alive player; _code1 = { hint "You're alive!" }; _code2 = { hint "You're dead!" }; _codes = _code1 else _code2; _condition then _codes;
My brain cannot handle that
If true then [{hint "Foo"}, {hint "Bar"}] ```
Because you think in terms of control structures @finite cloud
_false = if call { true } then call { false }```
[_elseStatement,_thenStatement] select _value ?
Can you help me understand what these examples are actually doing? Like what they compile down to or whatever?
I'm not following at all
I promise I'm not trying to be obtuse, haha
Like, what are the calls doing in that last example?
@finite cloud It's all just operators like + and -, but instead of operating on and returning numbers, they operate on all kinds of types, from numbers to string and booleans
@compact galleon your example is wrong though... Then is only accepting Code and bool
For right side
Yes, was supposed to be csharp _false = if call { true } then call { { false } else { true } }
just to confuse
Is that supposed to work kind of like a ternary expression? Like
_value = condition ? _case1 : _case2;
Or will the value of _false always be false?
[WORK] <STRING> Node Type;Offset;Length;Content
SQF;0;64; _false = if call { true } then call { { false } else { true } }
ASSIGNMENT;1;63;
VARIABLE;1;6;_false
BEXP4;10;139672794225463;
UNARYEXPRESSION;10;16;
UNARYOP;10;2;if
UNARYEXPRESSION;13;13;
UNARYOP;13;4;call
CODE;18;8;
NULAROP;20;4;true
BINARYOP;27;4;then
UNARYEXPRESSION;32;32;
UNARYOP;32;4;call
CODE;37;27;
BEXP5;39;0;
CODE;39;9;
NULAROP;41;5;false
BINARYOP;49;4;else
CODE;54;8;
NULAROP;56;4;true
����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������```
hint str call ({} else {1337} select 1)```
I am looking to enable Stress Damage on helos without having to run adv flight model cause pilots will kill us all if I did. But at the same time I do not want to see KOTH flying.
I found this but no idea how it works, takes effect or how to implement it. Can someone please adives?
https://community.bistudio.com/wiki/enableStressDamage
Negative, you'll have to enable AFM to use that. It's literally the same as toggling the option in the difficulty settings - it won't do anything if you toggle it while you're running BFM.
(Or, well, you could try, but I'm doubtful.)
Ouf. Any other way to limit pilots from "whipping like a ferarri"? Looking for ways to limit flight without having to AFM. And yeah, that is the quote they use in describing their piloting of a UH-60 that would otherwise break IRL.
This is pretty much exactly what AFM is for.
@finite cloud call command executes a function, which is a value of type CODE. And returns the result.
In that example above call {true} means it executes the function {true}. The last value in the function is what it returns, it's a true here. So the call returns true.
These guys are awesome at not actually answering the question but just posting more and more technically weird pieces of code 😄
SQF can only do 4 things.
command
command argument
argument command argument
variable = expression
What the commands do with the arguments is specific to the command. You can only know that by either thinking logicially or reading the command's page on the wiki.
are there any more setter commands like,
setTerrainGrid,
setObjectViewDistance,
setViewDistance,
setShadowViewDistance,
etc.
I want to provide the most tuning options for ui.
setDetailMapBlendPars
Ah, yeah I've already got that. Anything else?
aperture? 😄
AHA! Another thing to fiddle with!
I had some fun toying with that. It can be really powerful if you wanna for example force a dark mission
min,standard,max I guess something like gaussian curve like?
and standardAverageLuminance.. uh....
standard must be bigger than min, max must be bigger than standard.
and every value must be bigger 0.
The first 3 values are the aperture so.. how far open the pupils are... Kinda.
And the stdlum is how bright the overall scene should be in total.
So with the aperture values you can control the min and max. And the last value is the screen brightness if the aperture is in the center.
default values are 70,55,30,200 or whatever the CfgWorlds lighting config says. Check AiO config.
Hmmm...sounds like something that needs a little tweaking and learning for sure.
Do you have a sort of scale I can run these numbers by? Is the CfgWorlds lighting config the "default" aperature? I see if you also set it to -1, that it'll automatically adjust?
Search aio config for apertureMin and you'll find all the values for the different wheather states
Oh, sweet.
setting to -1 will let it honor the config values again
apertureMin
apertureStandard
apertureMax
standardAvgLum
these are the config names
Actually never looked that deeply into it. So far I just plugged random values in and looked at the result :D
Seems like you'd probably want to make the last value tweakable in your ui. That has the most effect I think
Yeah, especially when you're looking for a more dark appearance. Thanks!
does it still not reset aperture between the missions?
Does it? Dunno
It should.. But I can see very well that it might not
So in the case that it doesn't, should I reset the aperture after mission closure?
no
you might be able to alter where it tries to find a path to
but the path finding mechanics are not open for tinkering
ah damn
you can disable it and make your own if you think you could do better
was just wondering because I was trying out Unreal Engine
and allowed my computer to run lots of ai, by just making them group and follow a "leader"
that would path find for them.
was wondering if I could mimic that for Zombies and Demons in arma 3.
you cannot compare Unreal to Arma RV
RV?
Real Virtuality
Alright, was just wondering
If you want zombies you could create agents and script them
There are enough commands for that
as well as some nice ones for intersection checking
not sure how many zombies you want to have, it could be a problem with large numbers
yeah
Lesser so with a HC
my solution to large numbers was to mimic what I was doing in Unreal, and just make them copy a designated leader that would do that path finding calculations for them, then just apply an offset for each member of the group so they weren't single file. But I mean this is all me just theorising, I dont think its actually possible :/
Like I said, an HC. The HC will do the work for you. Rather than the client and server.
HC = Headless CLient
you can have multiple HCs as well
Cached page due to BI Pages on maintenance
HC is like running it on separate thread
oh so just basically more cores for the server
yeah less work for the server
Except it has no interface.
So I guess you could check if it's an hc like so:
if(!isServer && !hasInterface) then
{
};
or
if (player == yourHCinstancevariablename) then {...}
But like, what if you just wanna like throw it in there if it's an hc.
you can also connect more HCs dynamically
while the game is in progress
You could probably connect a proper self learning AI to the game via HC
And call it Chuck Norris
Basically yeah
Anyone ever got the script error Tangents of 90 degrees ? :D
That's the weirdest script error
Right next to Assertation failed... Btw BI. It's Assertion. Not Assertation
You b0rked it
Currently implementing intercept stuff to set custom script errors and found these in the stringtables
haha, nope never got them
Also Tangent, not Tangents 😄
@still forum assertion failed errors are par for the course in C++ :(
well. if an assert was triggered.
You probably meant the Assertion
But assertion is both a verb and noun. Assertation is specifically a noun
But assertion is both a verb and noun wut?
to assert, the assertion.
Assertation can't be verbanized
:| English hard
IDK if this is the exact right channel, but I'm trying to take some screenshots and such for the game as "promo"/cover for a fun-op I'm putting together for some friends. Is there a way that I could force IR lasers on, for models in static poses?
ACE has visible toggleable lasers I think
Would that be enabled in 3DEN or through Zeus?
that I dont know
There's also an action for IR Lasers; although there's very little documentation on it. https://community.bistudio.com/wiki/Arma_3_Actions#IRLaserOn
Would I need to know the class name of the laser attachment in question?
@elder karma use enableIRLasers
https://community.bistudio.com/wiki/enableIRLasers
if they don't turn lasers on, set their behaviour to "combat"
use
soldier1 disableAI "Anim";
soldier1 action ["IRLaserOn", soldier1];
I have an addaction on several units, which pass a variable, to my script file. The switch logic runs a line of code depending on which unit passed the action.
switch (_this select 1) do
{
case 1:{removeAllActions Intel1;myVar = 1};
case 2:{removeAllActions Intel2;myVar = 2};
case 3:{removeAllActions Intel3;myVar = 3};
case 4:{removeAllActions Intel4;myVar = 4};
case 5:{removeAllActions Intel5;myVar = 5};
sleep 1;
};
publicVariable "myVar";
works fine as single player, and the addaction is removed once activated. But in MP, each player must complete the action to remove the addaction.
How can I ensure the addaction is removed for all players by any player?
https://community.bistudio.com/wiki/remoteExec [Intel5] remoteExec ["removeAllActions"];
Assuming Intel5 is defined and identical on all players anyway.
private _index=_this select 1;
myVar = _index;
(missionNamespace getVariable format["Intel%1",_index]) remoteExec["removeAllActions",0];
sleep 1;//?
publicVariable "myVar";
Thanks guys will give the remoteExec a try.
This is quick and dirty but is something like this even possible? Identifying terrainobjects near me and adding an action to them?
nul = [] spawn {
_temp = nearestTerrainObjects [player, ["Bush"], 10];
{ _bush = _x;
_bush addAction ["Harvest", { hint "Harvested"; }];
} forEach _temp;
};```
You probably cannot add action to terrain objects
certainly doesn't seem that way
You can try (Tanoa)
player addAction
[
"Harvest",
{_obj = cursorObject; player playAction "PutDown"; sleep 0.75; _obj hideObject true },
0,
1.5,
true,
true,
"",
"!isNull cursorObject && {player distance cursorObject < 2 && {getModelInfo cursorObject select 1 find ""shrub"" > -1}}"
];
ok, yeah, I'll give that a shot
Might be able to modify that to suit my needs
@tough abyss so far that's not yielding any results but I think that gets me going in the right direction
It is copy paste working example, not sure how it doesn’t work for you
Something in the condition not working properly. I never got the harvest action.
Maybe it's something to do with the tanoa vegetation?
In an #include line, does \x\ always refer to the mod's root directory? Or is this some sort of macro defined in the addon I'm looking at?
Oh wait, not the mod's root directory
Whatever directory is above that
Idk, I'm looking through the source for CBA and trying to understand it, and I'm seeing stuff like this:
#include "\x\cba\addons\main\script_mod.hpp"
cba starts their addon prefix with x\
and ace with z if I remember correctly
so looks like no plants have class names... is this correct?
@vapid drift On Tanoa bush is called shrub, I changed the example
@tough abyss oh ok, I had no idea. That's weird though because nearestTerrainObjects [player, ["Bush"], 3]; returns the info
It is not weird, figure out why and how the condition works and you will see
I'm trying to make a very quick power cut script for a mission where players have to blow a power station. Using the example here https://www.youtube.com/watch?v=VF7RpA3LxN4 I can do this no problem. The issue I have is that the classnames for the light sources for the map I'm using Bystrica do not match those in that example. I'd thought I could get them by turning on map ids, and using [0,0,0] nearestobject idnumber however it turns out that the lamp posts don't appear to have any id's within eden.
Any ideas how I can figure the classnames out?
Have you looked up this page already? https://community.bistudio.com/wiki/switchLight
Hi @tough abyss yes, sadly as it shows, you need ID's or class names. I can't get ID's from do3DENAction "ToggleMapIDs"; to show id's for the items.
And the classnames listed in KK's example are the ones I'm already using. However, the lights aren't of that class or they'd be going out.
What classname are they?
yeah. that's what i'm trying to figure out.
Point at the light and execute hint str typeof cursorobject there is not much to it
So what are the classnames you have?
The one i was missing was "Land_PowLines_WoodL" by the looks of it.
your hint gave me the ability to find anything else that I've missed.
Anyone got any ideas how the arsenal gets this to happen for the rocket launcher?, not experienced at all but been looking it's sqf at things like lbdblclick, show weapon, selectweapon , etc for trying to replicate it. https://gfycat.com/ShockedHairyIrishterrier
what is the https://community.bistudio.com/wiki/menuAction sqf cmd family about?
Probably a getter for https://community.bistudio.com/wiki/menuSetAction
well what is menu UI element?
ok this makes sense
Switch between elapsed game time and audio time being used as animation timer. Used for audio/animation synchronization.
https://community.bistudio.com/wiki/useAudioTimeForMoves
any idea what "audio time" should be?
audio get's paused when you tab out. game time might not be
voice time maybe, also unrelated to in-game time? (like a "uiTime")
Not sure about that though. Audio stops playing. Don't know if music continues where it left of or if it just runs silently in the background
didnt A2 campaign have this slow motion scene at the start?
but controls were still normal?
nope, it was real-time (and only player-host would play, the others would switch internal camera to the unit and watch him)
I am about to cheat in MP for a slow-mo intro with setAnimSpeedCoef :3
so player useAudioTimeForMoves true
makes you normal speed regardless of accTime
so fast in slowmo and slow in fast time
I think it was more made about gesture/speech synchro, I don't know if it works with accTime
i guess could be also used during cutscenes and such
(can catch your own grenade this way)
(low fps due to my laptop)
What is the best way to make clickable map markers? Should I iterate over all potentially clickable markers on map click event, or should I do such functionality with fake groups and high command events, or should I add controls to map and move them on each frame? 😫
First approach sounds more straightforward
@velvet merlin thanks, I just can't wait to use it 😄
Yeah
Do you think that if I do it by adding controls to map display and using their event handlers, it will behave bad?
I suppose that ctrlCommit might take effect at next frame, so zooming in/out will look terrible as positions will lag behind
should I do such functionality with fake groups and high command events
No
First thing is your option. If you only want specific markers clickable, just keep their names in an array and make sure they always get added through a function that adds them to said array
I'm really more looking at drawIcon at the moment... how many drawIcons per draw event will cause troubles?
I might have like 50 of them or even more
Yep drawIcon works too. You can have quite a lot, map fps can get somewhat bad, but it's not directly an issue
That won't be an issue
However if you use drawIcon on GPS it starts suffering on FPS quite fast
So if I just add onDraw to the map display (finddisplay 12), it will not propagate to GPS, right?
50 icons? Wow, you sure you need that many?
Well it's an estimate, IDK yet 🤷 Will be all cities, outposts, everything
hey, guys is it possible to check if an object's inventory is already open by another player ? (Trying to fix this : https://youtu.be/Hr9nR-fFxPw )
I can't find anything on google
Maybe these can help you
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#InventoryOpened
Has anyone had issues with lbSetCurSel?
It crashes my game when I attempt to use it on a combo box
_index = -1;
for "_i" from 0 to ((lbSize 2100) - 1) do {
if (lbText [2100, _i] isEqualTo _label) exitWith {
_index = _i;
};
};
if (_index >= lbSize 2100 || _index < -1) then {_index = -1;};
lbSetCurSel [2100, _index];```
I dont
Also I would highly recommend always using the ctrl syntax as a sidenote
More reliable then IDC syntax
I would but I call that segment of code when another listbox is updated
so I dont have a copy of the control object
I guess I could find the control object with the display
_display = findDisplay 1010;
waitUntil {!isNull _display};
_comboControl = _display displayCtrl 2100;
_index = -1;
for "_i" from 0 to ((lbSize _comboControl) - 1) do {
if ((_comboControl lbText _i) isEqualTo _label) exitWith {
_index = _i;
};
};
if (_index >= lbSize _comboControl || _index < -1) then {_index = -1;};
_comboControl lbSetCurSel _index;```
Log _index before the lbSetCurSel and comment it, I've had similar issue aswell, don't remember what was the cause. But i'm pretty sure it was something with the index, some weird issue.
Which units does drawIcon use for width and height? Are these pixels scaled with UI size?
@astral dawn dunno how accurate or true that is but check the update note here http://killzonekid.com/arma-scripting-tutorials-how-to-draw-icon-on-map/
Oh you have just saved me time equivalent to two evenings of experiments, thanks!
I have started reading these wiki UI articles meanwhile... again... I hate these UI grids, really
Yeah I never got into grids myself seems you can dynamically resize without them just fine
Anyway try with different UI sizes after
Yeah will do, thanks
So, divide width by 640 and height by 480 to get absolute coordinates... wtf, what sense does it make...
640x480 is 4:3 viewport size, I wouldn’t be surprised if these values hardcoded for icon size, I gave up getting surprised when it comes to RV
Basically lemmie try to put it in words, if your viewport is 640x480 then to make icon of 24x24 pixels you need to pass 24,24 which will draw icon 24 x 24 pixels. But if your viewport is bigger or smaller the icon proportion would be adjusted accordingly from intended 24x24 and will be bigger or smaller depending on the current UI size. Something like that?
It would still preserve icon relative size to viewport size
Yes but this would make sense if they didn't have the absolute coordinate system (from 0 to 1) which is a common thing for everything UI related. Maybe they had to do it so that they definitely get integers somewhere in this long chain of coordinate conversions, I don't know.
Me too, it is mind boggling
Which units does drawIcon use for width and height?
Magical map units
In some cases you need to compensate for worldsize too, unless they fixed that these days
In the past I remember if I wanted accurate markers in meters, I'd need to adjust them by worldSize/8192 iirc
adjust them by worldSize/8192 iirc
Oh this is even more amazing thank you 😄
But that doesn’t make sense, the icon size doesn’t change with map zoom but the grid size does
lemme look at my old code for accurate vehicle marker sizes
I bet you used mapscale in it
yeah they were autoresizing ones so they stayed accurate despite zoom
so its that combo
I guess mapScale is what changed
Which brings even more “magic”
private _vehicleCfg = configFile >> "cfgVehicles" >> (typeOf _vehicle);
private _size = ((getNumber (_vehicleCfg >> "mapSize")) * 0.075) / GVAR(worldSizeCoef);
private _icon = getText (_vehicleCfg >> "icon");
if (isText (configFile >> "cfgVehicleIcons" >> _icon)) then {
_icon = getText (configFile >> "cfgVehicleIcons" >> _icon);
};
private _code = {
_width = (_height * (10^(abs log _mapScale))) max 18;
_height = _width;
};
GVAR(worldSizeCoef) = (worldSize / 8192);
That looks like 1 for stratis
i mean its what i use for all the maps, and it seems to be correct
2km and 40km terrains
Does this work? sqf } forEach allPlayers - (entities "HeadlessClient_F")
} forEach (allPlayers - entities "HeadlessClient_F")
@copper raven subtraction will be done first there was nothing wrong with that code
Higher precedence https://community.bistudio.com/wiki/SQF_syntax#Rules_of_Precedence
Right, too much select in my head, my bad, should've thought of that.
That table is great
Yeah, i was actually looking at it alot in past few weeks. But then, i just write stupid shit like that 🤦
Just use brackets any time you are in slightest doubt
You were not wrong just unnecessary in this case
I actually stopped putting () everywhere like i used to do. Just forgot about the math operators and others.
(((((1+1))))) there @astral dawn
🤢
Did you have any more doubt after adding one pair of brackets? xD
On the Life forums they say 5 brackets is the best for performance, but use 7 when you have 100+ people on the server
Hmm yes because compiler finds precedence faster 🤔
Yeah it really likes brackets it feeds on them
Just thought a name for a band “seven bracket shitcode”
(...) remoteExec [functionName, targets, _box];
(...) remoteExec [functionName, targets, _box];```
If I were to bind the JIP to the netID of an object twice, will the second line still be remotely executed or ignored?
e.g. two remote execs to the same object
I imagine if the ID is different that would be fine.
welp I tried and 2nd one doesn't run
I've noticed that using the same script command is not stackable when you use an objects netID.
With different custom IDs you would be fine.
Hmm, curious. Normally, it's the last one that only gets executed, since it overrides the first one.
well that or there's an error in here the RPT doesn't tell me sqf [_veh,["Open BIS Arsenal",{["Open", true] spawn BIS_fnc_arsenal},[],1,false,false,"","","5"]] remoteExec ["addAction",0,_veh]; [_veh,["Open ACE Arsenal","[player, player, true] call ace_arsenal_fnc_openBox;",[],1,false,false,"","","5"]] remoteExec ["addAction",0,_veh];
Yeah, I noticed the problem in a similar setting. I was using BIS_fnc_holdActionAdd though.
so just use ```sqf
remoteExec ["addAction",0,true];```` instead then?
Not exactly what you want. The advantage of the netID is that your stuff gets removed from the JIP queue once the object is deleted.
I see two approaches. Either remoteExec the raw code or a function that adds both of them or use custom JIP IDs together with a deleted EH.
Just as a reference, I used the first solution in my particular case.
hm how would that go in my case. I thought it may ruin some of the code to be executed
Just rewrite your stuff for a local machine without remoteExec, pack it in a function and remoteExec that function with the netID for the JIP parameter.
eh that sounds like a good idea
I've packed the stuff in a private _fnc_heal. How would that be called with remoteExec? Confused by the WIKI atm
Is this for a client side add-on?
server
server side only?
kind of a plugin
remote execs arsenals to certain objects
along with a dozen other stuff
but yea server side only
So the clients don't have the your config.
nope
if you use a private variable for the code, you would need to remoteExec call or spawn. Again you would run in the problem above if you would try it multiple times.
The better approach is to create a global variable and use publicVariable before you use remoteExec.
hm so here's a strange one... I execute a healing script with the name remoteexec and netID object
That one does run
yes
[_veh,["Open BIS Virtual Arsenal",_fnc_arsenal,[],2,false,false,"","",5]] remoteExec ["addAction",0,true];
[_veh,["Request Medical Attention",_fnc_heal,[],1.5,false,false,"","",5]] remoteExec ["addAction",0,true];```
Why are you surprised, you got the true for JIP?
eh just noticed I'm looking at two different codes to achieve the "same" thing
Also to increase security by protecting the global variable, you could do something like compileFinal. Not sure anymore, but I thought the protection gets also broadcasted with publicVariable.
global variable?
I mean global variable, which you make public with publicVariable 😄
The edit terrain objec module has a bug that in dedicated server if we set the biulding to be in destroyed state it apears that has 2 biuldings in the same place, one destroyed and one intact, is there a fix for that?
Was just referring to my previous suggestion to make a global function rather than a private one.
what would be the advantage over the private function if it's code sent by server to be executed globally/locally if "player" is used
The disadvantage is that your private function can't be used directly as the functionName argument of remoteExec.
You would have to feed it as an argument for remotely executed call or spawn.
Does anyone know why damage and getAllHitPointsDamage return different values. When I use setDamage, it affects both of the get commands, but when I use setHitIndex it only affects getAllHitPointsDamage; damage remains what it was before I used setHitIndex.
It is causing some weird issues where vehicles are not being repaired completely by my scripts and have "phantom" damage, so to say. It seems like the vehicle is fully repaired, but when you start it up the hull magically gets damaged.
The wiki pages aren't very enlightening
Could it be an issue with dependencies for hitpoints?
Hey guys, Im currently adding new ace 3 actions on vehicle. Do you know if it is possible to put some color on theses ?
how would I go around putting raw code including variables created inside the script (that need to be private) in a remoteExec? @languid tundra
I'm not sure I can make it work with a public variable
since the script that does the remoteExec itself is called from an object
is called from an object what does that mean?
Are you talking about the init line?
Oh
since I need to refer back the addaction to the same object(s)
I call a function from the vehicle that I want to be 'special'. the function then adds addactions and some ACE3 features to this vehicle
Is it like the mission designer calls your "API" function in the init line?
well I planned on making it more plug 'n play using the object's variable name, e.g. arsenaltruck_X where X is any integer number
then scan for present object for arsenaltruck_ and then apply it
but for now it's just sqf this call/spawn X_fnc_Y;
can't for the life of me find a suitable way to solve this one 😛
@south rivet damage is set after the damage of all hitpoints calculated
Yea, but when I have set each hitpoint damage to 0, as confirmed using getAllHitPointsDamage, damage still is the old value
Well, you could create a preinit function, which broadcast X_fnc_Y to all clients via publicVariable. The you just do everything locally in X_fnc_Y.
I think it might be because the "total" dependency for the hull is not being set
setHit doesn't trigger damage calculation, try BIS_fnc_setHitPointDamage https://community.bistudio.com/wiki/BIS_fnc_setHitPointDamage
I can't use that, some vehicles in RHS have duplicate hit points. So I need to use setHitIndex to fix every point properly
And there is no version of BIS_fnc_setHitPointDamage that accepts the index of a hitpoint
Well, it seems that damage calculation gets triggered in certain instances, although delayed. When I set hithull damage to 1 with setHitIndex for a Hunter, for instance, it will explode after some delay.
Yea, but I set it to 0. And in some circumstances (I think when I used setDamage) it will keep the damage on Total, and then when I start the vehicle the hithull damage is set to the same as Total.
The hull still looks damaged as well until I use setDamage 0
Play around with hitbody instead. hithull doesn't seem to be linked with visual changes.
I'm going over every hitpoint with my script, so I should be setting both. And hitHull is the one with the dependency for Total
The vehicle I'm using doesn't even have a hitbody
Hmm, probably ppl from #arma3_model know more about such things considering they have to configure the models/textures accordingly.
Yea
Hello there, does anyone know how i can store this:
_index = lbAdd [1003, "FOB Alpha"];
lbSetData [1003, 1, "respawn_west_1"];
into the profilenamespace? I would like to make it persistent without using a database. Thanks in advance 😃
PlayerPlayCutLoss = {
player setDamage 0;
[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
player allowdamage false;
[1, "BLACK", 1, 1] spawn BIS_fnc_fadeEffect;
_CutSceneCamera = "camera" camcreate (getPosATL CutCamera_1);
_CutSceneCamera cameraeffect ["internal","back"];
_CutSceneCamera camPrepareFOV 1;
//artilhary
//part 1
_CutSceneCamera camSetTarget [8109.56,3346.99,0];
_CutSceneCamera camPreparePos (getPosATL CutCamera_1);
_CutSceneCamera camPrepareFOV 1;
_CutSceneCamera camCommit 0;
sleep 5;
//part 2
_CutSceneCamera camSetTarget [8082.92,3325.95,5.46325];
_CutSceneCamera camPreparePos (getPosATL CutCamera_2);
_CutSceneCamera camPrepareFOV 1;
_CutSceneCamera camCommit 0;
sleep 5;
//part 3
_CutSceneCamera camSetTarget [8082.92,3325.95,5.46325];
_CutSceneCamera camPreparePos (getPosATL CutCamera_3);
_CutSceneCamera camPrepareFOV 1;
_CutSceneCamera camCommit 0;
sleep 5;
//Look at the sky
_CutSceneCamera camSetTarget [6813.51,2524.4,21.3163];
_CutSceneCamera camPreparePos [6827.18,2466.91,1];
_CutSceneCamera camPrepareFOV 1;
_CutSceneCamera camCommit 0;
sleep 5;
//pass by the desctruction
_CutSceneCamera camSetTarget [6821.6,2497.96,0];
_CutSceneCamera camPreparePos [6769.78,2441.82,1];
_CutSceneCamera camPrepareFOV 1;
_CutSceneCamera camCommit 0;
_CutSceneCamera camSetTarget [6857.01,2461.51,-0.00268459];
_CutSceneCamera camPreparePos [6805.19,2405.37,1];
_CutSceneCamera camPrepareFOV 1;
_CutSceneCamera camCommit 10;
};
Ok, looks like arma dones not like me but camPreparePos does not work, the camera still stuck in the same place that was created, anyone can figure?
With prepare commands you need to use https://community.bistudio.com/wiki/camCommitPrepared or don’t use prepare commands if you use just camCommit. Took me 3 sec to look up on wiki.
Were did you see that?
Their descriptions are the same, basicly it mislead to say that they do the same thing and their name diference just exist for wattever reason
Hi all. How to switch character to a default pose after playActionNow?
My case of playActionNow make persist pose of charactor, cant to switch default..
I looked up camPrepareFOV https://community.bistudio.com/wiki/camPrepareFov @astral tendon
@languid tundra Not sure anymore, but I thought the protection gets also broadcasted with publicVariable.
Yes it does https://discordapp.com/channels/105462288051380224/105462984087728128/540308970209017859
@compact maple Hey guys, Im currently adding new ace 3 actions on vehicle. Do you know if it is possible to put some color on theses ? Custom icons, in color. ACE already has green/orange/red icons for medical you could reuse them.
https://github.com/acemod/ACE3/blob/master/addons/medical/functions/fnc_modifyMedicalAction.sqf#L34 Seems like it's only the medical cross tho, you probably want the dot, gotta make your own colored icons them.
@shell carbon I don't understand.... Just setVariable into profileNamespace and be done?
@still forum right, thanks !
is it possible to do something like sqf [ AllUnits, true ] remoteExec [ "setUnconscious", 0 ]; to set allunits unconscious on a certain event? from reading my example i would say "no" lol.i need to set all units including NPC unconscious at one time
{
[_x,true] remoteExec ["setUnconscious",_x];
} foreach allUnits;
something like this should work
Probably better do do a single remoteExec for call
yea just thinking that
actually thought about doing this foreach
will try that
not sure bout the second _x tho as its the target param
setUnconscious is arg local. so that's correct
it sends the remoteexec to the owner of the unit, which is required cause setUnconscious required a local unit
thanks for clearing that up for me.will check now
Why don't script placed Support Modules work? If I script-sync the pre-placed Support modules everything works, however if I do
module1 = _grp createUnit ["SupportRequester",[0,0,0],[],0,"NONE"];
module2 = _grp createUnit ["SupportProvider_Artillery",[0,0,0],[],0,"NONE"];
guy synchronizeObjectsAdd [module1];
module1 synchronizeObjectsAdd [module2];
module2 synchronizeObjectsAdd [arty];```
no support option appears. Using typeOf and synchronizedObjects tells me everything is spawned and properly synced though. Why does it not work then?
the modules init script is probably not called
there is some trick for that, BI broke that recently
I assumed it had something to do with inits, at least I know where to look, thanks.
I think it was some setVariable, not sure. Something very obscure
Hey guys, i'm making a mission on 1.82 (linux v) I have noticed that deleteVehicle does not delete it up intil next frame. So if i go
deleteVehicle x; isNull x // false
sleep 1;
isNull x //true
Is it a hiden feature or a bug also is it fixed in current version?
It's a "feature"
deleteVehicle just marks the vehicle for deletion
it won't be deleted until next simulation cycle
damn, gotta check if it is mentioned in wiki, spent 3hrs in 15 line code figuering out whats wrong thinking i'm complete imbicil
it is, you should have checked it first
Yep, it is nicly stated in wiki, after all i'm not an imbicil i'm just a little illiterate
got it, needs to be like this for scripted modules to work:
_module1 = _grp createUnit ["SupportRequester",[0,0,0],[],0,"NONE"];
_module1 setVariable ['BIS_SUPP_custom_HQ',"",true];;
_module1 setVariable ['BIS_SUPP_limit_Artillery',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_CAS_Bombing',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_CAS_Heli',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_Drop',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_Transport',"-1",true];;
_module1 setVariable ['BIS_SUPP_limit_UAV',"-1",true];;
_module1 setVariable ["BIS_fnc_initModules_disableAutoActivation",true];
//[_module1] call BIS_fnc_moduleSupportsInitRequester;
_module2 = _grp createUnit ["SupportProvider_Artillery",[0,0,0],[],0,"NONE"];
_module2 setVariable ["BIS_fnc_initModules_disableAutoActivation",true];
//[_module2] call BIS_fnc_moduleSupportsInitProvider;
guy synchronizeObjectsAdd [_module1];
_module1 synchronizeObjectsAdd [_module2];
_module2 synchronizeObjectsAdd [arty];
_module1 setVariable ["BIS_fnc_initModules_activate",true];
_module2 setVariable ["BIS_fnc_initModules_activate",true];
Yo is it possible to change the escape menu with a dialog youve made ?
https://community.bistudio.com/wiki/isKindOf
I can compare but how do I get the kindOf of a vehicle?
typeOf
type of return the config name but not the ones in isKindOf like "tank","car"
No idea how to use that
inheritsFrom (configFile >> "CfgVehicles" >> (typeOf cursorObject));