#arma3_scripting

1 messages Β· Page 135 of 1

winter rose
#

the projectile is locally created on every machine iirc

#

(so technically yes)

ornate whale
#

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

granite sky
granite sky
#

I believe 40mm counts as the larger type.

winter rose
#

bullets/rockets/missiles are local I believe, maybe grenades are global?

granite sky
#

And RL rounds certainly do.

#

hmm

winter rose
#

just saying it like that, I don't have real data

ornate whale
#

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.

winter rose
#

try and report back if you're OK with it? so we can document it

still forum
granite sky
#

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?

flint topaz
#

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

viscid anvil
inland iris
#

why is the video long

viscid anvil
#

oh and btw I tried to print just _x and it didnt return

viscid anvil
#

when _x isn't initialized

inland iris
#

_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

viscid anvil
#

why is _x default for something, when it appers to be uninitialized

inland iris
viscid anvil
#

ohh lolll found it

#

wtf are magic variables

hallow mortar
#

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

meager granite
#

You have to add it inside Fired/FiredMan where instigator is local

meager granite
meager granite
#

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

oblique arrow
#

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?

meager granite
#

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

oblique arrow
#

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

fleet sand
#

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 ?

oblique arrow
#

too big mission not gud

inland iris
#

40 MB

#

anything bigger than can probably be broken down to multiple smaller misisons

oblique arrow
#

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

inland iris
#

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

hallow mortar
#

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.

granite sky
hallow mortar
granite sky
#

Also the inverse (have velocity, need trajectory) is simpler, although generating an impact point is pretty expensive.

oblique arrow
oblique arrow
inland iris
#

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

oblique arrow
#

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

inland iris
#

||6 hours ||

#

thats how long the content was

oblique arrow
#

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

inland iris
#

yes it would

hallow mortar
#

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.

inland iris
#

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

still forum
oblique arrow
#

Ye

oblique arrow
inland iris
oblique arrow
#

"Welcome to todays arma op guys, we'll start in roughly 5 hours when everyone has downloaded the mission file"

still forum
inland iris
#

dedmen we are talking about a regular server host for a community here
lets be real

#

not to mention the memory storage

#

sheesh

hallow mortar
inland iris
#

everyone will be lagging

still forum
#

I am talking about a regular server

cedar portal
#

hey are there any scripts that make my camera follow a launched projectile (missiles, AT ) ?

still forum
#

Discord or wiki

inland iris
#

Realistic*

hallow mortar
still forum
#

I run it on my server. And we have no issues with 20mb mission files

cedar portal
#

that was a post when I was 2 years old

inland iris
oblique arrow
inland iris
hallow mortar
oblique arrow
#

this game has code in it from years before I was born

inland iris
#

wait 2007 was 7 yeares ago

#

right?

#

RIGHT?

oblique arrow
#

not quiiiite

inland iris
oblique arrow
cedar portal
#

thanks alots guy, but just add the scripts and it'll work ? or do i have to use any keys on my keyboard ?

inland iris
#

start with reading

#

and trying to understand :3

tender sable
oblique arrow
#

second is your mind

#

you only gotta pay that one when you actually start writing ones yourself

#

please dont have sex with your arma notlikemeow

#

that might produce some very weird children that I'm sure bohemia doesnt want to deal with

cedar portal
#

thanks guys, i'll watch some arma 3 scripts for dummies

still forum
oblique arrow
oblique arrow
inland iris
#

also pi would you actually join for a 6 GB co op mission

#

adds cut scene every 3 objectives

oblique arrow
vapid dune
#

Do setObjectTextureGlobal work mid mission? Can I change some uniform texture as zeus?

little raptor
#

yes

#

Can I change some uniform texture
depends if the uniform has hidden selection textures or not

vapid dune
#

I mean, I do can change texture, I already did it in init field with same command

little raptor
#

then it will work yeah

vapid dune
#

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

little raptor
little raptor
vapid dune
#

