#arma3_scripting

1 messages Β· Page 686 of 1

spark turret
#

ah alright, well check the .rpt anyways and post the error in here

sharp peak
#

There is no error, I checked the RPT

spark turret
#

modules are just sqf code too

#

RIP

sharp peak
#

It simply doesn't return 'true'

cosmic lichen
#

@sharp peak That condition might never become true

spark turret
#

its evaluated on mission creation, is that a problem mabye?

cosmic lichen
#

It says it's executed on mission creation

#

but when exactly

sharp peak
#

Yeah, thats what I found to

#

elder_1 is a unit which exists on mission start

spark turret
#

maybe elder_1 isnt created yet when checked so it says "false"?

sharp peak
#

Is the issue that it spawns after intel_1?

cosmic lichen
#

if elder_1 comes after this entity in mission.sqm it might not even exist

sharp peak
#

Trying to spawn them after the other now

#

Indeed, it worked

#

Arma do be silly like that

#

Thx for helping figure it out)

spark turret
#

how did you change spawn order?

sharp peak
#

I put down a new object

#

Otherwise you can also edit the mission.sqm by hand

#

and just spawn the two objects around in places

cosmic lichen
#

This condition of presence is more meant to be used for things like (difficultyOption "friendlyTags") > 0

sharp peak
#

Thats whats so beautiful about Arma, meant for one thing - (somewhat) works for other))

cosmic lichen
#

Would not be a problem if the tooltip was not so generic

hollow laurel
#

Been trying to get a script that practically disables players from drowning to work. It doesn't. Something odd I noticed is that if you're experiencing the drowning effects and execute this it WILL bring your oxygen up to max, but it won't stay that way/it won't loop. Anything I'm doing wrong?

while {underwater player} do {
player setOxygenRemaining 1;
};```
cosmic lichen
#

!isAbleToBreathe player;

hollow laurel
#

lemme try that out

cosmic lichen
#

About underwater

hollow laurel
little raptor
#

Use waitUntil

little raptor
#

It won't stay

sharp peak
#

So if I have unit1 spawn when unit2 exists, that works. But object1 when unit2 exists - object1 will be instantly deleted

hollow laurel
#
waitUntil { 
if (!isAbleToBreathe player) exitWith { setOxygenRemaining 1 }; 
};```
#

Something like this maybe?

hollow laurel
little raptor
#

What that loop does is execute the code while the player can't breathe
If he can breathe the loop exits

hollow laurel
#

So once the player leaves the water, it won't reactivate?

little raptor
#

