#arma3_scripting

1 messages Β· Page 416 of 1

still forum
#

I told you to pass _this not [_this]

quartz coyote
#

then I don't even understand you English ...

still forum
#

[_this] != _this

#

You can see the brackets are different

edgy dune
#

[_this ] is a array yes?

still forum
#

One is an array with _this inside. The other is _this. the variable

edgy dune
#

question

quartz coyote
#

I now understand

edgy dune
#
[_this] joinSilent createGroup INDEPENDENT;
``` that makes a unit go independent,how do i make it civllian cause CIV doesnt work?
#

make it go *

still forum
#

civilian?

#

Why do you write that in Caps?

quartz coyote
#

thanks @still forum

edgy dune
#

i saw that independent somewhere was in caps

#

thought it had to be in caps

#

πŸ˜›

still forum
#

SQF is case insensitive

#

Not all SQF commands internals are. But SQF itself the language is.

pliant stream
#

the preprocessor is not though

still forum
#

yeah correct. The preprocessor is not SQF

edgy dune
#

rip case sensative

#

okay so ermm im tryna have a script to spawn chicken

#

and i got thi

#
"WHAT DO I PUT HERE" createUnit [position _user,civilian];
#

so wat do i put at "WHAT DO I PUT HERE"

still forum
#

Classname

edgy dune
#

type of the uniut?

#

oh okay

still forum
#

from CfgVehicles

edgy dune
#

oh shit theres dogs in arma 3?

still forum
#

yeah

#

and they have AI and can follow

#

You can even use them as a player

edgy dune
#

omg

#

why fight when u can be a dog

still forum
#

We once had a mission with a guy on vacation that couldn't really play or speak. He just ran along as a dog

fierce goblet
#

i want to be a dog. can i play with you and be a dog?

still forum
#

No

fierce goblet
#

dang.

edgy dune
#
"Fin_random_F" createUnit [position _this,civilian];
``` so this shold wowrk yes
#

question mark

still forum
#

yeah. looks good

#

no.

#

not at all

#

civilian is not a group

edgy dune
#

is the group wrong?

still forum
#

its a side

#

you need to createGroup

edgy dune
#

thx

#

now im ahave dog only ops

still forum
#

We even managed to give a dog a gun once

#

but that was more a bug..

edgy dune
#

wow

#

now is it

#

\n or/n

#

i forget

still forum
#

google

edgy dune
#

now is it suppose to work when i do this

#
_this globalChat format["line 1 \n line 2 \n line 3"];
still forum
#

no

#

There are few places where it works

#

format doesn't do any formatting btw.

#

it has no effect right there

edgy dune
#

fuck i had this in ther

#
_this globalChat format["line 1 \n line 2 \n line 3 \n my name is %1",(name _this)];
still forum
#

format only replaces %X by the parameter

#

without %X and without parameters it does nothing

edgy dune
#

forgot to put parameters πŸ˜›

#

wait demen how did u remote contorl the dog again>

fleet wind
#

How do you make a execVM when you push a button (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 73) then {execVM "OpenDiag4.sqf"}"]; // 9(numpad) Needs to be something like that

cerulean whale
#

Why are you using execvm over a function/method? @fleet wind

fleet wind
#

@cerulean whale Well you see im still new to this and i have never learnt the whole Functions

cerulean whale
#

I'll jump on my pc in a sec and give you a hand

fleet wind
#

Sounds great xD

young spade
#

Could someone help.
I'm nearly 50... I can't code, but I'm almost there...

Now posting in the right place, I hope.
I have found/botched together the code below that enables me to add remove units from HC.
The last line should remove units from HC. Except it doesn't.

Question: What is the Object vs. Array error in the last line?

player addAction ["Add Group to HC",{player hcSetGroup [Group CursorTarget]}];
player addAction ["Remove Group from HC",{player hcRemoveGroup [Group CursorTarget]}];

gaunt hamlet
#

Questions - I have a player variable that can either be nil, 0 or > 0 (nil if I have not set it yet)

