#arma3_scripting

1 messages ยท Page 13 of 1

winter rose
#

also

coarse dragon
#

For assignAsCargo to work

#

So half of a squad stops jumping out before take off

copper raven
#

keep in mind that squad init runs everywhere, so check for locality

winter rose
#
{ _x assignAsCargo _theVehicle } forEach units _theGroup;
```@coarse dragon
coarse dragon
#

Oh I see

#

Didn't work

open fractal
#

there are few circumstances that require setting variable names for everything

coarse dragon
#

Still junp out

open fractal
#

you didn't just write _theGroup did you

coarse dragon
#

I'm not even sure where to put the code

#

Vehicle init.
Squads init.
Units init. ๐Ÿคทโ€โ™‚๏ธ

copper raven
#

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?

winter rose
#

WHAT - DID - YOU - WRITE

coarse dragon
winter rose
#

if you copy-pasted my code 1:1 amma commit sudoku

fickle hedge
#

How can i disable the scoreboard?

little raptor
fickle hedge
little raptor
#

yes

fickle hedge
#

thnx

coarse dragon
#
{ _x assignAsCargo helo } forEach units sq1;

soo i got it working xD

winter rose
#

w00t!

coarse dragon
#

_ them fecking things

#

thanks

drifting sky
#

Is there any way that works to get AI infantry to fire a grenade from their launcher at a specific location or target?

fickle hedge
winter rose
little raptor
copper raven
winter rose
#

yep, my assumption ๐Ÿ–๏ธ

fickle hedge
#

I tried in init

#

and initplayerlocal

fickle hedge
little raptor
#

try in debug console too

#

maybe a mod is overriding it thonk

#

if it still doesn't work you can just override the key

fickle hedge
#

Works in debug...

#

But not initplayerlocal?

copper raven
#

init script is too early then

little raptor
#

then add some sleep

fickle hedge
#

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

drifting sky
#

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?

hallow mortar
#

selectWeapon to select the GL, then doFire to use it

distant belfry
#

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?

winter rose
distant belfry
#

SICK

#

That would help a lot for the moon war op

#

I can just set it much higher

winter rose
#

I bet yeah!

copper raven
distant belfry
copper raven
#

yes, where i put the ellipsis

#

you can combine this into a single if statement

distant belfry
#

Sorry I might be dumb but what would look like this?
isNull objectParent unit && {if ((alt > 120) || (alt < 10)) then { unit setDamage 1;}; alt >}

copper raven
#

no

#

just add what i sent before your condition, and inside the {} put your condition

distant belfry
#
isNull objectParent unit && {... alt >}
if ((alt > 120) || (alt < 10)) then { unit setDamage 1;};``` and then condition where the ellipsis are? What are conditions?
copper raven
#

(alt > 120) || (alt < 10) ?

distant belfry
#

do you mean the height value like a numeral?

#

Oh cool okay

copper raven
#

... alt > this is just a placeholder

distant belfry
#

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

distant belfry
#

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

copper raven
#

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

distant belfry
#

amazing

#

Thanks again, that's very handy

drifting sky
winter rose
#
  • doTarget or something
drifting sky
#

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

hallow mortar
#

Did you doTarget and then doFire in the same go?

drifting sky
#

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

distant belfry
# copper raven the `{ }` in a logical expression (`&&`, `||`) short circuits, so in your case `...

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;}; }];

granite sky
#

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.

sharp grotto
#
  • this aint gonna work out
granite sky
#

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.

sharp grotto
#
if(isNull objectParent unit && { (alt > 120) || (alt < 10) }) then {systemchat "do something"};
distant belfry
#

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;};?

drifting sky
copper raven
#

if you try to selectWeapon the launcher, it immediatly switches back to rifle next frame

drifting sky
#

This is such an elementary thing, there must be somebody who knows how to do it.

copper raven
#

just create an empty tank and hide it ๐Ÿคฃ

#

or simulate the missile yourself

drifting sky
#

what?

copper raven
#

create the ammo from AI's position, and maneuver it yourself with scripting

drifting sky
#

don't know how to calculate a firing solution

#

taking into account drag

copper raven
#

what launcher are you trying?

drifting sky
#

m203

copper raven
#

to be fair, a doTarget with fire isn't that terrible

#

for the "launch_NLAW_F" atleast

drifting sky
#

dotarget with fire does not cause them to shoot a nade at a target

