#arma3_scripting

1 messages Β· Page 215 of 1

tidal void
#

Sane option would be to remoteexec the same function that player action would

radiant lark
#

I guess so? It was intended to be a joke

#

Aight lets stick to scripting tho

pallid palm
#

i'm afraid to type anything now: πŸ™‚

hollow pilot
pallid palm
#

just kidding πŸ™‚

winter rose
pallid palm
#

see i'm 64 and i forget things sometimes: thats my bad

#

i guess that could be a good thing

#

but i only see the good in people: i try to stay away form the bad πŸ™‚

thin fox
pallid palm
#

true that

#

well no matter what i'm still having super fun in Arma 3: fighting and scripting and all that stuff: WooHoo

old owl
# pallid palm see i'm 64 and i forget things sometimes: thats my bad

I mean regardless of age no concept ever just immediately sticks when it comes to learning anything- not on you. Channels like this are cool because you can be young, old or anywhere in the world and talk with like minded people looking to learn. I don't have a professional background in programming or anything like that but the amount I've learned from coding SQF that can be applied even to more common languages I'd like to think has been pretty valuable. I heavily agree with Asmo that you do your best to help people around here and have, and that's what counts πŸ™‚

pallid palm
#

thx so much Milo

hollow pilot
pallid palm
#

me too wow thats Awsome m8

#

i liked OFP that was cool game i loved the way the choppers flew in that game

hollow pilot
#

yea those were the days but lets keep the chat related to arma 3 scripting since this is what the channel is 4

radiant lark
# pallid palm see i'm 64 and i forget things sometimes: thats my bad

The willing to learn something new at 64 is what really matters.

Besides learning, you also help others, your contributions are really appreciated considering 99% of the people that ask for help on this channel (including me) are selfish and do not try to help others.

Most of us come from a place where people have a huge ego and you have to learn almost anything on your own (not good), there is a famous quote that I like which goes like this: β€œThey say I got to learn but nobody is here to teach me”

Once you start learning and having experience, scripting becomes so easy that it feels like you were born with that knowledge, to such an extent that you can’t understand why people have trouble with the basics, making you think their questions are a β€œdumb question”

Maybe that explains it? Idk, but one thing for sure is that you are a really nice guy and your contributions are appreciated, we need more people like youπŸ˜ƒ

pallid palm
#

yes sir

radiant lark
pallid palm
#

wow thx man @radiant lark

radiant lark
#

No worries, you are awesome, hopefully I'll be like you when I'm 64

pallid palm
#

oh thx wow realy cool brother

little raptor
#

Arma veteran β‰  military veteran btw

pallid palm
#

me im military veteran USA Air Force

little raptor
#

I know, and I assumed that's what McIvan meant

radiant lark
pallid palm
#

wow thx so much for all the nice things said: i really appreciate it: thx so much guys

winter rose
#

let's not make this channel a scripter's blog and only write if you help/need help/rubberducking ok? πŸ˜ƒ

pallid palm
#

ok will do thx Lou

#

btw i don't know what rubberducking is πŸ™‚

#

is that like ducking when someone throws rubber at you

thin fox
#

Is there a way to do like an #include in stringtable.xml? I want to separate some parts of it into smaller files (mission config, not mod)

radiant lark
pallid palm
#

yes sir sorry about that

radiant lark
#

If doing that helps you, you can create a thread, I don't think they would mind

pallid palm
#

im not sure how to do that:

radiant lark
#

Right click the message and create thread

pallid palm
#

ahhh ok cool

winter rose
radiant lark
#

Do you approve of the thread thing?

winter rose
#

yep, sure why not

pallid palm
#

lol @Lou hahahah that was funny πŸ™‚

winter rose
# winter rose _a used one_

rubberducking is when you explain the problem to something/someone and the solution comes to you from explaining/simplifying it

pallid palm
#

oh i see

radiant lark
pallid palm
#

i was hoping maybe someOne could give some ideas on how to do it better

thin fox
#

😭

#

I saw that ace does that

winter rose
thin fox
#

thx

hallow mortar
winter rose
#

Dedmen plz fix

errant jasper
#

There are like tons of templating languages one could use instead.

cosmic lichen
#

Why do you want to split it though. Just use a container tag. That way you can fold everything else and concentrate on that part.

still forum
#

it doesn't

thin fox
thin fox
proven charm
#

i was thinking of making my own killfeed of the players and thought that at first the vanilla message needs to be blocked in "HandleChatMessage" EH and then send my custom one via customChat channel. or is there another way?

sturdy prairie
#

What's the most reliable eventhandler to put on a projectile that returns when it hits a vehicle? Been using HitPart, but while on server it seems to be a bit unreliable.

fair drum
sturdy prairie
fair drum
sturdy prairie
#

I'll take a look, thank you 🫑

drowsy geyser
proven charm
ruby spoke
#

I literally googled that xD @placid root Thanks anyway

drowsy geyser
#

yes i tried both and i also use the switch/playMove nothing works but im pretty sure it worked some years ago i can remember carrying a wounded in a mission and the animations worked well

proven charm
#

humm i ran playAction from console and it worked

#

actually i had to move forward for the anim to play

drowsy geyser
#

yes he only makes two steps and starts sliding

proven charm
#

weird

drowsy geyser
#

okay, if you do it with a gun equipped it does play the walking animations

#

but not without

old owl
#

Might need to do something like this maybe?

player playMoveNow "grabCarry";
player playActionNow "stop";
drowsy geyser
#

yes thats exactly what i did but works with a gun and not without

player switchAction "grabCarry";
player playActionNow "grabCarry";
#

turns out if you have no weapons then it does not play the walking animation but it plays if you have a handgun and even if its holstered

old owl
#

Okay was able to do it without a weapon like this. The uiSleep isn't timed exact to the animation so you'd probably have to fine tune that. There is probably a better way though that I am not considering.

player switchAction "grabCarry";
uiSleep 6;
player switchMove "";
drowsy geyser
old owl
#

Oh huh that worked for me without sliding issues. I am not reproducing this in a plain mission so I might be trolling tho

#

I'll see if I can repro in an empty mission

#

This here #arma3_scripting message does still seem to work for me in an empty mission. Not able to get it working with a gun though now.

proven charm
#

what i get (after the anim is played) (player playActionNow "grabCarry"):

winter rose
#

good
you are supposed to carry someone on your shoulders like in Arma 2

#

I would not mind seeing this feature back in vanilla Arma 3 wink wink nudge nudge KK

proven charm
#

still need to start the anim with W key πŸ˜„

drowsy geyser
cyan dust
#

I remember struggling with that as well. Ended up solving it with animations instead of actions:

[player,"acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon"] call TAG_fnc_playAnimGlobal;
sleep 4;//For 'fast paced'. Try longer sleep if you wish
[player,"acinpercmstpsraswrfldnon"] call TAG_fnc_playAnimGlobal;//Skip remaining animation

And 'play anim' is quite simple:

TAG_fnc_playAnimGlobal = {
    // params ["_unit","_animName"];
    _this remoteExecCall ["TAG_fnc_playAnim",0];
};

TAG_fnc_playAnim = {
    params ["_unit","_animName"];
    //Force unscheduled environment, see Leopard20's comment on https://community.bistudio.com/wiki/switchMove
    if (canSuspend)
        then {isNil {_unit switchMove _animName; _unit playMoveNow _animName}}
        else {_unit switchMove _animName; _unit playMoveNow _animName};
};

(I removed safety checks and irrelevant pieces from both examples, but idea stays the same)

#

Works with gun and you can even shoot while carry someone (which is awesome)

granite sky
sturdy prairie
granite sky
#

Not sure where remoteExec comes in.

#

First issue with HitPart (Projectile) is how you add it. Fired EH does work globally on the server, but it won't necessarily give you the correct projectile.

#

bullet simulation makes local copies of projectiles, and I imagine only the shooter-side one generates HitPart events.

#

So it feels like you'd have to install a Fired EH on every object on every client to pick up all the local projectiles.

blissful current
#

Is there a way to reliably get this (where a task icon will be pushed down by a new one) vs the more common, one that prints on top of the other?

proven charm
blissful current
#

@thin fox Thanks for showing me BIS_fnc_showNotification a while back. Works great for what I need.

crimson lion
#

I've noticed bis_fnc_attachToRelative seems to get VERY inaccurate with editor position vs. in-game position in dedi MP when your attached object is farther away from the object it's attaching to.

#

Hard to tell if it's a bug or a limitation by however its coordinates are handled (floating point issue?)

tender fossil
crimson lion
#

As an exaggeration if I attachToRelative'd something to an invis helipad that's like a kilometer away the attaching object will be absolutely incorrect by meters, plural, sometimes

serene olive
#

Is there a way to automatically slot certain player (e.g. by profile) to slots.
I want that myself automatically slot to my names Zeus slot on lobby-join.

blissful current
#

Found an interesting quirk. playSound will cancel out/remove a titleText Black out screen, but playSound will not effect cutText, thus letting the screen stay blacked out.

I wonder why that is?

Also what is the different in cutText/titleText. They seem do the same thing when I test them.

mortal folio
blissful current
#

Yikes!

mortal folio
#

like i remember a couple times doing a scripted sequence/event where i think i used the earthquake function, and ended up figuring out it was the earthquake completely removing the titletext that was meant to trigger at the same time

#

and then you consider other mods using various commands - yeah - it'll never work reliably

blissful current
#

Awesome, thanks for the info!

hushed turtle
#

Why do my missions show description "Search ?" in MP lobby, while other people missions show description from Workshop

topaz lion
#

Possibly a painfully simple one but a quick search and I couldn’t find an answer.

Is there a script I can put in a units config to exclude them from high command?.

Using the high command fix it mod and platoon leader redux so I’d like to exclude support vehicles, anti air guns and artillery etc as I use other mods to control those or don’t need control of them in the AA/ AAA case.

fair drum
hushed turtle
#

What config? Desription.txt? I don't think there is anythig really. I would have to check it though, but I'm not on the PC right now. I think I only set some loading and overview texts in the editor.

reef sedge
#

anyone got a script or idea that disables AI helicopters following terrain? tryed flyinheigtasl but it keeps throwing error and anything else keeps making aircraft just pitch straight up

warm hedge
#

A command that throws an error means your syntax is not right. Post your code

pallid palm
#

@reef sedge what do you mean pitch straight up: ? choppers can only pitch forward or pitch backward: or pitch sideways

#

do you mean Hovering

#

you may have AutoHover on in the menu commands in the chopper

winter rose
#

read the whole message again @pallid palm

pallid palm
#

ok let me see

#

so he wants to disable AI helicopters following terrain

winter rose
#

ASL*

radiant lark
#

Idk what he means either

pallid palm
#