But this OR statement just wont pass :-(

if ((isNil "_counter") || (_counter == 0)) then {
   ...
}
#

_counter is gotten via a _counter = player getVariable....

#

Does a variable have to be public for isNil to evaluate it since it requires it being sent along as a string (the variable to test) - this was something I read, that it had to be in string

peak plover
#

@young spade



player addAction ["Add Group to HC",{player hcSetGroup [Group CursorTarget]}];
player addAction ["Remove Group from HC",{player hcRemoveGroup [Group CursorTarget]}];
player addAction ["Add Group to HC",{player hcSetGroup (Group CursorTarget)}];
player addAction ["Remove Group from HC",{player hcRemoveGroup (Group CursorTarget)}];
#

you used square brakcets [ around group cursortarget

#

Square braket mean it's an array

#

use normal ( instead

#

But only in that part

#

@gaunt hamlet

if ((isNil "_counter") || {_counter == 0}) then {
   ...
}

try wrapping curly brackets around.
Curly brackets after || mean that the following {code} will only be checked if the first condition is false

#

If _counter is nil then your if would error. With curly brackets it won't

young spade
#

Thank you.

peak plover
#

np

gaunt hamlet
#

@peak plover will try that - thanks!

#

so I kind of force it to a true or false by evaluating it?

#

worked as a charm - thanks a bunch!

gaunt hamlet
#

Is there no way to get the generated event index inside the callback?
I need to remove my event once I have done the stuff I need to do inside the callback - and it would seem tidy to remove it the same place

#

And can you call normal EH's with addMPEventHandler also? coz example for addMPEventHandler says..

player removeMPEventHandler ["killed", 0];

Where I would think it should have been "mpkilled"?

cedar kindle
#

it returns the ID, so save it as a global variable

#

and it will be available in the scope of the eh

gaunt hamlet
#

is this allowed then?

#
  private _player = this select 0;
  
  ... do stuff

  private _index = _player getVariable "XxX_eventIndex";
  _player removeMPEventHandler ["mpkilled", _index];
}];

player setVariable ["XxX_eventIndex", _eventIndex];```
#

it should have returned its own index inside the callback - is "this" the scope of the event function inside it? Can I log out what properties it might have - its own index should be on it.

meager heart
#

@gaunt hamlet ```sqf
player addMPEventHandler ["mpkilled",
{
params ["_unit"];
/* your code */
_unit removeMPEventHandler ["mpkilled",_thisEventHandler];
}];

cedar kindle
#

when was that added

meager heart
#

1.60 + i think

#

not sure

gaunt hamlet
#

makes a lot more sense

#

thanks @meager heart

#

so params ["arg1", "arg"]
is better practise than
_arg1 = this select 0;
?

#

very new to this "language" πŸ˜ƒ

inner swallow
#

well, it lets you set defaults

gaunt hamlet
#

and with params ["..."] what is the scope of that variable?

inner swallow
#

that code block or script

#

but i think the _rule still applies

gaunt hamlet
#

ok thats - saves me typing that private each time - just seemed like good practise to declare as private if it is private

meager heart
gaunt hamlet
#

so _arg1 becomes block / script scoped by default?

meager heart
#

No its just local variable

gaunt hamlet
#

variables are accessible in deeper nested scopes in my script right? like inside a while loop I can access a variable I made outside it?

meager heart
#

it depends on where you define it... also is it private

gaunt hamlet
#

syntax question will this work?
player setVariable ["x_counter", _counter + 1];
Or do you need () around a statement that needs to be evaluated? Like this
player setVariable ["x_counter", (_counter + 1)];

peak plover
#

Both work

#

I usually put () around

gaunt hamlet
#

aye - more readable

#

@peak plover if I have two numerically based evaluations I want in a if statment with && do I have to wrap both in curly?

Like: ```
if ({_speed > 0} && {_randomWait > 0}) then {
_randomWait = _randomWait - 1;
};

peak plover
#

No

#

You don't need curly

#

Curly means the second one is only checked if the first one fails

#

good for isNil or isEqualType

gaunt hamlet
#
if (_speed > 0 && _randomWait > 0) then {
  _randomWait = _randomWait - 1;
};
#

ahh ok so only for ||

peak plover
#

N

#

Also wrosk with &&

gaunt hamlet
#

but why would you only want to check second one if first one fails in a && ?

peak plover
#

with || only checks the 2nd conditon if first one is false and with && only checks 2nd condition if first is true

#

because

gaunt hamlet
#

ahh rgr πŸ˜„

#

its only checking second if first is true for && - thanks πŸ˜ƒ

peak plover
#

πŸ‘Œ

gaunt hamlet
#

Hmm think my script is pretty much done - could use some scrutiny as it's my first one so to say

Had a need for a mine field in my first MP mission - so thought I might as well make this a reusable script.

But guess there are tons of minefield scripts out there - mine is special though :-D

Where do people go to share?

And anyone want to help me by looking it over and commenting where I messed the bed?

#

Would be very grateful - its only 67 lines, and like 1/3 of those are comments

#

so very small script

meager heart
#

was page with nice code optimizations tips and examples on wiki... wait

peak plover
#

Yeah, usually better to make your own than getting some elsewhere.

meager heart
#

@gaunt hamlet

gaunt hamlet
#

1/2 is comments actually

#

damn - sweet link sldt1ck

#

and 50% of the code lines remaining are end curlys πŸ˜›

#

My worry is the MP world and its caveats for random situations I have not thought about coz I'm new

meager heart
#

coz I'm new
Everyone was there, its ok

exotic tinsel
#

in a script im trying to determine if its night, does anyone on have something they can share

gaunt hamlet
#

When it is night can probably vary a lot depending on time of year @exotic tinsel

exotic tinsel
#

useful @gaunt hamlet

gaunt hamlet
#

_transitionState = sunOrMoon;

meager heart
#

@exotic tinsel ```sqf
0 spawn
{
private _hour = date select 3;
private _night = if (_hour > 20 || _hour < 8) then {true} else {false};
if (_night) then {hintSilent "Night"};
};

peak plover
#

As of Arma 3 1.7, this returns either 1 for sun or 0 for moon. Nothing in between.

exotic tinsel
#

awesome thanks alot

gaunt hamlet
#

wont that give 0 = night then?

#

and cant 20.30 be "not night" at height of summer?

meager heart
#

πŸ˜€

gaunt hamlet
#

@meager heart is [] spawn {} the same as 0 spawn {} and is it just to pipe the result into nothing - like null could have been used also?

#

or is it like a grabbing on to point to spawn it

meager heart
#

is it just to pipe the result into nothing - like null could have been used also?

#

yes

gaunt hamlet
#

And if anyone bothered to look at my script on my git - reload it - I fixed the indentation problem πŸ˜„

cedar kindle
#

it’s arguments for the spawned code so the second one would have 0 as _this, it’s not needed but I’d recommend sticking to []. on triggers or init fields you can’t return a script handle so there it can be used as 0 = [] spawn {... to circumvent

gaunt hamlet
#

so I could do like this?

  hint format ["%1", this name];
}```

or however you retrieve object properties
peak plover
#

_this instead of this

gaunt hamlet
#

how do you retrieve properties?

peak plover
#

and name _this

gaunt hamlet
#

"prop_name _this"?

#

I'm so blank lol - don't even know how the data structure works - is it objects with keys and values?

peak plover
#
[1,2,3,4] spawn {
    params ["_first","_second","_thrid","_fourth"];    
    hint str _first;
    // 1
};

πŸ‡΅ πŸ‡¦ πŸ‡· πŸ‡¦ πŸ‡² πŸ‡Έ

gaunt hamlet
#

ahh hint str instead of the whole format with arguments - when just wanting the variable and nothing more

#

lol saved me some time right there for my "hint-as-console-logs"

#

thanks you guys and girls - really helpful and saves me a TON of time

meager heart
#

LOL yw,np,glhf

grizzled rain
#

Could someone tell me if I am writing this the right way "switchMove "R_death_011"; s1 disableAI "anim";"

meager heart
#

who ? switchMove "R_death_011"

#

s1 switchMove "R_death_011"; s1 disableAI "anim"; ?

#

and what is R_death_011...

unborn ether
#

@peak plover πŸ’― / πŸ’― params syntax highlighting πŸ˜„

gaunt hamlet
#

is there a cap for how many conditions a if statement can take?

rancid ruin
#

you'd fuck your shit up well before you reached any theoretical limit

gaunt hamlet
#

and do I have to wrap all consecvent conditions in {} after first one?

rancid ruin
#

you use () for conditions

meager heart
#

he meant lazy eval maybe

peak plover
#

No limitbut u shouldn't use curly if u don't need it

meager heart
#

i just learned new word limitbut πŸ˜„

gaunt hamlet
#

If I run a script on a trigger activation like this _null = [] execVM "path\to\script\onActivation.sqf";

Is there then a way to pass whatever activates it as this in first argument _null = [this] execVM "path\to\script\onActivation.sqf"; And in that script treat that variable as I please without regards to if it is a vehicle, player or an AI?

#

Like then in scipt be able to do params ["_perpetrator"]; _speed = speed _perpetrator;

#

And again (and sorry for writing so much lol) - would appreciate if anyone would look over my script to see if they can see with their bare eyes any reason this would not work in a real MP server πŸ˜„

grizzled rain
#

Its a pose.

exotic tinsel
#

could use some help understanding how to use a foreach with a multi dimensional array. Would this work to get β€œ1” and β€œ1a”?
_myarray = [[β€œ1”,”2”,”3”],[β€œ1a”,”2a”,”3a”]];
{
_getparamNum = _x select 0;
_getparamAlphaNum = _x select 1;
} foreach _myarray;

rancid ruin
#

it'll never work if you spell select wrong i can tell you that much for sure

exotic tinsel
#

sorry was in a rush

rancid ruin
#

that would print
1, 2
1a, 2a

#

well if you told it to print it would do that

#

this is simple stuff to test yourself though man come on

lone glade
#

your array has two indexes:
[β€œ1”,”2”,”3”] and ,[β€œ1a”,”2a”,”3a”]....

#

foreach go through each index of the array you pass

#

i'll let you figure out why that won't work yourself

meager granite
#

@exotic tinsel

{
    systemChat str _x; // "1", ...
    systemChat str (_myarray select 1 select _forEachIndex); // "1a", ...
} forEach (_myarray select 0);
rancid ruin
#

that looks so crazy to me

#

is that how you get places with arma 3 scripting? embrace the crazy?

meager granite
#

Nothing crazy here. Though I'd assign each sub array into variable first though and str is not really needed here (just in case he has different data in his actual script).

#

This also of course assumes each sub array has same length but looking at his example it should.

still forum
#

@swift ferryenai#3053 selectPlayer I think. You can also replace the classname for a player slot in mission.sqm

#

Don't have time to fix that now.. ugh

tame portal
#

@edgy dune

edgy dune
#

oh

#

wait wat

#

oh u talking about controling a dog?

meager heart
#

@Sticky Handz That is wrong channel for that kind of messages

rancid ruin
#

what a desperate scrub lord

meager heart
#

and he jumped out from server

warm gorge
#

Does preprocessFileLineNumbers do pretty much the same as what compiling functions with CfgFunctions does? I want to replicate how it does it, but I dont want to use CfgFunctions because I only want a group of scripts to be compiled for a certain group of people/side

rancid ruin
#

pretty much i think yeah

#

you can't use the built in function browser unless you use cfgFunctions, otherwise i'm not sure there's many differences

#

I only want a group of scripts to be compiled for a certain group of people/side sounds like you're over complicating or over thinking things though

#

i use cfgFunctions cos it's neat and tidy

warm gorge
#

@rancid ruin What I mean by that is lets say I wanted just police to have access to their related scripts, that lets say civilians wouldnt need, I feel it would be better not to have it in CfgFunctions for everyone

rancid ruin
#

because.....?

warm gorge
#

Well considering theres so many scripts for them, plus this isnt the only "group" of scripts that are only limited to that group. Do you honestly think it wouldnt matter much just putting them all in CfgFunctions?

#

I mean id love to just put them all in CfgFunctions, just didnt think it would be best for performance and load time

rancid ruin
#

negligible

cedar kindle
#

it’ll work just fine

meager heart
#

I mean id love to just put them all in CfgFunctions, just didn't think it would be best for performance and load time
That is most optimized and safe way i think...

#

preInit, postInit, preStart also check what this things do @warm gorge

#

also compileFinal...

wise frigate
#

Hey guys. I have a small question.
Is there a way to possibly change the color of vehicle headlights via a script in game?

jade abyss
#

nope

peak plover
#

Lights are like part of the model, right?

jade abyss
#

Yep

peak plover
#

I guess you can create a lightsource with a different color, but I don't think those will every act as normal car lights and provide a cone

jade abyss
#

As long as the Veh not moves

peak plover
#

You can attach the light, 'tho

#

Hmm

#

Concerning performance and such... I have possible 300 locations that I want to draw a 3d icon for. They might move

#

Sending all of them as an array every second would be costly, right?

#

I don't understand the scale of how much information that would be

cedar kindle
#

over the network ?

still forum
#

@warm gorge you can look at the CfgFunctions script if you want to.
compileFinal preprocessFileLineNumbers <script>
That is what CfgFunctions does

peak plover
#

Yeah

cedar kindle
#

that’s not ok imo

peak plover
#

Yeah I think it's probably too bad too 😐

#

Just wondering how bad

cedar kindle
#

heck even sending a single variable every second is something I’d recommend looking into other options for

lone glade
#

you also have 300 locations.... just saying

still forum
#

Why would you send that over network?

#

Doesn't everyone already know where they are?

lone glade
#

tell me they are already placed and not created

peak plover
#

They are just array of positions right now. I can just make into locations

lone glade
#

retrieve locations on player init -> use it for whatever you intend to do

cedar kindle
#

what are you trying to build that requires 300 locations ?

lone glade
#

no need to broadcast it

peak plover
#

building ai. It could have any amount

#

300 is decent max to stress test on

cedar kindle
#

so it’s fake AI until they get in player range ?

peak plover
#

It's just an array of positions until they get in range

#

Also uncache / cache with zeus module

#

So I need to draw 3d icons of the positions for client who is zeus

#

So there's identication of the cached units

lone glade
#

oh boy

jade abyss
#
nigel - Today at 12:44 PM
You can attach the light, 'tho
Hmm```
Yes and the light will wiggle around like a TwerkingQueen..
peak plover
#

clientside light ?

jade abyss
#

Yes

cedar kindle
#

set initial pos, only send updates for moving units and send their start/end position, let the Zeus clients simulate how they’d move

jade abyss
#

Test it yourself, attachLightSource or however it was called uses probalby the PhysX Box wich switches around like crazy, Nigel

cedar kindle
#

should be good enough given that they move in birds path

#

that means straight line

lone glade
#

oh wait no, that's the showcase mission

#

wow

#

3 FSMs for mines in that mission.... holy moly

still forum
#

holy holy

#

no. actually holy holy holy

lone glade
#

ded

#

no bulli

still forum
#

bulli

knotty mantle
#

Can i do an if within a switch?? That same cases are only available if certain conditions are met?

peak plover
#

Consider using call and exitwith

#
private _a = 1;
call {
    if (_a isEqualTo 0) exitWith {};
    if (_a isEqualTo 1) exitWith {};
    if (_a isEqualTo 2) exitWith {};
    if (_a isEqualTo 3) exitWith {};
};
knotty mantle
#

Will do. Thank you πŸ˜ƒ

#

i guess i have to pass _a as an arg? Or is it known if it was set above the call in the script?

peak plover
#

it is known

#

Added to example

knotty mantle
#

Thank you πŸ˜ƒ

peak plover
#

Np

young spade
#

Morning, May I ask something else.

My son cheats in Zeus! He can see both sides and (ahem) is always in the right place at the right time -- he also moves my units. I would like to get him back by setting up a scenario where he ^cannot^ see OpFor in Zeus. It it possible to remove the Group/Units markers from the Zeus interface? or make it so he cannot direct the units?

Many Thanks.

still forum
#

@knotty mantle yes you can have an if in the switch code. No problem at all.

#

@young spade You can remove the markers yes. But he will still see them running around.
Are all units pre-placed at mission start?

inner swallow
#

You can also restrict a zeus to a side (probably via the module/entity properties, can't remember specifics)

still forum
#

Would be far easier than the solution I was thinking about

young spade
#

@still forum Removing the markers would be awesome! Most units are placed at the beginning of the mission but I like to add a few surprises(!) here and there later on.

@inner swallow I looked for that couldn't find a practical way of doing it ;0)

still forum
#

Units you place yourself as Zeus shouldn't show up in his interface anyway. Unless you are running special mods or scripts that do that

#

this removeCuratorEditableObjects [allUnits select {side _x == opfor} ,true]
Put that into the Zeus Module's init script field. That should work

young spade
#

Rather then placing units before the mission starts, I could spawn everything. Would it then be possible to remove all Opfor units from the Curator on their spawn? i.e. they would mysteriously dissappear.

still forum
#

Removes allUnits that are of side opfor from the editable Zeus objects.
And what you can't edit you also don't get markers for

young spade
#

@still forum Will try, thank you.

still forum
#

If it doesn't work just mention me. I could imagine that it doesn't work right at mission start and one needs to wait a few seconds before doing it

inner swallow
#

that should help

#

will check the modules and post here

still forum
#

Didn't even know about the camera area thing

young spade
#

;0)

inner swallow
#

@young spade in the list of Systems -> Virtual Entities, you'll find Zeus, Zeus (BLUFOR), Zeus (OPFOR), etc.

#

I've never actually used side specific ones, but they should work

#

along with dedmen's suggestion (although the side specific zeuses should just straight up prevent a zeus from placing opposite side's units)

