#arma3_scripting

1 messages Β· Page 198 of 1

nova mortar
#

open source eden when

#

that wouldnt help tbh lol

fair drum
#

you can change the values of the engine power and stuff if you want uphill travel better

nova mortar
#

I want a manual transmission

#

like everyone in my server

#

*friends server

fair drum
#

its all about finding workarounds

nova mortar
#

Well I'd have to make it adjust for downshifting somehow

fair drum
#

if full manual was possible, the ACE team would have already figured it out

hallow mortar
#

Unfortunately I don't think that idea would help with intentionally selecting a lower gear to climb hills. You'd limit the speed but the auto transmission would still be there, trying to shift up.

#

Good news though, Reforger and by extension Arma 4 have manual transmissions

nova mortar
#

i dont have reforger sadly

#

arma 4 exists?

hallow mortar
#

It will in 2027

nova mortar
#

oh alright

hallow mortar
#

Reforger is a direct testbed and development preview for Arma 4, so we can safely assume that engine features from Reforger will also exist in Arma 4

nova mortar
#

Will it be even more moddable than Arma 3?

cosmic lichen
#

Likely

nova mortar
#

k nice

hallow mortar
#

The modding access in Reforger is already far more extensive than A3. The new engine is built in a way that makes it much easier for basically everything to be changed.

nova mortar
#

Nice

#

well imma scrap my mod and wait unitl 2027 then

hallow mortar
#

It is interesting to note that there are parameters in the gearbox config that imply the existence of a manual mode in the simulation, it's just not accessible.
I feel like the devs have discussed this before though, and if we were going to get a way to switch to manual, it would've happened by now.

still forum
#

They are taken down because there was too much spam incoming, and the last moderator who was taking care of the spam stopped doing so.
Moderators have been asking for measures against the overwhelming spam for years, but nothing has ever been done about it.
Now that volunteer moderators don't waste their time with it anymore, it was decided that displaying that amount of spam on the official forums was worse than just taking them offline.

nova mortar
formal grail
#

😦 Would be nice if they could be left up as read-only. Any time I look up anything, I have to pray that web.archive has the page saved. Oh well.

formal grail
# hallow mortar The modding access in Reforger is already far more extensive than A3. The new en...

As is, it's not really. They still went with a DSL (granted, one that is closer to industry standard) and worse, they lock you into their IDE. At least for A3, I can code everything in my IDE of choice. For mission editing, you do get more flexibility than the A3 editor, but its maximum extensibility and maintainability is nowhere near A3. With the latest 2.20 update you can literally build web pages as UI in A3. The buttons and menus you have to click through to do something similar for reforger... Yes, that's after a decade of updates, but the design philosophy of the reforger system (it seems like it's looking to support universal modding across platforms) seems to point towards that not really being a soonish possibility there.
Not to be unfair to it, it does have some things going for it; the state of debugging seems to be more advanced. I just doubt it'll exceed A3 in terms of actual moddability any time soon.

still forum
#

SQF also has debugging, though community made

digital hollow
#

Easier point of intervention by scripting would be to just addForce up to a max speed if conditions are met.

nova mortar
digital hollow
#

No, leave the transmission alone. Just addforce every frame when, for example, player holds the key, vehicle is going up hill, speed is less than 10kph, etc

nova mortar
#

but, well

#

I could make my own transmission using that

#

I'd just have to figure out how to disable the transmission

digital hollow
fair drum
nova mortar
#

why do you even spam a forum....

#

oh right, ads...

round hazel
#

Hey folks!

Does anyone happen to have a script that will repeatedly spawn a unit on a point, to be put inside of a trigger?

#

I have

_grp = createGroup East;
_players = playableUnits;
_target = selectRandom _players;
_newUnit = _grp createUnit ["Zombie_O_Walker_Civ",getPos grave1, [], 10, "NONE"];
_newUnit doMove (getPos _target);

in a repeating trigger but it only spawns one unit at the mission start, it doesn't continue

stable dune
#

You need to use variable on server

//initServer.sqf
CVD_zombie = true;

And condition to trigger

CVD_zombie
 _grp = createGroup East; 
_players = playableUnits; 
_target = selectRandom _players; 
_newUnit = _grp createUnit ["Zombie_O_Walker_Civ",getPos grave1, [], 10, "NONE"]; 
_newUnit doMove (getPos _target); 
CVD_zombie = false;

and to trigger on deactivation

CVD_zombie = true;

The condition needs to go false so repeat works, and active again in on deactivation of trigger

#

And use delay/ trigger timer ,
Otherwise it will spawn every 0.5sec new zombie

round hazel
#

Much Obliged!

#

As a sidenote, is there any way to change an object's type during runtime through script?

exotic gyro
#

Negative

#

You have to delete it and replace it

stable dune
nova mortar
#

How to disable automatic vehicle movement dynamically(dynamically meaning that it can be done after loading the save/after a player left the vehicle/ etc.)? I just want to stop them, so I can make them move myself. Editing any config is not possible, due to it not being modular enough, and me needing all of the engine's and transmission's information.

nova mortar
proven charm
#

oh thats a whole another story then

nova mortar
#

hm

#

it says that it will remove the get in action

#

"lock the driver position" means that you cant get into the driver seat anymore i think

proven charm
#

yeah

digital hollow
#

Break the engine xD

nova mortar
#

well

#

ngl

proven charm
#

empty fuel πŸ™‚

nova mortar
#

that is a good idea

#

ampersand thank you imma try that tomorrow

#

that is the stupidest but also best solution I've heard today(since its the only solution that could actually work)

proven charm
#

well that will show engine damaged

nova mortar
#

empting fuel is also good

#

imma add the weight to another part of the vehicle then

proven charm
#

honestly if id need something like this i would use EachFrame EH to zero the vehicle speed..

#

but thats also far from perfect

digital hollow
#

I still think addForce would be enough to tweak the "effective" performance.

nova mortar
#

Well it's not just for getting up hills

digital hollow
#

Similar to my helicopter taxi mod

nova mortar
#

It's also for immersion

tawdry pond
#

Hi, how can i tell if the mission loading is finished and the world started rendering? I've always had trouble with this, and even more after the last update....

proven charm
tawdry pond
#

Yeah it's for MP. I will try it right now, thanks.

#

That doesn't quite do the trick, the latest state is "briefing read" and it happens way before the world starts rendering....

fair drum
#

Inits are kind of silly as the file order changes with sp and mp, and sometimes aren't even guaranteed to be in that order. I personally use my own game state variables.

You can also check the displays themselves if they exist.

tawdry pond
#

Well, after the latest update there is multithreaing and stuff, so what I get is a loading screen, but I hear stuff happening in the background, as in there are environment sounds, I can hear notifications pop up.

#

Is there a display number for the loading screen?

hallow mortar
nova mortar
#

What is the main page for all those functions and features?

tawdry pond
#

@hallow mortar Nice. I'll try it right away.

nova mortar
#

thanks, I hope I don't have to ask that many questions anymore using those pages

#

oh and can someone ping that it might be usefull for other people

hallow mortar
#

Both of those and the introduction to scripting are linked from the second pinned message in this channel

tawdry pond
#

BIS_fnc_isLoading returns false as soon as systemChat is able to write stuff to screen, so it didn't work.

nova mortar
#

oml i feel so stupid
edit: *am stupid

tawdry pond
#

Maybe something with camera commands? I'm not really good with that...

digital hollow
nova mortar
tawdry pond
#

My mission already waits for (alive player) and (!isNull findDisplay 46)

digital hollow
#

What are you trying to run, then? and how is it failing

leaden needle
#

Hi, is there a way to make AI units forgive a player after teamkilling? I couldn't figure out what to google.

tawdry pond
leaden needle
#

thanks, i knew i'd seen it before but forgot what it was called

quick peak
#

Hi can someone help me? How do i force ai v44 do fly in heli mode? I want it to land in specific place but it always flies above it like a plane

stable dune
proven charm
#

this works: ```sqf
heli landAt [getposATL player, "Land", 11, false]

tawdry pond
#

Just in case anyone is interested, I found a kind of lifehack to determine if the world has started rendering:
waitUntil {!isNull (uiNamespace getVariable ["RscUnitInfo", displayNull])};
This waits until the HUD rscTile is not null, but I'm not sure what will happen if HUD is disabled....

tulip ridge
#

Which is the main game display

hallow mortar
tulip ridge
#

So they mean after the black overlay dissapears?

spiral canyon
#

is it possible to trigger a hidden selection to change from a trigger? For example making the 3 screen rugged computer go to the BSOD when a player triggers it.

warm hedge
#

setObjectTexture

spiral canyon
nova mortar
#

private _currentGear = getVariable ["currentGear", 0]; Can I also replace the 0 with {_vehicle setFuel 0} for it to become private _currentGear = getVariable ["currentGear", {_vehicle setFuel 0}];

cosmic lichen
#

What? That makes no sense at all.

#

Default value suddenly changes from type number to type code and how are these values related anyway?

nova mortar
# cosmic lichen What? That makes no sense at all.

First of all, it can make sense in some languages. If I would make a programming language(wich I actually tried), the code block({}) would be replaced with the valued that it returned. Then this would actually work.

#

And I'm a noob at SQF

still forum
nova mortar
still forum
#

And you can take the return value of a code block like this
private _currentGear = getVariable ["currentGear", call {_vehicle setFuel 0}];

nova mortar
#

Ohhh

#

Could I also do private _currentGear = getVariable ["currentGear", call {_vehicle setFuel 0; return 0}];

#

so it would return something?

still forum
#

return is not a command

nova mortar
#

Oh

#

so just 0 after ;?

still forum
#

You need to tell the script whether you want to execute it or not.
It cannot read your mind, whether you want a code block as the default value, or whether you want the code block to be executed and use its return value as default

still forum
nova mortar
#

ohhh

#

Thanks

proven charm
#

getVariable works without left argument? thonk

nova mortar
#

I love this programming language

proven charm
#

yeah, thought so

nova mortar
#

It reminds me of my own attempt at making one lol

wooden dagger
#

Hey, I'm entirely green the scripting and code. I'm trying to create a trigger in the editor for a safe zone, specifically for ace3 gun safety. I found some code to create a safe zone by making the player put their gun on their back, but I need the gun to be on safe rather than restricting the gun to the player's back. I've got the trigger zone in place on the map, and two SQF files that work for actioning and terminating the gun on back, just need to modify it for ace3 safety - of which I'm not understanding.

inSafeZone.sqf
hint "In safe zone.";
player allowDamage false;

while {true} do
{
player action ["SwitchWeapon", player, player, -1];
sleep 1;
};

leftSafeZone.sqf
terminate inZoneH;
hint "Out of safe zone.";
player allowDamage true;
player action ["SwitchWeapon", player, player, 0];

From what I found about ace3 safety is this here: ace_safemode_fnc_getWeaponSafety

fleet sand
wooden dagger
wooden dagger
nova mortar
#

You can also do

#include <iostream>

// this is formated as a cpp file
int main() {
  std::cout << "Hello world!" << "\n";
};
wooden dagger
#

I have no idea what the means, lol. Like I said, entirely green on all of this

nova mortar
#

no i mean you can add ```cpp in the first line to format it as c++

nova mortar
wooden dagger
#
while {true} do
{
[player, currentWeapon player, true] call ace_safemode_fnc_setWeaponSafety;
sleep 1;
}; ```
nova mortar
#

yes

wooden dagger
#

Like that?

#

I gotcha

#

I know I can add an if statement in there instead of a while, but to structure it is where I'm lost.

#

basically I know I can have something like "if safety is turned off, then safety is turned back on"

fleet sand
# wooden dagger So, while testing this, I am able to turn the safety off, and it doesn't reengag...

Try this then:
Variable Name on Trigger: tag_TriggerName
Type: None
Activation: AnyPlayer
ActivationType: Present
Repetable: true
Server Only: false

Codition: this

OnActivation:

player allowDamage false;
[player, currentWeapon player, true] call ace_safemode_fnc_setWeaponSafety;
inAreaVar = player inArea tag_TriggerName;


0 spawn {
  while {inAreaVar} do {
  [player, currentWeapon player, true] call ace_safemode_fnc_setWeaponSafety;
  sleep 1;
  };
};

OnDeactivation:

player allowDamage true;
[player, currentWeapon player, false] call ace_safemode_fnc_setWeaponSafety;
inAreaVar = false;

I am sure there has to be better way with EH but i am lazy to think so this is what i got so far πŸ˜„

wooden dagger
#

I appreciate the help! I'm trying to understand this more to eventually get some teleport scripts going too, to allow players to fire, but in a certain area that isnt the spawn area, before op start.

fleet sand
#

The only thing i am not sure what would happen if 1 player is in trigger area and other player is outside the trigger area will the player who is outside still have enforced safty or not.

wooden dagger
fleet sand
wooden dagger
wooden dagger
wooden dagger
#

How would you make an "if then" line, or would that just not be the way to do this

#

Every variation I'm trying to create keeps getting me bool errors or saying I'm missing semi colons when I don't think I am

stable dune
#

If using , you could try

//condition
player inArea thisTrigger;
//on activation 
[{  
    params ["_args", "_idPFH"];  
    _args params ["_unit"];  
    _unit setVariable ["UTR_safety", _idPFH];   
    if !((currentWeapon _unit) in (_unit getVariable   ["ace_safedWeapons", []])) then { 
        [player, currentWeapon player, true] call ace_safemode_fnc_setWeaponSafety;  
    };  
    if (isDamageAllowed _unit) then {  
        _unit allowDamage false;  
    };   
},  
0.5, [player]] call CBA_fnc_addPerFrameHandler;  
systemChat "activated";
//on deactivation
systemChat "de activated";
player allowDamage true;
private _idPFH = player getVariable ["UTR_safety",-1]; 
if (_idPFH != -1) then { 
    [_idPFH] call CBA_fnc_removePerFrameHandler; 
    diag_log format ["UTR_safety removed unit removed %1, %2",player,_idPFH]; 
};  
fleet sand
# stable dune If using , you could try ```sqf //condition player inArea thisTrigger; ``` ```sq...

Myb also add this codition if player respawns or gets teleported out from safezone

player setVariable ["TAG_inSafeZone", true];

[{  
    params ["_args", "_idPFH"];  
    _args params ["_unit"];  
    _unit setVariable ["UTR_safety", _idPFH];

    if (!alive _unit || {!(_unit getVariable ["TAG_inSafeZone", false])}) exitWith {  
        [_idPFH] call CBA_fnc_removePerFrameHandler;  
    };

    if !((currentWeapon _unit) in (_unit getVariable   ["ace_safedWeapons", []])) then { 
        [player, currentWeapon player, true] call ace_safemode_fnc_setWeaponSafety;  
    };

    if (isDamageAllowed _unit) then {  
        _unit allowDamage false;  
    };   
},  
0.5, [player]] call CBA_fnc_addPerFrameHandler;
stable dune
#

True

wooden dagger
wooden dagger
rich nexus
#

what is the setobject texture script for a headgear retexture i want to test?

wooden dagger
#

Thank you all for your help!!

hallow mortar
rich nexus
hallow mortar
#

I guess

fleet sand
#

But the headgear has to have hiddenSelections

#

Actually nvm that is for uniforms not for helments

hallow mortar
eternal spruce
#

I'm stuck at a crossroads where I've downloaded a mod and one of its vehicles have a custom addAction to "fold wings". I've looked into the config for animationSource and none of them works, is there another way to find the animation used for a vehicle in the config that I'm unaware of?

crisp vault
#
_unitGroup addEventHandler ["EnemyDetected", {
params ["_group", "_newTarget"];
hint format ["event triggered. detected enemy. Group: %1, new target: %2", _group, _newTarget];
//greenGuy setPos [50,50,50];    
}];

can someone help me figure out why this does nothing? I named the unit greenGuy in the eden editor?
Im not too experienced yet with event handlers but from what I understand this should work, to send a hint, i even tried to set the position of the greenGuy for an obvious execution of code.
i tried launching from multiplayer server and singleplayer,
I tried using systemchat and hint
I tried initializing on the unit's init field/"this" automatic variable, and tried adding the event handler in the debug console

I guess i'm expecting that when i put an enemy in front of any unit of that group, it should execute the code, but maybe i am mistaken

eternal spruce
#

@thin fox, Question, does this only work for the jets DLC aircrafts or vehicles with the fold wings subclass definitions?

granite sky
crisp vault
#

thanks. not sure what i was doing wrong earlier. ill play with it some more. the code you provided worked fine

thin fox
#

I took this function from the addAction itself and modified it to work with my cas menu

nova mortar
#
// config.cpp
    class MarlosEnhancedTransmissions_AccelerateAnalog {
        displayName = "Accelerate(Analog)";
        tooltip = "Accelerate";
        onAnalog = "['MarlosEnhanvedTransmissions_AccelerateAnalog', _this] call MarlosEnhancedTransmissions_fnc_AccelerateAnalog";
};
// fn_accelerateAnalog.sqf
[
    "_accelerationIntensity"
];
private _vehicle = vehicle player;
if (_vehicle != player) then {
    _vehicle setVariable["MarlosEnhancedTransmissions_accelerationIntensity", _accelerationIntensity, false];
}

Is this the right useage of onAnalog?

#

Because it doesn't realy seem to work

warm hedge
#

You didn't declared _accelerationIntensity

still forum
#

Also what is that array at the top that does nothing? Was that supposed to be a params?

#

If it was supposed to be params, then it's wrong because you are passing two Parameters to the function, the first one seems nonsense to me.
But you're only retrieving one parameter

tender fossil
#

I'm losing my mind thanks to this mission.sqm issue... πŸ˜‚ The first object (Item57) works fine, the camp appears on map like it should thanks to the init code. But the other objects (like Item58) simply refuse to show even though the init lines should be identical apart from the variable name. What could be wrong here?

class Item57
{
    dataType="Object";
    class PositionInfo
    {
        position[]={16867.203,13.047143,15696.879};
        angles[]={6.2718058,5.7027411,0.03865904};
    };
    side="Empty";
    flags=4;
    class Attributes
    {
        init="call { call { this setVariable [""WF_CAMP_TOWN"", ""Pajunlahti""]; } } " \n "";
    };
    id=107;
    type="Land_Fort_Watchtower";
    atlOffset=9.5367432e-07;
};``` vs. ```cpp
class Item58
{
    dataType="Object";
    class PositionInfo
    {
        position[]={15461.747,4.5164852,14811.762};
        angles[]={6.2581573,3.942786,6.2786303};
    };
    side="Empty";
    flags=4;
    class Attributes
    {
        init="call { call { this setVariable [""WF_CAMP_TOWN"", ""Northern_Virojoki""]; } } " \n "";
    };
    id=108;
    type="Land_Fort_Watchtower";
};
hallow mortar
#

Manually editing mission.sqm? 😬
Is the object itself successfully created?

tender fossil
hallow mortar
#

What system is the WF_CAMP_TOWN variable used by? Just setting variables doesn't create markers on its own. It could be more of a problem with that system rather than with the code shown here directly.

tender fossil
#

Yes, I was thinking of that too. The code works partially at least since it's spawning camps for Pajunlahti

#

Oh well... The camps start to work if I decrease the maximum supply value of town down to minimum (40) and remove two service functionalities (from rearm, repair, refuel and heal). πŸ˜‚ I need to read the code of the function it's calling once again because it's not instantly evident why it acts like that

#

...and now it works with values that didn't work a moment ago πŸ˜„

proven charm
#

did you reload?

tender fossil
#

Yes

proven charm
#

k

nova mortar
still forum
#

yes

nova mortar
#

oh and

#
params [
    "_accelerationIntensity"
];
#

Do i need params?

#

in front of the []

still forum
#

If you want to use the params command, you need to use the params command.

#

But you could also just use _this directly, it is already the number you want

nova mortar
#

Ohh so I could replace _this with _accelerationIntensity

#

in config.cpp

still forum
#

no

nova mortar
#

oh

#

alright

#

thank you!

nova mortar
# still forum But you could also just use _this directly, it is already the number you want
private _vehicle = vehicle player;
if (_vehicle != player) then {
    _vehicle setVariable["MarlosEnhancedTransmissions_accelerationIntensity", _this, false];
}```

```cpp
// config.cpp
class MarlosEnhancedTransmissions_AccelerateAnalog {
    displayName = "Accelerate(Analog)";
    tooltip = "Accelerate";
    onAnalog = "[_this] call MarlosEnhancedTransmissions_fnc_AccelerateAnalog";
};

When I do vehicle player getVariable "MarlosEnhancedTransmissions_accelerationIntensity" ingame it returns 0, even when I used the button.

still forum
#

when I used
Specify what you mean by used

"used" is past-tense, meaning you are not using it anymore. Meaning the button value should be zero, because you're not pressing it

nova mortar
#

its a joystick slider

still forum
#

add logging into your script function to see its called right?

nova mortar
#

Uhm

#

with hint?

still forum
#

Anything you like

nova mortar
#

I don't realy know how but imma google

hallow mortar
# nova mortar its a joystick slider

Is it still in a non-0 state when you check the value? Because returning the device to the 0 position is still an analogue event, and will be recorded as such.

hallow mortar
nova mortar
#

Ohhh

#

thank you

#

Oh well

#

its an array

still forum
#

[_this] call
You are passing an array

#

you can pass _this directly, no [] around it

nova mortar
#

yes

#

i changed that

#

It doesn't work using the extended debug console, but it works printing it into the chat

still forum
#

When you pause the game to go into debug console, you also loose the joystick input

nova mortar
#

oh

still forum
#

You can probably just ignore the input if isGamePaused, but not working in MP

nova mortar
#

time to

git add --all
git commit -m ""
tender fossil
tender fossil
#

My friend tried creating a new map as well. No errors in RPT, rather the opposite, but nothing works. Back to the drawing board trying to figure out what we're doing wrong KEKSad

nova mortar
#

Can I use python scripts in my arma addon? I need to use numpy for some torque curve related things.

nova mortar
#

oh

#

I guess imma do it in SQF then

manic verge
#

first time trying to set up a virtual garage, does anyone know how i go about changing the direction the vehicle spawns in?

#

heres the code im using on the object

#

also sorry, not really sure if this belongs in scripting or editor..

winter rose
#

scripting is fine about scripting ^^

nova mortar
#

How do I apply a rotational(torque) force to a wheel of a car? And how do I get the wheels of the car?

#

Using addforce _wheel, [10, 0, 0], [0, _wheelRadius, 0]?

hollow lantern
#

would someone tell me what currently the best way is, to create a mine field? Specifically one that has evenly spaced mines in a 10x100 rectangle.
I then later wanna add mine signs to that rectangle as well on both sides.
Thanks.

nova mortar
# hollow lantern would someone tell me what currently the best way is, to create a mine field? Sp...

In programming, there isn't a best way. All Most roads lead to rome. But there is a fastest, easiest, etc. ways, to solve your problem.

Now I don't realy know how to do it in SQF, but I would just make a for loop for the x and y axis, that increments 10 points(?) at a time and places a mine there. If the terrain isn't flat, I would just move it down until it touches the terrain.
Again, I don't know if this is possible in SQF scripting. This would be my approach.

hollow lantern
#

I disagree. There can be a best way. Why write something that takes 1000 lines of code if you can do the same with 20 :p
But I will fiddle around with using a trigger box as guide to evenly distribute them, thanks.

nova mortar
#

But eh this argument will lead nowhere

hallow mortar
#

You could find a wheel's position in the car model using selectionPosition, and apply your addTorque or addForce to that position in the model, but that's not the same as applying it to the wheel

#

I'm not even sure wheels can spin freely like that

hallow mortar
# nova mortar bruh

I mean, you can try it. High centre a vehicle on something and bump into the wheels with a physics object, see if they spin.

nova mortar
#

If that doesn't work, I either use addforce on the vehicle itself, wich will be hard to do realistically, if not impossible

#

or give up

nova mortar
#

i mean i could still

#

apply force at the bottom of the wheels

#

and make the car move

hallow mortar
#

I'm absolutely certain this will result in a fluid, enjoyable, and non-jank driving system

nova mortar
#

yeah

#

all this just because they wont add manual driving

#

or i just make everything rear wheel drive

#

would fix some problems with that

#

How do I get the position of the wheels? Or how do I like use this from the config of a vehicle: model = "a3\Soft_F_Gamma\Truck_01\Truck_01_cargo_F.p3d";?

hallow mortar
nova mortar
#

oh

#

thanks

#

imma send my results tomorrow

little raptor
nova mortar
#

Oh ok imma look into that tomorrow

manic verge
fair drum
#

Honestly haven't worked with it and I'll have to do some testing before I answer. Won't be home from work until 8 est

manic verge
#

ah alr, i shall resign for the night and head to bed then lol

#

i'll probably wake up some time around 10pm est?

tough abyss
#

I'm having a bit or trouble making a script rotate an object it spawns by 180 degrees, I get an error saying I'm missing a semi colon, I don't see the problem?

....
private _cObj = createVehicle [_cType, _cPosition, [], 0, "CAN_COLLIDE"];
_cObj setVectorUp [0,0,1];
if(_z > 0) then {
 0 = [_cObj] call bis_fnc_replacewithsimpleobject;
}
if(floor(random 10) >= 5) then {
 [_cObj, [180,0,0]] call BIS_fnc_setObjectRotation;
}
....

Error message:

...bis_fnc_replacewithsimpleobject;
}
|#|if(floor(random 10) >= 5) then {
 [...

Specifically this is an init script for a composition

errant iron
#

semi colons at the end of code blocks } are required too

