#arma3_scripting

1 messages · Page 489 of 1

tough abyss
#

hm

#

i see

#

[joke]

#

anyways

calm ravine
#

where is the array out of range?

#

unitpositionelev returns an array of 3 numbers, selection of [0,1,2] doesn't seem like it's out of range

tough abyss
#
[  
    flagpole,  
    "Begin Your Next Sortie.",  
    "\A3\Ui_f\data\IGUI\Cfg\simpleTasks\types\interact_ca.paa",  
    "\A3\Ui_f\data\IGUI\Cfg\simpleTasks\types\interact_ca.paa",  
    "_this distance _target < 3",  
    "_caller distance _target < 3",  
    {},  
    {},  
    {},  
    {},  
    [],  
    10,  
    1000,  
    false,  
    false  
] remoteExecCall ["BIS_fnc_holdActionAdd", mobius1];```
i'm sure this is a stupid question, but i'm not seeing any hold action being added and i'm not sure why.
#

it's nearly midnight already, no wonder my brain isn't working

meager heart
#

your RE target is mobius1

tough abyss
#

yes

#

that's an object

meager heart
#

and you are player 😃

tough abyss
#

mobius1 is player object, i should specify

#

i want to add the holdaction to a single person

meager heart
#

hmm

calm ravine
#

mmm, found the issue, preemptive array, when getpos returns array. Array in array. Nevermind. Thanks for the help and info though, didn't know out of range was equivalent to dividing by zero.

late gull
#

@tough abyss what about: add the action to the flagpole but show only for that player

frigid raven
#

Good day beloved brothers

still forum
#

throws tasty freshly made and still warm chocolate chip cookie at @frigid raven

frigid raven
#

...well

#

why not 🍽

frigid raven
#

Why can I assign a ctrl to a variable if I am having a reference to the updated state of it?
Example

private _listBox = _display displayCtrl 1500;
// adding items to the _listBox variable

lbCurSel _listBox // yields `scalar`
// but
lbCurSel 1500 // yields the expected value

That does not make sense for me since the Wiki tells me both approaches are possible? Do I have to "update" the _listBox variable or better said reassign it before I call lbCurSel so it has the current state of the 1500 control?

still forum
#

if I am not having a reference to the updated state of it don't understand that?

compact maple
#

hello boyz

still forum
#

a control type variable is a reference to the control. Just like a object type variable is a reference to the object

#

it doesn't contain the state of the control

#

when you call lbCurSel it looks up the control reference. And grabs it's current value

frigid raven
#

@still forum sorry remove the not

still forum
#

// yields 'scalar' tells me you were probably passing a Nil to it

frigid raven
#

but I selected an item in it

#

as I said I was able to reproduce with teh plain ctrl IDC

#

And it worked then

still forum
#

Meaning _listBox was probably nil

frigid raven
#

hm

#

gonna check that

still forum
#

But as IDC is correct.. Maybe _display was nil?

frigid raven
#

mybe when using 1500 I fixed the _nil state of the _listBox as well without noticing

#

kk gonna recheck - so it actually should work with _listBox eh?

still forum
#

when you use 1500 it looks up in the currently open displays I think.

#

yes the _listBox way should work

compact maple
#
_display = findDisplay 100000;
_combobox = _display displayCtrl 100001;
_comboboxTexture = _combobox lbData (lbCurSel _combobox);

this worked for me

frigid raven
#

ok then I have a typo somewhere

meager heart
#

before you will add data to your list boxes use lnbClear and after lbSetCurSel

#

lbSetCurSel < without that, current selected sometimes - nothing

#

oh... also

#

lbClear != lnbClear

#

check wiki ^

digital jacinth
#

I have not done many overlays so far, only really static ones which do not change. I want to create an overlay which increases in opacity over time. I know I can set fade in and fade out stuff in the configs themselves, but i would like to control this via script.

Can someone give me a pointer so I do not need to search through the whole wiki and several projects? I do want that overlay to be fullscreen as well.

meager heart
#

maybe just use variable for the colors/backgrounds alpha and change it from anywhere 🤔

tough abyss
#

What is overlay?

digital jacinth
#

any kind of paa or picture overlayed over the players display

tough abyss
#

So you use RscPicture to display it?

digital jacinth
#

i do believe this will be needed as i do not know any other possibility to just display an image on a players screen

tough abyss
#

Hold on, I thought you already had an overlay and just wanted to change opacity with script? Sorry I misunderstood

digital jacinth
#

Well that is true

#

I have an overlay and jus want to change the opaciy via script and not via fade in or out

sturdy cape
#

You can use cuttext like you would rsc something also

#

To show a pic

tough abyss
#

You can ctrlCreate RscPicture and if I am not mistaken, control opacity with some foreground color command

#

Try that

worldly locust
#

getText(configfile >>"cfgAmmo">>"B_20mm_AP" >> "weaponType") returns "cannon", while getText(configfile>> "cfgAmmo" >> getText(configfile >> "cfgmagazines" >> "FIR_PavewayIV_P_1rnd_M" >> "Ammo")>>"WeaponType") returns "Default"

What I'm trying to do is pass a script any aircraft class, and determine if it carries bombs.(Eventually, also rockets, guns and missiles) Obviously the above is just a small part of the whole and is concentrating on a single ammo type or magazine type

#

How can I accomplish what I want

tough abyss
#

Or you can just use ctrlSetFade and fade in out the whole control @digital jacinth

#

I think you can commit that one to it will gradually change in its own

digital jacinth
#

oh setfade looks promising

#

yeah that looks nice, the commit is the length of the transition then and I can freely set the opacity

tough abyss
#

Well opacity is the fade

digital jacinth
#

i guess it is just a bit of a different naming as I am used to then.

meager heart
#

🤔

tough abyss
#

@late gull I dislike how addactions loks

#

Look

digital jacinth
#

I mean, i came across "opacity" as "visibility", "fillness" (most ridiculous one) already in my career. My understanding of the word "fade" in that regard was exclusively for the transitioning to opacity 1 or to 0.

tough abyss
#

who the fuck calls opacity "fillness"

meager heart
#

well... if your controls created with ctrlCreate you can just use ctrlSetFade or/and change alpha for all of them...

#

depends on which controls types there ^

tough abyss
#

@meager heart did you think of anything regarding my issue? it's super simple and i don't mean to bug you, i just want to figure out why i'm being a big dummy

meager heart
#

sorry which one ?

tough abyss
#

the one where addaction isn't working for one player

#
[  
    flagpole,  
    "Begin Your Next Sortie.",  
    "\A3\Ui_f\data\IGUI\Cfg\simpleTasks\types\interact_ca.paa",  
    "\A3\Ui_f\data\IGUI\Cfg\simpleTasks\types\interact_ca.paa",  
    "_this distance _target < 3",  
    "_caller distance _target < 3",  
    {},  
    {},  
    {},  
    {},  
    [],  
    10,  
    1000,  
    false,  
    false  
] remoteExecCall ["BIS_fnc_holdActionAdd", mobius1];

mobius1 is playable unit

#

and i don't see the action being added to the flagpole

digital jacinth
#

@tough abyss flash ui framework developers that's who

tough abyss
#

smack them

digital jacinth
#

i doubt they are around stil

meager heart
tough abyss
#

ffs

meager heart
#

¯_(ツ)_/¯

tough abyss
#

guess i'll look later, i have to go wageslave now

meager heart
#

glhf

digital jacinth
#

@tough abyss also make sure t that object you attach the action to is not a simple object. Maybe that is the issue

tough abyss
#

It shouldn't be, it's just a flagpole

digital jacinth
#

some objects placed in the editor are instantly simple objects. You mostly notice this if you double click on them and you see no option for simple objects

tough abyss
#

i know; flagpoles aren't

#

i also tested it with helper object

#

that didn't work either

tough abyss
#

hm, is there a command to set the thrust value of an aircraft?

cedar kindle
tough abyss
cedar kindle
#

righto new commands 👌

tough abyss
#

wanted to set the thrust as a QOL thing, but i guess that's impossible

#

the goal here is to do plane respawn by having the pilot look at a flagpole, perform a holdaction, and then be placed in a jet that's flying already

cedar kindle
#

that’s not impossible, we just told you how to do it

#

and createVehicle with “FLYING” to have engine on

meager heart
#

@tough abyss did you blocked me ? 😃

#

just tried to add 👍 to your useful post and was no luck... well 🤷

tough abyss
#

@cedar kindle missing the point of what i need

#
jet engineOn true;
jet setPos [getPos planeSpawnpoint select 0, getPos planeSpawnpoint select 1, (getPos planeSpawnpoint select 2) +10];
jet setDir 180;
    _vel = velocity jet;
    _dir = direction jet;
    _speed = 500;
        jet setVelocity [
            (_vel select 0) + (sin _dir * _speed), 
            (_vel select 1) + (cos _dir * _speed), 
            (_vel select 2)
        ];
mobius1 moveInAny jet;```