young spade
#

Thank you - I give the Virtual BlueFor Zeus a go.

young spade
#

@still forum @inner swallow Not getting anywhere fast.
Created a mission in a VR scene.
Put down 1 x BlueFor & ! x OpFor.
Added traditional zeus or virtual entitity bluefor zeus (named and linked to a zeus game-master with Dedmen code) .

''' this removeCuratorEditableObjects [allUnits select {side _x == opfor} ,true] '''

then, got into zeus mode and place duplicate units... came out of Zeus, went back in. No changes.

Maybe I need to put code in init.sqf or similar to test all units?

still forum
#

It removes all units that are placed at mission start

#

The ones you place. Will show up

young spade
#

Ok -- my bad. Thank you.

inner swallow
#

And to be clear, pre-placed units that aren't explicitly added to the curator via addCuratorEditableObjects command or the Add Editable Objects module shouldn't show up at all

still forum
#

So my script doesn't even make sense in that case

#

if pre-placed enemies and units placed by other Zeuses don't show up

#

The Zeus should never see enemies or anything he didn't spawn himself

#

unless some Mod is running that's doing that

warm gorge
#

@still forum The CfgFunctions script? Isnt that all engine based, where do you see that

tough abyss
#

a3/functions_f/initFunctions.sqf

warm gorge
#

ah yep cheers

inner swallow
#

I think multiple zeuses on the same side can control each other's units, but i'm not 100% sure - unless you're 100% sure about The Zeus should never see enemies or anything he didn't spawn himself

still forum
#

I know that I run scripts that add every object spawned by one Zeus to the other zeuses so they can access it too

#

I think the curator wiki page also talks about that

#

wouldn't be needed if that happens automatically

inner swallow
#

yeah, true

#

I know Ares/Achilles mods allow you to add units via the zeus interface itself

quartz coyote
#

Hello, Is there a way of testing if a player is in any type of vehicle (car, tank ...) ?
maybe with

Gunshiper = {player in _x} forEach [car,tank,plane.......];```
or something
meager heart
#
_in_vehicle = !(isNull objectParent player);
quartz coyote
#

ooooh ! nice !

inner swallow
#

you can also just check player != vehicle player

quartz coyote
#

I actually thought vehicle player was the body of the player xD

#

thanks guys

inner swallow
#

well it is... when the player isn't in a vehicle πŸ˜›

meager heart
#

yes, he also can be a "gunner" of vehicle player πŸ˜„

#

with cameraView == "Gunner"

quartz coyote
#

in this situation, I don't car about the position, all I want to know is if he is in a vehicle πŸ˜‰

long gazelle
#

Hola, anyone online that could help me out with modifying scripts?

peak plover
#

What wrong

long gazelle
#

I'm trying to figure out how to change this script so that instead of radius it would use xy range.

'''css
/*-------
Makes targets pop up at the user's command. Targets go down after being hit,
and return back with user action. Because swivel targets have a different
script assigned to them that works differently from all other targets,
they are handled separately in the script. If you don't plan
to use swivel targets at all, feel free to delete the corresponding part
of the code.

this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];

-------*/

params [["_dist",50,[1]],["_center",player,[objNull]]]; //in params

_targets = nearestObjects [position _center, ["TargetBase"], _dist]; //take all nearby practice targets

if (count _targets < 1) exitWith {
systemChat "No compatible targets were found."; //exit if no targets have been found
};

{_x animate ["Terc",0];} forEach _targets; //get all targets to upright pos

{_x addEventHandler ["HIT", { //add EH
_this select 0) animate ["Terc",1]; //if hit, get to the ground
(_this select 0) RemoveEventHandler ["HIT",0]; //remove EH
}
]
} forEach _targets;'''

subtle ore
#

Format pls

peak plover
#

```sqf
```

#

That one

#

U used '''

subtle ore
#

^

long gazelle
#

Ah

subtle ore
#

Discord supports sqf, no need for css highlighting?

long gazelle
#
/*-------
Makes targets pop up at the user's command. Targets go down after being hit,
and return back with user action. Because swivel targets have a different
script assigned to them that works differently from all other targets, 
they are handled separately in the script. If you don't plan
to use swivel targets at all, feel free to delete the corresponding part
of the code.

this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];

-------*/

params [["_dist",50,[1]],["_center",player,[objNull]]];                    //in params

_targets = nearestObjects [position _center, ["TargetBase"], _dist];    //take all nearby practice targets

if (count _targets < 1) exitWith {
        systemChat "No compatible targets were found.";                    //exit if no targets have been found
    };
    
{_x animate ["Terc",0];} forEach _targets;                                //get all targets to upright pos

{_x addEventHandler ["HIT", {                                            //add EH
        _this select 0) animate ["Terc",1];                                //if hit, get to the ground
        (_this select 0) RemoveEventHandler ["HIT",0];                    //remove EH
    }
]
} forEach _targets;
#

There we go..

peak plover
#

πŸ‘Œ

long gazelle
#

I got this script form Feuerex's video about how to make controlled pop up targets..

#

But it uses radius from object where I would prefer xy range.

peak plover
#

elaborate

#

Like an area

#

like marker / trigger?

long gazelle
#

Feuerex made it so that the targets, once hit, stay down until he would reset them on laptop which had this command this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];

peak plover
#

What is your goal @long gazelle

long gazelle
#

The object specified was Game Logic.

subtle ore
#

I have a quick question here, trying not to interrupt conversation here. If I were to use onPlayerConnected and it's special variable "_id" (Listed as Unique PlayID) and objectFromNetID. Would I get the correct returns? I tried to turn the id into a string and diag_log it, but it came up with "Error: No vehicle attached".

long gazelle
#

And my goal is to change the data input so that it won't read all targets within circle with X radius but within an area with xy range.

peak plover
#

> xy range what did you mean by that

subtle ore
#

you mean something like distance2D ?

long gazelle
#

For example area of x = 50, y = 100.

#

I know there's a better word for it but can't remember right now..

subtle ore
#

Radius....?

long gazelle
#

Is it really that? I've always used that with circles and spheres so I thought it would be confusing..

peak plover
#

inArea

#

alt syntax 3

subtle ore
#

Well yes, because circles and spheres from center -> Radius

long gazelle
#

Okay, so how would I implement the alt syntax 3 into given code? I'm completely new to scripting..

peak plover
#

_targets = _targets inAreaArray [_center, 50, 100, 0, true];
#

Also set the distance to x2, because nearestObjects wouldn't grab the corners

long gazelle
#

Can you elaborate?

peak plover
#

inAreaArray returns only the _targets that are in a square

#

50 wide 100 high

#

roation 0

long gazelle
#

Yeah that I got. But what you meant by "distance to x2"?

peak plover
#

Because ```sqf

