#arma3_scripting

1 messages · Page 351 of 1

little eagle
#

true

#

🤦

#

NaN and Number are the only types that == can cross check

peak plover
#

🤔

little eagle
#

== reports true when either side is NaN

#

>, <, >=, <= work as expected and report false.

#

This is a huge pitfall...

queen cargo
#

that is epic

#

not a pitfall

little eagle
#

epic fail

queen cargo
#

and probably differs from system to system
erg, using the visual c compiler, 10 / 0 is failing
on my raspberry pi with gcc it returns NaN 😄

little eagle
#

I blame all PhysX errors and flips on logic like this.

queen cargo
#

probably something like that in there too

#

where they simply did forgot to add NaN to >, <, >=, <=

#

or more: added it to == because some dev always crashed his pc with it back in OFP

sullen willow
#

@little eagle Sorry for being a pain. It works like a charm, but is it going to give money to every player on the server like it was before?

little eagle
#

Every player that is inside one of these cars.

sullen willow
#

Amazing. Thank you so much

dusk sage
#

@queen cargo What are you expecting 10/0 to return?

queen cargo
#

error

#

@dusk sage

#

something / 0 is illegal math

little eagle
#
0/0

reports 0 and errors "zero devisor"

#

But it does not report NaN. It's still 0.

#

...

queen cargo
#

should actually return NOTHING @little eagle

#

not NaN

little eagle
#

Isn't this what NaN is for?

dusk sage
#

Right, thought you were expecting something other than that 😛

queen cargo
#

not in the arma world @little eagle

#

not in the arma world 😛

little eagle
#

nil or NaN. I'd be fine with either. but 0 ...

#
tan deg (pi/2)

-2.28773e+007
🤔

dusk sage
#

Seems right, due to precision

queen cargo
#

i hate that crappy support info command ...

waxen tide
#

@little eagle yes and no, i want to keep it playable with vanilla but i'll support mods (ace, rhs, etc)

dusk sage
#

@little eagle a/b where b = 0, returns 0, always

#

Pi also seems to be accurate to 3.1415926536

little eagle
#

tan 90 does the same

#

a/b where b = 0, returns 0, always
In my country this would be undefined. Not a rational number.

waxen tide
#

commy2, you feel like telling me your easy way for the server-client vote thingy?

little eagle
#
if (isServer) then {
    missionNamespace setVariable ["asdfg_voteNamespace", createSimpleObject ["Building", [0,0,0]], true];
};

// client
asdfg_voteNamespace setVariable [str clientOwner, "yes", true];
#

To count the "yes" or whatever:

{asdfg_voteNamespace getVariable _x isEqualTo "yes"} count allVariables asdfg_voteNamespace
waxen tide
#

scratches his head

#

thanks

#

why did you ask about mods tho?

little eagle
#

Could've used the CBA function instead of createSimpleObject.

#

I always have to look up how you do this in vanilla.

#

This way you can easily overwrite your previous vote as client.

#

And the counting is quick.

#

So this made sense to me.

waxen tide
#

I'm not entirely sure i understand this correctly. so on the server you create a new namespace? on a dummy object?

indigo snow
#

you just call the object "namespace"

#

its an object

waxen tide
#

oh, i see. objects are automatically synced over network, so every client can glue a var to it?

little eagle
#

Yes.

#

It becomes your ballot box.

waxen tide
#

now it makes sense to me. thanks!

little eagle
#

I guess it's a bit unusual, but done in very few lines of code.

astral tendon
#

so, i try to make the AI drive wile i have recorded what to do, but he is moving wile pressing the brakes

little eagle
#

setDriveOnPath ?

astral tendon
#

this

#

any idea?

little eagle
#

disableAi of the driver???

peak plover
#

#define CFGEND(var1)        bin\config.bin/CfgDebriefing/##var1
[CFGEND(endDeath),CFGEND(loser),CFGEND(PlayerLost),CFGEND(PlayerWon)];

Is this how you are supposed to macro?

astral tendon
#

disableAi did not worked

little eagle
#

The SQF would need quote marks.

#

Also I'm not 100% sure if / is one of the chars that doesn't have to have the glue ##

rancid ruin
#

you're meant to be the macro master

#

what a noob

little eagle
#

I can never remember those. They are somewhere in DOUBLES and TRIPLES from CBA and I always just use those.

#

There is no rhyme or reason to ## as far as I can tell.

rancid ruin
#

it's for when you want to double hashtag something

indigo snow
#

i always just lint shit with eliteness and fiddle till it works

little eagle
#
#define QUOTE(var) #var
#define CFG_END(var) (configFile >> "CfgDebriefing" >> QUOTE(var))

[CFG_END(endDeath),CFG_END(loser),CFG_END(PlayerLost),CFG_END(PlayerWon)];
#

Something like that ^

peak plover
#

That's the darn one

#

damn

#

I suck at macro

little eagle
#

Oh

#
#define CFG_END(var) (configFile >> "CfgDebriefing" >> 'var')

[CFG_END(endDeath),CFG_END(loser),CFG_END(PlayerLost),CFG_END(PlayerWon)];
#

Simpler

#

= better

peak plover
#

Whaaad

#

dats gool

#

I for some reason didn't even think of that

#

probably noob

little eagle
#

^^

indigo snow
#

huh didnt know "var" doesnt expand but 'var' does

little eagle
#

Yup. That is how it works.

atomic epoch
#

Is there a reason for choosing missionNamespace setVariable?

peak plover
#

as opposed to?

atomic epoch
#