this is the code i wrote for it but i did this at my desk at work and i can't test it
#

works in my head fine tho

still forum
#

jet setPos [getPos planeSpawnpoint select 0, getPos planeSpawnpoint select 1, (getPos planeSpawnpoint select 2) +10];
->
jet setPos (getPos planeSpawnPoint vectorAdd [0, 0, 10])

meager heart
#

vectorAdd better option for that set pos

#

too late

tough abyss
#

ooh, good suggestion

#

dedmen got it first on my screen

#

😏

still forum
#
        jet setVelocity [
            (_vel select 0) + (sin _dir * _speed), 
            (_vel select 1) + (cos _dir * _speed), 
            (_vel select 2)
        ];

->

jet setVelocity (_vel vectorAdd [(sin _dir * _speed),  (cos _dir * _speed), 0]);
#

┬─┬ ノ( ゜-゜ノ)

meager heart
#

😃

tough abyss
#

math is hard okay

meager heart
#

also he unflipped non flipped table...

#

so stronk

hollow thistle
#

setVelocity This could be used to make Advanced Towing smoother, couldn't it? (it was using setPos last time I was checking the source of it.)

tough abyss
#

Probably using setpos because setvelocity might cause some pretty big physics fuckups

#

Setpos will find nearest acceptable spot

#

Setvelocity will just throw it

tough abyss
#

i'm totally fucking baffled with this holdaction thing

#

oh

#

now it's working all of a sudden?????

#

what in fuck

#

okay

#

i think i was just

#

my IQ must be room temperature because apparently 3m is too short of a distance

#

so condition was never satisfied

#

despite being

#

inside the unit

queen cargo
#

@tough abyss maybe you are just hungry 🤷

still forum
#

takes all of his food

tough abyss
#

reee

#

Gonna make a handful of tweaks

#

Gonna turn the jet engine on when the hold action is being initated

#

So the canopy doesn't close mid-air

#

Gonna reduce the initial speed

#

and then add a voice lcip

#

clip*

#

might make a nice fade in / fade out

frigid raven
#

Is there a way for a script-file wide scope?

#

I have a .sqf file that opens my dialog. In it I have a button handler. Unfortunately I have to redefine some variables in both scopes, the dialog-show.sqf scope and again within the _buttonHandler scope

#

That kinda buggers me

still forum
#

no.

#

Make a global variable.

#

or if you have a dialog. you can save variables onto it using setVariable

frigid raven
#

ah same for controls eh?

#

thats a way

still forum
#

yeah

orchid saffron
#

Hey guys, do you know a way to get the current gear of the car?

#

I´m referring to the gearbox

#

Like, 1, 2, 3

#

i have a formula which is v = ((wheelCircumferencewheel rpm60)/1000) /(gear ratio * group gear ratio)

#

But in arma is not working

still forum
#

` wrap your stuff in these things so that * works correctly`

#

I don't know of any way to get the current gear nor the rpm

orchid saffron
#

v = ((wheelCircumference * wheel rpm * 60)/1000) /(gear ratio * group gear ratio)

#

Thank you

#

For example the hatchback

#

wheelCircumference = 2.277, wheel rpm (first gear) = redRpm * gearUpMinCoef = 4829, gear ratio (first gear) = 2.461, group gear ratio = 4.111

#

If you replace in the formula

#

velocity = 65 km/h

#

So over 65km/h we´re in second gear and below 65km/h we´re in first gear

#

theoretically it´s correct but in arma

#

Hatchback changes to second gear at more or less 20 km/h

#

@still forum You can retrieve the rpm with vehicle player animationSourcePhase "rpm"

#

Any leads? Let me know

west grove
#

oi people. i'm having some troubles again. wasn't it possible to "attach" a variable to a specific unit?

#

i'm feeling like i remember something, but at the same time i do not

still forum
#

setVehicleVarName?

west grove
#

basically, what i want to do is set a certain status for a unit

#

then later in script i just check if the unit has that status

still forum
#

setVariable

#

uhh...

#

o no

unborn ether
#

wab wab wab waaaaaaaab

west grove
#

ah yeah, that's it.

tough abyss
#

what's the best way to use setVariable to add an object to an array

#

i want to put something similar to this setVariable ["marksman", this]; in the init fields of the marksmen in my ops

#

so that way i can specifically add a holdaction to them

runic surge
#

Does anyone know if it would be possible to detect terrain features through scripting?

#

Like slopes for example

#

surfaceNormal would come in to play here but detecting which direction is higher, which is lower, and whether or not it is 'flat' to the left and right or more irregular

#

My goal is to set object orientation based on this so I could potentially design certain terrain features with objects more quickly

foggy moon
#

Another one that comes to mind is the terrainIntersect functions, sounds like they're performance heavy though

meager heart
#

for the slope you can >

private _slopeValue = acos ((surfaceNormal getPos _origin) vectorCos [0, 0, 1]);
runic surge
#

it being performance heavy doesn't matter too much since I wouldn't be using it in a mission. I am only trying to create a function that I could use to place and orient objects, and if it's functional and doesn't crash the game, that is good enough

#

@meager heart what does this return? Slope angle?

meager heart
#

yes

runic surge
#

ah

#

that will be very helpful, thanks

meager heart
#

also maybe you can play with selectBestPlaces 🤔

runic surge
#

doesn't that one only use locations?

#

findEmptyPosition also this for preventing object overlap maybe

meager heart
#

no... you can filter there any kind of terrain/surface/check if there hills/trees and a lot more... check wiki

runic surge
#

I see

#

thanks again

#

I'll see what I can manage with this

foggy moon
#

So I'm running scripts on bombs/missiles after they drop, and I'm trying to figure out the best locality in which to do it. Do they get transferred to the server after drop/launch?

#

So while they're falling/flying, they're still local to the player that launched them?

#

cool, thanks

unborn ether
#

@foggy moon Any ammo shot is local to a gunner of that weapon, besides when you have some heli with manual fire where the owner is pilot or co-pilot.

foggy moon
#

awesome, thanks

wary vine
#

is it possible to include mission macros in a serverfile ?

still forum
#

#include a file out of the mission.pbo in a server mod? no

#

other way around. #include in mission.pbo from a server mod. Yes. But not description.ext

wary vine
#

thought so .. balls xD

#
format ["\life_server\..\..\mpmissions\%1.%2\script_macros.hpp",missionName, worldName]
``` i was hoping something like this but meeh
still forum
#

nope

#

unless maybe your mission file IS a serverside mod

#

then it would ofc work... But.. I don't know if Arma even lets players download these when they join or if players already need to have them

wary vine
#

just a thought, will just have to put the pveh inside the missionfile

sturdy cape
#

If you make an add-on for this and define functions for your sqf files in a config.cpp file you could even add eventhandlers or #include from the server side.

#

Not sure if this needs a plugin Management system like exile mod has or the APMS from desolation redux,which is what i am working with

#

Apms is very good to add stuff server side.

tough abyss
tough abyss
#

I can’t see discord links

#

@tough abyss i don't understand

#

Wait, I can now

#

why doesn't he just add this in initPlayerLocal?

#

why is he looping through all players for this

still forum
#

Well.. I already gave the answer to that didn't I?

tough abyss
#

JIPs won't get the eventHandler this way

still forum
#

😄

tough abyss
#

i'm going to make a bis account just to ask him what the fuck he's doing

#

oh

#

apparently i have bis account

#

Iol

#

done

#

1st post?

#

yeah lmao

#

I guess I made an account but never used it

#

what the fuck is gravatar?

#

why can't i just upload an avatar normally?

#

oh, i can, it's just a roundabout way

still forum
#

no

frigid raven
#

hey guys

rocky mortar
#

@wary vine what do you mean ? There is no difference between server and client side. Macro file are used by preprocessor

#

didn't see the answers 😃

#

just refresh

wary vine
#

@rocky mortar I meant, accessing a mission.pbo include from a serverside.pbo

rocky mortar
#

include path is define from the root of your mission or mod

#

what do you want to do exactly ?

cedar kindle
#

he wants to #include a mission macro file in a server addon

#

which i can’t say is a good idea overall

rocky mortar
#

if the server side code is in the same pbo file of macro file there is no problem

drowsy axle
#

How would I use params to pass two things, from two different arrays?

#

I was thinking of using ForEach, but there was a discussion a while back explaining another way.

still forum
#

Don't understand

#

params takes values from one array

#

so what do you mean with two arrays

drowsy axle
#
_opforUnits = [classname,classname];
_opforUnitsPos = [[x,y,z],[x,y,z]];
```The two arrays
still forum
#