#

the nade just goes off in some random direction

granite sky
#

You could use doFire and take all their other weapons away.

#

it's dumb as hell, yes

drifting sky
#

I can get them to fire a grenade. Just not while aiming it at an invisible target or a position.

copper raven
#

does doTarget not make them aim?

drifting sky
#

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????

copper raven
drifting sky
#

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.

copper raven
#

but yeah that's the issue, they properly adjust their aim based on their current weapon

drifting sky
#

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.

copper raven
#

try

onEachFrame { unit selectWeapon "launcher"; }

and then use doTarget + fire worth a try

drifting sky
#
THE_SHOOTER doTarget invis_target;
THE_SHOOTER fire "m203";
```  Doesn't work.  Unit just continues to fire his rifle.
copper raven
#

do copyToClipboard str getArray (configFile >> "CfgWeapons" >> "M203" >> "muzzles")

drifting sky
#

["this","M203"]

#

from copyToClipboard str getArray (configFile >> "CfgWeapons" >> (primaryweapon THE_SHOOTER) >> "muzzles");

copper raven
#

if you run player selectWeapon "M203" does it select it?

drifting sky
#

yes

south swan
copper raven
#

if they don't switch back, then i don't think removing mags will help

drifting sky
#
    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.
copper raven
drifting sky
#

are you shooting at an invisible target?

copper raven
#

a bench ๐Ÿ˜„

drifting sky
#
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.
copper raven
#

reveal it

drifting sky
#

He's shooting at it already so it must be revealed

#

are you able to get them to target a position?

copper raven
#

make them hold fire

#

with _unit setUnitCombatMode "BLUE";

copper raven
#

otherwise they just fire their main gun

drifting sky
#

This is so frustrating. So maybe I can get this to work with some kind of invisible target that is unaligned to any faction.

copper raven
#

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

drifting sky
#

is there some kind of really basic object I can create mid game and make invisible?

#

just to serve as something to aim at

copper raven
#

do you use independant side?

winter rose
#

O_TargetSoldier = OPFOR invisible target soldier

copper raven
#

there is an independant CBA invisible target, so you just make that friendly

drifting sky
#

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?

copper raven
#

yeah if you disable their features

winter rose
#

set it renegade

#

zeObj addRating -100000;

#

everybody and their mother will hate it

copper raven
drifting sky
#

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

copper raven
#

independant target, and make it friendly to both sides then ๐Ÿ˜„

drifting sky
#

let me check if that works

winter rose
#

setCaptive?

#

just like a soldier really

drifting sky
#

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

copper raven
drifting sky
#

I was using dofire

copper raven
#
_unit selectWeapon "M203";
_unit reveal _target;
_unit doTarget _target;
_unit spawn {
  sleep 2;
  _this fire "M203";
}
drifting sky
#

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.

copper raven
#

does what i sent not work?

drifting sky
#

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.

south swan
#

vanilla tracers module goes around this by disabling the animation and rotating the soldier through code ๐Ÿคฃ

drifting sky
#

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?

granite sky
#

Maybe it's too small and they can't see it? :P

#

could check knowsAbout

drifting sky
#

it's like he can't see it he's not even pointing at it anymore

winter rose
#

try to reveal
it might also have to do with the AI aiming time too

drifting sky
#

I'm using reveal as well so he should know as much about it as possible

granite sky
#

reveal 4?

drifting sky
#

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.

winter rose
lofty oriole
lofty oriole
winter rose
#

either yes

#

or no

#

50/50

drifting sky
#

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???!!

hallow mortar
#

What happens if you reveal the target to the shooter first?

drifting sky
#

I've been doing that for a while now.

hallow mortar
#

oh right. I didn't scroll up

drifting sky
#

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

hallow mortar
#

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)

drifting sky
#

I've given up working on this for the moment. It's been hours just spinning in circles, trying to do something extremely basic.

granite sky
#

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.

lofty oriole
granite sky
#

I don't know if you can detect bullets hitting the ground, but you can certainly make more particles.

winter rose
granite sky
#

yeah particles are really not my thing :P

lofty oriole
hallow mortar
#

The reply function pings the person you reply to unless you turn the switch off

winter rose
granite sky
#

Replies ping people unless you click the button on the right. Discord sucks.

lofty oriole
#

Oh I didnt know replying works like that my bad

winter rose
#

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

drifting sky
hallow mortar
#

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

fierce vector
#

Hey, does anyone know how to have a Spartans shields turn on at mission start? Operation Trebuchet

distant belfry
#
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?
copper raven
distant belfry
distant belfry
#

triggers that denote area

#

so like variable names

copper raven
#

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

distant belfry
#

Thanks for your help, we ended up trying something different and using triggers for 'airlock' doors which circumnavigated the issue entirely

open fractal
#

don't they have a discord?

fierce vector
#

No idea

distant belfry
fierce vector
#

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

stable dune
#

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 ๐Ÿ˜

winter rose
#

getRelPos? @stable dune

little raptor
#

modelToWorld(World) is more correct

drifting portal
#

if compared to modeltoWorld

little raptor
#

? I meant compared to getRelPos

#

Both work over water

#

But modelToWorldWorld is generally better because it returns the pos in absolute format

drifting portal
little raptor
#

It is

drifting portal
#

oh so over water ASL is better

little raptor
#

...

#

It depends what you want to use it with

drifting portal
#

also its better to use ModelToWorld here right?

little raptor
#

No

#

Yes

#

I thought you said worldWorld ...

drifting portal
#

no I'm just comparing the two sorry for the confusion
comparing modelToWorld with modelToWorldWorld

little raptor
#

If you need to work with vectors and offsets MtWW is better, because it's absolute

drifting portal
#

but let say we want to view the memory points on water (player on a boat)
ASLtoAGL is affected by waves still?

little raptor
#

Yes

#

AGL is AGL

#

Doesn't matter how you calculate it

drifting portal
#

oh alright, thanks a lot

stable dune
# winter rose getRelPos? <@790272937994879047>

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

little raptor
#

What is _pos?

winter rose
#

baby don't hurt me

stable dune
warm hedge
#

He meant which command you use to fetch _pos?

stable dune
pulsar bluff
#

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

little raptor
little raptor
winter rose
little raptor
#

Is it not? thonk

winter rose
stable dune
little raptor
little raptor
#

createSimpleObject takes ASL

#

You're providing AGL

stable dune
#

๐Ÿ˜ฒ Times when I feel stupid

little raptor
#

No need to feel stupid. Just read the wiki carefully meowsweats

stable dune
#

True

stable dune
proven charm
#

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)

coarse dragon
#

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 ๐Ÿค”

winter rose
#

also, what happens if he gets out by himself? ๐Ÿ™ƒ

coarse dragon
#

It's the AI xD

winter rose
#

IDK if they do
(also, AI mods, etc)

coarse dragon
#

I've never seem em exit em

winter rose
#

go with my pseudocode then

coarse dragon
#

But would be nice for the AI to killed the gunner and not spend 10 minutes trying to destroy the static

stable dune
little raptor
#

mods?

winter rose
#

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

coarse dragon
#

I use lambs danger. But according to them. Its vanilla behavior

winter rose
#

beer nonetheless

winter rose
stable dune
coarse dragon
winter rose
#

and most importantly, YOU DID NOT MENTION YOU USE MODS

coarse dragon
#

Who tf doesn't use mods ๐Ÿ™ƒ

winter rose
#

I don't

#

and especially if I am looking to debug an issue, I don't

coarse dragon
#

Lambs is the only mod that effects AI and they say they didn't mess with that. That it's default behaviour

winter rose
#

IDC ๐Ÿ˜ƒ you didn't check, and you didn't mention it
beer

little raptor
#

@warm coral

_x addForce [aimPos _this vectorFromTo aimPos _x vectorMultiply 200, _x worldToModel ASLtoAGL aimPos _x];
_x setDamage 1;
warm coral
#

will add it to it once im on pc again

#

thank you very much for all thw script help btw

little raptor
#

Actually I wrote it wrong

#

I swapped force and position

#

Fixed

stable dune
stable dune
#
_obj setVectorUp surfaceNormal position _obj;
#

But can i get that done in eachFrameEh ?

winter rose
#

do ye have a license for that mate?

#

PS: getPosWorld - ditch position for good

umbral oyster
#

Is it possible to make setVelocity work with a non-local object?

open hollow
umbral oyster
winter rose
#

remoteExec?

umbral oyster
#

remoteExec ["setVelocity",object] ?

winter rose
drowsy geyser
#

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;
copper raven
drowsy geyser
#

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?

copper raven
#

instead of selectRandom

drowsy geyser
# copper raven use `_randomObjPos deleteAt floor random count _randomObjPos`

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;
true frigate
#

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]
}];```
true frigate
#

