#arma3_scripting

1 messages · Page 220 of 1

faint burrow
#

As I remember, a unit should have a backpack with a weapon, and be near to the backpack with a tripod.

tulip ridge
#

There's no second item needed

faint burrow
#

As I remember, all vanilla deployable weapons contains consist of 2 parts -- the weapon itself and the tripod.

tulip ridge
#

Yes, my weapon is functionally the tripod

hallow mortar
tulip ridge
#

Oh looks like just using the unit as the tripod works, i.e. _this action ["Assemble", _this];

tulip ridge
#

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

faint burrow
#

That's why I deleted my message.

hallow mortar
tulip ridge
#

Seemed pretty much the same to the getIn commands
Might just leave it as instant, maybe with a small delay

ivory lake
#

them moving away is unfortunately the weird path finding the AI has to do

proven charm
#

he like tries to return to formation

tulip ridge
little raptor
#

you can move them manually with animations

#

then use the getIn action (not command) when close enough

zinc totem
#

how would i go about scripting a trigger that activates once all 4 members of a squad enter a vehicle?

faint burrow
#

((units _squad) findIf { !(_x in _vehicle) }) < 0

zinc totem
analog mulch
#

hi
is there a way to disable damage on vehicle engine specifically?

hushed turtle
#

Should be possible by handleDamage EH I guess

shrewd mauve
#

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 ?

shrewd mauve
#

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

analog mulch
#
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?

tulip ridge
sharp grotto
#

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. "

modern plank
#

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) ?

granite sky
#

"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.

modern plank
#

nice

#

should be enough

#

my groups are static. Thx mate

broken forge
#

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;
}]
granite sky
#

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.

broken forge
#

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];
proven charm
#

_prefix defined? post-init issue? add some additional loggin

broken forge
#

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"
proven charm
#

are you running dedi?

still forum
#

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 🤔

broken forge
#

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
proven charm
#

not that it probably matters but do note that addBackpackCargo etc commands have local effect

broken forge
#

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

warm hedge
#

Other than r2t, no

broken forge
#

You could probably setup a fixed camera facing the player with the html UI around the player

raven blaze
#

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?

granite sky
#

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.

stark fjord
#

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?

willow hound
#

Code inside isNil always runs unscheduled.

stark fjord
#

awesome thats cleaner than remoteExec.
thanks

granite sky
stable gazelle
#

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

stark fjord
fresh fulcrum
#

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,

granite sky
fresh fulcrum
oak loom
#

trying to find out where on this list Lambs supressions should go tried many dif variations thx

sly cape
oak loom
#

server likes when i have lambs danger where it is but when i add suppression the server comes back no mods loaded @sly cape

hallow mortar
#

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

oak loom
#

got it working thx was files names too long as you pointed towards

tidal idol
#

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.

tulip ridge
#

It is

granite sky
#

You'd normally setVariable on the object instead, if the var is object-dependent.

tulip ridge
#

Could also just set a var on the unit

#

Beat me to it

granite sky
#

Not really clear whether it is from the snippet.

tidal idol
granite sky
#

You never have to use CBA. It's just convenience.

tidal idol
#

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

granite sky
#

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.

tidal idol
#

so basically to add a variable to a unit, just replace the missionnamesppace with the vehicle object like this?

granite sky
#

Remove the global flag on the setVariable. You're installing the EH locally anyway. Other machines don't need the data.

tidal idol
#

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.

cosmic lichen
#

Why post a screenshot meowsweats

#

Just post the code here

#

!sqf

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓ turns into ↓

// your code here
hint "good!";
split ruin
#

how to script the custom radio triggers, the ones that are under 0-9- menu ? 🤔

split ruin
#

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 ?

stark fjord
#

deleteVehicle _unit?

split ruin
#

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!

stark fjord
#

_this select 0 is same as _unit

split ruin
#

yeah 😂

stark fjord
granite sky
#

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.

stark fjord
#

Yup. On mission that i have and can reliably replicate, it always works unscheduled

#

That mission has over 500 ai on tho

real tartan
#

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
    };
}];
proven charm
#

use KeyUp

real tartan
split ruin
#

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
split ruin
#

@proven charm omg, cluster fpv drone incoming
Edit: works perfectly as intended, thanks a lot!

granite sky
#

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.

tulip ridge
#

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)

proven charm
tulip ridge
#

I haven't, didn't know that was a thing
Sounds promising though

tulip ridge
split ruin
#

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,"",""
  ];