#

e.g. sqf if (true) then { ... };

tough abyss
#

oh, weird, I have an if without a semicolon around the snippet that that was working fine before adding the rotate part.. thanks!

errant iron
#

ye, if they're at the end of a script then the semicolon isn't necessary, same with other kinds of statements

tough abyss
#

does it not care if the closure is the last line in the parent?

if(x) then {
 if(y) then {
  if(z) then {
   //do something
  };
 } // didnt complain about this
};
#

ok, thanks for clearing that up!

hallow mortar
#

You need one after it because it may not be an effective end of line for whatever's outside it.

tough abyss
#

ok, not used to languages having that kinda flexability

hallow mortar
#

Personally, I'd say it's good practice to include a ; at end of line even if it's not strictly necessary, just for human readability.

errant iron
#

i'm in the opposite camp, i like omitting the semicolon rust-style as a convention to indicate lines that are intended as return values

pallid palm
#

i'm in the NikkoJT camp

tough abyss
#

unrelated to the last question im noticing something a bit weird with script-placed objects, basically my script places a random number of objects on top of eachother, and makes everything except the bottom one a simple object (strictly for performance and so it doesn't fall) the object on the bottom of the stack sinks into the ground and then bounces back up like its colliding it and I don't really know how to make it stop. I tried adjusting my script so the first item is 1 meter above ground and each object above it is also spaced as such, it doent seem to be related to other objects being above the one that still has physics

#

anyone know how to resolve this? The objects on the bottom level have doors I want the player to be able to interact with still, but beyond that I dont care if simulation is disabled entirely

pallid palm
#

can we see the script

tough abyss
#
HARROW_SHIPPING_CONTAINER_GEN_VERSION = "V1.0.0";
HARROW_SHIPPING_CONTAINER_GEN_POSITION = [0,0,0];

if(!isNull (findDisplay 312) && {!isNil "this"} && {!isNull this}) then {
 HARROW_SHIPPING_CONTAINER_GEN_POSITION = getPosATL this;
 deleteVehicle this; 
}; 
 
[] spawn {   
 _startPosition = HARROW_SHIPPING_CONTAINER_GEN_POSITION;
 _numOfContainersBase = 6; 
 _numOfContainersHeightMax = 4; 
 _distanceBetweenContainerStacks = 4; 
 _containerHeight = 2.635; 
 
 private _containerTypes = [ 
  "Land_Cargo40_blue_F", 
  "Land_Cargo40_brick_red_F", 
  "Land_Cargo40_cyan_F", 
  "Land_Cargo40_grey_F", 
  "Land_Cargo40_light_blue_F",
  "Land_Cargo40_light_green_F",
  "Land_Cargo40_military_green_F",
  "Land_Cargo40_orange_F",
  "Land_Cargo40_red_F",
  "Land_Cargo40_sand_F",
  "Land_Cargo40_white_F",
  "Land_Cargo40_yellow_F"
 ]; 
 
 for "_containerGridY" from 0 to _numOfContainersBase do { 
  if(floor(random 10) <= 7) then { 
   for "_containerGridZ" from 0 to (round(random _numOfContainersHeightMax - 1) + 1) do { 
    private _containerPosition = _startPosition vectorAdd [ 
     0,  
     (_containerGridY * _distanceBetweenContainerStacks),  
     (_containerGridZ * _containerHeight) + 0.1 
    ]; 
 
    private _containerType = selectRandom _containerTypes; 
    private _containerObj = createVehicle [
     _containerType,
     _containerPosition,
     [],
     0,
     "CAN_COLLIDE"
    ];
    _containerObj setVectorUp [0,0,1];
    if(floor(random 2) == 1) then {
     [_containerObj, [180,0,0]] call BIS_fnc_setObjectRotation;
    };
    if(_containerGridZ > 0) then {
     0 = [_containerObj] call bis_fnc_replacewithsimpleobject;
    };
   }; 
  };
 }; 
};
tulip ridge
#

Unrelated but don't use _y as a variable name, it's a magic variable like _x

hallow mortar
#

You can make your position adjustment a little cleaner using vectorAdd

tough abyss
#

Edited

pallid palm
#
for "_i" from 0 to
hallow mortar
#

It doesn't have to be "_i", that's just common convention

tough abyss
hallow mortar
#

Is that all? That's pretty normal for physics objects settling

tough abyss
#

its annoying to me, so I wanted to know if theres something I can do to prevent it but keep the doors on the containers working

#

if I cant it is what it is

hallow mortar
#

as long as they don't actually explode I wouldn't worry about it

tough abyss
#

ok

#

the bigger picture idea is that im making a container port and I want the containers and their contents to be procedural so I can reuse it in zeus and get something a little different every time

#

wont just be the containers that are procedural just figured its an easy enough starting point

pallid palm
#

i would just place them in the Editor, that would be real easy for me

#

using the alt key

#

and mouse ofcorse

tough abyss
#

I did that at first, but I didnt really like the results and I found spacing them how I liked to be tedious

#

same with placing ground peices at the right distance to avoid seams and zfighting, its easier to just script it

paper ginkgo
#

Does anyone know of a way to order IMS ai to conduct a melee charge, when playing as squadlead?

#

If there isn't a system or mechanic for it, then I could consider trying to implement it myself.

fair drum
#

ask on webknight's discord

fair drum
# manic verge heres the code im using on the object
this addAction ["Open Garage", {
    private _pos = [15424.8,15764.8,0];
    BIS_fnc_garage_center = createVehicle ["Land_HelipadEmpty_F", _pos, [], 0, "CAN_COLLIDE"];
    ["Open", true] call BIS_fnc_garage;
    
    // closed event subscription
    [missionNamespace, "garageClosed", {
        params ["_displayNull", "_toggleSpace"];

        if (!isNull BIS_fnc_garage_center) then {
            BIS_fnc_garage_center setDir random (360);
        };

        // Verification - you can delete this
        systemChat format["%1 | Pos: %2, Dir: %3", typeOf BIS_fnc_garage_center, getPosATL BIS_fnc_garage_center, getDir BIS_fnc_garage_center];

        [missionNamespace, "garageClosed", _thisScriptedEventHandler] call BIS_fnc_removeScriptedEventHandler;
    }] call BIS_fnc_addScriptedEventHandler;
}];

keep in mind, the created vehicle is going to be local to the player that uses this action until a new driver or locality change happens. if you intend on storing this vehicle in another variable for future use, know that you'll need to execute it where its local. Also know, that the way you are setting the position, if multiple people use the garage at the same time, you are going to have an explosive arma moment on your hands. So maybe change how you are going to do the positioning.

manic verge
#

damn, thats more code than i expected lol

#

ah, and ik about the exploding

fair drum
#

the garage system is kinda poor. no event for when the vehicle is created. its also labeled as broken on the wiki, so expect bugs

manic verge
#

this is only for a silly server for me and my friend to mess around in so i figure thats part of the fun lol

manic verge
#

but as i said idm

manic verge
#

i was on the right track

#

i tried using setdir

#

i was just too daft to figure out how lmao

#

thanks for that!

fair drum
#

when the garage is closed BIS_fnc_garage_center points to the vehicle that is created

#

which is why i subscribed to the closed event because it "should" have that already stored by then

manic verge
#

thats where i was lost

fair drum
#

you can open these functions in the function viewer and view them yourself. I just read through it.

manic verge
#

oh shit rlly

#

im very new to this stuff lol

manic verge
warm hedge
#

You cannot use comment line in Init section

manic verge
#

ah makes sense

manic verge
#

i imagine remoteExec is the way to fix that but idk where to add it

granite sky
#

Nah, vehicles are normally global. Garages will often use createVehicleLocal for placement UIs but when they spawn a real vehicle it should show for everyone.

#

If other people can't see those then they're not loading the right mods.

fair drum
#

And I believe when I looked at the function code, it uses createVehicle which is global, however, its still local ownership on the client that created it.

#

actually i think it uses the old create vehicle function instead...

#

super old code. still uses the param function before param/params came out

meager granite
nova mortar
#

Yeah?

#

wow class wheels that will surely help me find it

#

there is no class wheels in the vehicle

#

its a hemtt

little raptor
nova mortar
#

yes.

little raptor
#

Β―_(ツ)_/Β―

#

I know that it is there

nova mortar
#

its not.

little raptor
#

those are properties not classes

#

classes are on the left

nova mortar
#

i want to stab a knife into my knee

#

im so stupid

#

sry

inland flame
#

Is there a way to use the BIS_fnc_establishingShot more than once in a mission? I've been trying to use it in the intro and outro to a mission but the outro one just gives me my first person view and not the fake UAV

drifting badge
#

Is there any way to force an ai to walk backwards? (i.e. not have it turn around and move to a given waypoint, but keep it facing the enemy/threat and walk backwards to the waypoint without turning around?)

still forum
granite sky
#

Wait, parachutes are automatically deleted on landing? :P

thin fox
#

after 12 years...

still forum
ivory lake
#

they are

granite sky
#

is an Arma newbie really

ivory lake
#

do wish there was an eventhandler or something for when a player/unit uses the deploy parachute action

granite sky
#

I actually assumed that the normal parachute deploy was separate logic from the createVehicle + attach stuff we do with AIs.

#

And therefore you'd have to manually detach & delete the things.

proven charm
#

so in ```sqf
_paradropHandle continueWith { "SmokeshellGreen" createVehicle _this; };

still forum
#

yes

proven charm
#

cool

#

tbh the name "empty" handle didnt tell me much. maybe it could be called async or something, idk

still forum
#

Naming is hard.
Its a script handle without a script 🀷

#

scriptless-handle would also work

digital hollow
proven charm
#

"wait handle" ?

still forum
#

But a handle with a script in it, can also be waited on, its also a wait handle

proven charm
#

true

#

callback handle? i can think of many names but not very good ones πŸ™‚

hallow mortar
#

Reserved?

ivory lake
little raptor
still forum
#

No

#

It behaving like an Eventhandler is easier.
Scheduled scripts are already used to eventhandlers, and can easily spawn a new script.
And that way it'll also work good for unscheduled

little raptor
#

yeah makes sense

digital hollow
still forum
#

User action Handler to detect action menu activation, then check what action is currently selected πŸ˜„

hushed turtle
#

I don't see what's the point of the empty handle

little raptor
#

see the example with continueWith

#

it makes sense to me but still it is very odd looking πŸ˜…

still forum
#

Its like Javascripts .then and await

little raptor
#

_handle continueWith {} continueWith {} 🀣

hushed turtle
#

I see now. We don't have any scriptHandle, since we don't use spawn {} nor execVM. So, we need to create it in some other way

still forum
fair drum
#

@still forum How open are you to having submissions to optimization/fixes/updating with modern commands within older BIS functions?

still forum
#

I generally do not touch script.
Editing data is too much hassle

fair drum
#

Anyone still work on that side of script at all?

hallow mortar
#

I've seen KK adjust a few functions recently.
There was also a project to make the functions library more open to community submissions, which I think is still supposed to be happening, but much like the new FT and the forum fix, there hasn't been any news for a while

cosmic lichen
#

There was also a project to make the functions library more open to community submissions, which I think is still supposed to be happening, but much like the new FT and the forum fix, there hasn't been any news for a while
That probably landed on the same desk as the "we need a new feedback tracker" and "we need to fix the forums" tasks

hollow lantern
#

I seem to struggle to get a perfect line. I have a trigger with A = 1 / B = 100 and now I want that trigger as base to get a perfect centered line.
My goal is to play around with vectors to add objects on that line.

Not sure what function / command I have to use to achieve this
Thanks.

little raptor
#

what's A and B?

#

ellipse radii?

errant iron
#

Given a laser target, is it possible to retrieve its origin vehicle and instigator? Or would I need to iterate through all vehicles with laserTarget to identify that?

thin fox
#

I would like to know that too

hallow mortar
#

You could try objectParent, although this may be tripped up by script-created laser targets that are attached to things (if it works for this at all)

errant iron
#

oh right, i did try objectParent, attachedTo, and getShotParents but no luck with those

#

for now i'm iterating through all desired units to get the vehicle and instigator, along the lines of: sqf private _laserInstigators = createHashMap; { private _handLaser = laserTarget _x; private _vehicleLaser = _vehicle laserTarget (_vehicle unitTurret _x); // Determine instigator from UAVControl / leader... } forEach allUnits; actual code i'm using: https://gist.github.com/thegamecracks/f5df0196475df3d27ae01ef317c8771a

#

it's not that performant though, against 320 units it ends up taking about 1ms even if there aren't any laser targets active, so for my use case i've filtered it down to a specific side and players/UAV units only

tough abyss
#

say I have an arbitrary data structure (this is an example and its missing some context that makes this runnable or sensical code):

  1. Is there a noticeable performance impact to destructure into named private variables or should I just pass values through?
  2. The latter being unreadable trash, is it worth it to rewrite as such once the project is done for performance gains?
  3. Is there a way to model a structure in SQF beyond arrays?
"_name, _type, _spacing: [x, y, z], _startPoint, _objectCounts: [x, y, z]";
private _containerContents = [
  ["WATER","Land_WaterBottle_01_stack_F",[1.455,1.455,1.2578006],[-5.0837097,0,0.7748785],[8,0,2]],
  ["RICE","Land_FoodSacks_01_large_brown_idap_F",[1.455,1.455,1.2578006],[-5.0837097,0,0.7748785],[8,0,2]],
  ["BOX","Land_PaperBox_01_small_stacked_F",[1.455,1.455,1.2578006],[-5.0837097,0,0.7748785],[8,0,2]]
];

Destructuring to name fields:

private _containerContent = selectRandom _containerContents;
private _name = _containerContent select 0;
private _type = _containerContent select 1;
private _spacing = _containerContent select 2;
private _startPoint = _containerContent select 3;
private _objectCounts = _containerContent select 4;

private _containerContentsObject = createVehicle [_type, _startPoint vectorAdd [(_spacing select 0) * _objectCountX, (_spacing select 1) * _objectCountY, (_spacing select 2) * _objectCountZ], [], 0, "CAN_COLLIDE"];

Use expressions inline:

private _containerContent = selectRandom _containerContents;

private _containerContentsObject = createVehicle [(_containerContent select 1), (_containerContent select 3) vectorAdd [((_containerContent select 2) select 0) * _objectCountX, ((_containerContent select 2) select 1) * _objectCountY, ((_containerContent select 2) select 2) * _objectCountZ], [], 0, "CAN_COLLIDE"];
#

for this specific example above, it might also be worth asking is it better to have a longer script with precomputed positions for objects to be placed, or to compute them at run time with a smaller script. here I have computed at runtime but it wouldn't be difficult for me to precompute most things that dont require variance

hallow mortar
#

params will save you some lines there

warm hedge
#
  1. Slightly and unnoticeable performance increase
  2. params indeed
  3. What does it mean and for what purpose
tough abyss
#

@warm hedge for 3, like how im using an array with sub arrays to hold a bunch of related values, is there a way to just do like a struct or class object? even like javascript / json style? a map with key/value pairs?

warm hedge
#

HashMap is a thing in SQF

#

createHashMap or createHashMapFromArray can tell the idea

tough abyss
#

I would assume with hashmap the hashing / search is going to take longer than any convenience gained by storing information like this in one

warm hedge
#

Of course to fetch a singular data it has worse performance than array and select

tough abyss
#

take longer computationally than its worth given the convenience I'm not afforded in my current approach*

warm hedge
#

But you see how easy and strong HashMap is

tough abyss
#

ok

#

thanks for the help!

#

I will also go checkout what params looks like, ive seen it used in functions

warm hedge
#

To calculate the performance of a code, gauge icon in Debug Console can help

tough abyss
#

I imagine functions also come with some overhead so ive only used them where its actualyl being called more than once instead of my normal using function names to self document

#

ok

#

params cleaned up a ton of lines for me, thanks

granite sky
tough abyss
#

good to know!

granite sky
#

kinda makes sense because any time you use {} it's creating a sub-scope, so even an if statement is doing the same thing.

tough abyss
#

my script places objects inside another object, the inner object is replaced with a simple object. is it possible to:
a. set the inner object to be created as the simple object directly and skip the step to replace it with simple object?
b. could I disable physics for the outer object (like with [_object, false] remoteExec ["enableSimulationGlobal", 2]; until the inner object is replaced then reenable simulation with [_object, true] remoteExec ["enableSimulationGlobal", 2];?

#

the outer object gets shifted around from what I assume is physics issues with the inner object being placed inside

#

oh you know what i just found createSimpleObject in the docs

granite sky
#

Not really understanding your question but usually if you want to put one object inside another you use attachTo.

tough abyss
#

I have shipping containers that have doors that a player can open, inside them i want for example pallets of rice. my script places the container then places the pallets of rice inside the container, the rice clips through the container. after spawning the pallets of rice it calls 0 = [_palletOfRiceObject] call bis_fnc_replacewithsimpleobject; I think that the rice clipping through the shipping container, and the fact that both the shipping container and the rice have simulation enabled when they are spawned and there is atleast 1 tick between when the pallet is created before it has simulation disabled (disabled by replacing it with simple object) there is a physics caliculation that causes the shipping container to get pushed around

#

the createsimpleobject to spawn the rice instead of using createvehicle seems to have fixed this problem, but the position of the rice is messed up even after ATLToASL but I will worry about that later

granite sky
#

yeah there's some z-axis weirdness with simple objects.

tough abyss
#

I can figureout the offset on it later and it should be fine

granite sky
#

createVehicle + attachTo would work instead but might have a bit more performance cost.

tough abyss
#

I also did attach to

granite sky
#

disabling sim immediately should also work but it might need to be in the same frame as the createVehicle

tough abyss
#
private _containerContentObject = createSimpleObject  [_type, ATLToASL _containerContentObjectRealPosition];
       _containerContentObject setVectorUp [0,0,1];
       [_containerContentObject, _containerObj] call BIS_fnc_attachToRelative;
granite sky
#

When I use createVehicle + attach or createVehicle + setDir I always wrap them in isNil { } if it's scheduled.

tough abyss
#

before when it was shifting the shipping container it looked like (more or less going off memory):

private _containerContentObject = createVehicle  [_type, _containerContentObjectRealPosition, [], 0, "CAN_COLIDE"];
       _containerContentObject setVectorUp [0,0,1];
       [_containerContentObject, _containerObj] call BIS_fnc_attachToRelative;
granite sky
#

Because createVehicle is quite slow it's relatively likely to stop the scripts after it.

#

The isNil wrapper guarantees that it'll be attached before the physics kicks in.

tough abyss
#

ok so are you sayign then if I do like

isNil {
private _containerContentObject = createVehicle  [_type, _containerContentObjectRealPosition, [], 0, "CAN_COLIDE"];
       _containerContentObject setVectorUp [0,0,1];
       [_containerContentObject, _containerObj] call BIS_fnc_attachToRelative;
};

I can make sure all of that closure runs before doing something else / doing a physics frame?

granite sky
#

Yep.

#

Unscheduled code never gets interrupted. You can stall Arma for 10 seconds if you really want to.

#

you are missing an L in CAN_COLLIDE btw.

tough abyss
#

yeah that was just me typing from memory it was /like/ that not exactly that

#

thanks for lettimg me know tho thats pretty useful

#

big picture im trying to do a procedural container port with randomizing objectives

#

and randmoized layout

#

so that will be really helpful if I can queue up some tasks into batches with that

vast horizon
#

im editing a faction in a modded scenario, and the vehicles and equipments are from Prairie Fire DLC, and they are not loading, so I am guessing I need to add a line to indicate to load/consider content from that dlc, but I do not know what would be the code, any help?

warm hedge
#

One obvious way is isClass (configFile >> "CfgPatches" >> "loadorder_f_vietnam")

vast horizon
#

that unfortunately did not work

#

oh lord, just a second, I was writting on an old backup of the scenario πŸ’€

#

that is still a no, should I put that in an INIT file or can be directly on my faction .sqf?

warm hedge
#

No idea what you do and your goal, and what do you expect from my code

hollow lantern
little raptor
still forum
stable dune
#

If I create a sound source,
Which loops SFX sound,
Does it sync to JIP?
I mean if I have "long" sound and does it wait until it starts from begin or does sound continue xx point to jip

hushed turtle
still root
#

Are there code optimization Guides that go beyond what's written on the community wiki? I already use most of the methods from there (some just don't have a use case in my current projects) but I think it doesn't hurt to go beyond that

little raptor
#

I don't think so. what are you trying to optimize?

still root
#

Just wanting to learn good practice in general

still forum
#

I think most of the good practice (that isn't total nonsense like what some old youtube videos claim) is already on the wiki page

cosmic lichen
still root
still root
paper ginkgo
#

How would I use a script to get the position of the nearest enemy and then have the unit move there?

#

I'm somewhat new to scripting, but I've tried tons of scripts (finNearestEnemy, getpos, doMove) and it seems I just can't connect them properly for it to work.

#

Sidequestion: How do I use the position recieved from "getPos" and can I refer to recieved numbers with variables such as x,y,z

proven charm
lean kernel
#

I've been using AI to help me program my Arma 3 scripts, but for some reason it's generated a lot of hate in the modding community. I don't understand why. This tool is there for a reason. It's gotten to the point where people even hacked into my husband's personal Facebook account to insult him.
What's wrong with using AI to help me program faster and find syntax errors? This tool was created for a reason.
Can someone explain to me if there's a rule I broke by doing this? Literally half the Steam modding community messaged me calling me a chinese of shit.

paper ginkgo
hushed turtle
lean kernel
stable dune
lean kernel
#

I felt terrible. I'm someone with autism, and these kinds of attacks depress me quite a bit. I literally burst into tears. I was writing a lot of scripts for the community, but out of nowhere, tons of people, mostly Germans, started attacking me. They even attacked mods my husband made for another game over five years ago, even reaching his personal Facebook profile.

still forum
# lean kernel I've been using AI to help me program my Arma 3 scripts, but for some reason it'...

AI has its uses.
But the problem is not AI in itself.

The problem is stealing other peoples content, pretending its yours.
Posting lies on the mods description, promising features that aren't even there.
Asking for donations and monetary support even though the content was stolen.

I remember you name.
I posted a comment on your mod showing how badly it was made.
From beginner errors, over seemingly AI generating nonsense code, over deception and lies, to stolen code.

You just deleted my comment and hid your mods.
The problem is not AI, the problem is you.

I was informed about your history.
2014: Stealing other peoples age of empires mods, pretending you made them, and asking for donations. (and that was attempted multiple times)
2021: Stealing other peoples mods in Total War Shogun, pretending you made them, and asking for donations. Being called out for trying to gaslight people into siding with you because others are "unfairly" attacking you while you have done nothing wrong.
2021: Asking for donations because your girlfriend died to pay for the funeral.
2021: Asking for donations to dig up the dead girlfriend and cremate them
2022: Pretending to be a female veterinarian who's clinic was broken into, asking for donations. But the verification picture was stolen from another clinics Covid-19 donation drive, and edited to put your name onto it.
2025: Publishing Arma 3 mod, description making false claims, code is stolen or AI generated, asking for donations.

I see a pattern, and this community doesn't tend to appreciate such people.

lean kernel
#

Besides, I don't use AI for programming, but rather to achieve a more readable format and to find syntax errors.

still forum
lean kernel
#

yes

still forum
#

And its just a coincidence that the new modding activity from you, follows the exact same scammy/thieving/asking for donations pattern as "your husband"'s prior acitivty?

lean kernel
#

We even have it as a description on our profile, which the account he and I share.

#

He was asking for donations five years ago when his girlfriend died of COVID, but someone took advantage of the situation to ask for money in her name. This nearly drove him to suicide.

#

He doesn't even make mods anymore, it's been like a year.

still forum
#

So you now continue his legacy by making scam mods, stealing other peoples work, pretending its yours and asking for donations.
Just like he has done with his scam Age of Empires and Shogun mods that were stealing other peoples work, pretending its his and asking for donations.

lean kernel
#

Also, if I use AI to help me create my scripts, you really shouldn't care; it's a tool that helps a lot, and that's what it was created for.

still forum
#

Nice to learn that you are not involved with what your husband has done in the past.
But the present doesn't look any different

#

I literally don't care about you using AI.
I care about badly made mods, and people stealing other peoples work, and people lying about the content they put up.
Nothing of which is because of you using AI (Well some small parts of the bad scripts might be it)

lean kernel
#

I asked Grave and TPW for permission to use their work, they didn't refuse, Grave even supported me, since TPW mods are not compatible with multiplayer I asked him if he could make them compatible and it seems that there was no problem with it.

still forum
#

"they didn't refuse" Just like the inactive Age of empires creator in 2014 didn't refuse, because they didn't reply at all?
So you just took his mods and pretended it was yours.

The same "didn't refuse" mh?

lean kernel
#

With Gemini I decided to do Opex again from scratch since I think he passed away but in that case I never asked for donations.

#

I don't even know why I'm explaining myself to you, this feels like harassment.

#

You've made me cry too much, I just don't want to talk to you anymore.

still forum
#

This community doesn't appreciate such stuff.
Maybe find a different one to scam again.

lean kernel
#

I haven't scammed anyone. Instead, you've been harassing me for several hours.

digital jacinth
#

with your last remaster mod. I dove into it to figure out what is in it. it had quite some bold promises. I found several scripts from mods in there translated and renamed using ai. only after I made a comment on that you admitted to some.

The original tpw mod for example asked for credits which were not given. in the current remaster one there is only a small foot note inside a script file and only one

no mention of blastcore Murr or splendid or real engine either.

hence why this reaction.

still forum
lean kernel
atomic niche
#

no need

lean kernel
#

Also in this description I thank all the creators of Opex, including TPW who was not there but I added him.

#

Adding that where I live I can't even accept donations, it seemed to me more than anything a nice formality.

still forum
#

Can't accept donations, but is asking for donations on every mod. Ok.

lean kernel
#

Yes, it seems like a formality to me, really.

#

And I've mentioned the creators of Opex, Gemini, who I believe passed away from what I was told in his clan, and I specifically mentioned TPW in that description and how I was allowed to transform their mods into a system that supports servers and multiplayer.

rustic plover
#

A cousin or something.

lean kernel
#

Yes, that's right, from my husband's brother, but they applied for a loan and I closed the request, I'm very impulsive, since he has liver problems.

#

Literally 4 hours after I posted the description they told me they already had the money xd

#

That's why I proceeded to close the petition.

atomic niche
#

And "donations" aside, the mod description is filled with straight up lies (or AI generated and didn't even bother to check)

*A new lighting system based on Lumen (don’t ask how I did it, my head still hurts).
How you did it? spoiler: you didn't
*DLAA: the vanilla anti-aliasing is awful, so I recreated something similar through scripting.
nope
*Performance script: unloads unseen objects and reloads them when looking back β€” fully optimized to prevent visibility issues.
You mean setting the render distance to basically nothing and calling it a "performance increase"?

lean kernel
#

Lighting responds better to Lumens if

Performance increases if

What's the lie?

#

The line smoothing is much improved compared to DLAA in reshade, it's almost identical. What's the lie?

random crescent
#

Hey I heard you implemented some new anti aliasing. It's really really cool! How did you do that?

#

Very impressive mod. Would love to have it back.

lean kernel
#

Seriously, I don't know why they take it that way.
Am I lying if I say something is green and it looks a bit blue?

The lighting is more dynamic, very similar to Reshade's lumen. The line smoothing is practically identical to DLLA in Reshade. Performance has improved. Why did I lie?

#

I would really like to be told what the lie is if I am exactly reporting what I mentioned.

#

If I said the lines look smoother and they don't then yes, but I really managed to improve the line smoothing.

rustic plover
random crescent
#

I think it looks impressive. Barely any pixelated edges anymore, real smooth

#

I didnt even know that was possible in Arma!

lean kernel
#

And what I promised I delivered, plain and simple.

still forum
#

Chinese is your native language?
But all your mods are in spanish, and you are in Mexico

rustic plover
lean kernel
#

The account belongs to my husband, he's from Mexico. This is the second time I've said this. I translate the mod descriptions into all Steam languages, not just Spanish.

random crescent
#

I just really would love to know how you did the custom AA. What PBO is it in?

still forum
#

oh the discord account too?
Same bank account, same steam account, same discord account, same behavior. But two people! Wow.

lean kernel
#

I can't use these accounts for logical reasons, that's why I use his, so much reasoning.

still forum
#

Ah yes, probably same as you can't ask for donations, yet you do on every mod you "make".

lean kernel
#

I did it, didn't I?

#

Has anyone else achieved that line smoothing, reflections, lens effects?

#

Yes, I used AI to fix formatting and syntax errors, but I don't see anything wrong with that at all.

still forum
#

I would probably find it entertaining to let this continue, but there isn't any sense in wasting time on this (and its offtopic anyway).

This comes up when googling the name
https://www.reddit.com/r/Volound/comments/stva9e/serial_scammer_enkeli_the_man_behind_the_shogun_2/
https://www.reddit.com/r/aoe2/comments/9uhwro/comment/e95fyxr

There is a pattern of behavior here, lying/deception, stealing and asking for money, it goes back 11 years.
And even now while you say it was your husband and not you, you with your mods (on your husbands steam account..) continue the exact same pattern.
Almost as if, besides all the other lies (like proposed features of your mods), you and your husband being different people is also a lie.

Lie to someone else, we're not buying it. Find a different community to scam.

lean kernel
#

You are obsessed with my husband's past.

#

I think you are indeed a stalker.

tulip ridge
#

Simple google search = stalker lmao

rustic plover
tulip ridge
#

They were banned

rich frost
#

And let the cat go free

lime rapids
#

im guessing now isnt a good time to ask if set velocity, dir on each frame is the same in the end result as set velocity transformation?

tulip ridge
#

It's fine to ask

still forum
lime rapids
#

i c thx dedmen

hollow lantern
# little raptor and what kind of centered line are you talking about?

The one I want to create. Picture this: you have the trigger as reference where the line should be. and now center on the trigger, an imaginary line is drawn, going from one side to the other. Meaning my trigger with A 1 / B 100 has a line that is at least 200m long. And in a later usage I want to place objects in the imaginary line which becomes points of coordinate essentially

haughty timber
#

@kind wind Did you still need to see the script I was using for the "giving money to non-players"?

hushed turtle
hollow lantern
hushed turtle
#

Just to get the idea. This spawns quad bikes at azimuth of 0 degrees from player to the distance up to 100 meters with 4 metres spacing.

_direction = 0;
_spacing = 4;
_distance = 100;
_currentDistance = 0;

while { _currentDistance <= _distance } do
{
  "B_G_Quadbike_01_F" createVehicle (player getPos [_currentDistance, _direction]);
  _currentDistance = _currentDistance + _spacing;
};
little raptor
# hollow lantern The one I want to create. Picture this: you have the trigger as reference where ...

this is the vector method that you asked for, but you can also use getPos like above

triggerArea _trig params ["_a", "_b", "_angle"];
private _pos = getPosWorld _trig;
private _dir = [sin _angle, cos _angle, 0];
// spawn objects along the x axis (_x);
for "_dist" from -_a to _a step 5 do // every 5m
{
  private _obj = createVehicle [...];
  private _spawnPos = _pos vectorAdd (_dir vectorMultiply _dist);
  _obj setPosWorld _spawnPos;
};
#

I don't remember if trigger angle is measured CCW from X axis or CW from Y axis (like getDir)
if the latter, switch sin _angle and cos _angle

haughty timber
#

(Wait, how do I post SQF with the colors again?)

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
haughty timber
#

Thanks!

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
rich frost
#

need that bot for the ace discord lol

haughty timber
# kind wind <@160329435545993216> Yep, Still do!
//Every time a "man" entity that isn't on the player's side is created, it gives it a random amount of money
addMissionEventHandler ["EntityCreated", {
    params ["_entity"];
    if ((side _entity != independent) && (_entity isKindOf "CAManBase")) then
    {
        private _randomMoney = floor random [5, 100, 500];
        [_entity, _randomMoney] call grad_moneymenu_fnc_setFunds;
    };
}];

This is the code I use for my mission

#

Keep in mind, this is for GRADMoneyMenu

kind wind
haughty timber
#

Surprisingly I put it in init.sqf instead, specifically an execVM to a file called "everyonesMoney.sqf"

haughty timber
#

No idea if it makes it less efficient or if it's the only way it could work

#

Haven't tested yet

kind wind
#

Fair enough, I'll see if after work(today/tomorrow) I can test this out and see the results

haughty timber
#

I'm so, so sorry it took this long for me to respond btw!

#

I kept forgetting to do it, I have like 100 servers 😭

kind wind
split ruin
#

where is the error ? πŸ€”

this addAction
    [
        "<t color='#80FF80'>Build Hunter MRAP 5000R</t>",
        {
            params ["_target", "_caller", "_actionId", "_arguments"];
            private _sideScore = missionNamespace getVariable "kib_score";
            if (_sideScore < 5000) exitWith { hint "Earn more rating!"};
            private _newSideScore = _sideScore - 5000;
            missionNamespace setVariable ["kib_score", _newSideScore, true];
            _veh = createVehicle ["B_MRAP_01_F", helipad,[], 0,"NONE"];
            _veh enableDynamicSimulation true;
            ["build"] remoteExec ["BIS_fnc_showNotification",0];
        },nil,1.5,true,true,"","true"",3,false,"",""];
#

I simply put it in object init field

faint burrow
#

"true""

split ruin
#

@faint burrow omg, thanks

keen stream
#

I'm thinking of starting an ArmA 3 SQF blog with snippets gathered from here, the slacks and the forums. Something like http://www.kylania.com/ex/, because it would be a waste to leave these useful snippets and nuggets collecting dust.

#

Any pro's and con's I should be aware off? ( Or an existing site that does this? )

thorn tiger
#

Anyone have a script to turn on vehicle beacons?

warm hedge
#

If the vehicle have a scriped animation source to enable the beacon, maybe

thorn tiger
#

Yes, it does.

#

Its a cdlc vehicle after all

warm hedge
#

Which CDLC which vehicle

split ruin
#

I try to use one of default notifications from CfgNotifications but it shows the notifiaction without any text

["IntelAdded"] call BIS_fnc_showNotification;
thorn tiger
warm hedge
thorn tiger
#

Thank you

#

I’ve actually haven’t seen much discussion about this

open marsh
#

hi how do i get Land_TTowerBig_2_F in eden editor?

warm hedge
#

create3DENEntity

proven charm
#

also you can search by name (its transmitter tower)

open marsh
#

thank u so much

open marsh
warm hedge
#

What, what tips?

#

If you're just looking for more props, search through Workshop. I'm not a big Mod user so can't tell if there is any with decent quality

open marsh
#

ok np, i m just lookin for industrial and military props

faint burrow
split ruin
#

@faint burrow yeah, you are right, I defined them in description.ext and they show as they should ...

#
class CfgNotifications
{
    class friendly
    {
        title = "Friendly Reinforcements";
        iconPicture = "\A3\ui_f\data\igui\cfg\simpleTasks\types\radio_ca.paa";
        iconText = "";
        description = "Friendly reinforcements arrived on the battlefield!";
        color[] = {1,1,1,1};
        duration = 5;
        priority = 0;
        difficulty[] = {};
    };
};
faint burrow
tender fossil
#

Aight, since time is running out before a small event and I've been coding too much thanks to an issue discovered at the last moment, my brain refuses to think anymore...
How to find all matching elements (of type 'string') from a nested array when we know only a substring of the element(s) that we want to find? I guess you need BIS_fnc_findAllNestedElements and find at least.
Basically what I'm trying to do here is to find all enemy TFAR radio objects on a respawning player and remove them during respawn, but each of the TFAR radios seems to be individually numbered

faint burrow
#

Provide sample data.

tender fossil
# faint burrow Provide sample data.
_prohibitedItemsWest = ["TFAR_fadak", "TFAR_pnr1000a", "TFAR_mr3000"];
_prohibitedItemsEast = ["TFAR_anprc152", "TFAR_rf7800str", "TFAR_rt1523g"];
``` The actual TFAR radio items ingame are named like this: ``tfar_fadak_1`, `tfar_fadak_2` ... `tfar_pnr1000a_1` ... `tfar_mr3000_6`
faint burrow
#

What are these objects in the game? Magazines?

tender fossil
# faint burrow What are these objects in the game? Magazines?

Not sure to be honest, they fall under "communication" category in the BIS arsenal. Here's an example nested array where the player gear is saved (the radios can be in multiple places in players' gear like in vest or in radio slot etc.):

[[["cup_arifle_mk16_cqc_eglm_woodland",["","","cup_optic_ac11704_od",""],["cup_30rnd_556x45_stanag_mk16_woodland","cup_1rnd_he_m203"]],["cup_launch_m136_loaded",["","","",""],["cup_m136_m"]],["cup_hgun_glock17",["","","",""],["cup_17rnd_9x19_glock17"]]],[["cup_u_crye_g3c_m81_us_v2",["tfar_anprc152_1","cup_30rnd_556x45_stanag","cup_30rnd_556x45_stanag","cup_30rnd_556x45_stanag","cup_30rnd_556x45_stanag"]],["v_i_g_resistanceleader_f",["cup_30rnd_556x45_stanag","cup_30rnd_556x45_stanag","cup_30rnd_556x45_stanag","cup_1rnd_he_m203","cup_1rnd_he_m203","cup_1rnd_he_m203","cup_17rnd_9x19_glock17","cup_17rnd_9x19_glock17","cup_handgrenade_m67","cup_handgrenade_m67"]],["cup_b_usmc_assaultpack",["firstaidkit"]]],["cup_h_cz_helmet09","g_balaclava_oli"],[["cup_nvg_pvs14_hide_wasp",["binocular",""]],["itemmap","","itemcompass","itemwatch"]]]
proven charm
#

maybe something like this (not sure , not very good at this): ```sqf
isProhibited =
{
params ["_item"];

_prohibitedItemsWest = ["TFAR_fadak", "TFAR_pnr1000a", "TFAR_mr3000"];

_idx = _prohibitedItemsWest findIf { _x == (_item select [0, count _x]) };

_idx >= 0
};

_r = "tfar_fadak_2" call isProhibited;
_r2 = "tfar_pnr1000a_1" call isProhibited;
_r3 = "TFAR_mr3000_12345" call isProhibited;

systemchat format ["Result: %1 %2 %3", _r, _r2, _r3];

tender fossil
split ruin
tender fossil
#

Yes, I want to remove them all if there are any of them

proven charm
#
_idx = allitems findIf { _x == _prohbitedItem };
allitems deleteAt _idx;
``` or just allitems  = allitems  - [_prohbitedItem ];
faint burrow
#

@tender fossil, try this:

_uniqueItems = uniqueUnitItems [player, 0];

_prohibitedItems = (keys _uniqueItems) select {
    _item = _x;

    _prohibitedItemsWest findIf { _item find _x >= 0 } >= 0
};

{
    _item = _x;

    _count = _uniqueItems get _item;

    for "_n" from 1 to _count do {
        switch (true) do {
            case (((items player) findIf { _x == _item }) >= 0): {
                player removeItem _item;
            };
            case (((assignedItems player) findIf { _x == _item }) >= 0): {
                player unlinkItem _item;
            };
        };
    };
} forEach _prohibitedItems;
tender fossil
faint burrow
#

Correct.

#

But it's better to remove prohibited items before saving.

tender fossil
faint burrow
#

Yes.

#

And it's not tested.

tender fossil
#

Thanks to both of you @faint burrow and @proven charm! I learned something new today and the system is working now. The original issue was a major annoyance ingame

wicked snow
#

Anyone know what typically causes a GNIAC STACK SIZE VIOLATION?

still forum
#

GNIAC? Is that a typo? GIAR?

#

There were not the correct number of values on the stack, need to see the code where it happened to say why

#

sometimes a function not returning anything

wicked snow
#

Not a typo sadly. It says GNIAC which is the first time I have seen it. I have seen GIAR before. I found out the reason tho. I was a dumb little poo poo and put didn't do ==.

tawdry pond
#

i had something similar, i think it was gvar stack violation??? it was because of syntax errors.

#

I'm looking for base class definition of RscListNbox, does anybody have it?

pallid palm
#

hello all: How do i make west, Hostile, to civilian: ?

tawdry pond
pallid palm
#

ok thx m8

granite sky
gleaming forge
wicked snow
#

@gleaming forge I agree, it sucks that I have to resort to the Wayback Machine to view the threads. They are obviously not going to be up to date.

steel shadow
#
{_x inArea thisTrigger} count allMissionObjects "allDeadMen" > 0

Trying to use this to detect if some dead bodies have been moved out of the trigger area but doesn't seem to work. Could use some help

thin fox
#

also, if you are checking for the bodies to be moved out of the trigger area (i.e: all of them; in this case, returning 0 in the count command), you should put ** < 1 ** or ** == 0**

tulip ridge
tawdry pond
split ruin
#

how to export content from a crate ?

proven charm
#

why? in eden?

split ruin
#

yes, I used this but gives only the backpacks from the crate

player addAction ["export crate", { 
    thread = [] spawn { 
        _containersInCrate = everyContainer crate; 
        _numContainers = count _containersInCrate; 
        _containerArray = []; 
        for "_i" from 0 to (_numContainers -1) do { 
            _containerClass = _containersInCrate select _i select 0; 
            _containerRef = _containersInCrate select _i select 1; 
            _containerItems = itemCargo _containerRef; 
            _containerMagazines = magazineCargo _containerRef; 
            _containerWeapons = weaponCargo _containerRef; 
            _containerArray = _containerArray + [ [_containerClass, _containerItems, _containerMagazines, _containerWeapons] ]; 
        }; 
        hintSilent str _containerArray; 
        copyToClipboard str _containerArray; 
        cArray = _containerArray; 
    }; 
}];

result is

[["B_Mortar_01_weapon_F",[],[],[]],
["B_UAV_01_backpack_F",[],[],[]],
["B_UAV_01_backpack_F",[],[],[]],
["B_UAV_01_backpack_F",[],[],[]],
["B_UAV_01_backpack_F",[],[],[]],
["B_UAV_01_backpack_F",[],[],[]],
["B_RadioBag_01_mtp_F",[],[],[]],
["B_RadioBag_01_mtp_F",[],[],[]],
["B_RadioBag_01_mtp_F",[],[],[]],
["B_RadioBag_01_mtp_F",[],[],[]],
["B_RadioBag_01_mtp_F",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]],
["B_Kitbag_desert_lxWS",[],[],[]]]
proven charm
#

so what do you want to achieve? in eden you can directly edit the crate contents

split ruin
#

I fill a crate in eden with equipment and I want to export the classnames of the items inside so I can make a script to spawn the same crate.

proven charm
#

ic

#

idk about eden but there's also getWeaponCargo , getItemCargo etc commands

#

so you can pick the format you like

split ruin
#

yes, I found them too πŸ™‚ i will try to use them on the container.

#

ok, this is it

_items = getItemCargo crate;
_backpacks = everyContainer crate;
_weapons = getWeaponCargo crate;
_magazines = getMagazineCargo crate;
copyToClipboard str (_items+_backpacks+_weapons+_magazines);

crate is obviously the crate name I gave in eden

proven charm
#

i think you should use getBackpackCargo over everyContainer so that the format is same

split ruin
#

@proven charm yes, everyContainer gives model names (?) alongside classnames leading to giant flustercluck

proven charm
#

i mean you can use commands of the same command family to be able to process the output better

tropic nimbus
#

question for those who know how respawn tickets work
What side does the orange one represent? i know blue is blufor. red opfor, green indy, purple civ
But orange ive never seen before

proven charm
#

where's that screenshot taken from? thonk

hallow mortar
faint burrow
# split ruin how to export content from a crate ?

Adapt this script:

private ["_getBaseBackpack", "_getBaseWeapon", "_moveContainerItems", "_nearestObjects"];

params ["_area", "_destinationContainer"];

_getBaseBackpack = BIS_fnc_basicBackpack;
_getBaseWeapon = BIS_fnc_baseWeapon;
_moveContainerItems = {
    params ["_containerClassName", "_container"];

    private _items = getItemCargo _container;

    {
        _destinationContainer addWeaponWithAttachmentsCargoGlobal [
            [(_x select 0) call _getBaseWeapon] + (_x select [1]),
            1
        ];
    } forEach (weaponsItemsCargo _container);

    {
        _destinationContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1];
    } forEach (magazinesAmmoCargo _container);

    {
        _destinationContainer addItemCargoGlobal [_x, (_items select 1) select _forEachIndex];
    } forEach (_items select 0);

    {
        _x call _moveContainerItems;
    } forEach (everyContainer _container);

    if (_containerClassName isKindOf "Bag_Base") then {
        _destinationContainer addBackpackCargoGlobal [_containerClassName call _getBaseBackpack, 1];
    } else {
        _destinationContainer addItemCargoGlobal [_containerClassName, 1];
    };

    clearWeaponCargoGlobal _container;
    clearMagazineCargoGlobal _container;
    clearItemCargoGlobal _container;
    clearBackpackCargoGlobal _container;
};

if (!(_area isEqualType [])) then {
    _area = _area call BIS_fnc_getArea;
};

_nearestObjects = (nearestObjects [
    _area select 0, // position
    ["WeaponHolder", "WeaponHolderSimulated"],
    if (_area select 4) then { // isRectangle
        sqrt ((_area select 1) ^ 2 + (_area select 2) ^ 2)
    } else { selectMax (_area select [1, 2]) }
]) select { (_x != _destinationContainer) and { _x inArea _area } };

{
    [typeOf _x, _x] call _moveContainerItems;
} forEach _nearestObjects;
graceful kelp
#

In a network enviroment BIS_fnc_fire is having a noticable delay of around 1/3 second
may be related to using it on the gunner seat of vehicle
but is there a different command that isint sent over the network to fire the weapon

past pollen
# split ruin I fill a crate in eden with equipment and I want to export the classnames of the...

Another option for you @split ruin
I use this to copy contents of ammo crate in editor and change the SupportProvider_Virtual_Drop_BIS_SUPP_crateInit.
You can use for other purposes.
In your crate placed in the editor give it a Variable name, for instance MyCrateToCopy.
In the init of MyCrateToCopy place the following:

fnc_get3DENLoadout = { 
    params[ "_veh" ]; 
 
    _virtualCargo = [ 
        [ _veh call BIS_fnc_getVirtualWeaponCargo, [] ], 
        [ _veh call BIS_fnc_getVirtualMagazineCargo, [] ], 
        [ _veh call BIS_fnc_getVirtualItemCargo, [] ], 
        [ _veh call BIS_fnc_getVirtualBackpackCargo, [] ] 
    ]; 
 
    if ( _virtualCargo findIf{ count ( _x select 0 ) > 0 } > -1 ) then { 
        _veh setVariable [ "loadout", [ _virtualCargo, true ] ]; 
    }else{ 
        _veh setVariable[ "loadout", 
            [ 
                [ 
                    getWeaponCargo _veh, 
                    getMagazineCargo _veh, 
                    getItemCargo _veh, 
                    getBackpackCargo _veh 
                ], 
                false 
            ] 
        ]; 
    }; 
}; 
 
this call fnc_get3DENLoadout;

This is used with BIS_fnc_initAmmobox. So you can either fill another crate in editor via:

crate init: [ this, MyCrateToCopy getvariable "loadout" ] call BIS_fnc_initAmmobox; //changed from _this to this - virtual supply drop  is _this in crate init

or simply to have contents for script

copyToClipboard str (MyCrateToCopy getvariable "loadout");

Again, the format should be used with BIS_fnc_initAmmobox. This is code I have in a mission and was originally posted by Larrow on the BI forums. Works great for changing the supply drop.

molten tree
#

Hey all; I'm trying to make a convoy script; it's working well, but right now I'm trying to code in redundancy in the event the vehicle or driver is knocked out. In short, how it SHOULD work is that if it detects that a vehicle in a group dies, the vehicle behind it will start following the vehicle in front of it.

If I trigger the script manually (ie. I hand off the ownership of the variable from one vehicle to the other), it works fine, so I know the issue is specifically that it can't seem to detect when the driver is dead; when I delete the infantry from existence, it seems to work.

Is there any way to make it work reliably? Thanks!

For example:
if (!alive HEMTTFOLLOW4VAR) then { HEMTTFOLLOW5VAR = HEMTTFOLLOW4VAR;};

In theory, since HEMTTFOLLOW5VAR is now the same vehicle as HEMTTFOLLOW4VAR, the rest of the convoy won't be affected, but the one taking the place of the fallen vehicle will start following the one in front.

round hazel
#

Hey, i've got a missing ; somewhere here, can anyone spot it?

while {currentTime < waitTime} do
{
    call _spawnWave;
    _waitTime = random 40;
    currentTime = currentTime + _waitTime;
    sleep _waitTime;
};
sturdy sage
round hazel
#

Nope, two different variables (bad practice, i know)

#
["<t size='2.5' color='#ffffff' font='PuristaMedium' >The Horde Approaches!</t>",0,0.2,3,1] spawn bis_fnc_dynamictext;
currentTime = 0;
waitTime = 120;


_spawnWave =
{
    groupSize = [4, 10] call BIS_fnc_randomInt;
    currentGroupSize = 0;
    _grp = createGroup East;
    posToSpawn = Guards2 getPos [200, random 360];
    while {currentGroupSize < groupSize} do
    {
        _newUnit = _grp createUnit ["Zombie_O_Walker_Civ", posToSpawn, [], 10, "NONE"];
    };
    _grp setBehaviour "COMBAT";
    _wp = _grp addWaypoint [getPosASL Guards2, -1];
    _wp setWaypointType "SAD";
}

while {currentTime < waitTime} do
{
    call _spawnWave;
    _waitTime = random 40;
    currentTime = currentTime + _waitTime;
    sleep _waitTime;
};
["<t size='2.5' color='#ffffff' font='PuristaMedium' >You have survived for now!</t>",0,0.2,3,1] spawn bis_fnc_dynamictext;
#

Full code

#

Error says 'Missing ; line 21', which is the line starting "while {currentTime < waitTime} do"

sturdy sage
#

Yeah missing ; before it

#

The } that is closing the _spawnWave function

round hazel
#

AHHHHHH

#

Thank you!

sturdy sage
molten tree
#

The convoy system itself works fine... until you lose a vehicle in the convoy. sweat_smile The handoff system works, but I can't get it to see that the driver is dead.

sturdy sage
#

Don't really have context about how you are doing things.

If you have a loop running, you can just check if

canMove ...

I think that one returns false if driver is dead as well as other reasons a vehicle can't move. (not 100% sure about the driver part, otherwise just do alive driver ... )

If you don't have a loop and want it to be event driven you can add killed eventhandlers to vehicle + driver.

molten tree
sturdy sage
#

Is this the answer you are looking for?:

if (!alive HEMTTFOLLOW4VAR || !alive driver HEMTTFOLLOW4VAR ) then { HEMTTFOLLOW5VAR = HEMTTFOLLOW4VAR;};

Otherwise need more context. Show your code

molten tree
# sturdy sage Is this the answer you are looking for?: ```sqf if (!alive HEMTTFOLLOW4VAR || !a...

Here's the variable declarations; HEMTTFOLLOW#D is tied to the driver. Therefore, even if the vehicle is alive, it checks to see if the driver itself is alive:

HEMTTFOLLOWER1VAR = HEMTTFOLLOW1GRP;
HEMTTFOLLOW2VAR = HEMTTFOLLOW2D;
HEMTTFOLLOWER2VAR = HEMTTFOLLOW2GRP;
HEMTTFOLLOW3VAR = HEMTTFOLLOW3D;
HEMTTFOLLOWER3VAR = HEMTTFOLLOW3GRP;
HEMTTFOLLOW4VAR = HEMTTFOLLOW4D;
HEMTTFOLLOWER4VAR = HEMTTFOLLOW4GRP;
HEMTTFOLLOW5VAR = HEMTTFOLLOW5D;
HEMTTFOLLOWER5VAR = HEMTTFOLLOW5GRP;
HEMTTFOLLOW6VAR = HEMTTFOLLOW6D;
HEMTTFOLLOWER6VAR = HEMTTFOLLOW6GRP;
HEMTTFOLLOW7VAR = HEMTTFOLLOW7D;
HEMTTFOLLOWER7VAR = HEMTTFOLLOW7GRP;
HEMTTFOLLOW8VAR = HEMTTFOLLOW8D;
HEMTTFOLLOWER8VAR = HEMTTFOLLOW8GRP;
HEMTTFOLLOW9VAR = HEMTTFOLLOW9D;
HEMTTFOLLOWER9VAR = HEMTTFOLLOW9GRP;
HEMTTFOLLOW10VAR = HEMTTFOLLOW10D;
HEMTTFOLLOWER10VAR = HEMTTFOLLOW10GRP;
HEMTTFOLLOW11VAR = HEMTTFOLLOW11D;
HEMTTFOLLOWER11VAR = HEMTTFOLLOW11GRP;
HEMTTFOLLOW12VAR = HEMTTFOLLOW12D;
HEMTTFOLLOWER12VAR = HEMTTFOLLOW12GRP;```

Here's the working convoy code; it runs off a looping trigger:

```((waypoints HEMTTFOLLOWER1VAR) select 1) setWaypointPosition [HEMTTFOLLOW1VAR modelwoWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER2VAR) select 1) setWaypointPosition [HEMTTFOLLOW1VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER3VAR) select 1) setWaypointPosition [HEMTTFOLLOW2VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER4VAR) select 1) setWaypointPosition [HEMTTFOLLOW3VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER5VAR) select 1) setWaypointPosition [HEMTTFOLLOW4VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER6VAR) select 1) setWaypointPosition [HEMTTFOLLOW5VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER7VAR) select 1) setWaypointPosition [HEMTTFOLLOW6VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER8VAR) select 1) setWaypointPosition [HEMTTFOLLOW7VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER9VAR) select 1) setWaypointPosition [HEMTTFOLLOW8VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER10VAR) select 1) setWaypointPosition [HEMTTFOLLOW9VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER11VAR) select 1) setWaypointPosition [HEMTTFOLLOW10VAR modelToWorld [0,-15,22], -1];
((waypoints HEMTTFOLLOWER12VAR) select 1) setWaypointPosition [HEMTTFOLLOW11VAR modelToWorld [0,-15,22], -1];```

Here's the non-functioning alive script; I'll note that the drivers are set to NOT bail out, to prevent them from trying to bail to engage:

```if (!alive HEMTTFOLLOW1VAR || side HEMTTFOLLOW1VAR == civilian) then { HEMTTFOLLOW2VAR = HEMTTFOLLOW1VAR;};
if (!alive HEMTTFOLLOW2VAR || side HEMTTFOLLOW2VAR == civilian) then { HEMTTFOLLOW3VAR = HEMTTFOLLOW2VAR;};
if (!alive HEMTTFOLLOW3VAR || side HEMTTFOLLOW3VAR == civilian) then { HEMTTFOLLOW4VAR = HEMTTFOLLOW3VAR;};
if (!alive HEMTTFOLLOW4VAR || side HEMTTFOLLOW4VAR == civilian) then { HEMTTFOLLOW5VAR = HEMTTFOLLOW4VAR;};
if (!alive HEMTTFOLLOW5VAR || side HEMTTFOLLOW5VAR == civilian) then { HEMTTFOLLOW6VAR = HEMTTFOLLOW5VAR;};
if (!alive HEMTTFOLLOW6VAR || side HEMTTFOLLOW6VAR == civilian) then { HEMTTFOLLOW7VAR = HEMTTFOLLOW6VAR;};
if (!alive HEMTTFOLLOW7VAR || side HEMTTFOLLOW7VAR == civilian) then { HEMTTFOLLOW8VAR = HEMTTFOLLOW7VAR;};
if (!alive HEMTTFOLLOW8VAR || side HEMTTFOLLOW8VAR == civilian) then { HEMTTFOLLOW9VAR = HEMTTFOLLOW8VAR;};
if (!alive HEMTTFOLLOW9VAR || side HEMTTFOLLOW9VAR == civilian) then { HEMTTFOLLOW10VAR = HEMTTFOLLOW9VAR;};
if (!alive HEMTTFOLLOW10VAR || side HEMTTFOLLOW10VAR == civilian) then { HEMTTFOLLOW11VAR = HEMTTFOLLOW10VAR;};
if (!alive HEMTTFOLLOW11VAR || side HEMTTFOLLOW11VAR == civilian) then { HEMTTFOLLOW12VAR = HEMTTFOLLOW11VAR;};```

If I manually trigger `HEMTTFOLLOW2VAR = HEMTTFOLLOW1VAR;`, skipping the IF part of the statement, it works, so it's definitely an issue with the condition.
#

In my most recent test, I had the leader drive from the east side of Malden to the NW side of Malden. All 12 trucks navigated there without issue.

sturdy sage
#

Uuhh... lets just say this not how i would have done it. There are many possible problem sources here due to all those global variables.

Judging by the variable names you already assign the driver to that "HEMTTFOLLOW1VAR " variable so my suggestion didn't really change anything
Why the side HEMTTFOLLOW4VAR == civilian?

molten tree
sturdy sage
#

The !alive should work fine on the driver. Assuming that is what is actually stored in that variable.

molten tree
#

@sturdy sage Do you have any suggestions on cleaning up the code? I'd love a more scalable version of this script that doesn't require me to manually add a public variable for each instance, and simply using private ones instead.

#

Making a separate SQF, for example.

#

Heck, doing something like an array so I could add a vehicle via an initiation script, so each vehicle can be added by Zeus, instead of being hardcoded at mission start.

granite sky
graceful kelp
#

Im working on multicrew weapons for our mod and needed to be able to fire the weapons from either seat in the helicopter regardless of if the other seat had a player, ai or noone

#

got it sorted

queen cargo
#

um ... why doing it yourself?

#

write a bot

#

which gets all stuff that is posted in

code
blocks```
molten tree
#

