#arma3_scripting
1 messages ยท Page 13 of 1
keep in mind that squad init runs everywhere, so check for locality
no need? ๐คจ
{ _x assignAsCargo _theVehicle } forEach units _theGroup;
```@coarse dragon
there are few circumstances that require setting variable names for everything
Still junp out
you didn't just write _theGroup did you
I'm not even sure where to put the code
Vehicle init.
Squads init.
Units init. ๐คทโโ๏ธ
if you spawn the units in the helicopter from within the 3den itself, this won't fix anything
are you perhaps giving the group a move waypoint or something?
WHAT - DID - YOU - WRITE
One squad works fine. But when 2 squads are in the helicopter half of them jump out
if you copy-pasted my code 1:1 amma commit sudoku
How can i disable the scoreboard?
showScoretable 0
Where? init?
yes
thnx
{ _x assignAsCargo helo } forEach units sq1;
soo i got it working xD
w00t!
Is there any way that works to get AI infantry to fire a grenade from their launcher at a specific location or target?
I just tested it i can still open the scoreboard... any ideas?
I thought you knew about that ๐
here is the documentation and an explanation of scopes
https://community.bistudio.com/wiki/Variables#Local_Variables_Scope
according to the docs you weren't supposed to 
https://community.bistudio.com/wiki/showScoretable
when it is force closed, it cannot be opened manually.
where did you execute it?
how dare you break things
not really.
yep, my assumption ๐๏ธ
there's also a setting on the server-profile.cfg we have that on 0 and we can still open it
try in debug console too
maybe a mod is overriding it 
if it still doesn't work you can just override the key
init script is too early then
then add some sleep
Aight im not sure what did it, i just added 10 sleep and put it in init and initplayerlocal and seems to work now
Thanks
Does anyone know if there is any way to force an ai infantry to fire a grenade from their launcher at a specific position or target?
selectWeapon to select the GL, then doFire to use it
I have a line in the zero grav script to kill the player above a certain height (due to parachute animation issues)SQF if ((alt > 120) || (alt < 10)) then { unit setDamage 1;}; Is there a way to make this NOT apply when in a vehicle? So players can use air vehicles but if they are NOT in a vehicle above 120M they die?
(due to parachute animation issues)
you can set the freefall height limit btw - dunno if it can help?
oh wait, next patch (that should roll out in the coming weeks)
see https://community.bistudio.com/wiki/setUnitFreefallHeight
I bet yeah!
isNull objectParent unit && {... alt >}
can I put this under the line I posted and vehicles will be exempt?
Sorry I might be dumb but what would look like this?
isNull objectParent unit && {if ((alt > 120) || (alt < 10)) then { unit setDamage 1;}; alt >}
no
just add what i sent before your condition, and inside the {} put your condition
isNull objectParent unit && {... alt >}
if ((alt > 120) || (alt < 10)) then { unit setDamage 1;};``` and then condition where the ellipsis are? What are conditions?
(alt > 120) || (alt < 10) ?
... alt > this is just a placeholder
AH
got it, thanks so much
So what does your line do?
Just so I know what height to set if I'm setting safe zone or kill zone or what
Ah I see about the soldier returning vehicle.
Cool
Thank you, sorry for being dense, this is all relatively obtuse to me and I'm pretty new to it
I still don't really know what to set to accomplish what I want in the {} but I can experiment now so thanks
the { } in a logical expression (&&, ||) short circuits, so in your case isNull objectParent unit && { (alt > 120) || (alt < 10) }, if unit is in a vehicle, then the altitude will not be checked (doesn't make sense to do so) and the result is false, otherwise if they are not in a vehicle, the altitude is checked and based on that it's decided whether the unit dies or not
"selectWeapon to select the GL, then doFire to use it" Does not make them fire a nade at a target.
- doTarget or something
already tried dotarget
fire, dofire, fireAtTarget
I can get them to fire, but not AT the target.
with "fire" he just fires off in some random direction
regardless what he's targeting
Did you doTarget and then doFire in the same go?
yes
he does not fire the grenade launcher at all with dofire, but switches immediately back to rifle
I'm trying to get them to fire a grenade at an invisible target or at a position
I'm getting an error, I assume my syntax/formatting is wrong? saying generic error in expression. SQF addMissionEventHandler ["EachFrame",{ zerog = call intrig; //use this to control the zero gravity on-off alt = (getPosASL unit) select 2; if (zerog) then { 0.1 fadeSound 0; 0.1 fadeSpeech 1; hintSilent format ["Altitude: %1", alt]; unit playMove "AsdvPercMstpSnonWrflDnon"; veccurent = velocity unit; vectrue = veccurent vectorAdd vecupdate; unit setVelocity [(vectrue select 0), (vectrue select 1), 0 + movez]; }; if ((!zerog) && (animationState unit == "asdvpercmstpsnonwrfldnon")) then { unit switchmove ""; 0.1 fadeSound 1; 0.1 fadeSpeech 0; }; isNull objectParent unit && { (alt > 120) || (alt < 10) } if ((alt > 120) || (alt < 10)) then { unit setDamage 1;}; }];
You have an awful lot of global variables that probably shouldn't be global variables there.
vecupdate isn't defined.
although neither is movez. Can't tell from the code which of these are real globals.
- this aint gonna work out
I'm not sure what that's doing there.
Looks like a return value but it's in the wrong place. Missing the terminating semicolon anyway.
if(isNull objectParent unit && { (alt > 120) || (alt < 10) }) then {systemchat "do something"};
This is just an excerpt, 'works' without the isNull objectParent unit && { (alt > 120) || (alt < 10) } line, as above I'm trying to have vehicles exempted from the kill altitude that kills players
could I go SQF if(isNull objectParent unit && { (alt > 120) || (alt < 10) }) then { unit setDamage 1;};?
Is there any reason to believe that will cause the AI to fire AT a specific location or target?
never tried
i think you have to like remove their primary weapon or something
if you try to selectWeapon the launcher, it immediatly switches back to rifle next frame
This is such an elementary thing, there must be somebody who knows how to do it.
what?
create the ammo from AI's position, and maneuver it yourself with scripting
what launcher are you trying?
m203
to be fair, a doTarget with fire isn't that terrible
for the "launch_NLAW_F" atleast
dotarget with fire does not cause them to shoot a nade at a target
the nade just goes off in some random direction
I can get them to fire a grenade. Just not while aiming it at an invisible target or a position.
does doTarget not make them aim?
nope.
they will turn in that direction
but they do not aim correctly
grenade will either fly off somewhere way in the distance, if you fire immediately, or it will hit the ground way short if you add a sleep delay before firing.
they might be aiming correctly for their rifle??? but not for their grenade launcher.
an alternative solution would be if there's a way to configure the invisible target so that the ai is able to normally shoot nades at it. But nobody on earth seems to know anything about this since I've asked like 10 times without ever getting a response.
in A2, I could just use an invislbe "man" target, and the ai would fire whatever weapons at it that they can fire at men. But in A3 for some fucked up reason, you've got to use an invisible vehicle with a crew????
_ai = soldier;
_target = t;
{
_ai disableAI _x;
} forEach ["AIMINGERROR", "AUTOTARGET", "FSM", "PATH", "SUPPRESSION", "TARGET"];
_ai setBehaviourStrong "COMBAT";
_ai doTarget _target;
_ai spawn {
sleep 5;
_this fire "GL_3GL_F";
}
hits the GL very close to the target
I just tried that, he seems to just fire the grenade straight, like it was a regular bullet, meaning it falls way short. Firing at a target 100 meters away, the grenade falls short by about 60 meters.
Is it possible to temporarily disable a weapon without having to remove all of its ammo? The idea being to take away ability for the ai to use his rifle, so he is forced to use the under barrel launcher.
i don't think so
but yeah that's the issue, they properly adjust their aim based on their current weapon
So. Looks like I'll have to do this. Get all their mags, including the one loaded in their gun. Then remove all of them except ones that are grenades. Allow him to shoot for a while, then re-add all the magazines that were taken away. I suppose this mean any partially spent mags will be refilled.
try
onEachFrame { unit selectWeapon "launcher"; }
and then use doTarget + fire worth a try
THE_SHOOTER doTarget invis_target;
THE_SHOOTER fire "m203";
``` Doesn't work. Unit just continues to fire his rifle.
do copyToClipboard str getArray (configFile >> "CfgWeapons" >> "M203" >> "muzzles")
["this","M203"]
from copyToClipboard str getArray (configFile >> "CfgWeapons" >> (primaryweapon THE_SHOOTER) >> "muzzles");
if you run player selectWeapon "M203" does it select it?
yes
well, saving the ammo count and adding back partially-filled magazines is possible
run that on AI, and print their currentMuzzle
if they don't switch back, then i don't think removing mags will help
THE_SHOOTER selectWeapon "M203";
player sidechat str currentMuzzle THE_SHOOTER;
};
``` Spams "M203" in sidechat. But AI still fires only his rifle and without missing a beat.
https://cdn.discordapp.com/attachments/696730752959774722/1010690153834098708/ArmA_3_2022.08.21_-_02.00.04.06.mp4 they do adjust and shoot properly for the MX, maybe the weapon you have is just bugged or something in the config 
are you shooting at an invisible target?
a bench ๐
invis_target setposasl (getposasl A_LOW_WALL);
invis_target allowdamage false;
createVehicleCrew invis_target;``` In this test I'm creating an opfor invisible target at the position of A_LOW_WALL.
reveal it
He's shooting at it already so it must be revealed
are you able to get them to target a position?
with that ^ yeah
otherwise they just fire their main gun
This is so frustrating. So maybe I can get this to work with some kind of invisible target that is unaligned to any faction.
yeah what i noticed is if you use an enemy side target, they will switch back to the AR ammo
but if i use a bench, then they don't and aim properly
is there some kind of really basic object I can create mid game and make invisible?
just to serve as something to aim at
do you use independant side?
O_TargetSoldier = OPFOR invisible target soldier
there is an independant CBA invisible target, so you just make that friendly
nah, it needs to work for both sides
wait, is it even possible to force an ai to target a specific thing, if there are hostiles around?
yeah if you disable their features
well then you can create a friendly invisible target of that side
No cuz I don't want enemies shooting at it
I want something that nobody will shoot at except the designated shooter, and then only with the weapon specified
independant target, and make it friendly to both sides then ๐
let me check if that works
Independent target doesn't work. He still fires only his rifle at it.
setting captive prevents ai from firing on it at all
Is there not any kind of simple empty object that can be invisible, just to serve as something to dotarget on?
soemthing that has no collision volume so things wont run into it and it wont stop bullets
even if you use fire?
I was using dofire
_unit selectWeapon "M203";
_unit reveal _target;
_unit doTarget _target;
_unit spawn {
sleep 2;
_this fire "M203";
}
I'm going to try using helper objects. But it appears they block bullets. Is there a way to prevent that?
hideobject might work
How do I cancel a dofire? Suppose I want to move the target, and then have him fire upon its new position? Just moving it alone, he continues to fire upon where it was.
does what i sent not work?
i think a helper object will have fewer problems, so I'm going to try that
for one it doesn't have a side or a group
and so far it's working
now the only problem left is I want there to be spread to the shots, so I'm moving the target. However with dofire, the ai continues to fire upon where it was.
vanilla tracers module goes around this by disabling the animation and rotating the soldier through code ๐คฃ
I guess doing dofire again after the target has moved will adjust the fire.
I thought I had it all figured out. But once I move the helper object beyond more than about 50 meters out, they can't seem to shoot at it anymore.
anyone know why dofire would work on a helper object if it's about 50 meters away, but not 100 meters away?
it's like he can't see it he's not even pointing at it anymore
try to reveal
it might also have to do with the AI aiming time too
I'm using reveal as well so he should know as much about it as possible
reveal 4?
THE_SHOOTER reveal [vis_target, 4];
he wont even look in its direction once it's 100 meters away
I tried to help him out by modding the object like this: class VR_Helper_base_F; class VR_3DSelector_01_default_F : VR_Helper_base_F { cost = 300000; camouflage = 100; audible = 100; spotableDarkNightLightsOff = 100; spotableNightLightsOff = 100; spotableNightLightsOn = 100; threat[] = {1.0,1.0,1.0}; accuracy = 0.02; }; but it didn't have any effect.
guardmeden
does killzonekids firemode script work for ai
to make them spray far range
It's not just the helper objects, they don't seem to want to dofire on any other kinds of objects more than about 75 meters away
Hmm... they will dofire on things farther away if they're map objects or editor placed objects. BUT not things spawned in during the game???!!
What happens if you reveal the target to the shooter first?
I've been doing that for a while now.
oh right. I didn't scroll up
so dofire against editor place target = good. dofire against object made with createvehicle = bad.
Even if they're the same exact class of object
I've given it a good minute after spawn, and the object is only a little more than 100m away
he wont even look at it.
50m away, then he looks at it and shoots
What happens if you "activate" it by moving into range, and then move it out again? Does it still get engaged? (This won't solve your problem, I'm just curious)
I've given up working on this for the moment. It's been hours just spinning in circles, trying to do something extremely basic.
Honestly there's nothing basic about getting Arma AIs to do anything :P
If you need this as a one-off scripted thing, you're better off pointing them in roughly the right direction and redirecting the grenade yourself.
Arma just doesn't give you access to a lot of primitive AI functionality, and half of what it does give you doesn't work.
Is there a way to add more smoke when the ai shoots and if the bullets hit the ground
I don't know if you can detect bullets hitting the ground, but you can certainly make more particles.
can you ask your questions without pinging someone unrelated please?
yeah particles are really not my thing :P
im not pinging anyone
When they shoot? Yes, fired EH. When the bullets hit? Maybe in 2.10 when ammo event handlers arrive, otherwise through a config+effects mod (there are some mods already that change impact effects)
The reply function pings the person you reply to unless you turn the switch off
you did, by replying
Replies ping people unless you click the button on the right. Discord sucks.
Oh I didnt know replying works like that my bad
it's notifying the person and is not good etiquette, let's say. the channel is visited by many people, they will see your question nonetheless
That's an extreme problem. Bohemia is wayyyyy too tied to doing things their way that it's a huge pain in the ass to get the ai to do anything different.
For the last few years it's really been less "tied to doing things their way" and more "tied to not completely redoing the AI system on a skeleton crew and probably breaking everything in the process"
In Reforger/A4 I think there will be a lot more direct access to AI control (if there isn't already, I haven't been keeping up) since it can be built in to begin with, instead of requiring a massive rework with huge back compat problems in order to add it
Hey, does anyone know how to have a Spartans shields turn on at mission start? Operation Trebuchet
zerog = call compile preprocessFileLineNumbers "scripts\zerograv\intrig.sqf";``` trying to call intrig.sqf to offload it from the zg.sqf I posted earlier but it's throwing a generic error, what have I done wrong with this line?
the error is elsewhere(in the script), what you sent is fine
intrig = {
_return = true; // North
if (unit inArea bship1) then {_return = false};
if (unit inArea bship2) then {_return = false};
if (unit inArea fship) then {_return = false};
if (unit inArea fship2) then {_return = false};
_return
};```This is intrig.sqf
what is bship1 and others?
then the error is not here either, the code could be written alot better though
what do you do with zerog anywhere?
you return nothing, so why assign it to a variable?
that might be the issue aswell, if you leave assignment on the stack, you can't assign it anywhere iirc
Thanks for your help, we ended up trying something different and using triggers for 'airlock' doors which circumnavigated the issue entirely
Someone?
don't they have a discord?
No idea
This may have some documentation? https://steamcommunity.com/sharedfiles/filedetails/?id=2054469543&searchtext=mjolnir
No
I know how to turn the suit on
I want to know if it's possible for the shields to be automatically turned on when you start a mission
Is there a script or anything?
And OPTRE now has that mod included
Hi, If i want simple object, and i set place to object 1st attachTo player +10m front , and when I have decided place where I want to create it,
detached from player, but I want get position -(x)m lower and dir correctly.
So which commands I use to get all of these.
Let me know if my question is only confusing , i will explain again with better arguments ๐
getRelPos? @stable dune
modelToWorld(World) is more correct
is it correct over everything or over the water only?
if compared to modeltoWorld
? I meant compared to getRelPos
Both work over water
But modelToWorldWorld is generally better because it returns the pos in absolute format
oh I thought AGL was affected by waves or something
It is
oh so over water ASL is better
also its better to use ModelToWorld here right?
no I'm just comparing the two sorry for the confusion
comparing modelToWorld with modelToWorldWorld
Well obviously in that case draw3d needs AGL so MtW is better
Which is why I said it depends
If you need to work with vectors and offsets MtWW is better, because it's absolute
but let say we want to view the memory points on water (player on a boat)
ASLtoAGL is affected by waves still?
Correction*
oh alright, thanks a lot
Yeah, this one I'm using, and tested with modelToWorld.
Seems i have issue somewhere else because systemChat return with
str(_pos select 2) = 0```` And my position is [2891, 6242, 106]``` And my camo net is front of me 10m.
I do part by part and log where is changes to 0
What is _pos?
baby don't hurt me
Sry.
That is my created tent pos.
He meant which command you use to fetch _pos?
@little raptor
little challenge @little raptor , how to spawn a parachute in the air and have it land on a precise point, factoring wind ๐ scenario is players call a scripted supply drop. if the plane drops it right over them, the wind can carry it anywhere (even into water or tree tops)
i have worked on it in the past and failed
You're using getRelPos which always sets z to 0
Depends how you want to do it
Using setVelocityTransformation every frame can make it 100% accurate
I haven't looked at their trajectory. But if it's predictable using a linear or quadratic equation again it can be done easily
this should be on the wiki ๐
Is it not? 
Oh, good to know. Didn't realize that.
I guess I'm confusing it with getPos 
The real problem is you don't pay attention to position formats
createSimpleObject takes ASL
You're providing AGL
๐ฒ Times when I feel stupid
No need to feel stupid. Just read the wiki carefully 
True
will change the mistakes in the script and try again. Thanks for looking at my script
I tried the hot reloading of DLL (extension) but the "apply changes" button doesn't change anything even i get message it did. I can debug the DLL though. anyone else got this working with C# DLL? (Visual studio 2019)
Just curious. Is there a script I can put into a static weapons init. That will destroy it when the gunner is dead?
Could give em variable names and do Alive and on the gunners. Then setdamage on the statics ๐ค
on the gun:
set the static weapon variable in the gunner with setVariable
add a "Killed" event handler on the gunner that will setDamage the setVariabled static weapon
also, what happens if he gets out by himself? ๐
It's the AI xD
IDK if they do
(also, AI mods, etc)
I've never seem em exit em
go with my pseudocode then
But would be nice for the AI to killed the gunner and not spend 10 minutes trying to destroy the static
Yeah , got it work with right position formats.
Is there possiblity to do each frame or ace progress eh to get my tent to follow shape of ground?
they stop
mods?
ta-daaa! ๐ต
he made me start the game to test vanilla behaviour, he owes me a pint
new rule now: everytime I have to do that, I collect a pint
I use lambs danger. But according to them. Its vanilla behavior
beer nonetheless
set its Z to 0
and setVectorUp surfaceNormal
Thanks
No beer for you
you used a mod, you didn't check vanilla, I did, beer for me
and most importantly, YOU DID NOT MENTION YOU USE MODS
Who tf doesn't use mods ๐
Lambs is the only mod that effects AI and they say they didn't mess with that. That it's default behaviour
IDC ๐ you didn't check, and you didn't mention it
beer
@warm coral
_x addForce [aimPos _this vectorFromTo aimPos _x vectorMultiply 200, _x worldToModel ASLtoAGL aimPos _x];
_x setDamage 1;
will add it to it once im on pc again
thank you very much for all thw script help btw
Humm, how i do these?
Are these just for planting so I can't make my tent move with the terrain?
_obj setVectorUp surfaceNormal position _obj;
But can i get that done in eachFrameEh ?
Is it possible to make setVelocity work with a non-local object?
argument is local, but the effect is global
yes, but i need global argument, Maybe there is some workaround
remoteExec?
remoteExec ["setVelocity",object] ?
as explained there: https://community.bistudio.com/wiki/remoteExec
i have 3 Editor placed objects and i want to place them at random positions on the map but how can i ensure that they never get placed at the same position?
this is what i use, but sometimes they "spawn" at the same position:
_randomObjPos = selectRandom [
[7595.75,4005.57,0],
[7595.97,3993.47,0],
[7589.42,3999.57,0],
[7583.47,3993.63,0],
[7583.51,4005.68,0],
[7577.25,3999.46,0],
[7571.52,3993.45,0],
[7571.37,4005.22,0]
];
obj1 setPosATL _randomObjPos;
obj2 setPosATL _randomObjPos;
obj3 setPosATL _randomObjPos;
your code selects a random position(once), and then sets all three objects to that position
true, but even if I define the same positions for all objects separately, sometimes they spawn in the same position, how would i prevent that?
use _randomObjPos deleteAt floor random count _randomObjPos
instead of selectRandom
this worked
_randomObjPos = [
[7595.75,4005.57,0],
[7595.97,3993.47,0],
[7589.42,3999.57,0],
[7583.47,3993.63,0],
[7583.51,4005.68,0],
[7577.25,3999.46,0],
[7571.52,3993.45,0],
[7571.37,4005.22,0]
];
_pos1 = _randomObjPos deleteAt floor random count _randomObjPos;
_pos2 = _randomObjPos deleteAt floor random count _randomObjPos;
_pos3 = _randomObjPos deleteAt floor random count _randomObjPos;
obj1 setPosATL _pos1;
obj2 setPosATL _pos2;
obj3 setPosATL _pos3;
Hey, sorry if this is a pretty easy solve, I wrote this script using event handlers, and its my first time doing it myself. I have done a little research but haven't been using them for nearly long enough to be able to identify what's wrong.
The hint activates, which is telling me that the script should work, however, I'm getting the error "local variable in global space" at the second line, I think I've set my params up incorrectly but can't identify it.
_myIndex = Unit1 addEventHandler ["GetOutMan", {
params ["Unit1", "Cargo", "Plane1", "_turret"];
hint "Flare fired.";
_flarePos = [player, random 100, random 360] call BIS_fnc_relPos;
_flare = createVehicle ["F_20mm_Red", _flarePos, [], 0, "NONE"];
_flare setPosATL [getPosATL _flare select 0, getPosATL _flare select 1, 150 + (random 75)];
_flare setVelocity [0,0,-0.1];
Unit1 removeEventHandler ["GetOutMan", _myIndex]
}];```
you can't use global variables in params
So would the params just beparams ["_unit", "_role", "_vehicle", "_turret"]; and I assume the EH finds these?
Additionally to what Sharp said... you can use sqf unit1 removeEventHandler ["GetOutMan", _unitEventHandler]; instead of sqf Unit1 removeEventHandler ["GetOutMan", _myIndex]
they're passed into the event handler itself via _this, all params does is just "parse" them
yes something like that
Alright, that makes sense, my brain thought that I had to define them as the unit I wanted it to be activated by, the role of the unit in the vehicle and the vehicle it was leaving
also Unit1 removeEventHandler ["GetOutMan", _myIndex], _myIndex is undefined
local variables don't carry over into new scripts
you should just use _thisEventHandler instead, it's a magic variable inside the event handler that references the id of this added event handler
It's all in initPlayerLocal.sqf, is that still counted as a new script?
no that's not what i meant
you assign _myIndex outside the EH scope, and then try to use it inside of it, it doesn't carry into it like that
It is ok to learn! We were all exactly where you are right now at some point and we were lucky enough that the community endured our learning process.
haha fair enough, I do have one more question though. I want this to only be used if the unit (Unit1) leaves a specific vehicle (Plane1), is there a way of detecting if it is that vehicle?
Yes, from inside the EH it could be sqf if (_vehicle isEqualTo nameOfVehicle) then {//code};
Awesome, thank you! ๐
are you the one creating the vehicles aswell?
if so, you can just check for the count in that moment
wat? if a client wants to create a vehicle, ask the server to do so, which then the server can also check the count, and delete previous vehicles based on that
tag_fnc_onCreatedVehicle = {
params ["_vehicle", "_args", "_cb"];
if (_cb isEqualTo "") exitWith {};
[_vehicle, _args] call (missionNamespace getVariable _cb);
};
tag_fnc_createVehicleServer = {
params ["_type", "_position", ["_callback", ""], ["_args", []]];
private _veh = createVehicle [_type, [0, 0, 0], [], 0, "CAN_COLLIDE"];
_veh setPosASL _position;
if isRemoteExecuted then {
_veh setOwner remoteExecutedOwner;
[_veh, _args, _callback] remoteExecCall ["tag_fnc_onCreatedVehicle", remoteExecutedOwner];
};
tag_vehicles pushBack _veh;
if (count tag_vehicles > 10) then {
// delete the ones you wish
};
_veh
};
Is there some means of scripting in a vehicle 'respawn on position' like the Zeus module, or would a killed EH function be better?
i mean there are respawn modules you can use
but internally they use the killed EH, so it's the same thing basically
Yeah, this would be a scripted in vehicle and I was already doing the EH method for one, but wanted to make sure I wasnt committing some grave oversight :p
Is there a way to disable footprints and tire tread marks on the ground? After long games, these seem to bug out and cause visual problems.
you can delete them e.g on their creation
also, they should disappear with time actually
After an hours long game, they seem to get stuck and just keep compounding
I'm not going to bother with that. Just need to figure out how to disable them.
also are you sure it's related to long-running missions, or save-load?
you can't
no save-load
it's either because of long missions, or missions that span a certain times of day.
But they visually start bugging out, and compounding all over the place
of course you can't disable them.... sheesh. So there's a way to delete them when they're created though?
since v2.10 update (which will be released this week hopefully) you can use ObjectCreated event handler and just deleted them right after they're created
wait did Dedmen remove footsteps from that? 
I don't remember
How bout this one? Is it possible to disable the little particle puff originating from men's feen when they're walking?
setHumidity ๐
do those get bugged too?
No just pointless visual clutter I'd like to get rid of. Plus they look bad.
ObjectCreated has not been confirmed? 
well, crosses fingers then.
oh it was called EntityCreated 
If humidity is changing according to weather, does that mean sethumidity has a temporary effect?
yes
nobody added it to the wiki 
yeah those are documented ๐
oh nvm I'm blind...
yeah nvm footsteps were removed (they get filtered by the EH and it never triggers for them)
{
if (!isObjectHidden _x) then {
_x hideObject true;
};
} forEach (player nearObjects ["#track",1000]);
``` try this
While I'm here I might as well ask about this. Last night I discovered a new (to me) bug that was causing ai led groups to get stuck. The leader was stuck in some kind of state between dead and alive. And the group didn't recognize this and did not select a new group leader. So they stood around for like 30 minutes in that state. Any ideas what was going on?
or just delete them 
cant
why not?
e_e
doStop bug? AI mods?
do you frequently mess with enableAI/disableAI stuff?
Only Target or AutoTarget
ye idk when i try to delete them it doesnt dissapear, but if i hide it, it does so..
Another vehicle got stuck in a weird way. I got in as driver to see what was wrong. Engine was fine. Fuel was fine. But engine would not turn on and vehicle could not move. AI never recognized anything was wrong and did not abandon the vehicle.
arma things i guess
yeah you can only hide footsteps, not delete them
also #track is not the only type, there is also #mark
Deleted vehicles are automatically removed from a group's vehicle pool, right? They're not going to get stuck thinking they've still got the vehicle.
yep, it should be like that
Hi, did anyone work with calculatePath command? I'm having trouble to make it work for helicopters. When i use "calculatePath ["helicopter", "aware", [0, 0, 100], [1000, 1000, 100]]", "PathCalculated" event never fires
did you isNil it?
https://community.bistudio.com/wiki/calculatePath see the warning box
just use the PathCalculated EH
"PathCalculated" event never fires
When i use "calculatePath ["helicopter", "aware", [0, 0, 100], [1000, 1000, 100]]", "PathCalculated" event never fires
PathCalculated always fires if a path is calculated
indeed seems to be bugged, https://cdn.discordapp.com/attachments/907855097940287498/1011012482350989382/ArmA_3_Screenshot_2022.08.21_-_23.42.22.12.png there is only particle animation for the invisible heli ๐
the description says it Triggers when calculatePath command has calculated the path.
not if any path is calculated though
yay
I tried using isNil, still nothing
just use the PathCalculated event handler like I said
that command is useless 99% of the time anyway
because the game generates paths in segments
it doesn't give you the whole path
one call is usually not enough
fixed and expanded:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#PathCalculated
purrfect ๐ thanks!
I use this event handler already, do you mean i should ditch the calculatePath command and just wait for AI units to trigger this event?
I hope you get paid enough Lou. It's crazy how much you help here 
i should ditch the calculatePath command
yes
do you give the command to normal AI? or agents?
I just tested helis and everything works fine
I use it to check how long does it take for helicopter to travel from point A to point B
I don't use it for any vehicle in particular
with calculatePath? or manually creating the agent
Discord help is not part of my job, it's free of charge for the love of it โค๏ธ
atleast for agents they don't move if you hide their helicopter (hideObject)
that's probably why calculatePath doesn't work either for helicopters, as it's hidden
Is there an event handler that fires whenever any kind of equipment is dropped? I.e., dropped from inventory, or CUP disposable launchers tossed automatically.
EntityCreated
tho only when a new weapon holder is created
you can also use the Put EH
all (objects) event handlers are listed here:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
mission event handlers here:
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers
put doesn't work for CUP disposable launchers
just tried it
Does EntityCreated exist yet?
So there's no event handler that can catch these disposable launchers
maybe a CUP scripted EH
have any idea where to find that?
CUP doc
They don't seem to have any section on EH or scripts.
textures and classnames are the only two sections of their wiki
Hello
Is there a script I could do with "Add weapon turret" to add every weapon in game to a vehicle
Without having to manually copying EVERY config
you could get all weapons from config then forEach add them, but there is nothing "out of the box" for that I'm afraid
Right now I have a text file with the base vanilla weapons but it kinda takes alot of text space
Does the foreach thing make it so I don't have to write everything out?
the config getting would do that, not the forEach
it kinda is
Oof
So how would I grab all weaponturtets from the config
I could figure out the loop myself.
see configClasses
https://community.bistudio.com/wiki/configClasses
toString { /* conditions */ } configClasses (configFile >> "CfgWeapons");
The Put EH does work, like Leopard said.
You attach it to any unit that might drop an item.
it probably creates a launcher prop on the ground that's non interactable and has no inventory logic whatsoever
so in that case it won't catch that
IIRC the CUP ones do drop real launchers. You can even pick them up again.
hmm
Possible that Put doesn't work for those anyway though. Not sure how it dumps the item in that case.
I tested that it did work for dropping launchers on death.
Is there a script or a mod out there that disables the Freefall animation? Running a Harakoni Warhawks unit but the Freefall takes away from the Airborne insertions when we're using Retro Thrusters and we fall flat on our faces.
Nevermind I see its being added in 2.10 disregard my question
anyway via scripting to make squads stay in formation with weapons lowered? I got the SL to be in combatBehaviour "SAFE" while the squad is in behaviour "AWARE" with speedMode "LIMITED", this makes the SL walk with weapon lowered and units in formation, however the other units walk with weapon raised, setting individual units to be combatBehavior "SAFE" defaults them to the column formation
just set the behaviour on entire group
@copper raven but if you set the group behaviour to be SAFE, they immediately default to column and do not use other formations
tried setting formation after behaviour?
yes, I think its just prebuilt into arma for some reason that all SAFE groups walk in column no matter what. if there's a mod or workaround to make AWARE units walk with weapons lowered, that would fix my problem
g setFormation "ECH LEFT";
g setBehaviourStrong "SAFE";
works fine for me
just tried it, same result walking in column, did you set up the group any specific way?
maybe you have a mod that messes with their formation 
no, just put a regular group in 3den and ran that code
did you tell them to move at all? just tried it with vanilla AI and they do not use "ECH LEFT" formation but immediately move into column
no
Is this on roads or in the open?
in the open
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
Okay, what does this mean? What part of it you wanted to turn into a while? What exactly is your intention on this strange code after all?
dude setbehaviour "COMBAT";
_logic = createGroup west createUnit ["Logic", [0,0,0], [], 0, "NONE"];
_n = [dude, _logic] spawn
{
params["_dude","_logic"];
sleep 1; // give unit time to raise his weapon in combat mode
while {true} do {
_logic action ["useWeapon", dude, dude, 1]; //
sleep .3;
};
};```?
What do you mean?
What exactly is your intention on this code, as I said?
I've sent you this link before
consider bookmarking
it takes any type of array, including one produced by units https://community.bistudio.com/wiki/units
{
//your code here, use _x as described on the wiki
} forEach units blufor;
Where would I put this on the script above
this
read the comment in my code block
between that and the forEach page I don't know what else you want
see example 3 on the foreach page
Why did you removed a lot of your posts here
Putting it between will not work
Just do that will not of course. The magic variable _x is needed to use
{
_x setbehaviour "COMBAT";
_logic = createGroup west createUnit ["Logic", [0,0,0], [], 0, "NONE"];
_n = [_x, _logic] spawn
{
params["_x","_logic"];
sleep 1; // give unit time to raise his weapon in combat mode
while {true} do {
_logic action ["useWeapon", _x, _x, 1]; //
sleep .3;
};
};
} forEach units blufor;
TBH this is not really recommended because it spawns a lot... I would make forEach in the while
That would still make it loop though right? otherwise Id have to execute constantly
while {true} do {} will never ends
Ok I saw what you did for the forEach you replaced "dude" and "_dude" with _x
I appreciate that but now how would I foreach in the while
{
_x setbehaviour "COMBAT";
} forEach units blufor;
_n = [] spawn
{
sleep 1;
while {true} do {
{
[_x,primaryWeapon _x] call BIS_fnc_fire;
} forEach units blufor;
sleep .3;
};
};
```I guess
Oh wow the whole script was almost rewrotten LOL! Thank you so much!
Its working better than the other one
Pol is there a way to change the firemode of the soldiers cause the other one you can change to single, burst, auto
"The other one"?
works almost too great tbh i set the force to 20000 by accident, sent 5 soldiers into the stratosphere and crashed my game
will nearentities get map objects trees rocks etc?
any way to disable tracers from ai?
tracers?
bullet tracers? replace their magazines
do the extensions have full access to your computer? or is it limited?
limited to your Windows user's permissions
ah ok, same as arma right?
I would say so (unless you run it as admin)
arma should run normally, without admin rights
depends
on what?
if you have issue installing BattlEye โ run Arma as admin
if you want to use Huge Page Files for RAM โ run Arma as admin
anyway, why do you ask? if it is for "can I run this absolutely unknown dll on my PC safely", the answer is "no you cannot - you must know and trust the source"
i don't thinki i've ever given admin run to arma.. maybe to steam
I started thinking about this after I got DLL from Leo ๐
C:\Users\youProfile is open bar
I wouldn't trust Leo btw
imagine, a big cat writing code, brrrr
No
how can i get them?
nearestObjects or nearestTerrainObjects
I'm looking into making our CBA settings for the server into a .pbo and load it from there.
It says on the CBA page that if you use this method the settings can't be change anymore by admins.
Is this all settings, or only the settings included in the .pbo? or will rows that are not included simply be locked at default values?
any way to disable friendly fire in ai and make them stop spinning without disabling move?
โฆwhat
is disabling friendly fire for ai confusing for you?
yes
and the stop spinning too
Well is it not possible to disable friendly fire I dont want my ai killing my own ai
disable friendly fire in ai
was unclear, because "in AI" did bring confusion,
and it could mean "player not being able to friendly fire AI" or "AI not being able to friendly fire AI (or players)"
but with a HandleDamage Event Handler, you can do this
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
I guess drawLine only works on map?
depending on use case drawLine3D can help ๐คทโโ๏ธ
need 2D lines on GUI
screenToWorld ๐คทโโ๏ธ
that returns 2d pos
i was thinking maybe it's possible to somehow fake the Map ctrl?
no, first, usecase please
2D lines on GUI = CT_STATIC + ST_LINE
well, another way would be to create RscLine control. Except it my code here seems to be a dirty hack (and persists through mission restarts in my testing) XD
_line = findDisplay 46 ctrlCreate ["RscLine", -1];
_line ctrlSetPosition [0,0,1,1];
_line ctrlSetTextColor [1,0,0,1];
_line ctrlCommit 0;
_line = findDisplay 46 ctrlCreate ["RscLine", -1];
_line ctrlSetPosition [0,1,1,-1];
_line ctrlSetTextColor [0,1,0,1];
_line ctrlCommit 0;
oh great man going to try it ๐ thx
will see what works..
can't make the ctrlAddEventHandler ["draw", to trigger
did you mean I must use the control to draw the line and not use drawline at all?
that works, thx ๐
it's going to be a lot of line ctrls
if you press restart in the menu then yes, the mission display doesn't get destroyed, if you exit to editor and back, then yes
can you change RscLine width? been going through the config values but no dice
this should be unpinned no?
no
you have to make an RscPicture or something
it should be updated yes
but I'll unpin it indeed
sounds like a lot of work...
but I want lines connected to each other. not sure how to rotate for that...
they can be however you want them to be. the only difference is you have to make it as wide as the total line length
well i can try
you can make a function to make things easier
I haven't done this myself but I think you also have to divide by GUI_GRID_W and H to make sure the width and height have a uniform size
if you have complex lines but they don't need to move or be dynamically generated, perhaps you could draw them as a vector image (e.g. with Inkscape) and simply display that as a UI element
they are dynamically generated
params ["_p1", "_p2"];
_p1 params ["_x1", "_y1"];
_p2 params ["_x2", "_y2"];
_x1 = _x1 / GUI_GRID_W;
_x2 = _x2 / GUI_GRID_W;
_y1 = _y1 / GUI_GRID_H;
_y2 = _y2 / GUI_GRID_H;
private _w = abs(_x2 - _x1);
private _h = abs(_y2 - _y1);
private _x0 = _x1 min _x2;
private _y0 = _y1 min _y2;
private _angle = -(_h atan2 _w);
private _line = ...ctrlCreate...;
_line ctrlSetPosition [_x0, _y0, sqrt(_w^2 + _h^2) * GUI_GRID_W, _desiredLineWidth];
_line ctrlSetAngle [_angle, 0, 0];
_line ctrlCommit 0;

I'll give it a try, thx
cant get anything to render with that , probably because the coords used for linedraw ctrl are different....
well:
- did you define
GUI_GRID_WandGUI_GRID_H? - did you add a texture to the RscPicture?
yeah I noticed why
the x0 and y0 are wrong
but for some reason I can't get it to rotate 
#define GUI_GRID_W (((safezoneW / safezoneH) min 1.2) / 40)
#define GUI_GRID_H (((safezoneW / safezoneH) min 1.2) / 30)
params ["_p1", "_p2"];
_p1 params ["_x1", "_y1"];
_p2 params ["_x2", "_y2"];
private _x0 = _x1 min _x2;
private _y0 = _y1 min _y2;
_x1 = _x1 / GUI_GRID_W;
_x2 = _x2 / GUI_GRID_W;
_y1 = _y1 / GUI_GRID_H;
_y2 = _y2 / GUI_GRID_H;
private _w = abs(_x2 - _x1);
private _h = abs(_y2 - _y1);
private _angle = -(_h atan2 _w);
private _line = findDisplay 46 ctrlCreate ["RscPicture", -1];
_line ctrlSetText "#(argb,8,8,3)color(1,1,1,1)";
_line ctrlSetPosition [_x0, _y0, sqrt(_w^2 + _h^2) * GUI_GRID_W, 0.5 * GUI_GRID_H];
_line ctrlSetAngle [_angle, 0, 0, false];
_line ctrlCommit 0;
I meant cant get anything at all working
I know
like I said _x0 and _y0 were wrong (both divided by GUI_GRID)
I moved them to the top
oh 
Procedural textures filled controls do not rotate
the RscPicture is refusing to work for me XD
why cant even this work: _lineCtrl = _display ctrlCreate ["RscPicture", -1]; _lineCtrl ctrlSetPosition [-0.4,0,0.2,0.2]; _lineCtrl ctrlCommit 0;
?
too off screen?
nope...
are you sure?
well i tried many coords
well default RscPicture has no texture
at least give it something to be visible...
well yeah it gets skewed...I wasn't wrong
well it renders now the "boxes" but not quite there
this is why i thought it would be difficult ๐
it wouldn't be difficult if things worked in Arma as expected...
lol true
@little raptor this is how your code looks like in action: https://postimg.cc/9RC0pG3W there are two lines going there
if you're using procedural textures it's known that it doesn't rotate
im not using any textures just colors
well for your code i just have this: ```class TestCtrlCfg : RscPicture
{
colorBackground[] = {0,1,0,1};
colorText[] = {1,0,0,1};
text = "#(argb,8,8,3)color(1,0,0,1)";
};```
that's a procedural texture...
anyway ctrlSetAngle doesn't work the way I thought it does
so let it go. just use RscLine...
new things to learn
ok
is non-procedular like .paa file for example?
ok thx ๐
Reminds me of that moment when you browse a sqf script on github, and your whole screen is literally empty because ALL of the script in view is out of view to the right
+ and param and select and... more
Ah, of course now that I think about it. Thanks for pointing it out ๐
If you know ALL the code, you can do that.
But generally you don't.
as soon as a script does a call all bets are off.
You may think you know whats behind that call, but if its a global variable, you don't know if someone else may have overwritten or redirected it to something else
Yeah, if there's some part running where the supposed transpiler isn't being used, it's, well... RIP my concept ๐
Every sqf value is a allocation.
If they are not references, that means you'd have to allocate a copy everytime you call something, huge performance waste. and as youc annot edit the values anyway there is no harm to passing references
These wireframes are truly amazing
Someone pinged me here a few days ago, and now the ping is deleted :sad: I'll never know what it was
C# has it by default, no need to do anything afaik
freeExtension decrements the dll's reference counter. If its not zero its not unloaded. .NET will be doing something there
yes
Went through that idea with the SQF Bytecode optimizer.
Cannot optimize what I'm not 100% sure about.
A single call or if VARIABLE or && VARIABLE or || VARIABLE will make all optimizations on local variables impossible because any of these could modify any local variables
A single call or if VARIABLE or && VARIABLE or || VARIABLE will make all optimizations on local variables impossible because any of these could modify any local variables
if you do not know the code constant then yes, technically everything that comes before that and after cannot be optimized, as you don't know what variables it can modify. but if you know the code it's calling at compile time, you can keep going
I understand what you're saying but I meant moreso in terms of why references are forced rather than optional. Just copying primitives combined with the ability to actually edit the variables directly wouldn't be a "huge performance waste". Though I understand that the design goal of SQF was simplicity so I'm not surprised either.
"combined with the ability to actually edit the variables directly" well that ability doesn't exist, thats why
Yes which is why I ended my comment with how it makes sense given the design goals of the language
you very rarely know the code though
well if you cache preinit variables/cfgFunctions and what not (the ones that are compileFinal), it's not that terrible actually, but yeah
in SQF bytecode you don't know what mods may be loaded, any mod may change CfgFunctions or preInit's
true that
i have been trying to code a missile to fly to a position then search for a target, i have been unable to get the vanilla cfg autoseektarget to function and am attempting to script a target seeker
private _LoalTarget = createvehicle ["C_Offroad_01_F", [0,0,100], [], 0, "NONE"];
_loaltarget hideobjectglobal true;
_LoalTarget enableSimulation false;
_projectile setMissileTarget _loaltarget;
//delate Search point target and seek new target
[_loaltarget,_projectile] spawn {
params ["_loaltarget", "_projectile"];
waitUntil {_projectile distance _LoalTarget < 2500;};
private _targets = _loaltarget nearEntities ["Allvehicles",500];
private _list = [_targets, [_loaltarget], {_input0 distance _x}, "ASCEND"] call BIS_fnc_sortBy;
deleteVehicle _loaltarget;
_targetLocked = false;
{
_terrainobscure = terrainIntersectasl [getPosASL _projectile, getPosASL _x];
_obscureobjs = lineIntersectsWith [getPosASL _projectile, getPosASL _x, _projectile, _x];
if (!_terrainobscure && (_obscureobjs - nearestObjects [getpos _x, ["All"], 10]) isEqualTo [] && _targetLocked == false) exitwith {
_projectile setmissiletarget _x;
_targetLocked = true;
_list = [];
};
} foreach _list
};
the issuie im having currently is i fire 6 missiles at 6 different targets and there all converging on 1 or 2 targets out of the 6
this is being spawned in a fired event handler, and im having this issuie evan if i tell the missiles to get to the first target in the avaliable target list regardless of obscurance.
i have left out the convoluded code about the placement of the _loaltarget but guarantee there appearing on the intended targets
I used a small code to make it so when someones enter a specific vehicle they turn captive but for some reason it affects all vehicles
I'll post it here
condition:
isNull objectParent player
On Activation:
player setCaptive true;
I want when my players enter a prison bus they turn into captive mode
but it affects all vehicles
Yeah, that triggers on all vehicles.
the bus variable is "ik"
You'd want objectParent player == ik then.
no
objectParent player is the vehicle that the player is currently in
isNull objectParent player is true if the player isn't currently in a vehicle.
I put a !() around it
yes, hence it kinda worked :P
but objectParent player == ik should return true if the player is currently in your prison bus.
no !, no isNull
ok
testing it now
and when I want them to change I'll just write the same but with !=
?
Or close with !()
like
!(objectParent player == ok)
!= is fine.
ok
Proper solution to this sort of thing is to use GetIn/GetOut or GetInMan/GetOutMan event handlers, but I think that's a bit above your syntax level atm :P
yea
I try to learn arma 3 coding
I managed to make a nice code block for setting diesel silos on fire
by spawning sog napalm bombs when they die
well, that's an EH, right
You can use trigger there,
Just set trigger on silos.
Set variable name to the silos.
Condition to trigger !alive silosVarName
Activation
"napalmnName" createVehicle getPos thisTrigger
did that with create vehicle
and it spawned the ammo in the position of the silo
lou montana and another guy helped me with finding ammo types
but thanks
how can I use "getPosWorld player" but get the position 5 meters above that player?
Thanks! you rock!
what percent engine damage kills the engine
heyo, I have a bunch of empty markers on the map, like 50ish all with different variable names. How could I quickly grab the variable names? I only need them once as ill be using them to hard code something. Is there a method I can use to grab all markers or anything like that?
Are you grabbing the markers by random?
No I would like to literally grab the variable of every single marker I placed on the map if possible. I just want to copy it to my clipboard, so far I have
copyToClipboard allMapMarkers but I need to convert the array to a string somehow
looking into that now
copyToClipboard str allMapMarkers works
1 i'm guessing?
its .8 i trialed and errored it,
its a bit weird to be .8 instead of 1
but it is
I'm trying to work on some code for SNS and I'm really stuck on implementing a randomisation script\function. I've tried a lot of things but none have worked. I was wondering if someone here would be able to quickly write something that would work, as no one else who works on SNS really has any coding experience.
Some possible ways to check if the loadout should be changed or not:
maybe by using saved3DENInventory or comparing getUnitLoadout _this to getUnitLoadout configOf _this
It would be great if the script could be able to take a "vestList" from the class where it's called, just like BIS_fnc_unitHeadgear
For the record, we are trying to make scripts that randomise uniforms, vests and maybe backpacks.
https://community.bistudio.com/wiki/Unit_Loadout_Array https://community.bistudio.com/wiki/selectRandom https://community.bistudio.com/wiki/setUnitLoadout and arrays of classes is all you need
saw this in the config chat and came here to answer lol. This is the way^
#arma3_config message
I thought I've already told you the exact way
Also saved3DENInventory doesn't exist
it wont work tho
lol you would have to give more information than that
If I had a dollar for every time I got a bug report that was just "it wont work" I'd..... have enough money to hire someone to send emails to everyone on how to properly report bugs
sqfbin the code
I am starting to consider what you say is just troll...
And you keep removing what you say. This is one of the reason why I say you're trolling us
nah im not
Then
sqfbin the code
idk what that means
!sqfbin
with what
Oh I thought it was the command... Just Google it
would be nice if someone added it, like !code
its also at the bottom of one of Lou's pinned messages
not that anyone checks pinned messages 
it used to be differnet but is this what u mean
im only really good at configs idk anything about scripting
circa Line 1 Expected ]={
you pasted completely unrelated code
@oblique arrow should have the responsibility with the Arma Bot. You can check #discord_server's pinned Spreadsheet
Still unrelated to the error
In the first place, how/when the error happens? How did you run the code?
yes because what you're doing makes no sense, _this is an empty array
what is _this in this instance?
i guess Leo passes an empty array, but yeah
We've been discussed what he tries all over yesterday in #arma3_config
I already read your shpeel, it doesnt actually say what you want to see happen
i want the units loadout to be randomised based on whats provided in the class config
when?
Basically when the unit's loadout has not been changed in Eden, will randomize their gear
yeah
And I suggested the code. And IIRC, you didn't said you have a clue or not how to use it
I dont know anything about SNS, I assumed it was a gamemode, so my mind was thinking you wanted randomization when players spawn or something
i basically wanna copy bisheadgear function but for the other items of gear
S&S
sns aka s&S
still no idea
oh ok
so yeah we're trying to add actual units as an extra mod and we wanna randomise the gear
we literally wanna copy the bisunitheadgear function but for uniforms, vests and backpacks
I wouldn't know how to approach that from what you are talking about. If it was applying a script to units placed in eden, like the init box, or spawned via script, I would know. but I've never looked into doing things outside of there
polpox do u think u could write a script for it? you can be added as an author
how do I make my ai unit to face a certain direction and not move?
disable pathing
Yes I can, technically. You'll need a proper config for it whatsoever
setFormDir + doStop
"you'll need a proper config for it whatsoever" wdym by that
Theres a problem when I disable pathing cause they spin around and friendly fire my own ai team and when I disable move it works fine they just cant aim around them
Literally. The config, you'll need it. In case you don't know what config is, what you write in config.cpp
disable movement
I want them to aim all around them though cause when you disable move they cant aim behind them or on the side of them
nah ik what it is but the config for what?
I have a question
Config for what you want to make
please be more specific my english aint very good
do u mean classnames etc? or the config that adds the units
Yush for new command suggestions please add them to the google doc pinned in #discord_server and ping me in that chat
( @copper raven )
me or dedmen
so what do you want, them to face a direction and not be able to face away from there? or to be able to spin and face targets?
you have said both so far
You'll need some config entries that suggest that contains uniform/vest/backpack/headgear the unit should wear/equip
like for bisunitheadgear?
if I want to make only the people in a vehicle change side and not for the rest of the convoy will this code work for a trigger ?
I have the condition just need to check activation'
player setCaptive true;
whats ur question
I have a bus part of a convoy
and thought about making the driver captive so the ai doesn' launch an rpg at him
Ok so I want my unit to face a direction and stay there with the ability to spin and face targets and after he spins and eliminates the enemy his direction resets and goes back to the direction
setCaptive should work fine
player only refers to the local player
oh so the rest of the convoy will be fine
yes
thanks very much
oh, well...
this is a situation where I'd attach the trigger to the vehicle, and reference the driver of the vehicle
oh when?
but your trigger condition is what exactly?
I'm not sure if there's a way to set a direction for them to stick to after entering and exiting combat, you might just have to do it on a loop to set them back to that direction every so often, maybe with a waitUntil to check if they have left combat
like i said use doStop with setFormDir
idk how
ill make one sure
this worked thank you
Hello,
could use a bit of help with some basics. I need this script executed server side when a vehicle (variable name b_1000) enters the trigger area.
private ["_credits"];
_credits = b_1000 getVariable "R3F_LOG_CF_credits";
_credits = _credits + 1000;
b_1000 setVariable ["R3F_LOG_CF_credits", _credits, true];```
The script is in credits_refill.sqf in the mission folder. I've placed a repeatable, server-only, trigger but can't get it right with on activation. Or I'm missing something else. Any help would be appreciated
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
I am trying to have a description for whichever listbox item is currently selected in my GUI, but it is not updating when I select a new item. The line where I update the text works perfectly when I execute it outside of the event handler, but it is doing nothing here. I know the event handler is firing properly because my test hint is working as it should. I know this is because my variable _descriptionHashmap is undefined inside the EH, but there is no way to pass variables with ctrlAddEventHandler. Should I define the hashmap inside the EH and have it recreated every time the event is fired?
_descriptionHashmap = createHashMapFromArray [
[-1, "None Selected"],
[0, "Test1"],
[1, "Test2"],
[2, "Test3"],
[3, "Test4"],
[4, "Test5"],
[5, "Test6"],
[6, "Test7"],
[7, "Test8"],
[8, "Test9"],
[9, "Test10"],
[10, "Test11"],
[11, "Test12"],
[12, "Test13"]
];
displayCtrl 1500 ctrlAddEventHandler ["LBSelChanged", {
hint str lbCurSel 1500; //test hint, working
hint str _descriptionHashmap; //test hint, not working
displayCtrl 1100 ctrlSetStructuredText parseText (_descriptionHashmap get lbCurSel 1500); //doing nothing
}];
Should I define the hashmap inside the EH and have it recreated every time the event is fired?
yes and no.
yes: _descriptionHashmap doesn't exist in the event handler
no: recreating the hashmap is heavy. create it and store it with setVariable in the control
ok, thanks
Is it possible to get a turret's memory axis?
The goal is to estimate center of a turret
Put this inside credits_refill.sqf:
params ["_vehicles"];
if (b_1000 in _vehicles) then {
private _credits = b_1000 getVariable "R3F_LOG_CF_credits";
_credits = _credits + 1000;
b_1000 setVariable ["R3F_LOG_CF_credits", _credits, true];
};
And put this inside the trigger: _thisList execVM "credits_refill.sqf";
@coarse sedge
Thank you, trying it right now...
O____O
if (b_1000 in _vehicles) then { /* */ };
```no?
also, hoping it triggers only once
@coarse sedge I updated it, this is better
and if it triggers only once, directly sync the trigger to the vehicle and write the code in the trigger directly
it is repeatable Mr. Lou
thanks for mentioning setVariable on controls. I've brainfarted and used a bunch of uiNamespace variables for storing stuff 
should I use missionNamespace or uiNamespace to store my hashmap? I haven't used uiNamespace and I'm not sure if its function is more specific...
Can i delete a decal like for example the #Crater decal? I tried deleteVehicle but this not work.
i'd say you use the listbox itself as a namespace. Keeps things nice and coupled.
the control/display itself?
if you can't then you can't
maybe hiding it works
read the doc, dangit รจ.รฉ
works as of 3 minutes ago. I went and checked after seeing that in the doc :3
or moving it to some faraway place like [0,0,0], i remember that working
plz don't
[0,0,0] is a crowded place
not like collision-less decal would break anything there
@winter rose @south swan thanks ๐
I've placed a trigger:
Type: None
Activation: Anybody
Activation Type: Present
Repeatable
Server Only
Condition: this
On Activation:
_thisList execVM "credits_refill.sqf";
And the credits_refill.sqf is:
//params ["_vehicles"];
if (b_1000 in _vehicles) then {
private _credits = b_1000 getVariable "R3F_LOG_CF_credits";
_credits = _credits + 1000;
b_1000 setVariable ["R3F_LOG_CF_credits", _credits, true];
};
do i need to define _vehicles?
thatt's wrong.
Yeah, I know...
place a trigger, synchronise it to b_1000
make it "one time only" & "server only"
and in the init, place```sqf
private _credits = b_1000 getVariable "R3F_LOG_CF_credits";
b_1000 setVariable ["R3F_LOG_CF_credits", _credits + 1000, true];
ah I only saw the ones on the left lol
I should set it to 'one time only' even it if should be repeateble?
so the guy moves the vehicle back, comes again, +1000 credits?
how would I make it so while independence side is alive instead of
while {true} do {
If I knew how I would have it on a 30 min cooldown, plus a hint ''Buildnig supplies have been refilled''. But I wanted to start simple. The intention is to have resupply point in HQ.
so triggers are not what you want, but a way less abusable system
30min
hello me and a friend of mine are planing on making a mod that basically will attach medals to a character chest so i m asking does anyone know a command that help us
how would I make it so while independence side is alive instead of
while {true} do {
what you asked here you mean?
๐
just, reply to your own message as a ping to mention it is an existing request
while { units independent findIf { alive _x } > -1 } do
{
// ...
};
Also in your opinion is bisfncfire better or forceweaponfire
no opinion
Both same?
no idea
Thank you this worked! ๐
Now is it possible to make it while your unit is engaged in combat? or has contact on enemy
I was hoping the vehicle would be capped at 1000 credits, I can't test if it will overfill with credits (which would be an abuse in this type of mission) since I didn't get it to work. When you say triggers are not what I want...I honestly don't know...I'm trying to stick to the instructions provided by the original script (R3F Logistics) author which only state:
You can interact on the credits of a specific creation factory. It can make an interaction with your mission progress (e.g. when an objective is done, money is sent to the factory as a recompense).
The amount of credits is associated to a specific factory and is global to every players.
The following script to be executed on the server side (or only one client) adds 15 000 credits to the creation factory named "my_factory" :
no idea what you want to do
you would check if they are in combat mode with behaviour
yeah
on factory creation
not on trigger-entering vehicle
I understand, so one time only trigger in this situation. Thank you...could you suggest maybe a different angle on how to simulate supplies refill with some sort of limitations to prevent abuse? Something relatively simple
I chose R3F Logistics becouse of the manual with clear instructions that even someone with limited knowledge, like me, can set it up
what would be the logic behind "truck being brought"
just "truck is near building"?
or "truck comes and goes from a certain place to here"?
It's a warlords gamemode, so truck returns to HQ from the ''frontline'' to pick up more building supplies so players can further fortify their positions. Squad-like building system....
so there should already be an event of "truck bringing stuff" in the framework, no?
(I don't play Squad)
It should basicly work as a gas station. When a tank is full (1000 credits), the pump stops pumping. I'm not sure what you mean exactly. I think it only states ''truck contains stuff (credits)'' and there is an option to ''add more stuff''
Well, you gave me enough information that I can look into, and try to figure how to incorporate this into the mission.
If I have a trigger set up for any player present to kick it off, and its just a sound effect, that won't mean it overlaps right? Like if a squad of players enter the trigger zone in a line, it won't start the sound anew 8-12 times?
@winter rose Maybe i can make it repeatable if I add condition that states: execute script if there is less then x amount of credits... for example add 900 of there is less then 100
I think add 900 if there is less then 100 should do the trick. I assume that would not need a lot of writing.
if currentScore < 1000 set score to 1000
in pseudo code
private _credits = b_1000 getVariable "R3F_LOG_CF_credits"; will get the current credits of b_1000 so would that mean:
CONDITION:
if private_credits <1000 //but properly written ๐
ON ACTIVATION:
_thisList execVM "credits_refill.sqf";
CREDITS_REFILL.SQF:
params ["_vehicles"];
if (b_1000 in _vehicles) then {
private _credits = b_1000 getVariable "R3F_LOG_CF_credits";
_credits = 1000;
b_1000 setVariable ["R3F_LOG_CF_credits", _credits, true];
};```
condition this && credits < 1000
this will be "is the vehicle in the trigger"
issue: if the vehicle is already in the trigger and credits fall below 1000, it will refill to 1000
...so players could infinitely spend credits (and fortify) while the vehicle is inside trigger area? Is that what you mean by issue? I can place the refill station somewhere on map that has no significance so there would be no use in building there.
hello im still having a battle with this slack rope does anyone have any smort ideas https://cdn.discordapp.com/attachments/725093179455570021/1011620778921439334/bot_ba_buck.mp4
just need the rope to look taut -- its purely aesthetic so if anyone has a way of setting its length to like half a meter without it breaking that'd work
I didn't know there is a refill station where you refill the truck with "cash" that you then "deliver" to the trigger
thats using a custom rope which is short but also stretchy, same behaviour as regular rope in this instance. in other instances it only gets slack as you near the impact point
Hi
How Can i have the position (x,y,z) of the mini map (gps)?
For what purpose?
so I have no idea what you mean.
wherever it is, if there is the truck in the trigger, it will refill to 1000
period
To put beside a dialog
Ah, you mean the dialog itself's pos?
oh so you want the position on the players screen of the gps map?
Yes
No just the position of the minimap on the player screen
yeah thats what i said heh -- it wont have a z coordinate as its not a 3d space... i think
No problem
Ah sorry for my bad understanding ^^
class GroupIndicator: RscMapControl
{
x = "(profilenamespace getvariable ['IGUI_GRID_GPS_X', (safezoneX + safezoneW - 11 * ( ((safezoneW / safezoneH) min 1.2) / 40))])";
y = "(profilenamespace getvariable ['IGUI_GRID_GPS_Y', (safezoneY + safezoneH - 20.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])";
w = "(profilenamespace getvariable ['IGUI_GRID_GPS_W', (10 * ( ((safezoneW / safezoneH) min 1.2) / 40))])";
h = "(profilenamespace getvariable ['IGUI_GRID_GPS_H', (10 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])";
};```Perhaps ๐ฎ this is the hint
@winter rose I think you gave me enough to make it work. If I struggle, I'll get back to you...thanks once again!
Hey guys! How can I add a title to this so the sequence of things is
1.) Player interacts with 'addaction' item
2.) It fades to black for 3 seconds and teleports the player
3.) It puts a title up on screen against a black background I.e. "Destination - 12:00 HRS"
4.) It fades back in
Heres where im up to so far, just no idea how to accomplish the title bit! Thank you ๐
this addAction["Exit",{
[0,"BLACK",3,1] call BIS_fnc_fadeEffect;
player setPosASL (getPosASL boatint);
[1,"BLACK",10,1] call BIS_fnc_fadeEffect;
}];
don't forget to remove the action so it cannot be triggered multiple times too ๐
["Destination - 1200 hours", 0, 0.9, 4, 1, 0, 801] spawn BIS_fnc_dynamicText;
sleep 5;```
try putting that between your fadeEffects
Thanks @hallow mortar will give that a go! ๐
You can also have it automatically generate the actual time:
// Get hours and minutes, then add some leading zeroes to make it look good
private _hours = date select 3;
while {count _hours < 2} do {_hours = "0" + _hours};
private _minutes = date select 4;
while {count _minutes < 2} do {_minutes = "0" + _minutes};
// Format it using structured text
private _text = format ["Destination - %1%2 hours",_hours,_minutes];
// Display the result
[_text, 0, 0.9, 4, 1, 0, 801] spawn BIS_fnc_dynamicText;
sleep 5;```
๐ฎ Thats amazing! Thank you!
If I wanted to use the BIS_fnc_TypeText how would I format it between the fades? Seems to tell me im missing some [ or { here
this addAction["Exit",{
[0,"BLACK",3,1] call BIS_fnc_fadeEffect;
player setPosASL (getPosASL boatint);
["Onboard "Gyeonchae" Fishing Vessel", "<t valign='bottom' shadow = '1' color = '#99ffffff' size = '1' font='PuristaSemibold'>%1</t><br/>"],
["2KM From Cheongjin Hang Port", "<t valign='bottom' shadow = '1' color = '#99ffffff' sizeOf = '0.7'>%1</t><br/>"],
["23 August 2022, Early Morning", "<t valign='bottom' shadow = '1' color = '#99ffffff' size = '0.7'>%1</t>", 15]
spawn BIS_fnc_typeText;
sleep 5;
[1,"BLACK",3,1] call BIS_fnc_fadeEffect;
}];
Oh I think the issue may be the " around Gyeonchae
You've got two troubles. First, your parameters for typeText (the parts before the spawn) need to be all inside one array - an extra [ at the start and ] at the end.
And the second is indeed the ". Use ""Gyeonchae"" to escape the quotes and make them work properly.
Amazing, thank you very much! I finally feel im starting to get the basics of SQF and it seems well need to learn something entirely new for the next engine ๐
bingo ๐ syntaxhighlight helps here
you can use Visual Studio Code as code editor, with the SQF plugin
Ooh nice, ill give it a download!
Been using Notepad++ which has been good to me so far, but always willing to try new software!
you don't check extensions this way
yeah im trying to work around the .DLL being held up by arma problem
has anyone managed to successfully use setunitfreefallheight within a script in stable branch thus far
state your issue instead?
unsure if im doing it right or not but this setUnitFreefallHeight 10000 isnt working in debug console
this doesn't exist
...that'd be why ๐คฆ
โฆyeah ๐
serves me right for trying to script after writing job applications with no coffee
I'd use ink but to each their own
noice!
it's the virtual path to it, either the way the addon is packed in the pbo, or pbo prefix if you have one
hey I dunno which dev added this namespace (i assume dedmen) but I just wanted to say thank you this ROCKS https://community.bistudio.com/wiki/missionProfileNamespace
How can I make a custom respawn system? I want players to become a spectator when they die until they are respawned via Checkpoint or special action by a fire team leader. Do I have to use the BI respawn system with INSTANT respawn type for this or is there a way to respawn players with script commands?
KK
thank you killzone kid! lots of good little things in this update
hoping to move to reforger soon but thats not gonna be for a while
omg 2.10 is here, excited noises
Can someone on the wiki expand on setTerrainHeight and what exactly the positionAndAltitudeArray points are supposed to be? It isn't clear to me why you need so many points in the first example to just create flat terrain.
The terrain heightmap is like a greyscale image, many pixels