which two arrays?

#

the two arrays INSIDE _opforUnitsPos?

#

how are you passing them to the function

#

can you maybe write down some code to show how you want it to work?

drowsy axle
#

Well. I was going to do forEach. for both arrays. One that passes the position, then one that passes the classname. Which then the unit is created and positioned.

#

But that's ain't effective.

still forum
#

I don't understand...
Do the arrays always have 2 elements?

drowsy axle
#

They have the same amount, as they are related.

still forum
#

maybe order them like
units = [[classname, [x,y,z]], [classname, [x,y,z]]]

#

that would be easier

#

just a forEach loop through units. And a params ["_classname", "_position"]

drowsy axle
still forum
#

but why do you think a forEach is a bad solution?

drowsy axle
#

It's not "bad" it was giving me 32 reiterations

still forum
#
{
_classname = _x;
_position = _opforUnitsPos select _forEachIndex
} forEach _opforUnits
drowsy axle
#

as it would foreach both arrays

still forum
#

I have no idea why you would foreach both arrays

#

you already know the index of the position

#

so why iterate again

drowsy axle
#

Well that was my logic at the point. Now that I know you can pass arrays like that and param them.

#

Seems the legit way.

#

What does _forEachIndex return?

still forum
#

the index that the forEach is at

#

0 on first element. 1 on second element

unborn ether
#

Just realized that adding InventoryOpened EVH on top of existing one will override the return value of previous one, even if new one has nothing or false as a return. Should I add this as note to EVH or its just too obvious and I am dumb?

still forum
#

the last returned value is used

#

Don't know if that's written down somewhere. But I think it is

unborn ether
#

So it considers nil return as an actual value.

still forum
#

yeah

#

the code is basically
bool shouldClose = false;
foreach (eh in handlers)
shouldClose = eh();

unborn ether
#

So no way to stack them? My purpose is just a script execution, not to override anything "behind" it.

#

Damn.

tough abyss
still forum
#

linking messages is a developer feature

#

you are missing the quotes around the classname string

#
{
_x params  ["_classname", "_position"];
<do stuff here>
} forEach CAP_Units:
drowsy axle
#

Ah yeah. I forgot that. xD

#

Any differences between Unit and Vehicle create..?

#
CAP_Units = [
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]],
    ["O_Soldier_F",[0,0,0]]
];

{
    _x params  ["_classname", "_position"];
    _classname createUnit position _position;
} forEach CAP_Units;```
still forum
#

yes. A Unit has a brain

#

a vehicle doesn't

drowsy axle
#

lol xD

#

If I createUnit, for a vehicle. Does it automatically give crew? Or would I still need to do createVehicleCrew?

still forum
#

never tried.. I'd say no though. Don't know what happens when you createUnit a vehicle..

drowsy axle
#

Okay.. lol

#

just a thought.

drowsy axle
#

The Icon, thing.

still forum
#

some thing from some mod

#

many things place things at 0,0,0

drowsy axle
#

I have 3den Enhanced.

#

for debug

meager heart
#

_classname createUnit position _position; > _classname createUnit [_position, _group]; 👌

queen cargo
#

position _position?

#

wut?

#

did i missed somethin?

#

position [0,0,0] is valid? Oo

meager heart
#

....position _something or ....[0, 0, 0]

#

or <clssname> createUnit [_position, _group]

queen cargo
#

createUnit and createVehicle
both implemented in sqfvm

#

🤷

#

position too

#

but cannot remember some weirdo position <array> variant

meager heart
queen cargo
#

what version @meager heart ?

#

is it the latest snapshot or the released version?

#

ahh

#

though ... wait

#

think the latest snapshot has bugged params

#

though .. no

#

wait

#

position <array> simply is invalid

#

that combination is simply not existing

meager heart
#

1.0.0 rc 1 afaik 🤔

queen cargo
#

also .. there is no createUnit accepting "just" position

#

rc 1 has a bug inside with params

#
CAP_units = [
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]],
    ["O_Soldier_F", [0, 0, 0]]
];
{
    _x params ["_classname", "_position"];
    _classname createVehicle _position;
} forEach CAP_units;```
#

will work

#

only createVehicle accepts that syntax

#

that would also be possible in sqfvm though :P
just that you need to create a group first 🤷

meager heart
#

oh createVehicle there...

queen cargo
#

and was horribly wrong with both commands 🤷

regal kraken
#

Are line ending characters a big deal in ARMA scripts?

inner swallow
#

Not that I know

calm bloom
#

// Expression only runs on the server, must handle actions for all machines and future JIPs (Why BI?!)
expression = QUOTE([ARR_2(_this,_value)] call DFUNC(setSize););

Sad.

#

so, if i want to compactly pass different parameters on clients, 3den custom attributes are not the right way

#

so, only inits, then?

tough abyss
#

Where is this expression quote from?

calm bloom
#

ace custom attribute

tough abyss
#

So why are you asking BI?

calm bloom
#

sorry if i am wrighting some strange stuff. Ive just discovered a bit counter intuitive feature of our game

#

because naturally everything in mission is kinda global

tough abyss
#

I’ve no idea what you are trying to do that is not working

calm bloom
#

ok, if someone is digging this custom attributes too: they are not good to define any client functions and fire only on server.

peak plover
#

Setsize ?

#

Marker?

frigid raven
#

I have placed the following stringtable.xml in my root directory:

<?xml version="1.0" encoding="utf-8" ?>
<Project name="Deployment RPG">
    <Package name="Lobby">
        <Key ID="str.dpl.profile.info.name">
            <Original>DebugName: </Original>
        </Key>
        <Key ID="str.dpl.profile.info.reputation">
            <Original>ReputationDebug: </Original>
        </Key>
    </Package>
</Project>

Still the strings cannot be found using localize "<key>"
Do I have to include the stringtable anyhwere? Because the Wiki does not tell anything about that?

meager heart
#

you no need "original" just use "english"

#

Do I have to include the stringtable anyhwere?
no, mission root folder only

#

also keys id's names...

#
<?xml version="1.0" encoding="utf-8"?>
<Project name="Deployment RPG">
    <Package name="Lobby">
        <Key ID="STR_dpl_profile_info_name">
            <English>DebugName: </English>
        </Key>
        <Key ID="STR_dpl_profile_info_reputation">
            <English>ReputationDebug: </English>
        </Key>
    </Package>
</Project>
#

something like that ^

#

@frigid raven

#

also_maybe_you_can_use_shorter_names_for_those_keys 😃

frigid raven
#

ah thought there is no convention

winter rose
#

you no need "original" just use "english"

I think Original is the default value, whereas English is not used as default if wanted language isn't present @meager heart

hollow thistle
#

If wanted language is not present first from the top is used, or smth like that.

meager heart
#

yeah ^ commy was explaining that long time ago, i don't remember why exactly, but you can skip it...

#

also tried with russian as original... and was fail...

frigid raven
#

so i cannot use "ns.module.key" as keyname?

meager heart
#

you can try it yourself just use them in your description.ext without quotes 😃

#

author = $STR_xetra11_Interactive; < like that and with dots

still forum
#

If wanted language is not present first from the top is used, or smth like that. correct. Either the original entry is used, if it doesn't exist then the topmost one is used

meager heart
#

so that is optional and just not required then 🤔

#

aka useless

arctic owl
winter rose
#

@hollow thistle @meager heart @still forum thanks! Didn't know that

tough abyss
#

This should theoretically work with every UAV, just pass the Object/Screen and the UAV to the function.

arctic owl
#

@tough abyss , thanks going to give a go here after bit and see if I have any luck.

kindred lichen
#

I'm trying to get an addAction that'll only be availabe if the player can point at the object, so it doesn't work through buildings and walls and stuff, any ideas?

astral tendon
#

Is there a exemple for a LOITER waypoint?

arctic owl
#

@tough abyss , It works well, only problem I'm having is that it objects do not appear past about 300 meters from the camera, vs what I'm seeing when I am in the gunner view. I understand this is a camera attached to the gunner part of a UAV.

tough abyss
#