If anyone sees my messages above, I'm still seeking advice on it. πŸ™‚

molten tree
#

Fair. But I'd like to see if it's possible to keep the formation if they deal with the threat, or intentionally have them not disembark. Is there a way to make it automatically do a handoff?

lean raven
#

Hi everyone, in Splendid Camera mode, there is a focus parameter. Is it possible to adjust it during the game and if so, with what command?

lean raven
cosmic lichen
#

You need to apply it to the players camera.

lean raven
#

Hmm...

lean raven
warm hedge
#

Should be yes. Not sure a player camera can use such commands. At least I've never seen. What do you want to achieve?

lean raven
warm hedge
#

You can use DOF postprocess in the last update

warm hedge
lean raven
#

Yes... but they can't blur only the near background?

#

Hmm....

#

Wow.. yeah... I didn't think to use the minus...
Thanks a lot.

lean raven
warm hedge
#

DOF somehow cannot

lean raven
#

But even in this form it looks good))

still forum
still forum
# warm hedge DOF somehow cannot

Can any other PP effect have multiple?
If yes then thats just a bug in the DOF implementation, but I need some repro to get two of some other effect, to see why they work and DOF doesn't

warm hedge
#

ColorCorrections can, at least

hallow mortar
warm hedge
#
0 spawn {
    _ary = [] ;
    for "_i" from 0 to 5 do {
        _hnd = ppEffectCreate ["Resolution", 5555+_i];
        _hnd ppEffectAdjust [random 500];
        _hnd ppEffectEnable true ;
        _hnd ppEffectCommit 0 ;
        _ary pushBack _hnd ;
        uiSleep 0.5 ;
    } ;
    _ary apply {ppEffectDestroy _x} ;
} ;```Repro, same concept with other pps
west grove
#

is sunOrMoon the only way to detect if it's dark or not? seems to be a bit unreliable, since there can be a phase where it's dark, but return value is still 1

#

for example stratis at 03:57

warm hedge
#

getLighting etc is reliable

west grove
#

hm. doesnt that detect light on the spot you are at?

#

or should i just check if stars are there

tepid vigil
tepid vigil
west grove
#

ok, from my tests it looks like checking stars is working

lean raven
warm hedge
#

I do not say anything about the future

lean raven
next gust
#

hi πŸ™‚
we usually do some _finalBoss setSkill ["reloadSpeed", 0.8]; stuff in our initServer.sqf to tweak the skill of the AI units in our mission. Like this

{
    if (side _x != west) then {
        _x setBehaviour "SAFE";
        _x setCombatMode "YELLOW";
        _x setSpeedMode "NORMAL";

        _x setSkill ["general", 0.75];
        _x setSkill ["commanding", 0.75];
        _x setSkill ["courage", 0.75];
        _x setSkill ["aimingAccuracy", 0.65];
        _x setSkill ["aimingShake", 0.65];
        _x setSkill ["aimingSpeed", 0.65];
        _x setSkill ["reloadSpeed", 0.75];
        _x setSkill ["spotDistance", 0.85];
        _x setSkill ["spotTime", 0.85];
        _x enableAI "COVER";
        _x enableAI "AUTOCOMBAT";
    };
} forEach allUnits;

but I assume this only works for AI that is present during mission start. How can is set this for an AI that is spawned (zeus or via script) mid mission?

hallow mortar
next gust
#

will give that a try, thanks for idea

hallow mortar
next gust
#

its working, where would be the best place to add the EH, init.sqf?

hallow mortar
#

I would say yes, that will cover both Zeus and the server, which are the two places AI are typically local to

next gust
#

are units that are placed in editor also triggering this? then we could leave it out of the initserver.sqf completely

hallow mortar
next gust
#

gotcha. Thanks again

sharp grotto
granite sky
#

I would assume that getLighting works?

#

Although it seems a little incomplete...

edgy dune
granite sky
#

postInit apparently

#

Not exactly a fan of this do-stuff-slightly-later-and-hope timing logic but good luck figuring out what's going on behind the scenes there.

edgy dune
#

but ill put in postinit anyways

granite sky
#

Almost everyone uses postInit for textures, IIRC. Some vanilla vehicles were using init but they fixed that recently.

still forum
# warm hedge ```sqf 0 spawn { _ary = [] ; for "_i" from 0 to 5 do { _hnd = pp...

Mh when testing that, I can create multiple DepthOfField's, and they are all rendering together.
The problem is that the second DOF, overwrites the blurred area of the previous one with non-blurred area.

The DOF writes the whole screen, and for every pixel decides whether to grab from the unblurred or the pre-calculated blurred image.

In the second run, the unblurred is the original unblurred image, not the result from the previous DOF run.

That's a bit annoying to solve, but I can try..

still forum
#

For some reason, my depth of field blur is just purely black.
Even in 2.20 release, must be something wrong with my setup here.

But I got it to work
#dev_rc_branch message
this example adds close blur and far blur

Would just be nice to see if it works if the blur itself also works πŸ˜„

little raptor
#

Don't use mods. Try vanilla hmmyes

warm hedge
#

Huh

#

You did it again?

little raptor
#

me?

warm hedge
#

Ja

little raptor
#

oh you mean the green thing. yes πŸ˜…

ornate whale
ornate whale
# molten tree Fair. But I'd like to see if it's possible to keep the formation if they deal wi...

Could you explain what your current problem is. It seems to work decently in the video. πŸ‘ The major problem I find on this system is that the leading vehicle could unintentionally get off the road (or plethora of other undesired things could happen), and the other vehicles would stupidly follow or get stuck. And also the error of one vehicle will be amplified and passed on to the following vehicles. If one makes an error, the second one makes a bigger and so on.

If you want them to stay in formation, try this: https://community.bistudio.com/wiki/forceFollowRoad and this: https://community.bistudio.com/wiki/setUnloadInCombat . And set each of the vehicles (groups) to the CARELESS mode. They will ignore enemies and use the roads.

astral geode
verbal plume
#

hey, where can i get help to hemtt and vsc?
i have vsc with hemtt installed and to update the errors (from hemtt) i need to restart vsc. kinda weird? is that normal?

tulip ridge
#

Issue is likely because vs code is reading your files as c++, not Arma config (you can set the language in the bottom right)

verbal plume
open hollow
tender sable
# still forum πŸ‘‹ I'd like some feedback on this: https://community.bistudio.com/wiki/Script_H...

I haven't tested in-game but I went back to some stuff I have where I do async stuff unscheduled and scheduled manually just to see if it saves me some code. I can see the usefulness. Can you just answer that continueWith code block is in same scope as calling scope? I am assuming so. I would test myself but changing branch right now would be a pain for me. E.g. ```sqf
params ["_unit"];

private _handle = _unit spawn someScript;

private _result = _handle continueWith {_unit setVariable ["Something", true]; true;}; // _unit is valid here I assume?

#

possible improvement: maybe waitUntil could spawn automatically the script and handle with sqf _args waitUntil { code block} if for some reason you dont need the handle?

#

ack, wait no too confusing with first syntax... maybe sqf _args waitUntil [{code block}, _timeout]

#
_args waitUntil [{code block}]
molten tree
rich frost
#

Problem Respawn:

I have a missionfile and have desc.ext set as respawn = 3; we had a respawn_west marker before but we deleted it.

It is my understanding, that without the respawn marker, players respawn on their individual starting position but that is not the case.

players are respawning at the site of their death.

Any advice what i might be missing?

fair drum
pallid palm
#

@rich frost put the "respawn_west" marker back in the mission

#

respawn = 3; means on custom pos witch is the respawn_west marker

#

you can have as many respawn_west markers as you want, respawn_west respawn_west_1 respawn_west_2 and it would be random pos then

#

ofcorse this is the old school way of doing it, and its the way i do it

hallow mortar
fair drum
#

if you guys consistently get the same answer, i'll edit the wiki page

cosmic lichen
#

I think it is instant. I don't remember being respawn on the original position at the start of the scenario

edgy dune
#

can CfgNonAIVehicles support eventhandlers like init? I want to have it where when a certain wreck spawns another wreck spawns next to it

rich frost
proven charm
#

what's the fastest way to get nearby enemies, anyone happen to know?

still forum
still forum
hushed tendon
#

If using unitcapture would it be better to execute it on the server and have the server send the objects position to players or run it locally for each player at the same time?

cosmic lichen
#

You run it where the unit is local.

pine wing
#

is there a way to create my own airport that ai work at without GM?

proven charm
ornate whale
dire island
#

I feel like I'm missing something really obvious here:
I am trying to pass a variable into an event handler, like so:

_vic addEventHandler ["HandleDamage", 
  {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_layer"];
    if (_damage > 0.2) then {
      systemChat format ["(inside EH) _layer = %1 (type: %2)", _layer, typeName _layer];
      [[_layer, 6], "scripts\world\raiseTargetAmountOfTimes.sqf"] remoteExec ["execVM", 2];
    };
  }
];```
the systemChat returns that _layer is a string outside of the event handler (expected behaviour), but that it is <NULL-object> inside the event handler.
faint burrow
#

Sure, EH's scope is different. Use, for example, a global var.

stable dune
#

You need to pass your layer via setVariable on unit or like schatten said use global var

dire island
#

setVariable worked, thanks!

cyan dust
#

Good day. I have a logic that 'punishes' (in-game currency fine to put it simply) player for leaving the mission outside the base and in most cases it works fine. However, some players are disconnected because of network issues or battleye restart required or other stuff outside of their control. So the question is, can we determine the disconnect reason?
What I use currently: addMissionEventHandler ["HandleDisconnect",{ - can we get anything useful from here?
What I just found in wiki: addMissionEventHandler ["OnUserKicked", { - should I use that instead? Is that reliable? Covers simple disconnect? Or better mix in both?
Thank you.

still forum
#

HandleDisconnect is a bit meh.
The place its fired from is a bit funky. Also it also fires when the client did NOT disconnect? I don't understand that, it looks very messy.

OnUserKicked has the kick reason in it in the parameters

carmine belfry
hallow mortar
#

Global exec means every machine is running their own copy of the code. This could conflict. I'd suggest using Target exec instead.
If you're using a ZEN object code field, you can use _this to refer to the object the code field is attached to. That's cleaner than creating a global variable radar.

carmine belfry
hallow mortar
#

You might also need to target the radar's crew specifically. I dunno if lookAt is smart enough to go "oh, you mean the crew of this vehicle" if you pass it a vehicle. Try gunner _this lookAt...

carmine belfry
#

on target exec

hallow mortar
#

If it doesn't work you could try doWatch or lockCameraTo instead

carmine belfry
#

instead of lookAt ?

#

i tried
while {true} do { { _this lockCameraTo (_this getRelPos [100, _x]); sleep 2.45; } forEach [120, 240, 0]; };

and

while {true} do { { _this doWatch (_this getRelPos [100, _x]); sleep 2.45; } forEach [120, 240, 0]; };

on the crew of the radar and it didnt spin, what does getRelPos do? maybe that has to do something with it

hallow mortar
carmine belfry
fair drum
#

Depends on what _this returns. If you select the crew, it could be the group. If radar, could be the radar object. That matters.

carmine belfry
#

how can i check what _this returns ?

#

i mean the type

hallow mortar
#

str typeOf _this and if it errors it's a group :U
But you should be able to deduce it by checking what you're clicking on. If you double-clicked on the group header in the left list, or the diamond marker in the world, it's the crew group. If you double-clicked on the individual crew unit in the list, it's that object. If you double-clicked on the vehicle object, it's that object.

errant iron
#

if you double clicked on the radar itself, _this should be the radar object, while if you double clicked the AI on the left tab or the gunner icon, you'd have selected the AI unit

hallow mortar
#

Also the title bar of the attributes window tells you what you're editing

carmine belfry
#

yeah so i was selecting the ai or the radar when trying to edit them

#

i mean i was selecting what i was trying to

carmine belfry
#

is [cursorObject] remoteExec str typeOf _this valid?

errant iron
#

did a quick test in editor, both _vehicle doWatch _pos and _vehicle lockCameraTo [_pos, [0], false] will slew the radar correctly

hallow mortar
#

Well, systemChat str typeOf _this. But I'm pretty sure this isn't the problem. If you're selecting the correct thing then that shouldn't be an issue.

carmine belfry
hallow mortar
#

I can't remember if ZEN object code fields are scheduled or not

errant iron
#

oh yeah, you're trying to sleep in the execute box

#

you'd need to spawn it as well

hallow mortar
#
_this spawn {
  // ...everything you already had...
};```
hallow mortar
errant iron
carmine belfry
#

1 sec

errant iron
#

i mean it shouldn't break anything as is, just something to keep in mind

hallow mortar
#

Easy fix: while {alive _this} ...

carmine belfry
#

_this spawn { while {true} do { { _this doWatch (_this getRelPos [100, _x]); sleep 2.45; } forEach [120, 240, 0]; }; };
works ty everyone

#

and i can put it on either the crew or the radar doesnt matter

#

which is nice

#

only problem now is that they sometimes lock up / turn the other way and stay watching a direction too long but that can probably be fixed by lowering or raising the sleep timer

hallow mortar
#

For posting large blocks of code in Discord, you can enclose them in a full block format, which is easier to read.

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
carmine belfry
#
_this spawn {
   while {alive _this} do {   
 {   
  _this doWatch (_this getRelPos [100, _x]);   
  sleep 2.45;   
 } forEach [120, 240, 0];   
};
}; 

turret rotate script

hallow mortar
#

And here's that with fixed indentation :U

_this spawn {
  while {alive _this} do {
    {
      _this doWatch (_this getRelPos [100, _x]);
      sleep 2.45;
    } forEach [120, 240, 0];
  };
};```
rich frost
granite sky
proven charm
errant iron
proven charm
#

good point

granite sky
#

With the extra group that might be a bit long for simpleVM

#

In which case you'd want to split it into two selects if you care about performance.

proven charm
granite sky
#

It is.

proven charm
#

nice

#

so this is faster? ```sqf
private _e = (_center nearEntities [["CAManBase","LandVehicle"], _dist]);

_e = _e select { (side group _x) != _friendlySide && (side group _x) != civilian };

cosmic lichen
#

Use diag_testscriptsimplevm to test it

proven charm
errant iron
#

seems like && is a blacklisted command for simpleVM, or rather boolean && boolean is:

diag_testScriptSimpleVM {true && true};
"IncompatibleInstruction: build error:inlineable condition cmd with incompatible argument, at '&& (side group _'"```
#

i would simplify it to !(side group _x in [_friendlySide, civilian]), that should meet the simplevm requirements

granite sky
#

No, like this:

private _e = _center nearEntities [["CAManBase","LandVehicle"], _dist] select { side group _x != _friendlySide } select { side group _x != civilian };
proven charm
#

aah ok thx

granite sky
#

you could try the in+array version but it's likely slower.

#

maybe close if you pre-declare the array.

proven charm
#

I need to test this stuff sometime, thx all

errant iron
# granite sky you could try the in+array version but it's likely slower.

got these measurements on 936 units: ```sqf
0.3813 ms => allUnits select {side group _x != blufor && {side group _x != civilian}}
0.4113 ms => allUnits select {side group _x != blufor} select {side group _x != civilian}
0.3791 ms => allUnits select {!(side group _x in [blufor, civilian])}
0.3222 ms => allUnits select {!(side group _x in sides)}

0.2832 ms => allUnits apply {side group _x}
0.2706 ms => allUnits apply {side _x}
0.0975 ms => allUnits```

granite sky
#

hmm, guess the first one is within simpleVM limits then.

errant iron
#

Speaking of optimization, but is there a fast method to gather all known enemy positions from a given side and group them into areas? Right now, I basically iterate through _grp targets [true] across all desired groups (opfor + independent), apply targetKnowledge to get a known position of each target, then aggregate them with inAreaArray testing. My previous implementation used to take ~3.81ms, but I've since got it down to ~1.02ms. It only runs once every minute, but I feel like it could be further improved.

Source: https://github.com/Warriors-Haven-Gaming/WHFramework/blob/2025.7.16/WHFramework.Altis/Functions/Units/fn_aircraftLoop.sqf#L110-L234
Measurements by function: sqf _getKnownTargets: 0.5ms _getKnownTargetPositions: 0.1ms _aggregateTargetPositions: 0.28ms _generateTargetAreas: 0.08ms _appendTargetAreaPriorities: 0.06ms

lean raven
pallid palm
#

looks like Greek to me, he he πŸ™‚

#

but i understand Greek woohoo lol

#

i know im not funny lol

tough abyss
#

Challenge:
What is the global variable B in this code?

B isEqualTo B
-> false
granite sky
#

Common case there would be that several groups have full knowledge of the same targets. I'm not sure what the 0:0 case is for so the ordering might be suboptimal.

errant iron
#

netId is my mostly unique identifier for objects but it has the caveat that non-network objects share the same 0:0 netId, so checking that is just an edge case

granite sky
#

I'm not sure if there are ever non-network enemies.

#

If it's a rare case then put it on the end anyway.

errant iron
#

ive had targets [true] return vehicles identified as sideUnknown/civilian, but yeah maybe that's worth ignoring

granite sky
#

actually if it's rare, just delete 0:0 afterwards. That'll be cheaper than checking for it.

errant iron
#

lemme benchmark it in a bit

granite sky
#

generateTargetAreas can be done quite a bit better but that one's cheap-ish anyway.

errant iron
#

currently testing with 105 OPFOR groups (821 units), 41 of which know of any targets, and end result being 6 blufor targets returned: ```sqf
private _targets =
_group targets [true, 3000, [], 600]
select {leader _group knowsAbout _x >= 2.5};

{_targetGroups set [netId _x, [_x, _group]]} forEach _targets;
_targetGroups deleteAt "0:0"; // outside _groups loop```
original was 0.4001ms, above was 0.4802ms

#

goes down to 0.3201ms if i remove the hashmap assignments, so it spends about 0.16ms on that

#

maybe creating a bunch of key-value pairs for createHashMapFromArray would be faster?

granite sky
#

You'd definitely want the netId filtering first if it's 41 groups with knowledge of 6 units.

errant iron
#

rewrote it to this now: ```sqf
private _groupTargets =
_groups
apply {[_x, _x targets [true, 3000, [], 600]]}
select {count (_x # 1) > 0};

private _targetGroups = createHashMap;
{
_x params ["_group", "_targets"];
{_targetGroups set [netId _x, [_x, _group]]} forEach _targets;
} forEach _groupTargets;

private _targetGroups = _keys createHashMapFromArray _values;
_targetGroups deleteAt "0:0";```
without that select {count (_x # 1) > 0} the time was 0.3645ms, but just adding that line brought it down to 0.2655ms

#

and getOrDefault [... true] measures almost the exact same as set, only off by a few microseconds

#

although the _groupTargets part only measures at 0.0804ms, so the hashmap stuff must be taking up the remaining 0.18ms

#

i guess at this point my best savings would come from simplifying the algorithm itself, since this hashmap stuff is just to associate each target with a group that knows their approximate position

granite sky
#

Well, you removed the knowsAbout condition there.

#

I assume the code is a halfway version because _keys and _values don't exist.

errant iron
granite sky
#

Point of adding the netId pre-check is basically to cut down on knowsAbout condition checks :P

errant iron
#

i thought a bit more about that, the only case i can think of 0:0 happening naturally (outside of mods) is if it were a player-hosted server and some enemy CAS or drone flew over MOB while the host was previewing a vehicle from my spawner

#

or if a zeus spawned in a bunch of enemies at MOB and then previewed the spawner

granite sky
#

No, I mean the select {!(netId _x in _targetGroups)} part.

errant iron
#

o, well _targetGroups is a fresh hashmap so there wouldn't be any elements to begin with

granite sky
#

I don't think the rejig there does anything for you.

errant iron
#

oh wait, knowsAbout can take a side? that might solve having to iterate over all group targets if i can just query their knowledge from the side itself

granite sky
#

hmm

#

I assumed that was some separate knowledge logic. But maybe.

#

Doesn't seem to be accessible anywhere else so maybe it's just finding the max value over all groups.

frigid spade
#

is there a pathfinding function or something similar?

#

trying to script a way to see if a randomly spawned AI can reach a randomly selected point

#

calculatePath looks like a viable option but idk

errant iron
#

the wiki for that has a couple examples suggesting more reliable methods, but i haven't done pathing stuff either

granite sky
#

Not really, no. Sometimes they'll calculate a path and fail to follow it. Sometimes they'll fail to calculate a path. Sometimes they'll just fuck up the Z values.

#

The Arma pathfinding logic doesn't really know what it's capable of.

#

Of course it's even worse with vehicles :P

frigid spade
#

hmmm

#

the issue really arises the most on maps with islands

granite sky
#

You're talking about ground vehicles then?

frigid spade
#

yeah

#

maybe some sort of water detection

granite sky
#

There's not really anything legitimate you can do in realtime.

frigid spade
#

yeah, best i'll probably do is fudge it with like surfaceIsWater or something similar

#

or if a few nearby points ASL are negative

granite sky
#

Depends partly whether a false positive is a worse problem than a false negative.

#

If the problem is something like cars trying to cross between Tanoa islands and the mainland then a calculatePath check likely will work.

hallow mortar
frigid spade
#

Or on maps with islands that don’t have bridges to them

#

Like if you can’t find a path try a different random spot

#

(And hope the random spot is on that island)

hallow mortar
frigid spade
fallen locust
#

objNull

frigid spade
#

Also expecting absolutely 0 success I tested chatGPT on the task since someone mentioned that it was great for SQF and I didn’t believe them

#

It almost immediately invented a fictional β€œfindPath” function that it claimed was native to SQF

fallen locust
#

or any "Null"

granite sky
#

I'm not sure if it fires PathCalculated if it fails to find a path.

fallen locust
#

or log 0

#

or - log 0

#

quite few of them actually

errant iron
# errant iron oh wait, `knowsAbout` can take a side? that might solve having to iterate over a...

https://github.com/Warriors-Haven-Gaming/WHFramework/commit/64c90121c97c611fa847375c56012ee7e4f02830
i used this and sacrificed the targetKnowledge positions, but that let me scrap the targetGroups hashmap and it brought everything down from 1.09ms to 0.25ms :D

re-measured from a new run with several blufor squads in multiple objectives and difference was smaller, 0.84ms to 0.40ms: sqf _getKnownTargets: 0.4662ms => 0.0948ms _getKnownTargetPositions: 0.0604ms => N/A _aggregateTargets: 0.2022ms => 0.1745ms _generateTargetAreas: 0.0395ms => 0.0635ms _appendTargetAreaPriorities: 0.0736ms => 0.0642ms

errant iron
#

tho at this point i'd say it's plenty good enough anyway

granite sky
#

instead of the bulk loop you can do:

private _xvals = _positions apply { _x#0 }:
private _minX = selectMin _xvals;
private _maxX = selectMax _xvals;

etc.

errant iron
#

oh duh, done (saved about 0.01ms too)

granite sky
#

_aggregateTargets just looks so obviously bad that I'm probably missing something.

#

What exactly is in WHF_fnc_anyInArea?

errant iron
#

it was once a findIf inArea thing, but turns out that was slower so i just made it a single inAreaArray call

candid scroll
#

Does anyone here have some experience using the D3D11 pointers to get the device and context info? RVExtensionGData etc?

granite sky
#

wait, don't you only have six targets in this test...

errant iron
#

just slapped a few mechanized AA squads in four AOs, very scientific πŸ™ƒ

fair drum
candid scroll
fair drum
candid scroll
#

still need a way to pull the info out of the game in a non-blocking way, the sqf way doesnt let me access the image / camera data in an easy way

#

at least not from what ive found

fair drum
#

treat it all locally? or are you intending to use this web ui outside of the game

candid scroll
#

web ui outside of the game, totally external from the game context

#

access on your phone, for example

#

I think ive just fixed my issue, didnt specify the struct "pack" value, whatever that is, haha

errant iron
pine wing
#

Is there some way to use triggers to create medevac vehicles and units that dispatch to wounded units, load them into the ground or air vehicle, then move back to a medical base? I should add im using ace, and want to have it so ai can call medevac and such

granite sky
#

Sure but that's a complex system doing difficult things.

tough abyss
#

objNull isEqualTo objNull
-> true

#

log 0 isEqualTo log 0
-> true

#

-log 0 isEqualTo -log 0
-> true

#

You are wrong on all of them

still forum
drifting badge
#

Been trying to hide the power poles and power cables on the Malden map, but doing it with placing the hideobject modules (which works) is very tedious, so I am looking for a way to do it automatically. A search here showed that something like this might work to get all the poles and cables and hide them (using a gamelogic object)

{ 
    (getPosWorld this nearestObject _x) hideObject true 
} forEach [iskindof "power"];

but I tried different combinations and no luck so far.

warm hedge
#

iskindof "power" that is not how it works

#
nearestTerrainObjects [getPosWorld thism ["POWER LINES"],10] apply {hideObject _x}```try something like this
drifting badge
#

think "thism" might be an issue as it get an error

proven charm
#

thism -> this,

#

also i think you should use hideObjectGlobal instead

drifting badge
#

thx gen, but unfortunately both the power lines and poles are still there

warm hedge
#

Uff yeah typo

drifting badge
#

got a work call so I have to head out, but will check back later - thanks for your help so far guys ;)

sturdy sage
proven charm
#

though those wont work with nearestTerrainObjects

sturdy sage
#

Yeah, in my case i needed it to work with mission and terrain objects. So nearObjects + select with isKindOf checks

warm hedge
#

It actually seems the powerline is house in this context

#

At least Malden ones are

sturdy sage
#

Yeah its a bit all over the place with the base classes as well. Which is why i had to check for multiple.

warm hedge
west umbra
#

Hi everyone,

I could use a hand. On an Life–based mission I’m trying to update my MySQL database through extDB3 with this SQF:

// ───────── Sender account ─────────
_query2 = format [
    "UPDATE banque_account SET amount = %2 WHERE iban = '%1'",
    _ibanOriginal,
    [_newAmountOriginalAccount] call DB_fnc_numberSafe
];
private _res = [_query2, 1] call DB_fnc_asyncCall;
diag_log format ["[DEBUG SQL EXEC] %1 -> Result: %2", _query2, _res];

diag_log format ["_query virement = %1", _query2];

// ───────── Receiver account ─────────
private _newAmountReceiver = (_queryResult # 3) + _amontEnter;

_query3 = format [
    "UPDATE banque_account SET amount = %2 WHERE iban = '%1'",
    _ibanBeneficiaire,
    [_newAmountReceiver] call DB_fnc_numberSafe
];
[_query3, 1] call DB_fnc_asyncCall;
diag_log format ["_query virement receveur = %1", _query3];

Server log:

[DEBUG SQL EXEC] UPDATE banque_account SET amount = 25794800 WHERE iban = 'A3URLd1420629758' -> Result: true
_query virement = UPDATE banque_account SET amount = 25794800 WHERE iban = 'A3URLd1420629758'
_query virement receveur = UPDATE banque_account SET amount = 1610730 WHERE iban = 'A3URLd2045083596'

The receiver update worksβ€”its row changes in the DBβ€”while the sender update does nothing even though the log reports Result: true.
If I paste that same SQL statement directly into the database console the row is updated, so the query itself is valid.

Any ideas why the first UPDATE isn’t actually modifying the row when run through extDB3?
Thanks! πŸ™‚

proven charm
#

your iban is different in the last update

west umbra
#

Yes because I want to update two different row with 2 different IBAN one for the sender and one for the receiver

proven charm
#

oh ok , sorry dont know then

lean raven