_targets = nearestObjects [position _center, ["TargetBase"], _dist]; //take all nearby practice targets

#

it gets them around in a center

#

with a radios (circle)

#

So if you use a square later

#

you'd need to make sure the nearestobjects that in the square corners are there too

#

if your square is 50x50. then the corners would be more than 50

long gazelle
#

I'm gonna have to rewrite this whole code aren't I?

peak plover
#

If you want to yeah

#

Probably modify it to your liking

long gazelle
#

I hate text typing in chats...

#

This line,

_targets = _targets inAreaArray [_center, 50, 100, 0, true];

Did you mean I should replace the line below with line above?

_targets = nearestObjects [position _center, ["TargetBase"], _dist];

Or add the line above to the code without replacing anything?

peak plover
#

nearestobjecst
inAreaArray

#

nearestObjects creates an array _targets

#

_targets = _targets replaces the array with the result of inAreaArray

long gazelle
#

Question: Can you explain me this:

This code is written on the laptop to reset the targets:

sqf this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];

And this is the first line of code in reset.sqf:

sqf params [["_dist",50,[1]],["_center",player,[objNull]]];

Now I'm not making any heads or tails with this because how I understand it is that the laptop executes the reset.sqf and returns the variables: ```sqf
[radius, objectName]

But apart from that I have no idea what happens..

lone glade
#

wat

#

_radius and the other arg are passed to the script

#

also what the fuck

long gazelle
#

@peak plover

#

Stuff... Stuff is happening.

lone glade
#

was the person that wrote this drunk or impaired ?

long gazelle
#

I'm not gonna go take any guesses..

#

But I was not him.

lone glade
#

using three letters global vars.... and sqf at that... wow

#

I haven't seen this even in MCC....

long gazelle
#

Did you read everything already? Get the gist of it what I'm trying to do?

lone glade
#

going to read from the start, that sounds hilarious

long gazelle
#

Have at it.

#

Here's the video I got the code from.

lone glade
#

what do you mean by xy range? you still haven't clarified that

long gazelle
#

xy axels on map. x = 10, y = 10 you got a square area, x = 20, y = 10 you got rectangular area..

lone glade
#

oh, a square πŸ˜„

long gazelle
#

I'm not even sure how to explain it..

lone glade
#

yes I get it

long gazelle
#

My english is failing me badly today..

#

Any ideas how to do this?

lone glade
#

well, yes but it's less efficient than what you currently have

long gazelle
#

Okay..

#

Well save that for later, can you help me understand my last question?

lone glade
#

_targets = _targets select {_x inArea [_center, 100, 100, 0, true]}

peak plover
#

inAreaArray

#

don't need select

lone glade
#

meh

#

I keep forgetting it exists πŸ˜„

long gazelle
#

That doesn't answer a lot... Just raises more confusion for me..

lone glade
#

with inAreaArray:
_targets = _targets inAreaArray [_center, 100, 100, 0, true]

#

inAreaArray will only return targets that are within the rectangle provided

long gazelle
#

Okay... Where do I place that in the code?

lone glade
#

figure it out, otherwise you won't learn

#

also put that into a func since it seems you'll use it more than once

long gazelle
#