Ye (and if he's not in the water at the beginning it never executes)

#

I'm talking about the while one

hollow laurel
#

Yeah yeah

little raptor
#

Your waitUntil is nonsense

hollow laurel
#
waitUntil { sleep 1; !isAbleToBreathe player } player setOxygenRemaining 1;```
little raptor
#

You don't really need a condition

copper raven
little raptor
#
while {true} do {
player setOxygenRemaining 1;
sleep 1;
}
#

It won't matter if he's in water or not 🀷

tidal ferry
#

Hey, so does anyone know what the best way would be to get a logo to appear at the exact center of the screen?

#

I'm trying to use structured text and titleText/bis_fnc_dynamicText but having mixed results

#

Nvm, got it

hollow laurel
#

Just wondering what was wrong with this?

waitUntil { sleep 1; !isAbleToBreathe player } player setOxygenRemaining 1;```
little raptor
#

And it checks a useless condition

#

Like I said, who cares if the player can breathe

hollow laurel
#

i suppose

spark turret
#

if the condition is never true, it wont exit the loop

jade acorn
#

do Arma 3 animations have any kind of declaration whether they can be played with switchMove or not?
I have this code:

a_4 setBehaviour "CARELESS";
0 = a_4 spawn { 
waitUntil {time > 0}; 
a_4 switchMove "Acts_CivilListening_1"; 
while {alive a_4} do { 
waitUntil {animationState a_4 != "Acts_CivilListening_1"}; 
a_4 switchMove "Acts_CivilListening_1"} 
};```
and it works perfectly with `Acts_CivilListening_1` while it freezes when used with `HubStandingUB_idle1`. I don't really see any answers why does it happen, I don't see anything special in the animation config either. I tried changing switchMove to playMove and playMoveNow but then the animation doesn't even start
jade acorn
#

the only thing I have noticed is that Acts[...] is defined in Biki as "Actions" while the Hub[...] thing is "States"

little raptor
#

There's no guarantee that the unit can exit the animation state

#

It depends on the connections/interpolations

jade acorn
#

i tried both but the animation either freezes on it's first frame or doesn't start at all.

jade acorn
#

Yes, certain animations like the one I mentioned simply freezes

little raptor
jade acorn
#

So can it lack connection within this one animation? Because my problem is not tha it doesn't loop - the animation just does not end, it stops after the first frame.

broken forge
#

How would I go about selecting two ai from an array then getting the two ai to have a random conversation

#

I have 9 different topics to chose from and 4 ai, I would like to get a1 and a2 to pick one of the 9 topics and start a conversation, and then have the same done for b1 and b2.

little raptor
broken forge
#

@little raptor I kind of get what you're saying but I'm not fully understanding it, could you provide an example?

little raptor
#

Although you don't need the floor

little raptor
#

I assumed they are

#

Also do you want to pair them up?

cold mica
#

The following code changes the position of option_2 instead of the caller. I want the caller to change it's position when activating "Spectate CQB". Any advice on the matter?

option_2 addAction [
    "Spectate CQB",
    {
        params ["_caller"];
        _caller setPos (getPosATL entrance_spectator);
        _caller addAction [
            "Exit Spectate",
            {
                params ["_target"];
                _target setPos (position option_2);
                removeAllActions _target;
            }
        ];
    }
];
cold mica
#

dang. What are my params supposed to be?

little raptor
#
params ["_option_2", "_caller"];
#

since you don't need option just skip it with ""

cold mica
#

Wow. Both methods you mentioned worked. I understand params far less now lol

little raptor
little raptor
cold mica
#

if it works, it works

little raptor
cold mica
#

does the Exit Spectate action even need a "" param?

little raptor
#
params ["_target", "_caller", "_actionId", "_arguments"];
cold mica
#

oooooh, it's in order of the default params

#

that explains a lot

little raptor
#

it just assigns array elements to private variables

#
[1,2,3] params ["_1", "_2", "_3"]; //_1 is 1, _2 is 2, _3 is 3
cold mica
#

For some reason, I just thought it "initialised" variables of a particular functions. So if one wanted to use _target, they'd need to make a params with _target.

little raptor
#

no

cold mica
#

thanks for the help, leopard!

little raptor
#

np

cold mica
#

here is the version with Leopard's improvements:

option_2 addAction [
    "Spectate CQB",
    {
        params ["", "_caller"];
        _caller setPosATL (getPosATL entrance_spectator);
        _caller addAction [
            "Exit Spectate",
            {
                params ["_target","", "_id"];
                _target setPos (position option_2);
                _target removeAction _id;
            }
        ];
    }
];
spark turret
#

i have an ace selfaction, which should only be availalbe to Zeus. how do i test if a unit is a zeus?

#

allCurators biki tells me: Returns list of all curator logic units, not the units assigned to the logic.
which i dont know what that means

#

ah maybe its the gamemaster editor module?

cosmic lichen
#

Try this

spark turret
#

maybe this?
_dude in (allCurators apply {getAssignedCuratorUnit _x});

#

ah thanks revo

cosmic lichen
#

Let me know if it works. The biki description could need an update.

spark turret
#

not exactly what i hoped to hear, but sure lol will keep you updated

#

it says false, even tho i have zeus

cosmic lichen
#

(β•―Β°β–‘Β°οΌ‰β•―οΈ΅ ┻━┻

spark turret
#

πŸ˜„

cosmic lichen
#

gettext (configfile >> "cfgvehicles" >> typeof _curator >> "simulation") == "curator"

#

That's all it does

#

so yeah you need to use assigned* with allCurators

spark turret
#

hint str (allCurators apply {getAssignedCuratorUnit _x});
seems to do the job

sacred slate
#

can some one help me to make a kill eventhandler? it has to give 250 money for each kill to a variable, in this case if west and east units are killed by resistance. also if resistance kills a civilian it should substract 1000 money. i have here somthing that was made for a earlier stage: https://pastebin.com/QyfVu1e0

spark turret
cosmic lichen
#

Yeah, because it returns false

spark turret
#

not just my action, all actions

cosmic lichen
sacred slate
#

i have no clue. i cannot code yet. i can rudimentary get stuff done alone. i learned all from sqf so far.

spark turret
#

ah im dumb, it put it in the childcode, isntead of condition, thats why ace broke

cosmic lichen
#
if (side _killer isEqualTo independent && side _killed in [east, west]) then {add money};
if (side _killer isEqualTo independent && side _killed isEqualTo civilian) then {substract money}
sacred slate
#

epic thx!

#

haha

winter rose
#

side group _killer / _killed

#

@sacred slate

#

it also means that friendly fire is rewarded

sacred slate
#

well, the script of the pastebin causes also the substraction to east and west kills

#

thx lou, but i am not familar where in between i should add that

cosmic lichen
#

if (dmpPlayerCash < 0) then {dmpPlayerCash = 0;}; use max command here

sacred slate
#

3 max 2; // Result is 3

winter rose
# sacred slate 3 max 2; // Result is 3

more like this:```sqf
addMissionEventHandler ["EntityKilled", {
params ["_killed", "_killer", "_killerID"];

if (_killer != player || { side group _killer != independent }) exitWith {};
if (side group _killed in [east, west]) then { dmpPlayerCash = dmpPlayerCash + 250; };
if (side group _killed isEqualTo civilian) then { dmpPlayerCash = dmpPlayerCash - 1000; };
dmpPlayerCash = 0 max dmpPlayerCash;
hint str dmpPlayerCash;
}]

copper raven
spark turret
#

i used

(_target in (allCurators apply {getAssignedCuratorUnit _x}))
copper raven
#

yeah that's way slower ^^

spark turret
#

agreed but its an array of one person usually πŸ€·β€β™‚οΈ

#

ill put yours into a todo πŸ™‚

sacred slate
#

many thanks @winter rose

spark turret
#

any quick check if a helo is able to fly?

winter rose
#

canMove mayhaps?

#

(no, there is no canFly πŸ˜›)

spark turret
#

ugh im refactoring a helo supply script, which was never meant to be zeus usable. i hate frontend

spark turret
#
    {
        player sideChat "He's nailed on the ground! Now hurry!";
    };

where else would he be nailed? in the sky? biki do be like that lol

winter rose
sacred slate
#

@winter rose should the eventhandler work for a hc unit far away?

winter rose
#

yes

sacred slate
#

for the hc far away i am not sure, but a close squad member wont trigger it.

winter rose
#

where did you add the EH…?

sacred slate
#

the init.sqf does execVM "scripts\dmp\moneyonkill.sqf";

winter rose
#

and are you an independent unit…?

sacred slate
#

yes

winter rose
#

try setting systemChats to debug? because it should work ^^

#

also, the dmpcash var should be defined somewhere too

sacred slate
#

oh well its drongo's map population, and i am in the editor with it.

#

and it does work πŸ˜„

#

at least for the player

winter rose
#

well yeah, it is a local script

sacred slate
#

@winter rose so its not possible to make that for all fighting units?

winter rose
#

what are you trying to achieve? your code specifically says "if you are not the player, exit"

sacred slate
#

ohhhhhhh

#

yeah that was once the case.

#

i just would like the handler happening side based

winter rose
#

but removing that won't help much more
what is the end goal?

one moneypot per side?

sacred slate
#

yeah the money is for resistance

#

enemy is east and west

winter rose
#

then you cannot use a local "per-client" script, but a server-script

sacred slate
#

i am in a lan free single player scenario, i would like to keep it that way. so thats a no go?

winter rose
#

server-side script can happen in SP too - the machine "is" a server

#

so yeah just remove the player check and then it will be fine - script won't be MP compatible and that's it

sacred slate
#

haha how do i make the civ kills only for the player? πŸ˜„

#

also the handler even triggers if the enmy kill each other. but there could be another cause for that.

#

drongo map pop can read any mixed units and put them on a side. some how that behaves strange at start

#

well the civ punishment could happen for whole resi, but not for east and west, i maybe have to slow down the test trigger. but it looks like it does all kind of wild mixed things

winter rose
sacred slate
#

ok i will try.

#

is the last pastebin link correct?

winter rose
#

that's my code 😎 so perhaps

sacred slate
#

i mean i just commented the player check

spark turret
#

if you dont check for players, then an AI soldier killing an AI soldier will trigger dmpPlayerCash

#

the eventhandler fires for all units its attached to, regardless of who killed who

sacred slate
winter rose
#

no

#

but please, read the coud aloud, it really helps

sacred slate
#

ok

#

ok i did read it lol: if side killer is equal ind and side killed is equal civ, then

#

oh. while side ind and killed is civ

#

maybe..

broken forge
winter rose
sacred slate
#

yeh thats true. the learing to exploit ratio is quite harsh. still i rly contribute if i can. but surly not in scripting yet.

winter rose
#

no worries, it was the expression itself that made me chuckle πŸ˜‰ there is no shame in not knowing everything, otherwise everyone should be πŸ™‚

sacred slate
#

in the end that was the beginning we forgot everything.

#

the art of coding without coding.

winter rose
#

When starting from scratch if you know what you want but miss the specific steps to get to your point, it is a good practice to write down in your native language what you want to do. E.g Get <all the units> <near the city>, and <for each> <west> soldier in them, <add 30% damage>.

sacred slate
#

yeah i noticed how that all ready affect my daily routine some how πŸ˜„

winter rose
#

the starting point here would be "boom! someone got killed. now what?"

spark turret
#

uh is this "_myFunction = compile preprocessFileLineNumbers "myFile.sqf";" the best way to use functions?

#

theres no mention of the description functions framework in that page

spark turret
#

also, where do i read up on sqf compilation? ("interpretation" idc)

still forum
#

read up what?

spark turret
#

read up to figure out how sqf is read by the computer so i can write most performance efficient, ideally compiled code

#

to avoid on-runtime-interpretation

#

or however that works

winter rose
little raptor
#

that's the only rule to sqf

#

if there's an engine alternative, pick that one

#

e.g. don't use findIf if you can use find

#

don't use loops as much as possible

#

don't use ifs as much as possible

zenith edge
#

there is a biki page for 'optimization'

#

gives you faster alternatives for common 'functions'

little raptor
zenith edge
#

that and just using good programming logic

spark turret
still forum
#

Less code == more efficient.
Thats about all of it

spark turret
#

well, where do i find out how it works πŸ˜„

still forum
#

nowhere

spark turret
#

rip

zenith edge
#

blackbox

little raptor
#

everything is an operator, and executes at runtime

#

even if (true)

spark turret
#

ill just keep using
while {true} do {["uwu"] execVM "iron_function.sqf"}; then

little raptor
#

wat?

still forum
#

syntax error

spark turret
#

are description declared functions also interpreted at runtime as loadfile -> string -> interpret?

zenith edge
#

while true, eww

winter rose
#
waitUntil { ["uwu"] execVM "iron_function.sqf" ; false };
```here, I optimised it for you πŸ˜„
little raptor
still forum
little raptor
#

just loop the code

spark turret
#

so correct me if im wrong:
a normal "myfile.sqf" which i execVM from somewhere is compiled at runtime, which is slow.
is there a way to compile it at missionstart to keep load away during mission instead (as a description.ext declared function)?

spark turret
still forum
#

execVM loads script from file and compiles it yes

#

compile it once and store it in a variable, using CfgFunctions for example.
And then call/spawn it

#

execVM equals spawn compile preprocessFile

spark turret
#

okay, so CfgFunctions are better, bc they compile at missionstart once, instead of when they are called

still forum
#

Everything thats not execVM is better

#

unless ofc you're only ever executing it once

sacred slate
#

is any of those both right?
if (_killer != side group player) exitWith {};
if ({ side group _killer != independent }) exitWith {};

spark turret
little raptor
sacred slate
#

yeh i have that still on my list

spark turret
#

_killer != side something is wrong, youre comparing a unit to a side

little raptor
#

not code
{ side group _killer != independent } is a code (because it's wrapped in {})

spark turret
#

^

#

{uwu} is code. (uwu) is a condition

#

or arithemetic or anything else

#

depending on uwu

sacred slate
#

why is (position player) a condition

little raptor
#

it's not

#

who said it is?

sacred slate
#

cause it has ()

little raptor
#

a condition is something that evaluates to a boolean (true/false)

sacred slate
#

i tried to read some scripting basics

#

makes more sens if its jumping one in the face

little raptor
#

it's only used to group statements

spark turret
#

well it groups stuff together so anyting inside is evalutaed before its passed

sacred slate
#

how do you call the () in (position player)

spark turret
#

yeah, thats what i mean by grouping

little raptor
sacred slate
#

ok thx

spark turret
#

us round brackets for readability and to ensure the execution order is what you want

little raptor
spark turret
#

((3+1)*5) = 15 and (3+(1*5)) = 8

little raptor
spark turret
#

lets agree to disagree (and im right oc)

little raptor
#

no

spark turret
#

my nemesis are one-liners without brackets

winter rose
#

🍿

#
if not alive player then compile "hint ""lol"""
zenith edge
#

() are how you assert dominance

winter rose
#

(((@zenith edge))) then 😎

spark turret
#

(define subsets(lambda (org)(letrec((worker(lambda (in accu)(match in((make-pair x xs) (worker xs (append accu (map (lambda (y) (append y (list x))) accu))))(empty accu)))))(worker org (list empty)))))

zenith edge
#

perfectly readable

spark turret
#

is there an easy way to measure how much a helicopter is in danger (while approaching his LZ?)

#

_myHelo.pilot.getPanicValue()

winter rose
#

define "danger"

winter rose
broken forge
#

@little raptor To answer your question from last night, I have 4 ai placed down, and I would like to pair them up with random conversation topics.

spark turret
#

well, danger of being shot down. i want to decide if the LZ is to hot for a supplydrop or not

#

maybe hit eventhandlers on the Heli and a max count?

cosmic lichen
#

Just define the LZ area and check how many enemy units are there and how many of them have AA etc

spark turret
#

but that would magically know about hidden untis

cosmic lichen
#

use knowsAbout or whatever

spark turret
#

hmhm yeah

winter rose
#

nearEnemies something?

cosmic lichen
#

Why do hidden units are important anyway?

#

Is it a player flying the heli?

spark turret
#

select {helo knowsabout _x > 0.5} or sth

#

no, its an AI helo

#

but i rather have it react than act with magic knowledge

winter rose
spark turret
#

ill try both, hit EH, and knowsabout nearEnemies

cosmic lichen
#

if hit EH fires when a stinger hits the heli he sure knows it was too hot

spark turret
#

yeah, but thats realistic tho

winter rose
#

for a fraction of second only, let's hope the scheduler isn't busy then πŸ˜„

spark turret
#

you dont know before you dont get hit

broken forge
#

@winter rose I looked more into the bis_fnc_kbtalk, and I saw that's there's a param that can be pasted to enable an array for actors. I implemented it and it worked for me when I want a different ai to start a topic then the one defined in the .bikb file

jade acorn
spark turret
#

time to redesign my helo supply script into an FSM

#

bc i hate Zeuses and want the helis to be even less controllable

broken forge
#

@little raptor Well I have them placed down in pairs of two, and I would like to get all 4 ai to have random conversation with the ai that they're paired with.

lavish sparrow
#

How can I force the spawn of Zeus once the player joins? Right now the player get the respawn menu, which causes a 'buggy' respawn screen since I also force Zeus to open and stay open.

#

I had a look at a few possibilites. But none of them work, or I use it wrong.

patent lava
#

hmm maybe on the initlocal, check if the player is a zeus and if not just kill the player?

lavish sparrow
#

Huh?

patent lava
#

instead of using respawnOnStart, add a bit of code in the initPlayerLocal.sqf that checks if the player has access to zeus, and if not, kill the player so it forces the player that isn't a zeus to the respawn screen

lavish sparrow
#

initPlayerLocal.sqf where can I find this?

#

I have little experience in scripting.

patent lava
#

create that file at the root of your mission folder

little raptor
lavish sparrow
#

I hate programming and scripting with a passion.

patent lava
#

that's not good

#

typing something out now, standby

spark turret
lavish sparrow
#

I am not.

#

I am a network administrator.

#

Fuck them programming languages. Although... I must have to succumb to it sometime.

patent lava
#
if (isNull getAssignedCuratorLogic player) then {
    player setDamage 1;
};
#

put that in the initPlayerLocal.sqf

#

anyone that does not have zeus should be killed, and anyone who does shouldn't

lavish sparrow
#

That's not what I need.

#

I need to have the player who is Zeus to be forced to spawn.

#

Because I have zeus mode forced. So the spawn screen bugs out and is black.

#

Zeus needs a helping hand and be forcefully spawned.

patent lava
#

so in your case the first thing the players see is a respawn screen?

lavish sparrow
#

Yes.

#

And that should be, except for Zeus.

patent lava
#

set respawnOnStart to 0

lavish sparrow
#

Because Zeus gets a respawn screen, but the game also forces the zeus menu open it bugs out and gives a black screen.

#

And where do I fill that in?

patent lava
#

description.ext

#

create that in your mission root

#

and add

lavish sparrow
#

Wouldn't that make it so everyone has an instant respawn on start?

patent lava
#

respawnOnStart = 0;

#

well 0 sets it to false

#

so it disables respawn on start

lavish sparrow
#

Yes. But again, only Zeus should have that.

#

Not all players.

patent lava
#

afaik you can't only have certain people start with a respawn screen and other not without a bit of code

lavish sparrow
#

I completely understand that.

#

So that respawnonstart needs to have something that checks if the player is Zeus.

#

Right?

patent lava
#

not respawnonstart itself

#

that's a parameter you put in description.ext, which acts as a config file for the mission

lavish sparrow
#

I understand.

#

But it needs something that checks if the player is zeus.

patent lava
#
// initPlayerLocal.sqf
if (isNull getAssignedCuratorLogic player) then {
    player setDamage 1;
};
lavish sparrow
#

I understand everything you say, but I just don't have the brain power to comprehend the logic on how to build it.

patent lava
#

create a file in the mission root called initPlayerLocal.sqf

#

then add that code above

lavish sparrow
#
if (isNull getAssignedCuratorLogic player) then {
    respawnOnStart = 0;
};
#

Would this help?

patent lava
#

no

#

respawnOnStart should be in the description.ext file

#

create a file named description.ext

#

then put

#

respawnOnStart = 0;

lavish sparrow
#

This would force it for all players.

patent lava
#

yes

lavish sparrow
#

That, again, I do not want.

patent lava
#

but the code forces the players that don't have zeus to respawn, to which it sends them to the respawn screen

lavish sparrow
#

If there's no spawn?

patent lava
#

huh

#

what do you want other players to do?

lavish sparrow
#

That they get the respawn screen so they can select a respawnpoint.

#

But the zeus player NEEDS to respawn with that menu appearing.

patent lava
#

you mean without that respawnmenu appearing

lavish sparrow
#

Yes

#

But only for Zeus.

patent lava
#

do you have a respawn point?

lavish sparrow
#

For zeus?

#

Yes

patent lava
#

for players in general

lavish sparrow
#

Only for Zeus.

#

Which is on the Civilian side.

#

Other players are blufor

patent lava
#

but other players have to respawn too right?

lavish sparrow
#

No. Zeus needs to place a respawn first.

#

I want it to be like the normal real zeus mode.

#

Where players need to wait for a respawn point to be placed.

#

But where Zeus starts right away.

#

@patent lava
Would this work on the localplayer.sqf?

if (isNull getAssignedCuratorLogic player) then {
    respawnOnStart = 0;
};
#

If not, why not. I don't understand the scripting logic at all.

cosmic lichen
#

Isn't respawn on start a mission config value?

little raptor
#

it is

lavish sparrow
#

Is what I want achievable?

#

forceRespawn player;?

spark turret
#

someone got a suggestion for "isTouchingGround _myHelicopter" but it includes landing on builds or anywhere else?

patent lava
lavish sparrow
#
if (isNull getAssignedCuratorLogic player) then {
    forceRespawn player;
};```
#

Like this?

#

And where do I then putt this in?

patent lava
#

yes, initPlayerLocal.sqf in your mission root

lavish sparrow
#

Lets try.

#

Now it gives me respawn disabled as zeus.

patent lava
#

do you have a file named description.ext with respawnOnStart = 0; ?

lavish sparrow
#

No

#

Because that, again, would make everyone respawn. I don't want that.

patent lava
#

it wouldnt

#

because it's set at zero

#

have you tried it?

lavish sparrow
#

Let me try.

#

Still at the respawn screen.

#

Respawn disabled

#
if (isNull getAssignedCuratorLogic player) then {
    forceRespawn player;
};```
patent lava
#

the code isn't the problem

lavish sparrow
#

In the initlocal thingy

#

And the other one in the description thing.

winter rose
#

PS: no respawn in Eden Singleplayer (just to be sure 😬)

patent lava
#

that's a good one

lavish sparrow
#

I run it as a server, locally.

#

I know what I do in that regard.

patent lava
#

so im trying it myself now and indeed it is showing the respawn screen for both even though the description.ext has the respawnOnStart = 0

#

yeah that's really trippy wow

#

working on a solution now

spark turret
#

whats up with the FSM editor for arma 2, does that exist for arma 3=

#

?

winter rose
patent lava
#

@lavish sparrow i have no idea honestly, can't help you

lavish sparrow
#

It's fine.

#

I will figure it out. Somehow.

patent lava
#

goodluck

#

looking forward to the solution haha

lavish sparrow
#

respawnOnStart = 0; for now is better than nothing.

#

But if I do find a solution, I'll let you know.

#

Actually...

#

Is there just no wait to add the 'virtual' side to the game?

#

Like the real Zeus modes have.

patent lava
#

i tried it actually with that

#

but that didn't work

lavish sparrow
#

How do I add a virtual side?

patent lava
#

maybe with more trial and error, but i have other plans tonight haha

lavish sparrow
#

I will figure it out somehow.

tough abyss
#

Scripting wise can I search for a particular type of logic and then link a created entity too it?

I take it synchronizedObjectsAdd goes about adding a the thing to the logic object assuming I have a reference to it, do I just find an existing logic object with allUnits since its created with createUnit?

#

allCurators is game logic objects or something else?

winter rose
#

Returns list of all curator logic units, not the units assigned to the logic.

spark turret
tough abyss
#

Ah so not that then. nearestObject should find it I presume given I have its type?

astral dawn
#

maybe you can use "entities" command?

split notch
#

is it possible to make a truck a UAV truck? so once you get in it you have access to a uav terminal?

#

if so what is the code you would run in the object init of that vehicle

little raptor
split notch
#

@little raptor hmmm there are multiple uavs going up and spawning so i'm not sure how that would work

tough abyss
#

yea same question, is there suppose to a func to call up that uav terminal screen ???

little raptor
little raptor
split notch
#

full uav controls

#

this addAction ["UAV-Terminal","cw_terminal.sqf"];

#

would this work?

little raptor
#

what is cw_terminal.sqf?

split notch
#

i'm sorry

#

i've confused myself

#

one sec lmfao

#

just looking thorugh forums posts

#

i just wnat to add the UAV terminal actions to a vehicle

#

so like instead of using a terminal on your body, you have to go into a specific vehicle

little raptor
#

yeah I get that

#

I just found an action for opening the UAV terminal UAVTerminalOpen

#

ok so I think you can do this:

little raptor
#
this addAction ["Open UAV", {
  params ["", "_player"];
  _terminal = ["O_Uο»ΏavTerminal", "B_Uο»ΏavTerminal", "I_Uο»ΏavTerminal", "C_Uο»ΏavTerminal"] select (side _player call BIS_fnc_sideID);
  if !(_terminal in assignedItems _player) then {
    (getUnitLoadout _player select 9) params ["","_ItemGPS"];
    if (_itemGPS != "") then {_player unassignItem _itemGPS; _player removeItem _itemGPS};
    _player setVariable ["gps_item", _itemGPS];
    _player addItem _terminal;
    _player assignItem _terminal;
    _player setVariable ["uav_item", _terminal];
    _player addEventHandler ["GetOutMan", {
      params ["_player"];
      _item = _player getVariable ["uav_item", ""];
      _player unassignItem _item;
      _player removeItem _item;
      _item = _player getVariable ["gps_item", ""];
      _player addItem _item;
      _player assignItem _item;
      _player removeEventHandler ["GetOutMan", _thisEventHandler];
    }];
  };
  _player action ["UAVTerminalOpen", _player];
}];
#

it doesn't seem to work meowtrash

split notch
#

hmmm

#

sadge

#

let me look here

little raptor
#

even this doesn't work:

player addItem "B_Uο»ΏavTerminal";
player assignItem "B_Uο»ΏavTerminal";
#

what's even weirder is that I do the exact same thing in my own mod and it works meowtrash

#
if (_type == 4) exitWith {
    {
        _x addItem "FirstAidKit";
        _loadOut = getUnitLoadout _x;
        (_loadOut select 9) params ["_ItemMap","_ItemGPS","_ItemRadio","_ItemCompass","_ItemWatch","_NVGoggles"];
        (_loadOut select 8) params [["_Binocular", ""]];
        if (_ItemMap == "") then {_x addItem "ItemMap"; _x assignItem "ItemMap"};
        if (_ItemCompass == "") then {_x addItem "ItemCompass"; _x assignItem "ItemCompass"};
        if (_ItemWatch == "") then {_x addItem "ItemWatch"; _x assignItem "ItemWatch"};
        if (_ItemRadio == "") then {_x addItem "ItemRadio"; _x assignItem "ItemRadio"};
        if (_ItemGPS == "") then {
            _side = ["O", "B", "I", "C"] select ((side group _x) call BIS_fnc_sideID);
            _ItemGPS = format ["%1_UAVTerminal", _side];
            _x addItem _ItemGPS; 
            _x assignItem _ItemGPS
        };
        if (_NVGoggles == "") then {_x addItem "NVGoggles"; _x assignItem "NVGoggles"};
        if (_Binocular == "") then {_x addWeapon "RangeFinder"};
    } forEach _units;
};
split notch
#

hmmmmmmmmmmm

vapid finch
#

Anyone know of a good way to get rid of a dynamicText?

#

I tried doing a terminate, but it just gives me a generic error since the dynamicText is running on a

waitUntil {
    player == player
};
waitUntil {
    !isNull player
};
vapid finch
#

Mod that I'm playing with has their logo spawned in with that, and I was wanting to find a way to add an addon setting to enable and disable it externally without editing their code.

little raptor
vapid finch
little raptor
#

blabla is the handle to the spawned code

#

actually I just looked at the code

#
_spawn = missionnamespace getvariable format ["bis_dynamicText_spawn_%1",_layer];
#

that's the handle that dynamicText uses

#

just get the layer

vapid finch
#

This is gonna be an interesting search

little raptor
# vapid finch This is gonna be an interesting search
/*
    File: credits.sqf
    Author: Karel Moricky

    Description:
    Dynamic opening credits

    Parameter(s):
    _this select 0: Text
    _this select 1: (Optional) X coordinates
    _this select 2: (Optional) Y coordinates
    _this select 3: (Optional) Duration
    _this select 4: (Optional) Fadein time
    _this select 5: (Optional) Delta Y
    _this select 6: (Optional) Resource layer
*/
...
_layer = if (count _this > 6) then {_this select 6} else {[] call bis_fnc_rscLayer};
dreamy kestrel
#

basic question about scripting, scopes, etc. since SQF can be highly functional in nature, I should be able to refer to "local" variables in the parent scope to a callback? i.e.

_callback = {isNull _target};
_target = objNull;
[] call _callback; // true

Regardless of where/when that callback happened, has access to the variables that are in scope?
Not counting more complex cases like spawn where the scope vanishes apart from the args you provided, for all intents and purposes.

winter rose
#

yes

#

even just call _callback;, it is faster than [] call _callback; @dreamy kestrel

#

call is "run this code here as if it was copy-pasted"

dreamy kestrel
#

cool, I like it; much more readable than _this#n ...

winter rose
#

?

#

use params where needed πŸ™ƒ

dreamy kestrel
#

well, trying to avoid even that, leverage more scope vars

winter rose
#

still better than _this#0 on multiple accesses

#

memory for a var should not be of concern; readability and speed should

vapid finch
#

Not wanting to push Leopard more πŸ˜…, is there a way to override a CfgFunctions?

#
_spawn = scriptNull;
_timer = 0;
waitUntil {
_spawn = missionnamespace getvariable [format ["bis_dynamicText_spawn_%1",3090], scriptNull];
_timer = _timer + diag_deltaTime;
!isNull _spawn || _timer > 20 //exit after 20s
};
terminate _spawn;

This is what Leopard came up with to remove the dynamicText, but it's called under a function that preinits calling the script that adds the dynamicText. So I'm guessing that's why the dynamicText isn't disappearing

winter rose
#

is there a way to override a CfgFunctions
through a mod maybe, not via #arma3_scripting

vapid finch
#

Damn... thanks

little raptor
vapid finch
#

No, it just stays there 😦

little raptor
#

it stays there, yes, but it shouldn't move
I just noticed that the control was created before the spawn, so it won't disappear

vapid finch
#

Well at least that's good, but it wouldn't be possible to remove it then I assume

little raptor
#

see where the control is created

#

then delete it

#

or terminate it's display altogether if possible

vapid finch
#

That's the main issue, the BIS_fnc_dynamicText shows this for the parameters

    text: String - text to display
    x: Number - (Optional, default -1) X coordinates
    y: Number - (Optional, default -1) Y coordinates)
    duration: Number - (Optional, default 4) display duration
    fadeInTime: Number - (Optional, default 1) fade-in time
    deltaY: Number - (Optional, default 0) Y position delta:

        = 0: Text will not move
        > 0: Text will move down
        < 0: Text will move up

    duration and the absolute deltaY value will influence the movement speed.
    rscLayer: Number - (Optional, default) resource layer
little raptor
#

it doesn't matter

#

look at the code

vapid finch
#
waitUntil {
    player == player
};
waitUntil {
    !isNull player
};

_pic = "\TOP\gris.paa";
[
    '<img align='
    'left'
    ' size='
    '1.5'
    ' shadow='
    '1'
    ' image=' + (str(_pic)) + ' />',
    safeZoneX + 0.027,
    safeZoneY + safeZoneH - 0.1,
    99999,
    0,
    0,
    3090
] spawn bis_fnc_dynamicText;

I'm not experienced for this sort of stuff yet. I don't see what I would classify as a control. I hardly was able to find the rscLayer without your help πŸ˜…

lavish sparrow
#

Where do I have to use this? In the init part?

winter rose
#

wherever you like? πŸ€·β€β™‚οΈ

lavish sparrow
#

I don't know how all this works.

#

I don't know what to do exactly. I mean, the documentation is scarce and very uncentralised.

#

HoI IV does it better in the modding community in that regard, I must admit.

#

I just don't see the logic behind the scripting, yet.

#

Would love some lessons, but preferably live.

#

I mean, do I simply execute that example and should it work. Or should I make it point to something it should execute towards? Like a specific player?

#

Documentation is shit also in that regard, it's all scattered. Would really love to get into it. But that specifically gives me a really high bar to go over.

#

I now use this ```sqf
hint parseText "<t size='2.0'>Large text</t>";
sleep 5;
hintSilent "";

#

What is the exact build up? I get errors, is my format wrong? I just cannot find documenation in what order and format I need to place this.

#

Error Generic error in expression.

cosmic lichen
#

Documentation is shit also in that regard, it's all scattered.
Documenatation of BIS_fnc_guiMessage is perfectly fine.

lavish sparrow
#

No

cosmic lichen
#

How is sleep supposed to work then?

lavish sparrow
#

I don't know.

#

It doesn't show.

#

So clearly, the examples miss something.

cosmic lichen
#

They don't

lavish sparrow
#

Where do you see it?

cosmic lichen
#

See what?

lavish sparrow
#

That image

#

I don't see that text anywhere.

cosmic lichen
#

sleep page

lavish sparrow
#

Is this even the right page anymore?

#

I am getting so fucking confused.

cosmic lichen
#

Are you now talking about hint or guimessage?

lavish sparrow
#

I just want a message, somewhere, to notify the player.

#

Don't care how.

#

Just somewhere.

#

Someway.

cosmic lichen
#

Then use the example on BIS_fnc_guiMessage

lavish sparrow
#

Ok

#

And where do I use it on?

#

The init of the player?

#

Or a file?

cosmic lichen
#

Doesn't matter. Execute it when you need it

lavish sparrow
#

How do you know?!

#

Where does it show whee I can and cannot use it?

#

That's the problem for me, I don't know where I can and cannot use something. It doesn't tell me >you can use this 'here' or 'here'.

cosmic lichen
#

read

#

stop scripting and just read everything that is there.

lavish sparrow
#

Lets just say

#

If I'd put ["Hello World"] spawn BIS_fnc_guiMessage; in the init part.

#

Would I then work right away?

cosmic lichen
#

Test it

lavish sparrow
#

'Unable to create message box'.

cosmic lichen
#

Yep, so what is the issue now?

lavish sparrow
#

I don't get the message box?

cosmic lichen
#

Then don#t use the init box

#

Init boxes are bad anyway

lavish sparrow
#

Then what should I use?

#

InitPlayerLcal?

cosmic lichen
#

Do you know why it fails?

#

Do you know how to find that out?

lavish sparrow
#

No

#

It does show in singleplayer.

cosmic lichen
#

You know where to look up code of functions?

lavish sparrow
#

No

#

I have no affinity with scripting, coding and anything like it.

#

I rather stay away from it.

#

But I have no choice.

#

All I can do, is hate it with a passion.

cosmic lichen
#

I had no affinity with it as well, nor am I a programmer

#

But you have to try to solve issues yourself and don't expect every bit to be documented.

lavish sparrow
#

I don't know where to start to solve it.

cosmic lichen
#

The reason the message will not show is because the display it uses it not available at the time of execution

#
[] spawn
{
  sleep 1; ["Hello World"] spawn BIS_fnc_guiMessage;
};
#

This will work

lavish sparrow
#

Yes it does.

#

But what cause it to no be available?

cosmic lichen
#

It's simply not yet initialized.

#

Object is created, but the scene (display) is not yet there

mortal sapphire
#

Using spawn creates a scheduled environment

lavish sparrow
#

What is the purpose of [] spawn?

#

Aha

mortal sapphire
#

so that you can delay the script from being run until after the display has been initialized

lavish sparrow
#

So...

#

[]spawn creates a schedule...

#

But with no time or anything in it?

mortal sapphire
#

sleep 1;

lavish sparrow
#

So sleep gives that timer?

mortal sapphire
#

that's what's delaying your script

cosmic lichen
mortal sapphire
#

Yessir

#

if you're using CBA, I believe it has an extended event handler system that taps into specifically post-initialization

#

unsure as to what the context is here though as I've only just jumped in

lavish sparrow
#

The reason I want to use this message is for a workaround though...

#

What I really want is the player, playing Zeus to spawn in immediately, while all the regular players get the spawn screen.

#

That, I simply cannot get to work. It's only possible for all players or none.

#

And this message is basically meant to show so people know what to use 'zeus' since they spawn as 'nothing'.

#

Because I want to open Zeus automatically, but got to have that turned off... Because that gives the player a black spawn screen. Which works...

#

But people think it's broken and just don't play the scenario.

#

respawnOnStart = 0; helps...

#

But it's for all players. Which I do not want.

cosmic lichen
#

And what about forceRespawn ?

lavish sparrow
#

That doesn't work anymore. Before it worked? But it gave me spawn unavailable.

#
if (isNull getAssignedCuratorLogic player) then {
    forceRespawn player;
};
#

That's what I used.

cosmic lichen
#

Should work

#

executed in initPlayerLocal.sqf?

lavish sparrow
#

Yup

cosmic lichen
#

Respawn is setup correctly?

lavish sparrow
#

100% sure, yes.

#

I now still get the respawn screen with the timer.

#

Forces the unit to respawn. The effect is as if the player pressed the RESPAWN button in the game pause menu; the unit is killed but there is no "X was killed" message and no score adjustment.

cosmic lichen
#

This is what you get?

lavish sparrow
#

Wouldn't this mean it would only work if Zeus is already alive?

#

Yes.

#

But I can spawn now though.

#

But I don't want the respawn menu.

#

I want to be spawned automatically.

cosmic lichen
#

Just disable the menu then

lavish sparrow
#

How?

#

Normal players should still get it.

cosmic lichen
#

So you want to menu now or not?

lavish sparrow
#

Yes. But not for Zeus.

#

So everyone except the curator(s).

cosmic lichen
#

Don't think that's possible

#

Why don't you just display a blackscreen with a message for none zeus players

lavish sparrow
#

What would that fulfil?

#

I mean, they would still spawn then?

#

Because that's what I try to avoid, the players spawning on the location the playable entities are placed.

#

Zeus has to place a spawn first. Like normally.

cosmic lichen
#

Like in the vanilla zeus missions?

lavish sparrow
#

YES! :D

#

I want to make my scenario as true to that as possible. But specifically made for IFA3.

cosmic lichen
#

What do you think would be the easiest way to achive that?

lavish sparrow
#

Having the player 'stuck' in the spawn menu till Zeus places a spawn point.

#

And Zeus not being able to get out of Zeus mode.

cosmic lichen
#

Just extract the vanilla missions and check how they are created

lavish sparrow
#

Is that not shielded off?

cosmic lichen
#

no

lavish sparrow
#

Then that's one of the few games in existence nowadays.

#

Where can I find those missions?

cosmic lichen
#

arma3 root folder

#

C:\Program Files (x86)\Steam\steamapps\common\Arma 3\Curator\Addons

#

missions_f....

lavish sparrow
#

So I got to extract those?

cosmic lichen
#

yes

#

Then you can copy them into your mission folder and open them in Eden Editor

lavish sparrow
#

Well...

#

I find multiple things pointing to Armaholic...

#

But that's dead of course.

#

Where can I find a tool for it?

#

All the results go to armaholic.

cosmic lichen
#

Download arma 3 tools from steam

lavish sparrow
#

Workshop?

cosmic lichen
#

no

#

just like any other game

lavish sparrow
#

Ah found it.

cosmic lichen
#

and use the tool BankRev

lavish sparrow
#

Seems like an interesting tool altogether.

#

Failed to convert one file...

#

I might know why.

#

Now it worked.

lavish sparrow
#

Will make a back-up and start over with the map as it is.

#

So I don't need to replace all the items I placed.
Plus, I can learn from this for sure, see how all the ends connect together.

solar chasm
#

Hmmm... Not totally sqf proficient (< understatement), and trying to put together a simple script I can drop in an init as zeus to create a periodic area denial mission by enemy artillery as long as the object is there. Trying this utilizing an invisible helipad, and crashed arma - obvious I'm missing something. What should I look at to fix this? Thanks

_shell1 = "Sh_120_HE" createVehicle [((getPos _this select 0)+random [-100,0,100]),((getPos _this select 1)+random [-100,0,100]), 0]; 
_shell1 SetDamage 1;
sleep random [0.5,1,1.5];
_shell2 = "Sh_120_HE" createVehicle [((getPos _this select 0)+random [-100,0,100]),((getPos _this select 1)+random [-100,0,100]), 0]; 
_shell2 SetDamage 1;
sleep random [120,140,180];
};```
cosmic lichen
#

use alt syntax of getPos to define a random position to get rid of all that jankiness

#

also, don't use unit init and use []spawn {}

solar chasm
#

As in distance/heading and give those randoms of 0-100 and ⁰-359,respectively?

cosmic lichen
#

yes

solar chasm
#

thanks

copper raven
#

OBJECT removeMagazine ARRAY exists, but does nothing? πŸ€”
`Result:
0.0356 ms