Are there benifits to using

 missionNamespace setVariable ["asdfg_voteNamespace", createSimpleObject ["Building", [0,0,0]]

Instead of

asdfg_voteNamespace = createSimpleObject ["Building", [0,0,0]]

?

still forum
#

That was not what was posted.

#
 missionNamespace setVariable ["asdfg_voteNamespace", createSimpleObject ["Building", [0,0,0], true]
peak plover
#
missionNamespace setVariable [_myVarNameThatIsUnknownOrDynamic,true,true];
still forum
#

and this has publicVariable built directly into the command

#

also it let's you specify that you want to set a variable in missionNamespace

#

you can never be 100% sure that you are in missionNamespace in scheduled scripts

little eagle
#

The syntax without the public flag is pretty pointless. Would just use a normal assignment. And switching to uiNamespace should very rarely happen.

waxen tide
#

am i correct assuming that calling a script with compileFinal preprocessFileLineNumbers and calling a function is just about the same thing?

little eagle
#

Calling a (precompiled) function is superior, because the machine has to do less stuff during the mission.

waxen tide
#

well in the BIKI article for vars it says if you use global vars in MP, use compileFinal preprocessFileLineNumbers to prevent people from messing with them. And i kind of? get why, but why not just turn it into a function right away?

little eagle
#

Reading a file is pretty expensive and a bit less so, but still not needed is compiling a string to executable code.

#

In my opinion.

#

compileFinal is pointless outside of caching functions in ui namespace.

waxen tide
#

anything i define as a function is compiled at mission start anyways, isn't it?

little eagle
#

If someone can execute arbitrary code to change functions, you already lost.

waxen tide
#

caching functions in ui namespace? why would one need that?

little eagle
#

So that starting a mission with ACE doesn't take my machine 30 seconds to recompile all the functions.

#

It's what the CfgFunctions framework does.

#

For missions: compile and preprocess all functions at preInit
For addons: do it as game start in ui namespace and copy them over to mission namespace at preInit

#

Or just use CfgFunctions which does this all for you.

#

But it's handy to know what CfgFunctions actually does.

#

I guess.

waxen tide
#

CfgFunctions is part of ? arma? ace?

little eagle
#

Vanilla.

waxen tide
#

ok

#

thanks

waxen tide
#

i'll add this topic to my reading list.

indigo snow
#

stupid () and links

little eagle
#

Stupid discord

#

Doesn't happen in Slack btw. :whistle:

indigo snow
#

of course i want my \ to turn into /

#

tbh it breaks on more sites with a markup ish language

little eagle
#

He's smart enough to follow the link.

waxen tide
#

i am indeed.

little eagle
#

^^

indigo snow
#

🍪 😛

waxen tide
#

well obviously one doesn't want to recompile every time. its not like i'm a gentoo user.

tough abyss
#

Not SQF not still.

waxen tide
#

If i have a bunch of functions i want to execute on mission start and i need them to be ran in a particular order, whats the best way to do that? i used to just chain my scripts together, so when script1 was done it would call script2, etc but that gets a little bit messy after a while.

#

doing it in a central place would be neat, but i'm somehow stuck with the thought that will actually cost performance

little eagle
#
call asdfg_fnc_function1;
call asdfg_fnc_function2;
#

function2 will only run after function1 is completed.

waxen tide
#

oh. right. it being call and all. thanks commy2. I've slightly confused myself today with too much work.

little eagle
#

A central place would be a postInit function. The vanilla one is scheduled and the loading screen only finishes after postInit is done, but that's nothing that isNil can't fix.

waxen tide
#

i don't follow

little eagle
#

The link I posted about the function library. You can set functions to be automatically executed "preInit" (before any objects are created) or "postInit" (after all* objects are created).

waxen tide
#

to ensure editor placed objects already exist?

little eagle
#

So make one function as your "postInit" hub and set up your mission there.

#

They will already exist when a postInit function is called.

waxen tide
#

it seems to me most people just call their mission scripts at the bottom of the init event scripts? is that about equal, exactly equal, or is there something big i'm missing why it isn't?

little eagle
#

With the postInit one you can use player, the loading screen only ends when it's done running and the timing is the same in SP.

waxen tide
#

I'm sorry if i'm annoying, i'm a bit of a slowpoke today. Why wouldn't one be able to use player otherwise? And by timing you are saying that the postinit state is set for all connected players and the server at the same time?

indigo snow
#

Some initialization scripts run before the player command returns an object. Thats why you sometimes see waituntil {!isNull player} in scripts

waxen tide
#

Now with what you guys told me i'm confused a bit. What is the purpose of the init scripts? If i leave them blank, does nothing happen in the init phase? or does arma internal stuff happen that leads to player returning an object post init but (eventually) not during init?

#

is there things one needs to do in the init phase because it is impossible post-init?

rancid ruin
#

that's a strange question man

#

it all depends on what you're trying to accomplish really doesn't it

robust hollow
#

i cant say i understand the question fully, but to clear a part of it up.
You don't NEED any of the init scripts (init, initServer, initPlayerLocal, initPlayerServer), the mission will still start as expected, however if you need scripts to run when the mission starts and you don't want to add a pre or post init fnc to the cfgfunctions, those files are where you'd do it.

waxen tide
#

well it is not like i have any problems. i put my mission scripts at the end of the init scripts, and everything worked fine so far. but from what commy2 wrote i figured it is bad practice to rely on the timing being right when doing that.

#

thanks you two!

dusk sage
#
>a/b where b = 0, returns 0, always
In my country this would be undefined. Not a rational number.

I meant in ARMA (hardcoded to). Undefined globally 😛 @little eagle

waxen tide
#

I would assume variables saved in the profileNamespace are loaded on start from the profile and stay in memory the entire runtime?

rancid ruin
#

i think profilenamespace stays around forever

#

all the vars are written in to a file called yourarmaprofilename.vars or something - should be next to your profile file i think

#

it's what people use to make a ghetto "database" system without using addons @waxen tide

#

UInamespace is the one which stays around until your game is shut down

waxen tide
#

@rancid ruin i do quite extensive checks on the map to get data i use later to spawn stuff. i cache the data in the servers profile so i don't have to re-do it everytime (i included a check for the arma version and re-do checks on version change)

#

But i was wondering if that profile is loaded into RAM on start?

rancid ruin
#

i would say it is yeah

#

you're worried about what exactly?

waxen tide
#

well the reason i cache the data is to not rape the performance all the time by going thru the whole map to fetch data to spawn stuff. if profile reads from the file all the time, that would be expensive. so i would rather create a global var from profile to have it in memory.

#

but i guess it is keept in memory anyways

rancid ruin
#

yeah don't worry about read/write, it's certain to just be kept in memory and written to disk at shutdown

#

at least....that's how it should work if arma 3 was made in a half-way competent fashion

noble pond
#

if your going to be saving stuff to it, you need to do saveProfileNamespace to make your changes permenant

#

otherwise you will have data loss once the mission is over/restarted

#

so in the most simple way, you could just do saveProfileNamespace after any setVariable you do that has to do with it

#

in the end the read writes are so tiny its meaningless to add one more onto the list

#

i was able to store thousands of variables inside it and writing/saving a couple hundred every few minutes and there was no measurable performance drop

waxen tide
#

yeah i've already implemented it like you wrote. I guess compared what you're doing i'm using that feature very lightly.

blazing zodiac
#

Does anyone know how to remove the open/close door icons from the default doors? I am able to include a mod so config tweaks are usable.

rancid ruin
#

good question. not sure of the best way to do this, but what i'd probably do is de-pbo all the vanilla arma 3 UI pbos, find the .paa with the door open/close icon, and then work backwards from there. search main cfg file for the .paa's filename, then write a cfgPatch which hides it in some way, or just replaces the texture with a blank one @blazing zodiac

blazing zodiac
#

Makes perfect sense, I'll take a look when I get home @rancid ruin

rancid ruin
#

@blazing zodiac \Arma 3\Addons\ui_f_data\IGUI\Cfg\Actions\open_door_ca.paa there ya go bruh 👍🏿

#
  • close_ca.paa in the same dir
blazing zodiac
#

Awesome man, thanks for looking for me @rancid ruin

rancid ruin
#

no problem, glhf

little eagle
#

saveProfileNamespace does nothing. If you change a variable in the profile, it stays through the whole session so also mission restarts etc.
And the profile is saved when the game is closed. saveProfileNamespace does nothing. Try it.

fallow radish
#

hi guys can anyone help me out here with deactivating sounds from a trigger once out of the triggered area? currently it just keeps playing till the end

#

sfx works with trigger, but error keeps popping up saying no sound file but still plays

sullen willow
#

Could someone tell me why this isn't working?

#
    _CurrentWeapon = primaryWeapon player;
    if !(isNil "_CurrentWeapon") then {
        _CurrentWeapon = primaryWeapon player;
        _magazines = getArray (configFile / "CfgWeapons" / _CurrentWeapon / "magazines");
        player addMagazine (_magazines select 0);
    };
};
#

Supposed to add a mag for your current weapon

#

Well, your primary.

little eagle
#

You don't have space in your uniform / vest / backpack.

#
    _CurrentWeapon = primaryWeapon player;
    if !(isNil "_CurrentWeapon") then {
        _CurrentWeapon = primaryWeapon player;

???

sullen willow
#

This isn't my script so I'm just as ??? as you are.

little eagle
#

_CurrentWeapon will never be nil

#

"" maybe, but not nil

#

So yeah, addMagazine adds it to your uniform/vest/backpack and if you have no space, it just fails silently.

sullen willow
#

So then I need to remove the isNil bit?

#

I had plenty of space in my containers

#

There's no way that's what was wrong

little eagle
#

You can, because it's a tautology. It wouldn't change a thing, but simplify.

sullen willow
#

Then it must not be working for another reason

little eagle
#

So your uniform etc. isn't full?

sullen willow
#

Nope.

#

I made sure they were empty.

little eagle
#

Then this script isn't executed or there is an error before this code block which prevents this from being executed.

robust hollow
#

does ur player have a primary weapon?

sullen willow
#

No I just carry around a dildo

#

😐

robust hollow
#

well i think i know the problem then 👍

sullen willow
#

Lol

#

But yeah of course

robust hollow
#

the script itself works fine. if the unit has a primary weapon in the primary weapon slot then surely its just a space issue

little eagle
#

Yeah, this part is "fine". Search the error somewhere else.

robust hollow
#

^ 👍

sullen willow
#

It's definitely not a space issue

little eagle
#

Also, if your avatar is naked, no uniform/vest/backpack etc. then you never have enough space.

#

It never goes into the weapon directly.

sullen willow
#

Wearing a uniform, high capacity vest and backpack.

#

It's not a space issue

little eagle
#

What's the weapon?

sullen willow
#

ACR Remington

little eagle
#

Try with MX

sullen willow
#

sec

#

Still nothing

little eagle
#

Then this code block is not being executed.

#

Btw. it's just a function assignment by itself. You'd need to call that function in the local variable.

sullen willow
#

That makes a bit more sense

little eagle
#

I put this into the debug console and it gave me a mag. Note the last line I added.

_FNC_1Mag = { 
    _CurrentWeapon = primaryWeapon player; 
    if !(isNil "_CurrentWeapon") then { 
        _CurrentWeapon = primaryWeapon player; 
        _magazines = getArray (configFile / "CfgWeapons" / _CurrentWeapon / "magazines"); 
        player addMagazine (_magazines select 0); 
    }; 
};

call _FNC_1Mag
sullen willow
#

I see that, yes.

#

Thank you. Every bit of this is something else learned.

#

I am growing stronger

little eagle
#

yw

daring pawn
#

Lads, with ACE3, its fairly clear how to set new damage with a function they've created. I'm struggling however to get that damage in a similar fashion to the bohemia getDamage function. Is there a way to find out what ACE injuries they have?

still forum
#

getHitPointDamage

#

But that's only vanilla damage like broken legs.
ACE Injuries are stored in ACE internal variables.

#

see the fullHeal function for names of all of them

daring pawn
little eagle
#

I don't think the medical system has "damage". It has wounds and bloodloss etc.

daring pawn
#

is _target the bodyPart hitPoint?

little eagle
#
  • 1: Target <OBJECT>
#

An object

still forum
#

The Player/Unit

daring pawn
#

I'm seriously blind wow

little eagle
#

It was such a pita to put these function headers everywhere D:

daring pawn
#
_var = player getVariable "ace_medical_openWounds";
systemchat format ["%1",_var];

[[1,21,1,1,0.01],[2,3,3,2,0.01],[1,8,1,1,0]]

So it returns that on the unit who volunteered to take frag grenade. Where am I able to find what each part of that array is equal to? It appears to be the different injury types and how many of them there are

#

In fact doesn't matter for what I want as to what they are, just need to be able to store them to set them again

#

Beauty

little eagle
#

Tinkering with the internals. Sounds like a recipe for disaster. Good luck though.

daring pawn
#

I'm persisting their medical status in a session so disconnecting and reconnecting doesn't allow being cheeky to reset medical stats or if a game crash happens and they get back in they keep their stats.

I know its not ideal to do it with internals, especially when medical rewrite goes public but shouldn't be much strain to update it.

little eagle
#

People have been requesting a function to serialize the medic system stuff for ages. If it were as simple as copying over some variables, it would've been done a long time ago.

daring pawn
#

Oh nah not saying anything is slack at all, just making do with what I can

sullen willow
#

Would it be possible to have a make a script that would show the location of every player on the map for set amount of time?

still forum
#

yes.

little eagle
#

proof:

{
    systemChat str [name _x, getPosASL _x];
} forEach allPlayers;
astral tendon
#

is there a way to identify what cargo to join? for exemple, a huming bird side seats, he has 4 seasts, can i especify one of the seats?

robust hollow
astral tendon
#

that CargoIndex, there is a way to i know what is ir index?

daring pawn
#

@little eagle is QGVAR(internalWounds) used yet? I know Airways aren't at the moment

#

I've just never seen an internal wound in ingame experience

robust hollow
#

what do you mean roque? how do you know which index to move them into?

astral tendon
#

yes

#

for exemple, i want to lock one side of the huming bird but not the other

robust hollow
#

get on the sides and use this

vehicle player getCargoIndex player```
and then in ur script lock the one side with the indexs for it
astral tendon
#

thanks

#

another thing, do triggers can detect only the player inside the vehicle with out the vehicle it self? or will detect the vehicle and not the player inside it?

#

exemple: i do i tiny trigger are especificly made to detect the player seat inside of a vehicle and i wanna to just detect hin and not the vehicle it self.

little eagle
#

Which cargo index corresponds to what position in the vehicle depends on how they are numbered in the model.

astral tendon
#

driver1 showRadioetSpeedMode "FULL";

#

what is the generic error here?

robust hollow
#

is showRadioetSpeedMode a thing?

#

i assume you want

driver1 speedMode "FULL";```
astral tendon
#

i tried this but the driver still not go on full mode

robust hollow
#

oh, yea my bad. i assume you tried this one?

driver1 setSpeedMode "FULL";```
the snippet you pasted is two commands in one so thats why it errored.
astral tendon
#

yes i pasted wrong

#

and still not working

#

well, i give up on this one

still forum
#

The generic error is not a generic error. You just need to look more closely at the error message.

astral tendon
#

is there any command that makes AI drivers not care about obstacles? like walls or even units? i dont wanna they to try to dodge anyting, just follow the waypoint

little eagle
#

No.

still forum
astral tendon
#

i tried to use this but its broken af

astral tendon
#

not only it give a error when paste the Path but when edit it to actually work it drives in a completely diferent direction.

peak plover
#

it give a error
???

tough abyss
#

pretty sure it works

peak plover
#

You are probably causing it to error, hence it does not work for you

tough abyss
#

garbage in garbage out

astral tendon
#

copy the Path with F1
vehicleName setDriveOnPath
paste the points
some error

#

edit the path to fit
goes to some palce else

still forum
#

"some error" Thank you. Very helpful.

peak plover
#

>copy the Path with F1
wrong game / sport

tough abyss
#

😄

astral tendon
#

should i use a nascar vehicle instead?

#

Well, the editor does not help either

peak plover
#

pate your code here using

` == key under escape

```sqf
//mycode
private _nil = nil;
```
looks like

//mycode
private _nil = nil;
little eagle
#

we are we
talking like
this

#

?

peak plover
#

main forum we browse is a chan

#

?

little eagle
#

I wish quotes would work in discord like in Slack.

#

And Github.

peak plover
#

I wish I would start work on loadout systems

little eagle
#

Conclusion: fix the error and it will work.

tough abyss
#

or params

peak plover
#

Or just post code 😉

astral tendon
#

how? i cant put images or files here

peak plover
#

Copy paste code

#

example :

#

#include "script_component.cpp"
// Code begins

// Player init
if (hasInterface) then {
    call tpb_fnc_blocker;
};
astral tendon
#

oh, you mean i paste it?

peak plover
#

Yeah, because that command would be max ~5 lines ?

astral tendon
#

i can put that on the trigger?

peak plover
#

trigger, ree

still forum
#

No you can't put pasting something in discord on a trigger

peak plover
#

😂

still forum
#

and yes. When nigel says "paste" then he does mean "paste" like you correctly assumed.

#

You were asked to post your problem code here so we can take a look at it.

astral tendon
#

wait what it is that for?

still forum
#

For helping you.

astral tendon
#

here is a exemple

#

myVehicle setDriveOnPath [[1000,10,1000],[1100,10,1000]]

#

the this is

#

there is allot of numbers so i cant paste here

still forum
#

what is the error message

#

Please don't confuse obviously already confused people @peak plover :x

astral tendon
#

its too big

#

here

still forum
#

I understand that. Post the error....

peak plover
#

That's what she said 😂

astral tendon
#

the editor said

#

or the discord

still forum
#

That is definetly incorrect. As you already said
myVehicle setDriveOnPath [[1000,10,1000],[1100,10,1000]]
That is how it should look. You have
myVehicle setDriveOnPath [[0,[1000,10,1000],...]
So after the first 4 characters you can already see that it's wrong

astral tendon
#

exacly

still forum
#

Where do you get your path data from?

#

You should get it into the correct format.

astral tendon
#

when i remove those 4 characters it work but goes in a diferent direction

still forum
#

Then the order of the waypoints is incorrect

astral tendon
#

if i make just like the example above

#

i can change it?

still forum
#

Yes... You have a thing it front of you that is called keyboard. It has buttons on it. These buttons can edit text. You also have a Mouse. A Mouse can be used to select text.
A script is a big piece of text. It can be edited like any other piece of text.

astral tendon
#

nice

#

i tried it

#

and my car got send to the lake on left

still forum
#

Where do you get your path data from? (To repeat myself)

tough abyss
#

you probably just have one bracket to much arround your data

#

[[[],[]]] instead of [[],[]]

astral tendon
#

recording it

peak plover
#

Roque, you got it wrong

astral tendon
peak plover
#

Put your TOO BIG code on pastebin or something...

astral tendon
#

like here

still forum
#

@tough abyss No.
[[0,[
would still be wrong with less brackets

astral tendon
#

yup, to big for it too

tough abyss
#

yea he also messed up everything

still forum
#

unitCapture is designed to be used with unitPlay. not setDriveOnPath.

peak plover
#

setDriveOnPath won't work for unitCapture data

still forum
#

And both are designed for helicopters... Not ground vehicles

tough abyss
#

but after initially pasting the path he just shouldnt paste it into [] but reather directly behind the command

#

wait his data comes from unitCapture?

still forum
#

nods

astral tendon
still forum
#

have you tried unitPlay? Also that video doesn't say anything. He probably used the unitCapture data and edited it manually

little eagle
#

I don't think you're supposed to enter hundreds of positions to setDriveOnPath like you would with the unitPlay/Capture functions.

tough abyss
astral tendon
#

there is another way to get that data?

little eagle
#

Debug console

#

Drive to position X

#

getPos cameraOn

#

copy paste

#

repeat

astral tendon
#

thats why i said it was broken

little eagle
#

It's working fine if you give it the correct input.

tough abyss
#

garbage in garbage out

astral tendon
#

afther i was using
path1 =;
[unit1, path1] spawn BIS_fnc_Unitplay;

#

make a file for it and evreytinhg

#

it did worked but the driver keeps braking

#

its goes normal if i turn off the enginne

#

but course no enginne sound its looks like a ghost car

#

and if i order the AI to go fast it fix it

little eagle
#

Have you copy pasted your code to pastebin already?

astral tendon
little eagle
#
driver1 setDriveOnPath [[0,[4466.54,12216.8,4.2871],[-0.975498,-0.21581,0.0427808], ...
#

This is wrong on multiple levels.

#
myVehicle setDriveOnPath [[1000,10,1000],[1100,10,1000]]
#

That's one too many nested arrays and you're supposed to give it to the car, not the driver.

astral tendon
#

yes, the name of the car is driver1

little eagle
#

Well that's confusing.

astral tendon
#

dont ask

little eagle
#

Even then, the array has the wrong format and will error and not work.

astral tendon
#

well, i dont know how to use that debuge console

#

other way to get it?

little eagle
#

There are 8 lines in the lower half

#

Just enter
getPos cameraOn
In one of the odd numbered ones.

#

And it will write where you are.

#

x,y,z

#

Then you get a bunch of those

#

And used them with the command.

astral tendon
#

i got it

little eagle
#

myVehicle setDriveOnPath [[x1,y1,z1],[x2,y2,z2], ...]

astral tendon
#

so for multiple one is myVehicle setDriveOnPath [[1000,10,1000],[1100,10,1000],[1100,10,1000]] and soo on?

thin pine
#

CopyToClipboard?

peak plover
#

You can get the pos with the editor by right clicking

astral tendon
#

that will take some time, but at least works

#

there is a bind to that? or maybe i can bind it my self?

little eagle
#

You just need to record the positions where the car would turn I think.

peak plover
#

You can make a key down eventhandler that will add your current pos to an array, this way you could make it a lot faster... then when you done copy the array to clipboard

little eagle
#
findDisplay 46 displayAddEventHandler ["keyDown", {
    params ["", "_key"];

    If (_key == 0x3B) then {
        systemChat str time;
        diag_log getPos cameraOn;
    };
}];
#

There. F1

astral tendon
#

i need to change the "_key"?

little eagle
#

Pick one you like.

astral tendon
#

findDisplay 46 displayAddEventHandler ["keyDown", {
params ["", "DIK_APPS"];

If (_key == 0x3B) then {
    systemChat str time;
    diag_log getPos cameraOn;
};

}];

#

is that right?

little eagle
#

No

#

0x3B is F1

#

_key is just a variable name.

still forum
#

*facepalms *

little eagle
#

The == compares the key you just pressed with a id.

astral tendon
#

findDisplay 46 displayAddEventHandler ["keyDown", {
params ["", "_key"];

If (_key == 0xDD   ) then {
    systemChat str time;
    diag_log getPos cameraOn;
};

}];

#

right?

little eagle
#

lgtm

#

Debug console, upper half this time.

#

Then LOCAL EXEC

#

Result is in %LOCALAPPDATA%\Arma 3. On Windows at least.

simple solstice
#

#include "\a3\editor_f\Data\Scripts\dikCodes.h" for using DIK_<KEY> instead of hex values

little eagle
#

I wish the debug console supported this.

#

I wish we had a preprocessString command.

still forum
#

No you don't @little eagle

little eagle
#

You're not my mom.

#

Yes i do

still forum
#

You remember what happens when the preprocessor fails?

#

You really want that to be doable with via script?

little eagle
#

Fix the crashing too

astral tendon
#

so, i am on the folder

#

how do i get the results?

simple solstice
#

open latest rpt file

sand pivot
#

is there a scripting command/function that would allow me to set a camera view (curator camera) to show multiple objects? Same question for 2D map. Like a fit view to selection type function.

sullen willow
#
    sounds[] = {};
    
class sound1 
    {
    name = "snipe.ogg";
    sound[] = {"sound\snipe.ogg", 1, 1};
    titles[] = {};
    };
#

"Member already defined"

#

what do

robust hollow
#

what member is already defined? iit should say.

little eagle
#

Use unique classnames. No repeat "sound1"

sullen willow
#

should I change sound1 to the sound name then?

little eagle
#

Add a OFPEC tag to it.

#

This is description.ext right?

sullen willow
#

yes

little eagle
#

You only have one sound? Because this is missing a closing curly bracket if so.

sullen willow
#

For the moment yes

#

I'll be adding some more eventually

little eagle
#

Then you need another }

#
class CfgSounds {
    sounds[] = {};

    class sound1 {
        name = "snipe.ogg";
        sound[] = {"sound\snipe.ogg", 1, 1};
        titles[] = {};
    };
}; <--- there
#

Also, not sure about the name "snipe.ogg". Those sounds may have to not have a dot in their names

sullen willow
#

😐

#

So no periods, then?

little eagle
#

No periods in classnames.

#

Only a-z, 0-9 and _

atomic epoch
#
if (_no > 1 && _no < 2) then {true}

-> If there a more efficient way of finding out if no. is between 1 and 2?

#

Or am I overthinking 🤔

little eagle
#

Integers?

atomic epoch
#

Decimal. Maybe I shoyldve put 1.0 and 2.0 instead

little eagle
#

You can totally do what you have, but I'm thinking of something strange.

atomic epoch
#

Yeah... I have a strange feeling it can be done with min and max

little eagle
#

So you want to "clamp" the number?

#

1 -> 1
2 -> 2
3 -> 2
15 -> 2
0 -> 1
etc?

atomic epoch
#

Nope, I'm just seeing if there's a more efficient way of fidning out if a number is inside a range

sullen willow
#

Still getting that "member already defined" crap

little eagle
#

Post the description.ext

sullen willow
#

/*
    Header
*/
author = "Skull";
onLoadName = "Hardline: Malden";
loadScreen="Pictures\Cops.jpg";
onLoadMission = "Police forces battle Cartel Gunmen on Malden. Complete objectives and kill your enemy to bleed their respawn tickets.";

#include "voiceControl.cpp"

/*
    Classes
*/

#include "HG\UI\HG_DialogsMaster.h"

class RscTitles
{
    #include "HG\UI\Dialogs\HG_HUD.h"
    #include "HG\UI\Dialogs\HG_Tags.h"
};

class CfgClient
{
    #include "HG\Config\HG_Config.h"
};

class CfgSounds
{
    #include "HG\Sounds\HG_Sounds.h"
};

class CfgFunctions 
{
    #include "HG\Functions\HG_Functions.h"
};

class CfgSounds {
    sounds[] = {};

    class snipe {
        name = "snipe";
        sound[] = {"sound\snipe.ogg", 1, 1};
        titles[] = {};
    };
};```
little eagle
#
str _num select [0,2] isEqualTo "1."

idk

#

You have two CfgSounds, @sullen willow

sullen willow
#

what

#

I do

#

?

little eagle
#

That won't work

#

Yes, read what you posted.

sullen willow
#

Yep

#

I see it now

#

What then?

little eagle
#

Only use one.

peak plover
#

put #include "HG\Sounds\HG_Sounds.h" into the other one

#

delete the first one

noble pond
#

he'll still need to merge one of them at least partially into the other

little eagle
#

Not really.

#

I mean it would look better I guess.

peak plover
#

class CfgFunctions {
    class debug
    {
        class fnc
        {
            file = "engine\debug";
            class log {};
        };
    };
    class mission
    {
        class fnc
        {
            file = "engine";
            class loadSettings {};
            class initPlugin {preinit = 1;};
            class initPlayable {preinit = 1;};
        };
    };
    #define MISSION_PLUGIN_FUNCTIONS
        #include "plugins\plugins.cpp"
    #undef MISSION_PLUGIN_FUNCTIONS
};
#

works fine

#

Why would sounds not work?

noble pond
#

if you have two cfgAnything it will still cause the same problem

atomic epoch
#

I got it

_no = 5;
if (_no > 0 && _no < 10 ) then {true}

is the same as

_no = 5; 
if ((_no min 10) == (_no max 0) ) then {true};
noble pond
#

you just move it to a different location lol

peak plover
#
_no = 5; 
if ((_no min 10) == (_no max 0) ) then {true};
// same as
_no = 5; 
((_no min 10) == (_no max 0) )
little eagle
#

Can these numbers be negative?

peak plover
#

then {true} is kind of, erm useless?

atomic epoch
#

Sure

little eagle
#

I want to do something with log.

atomic epoch
#

Well, true is just as placeholder for "code"

little eagle
#

Or sine

peak plover
#

aah

sullen willow
#

Every time I try to fix this I just do it wrong lol

#

nigel - Today at 9:10 AM
put #include "HG\Sounds\HG_Sounds.h" into the other one

#

So put it in the bottom one?

atomic epoch
#
_no = 5;
if (_no > 0 && _no < 10 ) then {true}
```0.0026 ms

```sqf
_no = 5; 
if ((_no min 10) == (_no max 0) ) then {true};
```0.0026 ms
There's no difference, but its a nice quirk
little eagle
#
private _array = [5, _no, 10];
_array sort true;

if (_attay select 1 isEqualTo _no) then {
#

Watch this be faster than > and < #SQF

noble pond
#

isEqualTo is faster than ==, maybe faster than < or > too?

#

who knows

little eagle
#

I wish sort would return the array.

peak plover
#

Cool tricks @atomic epoch @little eagle

little eagle
#

Then this would almost guaranteed to be faster...

#

Mine is (hopefully) worse^^

#
if ((5 - _no) * (10 - _no) < 0) then {

Polynomial!

atomic epoch
#

I tested

private _array = [5, _no, 10];
_array sort true;

if (_attay select 1 isEqualTo _no) then {true}

0.0030

Is this meant to check if a number is inside a range or something else?

little eagle
#

Inside the range.

atomic epoch
#

It's slower by 0.0004ms in my test 😦

little eagle
#

good

#
_no = 5;
if ((0 - _no) * (10 - _no) < 0) then {true};

genuinely curious about this one ^

atomic epoch
#
_no = 5;
if ((0 - _no) * (10 - _no) < 0) then {true};

0.0029ms

and < is still faster

little eagle
#

damn

#

Does it get style points at least?

atomic epoch
#

ofc, I award 10/10 style points 👏

#

😁

sullen willow
#

Well. The errors went away, but it's not playing the sound.

sullen willow
#

Fix'd. Thanks ❤

sour saffron
#

How fast is _no in [0,1,2,3,4,5]; ? 😃

little eagle
#

1.5

sour saffron
#

harsh

sharp shuttle
#

Helicopter does not disappear, but remains a ghost Do you know what the problem is? I think it's only a problem on my server. My guess is it's a "script" issue.

http://hixsoft.net:83/12.png

austere granite
#

wait what the hell is wrong with that game

#

broken videocard? there's artifacts all over screen

still forum
#

@Adanteh#0761 where? I don't see any

austere granite
still forum
#

ugh. wow.

austere granite
#

😄

little eagle
#

Chinese

austere granite
#

Pretty sure it's Korean

#

Lots of circles

still forum
#

Are you sure it's Chinese? Maybe its Japanese

austere granite
#

Circles / ovals = Korean

#

Does it include simple lines? Probably japanese

#

WE ASIAN NOW

little eagle
#

I thought the game only supports Japanese and Chinese.

waxen tide
#

can the special argument of createVehicle ("CAN_COLLIDE" etc) be applied to createVehicleLocal?

little eagle
#

No.

waxen tide
#

:C

little eagle
#

Isn't it already in that mode though?

waxen tide
#

no idea.

#

i'll try

little eagle
#

CAN_COLLIDE is the simplest one. NONE is just the default for the other command.

#

You could just follow up with a setPosASL

waxen tide
#

what about "FLY" ?

#

substitute it with setPos as well

#

???

little eagle
#

Sure.

waxen tide
#

i am mildly confused but i see.

little eagle
#

How come?

waxen tide
#

well i wonder what fly is good for

little eagle
#

"don't ignore z, don't glue me to the ground"

halcyon crypt
#

i.e. helicopters and planes ^^

little eagle
#

Yeah. I think it also starts the engine for helicopters and planes in the air. Or maybe I am thinking of the editor...

#

This is really poorly documented.

simple solstice
#

can I ask TFAR specific questions in this channel?

little eagle
#

No one can stop you.

halcyon crypt
#

it does start the engines, they basically get spawned in a "flying" state

simple solstice
#

Mods can 😛

still forum
#

@simple solstice Go ahead. I'm listening

simple solstice
#

So, how can I move the listening object (the player) to the Zeus camera when I open it?

still forum
#

0.9.x or 1.0 ?

simple solstice
#

0.9.x

still forum
#

Ewwwww

simple solstice
#

Uhh

#

Is there a newer one?

still forum
#

yes. 1.0 beta

#

Extended_DisplayLoad_EventHandlers > RscDisplayCurator > detect open/close.
If open override
player setVariable ["TF_fnc_position", {ATLToASL (positionCameraToWorld [0,0,0])}];
if closed
player setVariable ["TF_fnc_position", nil];

#

Dunno if TF_fnc_position changed in 1.0 .. might have

#

in 1.0 it is "Tick the checkbox in Eden"

simple solstice
#

so if I nil the variable it returns to the player object, right?

still forum
#

yes. Then it returns to default behaviour

#

people won't be able to hear you. But you can listen from the camera

simple solstice
#

And thats only 1.x

#

right?

still forum
#

No

#

That "should" work in 0.9.x

#

But I think the height in the position changed. I think 0.9.x uses ATL. So you should remove the "ATLToASL"

simple solstice
#

Is there a way to do it by scripting and not mods?

still forum
#

I... Just showed you the scripting way

little eagle
#

Extended_DisplayLoad_EventHandlers can be put into the description.ext

simple solstice
#

Oh sorry the googling result misguided me

#

I'm a bit lost of where to add it and how 😅

waxen tide
#
// Ivan_fnc_deploy_vote
hint "molos";
// works
["deploy_vote_molos", "onMapSingleClick", {hint "molos"},"molos"] call BIS_fnc_addStackedEventHandler;
// doesn't work
["deploy_vote_molos", "onMapSingleClick", {call Ivan_fnc_deploy_vote},"molos"] call BIS_fnc_addStackedEventHandler;
little eagle
#
class Extended_DisplayLoad_EventHandlers {
    class RscDisplayCurator {
        myTag_fixTFAR_Zeus = " player setVariable ['TF_fnc_position', {ATLToASL (positionCameraToWorld [0,0,0])}];";
    };
};

class Extended_DisplayUnload_EventHandlers {
    class RscDisplayCurator {
        myTag_fixTFAR_Zeus = " player setVariable ['TF_fnc_position', nil];";
    };
};

???

simple solstice
#

Thank you, I really had no idea on how to do it

little eagle
#

Just a piece of code that should run when the curator display is opened / closed.

#

XEH!

tame portal
#

cba to install CBA 🍆

little eagle
#

It's running TFAR already.

tame portal
#

I see

simple solstice
#

Sorry, I am stuck in SQF and never think of anything other than it when it comes to arma 😦

#

And scripting

tame portal
#

Don't worry, SQF doesn't move forward

#

Plenty of time to catch up

still forum
#

#Intercept

tame portal
#

#ShamelessAdvertising

little eagle
#

Release 1.0

simple solstice
#

If I only knew C++

still forum
#

@tame portal you learn too fast

little eagle
#

That would worsen your SQF.

#

Knowing C++

simple solstice
#

optix you are writing about C#

#

arent you

tame portal
#

@little eagle Are you a C++ or high-level-language fan like C# or Java

#

No

#

Maybe

little eagle
#

C or assembly

tame portal
#

Oh assembly

#

Things of the past for most people

still forum
#

poor n<xor eax,eax><xor ecx,ecx>b's

little eagle
#

C++ is too many functions to ever remember.

tame portal
#

I personally will probably never go lower than C++

little eagle
#

I want to move zeros and ones.

tame portal
#

Next step is write them on paper manually

still forum
#

The result is not scalar NaN.
So there is something wrong between calc and hint. Or input and calc

#

need to show more script

simple solstice
#

it says here that "y and z are swapped around, different from your usual model space coordinates format"

#

Isn't this going to cause problem for TFAR?

still forum
#

@simple solstice Uhm... I didn't switch them around.. so.. supposidly it's fine

chrome mason
#

Deleted my stupid ass comment as i was blind

simple solstice
#

Ohhh I thought that when returning it's swapped

#

And its for the parameter

#

sorry, im going to hide in the shadow now

still forum
#

true.

simple solstice
#

Is there an XEH for the spectator mode?

#

So I can do it like I did with zeus

still forum
#

I wish there was

#

ACE spectator yes.

simple solstice
#

I meant the in-game one ;/

still forum
#

ACE spectator is a in-game one ^^

simple solstice
#

Not using ACE 😦

little eagle
#

There may be.

#

What's the spectator gui class called?

still forum
#

Good one..

simple solstice
#

Can I check it for you in any way? Have Arma open

still forum
#

RscDisplayEGSpectator

simple solstice
#

😄

still forum
#

*facerub * I just found and fixed a TFAR bug 😄

little eagle
#

RscSpectator
?

#

RscDisplayEGSpectator

#

EG is for endgame, yes?

simple solstice
#

I mean the spectator that you can open from the debug console

still forum
#

I am using RscDisplayEGSpectator

little eagle
#
class Extended_DisplayLoad_EventHandlers {
    class RscDisplayEGSpectator {
        commy_plsWork = "systemChat str _this";
    };
};

class Extended_DisplayUnload_EventHandlers {
    class RscDisplayEGSpectator {
        commy_plsWork = "systemChat str _this";
    };
};
still forum
#

and it was causing a bug that people couldn't get out of TFAR spectator anymore. So I guess that works

little eagle
#

Isn't the debug console just using a camera script?

#

Dunno if there even is a display to tap into.

sullen willow
#

@little eagle remember the script you helped me with yesterday? The one that had to do with giving money per 5 seconds while you're in a car, then terminating when you get out? What would I do if I wanted that for playing a sound instead? I tried it out and ended up CTD

#

this was my attempt

#
    while {true} do {
        if (player in cop1) then {
            playsound "chatter";
        };
    };
};```
#

with an eventhandler to run the script when you get in the car

queen cargo
#

@simple solstice no need to
soon™ you can create real desktop applications using sqf 😈

simple solstice
#

@still forum the variable doesnt work :/

daring pawn
#
waituntil {({side group _x == INDEPENDENT} count (allUnits inAreaArray _mkr) > 1) && ({side group _x == BLUFOR} count (allUnits inAreaArray _mkr) < 1)};

The above has been functioning with no issue when in SQF, but in a function it gives a generic error before the && line.

Can you not use a waitUntil in a function/call?

#

Its also inside a While loop not while true

still forum
#

¯_(ツ)_/¯

daring pawn
#

Also get an error - Suspending not allowed in this context

#

~_~

still forum
#

@daring pawn There is no generic error. Check the real error message

#

you can't suspend in unscheduled

daring pawn
#
 2:38:18 Suspending not allowed in this context
 2:38:18 Error in expression < count (allUnits inAreaArray _mkr) > 1) && ({side group _x == BLUFOR} count (all>
 2:38:18   Error position: <&& ({side group _x == BLUFOR} count (all>
 2:38:18   Error Generic error in expression
still forum
#

suspending not allowed yeah..

daring pawn
#

Yea shiet

#

uh

#

idk how i'm going to achieve what I want

still forum
#

from where does your code get called

daring pawn
#

At the end of another script with [_mkr] remoteExecCall ["gridState",2];

still forum
#

why are you using remoteExecCall instead of remoteExec?

daring pawn
#

because i'm making the assumption its something i'd normally just use call on. But i need it run on server

#

am I about to find out RemoteExec is scheduled ~_~

still forum
#

yes

#

call keeps the current scheduled-ness.

#

Nothing else really

peak plover
#

nmvm

still forum
#

it pushes the code onto the scheduled script array. If it is a script function

daring pawn
#

Alright now in terms of a load question, waitUntil, is that each frame?

still forum
#

no

#

scheduled characteristics apply

#

it might execute every frame. It might execute every 10 minutes

simple solstice
#

can I disable the zeus ping

daring pawn
#

Ah right so, lets say I have a lot of those functions I have and they're all individually waiting on their WaitUntil's, could significant delay occur?

simple solstice
#

im going insane

daring pawn
#

Yea turn "Radio" sounds off in your Audio

#

won't get the sound

simple solstice
#

THANK YOU

still forum
#

@simple solstice I think there is an eventhandler for that. Use it and just kill the guy pressing the button

little eagle
#

remoteExecCall is a horrible name. It implies stuff about it that isn't true and it implies stuff about regular call that isn't true either.

still forum
#

@daring pawn The functions themselves could be delayed a lot.. Just like anything else in scheduled

daring pawn
#

Well yea i've been using it (not reading the vague wiki difference in them) for anything I'm putting server end.

#

@still forum Yea alrighty, i'll have to look into how much of an effect its going to cause for what i'm doing

still forum
#

you'll probably be fine if it's your mission

daring pawn
#

cheers though. I'da spent ages wondering why I couldn't have my suspension in the call... never thought of the difference

still forum
#

You could've just read the error message and plugged it into google

daring pawn
#

I did, got lots of things not related to remoteExecCall though

#

I wouldn't have made the connection between remoteExecCall being the unscheduled

#

And initially thought it was the fact it was a function

still forum
#

How would you do it without a function? ^^

peak plover
#

setSkill is global / global ?

daring pawn
#

I was about to do it as an execVM instead -_-

#

which would have been yuck considering i'm proud so far of using that only once so far

still forum
#

execvm makes a function out of the script and executes it

daring pawn
#

😬 please I feel silly enough already 😛

little eagle
#

My guess is local args, global effects. And if locality of the object changes the local values of the new owner take effect.

peak plover
#

What are benefits of execVm?

still forum
#

there are none

little eagle
#

shrt wrd

#

There's one.

#

Doesn't require passing an argument like spawn.

daring pawn
#

I mean you can just [] spawn

#

thats not really passing anything

little eagle
#

It's passing an empty array.

peak plover
#

[] call vs call

#

'muh µs

still forum
#

muh us

little eagle
#

Oh, I didn't save that one.

#

µs

still forum
#

actually. µs singular. If you ceil

peak plover
#

a

#

1 second, if you ceil

still forum
#

good one

little eagle
#

actually. µs singular. If you ceil
u drunk?

peak plover
#

huge performance increase
replaced all my ; with ,
Gained 1 second average per script

little eagle
#

µ drµnk?

still forum
#

tired as always. But don't see anything wrong with that

astral tendon
#

hey i had to leave, thanks for the codes and stuff to help me.

peak plover
#

Has anyone ever done loadouts? I want to get a good way of defining different setups

little eagle
#

Plenty people have I suspect.

peak plover
#

A lot of variables, and ways to do it,

_weapon = "rifle";
_weaponAmmo = "clipazine";
_weapon = ["rifle","clipazine"];
#

🤔

little eagle
#

Do it like setUnitLoadout does

#

Standards.

peak plover
#
#define WEAPON "rifle"
#define WEAPONAMMO "clipazine"
#

huh?

still forum
#

I just use loadout scripts exported from arsenal

little eagle
#

That seems pointless no? You replace a string with a string.

peak plover
#

@still forum how do you extract mags/nades for vehicles/ammoboxes from that?

little eagle
#

ahahahaha

still forum
#

Cargo scripts? I write them manually.. Or copy-paste from the backpack part from arsenal

subtle ore
#

Ewww....arsenal exports.

little eagle
#

comment

peak plover
#

I want to define weapons and crap in one file. Then use functions to move those things to everything

#

setUnitLoadout hella weird..

subtle ore
#

How so?

peak plover
#

So much data

#

I guess I can make functions that will edit arrays and use a couple to set the loadout for players....

#

But I feel like it would be easier to just do addItem etc.

subtle ore
#

It's not like it is an insane amount of data. It is the same amount of data except faster if you were to do it manually

peak plover
#

loadout also means that if a vest does not in reality fit items, they will still be added. But if I use a function I can check per item, if it fits or not

#

I feel like getting the ammo/weapons for cargo etc. it would be faster for me to do everythign from scratch....

#

That's what i'm trying to figure out

#

if one of these has a big advantage or not

#

Which one is the ~best~

subtle ore
#

Really depends on the usage then

peak plover
#

Could you elaborate usage

subtle ore
#

Depends on what you are using it for

peak plover
#

I want to result with 1 file (per side) that I edit to change unit loadouts, vehicle cargo, etc.

subtle ore
#

Wether or not you want more or less control over what goes in and what does not

#

Then you will likely want to add/remove anything manually based on side

peak plover
#

From what I've done before, Sometimes certain roles will have certain quirks, random weapons sometimes, random uniforms sometimes

#

I've goit that one figured out

#

But general system is under question

#

🤔

subtle ore
#

Afaik each unit has a specified loadout initially per role. Defined via config

peak plover
#

I'd use unit classnames or variable that you can set for unit to decide which loadout he gets

indigo snow
#

is this for missionmakers? 3den attributes yo

peak plover
#

Well yeah

#

I'm doing a framework so I can make missions faster

indigo snow
#

then 3den attributes

peak plover
#

What does that mean?

indigo snow
#

make your mod add a 3den attribute where you can select a loadout?

waxen tide
#

I'm trying to center the map and zoom it so that the entire map is visible on opening. Anyone having a good idea how to do that?

indigo snow
#

as opposed to having to link either a classname somewhere or set a variable

little eagle
peak plover
#

It's basically this : Set player as Squad leader (B_soldier_SL_F), he will get SL loadout unless he has a _unit setVariable ["unit_loadout_override","Grenadier"];

little eagle
#
player setUnitLoadout "B_soldier_SL_F";
peak plover
#

Yes, but loadout for SL is defined in a single file

#

So If I want to edit the uniform and rifle I change

_uniform = "new_unfirom";
_rifle = ["rifle","clip"];
#

Also do

_rifle = {
    selectRandom [["rifle","clip"],["rifle2","assaultClip"]
};
indigo snow
#

why add {}

peak plover
#

and

_SLBeforeLoadout = {};
_SLAfterLoadout = {};
#

It's code

#

It's exectuded every time yo uget a loadout, eevery time new weapon

indigo snow
#

its a local var anyway, itll get recreated every time

peak plover
#

🤔

waxen tide
#

thanks commy

#

I'm struggeling how to get the control object tho?

peak plover
#

There's a chance there will be more complex code there, maybe?

indigo snow
#

why would you want that in there

#

if you want to execute code add a _code = {} variable or something

peak plover
#

just, in, case?

#

Yeah, but only code for _rifle... ?

#

I could have a different helmet per random weapon you recieve, so it needs to run that

indigo snow
#

i mean if you see a usecase sure

peak plover
#

I am very good at making up stupid issues, and features

indigo snow
#

you run into the case of there being better alternative ways i think

#

_helmets select (_weaponsOptions find _weapon max 0)

#

etc

peak plover
#

You should see my ai concept/notes 😄

indigo snow
#

its still all a scriptfile you execute that you have control over

#

why add extra code in a context where you can already execute code and now suffer a call overhead?

peak plover
#

I want there to be 1 file, that I have to change per mission

#

So all the functions do magic

#

call overhead is this real?

#
Searching 249 files for "call"
indigo snow
#

call { commands } will be slower than commands

#

youre already in a file where youre executing code 😛

peak plover
#
729 matches across 149 files
#

😦

#

ohh boy

#

I've used call very freely and usually replace code with functions if they get too confusing or big 😦

indigo snow
#

I mean thats fine

#

im just confused why youd want the option to execute code ... in a context where youre already executing code

#

if it works for you its all fine in the end

peak plover
#

nah, I'll just load the file and then call a function that will add the weapon for ex.

#

Then the function will see if it's a string or code, code will be called and then give weapon

#

Reason I want to use both is becaues sometimes I might want a simple quick only add class name for gun / uniform, next time I might want something more complex

#

And I want it to work in both cases with only editing 1 file

indigo snow
#

but you can just add more code under line under or above that in the same file 😛

peak plover
#

keep it clean ? ughh that's a good point

#

I think I was thinking of not doing local variables

#

I can do variables which can be set globally to override default values

#

this way I can change shit during the mission as well

#

That's probably too much :S

astral tendon
#

i am giving a drive orders to move on the car and he just dont obey, what can be?

indigo snow
#

you gave the driver a Move waypoint?

astral tendon
#

move order on the map and gunner "foward order"

#

he just dont wanna move

indigo snow
polar folio
#

does anyone know how to convert arma rgb format to html rgb format?

indigo snow
#

HTML rgb is just a differently formatted HEX right?

queen cargo
#

yup

indigo snow
#

arma colour format is basically a normalized RGB + alpha channel

#

so just use an RGB to hex algorithm

polar folio
#

yea i found some really good info already. i thought maybe someone found a bis_fnc for that. i just want to be able to control text color insdie structured text the same as control colors

#

ah cool. thx man

queen cargo
#

HTML (or more CSS) uses RGBA format
while arma uses ARGB i think

indigo snow
#

no alpha channel is 4th

#

and yea figured he might wanna SQF it

#

not really something arma is suited for i guess

polar folio
#

👍🏻

indigo snow
#
fn_armaToRGB = { _this resize 3; _this vectorMultiply 255 }; // _color call fn_armaToRGB
peak plover
#

😮

astral tendon
#

the set unit speed command is have to be put in the vehicle or the driver?

indigo snow
#

you mean the speedMode?

#

setSpeedMode needs to be set to a Group

astral tendon
#

it isent that optiom we can select were he go full, half etc?

#

i am seting up a tigger that teleport me to a gunner possition

#

this moveInGunner car1;

#

is not working, what i do to fix it?

little eagle
#

this in a trigger is just true or false. Read the description in the editor.

astral tendon
#

this is on the "on activation"

little eagle
#

The tooltip should say what you need to use.

astral tendon
#

thisList and thisTrigger does nothing

little eagle
#

thisList

#

That's the one.

astral tendon
#

yup, nothing

little eagle
#

It's an array with all the units inside the area.

#

You have to use it as array and not as object.

queen cargo
#

wondering right now ... anyone ever checked if when using objects the "this" variable is cleaned in missionNamespace?

astral tendon
#

thisList moveInGunner car1;

queen cargo
#

((same with other special vars like thisTrigger etc.))

little eagle
#

They are.

astral tendon
#

how it should be?

little eagle
#

No.

indigo snow
#

is this singleplayer? just use player

astral tendon
#

its a coop

polar folio
#

do you understand what the thisList variable contains?

astral tendon
#

no

polar folio
#

there's your problem 😄

#

i think you will get more answers and better answers if you show that you want to understand the code and not jsut copy paste it

astral tendon
#

so, how it works?

polar folio
#

so once you read this you will realise that it's a list of objects as the name says. afaik a vehicle can only have one gunner position that can be accessed by moveinGunner. so there's already a logical problem with your approach

astral tendon
#

its atually have only one gunner

polar folio
#

so who exactly needs to be in the gunner position? first guy to enter the trigger?

astral tendon
#

yes

polar folio
#

is your trigger set to one time or repeat?

astral tendon
#

just one time

polar folio
#

cool. then i guess you only need to solve your syntax problem

astral tendon
#

ok changing idea

#

how about if to detect a player inside of a vehicle and use the moveInGunner car1;

atomic epoch
#

Good evening all.
I've forgotten how to set up global scripts. Can anyone help me out? Global scripts are scripts that you can call from outside the mission folder

still forum
#

You mean.. A Mod.. Or CfgFunctions?

atomic epoch
#

Sqf in vanilla only

little eagle
#

You need a mod for this when you say "outside the mission folder".

atomic epoch
#

I remember doing it without mods. You sure?

little eagle
#

What else is there besides mod or mission?

atomic epoch
still forum
#

You are probably talking about filePatching. Yes that has been disabled

#

you cannot load stuff that is not inside a pbo or missionfolder

atomic epoch
astral tendon
#

this moveInGunner car1;

#

there is a variaton to it only work if the unit is a AI?

cold pebble
#

Check if its a player?

astral tendon
#

how?

cold pebble
#

isPlayer (whatever your checking)

astral tendon
#

how about to check if is a AI?

cold pebble
#

Well you do a check if it is not a player

#

!isPlayer unit

astral tendon
#

if (isPlayer a) then {moveInGunner car1;};

#

?

north vortex
#

Yes

#

True

astral tendon
#

so if this is a AI this command will execute?

north vortex
#

Uhhh yes if it works

indigo snow
#

itll only work if its a player atm

#

you forgot the !

#

!true = false

astral tendon
#

if (!isPlayer a) then {
isPlayer moveInGunner car1;
};

north vortex
#

Yes

#

True

indigo snow
#

no

north vortex
#

Oh shoot

indigo snow
#

isPlayer moveInGunner car1; this line is not right

north vortex
#

Yes true

rotund cypress
#

a moveInGunner car1;

north vortex
#

There you go

indigo snow
#

Id recommend a better variable name, though. a is pretty bad

cold pebble
#

isPlayer is a command lol

north vortex
#

Is it possable to script in binary?

#

No dom its a script

indigo snow
#

no its a command

rotund cypress
#

@north vortex why are you writing there you go when you clearly don't know what you are talking about?

cold pebble
#

...

indigo snow
#

i havent seen you say a single correct thing 😛

rotund cypress
#

^

cold pebble
#

I think I know the difference between a script and a command 😛

north vortex
#

Well there you go

rotund cypress
#

He meant Komanda I think @cold pebble

cold pebble
#

lol

indigo snow
#

i meant SimZor 🔥

#

jk

rotund cypress
#

😂

cold pebble
#

Simzor?

#

More liek Scamzor

#

I know who you are!!!

north vortex
#

Can you hear me?

cold pebble
#

😄

#

Well, we can read what your writing yes

north vortex
#

Ahh shoot

#

I deleated my op nuuuu

rotund cypress
#

Can you hear me?

north vortex
#

Yes

rotund cypress
#

🤣

astral tendon
#

it worked, thanks guys

rotund cypress
#

😂 😂 😂 😂 😂 😂

north vortex
#

I can hear you

rotund cypress
#

😂 😂 😂 😂

north vortex
#

Oh so you can hear me

rotund cypress
#

😂 😂 😂 😂

cold pebble
#

How could we not?

indigo snow
#

can we cut the spam a lil but

astral tendon
#

if (!isPlayer a) then {
a moveInGunner car1;
};

north vortex
#

Oh oh lol sorry can you se3 my text🙂 😂

rotund cypress
#

Sorry for my childishness

indigo snow
#

nice work Roque

astral tendon
#

a is the name of the unit

little eagle
#

WHAT'S SO BAD ABOUT "A" AS VARIABLE NAME?

rotund cypress
#

But yeah, as @indigo snow said, you probably want to rename that variable to something more conspicious @astral tendon

indigo snow
#

yea its pretty bad tho since its so short and undescriptive

#

if you name your variables like that youll make a mistake and override it some way pretty soon if you dont watch out

astral tendon
#

i just did that to test anyway

indigo snow
#

aight just making sure since youre new to this

#

i remember a guy on the forums

#

lets not talk about that

rotund cypress
#

Also, a would be a global variable, so you most likely want to do add a underscore for a local variable.

tame portal
#

@little eagle I CANT HEAR YOU

indigo snow
#

not in a trigger

rotund cypress
#

So you are not clogging up missionNamespace @astral tendon

little eagle
#

HELLO?!

indigo snow
#

it would be a vehicleVarName

#

commy ur reported

little eagle
#

But I am the police.

indigo snow
#

youre not the whiskey brown!

tame portal
#

You cant report the police

#

That's how a police state works

astral tendon
#

@rotund cypress what do you mean?

rotund cypress
#

So a variable without a underscore would be a global variable, which means that it can be accessed globally in any scope