#arma3_scripting

1 messages ยท Page 185 of 1

split scarab
#

How do I save a unit's gear on mission start as a loadout for next respawn?
As far as I understand I'm meant to use BIS_fnc_addRespawnInventory but I can't seem to figure it out

cyan thunder
#

@split scarab can just put player setVariable["lastLoadout", getUnitLoadout player]; on the player (copies their loadout onto a variable on them) then in OnPlayerRespawn.sqf put player setUnitLoadout (player getVariable "lastLoadout");

#

I do it a little differently in that I set the loadout when they exit the ace arsenal, so whatever they pick becomes what they'll have next time but if they change it and die they get the last change ๐Ÿ™‚

#

goes back to trying to find a way to get which door was opened when a player uses "Open Door" - I can do it if they use ace but can I bugger find a way to do it for the action method

#

@split scarab if you are using ace ```sqf
_id = [
"ace_arsenal_displayClosed",
{
hint "Saved your respawn loadout...";

    if([player] call BIS_fnc_getUnitInsignia == "") then {
        [player, "Ragner"] call BIS_fnc_setUnitInsignia;
    };

    if (getPlayerUID player == "1111") then {
        [player, "Sped1"] call BIS_fnc_setUnitInsignia;
    };
    
    player setVariable["lastLoadout", getUnitLoadout player];
}

] call CBA_fnc_addEventHandler;

lime rapids
#

using a ui slider to modify a vehicles rotation is there a performance friendly way to change the range from a float to a number between 1 and 360?

cyan thunder
lime rapids
cyan thunder
lime rapids
cyan thunder
#

I guess a clean version would look something like ```sqf
fnc_convertToDegrees = {
params ["_value"];

_degrees = floor (_value * 360);

if (_degrees == 360) then { _degrees = 0 };

_degrees

};``` (not run that - you'd probably want to clamp the value between 0 and 1 (unless you are 100% sure that it can't ever get floats >1 or <0 ๐Ÿ™‚ )

#

arma is so weird at times, you can do really sophisticated stuff with sqf but then get your arse kicked trying to do something simple like "run code when player opens a door" ๐Ÿฅน

split scarab
cyan thunder
#

fwiw done it that way for literally years across everyone of my campaigns without a blip ๐Ÿ™‚

split scarab
#

Cheers, was just wondering if it would mess with the variable hvtTarget that I set on a specific unit

cyan thunder
# split scarab Cheers, was just wondering if it would mess with the variable `hvtTarget` that I...

nah, they have different names, you'd only stomp (overwrite) if they shared a name which they don't, you can hang a bunch of stuff of a player/unit that way (lambs does it that way, so does CBA and ace) ๐Ÿ™‚ - the only risk is name collisions which is why mods typically do something like "ace_foo" or "lambs_main_foo" for their name scheme, I should probably do the same but eh, if its not broken ๐Ÿ˜‰

#

I do that stuff a lot in my zeus stufg because I have an entire economy (players earn money for killing things, lose it for losing things) so I have to track what they killed, who pays for a vic when it explodes, internally it's all just variables hung off objects ๐Ÿ˜„

lime rapids
cyan thunder
#

updates on the map so they can see in real time how much money they are making (or as is often the case hilariously losing) ๐Ÿ˜„

#

does make them value stuff though when their ability to spawn vehicles is dependent on having enough in the bank to pay for it ๐Ÿ˜„

split scarab
cyan thunder
#

that was astoundingly painful ๐Ÿ˜„

tough abyss
#

im trying to make a simple vehicle spawn script. ive done this in the past about 4 years ago. but with the forums down i cant find my old script.
anyway ive got a trigger that once activated allows me to spawn vehicles from the HQ, via addaction. Im just trying to find the right syntax to use. basically Ive got two arguments to pass. a global variable, called Resource Points and the vehicles classes. eg spawn a quadbike and remove 25 Resource points.

anyone help me out here?

granite sky
#

What are supply points?

cyan thunder
#

@tough abyss if you are using ace, should give you a good starting point - that's what I use for my zeused ops - lets me use VR objects with specific names as spawn points for players to retrieve stuff

tough abyss
#

@granite sky kinda just as a currency. spawning the vehicle isnt too hard. for the time being bis_fnc_findsafepos will do, or even just a marker position

#

@cyan thunder im not using ace for this mission

cyan thunder
#

then steal the bit that gets the spawn points from an object of a specific type with a specifc name ๐Ÿ˜„

#

I do it that way because my players can spawn vics on water, at air ports, fobs etc so it's convenient to just drop a vr marker down with a name like "helo_spawn_2" and the code take care of placing the object there (and checking there isn't already an object there, that the player is close enough and billing them for whatever it was they just spawned, refunding them if they unspawn it)

tough abyss
#

spawning the vehicle isnt my issue. im just going wrong when it comes to the addaction passing over the arguements. and using them in the script.

ive just tried doing it the silly way of making 1 script for each vehichle and it works that way. but ideally it would make sense to use one script. that just takes the arguement values.

#

i havent scripted in a long time. wasnt the best back then either

tulip ridge
#

If you're getting errors, then it could just be a simple syntax issue

covert kestrel
#

I have a question if anyone knows a script for Liberation_RX on Pylon Manager that will work on the server side because the one from basic Liberation doesn't show what mod the missle is from, etc.?

#

I am asking here because the forum is not working

royal quartz
#

Checked this BTW and no it dosnt, as I suspected it checks if your in water and dosnt let you open your inventory. I've managed to get this part of the inventory showing with the below command but I cant find what other elements this is missing.

createDialog "RscDisplayInventory";
meager granite
#

I think you need a wetsuit to use inventory underwater or something?

sharp grotto
flint topaz
sharp grotto
#

Doubt this can be fixed, the engine does these checks so you can't circumvent them.
I guess the only solution is to make your own inventory system replacement for the cases where the player is swimming.

I concepted this, you get the option underwater to transfer the loot, the gear/items are saved as variable, you go on land and drop the sack, then you can unpack it and the gear will be spawned.
https://cdn.discordapp.com/attachments/1045849933858734080/1171241928688414741/image.png?ex=67ec820c&is=67eb308c&hm=4e94414fb71415c730a2942951033c53e0ce714014f7d9b25deb343a193b411a&

pallid palm
#

you can However do a, addaction, for a Diver LoadOut, in a Ammo Box underWater, But you can Not do a addaction for a, Soldier LoadOut, in a Ammo Box underWater, If you try a, Soldier LoadOut, in a Ammo Box underWater, you just get stuck,,,, iv found

#

like you can go underWater as a Soldier, and get a Diver LoadOut from a addaction in a Ammo Box underWater.

#

But Not the other way around

proven charm
#

anyone know why ropeUnwind doesnt work if you attach a man to the rope via ropeAttachTo? the ropeUnwind starts behaving oddly ```sqf
[_target, [0,0,0], [0,0,-1]] ropeAttachTo _rope;

sleep 1;

ropeUnwind [_rope, 20, 0];

pallid palm
#

what! Something behaving oddly in Arma, No No it can't be.

#

sorry m8 i have no idea

hasty ridge
#

Hello, since the forums are down I was directed here to ask about a function Iโ€™ve been having trouble with.

Iโ€™ve been trying to wrangle the BIS_fnc_addSupportLink function for use in a dedicated server. The way itโ€™s set up now once a Blufor enters a trigger the function will be called and give one of the players access to mortars to call in for a section of the mission.

At the moment the issue that Iโ€™m having I figure is a problem of locality since if the trigger is set to โ€˜server onlyโ€™ then I can see in Zeus that the support provider module, support requester module and the player unit are all synched up but the player unit doesnโ€™t get access to the fire support menu. If the trigger is not set to โ€˜server onlyโ€™ then the player does get access to the fire support menu but the function gets called multiple times resulting in multiple support menus.

Iโ€™m still pretty new to making missions for a dedicated server (or really mission making in general) so Iโ€™m at a bit of a loss for what to do at the moment.

hallow mortar
#

I think the workaround is usually to use an invisible physx object as a proxy

proven charm
hallow mortar
#

In CfgVehicles, I would imagine

#

I believe classes inheriting from <something>X are guaranteed to be PhysX, but don't take that as 100% specific

proven charm
#

ok will look thx

proven charm
#

I tried baseball, waterbarrel and "UGV_02_Wheel_F" which all are "ThingX" but still same problem

sharp grotto
proven charm
#

seems that ropeUnwound command is to blame for the problem i have. it returns true too early when something is attached to the rope (and the rope Unwind is slower with attached item)

covert kestrel
#

:/

shy siren
#

Im looking for some help with "Add3DENConnection", does anyone have the list of types or knows of a way to export the function so i can find out the connection types?
the intent is to set up a script that prebuilds a platoon composition without needing to subscribe to a composition.

_arsenalBox set3DENAttribute ["ammoBox",""];
add3DENConnection ["Sync",_arsenalmod,_arsenalBox];

this code above is not working (_arsenalmod is a module spawned earlier in the code)

shy siren
#

Its doesn't give the types, and yes I've looked

winter rose
#

no, but it says where to find them

#

(press " ` ", open Config Viewer, go to Cfg3DEN > Connections)

little raptor
#