So would the params just beparams ["_unit", "_role", "_vehicle", "_turret"]; and I assume the EH finds these?

wind hedge
copper raven
#

they're passed into the event handler itself via _this, all params does is just "parse" them

true frigate
#

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

copper raven
#

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

true frigate
#

It's all in initPlayerLocal.sqf, is that still counted as a new script?

copper raven
#

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

true frigate
#

Ohh I understand

#

Sorry ๐Ÿ˜…

wind hedge
# true frigate Sorry ๐Ÿ˜…

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.

true frigate
#

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?

wind hedge
true frigate
#

Awesome, thank you! ๐Ÿ™‚

copper raven
#

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
};
manic sigil
#

Is there some means of scripting in a vehicle 'respawn on position' like the Zeus module, or would a killed EH function be better?

copper raven
#

but internally they use the killed EH, so it's the same thing basically

manic sigil
#

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

drifting sky
#

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.

winter rose
drifting sky
#

After an hours long game, they seem to get stuck and just keep compounding

little raptor
#

really? thonk

#

then it's a bug and should be reported

drifting sky
#

I'm not going to bother with that. Just need to figure out how to disable them.

little raptor
#

also are you sure it's related to long-running missions, or save-load?

drifting sky
#

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?

little raptor
#

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? thonk
I don't remember