Hint literally says:

little raptor
#

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"];
}
little raptor
vapid dune
#

Nevermind, thank you

wild canyon
#

Hi

fair drum
#

Hi

inland iris
#

hi

still forum
#

@vocal mantle Most People use output[outputsize-1] = 0; in the end of the RVExtension function just as a failsafe

bleak gulch
viscid anvil
#

is there a way to hot-reload a mod in arma 3?

bleak gulch
#

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.

viscid anvil
#

@bleak gulch
I dont really get it, if I edit the sqf files I need to reload the config file?

bleak gulch
#

You didn't notice anything abotu sqf. No. In case you edit sqf you don't need to reload .pbo.

warm hedge
#

What is your goal

inland iris
#

Yeah next time we need a rule that says

  1. What is your goal ?
  2. What did you try ?
bleak gulch
#

Yeah, can you be a little more specific.

viscid anvil
#

I'm just trying to edit some sqf files and console log the changes.
so lets clarify:

  1. if I edit the sqf files in the mod what should I reload to reflect the changes if anything?
  2. what is the deal with the config files, what are they used for?
warm hedge
#

Kinda confused. What you're after? An SQF? A Mission? A Mod? A config.cpp?

viscid anvil
#

a mod

warm hedge
#

Who made it?

viscid anvil
#

I'm adding some features to a closed source mod, changing some logic in the functions

bleak gulch
bleak gulch
#

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

viscid anvil
#

I think I found an article talking about file patching, THANKS A LOT!

#

and one last question, what are the config files for?

bleak gulch
#

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

viscid anvil
#

I saw something about pre init handlers, what are those for?

#

Like where would I use them

#

I think I got it, thanks

bleak gulch
viscid anvil
#

@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)

warm hedge
#

First off, try some scripts in a mission you can handle

viscid anvil
#

I dont intented to debug stuff isolated from the codebase all the time πŸ™‚

rancid zealot
#

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

bleak gulch
#

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

viscid anvil
#

nah nah I mean like important topics I could read on the wiki

bleak gulch
#

hm

viscid anvil
#

I did what cought my eye for the language stuff and their tutorial

viscid anvil
#

after that it goes to index pages -_-

bleak gulch
viscid anvil
#

Thanks

bleak gulch
viscid anvil
#

in dev build as I know A3 allows to

meager granite
#

Server fires the event for every client for all shots

#

I remember there were issues where event was missing a projectile though

sullen marsh
#

@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

deft zealot
#

well you usually need some kind of injector which intercept has already integrated

sullen marsh
#

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)

deft zealot
#

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.

sullen marsh
#

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

sullen sigil
#

isnt there a command for linking an item to a corpse/unit for deletion?

#

or is it just the expected addeventhandler [...]

meager granite
#

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

sullen sigil
#

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 notlikemeow

#

(i hate vector math)

sullen sigil
#

this probably demonstrates the issue best

#

footprint is vertical, needs to be horizontal

#

uses usertexture object which is vertical for some reason

meager granite
#

What you do you have as input? Terrain surfaceNormal and that's it?

hallow mortar
sullen sigil
#

_obj setVectorUp vectorNormalized (surfaceNormal _pos vectorAdd [0,1,0]); where the latter part is my attempt at resolving it

#

but yes

meager granite
#

What about direction where it should be facing?

sullen sigil
#

o im setting that bit with just setdir

meager granite
#

Where do you get the angle from?

sullen sigil
#

getdir

meager granite
#

From where?

#

unit?

