#arma3_scripting
1 messages · Page 220 of 1
There's no second item needed
As I remember, all vanilla deployable weapons contains consist of 2 parts -- the weapon itself and the tripod.
Yes, my weapon is functionally the tripod
Most do, but it's not actually a requirement and some of them don't (e.g. remote designator, UAVs)
Oh looks like just using the unit as the tripod works, i.e. _this action ["Assemble", _this];
I assume no, but is there a way to not have AI move away from the turret before getting in (without just using the moveInX commands)? I'm just doing:
_unit assignAsGunner _weapon;
[_unit] orderGetIn true;
without just using the moveInX commands
I didn't want to just "teleport" them, which is why I said that
That's why I deleted my message.
You could use the GetIn action. There'll still be a little bit of a snap but it might look slightly smoother.
Seemed pretty much the same to the getIn commands
Might just leave it as instant, maybe with a small delay
them moving away is unfortunately the weird path finding the AI has to do
he like tries to return to formation
Yeah that's what I had assumed
I was almost debating teleporting them back a bit / the turret a bit forward to try and offset it
you can move them manually with animations
then use the getIn action (not command) when close enough
how would i go about scripting a trigger that activates once all 4 members of a squad enter a vehicle?
((units _squad) findIf { !(_x in _vehicle) }) < 0
works like a charm, thanks a lot
hi
is there a way to disable damage on vehicle engine specifically?
Should be possible by handleDamage EH I guess
private _fnc_update = {
params ["_unit"];
private _vehicle = vehicle _unit;
if (_unit == _vehicle && {cameraView == "EXTERNAL"}) then {
_vehicle switchCamera "INTERNAL";
};
};
["vehicle", _fnc_update] call CBA_fnc_addPlayerEventHandler;
["cameraView", _fnc_update] call CBA_fnc_addPlayerEventHandler;
its possible to make this work only for UAV ?
you could check if !isNull
https://community.bistudio.com/wiki/getConnectedUAV
i'm sorry i don't really understand i'm debuting at scripting stuff and thise start to a be a bit to complex for me
this addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitPartIndex", "_instigator", "_hitPoint", "_directHit", "_context"];}];
how to set _hitPartIndex to check for engine and disable any damage on it?
Just check the hitpoint
if (toLowerANSI _hitpoint == "hitengine") then { ... };
and like mentioned here https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
"If the provided code returns a numeric value, this value will overwrite the default damage of given selection after processing. If no value is returned, the default damage processing will be done - this allows for safe stacking of this event handler. Only the return value of the last added "HandleDamage" EH is considered. "
Small one: can we know the index of the group of the player inside the whole list of groups defined into the mission (globally or per side, no matter) ?
"defined into the mission"?
You can do allGroups find (group player). But that does include groups created later, and excludes groups that have been deleted. I'm not sure if there's a persistent order either.
What am I doing wrong here, for some reason the vehicleVarName is not being set on the ammo box within the postInit of the mission:
private _mC = "FORGE_CfgLockers";
private _lockers = "true" configClasses (missionConfigFile >> "FORGE_CfgLockers" >> "lockers");
{
private _configName = configName(_x);
private _className = (missionConfigFile >> _mC >> "lockers" >> _configName >> "className") call BFUNC(getCfgData);
private _pos = (missionConfigFile >> _mC >> "lockers" >> _configName >> "pos") call BFUNC(getCfgData);
private _dir = (missionConfigFile >> _mC >> "lockers" >> _configName >> "dir") call BFUNC(getCfgData);
private _locker = createVehicle [_className, [0, 0, 0]];
private _varName = format ["FORGE_Locker_%1", _forEachIndex];
_locker setPosATL _pos;
_locker setDir _dir;
_locker allowDamage false;
_locker setVariable ["isLocker", true, true];
clearBackpackCargoGlobal _locker;
clearItemCargoGlobal _locker;
clearMagazineCargoGlobal _locker;
clearWeaponCargoGlobal _locker;
private _pLocker = vehicle _locker;
_pLocker setVehicleVarName _varName;
missionNamespace setVariable [_varName, _pLocker, true];
diag_log format ["[FORGE:Server:Locker] ClassName: %1 Pos: %2 Dir: %3 LockerName: %4", _className, _pos, _dir, _varName];
} forEach _lockers;
Even though the log shows that the items were added to the ammo box nothing is in it, here's the client side log: ```r
19:49:30 [FORGE] (locker) INFO: Found locker 'FORGE_Locker_0' : 2252afe1600# 15: equipment_box_f.p3d Box_NATO_Equip_F REMOTE
19:49:30 [FORGE] (locker) INFO: Added 4 30Rnd_65x39_caseless_mag
19:49:30 [FORGE] (locker) INFO: Added 1 arifle_MX_F
19:49:30 [FORGE] (locker) INFO: Added 1 NVGoggles
Here's the client side snippet of a function within a createHashMapObject:
["applyItems", {
private _lockers = _self get "lockers";
private _items = _self get "locker";
{
private _box = _x;
{
private _amount = _y get "amount";
private _category = _y get "category";
private _className = _y get "classname";
switch (_category) do {
case "backpack": { _box addBackpackCargo [_className, _amount]; diag_log text format ["[FORGE] (locker) INFO: Added %1 %2", _amount, _className]; };
case "item": { _box addItemCargo [_className, _amount]; diag_log text format ["[FORGE] (locker) INFO: Added %1 %2", _amount, _className]; };
case "magazine": { _box addMagazineCargo [_className, _amount]; diag_log text format ["[FORGE] (locker) INFO: Added %1 %2", _amount, _className]; };
case "weapon": { _box addWeaponCargo [_className, _amount]; diag_log text format ["[FORGE] (locker) INFO: Added %1 %2", _amount, _className]; };
default { _box addItemCargo [_className, _amount]; diag_log text format ["[FORGE] (locker) INFO: Added %1 %2", _amount, _className]; };
};
} forEach _items;
} forEach _lockers;
}]
Well, the diag_log in the upper loop isn't firing, so I'm not sure why you'd expect vehicleVarName to be set?
I don't see what the relationship of the two pieces of code is, as the first chunk doesn't set "lockers" on anything.
I forgot to include that log:
19:49:29 "[FORGE:Server:Locker] ClassName: Box_NATO_Equip_F Pos: [3,3,0] Dir: 0 LockerName: FORGE_Locker_0"
And here's a snippet of the client side code that get's the lockers within a createHashMapObject:
private _lockers = [];
for "_i" from 0 to 10 do {
private _var = format ["%1_%2", _prefix, _i];
private _obj = missionNamespace getVariable [_var, objNull];
if !(isNull _obj) then {
diag_log text format ["[FORGE] (locker) INFO: Found locker '%1' : %2", _var, _obj];
_lockers pushBack _obj;
};
};
_self set ["lockers", _lockers];
_prefix defined? post-init issue? add some additional loggin
Server log: ```r
6:03:37 "[FORGE:Server:Locker] Locker Var: FORGE_Locker_0"
6:03:37 "[FORGE:Server:Locker] ClassName: Box_NATO_Equip_F Pos: [3,3,0] Dir: 0"
Client log: ```r
6:03:40 [FORGE] (locker) INFO: Found locker 'FORGE_Locker_0' : 1bc30788100# 15: equipment_box_f.p3d Box_NATO_Equip_F REMOTE
6:03:40 [FORGE] (locker) INFO: Locker Items: [["30Rnd_65x39_caseless_mag",[["amount",4],["classname","30Rnd_65x39_caseless_mag"],["category","magazine"]]],["arifle_MX_F",[["amount",1],["classname","arifle_MX_F"],["category","weapon"]]],["NVGoggles",[["amount",1],["classname","NVGoggles"],["category","hmd"]]]]
6:03:40 [FORGE] (locker) INFO: Locker Lockers: [1bc30788100# 15: equipment_box_f.p3d Box_NATO_Equip_F REMOTE]
6:03:40 [FORGE] (locker) INFO: Locker Box: 1bc30788100# 15: equipment_box_f.p3d Box_NATO_Equip_F REMOTE
6:03:40 [FORGE] (locker) INFO: Locker Item: [["amount",4],["classname","30Rnd_65x39_caseless_mag"],["category","magazine"]]
6:03:40 [FORGE] (locker) INFO: Magazine added 4 30Rnd_65x39_caseless_mag
6:03:40 [FORGE] (locker) INFO: Locker Item: [["amount",1],["classname","arifle_MX_F"],["category","weapon"]]
6:03:40 [FORGE] (locker) INFO: Weapon added 1 arifle_MX_F
6:03:40 [FORGE] (locker) INFO: Locker Item: [["amount",1],["classname","NVGoggles"],["category","hmd"]]
6:03:40 [FORGE] (locker) INFO: Item added 1 NVGoggles
6:03:40 "[FORGE:Client:Locker] Sync completed"
are you running dedi?
I would say add a delay between createVehicle and manipulating it, like one-frame delay?
Mh no eden also has no delay to set varname so should be fine 🤔
Here's the source code that I'm working on for the module:
Mission Config: ```hpp
class FORGE_CfgLockers {
class lockers {
class locker1 {
className = "Box_NATO_Equip_F";
pos[] = {3, 3, 0};
dir = 0;
};
};
};
Server-Side (preInit func) https://pastebin.com/7QkB94Pk
Server-Side (postInit func) https://pastebin.com/gz8LFDKP
Client-Side (postInit func) https://pastebin.com/tqNy8t7K
not that it probably matters but do note that addBackpackCargo etc commands have local effect
That's the intent, I only want what the player stored in their locker instance showing inside the ammo box. I may just have to create an locker UI if I can't get this approach to work, lol
Other than r2t, no
You could probably setup a fixed camera facing the player with the html UI around the player
Can you tell me how to make a logical operator in the FSM editor, for example, when checking if yes, it goes under one path, if not, another path?
Create two conditions and two states. Create link from base state to the conditions and each condition to one of the new states.
Not sure which part of this isn't obvious though so I'm probably missing something.
If you want it to always take one of the conditions then you can simplify it slightly and make the lower-priority condition a true condition.
Hmm when i create vehicle via createVehicle create their group with BIS_fnc_spawnCrew and addWaypoint for them, they refuse to move to it until i slightly nudge the waypoint via zeus.
Anyone experienced this and knows a fix? Vehicle is a boat btw
Wtf, that only seems to be the case if i run it in scheduled. They work fine in unscheduled
Okay remoteExecCall to the rescue, or is there any other way to call function from scheduled to not be run scheduled?
Code inside isNil always runs unscheduled.
awesome thats cleaner than remoteExec.
thanks
oh, that's interesting. Seen that occasionally and didn't figure a pattern.
hey dose anyone have a script for a bombing target range were you can reset vic targets and stuff? im trying to make a practice range for my fixedwing guys in my unit
Ive tried to replicate it, but couldn't.
I will try some more tommorow.
can anyone help me with making a ammo type mod for arma 3 its APDS-ET Armor-Piercing Discarding Sabot Explosive Tracer round for the Mosin Nagant using 7.62x54mmR as the base cartridge,
#arma3_config for that.
thank you
trying to find out where on this list Lambs supressions should go tried many dif variations thx
Why does it matter where it goes?
server likes when i have lambs danger where it is but when i add suppression the server comes back no mods loaded @sly cape
This is more of a #server_admins issue rather than scripting.
One possible starting point, though: is it actually that no mods are loaded, or is the server just not reporting any mods to connecting clients through the launcher? If It's the latter, it could be the Steam data packet size limit. See https://community.bistudio.com/wiki/Arma_3:_Server_Config_File steamProtocolMaxDataSize
got it working thx was files names too long as you pointed towards
is it possible to send a custom parameter entry to an eventhandler? I've been using this clunky method with adding variables to missionnamespace, but it makes my file very hard to follow with multiple layers and I think it may cause issues with multiple modules present.
Cba has a function if you're using it
It's CBA_fnc_addBISEventHandler iirc
It is
You'd normally setVariable on the object instead, if the var is object-dependent.
Not really clear whether it is from the snippet.
ooh good idea. I'll try that. It should solve this particular problem but I still have a larger encompassing EH that I'll probably have to use the CBA method on because the first EH spawns a vehicle to which the second EH is applied to.
You never have to use CBA. It's just convenience.
I do know I have to stop using the missionnamespace method, I've just confirmed that it causes problems when multiple copies of this module are used with different parameters
missionNamespace is just global variables. missionNamespace setVariable ["foobar", 1] is identical to foobar = 1.
So normally the only time you use it when you're building a variable name with string commands.
so basically to add a variable to a unit, just replace the missionnamesppace with the vehicle object like this?
Remove the global flag on the setVariable. You're installing the EH locally anyway. Other machines don't need the data.
So I'm trying to check if the unit that fired a shot is the same as the unit who killed some vehicle _ICMVehicle
For some reason, my comparator to check isn't evaluating to true. I've tried both an == operator and now isEqualTo operator to no effect, but when displaying both variables as a hint individually, they read out the same thing. Identical mission using a saves mission+startup parameter.
The first _unit used to set the variable B47_WZ_ModuleSYSICMFiringUnit is from a Fired EH which kicks everything off.
```sqf
// your code here
hint "good!";
```
↓ turns into ↓
// your code here
hint "good!";
how to script the custom radio triggers, the ones that are under 0-9- menu ? 🤔
I have another problem, I scripted (the caveman way ) heavy kamikaze drone, it works ok but I want to get rid of the drone wreck, it break immersion
I tried with
_drone addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
_useEffects = false;
_boom = "Bo_Mk82" createVehicle (getPosATL _unit);
_boom setDamage 1;
}];
but the wreck is still there ...
how to get the specific drone wreck classname ?
deleteVehicle _unit?
didn't try but this works
_drone addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
_boom = "Bo_Mk82" createVehicle (getPosATL _unit);
_boom setDamage 1;
deleteVehicle (_this select 0);
}];
seems _this refers to the units wreck too
just tested your method @stark fjord , it works, thanks!
_this select 0 is same as _unit
yeah 😂
I cant reliably replicate this.
Yeah that is the general problem with AI bugs.
They sometimes jam in scheduled and never jam in unscheduled though? Even that's a good clue.
Yup. On mission that i have and can reliably replicate, it always works unscheduled
That mission has over 500 ai on tho
How do I prevent triggering holding down key? I want to trigger action only once per press, when key released and pressed again
( findDisplay 46 ) displayAddEventHandler [ "KeyDown", {
params [ "_displayOrControl", "_key", "_shift", "_ctrl", "_alt" ];
if ( inputAction "watch" isEqualTo 1 ) then
{
systemChat format [ "_frame: %1", diag_frameNo ];
private _time = uiNamespace getVariable [ "key_time", -1 ];
if ( serverTime < ( _time + 3 ) ) exitWith {};
uiNamespace setVariable [ "key_time", serverTime ];
// do stuff
};
}];
use KeyUp
also good read: https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding
addUserActionEventHandler would do
I have problem with a drone script,
problem is if the drone gets shot in the air it spawns the bomb and drops it on the ground with spectacular explosion killing near 100% the shooter
my intent is to make so the bomb explodes immediately in the air when the dron is destroyed
_tr10 = createTrigger ["EmptyDetector", getPos player, false];
_tr10 setTriggerArea [0, 0, 0, true];
_tr10 setTriggerActivation ["JULIET", "NONE", true];
_tr10 setTriggerStatements ["this",
"
if ((typeOf cursorObject) != 'O_UAV_06_F') exitWith {systemChat 'Wrong drone type';};
cursorObject addEventHandler ['Killed', {
params ['_unit', '_killer', '_instigator', '_useEffects'];
_boom = 'Bo_Mk82' createVehicle (getPosATL _unit);
_boom setDamage 1;
deleteVehicle _unit;
}];
systemChat 'Baba Yaga ready for the hunt';
", ""];
_tr10 setTriggerText "Arm Baba Yaga";
yes, the drone is armed via radio trigger 🤫
@proven charm omg, cluster fpv drone incoming
Edit: works perfectly as intended, thanks a lot!
btw, createVehicle with a CfgAmmo type treats the input position as AGL rather than ATL, so if you need the thing to work correctly against boats or units on piers then you should tweak it.
Working on some sliders for a module, but I want to keep it to whole numbers only. I already changed the ranges and removed the % for my custom ones, I already tried just rounding the value passed to initSliderValue but that didn't do it:
attributeLoad = QUOTE( \
_ctrlGroup = _this; \
[ARR_4(_ctrlGroup controlsGroupCtrl 100,_ctrlGroup controlsGroupCtrl 101,"""",round _value)] call BIS_fnc_initSliderValue \
);
onLoad = QUOTE( \
_ctrlGroup = _this select 0; \
[ARR_3(_ctrlGroup controlsGroupCtrl 100,_ctrlGroup controlsGroupCtrl 101,"""")] call BIS_fnc_initSliderValue \
);
(Second is a whole number because I didn't change the value)
hmm have you tried https://community.bistudio.com/wiki/sliderSetSpeed
I haven't, didn't know that was a thing
Sounds promising though
Yep that worked, thanks
I want to make drone drop a flare to mark position at night, but the flare is somehow attached to the drone
what shoud I use to make the flare to fall to the ground, vector speed ?
_drone addAction
[
"Drop White Flare",
{
params ["_target", "_caller", "_actionId", "_arguments"];
_fl = "Flare_82mm_AMOS_White" createVehicle (getPosATL _target);
triggerAmmo _fl;
},nil,5,true,true,"","true",3,false,"",""
];
That is very ugly flare
well its visible at least 😆
Try using alt syntax of createVehicle, and pass CAN_COLLIDE as special param.
private _flareObj = createVehicle [ _flare, _position, [], 0, "NONE" ];
triggerAmmo _flareObj;
sleep 0.1;
_flareObj setVelocity [ wind #0, wind #1, -1 ];
If you have SOG or SPE use their flares instead. Vanilla one is broken
To my knowledge this is only mortar/artillery caliber flare in the game and it's broken
Afaik flares work just fine
Have you seen it? It's graphical effect is broken and it does same illumination like 40 mm GL flare
Oh, its no bigger than 40mm thats true.
@hushed turtle yep, this flare is broken even spawned in air it doesn't fall down as it should ...
With my code?
Did you give it some velocity?
@hushed turtle no, by default ...
That behaviour is true for all flares or maybe for all ammo
Try something like
private _pos = _target modelToWorld [0,0,-1];
private _flare = "F_40mm_White" createvehicle _pos;
_flare setPosATL _pos;
_flare setVelocity [0,0,-5];
so spawn 1 m below the vehicle and add some downards velocity
@hushed turtle works perfectly with your code thanks 👍
@stark fjord yeah, velocity could be faster because I don't want to iluminate but to designate target for CAS
I'm wasn't successful at trying to change flare velocity. Maybe it needs to be set on each frame?
how much negative velocity did you give?
Most likely from my code
hey guys I'm trying to make an intro video play when a player joins the server.
Now I've tried 2 methods and both seems to be working. I've embedded the video inside of my custom mod so it wont increase the mission file size.
WaitUntil {!isNull player};
play = ["cwutility\data\intro2.ogv"] spawn BIS_fnc_PlayVideo;```
and this one on trigger
```play = ["cwutility\data\intro2.ogv"] spawn BIS_fnc_PlayVideo;```
But if a player disconnects and joins again it plays the video all again so I'm trying to make it play one time only first time they join.
So my question is, is it possible to make a system that remembers player when it re-joins? Maybe like SteamID check I'm not sure. Is it possible?
you could store all steam IDs of players who joined in an array, then check against that before playing a video.
But if your server is supposed to be up 24/7 and you expect alot of players that might not be the best solution.
Also this wont work over server restart
Could also just check a profileNamespace variable on the client to see if they've watched the video previously. Only disadvantage to this is they will get it again if they join with another profile. Storing on server though as Marko mentioned would probably be the better way. Could do something like this:
private _introHashmap = if !(profileNamespace isNil "introHashmap") then {
profileNamespace getVariable "introHashmap";
} else {
profileNamespace setVariable ["introHashmap", createHashmap];
profileNamespace getVariable "introHashmap";
};
private _watchedVideo = if (_introHashmap getOrDefault [_playerID, false]) then {
(true)
} else {
_intoHashmap set [_playerID, true];
saveProfileNamespace;
(false)
};
[_watchedVideo] remoteExec ["TAG_fnc_clientConnectRE", _object];
The above is just scratch though. You don't really need to be doing saveProfileNamespace that frequently, nor do you really need to be check if the variable isNil on every player connect. Just wrote extra though for demonstration purposes.
variables are fed via module
some of the parts of the file aren't relevantyet, ill paste it, just ignore the "If Shell" section since I'm testing new stuff on the missile section. The purpose of the section of code in question is to prevent the firing unit's rating from changing if the ammunition explodes, killing the spawned+attached vehicle unit
Hi,
I'm trying to add an event handler to GPS map control in a third party mission using this code:
#include "\a3\ui_f\hpp\defineResincl.inc"
_display = uiNamespace getVariable "RscCustomInfoMiniMap";
_control = _display displayCtrl IDC_MINIMAP;
diag_log _display;
diag_log _control;
_control ctrlAddEventHandler ["Draw", { hintSilent (str _this); }];
It logs _display and _control, but hints nothing. I'm using the same code in my mission, and it works fine. It also works in the editor when you run the code in the debug console. I thought that disableMapIndicators might be blocking my event handler, but removing it didn't help.
Any ideas what might be blocking the event handler from firing?
Hey, I got a question about the BIS_fnc_attachToRelative command.
[this, frigate_north] call BIS_fnc_attachToRelative;
I have a turret I'm attaching to a ship frigate_north using BIS_fnc_attachToRelative. This works, except the animations of the turret have become choppy. I know this is because of how ArmA does simulation and I know there's a way to make it run smoothly, but I forget how.
Can anyone help me out there?
I'm using this instead of attachTo due to multiplayer needs.
Static objects like that ship have low simulation rates, and when you attach an object, it inherits the simulation rate of the object it's attached to.
You'll need to attach your turret to a dummy object that has a higher simulation rate (e.g. a vehicle or something with ThingX simulation)
it inherits the simulation rate of the object it's attached to
Oh, I never knew that! That explains why this has issues whereas attaching to other vehicles tends to work fine.
could that be adjusted by chanign simulationStep config parameter?
That is what I was thinking. I don't know how to do that in this context.
cant via script, needs mod
Well shoot. I mean what's one more mod on my 213 mod list?
This is attachTo. BIS_fnc_attachToRelative is a function, not a command; it contains attachTo. The difference is that it also does some maths to automatically work out the correct offsets and directions to apply.
Ah, I see.
I thought it was like remote execute.
Brain fart, I should have known this already.
attachTo is GA/GE anyway so there's no need for any sort of remoteExec
So I think what I am actually supposed to do might be
[turret, boat, true] call BIS_fnc_attachToRelative;
true being the visual of render time / simulation time.
I was looking in the wrong place on the wiki
That won't help in this case.
It doesn't change how the actual attachment behaves (there's no mechanism for that in attachTo). It just determines which method is used for finding the offsets.
If your objects were both moving, then using render scope could help you get a more visually precise position. But once attached, it still inherits the parent object's simulation.
Ohh, okay, so I really do need a dummy object or a mod.
@tidal idol Are you aware of a mod that does this?
id what you're adjusting, just make one that re-inherits your desired "root" vehicle from its base class and change simulation step to something else. I'd copy the existing one and add one zero.
Would a flagpole work? I think I've used flagpoles as an anchor object in the past for the root of compositions.
hard to say. maybe the EH is deleted. check event handler info
try attaching the ship to a logic entity or maybe something else if logic doesn't work
A logic entity sounds like it would work, I'll try that. Far more sane sounding than shoving a secret car or other simulated object somewhere.
Whats the easy ace arsenal script you put in an object init again?
I forgot Im having a brain fart
You can just change it to "Blacklist" in the object's properties
But if you really need to script it, look at https://ace3.acemod.org/wiki/framework/arsenal-framework.html#11-adding-ace-arsenal-to-a-box
Is it possible to spawn a damageEffect through script?
Im not sure what I did to fix it, I reverted to an older mission file, and it runs again
new question, how can I use scriptDone with a spawned function?
not exactly scriptDone, but some other equlivant
Why not by a Var?
before spawn ->
MyVar = false;
[]spawn MySuperDuperFnc
waitUntil{MyVar};
In the end of MySuperDuperFnc -> MyVar = true;
?
Not directly. See https://community.bistudio.com/wiki/ParticleArray to recreate your own effect
nvm, I was using the wrong var 😦
I've used your method from time to time
I don't know why I asked if it was possible, I've done it before
Doesn't look like this, at least there are no ctrlRemoveEventHandler and ctrlRemoveAllEventHandlers in the mission files.
The whole code that is called from initPlayerLocal.sqf:
#include "\a3\ui_f\hpp\defineResincl.inc"
[] spawn {
_display = displayNull;
waitUntil {
_display = findDisplay IDD_MAIN_MAP;
!(isNull _display)
};
(_display displayCtrl IDC_MAP) ctrlAddEventHandler [
"Draw",
{
call SCH_fnc_drawUnitIcons;
call SCH_fnc_drawCorpseIcons;
}
];
};
[] spawn {
_display = displayNull;
waitUntil {
_display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];
!(isNull _display)
};
diag_log _display;
diag_log (_display displayCtrl IDC_MINIMAP);
_id = (_display displayCtrl IDC_MINIMAP) ctrlAddEventHandler [
"Draw",
{
hintSilent (str _this);
(_this + [false]) call SCH_fnc_drawUnitIcons;
call SCH_fnc_drawCorpseIcons;
}
];
diag_log _id;
};
The first part works fine, and I can see unit and corpse icons. The second part doesn't. Log:
12:31:55 Display #311
12:31:55 Control #101
12:31:55 0
So, the EH is added. I can even add the EH from the debug console, the ID will be 1, 2, 3, ... but it hints nothing.
So, something blocks all the Draw event handlers for GPS panel.
The same code works fine in my mission (as a reminder, I'm trying to change third party mission).
oh ok
could be wrong minimap being displayed though, because you can change that with key press
My mission:
i tested your code. first it does nothing when im in SENS mode but when i switch to NAV the hint shows
As I said, for some reason in a third party mission the EH hints nothing when I open NAV panel:
Log the same as above:
13:49:45 Display #311
13:49:45 Control #101
13:49:45 0
Very strange.
yea they must use custom map ctrl or something
Very unsure.
I am trying to fix the issue when player loose score points for destroying friendly fpv drone ...
cursorObject addEventHandler ['Killed', {
params ['_unit', '_killer', '_instigator', '_useEffects'];
[_killer, 5] remoteExec ['addScore',2];
[_instigator, 5] remoteExec ['addScore',2];
_boom = 'Bo_Mk82' createVehicle (getPosATL _unit);
triggerAmmo _boom;
deleteVehicle _unit;
}];
it still takes 5 score point after destroying the drone ...
the code fires?
Is there any way to get selection positions of weapons or other proxies?
Create it as a simple object and fetch the object's selections
mm... i suppose i can work with that - kinda need relative positions to the unit carrying the weapon but i guess i can add the unit's proxy selection position + the offsets from the fake proxy
@glass nest thanks, the EH works perfectly
Hello, please help, I can't figure this out. Automatic slot distribution is configured on the server. After connecting, players see a welcome menu with a camera showing a view of the base.
Problem: when connecting to the server, some players experience the following:
- The loading screen disappears for a moment.
- The start script menu appears.
- The loading screen returns and stays for varying lengths of time.
- While the menu is active, players can interact with it, but instead of the camera view, they see the loading screen.
After loading is complete, the camera is finally displayed correctly.
Before creating the dialogue, all necessary conditions are checked, and even more. I tried to find it but couldn't:
!isNull findDisplay 46 &&
{!isGamePaused} &&
{isNull (uiNamespace getVariable [“RscDisplayLoading”, displayNull])} &&
{isNull (uiNamespace getVariable [“RscDisplayLoadMission”, displayNull])} &&
{isNull (findDisplay 57)} &&
{!(isNull player)} &&
{alive player} &&
{time > 1}
};
disableSerialization;
private _dialog = createDialog [“SE_spawnMenu”];
Perhaps just give it more time. Your script goes forward as soon as step 1 youve described completes
Berhaps you could also use https://community.bistudio.com/wiki/getClientState ?
I don't understand what the "unscheduled" flag is supposed to do for HashMapObjects. Does it just force the HMO and its methods to run unscheduled regardless of where they were created or called (scheduled or unscheduled script)?
Conversely, what does it mean when the unscheduled flag is not present? Is it equivalent to spawning the HMO's methods? Apparently not since they can still return values to the script that called them.
Good question. I don't know but any behaviour beside the unscheduled option forcing unscheduled environment, and otherwise whatever environment you were in being used, would be surprising.
I imagine you can verify behavior with canSuspend.
Does it just force the HMO
how can it force a "hashmap" to run anything?
its methods to run unscheduled
yes
what does it mean when the unscheduled flag is not present? Is it equivalent to spawn
no. it's like ordinarycall
I have a question ? Is it possible to get the "Projectile" (Object) from the "Handle Damage" EH ?
No. I doubt it's guaranteed to exist at that point.
Probably only HitPart knows the projectile object.
Consider that HandleDamage is target-local and hits are assessed shooter-local.
Oh ok because i'm trying to solve the problem of "SLAT" armor that doesn't stops HEAT Projectiles and Handle Damage EH seems to be a good thing, however since i need to "prevent" all damage after i know it hit a SLAT, however i don't have the Projectile, so i need to use the unit that fired that projectile but i'm not sure it's a reliable way to do that
yeah i know, i thought about using that EH, however since it is supposed to be placed on the unit, i'm not sure i can use both since they are "running" on different client
You know what I mean. My question was whether the "unscheduled" flag means HMO methods are always unscheduled even if they originate in scheduled context
yeah i don't know either, i will try something and i will see :D, nevermind, thank you for your help
You can remoteExec the information from HitPart to the target client but I'm not sure whether that reaches before or after the HandleDamage calls.
If it's after then you'd need to block & store the damage and then apply it later. Which is a bit crazy.
Also no direct way to identify matching hits.
i thought about this but i'm not sure how to do this, is it only like a "sethitpointdamage" ? because some seems to be that but some aren't, it seems to be general
general damage hitpoint is just setDamage
I never completely figured the difference between a selection and a hitpoint so I'm the wrong person to ask :P
oh ok but i don't think there is a "setSelectionDamage", at least i'm not able to find that function 😄
It's called setHit
oh i didn't know that, i was only using setHitpointDamage
so yeah, if you don't know the difference between them, i don't know either 🙂
It's the sort of thing that's probably obvious if you've ever made a model, so it gets completely ignored on the wiki.
Although similarly you get no definition for terms like "vehicle" or "entity".
I thought only differencece is that one uses index and other one strings 😆
nah, there can be multiple selections in one hitpoint. Also they both have strings but one of them is in czech :P
I confused two different things. I meant hitPoint and hitPartIndex like it is in handleDamage EH
Any way to make my CT_WEBBROWSER not capture mouse input when I want it to? Like it were HUD
It's a menu with notifications so when you close the menu it should not capture input but show notifications
Even though that is some kind of necro, I still thought it might be nice to know:
disableBreaks true helps with the problem. The wheels don't necessary turn right, but they are turning at least for wheeled vehicles. Didn't try with tanks though.
Considering how much time this stupid little problem has taken from me, I'd call that some kind of success 😄
I wasn't expecting tanks to work because I heard they were busted for towing, but it looks like they can be moved like this as long as you handle the lack of rolling resistance.
"Brainfart" 😄
Hey guys. In arma 3 there's an animation called "AmovPercMstpSrasWrflDnon_turnL" (and R). It makes your character shift his feet around as you rotate. I want to disable it for first person as i don't quite like it. I looked at CfgMoves but i found nothing regarding first and third person. Anyone care to help?
please mention me if you wish to reply
Hello
Im not sure if this is the right place to do this or if its allowed
I have recently had a friedn help me withmaking a mod for our unit. It mainly focuses arounding scripting and zeus actions. Unfortunately he doesnt have enough time to support this any more and it has afew errors/issues and therefore cannot be used.
Is it possible to request support from someone (i have no knowledge of code,scripting or anything zeus related) to help rework or fix the mod. I would be open to commisions ect if reuired ?
I believe that paid script making is technically allowed, but usually "buying" stuff like that is looked down upon.
I think it would be better to just talk about the issues that you're having and try to learn to fix them with the help of the community (here).
Thanks for the advice
It’s way to complex for me to learn, it’s a mod with several different functions relations to civilian spawning, Zeus modules ect
It would probably be way longer to teach me than to do it themselves 😄
But I’d be happy to honor someone’s time if it came out correctly
I mean that you ask "how do I do X" or "what's causing Y error" when you come across something that you don't know how to do, instead of "teach me everything" or "fix it all for me."
People will help you if you do something like the first example. I wouldn't expect people to do the second, so the trouble is if you have no idea what anything does or how to do anything.
There is no difference in first and third person, it never has one, so config way is almost no joy. You may want some scripted workaround
Are you sure? In arma 1 and 2, this specific animation with the same name does not occur in first person
Yea 100% understand
i think the main issue is i have almost 0 knowledge on how any of this works so i wouldnt even begin to be able to understand what to do
Yes
There's no distinction between 1st/3rd person
Then I doubt it would be worth it to learn it all for one script/mod if you're not going to do more with the knowledge.
You can ask people to do stuff for you in #creators_recruiting.
Almost 100%. At least I've never seen such feature in any RV Arma games
Take a look at this then
?
This video shows an issue with ArmA 2 3rd person animations. When you're in 3rd person and turn slightly, your body plays an animation that causes your point of aim to lag behind, which leads to many a missed shot in ArmA, sometimes in very, very bad situations. In the grand scheme of things, it could be considered relatively minor, but when you...
Still I've never seen this in my personal experience. Maybe I haven't overlooked this
But from what I know, CfgMoves etc has no such integrated first/third person something
In arma 3 there is no difference, but in 2 there is. I wish to understand what toggles this difference
precisely, so it seems
When i checked throgu the cfgmoves file, looking between the two different games' files, i only saw minor differences in the values
but trying to modify what i thought was relevant yielded no results
except that the sound of footsteps stopped playing in arma 3, as that was disabled in 2 for the animation
Maybe I'll check some investigation
The point/goal is to disable rotation anims in A3 in first person, is that all?
Yes. But for the hell of it i'd like to try to do the opposite in A2. I suppose it is a toggle of some kind so figuring out the opposite of one or the other is probably the same
Let me know if you discover anything. I'll do the same
you can probably disable the turning animations easy enough but definitely not with scripting
my guess A2 might have hard coded the turn animations to be disabled when in first person
as for example in A3, the AI do not use the turn animations either
I would guess AnimChanged to spam switchMove may achieve it
I'm pretty sure the difference is handled by the game code. there's nothing in the animation config that handles it as POLPOX said
who knows how to fix it? And this problem is only with this plane.
https://youtu.be/2q3U8rxl_Io
How does one add custom commands to the Custom menu? I know about BIS_fnc_addCommMenuItem and BIS_fnc_createMenu, but not sure how to add to that Custom menu (if it's possible).
I think... disable its simulation + small sleep + enable its simulation
I did this - it doesn't work
all other vehicles works fine
https://youtu.be/hgo9umOJ_I4
I removed the simulation, attached it to another object, put a crew in it, and added mass... nothing helps - this impulse persists. I sometimes achieved results with exact height figures, but it worked in one place - it didn't work in another.
This is just a vehicle with not right physics, there is no room to improve from SQF side
@glass nest So I can do
BIS_fnc_addCommMenuItem_menu =
[
["MenuName", false],
["Teleport", [2], "", -5, [["expression", "player setPos _pos;"]], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"],
["Kill Target", [3], "", -5, [["expression", "_target setDamage 1;"]], "1", "1", "\A3\ui_f\data\IGUI\Cfg\Cursors\iconcursorsupport_ca.paa"],
["Disabled", [4], "", -5, [["expression", ""]], "1", "0"]
];
And it adds to the Radio menu, but not sure how to add to Custom menu.
Arma 3 possible values (thanks to RCA3):
"" - means the menu is closed
"RscGroupRootMenu" Group menu root
"RscMenuMove" (1) Move menu
"#WATCH" (2) Watch menu
"#WATCH1" (2-0) Watch menu - next page
"RscMenuEngage" (3) Engage menu
"RscMenuWatchDir" (3-8) Engage menu - watch a direction
"#GET_IN" (4) Mount menu
"RscMenuStatus" (5) Status menu
"RscCallSupport" (5-1) Status menu - call support
"#ACTION" (6) Action menu Action menu
"RscMenuCombatMode" (7) Combat mode menu
"RscMenuFormations" (8) Formation menu
"RscMenuTeam" (9) Team menu
"RscMenuSelectTeam" (9-9) Team menu - select team
"RscMenuReply" (0) Reply menu
"#User:BIS_fnc_addCommMenuItem_menu" (0-8) BIS Supports
"#CUSTOM_RADIO" (0-9) Custom radio <--------------- This menu
"RscRadio" (0-0) Radio menu
"RscMainMenu" (Backspace) Main menu
I found the solution right now
_veh = createVehicle [_class, _spawnPos, [], 0, "CAN_COLLIDE"];
_buyer moveInDriver _veh;
```I noticed earlier that if you sit down, the plane calms down... I've tried planting AI, but the result is negative.
https://youtu.be/Kff-7nENyYI
try awake _veh;?
this deserves to be an ARMA'd gif 🤣
I had already given up... BUT it works! Thank you so much!
https://youtu.be/3GjlaKv2MpU
@glass nest https://community.bistudio.com/wiki/Arma_3:_Communication_Menu only shows how to add to Support submenu, not any other submenu.
If i wanted to enable them in a2, would it achieve anything if i copied the anim files and gave them a new config so i could fool the game into thinking the animations are new, making it so it won't disable them?
no
good one wiki man
Does anybody know? or shall I just make one HUD and one Dialog?
My script runs via initPlayerLocal, during which time the server has time to retrieve information from the database and perform several stages of player verification.
I added {getClientStateNumber > 9} and it didn't help.
yeah that's the way
shid
why? it's the exact same control and code, just used by different displays
I had similar issues years ago, so i just used a generous amount of sleep in a "Delayed_loading" function that gets called in initplayerlocal.sqf
uisleep 10;
waitUntil {!isNil"ExileClientLoadedIn"}; // Was a public variable set the by the server
waitUntil{player == player};
Feels dirty but it worked for every single client, because you always had some weird edge cases with the other stuff.
I actually think it needs more code behind it, because otherwise I could just handle menu closing on the JS side and make a single control instead of making two controls where I need to tell both of them same info
In that sense yeah it's a bit more complicated
I also don't know if I can keep a WEBBROWSER control not closed but inactive, invisible and not messing with the input, that way I don't have to open it over and over again (due to performance impact). But, I think that's just me being way too picky with things, I think the implementation is well coded and performs well, right? Is there any benchmark?
The implementation is not what I worry about tho, I just worry about chromium being chromium and potato PCs being potato PCs
I got to admit that I have PTSD from my Selenium days
I understand why it will work.
uisleep 10; will definitely give the player time to load, but if the player has fast memory, they will simply have a black screen for 10 seconds after logging into the server, which is not good. The variable is a good idea, but the problem is that my launch process is as follows:
initplayerlocal -> Request to the server in the database -> Return the received data to the client. That is, by this point, they are definitely already receiving all the variables, and most likely, simply adding a server variable via a public variable will not help.
Arma loading is so slow, nobody every complained in Exile. Not sure how different the loading "flow" is in your setup.
Exile was showing the loadingscreen till the last moment. But better a black screen than game breaking bugs.
Can htmlLoad be used before joining a server from within a mod?
evening guys, i remember making this work on dedicated servers, but lost my missions with the code during harddrive broke. can anybody help with a working code for dedicated servers?
[this,"STAND","FULL",{(player distance _this) < 5}] call BIS_fnc_ambientAnimCombat;
Hello, i was looking for some help.
I have multiple triggers for a zone (maybe not the most efficient, but works for me) that work as a capturable area. The capturing works only when
private _opforCount = {alive _x && side _x == east} count thisList;
_bluforcount > _opforcount```
After being satisfied for 30 seconds it does:
```hint "BLUFOR Captured the Area";
"zone1_marker" setMarkerColor "ColorWest";
zone1_captured = true; publicVariable "zone1_captured"```
There is another trigger that activates when _bluforcount > _opforcount and sets the zone1_marker color to coloryellow on a 0 second delay. This all works.
Now i have a trigger that checks the opposite: _opforcount >= _bluforcount and is set to BLUFOR Present
In the action field of this trigger i put: ```if (isNil "zone1_captured") then {hint "Opfor Holds area"};
"zone1_marker" setMarkerColor "ColorEast";```
Though when Opfor is bigger or equal to Blufor, it doesn't hint Opfor Holds Area or Change the color from coloryellow to ColorEast. Any idea how i can fix this?
Please ask any questions, i'm having a hard time explaining
short answer: You really need to stop using triggers.
Are there other options?
If so, what kind?
Im very very new to this so I make more than plenty mistakes, only here to learn
Entry point is either creating an initServer.sqf or set up CfgFunctions with a postinit entry. From there you can run whatever code you like when you like.
In this case you'd want some code that runs every few seconds, checks the unit counts within an area and changes the state accordingly.
Start with something simple, use diag_log a lot and you should make progress.
Im gonna look into CfgFunctions and Postinit, im unfamiliar
initServer is the easy one to start with.
CfgFunctions you can figure out later once you have enough code to need structure.
Well, assuming that you're writing a scenario rather than a mod.
Thats right, its a scenario
This just makes a file with the script in there?
Facing troubles to escape properly a diary record with <execute expression=""> tag:
"...
- <execute expression='call atmtkResetWeather;'>Reset initial weather</execute><br/>
- <execute expression='[\"SUNNY\"] call atmtkSetWeather;'>Sunny</execute><br/>
"
The error:
23:17:22 Error in expression <ecute><br/>
- <execute expression='[\"SUNNY\"] call atmtkSetWeather;'>Sunny</e>
23:17:22 Error position: <SUNNY\"] call atmtkSetWeather;'>Sunny</e>
23:17:22 Error Missing ]
23:17:22 File C:\Users\12345\Documents\Arma 3\mpmissions\FastAction\Fast_Action_20260126.fapovo\atmtk\diary\main.sqf..., line 69
Any idea?
Yeah, create a file called initServer.sqf and put it next to your mission sqm. It'll be executed on mission startup.
I think i've seen this once. Makes sense. Can i find how to make it do stuff for specific "zones" on the forums?
It's the same thing as you have in your trigger conditions & statements except easier :P
thisList doesn't exist. You'd do this for example:
private _bluforCount = {alive _x} count (units west inAreaArray "zone1_marker");
And thats for initserver.sqf only?
Oh wait with the edit it makes sense
yeah I forgot you were using an area.
So instead of doing it in the trigger it counts alive blufor units in the area of zone1_marker
And zone1_marker would be a trigger that triggers when anything is present
Yeah. If you want a differently sized visual marker then you can use a second one for the check instead.
No, it's just a marker.
IIRC you can use a trigger for inAreaArray but it's overkill for just specifying an area.
U are telling me it can check anything within for example a square marker
Thats so cool
I really don't need to use triggers... This is amazing
You'd run your check code in something like this:
[] spawn {
while {true} do {
// checks go in here
sleep 5;
};
};
Im processing give me a moment lol
The spawn's there to prevent it from blocking other code that you might put in initServer. It creates a "thread" of code that runs separately.
Thanks btw, makes it make more sense
And then you have while/sleep so that it does something every five seconds.
So the checks i'd have to change to only check for inAreaArray "zone1_marker"
Ah wait just like this
Was finne type that, that makes sense now
What do the [] do in this case?
^
Nothing really. spawn just needs a parameter to pass in variables. But we're not using it.
Ah alright
For some reason there's no version of spawn that takes no left-side parameter.
So it just kinda always spawns the code every 5 seconds
The spawn just runs the code in a separate thread. The while/sleep does something every 5 seconds.
Okay okay
Now leading up to the check, i would have to work with if and then stuff to do what my triggers used to.
So if (_bluforcount > _opforcount) then ??delay?? { "zone1_marker" setMarkerColor "ColorWest"; hint "BLUFOR" Captured the Area"; zone1_captured = true; publicVariable "zone1_captured"};
\" isn't the correct escape code. "" is valid in some places. I can't say what's correct without an actual code example.
See examples 7 and 8 for createDiaryRecord.
"...
- <execute expression='call atmtkResetWeather;'>Reset initial weather</execute><br/>
- <execute expression='[""SUNNY""] call atmtkSetWeather;'>Sunny</execute><br/>
"
just works!
Also im typing on my phone so my bad for it looking like shit
What you'd want to do there is create a variable, increment it each time the check was true (and zero it otherwise), and then run your switch code when it reaches a certain value.
The delay could just be {sleep 30; followed by the rest no?
No, because you want to check if the condition was true for 30 seconds, not simply delay the action.
Ah true
That makes sense, though i can't yet process how to set its value as its counting every 5 seconds.
As im typing, it makes sense.
First its the same check we discussed. After that check i simply put if (_bluforcount > _opforcount) then {"MyVariable" = 1}; for it to turn the capturing of the point to true and set off a 30 second satisfaction thing
And ofcourse on spawn i'd have it make "MyVariable" and also set it to 0
A simple example. I removed the spawn wrapper for readability:
private _count = 0;
while {true} do {
_count = _count + 1;
if (_count == 6) then {
hint "30 seconds!";
_count = 0;
};
sleep 5;
};
The variable needs to be declared outside the while loop, otherwise it will be reset each time the loop code is run.
This makes sense, though the +1 in this case confused me along with the == 6
The code runs every 5 seconds (approx) because of the sleep 5. So 6*5 = 30.
If it was a sleep 1 then you'd check if (_count == 30)
Exactly
But that wouldn't reset when false instead of true
Or is it possible to add a second if that sets _count to 0 when its false
while {true} just makes it an infinite loop. while {false} wouldn't run at all.
All of these are commands that you should look up in the wiki: https://community.bistudio.com/wiki/while
Will totally re-read all of this and try to make a script. Got a deadline of this saturday so got some time left to study
Thanks so so much for caring enough to teach me such simple stuff. Its hard only going off the Wiki because every example refers to things that are examples
Infinite brain malfunction loophole
But say its true for 15 seconds, count would be 3. How do i reset count to 0 when its not true?
Or is that also in the wiki?
nah it's just logic.
well, if/else is in the wiki.
example:
if (_bluforcount > _opforcount) then {
_count = _count + 1;
} else {
_count = 0;
};
Forgot about else, i can make that work
Yeah okay okay
I'll make the script tomorrow and add onto it as i go. Thanks so much
Hi there, I'm looking for a way to delete specific container from ground weapon holder (dropped uniform). Clearing holder's inventory via clearItemCargo works but it is deleting every item in holder, including ones I don't want to delete.
Is there a workaround for this?
Need to read all the inventory data, delete the unwanted stuff, clear groundholder and fill again i think.
Atm i can't think of any other way, but it's late. If there is another way someone else will tell you 👋
I mean I can clone this groundholder without this uniform, but it seems too complicated for such an easy task
Maybe https://community.bistudio.com/wiki/addItemCargoGlobal alt syntax works (negative count will remove items)
Never tested it
Tried this
Deleting and re-adding is better for the JIP queue anyway :P
Do you mean deleting groundholder and creating it without this uniform?
Oh, wait, I thought groundholder is removed when it is empty
I guess if you don't have anything in it except items? Not sure on the timing there though.
In that case you may as well delete it. Although adding a backpack temporarily would prevent the deletion.
No, groundholder is not deleted after clearItemCargo even if it is empty, just tested it
Anyway this way is not optimal imo because I'll need to write a lot of code to handle adding back every possible item and container
For vests and uniforms inside containers, I don't think there's any way to access their contents directly with SQF.
addItemCargoGlobal with the -1 does work on vests for me, but I don't suppose there's any way to pick which one if there are two with different contents.
Guess it is time to start writing more code to handle this workaround.
Thank you
How do i retrieve current rpt file name from scripting ?
Arma generates an .rpt log file on every run. This log file contains a lot of information like the loaded mods or any errors that appear, and can be very useful for troubleshooting problems.
To get to your RPT files press Windows+R and enter %localAppData%/Arma 3
Additionally see the Crash Files wiki page for more information.
To share an rpt log here, please use a website like https://pastebin.com/ (Set expiry time to 1 week or less) to upload the full log, that way the people helping you can take a look at it and try to figure out with you the problem you encounter.
Note: RPT logs can hold personal information relevant to your system, the game or others.
I thought i could use diag_tickTime but it doesn't match the exact datetime the rpt was created
i know what is a RPT file, i want to retrieve it from scripting
I realized after you said the second part 😅
I don't think there's any way to do that.
Well, currently i'm using current datetime - diag_ticktime - 10 secs and i check every file within the next 20 secs to find it
With a hardcoded folder path?
i'm also using an extension
Just read the wiki??? It literally says that https://community.bistudio.com/wiki/createHashMapObject
Make a second one and display it as HUD element.
Sure you can. Set its size to zero.
But its not the control that influences capturing input. Its the Display that contains the controls.
It doesn't matter what kinda control you have in there or whether its active or not.
This has nothing to do with WebBrowser really. Its just how Arma UI works
ACE mod uses htmlLoad in the main menu
No, I don't see how you'd make one
control = [] spawn crap_fnc;
waitUntil{scriptDone control};
just delete all the RPT files before you get started playing the game: then after you start playing: then go to the folder where the RPT files are: that way you don't have to guess which RPT files is the one you want: even tho the last RPT file in line is the one want
a new RPT file gets created every time you start the game and the mission
also you can delete the log files in there too: no need for them
just (don't delete any folders in there) keep the folders 🙂
Is there any way to change the side of a turret in the editor and zeus? Trying to place a CRAM but it's BLURFOR only
One Big Brain moment I can think in 0AM is: Place Praetorian without crew, put OPFOR units in it
Truly a big brain moment. Solved!
Yea...I should get some sleep
Is there a vectorDivide command?
I need to halve the numbers, I know I can just vectorMultiply 0.5 but I'm just curious if there was one since I didn't see one
use multiply indeed
Question, is there a way I can make a Advance and Secure gamemode from Squad in ArmA 3?
ArmA.. Not sure, its a very old game by now and scripting there is quite limited
But Arma 3, sure. I don't see why not. Do you have anything in mind that might not work?
I am just getting into scripting so any help is welcome, some person I know gave me a script to help me out but I don't understand what to do with it
Sorry, should have specified
Creating a whole gamemode is a large task even for somewhat experienced developers. If you don't have experience from programming/scripting, it's gonna take a good while (more than a year I'd say...?) before you'd be able to create a whole gamemode, unless you're some kind of super learner 😅
(Trust me, I have lots of experience of trying too much lol)
Well I know roughly how to make zones that are captured turn blue or red, but I am trying to make them so that they need to be captured in an order
I know scripting is hard that's why a friend managed to send me a script called node control framework by flyingtarta but I understand nothing of it, I just want zones that can be captured from 1 to 2 to 3 and so on, the rest I can figure it out hopefully.
I understand even less partly because it is in Spanish and it is not my native language
Good Afternoon everyone.
I am currently trying to make a small mod that adds an ace self interaction, but I don't know if I should do it through an SQF script file or config. I (roughly) know how to do each one, but haven't been able to figure whether to use sqf scripts or a config file
If context is helpful the overarching goal is to add an action that only appears when wearing a specific vest, the action is supposed to allow you to select the different variants of the vest and switch to them without having to go to an arsenal. Obv the variants are cosmetic only
In the end it makes no difference.
Config actions are read at mission start, and converted into script values.
Script actions are inserted as script values at mission start.
Same end result.
I guess choose whatever is more comfortable for you.
I'd choose scripts because it works also in missions, and config inheritance can get annoying
Fair enough, thanks. I will most likely come back from time to time with some questions as this'd be my second scripting project so, still new at this.
For units you can just add stuff to CAManBase and its easy enough
class Man;
class CAManBase: Man {
class ACE_SelfActions {
class YourPrefix_yourThing { ... }:
};
};
so for the condition in the config, since its "is the player wearing the correct vest?". Would require item work? Or am I looking at this from the wrong angle?
oh wait I should ask in the config channel
my bad
https://github.com/PiG13BR/Arma-3/tree/main/AAS_PIG.VR made/tweaked with some code that I found in the bohemia forum, based on Project Reality's AAS gamemode
Is there a way I can add more objectives?
you mean flags/sectors?
Yep
Do flags have to be visible? or can I keep them hidden?
yes there is, I don't remember correctly, but I think you need to add as a variable in some array in the code
it uses the default sector module, and it changes some stuff on it to work like an AAS, but nothing more than that
I see, I just need 6 objectives for it, should copy paste suffice?
https://github.com/PiG13BR/Arma-3/blob/main/AAS_PIG.VR/initServer.sqf you need to add the sectors (with var name on it) on these arrays
PIG_sectors for example
Hiya, coming back to this one. I'm kind of confused on the "while {true} do {" part of this. What exactly does true refer to in this case?
Last question, is there a way to pre set a zone being captured?
currentWestSectors / currentEastSectors
but I don't remember if it does what you want
This is exactly what im trying to make but from the ground up
Tryna learn how to make this stuff but having a stroke doing so lol
I understand somewhat, how do I put in the sector? Replace select 0 with what?
oh yeah, it took me some time to learn and fix the code
I understand that lol, i'm just now getting into making such scripts and today is my first attempt at making an initserver.sqf
It's the plain and simple boolean value true, as opposed to false.
while continues running its loop as long as the condition code returns true. As soon as it returns false, the loop exits. By setting the condition code to just true, it ensures the loop will continue forever and never exit.
while true loops can be dangerous because there's no way to stop them, but John knows what he's doing.
Thats makes sense
I don't think you need to change that
it's just telling what sector each side will be attacking first, iirc
welcome to this world lol
I'm trying to figure out where to put the while true "_count" loop in my iniserver.sqf. It should only count when _bluforcount > opforcount. Does this mean i put an while {_bluforcount > _opforcount} do { _count = _count +1; if (_count ==6) then {hint "30 Seconds!"; _count = 0; }; sleep 5; };
Its a timer of 30 seconds and if i'm not mistaking this is how it'd work?
Okay, is the trigger the cap zone in front of the sector module?
did you open the mission in your editor?
Ye
so just do the same for the additional sectors
and put an unique variable name for each
I got that, I am just asking what is the cap zone, the trigger in front of the sector or the sector itself?
the trigger
A question to add on to this, do i need only a single [] spawn { in my initserver.sqf or do i need multiple whenever setting up new checks?
Cheers
I assume i only need one and when all done in the initserver.sqf i close the [] spawn { off with };
It just makes sure that it runs when the server runs right?
If you have stuff after while {true} do {} in a single spawn, then I don't think it will ever get past the loop and on to the next thing.
So i'd have to close it off and for other checks i create a new one
I mean no i can put all the checks in the same thing
because variables and giving them values
alright yeah okay okay thanks joe
How do I change sector names?
I think it's in the module
Thanks m8, definitely checking this out!
roger that m8
@radiant lark oh and when you start looking for errors go all the way to the bottom of the RPT file: and slowly go up it makes it easier to find any errors 🙂
Usually best to search for "error in" from the top. Otherwise if your code has any depth the errors further down will be caused by earlier errors.
yes but most of the real errors are way at the bottom of the rpt file
or the user errors
most of the stuff at the top: you cant do anyhing about and it can just corn-fuse you 🙂
but yes i do see what you mean
kinda like in "Arma scripting" the error is 1 line up from where it says the error is 🙂
like when it says error on line 39 the real error is on line 38
http://feedback.arma3.com/view.php?id=27475
So apparently clientOwner returning wrong IDs is by design.
can inflame work on non simulation fire objects? like a tank?
what I am trying to do is have a tank spawn with a partcle effect playing on it
if only they used version control......
Is there an event handler for GamePaused ?
Not getter but EH?
oh no ik about that, but something that is config based like how when u spawn a campfire theres a version that is already on fire cause of the inflame script, but doing that for a tank
Not exactly what i need. I need something that triggers when the game is paused even when the player is in single player and switches window
You can handle the first part.
I don't even think there is any of such. Unless you call setDamage a solution
yes it would be the best i don't want to use waitUntil {isGamePaused}
i need something to use in a mod, not in a mission
I don't see a reason of this. You can just check it eachframe
that's true ^^
I often do it. Even some CDLCs
yeah I can try that, make a fake hitpoint and setdamage to it on spawn
Is this below a common issues? Is there a fix for this with a script? Or is it just me who is experiencing the problem?
When I pull OPFOR enemies towards the player/squad AI in Zeus, then it seems that my squad AI has issue to register the enemies correctly. For example OPFOR Ai starts shooting at me but my squad AI first does nothing and then start to aim in random directions but is not shooting at the enemy. I should mention that the OPFOR AI was cached before and then woke up close to the player.
class CfgVehicles
{
class Man;
class CAManBase : Man
{
class ACE_SelfActions
{
class SC_Test
{
displayName = "Test Action";
condition = "true";
statement = "hint 'Test action executed!'";
};
};
};
};```
So this action I'm trying to add to the ACE self interaction menu, doesn't appear in-game. I tried with a few different conditions and it just doesn't seem to work.
I guess I know the answer but does anyone know if there is a way by using a script/mod in a mission to save something to a file?
I'm trying to figure out the best way to export a mission build in Zeus so it can be shared with others.
Right now I just copy a huge string to the clipboard but that does not sound like the best solution
Writing to a file is only possible with an extension. Doesn't Zeus Enhanced offer something like that?
Copy paste huge string yes.
Have you read the ace docs yet? You can also join their discord server.
I did, I've been referencing the ACE wiki for inteaction menus
where are you adding it? description.ext?
wdym?
I mean which config?
My own
I mean config.cpp or description.ext
config.cpp
and if you go to CaManBase in config viewer do you see your action there?
let me check that real quick
From what I'm seeing, the classname for the action doesn't appear, no
CaManBase?
in CfgPaches
no CfgPatches. did you even create a CfgPatches?
Yes I did create a CfgPatches
and ace_common, ace_main and ace_interaction_menu are all there
class CfgPatches
{
class gear_variants
{
units[] = {};
weapons[] = {};
requiredVersion = 2;
requiredAddons[] = {
"ace_interact_menu",
"ace_main",
"ace_common",
"cba_main"
};
author = "Void";
};
};```
okay thats almost what I thought.
Guess it's time for me to learn how to create an extension.
thx
if you do addonFiles ["yourAddonPrefix\"] what does it give you? (replace yourAddonPrefix with your own prefix)
or fileExists "yourAddonPrefix\config.cpp" or fileExists "yourAddonPrefix\config.bin"
Do I run that in the debug console?
Question dose it matter if he didnt add A3_Data_F_Decade_Loadorder in requiredAddons so it dosent know what CAMmanBase is ?
not sure 
I figured ace or cba have that already
but you can check the RPT. if it has a config error like overriding or overwriting base class then yeah that could be the issue
The main issue with Extensions will be that they'll need to be whitelisted by BE to be used with BattlEye on.
If the mission is built in MP in Zeus, that might be the case?
Also we just a few days ago, had a conversation about a file writing extension, the code is above
They do yes
Yes
it returned false, so I guess the game just isn't seeing my config file at all
The RPT lists every pbo it loads, is yours listed?
did addonFiles return an empty array?
yep
if so the game didn't even load your addon
or that yeah 😅
Or instructions weren't followed and the correct prefix was not put in
yeah I know about the BE part thats why I tried to avoid it.
And yes my mod for that I need this is meant for SP and MP.
My issue is right exporting the data I save to the clipboard is massive (all objects + all their attributes) and even trying to create some decoder/compiler to make it shorter results in too long strings.
Is the bug on profile where rtp stops logging fixed or not i havent checked ?
Arma can now do Text compression.
But then you'd need some tool to uncompress it again which is annoying
surprisingly the RPT says yes, it is loaded. it gives me the path to my workspace folder
You might be able to find a existing file writing extension (on the old BI Forums) that might already be whitelisted
I think there was even one on Killzone kid's blog
So the pbo prefix is wrong then?
Do you know what that is?
I fixed it, but the update was not released
So no
Also that only happens later
Yeah its like a "tag" that goes before the name of everything right?
🤔
Makes me think you didn't set it correctly when the pbo was packed
Though it does not actually matter (unless it conflicts) to whether your config loads
So I can to text compression inside of SQF but cannot uncompress it there?
Or am I understanding that wrong?
And thx i'll check if I find a whitelisted extension
my $PBOPREFIX$ just says z\SC\addons\gearVariants. I'm gonna guess that's wrong
You can decompress.
See ctrlWebBrowserAction
Nah that sounds good
I guess the next question is. Does your CfgPatches entry show up in the in-game config viewer
Should've probably been the first question 😄
It doesn't seem to
I'm a damn imbecile it was staring at me the entire time, my file structure was wrong
now the test action appears, I'm sorry for wasting y'alls time
On map Dagger Island Training Complex (a great one for sure), there are many already placed pop-up targets ("TargetP_Inf_F"). I would like to prevent them from standing up after the hit + a few seconds. (manual action to reset all targets instead). How can I do this with objects placed on the map?
Thank you mates!
Trying noPop....
works.
still need help....
I want to select the already placed targets.
If I do:
("TargetP_Inf_F" allObjects 0) inAreaArray "POPUP_ZONE_1"; => returns only the objects I placed into the editor
markerPos "POPUP_ZONE_1" nearObjects 500; => returns everything
I would like to deal with an inAreaArray marker to ease the selection of which targets should be reset. How can I get the list of objects inArea?
_radius = if ((markerShape "POPUP_ZONE_1") == "RECTANGLE") then {
vectorMagnitude (markerSize "POPUP_ZONE_1")
} else { selectMax (markerSize "POPUP_ZONE_1") };
_targets = ((markerPos "POPUP_ZONE_1") nearObjects ["TargetP_Inf_F", _radius]) inAreaArray "POPUP_ZONE_1";
Dedmen can you help me with deleting all the entirety of the main menu including images and everything like just delete it all, like, make it be gone
Sounds fairly realistic to me that a squad having enemies teleported into them would have poor response :P
If for some reason you need them to act like this is normal, you could try setting their behaviour to combat and forcing reveal to 4.
okay, doing it in 2 stages, why not. I guess there is no alternative to nearObjects?
Don't know.
Why do you need him for that?
Hiding the pre-placed objects and replacing them with mission objects is another option. But I'd be surprised if that was worth doing for your case.
It's ragebait shushhhh
Lmao
true, @faint burrow workaround is better by far.
nearObjects is pretty quick anyway. I wouldn't worry about using it in general.
However you can replace this:
sqrt ((_markerSize select 0) ^ 2 + (_markerSize select 1) ^ 2)
with this:
vectorMagnitude _markerSize
is this a place to also showcase your scripts or no?
tank
I think I'm getting tunnel vision, so I'd appreciate a second pair of eyes on this particular script.
It's supposed to switch the currently worn vest with one selected through an ace self interaction prompt.
I already figured out the ACE Self Interact part. The actions are there and successfully call the function, but I believe the function itself is not working as intended.
params ["_unit", "_newVest"];
private _loadout = getUnitLoadout _unit;
private _vestLoadout = _loadout select 1;
_vestLoadout set [0, _newVest];
_loadout set [1, _vestLoadout];
_unit setUnitLoadout _loadout;
What does it do? Nothing? Removes vest?
currently it does nothing
Is newVest param correct inside the func? If you systemChat it for example?
I'm still kinda new at this, what do you mean by systemChat'ing it?
In some line after params put systemChat _newVest then do self ace interaction, and see what gray text in chatbox says
Or errors out
alright, one sec
the system chat gives me the class name of the vest its supposed to switch to
cool, yeah i think index 1 isnt actually vest, i could be wrong but
0 - primary weapon
1 - launcher
2 - pistol
3 - uniform
4 - vest
5 - backpack
6 - helmet
7 - eyewere
8 - binos
9 - assigned items
try ```sqf
private _vestLoadout = _loadout select 4;
_vestLoadout set [0, _newVest];
_loadout set [4, _vestLoadout];
alright. One sec
That did the trick. Do you mind if I screenshot that message with the index for future reference?
god forbid
i jest, go ahead, after all its public discord, dont think anyone can prevent you from screenshotting it
Eh, I prefer to ask anyhow
Copyright all of your messages!
and add disney theme, incase you need to get lawyers involved
Come to think of it, why is this not explained on wiki?
idk. if its on the BI wiki I didn't see it
its not, i checked.
Anyhow dont take it for holy, this is just from my quick glance of one of the loadouts, there could be mistakes
Yeah I'll keep that in mind. Thanks a lot!
Probably easier to use ace's new wardrobe feature
They'll handle stuff like loadouts and transferring variables for you
While that is fair, I'm also using the opportunity to learn how to make these kinds of systems. So I didn't want to use something that was "plug n' play" so to say
Cannot read htmlLoad result right?
Oh yeah... it does actually point to it, i am silly
Yeah, the array at the top of setUnitLoadout is just for syntax 4. It is poorly written.
is it possible to use the arma3 rpt while also not showing pbo errors? (aside from the mission pbo)
Im just looking to show my diag_log stuff
my server rpt has like 27k lines of bullshit
don't have a fuckton of errors in the first place ?
add a code number with your diag_log something like diag_log format ["12345"] and ctrl+f through the rpt
i know how to search for the error im looking for, I'm just asking if theres a parameter besides noLogs to help me with what I want
nope
one has to wonder why an error such as Wrong player index passed to NetworkObjectInfo::GetPlayerObjectInfo - max=0, received=1
has to be repeated a few hundred times
brace yourself, they added ammoboxes init to BIS_fnc_log
meh, it's BI logging system, diag_log is an engine command
if you look into it it's probably a diag_log format with the requested params
No. Also don't remove the Arma 3 logo or copyright disclaimer or we'll cause problems for you
Mwehehehehe it was ragebait no worries
Well to be honest I do wanna change some things so people can join the server more directly and easier. Newbies will ask how to join the server, and the OGs will ask for the IP
I'd like to fix that with a big and simple "Play Server" button
So, Arma 3 logo (credits ofc) and copyright disclaimer are what needs to be kept, right?
Fair enough
while {uiSleep 2; true} do { ... };
while {true} do { ... uiSleep 2; };
I am assuming the performance is the same for both?

||don't remove the Arma 3 logo or copyright disclaimer||
||Is it normal that the disclaimer has expired? 2025???||
Probably going to change with 2.22
yeah it was changed
I think it'll be available in next dev update (maybe prof too)
Which game is that?
What if we change the logo to operation flashpoint 
:U
Which Operation Flashpoint logo is the original one that everyone knows? I'm afraid I remember it wrong.
Operation Flashpoint 4?
Ye the one marko posted below
The child in me would lose it
Back then i didnt know arma and ofp were basically the same thing lol
I was like.... 7 years old playing in the eden editor
All the way till i was like 12
It's called Eden only since A3
Well yeah back then it was just editor but its for the new ones here for understanding 😄
But besides that, same for story for me
The 3D one is called Eden if I remember correctly
I remember just plopping like a dozen squads of west vs east and set a waypoint in the middle of desert island as i myself set up with a sniper as resistance on the north hill and took pot shots as they fought
I found it entertaining for the longest time lol
I saw a video on YouTube where someone already tried to transfer some missions from the OFP series to Arma 3.
There is entire campaign in workshop
and in virtual reality
Hey hey hey, we dont wanna infringe any copyright now?
oh my arma 3... oh holy arma 3... oh no..
||p.s. New picture||
but… why 😹
he has to constantly remind himself not to get banned
tHis ARMA INstaNCe Is noT tO BE closeD
plz stop him... ||or me?||
I almost spat out my tea laughing because I forgot that this was also in the main menu.
Maybe it would have been better to upload this to memes? Although it looks more like a local joke stemming from a question about the ARMA logo.
like it? #meme-arma message
Damn, I really want to send this image and the source code that replaces the text and images. But no one will care about that code anyway. Although, when you exit the editor, it really makes you smile.
thats actually fire
plz publish mod 😭🔥🙏
It just code... not mod
aight aight
does anybody know in which cases ctrlHTMLLoaded URL will return false?
and whether it has a request timeout
Just actually a thought.
- A button in Eden (well, a combo to be exact)
- That shows recently used Eden scenarios and select one will load it (these parts are done already on my end)
- If the selected scenario is the same with the current scenario,
- Will close Eden, go back to mainmenu, and relaunch Eden, and load the said scenario
Question is, is there any dorable solution to achieve last half part? Main blocker I can think is relaunch part, the game wouldn't know I wanted to do it before I cloae Eden. Maybe adding some script into RscDisplayMain and see uiNamespace stores the scenario name?
I noticed that exitwith has a problem with references.
I checked using diag_log
I spent 2 hours trying to figure out why my completed missions weren't deleting...
_missions = worldZonesInfo getordefault [_hashmapZoneId,createhashmap] getordefault ["ListMissions",[]];
_ArrayMission = _missions select (_missions findif {_x#0 isEqualTo _NameMission});
//_ArrayMission => params ["_Name","_fnc","_cond","_args","_NeedActivate","_Complited"];
if true exitwith {
_ArrayMission set [5,true]; //5 _Complited for ListMissions(array) element 5 not changed to true
//but if code in inside
_missions = worldZonesInfo getordefault [_hashmapZoneId,createhashmap] getordefault ["ListMissions",[]];
_ArrayMission = _missions select (_missions findif {_x#0 isEqualTo _NameMission});
_ArrayMission set [5,true]; //5 _Complited for ListMissions(array) element 5 changed to true;
};
What is supposed to happen? What is the intention?
i think he want's to remove completed missions from the list: but im not sure
I just tried it with "then". Same thing. Now I don't understand at all why the reference to the array in the array disappears
- Why if true exitWith. That makes no sense
I need to check the array references to ensure they match...
Should I send you the entire 50-line code?
I am asking the expected result and the entire intention
Okay so, what you've posted is two different cases?
@last cave what are you trying to make happen: and for what reason
seems like a lot of code for something simple: but im not sure what you want to happen: you said like 50 lines of code
can you explain more what you want to happen
Either that or boil the problem down to a self-contained piece of code that you can paste.
//I cut 110 lines of code from my script.
params ["_PositionEnd","_NameMission","_hashmapZoneId"];
_missions = worldZonesInfo getordefault [_hashmapZoneId,createhashmap] getordefault ["ListMissions",[]];
_ArrayMission = _missions select (_missions findif {_x#0 isEqualTo _NameMission});
_vehicleCargo = createvehicle ["O_Truck_02_transport_F", IDAP_SPAWN, [], 30, "NONE"];
_IsWhile = true;
while {uisleep 0.26;
alive _vehicleCargo && _IsWhile
} do {
if (_vehicleCargo distance _PositionEnd <= 20) then {_IsWhile = false};
};
if (_vehicleCargo distance _PositionEnd <= 21) then {
_missions1 = worldZonesInfo getordefault [_hashmapZoneId,createhashmap] getordefault ["ListMissions",[]];
_ArrayMission1 = _missions1 select (_missions1 findif {_x#0 isEqualTo _NameMission});
diag_log formattext ["Before Set - %1",_ArrayMission];
diag_log formattext ["Before Set - %1",_ArrayMission1];
diag_log formattext ["isEqualRef = %1",_ArrayMission1 isEqualRef _ArrayMission];
_ArrayMission set [5,true];
diag_log formattext ["After Set - %1",_ArrayMission];
diag_log formattext ["After Set - %1",_ArrayMission1];
diag_log formattext ["isEqualRef = %1",_ArrayMission1 isEqualRef _ArrayMission];
};
/*
result
3:52:15 Before Set - ["str_WZC_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy_Condition",[20262.1,8802.24,0],false,false]
3:52:15 Before Set - ["str_WZC_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy_Condition",[20262.1,8802.24,0],false,false]
3:52:15 isEqualRef = false
3:52:15 After Set - ["str_WZC_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy_Condition",[20262.1,8802.24,0],false,true]
3:52:15 After Set - ["str_WZC_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy_Condition",[20262.1,8802.24,0],false,false]
3:52:15 isEqualRef = false
*/
Oh, you're expecting those to refer to the same object?
Your getOrDefaults are returning a default value but they're not setting it in the hashmap. You need the third parameter for that.
Otherwise you're just creating a new hashmap or array and throwing it away afterwards.
I just checked. After some time during code execution, the reference gets deleted and the array becomes a duplicate.
hashMap getOrDefault [key, defaultValue, setDefault] <- see setDefault.
//I cut 110 lines of code from my script.
params ["_PositionEnd","_NameMission","_hashmapZoneId"];
_missions = worldZonesInfo getordefault [_hashmapZoneId,createhashmap] getordefault ["ListMissions",[]];
_ArrayMission = _missions select (_missions findif {_x#0 isEqualTo _NameMission});
//ADDED THIS
_ArrayMission set [5,true];
//ADDED THIS
_vehicleCargo = createvehicle ["O_Truck_02_transport_F", IDAP_SPAWN, [], 30, "NONE"];
_IsWhile = true;
while {uisleep 0.26;
alive _vehicleCargo && _IsWhile
} do {
if (_vehicleCargo distance _PositionEnd <= 20) then {_IsWhile = false};
};
if (_vehicleCargo distance _PositionEnd <= 21) then {
_missions1 = worldZonesInfo getordefault [_hashmapZoneId,createhashmap] getordefault ["ListMissions",[]];
_ArrayMission1 = _missions1 select (_missions1 findif {_x#0 isEqualTo _NameMission});
diag_log formattext ["Before Set - %1",_ArrayMission];
diag_log formattext ["Before Set - %1",_ArrayMission1];
diag_log formattext ["isEqualRef = %1",_ArrayMission1 isEqualRef _ArrayMission];
_ArrayMission set [5,true];
diag_log formattext ["After Set - %1",_ArrayMission];
diag_log formattext ["After Set - %1",_ArrayMission1];
diag_log formattext ["isEqualRef = %1",_ArrayMission1 isEqualRef _ArrayMission];
};
/*
result
3:59:06 Before Set - ["str_WZC_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy_Condition",[20262.1,8802.24,0],false,true]
3:59:06 Before Set - <null>
3:59:06 isEqualRef = bool
3:59:06 After Set - ["str_WZC_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy","WZC_fnc_Humanitarian_convoy_Condition",[20262.1,8802.24,0],false,true]
3:59:06 After Set - <null>
3:59:06 isEqualRef = bool
*/
If the 5th element in my array is true, then the array is deleted by another script. (My logic in the system)
I already have a key and a value. I'm entering a default value so I don't get lost in variable types in the future.
Now the only option for my logic to execute correctly is to get an array with these two lines everywhere and immediately execute Set.
I have a suspicion that the reference to the array changes when I update any data in the hashmap.
Because if you immediately execute set after receiving the array, then the reference remains correct.
I'd need a replication case. So a sample of the input data, at least.
You're only setting into an array value within a hashmap, which normally works fine.
It will be difficult for me to show this because I have too many external factors in the mission that I can miss.
If that's true then it might be those external factors that are the problem.
If you can't replicate by building a couple of hashmaps manually.
Now everything works correctly when I moved the array definition right before the set.
yeah, so you have a createVehicle in the middle. createVehicle is slow, so other scripts may run between the two halves.
Let's say you have something else running that's modifying those arrays, accidentally or otherwise.
i cant send message
Clyde Bot stoped me...
p.s. I just separate message and this work..
Client Call mission
params ["_idZone","_SelectedMissionStr"];
_nameCountMissions = worldZonesInfoStatic getordefault [_idZone,createhashmap] getordefault ["missionszone",[]];
_id=_nameCountMissions findif {_x#0 == _SelectedMissionStr};
(_nameCountMissions select _id ) params ["_Name","_fnc","_cond","_args"];
_r =worldZonesInfo getordefault [_idZone,createhashmap] get "ListMissions";
if (_r findif {_x#0 isEqualTo _Name} == -1) then {
_r pushbackunique [_Name,_fnc,_cond,_args,true,false];
};
server check
#define HASHOBJECTINFO worldZonesInfo
while {uisleep 0.5;true} do {
_WithMissions= _a select {HASHOBJECTINFO getordefault [_x,createhashmap] getordefault ["ListMissions",[]] isnotEqualTo []};
{
_IdCurrentZone=_x;
_nameZone = worldZonesInfoStatic getordefault [_IdCurrentZone,createhashmap] getordefault ["name",_IdCurrentZone];
_missions=HASHOBJECTINFO getordefault [_IdCurrentZone,createhashmap] getordefault ["ListMissions",[]];
{
_x params ["_Name","_fnc","_cond","_args","_NeedActivate","_Complited"];
if _NeedActivate then {
_x set [4,false];
[_args,_Name,_IdCurrentZone] spawn (missionNamespace getvariable _fnc);
};
if _Complited then {
_missions deleteat (_missions findif {_x#0 isEqualTo _Name});
};
}foreach _missions;
}foreach _WithMissions;
....
spawn (missionNamespace getvariable _fnc);
params ["_PositionEnd","_NameMission","_hashmapZoneId"];
_missions = worldZonesInfo getordefault [_hashmapZoneId,createhashmap] getordefault ["ListMissions",[]];
_ArrayMission = _missions select (_missions findif {_x#0 isEqualTo _NameMission});
_vehicleCargo = createvehicle ["O_Truck_02_transport_F", IDAP_SPAWN, [], 30, "NONE"];
_IsWhile = true;
while {uisleep 0.26;
alive _vehicleCargo && _IsWhile
} do {
if (_vehicleCargo distance _PositionEnd <= 20) then {_IsWhile = false};
};
if (_vehicleCargo distance _PositionEnd <= 21) then {
_ArrayMission set [5,true];//lost reference and _Complited = false
};
But this work correct
params ["_PositionEnd","_NameMission","_hashmapZoneId"];
_vehicleCargo = createvehicle ["O_Truck_02_transport_F", IDAP_SPAWN, [], 30, "NONE"];
_IsWhile = true;
while {uisleep 0.26;
alive _vehicleCargo && _IsWhile
} do {
if (_vehicleCargo distance _PositionEnd <= 20) then {_IsWhile = false};
};
if (_vehicleCargo distance _PositionEnd <= 21) then {
_missions = worldZonesInfo getordefault [_hashmapZoneId,createhashmap] getordefault ["ListMissions",[]];
_ArrayMission = _missions select (_missions findif {_x#0 isEqualTo _NameMission});
_ArrayMission set [5,true];//not lost reference and _Complited = true
};
I also have another script that checks in a loop whether there have been changes in the hashmap.
#define HASHOBJECTINFO worldZonesInfo
//Part of the code responsible for the update
//Update in a loop every second
if (_OldWZInfo isnotEqualTo HASHOBJECTINFO) then {
if is3denmultiplayer then {
SystemChat format ["Update hashmap %1 ",time];
};
_OldWZInfo = +HASHOBJECTINFO;
MNSSet ["worldZonesInfo",HASHOBJECTINFO,true];
};
Yeah you have no sequencing control in there. Looks scary.
It's just spawn-spam in the middle of a half-second loop.
Well, actually,
_OldWZInfo isnotEqualTo HASHOBJECTINFO is executed only once when any value has changed. And I have 40+ keys there, each containing hashmaps with their own keys.
It looks scary, but there are absolutely no performance or network issues. However, as it turns out, references don't always remain the same over time.
I tested it on a dedicated server. The code has executed correctly 10 times already, even with my other scripts that handle changes and loops.
hey does anyone here do SQF work on linux? what does your dev env look like because the SQF plugin is not available for the open source version of vscode
doesn't hemtt's linter work on linux?
it might, pretty sure its written in rust so its platform agnostic
does it also do syntax highlighting? thats my big problem atm
Maybe you can pull the language JSON out of an extension? I assume it has some sort of language support...
I'm wondering, is there an EVH that is triggered on a player when you enter Zeus/Curator?
(I'm trying to get the Curator object/module that way so I don't need to look for all Curator modules every few seconds in case a new one gets added, etc)
For what it's worth, ACE and Zen do both have server-side event handlers for when curator objects are added.
I don't think there's a specific EH for entering the zeus UI though.
Can't even think of any camera or display opened event that you could fudge.
hmm, I figured it wouldn't use that, but it seems plausible.
You also can add onLoad event handler.
Only in config, right.
You could add onLoad to a loaded display but that wouldn't get you anywhere.
I'm looking at it but I don't seem to understand how I use that on a player to trigger only when the Curator Display is opened
There are examples on this page under "Scripted event handlers": https://community.bistudio.com/wiki/GUI_Tutorial#BIS_fnc_initDisplay
If you don't know the classname of the curator then just log the value and you'll find it.
[
missionNamespace,
"OnDisplayRegistered",
{
params ["_display", "_class"];
if ((ctrlIDD _display) != _zeusDisplayIdd) exitWith { }; // or _class != _zeusDisplayClass
hint "Zeus UI opened!";
}
] call BIS_fnc_addScriptedEventHandler;
If it doesn't work, then:
[
missionNamespace,
"OnDisplayRegistered",
{
params ["_display", "_class"];
if ((ctrlIDD _display) != _zeusDisplayIdd) exitWith { }; // or _class != _zeusDisplayClass
_display displayAddEventHandler [
"Load",
{
hint "Zeus UI opened!";
}
];
}
] call BIS_fnc_addScriptedEventHandler;
Ahh I see.
but if I understand it correctly (it's been some time since I last worked with EVHs) since this is running in missionNamespace, when the event is triggered I only know that someone opened the Curator interface but I don't know who, since I just get the display and the classname.
Is that correct?
It's local EH, it only triggers on player's PC.
That event will trigger locally on clients that open a variety of BI interfaces.
So first you figure out the zeus IDD or classname and then you install the EH from initPlayerLocal or whatever.
ah okay, got it.
Thank you
I am creating a customRadioChannel "hotline", and I am thinking about implementing a throttling/flood protection mechanism. I can go manually with an event storing the number of messages sent with a limit, and spawn a delayed job to decrease this number a few minutes later... do you have recommendations/existing stuff to do it?
FYI results from comparing selectRandom array vs array select floor random count array array having 15 elements:
selectRandom: 0.00480041 msarray select floor random count array: 0.00789795 ms
HandleChatMessage + track the number, waitandexecute to decrement it, waitandexecute to delay it if you're past the limit
a 60% speed increase was noted in favor of selectRandom
Sweet
Very niche thing. Don't spawn it though, use cba wae
what's throttling/flood protection mechanism
is that like limit the amount of traffic i guess
yep
I create a customRadioChannel to ease the communication betweens players facing issues and myslef, if they need a TP or whatever.
is empty string considered a valid key for hashmap?
yea i think it does but i just thought its unwanted situation...
yes
Why? Empty string is valid string value
ya but do you ever really want that
depends what you're doing. but you can use it to have a default for something. e.g. if you were caching config classes of vehicles but you wanted to support vehicles without a type like super simple objects. (but for most purposes you can use getOrDefault)
ok, ty
I forget, is there a way to block vanilla grenade throwing?
Iirc ace sets the ammo to 0, but I was wondering if there was a more "direct"/easier way I guess
I've not run into one. Generally if ACE is using a hack then there isn't a good way.
That's what I assumed
Just a quick question, is the mission namespace local to each client if variables aren't passed globally? Some of my tests have shown this to be true while working on my framework
Yes.
Bear in mind that publishing a variable (eg. with publicVariable) is a one-shot operation. If the variable changes later then that change won't be published unless you do so explicitly.
https://github.com/intercept/intercept <-- we've moved to a Github organization account for Intercept.
EachFrame + currentThrowable + setWeaponReloadingTime
That also works
```sqf
NoGrenadesForYouEH = addMissionEventHandler ["EachFrame",
{
player setWeaponReloadingTime [player, (currentThrowable player #1), 0.01];
};
```sqf
//KeyDown on 46 display
params ['','_key','_shift','_ctrl','_alt'];
private _c = FALSE;
_controledUnit=focuson;
if (_key in ((actionKeys 'Throw') + (actionKeys 'Put'))) then {
if (isNull (objectParent _controledUnit)) then {
if (!(unitIsUav cameraOn)) then {
//SYSTEMSCRIPT_fnc_IsInbase my script check InArea
if ( ([_controledUnit] call SYSTEMSCRIPT_fnc_IsInbase) ) then {
50 cutText ['Grenade not allowed!','PLAIN DOWN'];
_c = TRUE;
};
};
};
};
_c;
Still functionally the same thing, you need to constantly watch it and then set X thing
There you don't have to worry about setting the ammo back at least though
I have no idea why you're posting this video or what's supposed to be of any interest in it.
propaganda video
joking
This is a chat translation video.
Does hacking a UAV just put a friendly UAV unit inside the hacked UAV?
And secondly, is AI targeting determined by the side of the AI that is currently in the drone?
Yes. I forget exactly what it does with enemy UAVs (as against empty ones), but you end up with a friendly AI in there.
I suspect it just does delete vehicle for each crew of the UAV or something.
I helped a friend make a script to fold the props on his new UAV and had to figure out a way to make it unusable whilst the props are folded so I just deleted the crew, and when it gets unfolded it creates the crew defined in config
But I didnt know if there was a way to make it "unhackable"
Reason being, when you empty the crew and the unit is a UAV operator, it gives them an option to hack it while the props are folded, essentially bypassing the safeguard to prevent it from flying while in folded position
Cant seem to figure out a proper solution for that
Is there a limit on how much can be saved "in-memory" on the client or server? (i.e. when you set variables and add data to them) Just wondering because atm the framework I'm working on uses the server as a hot cache, and a redis database as cold storage, only reading and writing to the db on player connect/disconnect or when triggered to do so.
IIRC saving data as JSON can drop the amount of memory needed to save the variables by two orders of magnitude (e.g. from 100 Mb to ~1 Mb) (!)
Of course, not everything can be (easily) serialized, but it can be avoided with relevant code/data architecture
Although you might want someone else to confirm the above
At the moment I'm using hashMaps
Is there a way to pull a list of classnames for rifles that support all of muzzle + rail + scope attachments?
If you think about it, every function is a variable. Each variable is stored in memory. In the mission I'm working on we have nearly 1000 functions that range from 30 lines to thousands of lines, along with a bunch of variables storing a metric fuckton of values at any given time. (About 8GB of RAM usage according to Resource Monitor https://i.imgur.com/fRP4CDX.png)
Unless you're storing gigabytes of data on client or server, or megabytes of data over the network, I wouldn't worry too much about it
Is there a form of findIf that returns an array containing all indices where the condition is true?
This code is only deleting the first matching object and ignoring the rest of the items in _nearbyEntities that should be removed.
Or do I have to do it a messy method with a for loop?
Looks like Syntax 6 of select might do it
What exactly it does mean? Find all accessories on a weapon or a weapon that does accept every accessories?
Even if it doesn't exist?
What do you mean?
For a given attachment classname, return all weapons that can accept it on a rail?
Actually that would work too
Literally. Even in vanilla games there are some accessories that is exclusive to a certain weapon
Then https://community.bistudio.com/wiki/compatibleItems#Alternative_Syntax ?
I read that backwards, but it still sounds like it could be what you want?
Actually now that I think about it, that will probably work even better than what I was picturing, thanks
There's also compatibleWeapons, which is likely what I actually need
So then I think I'd just need to use it for a common item from each attachment slot and arrayIntersect them together
select syntax 6
well to be precise that gives you an array of elements where it returns true, if you specifically want indexes there isn't a built-in command to my knowledge, but you can either do find on each of those on the original array OR use the "apply" command to validate the condition and then output the index
latter's the better option
ah thats the new problem i ran into, I thought select syntax 6 gave indices but nope, that solves one problem that I just had
Does anyone have anything that may be useful in finding the end location of a particle effect (I.E. drop command)? I imagine there's some sort of math that makes it possible, just not very math smart 
I set the velocity far, so it's landing position is roughly probably 10-15 meters from it's starting position.
getPos it
If you are using onTimer scripts within the particle, you can actually execute code exactly where the particle dies to find its final getPos.
Asked Gemini and checked, sounds plausible
https://community.bistudio.com/wiki/ParticleArray#Global_Parameters
It's not bad with Arma 3, which surprises me if remember my tests with ChatGpt before 😆
You want the one below that, beforeDestroy
I guess "path to script" is a file path? Janky if so, hopefully it's cached.
It's kinda funny, I haven't brought anything like that up here because I know it's a hot take and this channel is here to learn; but it is kinda insane quite how much advancement there has been in AI. For SQF it still generates slop (nested if statements, unnecessary error checks, etc) but by guiding it to use better code, it is actually pretty effective. For UI creation, I was especially impressed. Was able to create me an entirely working controls group with radio, slider, etc.
Kinda takes the joy out of cooking it yourself, but as a tool it is useful
yeah they've been grinding through the githubs.
It's trash but it's plausible trash now :P
I used it a couple of times for math, because I suck at math, and with lots of patience it worked out.
For this example I still used ChatGPT which was rather painful but still worked out at the end 
https://github.com/ELRabito/ExileReverseEdenConverter
But if i try Gemini or so nowadays you already feel the advantages, doesn't make up commands anymore from other languages etc.
From https://community.bistudio.com/wiki/Particles_Tutorial
```sqf
drop [
["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 0, 8],
"", "Billboard", 1, 3, // animationName, type, timerPeriod, lifeTime
[0,1.5,0], // position relative to referenceObject
[0,0,0], // velocity
0, 0.005, 0.003925, 0.1, [0.25, 0.75], // rotation, weight, volume, rubbing, size
[[1,0,0,0.5], [0,1,0,1], [0,0,01,0.25]], // colors
[1], // animationPhase
0, 0, // randomDirectionPeriod, randomDirectionIntensity
"", "", // onTimer, beforeDestroy
player // referenceObject
];
Looks like you can add the path to the scripts (onTimer / beforeDestroy) directly into the drop command.
Huge, I bet that will work. Ty guys
🫶
When i use #(rgb,width,height,mipCount)ui("displayClassName","uniqueName","texType") how do i get the safezone of this area ?
I think I would ask for your origin of this question, why you need to do that?
What the hell are you doing to have almost 1000 functions and at least one file that's thousands of lines.
Altis Life - A server that has probably seen more developers than I have women, and has been around since 2013
Been slowly optimizing and removing functions, but it has them...
There's a few files that are nearing 5000 lines... Which I want to remove, but I dont really wanna touch due to being cancered every time I try
Been developing for this server for over 5 years at this point, mainly only added for Anti-Cheat measures, optimizations, and system reworks, but thanks lmfao
lol @old owl
Blessing because you usually have something for anything, but also a curse as there is so much stuff that would just be too much effort to rework 🥹
I've noticed a problem with lifeState. It seems to not sync quickly such that if a player becomes incapacitated through setUnconscious, it can take several seconds if the player is far away. Has anyone seen something like this?
I want to show displays on textures and i want theses displays to be animated. The problem is when i want to place a control using safezoneX and safezoneY, the control doesn't go the correct location because its using the screen Safezones
Trying to script either DBO or Libertad to allow AI to ride them or simulate riding them and also allow them to shoot rifles. Using the car seat mod as well for the "saddle". I've got a working comp going from a workshop listing, but it breaks on my dedicated server and gravity affects the seat and breaks the composition. Not familiar with scripting so would love some advice if possible
If you're placing this composition with Zeus, you'll probably need to turn on the server setting that allows Zeus-placed compositions to run scripts.
If you're not placing it with Zeus then 🤷 it's probably just written wrong (not too surprising for a workshop composition) but not really possible to fix without seeing the code
It works in editor and SP zeus so I'm imagining it works
I assume "them" means some kind of horse-like creature
I'll show more later and I'll have to figure out how to enable Zeus comp scripts on my server
Forgot to update, but worked like a charm. Cheers @sharp grotto and @granite sky 🙂
Appreciate both of your help!
Yeah it's a mounted rifleman on a horse
Working on converting a module from using an Attribute-defined area to a Module Area defined area, as shown below between the commented section and boxed section. This works as desired when the module is placed in 3DEN. However, when placed in Zeus, these default parameters are ignored and it uses the fallback 0/0/0 as defined in my code. Any insight? I'd like the Zeus placed version to read whatever default is in the module, as I have some child class versions with radius presets via modified AttributeValues class.
I think I would do _logic isNil "objectArea". If it's not nil, use that; if it is nil, do a config lookup on the module and get those values to use
_size = getArray ((configOf _logic) >> "attributeValues" >> "size3");```
that does not appear to be an option for me
no mention of zeus in my server config
unless i just add the line myself
You need to add it
Any settings not explicitly defined will use the default value described on that page
You can also do this in description.ext if you only want to enable it for a specific mission, rather than any mission played on the server
This was the backup I thought of to try when I get out of bed tmr, thanks for the ideas!
it didnt work. Do i need to add it somewhere specific?
I might not understood the situation correctly, but isn't it just x=0 y=0?
hmmm not sure, i'll try to see the result
Hey guys, I am pretty sure it already exists, so are you aware of some extension to deploy PBO on a remote dedicated server on a OnMissionExportMP 3DENHandler?
The goal is to read some config file (like YAML) in the profile of the user to read information like HOST/PORT/USER/PASSOWRD/SSHKEY/REMOTE_LOCATION so that the exported mission is pushed automatically. I am a bit stuck with C# extension implem, despite the good sample we can find on the web, so wanna check if it already exists.
What if you wrote just a batch (or even Powershell) script? Make it monitor the folder that contains the exported PBOs and copy the files to the remote location when it detects a new mission file
I guess it could monitor the last edit to a file too (if you're editing already existing mission)
Cause it is even better to trigger it on the export event.
Or monitor even a hash of a PBO, that would cover all cases
Make it check the current situation every second?
I am pretty sure someone did it. Of course we could implement something from the outside
To avoid that kind of implement.
I would imagine it would be much less effort with the monitor script
The triggering is not an issue. I mean it is very ok in term of difficulty ^^
I am doing SQF stuff in the deploy.sqf, but also a call to an extension like:
very easy, no need external crappy bash running all the time on your PC, or not started when you need it.
You could make it a Windows service if you don't want to run the script when you start making changes to the mission(s). But sure, if you want to go the extension route, why not. Though, where exactly do you need help with the extension?
The only thing that take more than a few minutes is the implem of the DLL, there are samples for many languages, so I may sort it out.
But before reinventing the wheel, since it is a very useful feature, I wonder if a mod does not exist yet.
I think I will go with that C# sample: https://github.com/blake8090/arma-extension-dotnet/blob/main/src/Main.cs
Just to be sure, here is where I put my function and its implem?
I could have another if (func == "HelloWorld") and callback.Log("Hello world!"), right?
I am not a C# + extension addict, sorry.
Not 100 % sure since I've written extensions for legacy stuff only (with no callbacks in Arma 2), but A3 does have callback functionality. Also if the extension fails with any reason, it will crash your game, so personally I'd wrap the whole stuff into try-catch block
It is quite ok, here it is in Eden.
I mean I don't think there's a reason to not to wrap it with try-catch since the performance hit is so small that it's not relevant in any way. But anyways, it's up to you to decide the extension code structure. You're free to do what you want between getting the data from the game and sending a result to the game
Indeed, the C# code will be safe, it is not a point to be discussed. My point was "don't care about performance", so ya, try catch, retry, network slowlyness... Just don't care in the export mission context
It depends on the approach, do you want a fire and forget, the extension to send data back to a function, or send an immediate response with/without data?
I will wait for the answer with a timeout. It is quite ok to wait a few seconds in that context.
Timeout to be defined into the config file.
I used the same dotnet repository you mentioned above, if you'd like I can send you a link to my source code of my ramdb mod for you to look through
Thanks a lot 🙂
In Eden, I know nothing better than systemChat to log info, I guess that we cannot send notifications as the green bar when we save the mission? Found nothing in Eden functions ...
you mean like this https://community.bistudio.com/wiki/Arma_3:_Eden_Editor_Event_Handlers#OnMissionSave ?
Yep. The temporary notification just below the menu bar...
oh you mean this? ["test",0,5] call BIS_fnc_3DENNotification
With the following snippet of code, spawning certain helicopters (A3 Littlebird, RHS chinook) results in them exploding immediately. Other objects such as light or tracked vehicles are fine.
Objects are created initially using createVehicleLocal during local placement mode. Then a script is remoteExec called on the server to build the actual object globally. _position is fetched from getPosATL on the local object. _dir comes from getDir and _vectorUp is vectorUp of the local object. The local object is deleted before the server-side call
Is there anything here that might hint as to why helicopters experience this issue? Have I ordered things incorrectly or is there an additional step required?
```
params[
["_className", "", [""]],
["_position", [], [[]]],
["_dir", -1, [-1]],
["_vectorUp", [], [[]]]
];
private _vehicle = createVehicle [_className, zeroPos, [], 0, "NONE"];
_vehicle allowDamage false;
_vehicle enableSimulationGlobal false;
_vehicle setDir _dir;
_vehicle setPosATL _position;
_Vehicle setVectorUp _vectorUp;
_vehicle setDamage 0;
_vehicle allowDamage true;
_vehicle enableSimulationGlobal true;
you can try https://community.bistudio.com/wiki/findEmptyPosition but idk how good that is. createVehicle should get free pos but maybe its buggy?
I'll record a small video shortly to demonstrate the issue. This is managed via a build system similar to Zeus so I'm pretty confident the area is clear. What I'm unsure about is whether it's a collision box issue with the ground
The simple thing to try might be to use vectorAdd to adjust the target position upwards by a few centimetres
Unfortunately, with vectorAdd, the Z value needs to be so high that the helicopter starts roughly 0.5-1 meter off the ground before dropping down. Anything lower results in an immediate explosion
if you're calling the script from the scheduled environment it's not doing what you think
it creates the vehicle, pauses, then disables damage in the next frame. by then it's already exploded
you must wrap it in isNil. there's no need for disable damage at all.
```sqf
params[
["_className", "", [""]],
["_position", [], [[]]],
["_dir", -1, [-1]],
["_vectorUp", [], [[]]]
];
isNil
{
private _vehicle = createVehicle [_className, zeroPos, [], 0, "NONE"];
_vehicle setDir _dir;
_vehicle setPosATL _position;
_Vehicle setVectorUp _vectorUp;
};
if you want to return the vehicle too, just declare it outside the scope private _vehicle = objNull;
```sqf
params[
["_className", "", [""]],
["_position", [], [[]]],
["_dir", -1, [-1]],
["_vectorUp", [], [[]]]
];
private _vehicle = objNull;
isNil
{
_vehicle = createVehicle [_className, zeroPos, [], 0, "NONE"];
_vehicle setDir _dir;
_vehicle setPosATL _position;
_Vehicle setVectorUp _vectorUp;
};
_vehicle
That makes sense, thanks for that. I'll test and see how it behaves
I've seen that with setMass. The game doesn't seem to put much importance on some pretty important variables.
I guess this is why enemies are inclined to magdump unconscious players if you don't also use setCaptive.
As an alternative, I have switched remoteExecCall with remoteExec to go from scheduled to unscheduled. That has done the trick, thank you. This may also explain why the behavior was happening intermittently in that it would look fine for maybe 1-2 attempts before exploding again on subsequent retries.
Interestingly, scripts from other missions that I'm referencing all run in the scheduled environment and invoke functions in a similar order but I am working exclusively with PosATL so I wonder if that's a contributing factor
In fact, my thinking is the other way around with regards to remoteExecCall/remoteExec. I've gone the other way, so my original script was originally being called in the unscheduled environment
Creating with "NONE" does tend to place the vehicle a short distance in the air, which works around some potential explosions.
but I don't know why delaying the setPos/setDir would ever help.
I am working exclusively with PosATL
I don't know where you get the pos from. in general ATL is fine but if you try to translate it to another place it stops making sense. I recommend AGL or ASL
. I've gone the other way, so my original script was originally being called in the unscheduled environment
it's best not to rely on this and force the environment yourself like I showed (using isNil) when you want something to happen "atomically" (without interruption)
remoteExecCall is supposed to do that
The strange thing is that the issue still occurs even with the script now set to
```
isNil {
private _vehicle = createVehicle [_className, zeroPos, [], 0, "NONE"];
_vehicle setDir _dir;
_vehicle setPosATL _position;
_Vehicle setVectorUp _vectorUp;
if(_buildType isEqualTo BUILD_TYPE_SECTOR) then {
_vehicle setVariable ["KPLIB_storage_type", 1, true];
} else {
[_vehicle] call KPLIB_fnc_addObjectInit;
[_vehicle] call KPLIB_fnc_clearCargo;
};
if(unitIsUAV _vehicle) then {
[_vehicle] call KPLIB_fnc_forceBluforCrew;
};
if(_buildType != BUILD_TYPE_BUILDING) then {
_vehicle addMPEventHandler ["MPKilled", {_this spawn kill_manager}];
{ _x addMPEventHandler ["MPKilled", {_this spawn kill_manager}]; true } count (crew _vehicle);
};
}
The only solution so far has been to change `remoteExecCall` to `remoteExec` to go from unscheduled to scheduled. Once the vehicle is spawned it starts slightly in the air and lands on the ground thus preventing the explosion (in line with what John said)
Can you replicate this outside kplib?
I'm always interested in exploding vehicles :P
Not really. I've created a new blank mission in the editor and have attempted a series of createVehicle commands with various helicopters that explode in KPLIB, but they spawn as normal
might be some sort of double-spawn issue then.
Here's a video that demonstrates the issue - currently processing in 4K
https://www.youtube.com/watch?v=Fs95f71fLfg
I'm using the onMouseMoving UI event with screenToWorld to set the local object position during the usage of a build system. (https://github.com/ColinM9991/KP-Liberation/blob/2c8e9a77b15e1409ee903ab8a019e362aad5cd2e/Missionframework/scripts/client/build/fnc/fn_build_handleMouse.sqf#L106)
When the confirm button is clicked then some values are pulled from the local object (position, direction and vectorUp) before deleting that object and subsequently building the object on the server with createVehicle
- https://github.com/ColinM9991/KP-Liberation/blob/2c8e9a77b15e1409ee903ab8a019e362aad5cd2e/Missionframework/scripts/client/build/fnc/fn_build_confirmBuild.sqf#L39
- https://github.com/ColinM9991/KP-Liberation/blob/2c8e9a77b15e1409ee903ab8a019e362aad5cd2e/Missionframework/scripts/client/build/fnc/fn_build_confirmBuildServer.sqf#L43
- https://github.com/ColinM9991/KP-Liberation/blob/feature/build-system/Missionframework/scripts/client/build/fnc/fn_build_buildItem.sqf
Wait, what's the one you're waving around? Separate createVehicleLocal object or something?
You probably need to wait a frame after deleting those. deleteVehicle isn't instantaneous.
They're both createVehicleLocal at the point of being in this interface
I was wondering whether I should enumerate all local items first, push the classname, position and vector into an array, delete the local vehicle, then enumerate the data array to later build the objects. As createVehicleLocal and createVehicle will be behaving in the same way while I'm testing in the editor.
With that said, this issue also occurs on my server in which I am the client and my createVehicleLocal objects shouldn't be present on the server
oh, it creates on the server. huh.
pulled from the local object
I think it's related to how you use dir and up
just use vectorDir and vectorUp not getDir. and set them at once using setVectorDirAndUp
yeah plausible, given that the angles here are not necessarily close to level :P
also you should first set the dir and up, then set position
because the position you got was obtained post rotation
I shall take those recommendations on-board and test
(or use getPosWorld and setPosWorld not get/setPosATL or get/setPosASL)
```sqf
params[
["_className", "", [""]],
["_position", [], [[]]],
["_vectorDir", [], [[]]],
["_vectorUp", [], [[]]]
];
private _vehicle = objNull;
isNil
{
_vehicle = createVehicle [_className, zeroPos, [], 0, "NONE"];
_vehicle setVectorDirAndUp [_vectorDir, _vectorUp];
_vehicle setPosWorld _position;
};
_vehicle
I've noticed that getPosATL/getPosASL and setting result in the object moving forward slightly, so that also makes sense with regards to set/getPosWorld
yeah for perfect translation always use getPosWorld/setPosWorld
I use PosWorld in another part of the mouse handler to raise/lower the object
The proposed changes have been applied (https://github.com/ColinM9991/KP-Liberation/commit/4cbd3ea797c4936a0b6bbba1da1303388b99084d) but with no success
It seems the reason why it's intermittent is due to the terrain at different points. A helicopter will explode on certain spots but not on others
but aren't you spawning it exactly were another heli was before?
what if you add a slight shift? _vehicle setPosWorld (_position vectorAdd [0,0,0.1]);
Is there any easy way to see if a vehicle can fire right at this moment?
https://community.bistudio.com/wiki/canFire found that 😄
Look what it does...
wiki says "Returns true if the given vehicle is still able to fire."
"The only way to obtain a canFire "false" is to make the crew disembark"
oh guess not then, sounds like buggy command
2018, not necessarily current
It still says true when there's no ammo so it's not useful anyway.
I found an issue with the drop command
https://community.bistudio.com/wiki/drop
when trying to drop a particle with space object parameters using a custom model (one that comes from a pbo, and is binarized and properly registered and can be spawned with createvehicle/createobject normally) the particle doesnt spawn. The resulting object is objNull
For example
drop [["\path\to\custom\model", 8, 4, 1], "", "SpaceObject", 1, 1, [-3.5 * (sin (direction xural)), -3.5 * (cos (direction xural)), 0], [random 0.1, random 0.1, random 0.5], 1, 0.005, 0.0042, 0.7, [0.3,3], [[0.5,0.5,0.5,0], [0.7,0.7,0.7,0.5], [0.9,0.9,0.9,0]], [0,1,0,1,0,1], 0.2, 0.2, "", "", xural];
Only if drop is repeatedly called multiple times within a short time span will the object eventually spawn on one of the subsequent tries (I put it inside of a for loop)
This issue does not occur with models that are part of the game ex: "\A3\data_f\ParticleEffects\Universal\Meat_ca"
Anyone else have this issue with drop?
eventually spawn
it sounds more like you have an issue with your parameters
I use the particle array, similar to the examples online
eg:
_source setParticleParams [ /* Sprite */ ["\ca\characters2\OTHER\FLY.p3d", 1, 0, 1, 0], // File,Ntieth,Index,Count,Loop /* Animation */ "", /* Type */ "spaceObject", /* TimerPer */ 1, /* Lifetime */ 4, /* Position */ [0,0,0], /* MoveVelocity */ [0,0,0.5], /* Simulation */ 1, 1.30, 1, 0, // rotationVel, weight, volume, rubbing /* Scale */ [0.03, 0.03, 0.03, 0], /* Color */ [[1,1,1,1], [1,1,1,1]], /* AnimSpeed */ [1.5, 0.5], /* randDirPeriod */ 0.01, /* randDirIntensity */ 0.08, /* onTimerScript */ "", /* DestroyScript */ "", /* object */ _this, /* Angle */ 0, /* onSurface */ true, /* bounceOnSurface */ 0.5, /* emissiveColor */ [[0,0,0,0]] ];
If I try to spawn an arma 3 object, it is fine. if custom object, its objnull until drop executed one or 1 more times
It eventually does spawn, so the array is correct, the problem is only it onlt spawns after called multiple times, does it make sense?
even if you use the same parameters as the wiki example and just change the model?
Yes
If I use the old route, and create a particle emmitter source first, then set parameters - the custom model will spawn without fail. But I would prefer to use drop
Apologies - I stepped away for a moment
I've added a uiSleep 0.5 between the point of calling deleteVehicle on the object created via createVehicleLocal, and spawning the actual object on the server. Objects are now spawning
Given the explosions occurred both locally via the editor (where I am the server and client) as well as a dedicated server, I'll assume the issue was multi-faceted.
Rather than uiSleep, is there a more reliable way of sleeping/waiting for the required amount of time for deleteVehicle to have cleaned up the local object before spawning again?
In fact, I've answered my own question there I think. waitUntil { isNull _x }