well if we set ```sqf
Helo2 flyInHeight 33;

granite sky
#

flyInHeight is ATL, so if you use that then it follows terrain. flyInHeightASL is for if you don't want it to follow terrain.

pallid palm
#

oh i see ok

#

so are you saying if you use ASL the chopper will fly into a mountin and crash

granite sky
#

No, that's separate.

#

The AI will still try to avoid collisions, I think.

pallid palm
#

yes thats true

#

no matter what hight you set the chopper will avoid collisions

granite sky
#

It's not necessarily very good at it. Some maps have mountains with slopes that the AI can't adjust for.

pallid palm
#

i found if i set the the flyInHeight to like 10m ASL the chopper will pull up and avoid collisions

#

at any cost

#

even over water

#

like in my DEEP Diver mission on the way home or RTB as it were: We are flying at 10m ASL and we are heading right into a cliff and the chopper pulls up to any hight it needs to get over it

#

this is just what i have found im not saying im correct

#

oh and i have the Ai pilot set to Zero skill

#

and set to careless also: and i have the chopper set to full speed also

#

as a matter of fact i never saw a Ai chopper pilot: fly into a cliff or crash into cliff ever in my whole Arma gaming life: unless it was damaged πŸ™‚

#

them Ai chopper pilots are really good: even at zero skill: they can land even if they are spinning around like hell: and damaged really bad

#

i tested and tested and tested all this

#

you could kinda say i'm a bit of a chopper expert πŸ™‚ in Arma 3 πŸ™‚

#

flying a chopper: or even scripting chopper stuff: choppers were the main reason i started playing Arma

#

but of course i saw all the other cool stuff also

#

lol i remember back in the day when Unsung came out i had to land a huge chopper in the jungle with a full team in the chopper: with 1st person lock on: and lucky i had a joy stick back then: cuz that was the hardest thing i ever had to do in Arma

#

if i would of crashed that chopper: and K.I.A everyone: i would of never heard the end of it πŸ™‚

pallid palm
#

it was like real life πŸ™‚

#

so after all that here you go πŸ™‚

#
Helo1 flyInHeightASL [standardAltitude, combatAltitude, stealthAltitude];

Helo1 flyInHeightASL [200, 100, 400];
hushed turtle
# fair drum whatcha got in the config/description?

In have author alone in Description.ext. There are some values like loading and overview description filled in editor, but besides that nothing. I don't see how is Workshop description related anyway. I doubt other people copy&pasted their workshop description to Description.ext

errant jasper
#

Isn't mission title not a mission.sqm thing? Pretty sure missions can have names without description.ext, though there is a chance my memory is fault.

#

Description.ext / briefingName
otherwise
mission.sqm / Mission / Intel / briefingName ?

pallid palm
#

yes there is like 4 places you can have the name of the mission Can have CutText name in the init.sqf
and in the Description.ext you can have the name
and 2 other places in the mission.sqm also

#

@hushed turtle btw is that a typo you have there ? Description.exe: should be Description.ext right ?

hushed turtle
#

I'm changing text file into an executable πŸ˜†

pallid palm
#

ok i was thinking that

reef sedge
pallid palm
#

ok m8 Awsome

hushed turtle
#

I've unpacked and checked some mission made by some else and they don't do anything differently, regarding mission description

#

And they have nothing like overview, text, author or anything like that in Description.ext

#

Just some text filled in editor

radiant lark
#

wow, this is some serious SQF right here

errant jasper
#

For a scam to work, shouldn't they provide a link or something ?

#

What is proper procedure. Can we ping "at at discord moderators"

radiant lark
radiant lark
still forum
#

I'm taking care of my backlog, I'll probably get to yours this week

still forum
radiant lark
#

You know it, every once in a while I just come up with some crazy ideas

proven charm
#

same πŸ’‘

hushed turtle
#

I've tried to copy Workshop missoin's .bin file and renamed to .pbo and place it into MPMissions in game's directory. This results in using texts set in editor.

#

Dunno why it displays "Search ?" rather than Workshop description in MP lobby. Linux issue maybe? That would quite unfortunate. 🐧

#

In singleplayer scenario list workshop description is displayed just fine.

hallow mortar
#

Does the description perhaps start with "Search & destroy" or something like that?

#

& is a special character with syntax meaning in strings - it's the start of an HTML special character code, and in some contexts the game will get confused if it's followed by anything other than a valid HTML special character code

#

If you want to display an actual & in structured text, you need to encode it using its own HTML character code: & or &

hushed turtle
#

It literally does start with "Search & destroy" πŸ˜†

#

Will try that

radiant lark
#

SND!

hushed turtle
#

Thanks NikkoJT for the tip, it indeed was issue with &. That being said, now it's replaced by & and both Workshop and singleplayer scenario list display & instead of &, while MP lobby displays correctly &. So, it's flipped, previously it wasn't working correctly in MP lobby, but now it's not working correctly in SP and Workshop. This game man sometimes, like it couldn't use same formatting at least. meowsweats notlikemeow meowfacepalm

#

MP lobby mission description doesn't support new lines. I guess it expects <br> tag. Oh, man...

hallow mortar
#

Unless some other solution turns up, the simplest option is probably to just write and instead

hushed turtle
#

That's what I did indeed hmmyes

sullen marsh
#

Do you have signatures enabled...?

proven charm
#

in arma3 do you blacklist commands client cant use?

winter rose
proven charm
#

thx was looking for something like that

blissful current
#

Has anyone encountered this before?

  1. If I place a task module and sync to an object, I can see a 3d icon from any distance.
  2. If I instead script task creation with BIS_fnc_taskCreate and use BIS_fnc_taskSetDestination to set the 3d icon, I will not see the icon until around 50 meters.
#

I would expect the behavior to be the same.

hushed turtle
#

Tasks can have icons set to always visible, which makes them visible even when other task is assigned

#

Maybe the one from module is set to always visible?

pallid palm
#

Rockin around the Arma game, let the Arma spirit ring

later on we can have some fun, and do some fi-i-ghting πŸ™‚

pallid palm
#

i myself never created a task via scripting i want to try that πŸ™‚

#

holy hanna that looks hard wow

#

well i only did tasks 1 time: in my chopper command Demo mission: so i guess its not needed

pallid palm
#

so in my (Special reload radio trigger 0,0,0) i have in the OnActivation

Local player

so in the script it targets isServer: πŸ™‚
and in that part of the script i have the reload Animation

but for all other players
i have in script not isServer with no reload Animation

and in that they just get the mag in their gun filled up to full capacity
that way No One going into the reload Animation: its just a work around

winter rose
#

and? do you need help or?

stable dune
pallid palm
#

ok cool thx m8 Awsome

hushed turtle
#
local player

meowsweats

stable dune
#

i bet that is true

hushed turtle
#

Man, player is always local

pallid palm
#

yeah i will change some stuff in the script and the OnActiveation as per what you guys said πŸ™‚

#

thx so much guys

#

lol you guys just gave me a ton of ideas πŸ™‚

granite sky
pallid palm
#

yes i got the help thx @winter rose i always need help

pallid palm
#

WooHoo it works Awsome now m8s: thx so much guys @stable dune @hushed turtle

#

man you guys saved me lots and lots of time πŸ™‚ man i love you guys so much πŸ™‚

#

if you can remove the sexual con-o-ta-tions from that statement πŸ™‚

blissful current
hushed turtle
#

Module could be forcing it

blissful current
#

If you create two triggers with createTrigger and name them exactly the same does that mean you have two triggers that would each do something. Or will the engine be like, no, there is already one like that.

hushed turtle
#

I would guess old one would stay working, but you're not going to have any way to access it, if you overwrite all variables referencing it

#

You can't really do anything by scripting with any unnamed editor trigger

#

So it would just stay existing. But if you overwrite all references then just won't be able to do anything with it.

#

There are commands to find nearby objects, they may be able to find triggers too

pallid palm
#

holy shit guys @stable dune @hushed turtle it works so good: now after you guys helped me: the host can take any player slot: and do all the stuff : So Awsome: thx so much πŸ™‚

#

hello all again: so e'm i correct in saying that: the Host player hasInterface and isServer and is Local player also
im Assuming thats correct ?

pallid palm
#

oh thx m8

thin fox
#

put this link in your favorites and check it when you have doubts about it

pallid palm
#

roger that will do

#

thx again

pallid palm
#

completed

errant hemlock
#

so I am trying to play a sound when a player fall unconscious in my mission.

this script below works for when they die but I rather it work when they fall unconscious and multiplayer compatible where all players can hear when they fall uncon.
this is in initPlayerLocal.sqf btw


_unit addEventHandler ["Killed", {
    [_this, {
        params ["_corpse"];

        private _dummy = "#particlesource" createVehicleLocal [0,0,0];
        _dummy setPosWorld getPosWorld _corpse;
        _dummy say3D "sound6";
    }] remoteExec ["call"];
}];```
any help is much appreciated
pallid palm
#

@errant hemlock so um maybe you should use a diff EventHandler, umm cuz that's a killed EventHandler, i'm not sure but: is there any other EventHandler you could use ?, the killed EventHandler is doing its job

#

im not the best but im just trying to help: you said any help is much appreciated: πŸ™‚ maybe you want a damage EventHandler

#

maybe something like this