sullen sigil
#

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;```
meager granite
#
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

sullen sigil
#

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

meager granite
#

_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

sullen sigil
#

hm, still nope but let me double check

#

yeah theyre still there

meager granite
#

Gonna test myself in a bit

sullen sigil
#

are you sure dir should be surfacenormal? makes no sense to me but it probably does to you

little raptor
#

What's the issue here?

meager granite
#

You want user texture to lay on the ground and its right up in the model

sullen sigil
#

i need le footprint decals to be flat against the terrain

#

yeah

meager granite
#

So its up vector should be along the ground and its dir vector perpendicular to the ground

little raptor
#

How does the texture look like without any rotation?

sullen sigil
meager granite
#

Post full code you used

#

I mean what you were using last time with my stuff added

sullen sigil
#

wait is sqfbin gone πŸ₯Ή

little raptor
sullen sigil
meager granite
#

Looks ok, probably still wrong cross product order

sullen sigil
#

ive not had to touch vectordirandup since capital ships last year

meager granite
#

I'll check it myself in a bit

sullen sigil
#

and leopard remembers that painful saga

#

thanks πŸ«‚

meager granite
#
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

sullen sigil
#

yeah i suspect it is

#

gonna double check first

winter rose
#

πŸ‡¨πŸ‡ΏπŸ‡¨πŸ‡Ώ done for you

sullen sigil
#

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

deft zealot
#

Good to hear that you care about BE

meager granite
#
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

sullen sigil
#

ah yay, works perfectly now, thanks for the help πŸ˜„ πŸ«‚

meager granite
sullen sigil
#

awesome 😎

#

pretty sure this'll end up killing performance but oh well

#

ive capped it at 1k step objects

meager granite
#

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

sullen sigil
#

oh wait are they

#

word

#

i just need to move all this shit to CBA standards first

sullen sigil
#

i take a ~50fps drop

#

i expect decals will be more performant but i cant find docs on them

meager granite
#

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!

sullen sigil
#

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

meager granite
#

Yeah, doesn't reset by itself

sullen sigil
#

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

sullen sigil
meager granite
# sullen sigil are you sure? doesnt seem to work properly <:thonk:1098612853579206656>
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"];
    };
};
sullen sigil
#
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"];
};```
πŸ˜…
meager granite
#

createSimpleObject only takes ASL coordinate

sullen sigil
#

aaaaaah

#

of course

#

sorry its 8am and ive not been to sleep

#

(clearly)

#

wicked, thanks πŸ«‚

#

this is even better at night lol

gentle zenith
#

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

warm hedge
#

What kind of code you've done to run setTerrainHeight?

#

In init.sqf or somewhere?

sonic onyx
#

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.

gentle zenith
warm hedge
#

But urm, that's not the question, how do you run it?

oblique arrow
#

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

oblique arrow
#

Man using public vars to start certain movements from a script feels so dirty πŸ˜…

meager granite
#

RE playMove/switchMove instead?

oblique arrow
#

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

oblique arrow
#
[] 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

#

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 bongocat

#

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

wild canyon
#

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:
still forum
#

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

wild canyon
#

Yeah couldnt find anything usefull online

versed belfry
#

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?

oblique arrow
#

or does it not have one?

versed belfry
oblique arrow
#

according to the alternate syntax it should take a classname too

versed belfry
oblique arrow
#

Ooh maybe it just takes 'real' objects like vehicles, etc

#

iirc item style objects are a bit funky sometimes πŸ€”

versed belfry
versed belfry
oblique arrow
#

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

wild canyon
oblique arrow
# versed belfry Negative :(

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

oblique arrow
#

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

versed belfry
still forum
wild canyon
#

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

oblique arrow
oblique arrow
#

been a while since I tried doing stuff with them but my experiences werent great

versed belfry
versed belfry
#
_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?

warm hedge
#

No

versed belfry
#
_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.

gray bramble
#

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

bleak gulch
#

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 {};
still forum
#

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

gaunt tendon
#

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);
  //-------------------------------------------------------------
};
runic warren
#

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?
still forum
#

There shouldn't be a semicolon before the else

runic warren
#

ah

still forum
#

Your use case should be a switch with a default

oblique arrow
#

^

#

also indendation prayge_a

runic warren
oblique arrow
#
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

winter rose
#

and if you remove the default code, it does not run anything and goes through

runic warren
#

