#arma3_scripting
1 messages ยท Page 195 of 1
Maybe we get waterguns ๐ซ
lol @proven charm
i remember he said he was going to make it his top mission to fix the rail on the underwater gun
i wounder if its already fixed
he could have been joking
no no he seemed for real
They sent an emoji called "nopers", they were being sarcastic
Can someone spot a syntax error on this line?: (uiNameSpace getVariable ["playerHUD",displayNull]) closeDialog;
ah man
its not fixed
i forget who but someone said all the stuff is there, for the rail, its just not put in the game
i really don't want to change weapons under water, just for the flashLight to be on, and then change back, so i can fire underwate, but if i must i will
i wish they would fix that, cuz i dont want to use any mods
NikkoJT said
There is a rail in the model, it's just not used in the vanilla game
thanks
should have checked the wiki but I assumed the code was correct when I acquired it, haha
This mod, among many things enabled optics on the SDAR https://steamcommunity.com/sharedfiles/filedetails/?id=3380662680
Optic rail, not side rail, and in any case there's not much reason to expect BI to change it at this point.
wow, I just got shocked by seeing the default console ingame. I really got very used to the amazing ADT over countless hours.
Hope Leopard20 is well
ahhh man
well i guess i'll be changing weapons under water then
just for a flashlight lol
Try a head lamp mod
How would one go about detecting objects in a 15ยฐ cone from a point going in a specific direction?
Take the dot product of the cone direction against the relative position of the object.
whats the magic witchcraft to make an AI helicopter land smoothly ๐ญ
@rich frost helo1 LAND "LAND";
@digital hollow yeah umm i only use Vanilla m8
no mod is going in my game ever
i like a clean Arma 3 game woohoo
sep for maybe maps
is there a big differnce between land and landAt?
yes
LAND "LAND"; will land at the safest place it can find so you may want to put a helipad down some where
there are many chopper extract scripts out there and they are all realy good
In the way the helo flies, not to my knowledge.
The difference (for helicopters, leaving aside the syntax for planes) is that landAt allows/will allow in 2.20 more precise control over the landing position and when the helo is allowed to depart again.
i have a situation where ihave helicopters approach an airfield and taxi along the airstrip, lowering speed and altitude, set with flyinheight (also flyinheightASL) so they smoothly glide, down to like 10~15m atl. everything is smooth sailing until they get near the LZ's and they decide to pop up again to like 40m and only then execute the land cmd "land on rail" maneuver
Yeah that's just kinda how it is tbh
That's why #production_releases message exists
that addresses a different type of pop up, namely when the ai needs to burn energy between waypoints to reach desired speed on short distances. this is not the issue here
try that around trees, he he
You could do it by force, waiting until they get close and then doing position/velocity interpolation. Bit risky and probably not too graceful though.
putting them on rail myself, ay? :kek:
is there a way to disable their "object collision avoidance"?
It'd be handy if we had a relative version of unitCapture, so you could fly an example landing and have them use it every time. Or, well, it's a function so someone who understands vector maths could make one, I suppose.
i played around with that stuff before. guess i have to undust that test mission file. bezzier convertion or what its called is useful for that.
i can mangle sqf to execute my will myself, but thanks ๐
ok
was just hoping to find some forbidden heli landing knowledge here
if you look for other chopper scripts out there you will find your forbidden heli landing knowledge
Antistasi has a combat landing script that looks pretty good, but the code is wack :P
I need to convert that one to eachFrame but first I need to dismantle the algorithm.
i remember how that started out
Hi
How can i, with script, simulate the SHIFT + left Mouse button (player's custom waypoint) ?
addWaypoint doesnt help
clostest i can find is the getter for the position, but i dont think there's a setter
https://community.bistudio.com/wiki/customWaypointPosition
yeah i found this but i didnt fint a setter :/
is netId of an object always [owner id] + ":" + [unique int] ?
I'm having an issue where AI after spawning and getting their patrol waypoints, they always set a waypoint to [0,0,0], I believe the issue to be VCOM, and instead I am trying to fix the symptom, instead of the root of the issue, is there a way I can script a way to put all waypoints on [0,0,0] into an array and just delete them? I'm thinking of something similar to nearestobjects, but for AI waypoints
{
{
if (waypointPosition _x isEqualTo [0,0,0]) then { deleteWaypoint _x };
} forEachReversed waypoints _x;
} forEach allGroups;
thank you!
Guys how do I stop players from a certain side from accessing an object's inventory (or at least taking anything from it)
I guess InventoryOpened EH, check the primary container, return true if it matches.
thanks! I will check this out
Anyone able to aid me in a script to lessen damage taken by vehicles.
I'm using ace also, tried event handlers and it would reset the damage each time a new damage was created. Would prefer to avoid pulling and modifying a cpp for that
So damage handlers normally pass the new damage value rather than the added damage.
You have to look up the previous damage value for that hitpoint with getHitPointDamage so that you can find how much new damage was added in that hit.
yes, leo has taken it down
Some do. But for now, just know that they are off the workshop and don't reupload them. If you have one still local, you can still use it, just can't redistribute.
I just noticed the problem text on https://community.bistudio.com/wiki/setObjectTextureGlobal
and I see this sometimes for mods where they do put setObjectTextureGlobal in a objects init field, so wat would be the correct way then?
Via attribute or whats your exact plan?
its not actually something I do now. just that back in the day before I knew how to config I would change vehicle texture in init field. now pretty much I can just config like vehicle skins in right. so I was more so curious really
Yeah for vehicles you can directly add predefined skins in config and change skins in garage or via script.
For objects like flag, clipboard, buildings or whatever kind of object you can add custom attributes in config to make predefined or also custom with empty field so people can write their own (for missions as example own flag texture)
how to force AI Aircrafts landing gear?
If you mean lower their gear, no. There is no reliable way other than let them land to a airstrip
i should add for helicopters specifically
LandGear is actually broken. It never worked properly on my end
thanks. welp. will give that a try myself...
Even in on each frame, as suggested in the article?
IIRC it worked when the camera is close to the plane, but they refuse to do when the camera went away
amazing
Understood, it's sad.
At this point actually, I want a command to force animate a animationSource
good enough :harold:
I was wrong, but anyways, it makes zero sense. Not too interested to make a FT though...
okay I'm a bit confused as to how I can restrict access to a container to one side
are you referencing the pilot or the vehicle with a?
Wipeout is a Ghost Hawk is b, both are not pilot but vehicle
hm
not a scripter, but it seems where it says "true" should help me out here?
Thank you!
Yes.
Is there a way to get explosions that happen? Basically an event handler that detects that an explosion has happened at all, not just damage from explosion.
Hello all!
https://community.bistudio.com/wiki/getPlayerScores
says
This command does not work (returns empty array) if the unit's side has been changed (e.g [player] joinSilent createGroup east).
Do we know if starts to work again if the unit is returned to his original group?
I always use 'sensor' objects near where an explosion is expected and add the eplosion EH to them
i used use a traffic cone as a sensor and hide it
It should.
And if you can get the projectile, the expode EH might work for you (correction for spelling - explode)
I need to detect any and all explosions that can happen at any time at any place.
There's a projectile created mission EH?
I tend to avoid using it because, uh,
A lot of projectiles get created
Yeah, same I think I could check the projectile itself if it's explosive and track it after that, but I was hoping for something simpler.
What's the general goal, anyway?
Detect any and all explosion that can potentially happen on the map at any time for... reasons...
I want to log them.
Note that it can be something using CBA.
Suspicious. I like it.
I'm not sure projectilecreated will work for mines and planted explosives, but that's close. Also have to decide how "explosive" a bullet should be before it's considered explosive to you (for instance, some bullets are like 0.2 explosive)
You can do allMines though
yeah, but I need rockets, bombs, grenades, mines and pretty much all the explody things. Fired or spawned by scripts.
Yeah.
So allMines at the start to check for 3den ones, then...
I guess check if projectile created works with mines and whatnot, since they're technically cfgammo
Ok, got something working with this, I'm just worried about performance.
addMissionEventHandler ["ProjectileCreated", {
params ["_projectile"];
systemChat format ["Projectile created: %1", _projectile];
_projectile addEventHandler ["Explode", {
params ["_projectile", "_position", "_velocity"];
systemChat format ["Explosion: %1 at %2", _projectile, _position];
}];
}];
However it does work and catches all explosions.
Welp, it catches all explosions by weapons, but not objects exploding due to damage. That will require a separate function.
As for the projectiles I settle on this for now:
addMissionEventHandler ["ProjectileCreated", {
params ["_projectile"];
//we check if boolit is boomy
if (getNumber(configFile >> "CfgAmmo" >> typeOf _projectile >> "explosive") > 0) then {
// boolit is boomy so we need to attach an event handler to track where it explodes
systemChat format ["Projectile created: %1", _projectile];
_projectile addEventHandler ["Explode", {
params ["_projectile", "_position", "_velocity"];
// function for handling booms goes here
systemChat format ["Explosion: %1 at %2", _projectile, _position];
}];
};
}];
I'm looking through configs to figure out what tells the game if a vehicle is to explode on death. The HMG on tripod and the car has the "FuelExplosion" as explosion effect, but the HMG does not explode on death. They bot have "DestrDefault" as destruction type. What governs that I wonder.
I think this came up in #arma3_config recently and the suspicion was that it was hardcoded inheritance-based.
chaps,
https://community.bistudio.com/wiki/assignedVehicleRole
is broken for players according to kzk
is there an alternative or workaround?
What are you actually trying to get?
if player is in a given seat
in prowler, it's command , which is turret 1
but remote player is reported as driver regardless of what seat he's in
fullCrew should do it.
You can specifically check against driver/gunner/commander if you only care about a specific seat.
There is also getCargoIndex but weirdly no command to just ask what seat role a unit is in.
in prowler, im looking for commander
and in hunter, im also looking for commander, but thats actually a cargo seta
seat
ugh, commander _vec always returns nul in a prowler
regardless of if the seat is occupied or not
fullcrew is accurate, both locally and remotely
will have to use that
ah no, it isnt
ffs
its returning a nonexistant player unit as prowler gunner
It can't. Non-existent units don't exist :P
i have alpha_1 and and alpha_2 in mission
on remote player, it's returning [[alpha_1, "gunner",-1,[0],false,alpha_4, etc etc
there is no alpha_4 and never has been
when done on alpha_1 machine (also server) it's accurate
Assigned units are likely local but you don't care about them anyway?
You wanted to know what unit was occupying the seat, didn't you?
Assigned unit is separate.
im running scripts on clilents to give addactions when in particular vehicle seats
The unit in the seat is just the first parameter. "unit".
Not necessarily the same as the assigned unit.
yes, its the assigned unit that returns nonexistent
Why does that matter?
Also it is returning an object, so it must be an object that exists somewhere. You could go find it with getPosATL or similar.
i was just worried the command was even returning non existent units, not really inspiring confidence of the reliability of the command
especiually when assignvehiclerole is brokne too
assignedVehicleRole isn't broken, Arma just doesn't necessarily assign players to the seats they're in.
And a non-existent unit is objNull. If it returns anything else then the unit exists somewhere.
huh yeah, alpha_4 has a position, its an AI
ive been writing code for these games since 2005. i think i spend more time battling the engine than i do OPFOR
well yes
ok, from what i can see, assignedvehiclerole for players is accurate if they are in cargo seats
Is there any way to make a trigger that opens a simple/steerable parachute on a player whenever they fall through it?
I've been combing back through this channel but all I can find is broken code because that's all anyone brings here lol
this isn't true, this is the best place for code atm out of all the avenues. "broken" is subjective, it just might not fit your use. do you want it to be when you go through a trigger? or always available if they are falling?
Ideally it would provide them with an "Open Parachute" option without them having to equip a new backpack or use a mod like BackpackOnChest. Sorry if I caused offence, I was just being flippant because I've been really struggling to find code which fits my purposes.
I'm currently trying
{[_x,(getPos _x) select 2] call BIS_fnc_halo;} forEach thisList;
which seems to work well but is throwing some kind of error
This, to be precise
Presumably because the BIS function includes a suspend which isn't allowed inside of the trigger
use spawn instead of call
also, note on that function:
Wow it's that easy. Thank you very much, would you mind educating me as to the nuance between spawn vs call?
Does this mean I should use something else instead?
{
private _unit = _x;
private _pos = getPosASL _unit;
private _parachute = createVehicle ["Steerable_Parachute_F", [0,0,0]];
_parachute setPosASL _pos;
_parachute setDir (getDir _unit);
_unit moveInAny _parachute;
} forEach thisList;
but remember, you might have your trigger set up weird, say if you have it to detect a single person, the trigger will fire and only that person might be in the trigger area (thisList)
basically spawn starts a new thread and is scheduled, while call remains in current thread. if you want to do reading heres a link : https://community.bistudio.com/wiki/Scheduler
if you want an action version example:
player addAction [
"Open Parachute",
{
params ["_target", "_caller", "_actionID", "_arguments"];
private _pos = getPosASL _caller;
private _parachute = createVehicle ["Steerable_Parachute_F", [0,0,0]];
_parachute setPosASL _pos;
_parachute setDir (getDir _caller);
_caller moveInAny _parachute;
},
nil, 0, false, true, "",
toString {
isNull objectParent _this && {
(getPos _this) # 2 >= 5
}
}, -1, false, "", ""
];
Could I throw an addAction in here to make it so you can open the chute
wow you did it before I could even finish typing
wild
i'm just pulling from some of my repositories https://github.com/hypoxia125/Carrier-Strike/blob/master/addons/game/functions/fn_PlayerActions.sqf
he's a very advanced AI model we train daily
Damn that's impressive that you had something prewritten for this occasion. I'm trying to set it up so that a team leader selects a location on the map, their squad gets teleported into a Xi'An which is flying towards the location selected, the ramp lowers, and each player is ejected and given an open parachute option.
Basically a gentrified HALO drop for your whole squad.
Think I know how to do most of it but I've been struggling with the parachutes and with setting up the Xi'An on a flight path. At least now half of my problems are solved lol.
i have a LOT of stuff prewritten in various things. just have to adapt them to people's uses
but that is a VERY common question
for halo jumping
Ah apologies for repeating it then. I did have a poke about but what I was trying just wasn't working. Fortunately for people like me there are people like you, or I would never be able to make half the awesome stuff I put together.
If you want to "gentrify" (hilarious) off the ramp https://www.youtube.com/watch?v=QzvRdTgn-r4
Alas the inside of the Xi'An is not walkable so far as I can tell
ah, correct.
I love DCS ๐
Okay so I feel like I'm getting pretty close with this script. But I can't figure out how to get the pilot to fly a predictable route over the drop zone instead of getting distracted and headhunting a random unit or flying off in some bizarre holding pattern. Is there a way to turn his brain off so he just spawns, flies over the DZ, and then gains altitude and flies off so I can delete him?
force to careless behaviour or maybe disableAI "CHECKVISIBLE" may help.
Careless behaviour + flyInHeightASL
-# i just read it as disableAI "VIBECHECK"
I shall experiment and report back 
Using RID to 'trigger' a shotgun trap.
Place a shotgun weapon/prop, rotate it to point towards the door, and attach it to the table.
The shotgun gets a checkbox from RID, which gives it an init box for scripting that is activated when the trap is triggered.
Use the RID mod to create a tripwire, and then connect it to the shotgun.
I think I should be using _this ForceWeaponFire [_this, "Single"] but I'm questioning the double _this, especially as the first variable is meant to refer to a unit - which is missing in this case! Is there a proper syntax, or perhaps a different command I can drop in that init box?
Was trying to check the Bohemia forums, but I keep getting the 'maintenance in progress' screen - would appreciate any assistance!
Er is getting players to eject from a flying vehicle harder than it sounds? None of the commands I'm using are working...
not even https://community.bistudio.com/wiki/doGetOut ?
No it made the Xi'An land on the ground to let all the AI out lol
Just did nothing
well, eject action works for me
also, using actions is better/more consistent when you execute it locally
So everything works except after the pilot flies over the waypoint and all the infantry gets kicked out the back, he always pulls a u-turn and hovers randomly, ignoring any new doMove's or flyInHeightASL's I give him
not really sure what I need to do to just get him to fly in a straight line up into the clouds
Are the infantry in the same squad as the crew?
That's an interesting question
_xian = createVehicle ["O_T_VTOL_02_infantry_dynamicLoadout_F", _spawnXiAnPos, [], 0, "FLY"];
createVehicleCrew _xian;
{_x moveInCargo _xian;} forEach _infantry;
would this put them in the same group?
Shouldn't do. createVehicleCrew creates a new group for the crew.
Oh, make sure you do leaveVehicle on the infantry group.
Otherwise they might have some brainworm about trying to get back into the vehicle.
LA/LE btw.
{group _x leaveVehicle _xian;} forEach _infantry;
Like this?*
No, leaveVehicle on the group.
Uh, if all the infantry are in the same group then you should only do it once.
Nah I just don't trust any Arma AI command to be spam-proof.
Understood
Still does an unexplainable U turn I'm afraid
is there any way I can just force the aircraft to go forwards and up
I just want it out of sight of the playerbase before it gets deleted 20s later
Yeah lol I just sighed when I pulled up the wiki
Anything cheap and dirty?
I'm just annoyed doMove isn't working
setVelocity/setPosASL/etc spammed eachFrame does the same thing.
Anyone know why a composition init might execute when copied as part of a larger composition by Zeus but not when placed in Eden prior to start?
Is it possible to stop terrain object damage? Specifically to trees?
allowDamage should do
Hmm, so allow damage false to all trees on the map? That should be ok to do?
I don't believe it would do any bad
find moduleCas function in the functions viewer, get the idea for setVelocityTransformation there
Game updates basically never break mods though, so why would it?
welp, good if so, however it has happened to me before that I would see scripting errors when using some mods that haven't been updated since like 2018.
though considering Arma 4 is just a few years out I guess we should be good
I'll for sure backup my local copy of Advanced Developer Tools in multiple places cuz that sheesh is gold ๐
I would blame the Mod if that is a case
I already reuploaded it
is thereenableUAVConnectability alternative command that uses specific UAV as reference instead of player ?
Man it is so hard to make a plane fly in a straight line. I genuinely cannot get it to work and I've been at it for hours. Of all the parts of this script I did not think flying in a straight line would be the hardest part.
do you give the plane a waypoint?
I've tried every variation of waypoints and setting velocity etc... that my skillset allows
I just need it to fly in a straight line from south to north at about 200m/s over a specific location
try these: ```
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointCombatMode "BLUE";
The only issue I'm ever having is that after all the infantry jump out, the pilot will randomly do a U turn and hover in midair about 50% of the time. I wonder if there is just some AI behaviour that I can disable?
It changes direction between the waypoints and then just ignores any other code that I write
well you can use waypoints all the way to give the plane position where to go
like this
I think format got updated to display error when it misses parameters. Despite the error everything works fine, provided it was working before.
What does this do? I'm trying to reverse engineer it but I don't really understand what is going on?
We are breaking one mod in 2.20
But that is because the mod's config was totally and utterly broken and wrong
This didn't work btw, plane still just pulls a U-turn unexplainably
I don't know whether the pilot is spotting units on the ground or getting upset about the friendlies disembarking
did you use code for the waypoints? or set in editor
_xian = createVehicle ["O_T_VTOL_02_infantry_dynamicLoadout_F", _spawnXiAnPos, [], 0, "FLY"];
createVehicleCrew _xian;
_xian deleteVehicleCrew gunner _xian;
_xian setPosASL _spawnXiAnPos;
_xian setDir 0;
_xian setVelocity [0,200,0];
_XiAnWaypoint = group driver _xian addWaypoint [_despawnXiAnPos, -0];
_XiAnWaypoint setWaypointBehaviour "CARELESS";
_XiAnWaypoint setWaypointCombatMode "BLUE";
driver _xian disableAI "CHECKVISIBLE";
driver _xian setBehaviour "CARELESS";
driver _xian disableAI "AUTOCOMBAT";
//driver _xian disableAI "PATH";
driver _xian disableAI "TARGET";
driver _xian disableAI "CHECKVISIBLE";
_xian flyInHeightASL [1600,1600,1600];
It just completely ignores the waypoint and starts doing donuts in the sky
flies in an arrow straight perfect line for 30 seconds, then usually about 5 seconds after the infantry bail it just starts ignoring all instructions
add ```
_XiAnWaypoint setWaypointType "MOVE";
you dont need all the disableAI code
infact it could create more problems
didn't work
Read only base classes?
no
Ah no. That was too recent
Well I guess we are not breaking the mod itself.
We are just allowing letting the mod break everything else (like it intended to do from the beginning)
Hi guys, do you know of any simple tool that would allow me to create simple documentation for my SQF functions by extracting and formating comment headers, possibly identified by a XML tag or any other string? Thanks
Reenabled all those AI modules, same problem as before
It just doesn't care
๐ซค plane cant move outside the map?
is it in careless mode? otherwise it just ignore it... but I saw that you're already did that.
Can you check with zeus if the unit/Group of the jet is really in careless mode?
Do you use AI mods?
It's true I had LAMBS on but moving the waypoint inside of the coloured area of the map fixed the issue
This was the problem
Arma is the worst
it moves an object every frame from one point to another on a straight line and at a fixed speed
weird, I've never had any issues with this, I can set waypoints outside of the map and it works. I'm working on a CAS menu and some times I place the waypoint for the jet outside of it.
Do you know the cas module right? from zeus
perhaps it wasn't the issue directly but moving all waypoints inside the map area and adding a second waypoint after the first seems to have fixed it
Yeah I tried to reverse engineer it for 5 hours and gave up
Did you try to copy out the function and try to call it yourself?
That's what I did at first time, then I run multiples diag_log or systemChat to see what the code is doing to understand.
If don't understand what the code is doing, trying to reverse engineer it is just a waste of time
setVelocityTransformation is hard to understand at first sight, but try to read it line by line, see where the local variables come from and what changes based on the parameters required by the command
waypoint is so close to map edge though
can you explain the start point? do you spawn this aircraft by script or is already spawned in the editor?
player opens map, clicks on map, xian is spawned 6km directly south of where they clicked on the map, xian flies directly north over the point where the player clicked, ejects all infantry over this point, flies off the map and despawns
so are you having problems with the despawn waypoint?
The problem is that about 30% of the time just after the infantry get ejected the xian does a U-turn and hovers near where they were ejected
hmmm can you show us your spawn script?
_xian = createVehicle ["O_T_VTOL_02_infantry_dynamicLoadout_F", _spawnXiAnPos, [], 0, "FLY"];
Moved the 2nd waypoint back inside the map and it still breaks
Even if I manually give them new waypoints in zeus the pilots just hover and ignore their commands
running your code
Thank you, here are the scripts if you want them in full.
@minor viper
The problem is that about 30% of the time just after the infantry get ejected the xian does a U-turn and hovers near where they were ejected
so why do you spawn another waypoint near the ejected place? sometimes the aircraft can't reach the required distance to despawn (those waitUntil distance of yours)
also, if you working on with waypoint, you don't need those waituntil to delete the aircraft, you can just use setWaypointStatements
_despawnXiAnPos = [_posX, _posY + 15000, _posZ + 1600];
_moveXiAnWaypoint = group driver _xian addWaypoint [_despawnXiAnPos, -0];
_moveXiAnWaypoint setWaypointBehaviour "CARELESS";
_moveXiAnWaypoint setWaypointCombatMode "BLUE";
_moveXiAnWaypoint setWaypointType "MOVE";
Originally it looked like this, with one waypoint 15km north. I only added the 2nd waypoint on the suggestion it was due to waypoints being outside of the map
also, consider using https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#MapSingleClick, you can pass arguments in MEH
the aircrafts can go outside of the map, the problem that you have is the second waypoint xD just remove it
and use setWaypointStatements
Okay but this bug was still happening even when there was just one waypoint. I will delete the 2nd waypoint now and test.
also, fix those if then syntax, you don't need that if (true) or if (something == false)... those type of commands already returns a bool
_moveXiAnWaypoint setWaypointStatements ["true", "{ _xian deleteVehicleCrew _x } forEach crew _xian;
deleteVehicle _xian;"]
```like this?
_xian is a local variable, so it will not work like this. You need to get the vehicle inside the waypoint statement by using thisList or this.
_xian = vehicle this I think this should do it
Removed the waypoint and the xian still circles back and hovers
something is breaking the AI and stopping it from following waypoints
is it the moveOut code?
show me your code
_pos = _this select 0; //_pos = position selected for airdrop
_vipers = [viperLeader, viperDemo, viperMedic, viperMarksman, viperRecon];
openMap [false, false];
_posX = _pos select 0;
_posY = _pos select 1;
_posZ = _pos select 2;
_movePos = [_posX, _posY, _posZ + 1000];
_spawnXiAnPos = [_posX, _posY - 6000, _posZ + 1600]; //6km south of drop
_despawnXiAnPos = [_posX, _posY + 15000, _posZ + 1600]; //15km north of drop
_xian = createVehicle ["O_T_VTOL_02_infantry_dynamicLoadout_F", _spawnXiAnPos, [], 0, "FLY"];
createVehicleCrew _xian;
_xian deleteVehicleCrew gunner _xian;
_xian setPosASL _spawnXiAnPos;
_xian setDir 0;
_xian setVelocity [0,200,0];
_xian flyInHeightASL [1600,1600,1600];
//_xian doMove _movePos;
_moveXiAnWaypoint = group driver _xian addWaypoint [_despawnXiAnPos, -0];
_moveXiAnWaypoint setWaypointBehaviour "CARELESS";
_moveXiAnWaypoint setWaypointCombatMode "BLUE";
_moveXiAnWaypoint setWaypointType "MOVE";
_moveXiAnWaypoint setWaypointStatements ["true", "{ _xian deleteVehicleCrew _x } forEach crew _xian;
deleteVehicle _xian;"];
{_x moveInCargo _xian;} forEach _vipers; //Teleports all OPFOR into XiAn passenger slots
waitUntil {_xian distance2D _pos < 1250};
_xian animateDoor ["Door_1_source", 1]; //Opens XiAn Ramp
waitUntil {_xian distance2D _pos < 150};
group viperLeader leaveVehicle _xian;
{
moveOut _x; //ejects passenger
_vel = velocity _x;
_vx = _vel select 0;
_vy = _vel select 1;
_vz = _vel select 2;
_vel = [_vx/8,_vy/8,_vz]; //reduces velocity of paratrooper
_x setvelocity _vel;
_x addAction //adds parachute
[
"Open Parachute",
{
params ["_target", "_caller", "_actionID", "_arguments"];
private _pos = getPosASL _caller;
private _parachute = createVehicle ["Steerable_Parachute_F", [0,0,0]];
_parachute setPosASL _pos;
_parachute setDir (getDir _caller);
_caller moveInAny _parachute;
},
nil,
0,
true,
true,
"",
toString
{
isNull objectParent _this &&
{
(getPos _this) # 2 >= 5
}
},
-1,
false,
"",
""
];
uisleep 0.1;
} forEach _vipers;
uisleep 1.5;
_xian animateDoor ["Door_1_source", 0]; //closes ramp door
_xian flyInHeightASL [2000,2000,2000];
Somewhere in here, something is disabling the AI and preventing it from following waypoints
It only happens about 30-50% of the time, and it only happens after the infantry are ejected
mine is woking fine by using your code
only using CBA + zeus enhanced + ADT
can we go to creativity lounge and I will show you?
can't rn, but I think your problem is some mod
enemies on map also effect the AI planes behaviour
let me try setting opfor/greenfor relations to neutral
no if in careless mode
It sets it to blue like you said
yep..
it's working fine with enemies near the position
are they near enough ๐ค
well, "near" on the ground ๐
yea, try putting tank on the planes path
ok then im once again out of ideas :/
@minor viper
_moveXiAnWaypoint setWaypointStatements ["true", "_xian = vehicle this; { _xian deleteVehicleCrew _x } forEach crew _xian;
deleteVehicle _xian;"];
Testing without LAMBS now
send your mod list
Advanced Sling Loading <- at least in Liberation this mod breaks up AI
gonna test your code with lambs
with lambs_danger: okay
Still occurs without ASL
try to call your code in your debug menu, like I did
with a pre-placed position
Still bugs
so, the aircraft makes an U-turn after dropping out the troops?
try a new scenario
and try without ANY mods
or at least with zeus enhaced
Then it either flies in circles or comes to a stop and hovers
but not all the time
only 30% of the time it bugs
is there something more in your scenario? more scripts running behind?
I mean it's a whole gamemode I've been working on for weeks
but nothing should interfere with the script
well never say "nothing should interfere" xD
there are infantry on the ground and stuff which I thought were distracting it but it's not that
Everything to do with this plane and airdrop are contained within these two scripts
I suggest you run this code in an empty scenario
only with the required troops and pre-placed position
Empty scenario with full modpack loaded it doesn't seem to bug, so the AI must be getting distracted by something else in the scenario?
did you check if the group of the aircraft is in careless mode after dropping the troops?
How do I check that
with zeus (enhanced)
double click on the group of the aircraft and check what behaviour is selected
Careless yeah
Can anyone tell why this script isn't working? It is supposed to help with mission design by showing a group's varname as a callsign in Zeus during scenario tests.
this setGroupIdGlobal [str(this getVariable "varName")];
hint str this;
{ _x addCuratorEditableObjects [units this, true]; } forEach allCurators;
Edit: The solution turns out to be creating a trigger and putting the below code into it. getGroupIdGlobal gets overwritten if it is executed during init, so you need to create a trigger and set it to 'any player not present 1 second'
hint "Processing";
{
_x setGroupIdGlobal [str (units _x select 0)];
} forEach allGroups;
what is not working
Would it be too flippant to say 'anything'? XD
The tooltip says "R " and the Zeus sees the callsign as Delta 3-6 currently. I've done some debugging, but there are a few things still vexing me.
setGroupIdGlobal["Test"]
hint str this
gets me 'This' but still shows the group as Delta 3-6 in Zeus.
I'm not sure if adding an object to Zeus again actually updates the callsign, or if I have to remove it before re-adding it. I'm also not sure I'm calling the varname correctly, because it seems to be interpretting str(this getVariable "varName") as a blank string.
So I've currently got two lines of code, one operation, and three errors. Sadly not a record.
where do you set this variable "varName"?
In the group editor. It's the actual variable name of the group. I may be calling it wrong. It's been a while.
you're doing this in the group's init?
Indeed
Every object that you add in zeus is a new one, no copies. If they are units, it creates a new group
working fine
Editor
where did you get this "varName" idea?
My friends are used to me giving faction templates with pre-filled callsigns to use as tooltips, but the export function I used to use is broken, so I'm looking for other ways to help them tell which unit is which.
Thank you so much! Whatever happened, I hope everything is going well for you ๐
I can not overstate how much this mod helped me with developing mods and advancing my arma knowledge!
Turns out it only happens when all of the infantry are AI, but it happens even on a new empty scenario
as long as there is at least 1 player it works fine
one player where
in the back of the Xi'an
If you zeus control the viperLeader, start the airdrop, then release control it bugs every time for me
my player unit was on the ground, and it worked fine all the times that I did the test
did you test this without any mods?
So this is where I'm trying to execute it, and where it doesn't seem to be working.
that getVariable will always return nothing, because "varName" doesn't exists if don't set it up first (setVariable). And if so, you need to remember that the game has a Initialisation order (https://community.bistudio.com/wiki/Initialisation_Order), object's init execute before any scripts, except functions with preinit, also, why are you doing in this way? sorry, I still not sure what are you trying to achieve here
But str this returns the callsign, so how do I check the variable name of the object? I thought it was varName.
why do you want to check the var name? for what?
str this will use the Editor-set variable name if it has one. If it doesn't, the entity doesn't actually have a human-readable representation, and it will be represented by its group ID instead.
so in that case, in that last screenshot, the hint should return the variable name?
I made a more detailed note about it in the Editor channel yesterday, but I am going through my custom faction compositions and setting the default varname for each group to a suggested callsign. I chose that because it appears in the Eden editor when they are initially dropped in, and my friends are used to my using the callsigns as tooltips.
So when they place the groups in the editor, they're going to look to the callsign expecting something like 'FactionnameUnitPurposeNote'. Unfortunately I'm coming back to a version where it doesn't appear to be possible to copy units without resetting their callsigns, so they're going to expect [Tooltip] and get [Lima 3-2] instead, and I would prefer they see [Lima 3-2(Tooltip)].
Typical behavior is to copy units in, test the scenario, and then write scripts for them, so I want the default script to preserve that tooltip until someone replaces it.
Yes, although doing hints and such during init phase might have unexpected results. Some things aren't necessarily ready yet.
That's good to know; thank you. It comes up blank though, which is odd.
well, because it doesn't show the variable name in my tests
Might be different for groups vs normal entities
It sounds like I might just be able to use str(this)?
It's different for groups vs normal entities
It seems like Zeus doesn't use the actual callsign of a unit, but assigns one, so the real question is probably 'How do I set the callsign that curators see from a script?'
what do you mean by "doesn't use the actual callsign of a unit?
It's super weird.
You can see it here. I've manually set a callsign, 'Yet Another Callsign', which the script is supposed to override and change to 'Thisisstupidbutitworks', but instead it ends up called 'Echo 1-5', but Zeus shows it as 'Delta 3-4'.
So there's at least four callsigns here, and the one I want, 'Thisisstupidbutitworks' is the only one that the game seems to ignore completely.
It's not Zeus, it's a locality issue. Editor-set callsigns aren't properly synchronised in MP; they're set on the host, but only on the host. If the Zeus is the host, they'll see the Editor-set callsign. Until/unless BI changes the Editor to use the global version of the command, you'll need to do it yourself with setGroupIDGlobal.
That's actually what I've tried to do here. I think it may just be a syntax error, but I'm not seeing what it is.
I'm sorry, but i'm still trying to understand why you want to get the var name instead of just putting the name that you want in the command
If the script were working, both the top left and top right of the in-game screenshot should say 'Thisisstuipidbutitworks'.
and also you have many alternative ways
where is this function or script that are you talking about?
In what context are you testing this? Local test, player-hosted MP, dedicated server...?
I'm trying this because I've got a couple people who are going to use these units I'm making, and are going to look at the Callsign in Eden expecting information, and I want the same information to carry over to Zeus. Variable name just happens to be displayed in the right place in Eden, and I expect they'll prefer to see the message and then change the variablename if they need to than to not see the message.
Just a local test right now.
I'm testing in local Editor test and all callsigns are being set as I would expect them to (I can see the Editor-set callsign, and if I change it with setGroupIDGlobal I can see the new version)
it should work normally, it worked for me, but not like doing "str this", because it really returns the callsign, which is correct, so nothing wrong with it
Are you putting the script in the group init in Eden or starting the test and then executing setGroupIdGlobal through Zeus?
Group init field
That's great. So if you put it in the group init, set the variable name of the group to ITWORKS, and then press 'Enter' twice to test the scenario, you can go into Zeus and it shows the Callsign as ITWORKS?
Can you paste the code you used? Do I maybe have my Zeus misconfigured? I'm using the GameMaster module and syncing it to the player.
Nikko already said that it doesn't work like a normal entity
this should be simple: this setGroupIDGlobal ["newName"]. You can explain to me 1000x times, I still don't understand why you want to use var name, I'm dumb 
Did he say that scripts written in the editor couldnโt affect curators? If so I misunderstood. I thought he was just saying that Zeus assigns its own names, but I assumed that a script could override that and make it show whatever.
I can see the Editor-set callsign in Zeus, and if I change it to something different using setGroupIDGlobal in the group's init field, I can see that new version. I do not see any autogenerated callsigns.
I cannot use this setGroupIDGlobal [str this] because it doesn't work like that. Object and unit entities return their Editor-set variable name if you do str this on them, but group entities do not; they return their group ID.
* by "cannot" I mean it doesn't do anything helpful, it does "work" but the results are not useful because you're just setting the group ID to...the group ID
sup! I'm trying to do local mod for more brighter nights but everytime I try I got this "'bin\config.bin/CfgWorlds/Altis/Lighting/sunSunset' is not a value'" error what should I do ?
You'll probably need #arma3_config for that
oh okay thanks
hey guys when i use either this or getArray function to get an array out of the configFile, the bools and arrays inside those always become strings
is there anything i can do about that?
Example?
oh i found the arrays being returned as string was my syntax error, they were moved from a sqf and still were [] in stead of {}
but the issue with bools persists, here is an example
if you have in configFile class MyClass { parameters[]= {0.5, true}; }; then getArray (configFile >> "MyClass" >> "parameters") returns [0.5, "true"]
Is this correct class? AFAIK it must have properties.
the same happens when using BIS_fnc_getCfgData
sorry yeah made a mistake in my example, its corrected
its been a long day of digging at this ๐ฅฒ
decided to just use ints in stead 
Config doesn't actually support bools. If you type true in your config the parser just assumes it's a string.
thanks for the help guys
You can try this:
parseSimpleArray (str (getArray (configFile >> "MyClass" >> "parameters")));
im trying to take as few steps as possible in the code, so just opting for replacing the true and false in my data with 1 and 0, its no big deal to change it
Or you can store arrays as strings and then
parseSimpleArray (getText (configFile >> "MyClass" >> "parameters"));
is there the ability to animate a non simulated object?, im sure its been asked a million times i dont care for the actual animation, i just need the end appearance of an animation
gun_0 addMagazinesTurret ["100Rnd_127x99_mag_Tracer_Yellow",[0],10];
what do you MEAN
What version of the game are you using?
Latest profiling branch
is this a coaxial gun?
no, it's an FIA m2 machine gun (low)
additionally check a lower number on last parameter (see warning)
Not sure if this command exists in profiling branch. Does the command work on other vehicles?
Command is dev branch only until 2.20
for "_n" from 1 to 10 do {
gun_0 addMagazineTurret ["100Rnd_127x99_mag_Tracer_Yellow", [0]];
};
Hi guys, do you know of any A3 addon template, that I could use as a starting point for building my addon and for learning about best practices for structuring folders and naming files? Thanks.
Thank you to @warm hedge and @modern plank for being actually helpful as I attempted to do this, and also to the others who said things, and I have officially done the simplest possible thing one could want to do after only 24 hours banging my head against it.
hint str (units this select 0); <- Returns the variable name of the the first object in a group. This allows you to get a variable name from Eden into a group for use in scripts.
This is almost a solution to the people who have had issues with the Set Callsign module as well, and I will update it when I eventually get there.
I suggest using the hemtt method
hello does anybody know the script command to switch fire modes, or can we even switch fire mode by script command
also theres:
unit action ["SwitchWeapon", targetUnit, targetUnit, muzzle index]
@fair drum thx man Awsome
ummm i don't see any switch fire mode in there @fair drum ummm em i missing somthing
ahhh ok i see thx man: thx NikkoJT and Hypoxic, you guys Are Awsome
thx guys works perfectly woohoo Arma 3
can someone please helpme, I cannot load savegame in single player missions.
Hey any chance of disabling friendly fire for grenades(Its a long shot i know), asking for a friend btw.
gonna have to provide more info than that. errors?
I solve itโฆ it was the new mod I instaled
So for some reason my dedicated server just seems to somewhat ignore my difficulty settings am I doing smth wrong. It says custom difficulty when I press escaoe and look at the mission in the bottom left but my settings are not 1 to 1 what I put.
To test im placing a guy down in Zeus and checking his skill level
This is the misssion cycle in my Server.cfg
// MISSIONS CYCLE
class Missions
{
class Overthrow
{
template="OverthrowMpAltis.altis";
difficulty="Custom";
};
class Training
{
template="RB_Training1.altis";
difficulty="Custom";
};
};
This is alll text in my .Arma3Profile
class DifficultyPresets
{
class CustomDifficulty
{
class Options
{
groupIndicators=0;
friendlyTags=0;
enemyTags=0;
detectedMines=0;
commands=0;
waypoints=0;
weaponInfo=1;
stanceIndicator=1;
reducedDamage=0;
staminaBar=0;
weaponCrosshair=0;
visionAid=0;
thirdPersonView=0;
cameraShake=1;
scoreTable=1;
deathMessages=0;
vonID=1;
mapContentFriendly=0;
mapContentEnemy=0;
mapContentMines=0;
autoReport=0;
multipleSaves=0;
tacticalPing=0;
};
aiLevelPreset="Custom";
};
class CustomAILevel
{
skillAI=1;
precisionAI=0.69999999;
};
};
activeKeys[]=
{
"BIS_DROace.Zargabad_done"
};
Server config AI skill is a multiplier on the mission-level skill, not a direct setting/override. (I think it's actually more complicated than a simple multiplier but you get the idea)
do u have any idea how I would change that
so I would have to change it through the mission?
there is no way to overide it?
You can change the mission-level skill within the mission itself, using commands like setSkill. It's still affected by the server skill settings as well, though.
This page has more information. https://community.bistudio.com/wiki/Arma_3:_AI_Skill
This is from that page
Yes, they can change the server config skill, but it's still not an absolute override. The server config skill is combined with the AI unit's individual skill, which is set on the mission level, to produce its final effective skill.
crazy
would a mod be able to overide?
Any script that runs during the mission can adjust the mission-level skill settings. You could use a mod for it if you want. For example, your mod could contain a postInit function (runs when a mission launches) that changes the skill for all existing AI, then adds an entityCreated mission event handler to catch units that are created later.
A mod can also change CfgAISkill as described on that page.
All the different ways of setting skill are combined together. If you want total control, you'll need to change all of them. There is no one place that fully and exactly overwrites the final number - everything works together to produce the final total through maths.
so is there some sort of equation or?
I mean, presumably, but it's pretty opaque. We don't have direct access to see how the engine crunches the numbers. That page contains about the best information on it you're going to get, unless a dev shows up to give more exact details.
I think there might have been some slightly (slightly) better insights shared here over time, but I am not getting into a fight with Discord search to hunt them down.
why was it made that way ๐ญ
(If a dev does show up to give more exact details, ask them to add the information to the wiki page :U)
Partly because the game's ancient and many of its systems were built on top of each other over many years.
Partly because having multi-level control is good, actually. The mission can decide how its units are skilled relative to each other - elites vs grunts, etc. Then the server owner (who may be a different person) can decide a more general range within which those relative values exist. This allows the mission to have its different flavours, while still allowing the server owner to calibrate the difficulty they want for their community.
sure but like list it somewhere ๐ญ
can you give me an example of how the command would go to set all units to 1
The documentation is very much a work-in-progress. For a long time there wasn't really a lot of documentation direct from BI, on anything, and the community had to reverse-engineer it. Now BI does do direct documentation, but most of the people who originally built the game are no longer working on it, so now BI is also having to reverse-engineer it. And even for BI, the AI code is a horrifying nightmare that no one wants to touch.
How in ARMA 3 can i check if something is inside a building or outside
I want to avoid placing things outside of a house
This is a general example and there are other ways you could approach this for different situations and results.
{
private _unit = _x;
{
_unit setSkill [_x, 1];
} forEach ["aimingAccuracy", "aimingShake", "aimingSpeed", "spotDistance", "courage", "commanding", "spotTime", "reloadSpeed", "general"];
} forEach units west;```
Remember, this will still be affected by the global config settings.
im using that but it says 0 when my char is inside a building
wait so I copy this and paste it into where exactly? im sorry
its weird, sometimes says 0 and sometimes it gives value, do i nee dto create a test unit and test a position with it
Well, I'd recommend trying to understand what it's doing rather than just copy-pasting it. There are a lot of different ways to do this and it's going to depend on exactly how you want this to behave.
I feel like this stuff is always way too out of touch for me really
I can have my friend who is more experienced at coding do it and then explain it to me verbally
that would probably be easier
You could put this in the debug console and global exec, in which case it would affect all currently-existing units on BLUFOR - but not others created later.
You could put it in init.sqf or in a postInit function, in which case it will affect all BLUFOR units existing at the start of the mission.
๐คท
That's going to be down to your game/mods/server stuff, not really a scripting issue.
// Debug script to test interior position validation at player position
private _debugInteriorValidation = {
// Get player's exact position and nearest building
private _playerPos = getPosATL player;
private _nearestBuilding = nearestObject [player, "House"];
systemChat format ["DEBUG: Testing position %1 in building %2", _playerPos, typeOf _nearestBuilding];
// USE insideBuilding - much simpler and more accurate!
private _insideValue = insideBuilding player;
systemChat format ["insideBuilding value: %1", _insideValue];
if (_insideValue == 1) then {
systemChat "โ
โ
โ
FULLY INSIDE BUILDING โ
โ
โ
";
} else {
if (_insideValue > 0.5) then {
systemChat "โ ๏ธ PARTIALLY INSIDE (maybe doorway/window area)";
} else {
if (_insideValue > 0) then {
systemChat "โ BARELY INSIDE (likely porch/balcony/covered area)";
} else {
systemChat "โโโ COMPLETELY OUTSIDE โโโ";
};
};
};
};
// Run the debug check
[] call _debugInteriorValidation;
how it says completely outside, 0 ๐ฆ
Try the command I suggested.
is it the else condition thats wrong
insideBuilding depends strongly on how the building is configured, because it reads information from the surface you're standing on. If the building is set up wrong (not uncommon) then that's it.
yes i did
lineIntersectsSurfaces [
getPosWorld _this,
getPosWorld _this vectorAdd [0, 0, 50],
_this, objNull, true, 1, "GEOM", "NONE"
] select 0 params ["","","","_house"];
if (_house isKindOf "House") exitWith { true };
false
};
onEachFrame { hintSilent str (player call KK_fnc_inHouse) };```
but it considers this to be inside a house
and if i walk out of it, it says im outside
what minimal code can i add that would detect this as outside
This code works by drawing a line straight down from a position 50 metres above your head, and if it hits an object that's roughly houselike, it considers you to be in a house. It looks like there's an awning above your head, which is probably configured as a house-type object or is part of the house, and that's what it's hitting.
You could reduce the distance if you want it to be a bit more specific. You could also add more line checks running horizontally, to see if you're surrounded by walls.
It does get very complex though, because e.g. being in an alley with something above you could seem to be "in a house".
This is a difficult problem to solve with 100% reliability, just because the definition of what is "in a house" isn't something that really exists as a measurable thing within the game. House objects aren't set up with invisible volumes denoting indoor areas that you could check against. You can check various things that usually correlate with being in a house, but ultimately it's just an educated guess.
That really sucks, one would think it'd be a fairly rudimentary thing to have
Nice to have yes, rudimentary no.
Most of the game doesn't need it. Players will largely do whatever regardless, and AI doesn't think in these terms. If a system did exist for defining indoor areas, it'd mean a lot of extra work for the people making the house objects, for information that's not actually used that often.
Basic building block command that'd be useful for many users
Hmm i'd think you'd at some point wanna check if something is inside or not
Maybe you can try something with soundControllers
If you want to let's say avoid placing things that are out in the open for example
I'm pretty sure sound controllers use the same information as insideBuilding
Hm
i think i can just skip this kind of building
It is possible to do this, to a degree.
Buildings do (mostly) come with configured positions for AI navigation; you can reference that. You can also get the building's position and size and then look for a clear space within that. Or you can do line intersection checks - they're good enough for avoiding "out in the open", even if that doesn't always exactly mean "inside a house".
Try this:
KK_fnc_inHouse = {
private _position = player modelToWorld (player selectionPosition "head");
lineIntersectsSurfaces ([
_position,
_position vectorAdd [0, 0, 50],
_this, objNull, true, 1, "GEOM", "NONE"
] select 0) params ["","","","_house"];
if (_house isKindOf "House") exitWith { true };
false
};
And, y'know, insideBuilding checks are usually reasonably correct, it's just up to mod makers to get it right.
If buildings did include defined "inside" volumes, that would still be subject to the same limitation. Mod makers could still forget to include one. (One reason among many why it won't happen now - not backwards-compatible at all.)
Position generation wasn't the problem with the previous code. This new version still has exactly the same issue I described here: #arma3_scripting message
Maybe, or maybe the command returns the intersection with the floor, which I encountered.
lineIntersectsSurfaces seems to be working well most of the time. Other times it will consider you inside, just because you're stading bellow whatever roof(no walls) and sometimes it will consider you outside while you're inside building with destroyed roof. Seems like there is no easy way to this.
I had idea to check if position is above the terrain and close enough to a object, which returns at least one position by buildingPos -1, but there are objects with no roof nor walls of any kind, but have building positions.
Why not use this command ? https://community.bohemia.net/wiki/insideBuilding
because this
Because he tried this command with no luck.
It would be nice to have insead of line intersect surfaces to have like a sphere cast
Sphere casting? I believe that's called bowling
or throwing a fireball but yeah
I think using lineIntersectsSurfaces horizontally at 4 different directions could lead to more accurate results, but also more performance hungry. Consider position inside if at least 2 opposite lines intersects same object. Of course it needs to be positions outside of ceiling, wall or any part of the object itself
but also more performance hungry.
There is multithreaded lineIntersects in 2.20, you can run all 4 in parallel at once
You have line cast and a shpere cast basicly a way to detect everything in that sphere https://images.app.goo.gl/VYnxnFCpjMN7AwBEA
Found on Google from discussions.unity.com
For example to achive this with line cast is possible but you need multiple lines to go in diffrent direction but if you have a sphere cast you dont need multiple casts one is enough
I know what you meant, it was just a joke
Hey guys, hope everyone is doing alright. I ran into an issue with a script and hope someone might know what I am doing wrong.
I got a trigger (repeatable) that is activated when any Blufor/West unit enters it. Upon activation I am trying to get a list of all the enemy units within the trigger, which I understand can be achieved with "list".
But I must be doing something wrong, as the following does not seem to work as intended:
"Trigger_02" is the name of the trigger and "Squad_02" is the name of the squad.
_enemy02 = (list Trigger_02 select 0);
{ _x doTarget _enemy2 } forEach units Squad_02;```
neither did
```sqf
private _pos02 = [getpos (list Trigger_02 select 0)];
{ _x dowatch _pos2 } forEach units Squad_02;```
What I am trying to achieve is that when an enemy unit enters the trigger the linked squad should:
1) turn towards the enemy (or one of the enemy units present, can be random)
2) move towards the enemy unil they are like 80 m from them
3) stop their movement & adjust their heading if needed
4) aim at the enemy
5) fire at the enemy
6) rinse and repeat
I know the AI can do some of those things "out of the box", but I need them to move in a specific way, in a specific custom formation and do not want them to start to run all over the place (so most of the AI behaviour has been turned off).
You could add move waypoint 80 meteres before _enemy02 to Squad_02
And disable AI autocombat to keep them in aware behaviour, so they stay in formation during combat
Thanks for your input @hushed turtle , but I have the feeling that the "list" thing does not work. I tried to check with a
hint (name _enemy2);```
to see if it does provide the name of a unit entering/being inside the trigger, but I get nothing (even though the trigger itself fires just fine -> tested it with a sound effect that does play as expected).
Is west the enemy in this case and is trigger set to activate when west is present?
yeah, like I said the trigger fires fine and repeats (tested with attaching a sound effect to the trigger), but the "HINT" does not provide a name (so no hint is displayed -> makes me think this part must be wrong somehow) or anything and the AI squad does seem to ignore the enemy target (does not look at it or aim towards it).
I can even force the enemy to fire their guns just fine with the same trigger but, as they do not aim at the enemy target that entered the trigger area, it is pretty moot and ineffective so to speak.
Are you running this code inside of trigger's activation field?
yeah
This in on activation field should print array of units who activated the trigger
systemChat str thisList;
There should be something
Even if you do
systemChat str list Trigger_02;
It would be really weird if list command wasn't working correctly
and not returning units who activated/would activate trigger
send us a screenshot of your trigger
ok this was driving me crazy - I now put down a simple test trigger, featuring ONLY the trigger name and
systemChat str list Trigger_02;
hint (name (list Trigger_02 select 0));```
in the activation field. And what do you know THAT worked! But in the other more complicated trigger (got it overloaded during testing with lots of crap in there) it does not do anything (i.e. it does not even want to relay any info to systemchat nor in hint => which made me think that it did not fire or work for some reason, so small wonder that the squad did nothing, as it did not even have the data required for any action)
I did have the original code set within this codeblock thingy and when I did the same to the test trigger ->
```sqf
_fn_enemy = {
systemChat str list Trigger_02;
hint (name (list Trigger_02 select 0));
};```
-> lo and behold it suddenly did NOTHING and did NOT use the gathered list data (that is did not display a hint nor any systemChat while still playing the alarm sound to show the trigger still works). So that was the problem. I guess I have to move that part out (hope I can still call the data from within that code part).
(btw is there any ETA when they will fix the BohemianInteractive Forums so one can more easily search for scripting infos there? They have been down for ages now :( )
Now this should work.
It may be stupid question, but were you calling _fn_enemy using call?
And thisList should also work. Triggers have been pretty solid since release so its most likely a user error.
That is not a stupid question actually. Been trying to get all of this to work for a very long time. Got frustrated and put everything away for a while and just decided to try again two days ago, so some of the reasons why I utilized some things are no longer clear even to me.
One of the main reasons why I used that code part, I think, was because I needed to have a "random sleep" part in the trigger
sleep random 1;
and that somehow was the only way I got the random sleep thing to work.
That said @hushed turtle you were a great help because now I figured out why things were not working (and why putting more and more - very probably VERY useless - code in to somehow make it work did nothing).
I saw that in the last update they added WebBrowser with js api. I also see that you can transfer data to the browser. But is it possible to receive events from the browser in sqf? For example, pressing a button.
Example so far
Heyo, i have been trying to get a proxy id from a model or to reference a proxy at all in sqf. Any ideas on functions i could use, I have been at this for quite a bit now.
where can I find a guide for adding to the field menu items?
Use selectionNames command, and check the strings for the proxy you want.
ight, thanks i didnt think of that one, kept going around KindOf and inherits. etc
Why not just this in InitPlayerLocal.sqf ?
player setVariable ["TAG_StartLoadout", getUnitLoadout player];
player addEventHandler ["Respawn", { private _loadout = player getVariable "TAG_StartLoadout"; if (!isNil "_loadout") then { player setUnitLoadout _loadout; }; }];
I don't suppose any of you folks know an effective way to implement an addAction for Eject to appear within the action menu whilest vehicles like the MH9 are airborne? I know it's a common feature but weirdly this sandbox-ish mission I'm attempting to use for some cinematics seems to have the feature disabled for some reason and I'm trying to find a way to re-enable it 
You can just use what the vanilla action uses or moveOut _unit:
// This is just the sqf version of the UserActions class, adjust as needed
_vehicle addAction [localize "STR_A3_action_eject", {
(_this select 0) spawn BIS_fnc_planeEjection;
}, nil, 1.5, true, true, "Eject", "player in _this"];
appreciated, I'll check it out and get back to you with any issues 
BIS_fnc_planeEjection is meant for jets configured with proper ejector seats. For aircraft like the MH-9 you'll need to use moveOut, "Eject" action, etc
Hey all, I don't know if this channel can be used for ACE 3 issues, but I've created a custom bandage, however, I am trying to test if the bandages function works. I am using this with my custom classname but its throwing the error shown in the screenshot.
[player, "Body", "ws_PlasterDressing", player] call ace_medical_treatment_fnc_bandageLocal;
The Error is attached.
https://github.com/acemod/ACE3/blob/master/addons%2Fmedical_treatment%2Ffunctions%2Ffnc_bandageLocal.sqf
Fourth argument should be a number for bandage effectiveness, not an object
im doing somehing wrong here?
_elementz= [];
for "_" from 0 to 10 do{
_direction = getCameraViewDirection player;
_raw = eyepos player vectoradd (_direction vectorMultiply 50);
_pos = _raw vectoradd ([random [-1, 0 , 1],random [-1, 0 ,1],random [-1, 0 ,1]] vectorMultiply 30);
_elementz pushBack [eyePos player, _pos, player];
};
_intersecs = lineIntersectsSurfaces _elementz;
_intersecs
trying to use the new syntax
im using developer tools mod btw*
[_elementz] instead
can yall send loadouts porfiles
How do you play animations on an through a script? Can't really find much online beyond forums stuff that are down right now
Figured it would be something like this but it doesn't do anything. anim1 playActionNow "Act_Alien_Gesture"
(anim1 in this is the name of the ai unit)
some animations you have to use switchMove as they don't have a interpolated list of animations, notice that switchMove needs to be executed where the unit is local
// if global
if (local _unit) then { _unit switchMove "myAnimation" }:
// or from server
[_unit, "myAnimation"] remoteExec ["switchMove", _unit];
// if local
_unit switchMove "myAnimation";
Needs to be run on all machines for it to be immediate
In order for the animation to change immediately on every PC in multiplayer, use global remote execution (see Example 2).
https://community.bistudio.com/wiki/switchMove
In SQF we send parameters info functions using arrays, which makes it hard to work with them, since you have to use indexes to do anything
Params creates variables, so you can use these instead of indexes, which makes code more readable
[player] call {
private _unit = _this select 0;
if (isNil "_unit") then {
_unit = objNull;
};
if !(_unit isEqualType objNull) then {
_unit = player;
};
};```vs```sqf
[player] call {
params [
["_unit",player,[objNull]]
];
};```
Nonsense code, but you can get the idea
Note the difference between Param and params though
Didn't even realised
I honestly don't see a big point to use param instead of params though
+1
Well no, that's not true.
๐คฃ
!true
There are some cases where you can do a one liner with it
Instead of select I can additionally have a default value and check the data type.
But these are edge cases in the code I have written thus far.
Also note that you can skip parameters by using an empty string as variable name in the params command.
param is useful as getOrDefault but for arrays
Since you guys been able to help me so brilliantly yesterday, there is another issue I am fighting with for a while now (but have been unable to make it happen): I am trying to get a unit to "rotate" slowly towards a given position (in two ways for two separate purposes: 1) is to rotate a set amount of degrees right or left and 2) is to rotate towards a marker position).
I have been experimenting with "getpos" and "setpos", but those make the change happen instantaneous (i.e. the unit "snaps" towards the new position) but I need it to be a continuous (slow) momement. I also tried with attaching the unit to a marker and use BIS_fnc_rotateMarker to rotate it. That does work, but the problem there is that, once the unit reaches the set azimuth of the "first" rotation (i.e. if you enter the repeatable trigger) it does not rotate the same amount of degrees again if you enter the trigger once more. (So if you set the azimuth in BIS_fnc_rotateMarker to for example 90ยฐ, it will stay at that heading, no matter how often you activate the trigger - while it should be able to rotate again, with +90ยฐ form its new position). This is driving me nuts.
First off, don't use setPos.
Secondly, you just want the unit to turn about it's z axis? setDir will give choppy movement as well, but if you actually play the animation associated with the unit turning about its shoulder, then stop it when the dir is complete, you'll get a smooth effect.
!quote 5
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
@fair drum - Thanks for your input, that does sound interesting, but how do I get the unit to turn smoothly? What commands/scripts should I use instead?
How slowly do you want?
setFormDir shouldโข make the unit do its normal turning animation (if it's AI). Won't be slow but it will look more natural.
Thanks @hallow mortar will look into that (but it might pose a problem since - according to the wiki - this might be a less precise way of doing it). Have to test if the "speed" is too high for my purposes.
Hi guys I made a script that explodes a Claymore mine facing a door when the door opens, however when I open the door from a side hugging the wall, I get 0 damage and I can basically exploit the whole thing. Does this make sense? Is there a way to prevent this, i want it to be challenging and def. hurt or kill me, (without having to do that manually with scriptcmds)
Is this an ArmA engine issue? That you get 0 damage because you're hugging a wall, even though you're 1-2m close to the explosion source
even with a demo charge exploding 1-2m from me, very close, i get 0 damage
The wall shields you from the blast, a claymore isn't that powerful explosive wise so it won't blow the building apart, it will just fire a bunch of small metal balls towards you (which the wall will stop just fine as long as its a decently thick wall)
yeah but it also happens with demo charge
also entire building collapsing, doesnt kill me either
From 1-2m, i should be dead yes?
but only when Im facing a door, opening, i get dmgd
And why are you against modifying the damage?
thanks for that
one more question
where do I find the mission directory?
Anyone good at arma 3 servers, I did everything right but server isnt appearing
It's typically in documents/arma 3 folder/profile name/missions or mp missions
You need to be more specific in your question. Give more details. Also instead of posting it here, post in #server_windows or #server_linux
If I have to do manually damage to units nearby, I'd have to look into making it balanced and realistic.. id rather delegate to the arma engine
You can try this command with a really small sleep (faster) inside it
https://community.bistudio.com/wiki/for
But for rotation you need to convert some values so the unit don't go from 10ยฐ to 270ยฐ lol, instead going the other way around to reach the same value faster
But it will look like robotic thing, so idk, try it.
For this command, get the actual dir of the unit (from) and put the wanted dir (to)
I just wish these smaller explosions could kill me when im 1m to it, but hugging a wall.. wish this exploit wasnt a thing
if a demo charge explodes 1m near u it shud kill u even if theres a wall ur against
Hey,
I've read the last spotrep multiples times but i'm can't find anything related to my problem
I have a custom handleDamage event, but since last update it looks somethings has changed because every player in vehicle receive the damage differently from a collision
Unfortunatly i can't find anything related to a change about that event in the last update
Do you have any other ideas of what could cause that ?
Your videos appear to have vehicles taking extreme responses from impacts with bushes and fences?
That seems to be a thing with today's perf/prof branch update, but I'm not sure what it has to do with your question.
does anybody have snippet from forums to listing all sounds from game? with gui
I don't know what you mean by, "with gui", but here are the sounds from the game.
https://community.bistudio.com/wiki/Arma_3:_Sound_Files
im not sure where this question falls lol
im testing the new CT_WEBBROWSER, and want to use it un a ui2texture.
i have some HTML that works perfectly as hud ( im using the example code forn the wiki)
import RscText;
class HudOverlayUIT
{
idd = 133713370;
duration = 1e+011;
onLoad = "GHUDOverlay = _this"; // Store our Display in a variable so we can access it from script
class controls
{
class Texture: RscText
{
type = 106; // CT_WEBBROWSER
idc = 1337;
x = safeZoneXabs; // Full screen from corner to corner
y = safeZoneYabs;
w = safeZoneW;
h = safeZoneH;
url = "file://test.html";
};
};
};
im calling it like this:
//bb setObjectTexture [0, '#(rgb,1024,1024,1)ui("HudOverlayUIT","abc")'];
pc setObjectTexture [1, '#(rgb,2048,4096,1)uiEx(display:HudOverlayUIT,uniqueName:"tesat name with space and quotes")'];
private _ctrl = ((GHUDOverlay#0) displayCtrl 1337);
_ctrl
this return 1337 so the ui is created.
but a black texture is placed instaed
ive tested just with createdsiplay and it works perfectly
Before last update this wasnโt happening, and reading the devblog I canโt see how can it be related but Iโm pretty sure it is
It isn't. It was a new bug in today's perf/prof branch.
how do u like get arma 3 by serching it up on mac
Yes looks like the new hotfix fixes it, thanks ๐
What you mean ?
Find money, then buy it on Steam
nothing else
don't take a credit for 10โฌ
I need your help
Thank you in advance.
When I spawn a camera, point it at the player, and let the player run an animation, the player just stands there instead of performing the animation.
- This only happens when the player has a currentWeapon.
- When I destroy the camera, the player immediately runs the animation.
I suspect that, since I am in the camera, either the player is not rendered or the animation is not loaded? Any idea?
it all depends on how you run things! show us your cooode
you may need a little delay before you do "playmove"
displayUpdate command.
A ui2texture does not update by itself. You need to keep telling it to update
Eachframe?
ye
Perf hit is noticeable or meh?
I should made some conditions like proximity isnโt it?
It will only update if displayUpdate has been called AND its in view
Ohh, The oneachframe only in the display update
Sheet, I saw a example code somewhere but I lost it
https://github.com/WolfCorps/CytechPCSystem/blob/master/init.sqf#L194 I do that
And I remove it again on unload
Hello guys, do you know if it's possible to retrieve the trunk size of a vehicle ?
any idea why i have this distortion in the screen ( of if its a feature lol)
What texture type are you using? co or ca?
Happens with an alpha channel in my experience (or set to ca)
im using the dedmens mission to test the new webreowser and ui2texture feature
I use the advanced procedural UI on texture with the tag texType=co. i.e.,
tv setObjectTexture ["hiddenSelectionName", "#(rgb,512,512,1)uiEx(display:RscDisplayName,uniqueName:tvReferenceName,texType:co)"];```
https://community.bohemia.net/wiki/Procedural_Textures?useskin=vector#UI_On_Texture_Advanced
It defaults to ca which assumes alpha
You can also do that with the basic notation
"#(rgb,width,height,mipCount)ui(<displayClassName>,<uniqueName>,<textType>)"```
Something a bout shadows I think.
If you turn shadows off its gone?
Hi guys! I'm building a training ground mission I'm wondering if there is a script for making the targets stay down longer, let's say a whole minute. I've spent some time trying to write the script with chatgpt but nothing seems to work
Yeah, gpt is not good with sqf.
Better ask here and do step by step.
And you will learn sqf step by step.
Targets,
Are alive units?
And you want them just lay down or what do you mean.
I'm using the yellow pop up targets
managed to create it with this
this is my reward for trying to slave AI into doing what I should be doing
After the update, I'm having problems with my Altis Life server, when the player enters the server the loadout saved in the database is not loaded and the player is born "naked", even if he buys items and clothes, it is being registered in the database normally, but when he enters the server, it seems that the database loadout is ignored and he is born only with virtual items, without clothes and equipment, I've been trying to solve this since yesterday and I can't, can someone help me?
YO HELP im currently doing a fun op
but ive reached the unit cap mid op
does anyone know the script to override it in zeus?
what unit cap
its a group number cap, not a unit cap
start making larger groups, not many 1 unit groups
hell all, I'm making a Nassau mission, trying to use inidbi2 for persistence, my scripts are fine, but the actual mod keeps breaking, i'm using faster on a dedicated windows, every time i deploy @inidbi2 through faster, the folder corrupts, anyone experienced this?
ths is where i put it, folder composition and the error i get when i add to faster as a local mod
Hey Hypoxic, if you have time can you elaborate on this a bit more? If not setPos and getPos what else? How do I make what you describe happen? Would not even know what to look for at this point. Thanks!
Instead of setPos and getPos, you should use either setPosASL/getPosASL or setPosATL/getPosATL as appropriate.
getPos is much slower, and the reference system it uses for its altitude return is not actually the same as that used by any of the setPos* commands. Sometimes it returns the correct altitude for use with other commands, but it is calculated differently and can have noticeable vertical error. The ASL/ATL command pairs are guaranteed to use the same altitude format as their partners, and are faster.
I want to enhance AI by cheating for him, if lets say i enter a room , i want him to be able to face me directly and fire as soon as he spots me, what do i need for this?
I think that can be achieved if you do a "reveal" on the player, as that makes the AI aware of you. Btw if you want to enhance the AI in general you can use VCom or LAMBS, which make the AI do pretty cool things (like trying to surround and flank you).
thank u
This is what I want to do, I want to have a soldier face a specific dirrection inside a building.
What I did was have a eden editor pre placed default soldier facing somewhere, and then replacing it with the soldier i want and taking over the properties like pos and direction its fcing, however when unit spawns in, it lowers it weapon, when i exec the script, the result isnt good as it doesnt really look at where i want it to look / aim. Do u have any idea how i can achieve this? i wanna spawn it and then have it sit still, facing the direction i set in eden editor or target
the sitting still/not moving can be done with disableAI "move" and disableAI "path", if you want the AI to have the weapon raised, ready to fire you can setCombatMode "RED" and setBehaviourStrong "COMBAT" and if you want the ai soldier to already face the direction it should be facing, you can just place it this way in the editor (unless you want to see it turn when you enter the room)
you can also set the AI's skill to be high (check the AI unit's attributes in Eden), but it will make things very difficult for the player
hello all : how do i use Call or spawn to exec this ```sqf
SFH_fnc_Heal1 = Compile preprocessFileLineNumbers "Scripts\Heal1.sqf";
[args] call SFH_fnc_Heal1;
[args] spawn SFH_fnc_Heal1;
ahhh ok cool thx man @stable dune thats Awsome
yeah i do that but when game starts it lowers its weapon / starts with weapon lowered.
I want to have a placeholder entity face a direction or be a target for the real soldier i wanna spawn i nwith script to aim at
is Suspending allowed in Spawn or Call
If you are doing it the config way, delete this and ask over at #arma3_config . You'll get better answers.
alright
oh man thx man your Awsome @stable dune
Suspending is allowed in call too, if you called it from scheduled environment.
any1 know how to make AI mute on command? if i fire somewhere close to the ai, but not at ai, the ai starts shouting and all, i want him to remain quiet then at some point re enable
True.
i see thx m8 your the best m8 @stable dune
you can disableAI "RADIOPROTOCOL" or setSpeaker "NoVoice" ๐
Trying to micro-manage this level of Arma3's AI in terms of "I want him oriented this way" and "his gun raised upon _x event" etc is going to get you spotty results at best. Yeah sure its doable to an extent -but prrobably not what you're envisioning
is there a way to scale up AI like x1.2 their size? I tried using SetObjectScale but that seems to only work on vehicles, but I did saw the AI scale up for split second before reverting back to normal
I think you have to spam it with eachFrame.
yea but wouldnt that affect performance, I'll try it out, thanks
well yes
That's the best you're going to get. Dynamic object scaling barely works in A3 and it's not really intended for use with anything other than static objects.
is there no mod to scale AI?
is there a way to not make it stutter? or am I just scripting it wrong. The AI kept getting big and reverting back constantly and stuttering
I don't know how you're scripting it so I can't say if you're scripting it wrong.
The best way to do it is using an EachFrame mission event handler (https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers), but even then, there are likely to be limitations, because as I said, this feature is not really designed to work with anything other than static objects.
I got it to work, thanks
There was a Giants mod going around for a while back in the day
Does anyone know if there were any changes to ctrlSetEventHandler lately? According to https://community.bohemia.net/wiki/ctrlSetEventHandler, it should always return Nothing but it's no longer the case, and it causes some scripts to break. I've noticed it in Ravage mod a few days ago. The script in question is:
{
((findDisplay 602) displayCtrl _x) ctrlSetEventHandler ["LBDblClick", "_this call fnc_gearLBDblClick"];
} count [633, 638, 619];
According to https://community.bohemia.net/wiki/count, count can be used in this manner with one caveat described in Notes section by user Ebay:
With the alternative syntax each iteration should result in an interior return of bool or nothing. Example:
createDialog "RscFunctionsViewer";
{ lbAdd [292901, _x]; } count ["first", "second", "third"];
lbAdd returns a number, so this throws "Error Type Number, expected Bool". Tested in A2OA 1.63.131129
To verify that note: the following test causes Error Type Number, expected Bool.
{
2
} count [1]
Now, I checked ctrlSetEventHandler in game and it does return a number. I assume it didn't until a couple of days ago. I've scrolled through the latest changelogs but couldn't find any information about this specific command being modified.
I guess more existing scripts related to controls management might be affected if they use a combination of ctrlSetEventHandler and count for iteration. I suspect the culprit might be https://dev.arma3.com/post/spotrep-00118. It doesn't mention any ctrlSetEventHandler updates, though.
isn't that an obsolete command?
Yeah, seems like it is. Still, the problem started occurring all of a sudden a few days ago so I assume there must've been some sort of update to ctrlSetEventHandler. However, it's difficult to say for sure without reverting ArmA 3 version to compare the behaviour.
but you're having problems with count command right?
Yes, but the problem occurs when you use both commands at the same time (i.e., ctrlSetEventHandler inside count iteration code block). That's why I lean more towards ctrlSetEventHandler being modified to return some numeric handle ID, perhaps to match the return value of ctrlAddEventHandler. The problem isn't ctrlSetEventHandler in itself - any command returning a number would cause the same problem.
However, this specific script from Ravage was working for years (even though it was using the long-deprecated ctrlSetEventHandler), and suddenly started throwing an error suggesting that a number began appearing inside the count code block, returned by the ((findDisplay 602) displayCtrl _x) ctrlSetEventHandler ["LBDblClick", "_this call fnc_gearLBDblClick"]; command. My idea is that if it's been returning Nothing before some recent update, it would work just fine with the count function. If it suddenly started returning a numeric ID, it would make sense that the script would break.
well, with my limited knowledge, this is a weird count syntax and it shouldn't work at all, the ctrlSetEventHandler actually returns nothing as it says biki
It doesn't return Nothing anymore, I tested it today ๐
afaik, the code block for the count command must return a bool in order to count the elements from the array if returns true
And yes, this is a very weird construction. Didn't know you can use count like that.
hmm that's why you're getting an error then
but any case, this is a weird construction lol
yeah it's returning a number
Ok, I checked the legacy build (2.18). It did return Nothing.
idk how to help you because I really don't know what that code does and why it exists in that way lol
So we have an undocumented change in 2.20 ๐
well the command is obsolete, so...
Yeah but then: why update a command that's obsolete?
Anyway, I think it's worth knowing if anyone starts getting weird errors in their weird count iterations, or in some mods that aren't updated on a regular basis. I started getting it in Ravage, and that's how I found the issue. Hopefully there aren't many creators who used the same combination of ctrlSetEventHandler and count.
my first impression of that code block, is that it wasn't working even before the update, because it must return a bool, and it wasn't giving you any error, now that can return a number, it's showing to you the error
can someone else help in this case?
According to the count documentation, the command inside the block is allowed to return either bool or Nothing, and ctrlSetEventHandler was returning Nothing - that's why it's been working before the update.
Now that I know the reason, I don't think there's anything else we can do here ๐ I'll try to get in touch with Ravage's author, and see if he can update it with this modification in mind. Thanks for the help, though. I didn't notice the command was obsolete, and looking at ctrlAddEventHandler gave me an idea what the new return value might mean (it's probably handler ID).
alright then
Good Evening people ๐
Is someone awake who quickly can say me why my trigger always come
activated when no one is around...
Code:
sascha_trg_charkiaRadio = createTrigger ["EmptyDetector", [17547.2,15269.8], true];
sascha_trg_charkiaRadio setTriggerArea [193,132,157, true, 100];
sascha_trg_charkiaRadio setTriggerActivation ["ANYPLAYER", "PRESENT", false];
if (triggerActivated sascha_trg_charkiaStatisch) then
{
systemChat "CharkiaStatisch spawnt!";
execVM "EBER\Erweiterungen\Charkia\Erweiterung\CharkiaStatisch.sqf";
};
Why is my trigger activated?
because you pulled the trigger ?
Im not in the area
what's in the condition of the trigger
you need to put this in the condition of the trigger
I thought that it means "repeatable"
https://community.bistudio.com/wiki/setTriggerActivation
Are you texting something?
Would you do it like:
["ANYPLAYER", "PRESENT", true];
yeah that looks ok to me
just do ANYPLAYER", "PRESENT and put the word this in the condition of the trigger
# Like (this)?
sascha_trg_charkiaRadio = createTrigger ["EmptyDetector", [17547.2,15269.8], true];
sascha_trg_charkiaRadio setTriggerArea [193,132,157, true, 100];
sascha_trg_charkiaRadio setTriggerActivation ["ANYPLAYER", "PRESENT", this];
if (triggerActivated sascha_trg_charkiaStatisch) then
{
systemChat "CharkiaStatisch spawnt!";
execVM "EBER\Erweiterungen\Charkia\Erweiterung\CharkiaStatisch.sqf";
};
oh you didnt tell me it was a scripted trigger
!!!
Now?
ok
trigger activated
West also triggerd the activation
BRO
Do you know what your doing or just try&error?
heres my trigger
_t = createTrigger ["EmptyDetector",_pos];
_t setTriggerArea [500,500,0,true];
_t setTriggerActivation ["WEST","PRESENT",true];
_t setTriggerStatements ["this && {((getPosATL _x) select 2) < 75} count thislist > 0","",""];
_t setTriggerType "NONE";
i think you need setTriggerStatements
if you follow this Ex it will work
sascha_trg_charkiaRadio = createTrigger ["EmptyDetector", [17547.2,15269.8], true];
sascha_trg_charkiaRadio setTriggerArea [193,132,157, true, 100];
sascha_trg_charkiaRadio setTriggerActivation ["WEST", "PRESENT", false];
sascha_trg_charkiaRadio setTriggerStatements ["thisTrigger", "thisTrigger", "thisTrigger"];
Dont work
Good night and thanks for the try
why didnt you follow my 1st EX
what don't work
well just looking back, you didn't address the main issue for a while which was the if condition right after creating the trigger instead of using a statement. a couple of pages of moving the wrong direction, he probably lost faith in you in combination with him not truly understanding the magic variables that triggers use. I'd suggest next time, take a little more time in getting the full picture of what they want before offering "fixes".
well he didnt tell me it was a scripted trigger at 1st
according to the OP currently, don't know if it was edited, it was clearly scripted
well yeah i saw that later
yeah, all i'm saying is slow down. you probably would have caught it
well it's not the first time that Monsterframe lost his patience here ๐
some ppl may need some more guidance to solve the issue
yes im learning that slowly
i'll take more time to get all the info next time befor i jump in
i mean well, i guess i want to help so bad i mess up
i'll do better next time you just w8 and see ๐
btw he said the trigger was activating and he didn't want that, until player was in the trigger
i don't create triggers in SQF often, but looking at the default trigger statement, apparently the condition always starts off as true: sqf triggerStatements _t; // Result: ["true", "", ""] true means the trigger will activate regardless of what you set in setTriggerActivation, since that result is only stored in the this variable - in other words, to make it behave normally, you need to change the condition to this in your trigger: sqf _t = createTrigger [...]; _t setTriggerStatements ["this", "", ""]; ... // Any other commands as usual
yes thats what i said as well
oh right, yea you did
thx m8
setTriggerStatements is directly equivalent to setting the trigger code fields in the Editor. You need to set them the same as you would there.
https://community.bistudio.com/wiki/setTriggerStatements
The Condition (statement 0) should likely be this. In a trigger condition, this represents the result of the conditions you set up in the trigger's basic attributes (e.g. ANY PLAYER, PRESENT)
The On Activation (statement 1) should be whatever code you want to be executed when the trigger is activated.
The On Deactivation (statement 2)...I think you can figure that out.
i gave him an EX trigger but he did not follow it but thats ok i guess
Your if check at the end is incorrect. if only checks once, not continuously, unless you script a loop to make it check again (which you didn't). So you're creating the trigger, immediately checking once if it's been activated, and then never checking again.
Just put your code in the trigger's On Activation statement, and let the trigger handle checking whether it's activated, just like in the Editor.
in my Ex i only want the trigger to be checked 1 time, cuz i have another loop deleting the trigger after it gets activated
or deactivated as it were
I was not talking to you or about your example.
oh ok sorry
i was thinking you were giving me hell cuz im not the sharpest tool in the tool box ๐
Oh I see your if at the end is actually referencing a different trigger. I don't know what's up with that then, I don't really see how it connects to the trigger you're actually having issues with. It would help to know more about what you're trying to make this code do.
Keep in mind what I said anyway, it still applies in general.
can anyone tell me how do i make the bullets of cram like this in my game ,the bullets get very spread out
I need some help
I am using a function to change spawned unit loadout but it gives error "undefined variable" for local variable _unit
private _unit = delta createUnit ["tweed_acu_summer_ocp_trop", flg, [], 7, "NONE"];
[_unit] call KIB_fnc_jTac;
private _unit setSkill 1;
private _unit setUnitTrait ["camouflageCoef", 0.5, false];
private _unit setUnitTrait ["audibleCoef", 0.5, false];
private _unit setUnitTrait ["UAVHacker", true, false];
you have many extra privates there
@proven charm oh yeah, probably only _unit has to have private but I am spawning two units
for "_i" from 0 to 1 do {
private _unit = delta createUnit ["tweed_acu_summer_ocp_trop", flg, [], 7, "NONE"];
[_unit] call KIB_fnc_jTac;
private _unit setSkill 1;
private _unit setUnitTrait ["camouflageCoef", 0.5, false];
private _unit setUnitTrait ["audibleCoef", 0.5, false];
private _unit setUnitTrait ["UAVHacker", true, false];
};
i dont know how that involves multiple privates. all you need is the first private
That is not the question. private only used when it came for declare the variable
same error with
for "_i" from 0 to 1 do {
private _unit = delta createUnit ["tweed_acu_summer_ocp_trop", flg, [], 7, "NONE"];
[_unit] call KIB_fnc_jTac;
_unit setSkill 1;
_unit setUnitTrait ["camouflageCoef", 0.5, false];
_unit setUnitTrait ["audibleCoef", 0.5, false];
_unit setUnitTrait ["UAVHacker", true, false];
};
What is the exact error, please?
the error is actually from the function KIB_fnc_jTac
https://pastebin.com/0wLzmhVh
Is the unit actually being created?
should be null if not ๐ค
i assume the "span class="re5">" thing in the pastebin was paste error and not your code
Is "tweed_acu_summer_ocp_trop" actually a unit classname? It looks more like a uniform classname.
@hallow mortar its a unit classname form a mod, I changed it to
"B_Soldier_F"
but it gives the same error
What is flg? Specifically? What type of thing does that variable contain?
Also, the full, exact, and complete error would be useful to see.
Is you flg array of position,
Or is that just variable name of object/ thing/ marker
omg I am an idiot I forgot to create a group for the units, now its working
deltagrp = createGroup [west, true];
deltagrp setGroupIdGlobal ["Delta"];
for "_i" from 0 to 1 do {
private _unit = deltagrp createUnit ["B_Soldier_F", flg, [], 7, "NONE"];
[_unit] call KIB_fnc_jTac;
_unit setSkill 1;
_unit setUnitTrait ["camouflageCoef", 0.5, false];
_unit setUnitTrait ["audibleCoef", 0.5, false];
_unit setUnitTrait ["UAVHacker", true, false];
};
i was gonna ask that ๐ (but for some reason didnt)
@split ruin your not a idiot your like me, to fast, lol, we need to slow down
weird question, but i'm a bit at a loss right now. when a helicopter gets destroyed, it swaps to the wreck model - but only once it hits the ground. is there any way to detect when this happens?
i'm thinking of spawning additional wreck clutter in that moment, but it doesnt seem as easy as i expected it
almost sure this should be possible, since a2 was also spawning stuff like craters once an aircraft crashed down?
doesn't trigger with MEH "EntityCreated"?
isnt that really heavy? checking constantly even though nothing might happen at all
you just need to filter it
i know, but it would still "filter" on every creation
your mission is too heavy?
it would run everywhere where the airplane is used
are you saying you want the wreck to happen before it hits the ground ?
no, i want to spawn additional wreck parts once it switches to the wreck model
imagine rotor parts or stuff like that
i could probably spawn some entitycreated EH once the vehicle gets destroyed, and delete that EH once i know the wreck is created. but would have to check first if it can even detect the wreck
not in the vanilla game
well, I don't think you need to worry about the MEH, which has local effect. But in this case, I would added a killed EH to the chopper and spawn a code and wait until the wreck touchs the ground
that might be another solution
i could even add a wait that checks if the wreck model is created
https://community.bistudio.com/wiki/getEntityInfo
isWreck is exactly that
oh, that will be even more useful
doubt it vehicle wrecks are a lod change
(getEntityInfo test)#12 works
just have to slap a wait in a killed EH and it should be reliable i guess
How i can open url in external browser without displays and controls?
I thought these two would provide me with the same result - the heading towards another unit - but I just had a testrun and for some reason I do not get the same results (althought, as far as I understand the wiki, it should be the same).
_vd = getPosASL _enemy2 vectorDiff getPosASL English_SGT_01;
_dir = (_vd select 0) atan2 (_vd select 1);
_dir = (_dir + 360) % 360;```
```sqf
_dirTEST2 = [_enemy2, English_SGT_01] call BIS_fnc_relativeDirTo;```
What am I missing? The first one does as it should, providing 0 to 360 results, depending on where the other unit is, the other just gives me a number that does not correspond to the other result.
should be _y atan2 _x
? like I said the first gives me correct results, the latter does not (i.e. the two results do not match for some reason, but should?); been trying to clean up some code I cobbled together, hence me trying to shorten some things if possible
theres also https://community.bistudio.com/wiki/getDir for this if you need (Alternative Syntax)
I am just confused that the results do not match and can not explain it (because I do not see the mistake I must have somewhere)
The second one gives a direction relative to the first object's heading. Command equivalent is getRelDir
You should find that if the unit is pointing north then they return the same values.
ah ok so I was wrong in thinking these two do the same thing, got it, thanks! was driving me nuts :)
I am doing force fire for turret with BIS_fnc_fire, but turret is not turning to target, how to wait for turret to turn to target ( +- 60 degree angle ) + ( 0 to 90 degree vertical ) ?
want to turn turret as fast as possible, to turn and fire at many targets
if ( _targets isNotEqualTo [] ) then
{
private _target = _targets select 0;
_vehicle lookAt _target;
// _vehicle lookAt getPosVisual _target;
sleep 0.1;
private _angle = "?";
private _elevation = "?";
if ( _angle <= 60 && _elevation >= 90 ) ) then
{
[ _vehicle, weaponState [ _vehicle, [ 0 ] ] select 1 ] call BIS_fnc_fire;
_vehicle setVehicleAmmo 1;
};
sleep 0.1;
};
@real tartan -> https://community.bistudio.com/wiki/fireAtTarget (see the "forceWeaponFire" example found at the bottom of the page, think that is what you are looking for; specifically the "waitUntil" part there)
Does anyone know where to find the script for these symbols? I have a few of them. Looks like this:
"\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa"
you mean the path?
You mean you want script that get all xx.paa from xx path / addon/ mod?
The part that changes is "sergeant_gs" like one is recon and the other is repair I think. They give you different icons. There's private, corperal, captain, and many more
Arma 3\Addons\ui_f_data.pbo/GUI/Cfg/Ranks
There are also 3 of them in .../RespawnRoles
these are only what i find -->
a3\ui_f\data\GUI\Cfg\Ranks
a3\ui_f\data\GUI\Cfg\RespawnRoles
Amazing!!
That's amazing thank you so much. Any guess where I might be able to find more?
If you are using dlcs, I bet those have more.
And mods too.
It's pretty easy find you have object/ layout/ or something where you see xx icon.
I don't know does vanilla arma (without dlc/ mods) have more than that.
use this script to find more images: https://gist.github.com/HallyG/fa7a6cda10abcb630b1dc325f0523553 just put that code in debug console and execute
3DEN Enhanced also has an image viewer, also has a search bar and sorts images by resolution
silly question i know, but how exactly can i learn more scripting myself? i mean as in like, there is the wiki, yeah, but do i just gotta sift through everything on the wiki, or is there like a โhubโ where i can go to start with learning how to do it on the wiki
Come up with something you want to do / make, google what you don't know, and learn as you go
and small
I see thanks. some times its that some things i do want to do are too ambitious and are way more complicated, but as gencoder said, just be reasonable with my personal demands
thanks bro
I started learning like Dart said, googling and such... but I've really learned a lot by looking other people's work, trying to understand each line what it does, etc
Iโve been doing that some, but I must figure out how to decrypt it. However, the payoff is worth it, so
search for Gunter Severloh in youtube
And you can always ask here.
Here is a lot of ppl who know and help.
I bet there is no stupid questions, and every time you learn something new.
Very true. Thank you all very much
Oh yeah I love that guy, gotta watch him more too
it takes times, but debugging the code (with diag_log, hint, systemChat) is a great resource and can speed up the process
when I'm trying to create an enemy infantry group that spawns, will it already be in it's own group?
For example
_destination = "defensArea";
_enemInfType = ["O_Soldier_F","O_Soldier_AR_F","O_Soldier_GL_F","O_Soldier_LAT_F","O_Soldier_SL_F"];
_enemInfGroup = _enemInftype createUnit getMarkerPos _stMarker;
_enemInfGroup setDir markerDir _stMarker;
_wayp = _enemInfGroup addWaypoint [markerPos _destination,0];
_wayp setWaypointType "SAD";```
will it just make all those few units into it's own squad?
createUnit takes a group as the left side argument
You have to specify what group that the unit will be in
so I cannot just say for a group to create unit from that array I gave, I need to do something like _enemInfGroup = createGroup east and add onto that?
Oh alt syntax has it as right side
Yes
Yeah I looked at it already, just not entirely sure how I can specify for a group to have those units I want. I looked over it a few times, may be blind or overthinking it however. Do I just have to put 2 lines where I specify _enemInfGroup = createGroup east; _enemInfGroup = _enemInfType createUnit getMarkerPos _stMarker;
or is there more to it than that?
You're creating a group, and then assigning the variable to the unit nothing?
That version of createUnit doesn't even return the unit
I may misunderstand you but I already assigned the variable _enemInfType an array of units for it pick from
I was just focusing on _enemInfGroup
I'll just send the whole thing, sorry for the confusion
_enemInfGroup = createGroup east; // Creates a new group and assigns _enemInfGroup to it
_enemInfGroup = _enemInfType createUnit getMarkerPos _stMarker; // Assigns _enemInfGroup to nothing
_destination = "defensArea";
_enemInfType = ["O_Soldier_F","O_Soldier_AR_F","O_Soldier_GL_F","O_Soldier_LAT_F","O_Soldier_SL_F"];
_enemInfGroup = createGroup east;
_enemInfGroup = createUnit getMarkerPos _stMarker;
_wayp = _enemInfGroup addWaypoint [markerPos _destination,0];
_wayp setWaypointType "SAD";```
ohh I see
Alright I shall, my b
okay I missed the part where it said group, that was a brain fart on my end, I was just assigning a variable to it. Or it's something else, I don't mean to be frustrating here my apologies, it's not that I'm not even reading it or not being attentive I'm just being stupid here ๐ญ
ok yeah i completely misunderstood what I was reading
Running into an issue where hashmapobjects aren't truely creating a new instance:
Psudocode:
testBaseClass = [
["numUnits", 6],
["units", []],
["group", grpNull],
["#create", {
params ["_side"];
_self set ["group", createGroup _side];
private _group = _self get "group";
private _numUnits = _self get "numUnits";
for "_i" from 0 to (_numUnits - 1) do {
private _unit = _group createUnit ["B_Soldier_F", [0,0,0], [], 0, "NONE"];
diag_log format["Unit created: %1",_unit];
private _units = _self get "units";
_units pushBack _unit;
};
diag_log format["All Units: %1",_self get "units"];
}]
];
groupObject_1 = createHashMapObject [testBaseClass, [west]];
groupObject_2 = createHashMapObject [testBaseClass, [east]];
log output:
14:50:25 "Unit created: B Alpha 3-2:1"
14:50:25 "Unit created: B Alpha 3-2:2"
14:50:25 "Unit created: B Alpha 3-2:3"
14:50:25 "Unit created: B Alpha 3-2:4"
14:50:25 "Unit created: B Alpha 3-2:5"
14:50:25 "Unit created: B Alpha 3-2:6"
14:50:25 "All Units: [B Alpha 3-2:1,B Alpha 3-2:2,B Alpha 3-2:3,B Alpha 3-2:4,B Alpha 3-2:5,B Alpha 3-2:6]"
14:50:25 "Unit created: O Alpha 2-6:1"
14:50:25 "Unit created: O Alpha 2-6:2"
14:50:25 "Unit created: O Alpha 2-6:3"
14:50:25 "Unit created: O Alpha 2-6:4"
14:50:25 "Unit created: O Alpha 2-6:5"
14:50:25 "Unit created: O Alpha 2-6:6"
14:50:25 "All Units: [B Alpha 3-2:1,B Alpha 3-2:2,B Alpha 3-2:3,B Alpha 3-2:4,B Alpha 3-2:5,B Alpha 3-2:6,O Alpha 2-6:1,O Alpha 2-6:2,O Alpha 2-6:3,O Alpha 2-6:4,O Alpha 2-6:5,O Alpha 2-6:6]"
each hashobject should have its own new set of properties, yet its stacking them unless I'm getting the syntax wrong
same result if i use a hashmap as the base class instead of an array
that was very dumb of me
It's all good. Everyone has to start somewhere. 
Thank you bro โค๏ธ
_vipers = [viperLeader, viperDemo, viperMedic, viperRecon, viperMarksman];
_seatChooser = 0;
{
switch (_seatChooser) do
{
case 0:
{
_x moveInCargo [_xian, 0];
};
case 1:
{
_x moveInCargo [_xian, 1];
};
case 2:
{
_x moveInCargo [_xian, 15];
};
case 3:
{
_x moveInCargo [_xian, 14];
};
case 4:
{
_x moveInCargo [_xian, 13];
};
};
_seatChooser = _seatChooser + 1;
} forEach _vipers;
Anyone know why this works perfectly on AI and the user but not other players? presuming you need to execute moveInCargo locally but not sure how I would do that while passing the right parameters. How would you write it to work for players?
[_x, [_xian, 0]] remoteExec ["moveInCargo", _x];
wow that's much easier than I was expecting
basically, you are telling the machine where _x is local to do the thing
Awesome, I thought you would need to do like machine _x or something like that but it's really useful to know you can just write it like that
would this still work for AI as well?
Epic, thank you โค๏ธ
It doesn't care if unit is player or not
and yes it will, it will just target whatever machine has the AI (which typically is server, which if sent from server, means no real network traffic anyways). This only really matters if you are leading a group of AI, or if you have a headless client that is controlling AI
That code is pretty interesting with it's usage of switch and _seatChooser variable
Now if split them individually, keep in mind, its STILL passing an array in the end:
groupObject_1 = createHashMapObject [[
["numUnits", 6],
["units", []],
["group", grpNull],
["#create", {
params ["_side"];
_self set ["group", createGroup _side];
private _group = _self get "group";
private _numUnits = _self get "numUnits";
for "_i" from 0 to (_numUnits - 1) do {
private _unit = _group createUnit ["B_Soldier_F", [0,0,0], [], 0, "NONE"];
diag_log format["Unit created: %1",_unit];
private _units = _self get "units";
_units pushBack _unit;
};
diag_log format["All Units: %1",_self get "units"];
}]
], [west]];
groupObject_2 = createHashMapObject [[
["numUnits", 6],
["units", []],
["group", grpNull],
["#create", {
params ["_side"];
_self set ["group", createGroup _side];
private _group = _self get "group";
private _numUnits = _self get "numUnits";
for "_i" from 0 to (_numUnits - 1) do {
private _unit = _group createUnit ["B_Soldier_F", [0,0,0], [], 0, "NONE"];
diag_log format["Unit created: %1",_unit];
private _units = _self get "units";
_units pushBack _unit;
};
diag_log format["All Units: %1",_self get "units"];
}]
], [east]];
15:19:26 "Unit created: B Alpha 3-6:1"
15:19:26 "Unit created: B Alpha 3-6:2"
15:19:26 "Unit created: B Alpha 3-6:3"
15:19:26 "Unit created: B Alpha 3-6:4"
15:19:26 "Unit created: B Alpha 3-6:5"
15:19:26 "Unit created: B Alpha 3-6:6"
15:19:26 "All Units: [B Alpha 3-6:1,B Alpha 3-6:2,B Alpha 3-6:3,B Alpha 3-6:4,B Alpha 3-6:5,B Alpha 3-6:6]"
15:19:26 "Unit created: O Alpha 3-4:1"
15:19:26 "Unit created: O Alpha 3-4:2"
15:19:26 "Unit created: O Alpha 3-4:3"
15:19:26 "Unit created: O Alpha 3-4:4"
15:19:26 "Unit created: O Alpha 3-4:5"
15:19:26 "Unit created: O Alpha 3-4:6"
15:19:26 "All Units: [O Alpha 3-4:1,O Alpha 3-4:2,O Alpha 3-4:3,O Alpha 3-4:4,O Alpha 3-4:5,O Alpha 3-4:6]"
so something is up with the command I think
It could be intended behaviour
its just weird to me. you are either passing in an array stored in a var, or directly and you get 2 different results
unless... its still using the stored var as reference instead of creating a whole new reference once the object is made
You could copy array and it would create two instances
groupObject_1 = createHashMapObject [+testBaseClass, [west]];
groupObject_2 = createHashMapObject [+testBaseClass, [east]];
oooo good catch sir!, that will do it. so instead of createHashMap making a whole new reference, it does still reference the declaration. more of a conversion rather than a new instance
so not quite OOP imo
i'll make a wiki edit with its current behavior
i finally did it, got it working with waves too
Maybe game detects that HashMapObject based on same array already exists, so it just calls #create method second time on the same array?
It's not HashMap object issue. Two objects get created, but they share same units array! Arrays are passed as references
@fair drum
You gonna need to create new empty array in #create to avoid it being shared
i'm going to just do a +copy on creation
That's whole new array created for no reason