#
_unit addEventHandler ["HandleDamage",{
    params ["_unit", "_selection", "_damage", "_source",  "_projectile", "_instigator"];
    //your code goes  here
}];```
#

there must be a damage level: with a unconscious player: is that true: i never tried this so: you know

#

i don't do the retrieve stuff in my missions: so you know πŸ™‚

granite sky
#

There's no event handler for unconsciousness despite a lot of begging.

pallid palm
#

ummm really

granite sky
#

yes, otherwise we'd have been using it :P

#

So you'd either have to poll lifeState, or support each medical system specifically.

pallid palm
#

i kinda remember seeing this damage EventHandler for the retrieve stuff

#

but im not sure

granite sky
#

Well, if you're writing your own medical system then you know when you used setUnconscious.

#

But otherwise it's a giant pain.

errant hemlock
granite sky
#

ACE uncon is easier.

#

They actually throw events.

errant hemlock
#

it makes me think how painful it was for the KAT devs

granite sky
#

"ace_unconscious" CBA event, fires globally.

pallid palm
#

you must be right @granite sky cuz i really don't know for sure

granite sky
#

I'm actually not sure there's any hook for BIS revive other than replacing the functions. Nothing listed in scripted event handlers.

errant hemlock
errant hemlock
#

I tried but I couldn't make much use out of it.

pallid palm
#

ok my friend

errant hemlock
#

well I figured out how ignis did it anyway, they used the vanilla revive system and set the incapacitation mode to advanced. its not ACE medical but close enough

pallid palm
#

nice m8 Awsome

hushed turtle
proven charm
#

the CfgDisabledCommands reminds me of BE filters, i wonder if you should use both?

warm ore
#

Is there a script command for a vehicle weapon used by the driver to enable/disable it (stopping it from firing)?
I'm guessing not, and you have to use removeMagazines?

winter rose
warm ore
#

Thanks Lou

tulip ridge
red beacon
#

The Arma 3 scripting language is called SQF, right? Has Bohemia released any books on it? Or any fans?

open hollow
#

probably not, since can be obsolete really fast... but ill be a nice thing to have, coding on paper like a real chad

pallid palm
#

i never learned anything from a book sep for Golf πŸ™‚

#

the wiki and Lou is my book now Woohoo

#

and other really Awsome guys

#

oh w8 i did learn how to fix cars from a book i forgot πŸ™‚

#

Lou is A plethora of knowledge: who needs Books πŸ™‚

red beacon
red beacon
errant jasper
#

Offline usage aside, my perspective is the wiki is great for novice overview of SQF and as reference material. The major challenge for people to advance learning basic application of SQF combined with either:

  1. general programming and problem solving with intricacies of the Arma engine
  2. or using an sqf "cookbook".

If someone else already know programming then #1 is feasible since they just have to learn the commands and quirks of the engine. Otherwise, the problem with #1 is that it is hard, and involves telling people they need to actually learn to program when all they want is quick script.
The problem #2 is that it doesn't really exists. Fortunately, many people are willing to "write a recipe" for people come in here with their problem.

pallid palm
#

@red beacon that would be a huge Book πŸ™‚

#

thats why Ai can't do Arma scripting Ai don't know the Arma engine

#

really iv been told that Arma don't use C++ or ".sqf as it were" scripting: it uses Arma scripting πŸ™‚

modern plank
#

Hello, I miss something:

I define a variable into the init field of all my group leaders units in Eden (this setVariable["NA",1]) but I fail to fetch it during the mission with :

{ 
   _val =  (leader _x) getVariable["NA",0];
} forEach (groups west);

Default value 0 is returned. If I put a variableName=myLeader on a unit, I manage to get it thanks to myLeader getVariable ["NA",0];, but I want to browse all my group leaders dynamically.

Any idea?

hallow mortar
#

Because _val is just a single variable, you're overwriting it with the new value on each iteration of the forEach. So the final value will be only the value for the last group in the list, which may be a group you didn't set the variable on.

#

Unless you mean you're actually checking it in the same iteration within the forEach, but the posted code doesn't show that 🀷

modern plank
#

ya, it is not my full code

#

the issue is myLeader and (leader _x) are not the same unit.

still forum
#

leader can change based on rank, if another member joins the group, or the leader leaves

#

Why do you want the variable on the leader? because there is only one per group?

modern plank
#

Yes, in fact it contains an array with group spawning positions that I read for different stages in-game.

#

Then I TP all groups on their prepared positions.

#

In fact, if I slot mylsef into myLeader, myLeader == (leader player) returns false.

#

I need another strategy

errant jasper
#

store it on the group instead?

#

For JIP you probably also want to guard the initialization either way lest a JIP player reset the state.

modern plank
#

ya better

cyan dust
#

Is there a way to spawn Livonian 'easter egg' tree via script commands? πŸ€”
I guess should be relatively simple with createVehicle, but how to find a classname? Or is it a complex object 'tree + decoration' ?

still forum
#

You mean the christmas tree?

cyan dust
#

Yeah

still forum
#

Afaik that is done by replacement in engine

#

"a3\vegetation_f_enoch\tree\t_piceaabies_2s.p3d" is replaced with "a3\vegetation_f_enoch\tree\t_piceaabiesnativitatis_2s.p3d"

You can probably spawn the latter with createSimpleObject

cyan dust
#

Yeeey πŸ₯³ It does work. Thanks a lot πŸŽ„

thin fox
red beacon
red beacon
proven charm
#

I wonder why player getEventHandlerInfo ["handledamage", 0]; indicates there is already one event in a new mission?

hallow mortar
#

If you're using BI revive, that uses one

#

ACE/KAT will have at least one as well

proven charm
#

oh, its empty mission, only player in it

#

default settings...

hallow mortar
old owl
#

I am not at my PC to look at the code but I imagine any base mission just has one. I can't say I've ever shot a player and damage not been inflicted in a base mission

proven charm
#

revive is disabled by default

hallow mortar
proven charm
#

i tried removing the EH to see if anything changes ;D it didnt

hallow mortar
proven charm
#

nope not reduced damage

old owl
hallow mortar
#

handleDamage is a method of interfering with the engine damage handling.

proven charm
#

could be a mod πŸ€”

hallow mortar
# proven charm could be a mod πŸ€”

Yes, if you have ACE or KAT they will certainly have at least one handleDamage, and it's possible CBA provides one as well (though it's likely it doesn't do anything by default, if it exists)

#

* not CBA, they have the capability to do it but it's commented out for some reason

proven charm
#

nope not a mod, i disabled all of them

hallow mortar
#

Then it's probably just BI revive

proven charm
#

maybe

#

in MP if its removed it gets added right back

old owl
#

Ran missionDifficulty in an empty mission and got -1. Took a look at my settings and reduced damage isn't enabled so probably isn't difficulty.

proven charm
#

in MP theres now two of them 😐

old owl
#

Okay found bis_fnc_feedback_damagepulsinghandler as a variable on the player. Looks to come from BIS_fnc_feedbackInit where a handleDamage EVH is also added. Maybe from there then?

proven charm
#

could be, im giving up because i just wanted to know the "default" EH counts

old owl
#

That actually would make a lot of sense- looks like pp effects from damage also appear to be applied in feedback if I am understanding correctly

proven charm
#

like how many EHs does player have

#

with player getEventHandlerInfo ["handledamage", 0];

old owl
#

Ah okay

hallow mortar
#

That's only for mission EHs, and there's no equivalent for object EHs

proven charm
#

cant see handledamage in there

old owl
#

Oh

#

Wait

#

Yeah

#

My bad

proven charm
#

no worries πŸ˜‰

#

whats interesting is that in MP there are atleast 2 of those EHs. in one player object

still forum
hallow mortar
#

I believe it's PP effects and overlays connected with receiving damage

old owl
#

From what I can see it is what Nikko said above- PP effects for burning, bleeding, etc if I am understanding it right

hallow mortar
#

It also has effects for fatigue, and is where the dirt-on-screen effect from nearby explosions comes from

still forum
#

Fatigue is probably the reason it checks so often then

proven charm
#

the second EH is coming from revive i can confirm that

granite sky
#

It installs even if it's disabled?

proven charm
#

revive being enabled i meant

granite sky
#

ah ok

pallid palm
tender fossil
#

(NOTE: Arma 2: OA/CO!) Basically, I'd like to know that as A2 is EOL since ages, is it wasted effort to try writing secure enough code in this case?

I have an autonomous team balancing system based on player scores on a server, but the problem is that after enabling it, some clients started acting weird which I noticed both because of extensive debug logging but also logging in case of potentially malicious activity, just like in this case.

In the first phase, a client sent negative score updates (even though the code doesn't allow negative scores at any stage and prints a warning if it happens despite of that). In the second phase, the code triggering score change worked only partially for some clients. In the third and final phase, some clients seemed to "mute" the whole score counting/increasing function as I could see them playing normally, but nothing was printed to logs.

It works like this on the side of the game:

  • When an unit gets created, a "Killed" EH gets attached to it.
  • When the unit gets killed, the EH fires and adds the score to player as follows:
if (isServer) then {
  ['SRVFNCREQUESTCHANGESCORE',[leader _killer_group, (score leader _killer_group) + _points]] Spawn WFBE_SE_FNC_HandlePVF;
} else {
  ["RequestChangeScore", [leader _killer_group, (score leader _killer_group) + _points]] Call WFBE_CO_FNC_SendToServer;
};

In vast majority of cases, the unit is not local to server, so the latter line of code gets run almost always.

So the clients seem to be able to modify the score counting mechanism even if the actual code adding the score doesn't even run on their machine.

Is it a lost battle?

open hollow
#

you want to use this in a3?

tender fossil
#

No, in A2 instead

open hollow
#

the killed eh is local, you cant run it locally in the server?

#

or it only activates where the unit is local?

tender fossil
#

It gets triggered where the unit is local

#

Most often it's headless client as most of the AI runs there

pallid palm
#

Hello All: do flashLights work under water:

#

you know the flashLight on your rail of a weapon

open hollow
pallid palm
#

i did and it didnt seem to work

#

but it was daylight out tho

#

maybe i just couldnt make it out or see it very well

open hollow
#

use 3rd person lol

pallid palm
#

yes sir i did and it didnt seem to work

open hollow
tender fossil
open hollow
#

i mean server and headless shouldt run the same code?

tender fossil
#

But in any case, the EH usually fires on another client (or occasionally server) and it still gets intercepted somehow

tender fossil
#

I think it's like that also because addScore can be run on server only

pallid palm
#

stupid Net wants me to get a Mod πŸ™ In Arma 3, standard flashlights generally don't work well: or at all underwater due to game mechanics (refraction, backscatter, water opacity) πŸ™

#

i'll do without a mod its just a matter of time πŸ™‚

hallow mortar
errant jasper
#

-I don't know how they manipulate the scores. If they had acquired scripting access they could do much worse.

  • But from a simplicity and correctness perspective, I would just sent the killed EH args to the server and let it do all the computing as a delta.
  • You have two places where you could get lost update
    • your spawn running multiple updates concurrently.
    • Two machines each getting a local kill before scores are synced.
tender fossil
#

I'll try that, thanks πŸ‘

hallow mortar
# pallid palm but it was daylight out tho

Flashlights work underwater. There are conditions:

  • it must be dark enough to actually see the flashlight; it won't be visible in daylight
  • you must be in a configuration that allows you to have your weapon out while swimming, e.g. wearing a vanilla Wetsuit
  • the vanilla flashlights have quite poor range and the light may not be noticeable if there's nothing nearby to shine it on
pallid palm
#

copy that thx m8

#

thx you for the reply

#

well i was only just under water near the surface of the water: im going to try it way deep in the water and see if i can " see the light": no pun intended πŸ™‚

#

its really dark at -100m in the water

#

i may have to do the sunOrMoon thing

hushed turtle
# pallid palm well i was only just under water near the surface of the water: im going to try...

This thing lights up ground and objects kilo meters away, yet under water it only really works for 100 meteres or something. It works the same, it's just visibility under water is limited even with incredible light for some reason.

private _reflector = createVehicleLocal [ "#lightreflector", [0,0,0], [], 0, "CAN_COLLIDE" ];
_reflector attachTo [ player, [0.0, 0.15, 0.15], "Head", true ];
_reflector setLightColor [1, 1, 1];
_reflector setLightAmbient [1, 1, 1];
_reflector setLightIntensity 5000;
_reflector setLightConePars [60, 10, 1];
_reflector setLightDayLight true;
_reflector setLightVolumeShape ["a3\data_f\VolumeLightFlashlight.p3d", [1, 1, 1]];
_reflector setLightAttenuation [6, 0, 0, 4.31918e-005];
_reflector setVectorDirAndUp [ [-0.35,1,0.2],[0,0,1] ];

reflector = _reflector;
pallid palm
#

wow Awsome m8 holy

hushed turtle
#

Can see using camera from sky that entire terrain under water is lit, but once under water visiblity is limited regardless

pallid palm
#

copy that thx m8

hushed turtle
#

In fact can see water being lit from above, ground only if close enough

pallid palm
#

i see: Awsome stuff

#

man you are really on that good wow

#

that really looks like it will work Awsome m8

#

thx so much

idle violet
#

Does anyone know why my addon builder packages an empty PBO? I've been having this problem for about 5 days; it returns a message saying it was packaged, but when I open the PBO it's empty, only containing a "config.bin" file.

granite sky
#

What are you packaging?

#

Addon builder by default won't copy in many file types.

#

Including SQF, amusingly.

idle violet
#

This is a sound mod for my Altislife server and another for configurations.

granite sky
#

Well, you see in options there's "list of files to copy directly"...

#

If a file isn't in that list and isn't something that gets binarized then it won't be included in the addon.

#

I don't know what gets binarized aside from config.cpp.

pallid palm
#

of corse it all should be in the same folder right or

granite sky
#

Subfolders should work.

#

I forget what happens if you untick binarize.

#

Maybe then it still automatically includes files that would have been binarized.

drowsy geyser
pallid palm
#

ok cool i'll look into that thx

hushed turtle
#

I doubt that, it's not light problem. Visibility under water is limited artificially

#

It's like a fog

pallid palm
#

lol fog of war lol

still forum
#

@tough abyss Whats it about?

silent comet
#

I made a trigger for a MP Mission to create a few interactions for some objects when a player reaches a town, and it works mostly fine on a local server, but when I tested it on the actual server, it create the interactions twice. Anyone has any ideas why? I keep getting my wires crossed with the whole local vs global execution

Trigger has an any player present condition:

["scripts\investigationStart.sqf"] remoteExec ["execVM"];

The Sqf uses BIS_fnc_holdActionAdd to create the interactions

[ // Crashed Helo
    objWreck,                                                            
    "Recover Black Box",                                                
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",
    "_this distance _target < 10",
    "_caller distance _target < 10",
    {},                                                                
    {},
    {
        taskGasCounter = taskGasCounter + 1;
        publicVariable "taskGasCounter";
        ["Intel added!"] remoteExec ["hint"];
        [
            "task1",
            [
              "Search the town for survivors and clues to what happened.",
              format ["Investigate GRIMM: %1/4", taskGasCounter],
              "mkrGrimm"
            ]
        ] remoteExec ["BIS_fnc_taskSetDescription"];
        [
            player,
            [
                "intelGrimm",
                [
                  "Black Box",
                  "The helicopter was shot down from an unknown location. The crew didn't survive the landing."
                ]
            ]
        ] remoteExec ["createDiaryRecord", 0];
        if (taskGasCounter >= 4) then { ["scripts\investigationEnd.sqf"] remoteExec ["execVM"]; }
    },
    {},
    [],
    10,
    300,
    true,
    false
] call BIS_fnc_holdActionAdd;
#

It only duplicated the interaction on the object when I wasn't the host

sharp grotto
#

right now you globally execute that on every machine including the server
guess that's the reason (without seeing the rest of the code).

silent comet
#

Got it, I'll try it, thanks

proven osprey
#

Good evening. Got what may be an easy question. I'm working on a course of fire with pop up targets, but I'm having trouble getting a script or code together that reads all my targets are down and changes the state of my task to succeeded.

hushed turtle
#

nearestObjects?

proven osprey
#

I have the targets in an array, so how do I get a trigger or task to read them in their down animation? Or would I need to set the down animation as a variable and use getVariable?

fair drum
#

you can check animationState if they are animations

#

use findIf for your poll

proven osprey
#

Not quite sure how to utilize them. I understand how to use the animateSource ["terc", 1] to get the popup targets to lay down as soon as I jump into mission from the editor. Does animationState work as returning the value of the state the targets are currently in?

warm hedge
#

That can do it

haughty hare
#

is it possible to pre-made path for ai helicopter, so it would copy the things that player did before 1:1?
i mean like imagine: you "write" smhw all your button pushes, so the bot heli pilot would copy moves from file in the scenario, just which u did while "writing"

hallow mortar
haughty hare
#

thanks, ill try

proven osprey
#

Here is what I am trying out, but it keeps kicking a generic error at _state == 1

#

missionNamespace setVariable ["noPop", true];
private _target = [target1];

_state = animationState target1;
waitUntil {_target findIf {_state == 1}}; {titleText ["Succeeded", "PLAIN"]};

#

I'm using a single target to start small, but want the array to be able to expand if needed and the title text as a place holder for setTaskState

stable dune
#

animationState
Returns the name of a unit's current primary animation.
-> Return Value:String
And find if -> code: Code - code defining an element to find, processed element can be referenced within the code as _x
And you can check waituntil it find unit from array of units with correct animation state.
It returns -1 if nothing is found.
What you want get from unit? correct animation? or something else?
@proven osprey ☝️ πŸ‘‡

#

if you want check xx units state is xx state ,

private _units =  [target1, target2,target3];
private _animationState = "amovpercmstpsraswrfldnon"; //just for example from wiki
waitUntil {sleep 1; _units findIf {animationState _x == _animationState} != -1;}
titleText ["Succeeded", "PLAIN"];
proven osprey
#

I need to get the correct animation, which for the popup targets is "terc" 1. the laying down position after getting hit

granite sky
#

animationPhase?

#

or animationSourcePhase. I don't know the difference.

proven osprey
#

@stable dune Thanks, ill play around with that and see what happens, but probably wont get back to it till much later.

little raptor
astral bone
#

2 things. Can I get metadata of sounds, and 2, selectRandom would select ANYTHING in the array, right?
playSound3D [getMissionPath (selectRandom _RCHT_Christmas_Music),(missionNamespace getVariable _this)];

hushed turtle
#
  1. Yes
tulip ridge
#

I.e. just what are you trying to get

#

Also are you prefixing a local variable for some reason?

astral bone
#

was curious for potentially displaying song names. Wondered if I could get it from the file's metadata x3
And- what about a local variable?

hushed turtle
#

You can read them from CfgMusic

#

Nothing wrong with local variable. It's just rare to see them prefixed. Global variables should be prefixed by TAG, but there is no need to do that with local ones.

warm ore
#

Could anyone write me a simple script that would place a line of explosives (maybe satchel charges as example) from 40m to 200m in front of a player-controlled vehicle?
Either all detonated together by player useraction, or set-off immediately as they are spawned/placed.
VEH --- 40m --- EXP - 20m - EXP - 20m - EXP - 20m - EXP .... to 200m

granite sky
#

40m in front of vehicle on the ground is just _vehicle getPos [40, direction _vehicle]

warm ore
#

Forgot to mention, it needs to work in MP. I'm just horrible at scripting, so don't want to put it together myself. πŸ˜‰

meager granite
#

satchel class: SatchelCharge_Remote_Ammo

warm ore
meager granite
#

_unit addOwnedMine _bomb; => triggerAmmo _bomb; for instant explosion

#

_unit addOwnedMine _bomb; => _bomb spawn {sleep 5; triggerAmmo _this}; for delayed for 5 seconds

warm ore
granite sky
#

Hmm, I wonder what the locality of addOwnedMine is

#

I guess only one unit can own each mine, so it might be GA/GE.

errant jasper
#

I would infer server-only? Pretty sure the game only network updates entities based on type and distance, so a player-local client that has moved away might not even have accurate enough entity info to ensure triggering. Then again there is nothing that says the server can't trigger the mine directly even if not local.

split ruin
#

I am trying to spawn camo net over vehicle, everything ok but its 1 meter above the ground. How to make it to touch the ground ?

private _rveh = selectRandom 
[
  "I_Truck_02_ammo_F",
  "I_Truck_02_fuel_F",
  "I_Truck_02_medical_F",
  "I_Truck_02_box_F"
];
private _obj = createVehicle [_rveh, uberPos, [], 40, "NONE"];
private _camo = createVehicle ["CamoNet_INDP_big_F", _obj, [], 0, "CAN_COLLIDE"];
hushed turtle
#

To count position one meter downwards:

getPosATL _obj vectorAdd [0,0,-1]
#

I don't understand why it's one meter above the ground though. It supposed to get spawned by default on the ground, if height above ground is zero.

split ruin
#

yeah, but probably it spawns at the level of the model center of the vehicles ... 🀷

hushed turtle
#

It's supposed to use PositionAGL, when you provide object as position

granite sky
#

"NONE" tends to spawn vehicles slightly above the ground IIRC.

#

So then when you create the camo net using that position it's also above ground.

split ruin
#

the camo net is above the ground, not the vehicle

granite sky
#

Yes, but the vehicle was at that point.

hushed turtle
#

Vehicle is physically accelerated and falls on the ground

granite sky
#

You're creating the camo net where the vehicle spawned, not where it ends up.

hushed turtle
#

Then it would place camo net correctly if he just set height to 0 above ground

granite sky
#

If you have a hardcoded position then it'd make sense to just use that for both objects with CAN_COLLIDE.

split ruin
#

maybe if place the camo net then the vehicle ?

granite sky
#

Assuming that the position has Z=0.

split ruin
#

position is not hard coded

granite sky
#

What's it from?

split ruin
#

its everywhere but in players base

uberPos = [KIB_centerMapPos, 0, 4000, 0, 0, 0.3, 0, ["player_base"], []] call BIS_fnc_findSafePos;
granite sky
#

No nearest-object checking so I guess you do need to use NONE on the vehicle.

#

Could just wait for the thing to drop and then place the camo net.

crude barn
#

Anyone know how to make flyInHeight work for values >10 meters?

granite sky
#

I thought it was low values that were broken.

crude barn
#

Anything greater than 10 and the heli hovers up to like 50

granite sky
#

Oh, you mean <50

crude barn
#

Yeah

hushed turtle
#

That's Arma Ai πŸ€–

split ruin
thin fox
tepid trail
#

y'all

#

the tripod mod is back into business

thin pine
#

@queen cargo Besides using commands like doStop - you could try setting the AI group to Danger mode - this will break the AI's will to maintain formation, but you have the obvious downsides of them going prone, etc. I guess maybe you can combine that with the 1.56 (near future) disableAI "COVER" feature....but this would be a long shot tbh

fair drum
#

tripod mod + bulge mod? thonk

queen cargo
#

doing both already @thin pine ... sadly .. the result still is not looking promising

thin pine
#

Care to share what your need for it is? πŸ˜›

queen cargo
#

compiled sources are not available yet

#

but i could provide it

#

((updated just now))

thin pine
#

I was more on about like....English wise. My C knowledge is in rookie stage and reading all this source code to find out what the goal is would take forever, haha πŸ˜›

#

Naw I was more like - are you trying to make AIs breach buildings separately or something? Like why do you need them to break formation I wonder

queen cargo
#

that what you see there is basically the source of an Insurgency like mission
--> AI spawns dynamically in buildings and is supposed to either stay there or seek for the player

#

when they are trying to maintain formation ... then they always try to re-formate

#

causing em to move out and clunch up ...

thin pine
#

If AIs are in buildings and they have the doStop order - they won't regroup into formation AS long as the leader's behaviour is COMBAT

#

and I'm assuming that ain't working?

queen cargo
#

its more that they stay stationary ...

#

all the time

#

never seeking for the player

#

even if they know his position

thin pine
#

doMove ain't working huh?

queen cargo
#

would work

#

but it would require me to have specific AI behaviour ocmpletly scripted into

#

which is not intentional

thin pine
#

Oh like that, I get it. You're trying to invoke the default AI behaviour

queen cargo
#

exactly

#

but on a perUnit base

thin pine
#

A question; are they entirely stationary? e.g. not even moving to cover?

queen cargo
#

yup

pallid palm
thin pine
#

how about; after they detect danger, make the unit doMove to his own position and then make sure he's in combat mode (if not already)

#

according to doMove wiki; After reaching his destination, the unit will immediately return to formation (if in a group);

#

That may break the 'doStop' order

#

But it'll be difficult to achieve what you want if you're not separating the groups...goodluck though πŸ˜› - that is, if my suggestion doesn't work

split ruin
#

@thin fox works perfectly, thank you 🍻

dry lava
#

does anyone know how to place more than 250+ units?

crude barn
#

β€œ- when altitude is greater or equal 10, collision avoidance will maintain priority and the rotary airframe stays around 20~35 meters ATL, depending on nearby objects.

  • when altitude is lower then 10, for example, 9.99999, it seems that collision avoidance is disabled and the airframe will maintain the desired ATL.”
oblique bolt
#

What exactly is wrong in this script because I can not understand what the ingame warning is pointing at

`_triggerActivated = _this select 0;
if !(player in (list _triggerActivated)) then
{
exitWith {};
};
playSoundWarning = true;