Well assuming that because it has _targets = _targets it goes through targets already within the _targets so after the line ```sqf
_targets = nearestObjects [position _center, ["TargetBase"], _dist];

I'm guessing..
lone glade
#

_targets is the local variable in which the result of nearestObjects is stored
we take that and check which ones are within the rectangle with inAreaArray and change _targets to only have those

long gazelle
#

Didn't work.

#

Nigel already said the exact same thing and I tried it..

lone glade
#

what's center ?

#

an object or position?

long gazelle
#

Game Logic...

#

I'm assuming..

lone glade
#

.... wat

#

use getPos _center instead and check if it works

long gazelle
#

Because I still don't fully know how this original code works..

#

I started scripting today, hopefully that clears just how much I know about all this.

#

So can you help understand my previous question first?

lone glade
#

it's a trigger, just checked the video you linked

#

getPos _center should do it, also what was the question?

long gazelle
#

No it's not.. The video doesn't cover it very well..

#

The trigger he has is just to demonstrate the area of effect.

#

Hold one.

lone glade
#

yeah, got it, sqf is the goddamn object varname..... 🀦

#

from what i've seen of what you just deleted

#

jesus christ

long gazelle
#

Question: Can you explain me this:

This code is written on the laptop to reset the targets:

this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];

And this is the first line of code in reset.sqf:

params [["_dist",50,[1]],["_center",player,[objNull]]];

Now I'm not making any heads or tails with this because how I understand it is that the laptop executes the reset.sqf and returns the variables:

[radius, objectName] 

But apart from that I have no idea what happens..(edited)

lone glade
#

wait what

#

oooooooh, sqf is you forgetting about the formatting πŸ˜„

long gazelle
#

Just... Ignore the sqf's...

lone glade
#

you scared me for a second

#

reset doesn't return anything

long gazelle
#

Now it's clean..

lone glade
#

reset receives arguments from the addAction, which in this case are nil

#

radius and center aren't defined in the addAction code block (scope)

long gazelle
#

Yes, I wrote them radius and objectName to explain what they are..

#

What I have in the game are [50, iCenter]

lone glade
#

iCenter being the varname of an object / trigger, correct?

long gazelle
#

iCenter being the Game Logic..

lone glade
#

why are you using a game logic?

long gazelle
#

I'm only using what the guy in the video put on the test map he had.

#

There's a download link to it in the description.

#

If it were me I would be using a rectangular Trigger and have every target within it react to the command but unfortunately I'm not that good at scripting yet..

#

@lone glade Where ya go?

lone glade
#

?

#

I mean, I could write it for you, but what would you learn from that?

long gazelle
#

No, I mean I wanted to learn what those two lines I last wrote are doing.. I know that the code in laptop
this addAction ["Reset targets", {0 = [radius, objectName] execVM "reset.sqf"}];
executes the reset.sqf and sends 2 variables to it.

But what I don't know is what happens here:

params [["_dist",50,[1]],["_center",player,[objNull]]];
#

It sets the parameters but besides that it's Latin to me.. For one, what the heck is that 50 doing there?

meager heart
long gazelle
#

And if the [1] is selecting the 2nd variable sent from the laptop then why is the _dist (which I assume is distance) taking the objectName?

#

I already did.

lone glade
#

it doesn't, _center is

#

it defaults to player and expects an object

meager heart
#

[variableName, defaultValue, expectedDataTypes, expectedArrayCount]

long gazelle
#

What about the {0 = []}??

#

I mean, how is that defined?

lone glade
#

it's because he doesn't know how execVM works

long gazelle
#

Ok?

lone glade
#

_handle =[args] execVM "filePath people just forgot you could omit the handle... and just decided to use nil / 0 instead :/

#

the handle is what allows you to use script commands such as terminate on the script

marble basalt
#

hello, sorry to but in but was wondering if someone could tell me how one would add a line of code that is a or option, ei need x item or y, z , c items

lone glade
#

if (BOOL || BOOL) then

#

|| is or, alternatively you can use OR (but then people on this chat will yell at you for good reasons)

marble basalt
#

ok thanks alot

lone glade
rancid ruin
#

good reasons?

lone glade
#

much faster to type and it's more readable

rancid ruin
#

wut

meager heart
#

πŸ˜‚

rancid ruin
#

you don't think "or" is more readable since it's a real word?

#

i use || out of habit, it doesn't really have any advantages lol

lone glade
#

it's because it's a "real word" that it's worse

#

it's easier to see the separations with ||

#

same with &&and AND

long gazelle
#

@lone glade Wanna keep chatting in private so I won't thake space here? Also clearer and easier to multitask..

lone glade
#

nope

rancid ruin
#

but you read OR as OR, your brain has to parse || and translate it internally to OR

lone glade
#

this chat is for help, might as well use it

long gazelle
#

Help them first then.. Get back to me when the channel is clear of traffic.

rancid ruin
#

there are more important things at hand right now

#

someone on the internet is wrong

lone glade
#

oneoh can help too

meager heart
queen cargo
lone glade
#

A.D.V.E.R.T.I.Z.I.N.G

queen cargo
#

Ohh... Just a wiki bot

#

Nah... Not in scope of my bot πŸ˜‚ πŸ˜‚

meager heart
#

πŸ˜€

queen cargo
#

I only execute sqf instead

#

Though, there is a help command but due to the bot not Supporting full cmd range

rancid ruin
#

if you're in this channel and don't have the sqf commands page bookmarked then you should be kicked tbh

#

no need for a bot

lone glade
#

yes need for a bot

#

the search bar on the wiki is trash

#

if you don't type the exact name it will have a 50/50 chance of failing

rancid ruin
#

that's why you bookmark the commands page and ctrl f

lone glade
#

ah, yes, bookmark all the pages

#

why didn't I think of that

#

THATS WHAT THE GODDAMN BAR IS FOR

rancid ruin
#

i'd rather just use ctrl-f and not have to wait for a page load myself

#

way quicker if you can't remember the full name of the function as well, or just remember one word

lone glade
#

doesn't help when you don't remember the name of the command at all

rancid ruin
#

you're fucked then yes

long gazelle
#

Hey, if I have variables [objectName1, objectName2]

And objectName2 was a trigger than can I get its area with

params [ ["_center", player, [objNull] ], ["_area", [10, 10, 0, True], [triggerArea] ] ]
lone glade
#

no, the third argument of params expects a data type

long gazelle
#

Okay, so how would I get the triggerArea without hassle and set it to _area?

meager heart
#

btw you can do it like that params ["_center","_area"];... looks less cool tho

lone glade
#

nah, the other args are needed here

long gazelle
#

One thing at a time guys.. You can argue later... No pun intended..

lone glade
#

pass it as argument

#

[objectName1, myTriggerVarName triggerArea, [args]]

long gazelle
#

what do I type in the [args]??

lone glade
#

whatever is in the wiki page for triggerArea

long gazelle
#

[args]

lone glade
#

can't remember what they are πŸ˜„

long gazelle
#

[a,b,angle,isRectangle,c]

lone glade
#

that's the return value, gimme 5s

#

[objectName1, triggerArea myTriggerVarName ]

long gazelle
#

How would I recieve them in params? I've been reading the page and I'm not entirely sure..

lone glade
#

it's passed to _this in your script and is what params used as input by default

long gazelle
#

I don't get it.. Do I write it like this: params ["_area", [10, 10, 0, True], [] ]

lone glade
#

yes, if you only pass one argument

#

also [[]] as third param

long gazelle
#

So ["_area", [10, 10, 0, True], [ [] ] ] ?

lone glade
#

yes, no need for the spaces in those arrays πŸ˜„

long gazelle
#

There, finally..

#

I know, it makes things easier to read.

queen cargo
#

@meager heart the used syntax also confirms valid input types

long gazelle
#

Alright... Let's test this thing..

meager heart
#

alganthe is right it will be easier for him, X39

long gazelle
#

Laptop code:

this addAction ["Reset targets", {_handle = [50, iCenter, triggerArea targetTrigger] execVM "reset.sqf"}];

iCenter = spheric trigger
targetTrigger = rectangular trigger with x = 10, y = 2, angle = 0

reset.sqf code:

params [["_dist",50,[1]], ["_center", player, [objNull] ], ["_area", [10, 10, 0, True], [ [] ] ] ];

_targets = nearestObjects [position _center, ["TargetBase"], _dist];
_targets = _targets inAreaArray  
    [_center, 
        [_area select 0], 
        [_area select 1], 
        [_area select 2], 
        [_area select 3] 
    ]

if (count _targets < 1) exitWith {
        systemChat "No compatible targets were found.";                
    };
    
{_x animate ["Terc",0];} forEach _targets;                                

{_x addEventHandler                                                 
    ["HIT", 
        {                                            
        _this select 0) animate ["Terc",1];                                
            (_this select 0) RemoveEventHandler ["HIT",0];            
        }
    ]
} forEach _targets;

In short: Not working, any ideas?

meager heart
#

Do you have -showScriptErrors startup param ? Abel_Ex

long gazelle
#

No, but if you are wondering about the missing ; already fixed that.. Didn't work..

#

So I'm guessing the problem is with _area select #

long gazelle
#

Anyone online?

subtle ore
#

Nope

long gazelle
#

Apparently so..

meager heart
subtle ore
#

At least you didn't @ everyone

long gazelle
#

Well doesn't matter any more... Just found the solution to my problems.. Took only 12 hours but who needs sleep anyway?

meager heart
#

welcome to arma

fossil yew
#

I've placed support requester module synced with a soldier (commander). Then I've placed artillery support module synced with mortar. I didn't sync both modules on purpose because I want them synced after certain action is triggered by a player (player needs to call in artillery action on some laptop near antenna tower). In that action I've called a script:

params ["_antena", "_caller", "_id"];

switch (side _caller) do {
    case west:
        {
            [supportRequesterWest, [supportProviderWest]] remoteExec ["synchronizeObjectsAdd", supportRequesterWest];
        };
    case resistance:
        {
            [supportRequesterResistance, [supportProviderResistance]] remoteExec ["synchronizeObjectsAdd", supportRequesterResistance];
        };
};

Unfortunately, that works only on single player despite synchronizeObjectsAdd being a global argument global effect command. What am I doing wrong?

meager heart
#

You can try add this after synchronization BIS_supp_refresh = TRUE; publicVariable "BIS_supp_refresh";

#

@fossil yew

fossil yew
#

that's a secret magic var?

meager heart
#

yep

fossil yew
#

ok thanks

warm gorge
#

What naming convention do you guys use for displays/dialogues? I see some use RscDisplay___, others just use camel cased names like someRandomDisplay

still forum
#

TAG_Display_Whatever TAG_Whatever

warm gorge
#

Sorry, should have put it in that section

still forum
#

important is to include the tag

warm gorge
#

Whys that?

still forum
#

So that others don't use the same classname as you do and break everything

warm gorge
#

Ah yep good point

hushed minnow
#

Hey #arma3_scripting , I was wondering is there anyway to find the marker of a tactical ping in sqf? as in, use it like position myPing??

still forum
#

That no. But I could imagine that there is a eventhandler for it

meager heart
#

Maybe inputAction "TacticalPing" and then you can return position with cursorTarget...

still forum
#

cursorTarget doesn't return the position

meager heart
#

_position = position cursorTarget;

still forum
#

No

#

Won't work at all if you are aiming at anything that's not an object

#

Sky/Terrain/Water/Tree

#

Even if you aim at an enemy AI that you haven't spotted

meager heart
#

well...yep you are right

#

but if look in sky with screenToWorld also will not work... maybe cursorObject and check if it !isNull...

lone glade
#

🀦 screenToWorld is for UI to world pos conversions

still forum
#

Can you ping into the sky?

meager heart
#

No

still forum
#

So no problem?

lone glade
#

the marker is a 2D / 3D icon

meager heart
#

Only if there is object

still forum
#

@lone glade aaand?

#

If there is an object then screenToWorld will work

meager heart
quartz coyote
#

Hello, In OFP you could give any vehicle weapon to a soldier with a addWeapon. In Arma 3 I can give missiles but not getling or miniguns ... can someone help ?

still forum
#

I guess if it doesn't work anymore then it doesn't work anymore

quartz coyote
#

what a shame ....

still forum
#

I remember using vehicle missiles. But I don't think I ever tried miniguns

quartz coyote
#

would it be possible somehow to attach a "M134_minigun" to a katiba ? xD

still forum
quartz coyote
#

okay

peak plover
#

@still forum mikero asks 35 bucks for his tools.
How much will you ask for the intrecept that improves perf

still forum
#

nothing

#

It's open source so...

peak plover
#

Good πŸ˜„

#

Thanks ❀

misty trail
#

I need to get a lot of positions for mt terrain so how would I go about teleporting my player and grabing the positions , directions, height etc and copy to clipboard , can this be done in zeus ?

halcyon crypt
#

you should be able to do it in the editor

#

I believe there's even some copy position to clipboard stuff

misty trail
#

ahh yep found it was over thinking it many thanks

fleet wind
#

I cant figure out how to use ctrlText on RSClistbox (What command do i use to check what is selected on there)

still forum
#

lb commands

#

list box

lone glade
#

lnb is listnbox

#

lb for listboxes / RscCombo

fleet wind
#

so Lbtext ?

lone glade
#

that's a getter

#

can't remember what is used to set / change the text

fleet wind
#

I only want to "Read" the text (Use it as a varibale)

lone glade
#

yeah then lbText

#

use that with the onLBSelChanged UI EH

fleet wind
#
Hint format["This is the player you have selected %1",_playerSelect];```
#

says it returned a number huuu?

lone glade
#

soooo, look at the wiki page again for that command

fleet wind
#

Roger that, πŸ˜‰ Thanks for the help anyway got me on the righ track.

still forum
tough abyss
#

Question about notepadd ++ figured this was the best place to ask.. if Im off topic .. let me know .. How do you append quotes and such to the end of a line of code .. with out manually copy paste .. saw one post on the web said to use find and replace $ and what ever you want to add at the end of each line .. dosent work for me

still forum
#

Why do you want to add quotes to the end of a line

tough abyss
#

Trader categories .. add ", at the end of every item .. has to be an easier way .. front side is easy

still forum
#

replace. Enable regex.
replace \n by ",\n

tough abyss
#

never mind I just figured it out .. needs to have reg expression checked πŸ˜ƒ

#

But thank you for the answer πŸ˜ƒ

exotic tinsel
#

using script, i have created a task and a trigger but how do i sync them to one another?

worldly locust
#

