#arma3_scripting
1 messages ยท Page 185 of 1
@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;
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?
so you want to convert a float to an integer?, what's the range of the float, 0 to 1?
yeah 0 to 1 but it rapidly updates due to being on a ui slider so needs to be rather optimised
couldn't you just multiple 360 by the float and round?
yeah that works thanks
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" ๐ฅน
Will setVariable not mess with the existing variable name on a unit?
nah, it's setting a variable on the player - doesn't do anything else, that variable won't already exist since it's one I added (unless the highly unlikely event something else collides with the name I chose, in which case change it to delicious_lastLoadout or something
fwiw done it that way for literally years across everyone of my campaigns without a blip ๐
Cheers, was just wondering if it would mess with the variable hvtTarget that I set on a specific unit
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 ๐
ikr i was able to pretty quickly put this together
slider ctrlAddEventHandler ["SliderPosChanged", {
Missionnamespace getVariable vic;
_rotation = _this select 1;
_rotationc = _rotation * 360;
_rotationf = round _rotationc;
systemchat str _rotationf;
vic setDir _rotationf;
}];
``` shows as only .00317 ms using diagcodeperformance so good enough
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 ๐
Perfect, it works nicely. Thanks :)
that was astoundingly painful ๐
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?
What are supply points?
Spawning a vehicle is just https://community.bistudio.com/wiki/createVehicle. Working out exactly where to spawn it tends to be the tricky part.
@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
@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
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)
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
Then you should send what you've tried to do with passing the vehicle type, and what issues / errors you ran into
If you're getting errors, then it could just be a simple syntax issue
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
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";
I think you need a wetsuit to use inventory underwater or something?
You can't use inventory at all when you are swimming , no matter what.
The only thing you can do is single item pickups (Hand symbol).
If you figure out a way lmk cause I would find this useful aswell
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&
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
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];
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.
mans aren't physx objects so ropes don't work very well when directly attached to them
I think the workaround is usually to use an invisible physx object as a proxy
where can i find physx objects?
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
ok will look thx
I tried baseball, waterbarrel and "UGV_02_Wheel_F" which all are "ThingX" but still same problem
Ropes on players are indeed funny, i wrote a towing script a while back and while testing this happened.๐
After jumping on the vehicle while the rope was attached, it acted like a trampoline.
https://i.gyazo.com/6d657b651d67a0db052509b0d0b80b4b.mp4
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)
:/
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)
Its doesn't give the types, and yes I've looked
no, but it says where to find them
(press " ` ", open Config Viewer, go to Cfg3DEN > Connections)
why press "`"? (btw with CBA it's Ctrl+D)
in vanilla, it's not Ctrl+D
(โฆiirc?)
I don't know these fancy shortcuts, I only know Debug Console ๐
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.

is there anyway to detect if headgear is hat or helmet? doing some CBRN stuff
thats not what i meant ๐ I mean im trying to detect if headgear has protection... I'm looking confs for that
class HitpointsProtectionInfo
?
https://community.bistudio.com/wiki/Arma_3:_Characters_And_Gear_Encoding_Guide#Headgear_Configuration
Maybe you can dig from there if helmet / hat has protection values defined
How do you set up the trigger?
Are you testing this with more players at the same?
code used with apex/unsung seems to work ```sqf
_hgn = headgear player;
_hgConf = configfile >> "CfgWeapons" >> _hgn;
_protection = getNumber (_hgConf >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "armor" );
hello, I have a question why I can't add cannon_railgun using a script to another vehicle??
it's heavily scripted and depends on a second weapon to fire iirc
ah. ok, thank you
aah, now I know, you had to add a rail gun and a rail gun dummy at the same time. now it works. thank you for the tip
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.
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
Oh my goodness, I think we finally figured it out, sorry to bother you guys. We were just getting really confused there.
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?
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.
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?
countType is for counting objects. Magazines in inventory (as returned by magazines) aren't objects, they're strings.
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?
try this:
{_x == (primaryWeaponMagazine _unit select 0)} count magazines _unit;```
(might need to tweak the `()` to get the right order of operations, not sure)
Or, to include secondary muzzles like GLs:
{_x in primaryWeaponMagazine _unit} count magazines _unit;```
I was playing around with count the whole time, just couldn't wrap my head around it. Thanks, these two work!
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
Broadcast it with publicVariable: ```sqf
publicVariable "gameStarted";
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
You should prefix your global variables
With anything or something specific?
something specific like this SAA_mapClicked
Will I still have to broadcast it or does it do that automatically?
You still have to broadcast. The prefix is just so that your variable names don't conflict with other mods or missions.
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;
};
};
sideChat is local effect.
BIS_fnc_endMission is too, although I'm not sure what happens if you only run it on the server.
Sorry to bother you, can you add an example 2 to the wiki? no worries if not and no rush, thanks for earlier as well.
Example 2: add3DENConnection ["Group",[ unit1, unit2, unit3], team_leader]; // all 3 units join the the team_leader's group
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?
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.
Fully randomized such is not impossible. I've ever tried to write Dijkstra to achieve similar but I failed to understand the concept
oh, I have a lot of Dijkstra :P
Line is horizontal, column is veritcal
You can do an a-star pretty fast in SQF. Surprisingly.
Interesting
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.
Ye, good thing is road objects can be the keypoints
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.
@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
It is just randomize not being simple. You can just use, let's say predetermined WPs and select one of them
Yes, that makes sense.. I'm trying to do a complete randomized script based mission, where nothing is the same.. It's been a wild ride ๐ I undewrstand what you're saying has driven the complexity here
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
I'll check it out now
cheers
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.
If you have spearhead you might wanna look in the functions viewer. We have a convoy script.
i can't find the link to the original BI forums detailing its use but i have Devastator's old convoy script and it works quite well
the random areas it starts and finishes is the part maybe someone can help u with
(but Forums down)
I know, but the original link was asked...