drifting sky
#

How bout this one? Is it possible to disable the little particle puff originating from men's feen when they're walking?

winter rose
#

setHumidity ๐Ÿ˜„

drifting sky
#

No just pointless visual clutter I'd like to get rid of. Plus they look bad.

winter rose
drifting sky
#

well, crosses fingers then.

little raptor
drifting sky
#

If humidity is changing according to weather, does that mean sethumidity has a temporary effect?

little raptor
winter rose
#

yes

winter rose
little raptor
#

oh nvm I'm blind...

little raptor
glossy pine
drifting sky
#

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?

little raptor
glossy pine
#

cant

little raptor
#

why not?

glossy pine
#

idk

#

xD

winter rose
#

e_e

little raptor
drifting sky
#

Only Target or AutoTarget

glossy pine
# glossy pine idk

ye idk when i try to delete them it doesnt dissapear, but if i hide it, it does so..

drifting sky
#

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.

glossy pine
#

arma things i guess

copper raven
#

also #track is not the only type, there is also #mark

drifting sky
#

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.

winter rose
#

yep, it should be like that

humble gale
#

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

little raptor
#

just use the PathCalculated EH

winter rose
little raptor
#

When i use "calculatePath ["helicopter", "aware", [0, 0, 100], [1000, 1000, 100]]", "PathCalculated" event never fires

#

PathCalculated always fires if a path is calculated

copper raven
winter rose
little raptor
#

it's wrong

#

I'll fix it

winter rose
#

yay

humble gale
#

I tried using isNil, still nothing

little raptor
#

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

winter rose
#

purrfect ๐Ÿ‘Œ thanks!

humble gale
#

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?

sharp grotto
#

I hope you get paid enough Lou. It's crazy how much you help here meowheart

little raptor
#

do you give the command to normal AI? or agents?

#

I just tested helis and everything works fine

humble gale
#

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

copper raven
little raptor
#

normal AI

#
  • EH
winter rose
copper raven
#

that's probably why calculatePath doesn't work either for helicopters, as it's hidden

drifting sky
#

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.

little raptor
#

EntityCreated

#

tho only when a new weapon holder is created

#

you can also use the Put EH

winter rose
drifting sky
#

put doesn't work for CUP disposable launchers

#

just tried it

#

Does EntityCreated exist yet?

drifting sky
#

So there's no event handler that can catch these disposable launchers

winter rose
#

maybe a CUP scripted EH

drifting sky
#

have any idea where to find that?

winter rose
#

CUP doc

drifting sky
#

They don't seem to have any section on EH or scripts.

#

textures and classnames are the only two sections of their wiki

strange elk
#

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

winter rose
#

you could get all weapons from config then forEach add them, but there is nothing "out of the box" for that I'm afraid

strange elk
#

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?

winter rose
#

the config getting would do that, not the forEach

strange elk
#

