#arma3_scripting
1 messages · Page 190 of 1
It's weapon from mod. There are some vanilla .50 cal weapons. I would test those first before asking BIS about a mod 🤷🏻♂️
some of the more common factors that could be causing this
1 ballistics ie range, body armor of target and any objects the round is passing through
2 server desinc and lag / packet loss
3 could be bad config on cups end stating that the ,50 round is slower or smaller bullet size
4 any other mods or scripts running at the same time
CUP weapons is gold standard though
no it very much is not
as in a lot of people use it so ppl will notice if it doesnt work
if (isNil "toolkitUses") then { toolkitUses = 0; };
{
_veh = _x;
if (damage _veh > 0) then {
_timeForRepair = 300;
_repairProgress = 0;
while {_repairProgress < 1} do {
if ("Toolkit" in items player) then {
_repairProgress = _repairProgress + (1 / _timeForRepair);
sleep 1;
hintSilent format["Repairing: %1%", ceil(_repairProgress * 100)];
if (_repairProgress >= 1) then {
_veh setDamage 0;
toolkitUses = toolkitUses + 1;
if (toolkitUses >= 3) then {
player removeItem "Toolkit";
toolkitUses = 0;
};
};
} else {
hint "You need a Toolkit to repair this vehicle.";
sleep 1;
break;
};
};
};
} forEach (nearestObjects [player, ["Car", "Tank", "Air"], 5]);
Hello someone made this little script for me i wanted to make repair longer , its possible to add 3rd pârty DLC repair kit to it ?
With it's audiovisual quality? No way IMHO. Maybe when combined with JSRS.
Still don't understand how does this relates to scripting though
no shit sherlock, ofc i ihave jsrs
thanks for pointing out the obvious
cool down buckaroo, this ain't the wild west
likely mod conflict or bad config
Guys we are all just trying to help each other we can be civil right
Speaking of help if you dont help me i will be MAD
😤
Hey im trying to get sql from the ace github i wanna learn and dont know am i supposed to drop this in mission file or can i take the function inside and put it in eden editor for startup init?
Talked with someone earlier about cargo size and wanna learn how to use this repository of functions effectively and to learn to make my own so not sure how to mesh them into missions thx in advance
i was joking about getting mad btw
im here to learn
Context here
i got directed to these functions i wanna change cargo size and they suggested these i just don't know how to use them
i c
i can work my way around the functions utility its more the file exploration and how to inject this stuff into my mission im lacking in knowledge
or the rules that arma uses for its systems im starting to get there but struggling mostly with the different files and what goes where and how i can mess with stuff in eden vs zeus vs pbo data in config etc
so you just want to set a single vehicles cargo size right?
that or set the value of a objects cargo weight yes
I actually suggested Mod approach before I understand the context. You should ignore my instruction
its a simple task or i thought so and i want to start simple and work from there my end goal is a way to functionally pay for through objects a seperate object or vehicle ie: 3 money or boxes for 1 vehicle
i dont know how to do any function yet so ye
It likely is just one line of code
id assume so im just very foreign to how any of this works
so for an object you can double click on it in editor and put [this, 3] call ace_cargo_fnc_setSize into the vehicles "init box" and modify the number after "this" to change its size
pretty sure if you have the 3DEN mod aswell you can just double click and scroll down and there is a box you can modify for vehicles cargo size or an objects cargo size
can you walk me through how that works for future understanding, its just calling into action the function of setting cargo size for "this" being the init directed object and the value is just that functions value change on mission startup?
do you have a link id love to grab that ty!
essentially ace has a function defined by that name and it is designed to take on two "parameters" (you can think of them as what you tell it to modify) and then it apply's whatever it needs to do code wise to that vehicle to increase the size of it
okay so its worked on my HEMTT but my concern is mostly that it worked on 1 single truck how could i make it work on all? is there a way to call that function to define all hemtt to have that function on mission startup?
just double click on all the trucks and paste that code in
but i might want to spawn a new hemtt in zeus it wont have that cargo size anymore
and maybe im stupid but im trying to execute the code in the new one in zeus but that isn't working as a test either
[_this, 3] call ace_cargo_fnc_setSize if you have zeus enhanced you can double click and paste this command into the console there note the difference in _this vs this
im trying that too i see it wants _this i have zeus enhanced is there a button i press to initiate the code or just press ok?
just ok
im pressing it and nothing seems to be happening
maybe need to press enter in the box
ive also now tried that on all options, global, local, target
i apologize i was mistaken use [_this, 20] call ace_cargo_fnc_setSpace this command for both
woah
that worked on target
right we were changing the value of the objects cargo size not its internal space
lol
yeah reeding is hard 
is there a way to write this stuff in the init of the mission file like call "B_Truck_01_cargo_F" ace_cargo_setSpace = 20?
instead of manually scripting each hemtt, im fine with it this is fantastic progress and im very grateful im learning alot i'd just like to see how far i could push this function
you can, it would be grabbing all existing trucks and foreach on them
spawned ones would be a different thing though.
thats kinda what i mean
my big thing is i spawn objects in for my players mid op for them to use and our ops last multiple days before server restarts so having that consistent space in the object or the cargo size of a barrel etc being consistent would be quite helpful
im so happy i got this far lol been trying to figure this out for ages lmao ik its simple but im very unfamiliar with arma and its systems
you would then need to use an event handler, "EntityCreated" (https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#EntityCreated) and check for the classname
how do we typically find classname apart from the obvious, is it through the config viewer ?
Is it possible to change cargo size in vanilla using scripting or is it some ACE witchcraft?
well i know this one, cargo size is a ace addition, there is inventory size but theres no cargo in vanilla last time i checked
(cargo is for boxes, crates, spare wheels for ace etc)
So, ACE has it's own cargo for things like spare wheels If I understand correctly
could you show me an example of this in action im writing one up but having a hard time with the syntax for the param
correct, the whole thing im working on is entirely ace driven its a little menu for boxes etc
this or right-click → copy to clipboard → class
(iirc)
yeah that was the easy way i thought existed thank you
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
if (typeOf _entity == "B_MyClass_F") then { _entity call SWA_fnc_MyScript; };
}];
oh wow thats different to what i wrote
we will never know if you don't post it :p
im trying to finish it you are too quick lol
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
Class B_Truck_01_cargo_F {
ace_cargo_setSpace = 16;
};
}];```
XD
yeah nah, here you are trying to define a class in script, you definitely cannot do this
i figured after reading your crazy one
how do we define the target of the function is that just typeOf _entity == "B_Truck_01_cargo_F"}?
then if we can confirm entity is that we move forward with function?
this event will execute for every created entity
you have to filter by entity type as shown yes
thats extremely cool
could we have different set values for the entity based on the target
like could i streamline 4 dif vehicles with 4 dif values in this ?
sure
thats rlly cool how do we seperate the dif entities do we have to call to each what allows us to direct each to their specific function?
you could use e.g a switch structure, this way it will accept multiple types
interesting let me see if i can try my hand at it
params ["_entity"];
if (typeOf _entity == "B1","B2","B3",)
switch (_condition) do {
case "B1" { _entity call ace_cargo_setSpace = 16;
case "B2" { _entity call ace_cargo_setSpace = 32;
case "B3" { _entity call ace_cargo_setSpace = 64;
}];```
would this be something similiar to what im looking for theoretically
i understand im bad at this but as i learn more its becoming infinitely more engageable
EntityCreated is awesomely useful - I use it for all sorts of things (like the current factions we are using some of the officers are set up weird and either have pistols only or no pistol/rifle so I have a quick check that adds an appropriate rifle, I also use it to control weather a unit is blacklisted from headless by type/side etc
it seems super useful
somewhat yes (of course here this code is wrong)
Hello, I have a question about preInit.
The following code is in a preInit executed function:
if !(isNil {respawnBlockWest}) then {
createMarker ['respawn_west', respawnBlockWest];
} else {
logWarning0("No respawn position found for side WEST")
};
};```
However when I run the code, it tiggers the logWarning macro. However, if I run the code ingame (after the preInit stage), it succeeds.
For my basic understanding of preInit, does map objects only get initialized after the preinit stage?
i feel like the switch needs a way to actually force the dif _entity to call the function but im not there yet i think but im glad im sorta getting closer
GOD this intel is driving me insane I have no idea what I'm doing anymore and nothing's working. I don't even know how to use eventhandlers and idk how to set up the triggers properly to make it work.
Someone please just give me a quick and dirty solution on a silver platter I can just paste in and format for each intel item at this point
because I'm tired of trying to quickfire intel in Zeus editor
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
switch (typeOf _entity) do
{
case "B_Class1_F": { [_entity, 16] call ace_cargo_setSpace; };
case "O_Class1_F": { [_entity, 32] call ace_cargo_setSpace; };
case "I_Class1_F": { [_entity, 64] call ace_cargo_setSpace; };
};
}];
```but don't quote me on it, check how to use `ace_cargo_setSpace`, I have no experience with this function
i think im the opposite im really loving learning this cause ill be able to change it in future
don't get me wrong everything I've learned so far is fantastic
I have the better half of a mission already set up at this point and it's the most immersive mission I've been involved with
but for the life of me I can't solve intel.
oh i see so in place of my condition you use (typeOf _entity) and for the actual setspace your using the _entity system again like in eden editor thats so cool
im actually rlly proud of how close i was lmao
What's crazy is,
for me, it's not managing the intel module and writing all that, then linking it to a trigger
that I can do just fine
it's setting up a player action that deletes the intel object, then fires the trigger.
there are tutorials for intel
anyone got a quick anwser to this before it gets lost in the chatter? 🙂
and they're all as clear as mud.
trust me I've watched every one of them.
so your problem is getting the action command for the player working?
my problem is getting the action command to trigger the AddDiaryEntry module
trying some variations of this ingame, not seeing results so far, no results and im not getting any erroers either its quite strange
ah, let me just look at the module. I personally dont really work with the arma 3 modules
You can sync it with a regular trigger so when players walk into the trigger, or if the trigger is activated via other means, it should create intel.
okey, and at what part does it not work for you?
so I've got a document resting on a table the players need to collect. I've set up in the document, for brevity's sake I'll just refer to as "doc", with an AddAction script that deletes the document on interaction and sends a hint saying "you've collected the doc". Then, the trigger contains within it's init !alive doc so that when the document gets deleted, theoretically, it should fire, because things in arma are "dead" when they're deleted or so I've been told. However, in practice, it doesn't work.
I did get it to work once, but the intel I wrote in the module didn't appear in the briefing, instead having just a blank image error icon.
!alive doc `is a condition for trigger
are you doing this all in code? Or placing the objects, triggers, modules and such in the eden editor?
because addaction command attached to an object is just suicide imo. especially in mp
eden only. I'd like to be able to quickly add this stuff in a module composition and edit it on the fly so I don't spend all day alt-tabbing checking .sqfs
yeah, ok. Then you're working with the object init in the editor right?
yup
try using object classed as inventory item for documents, addaction has local var scope which you have to code around
can you share the object init of the doc?
so we had a syntax error on my part the "ace_cargo_fnc_setSpace" was the correct usage i didnt put the fnc in there properly and now from what i can tell it works lol
worse still if you add them to a player 🙈 - (though tbf if you are using ace it's far nicer to add whatever it is to ACE UI)
this addAction ["prist's account", {deleteVehicle testbox}, nil, 1, true, true, "", "true", 4, false, ""];
this only deletes the testbox (what ever that is?)
the doc i assume?
It will be, yes.
wow im astounded how perfectly this works is there any consiquences of me throwing like 40 entities into a array of switches into this code and letting it go ham on every vehicle on spawn? this is absolutely f* amazing how useful this is
and now i can make all my crates a value of 2 weight too!!!
i owe you one lou!
I just use an infinite loop executed locally at the client where all the actions are placed. It works like a dream
all code has consequences in that it takes time to execute but you have to consider how frequently it's called and what the cost of running it is - EntityCreated doesn't get fired that often in the grand scheme of things - if you want to reduce the hit put an exit condition at the top so you can bail out fast if the entity isn't a vehicle or whatever
how would i put a exit condition im still quite new to this
did you try BIS_fnc_initIntelObject??
I just did that by accident, had a while{true}w/sleep to for a mod to display it's debug info and ran it in the unscheduled env by mistake (nut loose on the keyboard) arma did not like that 😄
I haven't but I don't believe it'll be helpful in this case because I'm wanting something simple and modular.
why? that's why there is a condition field in addAction
something like if!(_foo isKindOf "LandVehicle") exitWith{}; at the top - that'll bail out if _foo isn't a LandVehicle (which is cars, tanks, APC's etc)
does the condition field of addAction not do the same?... xD
well, it's simple as that... it will do all you want for that intel, even the addAction
im genuinely excited to learn more this shit is so cool when i spend time deciphering these hieroglyphs
I've been programming since 1987, that feeling never goes away 😄
it's safer
basically this 😄
lmao always the right for me
hmmm, dont really agree. It depends more on what they actions are for.
i just do network and server hosting stuff administration crap and files never touched any script or programming outside editing a few values or stealing from github
eh - not knowing something is never a bad thing, not choosing to learn is - you are choosing to learn - the rest comes with time/practice 🙂 - curiosity is the thing that makes a good programmer a good programmer
_foo is land vehicles or is it just a replacement name?
it doesn't make any sense
also iskindof is a odd one im gonna need to learn
none of this stuff makes sense to me I'm just here man
_foo is whatever object you want to check, so if you have params ["_entity"]; at the top of your EntityCreated function it'd be _entity not _foo (fyi, foo, bar, fizz and buzz - are what programmers use as "placeholders" when they don't know what the other person is calling the variable 😄 - I like to think that foobar comes from FUBAR (Fucked Up Beyond All Recognition) 😉 )
it's "is inherited from"
e.g "B_MRAP_01_F" isKindOf "Car"
its better to have one loop with 20 actions with there own conditions (which allows even some grouping of actions, like alive player) then have 20 actions with their individual conditions which basically are 20 individual loops
now if I can slap a hint in here it'll be great. I assume...
lmao
but any answer to my question btw? 😄
I assume if I edit my existing code from
this addAction ["prist's account", {deleteVehicle testbox}, nil, 1, true, true, "", "true", 4, false, ""];
to
this addAction ["priest's account", hint "you've collected the priest's account of what happened", {deleteVehicle testbox}, nil, 1, true, true, "", "true", 4, false, ""];
it'll work properly.
or does it need to be in the squggly brackets
thank you that helps alot, so what is "LandVehicle a defined term or would i need to specify the vehicle
oh thank you god my hypothesis was correct
now I can go back to making le scary mission
how extensive would it be to theoretically make the player input x objects to recieve x objects how would i go about that i can think of some basic ways like have a factory the player has to load cargo into until x then idk how i would check and spawn a vehicle but thats where im at on my next big project.
thanks everybody.
arma uses a thing called a class hierarchy, an entity can be a subtype of a class - say "Helicopter" or "Car", "LandVehicle" is a parent class of all vehicles that are land vehicles - basically all cars, APC's, trucks whatever
is it working?
it is indeed working perfectly.
is there a repository of all these hierarchies?
stop making working scripts, this is not the place!
with that addaction?
yes, with the addAction
the second one?
how that's working is beyond anyone's mind 😂
lmao
yeah - you can get them via Config Viewer in Eden or there are commands to work with it directly configHierarchy and the like
yes it's working exactly as intended.
oh amazing ty
an you help me with this @winter rose 😛
I walk up to the box, hit spacebar, it disappears. The game says they've collected the intel, and intel has appeared in the mapscreen.
I don't know what you did but this shouldn't work at all lol
wrong parameters order
if it works, don't fix it! thats like rule 101 in coding xD
I am afraid I don't know, but strongly assume that you won't have markers in pre-init
arma's config system is pretty neat but generlaly you'll find yourself using typeOf and isKindOf a lot in your code 🙂 first tells you what something is and second returns true/false if it's kindOf
sometimes, professor, the most effective thing to destroy the enemy's plans isn't in-fact to send soldiers in, but to instead send in a flock of hens, whom of which have no idea or preconception of how severe the situation is that they are in.
so you can do stuff like "is this unit a man (CAManBase not Man) and alive and on the enemy side and carrying a UAV terminal or whatever
@plain bramble this should be the correct one, you passed deleteVehicle testbox as an argument and it somehow works lol
this addAction ["priest's account", { hint "you've collected the priest's account of what happened"; deleteVehicle testbox; }, nil, 1, true, true, "", "true", 4, false, ""];
true, its the map object it need to find where all players spawn. Which is dynamic. And I want to create the respawn marker at that object. But i dont know if the preinit already has the mapobjects initialized. I assume not, so maybe I need to make a different approach. And that map object is already in the mission.sqm
thing is, you passed deleteVehicle testbox as an argument which you can acess with _this select 3 within addaction scope
also, use vscode (https://code.visualstudio.com/) and https://marketplace.visualstudio.com/items?itemName=Ezcoo.sqflint-revisited - it'll remove a lot of pain (first is a decent editor, second is a plugin for it that helps spot errors, typos in your code - stuff like the dreaded trailing , in arrays and the like
Visual Studio Code redefines AI-powered coding with GitHub Copilot for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.
I have no idea how it's happened, but now I'm gonna save this as a custom composition so I can just paste it in for other stuff I want the players to find in this endless breadcrump fetchquest of a horror op
I bet I could link this to a hide module on a marker that is named "exclusion zone" so the players don't know where the bad places are until it's too late
oh this looks similiar to obsidian lol
was just confusing as hell to me as i spent way too much time activating a trigger through addaction scope last night 
it's "just" a code editor - it's a pretty popular one and widely used - has a bunch of plugins for making arma development more pleasant (it's not the one I use at work (neovim or intellij ftw :D) but for arma it's great)
oh man this is a tad overwhelming
perseverance pays off, how do you eat an Elephant?... one bite at a time - everyone is a beginner at some point - even Dedman had to start somewhere 😄
yes it was for me (too) but now i know (Lou) (Woohoo) to You lol
i got the sql plugin how do i make it all work
Wait, he wasn't born a master programmer? 😯
and is there immediate changes i should make for ease of access?
So far I was using this one https://marketplace.visualstudio.com/items/?itemName=blackfisch.sqf-language
Extension for Visual Studio Code - Full SQF Language support for VS Code. Forked and updated from https://github.com/Armitxes/VSCode_SQF
Seventh Son of a Seventh Son born under a full moon 😉
lol
tangentially related, "Seventh Son of a Seventh Son" is one of the best metal albums ever created - perfect arma background music
How I could not notice 🎸
how do i use these plugins
Seen 'em live twice, seeing them again at the end of this month 🤘
Install them and start coding?
what do they do im trying to figure that part out i guess
they add functionality to vscode - specifically in this case they add a linter (a background task that watches what you type and makes sure it looks valid) - basically it'll give you a heads up if your code is syntactically invalid, for example (I deliberately removed a ; and it warned me on the next line that it was missing)
i dont have all that colour in mine
in that case, not only did it flag the error but it suggested what it might be
install the SQF extension, it'll syntax highlight (that's the colors) the file
i think i gotta use their theme then too
it's called SQF Language in the extensions
and i want the file to be under sqf?
i changed it now i got quite a array of colours and i think the arma stuff is working now too?
sqf extension
it doesn't show extension i installed it but when i have to choose a language it kinda just works?
like i typed and it came up with BIS
What a taste for colors 😆
yeah, if the extension is whatever.sqf then vscode will recognise it as an SQF file automatically - for SQFLint you may need to install Java and then go into settings and set the path to the java binary - java is here - https://www.oracle.com/java/technologies/downloads/ ( you want this one probably https://download.oracle.com/java/24/latest/jdk-24_windows-x64_bin.exe) if you install it in the default location then the apth you want to put in "Java Path" is C:\Program Files\Java\jdk-24\bin\java.exe - that's basically all you have to do to get it linting properly 🙂
thanks i got java already ill direct it
java sucks to setup when your doing any complicated minecraft hosting i got like 12 versions XD
Java sucks generally but the JVM is an engineering masterpiece
(note: not saying Java is a bad language - it's clearly not and half the world runs on it just not a language I enjoyed programming in at all)
i dont know the code i just know its hell for compatability
could i make a theoretical vehcile spawner in arma?
like interact with object = vehicle spawns
youd need to have a location for the vic to spawn and then my concern would be i want them to pay to spawn it, is there a check in game for a radius? like could i check for "block" in radius "5 meters" else no car?
of course. you can do almost anything in Arma. Thats why its so beloved and additive... its like lego's but then for adults
where could i find functions that could help in this endevour i want to make factories that my players can build and input resources into to get vehicles of their choice
https://community.bistudio.com/wiki/createVehicle
for starters
it might be a big step from changing 1 value idk if theres a middle ground option but its kinda my big crux atm spawning vics for my players is really rough on gameplay loop
100% can, I did this for my players so they could buy vehicles without hassling me 😄 https://www.youtube.com/watch?v=R0N2hRmk30Q
i want the logistics portion of the game to be as seemless as possible
yeah aye
its a nightmare
also that T-34 plays Sabaton when players get in it - because why not and it amused me 😄
lmao
(not as much as when I made every vehicle blast barbie girl for an op)
basically torture - https://youtu.be/nyXV0Ext2zk?feature=shared&t=107
can i change a function call per case in a switch script?
like cargo fnc setspace for case a but setsize for case b
yep
would there be any issues
hmm
that makes me want to make the largest entity created script ever
switch/case is a common pattern for handling dispatch based on a condition that can be one of many
you can also use it for stuff like this sqf switch true do { case (_bearing >= 337.5 || _bearing < 22.5): {"N"}; case (_bearing >= 22.5 && _bearing < 67.5): {"NE"}; case (_bearing >= 67.5 && _bearing < 112.5): {"E"}; case (_bearing >= 112.5 && _bearing < 157.5): {"SE"}; case (_bearing >= 157.5 && _bearing < 202.5): {"S"}; case (_bearing >= 202.5 && _bearing < 247.5): {"SW"}; case (_bearing >= 247.5 && _bearing < 292.5): {"W"}; case (_bearing >= 292.5 && _bearing < 337.5): {"NW"}; }; since you can switch on a boolean 🙂
LMAO
thats so useful i worry its going to be inefficient or a poor way to script this stuff like if theres a cleaner method id like to do it
thats why i wanted to do switch rather then a standard else function
switch isn't "expensive", it's essentially just a short hand to avoid a massive nasty block of ifelse
awesome ty
ive done 8 of these big arma events and its getting tiresome to do everything so having a way to make players load up crates sized 2 cargo on my hemtt and having dif objects be able to be loaded is gonna be so huge
is there a way to use a object position in reference to another object rather than the map?
https://pastebin.com/56G5Rvfd that's most of how my vehicle spawn works
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
what they are "allowed" to spawn is then controlled by config via Description.ext because I'm lazy and we change maps/enemy factions fairly often
right
^ uses ace, so it adds a new item to the ACE UI called "Ragner" (our unit) and then everything sits behind that for vehicle spawning
its getting late i might read that one tomorrow when i got more brain power, ive been working on this for hours
but ty!
In this video i will be showing you how to install, setup, and configure the
VVS - Virtual Vehicle Spawner Script. The script will allow you to spawn various
types of vehicles from any vanilla or mod faction, from cars, armored,
helicopters, planes, drones, boats, and support vehicles.
DOWNLOAD the script
https://drive.google.com/file/d/1IHAa...
no worries 🙂
yeah it's good that one 🙂 - I just built one for our purposes but that's entirely because I could and I wanted it to work a specific way (since we are mercenaries I bill them for everything - hell I have a store at the end of the runway run by the Unfriendly Arms Dealer where they can buy the good stuff 🙈 )
forgot I did that 😄
man i feel like ive just unlocked a new way to play this game
my players are gonna be so happy with this lol
where do i place this if! script does it go inside my "addmissionevent handler" or above the whole thing?
inside the function that gets executed at the top - it's commonly called a "guard clause" btw - basically you want to exit the function immediately if whatever the function does doesn't apply when it is called 🙂
also technically my event handler has things outside landvehicle now so i guess it should prob not be used
entirely depends on the context of what you are doing 🙂
i was just gonna do a big switch of all the objects cargo i wanted to change
yeah, I spend far more time programming arma than I do playing it these days - that or sat in the zeus slot watching them do stupid things in funny ways 😄
I was talking about this with Gunter yesterday (from that video I've linked. There are a lot of players that don't actually knows that arma is a sandbox lol
right, in two separate scripts, top one is working, bottom trigger isn't firing for some reason. both are spawned through script using BIS_fnc_spawnGroup, both groups are using arrays with classnames to spawn in
_players = playableUnits;
_target = selectRandom _players;
enemyVehGroup = [getMarkerPos "spawnEnemyPos", independent, [vehUnits]] call BIS_fnc_spawnGroup;
targetVeh = leader enemyVehGroup;
private _wp = enemyVehGroup addWaypoint[_target, 1];
[true, "taskDestroy", ["", "Destroy the leading vehicle"], targetVeh, "ASSIGNED", 2, true] call BIS_fnc_taskCreate;
_taskDestroyTrg = createTrigger ["EmptyDetector", [0,0,0]];
_taskDestroyTrg setTriggerStatements ["!alive targetVeh", "[""taskDestroy"",""SUCCEEDED""] call BIS_fnc_taskSetState;", ""];
_greenforGroup = [getPosATL player, east, [infUnits]] call BIS_fnc_spawnGroup;
_targetTL = leader scientistGroupTemp;
_killTarget = [_targetTL, true];
[true, "taskEliminate", ["", "Eliminate the target"], _killTarget, "ASSIGNED", 2, true] call BIS_fnc_taskCreate;
_eliminateTrg = createTrigger ["EmptyDetector", [0,0,0]];
_eliminateTrg setTriggerStatements ["!alive _targetTL", "[""taskEliminate"",""SUCCEEDED""] call BIS_fnc_taskSetState;", ""];
aye but doesn't surprise me, arma is kinda unusual in that not only do they not actively supress mods or implicitly allow them but straight and directly wants you to mod it 🙂
i just noticed i switched sides on them, good thing i posted 😂
that's what makes this community so awesome
I've got 5310 hours in arma - about 200 of that is vanilla arma 😄
I have 3,300h
it's my "home" game
mine as well 😄
And they themselves call it "platform" rather than "game" 😂
I mean they spun part of it off as a legit military simulator
considering it's age and origin, it really is a fantastic sandbox/thing
What a rookie hours I got at just 14 hundred 😆
highest person I've played with is north of 12000 hours 🙈
a full time job is ~2000 hours a year, so he basically did the equivalent of a full time arma job for 6 years
when writing in my init i have to get rid of my // stuff is there any way to make this more seamless?
i like writing notes for anyone reading cause i might have other zeus looking over this and teaching them
You could have the marker in editor at a default position and move it once your dynamic object is initialized.
@thin fox https://www.youtube.com/watch?v=Tx-2y1yQ9Gw final version of my convoy stuff - it's properly modular now I can protect it with basically anything that flies 😄
that's so cool man, loved it
did you remember that we've talked about the moduleCas_F days ago?
yeah vaguely
I played with modifying that a while ago https://www.youtube.com/watch?v=5xsrHZ-2kNo
omg i got my huron containers to work they actually load and unload omfg
@cyan thunder
this is just such a game changer for me
comment "This comment works";
"This comment works too";
// This doesn't work
/* This doesn't work either */
Or use the 3den comments module
ty
hey guys, is there any way i can check if a player has changed backpacks? im trying to do a rally point system that checks whether or not a player has an LR backpack and im trying to make it more dynamic
SlotItemChanged event
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#SlotItemChanged
alrigth well i got a absolute absurd amount done today ill come back tomorrow to possibly work on the factory system ty all for the help ive gone from not having the faintest idea of how to do this to being able to add functions and different ones to any object! tyvm 
You can do very neat things with that stuff - I have it setup so that players can drive a vic with a container to a spot on the map, unload it then that can be converted to a FOB (creates a respawn point and puts the correct arsenal down) - https://www.youtube.com/watch?v=ruO7b2DdKfs
oh man i gotta make arsenals automated next lol
ill check it out, thanx :D
i have certain equipment i want them using or have access to but every restart id have to add new editions they unlock manually and such
it's easy if you are using ace 🙂
always
create an arsenal off the map somewhere, set it up how you want it then you can use ```sqf
// get the virtual items in the arsenal, we only want the keys (as it is [["foo", any]]) - i.e. conventional hashmap)
_validItems = keys (primaryArsenal call ace_arsenal_fnc_getVirtualItems);
_arsenalObjectClass = "AmmoCrates_NoInteractive_Medium";
{
[_x, _validItems, true] call ACE_arsenal_fnc_initBox;
} forEach (allMissionObjects _arsenalObjectClass select { _x getVariable ["isSecondaryArsenal", false] == true});
TL_arsenalsTransfered = true;```
but the thing is i want to force only certain ppl to have access to certain gear and make any gear they get access to perma during the reset and after
😮
ill have to read that tomorrow i gotta sleep
but ty goodluck yall
ace uses events, you can hook the event when the arsenal is closed, if the player shouldn't have it you can just remove it from them then 😉
oh thats smart
or you know just punish them https://www.youtube.com/watch?v=Cwa4_pjLAWs if they take something you told them not to 😄
the thing I most love is that if you have an idea you can just build it - https://www.youtube.com/watch?v=CmvbXLLLSx4
One of my more recent things - I extended lambs so that it understood how to garrison/defend trenches (Trencher mod is awesome btw) https://www.youtube.com/watch?v=0J4RsP84JO8
Does anyone understand why AI simply become "static"? By that i don't mean pathing, but AI dont raise their gun when you come close, yet they still shoot without an animation.
Here's my code: https://pastebin.pl/view/6a90883d
It won't let me send the code in discord for some reason.
Pastebin.pl is a website where you can store code/text online for a set period of time and share to anybody on earth
I’m sorry if this is the wrong chat. But I’m running a small Arma 3 group, trying to step up my mission creation. And I’m in need of help with triggers and other things. Can anybody help? Or direct me to the correct channel to ask in?
Usually #arma3_editor but what are you looking to do?
It’s an SCP group, so I’m trying to figure out how to systematically teleport one player away, kill them so my team sees the death message, and then play a scream for the rest of the group.
Make a trigger and set activation to ANYBODY/ANY PLAYER and Repeatable unchecked and put the condition as this && isServer. In On Activation, paste:
private _victim = thisList select 0;
// teleport them to whatever coordinates
_victim setPosATL [1000, 1000, 0];
// kill them after 1 second
[_victim] spawn {
sleep 1;
_this#0 setDamage 1;
};
// death message
["SYSTEM", format ["%1 has died under mysterious circumstances...", name _victim]] remoteExec ["hint", 0];
// scream sound
[_victim, "scream"] remoteExec ["say3D", 0];
Make a description.ext in your mission folder and put this code in:
class CfgSounds {
sounds[] = {scream};
class scream {
name = "scream";
sound[] = {"sounds\scream.ogg", 1, 1};
titles[] = {};
};
};
Find a scream noise, convert it to a .ogg if it's not already and put it in \sounds.
Okay. I have no idea how to do the sound part of it but the teleport and kill worked perfectly. Thank you.
You simply need to find a mp3 of a scream noise, and convert it to a .ogg.
This is an example you could use.
Just name it whatever you pathed here;
sound[] = {"sounds\scream.ogg", 1, 1}; and you'll be fine.
It also has to be in the sounds\ folder if that's where you pathed it to.
The first number is the volume, with 1 being full volume. The second 1 is the pitch/speed of the sound.
do you want the scream to originate from the vanishment point, perhaps?
My thought process is teleport, death message, sound plays for those who where not teleported.
^^, in that case, add a
private _victim = thisList select 0;
private _vanishPos = getPosATL _victim;
and then
[_vanishPos] remoteExec [{
params ["_pos"];
private _sfx = "Land_HelipadEmpty_F" createVehicleLocal _pos;
_sfx say3D "scream";
sleep 3;
deleteVehicle _sfx;
}, 0]; // 0 = all clients
If i'm correct.
Is anyone able to help me with this per chance?
Prefix your classes
Also you don't need to do the sounds[] = {scream} thing (scream should also be in quotes) anymore
I should have specified. The mod I’m using has zeus modules to play sounds. Can I do something to set one of those to play?
Zeus Immersion Sounds?
Drongos spooks and anomalies.
don't usesqf _enemy attachTo [_helper, [0, 0, 0]]; detach _enemy; to teleport objects; _enemy setPosASL getPosASL _helper is good enough
Do you recon that causes the problem im having tho?
most likely not.
_hostage disableAI "MOVE"; is what makes a unit not move, that's about it
But that shouldn't stop their shooting animation tho. I'll go ingame real quick to take a clip of what's happening exactly.
What's the difference between MOVE and PATH?
Is there documentation on this anywhere?
Would try and look but the BI Forums have been down for a while.
It explains the disableAI feature but not necessarily the parameters as far as i can see.
I'll for sure mess around with it, i'm gonna assume that disabling pathing would be more then enough.
Unsure of why MOVE was added in there. I'm gonna assume its rotation or so.
Nevermind, just seen the button.
😭
Even after changing the variables the ''One hit kill'' script still doesn't have an effect on already spawned AI units
[] spawn {
while {true} do {
{
_x setVariable ["HAF_spawned",true];
_x addEventHandler ["HandleDamage", { [_this#2, 1] select (_this#6 == player) }];
} forEach (allUnits -allPlayers select {isNil {_x getVariable "HAF_spawned"} && side _x == EAST && !isPlayer _x});
uiSleep 2;
};
};
Use entity created event handler instead of a loop
Is there a function that allows you to change the amount of armor an AI has?
Me commenting out _enemy disableAI "MOVE"; gave the AI 1000% extra armor or something.
// SECTION 9.2: ENEMY PLACEMENT
private _mustSpawn = count _units < _unitsMin;
private _shouldSpawn = (random 1 < _enemyChance);
if (_unitCommon &&
count _units < _unitsMax &&
(_mustSpawn || _shouldSpawn)) then {
// Create enemy group and unit
private _group = createGroup _enemySide;
_group deleteGroupWhenEmpty true;
private _enemy = _group createUnit [
selectRandom _enemyTypes,
getPos _helper,
[], 1, "CAN_COLLIDE"
];
_enemy attachTo [_helper, [0, 0, 0]];
detach _enemy;
// set position and stance
_enemy setFormDir (_helper getDir _furthest);
_enemy setDir (_helper getDir _furthest);
_enemy setUnitPos (selectRandom ["UP", "MIDDLE"]);
// Disable AI movement
//_enemy disableAI "MOVE";
_enemy disableAI "PATH";
// Add to units array
_units pushBack _enemy;
sleep _sleep;
Part of the script.
something like this?
["CAManBase", "init", {
params ["_unit"];
if (
side _unit == EAST &&
!isPlayer _unit &&
isNil {_unit getVariable "HAF_spawned"}
) then {
// Mark unit as processed
_unit setVariable ["HAF_spawned", true];
_unit addEventHandler ["HandleDamage", {
[_this#2, 1] select (_this#6 == player)
}];
};
}] call CBA_fnc_addClassEventHandler;
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
["CAManBase", "init", {
params ["_unit"];
if (
side _unit == EAST &&
!isPlayer _unit &&
isNil {_unit getVariable "HAF_spawned"}
) then {
// Mark unit as processed
_unit setVariable ["HAF_spawned", true];
_unit addEventHandler ["HandleDamage", {
[_this#2, 1] select (_this#6 == player)
}];
};
}] call CBA_fnc_addClassEventHandler;
```sqf
yeah that button is bad UX - it caught me the other other day when I missed it on a different page 😄
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
}];
And check side group unit rather than side unit.
Side unit may return civ x point so
side group _entity
And you need to check that
isPlayer _this#6 ,
Because if event is called on server, player is not exists on server.
if (isNil "HAF_entityHandlerAdded") then {
HAF_entityHandlerAdded = true;
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
if (
_entity isKindOf "CAManBase" && // Only human units
side group _entity == EAST && // More reliable group side check
!isPlayer _entity && // Exclude players
isNil {_entity getVariable "HAF_spawned"} // Not already processed
) then {
_entity setVariable ["HAF_spawned", true];
_entity addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator"];
// Check if instigator is a player (works in MP)
private _isPlayerDamage = !isNull _instigator && {isPlayer _instigator};
// Return full damage if from player, original damage otherwise
[_damage, 1] select _isPlayerDamage
}];
};
}];
};```
Like this?
to check if the event handler was added, you need to check the return of the handler:
HAF_entityHandlerAdded = addMissionEventHandler ["EntityCreated", {}];
if (HAF_entityHandlerAdded == -1) exitWith { systemChat "My code failed :("; }
but do you think the code i sent is going to at least work?
Looks plausible as long as you don't have other HandleDamage event handlers (eg ACE).
Gonna test right now
I don't think addMissionEventHandler ever fails. I don't know where the -1 return value idea comes from.
No errors, but no effect, ACE is conflicting, but it already gave me a positive return for not popping up an error
I will probably try to add a ACE compatibility to it
Unless i mess everything up and give up lol
Why bother with HandleDamage if ypu're just killing them outright anyway?
Just use a Hit EH or something and kill them there
Would still effect my player only?
You would check it the exact same way
I might just give it a shot, as long as ACE and CBA don't conflict with it and mess everything up like it did a few months ago
So it would work on both already spawned units and newly spawned ones
insteresting approach
im gonna work on it tomorrow when i get home
No, you'd have to add it to every unit
Unless you're fine with a CBA dependency
no problems with a CBA dependency
already have it anyways
Then you can use CBA_fnc_addClassEventHandler to just add event handlers to units
["CAManBase", "HitPart", {
systemChat str _this;
}] call CBA_fnc_addClassEventHandler;
https://cbateam.github.io/CBA_A3/docs/files/xeh/fnc_addClassEventHandler-sqf.html
Then just check whatever conditions you want in the EH
Cool, will just check for player only and fresh spawns and already spawned ones
Nice, thanks for the help bro
That is the EH, you wouldn't need to add a new one
["CAManBase", "HitPart", {
private _firstHit = _this select 0;
private _instigator = _firstHit select 11;
if (isPlayer _instigator) then {
(_firstHit select 0) setDamage 1; // Kill unit
};
}] call CBA_fnc_addClassEventHandler;
Thanks for doing it
do i have to update de config.cpp and mod.cpp?
You'd need to add cba_main to your requiredAddons if its not already
Done it a few seconds ago lol
I have a side question
Does CBA usually overwrite all of the ACE's EventHandlers?
hello guys, my friendgroup and i play regular pvp missions on our server. To balance it a bit i would like to restrict the arsenal and take out some weapons from the mission and make them not playable. For example G6 Lynx or TITAN launcher. how do i do this?
Or "mechanics" to be less specific
You can edit the Arsenal with Zeus, if im not wrong, barely messed with it to be honest
Also, thanks again for the help brother
we dont use zeus. isnt it possible to do via init sqf or smth
smth like this:
// banWeapons.sqf
private _bannedWeapons = [
"arifle_Katiba_F",
"srifle_DMR_01_F"
];
while {true} do {
{
private _playerWeapons = weapons _x;
{
if (_x in _bannedWeapons) then {
_x removeWeapon _x;
_x setVariable ["warned", true, true];
_x globalChat "Diese Waffe ist verboten!";
};
} forEach _playerWeapons;
} forEach allPlayers;
sleep 5;
};
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
Use this to share your code here
oh okay
Makes it easier to read
Also, i don't usually mess with the Arsenal and weapons in the game, so i guess the others here can help you a lot more than i can
just limit what weapons the arsenal shows. documentation for ACE arsenal and vanilla arsenal on their respective sites.
where do i limit this?
What do you mean?
When ACE and CBA are running, which one has top priority on handling damage or vehicle damage, for example
we dont use ace
addClassEventHandler will just add the HitPart event handler to all child classes of CAManBase
In that example, it just saves you the effort of manually adding the event handler to all units
While still being able to set local player as the instigator and keeping the code simple
Very nice
Thanks for the help and the explanation
already tried this its not working
Another quick question, if i join my friends on a private server, will the script affect them as well?
did you write the script yourself?
the HandleDamage needs to be run where the entity is local so you should cover that
That's not using HandleDamage, and HitPart should run local to shooter iirc
Depends entirely on how you're running the script
Are you loading it from a mod that only you're using?
oh i was looking at the code posted above
Created a whole pbo for it, only i got it
Then yeah it should be fine
If you want, you could also check the _instigator's steam id and checks if it matches yours
Will do, thanks so much bro
Me, docs and good old AI
chatGPT?
But now the script is all Dart’s
Good, i don’t usually rely on Ai, unless is a language im not used to
have to say im bit impressed that AI created that code. not saying its perfect
But it’s a good helper
Oh don’t put your expectations so high lol
Lot’s of corrections there
The Ai creates some nonsense, just like any other
Deepseek it’s just easier to work with because it’s not so much gibberish unlike gpt for example
I do recommend using it only to help, not to create the whole thing
And yet, me with deepseek still got completely destroyed by Dart lol
I tried using a fully made one
Well, that didn't work, because he was trying to use it with ACE :P
True lol
I tried gpt and the one it made crashed my game, then when it said “oh i updated it” it ended up giving me a permanent error on screen and zero damage to any enemy
Anyways, time for me to go to work, have a good one yall
I've seen some pretty plausible SQF code from AIs recently, so I guess they've been grinding through the git repos.
In the end you've got to understand the platform though. The code isn't the hard part with SQF.
yeah like locality
my Chat GPT is the guys that i know, in Discord, i would never trust any code unless it came from the guys in here
or myself if its easy enough
Thx for the suggestion. That was indeed the alternative I had in mind. The thing is that a big chunk inc the base is executed in the preInit. I hoped to avoid a spawn with a waitUntil, but it couldn't be helped 🤷♂️
You could try it in postInit too
Dynamic Airport Configuration need a little help have all the inputs for the air port
class AirportBase : NonStrategic
{
simulation = "airport";
ilsPosition[] = { 52861.855, 77991.344 };
ilsDirection[] = { 53606.29, 0.08, 77826.59 };
ilsTaxiIn[] = { 53616.027, 77795, 53481.39, 77780.69, 53140.055, 77859.125 };
ilsTaxiOff[] = { 53074.191, 77872.25, 52990.79, 77892.19, 52917.27, 77910.7, 52824.09, 77972.95, 52813.656, 78002.45 };
};
place a carrier under the mapp. so i did (just for blackwasb)
lol under the map lol
yes in eden editor
it works
autopilot for blackwasb can land than
so thats just for cv aircraft right ?
jep.
only jets/planes ho can land automatic on carrier can land there. but u can make a script that everyplane can land there
so i think
ok ill try it out thank you
good morrow? im gonna try learn how this script works and what it exactly does to learn how to do it myself if your around could i ask insights into it?
oh i think i get it, your just making a arsenal that dupes itself to other objects of same class ie "Ammocrates_nointeractive_medium"
oh interesting im curious how it updates is it just checking every single time a interaction happens with it?
alright a tad bit confused on how to use this code
is there anyone around who could help me understand how this code works and what i should do with it
How do I script a unit to be designated by a laser so it can be targeted by data link/IR homing weapons?
Laser targets are objects and you can create them and attach them to things
Unfortunately I can't remember the classnames off the top of my head, but there are a few different ones for different sides; you'll need to get one that's targetable by the desired side
Once attached, you can either leave it alone (for LOS detection only) or broadcast it to the datalink (reportRemoteTarget, and confirmSensorTarget)
"LaserTargetW" for blufor "LaserTargetE" for opfor
Should also mention that IR guidance and laser guidance are not the same thing. Some IR-guided weapons also have laser guidance, but it's not guaranteed. You need to make sure the specific weapon has the correct type of seeker.
Probably, yeah. Need to test it 🤔
I need to make dedi proof little script which adds players individual rating to "overall rating" variable
_scorehandle = 0 spawn
{
missionNamespace setVariable ["kib_score", 1000, true];
while {true} do
{
sleep 10;
private _oldScore = missionNamespace getVariable "kib_score";
private _playerScore = rating player;
private _sideScore = _playerScore + _oldScore;
if (_sideScore >= 900000) then {_sideScore = 900000};
missionNamespace setVariable ["kib_score", _sideScore, true];
player addRating (0 - rating player);
};
};
@cosmic lichen nice, didn't know it existed 👍
Whenever you need to use spawn + while + sleep , check to see if there isn't an event handler that could do that.
sudden memory of "can I have a distance EH?"
DistanceChanged?
yes someone did not want to loop to check if entity 1 and 2 were close
I hope you suggested him to use AnimChanged event handler for that ?
hello: what do i put inplace of the "man" to cover all (Ai and Players)
_unit isKindOf "man"
"CAManBase"
@warm hedge oh cool thx man Awsome
Is there a Lasert target for independent?
try LaserTargetI
Thanks
Is there any way to freeze an object without enableSimulationor simple object? It's a light I want to attach to the roof and it doesn't flash if it's a simple object or enableSimulation = false
@split scarab what object?
Portable Helipad Light
Just attach it to something
Doesn't have to be attached to the roof, it can just be some proxy object that's not going to move. attachTo is pure magic, there doesn't have to be any proximity.
why you want to freeze it? performance gain is almost zero
It doesn't stay on the ceiling that's why I wanted to freeze it in place
If I rotate the object it'll attach to, will the light also be rotated in the same direction?
Depends what you mean.
If you rotate the object after attaching, the light will move with it, no matter what.
If you do a plain attachTo, the light will orient itself to match the object's orientation upon attaching. Use setDir, setVectorDir etc after attaching to adjust its relative orientation.
If you use BIS_fnc_attachToRelative, the light's relative orientation before attaching will be preserved.
I just rotated both upside down and it worked, thank you :)
Is there a way to remove specific weapons from the Virtual Arsenal?
The vanilla one or the ACE one?
vanilla
I don't think there's a blacklist option. You can either list everything or list specified items.
Not even via script?
Hi, I'm trying to run a script where every unit that gets spawned except the player gets money (I'm using GradMoneyMenu), but it's currently not working correctly. This is my code atm:
params ["_entity"];
if (!!isPlayer _entity) then
{
private _randomMoney = floor random [5, 100, 500];
[_entity, _randomMoney] call grad_moneymenu_fnc_setFunds;
};
}];```
Can anyone help? Thanks
I feel like this code is very wrong, but I can't put my finger on where
You could just do setvariable and call it a day.
I used grad money in the past and I didn't even know it had the call functions for adding cash lol.
I'm using GradMoneyMenu because specifically with this script in mind, I can have my players loot enemy AI corpses for cash
Setvariable is the core of the call function, just save time and use setvariable. You also have !! In the if statement which probably isn't gonna work out.
How do I find units that aren't players?
Should work how you have it off the top of my head just remove a ! In the if statement, it only requires one
Is ! the same as not?
It is but !! Won't work as far as I know
I did not isPlayer _entity earlier and it didn't work, it counted players as the units still and reset the amount of money every time we died
Try it as !(isplayer _entity) See if it works that way, I can't see much else unless the call function doesn't work that way.
isPlayer may indeed not be true at the moment the new unit is created, before the player's control is transferred into the new body
also note two !
Also, this EH is going to fire for every single entity that ever gets created, which includes all sorts of shit, not just units. You are going to be adding funds to, like, grenades.
Maybe a killed event handler?
They don't want to add funds to units that died, they want to add funds to units that just spawned.
You should include a check for whether the entity isKindOf "CAManBase" to only apply this to valid units
Is there a better way to code this?
If it was me, I would try a killed event handler adding the cash on death via a
_unit setvariable ["grad_bank_var_idk_it_lol",(50 + random 1000), true];
Something like that.
That's how I handled it on mine for several years I just don't remember the variables.
See the note here: https://community.bistudio.com/wiki/Arma_3:_Arsenal#Remove
To be fair, the forum does look like Microsoft Internet Explorer back in 2001.
Oh no, I want to add it to every living unit as well
For the mission I'm making, I'm also allowing my players to rob living civilians (we're doing a "bad guy" mission)
Every unit except INDFOR
Because we're fighting both BLUFOR and OPFOR
With ACE or scrollwheel?
ACE
The "rob living civilians" system is pretty simple, GRAD Civs allows you to make civs surrender if you aim at them, while GRAD Money Menu lets you take their money while they're surrendered
The only issue right now is actually giving units that spawn money
I was using
if (not isPlayer _entity) then
But it didn't work as intended; every unit gets a randomized amount of money when they spawn yes, but that includes resetting the amount of money the players have every time we respawn
initServer.sqf
{
if (alive _x && side _x != independent) then {
_x setVariable ["grad_bank_cash", 50 + random 1000, true];
_x addEventHandler ["Killed", {
params ["_unit", "_killer"];
if (!isNull _killer && _killer != _unit && isPlayer _killer && side (group _killer) != independent) then {
private _cash = _unit getVariable ["grad_bank_cash", 0];
private _current = _killer getVariable ["grad_bank_cash", 0];
_killer setVariable ["grad_bank_cash", _current + _cash, true];
if (local _killer) then {
systemChat format ["Message", round _cash, name _unit];
};
};
}];
// ace interaction
if (side _x isEqualTo civilian) then {
private _civ = _x;
[_civ, 0, ["ACE_MainActions"], [
"Rob Civilian",
"Take their money",
"",
{
params ["_target", "_caller", "_actionId", "_arguments"];
private _cash = _target getVariable ["grad_bank_cash", 0];
if (_cash <= 0) exitWith {
if (local _caller) then { systemChat "This civilian has nothing left."; };
};
private _callerCash = _caller getVariable ["grad_bank_cash", 0];
_caller setVariable ["grad_bank_cash", _callerCash + _cash, true];
_target setVariable ["grad_bank_cash", 0, true];
if (local _caller) then {
systemChat format ["Message", round _cash, name _target];
};
},
{ true },
{},
[]
]] call ace_interact_menu_fnc_addActionToObject;
};
};
} forEach allUnits;
Could try this. I'm not the best with ACE interactions, but you could use the documentation to make that work specifically if it doesn't.
Most of that is actually unnecessary, since the GRADMoneyMenu and GRADCivs module already work in tandem pretty dang well
Unsure. Never worked with GRAD, just used parameters that are in the docs.
if (alive _x && side _x != independent) then {
_x setVariable ["grad_bank_cash", 50 + random 1000, true];
} forEach allUnits;
Haven't tried this yet
Could try it this way?:
{
if (alive _x && side _x != independent) then {
_x addEventHandler ["Killed", {
params ["_unit", "_killer"];
if (!isNull _killer && _killer != _unit && isPlayer _killer && side (group _killer) != independent) then {
private _reward = 100 + random 500;
[_killer, _reward] call grad_lbm_fnc_addFunds;
if (local _killer) then {
systemChat format ["Message", round _reward, name _unit];
};
};
}];
};
} forEach allUnits;
Again, unsure, as i don't know how GRAD works.
Should I ask in their server instead?
basically haave the same question and not having any luck trying to make a custom Airfield without using a carrier for i still can have the taxi on and off part.
I’m creating a Vietnam scenario and for helicopters taking off, I want to delay a couple so they take off one by one. How can I do this?
I’m no too experienced with scripting so I would appreciate if u tell me where ur gonna need me to place the scripts
Can I have an event handler event handler that fires when event handlers are handled?
You’ll use a small line of code in the helicopter’s Init field to delay its movement.
1. Place each helicopter with a pilot in Eden Editor
Place the helicopter (with pilot) and name the helicopter something like heli1 and paste this into the helicopter’s init field:
this spawn {
params ["_heli"];
private _padBase = padBase;
private _padDest = padDest;
while {true} do {
// fly to destination
_heli doMove position _padDest;
waitUntil { (_heli distance _padDest < 30) || !canMove _heli };
// land at destination
_heli land "LAND";
waitUntil { isTouchingGround _heli || !canMove _heli };
sleep 40;
// fly back to base
_heli doMove position _padBase;
waitUntil { (_heli distance _padBase < 30) || !canMove _heli };
// land at base
_heli land "LAND";
waitUntil { isTouchingGround _heli || !canMove _heli };
sleep 40;
};
};
2. Place two invisible helipads
Place two invisible helipads from the "Objects (Helpers)" category. One at the base: name it padBase and one at the destination: name it padDest for example.
Repeat the same thing again if you're wanting to do it for multiple helicopters.
The while {true} do { makes it so that it's a infinite loop and it'll never stop.
If you're dealing with a light object (such as a blinking or rotating light) and you want it to remain visually animated (e.g., flashing), you cannot set enableSimulation false or use it as a Simple Object, because enableSimulation false disables scripts/animations for the object and Simple Object mode disables all logic/animations to improve performance.
Damn that’s a lot😂 thanks for ur help
Is there a string function like text startWith prefix returning a boolean?
I found nothing in the strings function page, so maybe CBA or whatever native workaround?
I guess there is nothing dealing with regexp?
Oups, I missed
string find [substring, indexStart]
Have a good night/day folks!
Or just "whatever" find _key == 0
ask dedmen kthxbai
Hi 🙂
Does anyone know how to place underwater mines with a script, and get the "Z" right?
Every time I place them, they stick out way too far above the water...
Use ATL or a negative Z with ASL
Oh thanks, I'll check that !
Small question about Missions Parameters (class Params in description.ext). Is there a way to create a kind of presets parameter, one param at the top who will update several ones when changing its value.
I know that I can read the whole params and do whatever I want with them after, but I would like dynamic changes on the parameters page directly. Possible?
Currently I have a "mission type" at the top, that overrides a bunch of params like "respawn type" during the init process, except if this param is set to value "custom". It just works, but checking if I can do better.
How would I access the first soldier in a group via script?
Do you need something else than units _group select 0? Some check on the rank maybe?
no, that should be enough.
ok.
ok I asked wrong. given a player, how can i know his position in his group?
probalby
does it matter?
yes, we hand out helmets with the position as a number on it. need give the right helmet to a player based on his number in the group
private _place = -1;
{
if(isPlayer _x && local _x) then {
_place = _forEachIndex;
break;
};
} forEach units player;```
Something like that (not tested).
will give that a try, thanks!
Looping on all units of the player's group.... then getting the index if the unit is a human player + local to the computer where it runs... to avoid matching another human in the same group.
Code to be executed on the computer who owns the unit. You may need to deal with clientID and owner otherwise.
works. thanks again for the help
Anyone got pointers for how to disable thermal vision on a AR-2 Darter drone after being assembled?
Not exactly the same, but some inspiration...
You may want to test the class of object to target Darter only, because this EH is attached to player.s, not the drone itself. Code not tested yet.
Thank you very much :)
Just check if it's equal to player then
That works but seems less clear about what the goal is
units player findIf { _x isEqualTo player }
Should work
Plus findIf exists as soon as a match is found, so it'll always be less or as many loops as forEach
Could also just do units player find player too
Does anyone know how to change the mission for arma 3 server we want to swap it to freeroam
True
Forgot find has an array syntax ngl
im stuck at zeus
what do you mean by freeroam?
I mean sandbox
hey could someone give me some help understanding how this script works and its utilization
_validItems = keys (primaryArsenal call ace_arsenal_fnc_getVirtualItems);
_arsenalObjectClass = "AmmoCrates_NoInteractive_Medium";
{
[_x, _validItems, true] call ACE_arsenal_fnc_initBox;
} forEach (allMissionObjects _arsenalObjectClass select { _x getVariable ["isSecondaryArsenal", false] == true});
TL_arsenalsTransfered = true;```
someone in the server gave it to me for my arsenal but i want to learn how it works i figured it would make all of that object class have the same arsenal but it doesn't seem to work
@hasty violet thank u
did you define your header class in description.ext?
https://community.bistudio.com/wiki/Description.ext
class Header
{
gameType = "Coop"; // game type
minPlayers = 1; // minimum number of players the mission supports
maxPlayers = 10; // maximum number of players the mission supports
};
not sure which gametype is "Sandbox" but you can look through other missions and see what type they use
it seems that you need to set the "isSecondaryArsenal" variable in boxes for them to work as arsenal
so in init ```
this setVariable ["isSecondaryArsenal", true];
Also read if you haven't yet. https://ace3.acemod.org/wiki/framework/arsenal-framework
in engine, Y and Z are always swapped.
And we go to the effort of always swapping them around the expected way, when passing any coordinates to/from scripts. Unless someone forgets to do it..
Anyone know how to disable TFAR radio when a unit is unconscious or where I can find TFAR documentation? Haven't bene able to find it myself
It disables radio if using ACE Medical but I'm using the vanilla medical system for my mission as we have a lot of new players that aren't used to ACE Medical
https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki
docs are on the github
Yeah it caught me by surprise
Thank you!
https://github.com/acemod/ACE3/blob/2cf57849b6957bda4ca24f6d76f499f0a2788c58/addons/common/XEH_postInit.sqf#L78 Here is how ace does it.
tf_unable_to_use_radio
Java person
Does this 👇 fires when player pressing the R button, or when using the action on the action menu for reload magazine? Or both?
private _ehId = addUserActionEventHandler ["ReloadMagazine", "Activate", { systemChat "reloading!"; }];```
Thanks!
Is it possible to add a while {} do loop on the init of a unit? I'm using a mod's unit spawning module, it allows me to write down a code I want to run on the init of the spawned unit
Basically what I'm trying to achieve is a moving mapmarker on every living vehicle that I spawn
My current code looks like this:
_vehMarkerClassname = format ["boughtVehMarker_%1" , _index];
_vehMarker = createMarker [_vehMarkerClassname, _this];
_vehMarker setMarkerTypeLocal "mil_triangle";
_vehMarker setMarkerSizeLocal [0.6,0.8];
_vehMarker setMarkerColorLocal "ColorGUER";
_vehMarker setMarkerText _vehMarkerClassname;
[] spawn {
while {alive _this} do {
_vehMarker setMarkerPosLocal _this;
_vehMarker setMarkerDir (getDir _this);
};
};
} else {
deleteMarker _vehMarker;
};```
please don't do that in init
make ONE thread that manages all marker for all units 😄
Ah crap, the problem is I wouldn't know the variable names of the spawned vehicles because they aren't made in the editor
while {alive _this} do {
_vehMarker setMarkerPosLocal _this;
_vehMarker setMarkerDir (getDir _this);
};
};
and please add some delay 
You gonns need [this] spawn {
You don't need to. You can find them by other means, for example by filtering the results of vehicles, or by having this module save the reference it already has. e.g.
markerVehicles pushbackUnique _this;
// and in the overwatch loop
{
// some marker code here
} forEach markerVehicles;
Oh right
Does the module indicate whether it runs this init code only on one machine, or on all machines?
It's the Simplex Support Services Logistics module, I dunno
Try hovering over the title of the init field and seeing if the tooltip has any useful information.
If you spawning then by script then you have all variables you need. Don't you?
It just says "Code ran for every item spawned. _this refers to the object, _thisargs refers to any extra arguments passed with the item"
Or you could add them into global array on spawn a then have one thread, which loops through
Super.
Well, I don't really want to go into this mod's code to figure out how it actually works, so there's a limit to how much I can say about it. But the main point is, it matters where the code is executed. If it's executed on all machines, you need to structure it properly to avoid duplication (either by adding a check to only run on the server, or by managing all the markers fully locally). If it only runs on one machine, then you need to make sure that machine correctly gives other machines the information they need.
Oh right
There's two ways to approach an overall looping thread: local management (each machine runs their own loop) and global management (the server runs one loop that broadcasts markers to everyone). In the case of local management, you need to make sure everyone gets an up-to-date list of targets for the markers. In the case of global management, you need to make sure the server's list is kept up-to-date. If the init code only runs on the server, that's easy, but if it runs elsewhere (e.g. on the machine of the player who spawned a vehicle) then it's a little more complex.
Is there a way to test the locality of the module's code
Look in the config. It's under isGlobal
0 is server only, 1 is global, 2 is global+persistent
hey thanks im quite new to this, this makes sense didn't know the systax so started with isSecondaryArsenal = true. does the primary box that i have need a call command too like this setVariable ["primaryArsenal", true];
since it needs to call the function of the virtual arsenal items from the primary arsenal and the keys for each item to send to every box rather than a full arsenal
How do I check the config? Apologies I'm still a novice
Is it in the Splendid Config Viewer?
you can check the dir and params in config iirc
i tried this and it didn't work it just gives full arsenal im not sure what im supposed to do
That's another case of DistanceChanged EH @winter rose we should really have that /s😄
It may not be that simple.
That config controls the module's code that's run for the module's initialisation, but this init field code isn't directly executed by the module's creation, it's executed by the module code when it creates a vehicle through its own processes. It could have its own internal checks and/or remoteExecs that cause this code to be executed on other machines.
I could spelunk into the code or ask in their server
if you have a DS or a friend available for a quick test, you can check yourself:
private _text = format ["init code was run on machine %1",clientOwner];
_text remoteExec ["systemChat"];```
Oh thanks for this! This might be able to help me kill two birds with one stone, since I've been having issues with locality for scripts using that module
:U
you can add them to some kind of array
I would recommend markers to be local as to not use network for it
hey Lou when you have a minute do you know what i do to call my primary arsenal object or is there code i write per item inside the init of the game via the keys of the items?
i get the context of the script but the formatting is not something im adept in yet
what is a "primary" arsenal object?
its the object that gets the virtual items on init to distribute that data to all "secondaryarsenals" essentially duplicating a specific arsenal to all of that object class of my choosing
but im having a hard time declaring a box as the primary arsenal object and so my secondary arsenals end up just having full virtual arsenal rather than a limited one
I, huh, would have no idea
no problem thanks for taking the time regardless
if my way of describing the issue is poor too please lmk how to improve
Wait @echo nebula are you using a limited arsenal of some sort
i am attempting to
What are you using?
the function?
im using ace's "ace_arsenal_fnc_getVirtualItems"
Oh
oh no lol im manually trying to do it haha
so i can update 1 arsenal and it will update all of them
im trying to do small projects scripting wise to learn and then work my way up and this helps my server
Maybe you could post the code you have so far for it?
i already have i don't want to be obnoxious and post like 3 times an hour
ill just direct to it
Ohh ok
this
its not mine it was written by someone else aiding me and i actually understand now how it works but my issue is mostly to do with navigating how it identifies or how i identify the primary arsenal
Oh I see
maybe on startup i tell the box to boolean the _validitems?
that way it triggers the function to get the item list or "keys"
the code you posted would go to init.sqf (or whatever is suitable for arsenal init) and every crate you want to use should have the "isSecondaryArsenal" variable set
thanks! im unsure what init.sqf is to be truthful, i also did the isSecondaryArsenal variable and it gave a full arsenal rather than the keys from the arsenal i have limited is there something i need to do to direct to the arsenal i have chosen?
init.sqf is a script located in the mission folder. It runs on every machine during mission initialisation.
@echo nebula well i dont really know how ACE arsenal works, i was just reacting to the code you posted
thanks i appreciate the help
i haven't touched init.sqf yet or folders outside the game with script yet to be truthful im nervous on that front
you have to run your script somewhere, dont worry
well ive been running them currently inside the eden editor in the init section
right
and i guess the code i have im confused about how it finds the information from the arsenal the whole keys section confused me
yeah i was bit puzzled as well but i dont know ACE so
i see the documents area for the mission sqm
thanks im still very new trying to learn appreciate the help even tho its confusing
what is a createHashMapObject?
im trying to understand all this lingo, is a hashmap just a database of all information a object has?
a hashmap is an object storing data as key→value
hashmap.Get(key) returns value
(oops, my Enforce Script leaked here)
so maybe i could get a hashmap of the data from primary arsenal -> then i could inform the init through _foo?
whats a hashmap typically used for? like examples of its utility
Store some data into a key. Like, I want to store some planes magazines inside a key called "GBU", and some other magazines in "Rockets", and in a script I would get the key to get the data from it
interesting that makes sense categorizing the data
the first section having "_validItems" makes sense now we use a hashmap on the primary arsenal to declare it as "_validitems" and then the code on init will work?
like it stores data from the ace function -> we take that declare it as _validitems and then the script goes wild with that?
2 iq thinking im 10 iq XD
could i theoretically use a event handler on the object to declare that when it opens to call _validitems and it does the function i want?
im so out of my depth with this i just don't get it, im trying to learn this hashmap stuff or look at all the ace functions or learn how to declare _this = "foo" i just dont get it i guess ill come back later when im less fatigued
You don't generally want to start by reading ACE code :D
What's a better way to do this? (Disabling TFAR radio if unconscious and enabling if conscious)
It works but "detatches" from the player after respawn
initPlayerLocal.sqf:
[player] spawn {
params ["_player"];
_player setVariable ["tf_unable_to_use_radio", false];
while { true } do {
systemChat format["Conscious check: %1", _player];
sleep 0.5;
if (incapacitatedState _player == "UNCONSCIOUS" && !(_player getVariable "tf_unable_to_use_radio")) then {
_player setVariable ["tf_unable_to_use_radio", true];
systemChat "Disabled radio";
};
if (incapacitatedState _player == "" && (_player getVariable "tf_unable_to_use_radio")) then {
_player setVariable ["tf_unable_to_use_radio", false];
systemChat "Enabled radio";
};
};
};`
You can attach it again from EH on respawn.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Respawn
Yeah, this stuff is quite overwhelming at first
Also you should probably do while { alive _player } do {, so the thread finishes executing after player dies
Yeah haha literally just noticed and changed it, gonna test with the same script in onPlayerRespawn.sqf
Should probably put in yet another feedback tracker request for an unconscious EH :/
AnimStateChanged EH 
There are so many animation state changes that it's probably slower than polling the damned thing :P
yeah I meant as a workaround 😅
Has anyone ever evaluated the utility of a
A) speedChangedEh
B) player forceProne true; (Same as forceWalk but for prone) (Yes I know it can be done via AnimStateChanged EH but also a expensive workaround) Basically to simulate a player with broken legs until healed
speedchangedEH?
Yes, triggered when a unit/vehicle changes speed. Useful to determine if a unit reached certain speed or if it moved at all
I don't see its use case
why force someone to be always prone or even crouched?
Basically to simulate a player with broken legs until healed
ah this
To simulate a damage state between unconscious and not so wounded... emulating for example how many extraction shooters allow the players even on a "downed state" to move around crawling or prone
well technically you can create your own animation states for that (you can use vanilla rtms tho)
if you chain them together without linking to vanilla ones the unit won't be able to go to another state except those you link to (basically traps the unit into a specific network of anims)
Yes, there are even mods for that but... a command would be simpler 😅
Would also be useful to simulate ai units being suppressed, forcing them temporarily into forced prone or croush
There are many many use cases really
Ai units do get suppressed
It's a vanilla thing
Also setUnitPos(?) exists for AI to force them into a certain state
addForce to make them collapse >:)
From the Wiki comments: "A unit might not always go prone when ordered to setUnitPos "DOWN", if the unit doesn't agree with the command."
A little bit too harsh for just being suppressed
Vanilla suppresion lowers their skill I believe but doesn't force them into prone/crouch
hey yall literal first time doing anything arma scripting related or just coding in general. I'm trying to make this script have there be multiple sidechat messages (one after another), how would i do that
You can just add ; and another sidechat just like the previous one as many times as you like but the UI can only show so much text before it is replaced by newer text
another way would be to use spawn instead of call so you can space them with a sleep like so:
0 spawn {_soldierOne sideChat "Show this text"; sleep 1; _soldierTwo sideChat "Show this text"; sleep 1; _soldierOne sideChat "Show this text";}
or you can continue what you are doing like sqf call {_soldierOne sideChat "Show this text"; _soldierOne sideChat "Show this text"; _soldierOne sideChat "Show this text";}
But all the text will come up at once
how would I set a longer interval between the texts here?
change sqf sleep 1 to sqf sleep 100
The amount of seconds you want
But using spawn
alr ty
Way back in OFP days, any unit with injured enough legs was forced to prone 
Well, that can no longer be done in Arma 3 unless you mod your own animations in
Just use player playActionNow "PlayerProne";
if the player has a certain damage value, and then block the input actions: Stand, Crouch, Prone, MoveUp, MoveDown
Player draws RPG, moves to crouch? :P
How does cursorObject work in multiplayer? I'm trying to make it so that players are supposed to spot a radar, and I know it works in singleplayer, but how does it return in MP?
I'm doing this through a trigger with condition cursorObject == obj1
Is it possible to determine which player's cursor is over the radar?
triggers are executed on each client, unless Server Only
VAL_fn_aiMovingThoughBuildingsFix = {
params [
["_unit", objNull, [objNull]]
];
onEachFrame {
if (insideBuilding _unit == 1) then {
if (isTouchingGround _unit) then {_unit setVelocity [0,0, -1]};
} else {
onEachFrame {};
};
};
};
☝️ Will this effectively remove the onEachFrame {} when the unit is not inside a building?
well yes
it is recommended to use the EachFrame event btw
it will work for only one unit, and onEachFrame does not see other variables
so it won't work 😄
Good to know, moving on the EachFrame EH then 😉 Thanks
PS: I know it is very expensive so I will use it on few units only
only one event, check on multiple units at once
I guess I could also try to use the animationChanged EH and check only every time they change animations
would be less expensive and might be as effective
if you want to paralyse them when they enter a building… why not simply disableAI?
Well the function is meant to avoid the ai falling under the building or getting stuck
last time I tested the Ai could still move
Its been ages that I tested it, I am just redoing most of my old scripts and some might no longer work
disableAI works fine, I use it a lot
Yeah, I meant Ai could still move with sqf if (isTouchingGround _unit) then {_unit setVelocity [0,0, -1]};
disableAi "PATH" works great if you want them to still turn and fire. disableAi "Move" is stronger
Hi all. I've been working on a full mission where all you have to do is put down a unit and copy files and run. Everything is there. I was wondering if anyone knows if it's possible to copy the contents of the entire mission folder to run with playScriptedMission to a new world?
Looking for arma 3 server dev
you can advertise in #creators_recruiting (following the template), even non-paid
Would anyone happen to know why on my dedicated server, I can heal people/rearm vehicles in Zeus using Zeus Enhanced (I think?) but my friend also using Zeus cannot? I'm typically logged in as admin but he can't do it even with admin
And does anyone know how to let spectators hear TFAR radio comms, not just proximity? And how to remove a specific radio from Zeus? :)
that would eventually be #arma3_troubleshooting , not scripting 😉
Fairs, for all 3 questions?
You cannot play/edit this mission; it is dependent on downloadable content that has been deleted.\na3_characters_f pulled theese from server logs, any idea?
Fake error. Your problem, whatever it is, is elsewhere.
Also i get Server error: Player without identity
no functions are working because of that error
This is probably not a scripting problem.
Does it say literally na3_characters_f, or is it actually a3_characters_f?
If the latter, try verifying your game files (and the server if it's impacting other people on the server, not just you). If the former, ✨ mod problem ✨
Na3 it says
But my main issie is that it shows player without idenity
@hallow mortar gonna go insane soon trying to figure it out for 2 hours straight
These are probably both symptoms of the same problem
Verify your game files anyway
Also try without mods, with a known good mission file, with a fresh empty mission file.
@hallow mortar thanks, i will give it a try
@cosmic crater well what i do if i want to move a mission to a new map:
i just change the folder name from A3-Jets.Altis To A3-Jets.Stratis
and then ofcorse you must go in the mission
and reset all the stuff to the places you want
but as far as playScriptedMission to a new world,, i dont know how to use that
i have seen missions where eveything was scripted to find locations and had many maps in it for use, but that takes alot of scripting, and yes it can be done
like the DEP mission
its a cool mission but i have to edit the hell out of it to fit my needs
is there any config properties to determine if something under cfgweapons is an infantry weapons?
type being 0, 1, 2 or 4
thx
Is there any way for AI to detect "oh shit I'm being shot at" even if it's by a friendly?
Ideally I want a line of script that checks,
- When someone is being shot at
- If the AI knows what
jerkwadis shooting at them - What side
jerkwadis on, East or West
and then finally, do something based on the outcome of if their side is the same as your side or not.
I observed AI behavior where I started shooting at indep as blufor, both friendly, trying to scare the AI into going into combat mode since I do know how to trigger scripts based on CombatModeChanged. The AI moved to my position after I finished shooting and missing them, so they know something's up. The use case is I am trying to make a group of AI set the person shooting at them to a renegade even if they don't hit anyone—ideally only if they actually identify who is shooting them.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#FiredNear but i dont know about friendly fire
Problem with FireNear is, max. distance ~69m.
I would use a combination between firedNear and Hit EH, not perfect but better than nothing.
Suppressed EH would be ideal except it only considers enemy fire
Sup guys, can someone tell if it is possible to make a script that gives me both bullet instant hit and no weapon spread?
In a way that would work on my local player
@tough abyss UI != GUI
what you need is just some way to do that stuff
recommended: simply add some simple keys for detailed adjustment and the rest: 3d space movement
you can speed up the projectile or teleport the projectile or something like that.. idk if 'instant' is attainable
speeding it up would probably get u the simplest result but idk what the engine limitation is there
Would work, how can it be done? I have the CBA mod
'Fired' can get u the projectile object and you can set the velocity of it
Anyone knows if sqf addMissionEventHandler ["PreloadStarted"
Runs before Mission Params in Description.ext or after?
Nice, thanks man, what about a no spread?
probably need to edit config which requires making a mod
Like a whole pbo file?
the Description.ext is run before scripts are run
A Function from a config with preInit would run before Description.ext thou, right?
Absolutely right. How do I write Gvars from a mod but allow the mission params to overwrite the default Gvars values then?
You wait until the mod has defined them and then overwrite them.
I see, so no there is no way of doing that in unscheduled...
thank you
My mod will imitate CDLCs so no CBA sadly, would be cool thou
I will just go scheduled
you can write your own CBA_fnc_waitUntil
it's a bit more but yeah 😅
Not necessarily.
If he only wants to check one condition
If he wants to build a framework like CBA's then of course it's more work.
hey guys the attachTo command says the offset is applied to the objects center, does that mean [0,0,0] in model co-ordinates or is it the position that the command boundingCenter returns?
Example for the hatchback on what boundingCenter returns. Its a very small amount but I need to know as im doing some work that requires precision.
[0.0344856,0.118506,0.561098]
It's model coordinates
PositionRelative = model offsets
Generally boundingCenter doesn't matter for vehicles, because their model gets automatically recentered on load.
Buildings are another matter. I'm not sure what attachTo uses there.
ok I was just curious because I was getting minor discrepancies in my logic for making vehicles go bumper to bumper of around 0.1 sometimes or 0.27 others and wanted to know if this could be the cause. thanks for the info.
If anyone does know would greatly help thanks
Was that using data from boundingBox(Real)?
yes I am using this command to get the bounding box of the vehicle ´boundingBoxReal [_loadVehicle,'geometry'];´ as it seems to provide the closest correct bounding box.
A question on that command with these parameters, do you know where the center of orgin comes from? Because on a hatchback for example you get this
[[-0.989059,-2.52638,-1.36978],[0.905163,2.20161,0.264737],2.38464]
As you can see for the Y co-ord, its not even so the center the command measures from is not central to the model which is frustrating. I was just wondering if anyone knows what the origin point is based on?
right I get its from model space co-ords but is it from [0,0,0] or from the boundingCenter position, or the center that boundingBoxReal gives. Im also wondering what the center of BoundingBoxReal is explained above
It's from the model center, so wherever [0, 0, 0] is
(or from the given bone, if set)
BB Center might be an offset from center of mass
Might be qeustion for #arma3_model
ill ask in #arma3_model but any idea for bb real? that cant be center of mass unless its wrong for the hatchback lol. THe engine is in the front and the point it originates from is towards the bck by 0.3 meters from center
I asked here because model people might not even know of the commands if they focus on model and config
They will know.
boundingCenter is different from [0,0,0]
attachTo uses [0,0,0] in model space (model coordinates origin is always [0,0,0] ofc, just like world coords)
any idea what this or BoundingBoxReal centers are then? See your answering in model chat ignore here. 🙂
Hi everyone. I'm back again with a different question.
I want to make a point in my mission where players can use (for example) a tent to skip time. I saw a reddit thread reference this code:
this addAction ["skip 5 hours",{SkipTime 5}];
Which in theory should work. But I wanted to double check that this action is in-fact repeatable?
yes
Great
Note that skipTime needs to run on the server.
(so this code wouldn't work in multiplayer, except for the host)
Though I will say, I probably need to just handle it zeus-side considering my playerbase. They'd abuse the shit out of a button like that.
skipTime needs to be executed on server regardless
all arma playerbases tbh https://www.youtube.com/watch?v=Cwa4_pjLAWs&feature=youtu.be
Yeah. Gonna handle it zeus side
"K everybody nappy time"
"I SAID"
"NAPPY. TIME."
Is it possible to "override" this spectator button somehow so it toggles ACE Spectator on/off instead of the vanilla spectator? With vanilla spectator you're just stuck 1st person view from your body
I'd like for player to be able to spectate their own team while they wait for respawn
Hey folks,
am I lucky and somebody already did some legwork with the new ACE function that attaches IR Lasers on vehicles?
I wanted a drone that is loitering in the Air targeting Targets on the ground and marking them with the IR Laser.
My idea is this:
droneVeh disableAi "AUTOTARGET";
droneVeh disableAi "AUTOCOMBAT";
droneVeh disableAi "FSM";
droneVeh lockCameraTo [truck_1,[0]];
droneGrp enableIRLasers true;
droneGrp setBehaviour "COMBAT";
droneVeh fireAtTarget [truck_1,"Laserdesignator_mounted"];
While the targeting works, the activation of the IR Laser does not happen. Also, if I switch it on manually by taking UAV turret control, it uses the laser and it is also visible for the Player on the ground, but after I release the UAV controls it will only stay on for a few seconds and then be switched off.
I didn't find to much in the ACE documentation and got lost in the ACE Github so I was hoping somebody here already worked with that function and might be able to help.
You can try to configure vanilla spectator https://community.bistudio.com/wiki/Arma_3:_End_Game_Spectator_Mode#Mission_Configuration
Ooh that works yeah! I don't suppose you also know if there's a variable or setting somewhere for whether or not NVG/Thermals are allowed during spectator?
I believe at least at first person this depends on whatever player being spectated is using and cannot be controlled by spectator nor mission maker
is anyone here knowledgeable about ace i asked about ace related questions previously and i still use it extensively for my zuesing and eden editing and would like some guidance on working some problems i have/things id prefer to script and not have to manually do in missions for my players
When i pick role and after i load in i get a black screen, but cant figure out whats wrong, ill leave log files here https://logpaste.com/Tg0oLHmC
Just ask, http://dontasktoask.com/
ACE discord is also a good place
oh good call i didn't think that was a thing truth be told
well i guess i want to fix this arsenal script i have and i got no clue how, i also want my players to be able to purchase vehicles of my choice for objects in game like you construct a vehicle at a sign and it costs 3 boxes
Do you know about Liberation?
im aware of it but id rather have it be a personal project, we worked on events like this before i just want to be able to automate some stuff but i don't like the stuff that comes with liberation or antistasi
I'm talking about taking a look into their files and see how they do some stuff rather than just reinventing the wheel again
you got a good point, im not knowledgeable about how to do that but it makes alot of sense and ill def investigate it tyvm
it was a game changer for me, I learned a lot
ty ill be sure to do that
want to let yall know that i solved the issue with my arsenal i had to use a cba function to wait until the map had loaded and the objects loaded before i ran my _validItems script 😛
ty yall for the aid!
What are the return values of a Zeus module? e.g. If I had a custom zeus module and placed it on a unit via Zeus, how do I get the unit it was placed on? Or do I define that when creating the module. Not sure if that makes sense.
You need to define an EH to the curator module
You can just set curatorCanAttach to 1 in the module's config, and then just check attachedTo _logic
E.g. something like:
params ["_logic"];
if (!local _logic) exitWith {};
private _unit = attachedTo _logic;
if (isNull _unit) exitWith {
[objNull, "Place on a unit"] call BIS_fnc_showCuratorFeedbackMessage;
};
hello all: So if i set the Fog on a Hosted Server in The initServer.sqf to WhatEver i want,
do i need to set the Fog in the initPlayerLocal.sqf and the init.sqf also
oh ok cool : thx @cosmic lichen so i was woundering if some one joined later
apologies if this isn't the place to ask this, does anyone know of a cheeky little line of code I could use to disable ace3 fatigue on a single player in a multiplayer environment (dedicated server, if that changes anything)
going to bed, so @ me if anyone has an answer, cheers 
Just disable it in the settings
and also player enableStamina false;
player enableFatigue false;
eh, I could
we usually play with stamina and all that, I'm looking at making one player in each squad an experimental heavy weapons droid, so I'd ideally like some way to disable stamina for just them
oh for real? my code monkey was telling me that wouldn't work with ace
must do both
copy, appreciate it
settings and p10 enableStamina false;
p10 enableFatigue false;
Change performance factor in Eden properties
ACE doesn't check for vanilla stamina being enabled / disabled at all
agree
Not sure if advanced_fatigue replaces or runs on top of the vanilla system
In any case, just change the unit's performance factor through Eden
If you want something more dynamic, you can look into adding a dutyFactor that checks some part about the unit
["TAG_isWeaponsDroid", {
// -5 is a random value, can tweak to whatever you want
// duty factor of 1 means no change
[1, -5] select (/* check if the unit is a weapons droid */);
}] call ace_advanced_fatigue_fnc_addDutyFactor
That wouldn't make it dependent on whatever slot a player picks, which you may or may not want
nice looking script @tulip ridge
Hello everyone, I'm trying to make a mp mission for me and my friends to play on a private server. I created easily a sandbox mission with zeus but now I'm trying to launch random objectives in the mission with scripts. I don't really know how to script so I used ai to create it but it's quite hard. Can someone help me please ? 🙂
I published the mission folders on GitHub https://github.com/Jozoooooooo/MISSION/tree/main/SANDBOX%2520AUSTRALIA.australia
If it's not the place to publish this I'm sorry and I will delete it immediatly
Link is a 404, I guess github urls allow the space instead of using %20?
And now it doesn't have the space
Weird
That still 404s, both
Anyone know if using the unit capture script, I have a NPC do its thing, if I enter that NPC as Zeus will it override the unit capture? I want to use the helmet cam mod to get seamless stuff (since you can’t do a lot of stuff with helmet cam)
discord formats it lol
I guess GitHub is %2520?
https://github.com/Jozoooooooo/MISSION/tree/main/SANDBOX%2520AUSTRALIA.australia/objectifs
Ah, yeah it changes the %2520 to a %20
I copy the permalink maybe it will work for you
its fine just link to https://github.com/Jozoooooooo/MISSION/tree/main
Oh yes, thank you !
The server run but the scripts for launching random missions are not working good at all
Well these scripts can't work as they contain commands that don't exist.