Hi Guys, My first project which is for AI Convoys and vehicle patrols. Initial idea is based on Norrins convoy script for which I got permission to modify from Norrin. I rewrite the scripts and now it has several new features and working. Convoy & Vehicle Patrol Features AI convoy and patrol ...
and dropbox DL link seems to be still active
Yeah, that works just fine. I have made a PvP Jet scenario with some sides objectives, and one of them is to destroy/defend convoy. I had to implement some EH to work around some basic problems, like to delete vehicles destroyed that can stuck the entire convoy...
I get it, just saying to not disappoint anyone clicking that link! ๐
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
hideObject
will you sitll be able to shoot it?
No
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
And where is the context I can understand and without F's?
is there any reason to not change the damage in event handlers?
I apologise, the tin sheeting was to 'bullet proof' the engine from small arms fire - I can since managed to use the objectscale command to scale down the barriers to a size that would actually fit onto the vehicle and hide them with the tin sheeting.
I'll look into the eventhandlers
Try using stuff that would actually stop bullets. maybe the metal target plates
Does sleep 0; wait for one frame?
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
nearestTerrainObjects ?
ah i was looking at that but it talks about some "Visitor"
id seems to be same at every run
no getObjectById though
Terrain objects also have a netId in singleplayer, its just the object id
nice thx guys ๐
It's weird to use nearestObjects when you already have the unique object id
But that's just sqf
Or you just don't, and use NetId instead.
ah, objectFromNetID
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
But why? The ID is unique, so the nearest object is always the one you provide.
objectFromNetId didnt work for me, i tried: ```
_obj = objectFromNetId (str _id);
returns nulls
but this worked: _obj = [0,0,0] nearestObject _id;
because a netId is not a object id. if you want to use net id you need to use netid
ah i got now what your saying , so I need to use netId first
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.
so which leads to the question which one is faster? XD
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
hey how do i know your the dev here
I see. That makes sense
What is faster "Do many X" or "Do one X"
dude
heeey
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?
true
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.
GOID = getObjectID cursorObject;
GPOS = getPos cursorObject;
diag_codePerformance [{GPOS nearestObject GOID}]
``` [0.00977677,100000]
GOID = getObjectID cursorObject;
diag_codePerformance [{[0,0,0] nearestObject GOID}]
GOID = netId cursorObject;
diag_codePerformance [{objectFromNetId GOID}]
with netid my code run: 0.031873 ms with nearestObject with proper search start center: 0.0352395 ms
use getPosWorld 
getPos is slow :/
not big difference, but with [0,0,0] center to nearestObject 70.3858 ms <- thats a lot
the lesson should be that all variants that use any position passing are bad
lesson learned don't annoy dedmen nearestObject is not worth it even with stored search center pos, just go with netid
We only use it for storing buildings in saves, and I'm not sure netID is reliable for that.
I assume netID works because saving/loading was my original question
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.
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];
}
10m/s is not very fast (for a projectile) so I'm not too surprised it doesn't go very far
isn't it setVelocity [x, y, z]?
Z being up?
oh yes, 100m/s Z, I didn't see that because it wrapped to the next line
No worries :)
flares seem to have an awful lot of air friction after they start, well, flaring. May be caused (or not) by their simulation type 
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.
[] 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];
}``` ๐
You can also trigger the flare immediately (triggerAmmo) rather than leaving it hanging around for 3 seconds waiting to trigger.
Yo that's sick!
"just glue it onto some rock" does help sometimes ๐คฃ
Hmm it makes a grenade sound lmao
Can I somehow make the GrenadeHand_stone a dud or silent?
Probably only with config. There might be a better one already though.
Google had a neat hack for it lol
UIsleep 4;
deleteVehicle _stone;
sleep*
Fairs, I'll use sleep instead
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
Hi! Sure, see https://community.bistudio.com/wiki/Conversations
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
@winter rose ??
i took it straight from the site but saying [BIS_fnc_kbTell] actor config param not defined for Interrupted1 in briefing?
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.
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;
@fleet sand can you help me with something?
can anyone good at scripting help? im on my own here
Post your question(s), someone will help for sure
ive tried about 3 times and no-one answered besides u and lou montana and then he blanked me ๐ฆ
you did not ask questions - and I also have a life
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
So you want your conversetion to happen later just call it when you need it ?
@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?
Have 2 conversetions and run the second conversetion when something is compleated
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
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.
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
i want 2 or more but i just need the right coding for it and i cant find it anywhere
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
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?
They wont speak over each other unless you trigger them at the same time
so yes i can now have 2 convos with 2 different triggers even if their across the entire map?
without interference of each other
Un sure about that i dont know if you can run 2 convos at the same time. Myb if they are on different actors/objects it will work but if they are on a same actor/object it might cause the problem. I havent tested that but you can test that if you want.
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?
No you dont wonna run 2 convos at the same time.
- This starts convo Breafing:
["Briefing", "ConversationsAtBase"] call bis_fnc_kbtell;
And then in another bikb file you create 2nd convo
And you run this convo when you need second convo to happen.
["Convo2", "ConversationsAtBase"] call bis_fnc_kbtell;
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?
You dont need a sqf file if all you do is start a convo.
you can just start the convo like:
["Briefing", "ConversationsAtBase"] call bis_fnc_kbtell;
In trigger activation or what ever activation you are using.
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?
Yea
ok im gonna try and get back to you if i have any problems,Thanks for the help pal
Also it would be better instead of call use spawn but it will internaly use spawn it skips a check so like so:
["Briefing", "ConversationsAtBase"] spawn bis_fnc_kbtell;
sorry the grammar is hard to understand i dont understand that
call - command is running in unscheduled environment in arma.
spawn - command is running in scheduled environment.
Use spawn for kbtell ๐
so it will still work the same its just different wording?
Yea and no just use spawn
https://community.bistudio.com/wiki/Scheduler
Read that if you are interested in more.
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?
no
What about that ?
so ur telling me that i need to use spawn instead of call,And if i want another trigger for convo2 spawn doesnt work
Dude
so i looked at the link u sent and saw scriptdone
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.
so if a had 2 triggers with the spawn coding it will just work?
Try and see
@fleet sand nope,Its saying i dont have ConversationsAtBase in Cfgsentences
do i a unit to be called KB?
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.
Set the owner ID when assembling (WeaponAssembled EH), and on each client you need a loop that checks for the owner ID.
Example from a script for the ExileMod https://github.com/MGTDB/Exile-fix-drone-uav-stealing/blob/main/initPlayerLocal.sqf
@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
dont ever giue up m8 keep fighting
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.
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
I'll give that a try. Right now I'm basically brute forcing my way with AI generated code and debugging it trying to understand syntax and terminology.
Well, I don't use gpt.
I am new to scripting and mostly using it as a way to experiment and understand how things work/don't work.
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
Trial and error repeatedly, along with research has gotten me through most of it. I'm here now because I hit the wall. Hence, why I'm here. I'll send the code I have so far when I'm back home Friday. Jusymt figured I'd pick brains and see if anyone had a similar idea/ script already.
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:
- It can often forget about sqf's syntax for binary operators. (Instead of a operator b, it often does operator [a, b].)
- Never trust it to call the right functions. It will sometimes invent non-existent functions.
- It's not mp/scheduler-aware, like, at all.
- 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.
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
Which object are you using and in what capacity is it supposed to be damaged?
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
Is is possible to prevent Workshop scenario from appearing in Scenarios list in game if required mods/DLCs aren't loaded?
Maybe store in variable how many hits/dmg it took and hide it once it takes enough hits/dmg?
im quite new to scripting so how would i accomplish that?
currently I'm using simple lines of code in the 3den events tab
negative, beside integrating the scenario to the mod
Have no experience with this particular thing. Can you share code which hides shield on damage?
So a non base-game object with a custom model?
pretty much
Is that object's attributes window?
yup
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)
I'll give it a try tmrw thnx
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.
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:
try setDir before setPosATL?
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
It's fairly unclear to me from the screenshot what exactly the intended result is
Still unclear? Do you have an idea how to solve?
A bit, yeah ๐
- the original rock is rotated in 3D; your created one is only rotated in 2D. You need
setVectorDirorsetVectorDirAndUp. - 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)
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
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
Ive checked before. The XYZ rot axe is 0 0 setDir
Ill do a short vid 4 you
Should be watchable. this is not ment as advertising
https://youtu.be/2mzKjfJjUmw
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?
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
You want the .sqf?
I mean sure that'd also work
You wanna come around at teamspeak? We are with 4 people here tryna solve the problem
Ill send .pbo via dm
I'd love to unfortunately I can't join vc for another 2h. Still at work, just able to test via rmt.

this is not ment as advertising
too late, you're permbanned
Life is wasted now. Im into Arma since Im 11. Now Im getting 22 in 22 days lol. And Im not planing to leave โค๏ธ
# 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
maybe some other script is toying with it, who knows
Is there any function to get the object/vehicle that someone is currently targeting via sensors/radar panel?
I have a script for that, I did this for my Liberation missions
send me a dm
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...
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?
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
that probably is a script, check out the functions browser
https://github.com/PiG13BR/Arma-3/tree/main/ARSENAL_WHITELIST_ACE.VR
Send me a dm if you have questions
sometimes it's just better to spawn a flare directly
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
Thank you, i'll have a look at this when i get the chance later
if you go onto youtube and look up onlinecombatbn flares on trigger he will show you how to do it
There is something wrong with "Flare_82mm_AMOS_White", I can't spawn it. but I can spawn F_40mm_White just fine. createVehicle returns some object, but no light to be seen when using "Flare_82mm_AMOS_White"
stupid question but did you try at night time?
Of course
k
is the light object created but not visible?
like not null
ugh nvm you already said that
weird
spawned in the air and such?
you have to setVelocity or something aswell to the flare
what happens if you do triggerAmmo on it?
This is the missing link (source: just tested it myself)
Dunno why it doesn't trigger itself automatically but there it is
@hushed turtle so you want a 82 flare to go up?
There must be some kind of internal special handling to get it to trigger at the right time for a mortar fire mission, and I guess that doesn't happen when it's spawned by script
triggerAmmo perhaps
@hushed turtle have you tried? https://community.bistudio.com/wiki/triggerAmmo
Thanks! triggerAmmo works
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
If you mean the mission end screen with the static and colour stuff, then the ION weapons scenario from Western Sahara uses it when ending a simulation section
Yes, it is possible (assuming that's what you mean)
Don't know how it works though
Yes that's what I mean. Great that there's a example of it. I'll take a look. Thank you!
Give me a second
[] 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

@icy ridge can you help me with conversation scripting by any chance?
its nothing major hard i just dont know how to do it
Sure, what have you got?
could i do pm by any chance to make it easier
Sure, just add me as I've got DM set to friends only
nvm I'll figure it out, hopefuly
Thanks so much ๐
No problem, have fun with it 
The 0 = is doing nothing, and can be removed
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
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}; };
class CopyBeThereNoTime
{
name = "CopyBeThereNoTime";
sound[] = {sound\CopyBeThereNoTime.ogg, db-7, 1.0};
titles[] = {0, ""};
};
db+ or - whatever
Prefix your classes
Also use ``` for code blocks
```cpp
Code
```
This is also for scripting, not config
Thank you, do you have a link where I can read up on this?
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;```
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.
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?
It works so well ๐ Thanks again!
Glad to hear, you're welcome ๐
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";
so why do you want HC?
Performance
is your mission so big it lags?
Is this important to know to help me?
yeah you may try to optimize something that doesnt need it. But if you want here is link to nice page about HC: https://community.bistudio.com/wiki/Arma_3:_Headless_Client
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
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
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)
Yeah disableAI only changes the AI's behavior on the machine where its called. If the group is moved to another machine, the old commands won't do anything
You need to call disableAI after they've been moved to the headless client.
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
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?
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
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)
Wow. Im speechless. Thank you. Lets work with the new learnings ๐ Thanks mate. Thats really logical
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)
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..
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.
Im literly reading the examples at this second
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.```
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**
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
More correct, but as I explained before, you do not need target 0 because that's already the default, and you don't need JIP true because you don't need the hint to automatically display on JIP machines when they connect.
Copy confirm. Noticed that. I was just tryna understanding the cmd haha
Now Im building it into the right placw
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
I think enhanced Zeus brings a nuke with it
oo, but im not using zeus
# 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 ๐
๐
Do you maybe have experience with remoteExec and maybe have time/ the motivation to help me to fix my command?
2013 i ported the arma 2 nuke to arma 3, it still works -> https://www.youtube.com/watch?v=NXOY85ucr6I
http://moerderhoschi.bplaced.net/arma-iii-nuke-demo/
its also implemented in my streetsweeper 2 mission port -> https://steamcommunity.com/sharedfiles/filedetails/?id=3439435183
Game: ArmA 3 - http://store.steampowered.com/app/107410/
Mission: DEMO Nuke
Video Author: Moerderhoschi@Armed-Assault.de
Download: - http://moerderhoschi.bplaced.net/?p=732
System Specs:
CPU: Intel i5 3570k - 4x3.4Ghz
GPU: Nvidia GTX 660OC - 2048MB
RAM: 16GB DDR3
no, it did not
Im even more confused because the group leader dont move but its units. I think Ive then did it with another try cry
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...
nice! so am i free to include the script to my mission?
sure ๐
Does anyone know somebody who could help me? Im despairing...
Waypoints are supposed to be global.
@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
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.
So I need to put the script on the headless client FTP?
Well, do you have control over where your AIs are?
Everywhere? So all AIs?
How do you mean? We have a 4 server network including 3 instances with headless clients. If you mean the control of the Headless FTP, yes
https://community.bistudio.com/wiki/Arma_3:_Headless_Client
You need to spawn the AI on the HC otherwise its pretty useless
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?
Please tell me how
...
@granite sky thats part of the .sqf Im inserting into Debug-Console
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
Oh, this conversation starts further back than I thought. Never mind.
Yeah Im trying to get into .sqf and DigitalReality since a while. So Ive clue about some parts but Im never sure..
We are playing Liberation so the AI gets moved somehow... I would like to develop from 0 but all people Ive asked just told me to use the existing system.
So I think the headless already got the group with the global var Ive created on the main machine.
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?
Nope
sascha_ziv would need to be published...
actually isnt it move to disable them moving?
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
You are running this in debug as local(or server) yes?
then sascha_ziv is only known to your own client not the HC, even tho the AI's are magically getting transfered to the HC by liberation code
Those civs getting sporty haha
But sadly Im runing this on the server
yes but where did you run this
sascha_ziv = createGroup Civilian;
its part of the "execVM "EBER\Erweiterungen\AnthrakiaVillage\Erweiterung.sqf";" Im runing through the server to start everything
yes so server knows sascha_ziv but the HC's dont
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
Oh sorry @granite sky overread your message.
I never would think about that because I tought by creating the units var without the _underline its already global and published
I feel so dumb...
So next logic step for me is to ask how I publish these units in the correct way
It's hard to talk about this because there are two meanings of global/local :P
WHAAAT??? Its getting worse hahaha
But in general to publish a variable everywhere you do publicVariable "variableName";
So I will need to supplement the publicVariable command beneath the createGroup thingy, right?
there is global/local variables (code scope), and "public" variables (as in updated over the network)
Ouuu those are the scopes. Ive read multiple times about it. So there is a outer scope of the "normal" global -> sascha_ptr = exampleForSimpelGlobalScope
Just publicVariable "sascha_ziv"; after the createGroup would probably work.
I feel released. Lets try out to confirm haha
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.
Not actually seen that in A3. Might be lacking a suitable animation.
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
Oh yeah, my brain is going and ACE does have carry as well as drag.
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...
Are you talking about those respawn points?
Yes (placed via zeus not the eden)
@dark pecan ACE code if you want to work from it:
https://github.com/acemod/ACE3/blob/master/addons/dragging/functions/fnc_startCarryLocal.sqf
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
Zeus enhanced or additions dont allow me to change it, if i knew what params to run to change in their exeuction
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
Yeah i have taken a look into that. But that's just applied to ace3. I was more looking into something with an addaction and then do it. Let me see what i can do with it
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
When you try to make server/mission for your friends but you have less than 100 hours in the game ...
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
noob question
Becomes an if-cause an iteration without an else option until the bool turns true?
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.
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/
Learn the basics of programming with the Python programming language. The focus of the course is on programming, and you will learn how to write programs and understand how they work. For example, the basics of algorithms, control structures, subprograms, object-oriented programming are covered. The course is suitable to anyone who wants to lear...
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...
I will need to save it. But Ill never have the time to read because of work, leading a community, doing milsim events, scripting and reworking things...
But HeadlessConfigurated haha
I need a way to pause the script until the headless took over the AI so Im handling the right "enviroment" (?)
And I need a break. Im going into the 12th hour of Arma today...
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)
you mean by someone else?
the only ways that you can change a local variable (besides intentional =) are:
- you mistakenly assign to it without making a private var
- you call a user callback and that modifies it, or you read from a global var that can be modified
- by reference if it's an array or hashmap (not the case here)
setvariable can't change local vars
Are you talking about local/global scope or local/global network?
local scope
no so i can update it by myself later in script
As long as you stay within the scope, you can just assign a new value to it like this ```sqf
_localVariable = 1337;
// ... code ...
_localVariable = "LEET";
yes
suprised i thought = was only used for defining vars
Remember to use private to avoid collisions though
Or privateAll. ๐
Oh, that's a thing nowadays, nice to know ๐
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];
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?
yeah BIS_fnc_endMission shows whats in the class
Gotcha, silly mistake by me then lol
hello hello
What would be the script command to show a message like this to zeus?
BIS_fnc_showCuratorFeedbackMessage
thank you!
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?
You could try setFormDir and/or doWatch
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";
};
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
Im using the debug console with server exec on a dedicated server
well, there's your answer
If I run it global it spawn 20 times
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
both of these don't work, i tried them both.
Ill do an activation.sqf where Ill separatly will form if-causes
Well, those are the options I know of.
I suppose you could make a script to setDir in very small increments over the course of a few seconds, but that's a bit silly. Otherwise you might be out of luck.
Do they have to be entirely stationary during this?
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.
If you don't want them to move during their turn, you can just use: https://community.bistudio.com/wiki/lookAt
This will initiate an animated turn to look at a given position.
You just need to get a relative position for them to look at
You can use https://community.bistudio.com/wiki/getRelPos to achieve this
for example:
mySoldier lookAt (mySoldier getRelPos [100, 90]);
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
Also, the last two lines in this snippet won't work, because the setFormDir and setDir commands are used on, I presume marker or object which you previously used to get the position the unit was supposed to move to, and not the unit itself.
Thats my attempt to select a sepecific HC:
if (isNil "HC3") then {
call AnthrakiaVillage_fnc_Einheiten;};
Hmm, can you not remoteExec["triggerAmmo"]?
[_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.
So what you're saying is, if the server is the entity that's creating the flare and executing triggerAmmo then it's automatically updated for all clients or am I misunderstanding?
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;
};
If the flare is created on the server then it should be local to the server and that's where you need to trigger it.
If the Server is the same instance creating the object as triggering it, yes. You do not require remoteExec and the effect is shown for every client.
Hmm, that's what happens then, but for some reason the triggerAmmo doesn't work unless I remoteExec it to all clients
What do you mean doesn't work?
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);
};
}
The flare isn't ignited immediately, it only ignites after 2-3 seconds
I want it to be ignited from the ground as it goes into the air
[_flare] remoteExec ["triggerAmmo", -2]; makes it work as intended
huh, very weird hm, maybe it is how it is 
Also to clarify the launchFlare function is defined in initServer.sqf as well
That is... functionally questionable...
From my side or game logic wise? lol
use 0, a server can also be a player
Depends on whether or not the mission is run on a dedi, no?
Game logic wise
Mission is running on dedicated server ye
correct
don't design missions for a specific type of server ๐
In terms of locality. It doesn't make sense.
I'm also currently testing using the dedicated server to ensure it works as I want
True it's likely best practice to make it adaptable
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
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.
I don't get it then lol
Cause all the logic is server side
Maybe it's something finicky with the 40mm flare specifically?
that's what I end up suspecting
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)
I agree with you and Lou. This is kinda weird behavior.
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.
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
To my understanding, more mass should make the vehicle slower to accelerate, brake and steer
Physics mass of a physics object is part of its model, not its config. You might have heard about the inventory mass of an inventory item, which is in its config.
getMass and setMass are fairly simple to use as long as you take note of the locality requirements.
You can also use limitSpeed if you simply want to make a vehicle unable to drive fast, without changing its other handling attributes.
that should be fine for me..well in concept, the vehicle is one of the towing tractor used at an airport so i would want it to be slow
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.
I thought that limitSpeed is only for AI
If you want players, you can use setCruiseControl in speed limiter mode.
I will keep that in mind thank you
@hallow mortar I'll read up on setCruiseControl and see if i get the desired result, thank you all
Generally a good idea to go with a percentage increase/decrease of getMass value.
There are several interesting effects of mass manipulation. For example:
Which incidentally is also a fairly good example of going a bit crazy with the values 
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
enableSimulationGlobal false should work.
myObject setMass [10, 0.5]; ok explain to me the values in the array
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;
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)
Bear in mind that global effects of setMass are transmitted extremely slowly for some reason :/
Whether that matters depends on your use case.
It's the other way around for me with your code. I can see the inventory of the vest but I can't pick it up.
Could it be due to being in profiling branch or using ace and cba?
I'm seeing the action to pickup and open the vest in the scroll menu
I only get open in the action menu.
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;
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?
In my config.cpp :
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;
};
};
};
};
I can't post the sqf because it's too many characters, lmao.
Use a code block, don't just paste it
```cpp
Config
```
And for scripts
```sqf
Code
```
Your CfgFunctions stuff is one level too deep, isn't it?
ah no, I forget that the functions themselves are classes.
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.
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;
thanks!
Since 2.18 you can skip the forEach and just give deleteVehicle an array directly
Thanks! It works both ways.
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 ๐คฆโโ๏ธ
It's just a readability thing
Put your script in like a pastebin or github gist or something if it's too long for discord
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
What's wrong with it?
when I fire the smoke round, nothing happens. no system message, no text, no helo support.
Tested in what environment?
Dedicated server, listen server, you're client or the server?
Does the diag_log for initialization fire?
And does the code work if you run it later from the debug console instead?
Tested in local server from editor
Havent tried running it from debug yet, will try and report back
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", "", ""];
};
};
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?
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
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?
Yes.
Given that the hold action is remoteExec with JIP, yes, the code's probably supposed to run on the server only.
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
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.
Hmm, that's annoying, you got any suggestions for a better way to remove/hide all actions except the first one used?
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.
What if I moved the addAction to server logic
Would the actionIds be consistent then?
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.
No worries, appreciate the heads up
Yup so in case anyone searches for this problem again in the future. The trick was to use remoteExec for the execution.
[[_target, triggerStart], "scripts\endscreen.sqf"] remoteExec ["BIS_fnc_execVM", 0];
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;
I wouldn't recommend this if you're running a public MP server as cheaters would be able to effectively remoteExec any script on anyone they like. I would take a look at these two links ๐
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
https://community.bistudio.com/wiki/Arma_3:_CfgRemoteExec
I have been waiting on my toes too hahaha
let it be known Irish is a crazy scripter ( highkey some cool as shit lmao) first hand experience
Really not. I monke my way through and sometimes it works. 90% of what I'm doing in our ops is triggers and timing things rather than true scripting.
dude I'm hyping you up in front of the script wizards shhhh
Anyway, I've put my synapses of what I want done into a pastebin. if one or more of Ya'll want to take a crack at it, please halp.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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?
One trick you can use with findEmptyPosition is to use a larger object than you're placing.
It saves when the game is closed properly. A lot of people alt-f4 because it's much faster. And servers probably get their process killed.
setVehiclePosition is the most straightforward way to achieve "safe teleportation" (https://community.bistudio.com/wiki/setVehiclePosition)
It utilizes the same algorithm as createVehicle to find a suitable position in a given radius around a given position.
"This command triggers a file operation. As file operations are slow (even on SSDs), it is not recommended to use this command too frequently (i.e. several times per second).
https://community.bistudio.com/wiki/saveProfileNamespace
Normal usage won't lag your server.
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.
Shouldn't hurt yea
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?
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,...
Take a look Here https://github.com/TacticalTrainingTeam/ttt_a3/blob/a753ddb5fb7f1959503141134a00ae654f44a5e4/addons/teleport/functions/fnc_moveToRespawn.sqf#L28
The custom unit modifcation for the Tactical Training Team - TacticalTrainingTeam/ttt_a3
to get animals you can do: ```
nearestObjects [getpos player,["animal"],30]
Awesome, will try it out thanks :)
Since addHandgunItem has local argument, does it mean that addHandgunItem needs to be run where unit is local for it to work?
Yes.
is there a way to limit which channels markers can be put into and still allowing typing like normal in the channel?
Check the channel and delete a marker in https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#MarkerCreated event handler.
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
Just display a message to the player if it was deleted
If you take a look at the page, you can see that the markerCreated EH tells you which channel the marker was created in directly.
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.
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.
There is also enableAttack.
Set if leader can issue attack commands to the soldiers in his group.
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)?
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
I found it. It is listed under dubbing_radio. Just in a big Names config.cpp
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
I believe if I just include a config.cpp in my mod with the Class CfgWorlds and GenericName class I can just add on to it all. The Livonia DLC does the same.
+= is probably what you need for that.
But #arma3_config will likely be able to help you better with this.
For Doubledax, or for me?
For you.
I see! I had not even thought this would be a config thing! I will go ask there ๐ซก
Well you're working in config.cpp and modifying things that start with Cfg. For future reference, that's a clue
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
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);```
Your original code may have worked except _firePos is already a position array, so position _firePos is invalid.
doWatch on a position is legitimate.
You can use sqf instead of c++ to get correct syntax highlighting in Discord code blocks
wow discord actually recognizes us Arma scripters! there are dozens of us!
I've fixed it, and yeah, he points in the right direction on the 2D plane, but still doesn't point the flaregun up, so I'm going to combine both results to point the unit in the direction of the waypoint using doWatch (since it looks less instant to observers) then use the pitch to actually point it up
yeah, that doesn't surprise me.
maybe next year we'll get that direct unit aim control command
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???
That's a rhetorical question, right
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...
if anyone happens to find this in the future, here is the current working version.
_firingUnit doWatch [(_firePos select 0), (_firePos select 1), (_firePos select 2)];
sleep 2.5;
[_firingUnit, 70,0] call BIS_fnc_setPitchBank;
_firingUnit fire [(_firingUnitWeapons select 0), _firingMode, _magazine];```
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
IIRC that's a unit behaviour not a group behaviour.
So you can just set that unit to combat rather than the group.
You could try experimenting with playActionNow. I'm not 100% sure, but one of these could be the action for raising the weapon https://community.bistudio.com/wiki/playAction/actions
Might be Combat or WeaponOn, maybe
Yeah I set the unit to combat mode when i tell him to switch weapon, my pause I had set up for the weapon switch was long enough to raise the weapon
Seems to be working fine
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.
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
Thank you, I will try that
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.
What have you done
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)
from the wiki ๐
Use addMagazine before addWeapon for the weapon to be loaded with the magazine automatically.
Well, obviously I just wanted to test you. Damn, how did I not see that.
You can also use e.g. addPrimaryWeaponItem if you want to be more specific with it
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)
you could alternatively use a camera to create a cutscene
this is not a cutscene, i'm doing a timeskip and i want the player to be in position when the black screen disappears
You could attach the player to something and only detach when you want them to be able to move.
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
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.
Yeah, you just make a separate action and put all your other actions in there
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
Anyone know if there is a way to continue to force the game to render in the background while the map is open?
Is there a script command I can use to make unit A rearm at unit B's backpack? For situations like a machine gunner rearming at an assistant machine gunner, or a medic distributing FAKs to the squad
Looks like this may be of use
https://community.bistudio.com/wiki/Arma_3:_Actions#Rearm
no but you can get a units inventory and remove items from it and then add items to another units inventory
im pretty sure the above action is for ammo vehicles
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
It's only for dead units iirc
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
That's the gear action, not rearming
or, I can have backpack units drop their pack, units rearm at packs, then backpack units pick up their packs
_unit action ["rearm", backpackContainer player]; did at least remove magazines from my backpack 
You could disable simulation on the players character. It will stop them moving and won't remember there last move.
are you running dedicated server? i think server should also call endMission
Is there a way to make active radar not detect ground vehicles? Makes no sense whatsoever.
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
Yea, irl if the target is actually moving and the helicopter is not moving. A radar cannot see the difference between a small shed a tank, or a tank sized boulder and a tank.
In arma active radars can detect ground vehicles even when they are parked and theres ground clutter all around it
It is possible to configure Arma radars to have a minimum target speed for detection - but again, only through config, not scripting.
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
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.
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
Well in that case you could give the aircraft just sensors and not an active radar to simulate this. As sensors won't show it unless they find it with there pod and reveal it with T or if another friendly radar finds It and datalinks it to them
extremly off topic but cant ground surveillance radar detect material thickness of a tank being refined steel vs rock?
I think maybe with very low frequency radars? But those are typically very large compared to high frequency radars so probably can't be carried by an aircraft
Hello all: Can we make soldiers fire RPG's at me, the player
with out any mods and just useing scripting
wow nice thx you @hushed turtle
I don't think that's gonna do the work, since you can't pick target. Maybe combine that with doTarget?
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
I don't remember Arma AI using any sort of AT weapon against human target 
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
I think ARMA 3 AI will use rpg on its own if it has HE rocket ammo instead of HEAT
on the players ?
yes
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
I think with HEAT they only use against vehicles. I think it is defined in CfgAmmo what targets a munition can be used against
No HE ammo available though
ahh ok
iv tried and tried to make this work, so i guess i keep trying, i have a few ideas in my brain
You'll probably have to either use invisible vehicle target for AI to shoot at, or script the aiming and shooting entirely.
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)
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 ?
well it is local, so you can check identity in this code
WHen i place in "Global channel" is not the same ?
so just if i check if the _marker (ctrlMapMousOver) select 1 find "_USER_DEFINED" its ok ?
All player created markers will have user defined in them
And i can make difference between "my marker" on "my mate's marker" with the player id ?
_USER_DEFINED #<PlayerID>/<MarkerID>/<ChannelID>
If you're referring to this comment, then that's the client id, not like a player's steam id
yep but its unique ?
Should be, they're not reused if someone disconnects and someone else joins in their place as far as I remember
For example, i can do
if (owner player == n1) then {
hint "its my marker !";
};
(n1 is from your example)
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
yeah i see
what does it mean ? i can't do that ?
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
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)
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?
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.
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.
Are there still only 10 custom channels?
It wouldn't appear if you instantly delete it. It would be deleted before the map could render
Yep, looks like custom channels are global, so ya, works only for 10 players, not enough.
It looks like a plan....will go with this implem, disabling all channels but Direct to limit networking.
thank you guys!
Probably still works. When I was testing some surrender code they they threw grenades at me because I'd removed their weapons.
Should still follow aiAmmoUsageFlags and allowAgainstInfantry though
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?
A spawned script terminates when it reaches the end of the code.
Any script ends when it reaches the end of the file or an exitWith
i already find solution, but your idea isnt what i was need because character will be freezed - this kill immersion, but thx for your answer anyway
Yeah but they can't see anything if the screen is blacked out
So what does it matter
because the screen doesn't go dark right away
Another way could be switching to a camera
guys this discussion is useless because it's already been decided - i found exactly what i needed
hmmm
I testeed on my server but the "player id" i can't get it with "clientOwner"
any guy have an idea ?
why u need player id ?
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?
dunno, how do you use it?
@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
oh cool thx Dart, yes i found this allowAgainstInfantry
@leaden needle if you post how your trying to use this we can help better
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
wait actually โ troubleshooting 101 โ i will start the game with 0 mods and try again
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
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"
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.
_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
There's the wiki pages
https://community.bistudio.com/wiki/CfgAmmo_Config_Reference#airFriction
https://community.bohemia.net/wiki/Arma_3:_Damage_Description
Found a steam guide that might help as well https://steamcommunity.com/sharedfiles/filedetails/?id=3248569792
Hit at a given velocity is from damage_to_target = hit * (speed / typicalSpeed)
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)
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.
Sounds about right.
If you want to replicate the path you'll need simulationStep too.
I was just starting to look for the discrete time interval I'd need. Thank you
Yes. Start with published irl performance specs but an auto collective shouldn't need to approach extremes hopefully. For sfm you can check the inputAction values for the collective key/Controller.
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
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?
Can't fake input afaik. You can reference the hatchet h60 flight director for some ideas as well. https://github.com/Project-Hatchet/H-60/blob/Main/addons/uh60_fd/functions/fnc_ias.sqf
One more thing if you happen to know. Sound Supressors increase muzzle velocity by about 5%, does this have any effect on accuracy?
You likely pasted the code into the group's init as well as the unit's
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
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
Suppressors make the weapons more accurate?
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
fair
There's this, but it does require AFM. I don't think there's a basic mode equivalent. https://community.bistudio.com/wiki/setActualCollectiveRTD
Edge case handling, using predicatble logic (if I use an existing "rearm" that can be predicted, less worrying if my code works as intended), preserving magazine ammocount, automatic animations, less duplicating existing functions, fewer failure points, and so on
- You'd have more handling when scripting something yourself rather than just using the engine
- You can add magazines with specific ammo counts
- Different code is not the same as less failure points
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
Does that exist? That doesn't sound like Arma :P
I did the easy way transfer magazine on reloaded eh
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?
Duplicate the trigger?
hmm..ok, I was trying to avoid that if I needed to do more in the future
At some point triggers will become annoying and you're better off with a monitor script.
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)
Post screenshots of trigger setup or associated code pieces
It's right there in the message, 4 triggers sync's to 4 open/close modules. No idea what code can do this hence my asking here.
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
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)
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!
Because the 4 open/close modules state it can only be activated by one trigger. My hope was it was repeatable and after testing its not.
How many door objects do you need to open in the end? Just one?
there are 3 checkpoints with 1 door each
And you had 4 triggers per checkpoint?
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.
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 ^
Okie doke, I'll go test that out now.
Added systemChat so it shows something in chat so you can control how trigger works
This worked, thank you so very much. I spent nearly 3 hours trying to work that out before coming on here.
Try with server only tick on the trigger and see if it works properly in multiplayer