Cycles:
10000/10000

Code:
player removeMagazine []`
interesting, some random overload πŸ˜„

solar chasm
#

Grrr... Have been trying the createVehicle alternate syntax:

while {true} do { 
_shell1 = createVehicle ["Sh_120_HE", getPos _this, [], 100, 'NONE']; 
_shell1 SetDamage 1; 
sleep random [6,8,10];
};
}; ```
But my getPos is throwing an error : "Type Array, Expected object, location"
(I've also tried with parens around (getPos _this), and separating it out in to [(getPos _this select 0), ...]
wraith cloud
sage heath
#

ok so, if you are familiar with the save loadout script when walking away from the BIS arsenal, now i have a problem, how do i...get a similar script which works on ace arsenal? πŸ€”

#

cuz im an idiot...

#

nvm

#

found it

#

thx reddit

sage heath
#

for those who's wondering
paste this into initPlayerLocal
`_id = ["ace_arsenal_displayClosed", {

player setVariable["loadout", getUnitLoadout player];
hint "Selected gear saved!"

}] call CBA_fnc_addEventHandler;`

little raptor
#

you only need 1 event handler

sage heath
#

idk i found it on reddit, it works(?)

#

should;ve stated i have no idea what the hell im doing

little raptor
#

It works but it's adding duplicate EHs

sage heath
#

OH I COPY AND PASTED IT WRONG

little raptor
sage heath
#

yeah i gotchu

#

again i fucked up that

tough abyss
#

so random question, is there a way to make the Airstrike module to only attack a point selected by the unit with the radio menu?

#

so it isnt a set point it will attack

tough abyss
#

cheers

#

very epic

tough abyss
#

im only getting into the whole scripting recently so i have no idea

little raptor
tough abyss
#

dammit

little raptor
tough abyss
#

its the cas module that i was refering to

#

i mean i fucked around with it

little raptor
tough abyss
#

oh so you just place the module and it shows up?

little raptor
#

no

#

you have to place support provider and support requester modules

tough abyss
#

oooh okay

#

now i get it

#

i think

little raptor
#

I can't tell you how it works off the top of my head. you can google it

#

like arma support module

tough abyss
#

i will

#

cheers my man

velvet umbra
#

hey short question is there any way to get the way how the aim assist of the Praetorian 1C works? wants to improve this one by make the preaim visible for incoming missiles and stuff

little raptor
quaint ivy
#

Apologies for reposting what I posted in #arma3_scenario , I remembered that this channel exists and is more appropriate
Could anyone help me figure out multiplayer compatibility for one of my actions?
My issue is how to make sure that the action executes code remotely upon its completion
https://pastebin.com/mqxzDCp3
Basically, although clients have the action available to them, them completing it has no effect.

winter rose
tough abyss
#

can someone help me

#

_teleport "_this select 0;
_caller " _this select 1;

_caller setPos (getPos (mine));
hint "Welcome"

#

i am struggling to find out why this script dosent work

little raptor
little raptor
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
steel shadow
#

Is there a way too give pilots access to Pylons without the truck or Zeus?

patent lava
#

is there something similar to x++?

cosmic lichen
#
_c = _c + 1;```
patent lava
#

yeah just wondered if it could get shorter

cosmic lichen
#

sadly no

still forum
#

_c=_c+1;
there, shorter

cosmic lichen
#

you can omit the ;

#

just make sure it's eof

patent lava
#
c=c+1
little raptor
#

or _=_+1

patent lava
#

if you use it more than once make a function

#
// fn_countUp.sqf
params ["_x"];
_x=_x+1
little raptor
#
_=_-_;

blobcloseenjoy

tidal ferry
#

Hey, so quick question

#

Do .Arma3Profile files support preprocessor commands like #include?

tough abyss
#

does anyone know how i can make gun runs with the support module?

late jacinth
#

How do I get the text to say on the screen longer??? I am using [] Spawn {[str ("Shanoa"), str("August 21, 2021"), str("07:35")] spawn BIS_fnc_infoText,;}

#

tried sleep command but it creates an error in the script

unique sundial
little raptor
#

with adjusted timings

smoky verge
warm hedge
#

How'd ya using it?

smoky verge
#

just running from an sqf
need to slightly slow down movement speed and this seems to be what I need

#

I've tried just dumping it in a while do loop with no sleep and it works
but I don't think its a very performance friendly way

warm hedge
#

I mean the actual code

smoky verge
#

player setAnimSpeedCoef 0.50;

#

thats it really

warm hedge
#

Uh... and Mods? Seems like a conflict

smoky verge
#

mhm could be
I did have some problems with other animation related things
I guess I could just use the while do loop
its just for a short scene

idle jungle
#

Hi guys is there any way I can tweak this script so it could also spawn a helicopter or the occasional apc?

Ps.. I'm on mobile sorry for the formatting

#
_Spawntarget = squadleader; 
_Spawndistance = 200;
_Deletedistance = 1000;
_Spawngroups = [
 (configfile ΛƒΛƒ "CfgGroups" ΛƒΛƒ "East" ΛƒΛƒ "rhsgref_faction_chdkz" ΛƒΛƒ "rhsgref_group_chdkz_insurgents_infantry" ΛƒΛƒ "rhsgref_group_chdkz_infantry_patrol"),
 (configfile ΛƒΛƒ "CfgGroups" ΛƒΛƒ "East" ΛƒΛƒ "rhsgref_faction_chdkz" ΛƒΛƒ "rhsgref_group_chdkz_insurgents_infantry" ΛƒΛƒ "rhsgref_group_chdkz_infantry_mg"),
 (configfile ΛƒΛƒ "CfgGroups" ΛƒΛƒ "East" ΛƒΛƒ "rhsgref_faction_chdkz" ΛƒΛƒ "rhsgref_group_chdkz_insurgents_infantry" ΛƒΛƒ "rhsgref_group_chdkz_infantry_at"),
 (configfile ΛƒΛƒ "CfgGroups" ΛƒΛƒ "East" ΛƒΛƒ "rhsgref_faction_chdkz" ΛƒΛƒ "rhsgref_group_chdkz_insurgents_infantry" ΛƒΛƒ "rhsgref_group_chdkz_insurgents_squad")
];
_Spawnmaxdelay =40;
_Spawnavgdelay =50;
_Spawnmindelay =60;
_Spawnside = OPFOR;
_AISkills = [];
while {true} do { 
 _SpawnPosistion = _Spawntarget getRelPos [_Spawndistance, round random 360];
 _NewGroup = [_SpawnPosistion, _Spawnside , _Spawngroups select (floor (random (count _Spawngroups)))] call BIS_fnc_spawnGroup;
 _NewGroup setVariable ["spawned",true];
 {
  _EditUnit = _x;
  {_EditUnit setSkill _x;} forEach _AISkills;
 } forEach units _NewGroup;
 _NewGroup setBehaviour "AWARE";
 _NewGroup setSpeedMode "FULL";
 _NewGroup setCombatMode "RED";
 _GroupWayPoint = _NewGroup addWaypoint [position _Spawntarget, 0];
 _GroupWayPoint setWaypointType "MOVE";
 {
  _EditGroup = _x;
  for "_i" from count waypoints _EditGroup - 1 to 0 step -1 do  { deleteWaypoint [_EditGroup, _i];};
  _NewGroupWayPoint = _EditGroup addWaypoint [position _Spawntarget, 0];
  _NewGroupWayPoint setWaypointType "MOVE";
  {
   if (_Spawntarget distance _x˃_Deletedistance) then {deleteVehicle _x;};
  } forEach units _EditGroup;
 } foreach (allGroups select {side _x == _Spawnside && (_x getVariable ["spawned",true])});

 sleep (random [_Spawnmindelay,_Spawnavgdelay,_Spawnmaxdelay]);
};```
#

Is there a way where I can put arrays of classnames instead of cfgGroup paths?

#

So I can customise my groups that have a chance of spawning

cosmic lichen
#

_Spawngroups select (floor (random (count _Spawngroups))) use selectRandom

#
 {
  _EditUnit = _x;
  {_EditUnit setSkill _x;} forEach _AISkills;
 } forEach units _NewGroup;
#

Does this even work?

idle jungle
#

i get no errors when i click preview

cosmic lichen
#

yeah, but what is the skill of the units?

#

oh wait

#

nvm#

idle jungle
#

oh i added them in afterwards

cosmic lichen
#

I totally missed the foreach inside the foreach

idle jungle
#

so instead of _Spawngroups select (floor (random (count _Spawngroups)))
put _Spawngroups selectRandom ?

cosmic lichen
#

check doc

idle jungle
#

will do

cosmic lichen
#

for "_i" from count waypoints _EditGroup - 1 to 0 step -1 do { deleteWaypoint [_EditGroup, _i];};
there is a waypointscommand

idle jungle
#

i must state that i didnt write the script lol

cosmic lichen
#

Yeah, but you are using it now

idle jungle
#

i aint got a clue lol

#

thats why i let 3den enhanced do a lot of it for me πŸ˜‰

#

_Spawngroups selectRandom [];
but what goes inside the []

cosmic lichen
#

selectRandom is unary

#

there is nothing on the left

#

About your initial question. It'd probably just add the vehicle class name to _spawngroups

#

and add a type check

idle jungle
#

how do people learn this stuff lol

cosmic lichen
#
while {true} do { 
_SpawnPosistion = _Spawntarget getRelPos [_Spawndistance, round random 360];
_thingToSpawn = selectRandom _spawnGroups;

if (_thingToSpawn isEqualType "") then 
{
 createVehicle....
} else 
{
  _NewGroup = [_SpawnPosistion, _Spawnside , _Spawngroups select (floor (random (count _Spawngroups)))] call BIS_fnc_spawnGroup;
};
#

Does this help?

idle jungle
#

my brain just farted but ill do what i can

#

appreciate the help

#

so _thingtospawn is a classname?

cosmic lichen
#

Depends, it can also be a group config, hence the type check

idle jungle
#

the level of scripting i do is

this setUnitPos 'MIDDLE'; lol

#

hahahaha

cosmic lichen
idle jungle
#

dont worry mate honestly πŸ™‚

#

it would be too much of a pain in the a.. to teach me i do apologise

cosmic lichen
#

I am not teaching anyway. Gonna read up on a few things if you really wanna learn it.

#

A good start would be that script you are trying to modify

idle jungle
#

yeah thats what i thought

cosmic lichen
#

anyway, give a few minutes. I will see what I can come up with

cosmic lichen
#

@idle jungle

#

There are a few issues with this script

  • Vehicles will not be deleted
  • There is no upper limit for how many groups can be spawned
idle jungle
#

ah no worries, i plan to use it like a defence type thing so the players wont be moving anyway

lavish sparrow
#

I put it in the 'initserver.sqf'.

warm hedge
#

I suppose it doesn't work in very first second of mission

lavish sparrow
#

Nevermind. I think I may fixed it.

#

Hopefully. lol

#

Nope

#
if (isNull getAssignedCuratorLogic player) then {
    setPlayerRespawnTime 0;
    
    //Message to Zeus
    [] spawn {
        sleep 2;
        "Instructions" hintC [
        "TEXT"
        ];
    };
};
#

Doesn't seem to work.

winter rose
#

initServer, checking player… there might be an issue here πŸ˜‰

lavish sparrow
#

Well. That upper part works.

#

I spawn right away.

winter rose
#

in SP yeah

lavish sparrow
#

I run it as a local MP server

#

But it also work on my online one.

#

I don't get the message either when running it on the local side.

#
if (isNull getAssignedCuratorLogic player) then {    
    [] spawn {sleep 2; hintC "Press W to move forward"; };
};
#

I run this on the local side.

#

But nothing.

#

It's not done yet of course, but I first want it to show up. bcaDerp3

#

I do have another idea as this is a workaround.

#

Can I use a script that would kill Zeus if it's not occupied by a player, so to reset it basically?

winter rose
#
waitUntil { not isNull player };
[] spawn {
  sleep 2;
  if (isNull getAssignedCuratorLogic player) then
  {
    private _sentence = ["hah! not isNull", "Press W to move forward"] select isNull getAssignedCuratorLogic player;
    hintC _sentence;
  };
};
quaint ivy
#

Does anyone know if I must whitelist my custom functions in CfgRemoteExec before I can use them with remoteExec?

lavish sparrow
#

The scripting is confusing me. I still try to understand it. Although I start to more and more bit by bit each day.

winter rose
cyan dust
#

Good day. Is there a way to find out in scripts if '#reset' server command was called or server was restarted in some other way (#restartserver or hard reset). I have an extension which Init must be called only after server process was restarted and not in any other case. Maybe some init scripts are called only once on server startup?

winter rose
cyan dust
#

Also, thanks for the answer. Will bicycle something.

winter rose
cyan dust
winter rose
#

oh okay

fickle quiver
#

hello, how do color work on dialog ?

winter rose
fickle quiver
#

all right, thank youso much (:

#

but i meant, in config, is it rgb ?

winter rose
#

r g b a iirc

fickle quiver
#

all right tysm !

winter rose
#

yw ^^

hollow thistle
broken forge
#

How could I convert this trigger On Activation to call a custom function instead of the script?
Condition

call{{_x iskindof "plane" && speed _x < 1} count thislist > 0  }

On Activation

call{_handle = [(thisList select 0)] execVM "SOG\utility\ServicePlane.sqf";}

My Function: ```sqf
SOGServiceVehicle = {
params ["_vehKind"];
private ["_veh", "_vehType"];
_veh = _this select 0;
_vehType = getText(configFile>>"CfgVehicles">>typeOf _veh>>"DisplayName");

if ((_veh isKindOf _vehKind) && (driver _veh == player)) exitWith {

    _veh sidechat format ["Servicing %1.", _vehType];
    _veh setFuel 0;
    sleep 3;

    _veh setVehicleAmmo 1;
    _veh sidechat format ["%1 Rearmed.", _vehType];
    sleep 3;

    _veh setDamage 0;
    _veh sidechat format ["%1 Repaired.", _vehType];
    sleep 3;

    _veh setFuel 1;
    _veh sidechat format ["%1 Refueled.", _vehType];
    sleep 2;

    _veh sidechat format ["Service Complete", _vehType];
};

};

Called Via: ```sqf
["plane"] call SOGServiceVehicle;
winter rose
broken forge
#

@winter rose I've created the function and packed it into a pbo file, I'm now trying to figure out how to replace the On Activation ```sqf
call{_handle = [(thisList select 0)] execVM "SOG\utility\ServicePlane.sqf";}

With ```sqf
["plane"] call SOGServiceVehicle;
#

It looks as if the On Activation takes the list that was created by the Condition, then executes the ServicePlane.sqf script.

cosmic lichen
#
params ["_vehKind"];
    private ["_veh", "_vehType"];
    _veh = _this select 0;

??

broken forge
#

@cosmic lichen I'm presuming that _veh is being taken from the list that was created in the Condition of the trigger. I don't believe I converted it correctly

#

I have 3 different script all of which do the same thing, just one line that is different in each of the scripts. ```sqf
((_veh isKindOf "plane") && (driver _veh == player))

```sqf
((_veh isKindOf "helicopter") && (driver _veh == player))
((_veh isKindOf "landVehilce") && (driver _veh == player))
#

Here's one of the original scripts: ```sqf
private ["_veh","_vehType"];
_veh = _this select 0;
_vehType = getText(configFile>>"CfgVehicles">>typeOf _veh>>"DisplayName");

if ((_veh isKindOf "landvehicle") && (driver _veh == player)) exitWith {

_veh sidechat format ["Servicing %1.", _vehType];
_veh setFuel 0;
sleep 3;

_veh setVehicleAmmo 1;
_veh sidechat format ["%1 Rearmed.", _vehType];
sleep 3;

_veh setDamage 0;
_veh sidechat format ["%1 Repaired.", _vehType];
sleep 3;

_veh setFuel 1;
_veh sidechat format ["%1 Refueled.", _vehType];
sleep 2;

_veh sidechat format ["Service Complete", _vehType];

};

quaint ivy
#

Hey, I'm having tons of trouble with actions being performed by clients. The following is a block of code that the hold action executes on start of the action

{
    _caller switchMove "Acts_Accessing_Computer_Loop";
    _target setObjectTextureGlobal [1,"a3\structures_f_epc\items\electronics\data\electronics_screens_laptop_device_co.paa"];
    _target setObjectTextureGlobal [2,"a3\missions_f_oldman\data\img\screens\csatntb_co.paa"];
    _target setObjectTextureGlobal [3,"a3\structures_f\items\electronics\data\electronics_screens_laptop_co.paa"];
    systemChat "Start code being executed";
    if(_target getVariable "reinforcementsCalled" == false) then {
        systemChat "Remote code being called";
        [_target] remoteExec ["CO_fnc_SFIntelHackStart",2];
        _target setVariable ["reinforcementsCalled", true];
     };
 }```
I would really appreciate any help
#

action works fine if I (the host) perform it, but if one of the clients does it, nothing happens

#

actually, the block is executed and the clients do get the system message, but the function that needs to be called doesn't

tidal ferry
#

Does anyone know if initPlayerLocal.sqf fires on Headless Client, or only on player client?

spark turret
#

if not, its undefined on the client

tidal ferry
#

^Try using publicVariable

quaint ivy
#

my issue has something to do with [_target] remoteExec ["CO_fnc_SFIntelHackStart",2]; because everything else works

#

but that function doesnt get executed

#

and the function is not broken because it works if I use it trough the console or with spawn/call

#

it's just not working with remoteExec for some reason. In fact, like I said, it works with remoteExec if the person doing the action is also the host, just not for other clients

cold pebble
tidal ferry
#

Sweet, thanks!

tidal ferry
#

Sweet, thanks!

#

Hey, so another question

#

How many times would {} foreach [missionNamespace] execute? Trying to improve/understand some code I wrote a while back

#

Would it execute once for the missionNamesspace itself, or once for everything in missionNamespace?

still forum
#

once

#

foreach element in array

#

your array has one element

tidal ferry
#

Ah right gotcha

quaint ivy
#

thanks

tidal ferry
#

So literally no good reason πŸ˜‚

#

Also, in another question, does anyone know if isRemoteExecuted will mark as true/false from 3den Object Init?

#

Basically I want to execute code from object init, but only on client machine

#

Instead of having it execute every time a player joins

little raptor
tidal ferry
#

I meant

#

In MP, Object Init fires every time client connects, right?

#

Well, basically I have an object with code I want to only execute once on client machine

#

Where the result is local to client machine

#

Wait

#

Nvm

#

Next question- BIS_fnc_holdActionAdd only has local effect by default, right? πŸ˜›

winter rose
#

yep

winter rose
#

ze wiki page says so

tidal ferry
#

Gotcha, just wanted to make sure

winter rose
#

😁

spark turret
#

Object init fires only for the connecting machine, not for all machines on every JIP.

#

Afaik

winter rose
#

Correct
But it gets fired on each connected machine on startup

#

Hence why the "be sure about locality/usage"
setFace is cool, setDamage is not

tidal ferry
#

Ah gotcha

#

Next question- I'm working on making a switch-do block, is it possible to use case to evaluate nil?

#

Or should I just use default?

#

Also, am I able to use a switch-do block to get a return value, e.g. _result = switch (_var) do {[...]};?

#

Ah wait nvm

tidal ferry
#

Okay, so very whack question

spark turret
#

can we get a "read the error FFS" emoji on this discord?

#

unrelated to you lol

tidal ferry
#

Is it possible to make a date evaluation in preprocessor command? E.g. if the date is before a current date, a certain part of the config will not load

#

I don't think it is but I wanted to ask anyhow

little raptor
#

there are game version macros

#

if it matters

tidal ferry
#

Yeah, darn

spark turret
#

are you trying to make a backward compat time machine forward compat?

tidal ferry
#

Nah

little raptor
# tidal ferry Yeah, darn

if it's a script you can use scripting commands to check the date
it's a bit slower than a macro obviously

tidal ferry
#

Nah, basically just adding some content to a mod but don't want it to be seen until a certain date, sort of like preloading a game

#

Pretty sure it's not possible with preprocessor

tidal ferry
#

I know, but we need to balance giving people enough time to DL the mod and not being too early that people will try and peek at stuff

little raptor
#

they won't have anything when it's not there

tidal ferry
#

Yeah I know, just wanted to see if we'd be able to give people extra time to download ahead of the release date

#

Some of our guys have really slow/sporadic wi-fi so we usually update mods well in advance of when they're needed

little raptor
#

steam will only download the diff

tidal ferry
#

Yeah, it's in a new PBO so hopefully will minimize time to only essentials

hollow lantern
#

question about creating a unit inside a vehicle ("O_UAV_AI"). Is it possible to have the option to control that AI from a UavTerminal?

little raptor
spark turret
#

is it possible to write into the map text fields at the top? like in arma 2 you had a "conversation log"

#

what are some keywords for commands there

hollow lantern
little raptor
#

no

spark turret
tidal ferry
#

I mean like, to evaluate the current date against a set date via preprocessor

still forum
#

why don't we have a unix timestamp πŸ€”

still forum
little raptor
#

for briefing tab you can use diary records

spark turret
#

i think setDiarayRecordText is what i want

tidal ferry
#

Okay, just wanted to make sure πŸ˜…

spark turret
little raptor
#

under briefing

still forum
#

@tidal ferry I'll see about adding UTC Timestamp in 2.06. I apparently forgot that

spark turret
#

ah cool thats far easier than i expected

tidal ferry
#

Oh, fantastic! Thanks!