#arma3_scripting
1 messages ยท Page 756 of 1
you didnt do what terra said
Trying to post my screen shot
you cant
the error says everything you need anyway
it's looking in sounds_f_characters not sounds_f\characters
Still getting an error: 14:08:19 Sound: Error: File: \a3\sounds_f\characters\human-sfx\P02\Breath_Aiming_1.wss not found !!!
Okay, so how do I know when to replace the folder sounds_f_characters with sounds_f\characters? That mismatches the original.
this
remove the \ at the beginning of the path
14:14:37 Sound: Error: File: a3\sounds_f\characters\human-sfx\P02\Breath_Aiming_1.wss not found !!!
Where do I find PBOPREFIX?
at the root of the pbo
//<'sounds_f.pbo' properties via Mikero's dos tools, dll version 8.23>
prefix=a3\sounds_f;
product=Arma 3;
version=150048;
//PboType=Arma Addon;
//</properties>
I'm using sounds_f_characters.pbo not sounds_f.pbo
this is the unpacked version of the game
This matches what I see in sounds_f.pbo, but I'm not using that, I'm using sounds_f_characters.pbo
but you dont want to, there is no sounds_f_characters folder ingame
Okay, thanks
Epp I needs help.
I've got a area set up into its own layer and some dude I need to join me group is there.
However he keeps joining me group because the trigger for him to do so is opforce not present
Yes please, starting to dabble in pvp events
there a getter for grabbing the current map zoom?
fooouuund it
_currentZoom = ctrlMapScale ((finddisplay 12) displayctrl 51);
is it possible to disable the kill feed in the stats screen, or change the information displayed?
I'm running into a situation where I have admins controlling AI from time to time killing players which show up in the feed.
We don't want this info for what we are running.
You can also deactivate it completely, but I don't know if this is the right command.
https://community.bistudio.com/wiki/Description.ext#respawnDialog
anyone able to help my keyhandler does not work
show code and explain what "does not work" means
execVM "admin\keyhandler.sqf";
execVM "admin\whitelist.sqf";
[This one is in the keyhandler sqf ] case 22: {//U key
if (_shift) then {
execVM "openessentialmenu.sqf";
};
Is there anything else in the keyhandler.sqf? :P
nope
I think there might be some fundamental misunderstanding here
Assuming that this is intended to be a permament keyboard handler, you would need to actually install it as an event handler.
the case command only works inside of a switch block
also what @granite sky said
So does completion radius on move waypoints ever work, either with vehicles or infantry? Can't persuade it do anything other than move right onto the waypoint before switching to the next.
there isnt anything engine based like setGroupIconsVisible per unit basis right?
aka you have to use addMissionEventHandler ["Draw3D", + drawIcon3D
is there ever a reason to use BIS_fnc_addStackedEventHandler onEachFrame with drawIcon3D these days?
I think it works as a sort of failsafe incase the exact waypoint location can't be reached
Yes, this the only way I've found to do it and its relatively simple. This is also the way the APEX campaign does their IFF system
can you actually reference the current running return? there a magic variable or something?
what the what?
BIS_fnc_addStackedEventHandler is kinda buggy with long EH codes iirc
it probably uses format or something 
it does:
_code = compile format
[
"%1%2%3 call %4",
_nativeParamsString,
["", "_this + "] select (_event in EVENTS_WITH_PARAMS),
["(missionNamespace getVariable format ['BIS_stackedEventHandlers_" + _event + "_%1', _thisEventHandler])", []] select (_args isEqualTo []),
_code
];
oof 
anyone knows what i am doing wrong here
_ctrl = (findDisplay 1234) displayCtrl 1500;
playerListArray = [];
{
playerListArray pushBack _x;
_name = name _x;
lbAdd [1500, _name];
} forEach allPlayers;
Hi I'm using setPos on a gamelogic in a script, and it isn't moving the logic.
Do I need to do something special for this to work?
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
Nvm, solved my issue. SQF weirdness.
!quote 5
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
@tough abyss always use one of the more specific setPosX commands
@still forum i'm sorry for the tag, but i went back to test out if the ID's were being re-issued to other people, i have found out that NO, infact, they were not. I dont know how i got to the conclusion first that they were, but on a reinspection they are not
People can change their mission slots though while keeping same ID
in case that matters
no, i was just testing if someone else could be issued with your old ID
after you had logged out
Is there a script command to add a local magazine with a specific ammo count to a local container? "addMagazine" acts globaly so it dosent add the magazine to a local container
what happens if I use addMagazineAmmoCargo on a local object does it still gets broadcasted ?
we already disable the respawn dialog via description.ext, and it looks like that event handler only handles the numeric score. Does adding my own handler also get rid of the kill feed?
yes
basic default kill feed is determined by mission difficulty, not anything script wise
so in the server settings we have "killed by" turned off,
I'm talking about the stats screen when you abort
there could be a really simple mistake that I'm missing but Im getting error saying "missing ] on line 10". this is my code...
_randomNumber = ceil random 4;
objPos = format ["pos%1", _randomNumber];
_taskPos = getMarkerPos _objPos;
_AOTask = man_1 createSimpleTask ["AO"];
_AOTask setSimpleTaskDestination _taskPos;
if (true) then
[
_heliWreck = createVehicle ["Land_Wreck_Heli_Attack_01_F", _taskPos, [], 1000, "NONE"];
_heliGroup = createGroup west;
_heliPilot = createVehicle ["B_Pilot_F", _heliWreck];
_heliTask = man_1 createSimpleTask ["Downed Pilot", _AOTask];
_heliTask setSimpleTaskDestination _heliWreck;
];
Question. Is it possible to enable a trigger to become true mid mission? Or do i have to create a trigger using a script?
when do you want the trigger to become true?
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
sorry mate, I always forget what character I need around it
you can create the trigger via script or have multiple conditions
like triggerActivated otherTrigger && this
oh. try adding
debriefing = 0
to your description.ext
me and a buddy just tested it with no luck (via eden instead of dedicated, not sure if that matters)
then no, you can't remove the menus after abort then. you can only change the values so that everything is 0
thats unfortunate to hear, thanks for the help though
is there a way to determine when game logics and agents are created? (some event one can log to rpt)
Does setting a profileNamespace variable to nil properly delete the data from the profileNamespace file?
@velvet merlin For agents, could do an active check if _currentAgents == ( count agents ) select { !isNull agent _x };
Game Logic maybe check allMissionObjects "GameLogic"
well thats a general monitoring, right? i was hoping for some context what creates them
AFAIK there is no EventHandler other than "Init" but that's a config EH I think.
like we have no createAgent in our scripts but the missions end up with 300+ with
[<NULL - team member>,""]
from[agent, typeOf agent]
and
17:14:02 โฅ Context: [] L31 (A3\functions_f\Modules\fn_initModules.sqf)
[] L19 (A3\functions_f\Modules\fn_initModules.sqf)
[] L22 (A3\functions_f\Modules\fn_initModules.sqf)
[] L23 (A3\functions_f\Modules\fn_initModules.sqf)```
I asked about that a couple years ago on the forum, apparently it's not a big deal. I haven't found a way to clear out the array.
That's why I added the select { !isNull agent _x }
They don't go away D:
one should be caused by the CAS module, but it doesnt look like the root cause
count allGroups, is it larger than 244 or whatever the A3 max is?
initModules has this:
//--- Create groups for module categories
_sideLogic = sidelogic call bis_fnc_sideID;
{
_category = configname _x;
_side = getnumber (_x >> "side");
if (_side == _sideLogic) then {
_groupVar = "bis_fnc_initModules_" + _category;
_group = grpnull;
if (isserver) then {
_group = creategroup sidelogic;
missionnamespace setvariable [_groupVar,_group];
publicvariable _groupVar;
} else {
_group = missionnamespace getvariable [_groupVar,grpnull]
};
_group setgroupid [gettext (configfile >> "cfgfactionclasses" >> _category >> "displayname")];
};
} foreach ((configfile >> "cfgfactionclasses") call bis_fnc_returnchildren);```
so each call should create new logics for all cfgfactionclasses with sideLogic - no reuse or caching
this looks like a design problem/weakness
still question remains why this gets called so often by our functions/missions
Locality issue maybe
If called in the editor, it will be called everytime someone connects.
so more context:
fn_modulehandle.fsm is a looping system, so it could come from that
private ["_module","_logic","_function","_params"];
#define ACTIVATED_ID 3
_module = _modules select _m;
_logic = _module select 0;
if !(isnull _logic) then {
_function = _module select 1;
_params = _module select 2;
_activated = _module select ACTIVATED_ID;
//--- Check synced triggers
_allTriggersActivated = true;
{
if (_x iskindof "emptydetector") then {_allTriggersActivated = _allTriggersActivated && triggerActivated _x;};
} foreach (synchronizedobjects _logic);
//--- Activate module
if (_allTriggersActivated) then {
if !(_activated) then {
//--- Activate
_logic setvariable ["bis_fnc_initModules_activate",false];
_modulesActivate set [count _modulesActivate,_logic];
_activateIndex = _m;
[_logic,_function,_params,true] spawn bis_fnc_moduleExecute;
//--- Mark as executed
_module set [ACTIVATED_ID,true];
};
} else {
if (_activated) then {
//--- Deactivate
_logic setvariable ["bis_fnc_initModules_activate",false];
_modulesActivate set [count _modulesActivate,_logic];
_activateIndex = _m;
[_logic,_function,_params,false] spawn bis_fnc_moduleExecute;
};
_module set [ACTIVATED_ID,false];
};
} else {
_modules set [_m,-1];
};
_m = _m + 1;```
```count _modulesActivate > 0 && _m == (_activateIndex min (_modulesCount - 1))```
```sqf
_modulesActivate spawn bis_fnc_initmodules;
_modulesActivate = [];
_activateIndex = -1;
if I am reading this correctly, this looks for dynamically created modules (logics?) [and triggers linked to them]
happens in Eden, SP, hosted and DS
One of the reasons I never use modules lol
๐ฌ
Can almost never get them to work right, mainly in online missions. I use them if I spawn them in. Think I've only used the terrain modules lol
the logic limit is certainly more easily reached if you have stuff like CAS or CombatPatrol uses logics as dummy for location selection
Do they not auto-delete?
we also reduced the hide modules (object and terrain)
AFAIK no
one angle i still need to check is recompile = 1; from cfgFunctions.
from what I understand it only happens at mission start, so should not trigger anything mid mission
initModules certainly has a design weakness. i think usually it doesnt matter as you have only so few factions and only few events for initModules to be re-executed
Could try using the CuratorObjectPlaced EH if you have a Zeus placing this shit
however in combination with others, it seems to push the logic number over the limit
potentially entityCreated missionEH is coming tho: https://feedback.bistudio.com/T155096
That'd be awesome โค๏ธ
Oh here's an idea
Do a forEach check (Maybe every 5 minutes?) for allGroups like this:
{
if ( isNull ( ( units group _x ) # 0 ) ) then
{
{
deleteVehicle _x;
}forEach units group _x;
};
}forEach ( allGroups select { side _x == sideLogic } );```
I dont' recommend using forEach within a forEach since it's 20x slower but you get the idea
If the module item such as CAS becomes null but the group still persists, delete it, since GameLogics are created via CreateUnit
yeah will resort to cyclic cleanup but would be nice to actually determine the root cause and get that sorted
Although I've read groups auto-delete when they are empty, that is not the case in my experience. I had a similar issue with my ambient civilians and insurgents on my insurgency mission years ago. The fix was to delete all empty groups every 5 mins.
What about GroupCreated eventHandler?
GameLogics in modules seem to create their own groups, so technically that'll do what you want in a way
That's the best I can think of ๐
Basically execute within the EH a check if the group is sideLogic, if so, you'll need to spawn a function or w/e to wait a sec for the unit be created/enter the group.
Is anyone aware if _this allowFleeing 1 is bugged for mid mission spawned AI?
I can get the AI to flee on command if they are spawned via editor, but if they come in via script or zues the command has 0 effect.
@sharp stag Not sure if anyone answered, but you're using the wrong brackets ([] instead of {}) for the code in the if statement.
I have been advised by a friend to ask here as to why this isnt functioning to limit a vics speed
vehicle player setCruiseControl [5, false];
What do you expect?
I expect it to limit a player controlled vehicles speed as it says it should here: https://community.bistudio.com/wiki/setCruiseControl
It does not limit, but auto-drives
If the code is set to True
However when set to false it should
limits player's vehicle speed to 5 km/h
false - Speed Limiter: the vehicle will not accelerate above set speed
Ah yeah, false
Mhm, however it does no such thing
A modded vic.
I expected a info more than that...
Sure, wait one
Its a Eagle IV from a german army mod, I can find the exact name if you'd like
So it is a car
Oh thats what you mean, yeah
Make sure it is not a Mod issue
Vanilla vehicle doesn't mean it is completely non-modded. A Mod can mod a vanilla vehicle
I know, but at that point I feel its a larger issue than I can deal with.
Do you know of any other way to speed limit a player controlled vic?
With a very hacky way but you won't like that
Use EachFrame Mission EH to setVelocitys players vehicle
Look, I'ma be honest, I'm kinda retarded, how does one put that into an init field?
Nobody wants to put that kind of thing into Init field. Use something else instead... Like init.sqf
I'ma refer you to my orignal point, how do?
Like, what, IDK, it's not tested but here it is sqf addMissionEventHandler ["EachFrame",{ if (vehicle player != vehicle) then { private _vehicle = vehicle player; private _velocity = velocity _vehicle; _vehicle setVelocity (vectorNormalized _velocity vectorMultiply ((vectorMagnitude _velocity) min 5)); }; }];
Okay, I shall report back with a yay or nay
Okay, how do I put it into an SQF and then call upon that on a vic?
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting#Script_Files
You would need to take a read
this addEventHandler ["Engine", {
params ["_vehicle", "_engineState"];
_vehicle setCruiseControl [5, true/false];
}];
This worked
In the Init
Well, picking one or the other for True/False of course
Wait, you wrote the script you said, in the vehicle's init field? In Eden Editor?
Does the player, sit in the vehicle at the start of the mission?
no
That's why
Oh, okay. I was unaware of that, and to be fair, none of the my buds who do this shit a lot did either
Thanks for you help any who
vehicle player does mean the vehicle which player is in, if not, player himself. If the player doesn't sit into the vehicle at the very first moment of the mission, it will be considered as player, which is not a valid vehicle to apply the command
Yeah my friend just pointed that out, hes just simplified the code from what I just sent down to
this setCruiseControl [14, false];
I am idiot.
It happens when it happens. Such things can be happened to anyone
Again, thank you for your help
Hello. We are writing our Respawn vehicle script, the question is: is it possible to make the vehicle be created with the same variable name?
The fact is that a trigger is attached to it, which should execute an event when the equipment is destroyed.
There is such a thing in the standard BIS module for revival, the attached trigger fires every time. But it doesn't suit us.
I would like that when my technique dies and respawns, its variable name is saved.
Yes, because you're misunderstanding the nature of variables.
You can set variables to anything you like after the mission started.
If it's in multiplayer then you may want to use publicVariable afterwards to share the value. Depends what you're using it for.
Ok, thanks
It's not so much "this vehicle's variable name is myVehicle" but "the value of myVehicle is set to this vehicle object"
Is there a way to get a trigger to disable a bunch of synced tracer modules?
Have you tried naming the modules and having the trigger do deleteVehicle on them?
Awk I have so many of them to name
You are going to run into issues in multiplayer with the tracer module btw.
They never seem to work consistently
Best just open the modules function, figure out how they did it, then recreate it better
Is anyone aware if _this allowFleeing 1 is bugged for mid mission spawned AI?
I can get the AI to flee on command if they are spawned via editor, but if they come in via script or zues the command has 0 effect.
player allowdamage true;
if (player allowdamage true) then {hint "GodMode OFF"};
dont know what i am doing wrong
Does anyone know the script to have players show up in zeus editable objects?
I forgot it
Nvm
isDamageAllowed
allowDamage returns Nothing
https://community.bistudio.com/wiki/allowDamage
how do you use the command?
Nothing specia just this....
eastgroups=[];
{
if (count units _x> 0 and side _x==east) then
{
eastgroups= eastgroups + [_x];
};
} forEach allGroups;
null=[]spawn
{
for "_i" from 0 to ((count eastgroups)+1) do
{
effectedunit = (eastgroups select _i);
sleep 0.1;
skillteam = leader effectedunit;
sleep 0.1;
if(faction skillteam == "OPF_F") then
{
{_x setSkill ["courage", 0.05] } forEach units group skillteam;
sleep 0.1;
{_x allowFleeing 1 } forEach units group skillteam;
}
else
{
{_x setDammage 1 } forEach units group skillteam;
};
};
};
It checks all units, makes an array, converts them to a variable, runs a skill set and forces everyone to flee if they are from OPF_F
Are the units spawned by Zeus?
yes, but where are the later-spawned groups added to this list?
Units are spawned via zeus or with a script that uses create sqf commands
Currently all in SP, not MP
I can show a simple gif, one second
regarding details:
null =is not needed for spawn- you can use
eastGroups = allGroups select { side _x == east }; - you can replace the use of
eastGroupsby the above code
Ill look into those, I need to re-review my code as now no one wants to flee ๐ so im probably mucking things up
Sorry for delay, was being a bit of a lemon. AI squad on the left is eden spawned. Squad on the Right is zues. Both are put in "Combat" mode so fleeing takes into effect https://gyazo.com/9ae427d2eba81e225b9af9f2ec905b62
yep
your script throws an error, so it stops running
also what is this abomination
for "_i" from 0 to ((count eastgroups)+1) do
Terrible coding:D and yes the variable runs out, which is fine for current testing. It still runs the {_x allowFleeing 1 } forEach units group skillteam; however
[] spawn {
private _allEastGroups = allGroups select { side _x == east };
{
private _group = _x;
private _leader = leader _group;
if (faction _leader == "OPF_F") then
{
{
_x setSkill ["courage", 0.05];
_x allowFleeing 1;
} forEach units _group;
}
else
{
{ _x setDamage 1 } forEach units _group;
};
} forEach _allEastGroups;
};
Thank you ๐ Sadly its still the same behavior. https://gyazo.com/b74af3d75f060299ae5418bf5a652a63
Eden (left) flees. Zeus spawned (Right) just chills
do you happen to use perf branch?
This is mainline branch
Main branch, nothing special. Testing this with and without mods to ensure no conflicts
can you try a systemChat format ["Groups: %1", count _allEastGroups]; in the spawn please?
yep, so it seems there is an issue ๐
At least I know I'm not crazy. Should I submit something to the tracker?
if the ticket does not already exist, gladly! otherwise bump the existing one ๐
and don't hesitate to ping Dedmen daily about it, he loves AI issues
Will hunt for it! And ehhh let's not anger the arma prophets :D as a workaround I'll look into somehow calculating the units morale or their casualties for the group and force a fleeing thing.
Hmm anyone used fading to black?
you
๐ค ๐ง
You'll need to describe the problem you're having
If you're using bis_fnc_fadeEffect, don't forget that the colour string is case-sensitive
What's the best way to forcibly close a control?
a display/dialog?
Yeah, so I'm using the HTML Load call, and want to forcibly close it
What's the best way to do that?
huh, code please?
[] [[spawn]] {
[[disableSerialization]];
_html = [[findDisplay]] 46 [[createDisplay]] "RscCredits" [[ctrlCreate]] ["RscHTML", -1];
_html [[ctrlSetBackgroundColor]] [0,0,0,0.8];
_html [[ctrlSetPosition]] [<nowiki/>[[safeZoneX]], [[safeZoneY]], [[safeZoneW]], [[safeZoneH]]];
_html [[ctrlCommit]] 0;
_html [[htmlLoad]] <nowiki>"http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English"</nowiki>;
};
From the wiki^
Not sure why everything is double encapsulated lol
where did you get this example?
thanks, fixed
๐ thanks for the help
example 2 is still broken
I have no idea where to start. Haven't done anything with it
[
[
["3 Hours later, ", "align = 'center' shadow = '0.2' size = '04.0' font='PuristaBold'"]
]
] spawn BIS_fnc_typeText2;
how would i get that TXT to the Middle of my screen?
with the posx and posy parameters. maybe 0.5 for both might work
are there some kind of semaphores to sync scheduled jobs?
isNil { } is somewhat handy there.
All scripts on a machine run on a single thread (there's no concurrency), so you just need isNil {} occasionally to ensure there won't be a task switch in the middle of scheduler-critical code.
is text script still in same scope as command, e.g.:
_wp setWaypointStatements[true,"[_gunHeli,_anim] spawn BIS_fnc_unitPlay"];
No.
Then how do I pass the variables to unitPlay in a wp statement?
I'd probably use global variables.
for strings and numbers you could use format
I just read the BIKI again, the code contains the special variables this (group's leader) and thisList (group's units)
You could setVariable on the group to pass data, but note that setWaypointStatements runs globally.
Hey guys, could I please ask for some help understanding the BI Page on 'BIS_fnc_typeText'
I would like to make the text stay up after typing for 15 seconds, but I cant quite figure out if blinkCount is tantamount to time on screen, I cant seem to get it to stay up
Currently using
[
[
["RAF Hereford", "<t valign='bottom' shadow = '1' color = '#ffffffff' size = '1' font='PuristaSemibold'>%1</t><br/>"],
["Credenhill, England, UK", "<t valign='bottom' shadow = '1' color = '#ffffffff' size = '0.7'>%1</t><br/>"],
["Thursday 31st March, 2022", "<t valign='bottom' shadow = '1' color = '#ffffffff' size = '0.7'>%1</t>", 15]
]
] spawn BIS_fnc_typeText;
It's cursor blinks rather than seconds. Not sure if those are fixed-rate or proportional to frame rate.
Ah OK, yeah it seems I can elongate the text on screen time per line i.e.
[
[
["RAF Hereford", "<t valign='bottom' shadow = '1' color = '#ffffffff' size = '1' font='PuristaSemibold'>%1</t><br/>", 15],
["Credenhill, England, UK", "<t valign='bottom' shadow = '1' color = '#ffffffff' size = '0.7'>%1</t><br/>", 15],
["Thursday 31st March, 2022", "<t valign='bottom' shadow = '1' color = '#ffffffff' size = '0.7'>%1</t>", 15]
]
] spawn BIS_fnc_typeText;
Question about maxLoad or setMaxLoad. If there's a Hummingbird and default maxLoad is 1,000. that means load limit is 1,000 and no more loading allowed? But I can load over 1,000, esp. loaded weapons such as magazine or missile, just double clicking right mouse button when inventory is opened .
https://imgur.com/a/1ptWwpd
Does anyone know how to fix this?
The code works just fine but instead of saying welcome, private. whatever
it says welcome, PRIVATE whatever.
There's most likely a way to make it "Private" instead of all caps but after an hour, Im at a loss.
hint format ["Access Granted. Welcome to the armory, %1 %2.", rank player, name player],
toLower rank player <-- is that you want?
Oop. this is why I shouldnt code at 4:30 am. The answer was right in front of me the whole time
Much appreciated
Hey guys, me again! ๐ฌ
Sorry to be a pain, but could anybody take a look at this script and let me know why it might not be working on a dedicated server? Aim of the script is to cut the lights within 1.5km, it works perfectly in SP & MP but not on dedi ๐ฆ
[
this,
"Disable Power",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_Search_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{},
{},
{ private _lamps = nearestObjects [EMP, ["Land_Lampa_ind_b", "Land_Lampa_ind", "Land_Lampa_ind_zebr", "Land_Lampa_cut", "Land_Lampa_sidl_3", "Land_Lampa_sidl_2", "Land_Lampadrevo", "Land_Lampa_sidl", "Land_Lampazel", "Land_Vo_seda", "Land_Tlampac_vo_seda", "Land_Vo_zlut", "Land_Lampa_valec", "Land_Lampa_vysoka", "Land_Lamp_Street1_EP1", "Land_Lamp_Street2_EP1", "Land_Lampa_Ind_EP1", "Land_Lamp_Small_EP1","Land_House_C_10_EP1", "Land_House_C_10_dam_EP1",
"Land_House_C_11_EP1", "Land_House_C_11_dam_EP1"], 1500];
{
for "_i" from 0 to count getAllHitPointsDamage _x -1 do
{
_x setHitIndex [_i, 0.99];
};
} forEach _lamps; },
{},
[],
10,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, this];
This is entered into the init of a powerbox .. Do I need to use this as an execVM to have it work on Dedi?
What's EMP here?
Its the name of the electricity box item the player interacts with to call the script
Antistasi has a similar blackout function which just uses setDamage, although I can't be absolutely sure that it works
setHitIndex is local argument, global effect, but I believe map objects are considered local everywhere.
These are map object lamps, not stuff you've added dynamically, right?
Some are, some are not ... In SP and MP it works perfectly so long as the lit object is inside the array :/
Just when it comes to dedi it doesnt work properly, placed objects seem to be affected for a moment but then come back on and map objects arent affected at all
Curious, just tested the blackout part with my local DS and it seems to work fine on map objects.
Not sure why you wouldn't use setDamage, but it seems to work.
Does someone know what the following log-entry means? I found it in my logs a couple of times but everything is seemingly still working just fine. Does anyone have an idea what this log-entry could mean and how I could avoid whatever is causing it?
2022/04/03, 8:27:26 โฅ Context: Trigger "OnActivate" name "1708452: <no shape>" at [12350.000000,43.319786,4550.000000]
Thanks in advance.
does anyone know how to add custom models to vests?
@granite sky Not sure pal, its not my script im afraid. I have given up on that one now, no idea why its not working!
In case anybody is looking for a script in the future that works perfectly in SP, MP & Dedi to turn off all lights within a radius, this one by Roque_THE_GAMER is the one you want! Simply enter this script into any item (in this script its the
https://steamcommunity.com/sharedfiles/filedetails/?id=1886747292
DistanceToReach = 1300;
this addAction
[
"Turn Off",
{
params ["_target", "_caller", "_actionId", "_arguments"];
{
private _ticket = format ["LSS%1", _forEachIndex];
[_x, "OFF"] remoteExec ["switchLight", 0, _ticket];
} forEach nearestObjects [_caller, [], DistanceToReach];
_target animateSource ["switchposition",1];
_target animateSource ["light",0];
_target setDamage 1;
},
[],
1.5,
true,
true,
"",
"alive _target",
3,
false,
"",
""
];
this addAction
[
"Turn On",
{
params ["_target", "_caller", "_actionId", "_arguments"];
{
private _ticket = format ["LSS%1", _forEachIndex];
[_x, "On"] remoteExec ["switchLight", 0, _ticket];
} forEach nearestObjects [_caller, [], DistanceToReach];
_target animateSource ["switchposition",-1];
_target animateSource ["light",1];
_target setDamage 0;
},
[],
1.5,
true,
true,
"",
"!alive _target",
3,
false,
"",
""
];
class m22_tnk: rhsusf_spcs_ocp_crewman
{
_generalMacro="m22_tnk";
author="Mus";
model = "\MUN_SAF\saf_tnk.p3d";
picture="MUN_SAF\data\saf.paa";
scope=2;
displayName="[VS] M12 (M10/Tenkisti)";
hiddenSelections[]=
{
"camo",
"camo1",
"camo2",
"camo3",
"camo4"
};
hiddenSelectionsTextures[]=
{
"MUN_SAF\data\vests\vest_m22.paa",
"MUN_SAF\data\vests\m22_g.paa",
"MUN_SAF\data\vests\m22_g_2.paa",
"rhsusf\addons\rhsusf_infantry2\gear\vests\mbav\data\mbav_gear_co.paa",
"rhsusf\addons\rhsusf_weapons\mag_proxies\data\pmag_black_co.paa"
};
};
this is the script I am currently using
for some reason i managed to change the texture but the model is still the same one from rhs
Try asking in #arma3_config ๐คทโโ๏ธ
alright thanks
when we do
(allPlayers select 3) switchcamera "INTERNAL";
We will be switched to the fourth player's POV, but my question is, if I wanted to get the camera object that we are switching to in this case, how will I get it?
so that instead of having to switch to the player's POV using switchcamera, I can get the camera object of the player's POV and broadcast it into a texture
that doesn't mean anything. the real error is above that line. that line simply tells you where the error is happening (which is in some trigger)
you don't "get" a camera object this way, this is just object-reference
you would have to create a camera and attach it
Are you sure?
2022/04/03, 16:33:00 soldier[B_T_Soldier_AR_F]:Some of magazines weren't stored in soldier Vest or Uniform?
2022/04/03, 16:33:00 โฅ Context: Trigger "OnActivate" name "1928320: <no shape>" at [5700.000000,6.376676,12550.000000]
2022/04/02, 18:11:06 soldier[O_Soldier_TL_F]:Some of magazines weren't stored in soldier Vest or Uniform?
2022/04/02, 18:11:06 โฅ Context: Trigger "OnActivate" name "1821851: <no shape>" at [19250.000000,34.180000,17550.000000]
2022/04/02, 18:11:06 soldier[O_Soldier_AR_F]:Some of magazines weren't stored in soldier Vest or Uniform?
2022/04/02, 18:11:06 โฅ Context: Trigger "OnActivate" name "1821851: <no shape>" at [19250.000000,34.180000,17550.000000]
so all switchCamera does is create a camera on the players head?
it "selects" the "player camera" on this unit
say I wanted to broadcast player camera, is that possible?
Does anyone know a script or mod where i can setup a wepon locker room where everyone can get his weapons
sadness
you would have to create a camera and attach it
done that already
but I thought I can get something better than the player's world model view
thank you
do you create any unit in a trigger? or use a module that does that?
In a trigger?!
in the OnActivation code
Nope, but I am calling a function that does that. That might explain it...
you can do:
[19250.000000,34.180000,17550.000000] nearestObject 1928320;
//or
[5700.000000,6.376676,12550.000000] nearestObject 1821851;
to find the trigger responsible for that error
well it seems like you're using some mod that modifies unit loadouts (e.g. item weight, maximum unit load, etc.)
and the game cannot add the items defined for the unit in its config (because it's full)
I am not using any mods whatsoever. That function actually used the BIS_fnc_spawnGroup-function to spawn a group and doesn't touch the loadouts at all afterwards...
I thought this was common. Some loadouts just throw the warning.
it could be that the vanilla config is overloading the unit 
I don't know if this is the correct place to say this but
this wiki page has a problem
Description is worng
#community_wiki ๐
hey is this code correct for !alive two differnt objects?
!Alive t1 && t2;
no
how that reads is (not alive t1) and t2
!Alive, t1 && t2; that it?
!Alive, t1, && t2,;
!alive t1 && !alive t2
or
[t1, t2] findIf {alive _x} == -1
or
{alive _x} count [t1,t2] == 0
ah thank you very much
Uh-oh
!(alive t1 && alive t2)
this is wrong
it means either is dead
not both
goes to show how often I use it that way. I almost exclusively use findIf for that check
findIf is slower (in that case)
I'm usually not comparing only two objects either. its typically large arrays.
ughh could of tagged me. ive finsihed for the day and will likely forgot to chnage it tomarrow
if only there was some way to record information for the future ๐ค
Hello, I am trying to create a script where a trigger condition is true when a player is not the leader of a defined group. How can I achieve this?
for singleplayer, leader player != player
alright ty
anyone an idea why spawn is not working in the main menu? like onLoad="[] spawn {XYZ};" (in a control)
you can't do anything scheduled in onLoad in main menu iirc
try maybe a frame after 
but how do I start a request a frame later if there is no scheduled environment?
on each frame event
you mean execute the onEachFrame { blablabla }; in the onLoad?
yes, preferably execNextFrame though if you use CBA
nice idea, I will try soon
Is there anyway to force a roll over of a vehicle? In multiplayer, preferably without triggers?
This one's my favourite https://community.bistudio.com/wiki/addTorque
any response for this issue plz?
this doesn't seem to work, is there a better way instead of writing multiple isKindOf ifs?
!({_wep isKindOf [_x, configFile >> "CfgWeapons"]} forEach ["autocannon_Base_F","autocannon_35mm","rhs_weap_azp23","rhs_weap_2a42"]))```
findIf is usually cleanest.
hmm yeah good idea, thanks
What is the question? You kinda just made a statement.
maxLoad or setMaxLoad is not working I guess, I can load weapons on vehicle cargo without any limit.
does anyone know where I can find the vanilla vehicle fire particle effects?
What's the way to play a sound in the game that will ignore the thickness of vehicle armor and helicopter armor without losing the volume?
playSound?
I don't know if that's possible with 3D sound
brb gonna try it, currently i'm using say3D but the vehicle armor and heli armor muffles it to the verge of silence
ahh does playsound need synced on every client?
Has anyone scripted the VLS turret to lock and fire on to laser targets
Carry capacity works when you try to add items as person, not when editing.
Sorry, don't understand. plz explain more detail.
You can only overload cargo weight limit in edit dialogs & script, including virtual arsenal.
You mean, is it normal ? I overloaded weapons on vehicle cargo on eden editor, no any script.
https://www.youtube.com/watch?v=qcCuZZ9KpvI&t=110s
Oh, that. There are a few known inventory exploits. I also had a bug where I could get unlimited magazines in backpack. Forgot how, but I remember doing it with virtual arsenal.
no (also why make that repro video so long. Literally the first 1:50 could've been cut off and saved me about a minute of lifetime)
sorry for wasting your lifetime. ๐ edited, haha. But I spent a couple of days to figure this out with my poor knowledge and English.
execNextFrame and onEachFrame are both not working. There are no error messages in my RPT, it just does nothing
if you spawn, and then print diag_activeScripts or something similar, what happens?
you mean diag_activeScripts in the spawn or behind?
10:04:55 "[1,0,0,0]"
๐ค so i guess the scheduler just never runs in the menu
what if you keep printing it(eachframe), does it change at all?
[] spawn {}; diag_log str diag_activeScripts; onEachFrame { diag_log str diag_activeScripts; }; just prints it out once
any idea for calling it later on?
i thought about maybe an mouse event handler when the player is hovering over the item, but it's not the best solution I think
can you add a button in the menu, that prints active scripts, spawn like a sleep 10 in the displayload or whatever you are currently doing, spam the button and see what happens?
you mean like onLoad = "[] spawn { sleep 10; diag_log "FINISHED"; };" and the ButtonAction diag_log str diag_activeScripts;
yes
anyone here has used the new "awake" command? not sure what it's good for @unique sundial
compared to just "enableSimulation"
it was all time the same
i guess it just never runs then
i thought maybe it empties it's scripts during some init phase and thus you would be spawning too early, doesn't seem to be the case
maybe I found a solution, but I need more tests. It goes with a "help control" which has an mouseMove and deletes it self after script init
have you tried https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#Draw3D maybe? though probably won't do anything just like other ehs
there is no mission in the main menu, I think that is the problem. And concerning some people using -skipIntro (which disables main menu mission loading) it makes things worse
it is technically a mission
just very limited probably
the engine doesn't execute many things from what it looks like
yeah the mission in the background returns e.g. a nullObject when calling player
and there is no missionNamespace like all Variables have to be stored in uiNamespace
problem solved as mentioned above
Arma 3 have script command "Date Converter to Timestamp"?
I need find Timestamp or something same.
Date to UNIX you mean?
Your current system date, yes. Otherwise (in-game date) you need to write a script I guess
Is it possible to set azimuth and elevation for an AI artillery unit?
I'd like to calculate artillery for an AI battery.
doWatch might work for it, but why? I think there is doArtilleryFire already
can kinda use https://community.bistudio.com/wiki/lockCameraTo for it
Abit complex.
But I have 8 member squad in a Hide module. From the start of the game.
I have a fade to black setup and a teleport near them.
The show module is on a trigger for 8 secs.
But each time I get teleported there. They are dead.
how are they dying?
No clue they are dead but no bodies are around
I don't have bombardments in the area. But they are hidden. Because I've also a truck there and it's fine when it is shown
are you sure they are dead?
2 are still hidden but they are replying to my commands the rest are report as KIA
have you checked with alive and isNull?
Well they are reported as dead. But invisible and 2 guys are invisible
Move things around abit. And now everyone else is dead who are supposed to be hidden... hmmm
sounds weird. add a killed eventhandler to the units and see why they are dying
The bombardments wouldn't affect them if they are hidden?
actually they do. they are invisible not invincible
๐ฉ
Does the slash at the end cause issues and if it does, what kind? It doesn't cause an error.
while {!(isNil "_group") && count (units _group) > 0} do {\
that should result in a parse error
unless it's within a macro
I suppose it's possible that the preprocessor doesn't care if it's inside a macro or not. Haven't checked though.
It isn't in a macro, and I don't think i've ever seen it throw an error. My game just sometimes crashes when this file is used, and I am wondering if this line could be the culprit
All it'd do is eat whitespace anyway. Unlikely to be crash-related.
if you don't preprocess it,e.g using just compile it should very certainly throw an error, as for preprocessing, it might just strip it i guess, as said above
arma's preproc is full of weird stuff
the preprocessor is actually notorious for crashing the game, at least used to be when including a non-existent file
It should at least be harmless removing it, so feel free to test.
it doesn't crash with -noLogs, also i think that was fixed not long ago
but losing rpt for not crashing is not so good 
i had a corrupted 3den.pbo where the include files were missing and it crashed on startup because some mods tried to include them
or actually i think it was fixed for mission stuff only, i.e description.ext
yeah i followed that development but iirc it still does when I mess up my UI includes in description.ext. will report back when I actually have evidence ๐
Ffs my two Alive T1 && T2 will not work ๐ฉ ๐ฉ
No it won't...
Expected bool code
alive T1 && alive T2```
Dang it. Thanks
explanation by breaking it down:sqf alive T1 && T2 becomessqf (alive T1) && T2 becomes```sqf
[boolean] && [object]
and `&&` only takes boolean && boolean, or boolean && code
Works xD
Yea you may aswell type that in Japanese

boolean is "true or false"
alive <object> returns "true or false" (let's say "true")
so true && object is absolutely wrong for the machine
Ah
(and I don't speak Japaneseโฆ maybe POLPOX can help here)

The thing is that and doesn't mean "this thing and that thing", it means "check if this returns true and that returns true". You're trying to phrase it as "do an alive check on this and that" but the command actually interprets it as Lou said - "check if this alive check returns true...and check if that object is true", which doesn't make sense to the computer because objects aren't a true or false value.
tl;dr you're trying to use it like you would in conversation, but the computer doesn't know that
Has anyone scripted the VLS turret to lock and fire on to laser targets
ใใใฆ็งใฏๆฅๆฌ่ชใ่ฉฑใใพใใโฆๅคๅPOLPOXใฏใใใงๅฉใใใใจใใงใใพใ
fixed
yes
Is it simple
relatively, let me link something
so you'll have to create a target using
createVehicle ["laserTargetW", position];
then attach that to your actual target
and you feed that virtual target to the fireAtTarget command
snippet from elsewhere in my mission
// Create target
target_n = createvehicle ["laserTargetW", [0,0,0], [], 0, "NONE"];
target_n attachTo [carrier_n_targetPos, [0,0,0]];
target_n setVariable ["owner", _northOwner];
independent ReportRemoteTarget [target_n, 99999999];
that reportRemoteTarget is important to doing this
Carrier_n is like moving target or what
hey i have this code in the. description.ext
class CfgSounds
{
class radio1
{
name = "radio1"; // Name for custom sound 1
sound[] = {\sound\radio1.ogg, 5, 1.0};
titles[] = {};
};
but i cant get the code for the trigger to work
```cpp please (it is config, not code)
also, I do not see your code
and you need to close the }; too
call(playsound "radio1";) code in trigger on activation
you can remove the call usage
also call takes code {}, not parentheses
you should run the game with the "show script errors" launcher advanced parameter
call{playsound "radio1";} that?
normally
but remove call and the brackets, not needed here
//means coments?
The file path in sound[] needs to be a string
sound[] = {"sound\radio1.ogg", 5, 1.0};

either silent because correct. or has quit the internet
Do you really need me to tell you whether you have correctly put "" at each end of a file path? I feel like that may be an easy one
{} correct? is the / correct? is the ogg", correct 
ok me test now
this code for the trigger is being annoying
... ๐ฆ sound radio1 not found
bear with me. im very stupid
You may need to reload the mission in the Editor to get it to detect the description.ext change
Also note as per https://community.bistudio.com/wiki/Description.ext#CfgSounds, you should have a sounds[] = {}; before your class radio1 - this isn't in the config you posted
although I believe it became optional at some point, but it never hurts to have it
If something is used in all the examples and doesn't explicitly say "optional" I always assume it's required :U
All this for a 30 second sound effect 
Yes, that's how things work in Arma
wiki's retrocompatibility ๐
it was mandatory in OFP at least
And now I'm getting a error @hallow mortar I sent you pic
As Lou mentioned here <#arma3_scripting message> you need to close the outermost {}; - in your posted code you have the class CfgSounds { but no matching }; at the end
if you only have that, you must have an error while saving the mission
{} numbers mismatch
I'm on mobile!
Yes, the error he sent me was "missing } in CfgSounds" :P
remember i said, im very stupid
being ignorant is a thing, being stupid is another
i have no idea what your on about
but a least please read our replies, for they are not written in vain
this is my 1st time working with this. also my thing looks similar to
Missing } is a pretty common error that happens to people all the time, it's a mistake that's easy to overlook.
...but the error message does straight up tell you that's what the problem is :U
hence why proper indentation saves (keyboards) lives ๐
What do you actually have at this moment?
class CfgSounds
{
class radio1
{
name = "radio1"; // Name for custom sound 1
sound[] = {"sound\radio1.ogg", 5, 1.0};
titles[] = {};
};
every { needs a closing };
this is just it
Yep. Still missing that last };.
class CfgSounds
{}: ??
You've closed your sound[] = {};. You've closed your titles[] = {};. You've closed your class radio1 {};. You're just missing....class CfgSounds {
class CfgSounds
{};
is that correct?
No, the }; goes right at the end, after everything that is contained in class CfgSounds.
class CfgSounds}:
Your final }; at the moment is the closing brace for class radio. You need another one outside of that to close CfgSounds, which contains class radio1.
Here. Let me do it.
class CfgSounds
{
class radio1
{
name = "radio1"; // Name for custom sound 1
sound[] = {"sound\radio1.ogg", 5, 1.0};
titles[] = {};
};
};
wtf
See how the opening and closing { and }; of each class layer are vertically aligned? That helps keep track of what layer you're at.
it's better if you understand the fix, rather than the how ๐
{} are pairs designed to define "blocks"
so here, you have CfgSounds, with radio1 inside, and name, sounds, titles into radio1
and all this has to be properly closed, hence why indentation (line-start spacing) is important, to see if you missed something
not how you write things
seems.. abit complex
it is not a lot of knowledge, but it needs to be known to understand the whole thing
be happy the game doesn't crash for a missing ;, as it did in OFP :-p
It's a way of defining a hierarchy. CfgSounds can contain many classes, and they all need to be properly contained, otherwise the engine doesn't know where CfgSounds actually ends and gets confused.
but with a different error, so there is progress!
Did you apply the changes to description.ext and save the file?
yessir
You can check whether your CfgSounds entry was actually applied in the config viewer.
i think so
If you're not sure, do it again. Can't hurt.
when you make changes to description.ext you must go back to eden and start the mission again. restarting won't have any effect
what's your config and error again?
I thought you had to actually reload the mission for config changes to stick, but maybe I was overdoing that.
I wasn't following the conversation
This was the previous error which this is allegedly the same as: https://cdn.discordapp.com/attachments/960625557253550101/960625588396245032/20220404_204249.jpg
Is it actually the same error, word for word, or simply a similar-looking error?
2 errors now
paste the config
erm
hey guys not sure where to ask this but im trying to key a server mod ive made for a private server, however having problems with it.
All it includes is a config and a few paa files for retextures in one pbo and a custom faction config in another pbo.
Ive signed both and keys are in server key folder but when trying to connect, says the pbos are not keyed
any help would be appreciated.
what do you mean?
Hopefully it looks similar to the bit I posted a few minutes ago, since that's what they should be using
class CfgSounds
{
class radio1
{
name = "radio1"; // Name for custom sound 1
sound[] = {"sound\radio1.ogg", 5, 1.0};
titles[] = {};
};
};
i copy pasta you'rs btw
that's all of it?
yes sir
I don't see any errors
did you exit the mission or just restart?
went bk to main menu
that should give a different error
Maybe this really isn't optional <#arma3_scripting message>
maybe.
also make sure you're not editing another mission... 
and if the error is different give us the new error
pics inbound
Interesting fact: if you press the Print Screen or PrtScr key on your keyboard, you'll get a direct screenshot in your clipboard ready to be pasted into Discord
Well yes, but into DMs or whatever. Better than having to pull out your phone and take a photo of the screen
I think the : is just part of the error message
what the hell have i done
I can't say that I remember whether that's normally there, but I also don't see where it would be coming from if it's wrong
i copied this from a youtube vid
If your description.ext file contains exactly and only the code you posted most recently, I don't know where this is broken. If it contains literally anything else, tell us.
nothing. i copied your one into it
Have you tried this? <#arma3_scripting message>
nvm the error was correct. I also see /CfgSounds/:
description.ext.txt,editing a different file, editing a different mission?
I just tested that and it works fine
I think if it was .txt it wouldn't even get to the line 7 part, it would just say the sound isn't defined
//initServer.sqf
{
vehicle _x enableSimulationGlobal false;
private _id = ceil (random 5);
_x addUniform format ["U_I_C_Soldier_Para_%1_F",_id];
if ((random 4) > 1) then {
removeHeadgear _x;
}
} forEach units independent;
how come vehicle crews also have simulation disabled?
just delete your description.ext and start over ๐คฃ
@coarse dragon you're kidding right?
no
this is what you dmed me:
class CfgSounds
{
class radio1
{
name = "radio1"; // Name for custom sound 1
sound[] = {"sound\radio1.ogg", 5, 1.0};
titles[] = {};
};
it's the same old one 
impossiable
vehicle _x can also refer to the unit
But clearly true
my confusion is I want the script to disable simulation for units and vehicles, but not crews within the vehicle
but it's disabling simulation for both the vehicle AND the crew
Units in vehicles probably inherit simulation state from their vehicle, otherwise there would be...problems
yeah in earlier versions of the game (not too long ago) you could enter a sim disabled vehicle and not get out anymore
Just want to congratulate you on your excellent sense of doubt btw
not a problem I guess if that's the case, I just feel like that hasn't always been my experience with vehicle crews
he didn't ctrl+S the file apparently 
problem solved... ๐
I'll test some stuff and come back
but does it matter?
the crew won't be able to do anything with a sim disabled vehicle anyway
no it doesn't, easy fix. I thought I was somehow manually disabling crew simulation
aye my first reply i had the wrong assumption, ofc vehicle _x would refer to the vehicle a unit is in, not the passenger
wait... he said in the editor
and right before that I asked if you had applied the changes to description.ext and saved the file
I'm having trouble figuring out how to phrase what I need to ask simply.
Would anyone be willing to help me understand how to make a function happen for each of an indefinite number of similarly named map markers?
I've got the function more or less working as I need, but I don't know how to make it repeat the function for each place I need it to happen without copy/pasting the function again and again and manually changing the names of the markers.
forEach?
Functions can accept arguments, e.g. [_arrayOfMarkers] call del_fnc_function and then parse those inside the function using params
i thought i did
I'm unsure how to get the inputs that I need. I don't understand how to programmatically create the array.
for loop
do all the markers have something in common?
Mr L Mr N and Mr Lou thank you for the help
They are all the 'empty' type and each are named 'sector_x' with x being indefinite numbers.
something like this then:
for "_i" from 0 to 1e3 do {
_marker = format ["sector_%1", _i];
if (getMarkerPos _marker isEqualTo [0,0,0]) exitWith {};
// do something with the marker
_marker setMarkerPos [...];
};
tho they should be continuous
Omfg help me. I accidentally saved over this fucking mission
Holy cow! Thanks so much! I'll give it a shot!
I may eventually need a catch to ensure it doesn't bug out if there is a gap in the marker number names, but either way, this gets me much further down the line!
I'm being serious
I don't think you can get it back anymore... 
Have you played the mission recently in any way outside of the *editor? You may be able to find where you downloaded a previous version of it.
that's what getMarkerPos does in Leo's script i think, the position of a non existent marker is 0,0,0
No
if it makes you feel better rebuilding a mission is a lot faster than making it from scratch
(though I prefer markerColor _mrk == "" because 0,0,0 is a valid marker position)
Eh
Ah! I see! Thanks! I have been busy looking at this chat instead of reading and implementing it.
I'm not familiar with all marker commands. but if that works yeah 
understandable, it is not very intuitive because there is no markerExists command
Do you guys think it would be better to run the function for each marker, or have each marker be found inside the function?
What does the 1e3 mean? Is that a common way to say continuous in code?
1000
Oh! Haha, duh. Sorry.
you can use a while loop instead 
what's the difference?
it's better that you "remember" what you created in the first place
e.g. store them in an array
or hashmap
I'm not sure there would be a functional difference, I was just curious if there is a known difference in performance or bugs, but I can discover that through testing.
How do I store them in an array?
What is a hashmap?
If these are Editor-placed markers and not script-created, the process of collecting them into an array would be basically the same as what you're doing to iterate through them anyway.
If script-created, _array pushback (createMarker [...])
my_global_array = [];
//create marker and store:
_marker = createMarker [format ["sector_%1", count my_global_array ]];
if (_marker != "") then {my_global_array pushBack _marker};
doStop TANK;
_points = allMissionObjects "Sign_Arrow_Blue_F" apply { getPosATL _x; }; // getting all marker positions
{ _x pushBack 15; } forEach _points; // setting speed
TANK setDriveOnPath _points;
Is there any trick on getting setDriveOnPath working? Tanks just seems to turn around on the spot
you should disable some stuff...
let me see what it was
@cosmic lichen
the important part is:
_gr selectLeader _dr;
{
_dr disableAI _x;
} forEach ["FSM", "TARGET", "AUTOTARGET", "AUTOCOMBAT", "COVER"];
_veh setEffectiveCommander _dr;
doStop _veh;
sleep 1;
I was right, something weird is going on with vehicle simulation. Crew does inherit vehicle simulation, but if the crew did not specifically have simulation set to false then they come back alive when the vehicle itself becomes simulated. The vehicle simulation is normally flagged as false while the crew is frozen in place but simulation is flagged as true. When I disable simulation through initServer, though, the crew's simulation is flagged as false along with the vehicle so I have to enable simulation on all the crew as well. The inconsistency there is a bit of a headache.
Edit: found the issue. it was something different going on with that vehicle
Gonna test that
as for a hashmap, it's a way of storing pairs of [key, value] s and finding the key from the value very fast:
https://community.bistudio.com/wiki/HashMap
kind of like an array of [[key1, value1], ...] except lookup is O(1) (for arrays it's O(n), i.e you must iterate over all items to find something)
Works now..kinda. It's far away from precise movement along the path though.
Thanks for the explanation! That may be handy!
Well. I made a mess of it.
For "_i" from 0 to 1e3 do {
If (isServer) then {
_Flag = createMarker ["sector_%1", _i];
if (markerColor _mrk == "") exitWith {};
_Flag setMarkerType 'mil_objective';
_SectorAAF = createTrigger ["EmptyDetector", markerPos "sector_%1", false];
_SectorAAF setTriggerActivation ["ANY", "PRESENT", true];
_SectorAAF setTriggerArea [100, 100, getDir this, true];
_SectorAAF setTriggerInterval 5;
_SectorAAF setTriggerStatements
[
"West countSide thisList < 0.4*(East countSide thisList);",
"DeleteMarker '';
_Flag = createMarker ['', markerPos 'sector_%1'];
_Flag setMarkerType 'Flag_Altis'",
""
];
_SectorFIA = createTrigger ["EmptyDetector", markerPos "sector_%1", false];
_SectorFIA setTriggerActivation ["ANY", "PRESENT", true];
_SectorFIA setTriggerArea [100, 100, getDir this, true];
_SectorFIA setTriggerInterval 5;
_SectorFIA setTriggerStatements
[
"East countSide thisList < 0.4*(West countSide thisList);",
"DeleteMarker '';
_Flag = createMarker ['', markerPos 'sector_%1'];
_Flag setMarkerType 'Flag_FIA'",
""
];
};
};```
Throwing a thousand errors saying bad conversion: array.
look again at what I wrote
also your exitWith simply exits the isServer scope
isServer should be outside the loop
PiP (picture in picture) does the low fps of PiP have to do with ping?
in terms of render to texture from a camera
or is it to save performance ?
any possible way to increase fps?
performance. pip is very heavy on that one
if you attach a camera to player about 1km from your position and stream it into a texture, sometimes the player desyncs and runs in a direction then gets teleported to their original position, is this PiP or ping?
looking at the texture in this case obviously not the player themselves
hmm could be ping but I guess that the simulation only approximates movement outside your view
yeah but it is very smooth in vehicles
so I guess its ping
have you tested in SP?
well then it's ping
maybe a combination of both, to save bandwidth and calculations
so probably that
does the player character have line of sight to your position?
yes
they look at my van
from 400m
so you can look at the other player through a binocular and at the same time with a pip?
okay define pip
doing body cam
with swichCamera or texture?
gui yes
fullscreen?
interesting, didnt know about that behaviour of pip
well I can send you the code if you want
no thanks I know what you mean just wanted to make sure we were talking about the same thing
alright thank you
now I am curious too. does that imply that pip is running its own simulation?
also worth an note on biki but where
โฆwhat?
the desync between pip (r2t) and actual game
most likely sync/prediction is way different between human entities and vehicles
I think its the game mixing prediction and synchronisation, with a bit of desync in the way
to reduce preformance load
even thou I'm using 6000 object render distance
while target is 1km away
you can sometimes see it with very distant players rarely
forgot to mention
the close you are to the target
the way lower the probability of this happening (PiP)
if you are within 250m of the target it nearly never does this
smooth as silk
In vehicles it is a very slight vector change
barely noticeable
a unit is barely predictable, I would wager
yes, I have seen humans running for 50m exact before syncing and being teleported correctly
something as slight as starting a running animation and stopping (on player side) will make the game persist with the running animation for like 3 secs before syncing (on PiP)
no. PiP is just a framebuffer. you simply render the scene from the PoV of another camera
the game simulates objects at different rates, depending where they are wrt to the main camera, and what kind of objects they are
Hey question
Is there any way to check if a certain module is in a mission via script?
yes, try to grab all modules then check for their class
What should I use to grab all modules?
units sideLogic;
Doesn't work, because I'm looking to check the presence of a specific type of module
units sideLogic findIf {typeOf _x isEqualTo "Specific Type of Module"} ?
units sideLogic; works for grabbing all modules (and all normal logics as well)
entities "class"? I don't remember if it worked with modules.
it should I believe
Hello all, I am facing an issue with the HandleDamage event. I want to prevent players on foot from taking damage when getting hit by a vehicle using the following code:
// HandleDamage event
// Anti-VDM
if (((vehicle _source isKindOf "Ship") || ( vehicle _source isKindOf "Air") || (vehicle _source isKindOf "LandVehicle"))) exitWith
{
diag_log ("HANDLE DAMAGE END: Damage=0 (VDM)");
0;
};
The issue I am facing is that when a player gets hit by a vehicle, it triggers multiple HandleDamage events, and the last event has a null object value as the source, so I cannot determine who the damage is caused by. Anybody have any idea?
I logged all the damage events as well: https://pastebin.com/5j10uvS3
As you can see in that sample log, all the handle damage events EXCEPT the last one has a source object. Testing was done by lightly hitting the player with a MRAP vehicle.
I think you can probably file that one as a bug if it's replicable.
the overall damage is reported last in A3? it's first in A2 ๐ค
IIRC ACE adds an extra hitpoint (which is definitely reported last) because it apparently doesn't trust that.
In my case, its pure vanilla arma
could store the source as a variable before exiting
if the other hitpoints in the handle damage return it I mean
But when I get a damage event with a null source, how will I know that its related to the last damage event which had a source in it?
save the time it happened too
and compare it
if it happens at the exact same time it'd be fairly safe to presume it came from it
I guess you could also check if _projectile is an empty string too
HandleDamage just kind of sucks. i've found it best to store the data from multiple script events invoked by a single damage event and handle the whole thing together in a PFH
Unfortunately โtype ofโ returns โLogicโ when I tried it, not specific module classes
Depends. High command and curator modules have different types, for example.
What exactly are you looking for?
I hope I'm right in this channel. My problem: I have an object which is definied as a transport vehicle (vehicleClass="Cargo";). When I use the createVehicle command to create a new rope, it does not appear (object exists). But when I attach the transport object to myself the rope becomes visible at the positionen spawned.
createVehicle command to create a new rope
aren't you supposed to use ropeCreate or whatever it's called?
ups. I meant ropeCreate xD
There is a particular class coming up as "Logic" , which is a special thing, rest is as you should expect.
It returns Logic because there that logic's class name is "Logic"
If you are not happy with that, you can use what veteran29 mentioned but I believe it would be slower in a standard mission, hence I did not suggest it.
But it works fine.
If I use player command multiple times in a script file. Is it better to use it after declaring private variable in the head? for example, private _player = player; in the head part, and then use the _player in a script.
depends on your needs
it is better to call the nular only once and store the result, in player case it's actually worse, unless you use it like 4+ times. unless you use the result of nular command once i highly suggest storing it once and then reusing.
Sorry, what is nular? I don't know the meaning.
thx .
as Untelo said depends how you use it. e.g let's say you want to check if there's a player:
while {true} do {
waitUntil {alive player};
...
}
you can't store this because the player is always changing
the converse is also true. if you always want to do something with the same object you must store it. it's not just a matter of performance
I see what you mean, thx, @little raptor
Just in case anyone know. This code will use network?sqf _vars remoteExecCall ["MY_fnc_01",[]];
it should do nothing
Thanks
It's a code that run in loop. So i will keep it as:sqf (...) _vars remoteExecCall ["MY_fnc_01",_sentTo]; (loop) instead of```sqf
(...)
if (_sendTo isNotEqualTo []) then {_vars remoteExecCall ["MY_fnc_01",_sentTo];};
(loop)
One less if
anyone knows a script that when you execute something another thing happens i want it like if () then {}
Will try again to understand it.
I tried it isServer outside of the loop and got a different error, so decided to try something else before I came crying for help again.
I'm getting back to work on it as soon as I eat and finish this coat of varnish.
you had another error. like I said, see what I wrote again.
#arma3_scripting message
what you wrote was completely wrong
Right, I get that. I was just explaining the other mistake, which was caused by me trying to understand the code without wasting more of your time before I even tried anything at all to fix it.
context?
i want a script that does a thing
Whats a simple script that gets a hold waypoint to skip
Gonna put it in an on activation field of another waypoint
why do ppl suggest using format in waypointstatements? How does that change the way it works.
to pass variables to the string?
i thought format["%1",_var] resolved like str(_var)
yeah but with format you can add more to the string
plus you can't write str _var in a waypoint statement
since that takes a string
who suggests that? format has a lot of limitations
unless you're putting multiple strings together for it, at whcih point format is easier
or you can just change the current active waypoint
you can write that
that's not the problem
_var is not defined in the waypoint statement
the only reason to ever use format is:
- the code is small (total size is always < 8 KB)
- you want to add a string or number in the waypoint statement that is always fixed
if either of those is not true you shouldn't useformat
_waypoint setWaypointStatements ["true", format ["%1 enableSimulation true", _otherUnit]];
is this correct or is there a better way than format in this example
?
you're stringifying an object
it's not an object anymore
it can correspond to an object only if you've set a vehicle var name for it and also created a variable with the same name that corresponds to the object
so would it turn into
B Alpha 1-1 whatever enableSimulation true
``` and not work?
am i understanding this right
but if the unit has been assigned a variable _otherUnit would return that variable
i see
it wouldn't work with local variables
no
some forum posts say to do that, but I don't see how
format ["%1 enableSimulation true", _unit]
resolves differently than "_unit enableSimulation true"
that's wrong as we just discussed
as for why it doesn't "resolve", _unit is not defined in that statement
as I already mentioned
the only correct way to pass variables to a waypoint statement is creating an array of args in the group's var space
you cannot "resolve" an object by its natural string representation, https://community.bistudio.com/wiki/setVehicleVarName see example 1, it explains it
_args = _grp getVariable ["#grpArgs", []];
_id = _args pushBack [_arg1, _arg2, ...];
_grp setVariable ["#grpArgs", _args];
_waypoint setWaypointStatements ["true", format ["
_args = group this getVariable ['#grpArgs', []] param [%1, []];
_args call MY_fnc_bla;
", _id]];
in case of mp, you'd want to broadcast the arguments and maybe also just index them via varname rather than array in that case
apparantly the onactivation code runs globally 
in MP you don't need array
or in general you can just write:
_wpID = str _waypoint;
_grp setVariable [_wpID, _args, true];
_waypoint setWaypointStatements ["true", format ["
_args = group this getVariable ['%1', []];
_args call MY_fnc_bla;
", _wpID]];
it's a bit messy 
I think the var can be overwritten rn 
i guess you can also add some frame number into the id ๐ or maybe something with time
how come
[getposatl player,west,"BUS_InfSquad"] call BIS_fnc_spawnGroup;
``` doesn't work?
[getposatl player,west, 5] call BIS_fnc_spawnGroup;
``` works fine
oh you need the full path
what is the scope of a #define?
I wanted to have a file that defines constants for a mission.
scope? macros don't do anything at runtime, they're handled at compile time, if you define a macro, it will be available anywhere within the file
not in any other file?
you'd have to #include the file with macro defines into said file(s)
It can get problematic with config stuff. Say you have:
#include "MyFirstGUIDialog.hpp"
#include "MySecondGUIDialog.hpp"
Anything defined in the first hpp will be visible in the second.
Because #include is basically copy-paste.
include guards easily fix this
Decent script for faster heli landings than the transport unload waypoint on a helipad?
guys, please tell me how to enable the display of the player's nickname on your server v DAYZ
script for hiding individual vechile parts? forgot the name of it know similar syntax etc just cant find after 2 hours looking for it
hideSelection or animate
thx
I can add an action onto this but using the action doesnt open the GUI. HOWEVER, adding the action to a player works perfectly fine. Anyone know why this is?
teleBoard addAction
[
"<t color='#3F6BC5'>Open Menu</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"]; // Calls the below parameters. Only using this so I can set radius of action
{execVM "openTomMenu.sqf"};
// Teleport Menu shit
},
nil, // arguments
1.5, // priority
true, // showWindow
true, // hideOnUse
"", // shortcut
"true", // condition
5, // radius
false, // unconscious
"", // selection
"" // memoryPoint
];
so the action shows but clicking it doesn't execute the code?
makes no sense ๐ค
Idk. Works perfectly fine when the action is attached to a player. Just opens a GUI with a list of players and lets you teleport to a player. I'm only trying to put it on an object so that it:
1.) Can't be abused mid combat.
2.) Im too stupid to make it only usable at base
add a systemChat str fileExists "openTomMenu.sqf"
Ill give that a shot
those brackets around the execVM part will not execute
teleBoard addAction
[
"<t color='#3F6BC5'>Open Menu</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"]; // Calls the below parameters. Only using this so I can set radius of action
execVM "openTomMenu.sqf";
// Teleport Menu shit
},
nil, // arguments
1.5, // priority
true, // showWindow
true, // hideOnUse
"", // shortcut
"true", // condition
5, // radius
false, // unconscious
"", // selection
"" // memoryPoint
];
@floral beacon
Works perfectly fine when the action is attached to a player
well that means the code you were using there wasn't the same as the one you sent ๐
i didn't even see that due to bad indentation 
cringe
anyone got anything on how to use BIS_fnc_moduleCAS?
it's a module function, use the module?
So I'm using EOS (linked below), and I'm hoping to make a change to eos_core.sqf such that vehicles don't despawn when a player moves out of the area. We'd ideally like to go within the detection distance, have the enemies spawn in, clear the area, steal their vehicle, then drive to the next point. But currently as soon as we drive out of the detection distance it despawns the vehicle we're in. Any ideas or help is appreciated ๐
https://forums.bohemia.net/forums/topic/144150-enemy-occupation-system-eos/
You could just comet these 2 lines and it shouldn't delete any vehicles. its at the end of the eos_core.sqf.
deleteVehicle _clear;
deleteVehicle _taken;
I have done and it still seems to be deleting them :/ I think it may be in the cache light vehicles / cahce armoured vehicles stuff earlier in the script
is it okay to ask CBA related questions in here?
it's meh, but may provide an answer
okay because i was wondering if you still need a CfgFunctions if you are using CBA
or do you just use CBA's FUNC()
If your using the ACE template simple use the PREP()
ace template?
I assume your are making an addon using CBA functions?
And CBA function caching.
Then it's best to use the ACE template from the GitHub. ACEX-template iirc
its a mod to add more medications to ace
it will have CBA loaded
the function file name is fnc_adrenaline and is under injector/functions
where injector is what will be the PBO
If you simple want to call ace functions you have to resolve them yourself
nah i want to make sure my function is set up right
i dont have it in cfgFunctions
i have it in XEH_PREP in a PREP()
Then I assume you already are using the ACE template.
i am looking into the template
As long as it's the same module/pbo you can call the function using FUNC()
Else EFUNC() with the target modules ADDON.
The ACE coding guidelines provide a clear explanation to this whole system
okay cool so aslong as i dont need to reference it outside of its own PBO
i can just use func() where i would do like XXX_fnc_myfunction
Question does the vehicle get deleted as soon as you leave the zone or as soon as you leave the zone and leave the vehicle you are in ?
Yes, that's correct.
I may need to double check but it's my understanding that you could be in a vehicle from the zone, drive out of the zone, and it would be deleted as you are driving it.
Which is weird because I would have thought that the lines that follow this format would have prevented that...
if (!(vehicle player == _vehicle)) then {{deleteVehicle _x}
forEach[_vehicle];};
so i dont need a cfgFunctions at all if i use CBA and dont need to reference outside of the pbo
If you are using PREP and the CBA template for your addon you don't and should not use cfgFunctions. It is completely replaced.
Look at the CBA GitHub wiki for a detailed explanation of the function library system.
whats the cba template?
im not using any template other than this one brake down of it i found in a reddit post
ACE/CBA template. It's the way the ace mod is structured. It makes the whole system of Macros and definitions function.
okay where can i find the guide for this template
ACEX-template on GitHub iirc. I'll try to get the link.
Got the name wrong, buts this is it.
the link for setting up the enviroment is broken for me
Let's take this to DM's
I beleve you need to comet dose lines of code becouse that is saying if player is in a vehicle delete vehicle player is in.
I could very well be wrong but I thought that the ! meant it was the opposite of that?
I'll give it a shot though, thank you ๐
Hey I currently use this https://github.com/SkaceKamen/vscode-sqflint, the problem is that it marks the functions with a possible error even if I give a path to the description.ext.
Does anyone have recommendations for an alternative?
thanks I saw that already but if I didn't overlooked something there is no other vscode Linter.
we kind of found the problem, Marcos aren't allowed to have a semicolon on the last line (in the "define" part) so you need to say MACRO(X,Y,Z); just a silly parser error i guess
thanks tho ๐
[(player getVariable "Zcam"), 0.1] call BIS_fnc_camera_setFOV;
I'm trying to change the camera fov using this command but its not working, what is the problem?
I don't see any immediate problem. It's possible that the "Zcam" variable isn't being correctly defined as a reference to a camera object (impossible to say without seeing where it's defined).
Don't forget to try the camSetFov command too (with camCommit as documented) in case that works instead.
yeah tired the two commands you mentioned they worked
is there a mathematical equation to convert FOV into zoom degrees or something of sorts?
Is there a way to disable like ragdoll physics on an AI unit? I know there is the "awake" command, but its description is short and I cant tell if its gonna break it
from camSetFov:
The angle of the field of view is
atan(FOV)*2radians when in 4:3 aspect ratio
I don't maths very well so I don't know whether that helps, but it looks right.
Yes but I'm on 16:9 which is a problem
What will be the best place to ask how to find a mathmatical equation the converts camera fov into zoom levels?
Or at the very least how is camera fov formatted?
Uh, problem here is that it doesn't specify what the function returns when it's not 4:3.
I guess I will just have to do 0.75 - ((0.75 - (0.75/zoom level))/zoom level) * zoom level
blinks
If the FOV is just for the 4:3 part in the middle then the full 16:9 FOV would be atan(FOV*4/3)*2 radians.
0.75 will only work if the user's fovTop is 0.75
https://community.bistudio.com/wiki/getResolution will get you the fovTop
hm, for me 0.75 is my fov for my game despite me having fovTop=1.54;
thanks
or maybe I'm wrong because I'm viewing the camera from a small screen
for the zoom level http://killzonekid.com/arma-scripting-tutorials-get-zoom/
tried putting that into a calculator with FOV = 0.75, got 1.57, so close to my fovTop=1.54;
problem is
I'm measuring the zoom from the camera position
what calculator?
not from a pos to a pos
a normal calculator
oh you mean your equation
how does that change anything? ๐ค
KK_fnc_trueZoom = {
(
[0.5,0.5]
distance2D
worldToScreen
positionCameraToWorld
[0,3,4]
) * (
getResolution
select 5
) / 2
};
isn't he measuring distance from a pos to the player camera?
no, positionCameraToWorld is current camera.
if I have a camera object, what should I replace positionCameraToWorld with?
nothing
I'm running a gui that broadcasts a camera pov into a texture (render to texture)
so isn't in this case the current camera is the player camera? not the camera I'm boradcasting?
It is.
if I wanted to set the camera zoom to 10x, how would I go about using this?
since it has no params
so basically to make it simpler, I want to convert 10X into FOV format
idk how it works with camera projected on surface.
Depends on aspect ratio of the surface I guess?
well, the ratio of the texture is 1
ctrlSetText '#(argb,512,512,1)r2t(Zera,1)';