why press "`"? (btw with CBA it's Ctrl+D)

winter rose
#

(โ€ฆiirc?)

little raptor
#

yeah I meant you can access the cfg viewer with Alt+G or via Tools menu

#

(in 3den)

winter rose
#

I don't know these fancy shortcuts, I only know Debug Console ๐Ÿ˜„

shy siren
#

Can you paste what it says or send me a screen shot, because I looked and couldn't find it. I'm probably also doing it wrong.

winter rose
winter rose
proven charm
#

is there anyway to detect if headgear is hat or helmet? doing some CBRN stuff

proven charm
#

thats not what i meant ๐Ÿ™‚ I mean im trying to detect if headgear has protection... I'm looking confs for that

stable dune
#
class HitpointsProtectionInfo

?

proven charm
#

thx, didnt find HitpointsProtectionInfo on unsung helmets yet

#

nvm found it ๐Ÿ™‚

thin fox
proven charm
#

code used with apex/unsung seems to work ```sqf
_hgn = headgear player;

_hgConf = configfile >> "CfgWeapons" >> _hgn;

_protection = getNumber (_hgConf >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "armor" );

terse tinsel
#

hello, I have a question why I can't add cannon_railgun using a script to another vehicle??

south swan
#

it's heavily scripted and depends on a second weapon to fire iirc

terse tinsel
terse tinsel
rugged hollow
#

Hey everybody, I'm new to the editor and am struggling right now. Im trying to create a sort of barrier that keeps AI from wandering out of a zone and if they do, are made to walk back into the zone. What I have set up currently is a Trigger that covers the desired area. I titled this trigger "restrictedZone" I then went into the AI unit's attributes and typed into their init this script with the hope of keeping them boxed within the trigger:

[this] spawn {
params ["_unit"];
while {alive _unit} do {
sleep 1;
if !(_unit inArea restrictedZone) then {
_unit doMove (getPos restrictedZone); // Orders AI to walk back
};
};
};

I didn't come up with the script myself, I got it from somebody who knows more than I do. However, the code just doesn't work. It's baffling even my buddy who, while he knows more than I do, doesn't know how to get our desired effect. Does anybody know what could be wrong? Is this method just not a good approach in the least? Does anybody have any suggestions? I'd love to hear from people who have a better understanding than I do.

minor agate
#

Just a Quick Q for people. Are you guys using remoteExec or the publicVariableClient (I have a player list which i loop through to send to all clients if required.) and publicVariableServer? For some reason, with commands like removeAction, remoteExec was just refusing to work properly however with publicVariableClient it worked perfectly. Don't know if i set it up wrong or something

rugged hollow
#

Oh my goodness, I think we finally figured it out, sorry to bother you guys. We were just getting really confused there.

minor agate
#

Okay, so it seems remoteExec works on the server when passing trying to reach all clients however when a client tries to reach all clients, it does nothing? Should this be happening?

hallow mortar
#

Depends on your server/mission CfgRemoteExec settings. There are security options to limit who can do what.

#

However, with commands like removeAction, be aware that the action ID can be different on different machines, so you can't reliably use them directly with remoteExec. The ID on the originating machine (which gets sent with the remoteExec) may not be the same as on the receiving machines, in which case the command won't work as expected. It would be better to use functions to store and retrieve the action IDs locally.

spring stone
#

I feel stupid and I have the feeling the answer is easier than I think:

I want to count the amount of magazines in the inventory of a unit.

I tried:
(primaryWeaponMagazine _unit select 0) countType (magazines _unit);
magazines _unit does clearly have the classname that I get from primaryWeaponMagazine multiple times in it. Still it only returns me 0.

Any idea how I can count the magazines in a units inventory?

hallow mortar
#

countType is for counting objects. Magazines in inventory (as returned by magazines) aren't objects, they're strings.

split scarab
#

How is a variable from initSever.sqfaccessible/readable in initPlayerLocal.sqf
Such as :
gameStarted = false;

It works well for me when I'm the one hosting the mission, but testing with a friend none of the variables are defined for him?

hallow mortar
#

Or, to include secondary muzzles like GLs:

{_x in primaryWeaponMagazine _unit} count magazines _unit;```
spring stone
regal kraken
#

quick quesstion

#

I keep getting 'WRONG # DIRECTIVE' suddenly with the description.ext - i havent touched it in about a week and its suddenly tirggered

#

what did i do

tender fossil
regal kraken
#

apparently its this causing it?

class HC_NP
    {
        name    = "HC: Naval Patrol";

        sound[]    = { "\radios\hc_np.ogg", db - 100, 1.0 };
        title    = "A Naval Patrol is now under your command.";
    };```
#

oh nvm

#

i found it

#

the one before it NEVER had a "

#

fml

tulip ridge
split scarab
pallid palm
#

something specific like this SAA_mapClicked

split scarab
#

Will I still have to broadcast it or does it do that automatically?

granite sky
#

You still have to broadcast. The prefix is just so that your variable names don't conflict with other mods or missions.

split scarab
#

Oh man, scripting for multiplayer is a lot more painful than I remember...

#

Like, I have this which just counts down from X minutes and then ends the game if a target is still alive, but it only ends the game for me and not my mate who joined.. he also doesn't see the sideChat messages?

startHvtCountdown = {
    timer = OB_hvtLastObjectiveTime;
    while { (OB_gameStarted && alive OB_hvtTarget) } do {
        format["Time left:\n%1", [timer, "MM:SS"] call BIS_fnc_secondsToString] remoteExec ["hint", allPlayers];
        if (timer == 0 && alive OB_hvtTarget) exitWith {
            [west, "Base"] sideChat "OPFOR WINS. Game over!"; 
            [east, "Base"] sideChat "OPFOR WINS. Game over!";
            ["OpforHvtWin", false] call BIS_fnc_endMission;
        };
        sleep 1;
        timer = timer - 1;
    };
};
granite sky
#

sideChat is local effect.

#

BIS_fnc_endMission is too, although I'm not sure what happens if you only run it on the server.

shy siren
hazy turtle
#

Hi there, I was wondering if anyone has a convoy script they'd be will to share. You know a random start and finish convoy that needs to be attacked as a task. This convoy stuff is tough, getting the lead vehicle to stay on a raod and the folloowing vehicles to stay close and succefully follow the lead vehicle. OMG days of working on it and I've just scrapped the idea that I am good enough to write anything remotely as clever as this?

granite sky
#

Ours needs a full pregenerated navgrid so it's not an option for a mission transplant.

#

Possibly making the entire convoy a single group and setting them to line formation works well enough, but I doubt it.

#

or is that column? I forget.

warm hedge
#

Fully randomized such is not impossible. I've ever tried to write Dijkstra to achieve similar but I failed to understand the concept

granite sky
#

oh, I have a lot of Dijkstra :P

tulip ridge
granite sky
#

You can do an a-star pretty fast in SQF. Surprisingly.

warm hedge
#

Interesting

granite sky
#

hmm, I guess you could use the road A-star directly. I normally only use that for the spawning logic.

#

If you have a specific path you want a convoy to follow for your mission then I guess you could just build a route with markers.

warm hedge
#

Ye, good thing is road objects can be the keypoints

granite sky
#

Then the principle is that you have a monitor function per vehicle that advances through the waypoints before they're reached (otherwise the behaviour is shitty), and maintains spacing to the vehicle in front by adjusting limitSpeed.

#

huh, missed a few getPos in there.

hazy turtle
#

@granite sky @warm hedge thanks guys, appreciate your interest and help.. It's nice to read it's not a simple task to do in ARMA 3

warm hedge
#

It is just randomize not being simple. You can just use, let's say predetermined WPs and select one of them

hazy turtle
warm hedge
#

One "simple" way is bruteforce multiple start point and end point and see if they consider a reasonable path to drive

#

calculatePath command for more info

granite sky
#

Bear in mind that different vehicle types may prefer different waypoints :/

#

If your start and end points are both on a road within ~100m and there's plenty of space then 99.5% of the time it'll get there. Although my requirements (travels between waypoints in reasonable time) are not the same as "usable for a video that doesn't make people point and laugh".

#

Oh yeah, not including bridges. Those are bugged to hell.

cosmic lichen
#

If you have spearhead you might wanna look in the functions viewer. We have a convoy script.

analog mulch
winter rose
#

(but Forums down)

faint burrow
#

I know, but the original link was asked...

south swan
faint burrow
south swan
#

and dropbox DL link seems to be still active

thin fox
winter rose
regal kraken
#

How do I make an object invisible? I've been trying to figure this out for about half an hour now - I cant even get the object to turn colour

warm hedge
#

hideObject

regal kraken
#

will you sitll be able to shoot it?

warm hedge
#

No

regal kraken
#

is there a way to make objects not penetrable?

#

picture will probably serve better context here lol

#

the engine keeps getting shot out - people kept bitching - but apparently unless its concrete barriers, that shits getting shot out

#

thanks for your quick response though, i'll need to just try mess about with it more

warm hedge
#

And where is the context I can understand and without F's?

south swan
#

is there any reason to not change the damage in event handlers?

regal kraken
regal kraken
digital hollow
#

Try using stuff that would actually stop bullets. maybe the metal target plates

hushed turtle
#

Does sleep 0; wait for one frame?

winter rose
#

I believe it is ignored

#

set e.g sleep 0.001;, usually enough

proven charm
#

whats the fastest way to get Terrain Objects (Houses etc) so that you can save them in savegame and then get them back from loadgame?

#

just saving the object damage state

cosmic lichen
#

nearestTerrainObjects ?

proven charm
#

yeah but how do i get the object id so I can reference that later

#

save it etc

cosmic lichen
proven charm
#

ah i was looking at that but it talks about some "Visitor"

#

id seems to be same at every run

#

no getObjectById though

still forum
#

Terrain objects also have a netId in singleplayer, its just the object id

cosmic lichen
#

There is syntax 4 that uses this id

proven charm
#

nice thx guys ๐Ÿ™‚

cosmic lichen
#

It's weird to use nearestObjects when you already have the unique object id

#

But that's just sqf

still forum
#

Or you just don't, and use NetId instead.

cosmic lichen
#

ah, objectFromNetID

still forum
#

It looks like nearestObject, first searches the object in the terrain cell that contains the position you give it.
If that fails (for example because you pass 0,0,0 like the wiki tells you to), it loads cells and iterates all objects in them, in a 10 cell radius around your provided coordinates

cosmic lichen
#

But why? The ID is unique, so the nearest object is always the one you provide.

proven charm
#

objectFromNetId didnt work for me, i tried: ```
_obj = objectFromNetId (str _id);

#

returns nulls

#

but this worked: _obj = [0,0,0] nearestObject _id;

still forum
proven charm
#

ah i got now what your saying , so I need to use netId first

still forum
# cosmic lichen But why? The ID is unique, so the nearest object is always the one you provide.

Terrain objects are streamed. That means the object might not exist and might first need to be loaded in.
To load in a terrain cell, it needs to know where the cell is at.
The objectId, does not contain that information, so either you provide it otherwise, or it bruteforce loads stuff until it finds it or gives up.

The "full" objectId that netId provides, internally encodes the coordinates of the cell its in.
objectFromNetId will load that specific cell, then iterate the objects in only that cell to find it.

#

netId is 1:[XCellCoordinate,YCellCoordinate,ObjectId]
objectId is only ObjectId.

proven charm
#

so which leads to the question which one is faster? XD

still forum
#

Which is faster, brute force loading terrain and iterating over all objects.
Or loading only the one cell where we know the object is in.

What kinda stupid question is that

proven charm
#

hey how do i know your the dev here

still forum
#

What is faster "Do many X" or "Do one X"
dude

winter rose
#

heeey

proven charm
#

right I reread what you said and i didnt first know if there was more to the nearestObject , like some trick to make it begin searching from right cell.

#

which gave me another question, hopefully not stupid one again ๐Ÿ˜‰ what if I give the correct coords to nearestObject which one is still faster?

cosmic lichen
#

There is an easy way to find that out

#

Profile it.

proven charm
#

true

granite sky
#

nearestObjects used to be faster than nearestObject for a pos -> single object mapping, but I think dedmen fixed that a while back.

#

yeah, it's like 0.0025 vs 0.001 now.

still forum
proven charm
#

with netid my code run: 0.031873 ms with nearestObject with proper search start center: 0.0352395 ms

little raptor
#

getPos is slow :/

proven charm
#

not big difference, but with [0,0,0] center to nearestObject 70.3858 ms <- thats a lot

still forum
proven charm
#

lesson learned don't annoy dedmen nearestObject is not worth it even with stored search center pos, just go with netid

granite sky
#

We only use it for storing buildings in saves, and I'm not sure netID is reliable for that.

proven charm
#

I assume netID works because saving/loading was my original question

granite sky
#

It seems to be persistent for the same mission file, but it's not clear where the ID comes from for mission objects. It's not from the mission file, so I guess there's some algorithmic stuff done on startup that might change by adding objects to the mission.

split scarab
#

I wanna simulate a flare getting launched from the ground, into the air (with slight angle variation), then drift down slowly

Similar to a real flare gun, this is what I currently have but it only flies about a meter or so up before it arcs down and falls pretty fast, if I change the velocity going "up" to more than 100 it has no momentum and drops immediately?

[] spawn {  
    _triggerPos = getPosATL test;
    _triggerPos set [2, (_triggerPos select 2) + 1];
    _flare = createVehicle ["F_40mm_Red", _triggerPos, [], 0, "FLY"];
    sleep 3.05;
    playSound3D ["a3\missions_f_beta\data\sounds\showcase_night\flaregun_4.wss", _triggerPos, false, _triggerPos, 1, 1, 200];
    _flare setVelocity [[0, 10] call BIS_fnc_randomInt, [0, 10] call BIS_fnc_randomInt, 100];
}
hallow mortar
#

10m/s is not very fast (for a projectile) so I'm not too surprised it doesn't go very far

split scarab
#

isn't it setVelocity [x, y, z]?
Z being up?

hallow mortar
#

oh yes, 100m/s Z, I didn't see that because it wrapped to the next line

south swan
#

flares seem to have an awful lot of air friction after they start, well, flaring. May be caused (or not) by their simulation type blobdoggoshruggoogly

hallow mortar
#

Yeah the 40mm flares are meant to fly like normal 40mm grenades until they trigger, then while burning they fall slowly, and their speed is pretty restricted. They don't normally burn while on the "up" part of their trajectory.

#

You could try using a 20mm flare, I think those are more illuminated before they fully trigger.

south swan
#
[] spawn {  
    _triggerPos = getPosATL test;
    _triggerPos set [2, (_triggerPos select 2) + 1];
    _flare = createVehicle ["F_40mm_Red", _triggerPos, [], 0, "FLY"];
    _stone = createVehicle ["GrenadeHand_stone", _triggerPos, [], 0, "FLY"];
    _flare attachTo [_stone];
    sleep 3.05;
    playSound3D ["a3\missions_f_beta\data\sounds\showcase_night\flaregun_4.wss", _triggerPos, false, _triggerPos, 1, 1, 200];
    _stone setVelocity [[0, 10] call BIS_fnc_randomInt, [0, 10] call BIS_fnc_randomInt, 100];
}``` ๐Ÿ™ƒ
hallow mortar
#

You can also trigger the flare immediately (triggerAmmo) rather than leaving it hanging around for 3 seconds waiting to trigger.

south swan
#

"just glue it onto some rock" does help sometimes ๐Ÿคฃ

split scarab
#

Hmm it makes a grenade sound lmao

#

Can I somehow make the GrenadeHand_stone a dud or silent?

granite sky
#

Probably only with config. There might be a better one already though.

split scarab
split scarab
#

Fairs, I'll use sleep instead

eternal ingot
#

can someone help me with a brief.bikb file?

#

or conversations as some of you might know

#

ive been trying for 5 days even using the website but i cant do it

#

pretty please

eternal ingot
#

the thing is is that i have the class brief_TL_Line 1 and brief 01 and all that jazz its just i cant get the code to make a conversation later in the mission in another trigger

#

"Interrupted event" is what i mean

eternal ingot
#

@winter rose ??

#

i took it straight from the site but saying [BIS_fnc_kbTell] actor config param not defined for Interrupted1 in briefing?

summer coral
#

i am in need of help, i need to activate a specific trigger using an ace interaction on a guard that will only activate the trigger if a specific item is in the players inventory. ive been trying to figure out the code but my understanding is lack luster, any help would be apreciated.

fleet sand
# summer coral i am in need of help, i need to activate a specific trigger using an ace interac...

That is easy also you can run code in ace interaction you dont need a interaction to trigger another trigger when you can run code in interaction it self.

Add this in Init of a guard.
To interaction to show up you need a map in your inventory.

private _action = ["TAG_CustomInteraction","Test Interaction","",{
    params ["_target", "_player", "_params"];
    
    hint format ["Hello %1", name _player];
},{
 params ["_target", "_player", "_params"];
[_player, "ItemMap"] call BIS_fnc_hasItem;
},{},[]] call ace_interact_menu_fnc_createAction;
[this, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject;
eternal ingot
#

@fleet sand can you help me with something?

#

can anyone good at scripting help? im on my own here

tender fossil
eternal ingot
#

ive tried about 3 times and no-one answered besides u and lou montana and then he blanked me ๐Ÿ˜ฆ

winter rose
#

you did not ask questions - and I also have a life

eternal ingot
#

the thing is is that i have the class brief_TL_Line 1 and brief 01 and all that jazz its just i cant get the code to make a conversation later in the mission in another trigger
"Interrupted event" is what i mean

#

can someone help me with a brief.bikb file?

#

questions

winter rose
#

can someone help me with a brief.bikb file?
most likely

#

answer

fleet sand
eternal ingot
#

@fleet sand so say now if i put down a trigger for a starttalk.sqf but i wanted another sentence later in the mission what coding would that be cause ive tried videos and the website and i just cannot do it it seems impossible

#

is it a class interrupted code or?

fleet sand
eternal ingot
#

so if i wanted to say hi,how are you and a im good for one trigger,But after say 2 tasks completed it says retreat to base after a trigger being activated,does that make sense?

#

i just done know or cant find the code for it in a brief.bikb

fleet sand
#

It should be easy have 2 conversetions.
1, Start the conv: hi how are you ect....
2. do the mission and have a codition is mission completed var
3: If the mission is compleated start 2nd convesetion.

eternal ingot
#

i have a class hello1 and all the stuff you can see on the website i can do all that,What i cant do is e.g syrian warfare or cold war rearmed where they have a little convo at the start of the mission and the end,Thats my mission but i simply cannot do the code cause its either wrong or crashes my game

eternal ingot
fleet sand
#

Here is even example:

class CfgSentences
{
    class MissionName
    {
        class Breafing
        {
            file = "Convo1.bikb";
            #include "Convo1.bikb"
        };
        
        class ReturnToBase
        {
            file = "Convo2.bikb";
            #include "Convo2.bikb"
        };
    };
};
["Breafing", "MissionName"] call BIS_fnc_kbTell; //start convo 1
["ReturnToBase", "MissionName"] call BIS_fnc_kbTell;// start convo 2
eternal ingot
#

so this will allow me to have 2 convo`s on different triggers and they wont speak over each other unless im in that certain trigger?

fleet sand
eternal ingot
#

so yes i can now have 2 convos with 2 different triggers even if their across the entire map?

#

without interference of each other

fleet sand
eternal ingot
#

ya i use two different units with different names and refer to them in the code by their name so that there wont be 5 people talking at the same time even tho arma wont let you use the same variable name twice

#

so 1 unit is SQL

#

TL

#

ETC...

#

and 1 more thing,In the starttalk.sqf file i have ["Briefing", "ConversationsAtBase"] call bis_fnc_kbtell; will i need to add another with convo 2 and conversationsatroad for example?

fleet sand
eternal ingot
#

i think you meant another starttalk.sqf? cause thats where the first convo is and it works

#

and then i put what starttalk.sqf2 into a trigger on activation?

fleet sand
eternal ingot
#

oh so if i just walk into a trigger with this coding in the on activation it will use my voice lines and all that stuff without overlapping? and then use convo 2 etc in another?

eternal ingot
#

ok im gonna try and get back to you if i have any problems,Thanks for the help pal

fleet sand
eternal ingot
#

sorry the grammar is hard to understand i dont understand that

fleet sand
#

Use spawn for kbtell ๐Ÿ˜„

eternal ingot
#

so it will still work the same its just different wording?

fleet sand
eternal ingot
#

oh so spawn make sure that convo at base goes first and then any other goes after that just unless it says spawn in the on activation in a trigger?

eternal ingot
#

what about scriptDone?

#

or terminate _script;?

#

@fleet sand ?

fleet sand
eternal ingot
#

so ur telling me that i need to use spawn instead of call,And if i want another trigger for convo2 spawn doesnt work

eternal ingot
#

so i looked at the link u sent and saw scriptdone

fleet sand
#

all i did was switch call with spawn that is all you need to do nothing else the link i send you tells you the diffrence about call and spawn.

eternal ingot
#

so if a had 2 triggers with the spawn coding it will just work?

eternal ingot
#

@fleet sand nope,Its saying i dont have ConversationsAtBase in Cfgsentences

#

do i a unit to be called KB?

silent cargo
#

Is there a way I could prevent people from accessing a drone by using a weapon assembled event handler for drone bags? Everything I see in relation to UAV connectivity is local only.

After the most recent arma update they allowed access to drones even when someone has a terminal connected to it so people are just stealing drones all the time.

#

Any help would be greatly appreciated

#

I basically want to set ownership to a drone to the player who assembled it. And prevent other players from connecting to said drone with their terminals.

sharp grotto
eternal ingot
#

@fleet sand its saying the first line i have in the first bikb file but thats it and if i go to the other file it says ConversationsAtBase not found in CfgSentences?

#

i might just give up tbh i cant be arsed anymore with this stupid games cdoding

pallid palm
#

dont ever giue up m8 keep fighting

round bison
#

Here's my idea: I want an ACE arsenal compatible custom smoke grenade that will allow my players to call for logistics support on the position of the smoke. Once deployed, the smoke needs to trigger a script to make a helo spawn some distance away (it can be random), fly to the smoke with an underslung cargo box of some kind, drop the box, fly away, and despawn.

The purpose is to take the "support" modules found in zeus /eden and give control to the squad leader of when and where without relying on Zeus to do so, increasing immersion and decreasing load on GM.

I've researched a little and not found a mod that does quite what I'm looking for. So far, I've been able to make a 40mm custom ammo type, but having trouble with the thrown varient. My plan was to use the 40mm variant as a basline for incorporating artillery and adding area markers to the map automatically but haven't made it that far yet.

warm hedge
#

You can "just" use Fire EventHandler to detect if the thrown grenade is the one you look for, either on the player unit or grenade class. I don't know how really Zeus modules work, but detection can be done for sure

round bison
warm hedge
#

SQF 101: don't bring GPT

#

LLMs are, at least this point, unreliable as hell

round bison
warm hedge
#

Either it is ChatGPT or Grok or, anyways, LLMs doesn't know what will or will not work either

#

We know, on the other hand

round bison
formal grail
#

I use copilot in vscode. It's occasionally pretty good, especially when I'm playing in vector-math-land, or just generally when refactoring stuff, but it can make egregious mistakes mostly in:

  1. It can often forget about sqf's syntax for binary operators. (Instead of a operator b, it often does operator [a, b].)
  2. Never trust it to call the right functions. It will sometimes invent non-existent functions.
  3. It's not mp/scheduler-aware, like, at all.
  4. When refactoring, it will sometimes just repeat your code with very minor variation.
    If you use it as a new coder, it may send you down the wrong path into hours of fruitless debugging, but that said, it's super convenient and I hate hate haaaaate that I can't use something like it in reforger because they insisted on controlling the entire IDE experience with their dsl.
remote trail
#

is it possible to make an object take damage that normally doesn't register damage

#

I'm trying to make a shield wall that breaks (gets hidden) after players destroy it but the object im using doesn't take damage

icy ridge
remote trail
#

its a modded shield wall

#

and basic smallarms

#

I did a workaround by just hiding the object after it takes damage

#

however it only takes one shot which i dont like

hushed turtle
#

Is is possible to prevent Workshop scenario from appearing in Scenarios list in game if required mods/DLCs aren't loaded?

hushed turtle
remote trail
#

im quite new to scripting so how would i accomplish that?

#

currently I'm using simple lines of code in the 3den events tab

winter rose
hushed turtle
icy ridge
remote trail
#

pretty much

hushed turtle
remote trail
#

yup

icy ridge
# remote trail pretty much

If you want it to take a set amount of hits to destroy, you could simply have a setVar count the taken hits and hide it upon reaching a certain threshold. That would be the simplest solution.

It would, however, count every shot the same. In other words a shot from a 9 mm handgun would have the same "effect" as a shot from a 120mm APFSDS fired from a MBT.

#

If you want more sophisticated damage handling it would be helpful if the object had a damage attribute (which it should anyways)

remote trail
#

I'll give it a try tmrw thnx

proven crown
#

How can I limit Ace Arsenal options for different roles?
I am working on a small team-based multiplayer gamemode, with different roles (e.g. rifleman, sniper, pilot, etc.) and for that I need to limit what each role can choose in the in Arsenal.
I've tried grom restricted arsenal mod but can't get it to work for any role other than AT rifleman.

broken pivot
#

Hey people. Ive got a localisation issue.

Im using this script:

_komplex_sascha_obj6 = createVehicle ["Land_SharpRock_spike", [9127.38,12214,0.441002], [], 0, "CAN_COLLIDE"];
_komplex_sascha_obj6 enableSimulationGlobal false;
_komplex_sascha_obj6 setPosATL [9128.13,12214,0.562561];
_komplex_sascha_obj6 setDir 283.982;

to spawn the rock. I will send 2 pictures. The first one will show the rock how it should be. The second will show how the rock is spawned.

#

How it should be:

#

How it is:

winter rose
#

try setDir before setPosATL?

broken pivot
#

Im into it. Will rewrite the auto script:

#

Used code:

_komplex_sascha_obj6 = createVehicle ["Land_SharpRock_spike", [9128.13,12214,0.562561], [], 0, "CAN_COLLIDE"];
_komplex_sascha_obj6 enableSimulationGlobal false;
_komplex_sascha_obj6 setDir 283.982;
_komplex_sascha_obj6 setPosATL [9128.13,12214,0.562561];
// setVectorDir ;
sleep 0.5;

Results: nope

#

Im into this one rock since 4 hours meanwhile...

#

# Could it just be impossible? Ive tried normal setPos Ive tried setPosATL/ASL Ive tried to spawn with and without simulation Ive rescheduled the order of the detail commands like setDir multiple times. I even tried to spawn it as simple object. Also if I copy the cords manually Its still the same result. Also if I use the grids to place it to only get naturall numbers it changes a fuck

icy ridge
#

It's fairly unclear to me from the screenshot what exactly the intended result is

broken pivot
#

Focus the rock in the middle

#

The one that just blocks the way in maximum

broken pivot
icy ridge
#

A bit, yeah ๐Ÿ˜…

hallow mortar
#
  1. the original rock is rotated in 3D; your created one is only rotated in 2D. You need setVectorDir or setVectorDirAndUp.
  2. I don't think your position is correct. The original rock appears to be more than ~0.5m above the ground, but your provided position only has ~0.5m Z (altitude ATL)
broken pivot
#

Thats a cave. And the rock with the skull is from vanilla Arma. So it wont move. But everything else just spawns to far left. Thats why the vanilla rock just shows up in the middle of the way in final result

icy ridge
#

Well I can't say for sure but I can definitely try to find a solution if i understand how it is supposed to look

broken pivot
#

Ill do a short vid 4 you

#

My mic doenst got detectet. Just imagina a aggressive german dude try to behave and explain chilled hahahaha

#

Are there any open questions from you about my problem and what exactly isnt working?

icy ridge
#

Well for testing purposes it would be very helpful to have the relative rocks to either side. Could you perhaps share the editor attributes for those?

#

So it's easier to tell if a solution actually fixed the issue

#

The ones left/right of the one that isn't spawning correctly

broken pivot
#

You want the .sqf?

icy ridge
#

I mean sure that'd also work

broken pivot
#

You wanna come around at teamspeak? We are with 4 people here tryna solve the problem

#

Ill send .pbo via dm

icy ridge
icy ridge
winter rose
broken pivot
#

Life is wasted now. Im into Arma since Im 11. Now Im getting 22 in 22 days lol. And Im not planing to leave โค๏ธ

broken pivot
#

# Update:
Everything is ricked.

If we launch the script isolated it works.
If we then build the part into the existing script it wont work.
If we clear the existing script so that the isolated versions runs lonely in the
existing script it also wont work.
But if we then remove the setPosATL it works

In germany we say hรครครครครครครครครครครครครครครครครครค????
in eng: dafuq lol wtf my head explodes

winter rose
#

maybe some other script is toying with it, who knows

proud dome
#

Is there any function to get the object/vehicle that someone is currently targeting via sensors/radar panel?

thin fox
#

send me a dm

broken pivot
# winter rose maybe some other script is toying with it, who knows

Weve tested this in a new scenario.
# Solution:
Weve compiled it to a fnc to launch it with "call" and skip the pre compiling of execVM. I dont like the solution cause of performance..

Reason:
Weve players that play the game since +22 years and they have no clue..
BUT if we defined the setPosATL before the setDir the issue is happening...

warm kestrel
#

I recall seeing some units in a VR scenario flash and fade out when 'dead'. Is there any way to replicate that effect with a script?

hushed turtle
#

How to fire flares?

[minomet, "Sh_82mm_AMOS", 100, 24, 10] spawn BIS_fnc_fireSupportVirtual;
Works for fire support

[minomet, "Flare_82mm_AMOS_White", 100, 24, 10] spawn BIS_fnc_fireSupportVirtual;
Does nothing

proven charm
thin fox
hushed turtle
#

How to do that? I've spent while on flares already looking through config for correct name and nothing worked. Have no idea why it doesn't work

proven crown
eternal ingot
hushed turtle
proven charm
#

stupid question but did you try at night time?

hushed turtle
#

Of course

proven charm
#

k

#

is the light object created but not visible?

#

like not null

#

ugh nvm you already said that

thin fox
#

spawned in the air and such?

#

you have to setVelocity or something aswell to the flare

little raptor
hallow mortar
eternal ingot
#

@hushed turtle so you want a 82 flare to go up?

hallow mortar
winter rose
#

triggerAmmo perhaps

hushed turtle
#

Thanks! triggerAmmo works

verbal ravine
#

I'm wanting to a fun late april fools missing with some of the folks I play with. To really sell the gag I'd like to be able to display the mission end screen that pops up. The one with the graphical glitches and the music sting. The idea is that it's a fake-out and the mission will continue.
I've been looking through the documentation and can see that you can trigger the end game screen, but it seems to be linked to actually ending the mission and sending everyone back to the lobby.
Is there a way to use that graphic without ending the mission fully?
I can fall back to creating a simple ui pop up, but to really sell it I want it to appear like it's over

dusty steppe
verbal ravine
#

Yes that's what I mean. Great that there's a example of it. I'll take a look. Thank you!

icy ridge
#
[] spawn {
_end = "end1";
_win = true;
_playmusic = true;
_layerNoise = "BIS_fnc_endMission_noise" call bis_fnc_rscLayer; 
  _layerInterlacing = "BIS_fnc_endMission_interlacing" call bis_fnc_rscLayer; 
  _layerStatic = "BIS_fnc_endMission_static" call bis_fnc_rscLayer; 
  _layerEnd = "BIS_fnc_endMission_end" call bis_fnc_rscLayer; 
  {_x cuttext ["","plain"]} foreach [_layerNoise,_layerInterlacing,_layerStatic,_layerEnd];  
 
  if (_playmusic) then { 
   _musicvolume = musicvolume; 
   0.2 fademusic 0; 
   sleep 0.2; 
   _musicList = if (isnull curatorcamera) then {["EventTrack02_F_Curator","EventTrack01_F_Curator"]} else {["EventTrack02_F_Curator","EventTrack03_F_Curator"]}; 
   playmusic (_musicList select _win); 
   0 fademusic _musicvolume; 
   sleep 0.4; 
  }; 
 
  setacctime 1; 
  _layerStatic cutrsc ["RscStatic","plain"]; 
 
  sleep 0.3; 
  if ((missionNamespace getVariable ["BIS_fnc_endMission_checkAliveState",true]) && !ismultiplayer && !alive player) exitwith {{_x cuttext ["","plain"]} foreach [_layerNoise,_layerInterlacing,_layerStatic,_layerEnd]}; 
 
  showhud false; 
  RscMissionEnd_end = _end; 
  RscMissionEnd_win = _win; 
  _layerEnd cutrsc ["RscMissionEnd","plain"]; 
 
  sleep 9; 
  if ((missionNamespace getVariable ["BIS_fnc_endMission_checkAliveState",true]) && !ismultiplayer && !alive player) exitwith {{_x cuttext ["","plain"]} foreach [_layerNoise,_layerInterlacing,_layerStatic,_layerEnd]}; 
 
  RscNoise_color = [1,1,1,0]; 
  _layerNoise cutrsc ["RscNoise","black"]; 
  _layerStatic cutrsc ["RscStatic","plain"]; 
 
  sleep 0.5; 
  if ((missionNamespace getVariable ["BIS_fnc_endMission_checkAliveState",true]) && !ismultiplayer && !alive player) exitwith {{_x cuttext ["","plain"]} foreach [_layerNoise,_layerInterlacing,_layerStatic,_layerEnd]}; 
 
  RscNoise_color = [1,1,1,1]; 
  _layerInterlacing cutrsc ["RscInterlacing","plain"]; 
 
  2.5 fadesound 0; 
  2.5 fademusic 0; 
 
  sleep 2.5; 
  if ((missionNamespace getVariable ["BIS_fnc_endMission_checkAliveState",true]) && !ismultiplayer && !alive player) exitwith {{_x cuttext ["","plain"]} foreach [_layerNoise,_layerInterlacing,_layerStatic,_layerEnd]}; 

  0 fadesound 1; 
  0 fademusic 1;
  showhud true; 
};
#

This is taken (just slightly tweaked) directly from the actual end mission function (just slightly trimmed down and without the actual mission closing)

#

That should work for an april fools scare

eternal ingot
#

@icy ridge can you help me with conversation scripting by any chance?

#

its nothing major hard i just dont know how to do it

eternal ingot
#

could i do pm by any chance to make it easier

icy ridge
#

Sure, just add me as I've got DM set to friends only

eternal ingot
#

put in 0 = execVM "SQF FILE"

#

@gusty quartz

gusty quartz
#

nvm I'll figure it out, hopefuly

icy ridge
tulip ridge
pallid palm
#

yeah thats what i was thinking

#

just do this [] execVM "some place\some script name.sqf";

#

or [] execVM "some script name.sqf";

#

NikkoJT can tell you why we dont use the 0= or the nul= any more

#

i remember it was something like the game used to freekout if it was not there but, its been fix for a long time now

#

and hello @tulip ridge how are you brother

eternal spruce
#

how do I Increase the volume of a cfgSound

class APUStartup { name = "APU_StartUp"; sound[] = {"sound\APU_Start_Up.ogg", 500, 1, 0, 0, false}; };

pallid palm
#
class CopyBeThereNoTime
    {
        name = "CopyBeThereNoTime";
        sound[] = {sound\CopyBeThereNoTime.ogg, db-7, 1.0};
        titles[] = {0, ""};
    };
#

db+ or - whatever

tulip ridge
#

Also use ``` for code blocks
```cpp
Code
```

This is also for scripting, not config

eternal spruce
eternal spruce
#

Anyone knows what I did wrong? I wanted to play an alarm from multiple speakers but I'm getting an error that I'm missing a ;

{say3D ScrambleAlarm _x} forEach _scrambleAlarm;```
tulip ridge
#

You're using say3d wrong

#

It should be _object say3D "CfgSoundsClass"

grand stratus
#

Guessing there's no way around it, but I'm guessing the game doesn't render while the map is open, and thus r2t on UI controls within the map display won't update even thought you can still move your character while in the map. Have to re-open the map to get little snapshots.

tepid hemlock
#

With the rise of the FFB (Force FeedBack Sticks (Moza, Rhino, WinWing, Maybe Virpil next year), are there any projects in regards to better FFB support and maybe share telemetry with outside tools?
There is basic support in Arma+Helis. So you get the vibration and some minor feedback fromt he rotor (spooling up/down). With Helisim coming to the AH64 Project and soon Hatchet MH60, some additional effects would be great.
Is there any documentation how and which effects are actually in the game?

verbal ravine
icy ridge
broken pivot
#

Hey there ๐Ÿ˜„ Im bringing a simple question with (hopefully) a simple anwser.

Ive created patrouls and units and customized their pathing. Now Im looking for a
way to bring those waypoints to the headless clients we are using. How do I do this?
(using ACE/CBA etc.)

#

# Code:

//Group
_sascha_ptr1 = createGroup east;

//Patroul
_sascha_ptr1_1 = _sascha_ptr1 createUnit ["rhs_msv_emr_driver", [16414.1,16161,-0.105804], [], 0, "CAN_COLLIDE"];
_sascha_ptr1_1 setPOSATL [16414.1,16161,-0.105804];
_sascha_ptr1_1 setDir 0;
_sascha_ptr1_2 = _sascha_ptr1 createUnit ["rhs_msv_emr_medic", [16418.8,16160.3,0.0795641], [], 0, "CAN_COLLIDE"];
_sascha_ptr1_2 setPOSATL [16418.8,16160.3,0.0795641];
_sascha_ptr1_2 setDir 0;
_sascha_ptr1_3 = _sascha_ptr1 createUnit ["rhs_msv_emr_rifleman", [16416.7,16160.5,0.052433], [], 0, "CAN_COLLIDE"];
_sascha_ptr1_3 setPOSATL [16416.7,16160.5,0.052433];
_sascha_ptr1_3 setDir 0;

//Waypoints
_sascha_ptr1_wp1 = _sascha_ptr1 addWaypoint [[15936.7,16173.7,-0.000358582], 0, -1, "start"];
_sascha_ptr1 setSpeedMode "LIMITED";
_sascha_ptr1_wp1 setWaypointType "SAD";
_sascha_ptr1_wp1 setWaypointBehaviour "SAVE";
_sascha_ptr1_wp1 setWaypointFormation "COLUMN";
_sascha_ptr1_wp2 = _sascha_ptr1 addWaypoint [[15802.6,16335.9,3.05176e-05], 0, -1, "start"];
_sascha_ptr1_wp2 setWaypointType "SAD";
_sascha_ptr1_wp3 = _sascha_ptr1 addWaypoint [[15845.2,16492.4,-3.05176e-05], 0, -1, "start"];
_sascha_ptr1_wp3 setWaypointType "SAD";
_sascha_ptr1_wp4 = _sascha_ptr1 addWaypoint [[15802.6,16335.9,3.05176e-05], 0, -1, "start"];
_sascha_ptr1_wp4 setWaypointType "SAD";
_sascha_ptr1_wp5 = _sascha_ptr1 addWaypoint [[15936.7,16173.7,-0.000358582], 0, -1, "start"];
_sascha_ptr1_wp5 setWaypointType "SAD";
_sascha_ptr1_wp6 = _sascha_ptr1 addWaypoint [[15936.7,16173.7,-0.000358582], 0, -1, "start"];
_sascha_ptr1_wp6 setWaypointType "CYCLE";
proven charm
#

so why do you want HC?

broken pivot
#

Performance

proven charm
#

is your mission so big it lags?

broken pivot
#

Is this important to know to help me?

proven charm
broken pivot
#

Wow thanks for the not help... You really think Im asking in here without trying to solve it with these...
Im to dumb for this haha. Ive did everythink like theyve said... Nothing

proven charm
#

well im sorry for not being able to help you but i know very little about HCs. the link is the best i could come up with

broken pivot
#

Thats really fair from you brother ๐Ÿ˜„ I love honest people

#

# Update:
Ive now talked to a german friend. We were able to find out that the HC not caring about the local commands we insert. Changed -> Works for patrouls

The major problem that stays is that static AIs from buildings and stuff are regrouping and ignoring:

{_x disableAI "PATH"} forEach units sascha_ziv;                                //Pfadfindung deaktivieren
{_x setUnitPos "UP"} forEach units sascha_ziv;                                //Haltungsรคnderung deaktivieren

(Thats really bad)

tulip ridge
#

You need to call disableAI after they've been moved to the headless client.

broken pivot
#

Alright so I remember to read something about if hasInterface or some ๐Ÿ˜„ Am I on the right track or is it the wooden path? hahaha

tulip ridge
#

No

#

It's going to be different for whatever headless client framework you're using

broken pivot
#

Need to google about the meaning. I dont know what headless client framework is

#

hmmm Im not sure but is it the method we are transfering the AI to the Headless?
If so: We are using Liberation wich did everything automaticly unit this point. (Also we have ace available -> I saw something about headless in there)

#

Was this your question?

broken pivot
#

Ive found something:

if (!hasInterface) then
{
    hint "IsHeadless";
} else {
    hint "IsNotHeadless"
    };

I hope to somehow find out how to get a true value only on headless clients.

Im really confused at the moment. If you look at Photo1 you will see that Im checking for NotHasInterface. But Im getting a false value so the AI im checking did got an interface...
Am I wrong or how is that possible?

#

@hallow mortar please bring me an idea hahaha

hallow mortar
# broken pivot Ive found something: ```sqf if (!hasInterface) then { hint "IsHeadless"; } ...

hasInterface doesn't detect whether the unit has an interface - note that you don't specify a target object for the command to check. It simply detects whether the machine where the command is executed has an interface. That code is being run on your machine, and you have an interface. (Actually, you're using the Global locality target for that field, so it's being run on all machines, but hint is Local Effect so you only see the result for your machine)

broken pivot
#

Wow. Im speechless. Thank you. Lets work with the new learnings ๐Ÿ˜„ Thanks mate. Thats really logical

hallow mortar
#

Change from the G (Global) to the T (Target) locality setting at the top right corner of the ZEN object init field. This will make the code only run on the machine where the object is local. Then change the hint to be remoteExec'd so it shows the result on all machines.

#

(this isn't the best way to do most things, but it'll give you an accurate result for this test)

broken pivot
#

Ive to learn about remoteExec. I fairly achieved the knowledge about call/execVM and compiling things yesterday..

#
if (!hasInterface) then
{
    remoteExec ["hint IsHeadless", 0 ,true];
} else {
    remoteExec ["hint IsNotHeadless", 0, true];
    };

Thats the status. But Im not getting a hint..

hallow mortar
#

https://community.bistudio.com/wiki/remoteExec
Make sure you read the examples.

"isHeadless" remoteExec ["hint"];```
You don't need to specify target `0` because that's already the default. You don't need to add JIP `true` because you don't need this to run on JIP machines when they connect.
broken pivot
#

Im literly reading the examples at this second

hallow mortar
#

Correct remoteExec formatting:

_leftArgument command _rightArgument;
[_leftArgument, _rightArgument] remoteExec ["command"];
// ..
command _oneArgument;
_oneArgument remoteExec ["command"];
// note: UNLESS that one argument is an array. Then you do have to still put it in another array, otherwise it'll think you're trying to do multiple arguments.```
broken pivot
#

So this is more correct:

if (!hasInterface) then
{
    ["IsHeadless"] remoteExec ["hint", 0 ,true];
} else {
    ["IsNotHeadless"] remoteExec ["hint", 0, true];
    };   

used code:

if (!hasInterface) then
{
    ["IsHeadless"] remoteExec ["hint"];
} else {
    ["IsNotHeadless"] remoteExec ["hint"];
    };```


**This creates an output**
tidal idol
#

Anyone know a way to get the reload time between individual shots of a vehicle weapon? Need to do some math in a script, but there doesn't seem to be a way that doesn't involve config lookups and prayers that nothing breaks

hallow mortar
broken pivot
#

Copy confirm. Noticed that. I was just tryna understanding the cmd haha

Now Im building it into the right placw

proven charm
#

anyone know a nuke script i can use? I'm mainly interested about the visuals and maybe blast damage, everything else I can script my self

broken pivot
#

I think enhanced Zeus brings a nuke with it

proven charm
#

oo, but im not using zeus

broken pivot
#

# Update:
Ive now bulit in the script and transformed it in the way I need it:

if (!hasInterface && !isDedicated) then
{
    {_x disableAI "PATH"} forEach units sascha_ziv;
    {_x setUnitPos "UP"} forEach units sascha_ziv;
    ["HeadlessConfigurated"] remoteExec ["hint"];
} else {
    ["HeadlessCantBeConfigurated"] remoteExec ["hint"];
};

The Problem:
The AI dont give a fuck about "disableAI" lol hahaha

#

The creation of the "sascha_ziv":

sascha_ziv = createGroup Civilian;    

sascha_ziv1 = sascha_ziv createUnit ["C_man_1", [16084.5,16235.1,0.535572], [], 0, "CAN_COLLIDE"];
sascha_ziv1 setPOSATL [16084.5,16235.1,0.535572];                                                //[X,Y,Z] von createUnit verwenden um Positionierung sicher zu stellen
sascha_ziv1 setDir 0;                                                //DREHUNG = 1-360
sascha_ziv2 = sascha_ziv createUnit ["C_man_1", [15896.2,16286.4,0.637274], [], 0, "CAN_COLLIDE"];
sascha_ziv2 setPOSATL [15896.2,16286.4,0.637274];                                                //[X,Y,Z] von createUnit verwenden um Positionierung sicher zu stellen
sascha_ziv2 setDir 0;                                                //DREHUNG = 1-360
sascha_ziv3 = sascha_ziv createUnit ["C_man_1", [15897.7,16308.5,3.9948], [], 0, "CAN_COLLIDE"];
sascha_ziv3 setPOSATL [15897.7,16308.5,3.9948];                                                //[X,Y,Z] von createUnit verwenden um Positionierung sicher zu stellen
sascha_ziv3 setDir 0;    

...
...
...
...

Im really runing out of ideas.

#

Im thinking about to remoteExec the _x disableAI part. That will be funny with the missing experience on the cmd haha -> LETS GO

News:

[{_x disableAI "PATH"}] remoteExec ["forEach units sascha_ziv"]; ```
This achieved to stop the group leader...
#

Hey @stable dune, nice to see you around ๐Ÿ˜„

broken pivot
#

Do you maybe have experience with remoteExec and maybe have time/ the motivation to help me to fix my command?

broken pivot
#

Im even more confused because the group leader dont move but its units. I think Ive then did it with another try cry

broken pivot
#
if (!hasInterface && !isDedicated) then
{    
    {_x disableAI "PATH"} forEach units sascha_ziv;
    {_x setUnitPos "UP"} forEach units sascha_ziv;
    ["HeadlessConfigurated"] remoteExec ["hint"];
} else {
    ["HeadlessCantBeConfigurated"] remoteExec ["hint"];
};

Can someone say if this is possible? Im getting crazy... Im into this now for 8 hours in a row.. the second day in a row...

proven charm
earnest ether
proven charm
#

will credit you ofcourse

broken pivot
#

Does anyone know somebody who could help me? Im despairing...

granite sky
broken pivot
#

@granite sky please be my hero

#

Waypoints already work in this way. But the disabledAI just fuck my face and go to its group leader

granite sky
#

disableAI is local effect and needs to be executed wherever your AIs end up.

#

If you don't have control over that then you'll have to run it everywhere.

broken pivot
#

So I need to put the script on the headless client FTP?

granite sky
#

Well, do you have control over where your AIs are?

broken pivot
granite sky
#

I mean are you spawning your AIs on specific machines, or are you relying on some black-box mod to transfer them from the server?

atomic niche
#

...

broken pivot
#

Ive tried

#

I need someone who could explain for me

broken pivot
atomic niche
#

If thats the sqf ur putting into debug console ur spawning the AI on your machine. so when the HC runs disableAI it doesn't do anything bc the HC doesn't control the AI

granite sky
#

Oh, this conversation starts further back than I thought. Never mind.

broken pivot
#

Yeah Im trying to get into .sqf and DigitalReality since a while. So Ive clue about some parts but Im never sure..

broken pivot
atomic niche
#

and running

if (!hasInterface && !isDedicated) then
{    
    {_x disableAI "PATH"} forEach units sascha_ziv;
    {_x setUnitPos "UP"} forEach units sascha_ziv;
    ["HeadlessConfigurated"] remoteExec ["hint"];
} else {
    ["HeadlessCantBeConfigurated"] remoteExec ["hint"];
};

as global exec in debug console doesn't stop the AI from moving?

broken pivot
#

Nope

granite sky
#

sascha_ziv would need to be published...

atomic niche
#

actually isnt it move to disable them moving?

broken pivot
#

Ive already tried to only run the

    {_x disableAI "PATH"} forEach units sascha_ziv;
    {_x setUnitPos "UP"} forEach units sascha_ziv;

part

#

Path works in Editor enviroment. And as long they are not taken other by the headless

#

Lets try move haha

atomic niche
broken pivot
#

Those civs getting sporty haha
But sadly Im runing this on the server

atomic niche
#

yes but where did you run this

sascha_ziv = createGroup Civilian;  
broken pivot
#

its part of the "execVM "EBER\Erweiterungen\AnthrakiaVillage\Erweiterung.sqf";" Im runing through the server to start everything

atomic niche
#

yes so server knows sascha_ziv but the HC's dont

atomic niche
#

you need this

broken pivot
#

Ahhhhh

#

Ohhhhhh

#

click

atomic niche
#

and even after u do that, I would not be surprised if that group is empty after liberation moves over all the AI to the HC

broken pivot
#

So next logic step for me is to ask how I publish these units in the correct way

granite sky
#

It's hard to talk about this because there are two meanings of global/local :P

broken pivot
#

WHAAAT??? Its getting worse hahaha

granite sky
#

But in general to publish a variable everywhere you do publicVariable "variableName";

broken pivot
#

So I will need to supplement the publicVariable command beneath the createGroup thingy, right?

winter rose
#

there is global/local variables (code scope), and "public" variables (as in updated over the network)

broken pivot
#

Ouuu those are the scopes. Ive read multiple times about it. So there is a outer scope of the "normal" global -> sascha_ptr = exampleForSimpelGlobalScope

granite sky
#

Just publicVariable "sascha_ziv"; after the createGroup would probably work.

broken pivot
#

I feel released. Lets try out to confirm haha

dark pecan
#

Hello everyone. I'm sorry this might be a recurring question or could be a joke. I have found and have been using a drag script for uncouscious teammates for a while, but would like to have one that gives me the ability to carry the uncouscious teammates as well. I'm just looking for some guidance to the script.

Thank you very much for the patience.

granite sky
#

Not actually seen that in A3. Might be lacking a suitable animation.

broken pivot
#

I really would like to help you in full size to give something back to the community.. But Im not sure enough
But my first thought is that its impossible (in vanilla) because of the missing animation, @granite sky is talking about.

I gues you dont like the mod, if you arent using it already, but ace3 contains these features
Otherwhise you could implement your own animation with a mod or own animation composition.

and if your still planless I can connect you with germans who are longer in Arma then Im alive
but they only understand german..

Disclaimer: This is all theoretical

granite sky
#

Oh yeah, my brain is going and ACE does have carry as well as drag.

spring bone
#

Does anyone know how to change a name of an existing respawn from zeus?

Can't check forums as they have been down for a long time...

broken pivot
#

Are you talking about those respawn points?

spring bone
#

Yes (placed via zeus not the eden)

granite sky
spring bone
#

normally they appear like this

#

(via zeus)

broken pivot
#

Hmm, I gues that they become part of the mission after placeing so that you would have to add them again to Zeus with a script or mod like zeus enhanced

spring bone
#

Zeus enhanced or additions dont allow me to change it, if i knew what params to run to change in their exeuction

broken pivot
#

My brain is smoking ... So if I got you right, your not getting editing options from "add to zeus"
Im honest if I get an idea Ill let you know but Im kinda done from my own thing Im doing since 11 hours..

But never give up and stay persistent in this channel / BI-Forum but always nice of corse
The only thing I could do is guesing. I really want to help but its to dangerous for me to waste your time

dark pecan
granite sky
#

It's well documented. You can see the animations they use and the conditions on them.

#

Only issue is that you don't have ACE_fakePrimaryWeapon

split ruin
#

When you try to make server/mission for your friends but you have less than 100 hours in the game ...

dark pecan
#

I believe the ace drag system is more complicated although, as you mentioned is well documented. That's why i was more looking to see if somebody already made something for A3 without ACE3

broken pivot
#

noob question
Becomes an if-cause an iteration without an else option until the bool turns true?

granite sky
#

An if doesn't wait. It executes the code if the condition is true, and skips it if not.

#

If you want to wait for a condition to become true then you use waitUntil, or while + sleep. Only valid in scheduled code though.

tender fossil
# broken pivot *noob question* Becomes an if-cause an iteration without an else option until th...

I was just thinking... If you want to learn basic principles of programming, here's a completely free programming course with lecture recordings and most importantly, hands-on approach with lots of programming exercises with automated tests so that you can try to complete the exercises at any time. The tests also give you feedback. Once you've learned the basics, it's much easier to script more or less advanced functionality in Arma ๐Ÿ‘ https://programming-25.mooc.fi/

broken pivot
#

If I execute with server the headless clients dont take over the units fast enough to complete the script. If I do it global it works but with multiple spawn waves...

broken pivot
broken pivot
lime rapids
#

is there no way other than setvariable to change a variable? specifically asking since im just using a local variable for calculations and dont think it should be global
(variable is just a number if that changes anything)

little raptor
#

you mean by someone else?

#

the only ways that you can change a local variable (besides intentional =) are:

  1. you mistakenly assign to it without making a private var
  2. you call a user callback and that modifies it, or you read from a global var that can be modified
  3. by reference if it's an array or hashmap (not the case here)
#

setvariable can't change local vars

hallow mortar
lime rapids
#

local scope

lime rapids
tender fossil
lime rapids
#

suprised i thought = was only used for defining vars

tender fossil
#

Remember to use private to avoid collisions though

faint burrow
#

Or privateAll. ๐Ÿ˜

tender fossil
#

Oh, that's a thing nowadays, nice to know ๐Ÿ˜„

split scarab
#

How do you accurately display mission success/failure result to each team? Like if BLUFOR won the game, it should say "mission success" for them but "mission failed" for OPFOR

I thought it would be like this but it still said "mission failed" when OPFOR won

private _bluforPlayers = allPlayers select {side group _x == west};
private _opforPlayers = allPlayers select {side group _x == east};
[[west, "Base"], "Game over! OPFOR WINS."] remoteExec ["sideChat"]; 
[[east, "Base"], "Game over! OPFOR WINS."] remoteExec ["sideChat"];
["OpforHvtWin", true] remoteExec ["BIS_fnc_endMission", _opforPlayers];
["OpforHvtWin", false] remoteExec ["BIS_fnc_endMission", _bluforPlayers];
proven charm
#

hows your OpforHvtWin class like?

split scarab
# proven charm hows your OpforHvtWin class like?
    class OpforHvtWin
    {
        title = "Mission Failed";
        subtitle = "OPFOR Victory!";
        description = "BLUFOR failed to complete the final objective (Eliminte HVT) within the time period.";
        pictureBackground = "";
        picture = "b_inf";
        pictureColor[] = {0.0, 0.3, 0.6, 1};
    };
#

Oh..

#

Well I see the mistake of the title

#

Should've been "Mission Success" but do I need to have another class defined to send to BLUFOR players where it says "Mission Failed" then?

proven charm
#

yeah BIS_fnc_endMission shows whats in the class

split scarab
#

Gotcha, silly mistake by me then lol

frozen seal
#

hello hello
What would be the script command to show a message like this to zeus?

tulip ridge
frozen seal
#

thank you!

teal vine
#

Is there a way to make AI turn to another direction like

this setDir 100

but instead of an instant change of direction the AI smoothly rotates to the desired direction?

hallow mortar
#

You could try setFormDir and/or doWatch

broken pivot
#

Hey there. My question is why the game still choose the execVM command:

if (!isDedicated && !hasInterface) then { 
    call AnthrakiaVillage_fnc_Einheiten;} else {
        ["HeadlessClientNotUsed"] remoteExec ["hint"];
        execVM "EBER\Erweiterungen\AnthrakiaVillage\Einheiten.sqf";
    };

hallow mortar
#

According to the logic, that execVM would be executed if the code is running on a machine that is a DS or has an interface

#

So the answer is not within the code itself, but in where the code is being run

broken pivot
#

Im using the debug console with server exec on a dedicated server

hallow mortar
#

well, there's your answer

broken pivot
#

If I run it global it spawn 20 times

hallow mortar
#

Server exec -> the code is being executed on the server -> isDedicated returns true so your else case is being used

#

Global exec -> every machine runs the code separately -> they all do their own checks and use whichever case applies to them

broken pivot
#

ohhh

#

fuuuuck

#

I thought its like server starts to check and sends it

teal vine
broken pivot
hallow mortar
icy ridge
teal vine
#

they'e not moving, i just want them to turn another direction.

#
csat_soldier enableAI "ALL";
csat_soldier doMove getPos csat_soldier_pos;
csat_soldier forceWalk true;
csat_soldier setBehaviour  "CARELESS";
waitUntil{moveToCompleted csat_soldier};
csat_soldier_pos setFormDir (getDir csat_soldier_pos);
csat_soldier_pos setDir (getDir csat_soldier_pos);

currently my script, but not working.

icy ridge
#

You just need to get a relative position for them to look at

#

for example:

mySoldier lookAt (mySoldier getRelPos [100, 90]);
broken pivot
# hallow mortar Global exec -> every machine runs the code separately -> they all do their own c...

That is my activation file Ive shortly done:

if (isDedicated && !hasInterface) then { 
    execVM "EBER\Erweiterungen\AnthrakiaVillage\FabiansLTEAntenne.sqf";
        ["FabiansLTEAntenne spawned"] remoteExec ["hint"];
    };
sleep 0.1;    
if (isDedicated && !hasInterface) then { 
    execVM "EBER\Erweiterungen\AnthrakiaVillage\Erweiterung.sqf";
        ["AnthrakiaVillage spawned"] remoteExec ["hint"];
    };
sleep 0.1;        
if (isDedicated && !hasInterface) then { 
    execVM "EBER\Erweiterungen\AnthrakiaVillage\Edin.sqf";
        ["Edins Einrichtung spawned"] remoteExec ["hint"];
    };
sleep 0.1;

    };
sleep 0.1;
if (!isDedicated && !hasInterface) then { 
    call AnthrakiaVillage_fnc_Einheiten;};

If I understood it right it just checks all available machines. So 3 cases of (!isDedicated && !hasInterface) because of headless clients also results into 3 waves of the script geting executed.

So how do I select only one of the three headless clients

icy ridge
broken pivot
split scarab
#

Hmm, can you not remoteExec["triggerAmmo"]?

#
[_flare, true] remoteExec ["triggerAmmo"];
icy ridge
# split scarab ```sqf [_flare, true] remoteExec ["triggerAmmo"]; ```

triggerAmmo Only takes one argument. It doesn't require a bool to determine whether or not to trigger. It just does.
[_flare] remoteExec ["triggerAmmo"];

But you'd likely want to define a destination for your remote execution as well. Leaving out an optional parameter will result in the command using the default value of the given param. In the case of targets this is 0 (all clients + server), this is extremely likely to be unnecessary for the purposes of triggerAmmo.

The most fitting target parameter for triggerAmmo is to use the object of the ammo you want to trigger, this will make sure that triggerAmmo is remotely executed on the client where the ammo is local. However, if this is reliably the same client as the client executing triggerAmmo there is no need to use remoteExec.

split scarab
#

I have a trigger that monitors for something to happen, once it happens it executes [_thisTrigger] spawn launchFlare; to send a flare into the sky from the trigger position:

launchFlare = {
    params ["_originObject"];
    _x = [-10, 10] call BIS_fnc_randomInt;
    _y = [-10, 10] call BIS_fnc_randomInt;
    _z = [48, 52] call BIS_fnc_randomInt;
       
    _objectPos = getPosATL _originObject;
    if (insideBuilding _originObject == 0) then {
        _objectPos set [2, (_objectPos select 2) + 1];
    }
    else
    {
        _objectPos set [2, (_objectPos select 2) + 20];
    };
    _flare = createVehicle ["F_40mm_Red", _objectPos, [], 0, "FLY"];  
    _stone = createVehicle ["GrenadeHand_stone", _objectPos, [], 0, "FLY"];  
    _flare attachTo [_stone];  
    [_flare] remoteExec ["triggerAmmo", -2];
    playSound3D ["a3\missions_f_beta\data\sounds\showcase_night\flaregun_4.wss", _originObject, false, _objectPos, 1, 1, 200];
 
    _stone setVelocity [_x, _y, _z];
    sleep 4; 
    deleteVehicle _stone; 
};
hallow mortar
icy ridge
split scarab
#

Hmm, that's what happens then, but for some reason the triggerAmmo doesn't work unless I remoteExec it to all clients

icy ridge
#

What do you mean doesn't work?

split scarab
#

On the Trigger Server Only and once activated it does this:

_sleepTime = OB_objectiveCompletedDelay;   
[thisTrigger, _sleepTime] spawn {    
    params ["_trigger", "_sleepTime"];   
    if (count (allMapMarkers select {toLower _x find "obj_" == 0}) == 1) then {   
        _sleepTime = 0;   
    };   
    sleep _sleepTime;   
       
    [[east, "Base"], "BLUFOR recently completed an objective! Red flares are being launched from the it's location."] remoteExec ["sideChat"];    
    [[west, "Base"], "OPFOR has been alerted of your recent objective completion."] remoteExec ["sideChat"];    
    deleteMarker "obj_AirbnbIntel";   
    sleep 2;   
    _flareCount = 3;   
    for "_i" from 1 to _flareCount do {    
       [_trigger] spawn launchFlare;   
       sleep ([1.5, 2.5] call BIS_fnc_randomNum);  
    };   
}
split scarab
#

I want it to be ignited from the ground as it goes into the air

#

[_flare] remoteExec ["triggerAmmo", -2]; makes it work as intended

winter rose
#

huh, very weird hm, maybe it is how it is blobdoggoshruggoogly

split scarab
#

Also to clarify the launchFlare function is defined in initServer.sqf as well

icy ridge
#

That is... functionally questionable...

split scarab
#

From my side or game logic wise? lol

winter rose
icy ridge
icy ridge
split scarab
#

Mission is running on dedicated server ye

winter rose
icy ridge
#

In terms of locality. It doesn't make sense.

split scarab
#

I'm also currently testing using the dedicated server to ensure it works as I want

icy ridge
split scarab
#

That is true, luckily it's just a mission I'm making to host for a community, it's not intended to be release publicly

#

But man the learning curve from functional -> optimized and adaptable is rough

icy ridge
#

I've just tested on a dedicated server. triggerAmmo locality works as expected. Spawning an explosive charge from the server and triggering it works without the use of remoteExec, as the charge is local to the server. Effects are global as expected.

split scarab
#

I don't get it then lol

#

Cause all the logic is server side

#

Maybe it's something finicky with the 40mm flare specifically?

winter rose
#

that's what I end up suspecting

icy ridge
#

For example:

Executing this server side will spawn a charge at the feet of my player object and trigger it (fun times).

expl1 = "DemoCharge_Remote_Ammo" createVehicle [0,0,0];
expl1 setPosATL (getPosATL ((allPlayers select {(name _x) isEqualTo "Kzyx"})#0));
triggerAmmo expl1;

Just spawning it and trying to trigger it triggerAmmo expl1; with client local execution won't work because (isNil "expl1") returns true on local client (obviously).

#

I CAN remoteExec it to clients from server, but this is likely because the object is provided with the remoteExec (still kinda weird but ok)

icy ridge
split scarab
#

Oh well, maybe not best optimized but it works now, thank you!

icy ridge
# split scarab Oh well, maybe not best optimized but it works now, thank you!

It's weird because triggerAmmo has the AL tag. Meaning the provided argument needs to be local to the executing instance to work as expected.

However, remote executing triggerAmmo on clients only from a dedicated server seems to work fine when the object is supplied as argument.

From my understanding of locality and remote execution this shouldn't be the case though, seeing as the locality of the object doesn't change and it's not local to any client.

eternal spruce
#

Can some please explain how to use getMass & setMass for me, I tried using this before a while back and couldn't figure it out because nothing seemed to changed when i tried to implement it and I was told that you can find the mass value in the vehicle's Config, where in the config can I locate this.

The reason I want to learn this is to make a vehicle move a bit slower by increasing it's mass but if there's an easier way to do that I'd appreciate any help I receive to solve this problem

split scarab
hallow mortar
eternal spruce
icy ridge
#

You ought to be careful not to go crazy with the values. From what I know and have tested the mass value is used in physics calculations as well, which can result in questionable behavior with extreme values.

eternal spruce
hallow mortar
eternal spruce
#

@hallow mortar I'll read up on setCruiseControl and see if i get the desired result, thank you all

icy ridge
#

Which incidentally is also a fairly good example of going a bit crazy with the values pepe_shrug

broken forge
#

How do I disable picking up a vest from a GroundWeaponHolder_Scripted. I've been able to disable the inventory, but the player can still take the vest

granite sky
#

enableSimulationGlobal false should work.

eternal spruce
broken forge
#

I've tried this and it's not working:

private _vestObj = createVehicle ["GroundWeaponHolder_Scripted", [4000, 4002, 0], [], 0, "CAN_COLLIDE"];

_vestObj setPosATL [4000, 4002, 0.5];
[_vestObj, 90, 180, 0] call BIS_fnc_setPitchBank;
_vestObj addItemCargoGlobal ["V_PlateCarrier1_rgr", 1];
_vestObj enableSimulationGlobal false;
_vestObj allowDamage false;
_vestObj setVariable ["ace_dragging_canDrag", false, true];
_vestObj setVariable ["ace_dragging_canCarry", false, true];
_vestObj setVariable ["ace_cargo_canLoad", false, true];
_vestObj lockInventory true;
[_vestObj, _vestObj] call ace_common_fnc_claim;
icy ridge
#

It's Syntax 2 of https://community.bistudio.com/wiki/setMass

Index 0 (in your case the int 10) is the value to set the mass to.

Index 1 (in yoir case the float 0.5) is the value defining the duration in seconds over which the change to mass is to be set gradually.

#

Although there is a syntax specific description for thr alternative syntax.

When main syntax is used on local vehicle, the change is global. When alternative syntax is used with time transition on local vehicle, the gradual mass change doesn't happen on remote clients, only final mass is applied after the given time. If you need gradual change on remote clients too, remote execute setMass globally.

(Quoted from the documentation page linked above)

granite sky
#

Bear in mind that global effects of setMass are transmitted extremely slowly for some reason :/

#

Whether that matters depends on your use case.

granite sky
broken forge
#

Could it be due to being in profiling branch or using ace and cba?

granite sky
#

I don't know. What action are you using to pick it up?

#

I'm in profiling branch too.

broken forge
#

I'm seeing the action to pickup and open the vest in the scroll menu

granite sky
#

I only get open in the action menu.

broken forge
#

Full code:

private _vestObj = createVehicle ["GroundWeaponHolder_Scripted", [4000, 4002, 0], [], 0, "CAN_COLLIDE"];

_vestObj setPosATL [4000, 4002, 0.5];
_vestObj setVectorDirAndUp [[0, 0, 1], [0, 1, 0]];
_vestObj addItemCargoGlobal ["V_PlateCarrier1_rgr", 1];
_vestObj enableSimulationGlobal false;
_vestObj allowDamage false;
_vestObj setVariable ["ace_dragging_canDrag", false, true];
_vestObj setVariable ["ace_dragging_canCarry", false, true];
_vestObj setVariable ["ace_cargo_canLoad", false, true];
_vestObj lockInventory true;

[_vestObj, _vestObj] call ace_common_fnc_claim;

private _action = [
    "OpenVestShop",
    "Browse Vests",
    "\a3\ui_f\data\IGUI\Cfg\Actions\gear_ca.paa",
    { [] spawn forge_fnc_listVests },
    { true }
] call ace_interact_menu_fnc_createAction;

[_vestObj, 0, [], _action] call ace_interact_menu_fnc_addActionToObject;
granite sky
#

I can't find any way to block the vest inventry. You can cycle through the containers with everyContainer but neither lockInventory or enableSimulation does anything.

#

Maybe create a simple object instead?

round bison
#

I can't post the sqf because it's too many characters, lmao.

tulip ridge
#

Use a code block, don't just paste it
```cpp
Config
```

And for scripts
```sqf
Code
```

granite sky
#

Your CfgFunctions stuff is one level too deep, isn't it?

#

ah no, I forget that the functions themselves are classes.

somber python
#

Hi, I'm new to scripting and I'm having trouble deleting groups. I've tried deletevehicle _group;

and also

{ _x setDamage 1 } forEach units _wave_RPK;

or

{deletevehicle _x } forEach
_wave_RPK;

_wave_RPK is the name of the group.

but it didn't work.

granite sky
#

The command for deleting groups is deleteGroup, but you need to remove all units from it first, so you'd need to use the second version.

#
{ deleteVehicle _x } forEach units _wave_RPK;
deleteGroup _wave_RPK;
somber python
#

thanks!

hallow mortar
somber python
#

Thanks! It works both ways.

round bison
#
class CfgPatches {
    class SmokeSupportMod {
        units[] = {};
        weapons[] = {};
        requiredVersion = 1.0;
        requiredAddons[] = {"cba_main", "ace_weapons", "aegis_main"};
        author = "IRISHCREAM"; 
    };
};

class CfgFunctions {
    class SmokeSupport {
        class main {
            class init {
                file = "\SmokeSupportMod\scripts\smokeSupport.sqf";
                preInit = 1; 
            };
        };
    };
};
#

even code block format its too long ๐Ÿคฆโ€โ™‚๏ธ

tulip ridge
round bison
meager granite
#

What's wrong with it?

round bison
#

when I fire the smoke round, nothing happens. no system message, no text, no helo support.

meager granite
#

Dedicated server, listen server, you're client or the server?

granite sky
#

Does the diag_log for initialization fire?

#

And does the code work if you run it later from the debug console instead?

round bison
#

Tested in local server from editor

#

Havent tried running it from debug yet, will try and report back

verbal ravine
#

I'm trying to trigger a variable defined trigger from code. It works in the editor, but not when running on the server. Would anyone be able to point me in the right direction?

params [
    ["_targetObject", objNull, [objNull]],
    ["_triggerToActivate", objNull, [objNull]]
];

[_targetObject, _triggerToActivate] spawn {
    params ["_targetObject", "_triggerToActivate"];
    
    // Some other code that completes fine

    // Activate the provided trigger if it exists
    if (!isNull _triggerToActivate) then {
        // Set trigger conditions and activate it once
        _triggerToActivate setTriggerActivation ["NONE", "PRESENT", false];
        _triggerToActivate setTriggerStatements ["true", "", ""];
    };
};


granite sky
#

Not sure how you'd tell if there's no payload in setTriggerStatements.

#

Is the trigger set to server only, and at what locality are you running the code?

verbal ravine
#

This is how I trigger the code. It's a hold action on a object.

[
    extractLuggage,                                                    // Object the action is attached to
    "Extract",                                                        // Title of the action
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Idle icon shown on screen
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Progress icon shown on screen
    "_this distance _target < 3",                                    // Condition for the action to be shown
    "_caller distance _target < 3",                                    // Condition for the action to progress
    {},                                                                // Code executed when action starts
    {},                                                                // Code executed on every progress tick
    {   // Code executed on completion
        params ["_target", "_caller", "_actionId", "_arguments"];
        [_target, triggerStart] execVM "scripts\endscreen.sqf"
    },                        
    {},                                                                // Code executed on interrupted
    [],                                                                // Arguments passed to the scripts as _this select 3
    4,                                                                // Action duration in seconds
    0,                                                                // Priority
    true,                                                            // Remove on completion
    false                                                            // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, extractLuggage];            // MP-compatible implementation

#

The trigger is the one in my screenshot above

verbal ravine
#

Is it the use of execVM that means it's running locally only?

#

Also that script to add the hold action is in the init.sqf. I'm guessing that it should go in the server init?

granite sky
#

Given that the hold action is remoteExec with JIP, yes, the code's probably supposed to run on the server only.

split scarab
#

What's wrong with my condition here in addAction. I've defined the variable in initServer.sqf and broadcast it:

OB_selectedBluforSpawn = false;
publicVariable "OB_selectedBluforSpawn";

And this condition on the action in initPlayerLocal.sqf:
.... ,"side group _this == west && (OB_selectedBluforSpawn == false or OB_selectedBluforSpawn == _actionId)", 3];

#

I have a foreach loop for 6 "insert" markers, it adds a action to teleport to each insert marker

The intention is to have OB_selectedBluforSpawn as false at the beginning until a player on Blufor has picked a spawn, then hide all teleport actions except the one that was used first, to ensure all Blufor starts at the same location

hallow mortar
#

Probably type mismatch. == can only compare the same data type. false is bool and _actionID is presumably a number.

#

I would suggest not changing types in the same variable - it makes it difficult to work with for exactly this reason. Make your default value -1 or something.

#

Btw, action IDs are dynamically generated and can be different on different machines, between different runs of the mission, or in different mod setups. I would not rely on them for any sort of reference.

split scarab
hallow mortar
#

There's probably a way with storing each action's ID in a variable with a dynamically generated name (based on something that can be rebuilt in the same way later when you need to find it again). format + get/setVariable etc.

split scarab
#

What if I moved the addAction to server logic

#

Would the actionIds be consistent then?

hallow mortar
# split scarab What if I moved the addAction to server logic

addAction is local effect. If you only execute it on the server, other machines won't have the action.
The action ID is generated based on the other actions already existing on the target object. Actions can be added in different orders on different machines or during different runs, due to JIP, locality, or just timing. Mods can add other actions outside your control.

#

In many cases the order will be probably mostly consistent. But it's impossible to guarantee that it actually is 100% of the time, so you have to treat it like it isn't.

#

The best solution is going to depend on exactly what you're trying to achieve. I don't really want to get further into it myself, this was meant to be a quick driveby message on my way to bed.

split scarab
verbal ravine
split scarab
#

How do I find a "safe" position near a marker to teleport the player, so that the players don't teleport inside of each other or objects?

private _markerPos = getMarkerPos [_mName, true];
private _safePos = _markerPos findEmptyPosition [0, 10];
_caller setPosATL _safePos;
old owl
simple heron
#

Irish.......

#

LMFAO

old owl
#

I have been waiting on my toes too hahaha

simple heron
#

let it be known Irish is a crazy scripter ( highkey some cool as shit lmao) first hand experience

round bison
simple heron
round bison
tame lion
#

Kind of a generalized question here, but according to the profileNamespace wiki, it says that it saves whenever a game is closed. I just wanted to ask, does this effectively render saveProfilenamespace unnecessary?
Some context to this question, I am creating a long form CTI style mission and have figured I would store all my variables in a hashMap on profileNamespace. I'm thinking of simply setting up a while true do loop to just save the hashmap to profileNamespace every 3-5 minutes. Do I no longer need to do saveProfilenamespace so as to keep the server from bogging down whenever this save interval hits?

granite sky
granite sky
icy ridge
sharp grotto
tame lion
#

Thanks @sharp grotto. Seems to imply i should be save to go ahead and do a saveProfileNamespace along side the setVariable every 3 min or so.

split scarab
#

I have an interesting idea, I have a "Ambient Animals" module that spawns 2 dogs. I wish to simulate guard dogs that bark if a BLUFOR player is nearby

How can I find both dog (units/objects?) so I can cast the sound from their position?

mint flame
#

Hello I need a script to have an artillery, with gunner thats already spawned in, to fire at a BLUFOR soldier's position, anyone have a scritp for this?

#

I dont know what to do, do artilleryfire, command,...

proven charm
split scarab
hushed turtle
#

Since addHandgunItem has local argument, does it mean that addHandgunItem needs to be run where unit is local for it to work?

faint burrow
#

Yes.

lime rapids
#

is there a way to limit which channels markers can be put into and still allowing typing like normal in the channel?

faint burrow
lime rapids
#

any more player friendly approach?, i could see that being reported as a bug even with briefing people, i guess i could attempt to get the ui control and delete it right? though to differentiate between channels id assume i would have to also check the text contents

tulip ridge
#

Just display a message to the player if it was deleted

hallow mortar
tidal idol
#

Is there a scripting command I can use to temporarily disable an AI group leader from issuing commands to subordinates? I've looked at disableAI but it doesn't look like any option has what I want. I want to prevent a group from getting "distracted" from their doArtilleryFire firemission if an enemy is spotted.

hallow mortar
#

Disabling autocombat and autotarget should help. The note about autotarget not working on grouped units seems to be talking mostly about disabling it for a single unit in a group; if the leader also has it disabled, then they shouldn't be able to issue targets to subordinates.
You could also try putting the group in Careless mode (setCombatBehaviour). I don't know whether it will also prevent them from executing their fire mission, but it's worth a go.

untold copper
#

There is also enableAttack.
Set if leader can issue attack commands to the soldiers in his group.

edgy dune
#

is there a guaranteed order to when WeaponDeployed and weaponRested are called in situations where both would be called (Like I am already rested, then I deploy, or vice versa)?

pale wagon
#

I think this falls under scripting, but when it comes to the names bases that Arma 3 uses for AI, how would you make custom ones?

I am interested in creating a custom faction using ALiVE. I know how to references names bases in the CfgVehicles file it generates, but I want to make my own

#

If you know, feel free to ping/dm. I likely won't see it immediately if you just respond

#

Iirc names were literally just x = x in a giant file list. I am curious if it is really just that easy? There's no way it is

pale wagon
#

maybe not

#

Actually might have just found it

#

data_f config.cpp GenericNames

#

I wonder how I can add to this without blowing everything up

#

didnt you just post that lmao

pale wagon
hallow mortar
#

+= is probably what you need for that.
But #arma3_config will likely be able to help you better with this.

pale wagon
#

For Doubledax, or for me?

hallow mortar
#

For you.

pale wagon
#

I see! I had not even thought this would be a config thing! I will go ask there ๐Ÿซก

hallow mortar
#

Well you're working in config.cpp and modifying things that start with Cfg. For future reference, that's a clue

tidal idol
#

Is there some way I can force a unit to point his weapon at a particular location or direction? I just want to make him point at a waypoint position about 100 meters up or so. I've tried doWatch since it allows position input according to the wiki, but I got errors ingame saying it doesn't accept position arrays (I've tried 2D and 3D arrays)

Relavent lines in my script:
_pos = _this param [1,[],[[]],3]; //in the parameters
_target = _this param [2,objnull,[objnull]]; //in the parameters
_firePos = if (!isNull _target) then {getPos _target} else {_pos}; //to pick which of those to use
_firingUnit doWatch [(position _firePos select 0), (position _firePos select 1), (position _firePos select 2) + 100]; //my 3D attempt at making it work
If I could I'd rather just say point forward and X degrees up

tidal idol
#

Problem solved. Not a pretty solution, but it works. Makes unit point 60ยฐ up for the split second he's firing.

        _firingUnitVec = [vectorDir _firingUnit, vectorUp _firingUnit];
        _firingUnit setVectorDirAndUp ([[_firingUnitVec select 0, _firingUnitVec select 1], 0, 60, 0] call BIS_fnc_transformVectorDirAndUp);
        _firingUnit fire [(_firingUnitWeapons select 0), _firingMode, _magazine];
        _firingUnit setVectorDirAndUp ([[_firingUnitVec select 0, _firingUnitVec select 1], 0, -60, 0] call BIS_fnc_transformVectorDirAndUp);```
granite sky
#

Your original code may have worked except _firePos is already a position array, so position _firePos is invalid.

#

doWatch on a position is legitimate.

hallow mortar
tidal idol
#

wow discord actually recognizes us Arma scripters! there are dozens of us!

tidal idol
granite sky
#

yeah, that doesn't surprise me.

hallow mortar
#

maybe next year we'll get that direct unit aim control command

pale wagon
#

So you're telling me scripting isnt just tapping the AI on the shoulder and saying "hey do me a favor and shoot the sky" and its actually black magic???

granite sky
#

That's a rhetorical question, right

pale wagon
#

Yes lol I am being funny... or trying. My jokes tend to almost never land

#

I wonder if people actually think that... I have dabbled very briefly into scripting, only enough to make a barely functioning random loadout generator or a random rank applicator...

tidal idol
tidal idol
#

okay one more thing - is there a good way to force a unit to raise their weapon? All I can think of for a workaround is to force the group to go into Combat mode

granite sky
#

IIRC that's a unit behaviour not a group behaviour.

#

So you can just set that unit to combat rather than the group.

hallow mortar
tidal idol
zealous heath
#

Hi, I am trying to get KPLiberation to work with a Star Wars Faction by editing the custom opfor preset, but no units will spawn and it throws up several errors. What has me stumped, is that is I use the custom opfor preset of a different custom KPLib Star Wars Mission in that same mission folder, it works no problem... I have triple checked the class names, so this is not it. Any help greatly appreciated.

proven charm
# zealous heath Said file, if anyone wants to have a look

welp one thing i noticed is that in this code: ```
opfor_troup_transports = [
"O_Truck_03_transport_F", // Tempest Transport
"O_Truck_03_covered_F", // Tempest Transport (Covered)
"O_APC_Wheeled_02_rcws_F", // MSE-3 Marid
"3AS_HMP_Transport", // Mi-290 Taru (Bench)
"3AS_HMP_Gunship", // Po-30 Orca (Armed)
];

#

so go thru all the code and remove those

zealous heath
warm kestrel
#

I'm looking to do something rather odd that I haven't been able to figure out how to do.

I'm essentially making troops with invisibility equipment, accomplished by turning off their models. I'd like to make it so that their models are toggled on whenever they shoot and off otherwise, but I was also looking to just make something that turns their model off and on on a timer, if the former can't be done.

warm hedge
#

What have you done

spring stone
#

Hey, if I add a weapon like this player addweapon "arifle_Mk20_F"it appears on the player, hower it has no magazine in it. How would I add a magazine to a unit with out the unit needing to reload (so spawn the weapon in hand with a mag in it)

proven charm
spring stone
#

Well, obviously I just wanted to test you. Damn, how did I not see that.

hallow mortar
#

You can also use e.g. addPrimaryWeaponItem if you want to be more specific with it

grim furnace
#

hello, i have a problem do u know how to solve it? The problem is i want to block unit control by player and i am using this script :

disableUserInput true;
Sleep 5;
disableUserInput false;
but when disableUserInput false; the game remember your last input and resume action until you push the same button again(example u are pushing "w" and when control back unit is moving forward without your new input)

winter rose
#

you could alternatively use a camera to create a cutscene

grim furnace
#

this is not a cutscene, i'm doing a timeskip and i want the player to be in position when the black screen disappears

digital hollow
#

You could attach the player to something and only detach when you want them to be able to move.

grim furnace
#

i find solution - i just turn off control again: full script with time skip looks like this

#

disableUserInput true;
player playMove "AmovPknlMstpSrasWrflDnon";
cuttext ["","BLACK OUT",5];
skiptime 3;
sleep 7;
cuttext ["3 hours later","BLACK IN",5];
sleep 4;
disableUserInput false;
disableUserInput true;
disableUserInput false;

#

thx for ur time

broken pivot
#

Good evenening ^^
Is there anyone who knows about ace?
Im asking myself if there is a way to sort created points in the interaction
menu like folders by there topics. Like that they become better readable.

tulip ridge
split scarab
#

How do you completely end the mission and force players back to the lobby after

["OpforHvtWinW", true] remoteExec ["BIS_fnc_endMission", _opforPlayers];
#

Cause using BIS_fnc_endMission, all players have to hit continue afterwards in order to go back to the lobby and the mission doesn't reset until everyone's in the lobby

grand stratus
#

Anyone know if there is a way to continue to force the game to render in the background while the map is open?

tidal idol
lime rapids
#

im pretty sure the above action is for ammo vehicles

tidal idol
#

I've seen rearm actions at units I'm pretty sure... maybe that was back when I'd play the A2 demo.
ill figure this out sometime l8r i got work tmr

tidal idol
#

I know one can use the command menu to order a unit to open a squadmates backpack, maybe I can use that as a lead to look into it further
worst comes to worst I create a pool of everything that groups units backpacks have, generate a list of rearm requirements, and remove+add items as needed

tulip ridge
#

That's the gear action, not rearming

tidal idol
#

or, I can have backpack units drop their pack, units rearm at packs, then backpack units pick up their packs

tulip ridge
#

Why overcomplicate it

#

Just remove items from one unit and add them to the other

south swan
royal quartz
proven charm
normal sage
#

Is there a way to make active radar not detect ground vehicles? Makes no sense whatsoever.

hallow mortar
# normal sage Is there a way to make active radar not detect ground vehicles? Makes no sense w...

In reality active radar can detect ground vehicles - see the Apache Longbow radar, ground surveillance radars e.g. Thales SQUIRE, even civilian car radars. Usually they are separate systems to air radars due to different requirements, but in Arma a radar can be configured to do anything.

In the game, we don't have commands to manage radar parameters or vehicle detection on the fly by scripting. However, if you're making a mod, you can change the radar's config to make it unable to detect ground targets, or unable to detect air targets: https://community.bistudio.com/wiki/Arma_3:_Sensors_Config_Reference

normal sage
#

In arma active radars can detect ground vehicles even when they are parked and theres ground clutter all around it

hallow mortar
#

It is possible to configure Arma radars to have a minimum target speed for detection - but again, only through config, not scripting.

normal sage
#

Yea best option seems to be disable sensor altogether for air vehicles then to make them not op against ground vehicles, but it will make them less effective in air to air

hallow mortar
#

Depending on what loadout management systems the players have access to, you could also limit what air-to-ground munitions are available. Then they will be able to detect, but not engage as easily.

normal sage
#

I like the use of stand off air to ground munitions, but I want the pilot to actually find the target instead of pressing tab and insta locking anyone that is within the sensor range

royal quartz
lime rapids
normal sage
pallid palm
#

Hello all: Can we make soldiers fire RPG's at me, the player

#

with out any mods and just useing scripting

hushed turtle
pallid palm
#

wow nice thx you @hushed turtle

hushed turtle
#

I don't think that's gonna do the work, since you can't pick target. Maybe combine that with doTarget?

pallid palm
#

yes im going to try this

#

i remember back in (Arma 2 OA) if you removed all weapons and Ammo sep for the RPG the enemy would fire The RPG at you

#

but that may not be the same in A3

hushed turtle
#

I don't remember Arma AI using any sort of AT weapon against human target tanking

pallid palm
#

yes in A2 OA it worked well

#

but in A3 who knows lol

#

ill see what i can come up with

#

i will need more help from you awsome people

normal sage
#

I think ARMA 3 AI will use rpg on its own if it has HE rocket ammo instead of HEAT

pallid palm
#

on the players ?

normal sage
#

yes

pallid palm
#

against the players

#

cool

#

what about the RPG_7 i wounder if the would work also

#

from the old man DLC

#

that would be awsome if Ai shot RPG,s at us woohoo Arma 3 hell yeah

normal sage
#

I think with HEAT they only use against vehicles. I think it is defined in CfgAmmo what targets a munition can be used against

hushed turtle
#

No HE ammo available though

pallid palm
#

ahh ok

#

iv tried and tried to make this work, so i guess i keep trying, i have a few ideas in my brain

digital hollow
#

You'll probably have to either use invisible vehicle target for AI to shoot at, or script the aiming and shooting entirely.

split scarab
#

Can someone help me fetch a random position within a marker area (marker is named "dog_area"), preferably in the open (not inside building or inside other objects)

novel basin
#

Hello

When i use ctrlMapMouseOver in MP, how can i know when its me (that i places the marker) or someone esle on my server ?

winter rose
novel basin
#

WHen i place in "Global channel" is not the same ?

tulip ridge
#

No

#

Those two things are completely different

novel basin
#

so just if i check if the _marker (ctrlMapMousOver) select 1 find "_USER_DEFINED" its ok ?

tulip ridge
#

All player created markers will have user defined in them

novel basin
#

And i can make difference between "my marker" on "my mate's marker" with the player id ?
_USER_DEFINED #<PlayerID>/<MarkerID>/<ChannelID>

tulip ridge
#

If you're referring to this comment, then that's the client id, not like a player's steam id

novel basin
#

yep but its unique ?

tulip ridge
#

Should be, they're not reused if someone disconnects and someone else joins in their place as far as I remember

novel basin
#

For example, i can do

if (owner player == n1) then {
hint "its my marker !";
};
#

(n1 is from your example)

tulip ridge
#

clientOwner, not owner player

#

Also that'd be comparing it to a global variable called n1, which isn't what the example is showing

#

Those parts are formatted into the marker's name itself, so you need to get whatever marker you're wanting to check and do some manipulating of the name to get the id

novel basin
#

yeah i see

novel basin
tulip ridge
#

I said what you needed to do right after that

so you need to get whatever marker you're wanting to check and do some manipulating of the name to get the id

novel basin
#

Ahhh yeah
So do you think it can work ?


_marker = "_USER_DEFINED #3/7/1";

_ownerMarkerId = _marker splitstring "#/" select 1; //Returns 3 for example

if (clientOwner == _ownerMarkerId) then {
    hint "It's your marker ! ";
};

#

splitstring returns

["USER_DEFINED ","3","2","1"]
(without select 1)

modern plank
#

Still on markers topic, how can I allow the in-game markers creation by players only for themselves? I don't want to broadcast them, but allow local map annotations only.

I know that I can disableChannels. If I disable all channels from 0 to 16, is the player still allowed to draw markers on his map with no broadcast?
Or should I let the players go with one channel (5=Direct for example) and intercept the event with addMissionEventHandler ["MarkerCreated"...] to deleteMarker the original one then createMarkerLocal with same properties?

hallow mortar
#

You could try using a markerCreated EH to deleteMarkerLocal any marker that didn't originate on the current client. Do test it, it's possible the marker will still appear for a brief moment before being deleted, but if it does work, it would be less complex than recreating the marker.

modern plank
#

you are right, less networking the better.

#

Crossing fingers that I don't have to manually do it....

#

I never played with custom channels. Maybe I can create locally a local channel per player, then place markers only on this one.... no broadcast. Don't know if possible.

tender fossil
#

Are there still only 10 custom channels?

still forum
modern plank
modern plank
#

thank you guys!

granite sky
tulip ridge
#

Should still follow aiAmmoUsageFlags and allowAgainstInfantry though

torn basin
#

Hello Guys, having a short question.

What happens when a sqf script file is running in my mission and the end of the code is reached? Will the script still cost some performance? should i have a terminate command at the end of all of my script files?

granite sky
#

A spawned script terminates when it reaches the end of the code.

tulip ridge
#

Any script ends when it reaches the end of the file or an exitWith

grim furnace
tulip ridge
#

Yeah but they can't see anything if the screen is blacked out

#

So what does it matter

grim furnace
#

because the screen doesn't go dark right away

meager granite
#

Another way could be switching to a camera

grim furnace
#

guys this discussion is useless because it's already been decided - i found exactly what i needed

novel basin
#

any guy have an idea ?

split ruin
#

why u need player id ?

leaden needle
#

Hi, quick question. The Wiki page for disableAI claims that disableAI "ANIM" will completely freeze a unit in place, including its blinking and looking around animations. Does this just not work or is it some issue on my end?

winter rose
#

dunno, how do you use it?

pallid palm
#

@leaden needle unit disableAI "All"; if you want to completely disable everything on the AI

#

but what good is that

#

disableAI has many diff features "All" is just 1 of them

pallid palm
pallid palm
leaden needle
#

i simply put this disableAI "ANIM"; in the unit's init. but in my experience, neitherdisableAI "ANIM" nor disableAI "ALL" actually prevent the unit from looking around and blinking

pallid palm
#

hmmm really

#

that looks like it should work then

leaden needle
#

wait actually โˆ’ troubleshooting 101 โˆ’ i will start the game with 0 mods and try again

pallid palm
#

ofcorse

#

copy that

leaden needle
#

i can report that it still doesn't work even with no mods, so that's not the issue

#

so the question i'm asking myself now is if disabling AI animations is just broken

hallow mortar
#

I don't think it's broken. The AI doesn't do any of its other animations, like lowering its gun or going prone. I think it's just that low-level idle animations like minor head movements aren't considered "proper animations", and aren't covered.

#

Certain mimics (setMimic) can override head idle animations and lock the head in place, for example "unconscious"

grand stratus
#

Is there any resources for how bullet drop/drag is calculated? Particularly how the 'airFriction' value is used? I'm looking to approximate "stats" for weapons, particularly damage loss @ mid/long range (400/800m). I've found some resources but they aren't very accurate when cross referencing in-game projectile behaviour. Bohemia forums with old posts containing information about this are inaccessible at the moment as well.

red matrix
#
  • _vehicle addForce [_vehicle vectorModelToWorld [0,0,500],getCenterOfMass _vehicle]; is this sort of the same as adding collective to a helicopter when flying?
  • How do I find out what are the max/min values that collective can apply for a given helicopter?
  • Is there a way to find out what current colletive value is?
    -# All of this Im considering for Simple Flight Model, Im trying to write a script that manages collective while flying a helicopter
dusty steppe
#

Also, the hit values for FMJ bullets were calculated initially using "FMJ bullet energy hit = sqrt(weight/2)*speed/5 "
Don't remember if this is exact for Arma 3, I think it fits most of the bullets, but it's balanced around 6.5 in Arma 3, rather than 7.62 in Arma 2 (might be wrong on values for this, the older stuff is hard to find)

grand stratus
#

I've looked through those before, I think the values I got weren't matching my intuition for an expected value, but I have 0 experience in ballistics so it could be correct.
So for my current test case, I got a initSpeed of 920, airFriction of -0.0009.

920*920 * -0.0009 = -761.76
Does that mean the deceleration @ exit is -761.76m/s^2? or am I misinterpreting the formula.

granite sky
#

Sounds about right.

#

If you want to replicate the path you'll need simulationStep too.

grand stratus
digital hollow
red matrix
# digital hollow Yes. Start with published irl performance specs but an auto collective shouldn't...

What Im trying to make exactly is a autopilot that will hold velocity, I have pitch control already figured out somewhat, but I want to also add collective control since if there is no collective it will just gradualy slow down to 0. So If possible I will need it to be the max value that collective can reach for a heli (so that the pilot doesnt have to constantly hold the key on keyboard)

Is there maybe a way to change the value of inputAction artificially? Like despite someone using push keybinds, make it work kinda like analog/how it works in planes via script

rugged spindle
#

Simplified version of a function I have:

 params[
    ["_unit", objNull, [objNull]]
];

_primary = getText (missionConfigFile >> "CfgLoadouts" >> "soldier" >> "primary_weapon");

_unit addWeapon _primary;

It's called on the unit's init. It gives me an error that group was given, object expected, but it still gives me the correct results (unit has weapon on mission start).

If I add postInit=1 to the function definition, it changes error to string provided, object expected. Again result is correct afterwards.

From this I suspect initialization order, is the unit's init the wrong place to call this?

digital hollow
grand stratus
tulip ridge
#

Also if CfgLoadouts or primary_weapon are custom properties that you've made, you should add a unique prefix to prevent potential conflicts.

E.g.
LNG_CfgLoadouts / LNG_primaryWeapon

dusty steppe
# grand stratus One more thing if you happen to know. Sound Supressors increase muzzle velocity ...

No, the velocity increase is separate from any accuracy change
This is part of the config from a mod I'm working on (muzzle brakes rather than suppressors, but the same code)
Velocity is modified by initSpeed in MagazineCoef, while dispersion is modified by dispersionCoef
(Note that ACE changes the suppressor stats compared to vanilla, if you are doing anything with ACE)

    class RAVEN_muzzle_brake_base : muzzle_snds_H
    {
        //thermal and model stuff removed//
        class ItemInfo : InventoryMuzzleItem_Base_F
        {
            mass = 10;
            class MagazineCoef
            {
                initSpeed = 1.0;
            };
            class AmmoCoef
            {
                hit = 1.0;
                visibleFire = 1.1;
                audibleFire = 1.1;
                visibleFireTime = 1.0;
                audibleFireTime = 1.0;
                cost = 1.0;
                typicalSpeed = 1.0;
                airFriction = 1.0;
            };
            soundTypeIndex = 0; //not suppressor, not going to add new sounds for everything
            muzzleEnd = "zaslehPoint";
            alternativeFire = "Zasleh2";
            class MuzzleCoef
            {
                dispersionCoef = "1.0f";
                artilleryDispersionCoef = "1.0f";
                fireLightCoef = "1.1f";
                recoilCoef = "0.90f"; 
                recoilProneCoef = "1.0f";
                minRangeCoef = "1.0f";
                minRangeProbabCoef = "1.0f";
                midRangeCoef = "1.0f";
                midRangeProbabCoef = "1.0f";
                maxRangeCoef = "1.0f";
                maxRangeProbabCoef = "1.0f";
            };
        };
        inertia = 0.2;
    };```
#

The vanilla suppressors do however modify dispersion
dispersionCoef = 0.8f; becomes dispersion with supressor is 80% of that without

granite sky
#

Suppressors make the weapons more accurate?

dusty steppe
#

That's what the code says
Though I wouldn't entirely trust it without testing, since recoilCoef didn't apply to players until a recent perf/prof version

granite sky
#

fair

hallow mortar
tidal idol
tulip ridge
tidal idol
#

Id basically need to make the ammo transfer subroutine myself when there exists a perfectly good base game function that does what I want and more

granite sky
#

Does that exist? That doesn't sound like Arma :P

digital hollow
#

I did the easy way transfer magazine on reloaded eh

eternal spruce
#

Hello everyone, I have a working script here in a trigger, what if i want to add plane2 to do the exact same thing as plane1 when it enters the trigger at a later time, how do I execute this without both plane lowering the landing gear at the same time if one enters the trigger first?

warm hedge
#

Duplicate the trigger?

eternal spruce
#

hmm..ok, I was trying to avoid that if I needed to do more in the future

granite sky
#

At some point triggers will become annoying and you're better off with a monitor script.

molten barn
#

Afternoon scripting chaps and chappets, reposting this question in here on suggestion of someone in the editor channel (hope this doesn't count as spam). I'm currently mid mission making and i've become stuck. Trying to make a checkpoint gate, for loading zone performance improving purposes, that opens on a trigger but the open/close module isn't cutting it for some reason. Basic premise of what i am doing/need is the checkpoint will have my players will go through one way then will come back through later. I have tried placing trigger connected to open/close modules for both sides of the door but they only seems to work one way. As far as ive experience and can read in the description of the module it can only be used by one trigger per module hence the need for 4 modules and triggers yet this didnt fix my issue.
After testing with zues teleporting myself to each trigger and it does seem that each module only activates once, triggers are set to repeatable and this works with the show/hide module. Think i either need a code around the one use for the module or a code that just opens and closes the door.
Any help would be very much appreciated as i cant seem to find an answer to what i'm stuck on anywhere. (Picture for reference of what i'm doing, items/objects from OPTRE modpacks)

meager granite
molten barn
meager granite
#

If there is no code involved I'm not sure I can help much

#

My advise would be setting up very small scene with small triggers and determine what works and what doesn't

#

Small scene so its easier to test it

molten barn
#

In the politest way, the idea of asking here is to see if anyone knows a code/script that can do what i need. As for testing it in a small scene i have done so to the same results.
Current issue is I need the door/gate to open and close with player proximity and the only way i know at this point of learning is to use an open/close module with triggers, that does not work as the open/close module is a one use module (as in once triggered it will not trigger again)

meager granite
#

Why do you have 4 trigger areas?

#

Checked how door open module works, it indeed deletes itself lol

#
deleteVehicle _logic;
#

Anyway, opening door through script is easy, you just need to find animation name

#

Module itself pretty much brute forces all possible door and hatch open names lol

#

The arma way!

molten barn
meager granite
#

How many door objects do you need to open in the end? Just one?

molten barn
#

there are 3 checkpoints with 1 door each

meager granite
#

And you had 4 triggers per checkpoint?

molten barn
#

yes my attempt of doing it my self had 4 triggers per door. they have 0 now as im trying to find out how to actually make the door open and close.

meager granite
#

Okay, try the following, setup a door, name it something like "myDoor1", setup a trigger that activates with players (any units?) present, repeatable

#

On activation:

for "_i" from 1 to 22 do {myDoor1 animate [format ["Door_%1_rot", _i], 1];};
systemChat "Opening the door!";

On decativation:

for "_i" from 1 to 22 do {myDoor1 animate [format ["Door_%1_rot", _i], 0];};
systemChat "Closing the door!";
#

You can probably make the trigger server only too, but try without that for now

#

Fixed code bit ^

molten barn
#

Okie doke, I'll go test that out now.

meager granite
#

Added systemChat so it shows something in chat so you can control how trigger works

molten barn
meager granite
#

Try with server only tick on the trigger and see if it works properly in multiplayer