That depends entirely on your PIP setting in the graphics options of the game.

arctic owl
#

Hmmm, I have it set to Ultra, I suppose that may be the limitations of the PIP. Better than nothing! Thanks for your help.

arctic owl
#

And, when I go into arsenal, the PIP totally disapears from the screen and does not come back. Oh Arma.. lol.

arctic owl
#

Any work around Quicksilver?

#

I tried making an action that terminates the script on the Monitor, then a script that restarts it.

#

No luck.

#

This is what I have as the script that is suppose to stop it.

uavmonitorphI = [] execVM "scripts/uavmonitor.sqf";
sleep 5;
terminate uavmonitorphI;
hint "PhantomI Signal Lost";

unborn ether
#

@still forum Is there any way to get a weapon reloading time delta?

still forum
#

don't know any

tough abyss
digital jacinth
#

I do have a question about spawning in many many objects. So far all of it is working just fine, but I do have some sync issues on a dedicated server. The server spawns those objects, but they are not in the right position and do not have the right rotation. this stays for around a minute or so and then it all snaps into place as it should.

Is there a way to prevent this?
This is the code snippet which spawns in the stuff, I have two of them one for simple objects and the other for normal object which have interactive parts.

{
    _x params ["_class","_posASL","_vehDirAndUp"];
    _object = createVehicle [_class, _posASL, [], 0, "NONE"];
    // _object = createSimpleObject [_class, _posASL];
    _object setVectorDirAndUp _vehDirAndUp;
    _object setPosASL _posASL;
    _object enableDynamicSimulation true;
} forEach _data;

Will spawning them at [0,0,0] also be faster or so?

#

this is all happening on the server btw

tough abyss
#

Does it do it without tinkering with simulation?

digital jacinth
#

not sure.

#

actually looks like it is still happening without the simulation part. I do spawn in multiple locations one of them had no simlation statement there and it still happened

tough abyss
#

Is the script scheduled?

digital jacinth
#

yes

tough abyss
#

Try wrapping inside of the loop in isNil{...}

meager heart
#

Will spawning them at [0,0,0] also be faster or so?
yes, i guess enableDynamicSimulation is the slowest part here 🤔

digital jacinth
#

also running in unsheduled is a no go imo as these are way way too many objects

tough abyss
#

No one is suggesting you run it all unscheduled, just the object spawning and positioning part

meager heart
#

also private will helps

#

few microseconds boost lol

digital jacinth
#

ey if it runs faster

#

¯_(ツ)_/¯

tough abyss
#

Maybe you need to preload scene on clients as well, maybe it is not updating in time who knows

digital jacinth
#

probably need to make the trigger areas larger then

#

the problem only occurs if you spawn the stuff directly on them (e.g. setting up the base camp) or if they drive to the locations.

tough abyss
#

So the delayed effect you observe is through Zeus interface or in game on the ground?

digital jacinth
#

both

#

it is bascially the server needs to broadcast the right rotation and position of the object

#

it is there, but not at the right position

tough abyss
#

With just one player in game?

digital jacinth
#

I tested with 2 other people around, they both told me it looked the same. e.g. some table in the ground 90° rotated in the rwrong direction etc

tough abyss
#

Pretty strange, you think you can make repro?

digital jacinth
#

I wanted to release this at some point anyways. It is made to work with layers, it grabs the whole thing, extracts it into one huuuuge array so you can copy paste it into the spawn function.

tough abyss
#

Do you attach anything to the trigger?

digital jacinth
#

no. right now i am using global variables as object holders, I will most likely switch to setVariable on the trigger in the future

tough abyss
#

Try to replace posASL with posWorld

#

In both grab and put

digital jacinth
#

i know it is a bit faster. it is only asl because that is with what i started out. now I cannot really change it anymore unless i want to edit an array with a few hundred items.

#

but yeah for future things posworld is better

tough abyss
#

It is not only better it is the one that should be used if you want exact position back, other pos commands introduce inaccuracy

digital jacinth
#

🤔 that would explain some of the inaccuracies i experienced

tough abyss
#

Misalignment expected if you are not using get/setPosWorld

digital jacinth
#

well, that means the stuff i have will stay misaligned as i got the pos with getPosASL

#

but future positions will be taken with getposworld instead

#

well, for now i just try spawning at 0,0,0 and moving them. salvaging those won't be possible right now.

meager heart
#

getPosASL vs getPosWorld - same

digital jacinth
#

so it is just the spawning part that has these problems when using setposAsl

meager heart
#
getPosWorld                            // 0.0015 ms
getPosASL                            // 0.0016 ms
getPosATL                            // 0.0016 ms
getPos                                // 0.0020 ms
position                            // 0.0020 ms
getPosVisual                        // 0.0021 ms
visiblePosition                        // 0.0021 ms
getPosASLW                            // 0.0023 ms
tough abyss
#

Other setpos commands perform additional transformations while posWorld does not

#

There was a ticket on feedback tracker when it was introduced if anyone bothers to find it

digital jacinth
#

meaning right now if i switch out setposasl with setposworld, it should be the same, just more accurate?

tough abyss
#

No you have to grab it with getPosWorld if you want to put it with setPosWorld

digital jacinth
#

ah, sad

#

as far as i now there is no transformation command from asl to world

#

or at least i could not find one

tough abyss
#

No

#

Would be too complicated

meager heart
#

spawning objects at [0,0,0] will speed up things, but probably the main problem is just number of objects... 🤷

digital jacinth
#

still thanks for the feedback on this. I got some answers form some other problems i had. Still making these things spawn faster is also good.

dim terrace
#

isn't spawning of objects at [0,0,0] cause .rpt logs later?

digital jacinth
#

Well, you tell me. I am not sooo sure

meager heart
#

"Object not found" spam ?

#

afaik that happens when you set pos them out of map, not when you spawn them at [0,0,0] and set pos after 🤔

digital jacinth
#

so far i am not seeing anything in the legs even repeated walking in and out of the trigger areas

#

must be a setpos thing then?

meager heart
#

🤷

peak plover
#

I had the same issue

#

But I think deleting and creating non physics objects and non vehicles is worse than letting them stay there

#

@digital jacinth Remember how FPS got better in terrible timing 3?

#

When we left the base on heli, I had ~60 fps. There were thousands of objects in the base. While there I was ~15

#

For me the only thing that helped with wrong pos and rotation was just setting it again.
So I'd create the objects and then reset their positions a second later.

digital jacinth
#

@peak plover dunno it is a give and take really. I am utilizing the whole map with several highly detailed locations. i think at this point it is better to just despawn the objects as you do not return there

peak plover
#

I'd say test it out. Don't hide any buildings and then teleport around.
I once tried by hiding and deleting all map objects and the fps impact out of view distance was minimal

#

There really shouldn't be much difference

#

However createVehicle on a HDD

digital jacinth
#

once itis cached :v

peak plover
#

That's true

peak plover
#

yea

#

Can you elaborate on the latter?

#

Ohh

#

For unconscious state?

#

And revive?

#

I've noticed many people still use the thing where they respawn the unit where they died always.
So when someone gets killed, you see a guy appear and dissapear for 1 frame

still forum
#

@dim terrace isn't spawning of objects at [0,0,0] cause .rpt logs later? no
@meager heart afaik that happens when you set pos them out of map, not when you spawn them at [0,0,0] and set pos after no. So far that was caused by invalid backpack containers that weren't propagated to server and other clients properly.

meager heart
#

yeah i know about the backpacks weirdness, iirc there was some issues with objects out of map too, Dedmen

dim terrace
#

pretty sure createAgent & createUnit did throw something

#

// Get designers to know more: Warning: Object B 1-1-B:10 (emtydoor.p3d) at position [1,1,0.356] too close to [0,0,0].
LogF("Warning: %s at position [%.2f,%.2f,%.2f] too close to [0,0,0].", cc_cast(GetDebugName()), vs._aimingPositionWorld.X(), vs._aimingPositionWorld.Y(), vs._aimingPositionWorld.Z());

still forum
#

Never seen that "too close to [0,0,0]" message before

dim terrace
#