hushed turtle
#

That is very ugly flare

split ruin
#

well its visible at least 😆

faint burrow
#

Try using alt syntax of createVehicle, and pass CAN_COLLIDE as special param.

hushed turtle
#

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

stark fjord
#

Afaik flares work just fine

hushed turtle
#

Have you seen it? It's graphical effect is broken and it does same illumination like 40 mm GL flare

stark fjord
#

Oh, its no bigger than 40mm thats true.

split ruin
#

@hushed turtle yep, this flare is broken even spawned in air it doesn't fall down as it should ...

hushed turtle
#

With my code?

stark fjord
#

Did you give it some velocity?

split ruin
#

@hushed turtle no, by default ...

hushed turtle
#

That behaviour is true for all flares or maybe for all ammo

stark fjord
#

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

split ruin
#

@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

hushed turtle
#

I'm wasn't successful at trying to change flare velocity. Maybe it needs to be set on each frame?

stark fjord
#

how much negative velocity did you give?

hushed turtle
#

Most likely from my code

split ruin
#

yes, -5 seems fine

#

now I need termite to have the perfect Baba Yaga type of drone 🔥

late beacon
#

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?
stark fjord
#

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

old owl
#

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.

tidal idol
# cosmic lichen Just post the code here

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

faint burrow
#

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?

raw vapor
#

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.

hallow mortar
#

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)

raw vapor
#

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.

tidal idol
#

could that be adjusted by chanign simulationStep config parameter?

raw vapor
tidal idol
#

cant via script, needs mod

raw vapor
#

smilethonk Well shoot. I mean what's one more mod on my 213 mod list?

hallow mortar
raw vapor
#

Ah, I see.

#

I thought it was like remote execute.

#

Brain fart, I should have known this already.

hallow mortar
#

attachTo is GA/GE anyway so there's no need for any sort of remoteExec

raw vapor
#

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

hallow mortar
#

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.

raw vapor
#

Ohh, okay, so I really do need a dummy object or a mod.

#

@tidal idol Are you aware of a mod that does this?

tidal idol
#

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.

raw vapor
#

Would a flagpole work? I think I've used flagpoles as an anchor object in the past for the root of compositions.

little raptor
little raptor
raw vapor
#

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.

tired nimbus
#

Whats the easy ace arsenal script you put in an object init again?

#

I forgot Im having a brain fart

tulip ridge
silent cargo
#

Is it possible to spawn a damageEffect through script?

agile pumice
#

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

jade abyss
#

Why not by a Var?

#

before spawn ->

MyVar = false;
[]spawn MySuperDuperFnc
waitUntil{MyVar};

In the end of MySuperDuperFnc -> MyVar = true;

?

warm hedge
agile pumice
#

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

faint burrow
# little raptor hard to say. maybe the EH is deleted. check event handler info

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.

proven charm
#

maybe it doesnt work with minimaps?

#

or wrong minimap being displayed

faint burrow
#

The same code works fine in my mission (as a reminder, I'm trying to change third party mission).

proven charm
#

oh ok

#

could be wrong minimap being displayed though, because you can change that with key press

faint burrow
#

My mission:

proven charm
#

i tested your code. first it does nothing when im in SENS mode but when i switch to NAV the hint shows

faint burrow
#

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.

proven charm
#

yea they must use custom map ctrl or something

faint burrow
#

Very unsure.

split ruin
#

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 ...

proven charm
#

the code fires?

mortal folio
#

Is there any way to get selection positions of weapons or other proxies?

warm hedge
#

Create it as a simple object and fetch the object's selections

mortal folio
split ruin
#

@glass nest thanks, the EH works perfectly

crimson lagoon
#

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:

  1. The loading screen disappears for a moment.
  2. The start script menu appears.
  3. The loading screen returns and stays for varying lengths of time.
  4. 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”];
stark fjord
#

Perhaps just give it more time. Your script goes forward as soon as step 1 youve described completes

uncut sphinx
#

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.

errant jasper
#

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.

little raptor
faint oasis
#

I have a question ? Is it possible to get the "Projectile" (Object) from the "Handle Damage" EH ?

granite sky
#

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.

faint oasis
# granite sky No. I doubt it's guaranteed to exist at that point.

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

faint oasis
granite sky
#

yeah it's complicated.

#

Not sure there's any way to do what you want there.

uncut sphinx
faint oasis
granite sky
#

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.

faint oasis
granite sky
#