Mind providing me an example?

#

Sorry if it's alotta work

winter rose
#

it kinda is

strange elk
#

Oof

#

So how would I grab all weaponturtets from the config

#

I could figure out the loop myself.

winter rose
copper raven
#

es

#

yes i saw nothing, don't worry

granite sky
#

You attach it to any unit that might drop an item.

copper raven
#

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

granite sky
#

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.

fast pewter
#

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

chilly bronze
#

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

copper raven
chilly bronze
#

@copper raven but if you set the group behaviour to be SAFE, they immediately default to column and do not use other formations

copper raven
#

tried setting formation after behaviour?

chilly bronze
#

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

copper raven
#
g setFormation "ECH LEFT";
g setBehaviourStrong "SAFE"; 

works fine for me

chilly bronze
#

just tried it, same result walking in column, did you set up the group any specific way?

copper raven
#

maybe you have a mod that messes with their formation blobdoggoshruggoogly

copper raven
chilly bronze
copper raven
#

no

granite sky
#

Is this on roads or in the open?

chilly bronze
warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
warm hedge
#

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?

open fractal
#

I've sent you this link before

#

consider bookmarking

#
{
  //your code here, use _x as described on the wiki
} forEach units blufor;
lofty oriole
open fractal
#

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

warm hedge
#

Why did you removed a lot of your posts here

lofty oriole
warm hedge
#

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

lofty oriole
warm hedge
#

while {true} do {} will never ends

lofty oriole
#

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