sleep 7;
if (player in (list _triggerActivated)) then
{
player setDamage 1:
};`

It tells me it's at line 4, "Error Missing ;"

#

even though I already have that after my exitWith and the if statement

proven charm
#

exitWith requires the if condition on the left

errant jasper
carmine sand
oblique bolt
#

oh damn, thank you

pallid palm
#

what did you want: for the chopper to achieve:

#

i have not seen any bug with a chopper in all my years

#

if you can tell me exactly what you want the chopper to Do: then i can help you m8

#

the only thing i'v seen is if you get to low: the Gear wants to come out like your landing

#

so in that case i use the Humming bird: cuz there's no gear on that chopper

tender fossil
gray raptor
#

okay, im trying to make a script where a unit when it takes damage and rather than it taking damage it is subtracted from a seperate variable pool. It's gonna be in the innit of the unit, which might also be a player, so what Im trying to do is this so far
this createVariable ["VamHealthStat", 100]; this addEventHandler ["HandleDamage" , { params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitPoint", "_instigator"]; createVariable ["VamHealthPre", VamHealthStat]; VamHealthStat = VamHealthStat - _damage; if (VamHealthStatPre > 0) then { setDamage this 0; VamHealthStat = VamHealthStatPre; } else { this sideChat "I can't take any more...";} }]
I can tell Im messing something up here but I can't see what

#

my head hurts

#

It's saying Im missing a ; but ik there's something else Im missing

sly cape
#

!sqf

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
tulip ridge
#

I smell Chat GPT

foggy stratus
#

setDamage this 0; should be _unit setDamage 0;

gray raptor
#

Im partly stealing my code from another script

#

Wait it's set variable isn't it.

tulip ridge
#

Yes

sly cape
#

I think you don't even need it at all here.

gray raptor
#

What should I be doin instead?

tulip ridge
gray raptor
#

Yeah, so I can call on it for some other stuff, like the message I stuck in to make them aware of losing that extra health.

#

I am trying to some extent to replecate the "Tachanka" and "juggernaut" compositions, but only what I actually need from it.

#

and also, making it myself.

sly cape
gray raptor
#
this addEventHandler ["HandleDamage" , {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitPoint", "_instigator"];
    setVariable ["VamHealthPre", VamHealthStat];
    VamHealthStat = VamHealthStat - _damage;
    if (VamHealthStatPre > 0) then {
        setDamage this 0;
        VamHealthStat = VamHealthStatPre};
    else {
        this sideChat "I can't take any more...";}
}]```
This is what I have after fixing the set variable
tulip ridge
#

That second setVariable is still wrong

#

And should also be a getVariable

granite sky
#

VamHealthStat and VamHealthStatPre are never defined either.

#

If they're supposed to be per-vehicle vars then you'd need to read them with getVariable each time the EH runs.

gray raptor
#

Yeah that was the goal, but idk what I need to put to define them, I thought that's what setVariable did