OK, so I'm beginning to move some of my eden concepts into sqf files. This particular script creates a 4 vehicle convoy (on Malden) and sets waypoints down the East coast to Le Port, and monitors for its destruction.

https://pastebin.com/tQimQAAH

So my questions are;

  1. is there anything I can refactor
  2. Am I right to sleep something for so long? (Should be between 30mins and 1hr30mins right?)
  3. How do I add into the waituntil that I want an exit from the wait if the convoy has reached it's destination?
  4. Why do the trucks which spawn in exactly on the road facing the direction they need insist on moving into a herringbone off the road and crash into lamp posts??? grrr
umbral oyster
#

Hello! Anyone know how sign EBO files?

lone glade
#

it's a BI reserved extension

umbral oyster
#

I saw that people signed these files

still forum
#

No.

#

Read BI EULA

subtle ore
#

Obfuscating a pbo is a thing right?

still forum
#

yes

umbral oyster
#

I would not ask if I did not see what I saw, and these signatures worked

lone glade
#

yes, they worked, but it's illegal

still forum
#

@umbral oyster Sure. BI ebo's also have signatures

#

You have to ask BI to sign your EBO as only they have the tools to do it

umbral oyster
#

No, 3rd ebo

#

Not bi

subtle ore
still forum
#

I know.

#

But Only BI can sign them

umbral oyster
#

lol

peak plover
#

How do you even make eboΓ€s

umbral oyster
#

If you do not know what is possible, it's better and say that you do not know.

still forum
#

I know.

#

It is possible

#

BI can do it

#

As I already said

jade abyss
#

Must be a pretty nice life-Server =}

#

That they have to use .ebos

still forum
#

Exile

lone glade
#

and get demonitzed and banned :p

jade abyss
#

Or that

#

^^

umbral oyster
#

I saw how a person not from the environment BI signed these files, their own files, their own byprivatakey, without the help of BI

#

Ye, Exile, fuck life)

still forum
#

Not possible though

lone glade
#

if they did that mean they reverse engineered BI code and broke the EULA

still forum
#

That guy probably had a direct contact to BI to get them signed

lone glade
#

or they asked nicely ^

#

that's also an option

umbral oyster
#

BI can signed files directly for me?))

still forum
#

exactly

lone glade
#

if you're on exile levels of fame probably :/

fleet wind
#

Sorry to intervene What is the reason fror writeing this _target = param [0,objNull,[objNull]]; (From altis life framework) instead of just ?_target = _this select 0

lone glade
#

because param is superior

still forum
#

because it has a default value

subtle ore
#

Default value, and type check

lone glade
#

which makes it superior

fleet wind
#

More efficent?

subtle ore
#

Yes

lone glade
#

default value + typeCheck + privating

still forum
#

@fleet wind no

subtle ore
#

πŸ€”

lone glade
#

it's not more efficient, just a lot more useful

still forum
#

Does a lot more stuff.

lone glade
#

well, it kinda is more efficient if you did all of those

indigo snow
#

id argue params is better than param though

lone glade
#

not the same

still forum
#

not if you only have one argument

umbral oyster
#

You're not kidding? Do they really sign the file on request? @still forum

indigo snow
#

mmm fair

still forum
#

@umbral oyster yes

lone glade
#

it's like saying inAreaArray is superior to inArea

still forum
#

or saying that iforeach3 is superior to count

jade abyss
#

inAreaArray > inArea

still forum
#

Ayyy. Dscha has my fav name today

jade abyss
#

thank you.

subtle ore
#

That is actually an interesting name Dscha

#

How far are you down the list?

still forum
#

It has a lot of history πŸ˜„

long gazelle
#

Hey quick question: what do I need to write, exactly, in to the condition field of a trigger for it to activate on any player passing through?

fleet wind
#

Here comes anothe stupid question why do you declare variables like this at the top for optimization ? private ["_dp","_target"];

subtle ore
#

@long gazelle Don't use triggers?

still forum
#

@long gazelle
thisList count {isPlayer _x} > 0

indigo snow
#

player inArea thisTrigger?

still forum
#

@indigo snow NOOOO

subtle ore
#

@fleet wind

private _var = 0;
//not
private["_var"];
_var = 0;
indigo snow
#

itll activate locally πŸ˜›

long gazelle
#

@still forum Didn't work..

fleet wind
#

@long gazelle You dont really need to write anything in a trigger just change the activation to any player πŸ˜‰

still forum
#

@fleet wind You don't. The private ARRAY variant shouldn't b e used

indigo snow
#

i should probably bow out, im not very much on point today

fleet wind
#

Thanks Dedmen allways to great help πŸ˜‰ Ill be back soon.

still forum
#

Dedmen*

fleet wind
#

Ops

still forum
#

Oops*

jade abyss
#

@subtle ore Still alot more in there =}

subtle ore
#

Daamnnnn.

still forum
#

We need a online name generator that finds fitting names in a 100GB wordlist

subtle ore
#

Woah

long gazelle
#

Okay, so either it the trigger will not activate even if god willed it, or I have the On Activation wrong.... I'm trying to get it do a simple hint for starters... How would I type that in?

still forum
#

God doesn't will stuff

lone glade
#

it doesn't exist

still forum
#

On Activation would be
hint "stuff"

long gazelle
#

No ; in the end?

still forum
#

doesn't matter if you only have one line

#

gud naighkt bois

long gazelle
#

Not only does my Arma minimize itself every 2 seconds the trigger does not work... No hint, no nothing..

#

Ideas?

indigo snow
#

whats your activation setting?

subtle ore
#

Wtf are you on about

indigo snow
#

thisList only consists of units that fulfill that

#

e.g. blufor present

subtle ore
#

Minimise itself every two seconds?

long gazelle
#

type: none, activation: any player, activation type: present, repeatable: yes, server: no

subtle ore
#

Your hands having spasms

indigo snow
#

you're running into it yourself in eden preview?

long gazelle
#

Yes.

peak plover
#

How do I #include from a parent folder?

indigo snow
#

..\aaaa

peak plover
#

is there any way without ..

subtle ore
#

No

indigo snow
#

uh why would you think there would be

peak plover
#

Can't be done with like mission path somehow?

still forum
#

Yes can be done with mission path

#

You can get mission path using a script

peak plover
#

How about in description.ext?

still forum
#

you can't get that scripts path into your script file before the preprocessor

indigo snow
#

youd go to a predefined location though, not necessarily the actual parent folder

subtle ore
#

How's that life code going nigel πŸ€“

peak plover
#

πŸ‘Œ

indigo snow
#

... can you still prune __THISFILE___ or whatever the macro was?

long gazelle
#

So is it not working because I'm in eden?

indigo snow
#

oh no but i couldnt think of another reason for it to not work

#

maybe try switching it to any present instead of player present

peak plover
#

How do I use THISFILE and prune it in description.ext?

long gazelle
#

There is "any player" and "anybody"... Did you mean the latter?

indigo snow
#

sure, Abel

#

nigel, liberal filty abuse of _EVAL?

#

havent messed with them for a year or so

#

dont think you can use that to #include in preprocessor though

long gazelle
#

Why is there no clear guide on the net that says: "Type THIS into the condition area and THIS into the On activation area"...

#

I'm getting nothing and internet ain't being helpful..

lone glade
#

what's the issue?

subtle ore
#

Why not ask here?

#

Your trigger acts as an activation area

long gazelle
#

I've been asking.. So far either nothing's been helpful or clear..

subtle ore
#

Why not ask for clarification on something then?

lone glade
#

put hint "weeee" in the activation area (the code run when the activation condition returns true), don't touch the condition and select a proper activation type

#

boom done

long gazelle
#

I simply want a trigger, that when any player enters the area, it displays a hint saying "hi"..

#

Boom hasn't worked for the past 40 tries..

lone glade
#

activation -> any player
On activation -> hint "hi"

#

that's all you need

long gazelle
#

And that's all I've been having... Does not work.

lone glade
#

is the trigger area large enough / are you in the trigger area

long gazelle
#

Yes and No.

#

Does this have something to do with it not working "function can only be activated during mission init"?

#

It displays everytime I press play scenario..

lone glade
#

huh? do you mind posting a screenshot of the trigger in 3DEN (the properties)

#

well yes

#

that error is unrelated

#

your trigger is working fine

#

what's the issue ?

long gazelle
#

Oh the trigger.. Hold on..

lone glade
#

it's working fine, you say it activates after you press play πŸ˜„

long gazelle
#

What? No no no...

#

You misunderstood completely.

lone glade
#

ah, the error displays, gotcha

inner swallow
#

You're running mods though, aren't you?

long gazelle
#

The hint is never played, ever. The trigger does not work.

#

Yeah...

lone glade
#

then screenshot of the trigger properties pls πŸ˜„

inner swallow
long gazelle
#

Read it, didn't help.

inner swallow
#

Β―_(ツ)_/Β―

long gazelle
#

There's the trigger properties..

inner swallow
#

condition

#

is empty

#

should be this

long gazelle
#

Someone previously said not to put anything in it.. Well it works now.. Next question: is the hint ever gonna go away?

inner swallow
#

yes

long gazelle
#

Ah there we go..

inner swallow
#

Also, those wiki links explain both the condition and activation condition...

long gazelle
#