warm hedge
#
{
    _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
lofty oriole
#

Its working better than the other one

lofty oriole
warm hedge
#

"The other one"?

warm coral
tough abyss
#

will nearentities get map objects trees rocks etc?

lofty oriole
#

any way to disable tracers from ai?

winter rose
#

bullet tracers? replace their magazines

proven charm
#

do the extensions have full access to your computer? or is it limited?

winter rose
#

limited to your Windows user's permissions

proven charm
winter rose
#

I would say so (unless you run it as admin)

proven charm
#

arma should run normally, without admin rights

winter rose
#

depends

proven charm
#

on what?

winter rose
#

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"

proven charm
#

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 ๐Ÿ˜„

winter rose
#

C:\Users\youProfile is open bar
I wouldn't trust Leo btw

#

imagine, a big cat writing code, brrrr

proven charm
#

hehe

#

just not go to same cage with him

tough abyss
#

how can i get them?

little raptor
#

nearestObjects or nearestTerrainObjects

scenic shard
#

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?

lofty oriole
#

any way to disable friendly fire in ai and make them stop spinning without disabling move?

winter rose
#

โ€ฆwhat

lofty oriole
#

is disabling friendly fire for ai confusing for you?

winter rose
#

yes
and the stop spinning too

lofty oriole
#

Well is it not possible to disable friendly fire I dont want my ai killing my own ai

winter rose
proven charm
#

I guess drawLine only works on map?

south swan
#

depending on use case drawLine3D can help ๐Ÿคทโ€โ™‚๏ธ

south swan
#

screenToWorld ๐Ÿคทโ€โ™‚๏ธ

proven charm
#

i was thinking maybe it's possible to somehow fake the Map ctrl?

winter rose
#

2D lines on GUI = CT_STATIC + ST_LINE

south swan
#

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;
proven charm
#

will see what works..

proven charm
#

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?

proven charm
#

it's going to be a lot of line ctrls

copper raven
proven charm
#

can you change RscLine width? been going through the config values but no dice

little raptor
#

this should be unpinned no?

little raptor
#

you have to make an RscPicture or something

winter rose
proven charm
little raptor
#

it's only slightly more work blobdoggoshruggoogly

#

you just make a picture then rotate it

proven charm
#

but I want lines connected to each other. not sure how to rotate for that...

little raptor
#

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

proven charm
#

well i can try

little raptor
#

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

hallow mortar
#

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

proven charm
little raptor
#
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;

meowsweats

proven charm
#

I'll give it a try, thx

#

cant get anything to render with that , probably because the coords used for linedraw ctrl are different....

little raptor
#

well:

  1. did you define GUI_GRID_W and GUI_GRID_H?
  2. did you add a texture to the RscPicture?
proven charm
#

yes

#

For some reason I get nothing rendering, hmmm...

little raptor
#

the x0 and y0 are wrong

#

but for some reason I can't get it to rotate meowsweats

#
#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;
proven charm
#

I meant cant get anything at all working

little raptor
#

I know

#

like I said _x0 and _y0 were wrong (both divided by GUI_GRID)

#

I moved them to the top

#

oh meowsweats

Procedural textures filled controls do not rotate

proven charm
#

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;

#

?

little raptor
#

too off screen?

proven charm
#

nope...

little raptor
#

are you sure?

proven charm
#

well i tried many coords

little raptor
#

well default RscPicture has no texture

#

at least give it something to be visible...

proven charm
#

that must be it

#

yep that was it ๐Ÿ˜„

little raptor
#

well yeah it gets skewed...I wasn't wrong

proven charm
#

well it renders now the "boxes" but not quite there

#

this is why i thought it would be difficult ๐Ÿ™‚

little raptor
#

it wouldn't be difficult if things worked in Arma as expected...

proven charm
#

lol true

proven charm
little raptor
#

if you're using procedural textures it's known that it doesn't rotate

proven charm
#

im not using any textures just colors

little raptor
#

then what do you use?

#

I mean what kinda colors?

proven charm
#

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)";
};```

little raptor
#

that's a procedural texture...

proven charm
#

so it renders those red bars

#

oh ok

#

hows non-procedular then?

little raptor
#

anyway ctrlSetAngle doesn't work the way I thought it does

#

so let it go. just use RscLine...

proven charm
#

ok

#

is non-procedular like .paa file for example?

little raptor
#

yes

#

also it's procedural

proven charm
#

ok thx ๐Ÿ™‚

still forum
#

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

tender fossil
still forum
#

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

tender fossil
#

Yeah, if there's some part running where the supposed transpiler isn't being used, it's, well... RIP my concept ๐Ÿ˜„

still forum
#

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

still forum
copper raven
# still forum Went through that idea with the SQF Bytecode optimizer. Cannot optimize what I'm...

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

tough abyss
still forum
#

"combined with the ability to actually edit the variables directly" well that ability doesn't exist, thats why

tough abyss
#

Yes which is why I ended my comment with how it makes sense given the design goals of the language

still forum
copper raven
#

well if you cache preinit variables/cfgFunctions and what not (the ones that are compileFinal), it's not that terrible actually, but yeah

still forum
#

in SQF bytecode you don't know what mods may be loaded, any mod may change CfgFunctions or preInit's

copper raven
#

true that

graceful kelp
#

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

polar belfry
#

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

granite sky
#

Yeah, that triggers on all vehicles.

polar belfry
#

the bus variable is "ik"

granite sky
#

You'd want objectParent player == ik then.

polar belfry
#

isNull objectParent player == ik?

#

ok I'll test

granite sky
#

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.

polar belfry
#

I put a !() around it

granite sky
#

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

polar belfry
#

ok

#

testing it now

#

and when I want them to change I'll just write the same but with !=

#

?

stable dune
#

Or close with !()
like

!(objectParent player == ok)
granite sky
#

!= is fine.

polar belfry
#

ok

granite sky
#

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

polar belfry
#

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

granite sky
#

well, that's an EH, right

stable dune
polar belfry
#

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

wind hedge
#

how can I use "getPosWorld player" but get the position 5 meters above that player?

open fractal
#
_pos = getPosWorld player;
_pos = _pos vectorAdd [0,0,5];
#

@wind hedge

graceful kelp
#

what percent engine damage kills the engine

boreal parcel
#

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?

tropic mirage
boreal parcel
#

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

copper raven
graceful kelp
#

its .8 i trialed and errored it,

#

its a bit weird to be .8 instead of 1

#

but it is

pliant sphinx
#

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.

ocean folio
#

saw this in the config chat and came here to answer lol. This is the way^

warm hedge
#

Also saved3DENInventory doesn't exist

ocean folio
#

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

pliant sphinx
#

circa Line 1 Expected ]={

#

thats the error

copper raven
#

sqfbin the code

warm hedge
#

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

pliant sphinx
#

nah im not

warm hedge
#

Then

sqfbin the code

pliant sphinx
#

idk what that means

warm hedge
#

!sqfbin

pliant sphinx
#

with what

warm hedge
#

Oh I thought it was the command... Just Google it

copper raven
ocean folio
#

its also at the bottom of one of Lou's pinned messages

#

not that anyone checks pinned messages notlikemeowcry

pliant sphinx
#

it used to be differnet but is this what u mean

#

im only really good at configs idk anything about scripting

copper raven
#

circa Line 1 Expected ]={
you pasted completely unrelated code

pliant sphinx
#

i will try this

warm hedge
#

Still unrelated to the error

#

In the first place, how/when the error happens? How did you run the code?

pliant sphinx
#

this is what happens

copper raven
#

yes because what you're doing makes no sense, _this is an empty array

ocean folio
#

what is _this in this instance?

copper raven
#

i guess Leo passes an empty array, but yeah

ocean folio
#

_this only works in specific scopes

#

what is the product you are hoping to see?

pliant sphinx
#

or a hint

#

if thats what u mean

warm hedge
#

We've been discussed what he tries all over yesterday in #arma3_config

ocean folio
#

I already read your shpeel, it doesnt actually say what you want to see happen

pliant sphinx
#

i want the units loadout to be randomised based on whats provided in the class config

ocean folio
#

when?

warm hedge
#

Basically when the unit's loadout has not been changed in Eden, will randomize their gear

pliant sphinx
#

yeah

warm hedge
#

And I suggested the code. And IIRC, you didn't said you have a clue or not how to use it

ocean folio
#

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

pliant sphinx
#

i basically wanna copy bisheadgear function but for the other items of gear

warm hedge
#

S&S

ocean folio
#

still no idea

ocean folio
#

ah

#

that would explain it, I've only ever actually seen that once

pliant sphinx
#

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

ocean folio
#

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

pliant sphinx
#

polpox do u think u could write a script for it? you can be added as an author

lofty oriole
#

how do I make my ai unit to face a certain direction and not move?

warm hedge
copper raven
pliant sphinx
lofty oriole
# pliant sphinx disable pathing

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

warm hedge
#

Literally. The config, you'll need it. In case you don't know what config is, what you write in config.cpp

lofty oriole
pliant sphinx
polar belfry
#

I have a question

warm hedge
#

Config for what you want to make

pliant sphinx
#

do u mean classnames etc? or the config that adds the units

oblique arrow
#

me or dedmen

ocean folio
#

you have said both so far

warm hedge
polar belfry
#

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;

pliant sphinx
#

whats ur question

polar belfry
#

I have a bus part of a convoy

#

and thought about making the driver captive so the ai doesn' launch an rpg at him

lofty oriole
polar belfry
#

will it affect only the people in the bus

#

or the entire playerbase

ocean folio
#

player only refers to the local player

polar belfry
#

oh so the rest of the convoy will be fine

copper raven
#

yes

polar belfry
#

thanks very much

ocean folio
#

oh, well...

#

this is a situation where I'd attach the trigger to the vehicle, and reference the driver of the vehicle

polar belfry
#

oh when?

copper raven
#

but your trigger condition is what exactly?

polar belfry
#

objectParent player == ik;

#

ik is the ikarus bus I armored with props

pliant sphinx
#

@warm hedge yo

#

what do u want

#

what part of the config

ocean folio
copper raven
#

like i said use doStop with setFormDir

lofty oriole
coarse sedge
#

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

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
past wagon
#

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
    }];
winter rose
warm hedge
#

Is it possible to get a turret's memory axis?
The goal is to estimate center of a turret

past wagon
#

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

coarse sedge
#

Thank you, trying it right now...

winter rose
#
if (b_1000 in _vehicles) then { /* */ };
```no?
past wagon
#