I did, that's why I've used

                private _agent = createAgent ["VirtualMan_F", [0,0,10000], [], 0, "CAN_COLLIDE"];```
still forum
#

Ah.. I don't see agents that often. That's probably why I didn't see it yet

dim terrace
#

it's in createUnit code too

meager heart
#

VirtualMan_F base class for the virtual curators ? 🤔

meager heart
#

oh btw vanilla respawn templates menu position teleports players at [0,0,0?] too...

#

when you will be in the respawn menu force close map and enjoy the view 😃

astral tendon
#
    uav = createVehicle ["B_UAV_02_dynamicLoadout_F", [(getPosATL player select 0),(getPosATL player select 1),(getPosATL player select 2)+15000000], [], 0, "FLY"];

It does not matter how much I set the altitude, the UAV allways spawn in the same level.

frigid raven
#

hey guys

#

Sorry again guys but I still cannot get my stringtable.xml file to work

still forum
#

where did you place it? what's your keyname, how do you try to localize

frigid raven
#
<?xml version="1.0" encoding="utf-8" ?>
<Project name="Deployment RPG">
    <Package name="Lobby">
        <Key ID="testString">
            <Original>DebugName:</Original>
        </Key>
    </Package>
</Project>

Place in the root where my Description.ext lies.
And calling it like localize "testString"

still forum
#

and I guess isLocalized will return false for that?

frigid raven
#

checking...

#

Okay - I just figured out that I had to friggin restart the whole preview

#

not just heading back to the lobby

tough abyss
#

So it works now?

frigid raven
#

still benchmarking 😄

tough abyss
#

Asking this because I know you don’t like to read wiki, but having prefix str_ has some significance

digital hollow
#

Are there script commands or functions for spawning ship weapon systems in the right place?

still forum
#

@tough abyss doesn't have any significance in this case

frigid raven
#
<Project name="Deployed RPG">
    <Package name="Lobby">
        <Key ID="str.dpl.profile.info.name">
            <Original>Name:</Original>
        </Key>
        <Key ID="str.dpl.profile.info.reputation">
            <Original>Reputation:</Original>
        </Key>
    </Package>
</Project>

after 123423423 tests, this does work

nocturne basalt
#

Hi guys. Can I remove the "get out" action when in a vehicle?

#

I cant use removeAllActions player; since it only removes user added actions

tough abyss
#

Not without modding or disabling the action menu all together

nocturne basalt
#

oh ok

tough abyss
#

removeAllActions and such are for user added actions

#

With addAction

tame lion
#

Is there anyway to stop the vitalsLoop from ACE that spawns on a character? I wanna test something with vitals but i need them to remain static and not get recalculated while i test things

nocturne basalt
#

I c

tame lion
#

@nocturne basalt you can't remove the action, but you can add an eventhandler for GetOut that essentially puts the person back in the vehicle. IDK if that would solve the issue for you

nocturne basalt
#

nah it doesnt help. Im making a parachute with a firing from vehicle function

#

when Im in the FFV, I get the "get out" action

tame lion
#

does the vehicle/parachute get deleted when that occurs?

nocturne basalt
#

no it only gets deleted when it hits the ground. Im putting the player into the driver position before it lands, or else you get stuck

tame lion
#

this is just speculation, but wouldn't you be able to force them back into their old seat with the eventhandler? and at most they only see a frame of them falling? I know its not ideal, but might be the closet thing to want you want to accomplish

vivid locust
#

How do you put 2 switch cases into one to avoid something like this:

switch (_type) do {
    case 0: {
        code1;
    };
    case 1: {
        code1;
    };
    case 2: {
        code2;
    };
};

Can you connect case 0 and 1 so you avoid identical cases?

nocturne basalt
#

maybe its better to use if else for this

vivid locust
#

That's an example, I have many more cases ofcourse

tame lion
#
if ((_type ==1) or (_type == 0)) then {
    //code1
} else {
    code2
};```
vivid locust
#

Nah... I want to keep the switch since I have many cases

tame lion
#

idk but i think this would work too:

switch (_type) do {
    case (0 or 1) : {
        //code1;
    };
    case 2 : {
        //code2;
    }
};```
vivid locust
#

That doesn't work, I tried it

tame lion
#

damn... i could swear that worked. I thought that case evaluated the code behind it

vivid locust
#

You get an error that the or operator needs boolean:boolean

#

I guess I got it, looks a bit weird but gives me the right answer:

    case 0: {
        case 1: {
        };
    };
tame lion
#
switch true do {
    case ((_type == 0) or (_type == 1)) : {
        //code1
    };
    case (_type == 2): {
        //code2
    };
};```

Edited and tested: works!
still forum
#

Just stop using switch if it's not suitable for what you're trying to do

vivid locust
#

@still forum Still better than having 20 different if statements

tame lion
#

@vivid locust read my previous, it worked for me just now

vivid locust
#

Yep, I've seen it. Might give this a try. It kinda sucks that you can't use operators in the cases like

case ( < 2): {
};
#

Thanks

hollow thistle
#
switch (_type) do {
    case 0; // semicolon
    case 1: { // colon
        code1;
    };
    case 2: {
        code2;
    };
};
#

^ - this is also shown on wiki in examples of switch do usage

calm bloom
#

Hello guys, does anyone know how to use ace3 TRACE_2 Macros?

#

i mean, any other way then repack addon

still forum
#

i mean, any other way then repack addon no

calm bloom
#

