#arma3_scripting
1 messages ยท Page 200 of 1
Any1 know why HC group disappears, no more under subordination, when made to enter vehicle
maybe creating a GUI on start so player can select such parameters
and then "load the mission" after it
I created such a UI for spearhead 1944.
There is a new parameter now to disable vanilla parameter handling which makes it super easy without weird workarounds.
great, is that on biki?
It's supposed to be. But I haven't gotten beyond the "This is WIP" part yet๐คฃ
It's on my list so maybe I find some time tomorrow.
neat
if the settings doesnt need to be set at mission start you can use https://community.bistudio.com/wiki/createDiaryLink to create settings menu
Hey folks,
maybe you can help me understand.
I have this line in a Script:
_bomb = createVehicle ['SatchelCharge_F',getPos _thisTrigger,[],0,'CAN_COLLIDE'];
But everytime when I start it I get the error in the picture.
I probably have just some Error in the call for createVehicle but I can't see it for the love of god. Can anybody help me?
getpos _thisTrigger seems to return empty array. maybe _thisTrigger is not defined?
did you mean "thisTrigger" instead?
Yeah, _thisTrigger was wrong. Sadly, replaced it but threws the same error message.
_bomb = createVehicle ['SatchelCharge_F',[1,1,1],[],0,'CAN_COLLIDE'];
I tihnk some syntax error, but I tried opening wiki and the cloudflare bullshit just keeps reloading and retrying and isn't working, so can't help you
From Wiki:
_veh = createVehicle ["ah1w", position player, [], 0, "FLY"];
createVehicle [type, position, markers, placement, special]
Full error message?
Isn't that the wrong class name?
Run that code from the debug console and check that it works.
Checked the log, but only throws it onto screen.
Sounds like a recompilation issue.
Make sure to drink enough water
If the error's not in the log then you're looking at the wrong log. If you're getting that error with that code then you're not running the code that you think that you're running.
Be aware that thisTrigger is not available in console
Did it, works.
So, thanks to all of you. Don't ask me why, but this works now:
_bomb = createVehicle ['DemoCharge_Remote_Ammo',getPos thisTrigger,[],0,'CAN_COLLIDE'];
So _thisTrigger was obviously wrong but it was also the wrong element to spawn.
anyone know how to get an AI unit to switch to launcher? From what I can find on BIKI, either of the following should work, but they don't:
_unit selectWeapon (secondaryWeapon _unit); or _unit selectWeapon "rhs_weap_rpg7";
Force it, remove all other weapons and leave rpg.
Ai don't want to use rpg ๐
you need a muzzle if there are multiple firing modes, not a weapon classname
also take a look at https://community.bistudio.com/wiki/Arma_3:_Actions#SwitchWeapon
I don't think the RHS RPG-7 has multiple muzzles
don't know, just putting it out there
Hello everyone. I've been working on a mission file for a group of mine and I am struggling to connect the powerlines to the poles via scripting. I've done some digging on the forums and scripts, but haven't been able to piece anything together. Is there a way to connect them together without using objects as reference points for the cable ends?
How can I set an NPC's faceware to a blindfold?
[] spawn {
_captiveUnit = (createGroup [east,true]) createUnit ["C_Man_French_universal_F", [0,0,0], [], 0, "CAN_COLLIDE"];
_captiveUnit linkItem "G_Blindfold_01_white_F";
};
I also tried doing addItem then assignItem but nothing happens either. I also cant seem to remove faceware like glasses that sometimes randomly appear on NPC spawn using removeAllAssignedItems _captiveUnit;, removeAllItems _captiveUnit;, etc.
hint str assignedItems player; with my player character wearing the blindfold also does not show the blindfold as an item I am wearing
nvm im actually dumb as shit it was well apparently addGoggles_captiveUnit addGoggles "G_Blindfold_01_white_F" doesnt work either but hint goggles player; does print the blindfold out
try removing whatever goggles are on the unit first, then adding the blindfold via addGoggles
_captiveUnit removeGoggles (goggles _captiveUnit);
_captiveUnit addGoggles "G_Blindfold_01_white_F";
@fair drum This is the actual code I am trying to run that isnt working:
private _captiveGroup = createGroup [east,true];
_captiveUnit = _captiveGroup createUnit ["C_Man_French_universal_F", _containerPosition vectorAdd _objectPosition, [], 0, "CAN_COLLIDE"];
removeAllWeapons _captiveUnit;
removeAllItems _captiveUnit;
removeAllAssignedItems _captiveUnit;
removeUniform _captiveUnit;
removeVest _captiveUnit;
removeBackpack _captiveUnit;
removeHeadgear _captiveUnit;
removeGoggles _captiveUnit;
removeAllContainers _captiveUnit;
_captiveUnit addGoggles "G_Blindfold_01_white_F";
there is nothing sticking out that is wrong with this snippet. however, in your spawn block above, you are losing reference to _captiveUnit if you don't pass it to the spawn scope
[_captiveUnit] spawn {
params ["_captiveUnit"];
// _captiveUnit is now in this scope
};
ok, that shouldnt be an issue for the actuaal full script I just wrote that to simplify, all my code is actually in the spawn block in a sense
once the unit is configured i dont need the reference anymore anywyas
id just pust the whole script but its way too long for discord
also instead of all those commands to strip naked, consider
_unit setUnitLoadout (configFile >> "EmptyLoadout");
put your whole script into pastebin, then post. easiest way.
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.
is this code you are executing in a zeus composition?
thats the idea but for testing I just run it from debug in SP zeus
it needs ezm loaded first
aafter running this is what the dudes look like
Seems to be a timing issue in the engine.
Works fine scheduled:
private _captiveGroup = createGroup [east,true];
_captiveUnit = _captiveGroup createUnit ["C_Man_French_universal_F", getPosATL player, [], 0, "NONE"];
sleep 0.01;
_captiveUnit addGoggles (goggles player);
I can throw it in an isNil {}; if you think that might do it?
Does not work unscheduled.
yup its a timing thing. needs to be next frame after creation or a small sleep. just finished testing my own version
Not sure if that's specific to goggles.
Their facewear randomisation is probably happening after you do your thing and so overwriting it
Ah yeah, that makes sense.
I did mine with vanilla base classes as well
ok, well apparently i cant put a sleep here so ill figure it out thanks for the help, this gives me a way forward!
sure you can, make a new spawn thread after creation since you are creating multiple at the same time
yeah if you're unscheduled then you'll need to spawn the addGoggles at least.
Or exec next frame if you're into the CBA stuff.
im trying to keep this working on vanilla servers as much as possible EZM was just a simple way for me to get a GUI but ill probably write my own later
https://community.bistudio.com/wiki/Scheduler
Your code is currently running unscheduled and cannot be suspended. Using spawn creates a new scheduled thread, where suspending is allowed. This is what Hypoxic is trying to tell you.
eyyy
rotation is messed up now but I can fix that after
thanks for all the help everyone, appreciate it
You should get a better debug console btw :P
Try the "Advanced Developer Tools" mod.
probably but I dont know anyone who does any arma development im pretty much running off my day job being software and whatever i can scrape out of the wiki
i will chekc it out, thanks!
i have just been coding in intellij with some sqf plugin that is missing some of the syntax
i was using vscode but it decided to turn off autosave without telling me and i lost like 4 hours of work to it crashign with out of memory despite using like none of my ram. so fuck vsc
Hey @proven charm , thanks again for helping with me on this man. Quick question though, I'm trying to update the script to react to BOTH OPFOR and INDFOR and I can't seem to get it work. Can you please help me out if you're free?
The current code I've changed it to is this:
[] spawn
{
[FIAOfficer, "WATCH1", "ASIS"] call BIS_fnc_ambientAnim;
waituntil { sleep 0.1; ({ _x distance FIAOfficer < 5 } count (units opfor)) > 0 };
waituntil { sleep 0.1; ({ _x distance FIAOfficer < 5 } count (units independent)) > 0 };
detach FIAOfficer;
FIAOfficer call BIS_fnc_ambientAnim__terminate;
};
However the NPC only identifies the first waituntil line and not the second
ok so you can combine the two lines: ```waituntil { sleep 0.1; ({ _x distance FIAOfficer < 5 } count (units opfor + units independent)) > 0 };
Dude, you're an absolute GOAT
Thanks so much haha
Also, the whole ASIS line for ambient anim still doesn't work cause the script deletes primary weapons or backpacks depending on the anim
Any chance you know how I can fix that haha?
umm no, i dont even know why it deletes gear
Yeah fair. Regardless, thanks for helping me out again!
Because BIS_fnc_ambientAnim is simply poorly written/implemented
i mean it shouldnt do that. but if you must restore the gear use https://community.bistudio.com/wiki/getUnitLoadout and set it back https://community.bistudio.com/wiki/setUnitLoadout
The function removes weapon whenever the animation is configured to do so, ASIS is not involved there
Ohhh, I'll take a look. Thanks guys
Will I be able to get it feed out of my loadout list from Arsenal by using this?
getUnitLoadout "B_Soldier_F";
Assuming I change up the B_Soldier_F that is
sorry i dont follow
Syntax 3 and Syntax 4 is different
Or rather, you simply just do like:
private _loadout = getUnitLoadout _unit;
[FIAOfficer, "WATCH1", "ASIS"] call BIS_fnc_ambientAnim;
_unit setUnitLoadout _loadout;```
Oh okay, I'll give this a try now thanks @warm hedge
thats loading gear from config class. i dont think arsenal supports that?
Arsenal is not related with it
Hmm I gave it a try and it still got rid of the NPC's backpack
Then make some sleep between
Sleep?
Yes
How to make a vehicle invisible when simulation is off ? ๐ค
Sorry I don't know what that is
Right gotcha, I'll give it a try. Thanks @warm hedge
Thanks R3vo!
Quick question: I have a trigger are that forces the AI to open fire as soon as a player steps into it, but I want to add a visibility check, so the AI will only shoot when they actually have a clear line of sight to the player (as it makes no sense when they fire if there is terrain or a wall or other objects between them and the player). Would a checkVisibilitycheck do the trick? So something like:
_canSee = [objNull, "VIEW"] checkVisibility [eyePos _groupleader, eyePos _enemy];
if (_canSee > 0.7) then { ...
yes. but add the _groupLeader as the ignore object
so switch out the "objNull" with "_groupleader" (which is the AIs group leader) and "_enemy" is any unit considered enemy (that steps into the area). Got it! Thank you :)
Hello, I would like to ask you, I found some older missions that used manual role assignment for ctab, does anyone know if it is still necessary to have such a script in missions or is it an unnecessary power hog?
//NATO
if (!(isNil "acoy_1")) then {if (acoy_1 == leader acoy_1) then {acoy_1 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_2")) then {if (acoy_2 == leader acoy_2) then {acoy_2 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_3")) then {if (acoy_3 == leader acoy_3) then {acoy_3 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_4")) then {if (acoy_4 == leader acoy_4) then {acoy_4 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_5")) then {if (acoy_5 == leader acoy_5) then {acoy_5 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "acoy_6")) then {if (acoy_6 == leader acoy_6) then {acoy_6 setGroupIdGlobal ["A-Coy"];};};
if (!(isNil "dingo_phq_1")) then {if (dingo_phq_1 == leader dingo_phq_1) then {dingo_phq_1 setGroupIdGlobal ["Dingo-PHQ"];};};
if (!(isNil "dingo_phq_2")) then {if (dingo_phq_2 == leader dingo_phq_2) then {dingo_phq_2 setGroupIdGlobal ["Dingo-PHQ"];};};
if (!(isNil "dingo_phq_3")) then {if (dingo_phq_3 == leader dingo_phq_3) then {dingo_phq_3 setGroupIdGlobal ["Dingo-PHQ"];};};
if (!(isNil "dingo_phq_4")) then {if (dingo_phq_4 == leader dingo_phq_4) then {dingo_phq_4 setGroupIdGlobal ["Dingo-PHQ"];};};
Do you guys know whether doWatch uses AGL or ATL? Thanks
From what I remember, most AI related commands are AGL
Can anyone confirm that this will always return Z=0 over land, even if there is a surface above the position? The description is not clear, it says AGLS, and AGL right after that. Thanks
(getposATL player) getpos [1, 0]; returns zero on land and negative z in water - just tested
Thanks, so there is probably a mistake in the AGLS.
is there a script that could turn this death background into just a black screen?
Is it possible to "move" an attached object B (that has been attached to object A via "attachto") to a new attached to position (still attached to object A) and make that transition show up in steps with ```sqf
for ... from ... to ... step
Or is that not possible to do with an object that has been attached to another?
Yes you can do that
@drifting badge Its how i did this: https://youtu.be/-FvtUN4v93I. Tank attached to plane. Parachute attached to tank. Moving attachTo positions in steps.
oh nice, how would the code look for this (if you like to share), might be able to adjust it to what I am trying to do
Discord doesn't let me post the message for some reason. Despite being under length limit. Says can't be send because we don't share server. But i was sending it in this channel wasn't even trying PM's ๐
{
null = [_this] spawn {
_this # 0 params ["_target", "_caller", "_actionId", "_arguments"];
private _vehicle = _arguments select 1;
private _parachuteClass = _arguments select 2;
private _parachuteAttachPos = [0,-2.5,1];
_arguments # 0 params ["_originalX","_originalY","_originalZ"];
_vehicle allowDamage false;
[_target,_actionId] remoteExec ["removeAction",0,true];
private _parachute = createVehicle [_parachuteClass,[0,0,0]];
_parachute allowDamage false;
_parachute disableCollisionWith _target;
_parachute attachTo [_target,[_parachuteAttachPos # 0,(_parachuteAttachPos # 1),_originalZ]];
_parachute setVectorDirAndUp [[0,0,1], [0,-1,0]];
sleep 2;
for [{private _i = ceil _originalY}, {_i > -10}, {_i = _i - 0.1}] do {
_parachute attachTo [_target,[_parachuteAttachPos # 0,(_parachuteAttachPos # 1) + _i,_originalZ]];
_vehicle attachTo [_target,[_originalX,_i,_originalZ]];
sleep 0.01;
};
_parachute attachTo [_vehicle,_parachuteAttachPos];
_parachute setVectorDirAndUp [[0,0,1], [0,-1,0]];
detach _vehicle;
sleep 5;
deleteVehicle _parachute;
_vehicle allowDamage true;
};
},
Ah that worked, i cut some stuff out. I guess the length counter way lying to me? ๐คท
I used the advanced for loop there, but you could just as easily do it with for from to step.
Thanks for clarification.
myRope = ropeCreate [transformer_start, [0,0,7], 51, [" Land_HighVoltageColumnWire_F", [0,0,7]], [" Land_HighVoltageEnd_F", [0,0,7]], "Rope", -1];
Here's what I have so far from the wiki
I don't think you can edit death screen background. That being said you could write script to display black screen instead of death screen and end the mission
I am trying to have a drone spawn 10 meters above the ground, I thought having "FLY" for the special string would make it so it starts off hovering but it just falls 
_spawnedDrone = createVehicle ["B_UAV_01_F",(position player),[],0,"FLY"];
_spawnedDrone engineOn true;
but the darter just spawns at its default height and falls down death
https://community.bistudio.com/wiki/createVehicle
"FLY" - if vehicle is capable of flying and has crew, it will be made airborne at default height.
probably b/c its a drone
that doesnt really help, the darter just starts falling from 50 meters up?
yeah ~50meters
brb booting up arma
my guess is that you'll need to setup the script to do the basic UAV connectivity things.
You need to add the drone 'crew' I think.
Yes, you need a dab of createVehicleCrew, otherwise there will be no pilot to maintain altitude
UAVs in Arma still require crew, it's just a special type of invisible unit that you remote-control
oh okay, in zeus I saw that it had like the blue filled icon to say it has crew, ill try that
lmao that was it
maybe I guess zeus was showing that there was a gunner but not a pilot lol
but yea that was the fix
create vic crew
ty ๐ซก
will DirectPlayID always return a string of numbers with getPlayerID? Is it safe to always parse to number?
But yes, it would be totally possible to create a rope, create a vehicle, attach the rope to said vehicle (which would be like the seat) and then attach it to the helicopter itself.
this has got my brain going
As for "throwing" the rope, you could possibly use a very very scripted grenade's landing point to find the final location for it.
And then attach a rope you could "climb"
might be able to get it through a fired EH
Probably.
Isn't it too long?
It's not safe to parse any string of numbers longer than six digits to an SQF number.
Would it be possible to do it through a ugl?
ugl?
Create a special round
Could do something similar for the Ziplines and the UGL.
Underslung Grenade Launcher
However
ah
The best thing to do would be to make a proof of concept first
before jumping straight to extra stuff
scope
if that's the case, i'll just work with it in string form then
Unsure about a climbing animation.
You could possibly treat the rope as a ladder.
not only that, ur climbing up a moving / phisics enabled object
It would look messy but work.
Could somehow lock the helicopter in place
we are talking climbing up an object
Ohhh right
Anyhow, using an invisible ladder there would work, but if the surface was sloped it wouldn't exactly end well.
ive have little play with the ropes, ive only made a slinky that de-synced my server lol
@gleaming rivet ladders + arma ??
u crazy? lol
๐
Have a test run with what Baermitumlaut's done with the fastroping for ace
i have nightmares from A2 ladders still
I don't know enough to possibly even comment about that
ladders + arma = bad things
They're not bugged though, it's a feature ๐
#PopulationControll
Or that, natural selection at it's best
people ask me to go up an ladder, ussual responce is ima jump of this cliff... more chance to survive
Probably should have been seven digits, but I doubt the distinction is relevant here.
I remember going up a ladder in the Alpha, instantly died as I clipped through a rock and my dead body shot off into space ๐
thats was the final of A2 was like
i think i would try to make this a script and not a mod
They work relatively okay in A3
i still dont touch them lol
I haven't fallen off a ladder since... Alpha I think.
ladder phobia
They're safe. Lol
LIES
Those editor placed ones aren't!
ROFL
Eh well, we stacked the Tactical Ladders in ACE 7 high before someone died.
๐
Safe!
ur crazy
I wouldn't dare be on the same map as that
IKR
I'd be climbing up nicely then get slingshotted into the ground
fking lethal
need to make a mod that logs every ladder death and shows a webpage with a number of people who have died on ladders
Millions in a week!
start a project at 3am?
urg....................
At least you have some clue of what you're doing! ๐
I'm using a config template and having trouble, so you'd obviously be much better
hi, yes it is possible
try in an onPlayerKilled.sqf file at the root of your mission directory:
params ["_oldUnit", "_killer", "_respawn", "_respawnDelay"];
sleep 3;
cutText ["", "BLACK OUT", 3];
sleep 3;
enableEndDialog;
Is there a command to read items inside a backpack in the container?
For example, a ground weapon holder(or container) have a backpack, the backpack have some stuff in it, how to get the stuff?
Maybe everyBackpack will do it
i dont think you can get backpack "contents" when its inside a box because the contents are not saved anywhere
I could be wrong but i think the backpack is just name in the box
Returns array of backpacks stored in given crate or vehicle. **Used for accessing backpack content** of a backpack on ground.
I hope it does work ^^'
but thats just if the backpack is on ground?
Read the note at the bottom of the page
a backpack on the ground is in a "weapon holder" that is also an object
like an invisible crate
hmm
@ Lou it might be good to change the "return value: array" to "return value: array of objects"
So, if you wanna get all kinds of items in a box, you need to:
// the item box
_box = cursorObject;
_items = [];
// get all kinds of items in the box
_items pushBack itemCargo _box;
_items pushBack magazineCargo _box;
_items pushBack weaponCargo _box;
_items pushBack weaponsItems _box;
_items pushBack backpackCargo _box;
// get all kinds of items in the containers(uniform, vest, backpack) in the box
{
_container = _x#1;
_items pushBack itemCargo _container;
_items pushBack magazineCargo _container;
_items pushBack weaponCargo _container;
_items pushBack weaponsItems _container;
_items pushBack backpackCargo _container;
} forEach everyContainer _box;
// flatten the array, remove duplicates, remove empty string and number
_items = flatten _items;
_items = _items arrayIntersect _items;
_items = _items select {_x isEqualType "" && {_x != ""}};
_items
yeppp
done
That's a good start!
im "borrowing" a buds life server to test this on lol
why is their stones in this game -.-
of all things
Don't break it ๐
If you ever need a server to test stuff on and you can't get that one. I have one that sits and does nothing for 6 days of the week
thx for the offer, but i have a VPS just sat around
- i like the life file system
poeple gunna hate me for saying that
Had a question about vehicleChat
I'm doing a mission with two helicopter pilots talking to each other. I'm trying to make the subtitles of the second pilot appear as vehicleChat (with the golden name). However, the subs only show for crew members of the second helo, and not for the pilot of the first one. Is it possible to make it so that this message is seen by everyone and not just the crew of the second helo?
I've tried this :
[BIS_helicopter2, "message"] remoteExec ["vehicleChat"];
but it didn't work, and I have a feeling that using remoteExec is not the way to go here
vehicleChat uses the Vehicle channel, which is specific to the vehicle the transmitting unit is currently in. So by doing remoteExec, you're making sure the message is transmitted on every machine (good) but it's still only visible to units who actually have access to that instance of the Vehicle channel.
In other words, you need to use a different channel
Some things about Life servers are good, I'd love a taser for my ops ๐
So radioChannelCreate?
You could create a custom channel and add only units that are in the helos to that channel. Or, you could use sideChat, and either make the messages visible to all units (easy) or use remoteExec to target only the machines whose player is in the helos.
lol
I guess I'll try to figure my way out with custom channels, thanks for your help!
OMG
ROFL
WTF
ARMA PLZ
i did a arma?
ROFL
omg, i cant breath
@swift ferry http://prntscr.com/9t80v3
i somhow moved the building by attaching a rope to it
having some issues, i know of a script that you can throw on (for example) the briefing room screen, and you can make it so you can choose the map location that it will show. any ideas as to what it was?
Strategic Map does that (https://www.youtube.com/watch?v=Ysflm7UYAMc)
Today I will show you how to use the strategic map module in arma 3.
i think the rope is too short so its winching the building
dnt know i could do that
Might be able to join two together
Oh right
Hi, Im looking for a method to do the following:
I want to write a mod/script that allows players to press a keybind to "tilt" their player/camera/weapon whichever forwards or backwards while they are currently deployed on a bipod. This would address the weirdness that sometimes happens when deploying a bipod on badly mapped terrain (Terrain that looks flat, but doesn't have flat colliders) causing them to either look too high, or too low. Or sometimes straight up in the ground.
I looked into SQF and couldn't find a method to achieve this. So I turned to C++ and I can't even get a default environment setup for that, so for now im at a loss.
I wonder if anyone has any ideas, or pointers to get me back on track?
Go with mm to make things interesting!
you cant do that with c++ / extension. what you need is more like https://community.bistudio.com/wiki/Category:Command_Group:_Camera_Control (SQF) commands but idk if what you want to do is doable
Wish I could help
man that was too funny
Just checking with the scripting gurus; On a dedicated server, who is represented by the identifier 'player', if it's used in a remote execute
in dedi server it should be null
Gotcha, cheers!
Depends how you pass it
I've done a work around, don't worry. I was just fixing a bug with my mission in multiplayer, figured that was it but I can't access the documentation at the moment for some reason
Didn't even know you could move buildings like that ๐
same
Oh I was misunderstanding your question. I thought you meant you were passing player as an object to the dedi. Not the opposite way.
Is there any mod that add's building? The only 2 I found is one that needs ace and is pritty shit and one that does not fit my needs (it has a crate of objects you can place in it, im looking for like a gui you can open to build).
Or script aswell.
Wait what? ๐ฎ
Is there a way to force a careless unit to run? According to the biki, _unit forceSpeed (_unit getSpeed "NORMAL"); should work to force a unit to sprint but doesn't in this case.
just wen i think ive worked arma out
Getting a default keybind error
Error Params: type bool, expected Array
Trying to add default keybinds for a mod im working on to CBA_A3. This is the line of code before calling CBA_fnc_addKeybind;
[false, true, false, false, 201] // default: Ctrl + PageUp
Anyone know what im doing wrong here? if you need more of the code as context i can post it
nvm I got it. Correct formatting is [201, [false, true, false]]
I was thinking that until I tried to make my own faction ๐
Oooh! Someone should have secured that better
anything i attach ropes too uproots and i can just drag about
dont matter what it is
not sure if i should bug tracker that
Ace Fortify, which comes with Ace.
Frankly. i dont know of any other building mods. I know a dayz mod with building inside it. I assume most other stuff is private and/or jank.
There is one other exception. I made a modular shoothouse script that. But is restricted to specific preplaced spots.
That's sad. There was a public zeus script called like zeus enhanced or zam? It still exists but its more updated and is missing some stuff. They used to have an amazing building menu you could grant players and it had a gui to select and everything it was great.
I dont know about old old arma 3. But i know public zeus doesnt let create custom menus on other peoples stuff. Only way I know to create a menu in pubzeus is that I can create a cuatom list of actions in the top left scroll menu.
Im sure its out there though. The Zam guys are insane.
Well thats intresting. You used to be able to place the script on a player and they got access to the menu by using i think ctrl+b. It has a black gui with options like sandbangs, bunkers and so on you could select and place + rotate.
I used it all the time in public zeus.
Indeed there scripts are CRAZY good.
As of now, BattlEye will kick you if any your scripts call createDialog. Or anything with the word create for that matter. i think i had to deliberately rename function createTank to spawnTank. Any function name called remotely with the word create in its name or code block results in BE kicking you.
Interesting, is that new or always been like that? If its new then that would explain why they removed the building menu script.
I dont know how new. i did some pubzeus a year ago. Before that... who knows.
Maybe there are some non-battleye enabled servers, nor or previously.
Theoretically, any menu that has some scripted dialog rather than config dialog could be hijacked.
So like, call function that spawns a menu. Change menu by referencing UI vars or UIDs. Boom, custom menu. only limited to whatever ui is created by the menu though.
And Zam already modifies the zeus menu. so we know its possible to some degree at least.
Probably should. Greek buildings apparently don't have foundations
lol
its an old comp me and troalinism worked on if memory serves though it propably wont work depending on pub zeus RE restrictions and i think it was just a version of EZM that someone modified to have it as a module https://steamcommunity.com/sharedfiles/filedetails/?id=2798288886&searchtext=build+menu
though the ui is shit looking back at it should propably redo\
as for EZM it is on zams website
does anyone know how to make this in arma 3 https://www.youtube.com/watch?v=CXd0-9UW5Z4 i normally used a invisible and unsimulated man and attaching it to a vehicle but that doesnt work well with keyframes and it sometimes stutters is there another way to do this
TrackIR / Oculus CV1
GPU: ASUS TUF RTX 3080OC 10GB
CPU: AMD Ryzen 9 5950X (16-Core)
Memory: 32 GB RAM
SSD: 1TB Samsung 980 EVO M.2 NVMe
Current resolution: 2560 x 1440, 120Hz
HOTAS: Virpil Throttle and Warbird Stick
Pedals: Logitech G Pro
Music from Tunetank.com
SHANTI - Extreme (Copyright Free Music)
Download free: https://tunetank.com/t/35fu/...
Use the multitude of camera commands
https://community.bistudio.com/wiki/Category:Command_Group:_Camera_Control
It is around 5am
yup
I'm done for the night, see you next time. Good luck on the script! ๐
I was trying to force explode a grenade I spawned with createVehicle using setDamage 1, but it didnt work, can grenades be forced exploded or do I have to use another explosive type?
Try with triggerAmmo
https://community.bistudio.com/wiki/triggerAmmo
ahhh i totally forgot about this ty
guys
I have a init.sqf where i calll 4 scripts thar are intensive that setup the mission
what do i do
do i do [] call for each
do i use spawn, do i use execvm
What is the issue you are trying to solve?
Just wanted to know whats standard
no issue
my scripts use sleep command
@atomic niche any clue?
execvm is fine if you run the files only once
I only wanna run at start of the mission, singleplayer only
but i wanna be able to save game and load that save
The scripts contain loops that will run all the time
Throughout entire mission
i would think savegame saves your scripts / variables
Theres dynamic stuff to it
if (isServer) then {
private _debug = false; // Set to false for production
if (_debug) then { systemChat "=== INITIALIZING ALL SYSTEMS ==="; };
[_debug] call system;
[_debug] call system2
sleep 1;
[_debug] call system3
sleep 1;
[_debug] call system4:
sleep 1;
if (_debug) then { systemChat "=== ALL SYSTEMS READY ==="; };
};```
How to do this ? @proven charm
.
Yeah
Run scripts
That setup the game
mission, enemies etc
behavior
just on init, and then to keep things unside those files runnin like loops
@proven charm
Put them into cfgFunctions and use postInit
or just use init.sqf, not really sure what's the issue.
No i wanna use init sqf
My question is how do i call them how do i do this
Imagine if u have system1folder/system1.sqf etv
Do you precompile
and then do [] call
just give me an example bro jesus why is it so hard to understand
how do you call functions in an init.sqf what is the standard way of doing it
but there is a differenc ebetween spawn, execvm and call
in terms of threads and all that
performance
persistence
and i dont know what they are
execvm is very similar to spawn because both run in new thread
because alll knowledge is buried inn forums and theyre down and the devs are too incompetent to solve a ddos issue so they took the plug out of the website instead
Then why is rhere execvm and call?
Bexause i know that for example you cant do sleep commmand in certain context
Read the scripting introduction on the wiki.
spawn and execvm run in scheduled mode so they can sleep
The website literally doesnt load for me
I cant open the websites
Why did the devs add 3 ways to call functions
Jesus christ what a community, too lazy to explain even rudimentary things. As if i requested RHS mod to be made from scratch here
@atomic niche
The link doesnt work mate
The forums dont work..i guess we have to pray to Jesus to explain us how ArmA works?
They behave differently.
execVM is used to directly load a plain script file. It's less efficient because the file is compiled every time - and it can't be used to execute "ordinary" code, only separate script files.
spawn is used to create a new Scheduled thread. The Scheduler is an engine system that manages the scripts that are currently running. Each Scheduled thread is limited to a certain amount of execution time per frame, and the Scheduler enforces that limit, as well as handling script suspension.
call is used to execute code "as if it was in-line" in the current context.
Why did the devs add 3 ways to call functions
Because they are 3 different things that have different functions...
Jesus christ what a community, too lazy to explain even rudimentary things
you are demanding an answer to a question you could have googled
The link doesnt work mate
What part "doesn't work" I currently have it open. we would have to look into why it doesn't work
It doesnt work for me
To be fair about the wiki "not working", people (including Dedmen) have been reporting problems with the Cloudflare protection semi-regularly since it was introduced
Thats valid and we're aware. but "what part doesn't work?" > "it doesn't work" doesn't help us troubleshoot it
should also be "fixable" by clicking one of the links on the page without CSS, but I can't suggest that when I don't know what the issue is
how do you know when to use which? is it just async vs sync?
worth a read. While the ACE practices might not be necessary for your use case it gives an overview of the scheduled vs unscheduled and which commands do what.
this one is a good read too: https://sqf.ovh/ite/2018/01/21/ITE-the-scheduler.html
It depends heavily on what you're trying to do.
Unscheduled code is guaranteed to happen in the current frame, so it's good for time-sensitive applications. But, that means the entire frame will wait for it, so suspension is not allowed, and heavy code can cause stuttering.
Scheduled code may be delayed if the frame script budget runs out, but suspension is allowed.
There are also important considerations aside from scheduled/unscheduled state. spawn is a new thread; that new thread will not wait for the current thread. call is as if the called code was in-line here; the parent context will not continue until the called code is completed, and the called code has the same scheduled/unscheduled state as the parent context.
execVM is a little bit obsolete tbh, I would generally prefer to make a function and use call or spawn, as they're more efficient. I'd only use execVM if I'm being exceptionally lazy, or if I need to execute a script file I can't access to turn into a function (e.g. existing script file inside a mod).
are these practices useful for singleplayer?
It depends on what you're building
SP, MP does not matter. It's the thing you're building.
If you're starting with SQF you should be fine doing mostly scheduled code. You can shoot yourself in the foot with unscheduled if you don't know what you're doing.
ouch my foot hert's, he he
@hallow mortar thx you so much for that clear explantion of Call and Spawn, it helped me alot, thx again your the greatest
Hello, I would like to know how to recreate subtitles identical to the SPEARHEAD 1944 DLC. Rectangle with face and background. Is it a new command or just an embedded image?
it's part of the Spearhead campaign framework.
See SPE_MissionUtilityFunctions_fnc_showSubtitle in the functions viewer
Avaialble portraits are listed here: https://community.bistudio.com/wiki/Spearhead_1944_Portraits
thanks ๐
I have this: MY_keyDownEHId = (findDisplay 46) displayAddEventHandler ["KeyDown","hint 'Key pressed'; _this call MY_fnc_keyPress"];
If I enter it in the debug console, it works.
Where should I put it to make it work for all MP players?
Is the line under prowler 3 an image?
I have tried init.sqf, initPlayerServer.sqf, and initPlayerLocal.sqf
Q: How do I declare an SQF a function?
I have a file I want to run repeatedly, but I don't want to have to recompile it every time if this is accurate.
quick dirty way: compileScript, proper way CfgFunctions.
How do I go about that? 
You read those pages on the wiki.
Alright, wait one.
And then you come back only if you don't understand it :P
Got it on the first try! Thank ya. 
Okay... I'm trying to call it, but it's not working. Do I need to throw in an #include "fn_functionName.sqf" in the init.sqf?
you need to declare your "functionName" in cfgFunctions
under a TAG
{
class CD
{
class CDFunctions
{
class vehicleFollow {};
};
};
};```
This? I have this in my description.ext.
almost, Idk if "CDFunctions" would work cause from what I remember is path related
Path is currently \BasicFunctionTest.Altis\Functions\CDFunctions\fn_vehicleFollow.sqf. Game isn't throwing up any errors so I know it's detecting it.
In that, the function name would be CN_fnc_vehicleFollow, default settings would expect it to be at <mission folder>\functions\CDFunctions\fn_vehicleFollow.sqf
To load your function you need to reload the mission just fyi
THAT'S where I went wrong. Let me check.
and check if you can see your function in the function viewer
Yep, that was it. Thanks @tulip ridge !
๐
If you want a different structure, you can specify a file parameter which points to a folder / script
Previously I was calling CD_CDFunctions_vehicleFollow
Yeah CfgFunctions will always name files TAG_fnc_functionName
Last question; if I want to precompile it, how do I get it to point at the sqfc?
Don't need to do anything
Arma should read a *.sqfc file with the same name if it exists iirc
Awesome, TY.
Hokay... new question.
What command would work well to determine if an AI is under fire? I'm doing a follow script, and I want that script to terminate if any of them detect that they are under fire. I tried using damage, but it's unreliable because sometimes they'll stop because the damage threshold wasn't reached.
Do you care if they are already under fire before? If not, then you can check the current behavior of the group. It will turn to combat when under fire.
There's an event handler for it
It's a convoy script, which tells the units to follow the leader. If they're under fire, they're set up to ignore a truck if it or its driver is disabled. I could disable the ability to disembark, but there's the 'halfway' issues, where a unit takes enough damage to stop it, but not enough to trigger the script.
This is what I have right now:
if (damage FOLLOW2VAR >= 0.4 || damage FOLLOWER2VAR >= 0.4 ) then { FOLLOW3VAR = FOLLOW2VAR;};
if (damage FOLLOW3VAR >= 0.4 || damage FOLLOWER3VAR >= 0.4 ) then { FOLLOW4VAR = FOLLOW3VAR;};
if (damage FOLLOW4VAR >= 0.4 || damage FOLLOWER4VAR >= 0.4 ) then { FOLLOW5VAR = FOLLOW4VAR;};
if (damage FOLLOW5VAR >= 0.4 || damage FOLLOWER5VAR >= 0.4 ) then { FOLLOW6VAR = FOLLOW5VAR;};
if (damage FOLLOW6VAR >= 0.4 || damage FOLLOWER6VAR >= 0.4 ) then { FOLLOW7VAR = FOLLOW6VAR;};
if (damage FOLLOW7VAR >= 0.4 || damage FOLLOWER7VAR >= 0.4 ) then { FOLLOW8VAR = FOLLOW7VAR;};
if (damage FOLLOW8VAR >= 0.4 || damage FOLLOWER8VAR >= 0.4 ) then { FOLLOW9VAR = FOLLOW8VAR;};
if (damage FOLLOW9VAR >= 0.4 || damage FOLLOWER9VAR >= 0.4 ) then { FOLLOW10VAR = FOLLOW9VAR;};
if (damage FOLLOW10VAR >= 0.4 || damage FOLLOWER10VAR >= 0.4 ) then { FOLLOW11VAR = FOLLOW10VAR;};
if (damage FOLLOW11VAR >= 0.4 || damage FOLLOWER11VAR >= 0.4 ) then { FOLLOW12VAR = FOLLOW11VAR;};```
If I remember correctly it's only unit's behaviour which gets autoswitched from aware into combat and back again once the firefight is over. While group's behaviour stays aware.
Thanks! Btw I'm finding that moveTo only works if a unit has a waypoint (whether I delete it later or not); I wanted to know if there's a way to skip that step?
Strange. All groups(at least editor placed ones) always have one move waypoint right on leaders position(hidden in UI, you can only see it using commands)
Why do you use moveTo over doMove?
Why to use these commands over waypoints? Maybe you just want to move a group member
if (damage FOLLOW1VAR >= 0.4 ..
Then your list will go over and every FOLLOVAR will be FOLLOW1VAR,
if your check is wrote like you pasted
True, also no need to check same thing twice in one condition
is there a way to get the contents of backpacks/vests/uniforms inside of a container/vehicle?
Noob mistake. I forgot: waituntil {!isnull (finddisplay 46)};
I'm trying to reduce stress on the game engine; it's supposed to update the move location repeatedly, and refreshing waypoints hammers the engine. I personally didn't notice a difference, but if it's multiplayer, that could be VERY different.
I'm currently reworking it atm. This is intended to be a sanity check to see if the vehicle is still operative. On that note, is there a way to shorthand code using the compile command?
For example (this doesn't work atm):
_dmgn = 0.4;
_dmg = "damage _fV > _dmgn";
_dmgd = compile "damage driver _fV > _dmgn";
if ( _dmg || _dmgd ) then { true } else {false};```
Wait, nevermind, I'm a dummy. 
_dmgn = 0.4;
_dmgv = damage _fV;
_dmgd = damage driver _fV;
_dmg = compile "_dmgv > _dmgn || _dmgd > _dmgn";
if (call _dmg) then { true } else {false};``` There we go. ๐
doMove has nothing to do with waypoints. It's like giving your squad member an order to move somewhere
Just tested this and I was wrong. Group behaviour changes to combat and later changes to aware once combat is over.
Strange thing is behaviour and combatBehaviour return different results for units, after group autoswitches into combat. Since combatBehaviour returns aware while behaviour returns combat. combatBehaviour will return combat for units only when changed manually. I guess Arma things

Yep, I'm aware. ๐
Do I have to set each disableAI argument individually or can i use the following to get those needed all in one? (Also am not really sure if one even has to remoteExec the disableAI as it is a local argument but has a global effect).
[_groupleader, ("MOVE","COVER","AUTOTARGET")] remoteExec ["disableAI", 0];
{
[_groupleader, _x] remoteExec ["disableAI", _groupleader];
} forEach ["MOVE","COVER","AUTOTARGET"];
disableAI has local args, and global Effect.
Object - the order will be executed where the given object is local
Create a function which does all three and and execute it where _groupLeader is local
oh that is quite clever Prisoner, did not even consider writing it like that! (am still such a complete NOOB when it comes to scripting)
im looking for a afunction to see if a helicopter can slingload a certain object. ideally both based on classnames.
Anyone familiar which configs are relevant here?
holy cow i had to riase up my view Distance, After learning how to use call and spawn better in my missions, cuz my game was Running so fast, woohoo
Am I right if I say that remoteExec can not execute an arbitrary block of code, like [] remoteExec ["{....}", 2]; ? Thanks
You'd check cargo mass and also config
// cargo
slingLoadCargoMemoryPoints[]
slingLoadCargoMemoryPointsDir[]
// lifter
slingLoadMaxCargoMass
It's not recommended to execute code remotely. Create a function and remote execute that function instead
if you write it as [args, code] remoteExec ["call", 2] then yes, any client can remote execute arbitrary code that way, unless blocked by CfgRemoteExec
Thanks.
"GAME LOADED" maybe?
Hello
(I think my question belongs here, but I might be wrong)
Is it possible to make buildings lamps flicker like you can do with streetlamps ?
(I'm using a modded map that contains modded corridors, and those have lamps)
Is it possible to make them "believe" it's day time so they turn off ?
ofc I don't want it to be really daytime, or at least so my players still use their headlamps
even with 100% cloud coverage it's still pretty bright during daytime
Yes. You'll use nearestTerrainObjects to get the lamps on the map, then you'll iterate through those by setting the damage of them to 0.9 and back to 0 over and over again with some randomness
answered my own question, I put it here if anyone looks :
I placed
_x switchLight "OFF";
} forEach (1 allObjects 0);```
in my init.sqf file
thank you, managed to find a "faster" way to manage it (at least to turn them off, I'll surely do as you said to get them to flicker)
And I'm too busy lol
Maybe we'll get lucky, and there'll be someone out there that is not tremendously lazy or busy simultaneously...
Im having trouble getting a squad to skip to the end of their waypoint chain when they encounter the enemy.
What im doing currently is:```sqf
Lookout_1 setCurrentWaypoint [Lookout_1, 6];
I thought maybe doing setCurrentWaypoint followed by doStop would help but it hasnt.
any AI mods like lambs?
i will have to check one sec
ye, the modpack has lambs RPG,Supression,Danger and Turrets
take those off, then retest. if it works, then its a mod issue
TBH i dont even know what those do
also, make sure that your waypoint index is 0 based
I think thats how its portrayed in game by default
Hello. I want to learn how to check anything for all objects in an array. Is it possible to do? As an example: {_x in vboat == true} forEach allPlayers (I know it doesn't work and the reason of it. I just want to know if checking anything is possible for objects in an array.)
yesss - see findIf
Too fast Lou
Thanks!
No, wait
It only returns a number of the first object which satisfies the condition *(e.g. *allUnits findIf {_x in vboat} returns 0 while 0, 1, 2 satisfy the condition)
Wait, I need to try to use the "Example 2"
I think this is what I was looking for.
waitUntil{ { _x in vboat } count allUnits == 4}
waitUntil{ _theUnits findIf { !(_x in vboat) } == -1 }; // better perfs
Is _theUnits already built into SQF?
no, it's an array of units to check
allUnits is checkingโฆ well, all units, so that's a bit much?
Okay. So it's allUnits
what do you want to check: that 4 people are in the boat? check crew _myBoat perhaps, that's even better
I am just testing it. There's no more units except 3 bots and 1 player squad.
Thank you.
count crew vboat > 3
What if I want to check the exact squad? Can I use waitUntil{ _thePlayerSquad findIf { !(_x in vboat) } == -1 };? Does squad variable name return an array of objects?
units _group
Thanks.
so you can use
units group player
or some xx variable name to get xx group
So thesquad variable and units group player1 both work the same?
Arma says they don't, okay. The squad name is a Group and not an Array
units thesquad
units group player means "get the units that are in the group that the player is in". It's the same as units someGroupVarName if that variable points at the same group.
(units group player could also be shortened to units player - if a unit is provided, the command assumes you mean that unit's group)
I've already figured it out, thank you for acknowledging me about units.
Regarding execVM and player, on BIKI (https://community.bistudio.com/wiki/switchMove), i found the following example:
[player, "AmovPsitMstpSlowWrflDnon"] remoteExec ["switchMove"];
with the caption "Sit player immediately and globally".
Let's say I run it on my machine. Does it
a) Cause everyone on the server to see my character sit down, or
b) Cause everyone on the server to sit down?
That is to say, does "player", when remoteexec'd, still refer to the player character on the machine who executed the command, or refer to the player character on the machine to which the command is sent?
a
you are sending the player object, player will not be evaluated on each machine
This first one is correct, the 2nd one isnt
Last one shouldn't have the variable name in quotes
Difference is that private keyword makes the variable not available to other scripts, you can run into issues when not making variables private
What do you mean?
https://foxhound.international/arma-3-sqf-private-variables.html#:~:text=When a CODE object begins to runโbecause you,the break commandsโthe engine automatically destroys the scope this is the only resource I found.
An exhaustive discussion on the rules regarding private variables and scopes in ARMA 3 SQF scripts.
It's a local variable that exists for the runtime of the script
Doesn't have anything to do with objects
Underscore makes a variable local, private keyword is an extra layer for local variables
You migt wanna start here https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
and furthermore https://community.bistudio.com/wiki/Category:Scripting_Topics
https://community.bistudio.com/wiki/Variables#Scopes This is what I was looking for
A local variable is only visible in the Script, Function or Control Structure in which it was defined.
No, local to the script
Because that's what you usually want
Because you should always use it unless you explicitly want other scripts to be able to access and modify variables
Which you don't want 99% of the time
You can run into some nasty stuff that is hard to debug if you don't
_var is local to the script
var is local to the client e.g. available in all scripts
private _var makes the variable local to the current scope (it will not be available in the parent scope)
A good way to learn these things is to test them. You got an idea, just write the code
The word "local" is used in two different ways when you're talking about SQF.
local vs global variables, local vs global objects/execution.
This is nasty btw. I never had an issue with variable scope until I made a mod that had to transfer storages between backpacks and a object (deployable duffels). And I kept running into a weird out of index error.
I had a recursive function, so the variable that stored the sub inventories would overwrite the parent function's variable.
Very simple question on my end. How do I make a script for a hold action that adds an item to the inventory of the player who completes the hold action in a MP mission
Hold Action will be local. If you add it to the object init in the mission, everyone will still see it. for adding items, https://community.bistudio.com/wiki/Category:Command_Group:_Unit_Inventory
More meant how to make sure the person who actually does the action gets the item. Is just using "player" enough for that?
Oh... yeah.
actions execute code locally. Use player and make sure to use a global command for adding an item.
its currnetly just
player addItem "insert item here";
that work, when I put the specific item there
Thatll work. Double check that addItem is a global command or has a global alternative
I tried like you said, but to no avail (I know for a fact lamps go off when building is destroyed, I tested it using the "edit terrain" module in Eden for one corridor)
I think it's because my script is wrong, but I don't see the issue
{
while { true } do
{
_flicker setDamage 0.9;
sleep (random 2);
_flicker setDamage 0;
sleep (random 2);
};
};```
ofc, I call my sqf file in my init with` execVM "flicker.sqf";` (file is named "flicker")
do you see it ?
yes, your scope around the while
you create a piece of code that is never called, basically
I see ... so this way then ?
if (isDedicated) exitWith {};
{
while { true } do
{
_flicker setDamage 0.9;
sleep (random 2);
_flicker setDamage 0;
sleep (random 2);
};
};```
youโฆ did not remove that scope
private _flicker = nearestTerrainObjects [[769, 2585, 0], [], 150, false];
if (isDedicated) exitWith {};
while { true } do
{
_flicker setDamage 0.9;
sleep (random 2);
_flicker setDamage 0;
sleep (random 2);
};
oh okay I get it now, thanks (I may have to change the "if" thing but otherwise I get it)
Also nearestTerrainObjects gives back an array
you would need to select an element, otherwise it will not work
private _flicker = (nearestTerrainObjects [[769, 2585, 0], [], 150, false]) select 0;
I thought it would apply to the entire array without having to select an element, my bad
forEach ๐
Can someone help me write a script to get all the items in an ace arsenal box?
I wanna black list all the uniforms and I can't seem to find an easier way of doing it
Some of the modded stuff gets added to CfgWeapons with all the weapons buy I only need the Uniforms
This is what I did
private _items = "true" configClasses (configFile >> "CfgWeapons");
private _filtered = _items select {getNumber (_x >> "isItem") == 1};
private _names = _filtered apply {configName _x};
copyToClipboard (_names joinString ", ");
hint format ["%1 general items copied to clipboard.", count _names];
But this returns all the items but I only need the Uniforms
Just check _x >> ItemInfo >> type
Uniforms are 801
private _allUniforms = "getNumber (_x >> 'ItemInfo' >> 'type') == 801" configClasses (configFile >> "CfgWeapons") apply { configName _x };
Then you can just feed it into https://ace3.acemod.org/wiki/framework/arsenal-framework.html#22-removing-virtual-items
a "while" loop doesn't break "_x" ?
Nvm, I fixed the "undefined variable" error
how would you define what units to set a Post Processing Effect can I have it directly in a for each loop or would I need to make it its own function and call it in there?
you make a local function and register it to CfgFunctions. This function contains all the local post processing effects.
then from the server, you remoteExec that function to the clients that own that unit:
[] remoteExec ["myFunction", units east]
for instance
add in a JIP tag as well if you want
Is there a command to automatically copy the pylon loadout of one vehicle to another?
My use case:
I start players inside of a hangar off-map spawn area that they can only leave by teleport. Inside that hangar is a fighter jet. On that fighter jet is a hold command that teleports the pilot and deletes this jet, and the pilot goes into an identical jet that is unsimulated and in the air with its engine on at load time. When the pilot uses a hold command to START MISSION the jet becomes simulated and flies normally.
What I want to do is maybe make the prop jet able to have its loadout changed, and when the pilot gets teleported, that pylon loadout gets copied to the unsimulated aircraft.
๐
So something like
someOtherJet setPylonLoadout _myJetLoadout;```
or better yet
something like someOtherJet setPylonLoadout (getAllPylonsInfo this;);
with this being the object I am executing the command on, the jet I am editing, while someOtherJet is the jet I am copying the loadout to.
you need to do some array manipulation. these commands aren't directly compatible
I guess I would not know where to start in that regard.
if (!isServer) exitWith {};
private _data = getAllPylonsInfo myBasePlane;
{
_x params ["_index", "_name", "_turret", "_magazineClass", "_magazineAmmoCount"];
// setPylonLoadout is local executed, need it to be global
[myClonePlane, [_index, _magazineClass, false, _turret]] remoteExec ["setPylonLoadout"];
} forEach _data;
an example
Keep in mind that when directy restarting (not resuming) a game (e.g. ESC -> Restart or #restart on servers), the main display 46 will carry over from the old mission and the init.sqf (or any other mission script) will be executed again, adding an additional keyDown event.
oh that is perfect
That works exactly as desired.
The only anomaly is Firewill planes don't like when I spawn them without pylons; the pylons get removed completely, so I got weapons floating mid-air.
Easy fix. If I'm copying the loadout anyway, just have the other plane start with pylons so even if they get overwritten with nothing they'll just be an empty pylon and not clean.
I don't know Firewill documentation to fix this but it works perfectly for vanilla.
(CBA fixes this by accident currently, so if anyone wants to confirm - do it without any mods)
I spent a few hours yesterday trying to understand why it won't work and testing multiple possibilities (changing the scope of "forEach", trying "_x" and the variable name, etc)
I'm starting to think it won't work anyway 
Can someone explain to me why this doesn't work please ? (if it's because I miss a ";", I might throw my computer through my window)
{
if ( time > 0 ) then
{
while { true } do
{
_x setDamage [1, false];
sleep (random 2);
_x setDamage [0, false];
sleep (random 2);
};
};
} forEach _flicker;```
(for context, it's an .sqf file I call using execVM in my init file, and I don't get an error message)
you are checking "if time > 0"
if it is 0, it will skip it entirely
try waitUntil?
I'm not sure that setDamage 0 after a previous complete destruction (setDamage 1) actually works
now I'm locked into a loop of error messages and I can't spawn anymore x)
I must have f***** up something, probably a scope
yeah I thought of that, I tried with 0.9 to no avail as well
it's not explicitly said on the wiki, but general consensus about it says that
So the way your code is structured, this will start a while loop on the first object in the _flicker array, and then.....continue doing that while loop and never get to the next object
even with forEach ? f*** me
forEach operates sequentially. It does the thing with the first item, then it does the thing with the second item, then...
If the first iteration contains an infinite loop, it will...wait for that loop to complete before moving on to the next iteration.
got it, makes sense, I have to tell it to apply to every single object in the array
Are you wanting all the objects to flicker at the same time, or at different intervals for every object?
different interval for each
I'm starting to think I would have already finished if I set the script individually for each object using the "edit terrain" module in Eden x)
Here are a couple of possible options for you. I'm just talking about overall structure here; I'm still not sure that setDamage is actually capable of bringing back fully destroyed objects.
private _flicker = nearestTerrainObjects [[769, 2585, 0], [], 150, false];
waitUntil {time > 0};
{
_x spawn {
while { true } do {
_this setDamage [1, false];
sleep (random 2);
_this setDamage [0, false];
sleep (random 2);
};
};
} forEach _flicker;
// =========
while {true} do {
private _obj = selectRandom _flicker;
if (damage _obj > 0.9) then {
_obj setDamage 0;
} else {
_obj setDamage 1;
};
sleep (random 2);
};```
seems to be working, thank you (try the first option)
fyi, setDamage does work when object is fully destroyed
I remember that you could spawn in with a black exile uniform when I hosted a server 8 years ago and can't find any information on how to implement it on my server I have just hired as I don't have my scripts
A question for the exile discord. I think the classname was "Exile_Uniform_ExileCustoms"
But you can just add it to ExileServer_object_player_network_createPlayerRequest (inside the exile_server.pbo unpack/edit/repack)
line 31
_bambiPlayer forceAddUniform "Exile_Uniform_ExileCustoms";
That should be enough
So the exile_server pbo not the altis.pbo ok thanks
You can also make a override in your mission for the same function.
Exile.Altis\config.cpp
class CfgExileCustomCode
Would someone mind helping me rq with the findif syntax?
Trying to check that the variable in my foreach loop matches the variable in my _validTypes array
forEach vehicles is the loop.
And the code thats checking is if (_validTypes findif {_x isKindOf _x}
It seems to be running code no matter what type of vehicle it finds so im questioning _x isKindOf _x
To compare classname use typeOf not isKindof
Not comparing classnames am I? My _validTypes array contains "private _validTypes = ["Plane", "Helicopter"];"
then nvm my post
Oki haha. But ye, do you know anything about the _x variable and if Im utilizing it correctly?
So I could do this instead. I'm a bit sketchy ATM as I just recently got back into A3 exile and I'm 69 years old so trying hard to remember how to do things but thanks
It involves the same steps, even one more.
Mission needs to be unpacked with a pbo manager, same as the exile_server.pbo
For the override in the mission you need to also get server function and add the CfgExileCustomCode
So i would just unpack exile_server.pbo and edit the function and repack it.
Ok that sounds the easiest option then, thanks again
Hello! Anyone know the remoteExec for these two lines?
[_video,[16,9]] call BIS_fnc_playVideo;
I have two instances of this code, one launching from a Hold Action and the other from the Event 'Killed' of a civilian. The second does not work on a dedicated server. If anybody has any guesses as to why, I would be eternally grateful!
setObjectTextureGlobal
Did not know that existed! I figured out how to put it in a remoteExec, but I'll test that afterwards!
What I ended up with
[Screen , [0, _video]] remoteExec ["setObjectTexture"];
[_video,[16,9]] remoteExec ["BIS_fnc_playVideo"];
You mean like this? @cosmic lichen
Screen setObjectTextureGlobal [0, _video];
[_video,[16,9]] remoteExec ["BIS_fnc_playVideo"];
Yes
A little present from our AI progs... ;)
https://forums.bistudio.com/topic/140837-development-branch-changelog/page-35#entry2968977
Page 35 of 35 - Development Branch Changelog - posted in ARMA 3 - DEVELOPMENT BRANCH: 14-12-2015
EXE rev. 133719 (game)
EXE rev. 133719 (launcher)
Size: ~46 MB (and ~63 MB hotfix)
ย
DATA
Added: BIS_fnc_getName now has new parameter to clamp the name size if needed
Fixed: In MP Bootcamp, JIP players could not take magazines from the weapon holder at the weapons firing range
Fixed: Cropped difficulty indicator in certain languages in the Scenarios and Campaigns displays
Tweaked: Some of...
Anyone here have an idea on how you achieve the filter used on voice lines over radio, BI style? Like instead of sounding like someone whos speaking into their microphone, it actually sounds like someone is talking on the radio, kind of like a speaking into a can sort of sound effect.
https://www.youtube.com/watch?v=fY_0QBEAFmg Using this an an example, you can hear the regular voice in the beginning, if you skip to 1:20 you can the radio effects.
A compilation of all the voice lines from Lieutenant James from the Arma 3 East Wind Campaign.
@tardy osprey I am not 100% sure but I think this is done via https://community.bohemia.net/wiki/Category:Command_Group:_Conversations (See the functions too)
If the above is not an option, you could also just edit the voice lines in a suitable program like Audacity
I see, I already have audacity. The problem is the file obviously comes out in a native recording without effects, so if you put it into arma it would just sound like my sitting in my room talking, instead of a radio communication. I would not know how to edit the audacity recording
You need to cut both low frequencies and high frequencies off via equalizer/EQ. Play with the EQ curve and preview after every edit. Make large changes at first so you get a grasp how cutting different frequencies off sounds, then you can start fine tuning
Additionally, you can add small static noise (there should be generator for it in Audacity) on the background for the duration of the "transmission"
There are tutorials and stuff for adding radio/phone filters on the internet, it's not a super secret science. You can learn to do it pretty easily.
Also, you can try what R3vo said above first.
Arsenal integration in eden... Does that mean i can equip placed units directly in eden?
I'll take a look, thanks.
Hi, I could use some help. I'm trying to enable the debug console but for some reason it's not picking up. I've enabled it through the Server.cfg:
// Debug Console Access
enableDebugConsole[] = {"SteamID"};
I've also whitelisted myself as the developer in the whitelist.sqf. I'm also brand new to this, any assistance would be greatly apprecaited. Thanks.
enableDebugConsole belongs into your description.ext for your mission.
Order of Precedence
Mission param is checked. If it is not defined then...
description.ext param enableDebugConsole is checked. If is not defined then...
Eden attribute option is checked. If not defined then...
Global/mod param enableDebugConsole is checked.
Thank you!
Quick question, I've seen a few options for perFrame event handlers and I was wondering which one I should use?
Stacked? Mission? CBA perFrame?
If you're just running code every frame, it's not going to make much of a difference
I'd say CBA is the most commonly used one, and you can also specify an interval if you only need to run every X seconds instead of each frame.
Ah ok, thanks
And I've seen this done but I'm not sure it's good practice - while loops instead of perFrame eventhandlers?
Situation dependent, but the while {true} do { ... }; loops that people use can be replaced by a PFH yes
Hm ok, thanks man
while loops aren't guaranteed to run every frame.
that may or may not be a good thing.
@torpid dagger Thats it. When you right click on a unit or multiple units you can select or create a loadout in the arsenal. This will be used for the unit(s) if you exit the arsenal!
from what I understand, you have to use two nested forEach loops. Like example 8 at https://community.bistudio.com/wiki/forEach
If you only have two valid types then using findIf is overcomplex anyway.
but yeah, if you need to refer to the value of _x from a parent loop then copy it into another variable first.
Hello. I wanna ask if it's possible to make a trigger that checks something only once 2 seconds after a scenario started and stops checking if the condition wasn't satisfied.
Does "Interval (default: 0.5)" starts checking right after the server started or after the amount of time mentioned in that "Interval" passed from the start?
Do you really need a trigger for this? This could be done simpler on the script side of things.
// Condition
if (time > 2 && !(triggerActivated thisTrigger)) exitWith { deleteVehicle thisTrigger; false; };
this
// Activation
systemChat "Dad I Frew Up";
XD
Thank you. I'll try to make something inside init.sqf instead of using triggers. I think I know how. It's strange that I didn't figure it out by myself.
even for multiple units? that's awesome ๐
Can someone help me? This shit which destroyed my last nerve in my totally empty nerve system thing appears 24/7.
Explanaton: I have 4 civs (civ5, civ6, civ7, civ8) which appear with a 50% probability. Variable possibletrigger == 1 if civdocs (the document to interact with) spawns on scenario startup (80% probability of spawning). I don't know what I'm doing wrong, this error appears 60 times per milisecond (with other errors of the same kind, the only thing which changes is a number in civ_X).
possibletrigger is undefined I presume
It is defined inside init.sqf and defines from 21 to 1 or 0 (depends on civdocs existence)
trying to warp my brain around "locality" in connection with player hosted MP games and if I should use
if !(local unit) exitWith {};
// ACTIONS TO DO
or either
if (isServer) then { //run on dedicated server or player host };
if (hasInterface) then { //run on all player clients incl. player host };
in my addaction called commands for things like for example force a unit to fire its weapon. I have also been trying to remoteexec those commands that are LA/GE, so there would not be any issues in player hosted MP (as this is what our little group uses).
Been testing with the following commands:
[_groupleader, "M16"] call BIS_fnc_fire; // works as it is GA/GE and so does not have to be remoteexec'd
[_groupleader, "M16"] remoteExec ["fire", 0, true]; // weird as it fires twice in close succession on the hosted end
_groupleader forceWeaponFire ["M16", "Single"]; // this works but it not remoteexec'd
[_groupleader, "M16"] remoteExec ["forceWeaponFire", "Single"]; // does not work ?
So what is the most sensible/effective thing to use in case of player hosted MP games? When to use "local" or "hasInterface" or the remoteexec "target -> 0/2/-2) and JIP "true" setting?
100% sure? What it does return if you put possibletrigger in Watch field?
What is "Watch field"?
Found out
It returns 1
I checked with Zeus - civdocs actually exists
You sure all variables that is used in your trigger exist?
If we consider that civ5, civ6, civ7 and civ8 appear randomly (with 50% chance) - then yesn't. They exist when they want to.
What if you make a trigger without civ5 to 8?
Then after picking up (destroying) civdocs marker will appear on the map no matter if the civillian exists.
I am asking if it returns the error, not how it should behave/what it should do
It still throws an error.
I slightly bet you're just deleting these object, I meant to remove these civ5 to civ8 mentions in the code
I did it, it just throws the same errors without mentioning civs
That means either !alive civdocs or possibletrigger == 1 is causing it
Turns out it throws an error if civdocs doesn't spawn
That means errors appear only if any mentioned object doesn't spawn.
Any ways to avoid it?
Make the civdocs variable no matter it is spawned or not
I don't know when it does spawn
Easiest way is civdocs = objNull;
W-what? How does making it equal to non-existent help? I am just tweaking % of probability of presence. I can make it spawn 100% but still need to check if civilians exist.
your last remoteExec is wrong
objNull is valid value of type OBJECT
It does. So the variable stores nonexistent object. That means alive can take its place with it. If the variable is not an object, alive cannot be used
in this case maybe it's not what they want tho
because alive civdocs will return false when it doesn't exist
This time civdocs doesn't exist and it doesn't throw any error, possibletrigger == 0 as intended
No
NO
It does exist!
It returns 0 while it's alive!
Basically using null in such getter work. This is useful in such case
yeah I figured there must have been something wrong there - but also tried it with
[_groupleader, "M16"] remoteExec ["forceWeaponFire", "Single", 0];
and that did not work either
Any insight when best to use utilize "local"/"hasInterface" or the remoteexec "target -> 0/2/-2) and JIP "true" setting? Should those always be added?
You dont need to RE forceWeaponFire its allready GE
Oh, thought anything that has LA/GE needs to be remoteexec'd? Because I also tested with some animation and playmovenow and this also is listed as LA/GE on the wiki but does not work in MP if not remoteexec'd?
For MP should not everything be run on the server and it will distribute to the clients?
Here is simple example of your script.
private _cW = currentWeapon player;
private _fMs = getArray (configFile >> "CfgWeapons" >> _cW >> "modes");
private _fM = selectRandom _fMs;
player forceWeaponFire [_cW,_fM];
For MP should not everything be run on the server and it will distribute to the clients?
No. You want to run most of the scripts on clients so there is no network traffic between clients and server that is not nessery.
You only want to run scripts on server that everybody needs to see.
about LA, you only need to run the command where the unit is local, generally, if you're doing things right since the beginning, you shouldn't worry about it
Hello, is it possible to overwrite/deactivate a pbo that is in another mod with my own mod so that the original author does not have to interfere with the mod himself?
again that's not how it's written. look at the pinned messages.
unless you plan to fire only once or twice, you should just make sure the entire call is made on the local machine instead of remoteExecing
depends what it contains
generally speaking yes. you can just patch it and disable what you don't want
I have a mod in the package that combines several things into one, but the original author also included a pbp for a texture for one plane. I'm trying to deactivate this single PBO so that when loading the arma, the error that the PBO requires that plane doesn't appear.
I think you can patch the CfgPatches of that mod. but I've never tried it so there's no guarantee
anyway, just replace its requiredAddons with one without that PBO
this is related to #arma3_config tho. not here
It is, Eden is the best thing that happened to Arma xD
@sweet raft i remember putting Arsenal intergration on the Eden suggestions (more people did that aswell i assume), Nice to see it intergrated now, cant wait for the official release of EDEN
Note that if you want to execute code only where a unit is local, you do it like this:
[_groupleader, ["M16", "Single"]] remoteExec ["forceWeaponFire", _groupLeader];
But as Leopard said, usually you should be running this sort of code from functions local to that unit in the first place.
Hey,
FiredNear event doesn't work on vehicles ?
It doesn't get trigerred for people inside vehicles so i tried to apply to a vehicle but still not working, do you have any solution to make it works ?
The workaround i can think of is using the fired event and get every vehicles around the player to trigger manually a simmilar event
what are you trying to achieve?
Forcing player to be in 1st person when someone shoot near them
FiredNear works perfectly with people that are not in vehiles, i just want to achieve this for people inside vehicles as well
hey anyone got/know/can help with a KAT med script for spawning injured uncon AI for practicing
Is there any way to set a player's aiming direction? Preferably like how weapon sway does it, AKA just moving the weapon and arms itself, but a way that moves the camera itself too would also be acceptable. I wanna see if I can make something like Arma 2's low stamina aim thing (with the reticle moving randomly within a radius on the screen)
No actually
Sad, thanks
OMG thanks You: To All The Awsome Guys in this Chn: (To many to Name), For helping me with all my stuff, Everything is working so GOOD, Im having so much FUN, i freeking love it, i Love You Guys, thx again
You can use https://community.bistudio.com/wiki/setCustomAimCoef to affect the intensity of weapon sway. Stamina does also still affect weapon sway directly, so if you want to immediately induce sway, you could use setStamina / setStaminaScheme, or use setUnitTrait with "loadCoef"` to make it easier to run out of stamina
this
Hello ๐
Is using remoteExec from server to clients a lot of times a bad habits ?
I want to modify a marker pos for ~20 clients only while it still hidden for all others clients, set pos is given by the server every second, I don't think it's going to be in a good shape or is it a common way to do that thing ?
Meaning that the remoteexec will tell the client to do a setmarkerposlocal
What kind of BAD Audio is comaptible with arma 3? Normally the audio files should be 32 Bit and 44,1KHz, But for radio music, I want to downgrade the whole audios into smaller bitrate and smaller Frequency. How low does arma support audio oggs?
is it possible to use 16KHz or 11,025KHz?
A position broadcast once a second isn't super bad. The game does much more than that every single frame.
However, if you want to be more efficient, you could consider handling the marker entirely locally on each client. Make a function that runs a position-updating thread and remoteExec that to the clients once.
* or find some other local event that can start the thread
Thanks
Meaning that if my position is random i have to calculate everything before sending it to the client, looks a good idea
got something puzzling (am sure I have a mistake somewhere)
The following works - placed in the INIT field of the group leader unit), using named units (i.e. Man1, Man2,...) in the group.
{ _x playMoveNow _anim } forEach [Man1,Man2,Man3];
But I am trying to make it into a more general script that works without having to name units but neither of the following seems to work as the one above (either throwing an error "is array and not object" or there is no error but nothing happens:
{ _x playMoveNow _anim } forEach units group this;
{ _x playMoveNow _anim } forEach units (group _this);
{ _x playMoveNow _anim } forEach (units (group this) - [leader (group this)]);
As said am trying to make things more copy/past-able without the need to always name units in Eden as it can be tedious. So a more general script that can work "copy/paste style" would be better.
How do you run the code? In where?
units this or units group this should be correct if you're definitely working in the init field of the group leader.
BUT init fields are not always a good place for this; they run on every machine separately (including JIPs), which can lead to conflicts, and sometimes they run before the unit/mission is initialised enough for some commands to take effect.
If you really want to get into reusable code, look at making functions (https://community.bistudio.com/wiki/Arma_3:_Functions_Library), which allow you to define the code once, and then invoke it multiple times without copying the entire code.
(Same warning about init fields still applies to functions)
Low works. You could also just try.
Also think about Bitrate not just sample rate.
Also we have a whole #arma3_audio
Hi ! I come to you to ask a question regarding the inventory. I want to limit the amount of item a player can carry. Either if they take it from an arsenal or take it from another inventory.
Is there an event Handler that can detect when a specific object is picked up or when it is added to the inventory ? I know I can detect when the inventory is opened or closed but that depends on the player opening or closing it.
I know I can use loops it thing like that but honestly I have bad feeling about making loops or script that continuously run (because Iโm bad at code so the performance will be bad)
Use a "loadout" player EH from CBA
https://cbateam.github.io/CBA_A3/docs/files/events/fnc_addPlayerEventHandler-sqf.html
Passed params are [_unit, _loadout, _oldLoadout]
I looked at CBA documentation I was going to usea CBA_get_loadout and WaitUntilAndExecute.
But this is so much simpler thank you very much dart ^^
please help me figure out how to correctly wait for my function to complete before executing further code.
Is there a good reason that you're not just calling the function?
first, I call a function that adds a large number of weapons to the virtual arsenal, and then I call another function that removes something unnecessary.
and apparently, the second function works faster than the first one finishes working
, as a result, the unnecessary weapon is not removed.
if i put sleep between them, then everything works correctly, but I don't like this approach.
Is there a way how to share a variable assigned to an object and make it available only on the machine where the object is local (and may become local in the future), without making it public? Thanks
Fun fact, the CBA loadout player EH alone makes Arma about 0.1% slower :P
But it does the work anyway so there's no additional cost for using it.
You're calling a function that does a spawn internally?
Is that function your code or someone else's?
How would you know where it might become local in the future?
I'm just call my own function, which has calls to BIS functions.
And it's the BIS functions that are spawning internally?
If you don't know then just say what the function is.
Is there a way to use setObjectTexture on the windows of a car?
These are all the functions of adding items to the arsenal, such as:
BIS_fnc_addVirtualWeaponCargo
BIS_fnc_addVirtualMagazineCargo
BIS_fnc_addVirtualBackpackCargo
BIS_fnc_addVirtualItemCargo
It's actually weird, I went to smoke a cigarette and when I came back everything started working correctly. Do you have any idea if I use a "call", the game is always waiting for it to end, or sometimes it can go on?
call executes the specified code and returns.
There's no spawn anywhere in those virtual cargo functions so if you call them then the state should be correct afterwards.
Im having an issue where moving a group, which is spawned by a Spawn AI module, via setpos deletes the groupโs waypoint. Is this a common issue?
that is, only "spawn" is executed asynchronously?
Correct (and execVM).
It seems to cancel the Sector Tactics logic
ะพะบ, only "spawn" and "execvm", right?))
now another problem, it does not add magazines to the arsenal via "BIS_fnc_addVirtualMagazineCargo", and calls all the functions of adding items (weapons, magazines, backpacks, items) They're standing next to each other. But if I add manually via the console, then everything is OK.
ok my bad this does work, just that the event is only handled on the client that declared it cause that's where i define my event
Got another question in regards to "addaction" -> currently the addaction only shows when one "aims" at the unit/object that the addaction is attached to, but is it somehow possible to make the addaction show up when the players are within a certain distance of the unit/object without them having to aim/target that object? (So a bit like it is with a trigger -> when the player enters the trigger the action shows up.)
yes. add the addAction to yourself (player) and tweak its condition to show only when you're close to the object
Oh hell did not even think about that! Thanks!!!
Add an action when a player enters a trigger, and remove it when the player leaves the trigger.
Is there a function in SQF equivalent to md5() or any other hashing function?
I am having an issue where the AI keep getting their first waypoint to [0,0,0], is there a way to have a script just select and delete all waypoints in a specific area? or do it through a trigger?
no
Why would that be at position [0,0,0]?
what the hek you need something like that for @ruby spoke ?
It's normal thing for group to have one waypoint created automatically, but right on leaders position
I'm using Vcom and for some reason it always makes the AI have their first waypoint to [0,0,0] position, other than that, vcom works wonderfully, I already checked my own patrol script and there are no issues with it, so I'm just trying to figure out a remedy for the symptom
getMarkerPos returns position [0,0,0] when no marker is found
So you spawn AI using script anywhere on the map and somehow they get first waypoint at [0,0,0]?
I'm making a police database system, and I want to have a unique ID for every entry. If I do only random(xxx) then there will still be a possibility for multiple entries to have the same unique ID.
while running VCOM yes, it does happen, without it, their waypoints work as intended
so the issue is within VCOM, I rather just have a trigger or something scanning that grid every few ticks and delete any waypoint parkers on that area
another way would be to go through every single group and check every single waypoint and if the position is [0,0,0], then it deletes it, but its resource intensive and will just kill all performance
then why using SQF at all for stuff like that?
you already have to use a dll anyway
so use a dll for that too
100% faster than any SQF scripted function ever can be here
A script to do that should not have a major performance impact unless it's running constantly, which it does not need to
it wouldn't be the most lightweight script in the world but it's not doing that much, and for one run every...30 seconds, say? it'd be fine
Alternatively, you could use a groupCreated mission event handler, wait a couple of seconds after it's created and then check if its first waypoint is at [0,0,0]
Okay then, I guess I'll just use the dll on KK's blog. Thanks anyway!
Are local (client's) missionNamespace variables saved when the host saves the game in MP?
Police database system ?? Life RPG Server ? MySQL Backend?
Just use a database unique key then
you mean an autoincrementing index @tough abyss ?
Yeah, assuming its getting saved to the backend
You can have unique keys & have it auto increment ๐ you know what i meant
https://community.bistudio.com/wiki/Namespace
no, missionNamespace is never saved, it's only "active" during mission runtime.
I'll try this option
How exactly do I make my game know the difference between fall damage and glitched-in-wall damage. And apply fall damage but not glitched-in-wall one?
Maybe it is because when you glitch into a wall the game believes you are falling (but you are floating) and kinda builds a momentum up to the moment when it drops and kills you?
The following works nicely, selecting the first 8 units from the "_CurrentGroup" group array:
} forEach (units _CurrentGroup select [0,9]);
...but for the life of me I can not figure out how to get odd specific units out of the group, like for example the 3rd, the 5th and the 9th of that group array - should that not be possible with select and the index number?
} forEach (units _CurrentGroup [_this select 2, _this select 4, _this select 8]);
Tried it with the above and some iterations of it, but there has to be some mistake I am making, as it is just not working.
Well that second one doesn't make sense, but you can just check the index in the forEach itself
{
// Starts at 0, so even index is odd unit number, while odd index is even
if (_forEachIndex % 2 != 0) then { continue };
// ...
} forEach (units _currentGroup);
-# (Side note that it may be faster to filter units _currentGroup with selcet before the forEach)
my bad I think I have badly explained what I am trying to do (should get some sleep), I have a group of about 18 soldiers, and I am trying to use the forEach in combination with "select" to pick out specific guys, like the guys at position 4 and position 17 in that group array to do something
are they always going to be in those positions or will you need some other identifier than just array position?
Oh if you have known indexes you can just grab those specifically
private _currentUnits = units _currentGroup;
private ["_unit"]; // only creates the _unit variable once for the whole loop
{
_unit = _currentUnits select _x;
} forEach [3, 16]; // or whatever you'd like
I'm not sure if unit order is consistent between loads though, not something I ever messed with
they will always be in that position so to speak, that is why I thought that array and select index should work, but I always get an error if I try to do forEach select 5, select 8, select 13 to get the desired guys
Well the syntax is just wrong, the way you'd do that would be like:
private _units = units _currentGroup;
{
} forEach [
_units select 5,
_units select 8,
_units select 13
];
But it's longer
Oh boy so I was really wrong there (thought it would be something like the array select "from to" thing that I mentioned and that indeed works, The code for the specific units to do something goes between the {...} I assume. Really looks different from what I expected (thanks for showing both versions, the longer one helps to understand things easier).
Much appreciated mate! And thanks to both of you for your help.
units _CurrentGroup call {[_this select 2, _this select 4, _this select 8]};
```will work and return array with these units, but its kinda ugly
Dart's version is much better since its all inline
oh that is interesting too as this is more like I thought it would look/work - but would never have figured out to utilize "call"!
feel like an microbe among giants ;)
Figured out how to script trigger new 82mm illumination flares
deleteVehicle f;
f = createVehicle ["Flare_82mm_AMOS_White_Illumination", player modelToWorld [0,300,300], [], 0, ""];
triggerAmmo f;
f spawn {
_this setVelocity [0,0,-3]; // Can't set velocity on same frame
}
not sure where this initial 1 second of sleep comes from, couldn't find it in config
If you select text in this code block and move mouse away, does it also deselects it for you?
Arming distance maybe.
It has no velocity and float in the air though
Nevermind this delay is not needed, I guess I messed something up with my velocity tests originally
Simplified the script
do dedi servers have a profile name space as well as the server namespace?
Can you override vanilla functions on arma? Functions such as setPos
I want to dig deep into how I could monitor and โpatchโ setPos to prevent cheating
It is a command not function, and no, that's not what we can
Yeah command sorry
Unfortunate, aight
what are you running into as far as cheating goes?
If I happen to want to disable setPos in cfgDisabledCommands will it mess up the game?
depends, are you running setPos on any client sided scripts?
SQF Injection, then there goes remote execution, people teleporting, killAll
Yes but my plan is to not have it client sided and then disable it
But maybe arma uses it
Same with allPlayers etc
If it were for me Iโd have banned most commands
Uh oh the wiki.. `Reminder
Once again, consider carefully what commands you want to disable and verify that disabling is not interfering with default functionality of the game. Don't forget to check .rpt file to avoid any confusion in the future.
`
i mean, @meager granite can probably give you more on it due to KOTH, but cheaters still get through there too. you just need good moderation
Oh KOTH is like the pinnacle of cheating right?
Hardcore cheaters try to go there
I got told BE filters can do the job but they look ugly ๐
i mean sure? any popular pvp game mode that is public you'll have them.
pve it doesn't really matter
Its true that real anti-cheater protection is moderation
if you aren't doing any hive based stuff like he does, you can just ban and reset the match
There are tons of ways to teleport and setPos is just a bit of it
I just wanna get to the point where the MOST a cheater can do is just Aimbot and ESP
Then I will just do anticheat extension
Also most advanced cheats don't even touch SQF directly, they form network messages themselves and you can't detect that unless these messages are logged by BE and only some are logged
Ugh my thing is a life server, itโs constantly going
Damn alright
just get some moderators and pay them for their time. always gonna get cheaters. its why as I've gotten older, I've kinda moved away from pvp games and more to pve/coop/singleplayer games. its only getting worse as time goes on. I think gaming in general is losing the fight against them (and instead, are messing with the kernal which doesn't even stop the more advanced cheaters, just giving up control/data to your pc for free).
not rly @nocturne bluff
but there are many misconceptions of this in the overall (not only arma) modding scene
if i would want to look smart i would first ask which database backend and then use the correct terms for the specific stuff there
because index is also no real datatype
correct one would be eg. INT
Always going to be cat and mouse with cheating tbh
Problem is, companies cheap out or don't care enough, because they know the customer will still eat their sh*t.
We need to vote more with our wallets.
while testing today I noticed that I forgot to take "killed" units in the group into account when using "forEach (units _group etc.)", is there any way (except of course specifically naming units in Eden) to keep "dead" guys in their group position? I.e. like it is with player lead groups where if you have 6 guys, they will always be selectable by F2 -> F7, even is they get killed as their "spot" is not filled (unless you have new units join the group). I would like it to be this way for AI lead groups too, so if I use "select 3" in the AI group array, and that guy at select 3 is dead, that it does not select a different guy but just skips this one. Hope that made sense?
Also is there any real way to reorder a (player) group? So you do not have "empty F(number)" spots? Is to ungroup and to regroup everyone the only way?
**# Hello everybody ** Im looking for a way to transfer Zeus compositions to Eden Editor (dont know if this is correct place for post)
Ive got a 6years old Liberation FoB wich I would like to move to the Editor. All I can do is to create
a composition that I couldnt use in the editor... Is there a known way?
Zeus compositions are just groups, which should be available in Eden Editor under the groups tab already
Ive tried to find them but didnt managed to success..
Are there cases in that compositions cant be saved: Like attached Liberation Scripts
-> yes Ive also checked the "Own" tab
The sector tactics module creates an eventhandler that fires when a sector is captured. How can I tie into/use that eventhandler in a separate script
Wrong channel, and you can't pay someone to import something. It's against eula
.#Eisenschmiede greets.
Im still stuck on this
Is there any way to disallow players to open/access backpacks/vests from friendly or enemy AIs when close to them (and they are not dead)? I vaguely remember this was possible but a search turned up nothing?
Its a straight server setting. Idk exact but I think that its something with difficulty
NOT SURE!!!
from top of my head, I think you can use the inventory EH and use a command to force closing it for the client
it is weird as I seem to recall that access was not possible on alive AIs (but could be that I am mixing this up with the OPF days)...
Idk about vests, but backpacks you can have access
=> found it! Think it is lockInventory -> https://community.bistudio.com/wiki/lockInventory
Yeah seems like the way
@broken pivot -> did you look under "custom"? (I also always have to search for where the compositions are
Yes
Its empty
Ive tried with the Liberation FoB and with some vanilla buildings, nothing shows up...
that is weird, did you try placing one or two objects and just save a new custom composition just to see it it shows up?
@broken pivot I know that liberation has a fob export for enemy fobs (secondary objectives), maybe you can tweak the code to get your fob
Could it be that its because Im using another profile because the liberation is safing on server client profile wich I had to import
We also developed a auto script for that. Ours is only working in editor/layers so I would need it first in editor to put it into a layer
that might be it - check in your second ARMA3 profile, the composition might be there!
Ill check all of the profiles... Just lemme fin the current Altis rework step
My hud went through supersize me but wont show up any composition
Hello everyone. I'm new here. I have an issue with a script. It is not mine, but It is bugged and i intend to fix it. However i am not sure how to properly implement a fix.
I cannot seem to be able to pinpoint exactly what string of code makes it break.
It is a script that governs suprressing fire.
An invisible object is spawned at the suspected enemy position, then the squad leader will command his units to fire at it for a set number of seconds, so to suppress the enemy.
This works fine for the most part until the enemy is too close or is hidden behind certain objects.
At that point the invisible object is spawned in the air, making units fire at the sky.
This is the code.
Please take a look if you can, and tell me if there is a value that must be changed so my soldiers stop shooting at the sky:
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.
Last modified: 21.11.2010
๐
no one is helping me on the a2 channel so it is what it is LOL
thanks to the overlap in commands it wouldn't be too difficult for an a3 scripter to help me with this
Are you playing Arma 2 or Arma 3 ?
A2. but as i said i am quite sure this would work on a3 technically
This would need rewrite for arma 3 example configfile command:
getNumber (configFile/"CfgVehicles"/typeof (leader _group)/"zeu_Exclude")"
It would need to be like:
getNumber (configFile >> "CfgVehicles" >> typeof (leader _group) >> "zeu_Exclude")
If you are playing Arma 3 with mods like Zeus Enhanced just use their fnc:
https://github.com/zen-mod/ZEN/blob/master/addons/ai/functions/fnc_suppressiveFire.sqf
It's called Zeus but it has nothing to do with Zeus the gamemode, let us be clear
my issue is that the soldiers shoot at the sky
do you think you would be able to pinpoint why this happens by looking at the code?
You would have more luck just starting new becouse this is more wrong then units just shoting in the sky.
Having nested foreach:
} foreach [_x];
} foreach _Targets;
and so much more.
I understand. I can't do that unfortunately, i am not good enough with scripting to rewrite something like this. Also this is linked with other parts of the mod. I can only limit myself to making small modifications i fear
i didn't even know that this was wrong btw
/ still works for config paths in a3, it's just slower
Holy shit pastebin is unusable without adblock these days
The whole internet is 
The target position code is just this:
if( vehicle _tgt isKindOf "man" ) then {
_pos setPosATL [(_ally getHideFrom vehicle _tgt) select 0, (_ally getHideFrom vehicle _tgt) select 1, ((_ally getHideFrom vehicle _tgt) select 2) +0.7];
} else {
_pos setPosATL [(_ally getHideFrom vehicle _tgt) select 0, (_ally getHideFrom vehicle _tgt) select 1, ((_ally getHideFrom vehicle _tgt) select 2) +2];
};
So it's intentionally shooting above the target. If you don't want it to do that then you could just remove the z-axis additions.
thank you very much for pointing it out to me
I did notice this at first but, i thought, surely this wouldn't make my guys shoot at the sky
thinking about it, at close ranges it probably does
yeah the other option would be to scale the offset with distance.
0.01 * distance2d or something like that.
i'll consider it if i have other issues after deleting the z axis additions
speaking of which
do you think this would make the suppressing squad shoot at a wall in front of them instead? if the target is behind them
well i'll try it first then i'll come back here if it happens
Hey guys. Forgive me because I do not know any scripting but I am trying to use ChatGPT to develop a script for Drongos Map Population mod. The goal is to despawn and cache units as the players leave the area and I kept getting the same message "scripts/dmp_unitCache.sqf not found". I then isolated that script and I am still getting the same error. For some reason this sqf file cannot be found. I have put it in a "scripts" folder and called on it through the .init file but nothing happens. I will post below for reference
// initServer.sqf
// Restore cached groups on mission start
[] execVM "scripts\persist_cache.sqf";
// Start monitoring for newly spawned DMP groups
[] execVM "scripts\monitor_dmpGroups.sqf";
You don't call scripts/dmp_unitCache.sqf there.
Okay. Where do I call it from?
I have tried in the init.sqf as well and it didnโt work
John's not saying "you shouldn't", it's a statement of fact that you currently don't. The error is saying that dmp_unitCache.sqf can't be found - but the code you posted is only trying to call persist_cache.sqf and monitor_dmpGroups.sqf, not dmp_unitCache.sqf. That means you have some other code somewhere else that is trying to call dmp_unitCache.sqf, and that's where the problem is.
You shouldn't use ChatGPT, for anything, but especially for SQF scripting. Large Language Models like ChatGPT rely on having an extensive body of high-quality training data to be anywhere near useful, and there is no such body of data for SQF. With good data, LLMs are still prone to hallucinations, inconsistencies, and mistakes; without it, they get much worse. SQF also relies on a lot of things that you need to actually play Arma to understand, which LLMs obviously can't do.
I see.Yeah, thatโs what I was afraid of. I believe it calls for it in the monitor_dmpGroups.sqf and the persist file.
Is there any scripts out there that are assembled already for unit caching with persistence built in. I would like to add something to Drongos Map Population to respawn units like ALIVE does because it drags the server if we move into multiple areas
His mod already spawns when players get within a certain distance but they donโt respawn. He has a module for unit caching I believe and it helps but not as much as despawning them does
Persistence is generally hard logic and not the sort of thing that you can approach with chatGPT.
You need a plan and understanding of the language.
Can somebody drop the link on compiled rpmalloc-v145.dll for Windows x64. DM if you have some.
Gotcha. Thanks for info
any global way to disable face gear for enemies?
{
removeGoggles _x;
} forEach units east // west, independent```
gives "missing ]" typo, I cannot find where the error is ๐ค
KIB_specOps = [
"B_Soldier_SL_F",
"B_soldier_LAT2_F",
"B_soldier_AR_F",
"B_Soldier_GL_F",
"B_soldier_AA_F",
"B_HeavyGunner_F",
"B_soldier_LAT_F",
"B_Sharpshooter_F",
"B_soldier_M_F"
];
publicVariable "KIB_specOps";
//Infantry units array
KIB_infUnits = [
"B_Soldier_SL_F",
"B_soldier_LAT2_F",
"B_soldier_AR_F",
"B_Soldier_GL_F",
"B_soldier_AA_F",
"B_HeavyGunner_F",
"B_soldier_LAT_F",
"B_Sharpshooter_F",
"B_soldier_M_F"
];
publicVariable "KIB_infUnits";
//Static weapons array
KIB_staticWeapons = [
"B_HMG_01_F",
"B_HMG_01_high_F"
"B_GMG_01_F",
"B_GMG_01_high_F",
"B_static_AA_F",
"B_static_AT_F"
];
publicVariable "KIB_staticWeapons";
//Enemy veh array
KIB_usaVeh = [
"B_T_APC_Tracked_01_AA_F",
"B_T_APC_Wheeled_01_cannon_F",
"B_T_APC_Wheeled_01_atgm_lxWS",
"B_T_APC_Tracked_01_rcws_F",
"B_T_AFV_Wheeled_01_up_cannon_F",
"B_T_MRAP_01_gmg_F",
"B_T_MRAP_01_hmg_F",
"B_T_LSV_01_AT_F",
"B_T_LSV_01_armed_F",
"B_T_MBT_01_TUSK_F"
];
publicVariable "KIB_usaVeh";
"B_HMG_01_high_F"```here
missing comma after โ๏ธ Poplox text
@warm hedge , @stable dune thanks, I am blind to this kinds of errors ...
//Static weapons array
KIB_staticWeapons = [
"B_HMG_01_F"
,"B_HMG_01_high_F"
,"B_GMG_01_F"
,"B_GMG_01_high_F"
,"B_static_AA_F"
,"B_static_AT_F"
];
publicVariable "KIB_staticWeapons";
```*This post was made by leading comma gang*
//Static weapons array
KIB_staticWeapons = [
"B_HMG_01_F",
"B_HMG_01_high_F",
"B_GMG_01_F",
"B_GMG_01_high_F",
"B_static_AA_F",
"B_static_AT_F"
];
publicVariable "KIB_staticWeapons";
This post was made by leading comma gang
heretic!
hello Mr. Lou Montana
Wait until you find out that I end all my SQF expressions with ,
ummm huh
I'm telling on you to @pastel python ๐
lol hahahaha
i got to say guys im having so much fun in Arma 3: cuz of all the help i got from all you lovely people in here thx so much guys
everything works perfectly and i mean everything
private _kill_icon = if(_this get "is_vehicle_kill") then {
format ["<img image='%1'%2/>"
,getText(configFile >> "CfgVehicles" >> _this get "killer_vehicle_class" >> "picture")
,if(_is_dark_font) then {
" shadow=1 color='#222222' shadowColor='#aaaaaa' shadowOffset=0"
} else {
" shadow=1 shadowColor='#000000' shadowOffset=0"
}
];
} else {
[
getText(configFile >> "CfgMagazines" >> _this get "killer_magazine" >> "picture")
,getText(configFile >> "CfgWeapons" >> _this get "killer_weapon" >> "picture")
] select {_x != ""} apply {
format ["<img image='%1'%2/>"
,_x
,format [" shadow=2 size='%1'", KILLFEED_LINE_OVERSIZE]
];
} joinString " "
};

lol