granite sky
#

It does but you never read the value.

tulip ridge
#

You want something like:

private _health = _unit getVariable ["VamHealthStat", 100];
_health = _health - _damage;
if (_health > 0) then {
  _unit setDamage 0;
  _unit setVariable ["VamHealthStat", _health];
} else {
  _unit sideChat "I can't take any more...";
};
granite sky
#

Healh typo in line 1

gray raptor
hushed turtle
#

Is this EH for person or vehicle?

gray raptor
tulip ridge
#

Also it looks like you're just putting this in a unit's init box, you want a if (!local this) exitWith {}; check before you do anything so it only is added where the unit is local and not once per machine

granite sky
#

HandleDamage doesn't run on non-local anyway though.

tulip ridge
#

True, but good habit

hushed turtle
granite sky
#

What's the actual intention here? Generally you want to return something in a HandleDamage, otherwise you get some undefined behaviour.

gray raptor
#

would the dammage EH be better?

granite sky
#

Depends if you want to intercept the effects or add something on top.

#

HandleDamage you need to use if you want to block default damage responses.

gray raptor
granite sky
#

Return 0 then, probably.

#

This is supposed to make a unit very tough?

gray raptor
#

what I was attempting to do is when damge is sustained, remove that damage from the health stat, then reset the damage state to 0 until said health stat is 0 then damage is done normally.

gray raptor
hushed turtle
#

Then return 0 until your var reaches 0

#

Note that unit will be immune to any sort of damage, so no injured body parts

gray raptor
gray raptor
#

otherwise I was going to divide the damage down alot, but that still caused damaged limbs.

hushed turtle
#

Also returning 0 sets units damage/damage of part to 0, so you can even heal the unit using this EH, which is about damage πŸ˜†

granite sky
#

Ok, so adjustment of Dart's code:

params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitPoint", "_instigator"];
private _health = _unit getVariable ["VamHealthStat", 100];
_health = _health - _damage;
if (_health > 0) then {
  _unit setVariable ["VamHealthStat", _health];
} else {
  _unit removeEventHandler [_thisEvent, _thisEventHandler];
  _unit sideChat "I can't take any more...";
};
0;
#

I assume you only want to print the chat once.

gray raptor
#

Yeah

#

Theoretically if they're at that point one or two shots is just gonna kill em as they're down to normal health.

#

so it might not matter as much

granite sky
#

You might want to only reduce health if _selection == "" (general damage). Probably works ok either way just with different numbers.

#

It's still Arma-calculated damage not base weapon damage so it'll be affected by armour and location.

#

Other route is that you work from the projectile type.

gray raptor
#

so private _health is setting a variable of _health to 100, but atp what is the point of the name part of the getVariable? Is that extra or am I missing something.

granite sky
#

The EH doesn't have direct access to your variable.

#

You have to read it from the unit, do the calculation on it and then write it back.

#

_health is just a temporary variable where we do the calculation.

#

_unit getVariable ["VamHealthStat", 100]; returns the variable from the unit if it exists, and 100 if it doesn't.

gray raptor
#

ahhh okay, so in the EH _health is a temporary variable, VamHealthStat is the variable outside of the EH?

granite sky
#

So you don't need to set the variable before the loop.

gray raptor
#

Okay I see what you're saying I think

granite sky
#

Variables set on objects are persistent. They don't go out of scope and get deleted like local variables.

gray raptor
#

_health is set to VamHealthStat, or 100 if VamHealthStat is not yet defined, then used for calculating in the EH, then VamHealthStat is updated to what _health is for following use

granite sky
#

yes

#

You could use a global variable instead and then the code would be simpler, but that's pretty nasty and wouldn't extend well to multiple units.

gray raptor
#

Rn Im just setting it in the units init but.

hushed turtle
#

No issues, other than healing the unit

#

Since it returns zero

granite sky
#

As written you'd want to add the event handler to add the effect.

#

If it's something that's supposed to recharge then you'd want to tweak things a bit.

gray raptor
hushed turtle
#

From anywhere

gray raptor
granite sky
#

Other inits can technically access other units.

#

You'd just need a way of referencing the unit that wasn't this

hushed turtle
#

It is per unit, but as long as you have any variable referencing the unit, you can then use it with getVariable/setVariable

gray raptor
granite sky
#

That code is logically a one-shot though. It adds the EH to create the shield and removes the EH when it returns to zero. Changing the value of VamHealthStat won't have an effect if the EH isn't running.

hushed turtle
#

So in init you could do TAG_myUnit = this; and then you can use TAG_myUnit anywhere. For example

gray raptor
#

I see.

hushed turtle
gray raptor
hushed turtle
#

Either the code needs to change, so EH does nothing when VamHealthStat is zero, but EH stays. Or add the EH again

dark viper
#

does GetVariable work for private unit variables? I thought it was a HashMapObject thing

granite sky
#

...what

hushed turtle
#

Global, local, private doesn't matter

dark viper
gray raptor
granite sky
#

getVariable dates back to ancient Arma.

#

Not sure which one. I haven't been around for that long :P

hushed turtle
#

ancient πŸ˜†

#

I play Arma since OFP, still have my campaing saves from 2010 🀣

gray raptor
hushed turtle
granite sky
gray raptor
#

Maybe I should get some other more basic scripts under my belt before tackling this lol.

dark viper
hushed turtle
hushed turtle
#
_number = 0;
if (true) then
{
  private _number = 100; // new _number var is declared for this scope and it does not overwrite one from parent scope
};

This all private does int SQF

gray raptor
hushed turtle
#

Not returning anytihng may lead to weird behaviour

gray raptor
#

that would be alot lighter weight.

gray raptor
#

Im probably not but still

hushed turtle
dark viper
#

I know about scope, the thing is GetVariable on wiki and no where else suggests you can get private variable from a different script

hushed turtle
#

private var is local var

gray raptor
hushed turtle
#

You can't access local var from different script

dark viper
#

then why use _unit GetVariable?

gray raptor
hushed turtle
#

Do you have any other reference to _unit other than _unit?

dark viper
#

There's my point, you have a reference to object, sounds like OOP to me

hushed turtle
#

Object in this case is person, it's not object in context of OOP

granite sky
#

Have you ever written an OOP language? :P

hushed turtle
#

You can't create classes in this language

dark viper
#

object in this case is just another script

granite sky
#

You can't setVariable on a code object.

dark viper
granite sky
#

object here is an object.

#

Like an actual thing in Arma 3.

gray raptor
#

as in the litteral thing right

gray raptor
dark viper
#

It's highly implied that you private variables are only local to the script in the Wiki, then you go on discord and somebody just tell you to get an object reference and call GetVariable on it

granite sky
#

Now there are things called "logic objects" that exist largely to do setVariable/getVariable on without having too much overhead, but they're still things.

dark viper
#

You must admit it's pretty jarring

hushed turtle
#

