#arma3_scripting

1 messages ยท Page 476 of 1

tough abyss
#

Hi all, i picked up arma scripting not long ago, and i noticed that although scripts are executed as independent threads, there seems to be no native support for thread safety? im aware there are c++ extensions like Intercept, but for things like BIS event handlers sqf is still needed. So is there certain mechanisms that mitigate race conditions that i didnt know of, or is sharing global variables simply a no-go for arma3?

digital jacinth
#

as in any language you can share global variables on a machine. Many scripts and mods use this. Race conditions are a sad reality in any language and in arma they exist as well, especially in an MP environment.

In arma there are Scheduled and unscheduled scopes. Scheduled scopes cannot be interruppted and try to run on the same frame, unsheduled scopes can be interrupted and the runtime can be over several frames.

#
// *** non-scheduled origin ***
[] spawn {
    // *** scheduled scope ***
    [] call {
        // *** scheduled scope ***
        sleep 3; // <- OK
        hintSilent "Hello World!";
    };
};
#

Commands like sleep only work in non scheduled environment. Calling a scheduled scope in an unscheduled one like the example above makes it essentially also an unscheduled scope.

still forum
#

But for things like BIS event handlers sqf is still needed Intercept has abstraction for the BIS eventhandlers. You don't have to see them.

Threads are not independent real threads. They are all scheduled on the main thread

#

@digital jacinth you mixed up scheduled/unscheduled. scheduled can be paused

digital jacinth
#

ah damn i always mix them up...

tough abyss
#

@still forum thanks for the info! so scripts and event handlers are guaranteed to run only once per frame?

still forum
#

there will never be scripts running in parallel.
"once per frame" well... If you run them multiple times sequentially then they will run multiple times per frame

strong shard
#

@tough abyss only event handlers and unscheduled scripts

still forum
#

You can get race conditions with scheduled scripts. As the script can pause at any time. If you copy a global variable into a local one. Then the script get's paused. When the script resumes and the global variable has changed. Your local variable will have the old state. So things like this can happen in unscheduled

_myVar = MyGlobalVariable;
_myVar == MyGlobalVariable //false

That can't happen in unscheduled scripts.

strong shard
#

@tough abyss if you need not-inyeruptable code inside scheduler, you can use isNil <CODE>

tough abyss
#

thats a bummer.. glad to hear Intercept has event handlers though!

still forum
#

The eventhandlers are SQF code in the backend. But you don't see that as a user

tough abyss
#

is isNil test-and-set?

strong shard
#

@tough abyss isNil CODE check if code return nil value

#

@tough abyss this code will be executed as unscheduled from start to end without interrupts

tough abyss
#

isNil { if (!aquired) then { aquired = true; true } else { false } }; can this hypothetically be used as a lock?

still forum
#

you'd have to return nil to get the returned value out

#

I have a lock script lying around

tough abyss
#

yea true but aside from that is my code semantically correct?

still forum
tough abyss
#

@still forum thanks for your help! thats one funny way to implement locks for sure lmao

#

thank you @strong shard @digital jacinth as well!

digital jacinth
#

๐Ÿ‘

leaden venture
#

Yeah, you can 't make includes from your own addons in description.ext even if you use a 3rd party packer

#

Its a real shame that BI didn't proceed a bit forward with that system, there's a whole crapton of stuff that you can do with it

still forum
#

I think it's just a bug that it got broken. Fixing it just doesn't have any priority. As few people use that. And these people can just use workarounds

tough abyss
#

@still forum just a follow up question are sqf commands themselves like isNil atomic?

still forum
#

yes

tough abyss
#

any exceptions?

still forum
#

ForEach/while/count (the count {} variant)

#

all things that loop through stuff

#

if/else are atomic themselves. But the code they execute on condition is not atomic

#

I think isNil is the only command that executes the code in it's parameter atomically.

#

So.. Commands are generally atomic. But the code that you pass as a argument is generally not executed atomically

tough abyss
#

isNil is the only command thats close damn..

#

alright thanks again @still forum

strong shard
#

Code inside FSM also atomic

still forum
#

I know there are other ways to get code to execute unscheduled. But I and everyone I know only uses isNil because it's the simplest

tough abyss
#

๐Ÿ‘

lusty canyon
#

some mod vehicles dont appear in zeus, they are loaded since i can see them in virtual garage and spawn with createvehicle. how to make them appear in the list?

digital jacinth
#

set it in the curator module that all addons including unofficial ones are available.

#

if that still does not does it then it means they are scoped out in their configs for zeus

lusty canyon
#

@digital jacinth so i have to do something like this? (foreaching allcurators array)

curatorObj addCuratorAddons ["veh_classname1","veh_classname2"];
digital jacinth
#

oh it is a zus module that is added via script`?

lusty canyon
#

its a vehicle mod like hafm submarines (and a few others), they just dont appear anywhere in zeus

#

(right side list of vehicles and units)

digital jacinth
#

no i mean you are creating the curator module with script, it is not added in the editor

lusty canyon
#

yeah def in mission script not editor

digital jacinth
#

iirc all you need to do is set a variable on the module

moduleZeus setVariable ["Addons", 3, true];
lusty canyon
#

where do i get that modulezeus object while mission is running? clients are telling me stuff is missing when they are inside zeus.

digital jacinth
#

you also should check the config of the vehicle, see if it has a "scopecurator" value

lusty canyon
#

so i just cant script them in realtime? (like debug console script?) i dont want to inherit stuff and make a new addon just to change the scopecurator bit

digital jacinth
#

you can get your own current curator object with this

getAssignedCuratorLogic player;
#

you can only change config entries with mods sadly

#

the reason why I am asking this is because with zeus vehicles can now have 2 scopes, one for editor and one for zeus

#

so for the part I meant you can do this:

(getAssignedCuratorLogic player) setVariable ["Addons", 3, true];

as the unit which has zeus

lusty canyon
#

so that statement will bypass the scopecurator attribute?

digital jacinth
#

no

#

this will enable unofficial addons

still forum
#

Do you still need to addCuratorAddons if you set that variable?

#

I didn't know that it existed. Need to update all my curator scripts immediately ๐Ÿ˜„

lusty canyon
#

so i set that var and magically my zeus list will have everything in there?

#

atleast everything that doesnt have explicit scopecurator cockblock?

digital jacinth
#

@still forum try it out, I made some dynamic zeus script, but it was too unreliable so i went back to normal editor placed ones

#

@lusty canyon iirc yes

#

and now i regret not uploading that code snippet to github so i could reference it directly

lusty canyon
#

@digital jacinth thanks heaps ill try them out, curator stuff is hurting my peanut brain

digital jacinth
still forum
tough abyss
#

Code inside FSM also atomic correct. When in doubt canSuspend

meager heart
#

"When in doubt" > check wiki ๐Ÿ‘Œ
also fsm states scripts is just unscheduled environments, there are no magic...๐Ÿ˜ƒ

digital jacinth
#

sometimes i wished there would be some magic in sqf

still forum
#

(โˆฉ๏ฝ€-ยด)โŠƒโ”โ˜†๏พŸ.*๏ฝฅ๏ฝก๏พŸ

tough abyss
#

FSM scripts are scheduled, this is exactly the reason why not to trust wiki completely. Also it might not get updated with changes to the engine unfortunately

still forum
#

Well. Changes to the engine in the FSM/SQF area are...... Rare.

#

Basically nothing change in the last like.. 10 years

#

But something in FSM's is executed in unscheduled manner. Maybe the conditions?

tough abyss
#

I think the conditions are based on what I saw in the broprofiler the other day.

#

Conditions, preconditions and states cannot be suspended but FSM scripts, .fsm are added to the global script scheduler

forest ore
#

How does one transfer scripts to be executed from an additional file rather than directly from initPlayerLocal.sqf? I'd like to move some eventHandlers away from the aforementioned file but for some reason the scripts/EH's won't work if I just move them to let's say folder/file.sqf in the mission PBO (and use []execVM "folder/file.sqf" to call the file from initPlayerLocal.sqf)

still forum
#

any errors you're getting? that stuff should work

forest ore
#

no errors so that's one thing

forest ore
#

Oh yeah.. pieces coming back together since I was wondering the same thing already quite some time ago. Obfuscation might have had something to do with the fact that the scripts placed in an additional file sort of don't work anymore

mortal nacelle
#

hey, how would i start xcam from the debug console?

#

path is E:\Steam\steamapps\common\Arma 3\@xCam

cold pebble
#

Erm

#

What do you mean exactly?

#

Like how to make a vehicle play an animation (open door etc)?

#

Or how to animate the object (add side seats to hummingbird etc)?

#

Can't in vanilla I don't think

#

As you don't get to 'stand' in any aircraft

tough abyss
#

Remnants of War IS vanilla

high marsh
#

I think this was produced by just making the plane static, adding lights, and positioning the characters to make it appear as if they are standing inside the plane

queen cargo
#

IIRC the state was executed scheduled while the conditions where not in FSM

inner swallow
#

well, there are many ways. easiest is to use a trigger, and set the condition to PRESENT. Then ied1 setDamage 1 in the on activation box

#

where ied1 is the name of the explosive

high marsh
#

Why would it? You're just making it a parent object of the one you are attaching it to.

#

setDamage will detonate IEDs iirc

inner swallow
#

That's interesting ๐Ÿค”

#

i mean, i would expect it to

#

Make sure you're actually in the trigger?

#

It could be something specific to aircraft, dunno

#

what's the present condition, again?

#

what?

#

no i mean

#

yes but which side is set to present

#

i mean

#

who is it checking for

#

and you are OPFOR, correct?

#

erm

#

Otan?

#

oh, well then it won't work

#

switch it to BLUFOR

#

yeah then it would work

#

you can make it "Anybody"

#

and then it'll trigger for any side

#

cheers ๐Ÿ‘๐Ÿฝ

high marsh
#

Don't get hooked on using triggers though, bad practice for mission expansion and readability. But if you are making a small mission it should not matter

polar folio
#

what would be a good way to make sure stuff that is saved locally on a player unit (setVariable) survives that player disconnecting? i'm unsure about the timing of it all.

#

it would be important to have it be local though before the player disconnects

high marsh
#

@polar folio HandleDisconnect EH + either profileNamepsace (local to player's profile) or server profile

#

server profile is not local to player, so profileNamespace might be what you're looking for

polar folio
#

i'm not trying to save player state on the server for persistence. i'm just wondering, when a player has their game crash for example, if the variables on their unit will get lost since making the stuff global or transfering it needs to happen on that player's machine, right? i should probably just debug this with someone

tough abyss
#

You have to save into profile namespace if you want it to survive crash on client

polar folio
#

oh i see what you mean. but i need it instantly. you mean so i can retrieve it once the client reconnects.

#

it's fine. i thought maybe it was stored somewhere for a sec. wishful thinking. i'll just have to broadcast stuff in intervals

tough abyss
#

Depends what stuff

polar folio
#

yea i know it's vague and abstract. it's just too interconnected to show examples. was more of a general question anyways. thx

exotic tinsel
#

how do i take a string "myvar" and turn it into a variable?

polar folio
#

@exotic tinsel missionNamespace setVariable ["myvar", _dta]; if i understood you correctly

high marsh
#

@polar folio Save stuff in intervals, I think with SQF Layer it's impossible to save right before crash, the best you can do is save frequently and make sure it gets saved in enough time

polar folio
#

yea, that is what i wanted to avoid and only do it on request/event. but yea should be fine. thx though

high marsh
#

Yeah. You can do it for event, just not crash event

exotic tinsel
#

where do you set addMissionEventHandlers? i mean what file

astral dawn
#

In any file or script, I think. In init.sqf for instance.

#

So I was using the ArmaDebugEngine and I like how it dumps all my local variables into the .rpt, it's very helpful. Can I cause it to dump the variables through some script command? Sometimes I just want to see what data is passing at some point without making a specific diag_log for it. I could make a scripting error of course to cause it to dump everything but it is kind of... ugly.

fair drum
#

how do i go about making the "player" ai controlled and uncontrollable like in the first mission of arma 3 campaign?

noble pond
#

@fair drum BIS uses a string of animations to do most of the cutscenes in arma 3's campaign

fair drum
#

I'm just talking about the first part in the campaign when you're walking forward you have no control of your character and it eventually pants away and then you have control again

#

I want to do the same thing except the player is a driver of a vehicle and I don't want the player to have any input until a certain point

high marsh
#

you can use capture data to be played back yes

fair drum
#

Okay I've used that before I didn't know you can use it as a player entity

high marsh
#

Sure

meager heart
#
player switchMove "Acts_welcomeOnHUB01_PlayerWalk";
``` ^ into the console
#