general damage hitpoint is just setDamage

faint oasis
#

oh ok

#

so only setDamage and setHitpointDamage ?

granite sky
#

I never completely figured the difference between a selection and a hitpoint so I'm the wrong person to ask :P

faint oasis
granite sky
#

It's called setHit

faint oasis
#

so yeah, if you don't know the difference between them, i don't know either 🙂

granite sky
#

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".

hushed turtle
granite sky
#

nah, there can be multiple selections in one hitpoint. Also they both have strings but one of them is in czech :P

hushed turtle
#

I confused two different things. I meant hitPoint and hitPartIndex like it is in handleDamage EH

radiant lark
#

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

remote cobalt
#

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 😄

granite sky
#

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.

jade abyss
#

"Brainfart" 😄

bold blade
#

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

candid trench
#

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 ?

sly cape
candid trench
#

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

sly cape
# candid trench It would probably be way longer to teach me than to do it themselves 😄

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.

warm hedge
bold blade
candid trench
tulip ridge
#

There's no distinction between 1st/3rd person

sly cape
warm hedge
bold blade
warm hedge
#

?

bold blade
warm hedge
#

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

bold blade
#

In arma 3 there is no difference, but in 2 there is. I wish to understand what toggles this difference

bold blade
#

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

warm hedge
#

Maybe I'll check some investigation

#

The point/goal is to disable rotation anims in A3 in first person, is that all?

bold blade
#

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

ivory lake
#

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

warm hedge
#

I would guess AnimChanged to spam switchMove may achieve it

little raptor
glass nest
dawn thunder
#

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).

thin fox
glass nest
glass nest
#

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.

warm hedge
#

This is just a vehicle with not right physics, there is no room to improve from SQF side

dawn thunder
#

@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
glass nest
little raptor
glass nest
dawn thunder
bold blade
little raptor
#

no

thin fox
radiant lark
crimson lagoon
little raptor
radiant lark
#

shid

little raptor
#

why? it's the exact same control and code, just used by different displays

sharp grotto
radiant lark
little raptor
#

In that sense yeah it's a bit more complicated

radiant lark
#

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?

radiant lark
#

I got to admit that I have PTSD from my Selenium days

crimson lagoon
# sharp grotto I had similar issues years ago, so i just used a generous amount of sleep in a "...

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.

sharp grotto
radiant lark
#

Can htmlLoad be used before joining a server from within a mod?

next kraken
#

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;

glossy oriole
#

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
granite sky
#

short answer: You really need to stop using triggers.

glossy oriole
#

If so, what kind?

#

Im very very new to this so I make more than plenty mistakes, only here to learn

granite sky
#

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.

glossy oriole
granite sky
#

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.

glossy oriole
glossy oriole
modern plank
#

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?

granite sky
glossy oriole
granite sky
#

It's the same thing as you have in your trigger conditions & statements except easier :P

glossy oriole
#

Yeah things are slowly clicking

#

Loads of errors in my head still

granite sky
#

thisList doesn't exist. You'd do this for example:
private _bluforCount = {alive _x} count (units west inAreaArray "zone1_marker");

glossy oriole
#

Oh wait with the edit it makes sense

granite sky
#

yeah I forgot you were using an area.

glossy oriole
#

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

granite sky
#

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.

glossy oriole
#

U are telling me it can check anything within for example a square marker

#

Thats so cool

modern plank
#

full doc here

glossy oriole
#

I really don't need to use triggers... This is amazing

granite sky
#

You'd run your check code in something like this:

[] spawn {
  while {true} do {
    // checks go in here
    sleep 5;  
  };
};
glossy oriole
#

Im processing give me a moment lol

granite sky
#

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.

glossy oriole
granite sky
#

And then you have while/sleep so that it does something every five seconds.

glossy oriole
glossy oriole
#

Was finne type that, that makes sense now

#

What do the [] do in this case?

granite sky
#

Nothing really. spawn just needs a parameter to pass in variables. But we're not using it.

glossy oriole
#

Ah alright

granite sky
#

For some reason there's no version of spawn that takes no left-side parameter.

glossy oriole
#

So it just kinda always spawns the code every 5 seconds

granite sky
#

The spawn just runs the code in a separate thread. The while/sleep does something every 5 seconds.

glossy oriole
#

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"};

granite sky
#

See examples 7 and 8 for createDiaryRecord.

modern plank
glossy oriole
granite sky
glossy oriole
#