so how would it apply to texture selected and script applied?

oblique arrow
#
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

winter rose
#
switch (_tex select 10) do
{
  case "texture\1.paa": { /*code */ };
  case "texture\2.paa": { /*code */ };
}
```basically yeah
runic warren
#

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

oblique arrow
#

its basically just if's chained together in a nicer way

oblique arrow
runic warren
#

right, many thanks :)

oblique arrow
runic warren
#

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

winter rose
#

the switch case is case-sensitive, you can use toLowerANSI

hallow mortar
#

How are you passing arguments to this script?

runic warren
#

as an init eventhandler

#

in the vehicle's config

runic warren
#

_this toLowerANSI ?

hallow mortar
#

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.

runic warren
#

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

hallow mortar
#

add some systemChat to display the values of important things

#

e.g. systemChat typeOf _vehicle, systemChat (_tex select 10)

runic warren
#

welp, I made it work with else if

#

might not be the prettiest solution but it works

#

thanks for the help tho ^_^

sullen sigil
#

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?

little raptor
sullen sigil
#

previously had all the steps collected into a huge array and was deleting out of that instead meowsweats

little raptor
#

it hurts my eyes meowsweats

sullen sigil
#

because of the macro usage or the code

little raptor
#

neither. the font πŸ˜…

sullen sigil
#

oh πŸ™‚

oblique arrow
#

man's coding in an entirely different game universe, hot damn

little raptor
# sullen sigil

so you want to break it down due to reaching the 500 elements limit?

sullen sigil
#

im not sure which is better performance wise

sullen sigil
# sullen sigil

from changing it and playing liberation it seems to be better with this but i feel something could be better

little raptor
#

when you do deleteAt 0 you also force the array to shift (do memory copies/moves)

#

instead just check the size and use set

sullen sigil
#

yeah ive been told to do deleteVehicle (_steps deleteAt 0);

little raptor
#

how's that any different?! πŸ˜…

sullen sigil
#

one less select

little raptor
#

I'm talking about the memory copy

sullen sigil
#

set doesnt return removed elements though does it

#

or what im confused

fair drum
sullen sigil
#

x39 hates macros so i thought leopard may be in the same boat

little raptor
#

you can do:

if (count _steps >= 500) then
{
  _nextStep = (_nextStep + 1) % 500;
  deleteVehicle (_steps#_nextStep);
  _arr set [_nextStep, _obj];
}
else
{
  _nextStep = _arr pushBack _obj
};
sullen sigil
#

that looks like more commands to me

little raptor
#

you also have to use another var to remember where the newest element was inserted

little raptor
#

so in the end it's faster for large arrays

#

even for 50k elements

sullen sigil
#

ah right

little raptor
#

you can reserve 50k elements in your array to prevent memory copy/move during the game

sullen sigil
#

so i would need to be setting nextstep as a variable on the unit?

little raptor
#
// run once
_arr resize 5e4;
_arr resize 0;
little raptor
sullen sigil
#

yuh

little raptor
#

then you can go back to that and just use a global var for nextStep too

little raptor
sullen sigil
#

so _nextStep just needs to be kept as a gvar right

little raptor
sullen sigil
#

ya

sullen sigil
#

roger

sullen sigil
little raptor
#

if you run that code from multiple scheduled scripts you'll also need an isNil to make it "atomic"

sullen sigil
#

i dont touch the scheduler

little raptor
sullen sigil
#

roger

knotty gyro
#

I need to make a building slingloadable.... How do I do it?

little raptor
#

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)

sullen sigil
knotty gyro
#

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

sullen sigil
#

oh thats so much better

#

thanks leopard

#

oh wait its probably because its not creating anything

little raptor
#

btw is the totalSteps arrays for all units or just the player?

sullen sigil
#

all

#

yeah 50k isnt a lot lol

little raptor
#

but in that case some units might have 10000 steps while some 10 πŸ˜…

sullen sigil
#

indeed

#

though if the oldest ones are the ones being deleted im not too worried

little raptor
#

so I guess you should just go back to the previous one since it makes more sense

little raptor
sullen sigil
#

yeah

little raptor
#

if you don't care how many steps each unit creates you can use the global one

sullen sigil
#

really i just care about performance

little raptor
#

but I guess it won't matter much think_turtle

sullen sigil
#

resizing the array will still be better for performance regardless wont it

little raptor
#

altho 50k objects are slow either way think_turtle

sullen sigil
#

if i do individual

little raptor
sullen sigil
#

yeah just got back on lib and its immediately already suttering again

#

i shall revert to the previous version

little raptor
#

well yeah like I said the first one creates at most 500 steps per unit

sullen sigil
#

if youre deleting that many objects iterating through allunits for them wont be that big of a deal anyway

little raptor
#

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 meowsweats

sullen sigil
#

probably makes more sense then right

little raptor
#

yeah

sullen sigil
#

should i change the unit steps array to resize to 500 then 0 like the global or is performance nbd for that

little raptor
#

combine it with the set and I guess resize one too to minimize performance impact

little raptor
#

or just reserve 250 elements at first

sullen sigil
#

why 250?

little raptor
#

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

sullen sigil
#

nah im gonna do some cursed shit πŸ˜„

#

i fucking LOVE untyped variables it lets me do this stupid shit

little raptor
#

why do you reserve 5000 tho meowsweats

sullen sigil
#

OH WAIT

#

LOL

#

oops

little raptor
#

also you're still not using the set meowsweats

sullen sigil
#

correct im very lazy

stable dune
#

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?

little raptor
#

it will still shift the array

stable dune
#

True

little raptor
#

the reason I recommended set was to avoid that and save on memory bandwidth (which is Arma's greatest weakness)

sullen sigil
#

i dont understand how the set bit works properly

#

oh wait its that shrimple

little raptor
#

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

sullen sigil
#

ah i see

#

thank you

little raptor
sullen sigil
#

i did mean both lmao

#

oh thats buttery smooth now

little raptor
#

you can still save some more performance

little raptor
little raptor
# sullen sigil oh wait its that shrimple
#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

sullen sigil
#

ah thanks πŸ˜…

#

that would explain why my frames were slowly dying

#

shall test now and see how it goes, thanks leopard πŸ«‚

little raptor
#

(Dedmen recently made them constants)

sullen sigil
#

oh word

sullen sigil
#

hehehehehehe

little raptor
#

that's wrong

#

if _steps is array it'll cause an error

sullen sigil
#

oh yeah

#

shame

little raptor
#

why do you still getVar nextSteps there? meowsweats

sullen sigil
#

errrrrrrrrrrrrrrrrrrr

little raptor
#

just copy paste it πŸ˜…
it's 100% correct

sullen sigil
#

then i have to make your brackets be on the same lines 😟

#

i jest i copy pasted it anyway

tough abyss
#

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?

granite sky
#

I wouldn't know. I just use it as a text editor.

#

Edit & retest process is acceptably fast with filepatching.

sullen sigil
#

hm... frames eventually degraded until death

#

but relatively suddenly

#

peculiar

granite sky
#

Out of RAM? :P

sullen sigil
#

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

granite sky
#

I don't know what you're doing but it sounds cracked.

sullen sigil
#

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

granite sky
#

...yes

sullen sigil
#

kjw moment

molten yacht
#

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

little raptor
#

smoke particles should have that option

molten yacht
#

Okay, now just wondering how fast this can make an AI stop shooting

last pike
#

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

meager granite
#

Setting scale is very limited, most reliably works on simple objects

#

Otherwise you'll need scripts to do it each frame

manic kettle
#

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

meager granite
#

Can I assume from that that projectils won't damage anything with explosion indirectHit x 4 meters away from it?

ivory lake
#

in theory

meager granite
#

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 thonk

ivory lake
#

yeah its also a bit unpredictable especially if you're like conisdering individual hitpoints on a vehicle

#

or the crew of said vehicle

meager granite
#

Well having it approximate could be enough

ivory lake
#

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

meager granite
#

Well, I guess I gotta go with rough estimate until its properly fixed

meager granite
#

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

still forum
still forum
still forum
bleak mural
#

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

you can attach the waypoint to the vehicle πŸ™‚

bleak mural
#

can i attatch it via code?

winter rose
#

you can still attach the waypoint yes

oblique arrow
#

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

pliant shell
#

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

oblique arrow
wintry wagon
#

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?

dim terrace
pliant shell
#

thanks

dim terrace
#

keep in mind, that a1.54 has string/array size limitation so use it on single class

#

or use 1.52 exe

pliant shell
#

well lucky me, i just have to check single vehicle

#

thanks

jade acorn
#

otherwise you'll break something and then you will come and complain that the campaign is bugged

sullen sigil
#

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

little raptor
sullen sigil
#

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

little raptor
#

performance hit of limiting
hit? or improvement?

sullen sigil
#

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

granite sky
#

one byte of data :D

sullen sigil
#

i feel like this is a reference to something i am missing

#

whether its my own stupidity or nit

granite sky
#

SQF works out as something like 48 bytes to store a scalar.

sullen sigil
#

wh

#

what!!!!!

winter rose
#

GameValue wrapper, value, etc

sullen sigil
#

this pains me

granite sky
#

yes

sullen sigil
#

anyway
still relatively insignificant stuff on the whole

winter rose
#

if you want closer to C++ memory management, try Arma Reforger 😏

sullen sigil
#

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

little raptor
#

use intercept hmmyes

sullen sigil
#

i dont want to use intercept

granite sky
#

he knows

sullen sigil
#

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

winter rose
#

SQF performance for you then

high vigil
#

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 ?

wind hedge
high vigil
pliant stream
maiden raven
#

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 stream
#

@pliant shell (configFile >> "CfgVehicles" >> "MyVehicle") call dumpconfig

pliant shell
#

thanks

wind hedge
winter rose
vocal mantle
#

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

pliant stream
#

nothing wrong with strcpy you just have to remember the null terminator

gray bramble
#

The code you linked, that was the exact code that crashed?

vocal mantle
#

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()

viscid anvil
#

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

viscid anvil
#

do I have to do it everywhere I call them?

fair drum
#

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

viscid anvil
#

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?

fair drum
#

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
viscid anvil
#

btw the cba stuff it would be great if you explainedd what should go where in general

fair drum
#

you making an addon or mission?

viscid anvil
#

I've seen the same strucutre in some ace addons to

viscid anvil
fair drum
#

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

fair drum
bleak mural
#

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

warm hedge
#

Change [0] part

bleak mural
#

ah thank you

bleak gulch
#

I need 'return' command πŸ™‚

bleak mural
#
this setMagazineTurretAmmo ["2Rnd_GAT_missiles_O", 1, [0]]; this setMagazineTurretAmmo ["2Rnd_GAT_missiles_O", 0, [1]];   
warm hedge
#

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

bleak mural
#

the syntax is in the vehicle init,just trying to reduce available ATGMs total number to 1

#

cheers il check that

brave venture
#

Does anyone know how to convert from object relative coords to object selection relative coords?

hallow mortar
# bleak mural this works fine,but there are two turrets with the same classname?

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]];```
deft zealot
#