probably unitcapture/play or cameras better option... you will have to "adjust everything" for that one animation... ๐Ÿค”

high marsh
#

Yep, both work perfectly. Just depends on what you want to use it for

still forum
#

@polar folio Deleted Eventhandler. Fires just before unit is deleted. If unit is not deleted then variables won't be lost. BUT the variables have to be public.
Saving them on the crashing player obviously doesn't work ^^

still forum
#

@astral dawn I am VERY sure that I had a command to just dump the stack somewhere... I can't find it now.. wtf :D
Probably didn't commit that change -.-
Okey.. Reimplementing that now and I'm now 100% sure I already implemented that somewhere.
https://s.sqf.ovh/firefox_2018-08-01_09-12-18.png HAH! There it is.. Wonder what happened to that code ๐Ÿค”

compact maple
#

Hello everyone, what would be the good syntax to search " and ' in a string ?
could be this ?

private _badChartoSpot      = ["/", "\", """"", ""'""];
still forum
#

@compact maple find command

#

you'd need to repeat for every string though. there isn't a find any string in array command

compact maple
#

I know, this is what i did :

params [
    ["_stringToInspect","",[""]],
    ["_badChartoSpot",[],[[]]]
];

private _badCharSpotted     = [];
private _isStringOk         = true;

{
    private _find = _stringToInspect find _x;
    if (_find != -1) then
    {
        _badChar = _stringToInspect select _find;
        if !(_badChar in _badCharSpotted) then
        {
            _badCharSpotted pushback _badChar;
        };
        _isStringOk = false;
    };
} forEach _badChartoSpot;

[_isStringOk, _badCharSpotted]

but what if i want to search a " or a ' ?

#

in my case, the player will have to enter a text, but i do not want him to type " or ' or / or \

meager heart
#

not sure about quotes but for the characters we have BIS_fnc_inString and BIS_fnc_filterString

still forum
#

Don't understand the question. If you want to search a " then.. just do it?

meager heart
#

just findit ๐Ÿ˜ƒ

compact maple
#

thanks didnt know theses functions.

yea then just do it, but how do i escape this " ? as string get two " "..

still forum
#

"'" and '"'

#

no need to escape at all

compact maple
#

LOL

#

thanks

meager heart
#

oh btw about strings and stuff... i have two arrays with a strings, one with constant number of elements and the second one with unknown/random, the task is to count elements in the second array and replace the same number of elements in first one, i'm doing it like this

_arrayA = ["one", "two"...];
_arrayB = ["a", "b"...];
_arrayA deleteRange [0, count _arrayB];
_arrayA append _arrayB;
```is there any better options for that ? ^ ๐Ÿค”
still forum
#

That way you end up with A+B. But if you wanted to replace you'd want B+A

#

simplest would be just a forEach loop

#
{_arrayA set [_forEachIndex, _x]} forEach _arrayB
meager heart
#

yeah, i need replace elements in the first one with the elements from the second

#

that's why there is append

still forum
#

you are not replacing though

#

you are removing X elements from the start. And then adding new elements to the back

#

ABC
and XY
would end up as
CXY
and not XYC

tough abyss
#

@compact maple Add [ and ] to string and do parseSimpleArray on it, if it is bad it will fail

meager heart
#

there is ranks + names

waxen tide
#

I've looked at drawing lines and such on the map, drawLine looks too thin and i think i would need multiple drawRectangle filled. But there is fps warnings in the wiki on both of those, so i guess it is a bad way to go about. Is there a better way? I recon some sort of map marker? Wondering how ACE map tool does it?

leaden venture
#

I've been thinking about my use of triggers in game missions. I'm wondering how many triggers it really takes to slow down a server that has many AI running. SInce triggers are checked many times very fast, I'm wondering if its better to make a sleep on the server that checks conditions every like 10 seconds or so. The mission I'm making would require somewhere around 15 triggers to work otherwise.

still forum
#

SInce triggers are checked many times very fast 0.5 seconds isn't thaat fast

waxen tide
#

@still forum Thanks i looked at the wrong files in that pbo :/

leaden venture
#

So dedmen do you think if I have 15 or so triggers running server only checking inconsequential things that its gonna have a neglible effect on the server? We'll have around 25 or so people playing and 200 AI using the BI dynamic simulation

tough abyss
#

@Dedmen if trigger is attached to frequently simulated object it will be checked each simulation

still forum
#

15 triggers shouldn't be a problem. As long as they don't span over the whole map

peak plover
#

also depends on condition

compact maple
#

@tough abyss what could fail exactly ?

tough abyss
#

Parsing of array containing 1 element which is your string

#

Actually never mind you might need to add more " for it to work, might get complicated.

digital jacinth
#

Have you tried the "AnimChanged" Eventhandler?

digital jacinth
#

Switchmove does not trigger that eh, use playmoce or playmovenow instead

#

Ye

strong shard
#

@tough abyss you need only one playMove or playMoveNow. playMove - add animation to queue, playMoveNow - clear queue and play this animation

#

@tough abyss yes if you need play two animation

unborn ether
#

Question: SQM placed vehicles in MP are owned by server?

still forum
#

yes. Until entered by a driver

meager heart
#
player spawn {sleep 0.5; _this switchMove ""}; 
player playMove "AovrPercMstpSrasWrflDf";
#

๐Ÿ˜”

#

how i make an animation to end?

player switchMove "";
young current
#

you need to make it wait until the unit is really there

#

I recall

meager heart
#

you have example ^ above with spawn ๐Ÿ˜ƒ

#
player spawn {_this switchMove "Acts_SupportTeam_Left_Move"; sleep 5; _this switchMove "";};
#

what for ?

#

lol

astral dawn
#

@still forum Thanks for sharing this build, it seems to be working!

still forum
#

๐Ÿค“

astral dawn
#

I only had to add the _x64 to the end of the dll name

still forum
#

oh.. oops

unborn ether
#

@tough abyss Also use this when using init field, since it might be not a player at all.

digital jacinth
#

is there a way to find all seats in a vehicle and see if they are occupied? I am trying to move a dog into a vehicle and want to make it as dynamic as possible without fixing the position for the unit.

#

i am already looking around the vehicles config but i cannot spot how to get the seat information

astral dawn
#

getNumber (_vehCfg >> "transportSoldier");

#

I think this one returns the amount of vehicle's cargo seats

#

Non-fire-in-vehicle ones

digital jacinth
#

any chance also to get the position of those?

astral dawn
#

Then you need to find FIV turrets separately... I have a script for that somewhere if you want

#

Position?

#

Do you mean ID?

digital jacinth
#

or mem point, does not matter. I want to attach a dog there and lock the seat

astral dawn
#

Oh this position... sorry I have no idea

still forum
high marsh
#

0_o

still forum
#

Don't know what these numbers you're throwing around are supposed to be ๐Ÿ˜„

tough abyss
#

From diag_captureFrame any idea what the numbers (103x151) mean? visUA; 20.88727; 0.21092;"~~ 29.77 ms, 103x151"

still forum
#

Just a comment to scope

#

I think that's a pixel size

#

I'll look again

#

observersXtargets

#

actually.. Now I'm not sure if it's culling anymore.. Might be AI visibility checking

#

Check your number of local AI's and compare that to the observers number

tough abyss
#

Two HCs, the game offloads to them and I had a script that would run per AI that wasn't there. You sure it is AI visibility? Why would that be running a place where there wasn't any AI?

still forum
#

no I'm not sure

tough abyss
#

๐Ÿ˜ƒ

still forum
#

observers x targets just sounds like AI

tough abyss
#

I stand by my original assertion, no one knows what this is ๐Ÿ˜ƒ

still forum
#

It's updating sensors

#

no idea what "sensors" are tho

tough abyss
#

Makes sense sort of in the context of the game but it also ought not be doing anything on the client for that

#

I'll take if off to the profiler chat and see if I can get an answer from the man himself

quartz coyote
#

Hello. I'm trying to this :

I'm in a Server-executed script and I want that script to tell a specified player to localy execute a selectWeapon
Is that even possible ?

still forum
#

remoteExec

quartz coyote
#

but if I RemoteExec it'll go to all players not just the one I want

still forum
#

No it won't

#

The target parameter isn't there to always enter the same value

#

the target parameter is there to specify the target

#

you can just pass an object as target. And it will execute the code where the object is local.
Aka on the player itself. If you pass a player's soldier

quartz coyote
#

hoouuouououou .... thanks !

#

I still ain't getting this right

#

I can't understand which way to write my remoteExec ....

#

I would have wrote it like this ...

unborn ether
#

player is local. Server will just ignore that, since it always has objNull for player.

#

For client with occupied unit - will send that packet to himself

quartz coyote
#

Sorry I wrote it too fast, I put the player's name instead

unborn ether
#

Name? target argument doesn't accept names. Maybe you meant unit's variable?

quartz coyote
#

.... hold one, i'll go back to reading the wiki, I most be missunderstanding it

#

Object - the function will be executed only where unit is local
WTF is this Chinese??? I don't understand this ! ๐Ÿ˜ฎ

unborn ether
#

Nothing Chinese tbh.

#

This packet will be remotely executed only on PC where that object is local.

quartz coyote
#

All I wan't is for the script to be executed for a local player not any player, the one I want and no other ! Why is it so complicated ..............

unborn ether
#

If you send unit occupied by a player as a target, it will only executed on that very PC, since player occupied unit is only local to himself.

#

local to himself ๐Ÿ˜„

still forum
#

Give the player a variable via editor

#

then put that variable as target.

quartz coyote
#

holly fuck I don't understand basic English now .....

#

This script shit is making me go dumb

unborn ether
#

Listen to Dedmen

#

And read some articles about locality in Arma - this will help.

still forum
#

Nah. It's not making you dumb

#

you are just blocking off the learning

quartz coyote
#

Well .... that's what I did !! I called my unit "u11"

#

and it's not working

still forum
#

Show me the remoteExec line

quartz coyote
#

"OPTRE_M6G_Scope" remoteExec ["selectWeapon", u11];

unborn ether
#
"OPTRE_M6G_Scope" remoteExec ["selectWeapon", u11];

^

still forum
#

Both wrong

#

๐Ÿ˜„

#

selectWeapon takes TWO arguments

unborn ether
#

I just copied ๐Ÿ˜„

still forum
#

you are only giving it "OPTRE_M6G_Scope"

#

That's ONE

#

not TWO

quartz coyote
#

Ok, i'll go and read and come back ok ?

unborn ether
#

proper one is:

[player,"OPTRE_M6G_Scope"] remoteExec ["selectWeapon", u11];
still forum
#

if you don't have it in 10 minutes I'll help more

#

Ahhhh

#

FU

unborn ether
#

๐Ÿ˜„

still forum
#

๐Ÿ˜„

quartz coyote
#

:(((

#

I need to learn m8, don't do it for me ๐Ÿ˜ฆ

#

anyways this ain't working eather

still forum
#

Oh right

#

@unborn ether wrong too ๐Ÿ˜„

#

Remember what @unborn ether told you before about player

quartz coyote
#

hold on ! eveyone shut up i'll go and study this and come back before

#

10 min expires

#

xD

#

holly shit this is chinese sorry
If you send unit occupied by a player as a target, it will only executed on that very PC, since player occupied unit is only local to himself.

still forum
#

[player,"OPTRE_M6G_Scope"] remoteExec ["selectWeapon", u11];
->
[left argument, right argument] remoteExec [command, target];

quartz coyote
#

where did you get this information ????

[left argument, right argument] remoteExec [command, target];

still forum
#

remoteExec wiki

quartz coyote
#

-_-

still forum
#

written in chinese ๐Ÿ˜‰

quartz coyote
#

Well I can't understand shit on this wiki

still forum
#

Player returns the local player. Meaning the unit that is being controlled on the computer that you exec player on.

#

But on a dedicated server

#

there is no human controlling a unit.

#

A server doesn't have a player

#

which is why player just doesn't work on server

#

you need to use a different way to access the unit. Like it's variable name

quartz coyote
#

I tryed !
I guessed that was the problem so I wrote this :

``` but didn't work eather
still forum
#

should work tho ._.

#

OPTRE_M6G_Scope where did you get that?

#

the _Scope part doesn't sound right

quartz coyote
#

any relation with the fact i'm trying this on local server ?

#

mmmh i'll check

unborn ether
#

oh damn @still forum you are right, i forgot that player is local to a sender at this point, so yes it should be a global unit variable.

quartz coyote
#

Indeed that was it !

#

Thanks again man

#

I really wish I could have a really conversation with someone one day, learning from typewriting is hard as fuck

#

plus i'm dumb when it comes to learning by reading

quartz coyote
#

@still forum maybe you could help me on this completely different thing :

I'm detaching an object from the player and making it fall slowly to the ground. It works but I can only make it wall in a precise direction from the player. what i'd like is for it to fall only in front of the player : always where the player is looking.

         detach _OBJ;
        _Z = 1;
        for "_i" from 1 to 10 step 1 do
        {
            _OBJ setPosATL [getPos player select 0, (getPos player select 1)+3, _Z];
            _Z = _Z - 0.1;
            sleep 0.1;
        };
still forum
#

_newPos = (getPos player) vectorAdd (getCameraViewDirection player)
That will make it spawn 1m away from the player. In the direction his camera is facing

quartz coyote
#

oooohhhh .... great !

#

i'll try this

#

thanks

#

wonderfull its working

#

but how do I make it fall 2 or 3m away and not 1m away

#

@still forum

still forum
#

vectorAdd (getCameraViewDirection player) vectorMultiply [2, 2, 0]
2m

quartz coyote
#

ouuuuh .... science fiction

exotic tinsel
#

hey guys. having trouble remoteExec ing this. cant find anything on the web. can it be done and if so would you be willing to provide the syntax.

unit disableUAVConnectability [uav,true];
//i tried this
[uav , true] remoteExec ["disableUAVConnectability", _unit];    
still forum
#

It tikes two arguments

#

one on left. one on right

#

you just threw the left one away. And gave it the right side one.

#

That's not gonna work of course

quartz coyote
#
(getPos ownerR) vectorAdd (getCameraViewDirection ownerR) vectorMultiply [2, 2, 0];

Error : Type Array, Expected Number ...

still forum
#

I ALWAYS make that mistake

#

it only takes a single number ๐Ÿคฆ

#

(getPos ownerR) vectorAdd (getCameraViewDirection ownerR) vectorMultiply 2 then

quartz coyote
#

I tryed with 2, 3 and 4 and my object just disappears like it's gone too far away

still forum
#

Oh...

#

Maaaaaybe

quartz coyote
#

as if it was multiplaying the getpos Aray

still forum
#

Arma does
((getPos ownerR) vectorAdd (getCameraViewDirection ownerR)) vectorMultiply 2;
instead of what I want it to do which is
(getPos ownerR) vectorAdd ((getCameraViewDirection ownerR) vectorMultiply 2);

quartz coyote
#

Correct answer :

(getPos ownerR) vectorAdd ((getCameraViewDirection ownerR) vectorMultiply 2);
still forum
#

setPos

exotic tinsel
#

im trying to apply this to a UAV from the server. it works only for a few shots when a player connects to it. then it goes back to firing without the server removing the event handler. what am i doing wrong. yes i already know im a noob.

[_uav, ["Fired", {                                
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    deleteVehicle _projectile;
    private _ammocount = _unit ammo _weapon;                                
    _unit setVehicleAmmo (_ammocount + 1);                                
}]] remoteExec ["addEventHandler"], 2;
ruby breach
#

remoteExec ["addEventHandler"], 2; to remoteExec ["addEventHandler",2];?

exotic tinsel
#

shit lol, thanks im tarded.

#

still not working. anything else im doing wrong?

[_uav, ["Fired", {                                
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    deleteVehicle _projectile;
    private _ammocount = _unit ammo _weapon;                                
    _unit setVehicleAmmo (_ammocount + 1);                                
}]] remoteExec ["addEventHandler", 2];

ive also tried remoteExec it everywhere, still no luck.

winter rose
#

maybe try

[_unit, (_ammoCount + 1)] remoteExecCall ["setVehicleAmmo", _unit];```
inner swallow
#

addAction, + setDamage

#

almost everything is SQF ๐Ÿ˜„

#

but i guess you mean a separate script file

#

all three can work, init is good to just try it out

#

otherwise separate file (although you'll still have to start it from somewhere, either unit init or init.sqf)

#

separate file is easier to edit though

#

no... ๐Ÿ˜…

#

for starters i don't know what C1 and E1 are, i'm assuming the charge and vehicle, respectively

#

but look up the addAction syntax on the wiki

#

or if you wait a bit maybe someone here decides to write it out

#

but would recommend looking at the addAction syntax in the meanwhile

#

they're explained

#

also there are examples

digital hollow
#

Now look at the setDamage like SuicideKing said. Also try not to think in the chat.

inner swallow
#

and probably check the other examples too

#

the ones that actually do something

cold pebble
#

Cmon

#

Did you even look at the syntax? :L

digital hollow
#

Compare what you have to the 3rd line of Example 1 on the addAction page.

cold pebble
#

Then why has the code gone out the []

inner swallow
#

yes

#

that's not what you're doing though

#

look at the syntax description, see where the code goes, compare to the examples

cold pebble
#

๐Ÿ˜ž

#

closer - i think

#

whats the differences?

#

Well

#

object = player

#

BOOM

#

Needs surrounding ""

#

Round the word BOOM?

#

Closer ๐Ÿ˜›

#

Another difference to example 3? ๐Ÿ˜›

ruby breach
#

Closer. What are the allowed data types for the 2nd argument in the array (i.e, script)?

#

The wiki is your friend

digital hollow
#

What difference do you see?

// Example
player addAction ["Hint Hello!", { hint format ["Hello %1!", name player] }];
// Munarmunar
player addAction ["BOOM",Explosive 1 setDamage 1]
strong shard
#

{}

cold pebble
#

Also explosive 1 won't work as a variable

#

Explosive_1 maybe

#

The gap makes it 2 different things

ruby breach
#

@tough abyss script: String or Code

strong shard
ruby breach
#

Explosive 1 setDamage 1 is not a string, nor is it code.

digital hollow
ruby breach
#
String: 
"Explosive_1 setDamage 1;"
``` or the better option ```
Code: 
{Explosive_1 setDamage 1;}``` are what you need.
cold pebble
#

wot

meager heart
#

๐Ÿšช rage quit

strong shard
#

๐Ÿ˜„

cold pebble
#

thats not different?

#

now it is

#

but worse?

#

the code bit - the {} bit - goes inside the 2nd parameter of the []

#

๐Ÿ˜ƒ

digital hollow
#

Great! Now please try using commas instead of pressing Enter xD

cold pebble
#

And think before you type ๐Ÿ˜„

#

Anyway, go blow up to your hearts content I guess

strong shard
cold pebble
#

By trying to learn from the wiki before here? ๐Ÿ˜›

#

Its crazy useful

strong shard
#

at 00:27?

queen cargo
#

guh ... use a paste service for that @tough abyss !

#

and make sure syntax highlighting is set to sqf

#

or at least use the code style

#

```sqf
code-goes-here
```

vernal mural
#

Hey there. Exploring the new USS Liberty I remembered that it was promised the vehicle-in-vehicle capability. But I'm unable to make it work, either by trying to get a boat in, or by script way. Any clue ?

daring kestrel
#

Use the Boat Rack object.

fringe yoke
#

Is there a discord or slack for CBA development?

tough abyss
#

Why?

fair drum
#

what am i messing up?

{!alive _x;} foreach [units hostagepatrol]

ruby breach
#

That depends. What is it you think you're doing?

fair drum
#

i want the game to check to see if a group is dead, then exec a trigger

ruby breach
#

All your code is going to do there is return the status of the last member of the group error out because [units hostagepatrol] just returns an array of objects within an array, use (units hostagepatrol) instead.

fair drum
#

mk so i need something like a IF then statement?

#

well it is in the condition box so that statement if it returns true should trigger it

#

the main error im getting is type array expected object

#

in the alive command

ruby breach
#

Several ways to go about it. for example ```sqf
(((units hostagepatrol) select {alive _x}) isEqualTo []) //all units within the group are dead

#

Probably also a better way with apply, but it's too late for me to think that through

fair drum
#

mk might need an explaination on the select command. im looking at the wiki for it and im kinda lost so far on it

ruby breach
#

(units hostagepatrol) select {alive _x} will return an array of all elements which satisfy the condition. In this case, it scans an array of objects and returns all alive objects

#

if that output is merely [], it means nothing satisfied the condition (in this case, nothing was alive)

fair drum
#

okay so units hostagepatrol is my group to array conversion and select is selecting all alive units in that array

ruby breach
#

correct

meager heart
#

findIf < also good option for that ^

#
(units hostagepatrol) findIf {alive _x} == -1
quasi rover
#
private _num = 5;

while { true } do {
  ....  _num  ... 
};

The _num in while { } stat. is not 5, because of different scope?

ruby breach
#

So fwiw I did a quick test, none of these finished all cycles.
Using a group of ~1200 dead units

(((units thisGroup) select {alive _x}) isEqualTo []) //0.976563 ms
(units thisGroup) findIf {alive _x} == -1 //0.761035 ms
{alive _x} count (units thisGroup) == 0 //0.777605 ms
{if (alive _x) exitWith {false}; true} forEach (units thisGroup) //1.35821 ms
fair drum
#

I did your first suggestion gnashes. it works well for the 8 units i have

#

could you explain this code to me?

for "_i" from 1 to 2 do {_x addItemToVest "30Rnd_556x45_Stanag";};

#

especially the 1 to 2 part

ruby breach
#

1 to 2 is just arbitrary there. Just means it'll loop through the given code using the variable _i with a beginning value of 1, incrementing by 1 until _i reaches 2

#

For example, if it were 1 to 10; the code block would be executed 10 times.

fair drum
#

why use that instead of just adding 2 magazines to the vest? this was just copied from an exported arsenal

ruby breach
#

Because if you're going to add more than a few mags, that is cleaner than repeating the same line of code 10+ times

fair drum
#

ok i see cause the only command that allows multiple magazine placement is addmagazines [mag, count] but this wants to put it in the vest so it cant use that

compact maple
#

@quasi rover it stills 5 in the while

quasi rover
#

Oh.. TBE thx.

still forum
#

@fringe yoke no public one. ACE Slack has a cba channel tho

unborn ether
#

Is there any way to replicate a vehicle namespace data to another vehicle, like something set with setVariable?

still forum
#

allVariables iterate through and copy each one

unborn ether
#

Oh, it supports objects. neat.

#

thanks

vernal mural
#

@still forum in several places you are mentionning static radios in TFAR, after v1.0. I do have this version, but I can't find anything like a static radio. Do I have to use a standard radio and configure it as static with some functions ?

still forum
#

Double click a radio in 3DEN

#

Doesn't work as good as I want it to with LR Radios though.

#

You can place a radio on a table. Double click it and pre-define it's frequencies

vernal mural
#

Oh great, thanks. Short range should be enough. What's wrong with LR ?

still forum
#

Backpacks are backpacks in 3DEN. but they are put into a weapon holder on game start.. which messes up things. As I'm no longer manipulating a vehicle. But a vehicle that's stored inside another vehicles container

#

Atleast I think it doesn't work right. I remember it being broken. Not sure if I fixed it in the meantime

vernal mural
#

Okay, I'll investigate, thx !

vernal mural
#

Is there a way to hide only the 3D model in A3 ? The hideObject commands also disable the simulation, which is not wanted in my case. Any idea ?

still forum
#

hideObject shouldn't disable simulation

#

but it might disable collision

unborn ether
#

^ hideObject don't disable simulation, it only "removes" GEOM and VIEW LODs

#

Any object hidden is still moving, shooting, dying, getting destroyed etc.

still forum
#

If it only removes GEOM.. Is fire GEO and physx GEO still there then?

digital jacinth
#

as player you can walk through solid object, but you still walk up stairs of buildings

#

it is weird

vernal mural
#

Actually it does disable simulation. I was trying to create a floating plateform, so I attached several parts to a simple jetski. So far, so good, everything behave as expected. But the jetski is visible in the structure. Using hideObject on it would effectively hide the jetski, but the plateform instantly stop behaving as a floating thing, moving along the waves.

#

Also when you try to attach a rope to a hidden object, the rope behave weirdly, mostly becoming stuck and unusable, and sometimes it's impossible to attach it to the hidden object

unborn ether
#
player hideObject true;
#

Still moving, shooting.

digital jacinth
#

you cannot disable simulation on a player

vernal mural
#

@digital jacinth yes you can

unborn ether
#

Since when?

strong shard
#

@digital jacinth you can

vernal mural
#

it stuck the player

digital jacinth
#

huh, weird it never worked for me..

still forum
#

@digital jacinth as player you can walk through solid object, but you still walk up stairs of buildings Geometry vs Roadway

digital jacinth
#

i only know you can get stuck in vehicles which have simulation disabled

unborn ether
#

hideObject doesn't disable simulation. Dot.

vernal mural
#

So why things get messed up when an object with attached parts gets hidden ?

#

and how to avoid it ?

compact maple
#

hey, i dont remember how can i setVariable on a player and make that variable unchangeable until he dc and variable get destroyed?

still forum
#

Only type you can make unchangeable is code

#

using compileFinal

compact maple
#

thanks you.

still forum
#

thank*

compact maple
#

thank then

brave jungle
#

Hey anyone free?

high marsh
#

@brave jungle Just ask your question. You don't need to get someone's attention to get a response

brave jungle
#

Is there a way to return the currenttimestamp that music is playing via playMusic?

high marsh
#

^

brave jungle
#

Wonderful :3

#

ty

manic sigil
#

I can add a magazine with addprimaryweaponitem, but not grenade rounds?

waxen tide
#

Can you delete map objects (say, a rock) with a script?

still forum
#

no

#

but you can hide them

waxen tide
#

Hm yes i just found that. But collision seems to be headache?

still forum
#

HideObject also disables collision

#

we just talked about that in this channel 2 hours ago

storm sierra
#

Anyone know if it's possible VIA scripts to make the new MK41 VLS fire a Cruise Missile at a remote target without manually controlling it with UAV Terminal?

brave jungle
#

There any special tricks to detecting keyDown EH in display 312? I've tried waituntil {!(IsNull (findDisplay 312))}; but it's sorta hit and miss

storm sierra
#

Any without Laser designator

waxen tide
#

@still forum thx will try it out. I'm not always reading this channel when my head is deep in the script sorry.

inner swallow
#

@storm sierra try reportRemoteTarget and then fire?

tough abyss
#

nearObject like command still see hidden objects or they disappear from that as well?

storm sierra
#

@inner swallow Thanks, that works

tough abyss
#

Is there any simple way to get all ammo classes a given vehicle can use?

#

Kinda like getCompatiblePylonMagazines but for vehicles without pylons.

tough abyss
#

If you want to filter out hidden objects - isObjectHidden

round scroll
#

wasn't there a SQF command to detect the mod source of an object?

strong shard
round scroll
#

thanks

waxen tide
#

I am trying to draw a line between two "areas" on the map that is defined by cities belonging to a different faction. Something like this: https://i.imgur.com/bZgquaB.jpg
The only way i can come up with is find pairs of opposite sided city locations and then find the inbetween position and use that point as a node on the line. But how do i find these pairs? Only thing i came up with was check distance between every single spot which is like 137*137

tame portal
#

Is each marker a position that can be taken by a faction?

waxen tide
#

kind of

tame portal
#

To be fair I only know of ways to do that in systems where each node has a set amount of connections to other nodes

tender fossil
#

Is it possible to allow sling loading for only certain types of vehicles?

tame portal
#

But your system sounds like it's supposed to be very dynamic

#

I believe you can disable slingloading manually via script if the vehicle allows it, but I don't know what properties a vehicle needs to allow that in the first place

#

@tender fossil

#

Idk why I tagged the other guy

tender fossil
#

Thanks!

waxen tide
#
array_1 = ["test"];
array_2 = array_1;
array_2 deleteAt 0;
systemChat format ["%1", array_1]; // []
systemChat format ["%1", array_2]; // []
#

wait ... what?

#

nvm .. but seriously caught me off guard.

waxen tide
#

wow ..... thanks!

tame portal
#

That arrays are passed by reference catches everyone off guard

#

Although it's kind of logical

waxen tide
#

good thing i started to check every step i code immediately with debug outputs before even attempting step 2.

tame portal
#

good old SQF Debugging

waxen tide
#

it's part of my "write some code, figure out what it does, proceed" approach.

queen cargo
#

Everything in arma is passed by reference ๐Ÿคทโ€โ™‚๏ธ

astral dawn
#

I wonder why they didn't add pointers to sqf then. Have to use arrays as pointer replacement. ๐Ÿคท

waxen tide
tulip smelt
#

Not really sure where to ask this, but.... I am making a mission where the players start off as civilans (blue units in "disguise") but on respawn I want them to respawn with the loadout they have at the mission start.

meager heart
#

if you are using respawn templates, you can just disable respawn on start, give them some "base" loadout and in respawn menu players will select they "another" loadout

#

@tulip smelt

tulip smelt
#

thankks

strong shard
#

@queen cargo only arrays, other types is passed by value

queen cargo
#

Nope @strong shard
Everything
Literally everything is passed by reference
Just that there are no commands to modify them ๐Ÿคทโ€โ™‚๏ธ๐Ÿคทโ€โ™‚๏ธ

still forum
#

@astral dawn because too complicated ๐Ÿ˜„ Would basically need to add another type for each type

astral dawn
#

Why, in SQF we have dynamic types. We could just have a type known as 'pointer to something', should be enough?

still forum
#

Ah yeah.. probably ๐Ÿค”

strong shard
#

@queen cargo ok, what about numbers? also reference? ๐Ÿ˜„

queen cargo
#

Yup

#

Check sqf-vm project of mine
Might understand then why ๐Ÿ˜‚๐Ÿ™ˆ

still forum
#

What's so hard to understand on Literally everything ?

queen cargo
#

The fact that it seems to the observer like those number are not passed by reference I guess ๐Ÿคทโ€โ™‚๏ธ

#

Dont know

mortal nacelle
#

Is anything wrong with this?

#
    "siren1",
    "siren2",
    "light1",
    "light2",
    "light3",
    "light4",
    "light5",
    "light6",
    "light7",
    "light8",
    "light9",
    "light10",
    "light11"
];
publicVariable "Config_Firecall_StationObjects";```
still forum
#

no

mortal nacelle
#

Lol, for some reason my mission is being a bitch about it..

still forum
#

if you get a error message you maybe should show it to us

waxen tide
#

admires Dedmens patience

mortal nacelle
#

Whenever my mission has something wrong with it, it always shows it as 'Task Force Radio is not deployed on this server'

#

Hold on checking RPT

still forum
#

That error is normal

#

seeks more distraction from doing actual work

waxen tide
#

carefully avoids looking over to the editor window

#

The good thing is, the more obscure bugs you create yourself, the better you get at finding them.

nocturne basalt
#

Hi guys. I would like to make a missilelauncher that locks on and fires at multiple targets at once. Anyone know if it can be done? In case, which functions would be used for this?

#

lets say I have 20 missiles and 10 enemies withing range, I would like 10 missiles to lock on to individual targets

waxen tide
#

Is there a way to call an sqf file in scheduled environment and recieve a return value from it without declaring it a function ?

still forum
#

call compile preprocessFileLineNumbers

waxen tide
#

Why no worky?

_map_array = _map_array call preprocessFileLineNumbers "conquer_10k.sqf";
_map_array = _map_array call preprocessFileLineNumbers "conquer_...'
Error call: Type String, expected Code
still forum
#

read what I wrote.

#

use your glasses

#

you a word

waxen tide
#

mumble mumble

#

Thanks i'll clean my ๐Ÿ‘“

velvet merlin
#

does hideObjectGlobal work all the time (vs hideObject: "When used on player, it only has an effect on third person mode. First person LOD is still visible. (A3 Dev 1.33)")

halcyon crypt
#

kinda sounds like if you hide yourself

velvet merlin
#

the problem is this in SP

#

in camera scenes you need to be nearby to hear conversations

#

so the approach was to move an unit ontop one of the convo guys

#

selectPlayer that

#

but hideObject it to not see the floating dude from the camera

#

in A3 that no longer works due to above bug

#

but havent tried the global variant yet

halcyon crypt
#

oh I see, you asked if hideObjectGlobal is better

#

my bad ^^

#

I guess it should work

still forum
#

it's because the first person model is rendered seperately if you are inside it

velvet merlin
#

but when you are in the camera, that shouldnt be the case, or doesnt have to?

#

(camCreate)

still forum
#

correct

velvet merlin
#

well it may be also a different bug. at least it no longer works in A3

oblique hare
#

Hi, i'm having a problem with ForceWeaponFire, i'm trying to make a dude fire full auto while playing an animation but it doesn't fire anything :[

#

bao switchMove "Acts_CrouchingFiringLeftRifle01";
sleep 1;
bao forceWeaponFire ["arifle_SUD_AK74", "FullAuto"];

("bao" is the unit i want to force fire,)

#

null = [] execVM "scrotum.sqf" (i put this in a trigger)

digital jacinth
#
bao forceWeaponFire [primaryWeapon bao, "FullAuto"];

You could try this, maybe the gun class was wrong

oblique hare
#

Giving it a try now

#

Nothing

#

I checked the list of the weapon's firing modes and FullAuto is in it

digital jacinth
#

does the animation work?

oblique hare
#

Yes

#

I've also put a hint after the forceWeaponFire

#

And it displays the hint

digital jacinth
#

does the unit fire without the animation?

oblique hare
#

I'll check

#

It does but not in FullAuto ๐Ÿค”

#

I'll try and change rifle

#

Nothing, let me try another animation

#

Doesn't seem to work on anims

#

Although i saw some machinimakers managed to use it

peak plover
#

            [] spawn { 
                for '_i' from 0 to 30 do { 
                    player forceWeaponFire [currentWeapon player,(weaponState player)#2]; 
                  sleep 0.1;  
                }; 
            };
#

does this not work in all animations?

oblique hare
#

Tried, doesn't work ๐Ÿ˜ฆ

peak plover
#

hmm

oblique hare
#

It only works if you're not using anims

tough abyss
#

@velvet merlin You can just move player camera there, the audio streams from where camera is. Could place an object at location even hide it, then switchCamera obj after youโ€™re done switchCamera player

velvet merlin
#

well this makes the audio not sound right as its from the wrong position, no?

tough abyss
#

How do you mean?

velvet merlin
#

maybe i dont understand right

#

there is two AI talking

tough abyss
#

The sound is stereo and depends on camera direction which depends on object direction

velvet merlin
#

the camera is somewhat off in most situations

#

the player is far off

#

currently the "player" is above the conversation via AI dummy and selectPlayer

#

and you hear via direct speech

#

aka 3d positioning dependent

tough abyss
#

Still not 100%. The audio would be from location as if player is there while player is elsewhere.

velvet merlin
#

so do you mean to use another object, instead of an infantry, to be nearby?

tough abyss
#

It would be simpler and you could achieve the same result as you are getting currently

storm sierra
#

Hello, stupid question incoming
I am using my own script to spawn infantry in an area, and I use CBA_fnc_taskDefend to make them patrol around.
Is there a way to prevent CBA_fnc_taskDefend from forcing the AI to take a swim and become impossible to find?
(Have a task that autocompletes as soon as enough infantry has been killed, but the infantry become impossible to find in a 500m radius area when half of them are hidden in the water)

Or should I just take CBA_fnc_taskDefend and make my own variant out of it with some "failsafes" to prevent it from placing waypoints into the Ocean?
(Thanks for Answers in advance)

plucky schooner
#

Hello, is there anyway to make a local variable on the client, public to the server without using publicVariableServer?

still forum
#

you cannot make local variables public anyway

#

as they are local

mortal nacelle
#

What would be the command to set the weather to sunny?

still forum
#

you first have to put it in a global variable.
Why don't you want to use publicVariableServer? That is literally the way to make a variable "public to the server" which is exactly what you asked

plucky schooner
#

The reason I dont want to use publicVariableServer is because the variable is changing. The variable is being overwritten by other clients.

still forum
#

If you want to transmit it you have to transmit it

storm sierra
#

To answer your question, I don't think there's a way to make a "local variable on the client, public to the server without using publicVariableServer", unless you make a function and execute it using remoteExec, but you'd get the same result as publicVariableServer that way anyway
If you want Clients to be able to update the variable for all other clients, use publicVariable

still forum
#

You are probably doing something wrong and there is a different/better way to do what you are actually trying to accomplish by sending that variable to the server

storm sierra
#

It might help us abit, if you tell us what you're trying to do with the local variable

still forum
#

yes

#

and?

peak plover
#

mine returns xyz

still forum
#

๐Ÿ˜ฎ ehhhh... Really really sure?

peak plover
#

ohh

#

No

#

no

#

my bad

#

Only parameter is reversed

#

Return value is normal

still forum
#

that would've been a apocalypse ^^

peak plover
#

But why ๐Ÿค”

still forum
#

cuz it's been xzy since forever

tough abyss
#

What do you think F in SQF stands for

still forum
#

function

tough abyss
#

Yeah fucktion

still forum
#

no

#

function.

velvet merlin
#

@tough abyss the problem is the units in the scene are moving at times. would need to move the object alongside

meager heart
#

is there any ez way to set EG spectator params/options (allowed sides, allow free camera, allow 3PP etc) without "initializing" it ?
so players can just start spectator from the respawn screen with "custom options" ? ๐Ÿค”

high marsh
#

Er. What?

#

Like, spawning in with the spectator menu enabled?

formal vigil
#

If I execute this line: ["SpawnNotification",["Rewards spawned on maps. Check markers."]] remoteExec ["BIS_fnc_showNotification",0,true]; with multiple people on server, let's say 3, it will execute the code on server and all those 3 people, right?

bronze pewter
#

It should from my understanding

#

the second parameter in the remoteExec function designated the client you want to execute that on

#

if 0 it's global

formal vigil
#

Right.

#

So, if I will, instead of showing notification, create a marker on map, there will be 4 markers on map?

bronze pewter
#

I think so

#

I actually have very little knowledge in arma3 scripting, i just did a little bit yesterday modifying a scenario off of github

formal vigil
#

So, to make sure that there would be only one marker, visible for all, what would the parameter value have to be?

bronze pewter
#

Took me a while to pickup on the keyword after if(condition) soooo ๐Ÿ˜„

#

I'd assume call a script that checks if it's the server

#
if(isServer) then {
[] execVM "TestServerSide\init.sqf";
};

[["Wow! It works!"],"sample_log",false] call BIS_fnc_MP;
hint "Done!";

Found from a google

#

Arent markers local though?

#

Let's you create a marker local to a player

high marsh
#

use remoteExec, not BIS_fnc_MP

bronze pewter
#

Yea that's 4 years old now

inner swallow
#

createMarker is global

bronze pewter
#

The post i got it from

inner swallow
#

createMarkerLocal is local

bronze pewter
#

This is where i say thanks capt

#

Would be a little less passive aggressive if there wasnt a documentation link a few posts above

inner swallow
#

I don't follow you

#

i just saw talk about remoteExecing createMarkerLocal ๐Ÿคท๐Ÿฝ

#

anyway

#

carry on

bronze pewter
#

Thought you were responding to my question

#

Which i already answered

#

So yea as established you should just need to use createMarker

#

Atleast i think ๐Ÿ˜›

formal vigil
#

So, let me explain what I'm trying to achieve:
I work on a mission with sectors to control. In each sector I have a trigger that's set this way: https://snag.gy/pQXbYB.jpg
This is the file executed in On Activation: https://pastebin.com/0h1TWVpJ

Problem is that when I tested and captured the sector it created everything two times.

bronze pewter
#

Use hatebin or hastebin for code sharing

#

It's a much nicer experience

#

I dont know the API enough to actually help

formal vigil
#

Things I'm considering:

  1. Ticking the "Server Only" checkbox in trigger
  2. Changing the remoteExec parameter
meager heart
#

@high marsh i mean when you start it from respawn menu, all of those option will be default from BIS_fnc_EGSpectator
for example "free and 3PP" cameras will be allowed by default, so it's possible to change it,
^ if someone need it just check BIS_fnc_EGSpectator file there is all the answers... ๐Ÿ‘Œ

formal vigil
#

FYI: 1st option did the trick. No duplicated spawns anymore

meager heart
#

oh also...

#
//--- How to return all sectors
private _allSectors = missionnamespace getvariable ["BIS_fnc_moduleSector_sectors", []];
formal vigil
#

great stuff, thanks @meager heart

#

yeah, now the problem is that people cannot join when the mission already started

tough abyss
#

Is it possible to make the I key inventory while inside a vehicle only show the gear side of things and make it so you can't put stuff inside the trunk while inside but you can move a gun from your bag to your primray spot? sorry for my english

digital jacinth
meager heart
#
_dog setPosWorld (getPosWorld _dog vectorAdd [0, 0, 1]);
```๐Ÿค”
digital jacinth
#

hmmm

#

probably look goofy, but then a playable dog is already goofy enough

digital jacinth
#

gah, nah. if you setpos the dog just cannot move for a few seconds. all these drawbacks because it does not inherit from camanbase

brave jungle
#

Hello, regarding the Zeus ping function, i'd like to keep the functionality that it offers, however slow down the amount of times it can be pressed. For example, detect when it was used, then sleep it for 30 seconds before allowing it to be pressed again.
Just not sure on a way to go about it. I tried the event handle but I'm not sure on how to delay the ability to spam it.

digital jacinth
#

probably better if you catch the key with in actionKeys "TacticalPing"

meager heart
#

hmmm

#
findDisplay 46 addEventHandler ["KeyDown",{if ((_this select 1) == 44) then {TRUE}}];
```bad example there that is the same as `if (true) then {true}`
```sqf
findDisplay 46 displayAddEventHandler ["KeyDown", {(_this select 1) == 44}];
``` ^ ๐Ÿ‘Œ
digital jacinth
#

addEventHandler also does not allow keydown, so that example is actually not working

#

maybe this?

(findDisplay 46) displayAddEventHandler ["KeyDown", {
  params ["_control", "_key", "_shift", "_ctrl", "_alt"];
  private _ret = false;
  if(_key in actionKeys "TacticalPing" && {(missionNamespace getVariable ["diw_lastping",time - 1) < time}) exitWith {
    diw_lastping = time + 1;
    _ret = true;
  };
  _ret
}];
#

lol now it does not work because of my german keyboard

#

actually the whole thing does not owkr as it looks like youc annot overwrite that action.

meager heart
#

actionKeys not reliable and inputAction too (both will fail with custom keybinds/macro/controllers... etc ๐Ÿคท)

digital jacinth
#

hah, funny i found a pist by dedmen. turns out it is bound by a missionnamespace variable

missionnamespace setvariable ["bis_fnc_curatorPinged_time", 99999999, true];
#

with this it would be possible to attach an eh to the curator which sets that variable for the unit remotely.

#

Just adding this to the init field of the curator module might work.

this addEventHandler ["CuratorPinged", {
  params ["_curator", "_unit"];
  systemChat format ["%1 pinged for zeus",name _unit];
  [0,{missionnamespace setvariable ["bis_fnc_curatorPinged_time",time + 5];systemChat "Ping received!"}] remoteExec ["call", _unit];
}];
vernal mural
#

Do one of you have any idea if it is possible to retexture the different screens spread all over the new USS Liberty ? I tried browsing all namespaces of the ship with

{ 
    _str pushBack allVariables (_x select 0); 
} forEach (dest getVariable "bis_carrierparts");
copyToClipboard str _str;```
where "dest" is the reference object of the destroyer in Eden, but the result is simply ``[[],[],[],[],[],[],[],[],[],[]]``. However all parts are correctly accessed, it just seems that there is no variables set otherwise. Is there another way to access those screens and eventually retexture them ?
viral ginkgo
#

Hi guys, just a quick question, wondering if anyone could help:

Iam trying to hunt down a weird bug in Antistasi Lord Golias edit:


//this sets up the Faction specific template
[_dict, "static_mg", "rhs_KORD_high_VDV"] call DICT_fnc_set;
[_dict, "static_mg_low", "rhs_KORD_VDV"] call DICT_fnc_set;
[_dict, "static_mortar", "rhs_2b14_82mm_vdv"] call DICT_fnc_set;

// compute lists of statics
{
    private _statics = [];
    private _type = _x;
    {
        if not ((_type == "static_mg_low") and (_x == "FIA")) then {
            // FIA does use "static_mg_low".
            private _static = [_x, _type] call AS_fnc_getEntity;
            if not isNil "_static" then {
                _statics pushBackUnique _static;
            };
        };
    } forEach ["CSAT", "NATO", "AAF", "FIA"];

    if (_type == "static_at") then {
        AS_allATstatics = +_statics;
    };
    if (_type == "static_aa") then {
        AS_allAAstatics = +_statics;
    };
    if (_type in ["static_mg", "static_mg_low"]) then {
        AS_allMGstatics = +_statics;
    };
    if (_type == "static_mortar") then {
        AS_allMortarStatics = +_statics;
    };
} forEach ["static_aa", "static_at", "static_mg", "static_mg_low", "static_mortar"];
AS_allStatics = AS_allATstatics + AS_allAAstatics + AS_allMGstatics + AS_allMortarStatics;```

At this point if I copy AS_allMGstatics into clipboard during the mission it gives me an array thats missing the "static_mg", "rhs_KORD_high_VDV" only has "static_mg_low", "rhs_KORD_VDV". Why is that? I would expect it to put both the static_mg and static_mg_low as per the code.

```sqf
if (typeOf _x in AS_allStatics) exitWith {_stcs pushBack _x;};```

Pushes back only the mortar but the composition has the MGs in it.
#
{
        _vehiculos pushBack _x;
        {
            private _unit = ([_posicion, 0, _crewType, _grupoCSAT] call bis_fnc_spawnvehicle) select 0;
            _unit moveInAny _x;
            _gns pushBack _unit;
        } forEach ([typeof _x, false] call BIS_fnc_crewCount);
    } forEach _stcs;```

And finally this throws a script error stating that the forEach _stcs is a number not an array.. it somehow changes to "Any".
#

All of this happens when Antistasi spawns in a composition from a template and tries to populate the static guns with infantry.

cosmic lichen
#

} forEach _stcs;) That bracket at the end? What's it doing there? Also where is _stcs defined?

viral ginkgo
#

that bracket was me just fighting the discord code formatting.. sorry will edit it out.. its not in the code itself

#

and private _stcs = []; is defined like this all the way at the top of the script

#

should be populated if (typeOf _x in AS_allStatics) exitWith {_stcs pushBack _x;}; here

#

the _x in this is every element thats in a composition built by BIS_fnc_objectsGrabber and saved into a usable template

meager heart
#

was me just fighting the discord code formatting
```sqf
code
```

#
if not isNil "_static" then
```you have there ^
viral ginkgo
#

sorry? not sure I understand

inner swallow
#

use three ` instead of one

#

and write sqf in front of it

#

and three to close

#

it will give you a colour coded code block

meager heart
#

do you have -showScriptErrors startup param, SomethingSimple ?

viral ginkgo
#

yeah

meager heart
#

no errors ?

viral ginkgo
#

12:27:17 Error in expression <it moveInAny _x;
_gns pushBack _unit;
} forEach ([typeof _x, false] call BIS_fnc>
12:27:17   Error position: <forEach ([typeof _x, false] call BIS_fnc>
12:27:17   Error foreach: Type Number, expected Array
12:27:17 File location\spawns\fnc_AAFhillAA.sqf [AS_location_fnc_AAFhillAA], line 63

#

only error I get

still forum
#

Yes.. That makes sense

#

BIS_fnc_crewCount would return the.. crew.. count.

#

which is a number. And you can't forEach through a number

viral ginkgo
#

ok, so the point of that block is to spawn a unit into every available slot within the vehicles as far as I understand it

#

should I just ditch the crewCount then?

#

ok, just tested without the BIS_fnc_crewCount and it does work.. no errors thrown around. The thing is that the script only picks up the mortar, not the static guns though.

#

if (_type in ["static_mg", "static_mg_low"]) then { AS_allMGstatics = +_statics; };

This part for whatever reason only counts the static_mg_low not the static_mg

halcyon creek
#

can anyone see if I have put something wrong here? brig playAction "Acts_B_M03_briefing";

#

Doesnt appear to be doing anything, i have it in a sqm file. the full code looks like this: ``` titlecut ["", "BLACK",0.2];
sleep 5;
titleCut ["", "BLACK in", 3];

brig playAction "Acts_B_M03_briefing";
JHF commandChat "DEBUG TEST";    

titlecut ["", "BLACK",0.2];
sleep 5;
titleCut ["", "BLACK in", 3];

if (local this) then {[A1,"SIT_AT_TABLE","ASIS",seat1] call BIS_fnc_ambientAnim};```

vernal mural
#

I'm having a hard time with script-spawning weapon systems on the USS Liberty. Weapons are considered as physx objects, so making them spawn on the deck products impredictable results. To the least, very imprecise placement. At worse, weapons are ejected in the sky because of small collisions with the deck. Using attachTo command, the object is not ejected, but it makes the AI in the weapon completely mad, and the turret stuttering. Ideas ? Is there already designed scripts for this ?

cyan valve
#

Hey, is there anyone here to help me out with some scripting in Zeus? I'm using the Iron Front mod in a single player Zeus scenario, and I'm trying to find a way to make the LCVP drop its ramp when it hits the beach. I went into the config file and found the statement of script to drop the ramp, but it wouldn't work in either vehicle init. or debug console, so I had someone design a new script for me that does work, but it relies on CursorObject and CursorTarget, so it doesn't work in Zeus, only first person. Does anyone know of a way to edit the vehicle name of an object in Zeus mode, or how to apply something to it directly?

#

This was the script that I pulled from the config file

#

"this say3d 'LIB_LCVP_Ramp_Open_1'; {this animate _x} forEach [['ramp_rotate',1],['roller_L0_rotate',1],['roller_L1_rotate',1],['roller_R0_rotate',1],['roller_R1_rotate',1],['shutter_rotate',0],['shutter_latch_L_translate',0],['shutter_latch_L_rotate',0],['shutter_latch_R_translate',0],['shutter_latch_R_rotate',0]]; if ([this,'LIB_LCVP_Fast_Landing',true] call LIB_Get_Variable) then {[this,'Ramp'] call LIB_LCVP_Fast_Landing}";

#

This is the script that works in first person

#

cursorTarget say3d "LIB_LCVP_Ramp_Open_1";

{
cursorTarget animate _x;
} forEach [
["ramp_rotate",1],
["roller_L0_rotate",1],
["roller_L1_rotate",1],
["roller_R0_rotate",1],
["roller_R1_rotate",1],
["shutter_rotate",0],
["shutter_latch_L_translate",0],
["shutter_latch_L_rotate",0],
["shutter_latch_R_translate",0],
["shutter_latch_R_rotate",0]
];

if ([cursorTarget,"LIB_LCVP_Fast_Landing",true] call LIB_Get_Variable) then {
[cursorTarget,"Ramp"] call LIB_LCVP_Fast_Landing;
};

#

But beyond that, I don't know what I can do.

#

And I know just about nothing about scripting, so the dumber you can make it the happier I'll be.

winter rose
#

@halcyon creek I can't check right now, but I think it should be playMove

halcyon creek
#

I got it by changing it to Switch Move

#

Thanks though ๐Ÿ˜ƒ

unreal siren
#

Hey guys! How would I go about overwriting a mod function in a mission file?

still forum
#

can't

#

if you are asking how to override his CfgFunctions entry.. Can't

unreal siren
#

Swore you could. I think Exile supports it, but maybe that's a special feature?

#

I need to extend functionality to this and I'd prefer not to require a new mod

still forum
#

You could try to create the function first by doing it in preInit

#

But I'd think mission preInit should fire after mod preInit

unreal siren
#

Hmmm...

#

Any way to overwrite this >With> A mod?

still forum
#

be the first to compile the function.

unreal siren
#

Without making a rebuild of the whole module

#

Ah...

#

Just need to append _nearThrowables , really.

#

But it's a private var

#

Is this possible?

still forum
#

don't see how.. In this case

unreal siren
#

Anybody know how to fix ACE not returning the right killer with the medical system, because it's handled via script?

digital jacinth
#

Take a look at acex kill tracker. the last damage variable is used and it is local to the unit only

unreal siren
#

Yeah, no luck. Replaced the _killer with it, works for getting AI kills against player (Returns player properly) but player deaths complain about an array instead of something else. @digital jacinth

#

That's working directly with the ace_medical_lastDamageSource var.

lean estuary
#

Is there any way how to make a explosion that when killed by it gives a killmessage like "Player1 killed player2" like normal explosions?

tame lion
#

@lean estuary do you need an answer to your question still regarding "Player X killed Player Y"?

unreal siren
#

I have a headache trying to read this code... lol https://gyazo.com/e3be09e796fa58ddac99a7e711e78e14
The red line, it says an Array cannot have an empty element. I literally have no idea what the intention was with the extra numbers and stuff... Where did the original port dude mess up? Array structure? extra elements?

   ["wep", >
22:26:32   Error position: <(2,5), RANDOM_BETWEEN(1,2)],
   ["wep", >
22:26:32   Error Missing ]
22:26:32 Error in expression < "launch_Titan_short_F"], RANDOM_BETWEEN(2,5), RANDOM_BETWEEN(1,2)],
   ["wep", >
22:26:32   Error position: <(2,5), RANDOM_BETWEEN(1,2)],
   ["wep", >
22:26:32   Error Missing ]

tame lion
#

where is that macro RANDOM_BETWEEN defined?

#

op... see it now that i clicked the link

unreal siren
#

Wasn't sure how to format it on here, so I took a picture with all the wonderful highlighting and erroring

tame lion
#

it happens further down in the scripting too with grenades or someting like that

unreal siren
#

How are you guys testing this btw?

tame lion
#

yeah i noticed too that some of the i guess "Options" for the script were not in arrays

#

im not testing, just eyeballing the script for poss errors

meager granite
#

@unreal siren If you see RANDOM_BETWEEN in your error means that macro didn't work

tame lion
#

thats what i was thinking too when the error was showing that but wasn't sure

meager granite
#

You actually have RANDOM_BETWEEN(2,5) in your script which is meaningless

unreal siren
#

I've never used macros personally

#

Some more useful info

#

Says a bracket is missing... and everything is wrong, lol

tame lion
#

if the script isn't getting Precompiled thats probably whats causing that issue too

unreal siren
#

Line 33 is suspect, why are there are there 4 elements instead of 3?

meager granite
#

Your macros are not processed, they are not defined in your script.

tame lion
#

is the script getting defined with compile preprocessFileLineNumbers?

unreal siren
#

Likely, the rest of the framework seems to- let me check

#

CompileFinal

#

fn_refillbox = compileFinal preprocessFileLineNumbers "scripts\server\a3w\scripts\fn_refillbox.sqf";

#

Inside init_missions.sqf, which in turn, is called the same way in initserver.sqf

#

Which is called in the init.sqf with the same, with an isserver check

meager granite
#

oh you have a screenshot in the post, I just looked at the error message

tame lion
#

seems like they should be getting compiled then unless that init_missions.sqf isn't geting called

meager granite
#

Yeah you're compiling the script wrong, macros are ignored

unreal siren
#

I'm not sure the guy knew how the wasteland sidemission system worked lol

meager granite
#

Do copyToClipboard str fn_refillbox and you'll have final look on the script after preprocessor

unreal siren
#

Gotcha

meager granite
#

Maybe your script gets put into variable elsewhere differently, overwriting this proper compile

unreal siren
#

Obviously this guy ported the sidemission system and tried to match the file structure without understanding how it's set up, neither do I, hence why I tend not to port stuff until I do, lol

meager granite
#

Though it should be compileFinal so it means its not compileFinal'd at all

tame lion
#

i know the feeling, i feel its easier sometimes to write my own system vs trying to port another in

unreal siren
#

Gotta pastebin, it's large.

meager granite
#

Well just see for yourself that macros weren't turned into code

unreal siren
meager granite
#

Oh they are turned into code

#

How do you execute the code where you get that error?

#

fn_refillbox is compiled properly, looks like you're not using it

unreal siren
#

It gets called when it's time to queue a new sidemission, but I don't remember if that's when it errors, or if it errors when the sidemission pops up.

meager granite
#

Check what side mission code does then

unreal siren
meager granite
#

Not that, where that script is actually used

unreal siren
#
// * This project is licensed under the GNU Affero GPL v3. Copyright ยฉ 2014 A3Wasteland.com *
// ******************************************************************************************
//    @file Name: sideMissionProcessor.sqf
//    @file Author: AgentRev

#define MISSION_PROC_TYPE_NAME "Side"
#define MISSION_PROC_TIMEOUT 45*60  // Time in seconds that a Side Mission will run for, unless completed
#define MISSION_PROC_COLOR_DEFINE sideMissionColor

#include "sideMissions\sideMissionDefines.sqf"
#include "missionProcessor.sqf";
meager granite
#

Just search for all mentions of fn_refillbox

unreal siren
#

Literally just the sidemissions that call it, and the function itself. That and the compile

meager granite
#

๐Ÿค”

unreal siren
meager granite
#

Well somehow, somewhere your script gets compiled without being preprocessed (through loadFile?)

#

Are you sure you didn't fix the script (lack of macros) and now trying to solve the issue that no longer exists?

tame lion
#

but that compileFinal should prevent that though, right?

meager granite
#

Maybe you just didn't have macros defined before and got the error, added macros and now trying to fix it?

#

Well if they try to save improperly compiled function into same variable

#

I assumed maybe he has something like call loadFile "...\fn_refillbox.sqf" somewhere

unreal siren
#

The thing is, the script definitely fires

tame lion
#

I'm not too familiar with the mission, but id say try launching it, and if you can, try forcing a side mission to fire and see if it pops the error in your test

unreal siren
#

And two-three boxes pop up which use those macros

tame lion
#

are their contents correct?

meager granite
#

My guess is that he already fixed the error, probably didn't have macro defined before and had the error

#

Also what's the point in maintaining CfgFunctions required file names and dir structure but still do all compileFinal manually ๐Ÿค”

unreal siren
#

I have no idea, lol

meager granite
#

(unrelated to error here)

unreal siren
#

If there's something I can improve on for my own stuff, please let me know

tame lion
#

not gonna lie, im lazy like that and just inLine all my functions too instead of cfgFunctions

meager granite
#

I don't use CfgFunctions at all

#

I believe you already have your error fixed @unreal siren just try the mission again I don't think it will error out.

unreal siren
#

I'll double check, I copy from my ssource to my missions folder for testing.

#

Same errors in sqllint

#

Typesqf*

#

Missing bracket

meager granite
#

Basically as you can see fn_refillbox has all macros replaced with actual code

unreal siren
#

Yeah

meager granite
#

But error had macro in it, meaning it didn't in that test where error fired.

unreal siren
#

Could the bracket also be around that same area?

tame lion
#

if a macro isn't defined, it shows up as a nil global var correct?

unreal siren
#

Nope, missions folder is same

#

I've also only experienced it at mission start...

#

So... That could be a big hint.

#

I think once I've seen it midgame

tame lion
#

even if the macro didn't fire, i dont think it would have affected a misplaced bracket, would it?

unreal siren
#

Line 73 [ needs closing bracket...

tame lion
#

hell, @meager granite could it even possibly be a namespace switch? I've only ever read about them but maybe the code is getting started in one namespace and continued in another?

unreal siren
#

Think I found it...

#

Oh God, that makes my head spin. I'm curious now

tame lion
#

i read about it on a killzonekid article once, i'd have to look it up again

unreal siren
#

I've got no dice, could the linter be wrong?

tame lion
#

but anytime i've experienced issues of a similar nature, when i couldn't find what was actually causing the problem of a variable going undefined, i would wrap my code in with missionnamespace do {} and sometimes it would fix the issue of variables going undefined

unreal siren
#

Can you confirm the brackets are correct?

tame lion
#

PM me the pastebin again for fn_boxrefill.sqf please, i lost it in the conversation

unreal siren
#

Done

unreal siren
#

@meager granite the comments in front of the Macros were included in the macro... lol

unreal siren
#

Also, my linter for Atom IO doesn't understand Macros, hence the empty array error.

unreal siren
#

Scratch, still errors.
Both still show errors in-editor (haven't tested the latest change), but what's the differene between ```sqf
#define RANDOM_BETWEEN(START,END) ((START) + floor random ((END) - (START) + 1))
#define RANDOM_BETWEEN(START,END) (START + floor random ((END - START) + 1))

meager granite
#

no difference

#

you can get rid of () around END-START too

meager heart
#
#define RANDOM_BETWEEN(A,B)  (floor (random [1, A, B])) 
#

also >

#define RAND(A)         (selectRandom A)
#define CRAND(A,B,C)    (ceil (random [A, B, C]))
#define FRAND(A,B,C)    (floor (random [A, B, C]))
#

first one is broken ๐Ÿ˜ƒ

#

random [1, 100, 200] < will return less than 100 too

#
#define RANDOM_BETWEEN(A,B)  ((A + floor (random B)) + 1) 
```something like that
#

idk why you need + 1 tho

tough abyss
#

Second one is broken too, you just confuse everyone with those.

halcyon creek
#

Been working on an Air support mission and had this script working perfectly, now all of a sudden it has stopped anyone see anything obvious as to why? ```sleep 60;

bomber sideChat "Bone-One-One is off hot, twenty six seconds to impact.";
sleep 26;
bomb="Bomb_04_F" createVehicle (getPos B11);
sleep 1;
bomb="Bomb_04_F" createVehicle (getPos B11_1);
sleep 1;
bomb="Bomb_04_F" createVehicle (getPos B11_2);
sleep 1;
bomb="Bomb_04_F" createVehicle (getPos B11_3);
sleep 1;
bomb="Bomb_04_F" createVehicle (getPos B11_4);
sleep 1;
bomb="Bomb_04_F" createVehicle (getPos B11_5);
sleep 1;
bomb="Bomb_04_F" createVehicle (getPos B11_6);
sleep 1;
bomb="Bomb_04_F" createVehicle (getPos B11_7);
sleep 1;
bomb="Bomb_04_F" createVehicle (getPos B11_8);
sleep 1;
bomb="Bomb_04_F" createVehicle (getPos B11_9);
sleep 4;
JTAC commandChat "Ugly callsigns, Knight Rider-Five-Six. You are cleared hot to engage any leakers on the bombs' impact.";
sleep 2;
CO sideChat "Ugly-Five-Zero, Copy That. Time on Target 30 seconds.";```

#

there is more code before and after but its just more sideChat and commandChat so im fairly sure its not that

meager heart
#

what is B11 ? some objects ?

#

if yes >

{
    private _bomb = "Bomb_04_F" createVehicle getPosWorld _x; 
    sleep 1;
} forEach [B11, B11_1, B11_2, B11_3....];
```also check this https://community.bistudio.com/wiki/forEach
peak plover
#

In case anyone is interested

#

A quick test lol

meager heart
#

looks like 3d Narnia map ๐Ÿ˜„

waxen tide
#

@peak plover super cool stuff, i have a great idea how to use that

peak plover
#

Good, that's why I posted it ๐Ÿ˜„ Maybe someone can get ideas or find it useful

meager heart
#

probably in all csi/star wars/future mods

fading yarrow
#

hey guys, do you know of any wonderous one-for-all script to persistently save and load a zeus mission including player state, vehicle state, container state, ai state and building state?

still forum
#

well @mortal yoke might know

sick sorrel
#

hey guys, I'm working on a vanilla mission where a 4-man team inserts by HALO, and when they have landed, they swap their chute for a backpack with their required gear. Right now, I'm using an addAction on the leader, that calls the following script:

// DEFINE _UNIT ARRAY
_unit = [X1,X2,X3,X4];

// REMOVE ALL BACKPACKS, REPLACE WITH KITBAG (MTP)

{removeBackpack _x;} forEach _unit;
sleep 2;
{_x addBackpack "B_Kitbag_mcamo";} forEach _unit;

// FILL KITBAG WITH 10x FAK and 1x MEDKIT
{(unitBackpack _x) addItemCargoGlobal ["firstAidKit", 10];} forEach _unit;
{(unitBackpack _x) addItemCargoGlobal ["mediKit",1];} forEach _unit;

// REMOVE ACTION
removeAllActions X1;
#

it works, but the problem is that everyone needs to wait until the last guy is on the ground, so I was thinking of swapping it around for a unitsBelowHeight or an isTouchingGround check

#

but how would I call / run the script only for the player that activates the trigger?

#

obviously I need to get rid of the forEach, but the only solution I can come up with is to put down 4 separate triggers, link them to each individual player, and have them all call the same script .. I'm hoping there's a cleaner option?

meager heart
#

thisList select 0 maybe

mortal yoke
#

@fading yarrow i`m not the maintainer of grad-persistence, you could either create an issue on github or ask @next parrot directly

sick sorrel
#

@meager heart like this?
if (isTouchingGround _unit) then {removeBackpack (thisList select 0)

and so on

meager heart
#

no... i mean in your trigger, thisList select 0 < that is player who activated the trigger

sick sorrel
#

ah, okay

#

in that case, I'd need an extra check to see if the player that activated the trigger is part of the array, right?

meager heart
#
player spawn {
    waitUntil {
        sleep 2;
        _this distance <something>
    };
    _this call tag_fnc_yourFunction;
};
``` "triggerless" option ^ into initPlayerLocal.sqf
#

_this distance <something> < or some "condition"

sick sorrel
#

what's the tag_fnc_yourFunction exactly? (pretty new at this whole scripting stuff ๐Ÿ‘ผ )
I'm guessing that's where I put the file location of the script?

meager heart
sick sorrel
#

I will, thanks

velvet merlin
tough abyss
#

That EH fires only on action list manipulation so the answer is probably no

#

What are you trying to block, maybe there are other ways

velvet merlin
#

we used it to block "target/locking" actions, as well as GL "selectAll" to stop abuse in PvP play

tough abyss
#

You can use inputAction to detect pretty much any combo including mouse, but you can only block key presses. So my suggestion, check if player has unusual bindings to overcome your restrictions and kick them out

velvet merlin
#

what is a non key press - joystick and mouse movement+wheel?

polar folio
#

is setObjectMaterialGlobal persistent in MP?

tough abyss
#

It should be @polar folio

polar folio
#

just wondering because according to the wiki it's not a server side command like hideObjectGlobal

tough abyss
#

Worth retesting, you never know ๐Ÿ˜‰

leaden venture
#

Does this new export to SQF function preserve dynamic simulation settings for groups?

compact maple
#

hi everyone, I just made a fresh installation of a server, I just installed ACE3 and CBA_A3, i want to configure all of theses ace 3 option with the new CBA Settings System, but i dont really know where to start

leaden venture
#

Connect to the server with any mission

#

Log in as admin

#

PRes ESC, go to configure, addon options,

#

Select SERVER tab,

#

Save settings when doen

compact maple
still forum
#

@polar folio being server-sided doesn't say anything about it being JIP persistent

compact maple
#

@leaden venture Seems i can do it in 3den editor

junior stone
#

someone know why this is not working properly?

private _map  =  _display ctrlCreate ["RscMapControl", 8200];
_map ctrlSetPosition [0.61125 * safezoneW + safezoneX,0.19 * safezoneH + safezoneY,0.198125 * safezoneW,0.28555556 * safezoneH];
_map ctrlCommit 0;
(_display displayCtrl 8200) ctrlMapAnimAdd [1, 0.1, [_mappos # 0, _mappos # 1, 0]];
ctrlMapAnimCommit (_display displayCtrl 8200);

The position is absolutly wrong

https://img.c0kkie.de/2018-08-05_05-39-37.mp4

errant jasper
#

You don't show how you compute _mappos.

polar folio
#

@still forum yea obviously. i was just comparing to hideObjectGlobal because of similar naming

junior stone
#

mappos are just position players cooridnates

#

only thing what i found is


Map control created with ctrlCreate have a weird behaviour. Control doesn't respect the aspects of Controls Group or Display itself. Results of ctrlMapAnimAdd applied to this control are also shifted for some reason.

In the wiki

leaden venture
#

Yeah its apparently some mod I'm running @compact maple

meager heart
#

i'm using ctrlMapAnimAddwith object and with coordinates... was no issues
(with RscMapControl created with ctrlCreate also ๐Ÿ‘Œ)

junior stone
meager heart
#

and i have just mapAnimAdd also works

junior stone
#

very strange that it is not working for me with ctrlcreate

#

๐Ÿ˜

meager heart
#

maybe you can try ctrlCommitted b4 ctrlMapAnimAdd ๐Ÿคท

junior stone
#

you mean

#
ctrlCommitted  (_display displayCtrl 8200);
(_display displayCtrl 8200) ctrlMapAnimAdd [1, 0.1, [_mappos # 0, _mappos # 1, 0]];
ctrlMapAnimCommit (_display displayCtrl 8200);
#

`?

meager heart
#

no

#
waitUntil {ctrlCommitted _ctrlMap};
_ctrlMap ctrlMapAnimAdd [1, 0.1, _position];
ctrlMapAnimCommit _ctrlMap;
junior stone
#

ah

#

nop same

#

the problem is since i use ctrlcreate

velvet merlin
#

any ideas what this is about

errant jasper
#

@junior stone After some testing: if you imagine your map control actually being part of a fullscreen map, and with the top-left of your control, being the top-left of this "imaginary" fullscreen map, then it seems to fit.

#

Though you would probably need some tricky calculation between the GUI sizes and the zoom you want to workaround it.

junior stone
#

hm

#

probably such thing

If animating the editor map (via the global variable "map") the desired position must be offset by a correction value, which can be calculated the following way (<V1.63):
// the offset depends on the screen ratio and the current map scale
_ratio = aspectRatio select 0;
_scale = ctrlMapScale map;
_offset = if (_ratio > 1) then {400} else {1224};
// apply the correction value to the desired position 
_pos set [0,(_pos select 0)+(_offset*_scale)];
// then move the map to that position
map ctrlMapAnimAdd [1, _scale, _pos];

Thats a part from the bisimulations

errant jasper
#

this shows me manually aligning the main map. If the smaller was as large as the fullscreen one, you can see how the center would fit my position (where the cursor is). https://imgur.com/a/THWjUEE

junior stone
#

hm^^

errant jasper
#

I guess you have to:

  • Compute how much your gui map takes up of the screen.
  • Find out how much "gui" it would have to be shifted
  • Convert the gui shift to coordinate shift to modify the "real" coordinate of the players into one that works with the dynamic map.
    ....
unreal siren
#

Here's a good one!
Shooting an AI (At least on a local host dedi, I think this doesn't work with headless clients) I get:

10:40:58 "[KP LIBERATION] [KILL] _unit is local to SturmFalke"``` Which is weird... It's reporting myself?

The following happens when a player either dies to AI, or dies to self.
```10:41:20 "[KP LIBERATION] [KILL] Kill Manager executed - _unit: O_G_Soldier_GL_F (O Alpha 1-1:1) - _killer:  (<NULL-object>)"
10:41:20 "[KP LIBERATION] [KILL] _unit is local to SturmFalke"

No error for first, but error for second.

10:41:13   Error position: <typeOf _unit, _unit, typeOf _killer, _ki>
10:41:13   Error typeof: Type Array, expected Object

#

I'm not getting any other diag either

#

So it's all kinds of fun