#arma3_scripting
1 messages Β· Page 135 of 1
What if I have two instances of the same event which spawns a block of code with sleep in it. Can one instance get ahead of the other because of the interruptible nature of scheduled code? Meaning that FIFO order wonΒ΄t be followed, instead FILO can happen? event#1started -> event#2started -> event#1interrupted -> event#2finished -> event#1unpaused -> event#1finished. Thanks
IIRC that depends on the projectile type (simulation?), and the larger stuff is a single global object.
what do you fire, tanks??
I believe 40mm counts as the larger type.
bullets/rockets/missiles are local I believe, maybe grenades are global?
just saying it like that, I don't have real data
I need that for tracking exploding projectiles like GL rounds, RL rockets and hand grenades. Anything a single human unit can throw, put down or fire that explodes. I would like to do as much on server without involing any client side event handlers.
try and report back if you're OK with it? so we can document it
if you spawn then your code is scheduled and can be suspended.
You can't depend on the order anymore.
It might actually work, the scheduler should run the oldest script, so that should end up with you getting same ordering. But there is no guarantee
What I didn't figure out is whether there's a hard switch at 3ms. Like is it possible that a script gets executed for one simple statement before it gets cut off, because it only started after another script executed for 2.99ms?
Yes the 3ms limit is global for that tick, itβs why mods that use excessive scheduled code can cause issues
Cba has some nice functions to do timers while still being unscheduled if you are trying to make a clock
yes
hey, I'm figuring out sqf rn, what the hell is going on here
why is the video long
oh and btw I tried to print just _x and it didnt return
the short of it is that if a variable is called _x it returns an error, and if its anything else it doesnt
when _x isn't initialized
_x is 1 by default
so insted of using it as a for loop use it as
forEach (_x in _arry ) do ("This is a hint")
something like that
I actully forgot myself wait lemme go and refresh it
use biki for this
why is _x default for something, when it appers to be uninitialized
You're getting an error because you're trying to do _x == 1 on that array, but the first element of the array is a "string", not a Number, and == requires types to be the same
If you need to do a comparison on things that could be any type, use isEqualTo instead
You have to add it inside Fired/FiredMan where instigator is local
I think the only projectile that isn't global is shotBullet
Ideally you have to add these projectile event handlers everywhere because projectile locality might change during its life time
Most usual case: Player laid a mine then left the game
Actually, just add it where shooter is local and on the server
Unless you have scripts that move locality to other players somehow
Otherwise the only engine-driven locality change is when player leaves and projectile transfers to server
I wonder what happens with shotBullet, I bet it simple vanishes (clients play fake bullet shot and that's it)
Wish there was "ShotLocal" nission event handler or something to make such cases easier to handle
Withing having the server add SEH's to each and every shot in the game to cover the case that client might potentially leave while shot is still alive
Hm that topic reminds me of something, is there a simple way to track where a bullet/autocannon shell etc. would land after it was shot before it reaches that point?
As in can I get a bullet when its fired, quickly get where it would land and then delete it and spawn something else there?
Or would I have to pretty much do the calculation myself or track it to the point where it lands?
Seen this posted some time ago, you can use it to calculate needed orientation and velocity to hit needed target
You can calculate that for each shot, then check how much it differs from fired shot and decide if you want to correct it
Though it could look weird over network
I don't think shotBullet will update at all, not sure about other projectiles

Thank you for the info! I'll look into that route
I was playing around with the idea of adding a UXO system for smaller calibers than bombs (so tanks, autocannons, etc) years ago but never got over the technical hurdles, might be worthwhile to look into it again
Quick qeustion is there a limit of how much stuff i can put in mission file example if i put video, audio, pictures is there a limit ?
not really a hardcoded software side limit (that you'll reach at least), however filesize is a limit
too big mission not gud
100mb already seems crazy to me π , my biggest mission in recent times was 12mb and that was because I forgot to delete an mp3 file in it, which I fixed before actually playing it
everything with in the 50 MB mark is fine
if youre doing more than that your just testing your players patience in a multiplayer server
for a single player I have no clue
Depends how long you're willing to make people wait to download it.
For SP missions you have more leeway, but I would not accept an MP mission on the server I help run bigger than 6MB. The download time becomes excessive.
This is only valid for cases without air resistance. I think that's just artillery in A3.
It doesn't sound like much, but Arma's file transfer is not especially fast, and when the server is trying to broadcast to 10+ people at once, it gets slowed down.
Also the inverse (have velocity, need trajectory) is simpler, although generating an impact point is pretty expensive.
Yep, although that was improved a lot in one of the last updates with the new settings for download speed (iirc)
50mb is also a ton imo
yeah but its the limit
for me as zeus at least
I have yet to find a mission maker whos willing to go past 20-30 MB
if my mission was 50mb I'd seriously reconsider if I actually need all that data, that'd have to be one hell of a mission to be worth it π
ok then it miight be justified, but I'd still seriously consider compressing it down
at some point it might even make sense to unload that data into a companion mod for the mission
yes it would
SP missions are different, they have a lot more potential for voice acting and stuff, and the download doesn't delay multiple people. A 100MB+ SP mission that was stacked with VO and video would be fine (assuming it was good, anyway)
I'd never do something like that in MP though. People hate sticking around to listen to cutscenes.
and to this day I still dont know why that dude thought that misison was justified
like he had players come and go with the first 3 hours
3gb ish. But remember that every player has to download mission file from server when they join...
Ye
hell yeeeeeeah 3gb mission file
yeah no
"Welcome to todays arma op guys, we'll start in roughly 5 hours when everyone has downloaded the mission file"
Ok big thanks.
6mb would go pretty fast with server bandwidth settings tweaks
dedmen we are talking about a regular server host for a community here
lets be real
not to mention the memory storage
sheesh
May I have more information on these tweaks?
everyone will be lagging
I am talking about a regular server
2
hey are there any scripts that make my camera follow a launched projectile (missiles, AT ) ?
Look up initBandwidth
Discord or wiki
Realistic*
initBandwidth is not on that page
I run it on my server. And we have no issues with 20mb mission files
that was a post when I was 2 years old
ill quicly make a 6 GB misison file for you and itll be a co op for you me and anyone else who wishes to join
Welcome to arma π
scripts are still the same
In fact, there are no mentions of initBandwidth anywhere on the wiki :U
this game has code in it from years before I was born
not quiiiite

To an extent, some stuff has been changed
I'd recommend sticking to arma 3 posts if possible for guidance since thats more likely to still be accurate
thanks alots guy, but just add the scripts and it'll work ? or do i have to use any keys on my keyboard ?
first script tax is your soul.
second is your mind
you only gotta pay that one when you actually start writing ones yourself
please dont have sex with your arma 
that might produce some very weird children that I'm sure bohemia doesnt want to deal with
thanks guys, i'll watch some arma 3 scripts for dummies
You can't make a working pbo that big.
Hey, he never said that the mission would work 
π If you have questions feel free to ask here and remember to do lots of googling, its a long and sometimes complicated road to work your way down π
This

also pi would you actually join for a 6 GB co op mission
adds cut scene every 3 objectives
props not since I'd be spending the entire day downloading it π
Do setObjectTextureGlobal work mid mission? Can I change some uniform texture as zeus?
yes
Can I change some uniform texture
depends if the uniform has hidden selection textures or not
I mean, I do can change texture, I already did it in init field with same command
then it will work yeah
I'm tryning this in execute field in mission but it doesn't work.
this setObjectTextureGlobal [2, "cwr3\humans\cwr3_soldiers_rus\uniforms\data\insignia\ranks\m69_insignia_ca.paa"];
Same script works when used in init field in editor
Oh, my bad, I should use _this in this case
https://community.bistudio.com/wiki/setObjectTextureGlobal
If executed from an object's init field (which should not be done anyway for GEGlobal commands), execution may happen too early and fail to broadcast over the network and to be JIP compatible.
no, this was correct
Hint literally says:
try running it with some delay:
_this spawn
{
sleep 1;
_this setObjectTextureGlobal [2, "cwr3\humans\cwr3_soldiers_rus\uniforms\data\insignia\ranks\m69_insignia_ca.paa"];
}
well that's not the "init field" I thought. I thought you mean the 3den init field
Well, I said "execute field in mission but it doesn't work", but works "when used in init field in editor"
Nevermind, thank you
Hi
Hi
hi
@vocal mantle Most People use output[outputsize-1] = 0; in the end of the RVExtension function just as a failsafe
Hi Sa-Matra, glad to see you here (last time I touched A3 in 2015-ish). Technically yes, but if client disconnects mid-flight of the bullet, the server-side "fired" EH won't fire. After changing the locality, we need to detect the disconnected client HAD bullet and we need to start our trajectory correction scipt midflight on the server (or HC)
is there a way to hot-reload a mod in arma 3?
in dev build as I know A3 allows to update config values on the fly
Release doesn't allow to do that. Probably for security reasons.
@bleak gulch
I dont really get it, if I edit the sqf files I need to reload the config file?
You didn't notice anything abotu sqf. No. In case you edit sqf you don't need to reload .pbo.
What is your goal
Yeah next time we need a rule that says
- What is your goal ?
- What did you try ?
Yeah, can you be a little more specific.
I'm just trying to edit some sqf files and console log the changes.
so lets clarify:
- if I edit the sqf files in the mod what should I reload to reflect the changes if anything?
- what is the deal with the config files, what are they used for?
Kinda confused. What you're after? An SQF? A Mission? A Mod? A config.cpp?
a mod
Who made it?
I'm adding some features to a closed source mod, changing some logic in the functions
Good example, but it needs optimization. That equation for the _angle calculation. And while-do loop is something questionable.
in this case you can -EnableFilePatching on the machine your run ArmA 3, put your mod SQF files into the directory saving the structure and change the files on the fly
you need to extract files into the game folder saving PBO prefix and all directory structure!
for example:
execVM "ARMA_3_ROOT>\x\prefix1\prefix2\mod_root_folder\functions\mycode.sqf";
or
MYMOD_fnc_myFunc = compileScript ["\x\prefix1\prefix2\mod_root_folder\functions\mycode.sqf"];
will recompile your function right in the game
I think I found an article talking about file patching, THANKS A LOT!
and one last question, what are the config files for?
it's primary way to store everything (almost) related to configuration for the game
For example in config you're storing the type (a path to the file) of texture for your car. Or you can register pre init event handler for your mod. Or you can define the load order of your mods, enable or disable / GPS in vehicle, add / remove compatible optics for your weapon or add new entities like new units, tanks etc with the physics of UFO.
Even binarized mission file is a config (binarized raP format).
I saw something about pre init handlers, what are those for?
Like where would I use them
I think I got it, thanks
First off you have to start from this table
https://community.bistudio.com/wiki/Initialisation_Order
@bleak gulch any articles you good advise me to read a beginner?
I've gone trough the basics (syntax + control flow, operator types and file extentions)
First off, try some scripts in a mission you can handle
haha I did, the issues started with the addons outside
I dont intented to debug stuff isolated from the codebase all the time π
hey can someone explain to me the gamemodes and which ones are the most realistic? If so let me know we can go into a vc channel
im new
Well, actually I don't know decent guide for the sqf / addon making. I believe most of us learned on our own, with help of forums / skype / discord / wiki / reversing other mods / etc
nah nah I mean like important topics I could read on the wiki
hm
I did what cought my eye for the language stuff and their tutorial
this one is probably #1
https://community.bistudio.com/wiki/Category:Arma_3:_Scripting_Commands
after that it goes to index pages -_-
and at some point I recommend you to read this one
https://community.bistudio.com/wiki/Code_Optimisation
Thanks
you also need to know how preprocessor works because the macros are widely used in medium - large projects. For example Community Base Addons (CBA_A3)
in dev build as I know A3 allows to
It will fire right on entity shooting
Server fires the event for every client for all shots
I remember there were issues where event was missing a projectile though
@deft zealot intercept can be easily used for hacking, so why woudn't BI prevent its functionality?
SQF its self can be used for hacking.... usually to much greater effect
well you usually need some kind of injector which intercept has already integrated
Sure people could look at intercepts source code and use it as a base for a hack... but intercept isn't doing anything that hasn't been done a million trillion times before
Plus, intercept still needs some SQF to load its self, so it's still subject to signature checking
And client DLLs need to be loaded through SQF (atm)
I love the great possibilities intercept brings to us scripters but if I would work at BI I wouldn't allow such hacky way of interacting with the RV engine. Thats why I am concerned if it will be tolerated.
I would... the only reason they'd have to (somehow) ban it is to stop their pride being hurt
In that modders managed to implement a better modding API than they did
Besides, they never stopped JayArma2Lib
Plus, intercept works fully within BE's confines (it's preventing us from doing some cooler things, actually) so it's not as if it's entirely unregulated
isnt there a command for linking an item to a corpse/unit for deletion?
or is it just the expected addeventhandler [...]
Looks like missiles (shotMissile) don't properly trigger HitExplosion when they explode without a direct hit on a target, but Explosion on the target DOES trigger and so does it get damage
Not projectile HitPart
Similar picture with 40mm GL (shotShell), it doesn't trigger PEH HitExplosion but does trigger EH Explosion on target. It does however triggers PEH HitPart but without a target listed
Complete fucking mess
whats the way to add 90 degrees to vectorUp? have surfaceNormal but need it to be 90 degrees rotated forwards for the object to be flat 
(i hate vector math)
Added in what plane?
this probably demonstrates the issue best
footprint is vertical, needs to be horizontal
uses usertexture object which is vertical for some reason
What you do you have as input? Terrain surfaceNormal and that's it?
_obj setVectorUp vectorNormalized (surfaceNormal _pos vectorAdd [0,1,0]); where the latter part is my attempt at resolving it
but yes
o im setting that bit with just setdir
Where do you get the angle from?
getdir
yep
private _pos = getPosATL _x;
private _dir = getDir _x;
if (_footTracker mod 2 != 0) then {
_obj = createVehicleLocal ["UserTexture1m_F",position _x vectorAdd [-0.1,0.4,0],[],0,"CAN_COLLIDE"];
_obj setObjectTexture [0,"y\KJW_Tracking\addons\core\data\footprint_l_ca.paa"];
} else {
_obj = createVehicleLocal ["UserTexture1m_F",position _x vectorAdd [0.2,-0.2] ,[],0,"CAN_COLLIDE"];
_obj setObjectTexture [0,"y\KJW_Tracking\addons\core\data\footprint_r_ca.paa"];
};
if (_footTracker >= 10000) then {
_footTracker = 0;
};
_obj setDir _dir;
_obj setVectorUp ([surfaceNormal _pos, 90, 2] call BIS_fnc_rotateVector3D);
_obj setObjectScale 0.3;```
private _pos = getPos player;
private _dir = getDir player;
private _vector_dir = surfaceNormal _pos;
private _vector_up = _vector_dir vectorCrossProduct [sin _dir, cos _dir, 0] vectorCrossProduct _vector_dir;
_obj setVectorDirAndUp [_vector_dir, _vector_up];
Something like this, didn't test
Might have messed up vector order in that cross product chain
will test now, thank you muchly
despite being a physics student (im transferring) i am terrible at vector math
(hence the transferring)
i think they may be upside down
_vector_dir vectorCrossProduct (_vector_dir vectorCrossProduct [sin _dir, cos _dir, 0])
Try this then
[sin _dir, cos _dir, 0] vectorCrossProduct _vector_dir vectorCrossProduct _vector_dir; or this, same thing but without parentheses
Gonna test myself in a bit
are you sure dir should be surfacenormal? makes no sense to me but it probably does to you
What's the issue here?
You want user texture to lay on the ground and its right up in the model
So its up vector should be along the ground and its dir vector perpendicular to the ground
How does the texture look like without any rotation?
that
wait is sqfbin gone π₯Ή
Then dir is either surf normal or its reverse (depending where you want the right vector to be)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Looks ok, probably still wrong cross product order
ive not had to touch vectordirandup since capital ships last year
I'll check it myself in a bit
private _pos = getPos player;
private _dir = getDir player;
private _vector_dir = surfaceNormal _pos;
private _vector_up = [sin _dir, cos _dir, 0] vectorCrossProduct _vector_dir vectorCrossProduct _vector_dir;
createVehicle ["Sign_Arrow_F", _pos, [], 0, "CAN_COLLIDE"] setVectorDirAndUp [_vector_dir, _vector_up];
pos = getPos player;
onEachFrame {
private _pos = getPos player;
if(pos distance _pos > 0.5) then {
pos = _pos;
private _dir = getDir player;
private _vector_dir = surfaceNormal _pos;
private _vector_up = [sin _dir, cos _dir, 0] vectorCrossProduct _vector_dir vectorCrossProduct _vector_dir;
createVehicle ["Sign_Arrow_F", _pos, [], 0, "CAN_COLLIDE"] setVectorDirAndUp [_vector_dir, _vector_up];
};
};
Might be upside down though
π¨πΏπ¨πΏ done for you
im so confused its still not working
i need to find something directional
errrrrr
it should be correct
i think
no wait
it is upside down
ok time for the most elementary question ever:
how do i flip it
Good to hear that you care about BE
pos = getPos player;
onEachFrame {
private _pos = getPos player;
if(pos distance _pos > 1) then {
pos = _pos;
private _dir = getDir player;
private _vector_dir = surfaceNormal _pos;
private _vector_up = _vector_dir vectorCrossProduct [sin _dir, cos _dir, 0] vectorCrossProduct _vector_dir;
private _obj = createVehicle ["UserTexture1m_F", _pos vectorAdd [0,0,0.1], [], 0, "CAN_COLLIDE"];
_obj setVectorDirAndUp [_vector_dir vectorMultiply -1, vectorNormalized _vector_up];
_obj setObjectTexture [0, "\A3\ui_f\data\map\vehicleicons\iconPlane_ca.paa"];
};
};
Here you go, vector_dir needed to be flipped for texture to be on the right side
ah yay, works perfectly now, thanks for the help π π«
awesome π
pretty sure this'll end up killing performance but oh well
ive capped it at 1k step objects
Spawn 10000 and see how much it affects the FPS, probably not that much
Also try simple objects, when created from class they're also retexturable
Probably won't be much difference
impacts performance a decent amount at even 1000
i take a ~50fps drop
i expect decals will be more performant but i cant find docs on them
Does it when they're away from camera?
and beyond view distance
Speaking of decals, how come there is no decal user texture object? Would be super useful!
when hidden, barely anything
when out of render, nothing
so yeah ill be fine lmao
may bump to 10k then
suppose simple objects makes setobjectscale infinitely easier too
Yeah, doesn't reset by itself
even at 100k its fine so long as theyre not all on top of one another
so ill just stick it at 50k
probably fine
500 units get 100 steps each that way, should be somewhat decent
are you sure? doesnt seem to work properly 
pos = getPos player;
onEachFrame {
private _pos = getPos player;
if(pos distance _pos > 1) then {
pos = _pos;
private _dir = getDir player;
private _vector_dir = surfaceNormal _pos;
private _vector_up = _vector_dir vectorCrossProduct [sin _dir, cos _dir, 0] vectorCrossProduct _vector_dir;
private _obj = createSimpleObject ["UserTexture1m_F", ATLtoASL(_pos vectorAdd [0,0,0.3])];
_obj setVectorDirAndUp [_vector_dir vectorMultiply -1, vectorNormalized _vector_up];
_obj setObjectTexture [0, "\A3\ui_f\data\map\vehicleicons\iconPlane_ca.paa"];
};
};
if (_footTracker mod 2 != 0) then {
_obj = createVehicleLocal ["UserTexture1m_F",position _x vectorAdd [-0.1,0.4,0],[],0,"CAN_COLLIDE"];
_obj setObjectTexture [0,"y\KJW_Tracking\addons\core\data\footprint_l_ca.paa"];
} else {
_obj = createSimpleObject ["UserTexture1m_F",position _x vectorAdd [0.2,-0.2], true];
_obj setObjectTexture [0,"y\KJW_Tracking\addons\core\data\footprint_r_ca.paa"];
};```
π
createSimpleObject only takes ASL coordinate
aaaaaah
of course
sorry its 8am and ive not been to sleep
(clearly)
wicked, thanks π«
this is even better at night lol
I do some stuff with setTerrainHeight in my mission file.
I just had somebody spawn in who couldn't see the terrain changes, this is 1 person out of 30 or so.
Known bug? Any known fixes?
He re-logged and now he can see it
Hi, I want to add an action like opening a box on the map, which forces the player to rotate the view 10 degrees down (like using ALT), is there any command that can help me with this?
This can happen in the middle of combat and I just want him to lower the view while doing the action.
On server, runs at server start before anybody can join the server. He was lagging really badly when downloading mission file he said
But urm, that's not the question, how do you run it?
Hm any chance someone here has experience with https://community.bistudio.com/wiki/playMission ?
Does it work outside of the main menu or only there? Hoping to start another mission right after the first one (an intro mission) is finished
already looked online and didnt see much except for it being possible when they're organized as a campaign, but thats not really feasible at the moment
Arma'd
Man using public vars to start certain movements from a script feels so dirty π
RE playMove/switchMove instead?
I'm using it for a multiplayer intro with multiple people, where all players get led through the intro with camera cuts etc. using initPlayerLocal
this felt like the most straightforward way to have the only the first person that reaches a point 'executing' certain voicelines/animations, rather than every player executing them themselves
Thats what I'm actually using in the units init to start the animation, the publicvar acts as the 'timer' it waits for
[] spawn {
waitUntil {sleep 1;pie_intro_csat_anim_1_bool};
intro_csat_soldier switchMove "Acts_Abuse_Lacey";
intro_csat_soldier enableSimulationGlobal true;
};
this disableAI "ALL";
It seems to be working fine for now but its very timing dependent of course, although I used to just have sleeps in the unit init too so this is better than that at least
this is what the intro script actually looks like
ah I forgot that sqf doesnt get file previews π€
Its definetly not a 'nice' workaround imo, but it does what it needs to
If anyone knows a better way to do it do let me know 
I guess I could outsource it into its own fnc which then checks if its already been executed π€ , but that'd add a good bit of complexity
Is there a way to disable the scroll menu?
Trying to make it so when youre in cuffs you cant eject, or getout
also double tapping v should be disabled
Because this isnt working and i dont know why
if (isNull objectParent player && {life_disable_getOut}) then {
player moveInCargo _vehicle;
};
if (!(isNull objectParent player) && {life_disable_getOut} && {(driver (vehicle player) isEqualTo player)}) then {
player action["eject",vehicle player];
player moveInCargo _vehicle;
};
if (!(isNull objectParent player) && {life_disable_getOut}) then {
_turrets = [[-1]] + allTurrets _vehicle;
{
if (_vehicle turretUnit [_x select 0] isEqualTo player) then {
player action["eject",vehicle player];
sleep 1;
player moveInCargo _vehicle;
};
}forEach _turrets;
};
if (_target getVariable ["playerSurrender", false]) {
if (!(currentWeapon _target isEqualTo "")) exitWith {
NOTIFY("You can't knock someone out when they have a gun in their hand.","red");
};
};``` Also above keeps giving this error:
indeed
You either need to have a ; or a command inbetween there
all your other things are if () then {}
But your last one is if () {}
There's something missing
ACE I think has a hacky way to disable scroll menu, by blocking the mouse cursor in a UI ? Don't know how that works exactly
Yeah couldnt find anything usefull online
Hello again,
I am trying to spawn a helmet as a simple object to be a decoration item so players can't interact with it, and I'm having trouble spawning the exact variant I want [There are multiple camos of the same helmet].
_marineHelmet = createSimpleObject ["\OPTRE_UNSC_Units\Army\helmet.p3d", (getPosASL dressUiformPad) vectorAdd [0, 0, -0.15]];
_marineHelmet setDir 45;
I tried using setObjectTexture but it didn't work, is there a way to do so? or am I stuck with the default variant?
Might make more sense to use the classname if the variant you want has its own, or?
or does it not have one?
_captainHelmet = createSimpleObject ["OPTRE_UNSC_CH252_Helmet_MAR", (getPosASL dressUiformPad) vectorAdd [0, 0, +0.20]];
_captainHelmet setDir 45;
Does not seem to work, it seems it only takes the p3d file?
Doesn't seem to work with items/headgear
Even tried a Vanilla H_Cap_marshal
Ooh maybe it just takes 'real' objects like vehicles, etc
iirc item style objects are a bit funky sometimes π€
Yea, would make sense
Do you know of a way to spawn it as an item but still prevent players from picking it up?
is it available in the 3den editor as an object? if so might be able to just disable its simulation
that'd be my first guess at least
Negative :(
if (_target getVariable ["playerSurrender", false]) then {
if (!(currentWeapon _target isEqualTo "")) exitWith { NOTIFY("You can't knock someone out when they have a gun in their hand.","red") };
};```
like this? im tired lol
hm, maybe create it as an item on the ground then, get the weaponholder its in and disable the simulation of that π ? Maybe someone smarter here has a better idea
2nd if is borked
Without testing this should be it
if (!(currentWeapon _target isEqualTo "")) then {exitWith {NOTIFY("You can't knock someone out when they have a gun in their hand.","red") };};
Will try that, thanks.
Any idea if I will have control over the rotation and looks of that?
wrong. exitWith is alternative for then
Probably fixed it with this lol
if (!(_target getVariable ["playerSurrender", false]) && { !(currentWeapon _target isEqualTo "") } ) exitWith { NOTIFY("You can't knock someone out when they have a gun in their hand.","red") };
Huh TIL
Eeh I dont think soo? maybe? not sure
been a while since I tried doing stuff with them but my experiences werent great
Get model from CfgWeapons
I have the mode, but the model is another variant
_marineHelmet = "groundweaponholder" createVehicle getpos downloadHelmetPad;
_marineHelmet addItemCargoGlobal ["OPTRE_UNSC_CH252_Helmet_MAR",1];
_marineHelmet attachTo [downloadHelmetPad,[0,-0.7, -0.76]];
_marineHelmet enableSimulationGlobal false;
detach _marineHelmet;
// set exact yaw, pitch, and roll
_yaw = 0; _pitch = 90; _roll = 85;
_marineHelmet setVectorDirAndUp [
[sin _yaw * cos _pitch, cos _yaw * cos _pitch, sin _pitch],
[[sin _roll, -sin _pitch, cos _roll * cos _pitch], -_yaw] call BIS_fnc_rotateVector2D
];
This seems to work
The action to pick up is still there but it won't work
Hmmm but if the player interacts with it, it will disappear well damn
Is there a way to remove ALL actions from an object? even default ones?
No
a work around seems to be setting damage to 1
_marineHelmet = "groundweaponholder" createVehicle getpos downloadHelmetPad;
_marineHelmet addItemCargoGlobal ["OPTRE_UNSC_CH252_Helmet_MAR",1];
_marineHelmet attachTo [downloadHelmetPad,[0.4,-0.5, -0.76]];
_marineHelmet enableSimulationGlobal false;
detach _marineHelmet;
_yaw = 0;
_pitch = 90;
_roll = 85;
_marineHelmet setVectorDirAndUp [
[sin _yaw * cos _pitch, cos _yaw * cos _pitch, sin _pitch],
[[sin _roll, -sin _pitch, cos _roll * cos _pitch], -_yaw] call BIS_fnc_rotateVector2D
];
_marineHelmet setDamage 1;
[_marineHelmet, _marineHelmet] call ace_common_fnc_claim;
This is the final version I ended up with
Pretty much makes it so the object can not be interacted with by a player even with ACE.
@vocal mantle Just looked at the code now, and that thing is weird indeed. I suggest attaching the debugger to the arma process with a breakpoint on RVExtension and keep a close eye on output. Also noteworthy is checking the error code from strncpy_s (you think you can get away without it?) or use strcpy since the source is a literal. Oh and, I suspect you may want to .detach() the thread.
std::thread::~thread Destroys the thread object. If *this has an associated thread (joinable() == true), std::terminate() is called.
use exitWith to exit from the current scope
avoid using slow commands like createVehicle
createVehicle [] is faster
always make local variables private
cache calculated results in the vars, for example you calculate cos of _pitch 3 times
if (!(isNull objectParent player) && {life_disable_getOut} && {(driver (vehicle player) isEqualTo player)})```
what is this?
If you're trying to use lazy evaluation it's used incorrectly
if (a && {b} && {c}) then {};
should be changed to
if (a && {b && {c}}) then {};
lazy eval with checking a global variable doesn't make sense (unless you expect it can be nil).
Doing the lazy eval is more expensive than just checking the variable (unless you get SimpleVM in a loop, but that code there doesn't)
Also that code is checking the same two conditions, 3 times. Instead of just making a nested if and checking it once
Anyone know how the map handles zooming?
My custom zooming function runs on this event
G_RSPWN_HALO_MouseMD_EVH = _Disp displayAddEventHandler ["MouseZChanged", Fnc_RSPWN_HALO_MapCtrl_MouseMD];
for a custom map control created on a rsc layer :
"ScreenRscLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN", -1, TRUE];
_Disp = uiNamespace getVariable ["RscTitleDisplayEmpty", displayNull];
(_Disp displayCtrl 1202) ctrlshow FALSE;//hide vignette
uiNamespace setVariable ["G_Disp_RspwnScreenRsc", _Disp];
map control :
private _Disp = uiNamespace getVariable ["G_Disp_RspwnScreenRsc", displayNull];
//-------------------------------------------------------------
_Ctrl = _Disp ctrlCreate ["RscMapControl_2", _IDC];//MAP
_Ctrl ctrlMapSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];
_Ctrl ctrlEnable FALSE;
_Ctrl ctrlShow TRUE;
ctrlMapAnimClear _Ctrl;
_Ctrl ctrlMapAnimAdd [0, 0.50, [worldSize/2, worldSize/2]];
_Ctrl ctrlMapAnimAdd [1, 1.00, [worldSize/2, worldSize/2]];
ctrlMapAnimCommit _ctrl;
_Disp setVariable ["G_CtrlMap", _Ctrl];
behind a full screen Overlay on the same layer
Fnc_RSPWN_HALO_MapCtrl_MouseMD handles zooming for me, it's kinda satisfactory but doesn't feel like the original zooming. is there a way to see how the original zooming is implemented?
this is the custom zooming function:
Fnc_RSPWN_HALO_MapCtrl_MouseMD = {//call
//-------------------------------------------------------------
disableSerialization;
//-------------------------------------------------------------
params ["_DispDia", "_dPz"];
//-------------------------------------------------------------
if(_dPz == 0) exitwith{};
//-------------------------------------------------------------
_sign = [-1,1] select (_dPz < 0);
//-------------------------------------------------------------
private _DispRsc = uiNamespace getVariable ["G_Disp_RspwnScreenRsc", displayNull];
private _CtrlMap = _DispRsc getVariable ["G_CtrlMap", controlNull];
private _nZoom_Min = 0.001;//0.075//0.001
_Zoom_0 = ctrlMapScale _CtrlMap;
_Zoom_F = ((_Zoom_0 + _sign*_Zoom_0*0.075) min 1) max _nZoom_Min;
if(_Zoom_0 == _Zoom_F) exitwith{};
getMousePosition params ["_MPx", "_MPy"];
_aPos_Map_Center = [worldSize/2, worldSize/2, 0];
_aPos_Fixed_Full = _CtrlMap ctrlMapScreenToWorld [_MPx, _MPy];
_aPos_Fixed_Full = [_aPos_Fixed_Full#0, _aPos_Fixed_Full#1, 0];
_Dist_Fixed_Full = _aPos_Map_Center vectorDistance _aPos_Fixed_Full;
_Dist_Fixed_Trunc = linearConversion [1, 0, 0.001, _Dist_Fixed_Full, 0, FALSE];
_vDir_Center_Fix = _aPos_Map_Center vectorFromTo _aPos_Fixed_Full;
_aPos_Fixed_Trunc = _aPos_Map_Center vectorAdd (_vDir_Center_Fix vectorMultiply (_Dist_Fixed_Full - _Dist_Fixed_Trunc));
_aPos_Scrn_Center = vectorLinearConversion [1, _nZoom_Min, _Zoom_F, _aPos_Map_Center, _aPos_Fixed_Trunc, FALSE];
ctrlMapAnimClear _CtrlMap;
_CtrlMap ctrlMapSetPosition [];
_CtrlMap ctrlMapAnimAdd [0, _Zoom_F, _aPos_Scrn_Center];
ctrlMapAnimCommit _CtrlMap;
_aPos_Scrn_Center = _CtrlMap ctrlMapScreenToWorld [0.50, 0.50];
_aPos_Fixed_Full = _aPos_Scrn_Center vectorAdd (_vDir_Center_Fix vectorMultiply (linearConversion [1, 0, (ctrlMapScale _CtrlMap), _Dist_Fixed_Full, 0, FALSE]));
setMousePosition (_CtrlMap ctrlMapWorldToScreen _aPos_Fixed_Full);
//-------------------------------------------------------------
};
hello gamers I have a lil question about else if configs; I know it might not be the most efficient way of doing it but I can't really think of anything else. I have an issue with the else part, it says its undefined, though I've followed the example in the wiki
_tex = getObjectTextures _vehicle;
if(_tex select 10 == "jsdf_vehb\SUB\SUB_d0_co.paa") then
{
[_vehicle] execVM "\JSDF_VehB\SUB\no_SUB_b.sqf";
//[_vehicle] execVM "\JSDF_VehB\SUB\body_SUB.sqf";
};
if(_tex select 10 == "Sparky_JSDF_overhaul_vehicles\Content\Sparky_JSDF_Type73_UN_co.paa") then
{
[_vehicle] execVM "\JSDF_VehB\SUB\no_SUB_b.sqf";
//[_vehicle] execVM "\JSDF_VehB\SUB\body_SUB.sqf";
};
else
{
[_vehicle] execVM "\JSDF_VehB\SUB\no_SUB.sqf";
};```
I have 2 scripts that change the license plate of the vehicle, one uses white numbers and the other uses black numbers, what I want to do is if it detects the desert or UN skin it applies the black numbers, if its anything else, the white numbers. Is what im trying to do doable or do I need to define every texture instead?
There shouldn't be a semicolon before the else
ah
Your use case should be a switch with a default
taking a look at https://community.bistudio.com/wiki/switch, I'm not sure I understand how it works
switch (floor random 5) do
{
case 1: { hint "one"; };
case 2: { hint "two"; };
default { hint "zero, three or four" };
};
it checks the thing in the brackets next to the switch and goes through the different cases
if the value of the thing in the switch brackets equals one of the case values it goes in that piece of code
if none fit it goes into the default code
and if you remove the default code, it does not run anything and goes through
so how would it apply to texture selected and script applied?
switch (_tex select 10) do
{
case "jsdf_vehb\SUB\SUB_d0_co.paa";
case "Sparky_JSDF_overhaul_vehicles\Content\Sparky_JSDF_Type73_UN_co.paa": { hint "string1 or string2" };
case "string3";
case "string4": { hint "string3 or string4" };
case "string5"; // will never enter default's code
default { hint "default" };
};
and so on
switch (_tex select 10) do
{
case "texture\1.paa": { /*code */ };
case "texture\2.paa": { /*code */ };
}
```basically yeah
Oh I see
well in this case I have to define every texture manually BUT i assume its a lot more efficient and performance easy than using else ifs
its basically just if's chained together in a nicer way
its also just a lot nicer to write and understand
right, many thanks :)

I have this 95% figured out, it seems I'm not defining the vehicle correctly...
_tex = getObjectTextures _vehicle;
switch (_tex select 10) do
{
case "\jsdf_vehb\SUB\jsdf_vehb\SUB\SUB_d0_co.paa": { _this execVM '\JSDF_vehB\SU\no_SU_b.sqf' };
case "\Sparky_JSDF_overhaul_vehicles\Content\Sparky_JSDF_Type73_UN_co.paa": { _this execVM '\JSDF_vehB\SU\no_SU_b.sqf' };
default {hint "default"};
} ```
whenever I start the mission i get the "default" hint, which leads me to believe the other conditions are not being awknoledged
the switch case is case-sensitive, you can use toLowerANSI
How are you passing arguments to this script?
how exactly do it that?
_this toLowerANSI ?
Then the vehicle definition is correct
The documentation for the init EH does say that it's better to use postInit when working with textures. Perhaps the textures aren't set properly yet.
I've checked the capitalization and ran it with postInit and it still does not work. It keeps using the default value. I just don't know what's wrong with it
add some systemChat to display the values of important things
e.g. systemChat typeOf _vehicle, systemChat (_tex select 10)
welp, I made it work with else if
might not be the prettiest solution but it works
thanks for the help tho ^_^
given arr performance is n^2 is it better to break arrays down into multiple arrays if im limiting the number of entries it can have?
depends what you're doing with it
previously had all the steps collected into a huge array and was deleting out of that instead 
it hurts my eyes 
because of the macro usage or the code
neither. the font π
oh π
man's coding in an entirely different game universe, hot damn
so you want to break it down due to reaching the 500 elements limit?
no thats what im doing now; previously i was pushing all the steps into one big array and limiting that array to 50k elements instead
im not sure which is better performance wise
from changing it and playing liberation it seems to be better with this but i feel something could be better
when you do deleteAt 0 you also force the array to shift (do memory copies/moves)
instead just check the size and use set
yeah ive been told to do deleteVehicle (_steps deleteAt 0);
how's that any different?! π
one less select
I'm talking about the memory copy
You know it's always the font lol
x39 hates macros so i thought leopard may be in the same boat
you can do:
if (count _steps >= 500) then
{
_nextStep = (_nextStep + 1) % 500;
deleteVehicle (_steps#_nextStep);
_arr set [_nextStep, _obj];
}
else
{
_nextStep = _arr pushBack _obj
};
that looks like more commands to me
you also have to use another var to remember where the newest element was inserted
yes but because you won't do deleteAt 0 the game doesn't have to shift the array
so in the end it's faster for large arrays
even for 50k elements
ah right
you can reserve 50k elements in your array to prevent memory copy/move during the game
so i would need to be setting nextstep as a variable on the unit?
// run once
_arr resize 5e4;
_arr resize 0;
well in your previous attempt, was the 50k array just a global array?
yuh
then you can go back to that and just use a global var for nextStep too
and also run this once to reserve 50k elements for your array
so _nextStep just needs to be kept as a gvar right
ofc instead of 500 you need to use 50k here
ya
yeah
roger
does that reserve the space or something
if you run that code from multiple scheduled scripts you'll also need an isNil to make it "atomic"
i dont touch the scheduler
yeah. it allocates 50k elements in the array then just clears it. the game won't have to allocate anything for that afterwards
roger
I need to make a building slingloadable.... How do I do it?
attach it to a slingloadable obj?
if you're talking about terrain objs you can't move those tho
(however you can hide them and create a copy instead)
lol
I heard about a recentrly declassified CIA operation, where they flew in a chinook and grabbed an entire radar complex off of the russians, after a strike team had wiped the small island...
Wanted to recreate something along those lines
oh thats so much better
thanks leopard
oh wait its probably because its not creating anything
btw is the totalSteps arrays for all units or just the player?
but in that case some units might have 10000 steps while some 10 π
so I guess you should just go back to the previous one since it makes more sense
well the approaches are different tho
yeah
if you don't care how many steps each unit creates you can use the global one
really i just care about performance
but I guess it won't matter much 
resizing the array will still be better for performance regardless wont it
altho 50k objects are slow either way 
if i do individual
for 500 elements it won't matter much
yeah just got back on lib and its immediately already suttering again
i shall revert to the previous version
well yeah like I said the first one creates at most 500 steps per unit
if youre deleting that many objects iterating through allunits for them wont be that big of a deal anyway
if you only have 10 units in the mission you won't go beyond 5000
but with the global array, one unit can create 50k elements by itself 
probably makes more sense then right
yeah
should i change the unit steps array to resize to 500 then 0 like the global or is performance nbd for that
combine it with the set and I guess resize one too to minimize performance impact
won't matter much but you can do that yeah
or just reserve 250 elements at first
why 250?
it will become 500 the next time the array grows π (iirc growth factor was 2 for A3 arrays)
meh just reserve 500 from the start. it won't matter much anyway
you can use the EntityCreated EH to init the array
nah im gonna do some cursed shit π
i fucking LOVE untyped variables it lets me do this stupid shit
why do you reserve 5000 tho 
also you're still not using the set 
correct im very lazy
Could it just insert 0 and delete last if the array count is 500
_index = count _array;
If (_index > 499) then {
_array deleteAt -1;
};
_array insert [0,[_step]];
So newest is 1 and deleting last?
it will still shift the array
True
the reason I recommended set was to avoid that and save on memory bandwidth (which is Arma's greatest weakness)
it's simple. let's say you want 4 elements at most:
[a1, a2, a3, a4]
now when you insert the last element via pushBack, the next index becomes 3, and count is 4
so you enter the set part
now let's insert a5:
(_next + 1) % 4 becomes 0
so now the array is
[a5, a2, a3, a4]
and next time:
[a5,a6,a3,a4]
it's just a "circular" buffer
oh you mean the implementation nvm π
you can still save some more performance
the code is wrong btw π
#define MAX_STEPS 500
private _steps = _x getVariable [QGVAR(steps), false];
if (_steps isEqualType false) then
{
_steps = [];
_steps resize MAX_STEPS;
_steps resize 0;
_x setVariable [QGVAR(steps), _steps];
_x setVariable [QGVAR(nextStep), MAX_STEPS - 1];
};
if (count _steps >= MAX_STEPS) then
{
private _nextStep = _x getVariable QGVAR(nextStep);
_nextStep = (_nextStep + 1) % MAX_STEPS;
deleteVehicle (_steps#_nextStep);
_steps set [_nextStep, _obj];
_x setVariable [QGVAR(nextStep), _nextStep];
}
else
{
_steps pushBack _obj;
};
you don't have to get default for QGVAR(nextStep) and you don't need to do setVariable for _steps at the end anymore
ah thanks π
that would explain why my frames were slowly dying
shall test now and see how it goes, thanks leopard π«
btw if you use true or false for default value of steps that'll be even faster
(Dedmen recently made them constants)
oh word
added that too
hehehehehehe
why do you still getVar nextSteps there? 
just do this
errrrrrrrrrrrrrrrrrrr
just copy paste it π
it's 100% correct
then i have to make your brackets be on the same lines π
i jest i copy pasted it anyway
How do people code in vscode? Is there an injector or something or you can actually easily script if you run it via dedicated server?
I wouldn't know. I just use it as a text editor.
Edit & retest process is acceptably fast with filepatching.
Out of RAM? :P
possibly..? i didnt check
shouldnt be that many objs tho
then again i suppose 500 per unit is a bit much
wonder if i just saved the spatial data rather than the objects then created the footprints on tracking.......?
kjw thats a much better idea youre really stupid
or actually is it better
creating/deleting up to 500 is a lot
probably
I don't know what you're doing but it sounds cracked.
kjws tracking
i was originally creating simple objects for every single footstep every single unit took
thats such a bad idea when i can just save the positional data
...yes
kjw moment
Does anyone know how smoke works with the AI? Could you slap down a bunch of smoke particle emitters manually to block line of sight?
I'm curious for reasons of making an analogue of the soviet RDG-M grenade, which makes a big smoke puff instead of a long extended smoke cloud
If the particle has the blockAiVisibility option yes it can block AI visibility
smoke particles should have that option
Okay, now just wondering how fast this can make an AI stop shooting
hello friends
Im new to scripting and needed help
object scaling is resetting and its just not working
when i change the object scale in eden it will reset and it does the same with the scripts
this happens when i enter zeus while running it on mp
Setting scale is very limited, most reliably works on simple objects
Otherwise you'll need scripts to do it each frame
You can do it in mp by attaching an obj to something else before scaling it. Then move the attached obj. That's the best you can do
Can I assume from that that projectils won't damage anything with explosion indirectHit x 4 meters away from it?
in theory
I guess I should also take object's bounding sphere size into account?
Making a crutch to properly pass missile info into HitPart and Explosion EHs since the fix didn't make it into 2.16 
yeah its also a bit unpredictable especially if you're like conisdering individual hitpoints on a vehicle
or the crew of said vehicle
Well having it approximate could be enough
like say a HE round hits a transport plane, if the range is short enough it'll only injure those near it
but im unsure if it follows the same range*4 formula
Well, I guess I gotta go with rough estimate until its properly fixed
Seeing how often exitWith {} is used to exit the scope, I wonder if having something like
exitIf(count _candidates == 0);
```would be noticeably faster than
```sqf
if(count _candidates == 0) exitWith {};
```by having no exit code scope creation and calling
breakIf BOOL and continueIf BOOL for cycles too

We are probably doing that badly. Can probably optimize that.
Not sure what you mean. Ther is a debugger but not an injector.
What would an injector be, whatn do you have in mind?
nope its a memmove
just a question as my brain froze on this. whats the best way to ,via scripted wp's,get a group into a specific vehicle?
id like to change this:
_wp = Alpha1 addWaypoint [position EXFIL, 0];
_wp setwaypointtype "GETIN NEAREST";
_wp = Alpha1 addWaypoint [position FOBA1, 0];
_wp setwaypointtype "GETOUT";
change "get in nearest" to "get in". but how do i syntax it to a specific vehicle?
is this the best way?
_wp setWaypointStatements ["true", "{_x assignAsCargo car} foreach units _mygroup;"];
you can attach the waypoint to the vehicle π
it isnt done with editor wp's
can i attatch it via code?
Hm any chance anyone here has experience with the 'Sector' Modules? Currently using them in a mission and I'd like to 'lock' the sector once it has been captured by a certain side
is there a script command that allows me to dump the entire config class of a vehicle to the clipboard or rpt?
i need to check all the config entries for a vehicle but config viewer makes my eyes bleed for this sort of thing
π€ @jade acorn
I don't know how to enter the vehicle in the east wind, which locks all the vehicle. Please tell me what command can solve it?
thanks
keep in mind, that a1.54 has string/array size limitation so use it on single class
or use 1.52 exe
if campaign restricts you from getting into a vehicle then you should not get into it.
otherwise you'll break something and then you will come and complain that the campaign is bugged
it was a huge array running a deleteAt for every unit every 0.6 seconds lol
bad performance for that is to be expected
i did however not need to do that because i just needed to store positional data
dunno whether i need to cap that off or not given its just a few bytes of information per footstep
I thought the point was to show the footsteps themselves
yeah but only once you start tracking the unit
so i couldve just created the footsteps on the unit tracking start lako
lmao
(thats what im doing now)
though im unconvinced the performance hit of limiting the positional data is worth it
performance hit of limiting
hit? or improvement?
hit
given its just saving an array of like
1 position arr, a direction scalar and a footcounter scalar i dont even need
thats like one byte of data
versus the array rejigging bits still costs perf
one byte of data :D
i feel like this is a reference to something i am missing
whether its my own stupidity or nit
SQF works out as something like 48 bytes to store a scalar.
GameValue wrapper, value, etc
this pains me
yes
anyway
still relatively insignificant stuff on the whole
if you want closer to C++ memory management, try Arma Reforger π
im not allowed to respond in appropriate manner in this discord i would get muted
either way the mod works rn without utterly desecrating fps any more so i should probably leave it as is
use intercept 
i dont want to use intercept
he knows
ive blacklisted myself from writing c# for the next 5 months
i just end up writing code for my unit and not running the unit
how about a no :3
SQF performance for you then
We are trying to build little bunker under ground where people can walk around (Basically building full thing on top then shifting it under), Is there going to be a problem with placing players below terrain ?
You can deform the terrain to simulate a hole or make a terrain that has a terrain depression where you can put your "underground" structures but I don't think there such thing as players/vehicles bellow terrain and working correctly...
yes am aware of the deform option and its a backup plan, but placing the bunker below ground and then moving players there work fine, but i want to ask devs if there isnt going to be any engine issues with that
Any ideas how to work around knowsAbout, it works for units that are alive, but Id need something that will act the same way for bodies as well. The target could be dead or alive when found. Anything more clever than checking for cursorTarget or something?
@pliant shell (configFile >> "CfgVehicles" >> "MyVehicle") call dumpconfig
thanks
What? You placed the bunker below ground and moved players there and it worked? Can you show a pic?
there will be problems. soldiers and vehicles are programmed to have an min altitude of zero above ground, can't go below
@still forum Yeah, your solution worked. Although I wrote it like outputSize -= 1; Edit: Just realized that our solutions are not the same. Mine is shrinking output size while yours is null terminating the string.
@gray bramble I have never had issues with strncpy_s. I am only using it because VS recommends it and many others have used it in extensions without fail.
nothing wrong with strcpy you just have to remember the null terminator
The code you linked, that was the exact code that crashed?
yes, but that was not the issue. I commented out all instances of strcpy and still crashed. @gray bramble yes. that and all other changes until I added outputSize -= 1; at the start of RVExtension()
Hello, I'm new to sqf and im trying to figure out how to do functional programming here.
dismemberment is kind of my main thread. I have an XHE_init.sqf that executes it at launch and nothing happens, no error just that the mod doesnt work.
when I try to call:
"\dismemberment\scripts\dismemberment.sqf" remoteExec ["execVM",0];
it says I have an undefined variable at call #|fnc_addClientHandlers
are you preloading them correctly?
https://community.bistudio.com/wiki/Function#Call
do I have to do it everywhere I call them?
I think your XEH and CBA stuff is all messed up
you should only be using
XEH_postInit.sqf
XEH_preInit.sqf
XEH_PREP.hpp
XEH_preStart.hpp
in conjunction with
class Extended_PreStart_EventHandlers {
class ADDON {
init = "call compileScript ['XEH_preStart.sqf']";
};
};
class Extended_PreInit_EventHandlers {
class ADDON {
init = "call compileScript ['XEH_preInit.sqf']";
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = "call compileScript ['XEH_postInit.sqf']";
};
};
actually, while you might want to jump into the CBA stuff, why don't you try to create something using the default CfgFunctions for defining functions to start with
because its a pain
and I dont want my functions to be all public
isn't there a way to preload everything from the get go?
using XEH_PREP.hpp but you have to make sure your PREP define is set up right:
example:
#ifdef DISABLE_COMPILE_CACHE
#undef PREP
#define PREP(fncName) TRIPLES(ADDON,fnc,fncName) = compile preprocessFileLineNumbers QUOTE(functions\DOUBLES(fn,fncName).sqf)
#else
#undef PREP
#define PREP(fncName) [QUOTE(functions\DOUBLES(fn,fncName).sqf), QFUNC(fncName)] call CBA_fnc_compileFunction
#endif
btw the cba stuff it would be great if you explainedd what should go where in general
you making an addon or mission?
I'm kind of confused on what theese are
I've seen the same strucutre in some ace addons to
addon
basically, there are two ways that the CBA system defines functions.
1.) compiling without final: allows you to modify them on the fly while testing
2.) compile final: locks the function so that no one can modify
That is what DIABLE_COMPILE_CACHE is doing
what do you mean by public, public in the mod structure terms, or public as in "i don't want people to see my functions and possibly copy them"
having trouble identifying how to reduce the Kamysh ATGM titan missiles to a specific number, 1, in this case
this setMagazineTurretAmmo ["2Rnd_GAT_missiles_O", 1, [0]];
this works fine,but there are two turrets with the same classname?
each turret has a specific count
Change [0] part
ah thank you
I'd prefer to optimize the internal implementation for the exitWith {} than having another one construction which doing the same but a little bit faster and differs visually. Is creating the empty scope really noticeable?
I need 'return' command π
[0} references position correct? so 1 would be the other turret? iv attempted this but it isnt working
this setMagazineTurretAmmo ["2Rnd_GAT_missiles_O", 1, [0]]; this setMagazineTurretAmmo ["2Rnd_GAT_missiles_O", 0, [1]];
Should be and can't say yes since I don't exactly know what are you trying
allTurrets or some command returns all supported turrets on the vehicle so you my get a clue
the syntax is in the vehicle init,just trying to reduce available ATGMs total number to 1
cheers il check that
Does anyone know how to convert from object relative coords to object selection relative coords?
I'll bet you anything the Kamysh doesn't have two turrets with the same classname.
I think what you've seen is that its default loadout includes two of the same magazines for the ATGM launcher (one in the launcher, one in reserve).
If you want to set the total missile count to 1, you need to remove one of the magazines entirely (removeMagazineTurret), and then use setMagazineTurretAmmo on the remaining one.
I'm pretty sure the Kamysh's main turret has path [0], so the correct code would be:
this removeMagazineTurret ["2Rnd_GAT_missiles_O",[0]];
this setMagazineTurretAmmo ["2Rnd_GAT_missiles_O",1,[0]];```
@sullen marsh @grizzled cliff is there an intercept discord?
OH quite clever approach. iv been doing some testing and found interesting results with the BTR-K vs BTR-T. The BTR-T has 4 HEAT(VERONA) rounds which have a higher potential damage vs other Armor,compared to the Titan of the Kamysh,however, even in a 3(kamysh) VS 3(Mora) (with an EH for some damage reduction to keep the mora alive longer) the Kamysh with its Titans far outperforms the Iskatel BTR-T
Im attempting to reduce lethality on OPFOR vehicles
iv checked the WS vehicle classnames pagehttps://community.bistudio.com/wiki/Western_Sahara_classNames#Weapons_and_Equipment it doesnt seem to list the BTR-T turret
trying to do a similar thing with it as the Kamysh
actually this is SHOWING one missile but it never loads
this removeMagazineTurret ["2Rnd_GAT_missiles_O",[0]];
this setMagazineTurretAmmo ["2Rnd_GAT_missiles_O",1,[0]];
The Iskatel's weapons are on that page.
autocannon_30mm_lxWS
missiles_Vorona_vehicle_lxWS
To quickly find a vehicle's weapons, you can place it in the Editor, rightclick>find in Config Viewer, and look for its Weapons property (in the vehicle's main config for driver-controlled weapons, in the Turrets >> turretname subclass on the left for turret weapons)
thank you i had a good tinker with things and found some good results. By the way off topic are BIS forums down for you too or just me? getting a 502 bad gateway error all day
Does anyone know how to manually detach a DLL from arma? It's a bit of a pain not being able to overwrite DLLs as I modify them while the game is running.
@deft zealot there is not
Not that'll do what you want, anyway.
You can use the selectionVectorDirAndUp command to get the dir and up of the selection (and aside using cross)
Use selectionPosition to get the sel pos
Selection relative pos is:
_diff = _modelRelativePos vectorDiff _selPos;
_selRelativePos = [
_diff vectorDotProduct _aside,
_diff vectorDotProduct _dir,
_diff vectorDotProduct _up
]
hi
Is there a way to removeAllWeapons but it actually removes only the weapons
Not other items like clothing inside of a backpack
You have to use removeWeapon instead
{
_unit removeWeapon _x
} forEach (_allWeapons select {getNumber (configFile >> "CfgWeapons" >> _x >> "type") in [1, 2, 4]})
thanks lad
Whats the 1,2,4 mean exactly, forgot
havent used pointers like that
Not 100% sure if the condition I wrote is correct tho. But it should be
Yep ill test it now
Tho I think using it without condition should work too? 
Well I'm typing on mobile so that's as good as it gets π
1 is primary weapon
2 is handgun
4 is launcher
But try without that condition as well
what is 3 haha
yep ill try that if it doestn work
3 is not existent type
π
Or simply unused
ah oki
They're bit flags so they're powers of 2
Yeah I know
Being rifle and pistol in the same time... US firearm law time?
is there a way to make an item to have limited uses?
say u have a bandage, and u can use that bandage only 2 times to heal wounds
yeah @vocal mantle you should create an extension that can dynamically load and free another library
is there a way in arma
to place an itmen in eden editor invisible
and make it visible with script
@meager granite just as experiment
20x of {}
{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}
0.0003 ms
20x of nested call {};
call {call {call {call {call {call {call {call {call {call {call {call {call {call {call {call {call {call {call {call {};};};};};};};};};};};};};};};};};};};};
0.0042 ms
20x nested if (true) exitWith {};
if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {if (true) exitWith {};};};};};};};};};};};};};};};};};};};};
0.0284 ms
10000 iterations in unscheduled environment
place it in the editor, go to attributes >> special states >> show model >> turn off or use this in its init:
if (isServer) then {
this hideObjectGlobal true;
};
then scriptwise, run on the server:
if (isServer) then {
myObject hideObjectGlobal false;
};
thank u
yeah, guess its not that much
Oh wait, SQF has return equivalent... after 10+ years now I know π okay!
// 0.0027 ms
f =
{
scopeName "main";
if (true) then
{
if (1 > 0) then
{
if (1 < 2) then
{
2 breakOut "main"; // actual return
};
};
};
1 // fake return
};
// 0.00065 ms
f =
{
private _return = 0;
if (true) then
{
if (1 > 0) then
{
if (1 < 2) then
{
_return = 2;
};
};
};
_return
};
call f; // returns 2
wow this difference
have you read the page on code optimization? there is a lot of content there that people have already tested
sure, but it lacks a lot of info
for example switch {true} do is slower than call-if-exitWith, there is no benchmark on that page
also some tests are not consistent, for example lazy evaluation
there is no
["false || { false || {true}}", nil, 100000] call BIS_fnc_codePerformance;
the page definitely needs to be updated
you do the tests, make them readable, then post it to #community_wiki , we will put them in
hey, has there been a report for problems with BIS_fnc_unitPlayFiring and helicopters with weapons for the pilot?
i recorded firemoves with BIS_fnc_unitCapture and tried to run them with BIS_fnc_unitPlayFiring and nothing happens
@pliant stream So another tried and true extension to free the other WIP extension?
yeah so you have an extension A
vanilla or modded helicopter?
rhs modded littlebird
i can try it with the vanilla pawnee, give me a moment
typically i see issues when people use modded helis
maybe you can say "Load myLibrary" callExtension "A" and it loads a library named myLibrary.dll
ok
ill get back in a moment
confirm, it is just modded heli
vanilla pawnee works
any idea why?
Simplest option may be to create a new dll with a new name for each version.
so you load myLibrary, get the function address with GetProcAddress, call the function as many times as you like and then unload with FreeLibrary
whats the fun in that @gray bramble :D
and you do not need to remove the semicolon for it to return π
@deft zealot There'll be a intercept channel when it's released
We're still implementing function wrappers, after that we've got to test features
@gray bramble Thats what ive been doing... not a fan of that method.
anyone have a simple tfar jammer jamming script that i could use for a local multiplayer server?
Hi
Very quick and simple questions:
Ive managed to get this script to work: you spawn in, a blackscreen plays with the text given there and music plays.
all fine and dandy
Only issue i am having:
The Music abruptly stops! I want it to fade away slowly and not just a hard-cut so to say
Maybe ive made an error somewhere at the end? Or am i missing a complete line of code? .-.
enableRadio false;
0 fadeSpeech 0;
0 fadeRadio 0;
0 fadeSound 0;
titleText ["", "BLACK FADED", 2];
sleep 1;
playmusic "introsong";
sleep 20;
titleText ["24TH JUNE 2035 - 1753 HRS - MALDEN. \n ION Inc. PMCs as well as a Team of the Russian Navy are gathering at an US airbase to retrieve a VIP on Malden! \n Meanwhile smallpox is on the rise again and everyone tries to flee!", "BLACK FADED", 2];
sleep 20;
titleText ["", "BLACK FADED", 2];
sleep 3;
titleText ["<t color='#ffffff' size='2'>K Γ N I G S R P C A M P A I G N </t><br/><t color='#c38e11' size='5'>O P E R A T I O N <br/> H Y D R A K I L L E R </t>", "BLACK FADED", 3, true, true];
sleep 15;
titleText ["", "BLACK FADED", 2];
sleep 3;
titleText ["<t color='#ffffff' size='2'>M A L D E N : A T L A N T I C S E A W E S T O F A F R I C A</t><br/><t color='#ffffff' size='1'>...less than an hour before Day 0...<br/>__________________________________________</t><br/><t color='#e62323' size='6'>MISSION 1 - MALDENS DOOM</t>", "BLACK FADED", -1, true, true];
sleep 14;
3 fadeSpeech 1;
3 fadeRadio 1;
10 fadeSound 1;
enableRadio true;
sleep 2;
titleText ["", "BLACK FADED", 2];
sleep 2;
titleText ["", "BLACK IN", 3];
sleep 2;
titleText ["", "PLAIN", 2];
10 fademusic 0;
sleep 20;
playmusic "";```
Yes
ace_hearing_disableVolumeUpdate = true
Change it back when you are done
Where do i put that in my code here?
at the end or where?
Before you start your code and after to set it back to false
So line 1 and last line, but remember to still wait out the fade first
so before "enableRadio false;" - put that code there with True
And after "playmusic"" - put the same code but with false in there?
Mind telling me why i need the ace hearing update? What does that line "tell me" excatly?
trying to learn more coding and every bit helps
So thanks so far π
When running ace, their hearing addon, the one that controls the earplugs system is always updating. It muffles/mutes everything and doesn't allow you to use the fade system.
There is a variable check in it that checks for that variable. If it's true, then the update is skipped
Aahhhh okay
So i disable that Checkup, run my Intro and then after the music faded away i enable it again
Nice man
I will try it out tomorrow, need some sleep asap
But thanks for the quick Help! 
Hi, I mean encapsulation, so potential developers don't break stuff unintentionally
I can't seem to find a guide neither on their website nor their github page about how to handle functions that are stored in separate files
@indigo snow I was reading about lissajous curve 4:3 last night but I can't figure out the best way to move stuff smoothly in arma
in unity i could use time.DeltaTime and lerp, and a million other things - what's the best method in arma? move it every frame?
the smoothness of a lissajous curve obviously has to to with step size. both diag_tickTime and diag_frameNo could be used, which you could multiply appropriately
using time could work as well
@candid sun Here's an example I did for scrambling the location of a soldier transmitting using an acre2 radio, resulting in a 2D position.
http://pastebin.com/s0ps2M7L
the code itself is a bit of a clusterfuck after many "lemme quick fix this" phases :D
thanks, i've hardly used any of the math functions in arma, this is all new and exciting/confusing to me!
fixed it a bit since everything to do with min and max had changed into a static number anyway
in reality it's just a combination of the vectorAdd command, to center the figure around the actual position instead of [0,0] and the sin command
later on I would scramble some red dots around the calculated position using draw3D so defenders could see the position of OPFOR when they were using the radio
never quite finished that
http://jsxgraph.uni-bayreuth.de/wiki/index.php/Lissajous_curves is a nice applet for generating your own lissajous figures
man, if addCamShake worked with cameras (imagine that) i could have just gone the rest of my life not knowing about Mr. Lissajous and his curves
hm
they are basically global variables with type of "CODE"
there is no OOP concept with private, protected, public methods
but
if you finalize the function it cannot be overwritten
yhea, I tried doing things the ace way but with all the compiling I just decided to switch to cfgFuctions instead
I didnt want to expose the functions but it was much simpler at the end
Yep, Fucntions defined in CfgFunctions are finalized automatically
is this like a new feature?
because I saw the option to preinit and stuff just like cba
not really, it was introduced years ago.
https://community.bistudio.com/wiki/compileFinal
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
The advantages of using the Functions Library over e.g execVM an SQF file are as follow:
Automatic compilation upon mission start into a global variable - no need to remember direct paths to files.
**Anti-hack protection using compileFinal (see Arma 3: Writing a Function - Recompiling and BIS_fnc_recompile)**
Listing in the Functions Viewer
Advanced debugging options
Optional immediate execution upon mission start, without need for manual call
Potential performance improvements
Well, it's not the same as protected or private but at least it prevents overwriting
cba?
CBA functions are finalized
and are there any performance gains?
only potential, because the game compiles the functions twice - rigth after start and when mission loads. CBA with caching allows to compile the function only once unless you explicitly disable the cache
nvm, recompile attribute is 0 by default
so you benefit from defining the functions in CfgFunctions
CBA is used for its dev environment mostly. The cache system of CBA functions lets you modify them on the fly.
Basically it's easier to disable the cache in CBA than changing 'recompile' attribute because it doesn't require to rebuild the addon (.pbo). It may save your time if you change the code constantly, experimenting, fixing, etc. Also functions compiled using CBA are just variables without any trails in Cfg
Many of the things featured in CBA didn't exist when Arma 3 was new. Many of them have since been added to the game.
Exactly ^. Some of them are just legacy features re-introduced for compatibility purpose.
however, if you are using the caching system, you have to make sure its populated before a player can modify it. means you must use preInit at least. otherwise, you can inject code using description.ext (using any property read by getNumber)
:) imagine that
hi,i have hold action fnc and an loadout settings.
the main problem:when hold action done loadout must just apply on the _caller but the loadout apply on all the other players
anyone pls give me a tip
i have not access to my code for now
then if you can give me the code
Post code when you can
i just first group the caller and then apply loadout on the caller group
_x and for each
but i think it will be done when i remove group and directly use _caller for every _x
Just post the code.
glad to see over three friend answer about problems,
its my code
[s4,
"LoadOUT",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 2",
"_caller distance _target < 2",
{"laa" remoteExec ["playSound"];},
{hint "iw";},
{_pg = group _caller;
{
removeAllWeapons _x;
removeAllItems _x;
removeAllAssignedItems _x;
removeUniform _x;
removeVest _x;
removeBackpack _x;
removeHeadgear _x;
removeGoggles _x;
_x addWeapon "hlc_smg_MP5N";
_x addPrimaryWeaponItem "hlc_30Rnd_9x19_B_MP5";
_x addWeapon "rhsusf_weap_m9";
_x addHandgunItem "rhsusf_mag_15Rnd_9x19_FMJ";
_x forceAddUniform "B_BLK_BLK_soldier_F_uniform";
_x addVest "IRI_V_Sheriff_BA_TB";
_x addWeapon "Binocular";
_x addItemToUniform "FirstAidKit";
for "_i" from 1 to 2 do {_x addItemToUniform "hlc_30Rnd_9x19_B_MP5";};
_x addItemToUniform "SmokeShell";
_x addItemToUniform "MiniGrenade";
for "_i" from 1 to 3 do {_x addItemToVest "hlc_30Rnd_9x19_B_MP5";};
_x addItemToVest "rhsusf_mag_15Rnd_9x19_FMJ";
for "_i" from 1 to 5 do {_x addItemToVest "rhs_mag_mk84";};
for "_i" from 1 to 2 do {_x addItemToVest "MiniGrenade";};
_x addItemToVest "SmokeShell";
_x addHeadgear "H_PASGT_basic_black_F";
_x addGoggles "G_Balaclava_TI_G_blk_F";
_x linkItem "ItemMap";
_x linkItem "ItemGPS";
_x linkItem "ItemCompass";
_x linkItem "ItemWatch";
_x linkItem "ItemRadio";
_x linkItem "NVGoggles_OPFOR";
[_x,"Pad_A3_01","male01per"] call BIS_fnc_setIdentity;
[_x,"rw_Service_qe"] call BIS_fnc_setUnitInsignia;
} forEach units _pg;
hint "NO";
},
{hint "Lm";},
[],
2,
1000,
false,
false,
true
] remoteExec ["BIS_fnc_holdActionAdd",[0,-2] select isDedicated,true];
do it will fix when the group and foreach get removed and every _x change to _caller?
You set the loadout for every unit of the callers group. Is that intended?
had a general question about code that runs on incapacitated units(a general answer looking for) basically do revive scripts,have any substantial code running when a unit is not in a revivable state. aka just throughout the scenario? just trying to understand if a script can cause lag halfway through a mission
ok i was just thinking if conditions are constantly being checked and if thats how it works
i assume they are and it isnt just calculating stuff when a condition is met
in the first code when you have a loadout and another player move to holdaction pos and use it the coded loadout apply on he and also every player is online
i need to apply just on who use the holdaction
Could be anything really.
Then replace _x with caller and remove the forEach
and it will be done?
Just try it
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
yep ^ @buoyant hound
thank you
there i have a video and i want to play it on the billboard
via hold action
any code or suggest?
like in Western Sakhara campaign?
idk that bro,there is an billboard named b1 and i will dessign a data projector
and paste hold act fnc on data projector,which syntax i need to use
I think i used this one before to play video on a screen
_video = v/video.ogv";
_screen = "b1";
_screen setObjectTexture [0, _video];
[_video, [10, 10]] call BIS_fnc_playVideo;
do this code will work for dedicate server?
Use the Metis presentation mod. Works with png images or video files
Hello everyone.
Is there a way to catch:
- connecting the player to the UAV
- UAV disassembly
I couldn't find any suitable EH.
i cant use mod
Try the weapon assembly/disassembly EHs, I'm pretty sure UAV assembly uses the same system
The problem is that this EH is hung on the player and the drone object that is being disassembled is not passed in the parameters.
I feel like there should be a way to get a static or UAV from its backpack, since the object still exists and has an engine connection to a specific backpack, but I can't find one π€
Disassembled is for drones/statics, WeaponDisassembled is for unit that disassembles it
Considering this bug( https://feedback.bistudio.com/T180375) and it not looking like its been given much attention since i found and reported it a while back,i decided to look at another way to call an event handler. current event handler is a combat mode EH
this addEventHandler ["CombatModeChanged", {
params ["_group", "_newMode"];
if (_newMode == "COMBAT") then
{
CAN ANYONE ADVISE A BETTER SOLUTION?
A good alternative to combat mode i mean. essentially if group spots an enemy
however because of the reported bug, i belive they are "spotting" them when they shouldnt be able to. so i cant think of a good alternative
i thought about that but considering the bug, i believe groups know about enemy they shouldnt if they destroy a vehicle
so this wouldnt work
do what I do, build it as is and wait for a fix lol
you opened it on the 6th, I'd say its still within the zone of "exploring the problem"
is there an EH for "taking fire"? not hit
firedNear
ah ok
its not really firedAT, but rather something shot nearby
yeah i just read that
i think this is all can do
getSuppression is one option
should be a "firedAtEnemy" EH
i had friendlies suppression effects disabled
though il look at this and reenable
Hey guys, I have an issue with text in a GUI not scaling properly when somebody is using non-standard screen resolutions.
I have a RscStructuredText inside of a RscControlsGroup, the GUI is properly setup to work with the safezone, this is the only menu I have this issue with, probably because the text is inside of a group?
Anyway to fix?
code/config?
I think it'll be called config
{
idc = 2300;
x = 0.365937 * safezoneW + safezoneX;
y = 0.247 * safezoneH + safezoneY;
w = 0.417656 * safezoneW;
h = 0.506 * safezoneH;
class Controls
{
class mainText: RscStructuredText
{
idc = 1100;
x = 0.291094 * safezoneW + safezoneX;
y = 0.247 * safezoneH + safezoneY;
w = 0.407656 * safezoneW;
h = 2 * safezoneH;
};
};
};```
mainText is the problem child
can you try the text's h & w without safezoneW/H ?
Sure I can give that a try
Thanks for trying but that made it even worse haha
hmm i think controls group has its own coordinate system so i wouldnt try using safezone there
example from my code: ```class RscText_1000: RscText
{
idc = 1000;
text = "Show"; //--- ToDo: Localize;
x = 0.01;
y = 0.2;
w = 0.3;
h = 0.1;
};
Yeah without the safezones it's totally off
oh
You have to multiply by controls group size instead of SafeZone inside contrls group
Yeah so on standard resolutions the text is properly centered, but the wide aspect ratios make it go crazy
if you expect your values being proportional of controls group
I understand what you mean, I've never done that before so I'm unsure how I would write it
SafeZoneX is irrelevant inside controls group because its controls start from controls group's X
#define GROUP_WIDTH 0.417656 * safezoneW
class group: RscControlsGroup
{
idc = 2300;
x = 0.365937 * safezoneW + safezoneX;
y = 0.247 * safezoneH + safezoneY;
w = GROUP_WIDTH;
h = 0.506 * safezoneH;
class Controls
{
class mainText: RscStructuredText
{
idc = 1100;
x = 0;
y = 0;
w = GROUP_WIDTH;
h = 2 * safezoneH;
};
};
};
Why do you even want to get rid of safezone? It makes no sense if you don't also scale content somehow (fonts, etc.)
Your bottom buttons are an example of what happens in such case
large size independent of UI size setting, yet font size is still scaled by UI size
Actually nevermind, I keep mixing up safe zone and "absolute" coordinates
the names that is
Yeah, never been much of a GUI expert, I basically just copy and paste older GUI's that I have, I can't pretend to understand them.
I wasn't trying to get rid of the safezone, I was just trying to make the text appear the same on both standard, and extra wide ratio's.
Your solution is working on both, so thanks a lot for that!
"if (local (_this select 0)) then {_onSpawn = {sleep 0.3; _unit = _this select 0;};_this spawn _onSpawn;(_this select 0) addMPEventHandler ['MPRespawn', _onSpawn];};"
How would I change this to set the vehicle's flag texture automatically? (I'm writing an ORBAT file)
is there an equivelant to inthislist for using markers?
rather than triggers?
i have an ever moving marker and i need an object in the marker area to trigger a task complete state. trying to avoid having more triggers if can help it
or an efficent way to detect if an object is near to one of 6 other specific objects,but i have a feeling thats more resource intense
@bleak gulch @fair drum Thank you soo much!! you guys are legends
I'm working on a mod that the original creator didn't leave source files, I've debinarized the config file but the build fails with the p3d models
Where is this from? Init config field?
Orbat faction file
No idea how that works, can't help
Alright
Typically you hook handleDamage. Which is a bit of a beast.
The engine/network cost of the bullets is typically more expensive than the scripts though.
playAction
thanks for that explanation
does " attachTo [object, [0,0,0]];" stay attached?
im habing difficult time testing this results are very inconsistent
seems theres the issue of pre init and random placement of an object with the attach to command,but also in general it seems my trigger isnt staying attached to my object once object moves
Unless something runs detach then yes, as far as I know.
I don't know about triggers though.
It's possible that the trigger object moves but the detection area doesn't change.
(this is pure speculation)
i figured out my issue..i had a crate with a trigger attached to it,with a radius,and on activation code to repair a vehicle,condition blufor present. but i was sling loading the crate(thinking the trigger wasnt staying attached) and dropping crate off to a vehicle position..the trigger never fire
it never fired because it never "reset" the blufor present as my heli and me where within its radius AS i dropped it off to a blufor vehicle
this is true on a "random start" object. for example if a attach a trigger to a house,but attach a randon start sync for that house to a marker, at mission start the house moves to a random pos(random marker pos),but trigger(which WAS attached at init to the house) fails to move with the house
what would a correct syntax be to detect kind of car OR kind of tank?
This is because the random placement is decided before the trigger is attached
{({_x isKindOf "LandVehicle"} count thisList) > 0} keep getting errors
yeah i figured that out after a little testing
ok had to rearrange the condition. hope this works
triggerActivated logtrg && {({_x isKindOf "LandVehicle"} count thisList) > 0}
Thanks and how do I cancel a gesture?
player playAction "";
doesnt wanna work
Honestly, I don't know. I remember switchGesture not working, but perhaps it was changed recently?
thx
i know its a bit silly but does anyone know how to set Praetorian 1C as independent arma 3 just using init fields?
Place it, add if(isServer) then {createVehicleCrew this} into init field
unless you meant independent as in side
createVehicleCrew is also the answer to that
if isServer then { independent createVehicleCrew this }```
oh yeah alt syntax made it a while ago
Just to clarify, place it empty before using createVehicleCrew on it. Won't work if it already has its default BLUFOR crew unit.
i meant independent as a side
π
okay, thank you let me check it out :D
mfcivgroup = createGroup civilian;
mfaicharacter1 = mfcivgroup createUnit [ βB_Soldier_VR_Fβ, position player, [], 0, "FORM"];
mfaicharacter1 enableSimulation false;
any idea why this is giving invalid expression error?