okay(

#

tnx

tough abyss
#

Hey guys, I need help that involves setting up a mission's date upon start up, I know this is easily done through 3den editor but the highest year i can go to is 2050 (im using a halo mod so i want the year to to be 2535). I know i can use setDate but i cant seem to get it working, i followed what the wiki page says however when i load the mission, the date is not set to what i want it to be.

Here is what I have got.

    waitUntil {time > 0};
    setDate [2535, 9, 27, 14, 0];
};```
high marsh
#

@tough abyss setDate requires a server side execution, but has local effects after the mission has started. The clients will sync their date if the server has the date set to 2535 before the mission has started

#

in this case, you are using waitUntil to ensure the mission has already started

#

if you need it to be set after the mission has started, use remotExec to set the date to 2353 locally on each client

#

the previous isn't true though if you don't change the year

winter rose
#

@tough abyss you can edit the mission.sqm file directly too, just be sure not to edit it again in 3den afterwards (or repeat the process)

high marsh
#

¯_(ツ)_/¯

winter rose
#

:3

tough abyss
#

@tough abyss where do you put that code?

meager heart
radiant egret
#

@tough abyss some kind of reactive armor ?

tough abyss
#

@tough abyss init.sqf, @subtle ore was able to help me out though

#

im also experimenting with the established shot intro thing and it displays the incorrect date, however i made a trigger for when i step on it, it displays the year and its the correct number (2535). Does anyone know a fix to this?

#

@tough abyss Hold on a second, does your whole date not sync or only year? I know there is a bug with the year, unless the same year is set in the editor it just won’t sync

#

whole date

#

Hmm

#

i wish the editor would allow me to use a year higher than 2050 lol

#

Considering the game is set in 2035 giving it another 15 years max sounds like an oversight, you should report it as a bug

#

is there any way to get rid of the date being displayed for the established shot?

#

Is it enabled in description.ext?

#

it's done through the editor

#

no option about a displayed date

meager heart
#

is there any way to get rid of the date being displayed for the established shot?
no

#

you can edit mission sqm...

#

@tough abyss

tough abyss
#

@meager heart i'll look into it, thanks!

tough abyss
#

so

#

am i being a smoothbrain here

#

in the init field of some vr objects, i'm using

#

oh SHIT I FORGOT TO SET THE VARSPACE

#

AAAAAAAA

graceful condor
#

lolololol

tough abyss
#

this setVariable ["starterBlocks", "true"]; is in VR object block

#

and

#

how the fuck am i supposed to return all of those variables into an array

#

i'm trying to use getVariable and I'm totally losing my mind

peak plover
#

All variables?

#

All blocks?

#

Calmly explain what you are trying to do

#

3,21,34,1 would be on the bottom center of the screen

#

If I use ctrlCommit 0 on every frame

#

it bugs out

tough abyss
#

What are 3,21,34,1 winning lottery numbers for this week draw?

peak plover
#

x y w h

#

The numbers are correct (2nd image)

#

But whenever I use ctrlCommit 0

#

It breaks it

tough abyss
#

Those numbers will place image outside visible area

#

Obviously ctrlCommit will move it outside

peak plover
#

Ohh yeah, you're right. My bad

#

Thanks

tough abyss
#

And don’t execute ctrlCommit on every frame it makes no sense

peak plover
#

Yah

high marsh
#

Wait a sec, are you the same world famous life developer nigel? Why would you do such a silly thing? Is this why life frameworks have such low standards?

peak plover
#

I don't develop life 👺

high marsh
#

That's what you say nigel, but when everyone sees your rpg framework 2.0, the secret will be out.

peak plover
#

            [_ctrlSliderTimeout,_sliderPos,_timeUntilOpen] spawn {
                    disableSerialization
                    params ['_ctrlSliderTimeout','_sliderPos','_timeUntilOpen'];
                    systemChat str _this;
                    systemChat str _ctrlSliderTimeout;
#

undefined variable in _ctrlSliderTimeout

#

🤔

high marsh
#

Error speaks for itself

peak plover
#

Says it's a control

#

Ohh

#

I see

#

Disableserilization dones't have semicolon

#

And it didn't error

#

🤔

tough abyss
#

@peak plover trying to return a certain array of blocks

#

i don't want to set an individual variable for each block

#

and there's a lot of the same block that i need in different arrays, so i can't just use typeOf

peak plover
#

Are these blocks all in the same area?

tough abyss
#

Yes

peak plover
#

You can put a trigger with 3d space

#

and if they are all in there, you can get 'em

#

example

#
private _myArrayOfBlocks = [block1,block2,..];
private _myTrigger = triggerWithArea_1;

private _myArrayOfBlocksInTrigger = _myArrayOfBlocks inAreaArray _myTrigger;
#

As an alternative:
use 3den layers

digital hollow
#

Is there a way to detect whether an AI in a player's group has been given the Hold Fire command?

meager heart
#

we have currentCommand but idk is there "hold fire"

#

sendSimpleCommand iirc has it but it returns nothing and no getters

#

oh.. maybe

frigid raven
#

good morning brothers from another mothers

#

I am sad that I have to use localize to use stringtable values

#

I wonder if anybody of you have written a n0ice macro for it

#

Ah heres my question can I make a $ macro to have localize "key.of.awesomenezazsa substituted?

#

like hint $(key.of.awesoamsdasd)

#

can't test it cause am at work but am sure it is a not allowed symbol eh?

frigid raven
#

thx for pointing out

#

need to get used to PreProcessor Cmds

tough abyss
#

Dunno about dollar sign but you could use word or letter, something like
#define S(KEY) (localize #KEY)
Usage of macros however makes code difficult to read and in this case doesn’t improve anything

broken thistle
#

I wanted to find out of someone has a web site that has script samples. I;m looking for an insert and pick up

#

Oh and some mission editor samples too. I don't some missions in arma 2. The code in area 3 is more advanced that I thought

compact maple
#

wut

#

is that arma 3 related

tough abyss
#

I don't some missions in arma 2. The code in area 3 is more advanced huh???

compact maple
#

lmao

tough abyss
#

Bizarre

queen cargo
#

Uhm... Wut? Using the Dollar syntax in Configs is legt

#

Legit

tough abyss
#

Hi, can anyone tell me how to confugure a mission with 3 respanws only. An script? Thanks.

compact maple
#

What do you mean ? 3 different place to spawn ? or 3 respawn per player ?

tough abyss
#

respawns per player in the death place

compact maple
#

well in the multiplayer options in 3den I think you can configure the respawn system

tough abyss
#

yes, but i can't find where to select the number of respawns

frigid raven
#

@tough abyss Macros are friggin awesome! localize "key.of.me" vs. STR(key.of.me) the latter wins my heart

#

... well after reading over it several times... meh

#

😄

still forum
#

@frigid raven yes you can use a macro like that.
Ignore that guy who clearly doesn't know what he's talking about 😄

frigid raven
#

will do...

#

I will ignore this guy ( @tough abyss )

tough abyss
fringe yoke
#

Does anyone know of a command to toggle free look?

tough abyss
#

I will ignore this guy what the actual fuck? I did not say you can’t use macros

ruby breach
tough abyss
#

hey hey, this looks to be what i'm looking for

#

thank you! @ruby breach

compact maple
#

why do you people think you cant be touch lmao

#

thats an hard superiority complexe you got there

frigid raven
#

@tough abyss 😄 calm down - just joking around

unborn ether
#

🍿

#

Okay 😦 slowly exits the room leaving popcorn behind

frigid raven
#

No take your popcorn with you - before sb. else takes the seat

still forum
#

looks up after eating popcorn off the ground

narrow musk
#

👀

frigid raven
#

giving up by laying on the ground

peak plover
#

Wait

#

Wouldn't it be easier to just create the blocks in .sqf? @tough abyss

tough abyss
#

listen here buddy that's too big-brained for me and also that's more effort than i want to put into this mission

peak plover
#

Then 3den layers

tough abyss
#

@peak plover You can use 3den layers to return an array?

peak plover
#

yea

tough abyss
#

WHAT

#

HOW

peak plover
#

example

tough abyss
#

holy shit

peak plover
#

line 40 I got the 3den layer entities and did param [0,[]]

#

This returns all objects within that layer

#

My layer name is generated on the fly in this case

tough abyss
#

absolutely amazing

#

thank you so much fampai you just made my life way easier

peak plover
#

No problem

frigid raven
#

@tough abyss friends again?

tough abyss
#

Geee, let me think...sure

frigid raven
#

yay

grizzled rain
#

Does anyone know how to add the alarm sound to an object?
to turn on and off such

tough abyss
#

@grizzled rain are you looking to make it so players can toggle the alarm?

frigid raven
#

Is GVAR a convention to adapt in your own mod/mission ? Or does it has some kind of copyright when I gonna use something similar?

grizzled rain
#

yes @tough abyss

tough abyss
#

Rule of thumb, prefix your shit so that it won’t clash with other people’s shit

still forum
#

I don't think one can put copyright around 4 letters..

#

ALWAYS use prefix for global variables

#

whether you hide it behind macros doesn't really matter

frigid raven
#

yea but my macro names will not interfere with others do they?

still forum
#

Uh...

#

Arma doesn't really like redefining macros if that's what you mean

frigid raven
#

ok got your point

still forum
#

I think you might be forgetting that macros are just copy-paste

frigid raven
#

really first time I use macros

still forum
#

Don't use macros if you don't know why you should

frigid raven
#

so I forget to grasp the concepts sometimes

#

I wanna make boilerplate statements more readable

#

getVariable is a good example in my opinion

still forum
#

Well I'd say GVAR is not boilerplate.
And yeah.. ACE also has macros for getVariable stuff. But. That kills readability completely

frigid raven
#

hm

#

#define DEBUG(var1) [format ["DEBUG: %1", var1], DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug;

#

I wanna slim down my debug statements actually

still forum
#

that's a very nice idea. That way you can also very easily disable all your debugging, by just emptying the macro

frigid raven
#

Aye

frigid raven
#

#define LDEBUG(var1,var2) [format ["DEBUG (var1): %1", var2], DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug

Any idea what's wrong with this macro? var1 is not getting evaled. Calling it like so:
LDEBUG("before", _allProfiles);

#

I am omitting the # because it doesn't need to get converted to a string in my opinion

#

Tried this as well LDEBUG(before, _allProfiles); // no ""

still forum
#

macro params aren't resolved inside "" strings

#

use '' strings

#

also leave away the quotes when you "call" the macro

frigid raven
#

ah ok - I found the quotes nice in the call cause of syntax highlighting for strings

#

Jeez I want to implement logic for 2 hours but still sitting there refactoring the whole

#

I am way too german

still forum
#

you mean "too perfect" 😉

frigid raven
#

🦌 are.... are we allowed to be patriotic again?

#

ah yea right - all eyes on Trump now so we can rise again!

#

Alright third try my Kameraden! This time we can make it!

#

...too soon?

still forum
#

for mother Chernarussia!

frigid raven
#

! yay

#
#define LDEBUG(var1,var2) [format ['DEBUG - var1: %1', var2], DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug
#define DEBUG(var1) [format ["DEBUG: %1", var1], DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug

Next mystery to solve...
Calling it like
LDEBUG(after, _allProfiles);
yields
DPL.PROFILES - - after: ["#CBA_HASH#",["76561197977776587"],[[<null>,<null>,["#CBA_HASH#",[],[],any]]],[]]
Please notice that DEBUG is being removed from the output - I do have a macro called DEBUG but that one expects argument. Might this be evaluated there?

fringe yoke
#

Does anyone know a way to toggle free look?

tame lion
#

double tap "alt"? is that what you mean?

frigid raven
#

I think he means by script eh?

fringe yoke
#

Yeah, via script

frigid raven
#

Yea but the question seemed odd 😄

#

Can I know the use-case? Am curious

fringe yoke
#

There is a animation that plays, but the player is still allowed to move their head around, which makes the animation clip into the ground. I would like to switch to free look during the animation

#

Right now I going to use an extension to double tap alt... hoping for a better way

frigid raven
#

So you want the player to stop looking around right?

fringe yoke
#

I don't think that works for players

#

Only ai

frigid raven
#

@fringe yoke well give it a try ?

#

Units can be players, too as far as I know

fringe yoke
#

I found the check yeah, disappointed I didn't find an enableFreeLook like everything else

#

I tired it already in the debug console with no luck, didn't dig into it too much

frigid raven
#

I think there is a way to execute every action a user can do - but hard to find without the wording for it

peak plover
#

I'm not sure if u can force freelook?

#

or disable

#

Also what would happen if trackIR

tough abyss
#

You can disable kinda by overriding key press but if it is remapped to mouse or joystick you can only check if the binding is not vanilla

frigid raven
#

Is it possible to make a Rsc_Picture clickable? I want to have them as clickable areas. Workaround would be overlay buttons without alpha values

peak plover
tough abyss
#

Yeah mousedown should work

frigid raven
#

okay then sth else is going wrong here

tough abyss
#

There is no Rsc_Picture though, only RscPicture

frigid raven
#

ye...

#
_profilePicture1 ctrlAddEventHandler ["MouseButtonDown", {
    ["DEBUG!666", DEBUG_CTX, DEBUG_CFG] call CBA_fnc_debug;
}];
#

Does not execute

#

trying same statement with a button now

#

k still not working - doing bullshit anyhow it seems

weary pivot
#

I’ve setup my artillery providers, my support provider and a unit they are synced and the artillery communicates and says Rounds complete but they never move to aim and the don’t fire. What am I doing wrong

#

Nevermind I figured it out I had to many providers

unborn ether
#

@frigid raven To make control fire event handlers, it should be enabled. AFAIR things like RscPicture|RscPictureKeepAspect are both disabled by default.

frigid raven
#

But can be enabled in the config eh?

peak plover
#

Try that

frigid raven
#

thx a heap

meager heart
#

you can try ctrlSetFocus too 😃

#

and there are no disabled controls by default... 👌

meager heart
#

oh... also "MouseButtonDown" - does not works with "RscPicture"... (i can't type)

tame lion
#

is there anyway to get the IRL date/time in arma?

meager heart
#

only with extensions afaik

unborn ether
#

Is it possible to grab chat control and add some text to it? thanks.

tame lion
#

the only one i found was one by KillzoneKid, but its 32bit only, and i definitely would need 64

unborn ether
#

@tame lion Watch for real_date extension. It has both x86/x64.

tame lion
#

nevermind, he has a x64 buid on it too i just found

unborn ether
#

Jeez

tough abyss
#

@tame lion you can do this with missionStart, it even has an example

tame lion
#

thank you, i just got it to work 😃

#

long story short: I have a vehicle shop system and one of my members suggested doing like a "sale of the week" to me.
my idea was to do something like "Sundays between 7-9pm, all vehicles half off" or something to that effect

peak plover
#

How would one determine which command to use to remove an item?

#

Like removeWeapon,removeMagazine,removeItem

still forum
#

bis_fnc_itemType?

meager heart
#

addItem works with everything... so maybe removeItem too 🤔

peak plover
#

Ohh it works with mags at least

frigid raven
#

be sure to have the right weapon item name

#

I had a stupid moment where the name visible in the eden editor != the name it needs for being added

peak plover
#

ohh itemType works great thanks @still forum

peak plover
#

I guess if I want to drop player uniform via script I have to get the items with itemCargo uniformContainer _unit

still forum
#

would probably easier to use the drop action
I know that works for weapons, might work for uniforms too

peak plover
#

I need animationless/instant

compact maple
#

hello superior living people

still forum
#

Well as soon as you have weapons with attachments in the uniform.. you're doomed

peak plover
#

ohh yeah

#

They would be gone

#

But they won't be

still forum
#

you can unlink them from the weapon and put them in uniform that way

peak plover
#

I would just take the gun apart

#

Whatever 🤷🏻

#

As long as the items are not dissappearing 😄

gusty flume
#

not an arma script but wondering if anyone here has experience with python scripting and could tell me if my script will do the job i want it to

tame lion
#

Kind of a general question scripting question here:
I know that while {true} do is bad to do, busty is it strenuous on the system if you put a sleep in that condition? Ex: while {sleep 60; true} do

still forum
#

put the sleep into the code, not condition ^^

tame lion
#

Oh i thought you could put It in the condition. It's worked for me in other instances

still forum
#

could too....

#

But I don't see why. It should work. But looks ugly 😄

tame lion
#

Lol i don't know the engine well enough but I think i learned that from reading some script a long time ago when i was but a young padawan

#

My understanding is that the reason it's strenuous is because the condition code is getting run every frame, and my thought was that the sleep in the condition prevents that from happening

still forum
#

is because the condition code is getting run every frame nope

#

your script runs for at most 3ms per frame

#

and at minimum... never.

#

Without any sleep your while loop might run dozens of iterations each frame. For up to 3ms.
With a sleep you can make sure it only runs between once every sleep interval and.. never.

tame lion
#

Oh yeah... The code will exit once the condition is false anyway lol

tough abyss
#

"The code will exit once the condition is false"
no it won't

#

the condition won't be satisfied if the condition is false

#

if you have code that's being run and your condition gets set to false somehow during that -- your code would still execute

#

it would stop executing after its current iteration would finish

#

but it would not exit

peak plover
#

I'd love to find out what @tame lion 's goal is

#

Stop the loop condition from checking every frame?

#
private _i = 0;

// waituntil runs once per fram
waitUntil {

    call my_fnc_runsEveryFrame;

    // increment
    _i = _i + 1;
    (_i == 10 && {
        _i = 0;
        ((currentWeapon player) isEqualTo (handGunWeapon player))
    })    // condition
};

#

This would only check the condition every 10 frames

#

And execute the code every frame

still forum
#

it would check "some" condition at most every frame. But not "THE" condition 😄

peak plover
#

Wll

#

let me edit

#

if you wanna run code every frame

#

but only wanna check the condition every 10 frames

#

🤷🏻

still forum
#

:U

#

but waitUntil doesn't run every frame

#

it runs at most once every frame

#

and minimum... never.

peak plover
#

aaah

#

yeaa

#

in that case you can do a similar thing with eachFrame

still forum
#

I'd say in the average case.. it runs every couple frames

peak plover
#

and run it all in unscheduled

still forum
#

I think Crowmedic was only aiming to make his code less performance intensive

peak plover
#

@tame lion Is the issue low fps ?

tame lion
#

I was asking only a generalized question. But more specifically i have a vehicle shop that updates it's contentevery hour from server start via while {sleep 3600; true} do

#

I remembered reading somewhere that doing while true do's was a bad thing to do but figured if it only runes every hour it can't be that bad

still forum
#

your remembering and figuring are both correct

#

That way to do a hourly update seems horrendously bad.. But.. You don't really have alternatives with vanilla Arma

peak plover
#

Isn/t sleep still inaccurate}

still forum
#

yes

#

Same as scheduled in general

tame lion
#

But is been working though lol

still forum
#

yeah. It works. And there aren't really any good alternatives. But it still makes my non-existent back hair stand up

dusk sage
#

As long as you don't need it critically on the hour :)

peak plover
#

.dll and just a py script or sth 🤷🏻

still forum
#

Intercept is the only almost-perfect solution.

peak plover
#

&

#

Yup

tame lion
#

Is only an update that doesn't need to happen exactly at the hour. Just close enough

peak plover
#

Sure, but there's gotta be more things like that

dusk sage
#

If you make an extension, you're still gonna have to poll it

peak plover
#

I just mean use an existing extension

#

And use something other than arma to do things

still forum
#

Unless... Intercept.. But unless you go crazy like I would.. It's still polling

tame lion
#

I was looking through a mod the other day (ace medical i think) and remember seeing something called cba_fnc_waitandexecute (or something to that effect) could that possibly be the alternative to my while sleep 3600 true do?

still forum
#

You almost can't do anything perfect with Arma ¯_(ツ)_/¯

#

Yeah. waitAndExecute is the most efficient alternative there is (besides.... that thing)

dusk sage
#

Don't be deterred from just sleeping for an hour if it really isn't time critical whatsoever @tame lion it's the simplest solution

still forum
#

and performance wise it doesn't really matter anyway

peak plover
#

True

#

There are other ways of increasing performance

#

Which are probably more effective

still forum
#

-noSound :3

tame lion
#

-nosound on server exe I'm assuming?

still forum
#

no.. that wouldn't make any sense ^^

peak plover
#

scheduled scripts rarely kill performance

still forum
#

Server doesn't have sound anyway

tame lion
#

Lol i knew that But the suggestion made me think i was wrong

still forum
#

disabling sound clientside gives more fps

peak plover
#

How much more?

still forum
#

about half of one

#

probably 😄

peak plover
#

So 50% more?

tame lion
#

Long story short I've got a project I've been working on over the past year. I've learn a lot in that time, better techniques, etc. I'm now going through all my older code and attempting to optimise and fix things that work but could work better

still forum
#

Ahh yeah.. Old projects are the best... NOT

#

Most of the time when people tell me "My mission is awesome, I have been working on it for over 3 years" you already know the SQF code is gonna be utter garbage

peak plover
#

yikes

still forum
#

You either go over all your code about once per year and clean up. Or you rewrite everything. Or your code is gonna stay crap 😄

peak plover
#

My mission is gonna be awesome, I've had the idea for it for years, just started writing it.

still forum
#

If I find a single private ARRAY in there you're gonna get a slap on the wrist

tame lion
#

Yeah... As an example... The dialogs for this shop... They declare selections as global variables because i didn't realize better ways to store and transfer data between different ctrl event handlers

still forum
#

setVariable! 😄

peak plover
#

Yea

#

_ctrl setVariable

tame lion
#

Well... More like ´lbCurSel´

#

That's what I've been doing now

still forum
#

I started looking into someone's mission on github today. This code is not his though, some idiot from armaholic wrote that years back and tons of people keep copying that shit. But I found DOZENS of occurrences of this

call compile format ["%1 = %2",_varType, _terrainGrid];
call compile format ["profileNamespace setVariable ['%1',%1]", _varType];

Note here that the profileNamespace variable is NEVER being read. It's purely useless garbage

tame lion
#

You mean that they never pull it with profilenamespace variable?

still forum
#

getVariable yes

tame lion
#

Yes... Lol I'm on my phone

still forum
#

Also the variable name is ""varname"" instead of "varname" like you would expect

dusk sage
#

Next you're gonna say they had with uiNamespace do { before that

still forum
#

no 😄 atleast I haven't seen that yet

tame lion
#

Wait... I've done that... What's wrong with that?

still forum
#

kinda broken and unreliable.
I think the currentNamespace would carry over to other scripts even though you don't intent to

#

I'm not up-to-date to whether that has been fixed

tame lion
#

but this is how this should work, correct?

with uinamespace do {
var1 = "Test Text";
};
hint var1; //<--- fails

hint (uinamespace getvariable "var1"); //<-- succeeds
#

just as a general theory question

still forum
#

yes

dusk sage
#

(but nothing stops you doing uiNamespace setVariable...!)

tame lion
#

oh i know, it was just a working example to make sure i understood the concept lol\

frigid raven
#
    <Key ID="str.dpl.profile.info.isprisoner">
        <Original>Prisoner:&nbsp;</Original>
        <German>Gefangener:&nbsp;</German>
    </Key>

yields Prisoner:?
😦

still forum
#

why not use a normal space ^^

#

Yeah the Arma font might not support printing that

frigid raven
#

when using normal it trims it

frigid raven
#

There is no way in forEachs scope to access the current iteration index eh?

young current
#

this?

frigid raven
#

leave me alone pls

#

🐛

#

thx tho...

high marsh
#

Have a taco, will make you feel better.

frigid raven
#

What about the cookies?

#

already gone?

peak plover
#

can't eat sugar

#

brain fog == bad code

high marsh
#

there, don't go and getting yourself fat now.

#

@peak plover Brain fog?

#

You got sugar molecules in the form of cookies?

peak plover
#

Brain fog is a general term for dysfunctions in focus, learning, and memory that can create brief episodes of confusion, disorientation and frustration.

#

It's when you are trying to script and it's not working and you don't know why and you get more and more frustrated and confused

tame lion
#

I'm having an issue with addPublicVariableEventHandler not firing despite me actually changing the variable. Here is how im using it:

"APM_Admin_notes" addPublicVariableEventHandler {
    hint str _this;
};```
and anytime i do this:
```sqf
APM_Admin_notes = "Some Data";
publicVariable "APM_Admin_notes";

the above code does not fire. Any ideas?

austere granite
#

When are you calling the code? There's something with using it in preinit/postinit that you need to spawn it I believe

#

Rule?

tame lion
#

dropped my keyboard and that popped out

#

the variable is gonna change whenever a player enters a note into the array that is going to be APM_Admin_notes and the client is going to public the new variable

#

what will happen is: Client who is an "Admin" (not logged or voted, but declared through my system) will enter data into a dialog, that data will get sent to the server and pushback'ed into the APM_Admin_notes array. The server will then PublicVariable APM_Admin_notes in order to make sure that all admins now have all the "notes" which will be in this array

#

let me ask this: I'm currently testing in the editor with Local Hosting, not dedicated atm, does that affect how this works? does the event only happen when you aren't the one changing and public'ing the new variable?

frigid raven
#

This is the login handler (mouse button down) for my login Dialog. It is being executed.
Please note that _profile is a CBA Hash. Debugging it in the handler scope yields the expected values.

_loginHandler = {
    params ["_ctrl"];
    private _profile = _ctrl getVariable ["_profile", EMPTY_HASH];
    closeDialog 1;
    _profile call X11_fnc_login;
};

But when inside the X11_fnc_login the given param _profile is not the hash it was before. I know Dialogs work a bit different but did wasn't aware it will screw these things up?

tame lion
#

i only did hint str _this to test how addPublicVariableEventHandler worked

peak plover
#

I strongly suggest to dump public variable EH and use functions and remoteExecute instead

#

@frigid raven What data type?
try

[_profile] call X11_fnc_login;```
frigid raven
#