I read them but for me they are not clear enough..

#

Last question: What command do I need to use in the On Activation: to execVM "test.sqf" with 3 variables?

inner swallow
#

_temp = [var1, var2, var3] execVM "test.sqf"

long gazelle
#

So it was that.. Thanks.. The format of the line was the main point here.. wasn't sure if I should put all of it within [] or not..

indigo snow
#

Putting it all between [] makes it a single array thats passed

#

Thats why it all needs to be in the square brackets

inner swallow
#

so then within the script you can access the first variable by _this select 0 and the second by _this select 1, and so forth.

exotic tinsel
#

how can i, in a triggers condition check the state of a task? im trying to execute script on succeeded of a task using a trigger

indigo snow
#

How have you set up your tasks?

exotic tinsel
#

_Trg_detectMissionComplete setTriggerStatements ["taskState " + _taskid + " == 'Succeeded';","hint 'main task completed';", ""];

stark fox
#

Hi all, I need help trying to get an enemy ai to drop his primary weapon when blufor enters the triiger. I have this in the act: unit1 action ["dropWeapon", unit1, "PRIMARYWEAPON"]

#

but doesnt work

indigo snow
#

LifeSnatcher, youre still using the simpletask commands? You might wanna switch to the mewer tasks function framework

exotic tinsel
#

using the task modules. those work fine, trigger >> set state >> create task. i need to have a trigger unrelated to that chain waiting for the last task to be completed. i am spawning the monitoring trigger in.

#

i just need a trigger condition that if task state == Succeeded then execute activation.

wispy kestrel
#

I am trying to use ["addon"] call BIS_fnc_activateAddon but I cant seem to get it to work. I am calling it from a function with preInit = 1.

lone glade
#

why are you calling this function in the first place?

wispy kestrel
#

I want to add a dependency to an addon without editing the mission.sqm

#

i.e. no placed objects or units

meager heart
#

how it will add dependency if nothing was used from addon ?

peak plover
#
if !(isClass(configFile >> "CfgPatches" >> "rhsusf_c_m1a2")) exitWith {systemChat "no rhs m1a2"};
#

@meager heart

#

You can acces cfgPatches with config viewer

wispy kestrel
#

The functions adds the CfgPatches class to the array actiivatedAddons but needs to be run before mission start

#

I figured preInit would do the trick but doesn't

peak plover
#

Ohh oops

#

Thought he asked

lone glade
#

before time is above 0, it's not a "perfect" preInit check.

wispy kestrel
#

maybe use older activateAddons command instead?

lone glade
#

that's what the func uses

wispy kestrel
#

right

peak plover
#

hmm

lone glade
#
if !(isserver) exitwith {"The function can be called only on server." call bis_fnc_error; []};
if (time > 0) exitwith {"The function can be activated only during the mission init." call bis_fnc_error; []};

private ["_input","_addons"];
_input = [_this] param [0,[],[[]]];
_addons = activatedaddons;
{
    private ["_addon"];
    _addon = _x param [0,"",[""]];
    _addon = if (isclass (configfile >> "cfgpatches" >> _addon)) then {[_addon]} else {unitaddons _addon};
    {
        if !(_x in _addons) then {_addons set [count _addons,_x];};
    } foreach _addon;
} foreach _input;
activateaddons _addons;
_addons
#

here it is

wispy kestrel
#

I am looking at it atm too

#

So preInit = 1 doesn't guarentee that if (time > 0) will be true?

meager heart
#

@peak plover dependency != cfgpatches check

peak plover
#

yea my bad

#

Misread

meager heart
#

np

edgy dune
#

question

#

is there away to say,disable ejecting with scripts πŸ˜›

#

aka like delete the action from the menu

lone glade
#

no

river meteor
#

if you lock a vehicle can it still be ejected from?

lone glade
#

nope

jade abyss
#

Yes

lone glade
#

wait what?

jade abyss
#

wait, nvm. I had the AI Dissembark in mind

edgy dune
#

aye thx

#

will make a script that just locks the vic XD

meager heart
#

and name it omae_wa_mou_shindeiru.sqf πŸ˜„

edgy dune
#

πŸ˜ƒ

#

okay so u know how u can spawn dogs right?

#

wat if im bored af, and I wana attach the mx rifle to the dog....for science

#

can u attach a rifle to a dog? like ik u can attach objects to objects but ....idk i figured weapons would be diffrent

meager heart
#

attach weapon holder maybe

edgy dune
#

okai

#

also

#

so im looking at the createUnit function on the wiki

#
_unit = group player createUnit ["B_RangeMaster_F", position player, [], 0, "FORM"];
``` this is one fo the examples
#

the thing is when I use it in zeus on a server in on

#

i makes N times range masters,where N is the number of ppl on the server

#

any ideas why?

lone glade
#

lemme guess, you run that in init.sqf or initPlayer.sqf ?

meager heart
#

probably some mega addon for zeus

umbral oyster
#

Is it possible to stop the sound produced by the say3D command?

zenith edge
#

while(true) in scheduled space doesn't survive mission changes right?

unborn ether
#

@zenith edge What do you mean by mission changes? The condition of the while is evaluated on each cycle. Consider that values stored in private variables are not updated, unless you do that in its body. (if meant this)

zenith edge
#

i mean if you are hosting a mission on a dedicated server. you launch some code in scheduled enviroment, with a while loop without any exit logic at all. and then you change the mission without restarting the server

#

does that while true loop survive

#

or does the engine end it for you

unborn ether
#

@zenith edge If that was running in a schedule of a mission (almost anything scripted*) it goes away with mission namespace. * There are few scripted things that aren't nullified on mission restart/stop, such as onEachFrame and any EH that is attached to a such displays as RscDisplayMain

zenith edge
#

and the engine will free memory on scope loss and isn't just removing the pointer?

#

for variables?

#

so we dont have to manually null them?

unborn ether
#

@zenith edge Not sure about how engine handles that, but schedule is "dying" for sure. You might ask #arma3_scenario about how mission schedule reacts to exactly restarting it.

umbral oyster
#

@unborn ether я знаю ΠΊΠ°ΠΊ ΠΎΠ½Π° Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚, я ΡΠΏΡ€Π°ΡˆΠΈΠ²Π°ΡŽ Π΅ΡΡ‚ΡŒ Π»ΠΈ способы ΠΎΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ Π·Π²ΡƒΠΊ Π²ΠΎ врСмя воспроизвСдСния, Π½Π°ΠΌΠ°Π½Π΅Ρ€ ΠΊΠ½ΠΎΠΏΠΊΠΈ стоп.

#

Oh

#

Sorry

#

@unborn ether I know how it works, I'm asking if there are ways to stop the sound during playback, a like a stop button.

unborn ether
#

@umbral oyster Π—Π²ΡƒΠΊ ΠΌΠΎΠΆΠ΅Ρ‚ остановится Ρ‚ΠΎΠ»ΡŒΠΊΠΎ с отсутвиСм рСсурса Π·Π²ΡƒΠΊΠ° ΠΈΠ»ΠΈ Π΅Π³ΠΎ ΡΠΌΠ΅Ρ€Ρ‚ΡŒΡŽ. Если Ρ‚Ρ‹ Ρ…ΠΎΡ‡Π΅ΡˆΡŒ ΡƒΠ³Π»ΡƒΠ±ΠΈΡ‚ΡŒΡΡ Π² эту Ρ‚Π΅ΠΌΡƒ, моТСшь ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ createSoundSource, Ρ‡Ρ‚ΠΎ ΠΏΠΎ Ρ„Π°ΠΊΡ‚Ρƒ ΠΈ происходит. Как описал Π² ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΈ Killzone Kid, ΠΌΠΎΠΆΠ½ΠΎ Π²Ρ‹ΡΡΠ½ΠΈΡ‚ΡŒ, Ρ‡Ρ‚ΠΎ создаСтся ΡΠΏΠ΅Ρ†ΠΈΠ°Π»ΡŒΠ½Ρ‹ΠΉ физичСский рСсурс, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠΎ Ρ„Π°ΠΊΡ‚Ρƒ ΡƒΠ΄Π°Π»ΠΈΡ‚ΡŒ, Π½ΠΎ это довольно нСудобная схСма для ΠΌΠ°Π½Π°Π³Π°

umbral oyster
#

Понял, спасибо, Ρ‡Π΅Ρ‚ Π½Π΅ Π²ΠΈΠ΄Π΅Π» Ρ€Π°Π½ΡŒΡˆΠ΅ этой ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹

unborn ether
#

@umbral oyster And yeah, we should talk only EN here. Rules.

umbral oyster
#

@unborn ether sure)

thorn saffron
#

Could you guys help me out a bit? I would like to have the player's current animation class name displayed in the systemchat.

#

I'm trying to get a crosshair to display when you run with weapon up (not tactical pace though). I did add "showWeaponAim=1" but it does not seem to work for some reason.

#

I suspect I might have edited the wrong animations

meager heart
#

you can try this _current_anim = animationState player;

unborn ether
#

@thorn saffron You can use AnimStateChanged EVH, it does trigger for any animation changes, including animation sequences.

thorn saffron
#

Never mind, I did edit the correct animations, its just the fact the crosshair does not appear for some reason

#

I do have it enabled and it does work for the tactical pace

meager heart
#

@thorn saffron

thorn saffron
#
class CfgMovesMaleSdr: CfgMovesBasic
{
        class States
    {
        
        class AmovPknlMstpSrasWrflDnon;
        class AidlPknlMstpSrasWpstDnon_G0S;
        class AmovPercMrunSlowWlnrDf;
        class AmovPercMstpSrasWrflDnon;
        class AmovPercMstpSrasWpstDnon;
        class AmovPknlMrunSrasWrflDf: AmovPknlMstpSrasWrflDnon
        {
            showWeaponAim=1;
        };
        class AmovPknlMrunSrasWpstDf: AidlPknlMstpSrasWpstDnon_G0S
        {
            showWeaponAim=1;
        };
        class AmovPknlMrunSrasWlnrDf: AmovPercMrunSlowWlnrDf
        {
            showWeaponAim=1;
        };
        class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon
        {
            showWeaponAim=1;
        };
        class AmovPercMrunSrasWpstDf: AmovPercMstpSrasWpstDnon
        {
            showWeaponAim=1;
        };
        class AmovPercMrunSrasWlnrDf: AmovPercMrunSlowWlnrDf
        {
            showWeaponAim=1;
        };
    };
};```
#

