#arma3_scripting
1 messages ยท Page 124 of 1
to what _pos?
_missile setPosASLW (_pos vectorAdd [0, 0, 45]) ; should do the trick
still no luck
if (( getposasl sub) select 2>=-3) then{
private _pos = launch modelToWorld [0,2,1.6];
private _missile = createVehicle ["ammo_Missile_Cruise_01", [0,0,0], [], 0, "none"];
_missile enableSimulation true;
_missile setPosASLW _pos;
_missile setVectorDirAndUp [[0,0,1], [1,0,0]];}
else{ private _pos = launch modelToWorld [0,2,1.6];
private _missile = createVehicle ["ammo_Missile_Cruise_01", [0,0,0], [], 0, "none"];
_missile setPosASLW (_pos vectorAdd [0, 0, 45]);
_missile enableSimulation true;
_missile setVectorDirAndUp [[0,0,1], [1,0,0]];
}
There is a } too many
yea fixed it in init
my issue is what happens on else. I want the missile to spawn on the water surface rather than on the reference point named launch
private _pos = launch modelToWorld [0, 2, 1.6];
private _missile = createVehicle ["ammo_Missile_Cruise_01", [0, 0, 0], [], 0, "none"];
if ((getPosASL sub) select 2 >= -3) then
{
_missile setPosASLW _pos;
}
else
{
_missile setPosASLW (_pos vectorAdd [0, 0, 45]);
};
_missile enableSimulation true;
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
looks nicer let me try it
It's the same code
Just removed the duplicated lines
So basically two cases
If submarine is submerged, spawn it on the water surface (ASLW = 0)
if submariine is above water line, spawn it on the launcher?
This is the thing I want to achieve cause still it spawns at the oil stain
should I try to make it [0,0,0] instead of (_pos vectorAdd [0, 0, 45])
no that would spawn it at these cords
Yeah, that's a bit tricky. There are different position formats involved. I am not doing that too often.
private _pos = launch modelToWorld [0, 2, 1.6];
private _missile = createVehicle ["ammo_Missile_Cruise_01", [0, 0, 0], [], 0, "none"];
if ((getPosASLW sub) select 2 < 0) then
{
//Submerged
_pos set [2, 0];
_missile setPosASLW AGLtoASL _pos;
}
else
{
_missile setPosASLW AGLtoASL (_pos vectorAdd [0, 0, 45]);
};
_missile enableSimulation true;
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
https://community.bistudio.com/wiki/Position#PositionASL Have you read this?
yes
sub = vehicle player;
sub allowDamage false;
private _pos = sub modelToWorld [0, 2, 1.6];
private _submergeThreshold = -1;
//private _pos = launch modelToWorld [0, 2, 1.6];
private _missile = createVehicle ["ammo_Missile_Cruise_01", [0, 0, 0], [], 0, "none"];
if ((getPosASLW sub) select 2 < _submergeThreshold) then
{
//Submerged
_pos set [2, 2];
_missile setPosASLW AGLtoASL _pos;
}
else
{
_missile setPosASLW AGLtoASL (_pos vectorAdd [0, 0, 45]);
};
_missile enableSimulation true;
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
This seems to work.
So highest is -3?
Then you need to adjust _subMergeThreshhold
So I'd set it to -4
How do I create custom values? So in a trigger using an if I let the other trigger know that something is true, and if its true trigger activates. If its isnt it wont....
I tested it after setting the threshold to -4
On surface and in depth it made the missile shoot 45m above sub
I mean the variables
1st trigger:
if (triggerActivated trg7)then {LZ = true;}else{to be added;};
2nd one activation:
LZ = true;
and it wont work
on second try LZ == true
LZ=true tells him to have an LZ value that's true
== is the equality operand
found the issue the HAFM sub is always telling that it's on Z=0
It works partly now. Everything will work as intended ONLY when the player activates trg7 before performing another action that activates the trigger with if. But if player will activate the trigger with if without activating trg7 before, the text message wont show up.
I swear to god that those little things make arma very irritating
fuck it. Im not wasting my time on this shi
Is it possible to spawn my own explosions with a line of code?
It's usually done by spawning ammunition and then detonating it.
Would it be big enough? I just want is for visuall effect and nothing with demage
I want it to be big
That's more custom particle effects, but that's certainly not a one-liner.
boom = "bo_gbu12_lgb" createvehicle getmarkerpos "marker_0"; Any idea how I can make it bigger?
I'm looking to have custom black bars like the cinematic ones creep up from the outside of the screen for a mission title. Is there any way to animate a cutRSC with like, scale, or moving a pair of them up from the bottom and top of the screen?
The existing cinematic mode function kills access to controls and the bars are too big.
is there any mod that lets you auto crawl? similar to auto run but for proning and crawling?
can you create a while statement that only activates after a certain check?
null = executioner1 spawn {executioner1 dotarget execute1; sleep 1; while {alive chinaman_executed1} do {firingsquad1 action ["useweapon", vehicle executioner1, executioner1,0];}};
I've tried adding a ceck for a certain trigger having been triggered into the while statement check as well as wrapping it in an if statement. My issue is it runs regardless if a trigger has been run or not and I've tried a bunch of different ways to figure out if the trigger has been auto triggering. The trigger isnt triggered but the script is running anyway so the rifleman is shooting as soon as he loads in rather than waiting for the trigger.
Its a scene where a rifleman is shooting at an object embedded in a wall behind their target (Execute1) its a sandbag. In front of it, his target (chinaman_executed1). I've done it this way because they were inaccurate when they tried to actually target the individual npc. Anyway, is there a way I can get this script to not run until the trigger is properly triggered? (Its a scene where the player passes and can witness the execution during an on the rails transport segment.)
the script is from a youtube video for setting up an AI firing range
This is an Arma 3 Eden editor tutorial on how to make an Ai unit shoot at a specific object/target.
Copy & paste the following into the units init:
null = this spawn {_this dotarget t6; sleep 0.5; while {alive t6 and alive _this} do {sleep 4; gl action ["useweapon",vehicle _this,_this,0]; }};
โข Change t6 to what ever you have called the targe...
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
What R3vo said (this is what the trigger On Activation field is for); if you really want to use purely scripting outside of triggers, you probably want waitUntil
If you use the On Activation field, you don't need waitUntil to wait for the trigger to be activated, because On Activation already takes care of that. That's why I said to use waitUntil if you want to work outside of triggers.
I'm trying to get and keep the relative position and rotation of an object to the origin object, the positioning works fine but I can't get the rotation using vectors to work out right. It's probably just from my lack of understanding vectors but even after 8 hours of re-learning vectors I'm still failing to get this working right.
params ["_originObj","_subjectObj"];
//-- Relative Positioning
private _relPos = _originObj worldToModel getPosATL _subjectObj;
//-- Relative Rotation
private _originVectorDir = vectorDir _originObj;
private _originVectorUp = vectorUp _originObj;
private _subjectVectorDir = vectorDir _subjectObj;
private _subjectVectorUp = vectorUp _subjectObj;
private _diffVectorDir = _originVectorDir vectorDiff _subjectVectorDir;
private _diffVectorUp = _originVectorUp vectorDiff _subjectVectorUp;
while {alive _subjectObj} do {
//-- Set Relative Pos
private _newRelPos = _originObj modelToWorld _relPos;
_subjectObj setPosATL _newRelPos;
//-- Set Relative Rotation
private _originVectorDir = vectorDir _originObj;
private _originVectorUp = vectorUp _originObj;
private _addVectorDir = _originVectorDir vectorAdd _diffVectorDir;
private _addVectorUp = _originVectorUp vectorAdd _diffVectorUp;
_subjectObj setVectorDirAndUp [_addVectorDir,_addVectorUp];
sleep 0.001;
};
i haven't the slightest idea how to do that. Where would I be storing it?
vectorWorldToModel and vectorModelToWorld
Also getPosATL does not give an AGL pos
You should use getPosWorld/setPosWorld
(use ASLtoAGL to convert to AGL)
what is the first moment when player joins server? like when is the player object valid in server
i thought maybe initPlayerServer.sqf but not sure
would init.sqf be best place for that?
Nope, you need a function that runs from preInit to catch players that aren't JIP in that
does BIS_fnc_holdActionAdd have hard limit for distance check (50m) ? Can I reduce this distance to custom ( lets say 3m from object ) like with addAction ?
wiki
It doesn't have a specific distance parameter like addAction, but you can include a distance check as part of the condition, e.g.
"(_target distance _caller < 10) && {alive _target}"```
I think it does use addAction somehow internally, so the 50m hard limit is probably still present, but I haven't tested
Is it possible to do a script that will force the AI to wait for the player team to get into helicopter? If I will sync "get in" and "load" waypoints AI just waits for the player and then flies away
Maybe the third time will be the charm. Is there any information on how best to display a set of cinematic bars without locking out user controls?
They're going to be driving, even a second of lockout could kill a dozen people.
if !(isNull objectParent player); But how do I make it that if will play another waypoint????
person in vehicle;
in a trigger
found it
what is this used for: sqf _unit modelToWorld (velocityModelSpace _unit) ?
I found it like this on a script:
_agent setDestination [_target modelToWorld (velocityModelSpace _target),"LEADER PLANNED",true];
velocity vector?
SPE
whats the best way to get a list of dead vehicles (excluding bodies)
allDead - allDeadMen?
vehicles select {!alive _x}?
Large array subtraction can be brutally slow, so the second might be better.
Although I don't know if vehicles includes dead vehicles.
is it possible to set the _frame number in a BIS_fnc_holdaction?
can an attached FSM on a unit be disabled later?
For Example:
_unit execFSM "A3\Modules_F_Tacops\Ambient\CivilianPresence\FSM\behavior.fsm";
During the mission:
if !(isNil {_x getVariable "hasTarget"}) then {_unit execFSM "";};
How?
I don't even know how to test if it worked, as the civ fsm is so minimalistic
how many units did you test it with
you could probably do 22 by hand pretty quick lmao
test with 1000 alive and 1000 dead
ok
and
test at extreme highs
Unrealistic scenario is good to test
not at extreme lows ๐
300 - 100 is realistic.
But if you're using low object counts then it doesn't much matter what you use because it'll be fast enough anyway.
sizes?
102 - 102?
You keep quoting one number without saying what it is. That's meaningless.
1200 alive, 1200 dead
allDead select {!alive vehicle _x} 0.7341 ms
allDead - allDeadMen 9.0621 ms
told you so.
not dead units?
cc @pulsar bluff
Well, arr1-arr2 is O(n^2)
dont use the scheduler
unless for some ungodly reason you decide to use allDead - allDeadMen
overuse of the scheduler just fucks up mods which actually need to use the scheduler
no
especially given as when you test it in paused debug menu the game simulation is also paused 
I don't think diag_codePerformance gets paused by the scheduler.
well then thats a bit silly isnt it
youre testing the performance of your code not your computer
what on earth are you on about
test your code properly
simple as
which in this case has proved precisely what john said
(almost as if he knows what hes talking about)
i dont want to get technical because the point is proven
and i dont care
take the l from your online internet argument about which number is bigger and move on
how many arma mods have you published
so you have no quantified experience scripting in arma
thus your opinion is null and void
take the l and move on
and do stop tagging me
its incredibly irritating
maybe dont try and come and throw your weight around while arguing with experienced scripters
just a thought
refer here
i dont repeat myself often and im not making an exception for you again
stop tagging me
dear lord he left over being wrong
christ
Quite a drama to quit the server or even the game because of one opinion from one person you can't agree
Just thought about it. If particles can be grabbed into scripting variables, why not make a drop command version that returns the particle?
How about:
ENTITY = drop ENTITY
where operand is particle source
Might be a hassle to setup a particle source if you need only a single particle though ๐ค
To keep backwards compatibility of drop returning NOTHING there can be new binary command:
ARRAY = NUMBER drop ARRAY
NUMBER is number of particles you want dropped this frame
ARRAY operand is particle array
ARRAY return is array of made particles
1 drop [...] for a single particle
ARRAY = NUMBER drop ENTITY to source particle array from particle source too
To avoid creating and sending huge array into the command and then having the engine parse it each and every time
could same some microseconds in a long run
BUT being able to drop them exactly when you need instead of regular timer that particle source offers
Maybe spawn number nad array\source around so its more readable, used right operand in example so its in line with existing command
nearEntities in its Syntax 5 form ```sqf
area nearEntities [types, matchExactType, aliveOnly, includeCrew]
Is giving me a "5 elements provided, 3 expected error"
What is your code
full script: ```sqf
private _inAreaHearing = [_x, _infectedHearingRange, _infectedHearingRange, 1, false];
_potentialTargets = _inAreaHearing nearEntities [["CAManBase","LandVehicle","Dog_Base_F"], false, true, false];
That's labelled as a 2.18 syntax so it may not be available in your build
When using remoteExec and JIP do you need to remove previous remoteExecs before making a new one?
like I have this code ```sqf
disc = discounts remoteExecCall ["onDiscountsUpdate", _side, true];
should I do remoteExecCall ["", disc ]; first ?
Remove... what?
the JIP queue
I'm not sure what onDiscoundsUpdate should do but I think just execute locally and let local computers refer to publicVariable'd variable
Id like to use the current approach
Then disable JIP queue and call upon somebody JIPs
my question simply was will new remoteExecCall JIPs override previous remoteExecCall calls
Oh wait yeah, just realized you can actually remove JIP queue
is there a way to use modules to fail the mission for OPFOR and succeed the mission for BLUFOR?
JIP (Optional, default false):
- String:
- else the string is treated as a custom JIP ID and the remoteExec statement is added to the JIP queue, replacing statements that have the same JIP ID
I think I can read what you say is true. Need a test to confirn on my end though
If you mean End Scenario module, it seems that's a no. BIS_fnc_endMission instead
will look into that
so i would do something like
{
[ OPFOR failure function variables] remoteexeccall ["bis_fnc_endmission", _x, false]
} foreach units east;
{
[ blufor Success function variables] remoteexeccall ["bis_fnc_endmission", _x, false]
} foreach units west;
or did i read the Biki wrong?
Don't think your idea is semantically so wrong
heres hoping
it appears to work, but i dont have any friends online to help me test if it works with multiple people on the server, so i will have to wait till tomorrow to fully test it.
THANK YOU!
You can actually try to launch multiple clients and call it a test
If you need you also launch the game in windowed mode
my ol beater doesnt have the ram for that. i only have about a gig free with just arma and discord running.
thanks, I will mainly be iterating over like < 100 dead units and < 25 dead vehicles ... it could spike higher rarely i guess depending if zeus is doing something
I wonder if its just better to use an abstracted array from the "entityKilled" mission event
[]spawn
{
Sleep 5;
_playerPosition = profileNamespace getVariable ["ptlm_anomaly_position_01", []];
player setPosATL _playerPosition;
};
Is there anything wrong with this? I keep getting* Error 0 elements provided, 3 expected* on the setposatl line.
Earlier in code I have:
while {alive player} do
{
Sleep 60;
profileNamespace setVariable ["ptlm_anomaly_position_01", (getPosATL player)];
saveProfileNamespace;
Sleep 60;
};
"ptlm_anomaly_position_01" is not defined
you only define it after 60 seconds, but you read it every 5 seconds, and the default value you return is an empty array.
should atleast do: [0,0,0]
as default return value
_playerPosition = profileNamespace getVariable ["ptlm_anomaly_position_01", [0,0,0]];
I see, so its only a problem the first time right? it gets fixed after 60 seconds?
yes
you could just do this:
_playerPosition = profileNamespace getVariable ["ptlm_anomaly_position_01", (getPosATL player)];
meaning if the var isnt defined you get put back on your position
I am sure I stood still for 60s. Respawned, my loadout did change (use exatly the same code, just replaced with getunitloadout. And my loadout was replaced while position wasnt
I will test
the error is bc of the empty array, if something else doesnt work im not sure right away why
I think there might be an issue with saving coordinates
It doesn't download anything when i put it as a -mod=SPE;.
This is what my host provides me with.
If i'd put vn;, it would download the SOG dlc when i start the server.
It doesn't seem to do anything with SPE;.
adding
params ["_unit", "_killer"];
systemChat format ["%1 has been killed by %2.", _unit, _killer];
}];``` to the init field of an object, as example from https://community.bistudio.com/wiki/addEventHandler
results in (picture)
any ideas?
params ["_unit", "_killer"];
systemChat format ["%1 has been killed by %2.", name _unit, name _killer];
}];```
seems it does not trigger an error when attatched to a unit
Try that.
same result
problem exists only when not attaching to a man object or vehicle
object in question is a satchel charge
SatchelCharge_F
Where do you put that
the charge or the script?
Me or?
The script
Are you sure you're not putting this into group Init?
yes, it states "object init"
POLPOX, are you sure its "SPE;"?
Copy and paste into an object init does work perfectly
Yes, if you're after server management this is not the channel for it after all. #server_admins
Oh yeah, it returns an error. What exactly you're looking for? What exactly you expect for a satchel?
just want to run a script when the satchel goes off
might just place a crate close to it and add an explosion eventhandler to that
make sure it detonates the satchel too if it gets hit
extra fun for players to have to be careful not to get explosions near it
It probably could because it is an ammo, not a regular vehicle
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Deleted_2
Try this instead
If I want to create a server DLL, do I need to whitelist it in BattlEye?
Server doesn't run BE, so no need
Thanks
player addEventHandler ["InventoryClosed",
{
_items = items player;
if ("rvg_rice" in magazines _items)
then {
player removeMagazines "rvg_rice";
player addItem "FTAC_CannedDailyMeal";
};
}];
I am trying to replace food items from Ravage food to ACE food. I am getting an "type string, expected object" error. What am I doing wrong?
player addEventHandler ["InventoryClosed",
{
_items = items player;
if ("rvg_rice" in _items) then
{
player removeMagazines "rvg_rice";
player addItem "FTAC_CannedDailyMeal";
};
}];
rvg_rice can be found in arsenal under magazines
then adjust the code
your syntax was also wrong as you can see
player addEventHandler ["InventoryClosed",
{
if ("rvg_rice" in (magazines player)) then
{
player removeMagazines "rvg_rice";
player addItem "FTAC_CannedDailyMeal";
};
}];
oh yes this one works thanks
Is there any other way to force the AI to wait for unit to get into vehicle?
a1 in heli2 && a2 in heli2 && a3 in heli2 && a4 in heli2 && a5 in heli2 && a6 in heli2 && a7 in heli2 && a8 in heli2 && triggerActivated trg7;
This thing works only when everyone will be alive, and if the AI will use 10% of its brain and follow orders. Otherwise whole operation is fucked. Can I do something like this?
this && {
units myGroup findIf
{
alive _x && !(_x in heli2)
} < 0
}
it doesn't check if the AI is using "10% of its brain" tho 
a1 to a8 must be in the same group, in that code I called it "myGroup"
Will try, ty
not alive OR, no?
well it finds if a unit is alive but not in a vehicle
so && is correct
(if units is dead or already in vehicle, it skips that unit)
so when findIf returns -1, either all units are dead, or all in vehicle
@little raptor thanks. It works perfectly
private _tDir = _playerVehiclePositionVisual vectorFromTo (getPosVisual _obj);
Leopard can you tell why this is quite expensive (0.1 ms)
Q: are map CONTROL 'draw' EH stackable? I am getting a unique _ehID back, but I wonder whether they are?
reason I ask is, I have a service EH which I register which listens for published shape meta data. basically a client side CRUD operation for shapes, read a shapes dictionary, create new (incoming) shapes, update with newly published changed, or delete the same.
server side is fine, I see the related changes happening and publishing.
however, once the shape is "seen" and created, its own EH is registered as a 'draw' callback, that is the only one that I am seeing. I no longer see the service function in my logs from that point forward.
so I wonder is there a better way to handle publishing "shapes" to the client. I'd like to keep each shape draw EH as atomic as possible, draw just that one shape, and be done with it. without it turning into more of a bloat than it needs to be. but I wonder is that possible considering the log evidence.
thoughts? ๐ง this is a bit of a kerfuffle, I want to sort it out. thanks...
I do not see any notes here about EH return values, but I wonder returning true is not great for this, i.e. short circuits the reverse order process from calling back to the "next" (first) EH?
https://community.bistudio.com/wiki/ctrlAddEventHandler
getPosVisual returns the AGLS position
i.e. similar to getPos and position
it's always been expensive. see:
https://community.bistudio.com/wiki/getPos
not sure what you need it for, but generally speaking, use getPosASLVisual/getPosWorldVisual instead
seeing that you're taking vectorFromTo, the only correct position format is ASL for both the start and end vectors
because only ASL is absolute. other position formats are relative
all addXXXEventHandlers are stackable
add = stack
set = replace (non-stackable)
only use 1 event handler
which iterates over an array of, well whatever you're drawing, and draws them
instead of constantly adding event handlers and removing them
if (_map getVariable ["my_EH", -1] >= 0) exitWith {}; // EH is already added. so don't add it again
_EH = _map ctrlAddEventHandler ["Draw", {
{
// draw
} forEach Array_Of_Things;
}];
_map setVariable ["my_EH", _EH]
to draw things, simply pushBack to that array. to stop drawing, remove it using deleteAt or -
well, that's the thing, the approach is not constantly adding or removing, the shapes in question are a bit more sustained than all that.
but still, point well taken.
to the primitive, though, ctrlAddEventHandler being add is not stackable then? would seem possibly not.
where is the official download link for pbo manager?
can u link me the website u got this download?
i got it saved to my Dserver as a file sorry
afaik it doesn't have an "official" download link
it used to be hosted on armaholic (and iirc some file sharing site like dropbox)
which is down
soo where does everyone download the pbo manager?
but its a safe download dude
;/ not trying to say it isnt but i just had bad past experience that resulted into being more wary of things i download from others
well its up to you dude
it's kinda old so most people use other things
for example:
https://github.com/dedmen/PboExplorer
so I mean based on that alone, why do I only see the "one" EH...
should it return false for instance, for the "other" EH to be processed?
the 'crud' EH picks up the initial shape correctly. which adds an EH for 'just that shape'.
and the shape is drawing correctly in the event registered map CONTROL.
but after that drawing event is registered, I no longer see any of the crud.
all of it logged.
so at least from this perspective, I do not think I am doing anything wrong, but the EH are not all being processed, counter to the what wiki docs suggest, reverse order, heck any order, but PROCESS THEM. they are not all processing.
however, other EH scenarios, control events, keyboard mouse, etc, where BOOL can be returned to signal event handled, I wonder if that guidance is in effect here as well?
no
then this beggars the question ctrlAddEventHandler what is it doing? because behavior suggests stacking is not the case.
all I can tell you is that it does stack. you're doing something wrong. hard to say what
I'm in delta, will share my vscode
if you can spare 30 seconds or 5 min maybe tops to lend your eyes
I don't have time rn
if you want DM me the code and I'll take a look at it tomorrow
as it stands right now the last event only is being processed. could be returning a BOOL is the issue, true versus false. will do, thanks for at least being available that way.
Hello everyone, I am an absolute scripting novice and would like if i can get a solution to something i've been working on. While using unitCapture/unitPlay on aircrafts, I've notice whenever I'm replaying the captured data on said vehicle the landing gear doesn't deploy upon approach on the runway or at all it just lands on its belly and if damage is enabled it just explode on impact.
while searching online i found this code that seems to work fine and i added the code in the activation field in a trigger before the runway, how do i make multiple units execute this code without placing multiple triggers?
_plane = (UnitName);
_mis = _plane;
_plane action ["LANDGEAR",_mis];
_mis land "LAND";
_landgear = true;
That code doesn't make a lot of sense. Like you've got UnitName, and then instead of just using that, you're saving it to _plane and to _mis - completely unnecessary. Also, the land command is for ordering helicopter landings. Using it for plane landings is...dubious.
Anyway, what you need is forEach.
{
_x action ["LANDGEAR",_x];
} forEach [unit1, unit2, ...];```
sorry for my ignorance, I'll run the code you gave me
@hallow mortar I got an error saying "On Activation: Missing ["
you can't just "run" the code he gave you in its current exact, you have to modify it to meet your needs.
yes i changed the vibrable names and i realized the error i was getting was from my mistake i had an extra comma
Hey, is there any way to send a hint or a systemchat to a unit name
in the same way I'd put funkyTank setdamage 1 I'd love if I could remote-exec to that name only
....or can remoteExec just take a unit name as an argument
oh balls it can
nevermind
I'll just hint and target the object(s)
I'm having an issue where the AI controlled aircraft in a unitCapture/unitPlay doesn't lower the landing gear by itself and after using this code in a trigger it works but not how i want it.
{
_x action ["LANDGEAR",_x];
_x land "LAND";
} forEach [F15EAGLE_1D, F15EAGLE_2D];
According to the wiki using the unit action "LandGear" will lower the gear near the ground and that is what i'm currently experiencing after the aircraft touches down on the runway.
https://community.bistudio.com/wiki/Arma_3:_Actions#LandGear
Does anyone know how to solve this from the wiki "In the case of AI-controlled aircraft, it has to be used in an each-frame loop to to override the AI behavior".
Does anybody know if there is any method to force AI groups to plan more direct paths toward an objective?
Any method other than giving them lots of waypoints forming a trail toward the objective, which doesn't seem to work very well anyway.
https://community.bistudio.com/wiki/AI_Behaviour
Comes to mind, but I'm borderline 0 with AIs to really tell
use one of the existing AI
oh oops thought i was talking to my partner
well while im here, what's a good way to define 3D areas in the eden editor that can easily be referenced by scripts? I usually use markers with inArea(Array) but those are a bit inconvenient, having to view in map and also include a manual check for AGL height...
To be more specific, I have one use case where a spawned, server-side script handles checking if a certain set of units are inside a prison area (defined as any marker prefixed with SHZ_prison), but my buddy's also planning to have a "decontamination process" where players walk through several triggers to decon their vehicle and then themselves. I think for the decon we could get by with having this && {player in thisList} in the trigger condition, but I'm curious if I can just have the areas to reference without actually using the trigger activation (and preferably not require hardcoding variable names).
https://community.bistudio.com/wiki/allObjects
ah, i might do alright with 8 allObjects 7 to get all triggers and then filtering by triggerText for a certain prefix
inArea can accept triggers as the area to check, so you can use empty triggers as area references if you like.
How far is the objective? In my experience, and someone could say I'm wrong on this but... if it's past a certain distance (maybe view distance?) it will only pathfind up until that distance and continuously replan on the move making the ai take really suboptimal paths. Best way is to set waypoints about every few kms or so. If your obj is closer than 2-3k maybe adjust combat mode and behavior to suit the desired effect. The alternative is heavy scripting unfortunately.
Currently I'm giving them waypoints only out to 800m, and yet they still go like a km in the wrong direction sometimes.
Vehicle or on foot?
it seems mostly guys on foot, but really it can be anybody.
They're trying to go AROUND beaten zones, I'm pretty sure.
however, in a long game, everything is a beaten zone, so they'll take extremely long routes around to an objecive. Sometimes going 2 or 3 km in the wrong direction.
That seems like something else on top of vanilla AI. Running mods?
There's nothing that should affect their planning. The problems gets worse the longer the mission lasts.
And when I say they're going out of their way, they go WAY out of their way. Also, higher skilled AI, such as snipers, seem to be affected more severely. I've seen sniper led AI groups take like 30 minutes to travel 100m closer to the objective, with no enemies anywhere in sight. They're constantly moving, but ineffectively, going back and forth but not closer to the objective.
I'd definitely look into what your running because default ai doesn't do this. I'd ask the discord or whomever developed the game mode your running.
does anyone know if there is a way to make an event handler apply to a side as opposed to a unit? I'm trying to make it so a notification pops up when a civilian is killed. There's a mod I would normally use for this but unfortunately the mod is outdated
something like ```sqf
addMissionEventHandler ["EntityKilled",
{
params ["_unit", "_killer", "_instigator", "_useEffects"];
if((side (group _unit)) == civilian) then
{
hint "Civilian killed!";
};
}];
that worked, thanks
Hi, I am trying to get a playSound3D working. The sound it shall play originates in a mod. I figured I need to use the absolute path to the file. But I am not sure how to use that with the playSound3D command. When I just put the path as the filename no sound appears.
I also tried using a default arma sound with absolute Path, doesn't work either. What am I doing wrong here?
playSound3D ["C:\Program Files\Steam\steamapps\common\Arma 3\Addons\A3\Sounds_F\sfx\alarm_independent.wss", player];
playSound3D ["A3\Sounds_F\sfx\alarm_independent.wss",player]```does the thing pretty finely?
Not sure why/where you got the clue to use that kind of path
because If I want to use it with a mod it doesnt work...
and only using the relative path from the mod doesnt work either
therefor I tried getting the absolute path to work
playSound3D ["C:\Program Files\Steam\steamapps\common\Arma 3\!Workshop\@Dog\addons\MFR_Dogs\sounds\DogBark_01.OGG", player];
playSound3D ["MFR_Dogs\sounds\DogBark_01.OGG", player];
I don't recall if an OGG can work with it, but in the first place, Arma 3 does not going to find any file that is not located in any loaded PBOs (well basically) so that kind of absolute path is simply invalid
Make sure your Mod you're trying to look up has the file PBOPREFIX MFR_Dogs
according to the wiki an .OGG should be fine with the playSound3D and the mod is packed into a .pbo called MFR_Dogs
PBO name is not always equal to PBOPREFIX
what is the PBOPREFIX then exactly?
or rather how do I figure out what the PREFIX is?
PBOPREFIX is the prefix/address where the PBO should be located in Arma 3 internally
OGG also works
playSound3D ["RW_assets\sfx\metalclose.ogg", player, false, getPosASL _container, 2, 1, 25];```
e.g. Arma 3\Addons\3den.pbo has a3\3den PREFIX, note that it has a3\
Who packed MFR_Dogs? Is that yours? If so what software you use to pack?
No, it is a mod from the workshop I am writing some scripts with
But I can just try contacting the creator if there is no other way to find out the prefix
One way is to just check the PBO with a text editor or binary editor like Bz
Isn't it always the pbo name ?
No
Pretty much a3\3den is not equal to 3den
At least for mods thats my experience
Some PBO related software can look it up too... like Eliteness or something
well, already helped alot, thx ^^
Official or Mods makes no difference
This is what it looks in Bz, the very first lines clearly declares the PREFIX
https://community.bistudio.com/wiki/allAddonsInfo
If you want to look up in-game, allAddonsInfo can help too
so with this script it gives a hint when a player kills a civilian
{
params ["_unit", "_killer", "_instigator", "_useEffects"];
if((side (group _unit)) == civilian) then
{
hint parseText format ["A Civilian Was Killed By <br /><t color='#c1000b' size='1'>%1</t>",name _killer];
};
}];```
however, if something such as a zeus lighting bolt kills a civilian it displays "Error: No vehicle" where the player name would normally go, is there a way to stop it from displaying the hint if it has the error?
I've tried to do
addMissionEventHandler ["EntityKilled",
{
params ["_unit", "_killer", "_instigator", "_useEffects"];
if((side (group _unit)) == civilian) then
{
if (_killer != _error) then hint parseText format ["A Civilian Was Killed By <br /><t color='#c1000b' size='1'>%1</t>",name _killer];
};
}];```
but it didn't work
thanks, I was able to get it working by doing
} else {
hint parseText format ["A Civilian Was Killed By <br /><t color='#c1000b' size='1'>%1</t>",name _killer];
}```
I just checked with the allAddonsInfo and apparently the MFR_Dogs is the prefix
[""MFR_Dogs\"","""",false,8,""9ac902975d297cfe7bd2f8a403e57d84c4edb114""]
Then use this to make sure the audio file is there
https://community.bistudio.com/wiki/addonFiles
yea, returns empty
What is the code you've run
diag_log str addonFiles ["MFR_Dogs", ".OGG"];
however as there are subfolders I am not too sure how that behaves
Try without extensions
diag_log str addonFiles ["MFR_Dogs"];
still returns empty
12:15:56 "[]"
How about sqf addonFiles ["MFR_Dogs\"];Instead
ahh, my bad. Yea seems to work now
It also returns the path
"MFR_Dogs\sounds\dog_bark_01.ogg"
however as mentioned before the playSound3D doesnt work with this path
Could this be an error on the mod-dev side?
Maybe maybe not
Probably simply because your code is somewhat wrong could be a reason too
In description.ext cfgSounds, the file path has to be prefixed with @ to use things in addons. Maybe that's the same here?
No, that shouldn't be a thing. At least I haven't seen such
Uh, quick check, have you tested it again using this exact path?
Because this path is dog_bark_01, and the path you said you used earlier was dogbark_01
Well, apparently sometimes it can be such a stupid mistake as missing an underscore. Sorry to have wasted your time...
At least I learned a few new things
Still thanks a lot for your help
is there a script/function from BI/A3 or 3rd party to export cfgVehicle code to rpt with the correct inheritance setup (turrets etc)
there are some export buttons in config viewer not sure if that's due to 3den enchanted mod
basically you need to get all parents, and recreate in reverse order with the correct turret setup
Running into an issue with my FFV turrets where when preparing a grenade through advanced throw, the player is blocked from throwing. Am I missing something in my conifg or is there a way to enable it via scripting?
nvm, ace_advanced_throwing_fnc_canThrow is the function returning false so there is something else causing an intersection
Is there a way to jack up the volume for playsound3d
https://community.bistudio.com/wiki/playSound3D
Syntax:
playSound3D [filename, soundSource, isInside, soundPosition, volume, soundPitch, distance, offset, local]
volume: Number - (Optional, default 1) sound volume. A value greater than 5 gets capped
So what would I put to isinside and soundposition as default values
https://community.bistudio.com/wiki/playSound3D
isInside: Boolean - (Optional, default false)
soundPosition: If a following parameter has to be used, simply usegetPosASL _soundSourcefor soundPosition
Ok thanks
I'm not actually a wiki repost bot btw
I know, you have helped me in the past
By providing advice and helping me with code
Today's advice is "when I answer with a link, it's because the link contains helpful and relevant information, and you should read it"
Would anyone be able to point me in the right direction. I want to have one central arsenal, but inside that arsneal are limited items and only specific slots can get specific items
for example:
Machinegunner, can be the only one to pull out machine guns
Aviators, are the only ones who can pull out flight suits and flight helmets
Engineers, are the only ones who can pull out mine detectors and explosives
just some random question @grizzled cliff
how does the SQF VM works?
always thought it was a stack ==> parallel access bad
Is there a setDir command, but for different axis?
setVectorDirAndUp
I figured it out. was a question of pretty much always returning false (versus true) adopting this approach, which signals the ARMA EH model whether to continue invoking registered event callbacks.
couple other minor bits to sort out, but otherwise, sorted.
thanks!
if that's the issue that's not intended behavior
and I don't see anything in the game code
ah nvm it does have bool return
yet it's not even documented...
looks like a bug
will be fixed in the next game version
I'm trying to use this script to have a helicopter move to a spot (pad2) and then land, but they just end up hovering over pad2. I'm pretty sure this should work because it's pretty much the code in the wiki page for the land command. If anyone can see what I've done wrong it would be appreciated. pad2 is an invisible helipad.
sleep 5;
while { alive HeliPilot && not unitReady HeliPilot } do
{
sleep 1;
};
if (alive HeliPilot) then
{
HeliPilot land "LAND";
};```
Maybe check if it's getting to the second step?
I think the problem is that it can't fully get to pad2 so it cant mark the move as being done. Problem is I'm not sure how to fix that, I tried making it move to a helper above where it's supposed to land but it stopped before getting to the helper
Pretty sure "land" takes the vehicle as argument, not the pilot... so
(vehicle HeliPilot) land "LAND";
all good, but, yes, seems consistent with other stacking EH. 'that' is how you approach them.
Has anybody solved the problem of getting an AI unit to immediately move to a new location, regardless of the circumstances?
It seems like the best I can do is to use playactionnow to make them immediately get up and run, but that only seems to work some of the time. The rest of the time, they just run in place.
Hey, is there a setting that controls how fast the server switches missions? Every time we end a mission it goes back to our default training range before anyone can read the ending description
Anyway flags can be held by the player as an item like a small flag pole and then placed on the ground?
if that's not possible, how to maybe set an action where if the player is in a specific location they use the scroll whel to spawn a flag, signaling friendlies took over the area?
Setting them to careless + high move speed and a couple of disableAIs works, IIRC.
setSpeedMode "FULL" is the speed one
IIRC one of "TARGET" or "AUTOTARGET" was important.
(disableAI)
setSpeedMode seems to be for groups only. I'm talking about causing a single unit in a group to move to a new location, and to do it with the minimum possible delay.
I've tried all of these in various combinations, and all together, without the desired effect:
_unit disableAI "AUTOTARGET";
_unit disableAI "FSM";
_unit disableAI "COVER";
_unit disableAI "SUPPRESSION";
_unit disableAI "AUTOCOMBAT";
_unit forgetTarget _caused_by;
_unit setunitCombatMode "BLUE";
_unit setCombatBehaviour "CARELESS";
_unit forcespeed 100;
_unit enableStamina false;
_unit domove _cover_pos;
_unit setDestination [_cover_pos, "DoNotPlan", true];
_unit setdir (_unit getdir _cover_pos);
_unit dowatch _cover_pos; ```
The only thing that actually (sometimes but not reliably) causes them to immediately start moving is:
```_unit playactionnow "FastF";```
I've made sure that _cover_pos is a place that is in the unit's line of sight, and that it isn't colliding with anything by first using setvehicleposition to position an object approximately near the _cover_pos, using the create vehicle algorithm.
What do they do?
they don't cause the unit to move quickly
What we saw back in ToJ was that the engine is not thread-safe, so if it's called by multiple threads bad things would happen sooner rather than later.
if they move at all
usually they don't move at all
except if i playanimationnow that is
You might need to group-switch them. Some behaviour depends on group behaviour rather than unit behaviour.
tried that, it had no effect on the problem.
Given how deep (and costly) a change that would take to fix, I assume this is still true.
uh, you haven't managed to make a unit move directly to a point even in its own group?
it doesn't seem to ever want to move directly to a position. Not while in combat anyway.
the only way i've been able to get it to move successfully is with playactionnow to force the FastF running animation.
but that only works about 60% of the time. The rest of the time they just run in place .... as if there's an invisible wall blocking their movement.
well, if the engine still is stack based then that is simply bad by concept
you cannot operate on the same stack in parallel
Not seeing where any stacks at all come into it. Two threads calling even semi-related functions can conflict in "undefined behavior" ways when not explicitly synchronized.
Is there any function to gather all tasks in the mission into a list
Including ones that aren't assigned to any units
Given that they operate on same data - i.e. game engine state
nope, just keep track of your tasks ๐คท
I remember making a toj background thread that called diag_log in a loop, crashing the game in minutes at most.
And you have the same problem when someone else may be writing, especially if they are not using memory barriers.
you should be fine when somebody is writing
however, you might end up with a value which is not correct anymore which does indeed is a problem
eg. having a 0xFFFFFFFF in memory and somebody changes it to a 0x00000000
you could end up with a 0xFFFF0000 in your reading
which then would cause trouble itself again
meh ... i rly should get back to work
Weird, but okay
hm
looking at the code there's no central reporting for tasks ๐ค
I'd almost expect them to be registered in an array somewhere
They would be. It's just not exposed in an SQF command.
Sometimes I wish for STRING select NUMBER so you can quickly select just a single character without building an array for STRING select ARRAY. Muh microseconds moment again.
"#fall" select 0 == "#"
yeah, didn't want to build an array just to get one symbol
ah thats what you meant by that I thought you meant splitString
Yeah, I wish there was some way to find it. I'm reduced to trying things like
private _allTaskMakers = [];
{
if (typeOf _x == "ModuleTaskSetState_F") then {
private _taskState = [(_x getVariable ["ID","NoID"]),(_x getVariable ["state","None"]),(_x getVariable ["Title","None"])];
_allTaskMakers append [_taskState];
}; } forEach units sideLogic;
Troublingly, even though someTaskModule getVariable["id","none"]; works, this way of doing it doesn't.
I feel like there's some way of getting more direct references to the modules that would make it work but I'm too sleepy to remember it
I'm like, touching the group references instead of the objects themselves
I don't see what doesn't work there.
Is units sideLogic select { typeof _x == "ModuleTaskSetState_F" } not picking up some tasks?
No, they're all picking up
It's just not grabbing the task's ID
returns noID instead for all of them
I think maybe there's some fuckery with taskIDs vs variableName
Using the eden variable viewer, I'm interested to find that all tasks are @taskThisOrThat including tasks with no assigned task ID, which are instead like @task4018234
and these each have child variables, .0 through .11
....Oh, I'm dummy. Hang on.
Remember how I was tired? It should have been looking for ModuleTaskCreate, not SetState.
Does anyone know a way to disable the map view which shows the hierarchy when clicking on an ORBAT icon?
So... I've no idea why it does that, but if you do loadConfig "mission.sqm" during a main menu background scene in CWR II and SOG:PF, it crashes arma (Access Violation) with no hint in the logfiles as to why. In fact it does not even print diag_log entries in the file that calls loadConfig, nor the file calling it.
During SP and MP sessions, it seems fine. Haven't actually verified that the code runs there, actually, but it's fine during the regular Altis background scene. Crashes when SOG:PF or CWR II are loaded.
What compatibleMagazines does exactly? I noticed it fires Warning Message: Error: creating weapon launch_Titan_base with scope=private when used on an illegal weapon, does it actually create the weapon somewhere? Any overhead to this? I plan to walk through all weapons and get magazines for all weapon-muzzle combinations to precache stuff.
By overhead I mean some network traffic, some weapon instance stuck in limbo/memory forever.
IIRC getUnitLoadout CONFIG does create the unit first. Perhaps the same for your case.
Can't you get the comp magazines from config?
Sure I can, but I thought to get lazy and just use the command
Have to go through all muzzles, all magazines, all magazine wells otherwise
Didn't think it would actually create some weapons
Does setShotParents affect player scores?
In other words, if I modify the killer and instigator in setShotParents, will this change the player scores for the new killer?"
The scheduler has influence on the select loop. Because every iteration it will check against the 3ms limit and may stop right in the middle (though this simple code would trigger SimpleVM to execute faster and won't do suspension checks)
Whereas the array subtraction is one statement, that cannot be suspended.
ParticleSource vs Particle.
But yeah seems like it can indeed return the Particle entity.
The "Killed" event is for Units/Vehicles.
A Satchel is "Ammo"/Projectile. So only these apply to it https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Projectile_Event_Handlers
You want to trigger wehn it goes off, there is a "Explode" event for exactly that
I figured killed and dammaged would work since you detonate the explosive by "killing" it
setdammage
ArmaScriptCompiler could optimize the array away.
It currently only does that on params though
In general no crash says in the RPT why.
loadConfig is a hacky thing
It loads the WeaponType from config. If its not already in cache.
No entity is created
That is the intended use of that command
Here's a segment of code that spawns a missile and detonates it. The problem is that even when a player is controlling a drone and setShotParents is explicitly set, the player does not receive any score.
I also tried directly setting _killer and _instigator as the player, but it had no effect.
private _killer = driver _uav;
private _instigator = (UAVControl _uav) # 0;
private _missile = createVehicle [_missileType, _uav modelToWorld [0, 0, 0]];
[_missile, [_killer, _instigator]] remoteExec ["setShotParents", 2];
[_missile, true] remoteExec ["hideObjectGlobal", 2];
_missile setVectorDirAndUp [vectorDir _uav, vectorUp _uav];
triggerAmmo _missile;
Missile might be complicated because it isn't direct hit, but instead explodes and does range damage.
I would expect that should...
Why is that remoteExec?
oh setShotParents is a server command? really?
Ah I see. Yeah that's right ๐ค
Wish we had createShot to send everything projectile needs right away
Yes, that's right, thanks, there's an ammo penetrator inside, most likely it hits the target
position, vectors, parents
Doesn't penetrator aka submunitions inherit the shotparent?
they do
should ๐
is there a getShotParents? to validate it gets set correctly?
Actually nevermind
I see the mistake
There is no time delay between the missile being created and triggered
The missile explodes, befoer setShotParents is even executed
Ah that makes sense
Yeah, thanks, I set the delay, and it worked!
hey guys. can someone guide me, or point me to a guide, on how to set a up my dedi server so i can save changes to scripts without having to restart the whole thing? i've read something about file patching but its activated and still can't get it done.
So you don't have to restart the game? Or mission? Making a mod or just a mission?
working on mission scripts. i just hate having to close the dedi and disconnect, just because of a typo on a script.}
-- edit and save files on dedicated while its running --
that's why you don't script on the server :p
if i knew the code so well that i could just test stuff on self hosted and be sure its gonna work on dedicated, i wouldn't be asking for this hahah. but reality for me is that locality is a biotch and some lines i need to trial and error.
I get it, dw ;) do you happen to know about this page? https://community.bistudio.com/wiki/Multiplayer_Scripting
i guess you are used to ppl asking without checking on their own first. but yes, i've read that page. im just lookig for a way to make it a bit simpler to test stuff in a dedi enviroment. thats all.
You can also turn off battleeye and click start game again to get two clients open. Then host it on one and join on other
No dedi needed
i've tried that. steam wont let me open two instances for some reason
Turn off battleeye? You can start two instances from the launcher
Battleeye will kill duplicates
yes BE is off.
Don't start two launchers. Just click start game twice on the one launcher
i just thought something changed since that info. im starting to think is something on my end
all right yeah. this calls for a re install.
I need some assistance, I have an aircraft hidden by default, and it gets unhidden with a "radio alpha" trigger, I need a way to teleport all players in a multiplayer game into that vehicle, I was thinking maybe something in the trigger, so it gets activated at the same time but so far I haven't been able to get anything to work
I've tried a remote exec to a sqf that is supposed to teleport the players, ive looked all around forums and reddit for answers and so far I haven't found anything that seems to work
do something like this :
{
_x moveInAny VEHICLEVARIABLENAME;
} forEach allPlayers;
that seems to have worked, ill test it with multiple players
Make sure you have the trigger as server only
I set the skill in one unit, for example: _grp1 setskill ["general", 0.3];, when it spawns after 15 seconds the skill always returns to 50%. Why? How to prevent it from returning to 50%?
I play in Zeus
@fair drum @winter rose well after reinstalling the game i can open 2 instances from the launcher without getting that weird steam error. no idea what th that was. thanks for the help.
Can I make a code that will unlock the vehicle for players if it was first spawned with block to all entities status?
nvm
found it
_veh1 setVehicleLock "LOCKED";
glad to hear!
Any way to make a unit thermally "cold" instead of hot? I'd like them to blend in but not be invisible
@queen cargo the VM is a stack of scripts which it switches through like you expected. Multithreading is not possible because every script is based on an GameState which has the current scripts position and local variables and stuff. And there just cant be two scripts running in one GameState cause they will overwrite each other. Thats not 100% true but thats what i got out of my first testing. But i didnt access the scripting functions itself i called whole scripts in different threads. If your lucky and the engine isnt currently executing something your fine. The good thing on Nou's side is that not all script functions use the GameState or only read from it if called directly so they dont interfere with eachother. The problem with reading a variable while its currently being written is still there tho
GetPos for example only calls the GameState to create the gameValue it then outputs via a static function. So as long as your just executing single script functions your mostly fine. But as i do it by calling entire scripts which need to be parsed youll get problems.. Unless! you create your own GameState...
vehicles yes, humans no (unless killing them is ok in your scenario)
Hi guys!
How I can check is it air vehicle or ground vehicle in my trigger area ?
alas :(
I'll just have to figure out how the reapers are made
isKindOf CarX, TankX, Air, Helicopter I believe
Which typeName responsible for air transport ?
Or how can i get this ?
heli + plane, "air" should be the one
"transport" needs to check cargo space
If I need only plane or heli ?
yep
I mean if I need only plane or heli, not both ?
For example: reapir only for heli and repair for plane - not the same
I told you, "Helicopter" or "Plane" (or HelicopterX or PlaneX)
if(!_getVehiclesInHeliTrigger isKindOf "Helicopter") then
{
hint "It is not an air vehicle";
};
The weird part was more that any log messages surrounding that bit of code were also not showing up.
How far back are diag_log calls buffered before they are written to the log?
But more importantly, how hacky is it exactly? Is there a way of testing whether a call to it will be safe?
My solution for now would be to find a way to determine whether the respective code gets called in a background scene or not, but if I knew better what it is crashing there in the first place, I could make it safer in the future.
Either way I'll be adding a comment to the page I guess.
Maybe i doing something wrong
Q: after we are done with a drawEllipse (or rectangle, or what have you), no longer need it on the map, what do we do with it? the EH is being removed, but I still see the remnants on the map, is that correct?
I never trust a not or ! standing along prior to the thing it is trying to invert.
if(!(_getVehiclesInHeliTrigger isKindOf "Helicopter")) then {
hint "It is not an air vehicle";
};
but second of all what is _getVehiclesInHeliTrigger?
do I need to redraw a void shape in the same geometry or what?
Why never trust?
_getVehiclesInHeliTrigger :
_getVehiclesInHeliTrigger = vehicles inAreaArray HeliAreaTriggerBLUFOR;
Generally unary commands (like !) have higher precedence than binary commands (like isKindOf), so yeah, the code is incorrect.
but also _getVehiclesInHeliTrigger is an array of vehicles, so you need to use a loop command like findIf to check all of them.
isKindOf only works on objects, not arrays of objects.
Higher precedence - what does it mean?
It means the interpreter reads !_object isKindOf "Helicopter" as (!_object) isKindOf "Helicopter"
there is always that danger, exactly
actually not wholely accurate, I think it works on class names (STRING) as well, but always testing the classification (STRING).
...what?
look at Syntax 2
you mean "class" isKindOf "class2"? I don't see how that's relevant.
saying only works on objects
Oh, you replied to the wrong sentence.
yeah my error
Is there a way to walk silently in Arma 3 ? I know i could replace game files but i need to be able to switch to silent moe during the game
In script? setUnitTrait with audibleCoef maybe.
I figured it out. was actually kicking into the draw areas with artifacts that were remnants of the objective being run. sorted. thanks...
walk silently? you can change your combat pass, crouch, etc.
trying to get a player (carring something in particular) to NOT be able to open the arsenal. there is the "arsenalOpened" scripted EH, and that works.. but then there is ACE, and i also have a save load out with a "arsenalClosed" EH. any ideas?
RPR_noArsenal = [missionnamespace,"arsenalOpened", {
params ["_display", "_toggleSpace"];
if (RPR_item in (itemswithmagazines player)) then
{
_display closeDisplay 1;
systemChat str "you cannot access the arsenal while carrying the item";
};
}] call bis_fnc_addScriptedEventhandler;
that i got working. i was just wondering if there might be a more direct way
I fixed the code a little, is it right ?
_index = _getVehiclesInHeliTrigger findIf {_x isKindOf "Helicopter"};
if(_getVehiclesInHeliTrigger select _index isKindOf "Helicopter") then
{
hint "It is an air vehicle";
} else
{
hint "It is not an air vehicle";
};
Perhaps this code can be simplified?
findIf returns -1 when not found, so why not just test for that?
ACE also has its own arsenal event handlers
https://ace3.acemod.org/wiki/framework/arsenal-framework#8-eventhandlers
ace_arsenal_displayOpened
Like that? :
if(_getVehiclesInHeliTrigger findIf {_x isKindOf "Helicopter"} == -1) then
{
hint "It is not an air vehicle";
} else
{
hint "It is an air vehicle";
};
up to you, you know your goals, what you want to do. point is, we're saying simplify whenever possible, if at all possible.
yes thanks! i was trying to get away with some magic code that just wont let you open ANY arsenal. dreaming is free lol. i got a set of "put" and "take" EH already working in tandem to track an item, that'd make 4 EH's just for that item. but the risk of someone changing loadouts and the item just disappearing is a real one. or maybe there is some magic code to just keep track of an inventory item? haahaha
Thank you so much
we are all simple here
no problem, good luck, good hunting ๐ป
@granite sky You also )
is there a consistent way to select a road segment?
like, I want to be able to look at a road segment and get sometthing equivalent to its netid (obv wont have one bc its a terrain object)
I can do getObjectID to get its ID but I don't know how to turn an ID back into an object
What's this for? Saving between missions?
kind of yeah. I want to dynamically spawn bus stops adjacent to roads, so the ideal would be to save a list of road segment IDs and then select those on startup
You could save the position instead.
yeah, that was going to be the other option, just save posasl/dir
ok been reading more about it. the ACE EH's are all CBA added right?
i.e :
["ace_arsenal_displayOpened", yourfunctionname] call CBA_fnc_addEventHandler;
its not that big a deal just wanted to do it consistently
Not working
the character always makes noise whatever the stance
uh, are you talking about noise you can hear or noise that enemy AIs can hear?
i'm talking about the noise me and other players can hear
I'm not sure you have any control over that other than using different walking animations.
i'll try
you make less noise if you are crouched, if you are in combat pace, etc. more than that stop running. then you will not make as much noise. sheesh...
yup
is that a voice channel ?
No this is the channel where you complain about BI and the RV engine.
Can I use inAreaArray to get an array of all buildings at a location?
The fun thing about that code is that -1 is a valid index now, it selects the last element in an array. So if findIf didn't find anything, you'd retrieve the last element in the array with it xD
Yes
Get all buildings in larger area, then narrow it down with inAreaArray
I tried _buildings = Building inAreaArray _locationData; but "building" is the wrong object?
In that example _locationData is the map location array
Check the syntax. Left operand is list of objects, right is either search dimensions or location entity.
You first need to get all buildings near location you're checking, then narrow it down to only include ones that are exactly inside the area/location
Ok yeah I was looking at it all wrong, it's late here 
Thanks for that
To get all buildings you can get lazy and do something like this:
(1 allObjects 0) + (8 allObjects 0)
but this will include lots of crap and have ALL objects in the world in one array, very wasteful
Proper solution:
- Calc the hypotenuse of a triangle with your area\location sides
- Use center of your area\location and that calced value in
nearEntities,nearObjectsornearestTerrainObjectsor other object finder command - Then use that command's output as left operand in
inAreaArrayto only select objects that are precisely inside your area\location
Yeah cool, I've already done 1 and 2.
Honestly it's all just to work out dynamically how many enemy to spawn at a location ๐
I figure if I have the size of a location and the number of buildings then I can come up with some "math" to give me a reasonable number
You can try getting buildingPos of buildings to see how many positions there is
While not perfect it can give you an estimate of how much space inside buildings there is in the location
Yeah good point, that's probably going to be the better option
Won't work for non-enterable citis on Tanoa for example though
Maybe it could be enterable spaces per area
Just throwing ideas, up to you of course
Yeah appreciate it.
Does addPublicVariableEventHandler work with setVariable with the optional public argument?
is there a command to turn the mine detector on?
like openGPS true; or showCompass true;
https://community.bistudio.com/wiki/setInfoPanel
And component should be MineDetectorDisplay
do we have a list of components though?
class Components
{
class EmptyDisplay
{
componentType = "EmptyDisplayComponent";
};
class MinimapDisplay
{
componentType = "MinimapDisplayComponent";
};
class MineDetectorDisplay
{
componentType = "MineDetectorDisplayComponent";
};
class CrewDisplay
{
componentType = "CrewDisplayComponent";
};
class UAVDisplay
{
componentType = "UAVFeedDisplayComponent";
};
class SlingLoadDisplay
{
componentType = "SlingLoadDisplayComponent";
};
};```
ah, infoPanels and infoPanelComponents
The buffer might be huge.
But I think crash should flush.. maybe.
But more importantly, how hacky is it exactly? Is there a way of testing whether a call to it will be safe?
Its not a feature the engine expected to have. No there isn't.
but if I knew better what it is crashing there in the first place, I could make it safer in the future.
Yeah same here, but so far I didn't get any crash reports.
Well I can tell you it doesn't in this case. Logs get swallowed quite far up the callstack even.
I get that it loses the ones in the same file, but it also drops the one from the calling file(s).
I solved it for now by moving it to parts of the code that will only be executed in actual missions.
I can try and produce some crashreports for you over the next few days.
It's quite trivial to reproduce if you want to try it yourself, tho. Just needs an addon that calls loadConfig "mission.sqm" in pre-init.
It will work for vanilla, but blow up when loaded with SOG:PF.
Also with Cold War Rearmed II, so they're both doing sth that sets it off.
Hi guys!
How can I make a table with sides points, which they can use to buy something ?
Like this:
That's a long process
Go to #arma3_gui and I recommend watching some yt videos for gui basics
In which place (file) I should put the function written by me ?
For example function, which will be check, is the player in the area
My think: in init.sqf. Is it right ? If no - why ?
There are no strict rules about it. It's your choice what kind of folder/file structure you want to have. Init.sqf gets executed when the mission starts. You can add multiple script files in a project and call the code in those script files from other scripts. You can start testing your code by writing it directly in init.sqf, but sooner or later you might want to split the code in logical parts (in other SQF files).
where do i go to learn about sqf file and how it works in and out overall?
I was wondering.
Are you able to exclude a certain group from a certain check?
I have an extract end condition which works just fine, where it triggers if 20% of alive blufor are in the marker.
Slight problem is, a 3 man mortar team sits in base, and as such, they can potentially be atleast 20% of the alive blufor team.
Which results in the mission ending early, before the force out in the field returns to base.
What does the current condition (code) look like?
_resForce = allUnits select {side _x == west};
_resAlive = _resForce select {_x call FNC_alive};
_resArea = _resForce select {_x inArea "extract"};
if (alive HVT && {HVT inArea "extract"} && (count _resArea > (count _resAlive * 0.2))) exitWith {
Perhaps something like so?
_resForce = units west;
_resForce = _resForce - units MortarGroup;
_resAlive = ...
I've been working on an undercorver system for a few days now and im at a point where I believe im about 80% done but my limited knowledge/experience is roadblocking me. anyone think they copuld spare a few mins to help me figure out whats going wrong?
If you're not using _resAlive and _resArea for anything else you can also optimize count:
_resAlive = {_x call FNC_alive} count _resForce;
_resArea = {_x inArea "extract"} count _resForce;
if (alive HVT && {HVT inArea "extract"} && (_resArea > (_resAlive * 0.2))) ...
Does fnc_alive do anything special, or can it be replaced with simply alive _x?
fnc_alive is a function from our framework if I recall.
would - units MortarGroup; work though?
Like... is it that simple?
Yes if the group is named MortarGroup
You're just subtracting the array of units in that group from the _resForce array
Seems simple enough.
I did read up on https://community.bistudio.com/wiki/-
hi. can someone help? here is my mod (with commented code and README).
Problems: it works fine in SP, but in MP it works fine only on host. Host gets all the variables (parameters) right on every drone, but other players get default values (not that was set in attributes), and somehow players can manage actions if they are controlling drones ('pilotNow' is set to true mb).
Idk if it gets default value from attributes set variables, or right in code
i think problem is might be with getting manually settled values in eden attributes of drone on every player connected to server?...
in notepad + +, if I save a script as .sqf will arma 3 be able to understand said .sqf file ?
obviously if i write it properly and properly put the said .sqf file where it belongs*
.sqf files are just text files
you could even save them as .txt
just make sure you save them as utf8
i see
this addaction ["<t color='#FFFF00'>Virtual Garage</t>", {[("markername")] call opec_fnc_garageNew;}];
this code will open virtual garage and spawn vehicles at marker1, but problem is said marker1 has fixed altitude i need marker1 to be at altidude 205 i think so that it spawns at altitude 205 and not inside of carrier vessel is there a workaround ?
i want to use helipad invisible but this is specified only for Marker idk how to make it be helipadinvisible tho hence helipadinvisble can be moved up and down
You don't need to do ("markername"). Just "markername" is fine, there's no order of precedence issue there that you'd need the () to resolve.
but the sqf file i got it from requires for me to use marker but idk how to make sqf one use helipad invisible
When we use an array we get this error but we cant figure out what weare doing wrong can someone pls help ??
Files are provided.
The Error:
class peragh_ausgrab_config {
peragh_ausgrabun>
0:21:22 Error position: <peragh_ausgrab_config {
peragh_ausgrabun>
0:21:22 Error Missing ;
0:21:22 File mpmissions\Altis_Life.Altis\config\Config_Ausgrabung.hpp..., line 4
0:21:22 Error in expression <\config\Config_Ausgrabung.hpp"
Config_Ausgrabung.hpp
class peragh_ausgrab_config {
peragh_ausgrabungsGebiet = "test";
peragh_ausgrabungsSize = 30;
peragh_requiredItem = "";
peragh_searchTime = 10;
peragh_ausgrabungAnim = "";
peragh_lootAusgrabung[] = {
{"hgun_P07_F", "weapon", 0.5},
{"peach", "vitem", 0.8}
};
};
fn_actionKeyHandler.sqf
if (player inArea getMarkerPos[peragh_ausgrabungsGebiet, peragh_ausgrabungsSize]) then {
[] call life_fnc_ausgrabung;
};
fn_ausgrabung.sqf:
fnc_startAusgrabung = {
private ["_item", "_startTime"];
if (player inArea getMarkerPos[peragh_ausgrabungsGebiet, peragh_ausgrabungsSize]) then {
if (!(peragh_requiredItem in assignedItems player)) then {
hint format ["Du benรถtigst %1 um hier ausgraben zu kรถnnen", peragh_requiredItem];
} exitWith {};
if (peragh_requiredItem in assignedItems player) then {
player playMove peragh_ausgrabungAnim;
_startTime = time;
while ((time - _startTime) < peragh_searchTime) do {
_item = _x select 0;
if (random 1 <= _x select 2) then {
if ((_x select 1) == "weapon") then {
player addItemToBackpack _item;
} else {
player addItem [_x select 0, 1];
};
};
} forEach peragh_lootAusgrabung;
};
hint format ["Du hast %1 Augegraben", peragh_lootAusgrabung];
} else {
hint "Du befindest dich nicht im Ausgrabungsgebiet";
};
};
Excuse me, why you're "executing" a config as a script?
where exactly? Because I actually call the cfg and the cfg takes the things from the .hpp or am I just stupid?
A include like this has nothing to do inside a script
#include "..\..\config\Config_Ausgrabung.hpp"
x39: I believe half writes is only a problem for unaligned variables? A more likely problem is that something is written, a pointer to it is written, and that pointer is flushed to deeper caches or main memory, before the data it points to. If you try to read the data in between you get garbage.
But if that's not included, do I have to pass the parameters via params or how does it take the things from the config?
OK, thx, now I found it, I was just stupid ๐
Is it real to detect a flying rocket and if it flies into a certain area (into a trigger, for example), does the sound turn on?
Wat
What, what sound?
For example custom air warning
If the rocket in the trigger, than players can hear about air warning
It's not impossible. I'm not available to write a snippet right now though
no problem )
But if it not impossible - its time to think for me
I'm trying to write an addaction to add to a Training NPC.
The medDoll%'s are just suspended in the air with sim/dmg/hide off so the idea is the action re-enables simulation, damage and un-hides them
At the moment it's asking for a missing ] but it's eluding me
{
_target = _x;
_title = format ["Activate Patients", _target];
_script = format ["_target = %1; hint format [\"Activating %1!\", _target]; _target enableSimulation true; _target allowDamage true; _target hideObjectGlobal false;", _target];
_arguments = [_target, true, false, true];
medDoll1 addAction [_title, {_x call {(_this select 0) spawn {(_this select 1) call BIS_fnc_holdActionAdd;}}}, _arguments, 0, true, true, "", "true", 5, false, ""];
} forEach targets;```
if anyone could spot the issue/issues that would be greatly appreciated
Always quote the error text.
Init: Missing ]
No, the whole error.
\" is this C?
Pretty sure that backslash escaping doesn't work in SQF.
that would be a part of the problem! yup
For something like that you just swap quote types. Use single quotes if the outer is doubles.
They both work in SQF and it just looks for a match.
Beyond that, it's unreadable :P
the quote types did it
now it's just a reserved variable and the whole thing being unreadable
@still forum I would not be inclined to believe the gamestate (world with all its objects) includes a single scriptstate - rather the executor would have its scriptstate object which has a pointer to the gamestate. Am I wrong? MT would still be quite hard, but for other reasons that would still apply.
hi friends is it possible to make a car's wheel break after a trigger is activated ?
re half updates - it could perhaps also apply to two-word values, like doubles. Don't know know much those are used though.
@barren ermine https://community.bistudio.com/wiki/setHitPointDamage
how do i know which variable(s) are the wheels ?
I have a question, probably simple for you, but I don't know how to do it :(. How to write a script so that the vehicle does not avoid the obstacle in front of it but hits it? For example, so that the tank does not avoid the car?
@granite sky @stable dune you guys are literally the goats bro
Create the car as a simple object and then use setDestination maybe.
This stuff is never simple though. Arma doesn't like to give you that sort of AI control.
ok i will try ๐ thx
I was thinking about unit capture and unit play but it's too much work ;p
is there some simple example of xml file for BIS_fnc_dbImportXML ?
heh
multithreading is not a problem
took me a day or so to get it working
but now it is perfectly stable
with 100s of threads calling sqf functions
neato. i'd bet @sullen marsh would want that for his AAR stuff
yah
yah i just gotta find this little memory leak im getting now
Is there a command to mute the AI โโvoice, including pain/breathing sounds, when injured/exhausted?
setSpeaker with "NoVoice" should take care of AI voice chatter.
For breathing sounds, try a soundPlayed event handler
I presume we can't get to the debug menu/triggers/change objectives icons via Zeus?
it may seem that any XML could do?
@gray bramble the gamestate is not the world with all its objects. Its more than a base of all scripts being executed.. better name would be ScriptState but its called gamestate
Aye i'm super interested in it
Anyone looked into what they're doing with enfusion ?
i know they have a new scripting language
I did look at the language
its in take on mars
I think the ToM wrote it first then they just snagged it upp
Brand new language or is it based on something?
Knowing BI probably based on C++ somehow.
yah, looking at it, it looks like its C++ in terms of syntax, the question is how is it interpreted
That looks noiiiice.
I mean, hopefully it wouldn't be interpreted at all... C++ lives to be compiled, even if it's done at load
pain
At least BI support modding properly, it's nice to have a company so supportive of it's playerbase and modders.
That's true, SQF might make me pull my hair out sometimes (and I don't even use it that often) but at least they let us mod at all
BUT it would be the death of arma if they didn't...
clamp linDamp<0, 1>;
Strange syntax
is it a lot of work to make a vehicle mod ace compatable?
What the different between spawn and call commands?
..
spawn creates a new "thread" in the scheduler which will run your code at some point in the future.
call will run the code immediately and return to where you called it from.
run the code immediately
that's a bit confusing. only unsch env can run a code immediately
perhaps it's better to say:
call is for sequential execution?
whereas spawn detaches from the script that ran it, and does its own thing
Would anyone happen to know of a Script that would essentially spawn in Destroyed aircraft mid Air, and Despawn them after say a few seconds as they are falling out of the sky to create say and ambiance affect
no, but it is doable
thanks
im assuming not able to repair wheels is due to non-conventional memory points?
So what i think you are getting at is playing explosion and gunfire sounds in the distance of "an active war zone". A much simpler concept would be to play the sounds you want (including custom ones) pff in the distance.
I'm trying to run this code:
sleep 5;
while { alive HeliPilot && not unitReady HeliPilot } do
{
sleep 1;
};
if (alive HeliPilot) then
{
(vehicle HeliPilot) land "LAND";
};```
it works fine in singleplayer but doesn't work on a server, anyone know if any of the commands don't work in mp?
how to you see the response to that syntax ? like how do i print the result
Naw I was trying to replicate this but the guy who posted it years ago never posted how he did it
Hello,
This is not a tutorial but a showcase with explanation. Simple concept demonstrating how one can add atmospheric ambient battles to missions. This is aimed at the SWOP mod but is not limited to it in design.
You could use such ambience to add atmosphere to any mission - to make the player feel like they are part of something much bigger.
What exactly doesn't work about it?
the ai doesn't move or even start the vehicles engine
Where/how are you executing the code?
As far as I know, the AI you're commanding to "move" or "land" have to be local to the client executing the command
I got down how he did the ship to ship firing down itโs more so the AirVics spawning already destroyed and despawning after they started falling abit
I might as well ask Chat GPT to write it KEK
I have the script being called by an execVM command attached to an interaction
Chances are you have to remoteExec the code on the server instead of the client then; The AI are local to the server if thats how they are spawned.
possibly. They have a dedicated slack where you could check
the server uses a hc so would that make the ai local to the server?
no
chatgpt cant code
especially not sqf
Ah. Cool. I love being wrong here.
Here is how I would do that.
Spawn the fighter, set the pilot's group to hold fire and careless, give them a move waypoint, and use the waypoint complete statement to set vehicle health to 0. Just loop this with a few different fighters and starting from different positions and BOOM! Literally ๐
Useful Commands:
addWaypoint
setCurrentWaypoiny
setWaypointStatements
^
I dont know of any premade scripts though to answer your original question. Far too particular to repurpose from some premade code that i have anyways.
Thatโs fair
And everything you said can be done in Eden. And there isnโt a need for a Sqf
Iโve like never genially scripted anything from scratch so , my knowledge on scripting missions are limited
I more of a Code/ Materials Guy
This is a perfect project to start messing with sqf!
For sure Iโm probably going to start working on it Friday since my work schedule is fucked if I have any questions can I shoot you a DM ?
i have a capital ships mod for that sort of stuff coming out whenever the update for setangularvelocity releases
Go ahead. i dont mind dms
Valid
Elaborate
I mean couldnโt you just use the attach to Zeus model
To fly the static starships
I mean I know itโs abit jank but it still works
Will they have interior or how will that work if your able to explain further
Dope
anyone know of a way to do a fake explosion attached to a helicopter to mimic an rpg hitting it (without any damage) once its gets to a waypoint cause I have the sound and damage alreadly scripted just trying to find a way to do an explosion
Making a fake explosion is rather hard. I think I can suggest to create an actual explosion but disable all damages for the heli and crew
okay but how can I ensure it actually hits the helicopter
and on the area of the heli where I want it to
modelToWorld or some way
Or hell make it not do damage (sorry I suck at scripting)
allowDamage
So make everyone also invincible and not just the heli
so I'm still trying to get this script to work I've tried using remoteExec but it hasn't worked. The pilot of the helicopter says the grid that they're supposed to move to but then they do nothing
Are you sure you have any Mod, especially AI Mods that can overwrite your order
I'm using lambs but I disabled the pilots lambs ai
I am, its just that I'm using not instead of !, pretty much the only difference between that script and mine is that in mine the helipad is already created
when the script is run the pilot just says the grid that the lz is in and then does nothing. Same thing happened when I gave the move command to the helicopter instead of the pilot
it works fine in sp but doesn't work when put onto a server
oohh (didn't read that below, my bad)
How do you test in SP? Did you use LAMBs in SP too?
yeah, exact same mods
What if you disable LAMBs in your server
haven't tried that but I don't imagine it would do much. LAMBs pretty much only effects units in combat and the helicopter is set to careless. They also have had LAMBs ai disabled in the editor and confirmed to be disabled in zeus
but I just remembered that we're running drongos air operations so I'm going to try disabling that
although now that I think about it it's probably not that. I have a truck with a similar script that also isn't doing anything
waitUntil {moveToCompleted TruckDriver};
sleep 10;
TruckDriver doMove position Start;```
I highly suspect any AI Mods in this case anyways
I think I figured it out
in zeus I ran the code to execute the script and it worked in global mode and target mode but not local mode
I'm going to see if switching the code that calls the script from "heli.sqf" remoteExec ["execVM", 2] to "heli.sqf" remoteExec ["execVM", 0] works
it worked
bomb = "Bo_GBU12_LGB" createVehicle (player modelToWorld [0,0,0]);
bomb setdamage 1;
``` so the bomb isnt being blown up by setdamage the only reason why it even exploding is cause the helicopter causes it to but that can be janky so I was wondering if there was a better way of doing this
triggerAmmo
Is there any caveat I should look for when using playSound3D for a whistle sound? Currently, my trigger seems to be activating without issues, but that's a separate situation I'll look into myself.
What I currently have in my trigger activation field (trigger is set to Server Only):
[] spawn {
private _whistles = ['vn\sounds_f_vietnam\sfx\missiondesign\enemy_whistle_1.ogg',
'vn\sounds_f_vietnam\sfx\missiondesign\enemy_whistle_2.ogg',
'vn\sounds_f_vietnam\sfx\missiondesign\enemy_whistle_3.ogg',
'vn\sounds_f_vietnam\sfx\missiondesign\enemy_whistle_4.ogg'
];
playSound3D [selectRandom _whistles, whistler, false, getPosASL whistler, 5, 1, 500, 1, false];
}
but it seems to be a hit-or-miss case on a dedicated server with the whistle sound playing on my whistler unit (a singular guy with the variable name set to whistler).
TY SO MUCH
That spawn is unnecessary anyways, I'd suggest to make sure these files exist for sure. fileExists command to check if it is
Looks like it's time to bug someone who has access to the server! Thanks 
Uh so, in MP some plays the sound some don't?
It worked locally but in MP on a dedi it seems to have failed based on a singular test
Will need to look into it properly when we have the time
Add some kind of logging (diag_log) to see if your conditions are met properly
and inside activation, then check RPT after a test to see if your lines are there
Don't recall rn but is playSound3D global?
The last argument is:
local: Boolean - (Optional, default false) if true the sound will not be broadcast over network
Oh true
probably I mean false
finally its done I made a singleplayer helicopter crash script
Hello,
Have someone build time_slider to attributes on object?
Like CBA settings "TIME", where you can set Min and Max.
Havent seen. Or is there in Vanilla some value for this?
And dont know is this correct place to ask , but lets start from here.
You wanna create a custom attribute in Eden Editor for objects?
Yes.
Dont know is it possible to build like CBA have in CBA addons settings "TIME" setting.
I would have timer where i set min value (like 30) and max value (like 300),
And you could select time between those.
But always i can use something what is already made, but didnt found any
https://github.com/acemod/ACE3/blob/master/addons/medical_damage/CfgEden.hpp
I know i can do something like this.
But can i do this for object , not in cfgEden.
Under
class CfgVehicles
{
class B_Soldier_F;
class MyEntity : B_Soldier_F // Your entity class
{
class Attributes // Entity attributes have no categories, they are all defined directly in class Attributes
{
class MyEntityAttribute
{
// ... attribute properties, see entity attributes <---- Here
};
};
};
};
@lone glade more like the game has barely anything to offer without player created content, so here's the bare minimum of tools for our esoteric engine. oh and no need for documentation right? right.
There's a fuckton of doc, and vanilla content is fine, they also provide constant updates.
Yea Foxy, you have to be a pesamistic moron to think that.
Trust me, if you think modding for Arma is hard or esoteric then you haven't worked on many other game platforms.
Is there a possibility to make not a full arsenal but something players could make their loadouts off without having access to all weaponry
I think you can.
Attribute controls work in Cfg3DEN and CfgVehicles.
Is there a way to access the startup params via sqf?
Or more specifically, can I check in sqf whether the game was launched with -skipIntro?
No
Is there any way to detect whether a background scene is running or not?
Like, is that an UI element? Or how is that implemented?
I think the answer is depends on your goal. If you just wanted to detect/run a script upon mission run, just init.sqf
No, am doing main menu rebranding. And depending on whether there is a background scene running or not I want to show a custom background image. Though depending on this question I might not need to know at all because I can just replace the default background . #arma3_gui message
BIS_fnc_arsenal has an option to limit the arsenal to what you've whitelisted into it.
_crate = cursorobject;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;
_headgear = {
"H_Hat_Tinfoil_F",
"H_HelmetSpecO_blk",
"H_HelmetSpecO_ocamo",
"H_Beret_gen_F",
"H_Beret_blk"
};
[_crate,((backpackCargo _crate) +_bags)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _headgear + _glasses + _clothing + _vests + _attachments + _acc)] call BIS_fnc_addVirtualItemCargo;
[_crate,(magazineCargo _crate + _mags)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _guns)] call BIS_fnc_addVirtualWeaponCargo;```
something like that should work
I see... Thank you
there's about a million things on the wiki with no documentation though to be fair
i can't remember ever seeing any docs from bohemia but i'll take your word for it, and yeah i was exaggerating but looking at stuff like asset/animation pipeline for arma 2 at least is pretty non-existant maybe it's better in arma 3 haven't really done anything with that
hey they included samples in arma 3 tools for like 4 or 5 different things, that's a step in the right direction eh
Yeh. It worked.
Thanks, didnt know those use same.
Thanks alot.
Is there way to add condition in attributes .
Like "checkboxState" which enable/ disable whole attributes.
But if i want in attributes.
Hi, does anyone know on how to execute a script on a person(in a trigger) via ace button?
You need to create your own attribute controls group and write the code yourself.
In case you own the Spearhead cdlc you can check the config of the Indirect Fire Support module for an example via the config viewer.
Awesome , thanks
I think I have such a control in 3den Enhanced as well so you might wanna check the source code in GitHub as well
https://en.wikipedia.org/wiki/C%2B%2B/CLI <-- most likely what take on mars scripting is
C++/CLI
its .NET but with C++
Hello, first time hosting server and it wont load due to this message, could anybody assist ? NoReply 'bin\config.bin/CfgMagazines/Aegis_8Rnd_12Gauge_HE.scope
That's not the full error message, that's just a config path. The error message is telling you there's a problem there, but you've left out what the problem actually is. I'm guessing "not found", but details would be useful.
Something is trying to use an 8rd 12gauge HE magazine from the Aegis mod, and that item is either missing or has a problem with its config.
If you don't have Aegis loaded, you need to load it. If you do have Aegis loaded, you need to verify its files to make sure they're intact.
If you have Aegis loaded and the files have been verified, you need to find out whether Aegis_8Rnd_12Gauge_HE (spelled exactly like that) is actually a real classname that exists in CfgMagazines. If it isn't (either doesn't exist or is spelled wrong) then you need to find the script or mod that's attempting to reference it, and either correct or remove that reference.
Yeah sorry this is the actual problem
No entry 'bin\config.bin/CfgMagazines/Aegis_8Rnd_12Gauge_HE.scope'.
has this for multiple items
Anyone know what the function is called for the little rotary circle that appears for example when you hold down a key to free a prisoner. As you hold it down the dots progress in a circular pattern until the prisoner is free.
BIS_fnc_holdActionAdd
Awesome thank you
how do i find the refernce
For item mass, what is the unit? kilograms?
it is a general unit that covers mass and volume
and it also depends on what mass are we talking about, o.b mass is kilos, ingame mass is a meaningless unit that represents the volume as lou says
what for?
so if someone need a similar script they can find it
Not really discords thing.
I don't see a rule forbidding you from doing so but please do care to add some context to it, since it's a "help with scripts" channel rather than "library of scripts" one
there are other discord servers around that are dedicated to snippet collection, I think even BI Forums have a thread and/or a category for such
How about he posts it, and one by one we make edits until it's no longer recognizable as his original work? Lol

one day we will have our own sqfbin
Is it possible to add Zeus modules via a mission script or only mod?
What a script can do is also possible for a Mod's script and vice versa too. tldr, yes
Sweet! Thanks 
Zeus modules aren't added by script, they're added by CfgVehicles, which is mod-exclusive
Not really vanilla but zeus enhanced has functions to create zeus modules via scripting
updAttPos; 67.48811; 3.03353;""
what is this to take 3ms?
is this sounds in a queue or some wss file fetching, or what is this? (almost all have the same sound)
Makes sense
๐ I'll need to check that out
UpdateAttachedPositions
Lights attached to vehicle (spawned by engine, all Man that have flashlight on are attached), Craters/SmokeSources are attached, Lights on vehicles (headlights)
"objects that need some processing between simulation and rendering"
They get separate simulation cycle.
Diag binary has "AttachedOn" diag_enable that will rnder debug shapes on some of them.
Seems lights use this simulation cycle, to move with their parent vehicle/unit.
Soldiers update their flashlight / IR ray.
fs is file system. So it'll be reads from disk
wssGD is instead wss get data.
Do you know when you might be up for releasing your C++ bindings Nou?
I'm really itching to check it out
thanks a lot ๐โโ๏ธ
doesnt the engine cache sound files, or it does and this is only a "get cached or fetch function"?
are camo coef and audible coef on the same scale? i.e 0.5 camo coef and 0.5 audible coef is same level of "hidden-ness"?
well they're both coefficients, so they both get multiplied by something
but they don't mean the same thing. 0.5 audible might mean you can get 2x closer to enemy (I mean half distance), but 0.5 camo might mean 0.1 closer (0.9 * distance).
blue leopard again looks weird
but ya figure decreasing by the same amount is probably the easiest way forward
I am trying to bind extra actions when Zeus closes/hides interface but my code doesn't do anything at all.
addUserActionEventHandler ["curatorToggleInterface", "Activate", { systemChat "Hello world!"; }];
Are you sure you're checking the correct action?
curatorToggleInterface is to show/hide the UI but remain in Zeus mode.
If you're trying to detect when the Zeus switches to/from Zeus mode, you need curatorInterface.
Yeah, the default BACKSPACE action. "curatorInterface" does work when I tried it out(just in case), but it's not what I need.
And tried it out in Vanilla too, just in case. But doesn't work either.
Anyone know if r2t can be used on Night Vision goggles?
Hi, need some help, for some reason even though i attach a flag file (.paa) to my mp mission folder, when i host on linux, its unable to find the flag. Do I need to use other paths?
ie; ./imagefile.paa instead of 'imagefile.paa'
It is all lower-cased?
yes
This is how its structured
I try to access it from the editor and scripts using its name "flag.paa", and it works fine on windows
but when I host the game on the linux server, it says image not found
Is there a scripting way to get a mod name from a pbo cfgpatches? Like figure out that ace_medical.pbo belongs to the ace mod?
Spawn...
sleep 5;
Spawn... When I write a script interrupted by a time delay as sqf, it works ok. But when I paste it into the ini of the Eden unit, I get an error. Here's an example
sleep must be spawned too if you want to use it in init, it won't work on its own in unscheduled environment.
ok, thank you for your reply.
you might want to write a separate file and then execVM it in the unit's init if the sleep must be outside of the spawns
OK now . you helped me a lot. Thank you ๐
Meabe try this Dude https://community.bistudio.com/wiki/Arma_3:_Splendid_Config_Viewer
i gotta fix this memory leak, and then the initial very low level bindings will be done
it'll require manual memory releasing though
i an add you to the github project if you want
its private for now
best experience i ever had was modding Minecraft ...
no official tools --> decompile, deobfuscate needed
+
as soon as you had access to the whole source code you saw what a gigantic mess Minecraft was :facepalm:
tbh ... i do not want to see ArmAs src code so i never have that feeling again i had back in the days i modden minecraft ...
the moment you realize that most stuff is done twice in the source + all APIs you have are screwed little bitches with missleading names and completly unusable other stuff is the moment you realize what you have done to yourself ...
thats why you also should never allow native code to be ran as mods ...
modders will screw you for every mistake you made in concept phase
I have question: If i spawned some function, and then i spawn it ones more, does it makes like separate thread? Or it removes old one with new? So if i have while in it will it spawn more while-loops?
Each spawn is a separate thread, doesn't matter where you called it from
Does the choice of language count ? huehuehue
Ok, so i need somehow to remove it before ill spawn one more, is it?
Yes. Save the handle and terminate it
it depends
for new people
no
for those few which do have knowledge in programming, yes
eg. you should try to stick to the C-Stylish langs
How do arrays work? I'm attempting to put a squad in an array, but I can't seem to get the syntax right
Ex: _squad1 = ["ai1", "ai2", "ai3", "ai4", "ai5", "ai6", "ai7", "player1"];
Without quotes
In what use case would you have quotes? I looked at the wiki and all the example arrays have them
if you want to have an array of strings, use quotes
if you want to have an array of groups, use the group's varnames without quotes