CBA Hash (pseudo) so it isn in fact a huge ass array

#
[_profile] spawn X11_fnc_login;

is working now

#

no clue why -_-

peak plover
#

look in X11_fnc_login

#

how are the params grabbed

#

I have no clue what pseudo means

#

Wouldn't the has be an array?

high marsh
#

Pesudo -> Not genuine, perpetrating something, but is still not so

frigid raven
#

I have an array of 3 elements

#

want to remove the value of the element at index 1

#

_array set [1, nil] ?

peak plover
#

Yes

still forum
#

you want to replace the 1 element by nothing. Or you want to remove the element?

tame lion
#

Example depending on what you want to happen:

_array = [3, 4, 5];

_array set [1, nil]; //[3, nil, 5];

_array deleteAt 1; // [3, 5];

still forum
#

the deleteAt is enough to remove it lol.. thought you were him 😄

frigid raven
#

I just want to have an empty value there without having it pop back somehow

#

So I did it right, yay!

#
    _player setVariable [KEY_PROFILE_FETCHED, EMPTY_HASH, _ownerId];

Does this make sense? I want the variable to be available on the players namespace.

still forum
#

Yeah. Looks fine I'd say. But better test that out before pushing it to production 😄

frigid raven
#

I am unsure about having _player as first param... I kinda see this as doubled args