@sullen marsh @grizzled cliff is there an intercept discord?

bleak mural
# hallow mortar I'll bet you anything the Kamysh doesn't have two turrets with the same classnam...

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

hallow mortar
#

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)

bleak mural
vocal mantle
#

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.

trail rose
#

@deft zealot there is not

gray bramble
#

Not that'll do what you want, anyway.

little raptor
wild canyon
#

hi

#

Is there a way to removeAllWeapons but it actually removes only the weapons

#

Not other items like clothing inside of a backpack

little raptor
wild canyon
#

Whats the 1,2,4 mean exactly, forgot

#

havent used pointers like that

little raptor
#

Not 100% sure if the condition I wrote is correct tho. But it should be

wild canyon
#

Yep ill test it now

little raptor
#

Tho I think using it without condition should work too? think_turtle

wild canyon
#

You missed one )

#

thats all

little raptor
#

Well I'm typing on mobile so that's as good as it gets πŸ˜‰

wild canyon
#

Oh damn hahaa

#

fair g

little raptor
wild canyon
#

gotchu

#

thanks

little raptor
#

But try without that condition as well

wild canyon
#

what is 3 haha

wild canyon
warm hedge
#

3 is not existent type

wild canyon
#

πŸ˜”

warm hedge
#

Or simply unused