I did edit the correct animations but arma seems to do stuff with the crosshairs, I guess I'll just live with that.

#

And yeah I did check ingame using "_current_anim = animationState player"

#

As a fun note: the weapon in arma does not actually aim at the center of the screen, its a bit off. I tried out a simple crosshair in the screen center (using reshade) and the arma crosshair was always off. My guess is when I enabled the crosshair for the running animation it actually points somewhere off the side, where the weapon is actually pointing. Although I should see the crosshair for the pistol at least.

split coral
#

Is it possible to spawn a partly damaged building? I tried setting hitpoint damage to a normal editor placed house, but I only managed to break the windows.
Hiding/unhiding damage selections on a simpleObject building also didn't do anything. The normal terrain object of the same house can be broken with the editor module.

unborn ether
#

@thorn saffron Eh, yes crosshair is relative to gun sights. Nice thing for VR experience tbh.

thorn saffron
#

@unborn ether I found the reason, its the "disableWeapons" setting, but if I enable it then the first shot is somewhere off to the side, before the character can bring the weapon up. The crosshair does appear in the center though.

cedar kindle
#

bullets are literally fired from the barrel. you’ll notice this using forceWeaponFire with weapon on back

meager heart
#

from usti hlavne in direction of konec hlavne... memory points

thorn saffron
#

Oh yeah, got the crosshair working properly!

cedar kindle
#

usti hlavne is my favorite hlavne

exotic tinsel
#

is it possible to detect if a task is completed in a triggers condition?

fossil yew
exotic tinsel
#

thank you

#

i tried doing this but im not getting a hint message when i complete the task

#

_Trg_detectMissionComplete = createTrigger ["EmptyDetector", getMarkerPos _spawnmarker];
_Trg_detectMissionComplete setTriggerStatements ["(taskCompleted " + _taskid + ") ","hint 'worked';", ""];
_Trg_detectMissionComplete setTriggerTimeout [20, 20, 20, True];

fossil yew
#

how do you create a task?

exotic tinsel
#

using the eden editor

fossil yew
#

which property is _taskid?

#

think module var is not that, there is a taskId attribute on create task module

#

double check that

#

I don't know what type of tasks that module creates, but it should be simple task for taskCompleted. You can double check like this - if your task is on list of simpleTasks then you can use taskCompleted.

#

If not, there is something in that Intel module that is different than simple tasks.

exotic tinsel
#

rgr, ill test it out. sorry got pulled away. thanks mate for info

#

ok so i changed the task varrible name to be "task_1" and thats what im passing. but im gettinga n error on the trigger condition.

#

_Trg_detectMissionComplete setTriggerStatements ["BIS_fnc_taskCompleted " + _task + "; ","hint 'worked';", ""];

fossil yew
#

["task_1"] call BIS_fnc_taskCompleted should be your condition

#

BIS_fnc_taskCompleted is a function, not a command, hence the parameter array.

exotic tinsel
#

is this correct syntax? _Trg_detectMissionComplete setTriggerStatements ["['" + _task + "'] call BIS_fnc_taskCompleted ","hint 'worked';", ""];

indigo snow
#

format["[%1] call BIS_fnc_taskCompleted",_task] (I generally like using format for readability)

#

You need to go go check if the actual task name is correct, it might not be the same as the module variable name if you used that

#

if youre doing these things by script anyway, might as well create these tasks via script.

fossil yew
#

It's better he uses tasks framework, takes care of MP locality issues.

#

createSimpleTask is local effect only

exotic tinsel
#

Im creating the task in eden using the createtask module, the taskid is set to β€œtest_1” the variable field is blank.
In the createtask module i put in the init, β€œ["test_1", 'marker_0', 'true', 1] call TLS_fnc_missionspawnfunc;”

When the composition spawns in i want my function β€œTLS_fnc_missionspawnfunc” to create a trigger to wait for the task to be completed. Im not getting errors using the below code, but its also not giving me a hint.

_Trg_detectMissionComplete = createTrigger ["EmptyDetector", getMarkerPos _spawnmarker];
_Trg_detectMissionComplete setTriggerStatements [format["[%1] call BIS_fnc_taskCompleted",_task],"hint 'worked';", ""];
_Trg_detectMissionComplete setTriggerTimeout [20, 20, 20, True];

fossil yew
#

you made it a lot more complicated than it should be

#
  1. create a task as above, ditch this ["test_1", 'marker_0', 'true', 1] call TLS_fnc_missionspawnfunc;
indigo snow
#

Don't you already have a trigger that toggles the module that sets the task to complete?

fossil yew
#
  1. create a trigger and in condition use ["task_1"] call BIS_fnc_taskCompleted as condition. Put hint "it works!"; in on activation
#

also, that's a good question, when does your task complete?

exotic tinsel
#

yes its important to know, i cant modify the compositions task logic chain. i can onlyy add my function call somewhere that detects when the compostions task is complete so i can despawn it.

#

this is the last peice of a larger setup, i get this figured out im done.

fossil yew
#

I sense missing quotes in this _Trg_detectMissionComplete setTriggerStatements [format["[%1] call BIS_fnc_taskCompleted",_task],"hint 'worked';", ""];

#

this will format it as [task_1] call BIS_fnc_taskCompleted while it should be ["task_1"] call BIS_fnc_taskCompleted

#

try putting str around

exotic tinsel
#

testing now

indigo snow
#

good point

fossil yew
#

also consider using something that is not a trigger, simple spawn with waitUntil and sleep will do as well

exotic tinsel
#

no error, but also no hint

meager heart
#

your syntax is wrong for setTriggerStatements @exotic tinsel

exotic tinsel
#

here is the updated code
_Trg_detectMissionComplete setTriggerStatements ["['task_1'] call BIS_fnc_taskCompleted","hint 'worked';", ""];

meager heart
#
_Trg_detectMissionComplete setTriggerStatements ["['test_1'] call BIS_fnc_taskCompleted", "'Task completed' remoteExec ['hintSilent']", ""];
exotic tinsel
#

scratch that last post

#

_Trg_detectMissionComplete setTriggerStatements ["['+ _task +'] call BIS_fnc_taskCompleted","hint 'worked';", ""];

fossil yew
#

hintSilent - typo

meager heart
#

fixed

exotic tinsel
#

@fossil yew do i need to change my hint to hintsilent?

fossil yew
#

doesn't matter

#

key might be in remoteExec

#

it will execute hint on every machine

exotic tinsel
#

will this work?
_Trg_detectMissionComplete setTriggerStatements ["['+ _task +'] call BIS_fnc_taskCompleted","'hello' remoteExec ['hint']; ", ""];

meager heart
#

no task id

exotic tinsel
#

its in the var _task

meager heart
#

you have + _task +

fossil yew
#

can you please format code @exotic tinsel as this is hard to read, use code formatting for Discord

exotic tinsel
#

isnt that how i put a var in a string?

meager heart
#

```sqf
your code
```

exotic tinsel
#

rgr will do @fossil yew

#

_Trg_detectMissionComplete setTriggerStatements [
"
['+ _task +'] call BIS_fnc_taskCompleted
",
"
'hello' remoteExec ['hint'];
",
""];

meager heart
#

what your task id ? task_1 ?

exotic tinsel
#

test_1 passed in via function params

meager heart
#

and you have + _task +

exotic tinsel
#

i dont know how to refrence a var in a string

#

thought that worked for me in the past, please advise

meager heart
#

your task id string will be "test_1" or 'test_1' if its inside " "

#

Im creating the task in eden using the createtask module, the taskid is set to β€œtest_1” the variable field is blank.

#

that is your task id

exotic tinsel
#

its my understanding that when placing strings inside (setTriggerStatments) string, that i have to use single quotes for other string.

meager heart
#

" 'string_1' "

exotic tinsel
#

so i dont need to us "+" to append?

#

use*

meager heart
#

do you have showScriptErrors param ?

exotic tinsel
#

yes

meager heart
#

and no errors ?

exotic tinsel
#

_task is a var param used in the function that is called that creates this trigger

#

no errors

#

i cant hard code the task id in the trigger creation, it needs to be dynamic