Stuff like tress, houses, vehicles, people are all objects. We can assing variables to them using setVariable and read them using getVarible. But these variables are all public. Really they are just global variables, available only in certain namespace(object's namespace)

gray raptor
#

It might be the same sounds, but it's not the same thing, it's a different language.

#

It's only jarring because that word already means something for you.

granite sky
#

Arma documentation overloads a lot of words even within Arma. Like "global" for both network-global and namespace-global.

gray raptor
#

Probably just a me thing but still.

granite sky
#

This sort of linguistic conflict is never really addressed. You just gotta read enough shit to figure it out for yourself.

hushed turtle
#

I'm quite happy to see we're getting something much better new Arma titles

gray raptor
hushed turtle
#

Things are gonna improve and Reforger is just tech demo for it. Before Arma 4 comes out

gray raptor
granite sky
#

I'd rather we could do a bit less but it all works.

#

but what's probably gonna happen is less stuff that still doesn't work :P

gray raptor
dark viper
#

So is there a difference between
private _myVar = "blah";
this SetVariable("myVar", "blah", false);

granite sky
#

tbf Arma 3 was super thin on modifiable character stats.

gray raptor
#

_myVar would be temporary right?

granite sky
#

Like we wanted to do more with roles in Antistasi but there just isn't much there.

hushed turtle
granite sky
#

Also your setVariable syntax is wrong, needs [] not () on the right-hand params.

dark viper
#

so it will die after init? setVariable is the proper way to couple data with object?

granite sky
#

yeah, as soon as that code scope ends, the variables disappear into the void.

gray raptor
# granite sky Like we wanted to do more with roles in Antistasi but there just isn't much ther...

the goal was originally to have a layer over top when I had soemone helping me, create a character with stats, roll dice, and other things, then build off that. Essentially it would have been two forms of combat where in normal gameplay you had abilities and other things, and in "scene" it was a more traditional kind TTRPG style. It actually was working too, but then he just disappeared.

#

rather than forcing more in, it was connecting two layers where we could, what little we had done people ate up.

dark viper
#

You can see my confusion, I thought there was no way to couple data with objects without using a HashMapObject

granite sky
#

Now myVar = "blah"; will persist, but it's unrelated to the object. It's equivalent to missionNamespace setVariable ["myVar", "blah", false];

hushed turtle
granite sky
#

HashMapObjects are just a language thing. They're not directly related to real A3 objects either.

dark viper
#

I wish Variables section on wiki mentions GetVariable and SetVariable but it does not

granite sky
#

More like a chunk of data+code that you're passing around.

hushed turtle
#

I some older code I still have array of hashmaps with groups and some related variables. Had no idea I could add these vars directly do the groups πŸ˜†

modern plank
#

Small one: you have a _bigArray that contains 5 elements. You want a _smallArray that contains only the Nth first elements of _bigArray (let's say the 3 first ones). How to do it short&clean?

granite sky
#

select

#

_smallArray = _bigArray select [0,3];

modern plank
#

thanks, I forgot this select form.

granite sky
#

There are a lot of them :P

modern plank
#

true.

hushed turtle
#

I was about to suggest to hard copy the array and then resize, but select is most likely better πŸ˜€

#

Well yes, you can do substring exactly the same way... who would have thought, that select can do substrings

modern plank
#

yeah, sometimes you remember the function for one or two convenient use-cases, but forget about the ones you don't use very often.

pallid palm
#

oh good at least some other people forget: just like me: thx m8 πŸ™‚

radiant lark
#

I've met little to no people that know how to script in SQF without looking at wiki / google

#

The most remarkable guy is an Ukranian guy named Demellion, he is out of Arma but the guy was brilliant, his Arma 3 playtime is around 18000 hours

radiant lark
sly cape
radiant lark
cyan dust
#

Good day. Is there a way to delete custom player waypoint via script? πŸ€”
The one created by 'shift+LMB' on the map

silk cipher
#

can someone help me download KP liberation

hallow mortar
cyan dust
charred monolith
#

Greetings.

I've been trying to do a Zero Gravity Script.

I've achieved to move the player in space relative to it's ModelSpace, I also have momentum, to imitate a vacum.
But I have a problem, because I use setVelocityModelSpace, when the player move the camera, the velocity with it.
Honestly I don't know how to resolve this.

I still wish to take into account the players view to move the player relative to it's view. But when the player doesn't increase it's velocity, I just want it to continue regardless of the players orientation.

There is the code :

player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
    params ["_args"];
    _args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
    private _delta = cba_missionTime - _lastRun;    
    private _velocityUnit = _unit getVariable ["ar_velocity",[0,0,0]];
    _velocityUnit params ["_vX","_vY","_vZ"];
    private _unitMass = getMass _unit;
        
    if(inputAction "TurnRight" > 0 )then{_vX = _vX + 5 * _delta};
    if(inputAction "TurnLeft" > 0)then{_vX = _vX - 5 * _delta};
    if(inputAction "MoveForward" > 0)then{_vY = _vY + 5 * _delta};
    if(inputAction "MoveBack" > 0 )then{_vY = _vY - 5 * _delta};
    if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
    if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};
    
    private _force = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
    systemChat str _force;
    _unit setVelocityModelSpace _force;
    _unit playMove "asdvpercmstpsnonwrfldnon";
    _unit setVariable ["ar_velocity",[_vX,_vY,_vZ],true];
    _args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;

There is a shortclip of the issue (I can't post directly on discord, the file is too big)
https://www.youtube.com/watch?v=1tt4b7MVkuk

charred monolith
#

I've used setVelocity, the problem with it is that it only moving on the x and y axis not relative to the player. If I go left while i'm facing south for exemple. Then from my perspective I will go right

tender fossil
tender fossil
charred monolith
#

Yup that's where i'm stuck.

tender fossil
#

Or actually I think there are commands for the conversion

charred monolith
#

aaahhh i thought that was it. Sadly vectorModelToWorldVisual do the exact same things as setVelocityModelSpace. I think I'll have to learn Vector Math again....

tender fossil
#

(If I got it right but it's something like that anyways) πŸ˜‚

charred monolith
#

So I need to redo my Calculation to make it relative to the player.

tender fossil
charred monolith
#

Because if I understand my own code It's doing it relative to the world no ?

tender fossil
#

(Kinda what the name of the command implies) πŸ˜…

#
player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
    params ["_args"];
    _args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
    private _delta = cba_missionTime - _lastRun;    
    private _velocityUnit = _unit getVariable ["ar_velocity",[0,0,0]];
    _velocityUnit params ["_vX","_vY","_vZ"];
    private _unitMass = getMass _unit;
        
    if(inputAction "TurnRight" > 0 )then{_vX = _vX + 5 * _delta};
    if(inputAction "TurnLeft" > 0)then{_vX = _vX - 5 * _delta};
    if(inputAction "MoveForward" > 0)then{_vY = _vY + 5 * _delta};
    if(inputAction "MoveBack" > 0 )then{_vY = _vY - 5 * _delta};
    if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
    if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};
    
    private _force = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
    systemChat str _force;
    _force = vectorModelToWorldVisual _force;
    _unit setVelocity _force;
    _unit playMove "asdvpercmstpsnonwrfldnon";
    _unit setVariable ["ar_velocity",[_vX,_vY,_vZ],true];
    _args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;
``` Try this
charred monolith
#

I've tried this. it's exactly what setVelocityModelSpace is doing. I think it use vectorModelToWorldVisual under the hood.

tender fossil
#

Did you use vectorModelToWorldVisual or vectorWorldToModelVisual? (Just to make sure)

charred monolith
#

vectorModelToWorldVisual

#

If i use vectorWorldToModelVisual with setVelocity it inverts it by 90Β°. That's funny xD

tender fossil
#

I wonder why it takes the camera rotation into account when there's nothing about it in the script

#

Actually wait

charred monolith
#

I think it's something like this that happens. (Sorry for the really bad drawing)

#

The problem is that it does't take into account the orientation of the player so when I press W to go forward, it goes forward on the Y Axis (The red one) while I look at the east of the map)

#

What if I calculate a vector relative to the player but add it to a vector relative to the world ?

tender fossil
#

Actually, you could start with the initial value of [0, 0, 0] and then do the calculations with delta from that value. So e.g. if character has turned 45Β° to the right from the starting value, you calculate the delta between that and the starting value, and then apply the force... I think? (Should open editor to test these πŸ˜„ )

tender fossil
#

So keep the final vector value in world space the same when player is not applying any force. For this you need to calculate the "delta" between camera/model space and world space on every frame

charred monolith
#

or maybe I can do that the "bad way" get the angle of the player and change the signs of the calculation depending on the angle. It's going to be a big code and a bit dirty to do that, but could work.

tender fossil
#

As a rule of thumb, the world space vector should change only when player applies a force

charred monolith
#

I think I get what you are saying. The thing is, how could this be done ? i'll have to calculate the force in each condition.

dark viper
#

what's the problem with vectoModelToWorldVisual?

#

oh is it cause velocity is kept from all the inputs?

#

so you do arcs with the character movement

tender fossil
#
player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
    params ["_args"];
    _args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
    private _delta = cba_missionTime - _lastRun;    
    private _velocityUnit = _unit getVariable ["ar_velocity",[0,0,0]];
    _velocityUnit params ["_vX","_vY","_vZ"];
    private _unitMass = getMass _unit;
        
    if(inputAction "TurnRight" > 0 )then{_vX = _vX + 5 * _delta};
    if(inputAction "TurnLeft" > 0)then{_vX = _vX - 5 * _delta};
    if(inputAction "MoveForward" > 0)then{_vY = _vY + 5 * _delta};
    if(inputAction "MoveBack" > 0 )then{_vY = _vY - 5 * _delta};
    if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
    if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};
    
    private _force = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
    systemChat str _force;
    _force = vectorModelToWorldVisual _force;
    _unit setVelocity _force;
    _unit playMove "asdvpercmstpsnonwrfldnon";
    _unit setVariable ["ar_velocity",[_vX,_vY,_vZ],true];
    _args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;

Did you try this?

charred monolith
tender fossil
#

Ok, just wanted to make sure πŸ˜›

charred monolith
# dark viper so you do arcs with the character movement

Lets say I look north and go forward.
I have a velocity that's positive (relative to me and the world, because I look north)
But the second I look south my velocity is inversed (Without changing the velocity) now I go forward but south. Because relative to the player the velocity hasn't changed

#

If I go at a velocity of 10m/s
If I look north, relative to the world I go [0,10,0]
If I look south, relative to the world I go [0,-10,0]
While relative to the player I always go [0,10,0] whatever the orientation
Just by looking in a different direction the velocity relative to the world changes.

dark viper
#

you should be converting the vector delta's to visual world space and adding them instead of converting _force back to world visual space every frame, velocity should not be converted in frames and stay in world space

charred monolith
#

I don't think I understand. I shouldn't convert in the PerFrameHandler ?

dark viper
#

_force = vectorModelToWorldVisual _force;
_unit setVelocity _force;
This is a problem in the loop, you are transforming your velocity on every frame back into camera space

#
 if(inputAction "TurnRight" > 0 )then{_vX = _vX + 5 * _delta};
    if(inputAction "TurnLeft" > 0)then{_vX = _vX - 5 * _delta};
    if(inputAction "MoveForward" > 0)then{_vY = _vY + 5 * _delta};
    if(inputAction "MoveBack" > 0 )then{_vY = _vY - 5 * _delta};
    if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
    if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};

You want to convert the vector additions here to visual world space, instead of transforming the entirety of _force

tender fossil
#

Ah, yes! Would've taken some time for me to figure it out πŸ˜‚

dark viper
#

you can continue setVelocity _force but do not do any transforms on it, it stays completely in world space the entire time inherently

#
player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
    params ["_args"];
    _args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
    private _delta = cba_missionTime - _lastRun;    
    private _velocityUnit = _unit getVariable ["ar_velocity",[0,0,0]];
    _velocityUnit params ["_vX","_vY","_vZ"];
    private _unitMass = getMass _unit;
    private _xDir = [1, 0, 0];
    private _yDir = [0, 1, 0];
    private _zDir = [0, 0, 1];
    if(inputAction "TurnRight" > 0 )then{_vX = _vX + (5 * _delta * _xDir)};
    if(inputAction "TurnLeft" > 0)then{_vX = _vX - (5 * _delta * _xDir)};
    if(inputAction "MoveForward" > 0)then{_vY = _vY + (5 * _delta * _yDir)};
    if(inputAction "MoveBack" > 0 )then{_vY = _vY - (5 * _delta * _yDir)};
    if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + (5 * _delta * _zDir)};
    if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - (5 * _delta * _zDir)};
    
    private _force = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
    // all additions on force are already in world space
    systemChat str _force;
   // _force = vectorModelToWorldVisual _force; removed, never transform
    _unit setVelocity _force;
    _unit playMove "asdvpercmstpsnonwrfldnon";
    _unit setVariable ["ar_velocity",[_vX,_vY,_vZ],true];
    _args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;
#

not correct yet need visual space

charred monolith
#

_delta in this context is the deltaTime.

#

I think my lack of understanding comes from that. Because for me the delta was the deltaTime and not a difference between vector.

dark viper
#

We need the visual transform for the increment, but I have confused myself atm

tender fossil
#

@dark viper Would this work too?

player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
  params ["_args"];
  _args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
  private _delta = cba_missionTime - _lastRun;    
  private _velocityUnitDelta = [0, 0, 0];
  _velocityUnitDelta params ["_vX","_vY","_vZ"];
  private _unitMass = getMass _unit;

  if(inputAction "TurnRight" > 0 )then{_vX = _vX + 5 * _delta;};
  if(inputAction "TurnLeft" > 0)then{_vX = _vX - 5 * _delta};
  if(inputAction "MoveForward" > 0)then{_vY = _vY + 5 * _delta};
  if(inputAction "MoveBack" > 0 )then{_vY = _vY - 5 * _delta};
  if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
  if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};

  private _velocityDelta = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
  _transformedVelocityDelta = modelToWorld _velocityDelta;
  _oldVelocity = player getVariable ["ar_velocity"];
  _newVelocity = _oldVelocity vectoradd _transformedVelocityDelta;
  _unit setVelocity _newVelocity;
  systemChat str _force;
  _unit playMove "asdvpercmstpsnonwrfldnon";
  _unit setVariable ["ar_velocity",_newVelocity,true];
  _args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;
#

(Edited the script like 10 times, so test with the current version just to make sure) πŸ˜„

charred monolith
dark viper
#

I don't think it would work

#

you need to reset _vX, _vY, _vZ to 0 between frames if you want to add it like that

tender fossil
#

I'm doing that I think?

#

What does _delta = cba_missionTime - _lastRun; return (on average)?

dark viper
#

whatever the frametime is

tender fossil
#

Yeah but like the actual value

dark viper
#

private _velocityUnitDelta = [0, 0, 0];
_velocityUnitDelta params ["_vX","_vY","_vZ"];

vx, vy, vz stores the force and you load it into the delta every frame, so you actually add the force to itself 1/frametime times per second and it will be exponential

tender fossil
#

Don't they reset with the first line in your reply?

dark viper
#

Listen imma be honest I'm straight winging it in this chat right now I haven't actually coded much ARMA 3, but no, you init the variable to [0, 0, 0] but you load the vx vy vz that is saved in to it, so not really

charred monolith
#

Oh sorry it's not the same code I used, I do the [0,0,0] outside the frameHandler

dark viper
#

finally i realized why i am confused

#

we need vectorModelToWorldVisual

#

vectorModelToWorldVisual xDir // yDir // zDir

tender fossil
#
player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
  params ["_args"];
  _args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
  private _delta = cba_missionTime - _lastRun;    
  private _velocityUnitDelta = [0, 0, 0];
  private _vX = 0;
  private _vY = 0;
  private _vZ = 0;
  private _unitMass = getMass _unit;

  if(inputAction "TurnRight" > 0 )then{_vX = _vX + 5 * _delta;};
  if(inputAction "TurnLeft" > 0)then{_vX = _vX - 5 * _delta};
  if(inputAction "MoveForward" > 0)then{_vY = _vY + 5 * _delta};
  if(inputAction "MoveBack" > 0 )then{_vY = _vY - 5 * _delta};
  if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
  if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};

  private _velocityDelta = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
  _transformedVelocityDelta = vectorModelToWorld _velocityDelta;
  _oldVelocity = player getVariable ["ar_velocity"];
  _newVelocity = _oldVelocity vectoradd _transformedVelocityDelta;
  _unit setVelocity _newVelocity;
  systemChat str _force;
  _unit playMove "asdvpercmstpsnonwrfldnon";
  _unit setVariable ["ar_velocity",_newVelocity,true];
  _args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;

Better now?

dark viper
#
player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
    params ["_args"];
    _args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
    private _delta = cba_missionTime - _lastRun;    
    private _velocityUnit = _unit getVariable ["ar_velocity",[0,0,0]];
    _velocityUnit params ["_vX","_vY","_vZ"];
    private _unitMass = getMass _unit;

    private _forwardDir = getCameraViewDirection _unit;
    private _upDir = vectorUp _unit;
    private _rightDir = _forwardDir vectorCrossProduct _upDir;
    private _resultVec  = [0, 0, 0];
    private _speedScale = 5 * _delta;
    _resultVec = _resultVec + (inputAction "TurnRight") * _speedScale * _rightDir;
    _resultVec = _resultVec + -(inputAction "TurnLeft") * _speedScale * _rightDir;
    _resultVec = _resultVec + (inputAction "MoveForward") * _speedScale * _forwardDir;
    _resultVec = _resultVec + -(inputAction "MoveBackward") * _speedScale * _forwardDir;
    _resultVec = _resultVec + (inputAction "HeliCollectiveRaise") * _speedScale * _upDir;
    _resultVec = _resultVec + - (inputAction "HeliCollectiveLower") * _speedScale * _upDir;

    systemChat str _force;
    _unit setVelocity _resultVec + _unit velocity; //maybe
    _unit playMove "asdvpercmstpsnonwrfldnon";
    _unit setVariable ["ar_velocity", (_unit velocity),true];
    _args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;
tender fossil
dark viper
#

dunno what to give it, just whatever this object is should be fine right?

tender fossil
#

Just keep them as is (in the model space) and transform the resulting vector with vectorModelToWorld

dark viper
#

we definitely the player object or whatever's model space

#

this is standard

#

yeah _unit was being used originally

old owl
charred monolith
split ruin
#

BotSturmTruppen attack again? πŸ˜‚

tender fossil
#
player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
  params ["_args"];
  _args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
  private _delta = cba_missionTime - _lastRun;   
  private _velocityUnit = velocity player; 
  private _velocityUnitDelta = [0, 0, 0];
  private _vX = 0;
  private _vY = 0;
  private _vZ = 0;
  private _unitMass = getMass _unit;

  if(inputAction "TurnRight" > 0 )then{_vX = _vX + 5 * _delta;};
  if(inputAction "TurnLeft" > 0)then{_vX = _vX - 5 * _delta};
  if(inputAction "MoveForward" > 0)then{_vY = _vY + 5 * _delta};
  if(inputAction "MoveBack" > 0 )then{_vY = _vY - 5 * _delta};
  if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
  if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};

  _velocityUnitDelta = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
  _velocityUnit = _velocityUnit vectorAdd _velocityUnitDelta;
  _velocityUnitWorldSpace = // do the conversion here
  _unit setVelocity _velocityUnitWorldSpace;
  systemChat str _velocityUnitWorldSpace;
  _unit playMove "asdvpercmstpsnonwrfldnon";
  _unit setVariable ["ar_velocity",_velocityUnitWorldSpace,true];
  _args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;

Better now?

dark viper
charred monolith
dark viper
#

Like a mask is a decent way of thinking about it.

We need the orthonormal basis of the model, and each input is only responsible for 1 of the basis axis of movement

tender fossil
dark viper
#

saving everything in model space is convenient

dark viper
tender fossil
#

Yes, I'm trying to fix that but I haven't taken a course in linear algebra so I'm starting to get stuck here πŸ˜‚

dark viper
#

I had to come help you guys when you started talking about doing manual angle subtraction and additions to calculate the correct vectors

#

doing good for the world in ARMA discord

manic sigil
#

I have an array of various ground vehicles that can be loaded VIV, and a landing craft that can load vehicles.

I'm trying to parse down the list to vehicles that can, in this moment, be loaded.

Srd_Var_VehicleList select {(craftName canVehicleCargo _x) == [true,true]}

just throws a Type Array error.

charred monolith
#

Well I'll will take a look deeper a bit later in the day. I've been on this issues since this morning and I think I need a break xD.
Thanks to the both of you. Your help has been invaluable.

tender fossil
#
player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
  params ["_args"];
  _args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
  private _delta = cba_missionTime - _lastRun;   
  private _velocityUnit = velocity _unit; 
  private _velocityUnitDelta = [0, 0, 0];
  private _vX = 0;
  private _vY = 0;
  private _vZ = 0;
  private _unitMass = getMass _unit;

  if(inputAction "TurnRight" > 0 )then{_vX = _vX + 5 * _delta;};
  if(inputAction "TurnLeft" > 0)then{_vX = _vX - 5 * _delta};
  if(inputAction "MoveForward" > 0)then{_vY = _vY + 5 * _delta};
  if(inputAction "MoveBack" > 0 )then{_vY = _vY - 5 * _delta};
  if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
  if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};

  _velocityUnitDeltaModelSpace = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
  _velocityUnitModelSpace = // Convert _velocityUnit from world space to model space here (with matrix multiplication I think?)
  _velocityUnitModelSpace = _velocityUnitModelSpace + _velocityUnitDeltaModelSpace;
  _velocityUnit = // Convert _velocityUnitModelSpace to world space here (matrix multiplication as well here)
  _unit setVelocity _velocityUnit;
  systemChat str _velocityUnit;
  _unit playMove "asdvpercmstpsnonwrfldnon";
  _unit setVariable ["ar_velocity",_velocityUnitWorldSpace,true];
  _args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;

How about now πŸ˜„

warm hedge
manic sigil
#

Now I just need to figure out why the 'fill with troops' section is picking one type and sticking with it.

#

Go, my knoble headed army!

dark viper
#

_unit velocity is already in world space I think

tender fossil
# dark viper I think this one was closest, just change `private _velocityUnit = velocity _un...

Like this? ```sqf
player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
params ["_args"];
_args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
private _delta = cba_missionTime - _lastRun;
private _velocityUnit = velocity _unit;
private _velocityUnitDelta = [0, 0, 0];
private _vX = 0;
private _vY = 0;
private _vZ = 0;
private _unitMass = getMass _unit;

if(inputAction "TurnRight" > 0 )then{_vX = _vX + 5 * _delta;};
if(inputAction "TurnLeft" > 0)then{_vX = _vX - 5 * _delta};
if(inputAction "MoveForward" > 0)then{_vY = _vY + 5 * _delta};
if(inputAction "MoveBack" > 0 )then{_vY = _vY - 5 * _delta};
if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};

_velocityUnitDeltaModelSpace = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
_velocityUnitDeltaWorldSpace = _unit vectorModelToWorldVisual _velocityUnitDeltaModelSpace;
_velocityUnit = _velocityUnit vectorAdd _velocityUnitDeltaWorldSpace;
_unit setVelocity _velocityUnit;
systemChat str _velocityUnit;
_unit playMove "asdvpercmstpsnonwrfldnon";
_unit setVariable ["ar_velocity",_velocityUnitWorldSpace,true];
_args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;

#

It's almost working

dark viper
#

this would be like in total:

_velocityUnitDelta // model space
// [ 0, 0, 0] default, input adds axial value
// W is orientation in world space for the unit
// V is rotation matrix (orientation for camera)
// 
// transform would be  V * _velocityUnitDelta // ModelToWorldVisual
// or                   W * _velocityUnitDelta // ModelToWorld
//  over simplified because, _velocityUnitDelta starts as fresh orthonormal basis
// a single rotation can go to World or WorldVisual
// there would be concatenated inverses, depending on what's going on
// add one of
_unit SetVelocity _velocityUnit +  ( W * _velocityUnitDelta) // _unit ModelToWorldVisual
tender fossil
#

Got it working, only the anti-gravitation force is not correct

dark viper
#

if you mean the _vZ component, yes I know, I didn't know if the person wanted it to be world Z or camera Z

tender fossil
#

getMass _unit or getMass player returns 0

#

That's where the fault is πŸ˜…

dark viper
#

idk anything about the physics stuff of Arma

#
 if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 5 * _delta};
  if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};

I thought you mean this part though

#

The problem not doing the relative transform on the input vectors is that, you can't mix model / world /visual inputs now. They all go through the one transformation together

tender fossil
#

Only the gravity counter is bugging out, otherwise it works

#

The exact script is this: ```sqf
player setPosATL ([0,0,10] vectorAdd (getPosATL player));
player setVariable ["ar_velocity", [0,0,0], true];

[{
params ["_args"];
_args params ["_unit", "_lastRun","_velocityUnit","_accUnit"];
private _delta = cba_missionTime - _lastRun;
private _velocityUnit = velocity _unit;
private _velocityUnitDelta = [0, 0, 0];
private _vX = 0;
private _vY = 0;
private _vZ = 0;
private _unitMass = getMass _unit;

if(inputAction "TurnRight" > 0 )then{_vX = _vX + 20 * _delta;};
if(inputAction "TurnLeft" > 0)then{_vX = _vX - 20 * _delta};
if(inputAction "MoveForward" > 0)then{_vY = _vY + 20 * _delta};
if(inputAction "MoveBack" > 0 )then{_vY = _vY - 20 * _delta};
if(inputAction "HeliCollectiveRaise" > 0)then{_vZ = _vZ + 50 * _delta};
if(inputAction "HeliCollectiveLower" > 0 )then{_vZ = _vZ - 5 * _delta};

_velocityUnitDeltaModelSpace = [_vX, _vY, (_unitMass * _delta * 9.8) + _vZ];
_velocityUnitDeltaWorldSpace = _unit vectorModelToWorldVisual _velocityUnitDeltaModelSpace;
_velocityUnit = _velocityUnit vectorAdd _velocityUnitDeltaWorldSpace;
_unit setVelocity _velocityUnit;
systemChat str _velocityUnit;
_unit playMove "asdvpercmstpsnonwrfldnon";
_unit setVariable ["ar_velocity",_velocityUnitWorldSpace,true];
_args set [1, cba_missionTime];
}, 0, [player, cba_missionTime]] call CBA_fnc_addPerFrameHandler;
``` Indeed, getMass returns 0 and it makes the anti-gravity fail

dark viper
#

To add to misunderstanding, after research I believe ModelToWorldVisual is not related to the player camera transform

proven charm
#

does anyone know why radioChannelAdd fails sometimes at mission start? it seems if called too early it fails and I tried radioChannelInfo to check if the channel is created/ready but nothing useful there

#

my code looks something like this:```sqf
waituntil {!isnull player};
waituntil { sleep 0.1; !isnil "kfChannelId" };
kfChannelId radioChannelAdd [player];

dark viper
#

this explains a lot of my confusion on why we were using the laborious WorldVisual transforms instead of accessing the camera orientations directly

modern plank
#

Question about MP-sharing variables with getVariable/setVariable[].
Today I try to ensure that I do missionNamespace setVariable["VAR",val,true]; enough in advance to ensure that all clients can get the last value with a missionNamespace getVariable["VAR",default] but it is sometimes complex.
Is there any equivalent of missionNamespace getVariable["VAR",val,2]; to say 'ensure you get the value from the server before reading it' ?

#

I would like to "pull" vars instead of "push". Much convenient model.

dark viper
#

and if you're curious the transform matrix operations would be

//InverseCameraTransform = (Camera Orientation inverse * Camera translation(position) inverse)
InverseCameraTransform * ModelToWorldTransform * object
// object to camera relative space

But we don't actually need that for anything we can apply everything directly in world space to everything, that's just rendering trivia

hushed turtle
#

You would have to remote execute some code, which would then make server to publish the variable

modern plank
proven charm
#

maybe check nil ```sqf
waituntil { ! (missionNamespace isnil "VAR") };

modern plank
#

BUt I don't know if NIL is the latest correct value or not.

hushed turtle
modern plank
#

I have like boolean to know if I am in warmup, or mission already started.... so true or false are both acceptable... only the server knows which value is correct.

#

so you suggest to have one-time variable for all of them. Not perfect, but can work.

hushed turtle
#

Remote exec to the server to publish variable and wait for change

modern plank
#

again, how I know that I don't have to wait anymore on the cli machine?

#

Only the server who is my single source of trust knows that.

old owl
#

The idea is you're waiting until you've fetched the expected value(s) from server

modern plank
#

yes, with one-shot variable only, this way you know that nil means unset...

#

because CLI know that NIL means not fetched.

old owl
#

What do you mean by CLI machine?

#

Like dedicated server?

modern plank
#

client machines

old owl
#

Ah okay sorry wasn't following

#

Do you have a bunch of variables are you are setting at a time outside of one batched remoteExec?

modern plank
#

I have a dedicated server, who drives the workflow and know in which stage we are currently etc.... then JIP and standards cli must read the right value....

#

like CURRENT_STAGE=3 needs to be propagated for example

#

CURRENT_STAGE=2 is also a valid value.

#

4 too.

old owl
#

Ah okay. So your method of transferring all of this data to client is via JIP?

modern plank
#

not only, for everybody.

old owl
#

So globally for all clients in mission?

modern plank
#

I mean, I would like on a client, to be able to pull a variable from the server, whenever it makes sens on whatever cli.

hushed turtle
little raptor
modern plank
#

Makes sens.

#

timestamped or whatever transactionnal

#

No feature into the SQF by default to do it right?

little raptor
#

it can just be an incremental number πŸ€·β€β™‚οΈ

#

No feature into the SQF by default to do it right?
the ID?
the remoteExec is just:

//client
[data, id] remoteExecCall ["my_fnc_serverBlabla", 2];
// server
params ["_data", "_id"];
_res = _data call my_fnc_blabla;
[_res, _id] remoteExecCall ["my_fnc_clientBlabla", remoteExecutedOwner];
// client again
params ["_res", "_id"];

_request = requestHashmap get _id;
// ....

(the request can contain a callback for example)

modern plank
#

as soon as it remains unique and identifiable, yes

old owl
#

That is what I was kinda trying to explain but perhaps I was poorly with the sandwhich code example I gave earlier here #arma3_scripting message. Especially for the case of client initialization in an MP mission, it can be super helpful to have all of that down to one remoteExec from server, as then you can combine network calls and also order specific variables or tasks.

modern plank
#

because you know there are the two ways: even the server pushes values to cli, or better for asynchronous things, cli pull themselves from the server when they need.

little raptor
errant jasper
#

Today I try to ensure that I do missionNamespace setVariable["VAR",val,true]; enough in advance to ensure that all clients can get the last value with a missionNamespace getVariable["VAR",default] but it is sometimes complex.
I don't see the point though? If you are having trouble with the client getting the value early "enough in advance" with the server pushing the values, I don't see how that solve the problem of them getting it in time with a pull model.

modern plank
#

I don't get it. I have globalVars like [HAS_WARMUP_STARTED, HAS_MISSION_STARTED, CURRENT_MISSION] for example. Possibles values are [false,true,4]

#

The server pushes with broadcast flag into the setVariable[myArray]

#

It is buggy, sometimes cli don't do the right stuff and so on so I need a try catch to locally execute again the right stuff on cli when needed. To do it properly, I need a fresh copy of myArray from the server.

#

(to create the diary corresponding to the right mission etc...)

#

From the cli, I can have a wrong copy like [true,false,3]

#

I have no idea that these values are wrong on the cli.

little raptor
#

in this case you don't need setVariable. the server can remoteExec a function on the client and send the data + what to do with it

modern plank
#

in push model yes

hushed turtle
#

If you remoteExec a function multiple times. Don't JIP clients execute just the last call?

modern plank
#

BUT it is buggy

#

With 60+ cli there are always guys who do not execute it well.

#

this is why I implement the try-catch triggered on the cli

old owl
#

Having public variables for things like mission state isn't a bad way to go. I honestly prefer it over remoteExec & JIP. Having a singular file though that executes on client at start of mission is a good way you can make sure things are executing in the order you're intending and that you're batching network

errant jasper
#

It seems like you have separated your "transitions" from your data, if as you say the client has wrong data, but know they need to "transition" but are missing the right data from the server.

#

Many problems disappear when they are combined, into say CBA-style events or perhaps remoteExec with JIP

little raptor
modern plank
#

yes. So I can always do a remoteExecCall from the cli... that broacast again the variables from the server.... on the cli I do a fucking sleep 3; to ensure reasonably that the server had the time to send data... but looks crap.

hushed turtle
old owl
#

JIP isn't bad but I do personally try to tend to stay away from it since I feel like it can be cumbersome to track JIP ID's and that the ordering can be kinda weird

#

That might be kind of a hot take tho

modern plank
#

beacause you are in push model, and it is buggy again.

#

With dozens of client, there are always network issues

errant jasper
#

So for instance, it looks like you have an active "mission state" that can change. So you need relevant data to be attached to the transition (another name for event). So something like:
[["MISSION_STARTED", ["ALL", "RELEVANT", "DATA"]] remoteExecCall ["TAG_fnc_ActiveMissionState", 0, "TAG_JIP_MISSION_STATE"];

modern plank
#

And I want a try catch from the client.

#

to pull data.

old owl
#

Plus that you can only assign one remoteExec to one JIP ID is a major w_sadcat for me

little raptor
#

what?

#

you can have as many as you want

errant jasper
little raptor
#

ah that, well yeah

old owl
#

I am terrible at explaining things- apologies

modern plank
#

During all "states changes" driven by the server, I have many things to execute on cli, like local markers, diary, mass teleportation to new spawn position, loadout restore, invincibility during briefing, then I remove all of these when it is finish etc....

#

I have guys who disconnect.... reconnect...

hushed turtle
#

I guess then do what Leopard recommended

modern plank
#

some guys don't but are not TP for example, so I need a loop to check if their location is good, if not I redo the TP etc...but I need the right CURRENT_MISSION to read the right spawn location...

#

to be clear: push model from the server works very fine.... with 6 cli. Server just do [CURRENT_MISSION] remoteExec["cliWarmupStart", -2, true]; and this is it.

#

With 60+, issues happen.

#

VEH are destroyed, some are created for the current mission... lots of networking in all directions. It may explain that some cli just don't run the cliWarmupStart well.

old owl
#

In cliWarmupStart could you not just have a variable like clientSessionLoaded = true; that you set at the end of the file- then for other files that are running on initialization do a:

waitUntil {
  uiSleep 0.01;
  !isNil clientSessionLoaded
};

To verify the player receives all necessary data prior to mission start?

#

Obviously less preferable to have waitUntil logic throughout various mission scripts. Would be preferable to have all of that stuff combined into either one script or in cliWarmupStart. If I am understanding what you're describing correctly

modern plank
#

The issue if clientSessionLoaded = true; has been set on all the cli for the warmup of mission 2. Now server is launching warmup for misson 3... 2 cli have the wrong value, but clientSessionLoaded =true.

errant jasper
#

I mean you can use a pull model, it is just much less efficient, and requires you to basically do "callback" style handling.

[CURRENT_MISSION] remoteExec["cliWarmupStart", -2, true]; To be clear this will run not just for Mission #2 right, now and for future JIPs, with true as the JIP flag it will run again on all later missions. So when you reach mission #4 then all JIPs would run 1,2,3,4.

modern plank
#

ya. Which can be an issue. This is why I usually don't use JIP flag, but instead I am reading the [HAS_WARMUP_STARTED, HAS_MISSION_STARTED, CURRENT_MISSION] vars to do only what makes sens to the current situation inside initPlayer.sqf.

#

Or you can, but put a big if() at the beginning that skip the process if the parameter does not match the CURRENT_MISSION, this way [1|2|3] cliWarmupStart will do nothing.

#

Two possible implem.

#

But again, my point here is not JIP. I know how to do it.

#

Question is more how people do with massive MP to get reliable variables from the srv when they need on the cli side.

errant jasper
#

There is no problem with reliable sync. All the push based approached (setVariable, publicVariable, remoteExec) does it. Pulling the data is basically asking the server to push it to you.

What you have is some lack of ordering and processing or something else.

old owl
#

Our server runs a lot of people at a time and a remoteExec file along with init scripts and publicly broadcasted variables works for us

#

We don't have multiple missions we run at a given time, but there are a lot of different events happening at a given time that we have to keep track of

modern plank
#

srv exec drives. So for example:

srvStartWarmup = {}; will do a lot of things like putting the right VEH etc... and also triggers the cli exec with a [mission_num] remoteExec["cliStartWarmup",-2];. The cliStartWarmup will generate the diary for example... which requires the right "sequence" because if the srv has not finish with the VEH creations, the cli will write the wrong VEH in the diary...

#

So the whole sequence has to be "rigid and sync".

#

This is why I need pull from the cli, but if no one uses it, fair enough

errant jasper
#

Well, don't trigger the cliStartWarmup until the server has done the necessary thing ?

#

What do you want to pull from the server? Whether it is ready?

modern plank
#

Ya. the cliStartWarmup also TP the player to the next spawn. Imagin it fails. (the player was still on a previous mission veh, so the TP fails)

#

I want to do a scheduled retry just in case the sequenced exec has failed.

#

Here I know now, since some buddies were not TP because of that, there were ejected from the VEH at his deletion, but they missed the TP. (deletion into a spawn{} in // and cli executed before)

#

So I have a fix now.

#

But whatever the next bugs, I would like to do such retries from the cli as safe-guard.

#

Useful for the cli where it fails, the JIP etc...

errant jasper
#

Okay, well, as for pull'ing you need

  1. Make a request identifier
  2. Store anything anything you want to do after (the continuation), plus any needed variables in scope, into some object (hashtable) under identifier.
  3. Send request to server for data, including variable name, and your request identifier.
  4. The sender will send back the response and your identifier.
  5. In your handler you retrieve the continuation code and the stored variables, and in the continuation code you load the reponse and store data into variables again and continue.

As for try-catch, ignore the commands named that. You will have to detect that yourself.

#

But do understand that in the push-model all we do is:

  • Push infallible transitions
  • At the right time, sequenced in the right order (yes obviously this not fully trivial).
modern plank
#

yep. in that case, most spawn{} completion must be waited before moving on.

#

I would be OK with that if on such call:

missionNamespace setVariable ["ATMTK_CURRENT_STAGE",_stageIdx, true];

We could do something like

waitUntil { broadcastDone "ATMTK_CURRENT_STAGE" };

just to ensure that all cli have received the update. Caus' except crappy "sleep + fingers crossed", I don't see how I can move on with a rigid sequence workflow.
Without, it means something like while(functional condition is not OK) {sleep ;} on all cli to synchronize, which is obviously complex.... for nothing.

errant jasper
#

I sorta see where you are going, but I just can't imagine a situation where the server would wait back on the client.
And if the clients are going to sleep anyway until condition, why trigger it before?

modern plank
#

This is why most of scripts go with the crappy "sleep+fingers crossed"

#

or CBA event driven as a best alternative, somethig I should consider too I guess.

errant jasper
#

I mean "CBA-style" just doesn't do this, IME... It is "atomic transitions" driven by handling code running unscheduled. The events handles strict transitions, the "atomicity" of handlers ensure not conflicts.

#

There is hardly any spawn to be found in such a code base.

#

The main challenge is ensuring JIP data is ready, and to handle the "joining-transition" atomically.

old owl
#

Although entirely different from what you guys are talking about- I am really excited for the script promises that are coming in 2.22

#

Should reduce the amount of waitUntil that is really necessary for things

errant jasper
#

Is that the one that allows you to queue further code to run on a spawned script? I guess it nice, but as I said hardly matters for me because there is hardly any spawn or execVM to be found... Maybe the server is running one or two, but it is the "controlling" machine, so there is no synchronization problem there.

old owl
pallid palm
#

holy shit i think i finaly got this radio trigger stuff right: i had to make it like it was in OFP

hushed turtle
#

I would like to learn whatever you've figured out. If you don't mind blobcloseenjoy

pallid palm
#

yes sir 1 sec

#

ok m8 this is what i found to be true

hushed turtle
#

You need third parameter false for trigger to be created locally, otherwise it would be global

#

In createTrigger

pallid palm
#

can you show me

fleet sand
pallid palm
#

O I C

fleet sand
pallid palm
#

ahhh ok nice thx m8s

#

i fixed it up there

hushed turtle
#

No need for double quotes

pallid palm
#

oh shit lol ok

hushed turtle
#

wait

pallid palm
#

i always need help πŸ™‚

hushed turtle
#

Since it's inside "", then you need to use ''

pallid palm
#

ok

hushed turtle
#

Apostrophe '

pallid palm
#

ah ok

hushed turtle
#

Also I don't see any global execution. You just remote execute one function on the server

pallid palm
#

that because there a Animation in my script

hushed turtle
#

Like this:

['SFA_fnc_playerReload', 2]
pallid palm
#

oh ok thx m8

#

there we go