wild canyon
#

ah oki

little raptor
warm hedge
#

Yeah I know

little raptor
#

1 2 4 8 16 etc

#

3 would be 1 | 2 (or 1 + 2)

#

But that won't work I think πŸ˜…

warm hedge
#

Being rifle and pistol in the same time... US firearm law time?

sullen trellis
#

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

pliant stream
#

yeah @vocal mantle you should create an extension that can dynamically load and free another library

wild canyon
#

is there a way in arma

#

to place an itmen in eden editor invisible

#

and make it visible with script

bleak gulch
#

@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

fair drum
# wild canyon to place an itmen in eden editor invisible

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;
};
meager granite
bleak gulch
#

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

fair drum
#

have you read the page on code optimization? there is a lot of content there that people have already tested

bleak gulch
#

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

fair drum
#

you do the tests, make them readable, then post it to #community_wiki , we will put them in

ebon citrus
#

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

vocal mantle
#

@pliant stream So another tried and true extension to free the other WIP extension?

pliant stream
#

yeah so you have an extension A

fair drum
#

vanilla or modded helicopter?

ebon citrus
#

i can try it with the vanilla pawnee, give me a moment

fair drum
#

typically i see issues when people use modded helis

pliant stream
#

maybe you can say "Load myLibrary" callExtension "A" and it loads a library named myLibrary.dll