#

haha ye testing the whole time

still forum
#

Well.. Do you want to set it on the player object?

#

or in that players missionNamespace?

frigid raven
#

mod is so huge for me now I am getting friggin crayz

#

Ehm actually I getVar on the player object

#

so yea on the player

still forum
#

that's correct then.

frigid raven
#

kk

#

thanxe

meager granite
#

Have _ownerId instead of _player as left operand

high marsh
#

Hm? Where are you talking about Sa?

meager granite
#

@frigid raven post, I assume he tries to come up with a way to send specific player a variable or something

#

Come up as in imagine something that probably will never be in game

#

Unless it has something to do with Intercept since Dedmen responded to him

still forum
#

setVariable doesn't take a number as left argument

#

He is using the
<object> setVariable [<name>, <value>, <public variable to clientID>]
sytnax

meager granite
#

Well, I feel stupid now

#

How did I miss third array value accepting client id or even array of ids

still forum
#

You don't really use it that much ^^

meager granite
#

I thought he was thinking about how it could potentially work

#

Yeah, never had a need for it before

#

So @frigid raven ignore anything I said

frigid raven
#

yea thats what I felt weird about I have the left side argument player object and also as third right arg the owner ID... kinda double payload since the func could get the ID on the left side or get the owner by itself from the _player object

#

wow I do not understand what I just wrote

meager granite
#

It makes sense since you might want to set variable on client which doesn't own target object

tough abyss
#

You know what P stands for in PublicVariable?

#

Real men use remoteExec!