The delay could just be {sleep 30; followed by the rest no?

granite sky
#

No, because you want to check if the condition was true for 30 seconds, not simply delay the action.

glossy oriole
#

And ofcourse on spawn i'd have it make "MyVariable" and also set it to 0

granite sky
#

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.

glossy oriole
granite sky
#

The code runs every 5 seconds (approx) because of the sleep 5. So 6*5 = 30.

glossy oriole
#

Aaah now it makes sense

#

Due to the while true

granite sky
#

If it was a sleep 1 then you'd check if (_count == 30)

glossy oriole
#

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

granite sky
#

while {true} just makes it an infinite loop. while {false} wouldn't run at all.

glossy oriole
#

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

glossy oriole
#

Or is that also in the wiki?

granite sky
#

nah it's just logic.

#

well, if/else is in the wiki.

#

example:

if (_bluforcount > _opforcount) then {
  _count = _count + 1;
} else {
  _count = 0;
};
glossy oriole
#

Forgot about else, i can make that work

glossy oriole
#

I'll make the script tomorrow and add onto it as i go. Thanks so much

vapid dune
#

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?

sharp grotto
#

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 👋

vapid dune
#

I mean I can clone this groundholder without this uniform, but it seems too complicated for such an easy task

sharp grotto
vapid dune
#

Tried this

granite sky
#

Deleting and re-adding is better for the JIP queue anyway :P

vapid dune
#

Do you mean deleting groundholder and creating it without this uniform?

granite sky
#

No, clearItemCargo + re-add.

#

but that too.

vapid dune
#

Oh, wait, I thought groundholder is removed when it is empty

granite sky
#

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.

vapid dune
#

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

granite sky
#

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.

vapid dune
#

Guess it is time to start writing more code to handle this workaround.
Thank you

exotic flame
#

How do i retrieve current rpt file name from scripting ?

wicked roostBOT
#
Arma RPT

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.

exotic flame
#

I thought i could use diag_tickTime but it doesn't match the exact datetime the rpt was created

exotic flame
# sly cape !rpt

i know what is a RPT file, i want to retrieve it from scripting

sly cape
granite sky
#

I don't think there's any way to do that.

exotic flame
granite sky
#

With a hardcoded folder path?

exotic flame
still forum
still forum
still forum
radiant lark
#

Gotcha dedmen, tysm

#

Is there any benchmark for WebBrowser UI?

still forum
#

No, I don't see how you'd make one

fallen locust
#
control = [] spawn crap_fnc;
waitUntil{scriptDone control};
pallid palm
#

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 🙂

sleek forum
#

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

warm hedge
#

One Big Brain moment I can think in 0AM is: Place Praetorian without crew, put OPFOR units in it

sleek forum
#

Yea...I should get some sleep

tulip ridge
#

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

winter rose
#

use multiply indeed

turbid lodge
#

Question, is there a way I can make a Advance and Secure gamemode from Squad in ArmA 3?

still forum
#

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?

turbid lodge
#

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

turbid lodge
tender fossil
turbid lodge
turbid lodge
#

I understand even less partly because it is in Spanish and it is not my native language

shadow merlin
#

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

still forum
shadow merlin
#

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.

tulip ridge
#

For units you can just add stuff to CAManBase and its easy enough

#
class Man;
class CAManBase: Man {
    class ACE_SelfActions {
        class YourPrefix_yourThing { ... }:
    };
};
shadow merlin
#

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

thin fox
turbid lodge
thin fox
turbid lodge
#

Do flags have to be visible? or can I keep them hidden?

thin fox
# turbid lodge Yep

yes there is, I don't remember correctly, but I think you need to add as a variable in some array in the code

thin fox
turbid lodge
#

I see, I just need 6 objectives for it, should copy paste suffice?

thin fox
#

PIG_sectors for example

turbid lodge
#

I see

#

Thanks

glossy oriole
turbid lodge
thin fox
#

but I don't remember if it does what you want

glossy oriole
#

Tryna learn how to make this stuff but having a stroke doing so lol

turbid lodge
thin fox
glossy oriole
hallow mortar
#

while true loops can be dangerous because there's no way to stop them, but John knows what he's doing.

thin fox
#

it's just telling what sector each side will be attacking first, iirc

glossy oriole
#

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?

turbid lodge
thin fox
turbid lodge
#

Ye

thin fox
#

so just do the same for the additional sectors

#

and put an unique variable name for each

turbid lodge
#

I got that, I am just asking what is the cap zone, the trigger in front of the sector or the sector itself?

glossy oriole
turbid lodge
glossy oriole
#

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?

sly cape
glossy oriole
#

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

turbid lodge
thin fox
radiant lark
pallid palm
#

roger that m8

pallid palm
#

@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 🙂

granite sky
#

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.

pallid palm
#

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

little eagle
edgy dune
#

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

little eagle
#

For a reason "no one remembers now"

#

:facepalm:

warm hedge
#

Playing particle is done with particle object, is thay what you ask

lone glade
#

if only they used version control......

exotic flame
#

Is there an event handler for GamePaused ?

warm hedge
#

Not getter but EH?

edgy dune
exotic flame
faint burrow
warm hedge
exotic flame
exotic flame
warm hedge
#

I don't see a reason of this. You can just check it eachframe

exotic flame
warm hedge
#

I often do it. Even some CDLCs

edgy dune
modern meteor
#

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.

shadow merlin
#
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.
opal ember
#

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

cosmic lichen
#

Writing to a file is only possible with an extension. Doesn't Zeus Enhanced offer something like that?

stark fjord
#

Copy paste huge string yes.

cosmic lichen
shadow merlin
little raptor
shadow merlin
little raptor
#

I mean which config?

shadow merlin
#

My own

little raptor
#

I mean config.cpp or description.ext

shadow merlin
#

config.cpp

little raptor
#

and if you go to CaManBase in config viewer do you see your action there?

shadow merlin
#

let me check that real quick

shadow merlin
little raptor
#

did you list ace as a dependency for your addon?

#

in requiredAddons

shadow merlin
#

CaManBase?

fleet sand
little raptor
#

no CfgPatches. did you even create a CfgPatches?

shadow merlin
#

Yes I did create a CfgPatches

#

and ace_common, ace_main and ace_interaction_menu are all there

little raptor
#

post your whole config

#

well CfgPatches I mean

shadow merlin
#
class CfgPatches
{
    class gear_variants
    {
        units[] = {};
        weapons[] = {};
        requiredVersion = 2;
        requiredAddons[] = {
            "ace_interact_menu",
            "ace_main",
            "ace_common",
            "cba_main"
        };
        author = "Void";
    };
};```
opal ember
little raptor
shadow merlin
#

Do I run that in the debug console?

fleet sand
little raptor
#

not sure think_turtle
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

still forum
#

Also we just a few days ago, had a conversation about a file writing extension, the code is above

still forum
shadow merlin
still forum
little raptor
#

did addonFiles return an empty array?

shadow merlin
#

yep

little raptor
#

if so the game didn't even load your addon

little raptor
still forum
opal ember
fleet sand
still forum
shadow merlin
still forum
#

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

still forum
still forum
shadow merlin
#

Yeah its like a "tag" that goes before the name of everything right?

still forum
#

🤔

#

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

opal ember
shadow merlin
#

my $PBOPREFIX$ just says z\SC\addons\gearVariants. I'm gonna guess that's wrong

still forum
still forum
#

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 😄

shadow merlin
#

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

modern plank
#

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.

modern plank
#

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?

faint burrow
#
_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";
radiant lark
# still forum Nah that sounds good

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

granite sky
modern plank
faint burrow
#

Don't know.

mortal folio
granite sky
radiant lark
mortal folio
#

Lmao

modern plank
granite sky
#

nearObjects is pretty quick anyway. I wouldn't worry about using it in general.

granite sky
#

However you can replace this:
sqrt ((_markerSize select 0) ^ 2 + (_markerSize select 1) ^ 2)
with this:
vectorMagnitude _markerSize

desert crescent
#

is this a place to also showcase your scripts or no?

desert crescent
#

tank

shadow merlin
#

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;
stark fjord
#

What does it do? Nothing? Removes vest?

shadow merlin
#

currently it does nothing

stark fjord
#

Is newVest param correct inside the func? If you systemChat it for example?

shadow merlin
#

I'm still kinda new at this, what do you mean by systemChat'ing it?

stark fjord
#

In some line after params put systemChat _newVest then do self ace interaction, and see what gray text in chatbox says

#

Or errors out

shadow merlin
#

alright, one sec

#

the system chat gives me the class name of the vest its supposed to switch to

stark fjord
#

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];

shadow merlin
#

alright. One sec

#

That did the trick. Do you mind if I screenshot that message with the index for future reference?

stark fjord
#

god forbid

#

i jest, go ahead, after all its public discord, dont think anyone can prevent you from screenshotting it

shadow merlin
#

Eh, I prefer to ask anyhow

stark fjord
#

and add disney theme, incase you need to get lawyers involved

stark fjord
shadow merlin
#

idk. if its on the BI wiki I didn't see it

stark fjord
#

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

shadow merlin
#

Yeah I'll keep that in mind. Thanks a lot!

tulip ridge
#

They'll handle stuff like loadouts and transferring variables for you

shadow merlin
#

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

radiant lark
#

Cannot read htmlLoad result right?

stark fjord
granite sky
#

Yeah, the array at the top of setUnitLoadout is just for syntax 4. It is poorly written.

agile pumice
#

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

lone glade
#

don't have a fuckton of errors in the first place ?

agile pumice
#

its 90% arma3 or other addons

#

make that 99.9%

lone glade
#

add a code number with your diag_log something like diag_log format ["12345"] and ctrl+f through the rpt

agile pumice
#

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

lone glade
#

nope

agile pumice
#

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

lone glade
#

brace yourself, they added ammoboxes init to BIS_fnc_log

agile pumice
#

is that the same as diag_log ______ ?

#

obviously with a little more fomatting

lone glade
#

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

still forum
radiant lark
#

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?

radiant lark
indigo wolf
#
while {uiSleep 2; true} do { ... };
while {true} do { ... uiSleep 2; };

I am assuming the performance is the same for both?

last cave
#

blobcloseenjoy
||don't remove the Arma 3 logo or copyright disclaimer||

||Is it normal that the disclaimer has expired? 2025???||

cosmic lichen
#

Probably going to change with 2.22

little raptor
#

yeah it was changed

#

I think it'll be available in next dev update (maybe prof too)

mortal folio
#

What if we change the logo to operation flashpoint thonk

winter rose
#

:U

last cave
last cave
mortal folio
mortal folio
#

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

hushed turtle
#

It's called Eden only since A3

last cave
mortal folio
#

Well yeah back then it was just editor but its for the new ones here for understanding 😄

hushed turtle
#

But besides that, same for story for me

#

The 3D one is called Eden if I remember correctly

hushed turtle
mortal folio
#

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

last cave
#

I saw a video on YouTube where someone already tried to transfer some missions from the OFP series to Arma 3.

hushed turtle
#

There is entire campaign in workshop

stark fjord
winter rose
#

that's instant IRL ban 🔥 🔨

#

banned from real life

last cave
#

and in virtual reality

stark fjord
last cave
#

oh my arma 3... oh holy arma 3... oh no..
||p.s. New picture||

winter rose
#

but… why 😹

little raptor
#

he has to constantly remind himself not to get banned

winter rose
#

tHis ARMA INstaNCe Is noT tO BE closeD

last cave
#

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.

last cave
#

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.

radiant lark
#

plz publish mod 😭🔥🙏

last cave
radiant lark
#

aight aight

#

does anybody know in which cases ctrlHTMLLoaded URL will return false?

#

and whether it has a request timeout

warm hedge
#

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?
last cave
#

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;

};
warm hedge
#

What is supposed to happen? What is the intention?

pallid palm
#

i think he want's to remove completed missions from the list: but im not sure

last cave
#

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

warm hedge
last cave
#

I need to check the array references to ensure they match...

last cave
warm hedge
#

I am asking the expected result and the entire intention

last cave
#

expected result - element 5 changed to true;

#

but in real result false

warm hedge
#

Okay so, what you've posted is two different cases?

pallid palm
#

@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

granite sky
#

Either that or boil the problem down to a self-contained piece of code that you can paste.

last cave
#
//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
*/
granite sky
#

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.

last cave
#

I just checked. After some time during code execution, the reference gets deleted and the array becomes a duplicate.

granite sky
#

hashMap getOrDefault [key, defaultValue, setDefault] <- see setDefault.

last cave
#
//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)

last cave
#

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.

granite sky
#

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.

last cave
#

It will be difficult for me to show this because I have too many external factors in the mission that I can miss.

granite sky
#

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.

last cave
#

Now everything works correctly when I moved the array definition right before the set.

granite sky
#

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.

last cave
#

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];
};
granite sky
#

Yeah you have no sequencing control in there. Looks scary.

#

It's just spawn-spam in the middle of a half-second loop.

last cave
#

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.

azure mural
#

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

fair drum
azure mural
#

it might, pretty sure its written in rust so its platform agnostic

#

does it also do syntax highlighting? thats my big problem atm

granite sky
#

Maybe you can pull the language JSON out of an extension? I assume it has some sort of language support...

opal ember
#

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)

granite sky
#

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.

granite sky
#

hmm, I figured it wouldn't use that, but it seems plausible.

faint burrow
#

You also can add onLoad event handler.

granite sky
#

Only in config, right.

#

You could add onLoad to a loaded display but that wouldn't get you anywhere.

opal ember
granite sky
#

If you don't know the classname of the curator then just log the value and you'll find it.

faint burrow
# opal ember I'm looking at it but I don't seem to understand how I use that on a player to t...
[
    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;
opal ember
#

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?

faint burrow
#

It's local EH, it only triggers on player's PC.

granite sky
#

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.

opal ember
#

ah okay, got it.
Thank you

modern plank
#

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?

lone glade
#

FYI results from comparing selectRandom array vs array select floor random count array array having 15 elements:

  • selectRandom: ​0.00480041 ms
  • array select floor random count array: ​0.00789795 ms
exotic gyro
#

HandleChatMessage + track the number, waitandexecute to decrement it, waitandexecute to delay it if you're past the limit

lone glade
#

a 60% speed increase was noted in favor of selectRandom

modern plank
#

Yes, manually.

#

No throttling feature on radio channel from CBA for example ?

jade abyss
#

Sweet

exotic gyro
#

Very niche thing. Don't spawn it though, use cba wae

pallid palm
#

what's throttling/flood protection mechanism

#

is that like limit the amount of traffic i guess

modern plank
#

yep

#

I create a customRadioChannel to ease the communication betweens players facing issues and myslef, if they need a TP or whatever.

proven charm
#

is empty string considered a valid key for hashmap?

hushed turtle
#

In theory it should

proven charm
#

yea i think it does but i just thought its unwanted situation...

hushed turtle
#

Why? Empty string is valid string value

proven charm
#

ya but do you ever really want that

little raptor
proven charm
#

ok, ty

tulip ridge
#

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

granite sky
#

I've not run into one. Generally if ACE is using a hack then there isn't a good way.

tulip ridge
#

That's what I assumed

broken forge
#

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

granite sky
#

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.

grizzled cliff
sharp grotto
#

That also works
⁨⁨⁨```sqf
NoGrenadesForYouEH = addMissionEventHandler ["EachFrame",
{
player setWeaponReloadingTime [player, (currentThrowable player #1), 0.01];
};

last cave
# tulip ridge I forget, is there a way to block vanilla grenade throwing? Iirc ace sets the a...

⁨⁨```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;

tulip ridge
#

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

granite sky
#

I have no idea why you're posting this video or what's supposed to be of any interest in it.

proven charm
#

propaganda video

proven charm
#

joking

glass nest
#

This is a chat translation video.

silent cargo
#

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?

granite sky
silent cargo
#

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

broken forge
#

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.

tender fossil
#

Although you might want someone else to confirm the above

broken forge
#

At the moment I'm using hashMaps

primal trench
#

Is there a way to pull a list of classnames for rifles that support all of muzzle + rail + scope attachments?

dusk gust
# broken forge Is there a limit on how much can be saved "in-memory" on the client or server? (...

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

tidal idol
#

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

warm hedge
primal trench
#

Weapons that accept every accessory type

#

Or in every slot

warm hedge
#

Even if it doesn't exist?

primal trench
#

What do you mean?

tidal idol
#

For a given attachment classname, return all weapons that can accept it on a rail?

primal trench
#

Actually that would work too

warm hedge
#

Literally. Even in vanilla games there are some accessories that is exclusive to a certain weapon

sly cape
primal trench
#

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

mortal folio
#

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

tidal idol
#

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

old owl
#

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 w_sadcat

#

I set the velocity far, so it's landing position is roughly probably 10-15 meters from it's starting position.

warm hedge
#

getPos it

sharp grotto
#

It's not bad with Arma 3, which surprises me if remember my tests with ChatGpt before 😆

granite sky
#

You want the one below that, beforeDestroy

#

I guess "path to script" is a file path? Janky if so, hopefully it's cached.

old owl
# sharp grotto It's not bad with Arma 3, which surprises me if remember my tests with ChatGpt b...

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

granite sky
#

yeah they've been grinding through the githubs.

#

It's trash but it's plausible trash now :P

sharp grotto
#

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 blobdoggoshruggoogly
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.
old owl
#

Huge, I bet that will work. Ty guys catnod🫶

exotic flame
#

When i use ⁨#(rgb,width,height,mipCount)ui("displayClassName","uniqueName","texType")⁩ how do i get the safezone of this area ?

warm hedge
#

I think I would ask for your origin of this question, why you need to do that?

tulip ridge
dusk gust
#

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

dusk gust
#

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

pallid palm
#

lol @old owl

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 🥹

formal grail
#

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?

exotic flame
gusty rivet
#

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

hallow mortar
#

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

gusty rivet
hallow mortar
#

I assume "them" means some kind of horse-like creature

gusty rivet
#

I'll show more later and I'll have to figure out how to enable Zeus comp scripts on my server

old owl
#

Appreciate both of your help!

gusty rivet
tidal idol
#

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.

hallow mortar
#

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");```
gusty rivet
#

no mention of zeus in my server config

#

unless i just add the line myself

hallow mortar
#

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

tidal idol
gusty rivet
gusty rivet
#

IT WORKED

#

now ive just gotta make em fire lol they dont want to

warm hedge
exotic flame
modern plank
#

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.

tender fossil
#

I guess it could monitor the last edit to a file too (if you're editing already existing mission)

modern plank
#

Cause it is even better to trigger it on the export event.

tender fossil
#

Or monitor even a hash of a PBO, that would cover all cases

tender fossil
modern plank
#

I am pretty sure someone did it. Of course we could implement something from the outside

#

To avoid that kind of implement.

tender fossil
#

I would imagine it would be much less effort with the monitor script

modern plank
#

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.

tender fossil
#

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?

modern plank
#

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.

#

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.

tender fossil
modern plank
#

It is quite ok, here it is in Eden.

tender fossil
#

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

modern plank
#

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

broken forge
#

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?

modern plank
#

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.

broken forge
#

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

modern plank
#

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 ...

modern plank
#

Yep. The temporary notification just below the menu bar...

proven charm
#

oh you mean this? ⁨["test",0,5] call BIS_fnc_3DENNotification

short anchor
#

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;

proven charm
short anchor
#

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

hallow mortar
#

The simple thing to try might be to use vectorAdd to adjust the target position upwards by a few centimetres

short anchor
#

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

little raptor
#

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

short anchor
#

That makes sense, thanks for that. I'll test and see how it behaves

granite sky
#

I guess this is why enemies are inclined to magdump unconscious players if you don't also use setCaptive.

short anchor
# little raptor you must wrap it in ⁨`isNil`⁩. there's no need for disable damage at all. ⁨```sq...

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

granite sky
#

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.

little raptor
#

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)

hallow mortar
#

remoteExecCall is supposed to do that

short anchor
#

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)
granite sky
#

Can you replicate this outside kplib?

#

I'm always interested in exploding vehicles :P

short anchor
#

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

granite sky
#

might be some sort of double-spawn issue then.

short anchor
#
granite sky
#

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.

short anchor
#

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

granite sky
#

oh, it creates on the server. huh.

little raptor
#

just use ⁨vectorDir⁩ and ⁨vectorUp⁩ not ⁨getDir⁩. and set them at once using ⁨setVectorDirAndUp

granite sky
#

yeah plausible, given that the angles here are not necessarily close to level :P

little raptor
#

also you should first set the dir and up, then set position

#

because the position you got was obtained post rotation

short anchor
#

I shall take those recommendations on-board and test

little raptor
#

(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

short anchor
#

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

little raptor
#

yeah for perfect translation always use getPosWorld/setPosWorld

short anchor
#

I use PosWorld in another part of the mouse handler to raise/lower the object

#

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

little raptor
#

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]);

sly cape
#

Is there any easy way to see if a vehicle can fire right at this moment?

sly cape
proven charm
#

wiki says "Returns true if the given vehicle is still able to fire."

sly cape
proven charm
#

oh guess not then, sounds like buggy command

granite sky
#

2018, not necessarily current

sly cape
#

It still says true when there's no ammo so it's not useful anyway.

somber silo
#

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?

little raptor
#

eventually spawn
it sounds more like you have an issue with your parameters

somber silo
# little raptor > 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?

little raptor
#

even if you use the same parameters as the wiki example and just change the model?

somber silo
#

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

short anchor
# little raptor but aren't you spawning it exactly were another heli was before?

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 }