actually yeah

#

mb

winter rose
#

also, hoping it triggers only once

past wagon
winter rose
#

and if it triggers only once, directly sync the trigger to the vehicle and write the code in the trigger directly

coarse sedge
#

it is repeatable Mr. Lou

south swan
past wagon
#

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...

pseudo ridge
#

Can i delete a decal like for example the #Crater decal? I tried deleteVehicle but this not work.

south swan
past wagon
#

ok sounds good

#

thanks

#

but are you sure I can use a control as a varspace?

winter rose
south swan
#

works as of 3 minutes ago. I went and checked after seeing that in the doc :3

south swan
winter rose
south swan
#

not like collision-less decal would break anything there

pseudo ridge
#

@winter rose @south swan thanks ๐Ÿ‘

coarse sedge
#

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?

coarse sedge
#

Yeah, I know...

winter rose
#

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];

past wagon
coarse sedge
winter rose
#

so the guy moves the vehicle back, comes again, +1000 credits?

lofty oriole
#

how would I make it so while independence side is alive instead of
while {true} do {

coarse sedge
#

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.

winter rose
coarse sedge
#

30min

tepid talon
#

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

lofty oriole
#

how would I make it so while independence side is alive instead of
while {true} do {

winter rose
lofty oriole
#

๐Ÿ‘

winter rose
#

just, reply to your own message as a ping to mention it is an existing request

#
while { units independent findIf { alive _x } > -1 } do
{
 // ...
};
lofty oriole
#

Also in your opinion is bisfncfire better or forceweaponfire

winter rose
#

no opinion

lofty oriole
#

Both same?

winter rose
#

no idea

lofty oriole
coarse sedge
# winter rose so triggers are not what you want, but a way less abusable system

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" :

winter rose
winter rose
coarse sedge
#

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

winter rose
#

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"?

coarse sedge
#

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....

winter rose
#

so there should already be an event of "truck bringing stuff" in the framework, no?

#

(I don't play Squad)

coarse sedge
#

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.

elder karma
#

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?

coarse sedge
#

@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

winter rose
#

๐Ÿฎ perhaps

#

only you know what you want ๐Ÿ™‚

coarse sedge
#

I think add 900 if there is less then 100 should do the trick. I assume that would not need a lot of writing.

winter rose
#

if currentScore < 1000 set score to 1000
in pseudo code

coarse sedge
#

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];
};```
winter rose
#

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

coarse sedge
#

...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.

sullen sigil
#

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

winter rose
sullen sigil
#

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

coarse sedge
#

i meant the refill station is the trigger

#

my bad

novel basin
#

Hi
How Can i have the position (x,y,z) of the mini map (gps)?

sullen sigil
#

what

#

do you want the players position

novel basin
#

No the position of the mini map

#

(sorry for my bad english, i'm French ๐Ÿ˜… )

warm hedge
#

For what purpose?

winter rose
novel basin
warm hedge
#

Ah, you mean the dialog itself's pos?

sullen sigil
#

oh so you want the position on the players screen of the gps map?

novel basin
novel basin
warm hedge
#

Hmm should be possible

#

But I can't think up how right now ๐Ÿ˜›

sullen sigil
novel basin
novel basin
warm hedge
#
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
novel basin
#

Oh thanks !

#

I will try it

coarse sedge
#

@winter rose I think you gave me enough to make it work. If I struggle, I'll get back to you...thanks once again!

gloomy aspen
#

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; 
      
}];
winter rose
#

don't forget to remove the action so it cannot be triggered multiple times too ๐Ÿ™‚

hallow mortar
#
["Destination - 1200 hours", 0, 0.9, 4, 1, 0, 801] spawn BIS_fnc_dynamicText;
sleep 5;```
try putting that between your fadeEffects
gloomy aspen
#

Thanks @hallow mortar will give that a go! ๐Ÿ™‚

hallow mortar
# gloomy aspen Thanks <@137672072821211136> 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;```
gloomy aspen
#

๐Ÿ˜ฎ 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

hallow mortar
#

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.

gloomy aspen
#

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 ๐Ÿ˜‚

winter rose
gloomy aspen
#

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!

winter rose
#

there is some SQF support for N++, but I can only recommend VSCode

proven charm
#

can you somehow get the path to a DLL inside a mod?

#

for fileExists check

winter rose
#

you don't check extensions this way

proven charm
sullen sigil
#

has anyone managed to successfully use setunitfreefallheight within a script in stable branch thus far

sullen sigil
#

unsure if im doing it right or not but this setUnitFreefallHeight 10000 isnt working in debug console

winter rose
#

this doesn't exist

sullen sigil
#

...that'd be why ๐Ÿคฆ

winter rose
#

โ€ฆyeah ๐Ÿ˜„

sullen sigil
#

serves me right for trying to script after writing job applications with no coffee

winter rose
#

I'd use ink but to each their own

sullen sigil
#

i stg ๐Ÿ˜‚

#

yeah player is working fine

#

brug moment

winter rose
#

noice!

copper raven
brazen lagoon
delicate lotus
#

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?

brazen lagoon
#

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

opal zephyr
#

omg 2.10 is here, excited noises

pastel pier
#

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.

still forum
#

The terrain heightmap is like a greyscale image, many pixels