ebon citrus
#

ok

#

ill get back in a moment

#

confirm, it is just modded heli

#

vanilla pawnee works

#

any idea why?

gray bramble
#

Simplest option may be to create a new dll with a new name for each version.

pliant stream
#

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

winter rose
sullen marsh
#

@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

vocal mantle
#

@gray bramble Thats what ive been doing... not a fan of that method.

vapid spoke
#

anyone have a simple tfar jammer jamming script that i could use for a local multiplayer server?

vagrant elm
#

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 "";```
fair drum
#

Are you using Ace?

#

@vagrant elm

vagrant elm
#

Yes

fair drum
# vagrant elm Yes

ace_hearing_disableVolumeUpdate = true

Change it back when you are done

vagrant elm
#

Where do i put that in my code here?
at the end or where?

fair drum
#

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

vagrant elm
#

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 πŸ™‚

fair drum
#

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

vagrant elm
#

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

viscid anvil
#

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

candid sun
#

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

indigo snow
#

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

candid sun
#

thanks, i've hardly used any of the math functions in arma, this is all new and exciting/confusing to me!

indigo snow
#

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

candid sun
#

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

bleak gulch
#

hm

bleak gulch
#

there is no OOP concept with private, protected, public methods

#

but

#

if you finalize the function it cannot be overwritten

viscid anvil
#

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

bleak gulch
#

Yep, Fucntions defined in CfgFunctions are finalized automatically

viscid anvil
#

is this like a new feature?

#

because I saw the option to preinit and stuff just like cba

bleak gulch
viscid anvil
#

then what good reason is there to use cba?

#

spesifically for compilation

bleak gulch
#

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

viscid anvil
#

cba?

bleak gulch
#

CBA functions are finalized

viscid anvil
#

and are there any performance gains?

bleak gulch
#

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

fair drum
#

CBA is used for its dev environment mostly. The cache system of CBA functions lets you modify them on the fly.

bleak gulch
# viscid anvil then what good reason is there to use cba?

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

fair drum
#

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.

bleak gulch
#

Exactly ^. Some of them are just legacy features re-introduced for compatibility purpose.

fair drum
#

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)

indigo snow
#

:) imagine that

buoyant hound
#

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

buoyant hound
#

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

warm hedge
#

Still you need to tell us more specifically

#

Summary never tells details

cosmic lichen
#

Just post the code.

buoyant hound
#

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?

cosmic lichen
#

You set the loadout for every unit of the callers group. Is that intended?

bleak mural
#

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

cosmic lichen
#

Who knows what revive scripts do.

#

Scripts can cause lag if badly written.

bleak mural
#

i assume they are and it isnt just calculating stuff when a condition is met

buoyant hound
#

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

cosmic lichen
cosmic lichen
buoyant hound
cosmic lichen
#

Just try it

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
bleak gulch
#

yep ^ @buoyant hound

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?

bleak gulch
#

like in Western Sakhara campaign?

buoyant hound
#

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

buoyant hound
#

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?

manic kettle
modern osprey
#

Hello everyone.

Is there a way to catch:

  • connecting the player to the UAV
  • UAV disassembly

I couldn't find any suitable EH.

hallow mortar
modern osprey
hallow mortar
#

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 πŸ€”

meager granite
bleak mural
#

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

bleak mural
#

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

fair drum
#

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"

bleak mural
#

is there an EH for "taking fire"? not hit

fair drum
#

firedNear

bleak mural
#

ah ok

fair drum
#

its not really firedAT, but rather something shot nearby

bleak mural
#

yeah i just read that

bleak mural
proven charm
#

getSuppression is one option

bleak mural
#

should be a "firedAtEnemy" EH

bleak mural
#

though il look at this and reenable

gentle zenith
#

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?

proven charm
#

code/config?

gentle zenith
#

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

proven charm
#

can you try the text's h & w without safezoneW/H ?

gentle zenith
#

Sure I can give that a try

gentle zenith
proven charm
#

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

gentle zenith
#

Yeah without the safezones it's totally off

proven charm
#

oh

meager granite
gentle zenith
#

Yeah so on standard resolutions the text is properly centered, but the wide aspect ratios make it go crazy

meager granite
#

if you expect your values being proportional of controls group

gentle zenith
meager granite
#

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

gentle zenith
final spear
#

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

bleak mural
#

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

viscid anvil
#

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

meager granite
final spear
meager granite
#

No idea how that works, can't help

final spear
#

Alright

granite sky
#

The engine/network cost of the bullets is typically more expensive than the scripts though.

cobalt path
#

question, what is the script to do a gesture?

#

playaction, switchmove? etc

meager granite
#

playAction

bleak mural
#

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

granite sky
#

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)

bleak mural
# granite sky I don't know about triggers though.

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

bleak mural
#

what would a correct syntax be to detect kind of car OR kind of tank?

hallow mortar
bleak mural
#

{({_x isKindOf "LandVehicle"} count thisList) > 0} keep getting errors

bleak mural
#

ok had to rearrange the condition. hope this works

#
triggerActivated logtrg && {({_x isKindOf "LandVehicle"} count thisList) > 0}
cobalt path
meager granite
#

Honestly, I don't know. I remember switchGesture not working, but perhaps it was changed recently?

frail vault
#

i know its a bit silly but does anyone know how to set Praetorian 1C as independent arma 3 just using init fields?

meager granite
#

unless you meant independent as in side

hallow mortar
#
if isServer then { independent createVehicleCrew this }```
meager granite
#

oh yeah alt syntax made it a while ago

hallow mortar
#

Just to clarify, place it empty before using createVehicleCrew on it. Won't work if it already has its default BLUFOR crew unit.

frail vault
frail vault
cobalt path
#
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?