#arma3_scripting
1 messages Β· Page 198 of 1
you can change the values of the engine power and stuff if you want uphill travel better
then do the https://discordapp.com/channels/105462288051380224/105462984087728128/1391657894407311413 idea that Nikko suggested
its all about finding workarounds
Well I'd have to make it adjust for downshifting somehow
if full manual was possible, the ACE team would have already figured it out
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
It will in 2027
oh alright
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
Will it be even more moddable than Arma 3?
Likely
k nice
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.
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.
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.
That sucks if you want to code.
π¦ 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.
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.
Its supposed to be turned to read only. But that was months ago by now and there has been no visible movement
SQF also has debugging, though community made
Easier point of intervention by scripting would be to just addForce up to a max speed if conditions are met.
So I would just disable the normal transmission and build mine with addForce on top?
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
but, well
I could make my own transmission using that
I'd just have to figure out how to disable the transmission
The bug tracker is starting to fill with spam too now. Sucks.
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
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
Much Obliged!
As a sidenote, is there any way to change an object's type during runtime through script?
What you want to replace and when?
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.
depends little bit who leads the AI but you could try https://community.bistudio.com/wiki/doStop
It also needs to work with non NPCs(players)
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
yeah
Break the engine xD
empty fuel π
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)
well that will show engine damaged
honestly if id need something like this i would use EachFrame EH to zero the vehicle speed..
but thats also far from perfect
I still think addForce would be enough to tweak the "effective" performance.
Well it's not just for getting up hills
Similar to my helicopter taxi mod
It's also for immersion
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....
in MP. maybe https://community.bistudio.com/wiki/getClientState
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....
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.
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?
What is the main page for all those functions and features?
@hallow mortar Nice. I'll try it right away.
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
Both of those and the introduction to scripting are linked from the second pinned message in this channel
BIS_fnc_isLoading returns false as soon as systemChat is able to write stuff to screen, so it didn't work.
oml i feel so stupid
edit: *am stupid
Maybe something with camera commands? I'm not really good with that...
This is basically my homepage https://community.bistudio.com/wiki/Category:Scripting_Commands
try this (Example 1) https://community.bistudio.com/wiki/findDisplay
I'm gonna pin this in chrome too, thx
My mission already waits for (alive player) and (!isNull findDisplay 46)
What are you trying to run, then? and how is it failing
This
This
Hi, is there a way to make AI units forgive a player after teamkilling? I couldn't figure out what to google.
thanks, i knew i'd seen it before but forgot what it was called
Your rating
https://community.bistudio.com/wiki/rating
And there is event handler for it
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleRating
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
Have you tried adding an invisible helipad to your location?
this works: ```sqf
heli landAt [getposATL player, "Land", 11, false]
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....
Just check !isNull (findDisplay 46)
Which is the main game display
They've previously found that that isn't suitable for their purpose because display 46 stops being null before the loading screen finishes
So they mean after the black overlay dissapears?
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.
setObjectTexture
Yeah I just figured it out. Thanks
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}];
What? That makes no sense at all.
Default value suddenly changes from type number to type code and how are these values related anyway?
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
Yeah I see the thinking, but it still makes no sense. because setFuel does not return anything
I know. I just wanted to know if it would be executed.
And you can take the return value of a code block like this
private _currentGear = getVariable ["currentGear", call {_vehicle setFuel 0}];
Ohhh
Could I also do private _currentGear = getVariable ["currentGear", call {_vehicle setFuel 0; return 0}];
so it would return something?
return is not a command
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
yes
getVariable works without left argument? 
I love this programming language
yeah, thought so
It reminds me of my own attempt at making one lol
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
You can just do this:
in Trigger:
Type: None
Activation: AnyPlayer
ActivationType: Present
Repetable: True
ServerOnly: False
Codition: This
OnActivation:
player allowDamage false;
[player, currentWeapon player, true] call ace_safemode_fnc_setWeaponSafety;
OnDeactivation:
player allowDamage true;
[player, currentWeapon player, false] call ace_safemode_fnc_setWeaponSafety;
That is a whole lot simpler than what I was doing. Thank you so much!
So, while testing this, I am able to turn the safety off, and it doesn't reengage the safety, effectively nullifying the script. I tried doing the:
{
[player, currentWeapon player, true] call ace_safemode_fnc_setWeaponSafety;
sleep 1;
}; ```
around it, and it instead causes a massive lag spike and doesn't redo the command. How does this work?
Use code blocks by putting ``` around your code
Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to d...
You can also do
#include <iostream>
// this is formated as a cpp file
int main() {
std::cout << "Hello world!" << "\n";
};
I have no idea what the means, lol. Like I said, entirely green on all of this
no i mean you can add ```cpp in the first line to format it as c++
thats just hello world(with a missing return statement)
while {true} do
{
[player, currentWeapon player, true] call ace_safemode_fnc_setWeaponSafety;
sleep 1;
}; ```
yes
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"
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 π
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.
Teleport is eays just SetPosASL or SetPosAGL depending on what kind of positions do you need.
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.
Testing it now shows that safety goes back to normal outside of trigger, so it's working as intended
That is with 1 player on Local host or on dedicated. I was asking for 2 players. If 2 player both enter in trigger area and 1 player leaves the trigger area will the player who exited trigger area still be in safe mod or not that is what i dont know.
Oh, I gotcha, say I can probably test that here real quick
Ok so testing shows that is only works for the first player, and if someone remains in the zone, the safety stays on for that same person until everyone exits the trigger zone
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
Are you using CBA?
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];
};
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;
True
This works with other players, thank you!
I'll also try this one for the sake that you wrote this
what is the setobject texture script for a headgear retexture i want to test?
Thank you all for your help!!
You can't use setObjectTexture on proxies (guns, vests, headgear, facewear, currently equipped on a unit). They're not unique objects and there's no means of targeting them.
thnakyou so just make a mod of it and keep changing till its how i want it basically ?
I guess
I mean there is UI2Texture he might change stuff with that ?
But the headgear has to have hiddenSelections
Actually nvm that is for uniforms not for helments
UI2Texture is still doing setObjectTexture on a thing. You still can't target proxies with setObjectTexture
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?
_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
@thin fox, Question, does this only work for the jets DLC aircrafts or vehicles with the fold wings subclass definitions?
Works for me. I just put this in a redfor unit's init box, facing my blufor unit:
group this addEventHandler ["EnemyDetected", {
params ["_group", "_newTarget"];
hint format ["event triggered. detected enemy. Group: %1, new target: %2", _group, _newTarget];
}];
thanks. not sure what i was doing wrong earlier. ill play with it some more. the code you provided worked fine
I think it's a config thing, it works for f18 FIR as well
I took this function from the addAction itself and modified it to work with my cas menu
// 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
You didn't declared _accelerationIntensity
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
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";
};
Manually editing mission.sqm? π¬
Is the object itself successfully created?
Tried everything in editor with no luck. Let me check so that I'm certain
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.
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 π
did you reload?
Yes
k
onAnalog = "_this call MarlosEnhancedTransmissions_fnc_AccelerateAnalog"; This should work, shouldn't it?
yes
oh and
params [
"_accelerationIntensity"
];
Do i need params?
in front of the []
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
no
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.
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
its a joystick slider
add logging into your script function to see its called right?
Anything you like
I don't realy know how but imma google
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.
yes
systemChat format ["TIME %1 STATE %2", time, _this];```
yes
i changed that
It doesn't work using the extended debug console, but it works printing it into the chat
When you pause the game to go into debug console, you also loose the joystick input
oh
You can probably just ignore the input if isGamePaused, but not working in MP
time to
git add --all
git commit -m ""
Now the camp markers are gone again! Like wtf π
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 
Can I use python scripts in my arma addon? I need to use numpy for some torque curve related things.
technically yes, https://github.com/overfl0/Pythia
but only with an extension
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..
scripting is fine about scripting ^^
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]?
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.
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.
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.
That would be the shortest way, not the best way and propably not the fastest way.
But eh this argument will lead nowhere
Wheels aren't separate objects and can't be targeted like this
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
Either adapt my code or use the mod if you want.
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.
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
they dont-
i mean i could still
apply force at the bottom of the wheels
and make the car move
I'm absolutely certain this will result in a fluid, enjoyable, and non-jank driving system
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";?
https://community.bistudio.com/wiki/selectionPosition
Wheels (....mostly) have standard selection names.
there's a wheels class in the vehicle config that tells you their selection names iirc
Oh ok imma look into that tomorrow
anyone? really wanna get this working some point in the next few hours (if i dont fall asleep that is)
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
ah alr, i shall resign for the night and head to bed then lol
i'll probably wake up some time around 10pm est?
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
semi colons at the end of code blocks } are required too
e.g. sqf if (true) then { ... };
oh, weird, I have an if without a semicolon around the snippet that that was working fine before adding the rotate part.. thanks!
ye, if they're at the end of a script then the semicolon isn't necessary, same with other kinds of statements
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!
} is the end of the code scope so it's already effectively an end of line for whatever's inside it - no explicit ; is needed before it.
You need one after it because it may not be an effective end of line for whatever's outside it.
ok, not used to languages having that kinda flexability
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.
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
i'm in the NikkoJT camp
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
can we see the script
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;
};
};
};
};
};
Unrelated but don't use _y as a variable name, it's a magic variable like _x
You can make your position adjustment a little cleaner using vectorAdd
Edited
for "_i" from 0 to
It doesn't have to be "_i", that's just common convention
Is that all? That's pretty normal for physics objects settling
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
as long as they don't actually explode I wouldn't worry about it
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
i would just place them in the Editor, that would be real easy for me
using the alt key
and mouse ofcorse
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
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.
ask on webknight's discord
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.
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
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
yea, i noticed it was a bit... flawed
but as i said idm
ah wait so
i was on the right track
i tried using setdir
i was just too daft to figure out how lmao
thanks for that!
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
ahhhhhh
thats where i was lost
you can open these functions in the function viewer and view them yourself. I just read through it.
ah, now im testing this, i get an error
You cannot use comment line in Init section
ah makes sense
apologies for all the questions lol idk wtf im doing, but, all the vehicles spawn for only the client who spawned them, not other players on the server
i imagine remoteExec is the way to fix that but idk where to add it
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.
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
where? I cant find it.
class Wheels
Yeah?
wow class wheels that will surely help me find it
there is no class wheels in the vehicle
its a hemtt
all PhysX vehicles have it. are you looking in config viewer even?
yes.
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
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?)
π I'd like some feedback on this: https://community.bistudio.com/wiki/Script_Handle#Promise_Handles
Anything important you would want to add or change on it (not naming of commands)
Wait, parachutes are automatically deleted on landing? :P
after 12 years...
Well I hope so
Are they not?
they are
is an Arma newbie really
do wish there was an eventhandler or something for when a player/unit uses the deploy parachute action
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.
so in ```sqf
_paradropHandle continueWith { "SmokeshellGreen" createVehicle _this; };
yes
cool
tbh the name "empty" handle didnt tell me much. maybe it could be called async or something, idk
Naming is hard.
Its a script handle without a script π€·
scriptless-handle would also work
getInMan? it's not particularly specific, true
"wait handle" ?
But a handle with a script in it, can also be waited on, its also a wait handle
Reserved?
Yeah i figured out some work arounds for it but I wanted specifically the time when the action is run, but before the parachute exists
the code in continueWith is scheduled right?
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
yeah makes sense
also addUserActionEventHandler is already taken and it's for inputAction xD
actionMenuEventHandler then?
User action Handler to detect action menu activation, then check what action is currently selected π
I don't see what's the point of the empty handle
see the example with continueWith
it makes sense to me but still it is very odd looking π
Its like Javascripts .then and await
really? can you chain them?
_handle continueWith {} continueWith {} π€£
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
_handle continueWith {([] spawn {}) continueWith {}} π
@still forum How open are you to having submissions to optimization/fixes/updating with modern commands within older BIS functions?
I generally do not touch script.
Editing data is too much hassle
Anyone still work on that side of script at all?
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
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
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.
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?
I would like to know that too
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)
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
say I have an arbitrary data structure (this is an example and its missing some context that makes this runnable or sensical code):
- Is there a noticeable performance impact to destructure into named private variables or should I just pass values through?
- The latter being unreadable trash, is it worth it to rewrite as such once the project is done for performance gains?
- 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
params will save you some lines there
- Slightly and unnoticeable performance increase
- params indeed
- What does it mean and for what purpose
@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?
I would assume with hashmap the hashing / search is going to take longer than any convenience gained by storing information like this in one
Of course to fetch a singular data it has worse performance than array and select
take longer computationally than its worth given the convenience I'm not afforded in my current approach*
But you see how easy and strong HashMap is
ok
thanks for the help!
I will also go checkout what params looks like, ive seen it used in functions
To calculate the performance of a code, gauge icon in Debug Console can help
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
call has remarkably little overhead actually.
good to know!
kinda makes sense because any time you use {} it's creating a sub-scope, so even an if statement is doing the same thing.
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
Not really understanding your question but usually if you want to put one object inside another you use attachTo.
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
yeah there's some z-axis weirdness with simple objects.
I can figureout the offset on it later and it should be fine
createVehicle + attachTo would work instead but might have a bit more performance cost.
I also did attach to
disabling sim immediately should also work but it might need to be in the same frame as the createVehicle
private _containerContentObject = createSimpleObject [_type, ATLToASL _containerContentObjectRealPosition];
_containerContentObject setVectorUp [0,0,1];
[_containerContentObject, _containerObj] call BIS_fnc_attachToRelative;
When I use createVehicle + attach or createVehicle + setDir I always wrap them in isNil { } if it's scheduled.
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;
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.
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?
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.
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
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?
One obvious way is isClass (configFile >> "CfgPatches" >> "loadorder_f_vietnam")
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?
No idea what you do and your goal, and what do you expect from my code
reactangle actually.
and what kind of centered line are you talking about?
We can probably add objectParent support to engine.
Laser target is special but I assume we're storing the owner
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
I thought HashMaps are really fast, like just arrays
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
I don't think so. what are you trying to optimize?
Just wanting to learn good practice in general
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
Besides reading some tutorial pages you could also take a look at CBA and ACE. Might give you some ideas on how to write things differently.
ACE and CBA are definitely 2 resources I have used a lot as reference, they taught me how to use macros, no more writing entire pathsπ
Good to know, I think Iβll just sift through github then to look at more implementations and see what I can use to improve my stuff :)
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
_pos = getpos player;
_x = _pos # 0;
_y = _pos # 1;
_z = _pos # 2;
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.
Would I then be able to replace "player" with "nearestEnemy"?
AI is really bad at SQF scripting
That's what I don't understand. I use it to format my scripts nicely and to find errors with missing characters, but it seems to have caused a horrible hatred towards me.
Yes.
If you get
private _myNearestEnemy = player findNearestEnemy player;
private _pos = getPosATL _myNearestEnemy;
_pos params ["_x","_y","_z"];
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.
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.
I'm not involved in what my husband has done in the past. We share a bank account, I've said that many times.
Besides, I don't use AI for programming, but rather to achieve a more readable format and to find syntax errors.
Bank account? you mean steam account?
yes
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?
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.
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.
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.
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)
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.
"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?
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.
This community doesn't appreciate such stuff.
Maybe find a different one to scam again.
I haven't scammed anyone. Instead, you've been harassing me for several hours.
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.
but in that case I never asked for donations.
Sorry what?
I guess.. yeah.. theoretically you say you don't, but then theres a donation link right there on it.
No one has donated anything, so I haven't scammed anyone. You, on the other hand, are harassing me.
no need
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.
Can't accept donations, but is asking for donations on every mod. Ok.
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.
A while ago you were collecting donations for your relative's surgery. I remember it clearly, it was in your mod description
A cousin or something.
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.
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"?
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?
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.
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.
Do you even know what DLAA is? At least an abbreviation
I think it looks impressive. Barely any pixelated edges anymore, real smooth
I didnt even know that was possible in Arma!
I may not know how to speak English because Chinese is my native language, and yet here I am, conversing.
And what I promised I delivered, plain and simple.
Chinese is your native language?
But all your mods are in spanish, and you are in Mexico
This is the basic idea of ββdeception: passing off a fake as the original. There's no way you can technically do DLAA in Arma
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.
I just really would love to know how you did the custom AA. What PBO is it in?
oh the discord account too?
Same bank account, same steam account, same discord account, same behavior. But two people! Wow.
I can't use these accounts for logical reasons, that's why I use his, so much reasoning.
Ah yes, probably same as you can't ask for donations, yet you do on every mod you "make".
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.
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.
Simple google search = stalker lmao
I think you're just a scammer, you're not a woman, you're a man who wants to scam people. Everything you say is a lie because there is no proof
They were banned
And let the cat go free
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?
It's fine to ask
setVelocityTransformation also works every frame.
It just does the interpolating for you
i c thx dedmen
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
@kind wind Did you still need to see the script I was using for the "giving money to non-players"?
You don't need to draw any lines to spawn objects in line
donβt focus on the line then, this was merrily to illustrate my goal. I need coordinates that would be a straight line, evenly spaced and the trigger serves as reference where those coordinates should be.
But I donβt know how I could archive this
@haughty timber Yep, Still do!
Idk your main goal, but maybe something like this? https://github.com/PiG13BR/PIG-Air_Supremacy_PVP/blob/main/functions%2Fobjectives%2Ffn_convoyObjective.sqf#L48
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;
};
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
(Wait, how do I post SQF with the colors again?)
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Thanks!
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
need that bot for the ace discord lol
//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
And that's for initserver.sqf, correct?
Surprisingly I put it in init.sqf instead, specifically an execVM to a file called "everyonesMoney.sqf"
I put this code as everyonesMoney.sqf and in init.sqf I just did an execVM "scripts\everyonesMoney.sqf"
No idea if it makes it less efficient or if it's the only way it could work
Haven't tested yet
Fair enough, I'll see if after work(today/tomorrow) I can test this out and see the results
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 π
all good bro, thought it was me with my EST zone and 8 hour - 5 day shifts π
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
"true""
@faint burrow omg, thanks
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? )
Anyone have a script to turn on vehicle beacons?
If the vehicle have a scriped animation source to enable the beacon, maybe
Which CDLC which vehicle
I try to use one of default notifications from CfgNotifications but it shows the notifiaction without any text
["IntelAdded"] call BIS_fnc_showNotification;
The cldc is global mobilization, and the vehicle is the W123.
hi how do i get Land_TTowerBig_2_F in eden editor?
create3DENEntity
also you can search by name (its transmitter tower)
thank u so much
any tips for a mod with more eden objects, specifically for military bases, radar towers, comm towers, walls etc
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
ok np, i m just lookin for industrial and military props
Why should the text be shown if you didn't pass it?
@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[] = {};
};
};
I meant you could use standard IntelAdded notification template and pass in the text to be shown.
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
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`
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"]]]
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];
Thanks! I'll test it in a minute. I forgot to add that I'd like to remove the prohibited entries from the array above, so I guess BIS_fnc_removeNestedElement should do? Or is there better way
thats different radios for opfor side
Yes, I want to remove them all if there are any of them
_idx = allitems findIf { _x == _prohbitedItem };
allitems deleteAt _idx;
``` or just allitems = allitems - [_prohbitedItem ];
@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;
I need to remove them from a nested array that the mission uses as reference when determining the spawn gear. But I guess I could also just run this just after the player has spawned with their gear?
Just to double check, I just change the _prohibitedItemsWest to _prohibitedItemsEast when checking OPFOR player's loadouts?
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
Anyone know what typically causes a GNIAC STACK SIZE VIOLATION?
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
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 ==.
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?
hello all: How do i make west, Hostile, to civilian: ?
ok thx m8
I vaguely recall two different ones in the wiki. Best to get it from config viewer directly.
I donβt understand how this has fallen off of someoneβs radar at BI; surely the company understands the value in what the forums have provided so far?
@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.
{_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
idk if "allDeadMen" exists for that command, but you can try just with allDeadMen command directly
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**
It doesn't, allMissionObjects only accepts what it listed on the wiki:
Damn, I didn't know you could do that, thanks!
how to export content from a crate ?
why? in eden?
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",[],[],[]]]
so what do you want to achieve? in eden you can directly edit the crate contents
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.
ic
idk about eden but there's also getWeaponCargo , getItemCargo etc commands
so you can pick the format you like
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
i think you should use getBackpackCargo over everyContainer so that the format is same
@proven charm yes, everyContainer gives model names (?) alongside classnames leading to giant flustercluck
i mean you can use commands of the same command family to be able to process the output better
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
where's that screenshot taken from? 
Respawn does support per-unit and per-group ticket pools, as well as the side pools. It could be one of those.
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;
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
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.
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.
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;
};
I assume first line is supposed to be _waitTime
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"
...Anyone? 
Do you want advice how to approach this?
Or did you try something and it didn't work? If you tried something, show what you did so we can correct mistakes/steer you in a different direction if needed.
Yeah; I couldn't get it to detect that the driver is dead.
The convoy system itself works fine... until you lose a vehicle in the convoy.
The handoff system works, but I can't get it to see that the driver is dead.
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.
It's loop driven; once a second it checks to see if each driver is alive. If it's not, it transfers the ownership of the variable for the driver behind it to the vehicle that just died, so the script still works as intended.
Is this the answer you are looking for?:
if (!alive HEMTTFOLLOW4VAR || !alive driver HEMTTFOLLOW4VAR ) then { HEMTTFOLLOW5VAR = HEMTTFOLLOW4VAR;};
Otherwise need more context. Show your code
Maybe? Let me check.
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.
This is an earlier version of the convoy code in action; I've done some minor optimizations since filming this:
https://youtube.com/live/3CKVJXlyc7E
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.
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?
Was an attempt to get it to flag as dead.
Because dead people sometimes turn civilian before turning black.
The !alive should work fine on the driver. Assuming that is what is actually stored in that variable.
It is, yes.
@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.
I would expect that firing has to be done locally to the turret. Normally you'd want to change the locality of the code that's ordering the shooting.
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
um ... why doing it yourself?
write a bot
which gets all stuff that is posted in
code
blocks```
If anyone sees my messages above, I'm still seeking advice on it. π
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?
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?
So you can do it in camera, but you can't do it in first person, right?
You need to apply it to the players camera.
Hmm...
This may be a stupid question... but does that mean the player's camera is the player?
I make a request through allCameras. And there are a bunch of some bees) And among them there is a player)
Is that correct?
Should be yes. Not sure a player camera can use such commands. At least I've never seen. What do you want to achieve?
I want to make the weapon blur in close focus when aiming. Like in modern games.
You can use DOF postprocess in the last update
#dev_rc_branch message
Minus intensity to blur your hands
Yes... but they can't blur only the near background?
Hmm....
Wow.. yeah... I didn't think to use the minus...
Thanks a lot.
And another stupid question... Is it impossible to apply two identical effects at the same time?
DOF somehow cannot
man_2Animated = false that's not a condition sir.
Maybe you meant == false, but that is also wrong, you probably meant !man_2Animated
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
ColorCorrections can, at least
If this is just for personal use, you can use Reshade depth of field shaders, which have more advanced control. (Unless you want to play on MP servers running BattlEye)
Just tried:
ChromAberration
WetDistortion
ColorCorrections
DynamicBlur
FilmGrain
ColorInversion
Resolution```They can have multiple instances of it. Could not confirm about `SSAO`
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
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
getLighting etc is reliable
hm. doesnt that detect light on the spot you are at?
or should i just check if stars are there
I don't know if it's still the case, but getLighting has been broken on HC's in the past
Lambs does a night check like so:
(getPos _unit) getEnvSoundController "night" isEqualTo 1
ok, from my tests it looks like checking stars is working
So, can we expect that DOF will also work in the future?
I do not say anything about the future
Ok)))
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?
Probably an entityCreated mission event handler, with an if !(_entity isKindOf "CAManBase") exitWith {}; check inside it so it skips anything that doesn't need it.
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#EntityCreated
will give that a try, thanks for idea
If you put all this (approximately) in a function https://community.bistudio.com/wiki/Arma_3:_Functions_Library, you can call the same function in both places and avoid duplicate code
its working, where would be the best place to add the EH, init.sqf?
I would say yes, that will cover both Zeus and the server, which are the two places AI are typically local to
are units that are placed in editor also triggering this? then we could leave it out of the initserver.sqf completely
https://community.bistudio.com/wiki/Initialisation_Order
Editor entities are created and initialised before either of the init scripts run, so the EH won't exist yet
gotcha. Thanks again
You can also do
private _SRSSTime = date call BIS_fnc_sunriseSunsetTime;
if(((dayTime -1) > (_SRSSTime #1)) or ((dayTime +1) < (_SRSSTime #0))) then {systemChat "It's dark"};
at https://community.bistudio.com/wiki/setObjectTextureGlobal
it says there could be problems if executed from init field, which I do kinda alot for setting random decals on vehicles, what would be the reccomended way then?
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.
almost every other mod or maybe even cdlc? that does randomize decal does this lol so i guess if it works for them it should work right? π
but ill put in postinit anyways
Almost everyone uses postInit for textures, IIRC. Some vanilla vehicles were using init but they fixed that recently.
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..
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 π
Don't use mods. Try vanilla 
me?
Ja
oh you mean the green thing. yes π
To make it more scalable, the function can take an input parameter - an ordered array of all vehicles. Then you would cycle through the array, instead of the hard-coded vehicle variables. That means, it can work for 3 vehicles or even 30 without code changes.
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.
There are a couple things I want to make that would need two DOFs, thanks for working on this
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?
There's a dedicated channel for hemtt kn the ace discord
Issue is likely because vs code is reading your files as c++, not Arma config (you can set the language in the bottom right)
its reading them right (arma config)
thanks will check the hemtt channel there then
congrats π
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}]
The problem isn't so much the script as it is my attempt to make it self-correcting once a vehicle is destroyed. Even though I tried to use !alive, the game is not seeing it as so, unless I physically delete the entity as Zeus.
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?
I'm assuming you are not using MenuPosition then?
@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
If no marker is defined, respawn behaviour will be the same as "INSTANT".
This conflicts with the information here: https://community.bistudio.com/wiki/Arma_3:_Respawn which is presumably where they were reading it.
When no markers are defined, player is respawned on position where he started the mission.
I would expect that it's just that this latter page on the wiki is wrong, and the description.ext page is correct.
if you guys consistently get the same answer, i'll edit the wiki page
I think it is instant. I don't remember being respawn on the original position at the start of the scenario
can CfgNonAIVehicles support eventhandlers like init? I want to have it where when a certain wreck spawns another wreck spawns next to it
I had it working like I expected before though which is the wild part
what's the fastest way to get nearby enemies, anyone happen to know?
continueWith is an eventhandler. Just like other eventhandlers or spawned scripts, it is not executed "right now" thus it cannot see variables that were present somewhere in the past.
But maybe an alt syntax that allows to pass parameters to it, like we do for missionEventHandlers makes sense
to save you from writing one word waitUntil (_args spawn {code block}) ? no.
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?
You run it where the unit is local.
is there a way to create my own airport that ai work at without GM?
You may also try this: https://community.bistudio.com/wiki/canMove . It returns false when the vehicle is immobilized - still alive but damaged.
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.
Sure, EH's scope is different. Use, for example, a global var.
You need to pass your layer via setVariable on unit or like schatten said use global var
setVariable worked, thanks!
This is great)))
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.
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
trying to apply this script in zeus
https://forums.bohemia.net/forums/topic/218562-neat-little-rotating-radar-script/
while {true} do { { radar lookAt (radar getRelPos [100, _x]); sleep 2.45; } forEach [120, 240, 0]; };
but the radar wont rotate, can someone take a look at the script maybe im doing something wrong? running it as global exec too
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.
like this?
while {true} do { { _this lookAt (_this getRelPos [100, _x]); sleep 2.45; } forEach [120, 240, 0]; };
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...
tried putting it on the actual ai of the radar, not the radar itself still wouldnt spin, let me try gunner
on target exec
If it doesn't work you could try doWatch or lockCameraTo instead
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
https://community.bistudio.com/wiki/getRelPos
It returns a position relative to the current direction of the object (the whole object, not its turret). That should not be the issue there.
If you want to use lockCameraTo you need to check its syntax though, because it doesn't accept just a plain position. https://community.bistudio.com/wiki/lockCameraTo (syntax 2 for this purpose)
It requires an array of [_target, _turretPath, _temporary]
do i need to spawn anything in zeus? what im doing is just selecting the crew or the radar piece pasting the code in the execute bar and pressing enter / ok
Depends on what _this returns. If you select the crew, it could be the group. If radar, could be the radar object. That matters.
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.
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
Also the title bar of the attributes window tells you what you're editing
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
well when i execute it, i cant see the result because executing it closes the window
is [cursorObject] remoteExec str typeOf _this valid?
did a quick test in editor, both _vehicle doWatch _pos and _vehicle lockCameraTo [_pos, [0], false] will slew the radar correctly
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.
im thinking it has something with me trying to do it zeus
I can't remember if ZEN object code fields are scheduled or not
_this spawn {
// ...everything you already had...
};```
Sure would be handy if ZEN had this information on their wiki :U
double checked with systemChat str canSuspend and it indeed returns false
1 sec
careful with the while-true loop too, it'll keep running even if the radar gets destroyed
i mean it shouldn't break anything as is, just something to keep in mind
Easy fix: while {alive _this} ...
_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
For posting large blocks of code in Discord, you can enclose them in a full block format, which is easier to read.
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
_this spawn {
while {alive _this} do {
{
_this doWatch (_this getRelPos [100, _x]);
sleep 2.45;
} forEach [120, 240, 0];
};
};
turret rotate script
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];
};
};```
i am 100% certain that it worked like this previously.
this used to be my default mp mission setup for respawn.
Depends. If you know all enemies are the same side, then units _enemySide inAreaArray [_position, _distance, _distance]. Otherwise probably nearEntities + select filter.
I went with nearEntities π ```sqf
private _e = (_center nearEntities [["CAManBase","LandVehicle"], _dist]) select { side _x != _friendlySide && side _x != civilian };
depending on your use case, it might be worth checking side group rather than just side to avoid excluding captive units
good point
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.
oh im new to simpleVM , didnt know if it was on stable yet
It is.
nice
so this is faster? ```sqf
private _e = (_center nearEntities [["CAManBase","LandVehicle"], _dist]);
_e = _e select { (side group _x) != _friendlySide && (side group _x) != civilian };
Use diag_testscriptsimplevm to test it
cool it might do that. thx
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
No, like this:
private _e = _center nearEntities [["CAManBase","LandVehicle"], _dist] select { side group _x != _friendlySide } select { side group _x != civilian };
aah ok thx
you could try the in+array version but it's likely slower.
maybe close if you pre-declare the array.
I need to test this stuff sometime, thx all
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```
hmm, guess the first one is within simpleVM limits then.
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
And when can we expect this on dev?
looks like Greek to me, he he π
but i understand Greek woohoo lol
i know im not funny lol
Challenge:
What is the global variable B in this code?
B isEqualTo B
-> false
I'd have thought that getKnownTargets would be faster in the worst case if you take load out of the forEach, so like this:
private _targets =
_group targets [true, 3000, [], 600]
select {!(netId _x in _targetGroups)}
select {netId _x isNotEqualTo "0:0"}
select {leader _group knowsAbout _x >= 2.5};
{
_targetGroups set [_key, [_x, _group]];
} forEach _targets;
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.
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
I'm not sure if there are ever non-network enemies.
If it's a rare case then put it on the end anyway.
ive had targets [true] return vehicles identified as sideUnknown/civilian, but yeah maybe that's worth ignoring
actually if it's rare, just delete 0:0 afterwards. That'll be cheaper than checking for it.
lemme benchmark it in a bit
generateTargetAreas can be done quite a bit better but that one's cheap-ish anyway.
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?
You'd definitely want the netId filtering first if it's 41 groups with knowledge of 6 units.
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
Well, you removed the knowsAbout condition there.
I assume the code is a halfway version because _keys and _values don't exist.
oops, forgot to remove that and put in the knowsAbout condition back...
Point of adding the netId pre-check is basically to cut down on knowsAbout condition checks :P
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
No, I mean the select {!(netId _x in _targetGroups)} part.
o, well _targetGroups is a fresh hashmap so there wouldn't be any elements to begin with
I don't think the rejig there does anything for you.
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
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.
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
the wiki for that has a couple examples suggesting more reliable methods, but i haven't done pathing stuff either
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
You're talking about ground vehicles then?
There's not really anything legitimate you can do in realtime.
yeah, best i'll probably do is fudge it with like surfaceIsWater or something similar
or if a few nearby points ASL are negative
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.
Bit of an edge case but this could fail if artificial water plane objects are involved. Vanilla maps don't have them, but they are supported in the engine and some mods use them for rivers and ponds above sea level.
Itβs mostly for something like that
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)
You don't often see artificial water bodies large enough to have islands in them, so it may not be serious enough to be worth accounting for. Worth keeping in mind though.
Indeed yeah Iβve encountered water bodies like those
objNull
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
or any "Null"
I'm not sure if it fires PathCalculated if it fails to find a path.
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
i wouldn't mind cleaning up this function too, would this be simpler?
tho at this point i'd say it's plenty good enough anyway
instead of the bulk loop you can do:
private _xvals = _positions apply { _x#0 }:
private _minX = selectMin _xvals;
private _maxX = selectMax _xvals;
etc.
oh duh, done (saved about 0.01ms too)
_aggregateTargets just looks so obviously bad that I'm probably missing something.
What exactly is in WHF_fnc_anyInArea?
it was once a findIf inArea thing, but turns out that was slower so i just made it a single inAreaArray call
Does anyone here have some experience using the D3D11 pointers to get the device and context info? RVExtensionGData etc?
wait, don't you only have six targets in this test...
the numbers here are with several more blufor across the map, retested with old version alongside the new one
just slapped a few mechanized AA squads in four AOs, very scientific π
nope, but curious to what you want to do with that info
grab a section of the games rendered screen and send it to a web UI for streamed helmet cameras
and duplicating the player camera on every player and using that won't do it for you? kind of like bf4 spawn screen style?
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
treat it all locally? or are you intending to use this web ui outside of the game
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
dang, inlined it to {_x inAreaArray _area isNotEqualTo []} and ran the scenario again, function's time went down from 0.2164ms to 0.1116ms
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
Sure but that's a complex system doing difficult things.
objNull isEqualTo objNull
-> true
log 0 isEqualTo log 0
-> true
-log 0 isEqualTo -log 0
-> true
You are wrong on all of them
whenever the next dev is
straight to jail
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.
iskindof "power" that is not how it works
nearestTerrainObjects [getPosWorld thism ["POWER LINES"],10] apply {hideObject _x}```try something like this
think "thism" might be an issue as it get an error
thx gen, but unfortunately both the power lines and poles are still there
Uff yeah typo
got a work call so I have to head out, but will check back later - thanks for your help so far guys ;)
PowerLines_Small_base_F,PowerLines_base_F,PowerLines_Wires_base_F,PowerCable_01_base_F
^I check for any of these in one of my scripts.
though those wont work with nearestTerrainObjects
Yeah, in my case i needed it to work with mission and terrain objects. So nearObjects + select with isKindOf checks
Yeah its a bit all over the place with the base classes as well. Which is why i had to check for multiple.
I guess this is much better solution after some inspect
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! π
your iban is different in the last update
Yes because I want to update two different row with 2 different IBAN one for the sender and one for the receiver
oh ok , sorry dont know then
Excellent, thank you very much)