#arma3_scripting

1 messages ยท Page 584 of 1

winter rose
#
// server-side
thePilot assignAsDriver heli;
theGunner assignAsGunner heli;
[thePilot, theGunner] orderGetIn true;
waitUntil { thePilot in heli };
heli engineOn true;
waitUntil { theGunner in heli };
waitUntil { sleep 1; _units findIf { !(_x in heli) } == -1 };
heli move getMarkerPos "heli_move";
```should work ๐Ÿ˜‰
manic sigil
#

Of course there's 'move' as a script command T_T

winter rose
#

:p

manic sigil
#

Though I had a lot of things tied to specific waypoints... mostly radio chatter, but still. Hrn...

#

Would this be run as an SQF, Init, or triggered event?

winter rose
#

you could put this in initServer.sqf yes

#

maybe with a sleep 1; before, just in case

manic sigil
#

Ugh... I'm going to have to offload so many things into external files, aren't I T_T

#

Double ugh, that's the only proper way to do anything more complex than dropping units on the map and killing them, isn't it T_T T_T

winter rose
#

if you only need one waypoint after another, just use waypoints
if you want to do complex things and setCurrentWaypoint (which you should not need for simple waypoints), ditch them and go scripting

dusk badge
#

I'm pretty new to SQF. Can someone check me?
c = "a" select 0; is equivalent of char c = 'a'; am I right?

manic sigil
#

It's not like I'm making them do anything complex, but it is enough simple parts that complexity is just a byproduct. Thanks, Lou, I'll see what I can do.

still forum
#

c = "a" select 0; is equivalent of char c = 'a'; am I right?
uh.. yes and no?

#

c = "a" select 0
is equal to
Hello I'm a syntax error

dusk badge
#

I need the char value. I want to fill an array with characters. If I use apply { "a" }; it gives me an arrays of strings.

winter rose
#

Alternative Syntax 3

Syntax:
string select [start, length]

#

there is no "character" type - only String

dusk badge
#

So _arr = _arr apply { "a" select 0 }; is what I'm currently trying

#

Would I actually have to use a hardcoded ASCII value?

winter rose
#

no. Stop. What do you want to do.

#

I want to fill an array with characters

#
private _myArray = ["mycharacters"];
```boom, done
dusk badge
#

Right. That would solve the issue for let's say a length of 10. What If it should be 20, 100 or even 1000?

#

It 'works' if I use a hardcoded value, but that's just dirty.

winter rose
#

so you mostly don't want an array, you want a big string

#

an (ugly) way to do so would be:

private _array = [];
_array resize 1000; // your string length
private _finalString = (_array apply { "a" }) joinString "";
#

it might be the faster/cleaner way actually

dusk badge
#

Hmm. Let me test this

#

That appears to be doing what I need. Still weird that SQF has no concept of characters. Considering a string really is an array of characters.

winter rose
#

yes, but not really needed at this level

dusk badge
#
_myStr = "a";
diag_log toArray _myStr;

[97]

#

It doesn't have a representation for it. But it's there.

winter rose
dusk badge
#

It can, just not outside of an array. Which is good enough ๐Ÿ˜…

manic sigil
#

Yay, my text editor uses " marks that .sqf doesn't recognize after I just bashed out 30 lines of new code and a backup save to nuke ๐Ÿ˜ƒ ๐Ÿ˜ƒ ๐Ÿคข ๐Ÿ˜ƒ

winter rose
#

โ€ฆwha'?

manic sigil
#

Do not code in a ten year old OpenOffice window, then copy-paste into Notepad to save as an SQF

tough abyss
#

why would you do that

manic sigil
#

Because I hate myself

tough abyss
#

why don't you use your mouse and on screen keyboard while you're at it?

#

or better yet speech to text

manic sigil
#

Yes, NOW you've got it

#

Hah, it's literally 30 lines of code too. crazy.

tough abyss
#

30 lines isn't necessarily that much though. I'd recommend vscode/notepad++ for sqf

manic sigil
#

Just installed Notepad ++

#

And it isn't, but it's half fresh-written, half copy-pasted from triggers I had in the mission already

#

So it throwing a fit over the quote marks not being exactly 6 pixels tall is the highlight of my day

#

It's " instead of "

#

Which I'm really hoping came across or I'mma look like a madman

#

Wait, no

winter rose
#

easy, Ctrl+H

manic sigil
#

That's the wrong one

#

โ€œ vs "

winter rose
#

(also, switch to LibreOffice)
anyway, Notepad++ or Visual Studio Code should be way better

manic sigil
#

Thanks again, Lou; got the last one.

And we use LibreOffice at work and it just makes my soul bleed.

#

Mostly because people have been poking at it for years and nothing works right anymore, but I digress

#

Okay, two dozen restarts later, script stopped throwing up errors, things seem to be running... now to see if the pilot still dicks me over :x

#

xD So close. At least he didn't fly off.

manic sigil
#

Okay, so far so good, but 'move' brings him to a hover above my desired point, and

waitUntil {(Taru distance GetMarkerPos "TaruWP1") < 200};

didn't seem to parse

winter rose
#

@manic sigil what do you want i to do, land?

manic sigil
#

I want it to reach that point in steady flight, then have it land at the LZ a little distance away - I was going with an AddWaypoint once it was within 200m of the move command's target, but it appears to have quietly died.

winter rose
#
private _wp1pos = getMarkerPos "TaruWP1";
waitUntil { heli distance _wp1pos < 200 };
heli land "land";
manic sigil
#

ffs I swear I searched for 'land' as a simple command t_t

#

I swear I'm not this new to scripting!

#

Though correct me if I'm wrong, but wouldn't that script just make the pilot land at TaruWP1? My goal is a nearby LZ, a bit too far for the AI to search for the invisible helipad. Is it possible to interrupt a Move with another Move?

mighty vector
#

Hi again.

Trying to do a multiline html text control (aka: textarea).

ctrlSetStructuredText parseText "<a href='http://arma3.com'>A3</a>" generates a wonderful link...but sadly ctrlText flattens the text.
Is there any way to get the control text in his original "html" format?

round scroll
#

looks like this carrying/dragging injured AI by AI topic is not done? I'm currently looking for a solution where one AI carries or drags another one to a player controlled helicopter, both AI then GETIN the heli

exotic flax
#

you could try to script it yourself, because I don't believe it exists yet

round scroll
#

I'm not even able to get them into a injured animation I''m afraid: sqf injured switchMove "Acts_LyingWounded_loop"; injured2 switchMove "Acts_SittingWounded_loop";

sage flume
#

looks like this carrying/dragging injured AI by AI topic is not done? I'm currently looking for a solution where one AI carries or drags another one to a player controlled helicopter, both AI then GETIN the heli
@round scroll I wish I knew more, would make a great stanalone mod

#

Coop could be very useful...

#

and cool

#

I know your scripting for AI but nonetheless

round scroll
#

bis coding to the help: sqf [injured, "PRONE_INJURED", "NONE"] call BIS_fnc_ambientAnim; [injured2, "PRONE_INJURED_U1", "NONE"] call BIS_fnc_ambientAnim;

mighty vector
#

I'll ask another way: how to append HTML to ctrlSetStructuredText ?

winter rose
#

+?

mighty vector
#

...example? cause i have being dealing with parseText for half an hour...

#

_oldTxt = ctrlText _control;
_control ctrlSetStructuredText parseText format ["<a href='http://arma3.com'>A3</a><br/>%1<br/>%2", _oldTxt, _newTxt];

doesnt work (it flattens html)

winter rose
#
private _structuredText = "<a href='blah'>blah</a>";
_ctrl ctrlSetStructuredText _structuredText;

_ctrl  ctrlSetStructuredText formatText ["%1%2", _structuredText, _html];
``` _perhaps_
#

it seems there is no ctrlStructuredText to get it, maybe you can do something with ctrlText

#

Though correct me if I'm wrong, but wouldn't that script just make the pilot land at TaruWP1? My goal is a nearby LZ, a bit too far for the AI to search for the invisible helipad. Is it possible to interrupt a Move with another Move?
@manic sigil he would land near taruWP1 yes.
yes you can override a move with another move

manic sigil
#

Yeah, working that out now... though it's less than ideal, get a real AI landing flare going T_T I don't want to much with unitCapture but it may be necessary for muh realisms

winter rose
#

depends on the level of precision you want

you can do a waitUntil heli close to taruwp1, then heli move getpos helipad, then land

mighty vector
#

@winter rose that doesn't seem to work neither.

_oldTxt = ctrlText _control;
_control ctrlSetStructuredText formatText ["%1<br/><a href='http://arma3.com'>%2</a>", _oldTxt, _newTxt];
doesnt parseHTML

_oldTxt = ctrlText _control;
_control ctrlSetStructuredText parseText ["%1<br/><a href='http://arma3.com'>%2</a>", _oldTxt, _newTxt];
parses new as html, but old is flattened

winter rose
#

(```sqf , see pinned message)

#

then I don't know if there is a way to get structured text from a control.

#

best bet: keep it somewhere like setVariable it on the control @mighty vector

mighty vector
#

do u mean store data in html/raw, append there, and then parseText for control...well, it could work. ill give a try.

winter rose
#

ctrlText returns a string, not structured text
so yep, use alternative storing

mighty vector
#

@winter rose thanks. it woarks. I will use that for a while ๐Ÿ˜‰

winter rose
#

noice!

manic sigil
#

Getting closer... only one error away from the first leg of the mission being scripted in a single .sqf ๐Ÿ˜ฎ

#

At least, the pilot side of it

#

And no guarantees it's repeatable, and it's not a smooth entry in the slightest :/

winter rose
#

the issue beingโ€ฆ?

manic sigil
#

AI flying habits ๐Ÿ˜›

#

Tale as old as time, the autohover-ultrasafe-soccermomwithextrakids approach in what's supposed to be a tense combat drop

#

That, and the final part of my script didn't fire o.0 No errors, but the expected sideChat/move order didn't trigger.

mighty vector
#

autohover-ultrasafe-soccermomwithextrakids
@manic sigil LOL

manic sigil
#

Hrm...

#
private _Passengers = fullCrew [Taru,"Cargo",false];
waitUntil {count _Passengers == 0};

Doesn't seem to trip, even when _passangers hits 0.

#

Oh come on XD

#

First i can't code in Arma, now I can't even markup in Discord

#

There wego

#

... nvm, I'm getting there slowly.

#

It's not updating, is it. It's just getting a number then sitting on it.

winter rose
#

yep

manic sigil
#

That got it :3

#

So that was what... 4 hours to replace the first leg of my mission? ๐Ÿ˜›

winter rose
#
waitUntil { sleep 1; count fullCrew [Taru, "Cargo", false] == 0 };
#

4 hours to replace the first leg of my mission?
it's an investment ;-p

distant wave
#

i have found that sometimes the player object (civ_3 forExample) is returned objNull, even if a player is using that slot. why is this happening?

#

hmm

winter rose
#

@distant wave when?

distant wave
#

well i just test the player in the debug console using isNull civ_3;

#

and returns true

winter rose
#

try civ_3 == player?

distant wave
#

it's another player from the server, not my player which works fine

winter rose
#

then maybe civ_3 is not defined on your machine

#

it might be a locality issue, idk.

#

you could try

hint str allPlayers;
```to get a preview of all named units
distant wave
#

okay.. in the allPlayers array the object seems that's there, but if i do this in the debug

private _obj = civ_3;
_obj

running as local or server it returns <NULL-OBJECT>

winter rose
#

yeah, and did you see civ_3 in allPlayers?

distant wave
#

yep. but if i check isNull civ_3 it returns true..

winter rose
#

now that's weird. where is civ_3 defined?

distant wave
#

it's a player slot

#

defined, i guess in the SQM

winter rose
#

eden editor variable?

distant wave
#

yep

winter rose
#

ok
well, tbh idk

#

civ_3 setDamage 1?
or he died and got deleted?

distant wave
#

searching in the BIS wiki found in here https://community.bistudio.com/wiki/isPlayer this In some cases, the identity of certain player units might fail to propagate to other clients and the server, which causes isPlayer and getPlayerUID to incorrectly return false and "", respectively, where the affected units are not local.[1] Therefore, beware of false negatives.

#

so probably this is the problem

#

but the next question is how to prevent this ๐Ÿ˜’

winter rose
#

^ that's what I never figured, the "some cases"

elfin garden
#

isPlayer and getPlayerUID to incorrectly return false and ""

#

You're having it return true tho

winter rose
#

ping me if you find out so I can document it

elfin garden
#

What does getPlayerUID return

distant wave
#

if i find something i'll tell you

#

get PlayerUID return ""

elfin garden
#

Oh wait you ran isNull instead of isPlayer

#

Does isPlayer return false as well

distant wave
#

yep, even if that slot is used by a player

elfin garden
#

Interesting

distant wave
#

i tried doing cursorTarget looking at the civ_3 player with local exec and it returns this C Alpha 1-3:1 (oski689) REMOTE (civ_3) on that player which has this problem, but if i do this cursorTarget on a working fine players it returns their slot like eg. civ_5

#

maybe because i got a zeus module in the mission for the loggedInAdmin?

astral tendon
#

how do I check who is in control of the UAV? because UAVControl does not seens to work on dedicated server

spiral fractal
#

I cant understand, setMarkerPos is global (EG) command, inside loop in script that executed on server, when I use this command its not working, but if I use remoteExec with parameter 2 it is, why?

rough dagger
#

Hi everyone, I come here as a last resort, and hoping someone can steer me right on this. Probably dead easy in the right hands. I want to preserve an addAction on a heli asset in my MP mission. Trouble is, when the asset respawns (using the MP respawn module from the editor) the addAction disappears. My best guess is that the respawning process renames the asset, so my action assigned to "heli1" does not exist any more bc "heli1" is replaced with "heli1_1". This is just a guess. Anyway, what I was hoping for is some advice on how one would go about keeping an addAction assigned to a respawnable asset like a heli in MP.

#

Would I need to look at a script-based option, and find a way to retain the asset name (e.g. heli1), so the addAction always has a home. Or, would I ditch the reliance on a named asset and us the init field of the asset and/or the vehicle respawn module (so that the code fires on respawn)?

#

Any advice on how best to do this would be super appreciated

robust hollow
#

you need to add the action every time the vehicle respawns, because it is technically a new object.

night frigate
#

It'

#

It's basically the last thing you said - put the code in the respawn module. ๐Ÿ™‚

smoky verge
#

I mean if you want to keep the init you can just spawn the vehicle by script and then repeat the script once the vehicle is dead
so the variable name is the same and the init is the same

rough dagger
#

right right .. thank you guys .. I have been thinking about the latter option, but was unsure how to manage a homebrew resapwn script that didn't kill my performance lol, so I guess I was leaning towards a vehicleRespawnModule solution.

#

@night frigate thank you for the link, checking now

#

as always, thank you all for your help ๐Ÿ™‚

glass zinc
#
_Ratio=0.3; //At _a=0.2, with 30 players, 6 AI allowed/player....At _a=0.3, with 30 players, 3 AI allowed/player.
_Max=12;

while {! CTI_GameOver} do {
    _nbp={isPlayer _x} count playableUnits;
    _next=0 max ceil(_Max-(_Ratio*_nbp));
    if !(missionNamespace getVariable "CTI_PLAYERS_GROUPSIZE" == _next ) then {
        missionNamespace setVariable ["CTI_PLAYERS_GROUPSIZE",_next] ;
        HUD_NOTIFICATIONS pushBack [format ["Group size is now : %1 ",_next],time+10,"ffffff"];

    };
    sleep 60;
};

Im trying to change this script to do a check for PlayerNumber instead. Im essentially trying to make a script that will give the side with less players more AI while also balancing according to server player count
https://community.bistudio.com/wiki/playersNumber
anyone have any suggestions?

winter rose
#

could you name your variables properly please? I get _nbp is number of players, but _a and _bโ€ฆ please ^^
_a = ratio,
_b = max?

glass zinc
#

yeah b is max

#

ill change those

still forum
#

What makes {isPlayer _x} count playableUnits; different from count allPlayers ?

winter rose
#

Arma 2 script I suppose?

glass zinc
#

yes it came from arma 2 CTI

still forum
#

pushBack is also A3, and its in there

winter rose
#

he is updating it

glass zinc
#

well it came from arma 2 and was updated for a3

still forum
#

You want to find players per side.
west countSide allPlayers
east countSide allPlayers

winter rose
#

or```sqf
count playersNumber west;

night frigate
#

countSide would include anything in the mission, right - not just player/playable slots?

winter rose
#

allPlayers would restrict that to players

night frigate
#

anyway, I guess you could do playersNumber east and playersNumber west, compare those, find the difference, and then add AI to the side with fewer players (don't forget to disable AI or it'll count the playable bots) based on your ratio.

#

(unless you want to count the playable bots, that is, I guess ๐Ÿ™‚ )

glass zinc
#

there are no playable bots, or at last not ones that take up mission side slots

    _west = playersNumber west;
    _east = playersNumber east;
    _countplayersbyside = 

so yes I need to compare the number then once the 2 numbers are compared i need to have a ratio that is in favor of the side with less, and then gives that side more AI
this is normally done using

player setVariable ["CTI_PLAYER_GROUPSIZE", CTI_PLAYERS_GROUPSIZE, true];
#

to set the groupsize via a single value

#

so i need to find a way to split it based on side

#

so when i assign the new value it does it properly per side

night frigate
#

I'm not sure what CTI is doing with that variable elsewhere

glass zinc
#

well it has a table where its got a numbers going from 0-16, and 99.

#

when on of those numbers is selected it goes down a different path. at 0 it uses a upgrade system based off that sides upgrades. on the other settings its just a hard number

#

i added 99 so it would use this script

#

so on 99 it activates this sqf

night frigate
#

OK. Do you need it to modify this variable?

glass zinc
#

how do I create a ratio with the 2 numbers.
umm i dont quite understand. I need to switch it so player setVariable ["CTI_PLAYER_GROUPSIZE", CTI_PLAYERS_GROUPSIZE, true]; will take player side into account. but that is a later problem

night frigate
#

and, so I understand... if one side has 10 players, and the other has 12, you want to add AI - like actually spawn AI into one of the players' groups - based on a factor calculated off the difference of 2 players?

glass zinc
#

yes, but the ai does not spawn, it just changes a value of how many AI that player can buy/ho;d

#

so how do i take 10 west and 12 east, turn that into a ratio that spits out 2 numbers

night frigate
#

ahhh, OK.

glass zinc
#

that i can then apply per side

night frigate
#

So if there are 10 on east and 12 on west, you want east to be able to recruit (e.g.) 20 AI, and west only to be able to recruit 14 AI?

glass zinc
#

yes

winter rose
#
private _westNumber = count playersNumber west;
private _eastNumber = count playersNumber east;
private _max = _westNumber max _eastNumber;

private _westAllowed = _max - _westNumber;
private _eastAllowed = _max - _eastNumber;
#

waitโ€ฆ I don't get anything about it.

night frigate
#

heheh. That's why I was asking q's. ๐Ÿ™‚

#

What is the max number of units you want on either side?

#

(player plus AI)?

glass zinc
#

so like west has 12 players, east has 6
I need to take those 2 numbers, have a function compare that and be like west has 50% more players then east so give each east player +5 AI per extra player or %50 more AI

winter rose
#

or

glass zinc
#

I obviously dont want it so if one side has 13 and other side had 13 and then loses one and then has 12 that that side does not get a immediate boost of like 10 AI

#

i need it to understand if there is a gap

#

and how wide that gap is

#

and then give a boost to the side losing players

night frigate
#

OK, then I think what Lou gave you above would work, just take _westAllowed and _eastAllowed and multiply by the number of AI you want per missing player on the side with fewer players

winter rose
#

and if someone connects again? kill the AI?

glass zinc
#

because its assigned per player right, so if i just set a value of +10 to side with 1 less player, then potentially one side could have 10 players each getting 10 extra AI each.

#

plan is to have it have a long enough sleep cycle

#

that its hard to game

night frigate
#

ohhhhhhhh.... I see the issue then, it's per player. I was missing that.

winter rose
#

I'm out of here ๐Ÿ˜„

glass zinc
#

sorry lol

#

but if its on a ratio, its harder for the players to game it

#

because they would have to quit in a large number and rejoin to try to pull a advantage. or have it adjust on a +2 per side or something.

night frigate
#

OK... so that number exists for each player already. You could do something like...

_recruitsPerPlayer = <whatever that is for CTI>;
_eastPlayers = playersNumber east;
_westPlayers = playersNumber west;
if ( _eastPlayers != _westPlayers ) then
{
  if ( _eastPlayers > _westPlayers ) then
  {
    _westPlayerRecruitModifier = 1 max (floor ( ( _eastPlayers - _westPlayers ) / _westPlayers ) );
    <multiply the recruit number for west players by _westPlayerRecruitModifier>
  }
  else
  {
    <do the opposite of above>
  };
};
#

or something..... ๐Ÿ™‚

glass zinc
#

ok that helps thanks ill go tinker for a bit and come back when i made it down the road a bit

#

well the number does not exist if its using this script, this script would have to create a base number then adjust that value for each player per side based on the player count difference :S

#

so like

night frigate
#

OK - so you'll have to set the number initially for however many AI you want each player to be able to recruit. Then this will bump that number for players on one side based on the ratio of the team balance. The way I have the formula, it will require one team to be double the size of the other before any boost even occurs.

#

but then every player would be able to recruit double the number of units. You will need to massage the formula based on what you're actually going for

glass zinc
#
    if ( CTI_PLAYERS_GROUPSIZE isEqualTo 0) then {
        player setVariable ["CTI_PLAYER_GROUPSIZE", _upgrade_barracks_ai, true];
        } else {
            player setVariable ["CTI_PLAYER_GROUPSIZE", CTI_PLAYERS_GROUPSIZE, true];
    class CTI_PLAYERS_GROUPSIZE {
        title = "AI: Player Group Size";
        values[] = {0,1,2,3,4,5,8,10,12,14,16,99};
        texts[] = {"Barracks","1","2","3","4","5","8","10","12","14","16","Autobalance"};
        default = 99;
#

so normally it would use that to find its groupsizes

night frigate
#

ah, this is a parameter at mission start?

glass zinc
#

it would either take the 0 value and then run its script checking against that teams "upgrades"
or it would use a raw number. or 99 which is "autobalance" that i just made

#

yes

#

and it adjusts during the game in the upgrade system

#

and the old version of this script i am upgrading

#

was dynamic on a 60 second sleep and would just take total numbers of players on the server

#

and use that to adjust how much AI the players got regardless of side

#

and was primarily used for performance. so IE if you had 5 players on the server total they would each get like 10 AI and if there where 30 players it would cut you down to like 3-5

night frigate
#

OK, so you'd just have to determine what you want it to start at if the autobalance option is selected.

glass zinc
#

yeah

#

then i need it to count players, compare find ratio, adjust via the ratio take that adjusted numbers for each side and give that to the players

#

so 10 west 5 east
50%
_adjustedeast=east _X AI per player
Side player setVariable [CTI_PLAYER_GROUPSIZE= _adjustedeast]

night frigate
#

OK, so change the formula to something like this:

_westPlayerRecruitModifier = _eastPlayers / _westPlayers;
<get current player group size>;
<multiply current group size by _westPlayerRecruitModifier >>> floor this calc to get a whole number>;
<set player group size variable to new value>;
glass zinc
#

sorta like that? logic wise i mean

night frigate
#

so if current group size is 3, and players is 10 and 5, that's a factor of 2 for east. change variable for everyone on east to 3 x 2 = 6

#

if group size is currently 6, let's say, and there are 10 east and 8 west. 10/8 = 1.25. 1.25 x 6 = 7.5. floor 7.5 is 7. set the new group size for west to 7.

#

Or you could ceiling the number to give the lower player count side extra AI. In that case, you'd set the variable for west to 8. That would be a max of 60 east and a max of 64 west (players plus AI)

#

(thinking about it, that's probably better to use ceiling rather than floor, otherwise one team has fewer players and not enough AI to make up the difference)

glass zinc
#

yeah that makes sense

warm hedge
#

Is there any way to check turret path of a pylon?

#

I suspect magazinesAllTurrets will do the thing, but how do I know a magazine is a slung under a pylon?

manic sigil
#

SideChat is local, but if I remoteExec an .sqf with sideChat in it, does it become 'global', or do I still need to remoteExec ["sideChat"] in the sqf?

still forum
#

it doesn't become global

#

but it will be executed where you remoteExec it to

#

if you remoteExec it to everyone, it will locally execute globally

manic sigil
#

And the headhurting begins t_t

still forum
#

if your whole sqf already executes everywhere, the sideChat inside it will also execute everywhere.
So you don't need to remoteExec the sideChat specifically again

manic sigil
#

Okay, that was more clear - and what I suspected. Thank you :)

round scroll
vague geode
#

Is it possible to have vehicles with different dynamic loadouts in the CfgWLRequisitionPresets?

thorn saffron
#

Is there any EH or something that triggers when unit reports an enemy? I want to get the moment squadmembers report the enemy, but I do not want to run a really agressive loop that checks their knowledge every second.

safe pilot
#

Is there a way to add x,y,z values to like "position player"?

lost copper
tough abyss
#

how do i set a trigger to be false once its been activated

exotic flax
#

@safe pilot

// get position of player with +10 on X, Y and Z
_position = [(position player select 0) + 10, (position player select 1) + 10, (position player select 2) + 10];
warm hedge
#

@safe pilot vectorAdd command will also do.

safe pilot
#

Yuhh!! thank y'all!!!

#

Does setting triggers to be server side make them not work in singleplayer?

#

Like enabling the server only option

#

@eager pier Okie, thank you!

signal kite
#

Hello! I try to transfer Ownerships of all groups from the Server to the Headless Client (4) using following script, but it just doen't work. Any clues?

_array = []
{
if ((groupOwner _x) == 2) then
_array pushBack _x;
}forEach _allGroups;

{_x setGroupOwner 4}
forEach _array;
winter rose
#

@signal kite missing then { }

#

also, missing ; after []
1/ this is not javascript
2/ use "show script errors" in Arma launcher ๐Ÿ˜„

plain raven
#

Anyone had an issue with vehicles created with createVehicle not moving? Im spawning 4 vehicles with createVehicle and adding crew, the waypoints aren't added until the vehicle is full. If I assign a WP in zeus they work fine. The engines are on and I'm creating them at a spot on land instead of 0,0,0 and moving them.

Whats weird is the wayponts are there but over the course of 10 seconds they complete despite the vehicle never moving and the first WP being 6km away minimum

#

Its almost like the waypoints are created too quickly for the group leader

ruby island
#

Hi all .
I am on a mission and I would like to have a CAS module with the a164 attack aircraft. I put it in place without problem, with the support, the air strike support (bombing) but there are only two options: bomb and laser guided bomb, I would like to know how to make an option for the executions of , missile strikes, etc.

hazy trail
#

@plain raven Yes, I see this all the time. For my waypoints, it may be that the server is too busy or that the waypoint is too far away. I've gotten the impression that when a waypoint is put down and figuring out a path take too long, ARMA just gives up. If you then interactively move the waypoint, the vehicle will often wake up and get moving. By interactively moving it, you're telling ARMA to again figure out the path to the waypoint, and it can usually find the computes after a try or two.

plain raven
#

Thanks @hazy trail, I'll run some tests where the WP is closer. Its annoyingly inconsistent

#

Ok so looks like it might be vehicle related in this case, other vehicles work fine although I can't see the logic in that

hazy trail
#

Is the difference tracked vehicles versus wheeled vehicles? Some vehicles, like the Ifrit will just kinda zone out if the waypoint is behind them.

plain raven
#

nah, its happening with cars, tanks and APCs

ruby island
#

I always have this error at the start of the scripts, and it runs 1 time in 20 and the only time it worked it didn't hit the target.

winter rose
#

@ruby island DON'T post a wall of code. use e.g https://sqfbin.com and paste the link here.

winter rose
#

use a default value for getVariable

ruby island
#

what is default value?

winter rose
ruby island
#

all the getvariable to put by defaultvalue?

winter rose
#

to avoid an error if the variable doesn't exist on the object

ruby island
#

Can you give me an example of default value so that I'm sure of what I'm doing?

winter rose
#

if you are checking for !isNull, you could put objNull

ruby island
#

I tried to replace! isNull with objNull but it doesn't work anymore.

#

@winter rose I do not know anything in script I do not understand well.

winter rose
#
!isnull (player getVariable "theVarName")
// becomes
!isnull (player getVariable ["theVarName", objNull])
```@ruby island
mighty vector
#

Hi.

Considering I want to execute a function in 15 minutes each time a certain unit is killed....

would it be considered "good practive" to use BIS_fnc_loop itemAdd/itemExecute and executeOnce=true, or it is better to use spawn+sleep+call?

winter rose
#

I would sayโ€ฆ your call ๐Ÿ˜„

#

the simplest, the bestest

either use BIS_fnc_loop, one item, executeOnce = false (because you want the same code to repeat)

I would go for manual scripting, but that's my usual way of doing things

ruby island
#

@winter rose It says in the description of the script "Added a slope for gun run. Better accuracy.", What does that mean?

winter rose
#

no idea.

safe pilot
crude needle
ruby island
#

If anyone knows how to use the 30mm gun of the a164 from the supports; air strike support (bombing), I am a taker.
thanking you in advance .

distant wave
#

@winter rose regarding my problem with isPlayer == false, which we spoke about it yesterday, seems like i found a thing that fixes that problem.. i saw when onPlayerKilled/onPlayerRespawned EVH gets triggered it fixes isPlayer problem, maybe it's a clue

safe pilot
#

Do y'all remember the scripting functions and syntax?

#

Or do y'all always have the wiki open?

#

I'm trying to make my workflow more efficient and I just find myself always referring to the wiki for syntax on functions I use all the time.

exotic flax
#

I always have the biki open on my second screen while scripting, although most functions I know without looking (took a few years though)

#

And I have my P drive with the A3 pbo's extracted to read into the functions themselves in case I want to know how it works internally

lost copper
#

@distant wave maybe respawn of that player fix this problem?

distant wave
#

yep. but in an altis life server

#

i need some other fix

#

other than dying

#

๐Ÿฅบ

lost copper
#

That parameter makes any unit respawn on start. If that case dont broke anything when player connect to your server - that can be a possible solution

shut shadow
#

What's the most performance friendly way to continually loop a script with a delay in between?

astral dawn
#

Spawn with while-true and sleep is kinda okay, typically it's more about the actual calculation than the housekeeping logic

#

And unless you want to calculate something really heavy you shouldn't bother

#

So what's that you want to calculate and how often?

smoky verge
#

I'm trying to learn how to use the BIS_fnc_taskCreate and tried to reverse engineer the samples
I made this
[player,"_task1" ,["task","task",""], getPos h1 ,-1,-1,true,"task"] call BIS_fnc_taskCreate;
which works
but then tried to use
"_task1" setTaskState "Succeeded";
and it doesn't seem to work
am I doing something wrong? I though the _task1 was the taskID

meager granite
#

You're mixing up strings, variables and actual task variables

#

Task framework (BIS_fnc_ stuff) operates tasks by string identifies

#

Task scripting commands operate with actual task variables (of Task type)

#

Basically BIS_fnc_ stuff is designed to avoid using task scripting commands and use BIS_fnc_ functions instead

#

What you want to do:
["_task1", "SUCCEEDED"] call BIS_fnc_taskSetState;

#

Having that _ in "_task1" doesn't mean anything, its not local variable, its just a string and can be anything

smoky verge
#

oh yeah I just added it to distinguish it from the other "task" names I used as dummy
I think I understand what you're saying
I guess setTaskState would have only worked with createSimpleTask

meager granite
#

Yes, exactly.

#

BIS_fnc_ task framework does all these commands inside it but just hides it from you, its a functions wrapper for these scripting commands.

smoky verge
#

is it me or the only advantage they have over modules are the capability to have custom icons?
and I think they are slightly faster

meager granite
#

Not sure what module does (probably uses BIS_fnc_ stuff too) but everything comes down to what scripting commands are capable of.

smoky verge
#

How can I make an unit rotate with an animationg instead of an instant transition?

#

maybe LookAt?

#

ok it works

loud python
#

is there any good way to simulate keyword arguments?

#

thus far I'm setting variables on the object I'm working with, but that seems kind of ugly

quartz pebble
#

How do I spawn a shell so triggerAmmo would blow it?

warm hedge
#

createVehicle

quartz pebble
#
ammo = createVehicle ["Sh_120mm_HE", [14182.1,16298.2,50], [], 0, "None"];
triggerAmmo ammo;

didn't work when running through debug console; a shell spawns and hangs in air

warm hedge
#

First stop using ammo to contain the munition; it's reserved command

winter rose
#

^

deft flax
#

I need help :c

warm hedge
#

Okay

quartz pebble
#

It is just a piece of script i used here. The real var name was ugly so I "prettied" it

deft flax
#

Can i send the photo to someone?

winter rose
#

@loud python what the heck are you trying to accomplish, "simulate keyword arguments" ๐Ÿ˜…

#

if you need help with your face, no
if you need help with your code, paste in https://sqfbin.com and post the link here ๐Ÿ™‚

deft flax
#

It's a photo ๐Ÿ˜

#

Not with my face

warm hedge
#

I'm interested with your selfie

deft flax
#

about the game xD

winter rose
#

a photo of what

quartz pebble
#
v = createVehicle ["Sh_120mm_HE", [14182.1,16298.2,50], [], 0, "None"]; 
triggerAmmo v;

no difference

deft flax
#

A problem on my arma 3 the thing that shows up top

#

Nvm

winter rose
loud python
#

Keyword arguments as in [this, health=100, stamina=20, foo="bar"] call ME_fnc_someStuff; (obviously pseudocode)

deft flax
#

Does anyone have 3den ehnaced 3.9.7 version?

warm hedge
#

Sh_120mm_HE is not something to use triggerAmmo

winter rose
#

@loud python make classes in Description.ext and read/apply them with a missionConfigFile-reading function

warm hedge
#

Others such M_Mo_120mm_AT does work

deft flax
#

It says A3_Data_F_Sams_loadorder

#

Annnd i have no idea what is that

warm hedge
#

Then it says A3_Data_F_Sams_loadorder

winter rose
warm hedge
#

At what context

deft flax
#

Ok

quartz pebble
#

Sh_120mm_HE is not something to use triggerAmmo
And what - is?

warm hedge
#

-?

quartz pebble
#

Docs say: "shells, bullets, missiles, rockets and bombs"

warm hedge
#

I honestly don't know what exactly is the requirements of it, just that doesn't work

quartz pebble
#

lol, i'll try other kinds of ammo

winter rose
#

@loud python you cannot do something likesqf // Keyword arguments as in [this, health=100, stamina=20, foo="bar"] call ME_fnc_someStuff; unless e.g you write your own string parser, you would then write```sqf
[this, "health=100, stamina=20, foo='bar'"] call ME_fnc_someStuff;

loud python
#

that sounds more complicated than my current solution ๐Ÿคท

#

right now I'm just doing this setVariable ["health", 100]; ... ; [this] call ME_fnc_someStuff;

quartz pebble
#

So, tried different stuff. Seems triggerAmmo works only for smart ammo, like guided missiles.

warm hedge
#

It kinda works only for like that, maybe I need to write more โ€œspecificallyโ€ requirements to do it

winter rose
#

@loud python don't forget to prefix your variables with a tag

meager granite
#

If you're passing a lot of arguments you can create some throwaway entity like Location, no prefixes will be ever needed too.

winter rose
#

prefiiix ๐Ÿ‘€ ๐Ÿ˜„

loud python
#

no need for prefixes; you can just choose very descriptive variable names like a or b or spd

#

/s

cosmic lichen
#

No need for prefixes if everyone else uses them ๐Ÿ˜„

loud python
#

personally, I'm somewhat of a variable socialist

#

if everyone uses the variables responsibly and there's enough dialogue between devs, there should be no collisions

#

okay, enough sarcastic complaining about bad scripting practices, back to debugging stuff

meager granite
#
[
    "key", "value",
    "key2", 1000,
    "key3", objNull
] call somefunc;

somefunc = {
    _value = _this select ((_this find "key") + 1);
};

You can try stuff like this

#

Plenty of limitations though, strings for values should never have key names in them

#

Additional checks in case key is not preset (check if find is >= 0 before select)

winter rose
#
[
  ["key", "value"] // solves it
]
loud python
#

I was thinking of something like [this, ["key", "value], ["key2", 1000]] call ...;, but that seems hard to extract

meager granite
#

The less arrays the better

winter rose
#

it's an init, it's a one time thing

loud python
#

I mean, functions that need that many arguments are probably not called often, so performance is less relavant there

#

in the end you'd probably just use this for stuff to initialize objects every now and then

meager granite
#

My guess was that your goal was configuration convenience

loud python
#

mostly, yes

#

well, it's really about not having one config-entry per gas station on altis life ๐Ÿ˜„

meager granite
#

If you're doing this from Init fields, either store actual data in some other file or in config

sage flume
#

I'm going through my .rpt and trying to eliminate as many errors as I can. Knowing that there are hundreds that are also generic in nature...

#

I see this

#

Missing 'description.ext::Header

#

should I woory about it?

#

and I saw this posted somewhere

#

class Header
{
gameType = Survive;
minPlayers = 1;
maxPlayers = 100;
};

#

if this corrects the error entry, where do I put this?..

#

I'm gusing in the description.ext

winter rose
#

we have a wonderful Description.ext wiki page you know ๐Ÿ˜‰

#

also, ```cpp for config

sage flume
#

๐Ÿ˜Ÿ I know but still hard to grasp,....I'll try

sage flume
#

๐Ÿ‘ TkU

fervent kettle
#

I am trying to limit the distance to activate an addAction but it doenst work
questd2 addAction ["somerandomtextinhere", "quest\mario\askm.sqf", "questd2 distance player<2.0"];

warm hedge
#

Read BIKI, that's not how to set custom conditions

#

addAction's 8th argument (which I start from 0) is the condition

unique sundial
warm hedge
#

^ I forgot about this

leaden eagle
#

good morning
are nearRoads and BIS_fnc_nearestRoad functions supposed to be working correctly on dedicated server?

fervent kettle
#

I am to much of a bread, however, can i remove one specific action?

unique sundial
#

You can โ€˜entity removeAction idโ€™

fervent kettle
#

you mean like that questd2 removeAction 1; ?

unique sundial
#

Maybe, id has to be the id of the action you want to remove

#

There is actionIds and actionParams too, just look up Biki

fervent kettle
#

I have tried askmd2 = questd2 addAction ["morerandomtext", "quest\mario\askm.sqf"]; and questd2 removeAction "askmd2 "; but that doesnt work

unique sundial
#

No why in โ€œโ€?

fervent kettle
#

tried with and without ""

unique sundial
#

You canโ€™t use โ€œโ€ it is an error the command expects number not string

fervent kettle
#

i am confused, as i said i have tried with and without ""

winter rose
#
(_this select 0) removeAction (_this select 2);
fervent kettle
#

is _this in this case the action name or the obj it is attached to?

winter rose
#

none of them; when you run a script file from an action, parameters are passed

#

see https://community.bistudio.com/wiki/addAction#Syntax

Parameters array passed to the script upon activation in _this variable is:
params ["_target", "_caller", "_actionId", "_arguments"];
target (_this select 0): Object - the object which the action is assigned to
caller (_this select 1): Object - the unit that activated the action
ID (_this select 2): Number - ID of the activated action (same as ID returned by addAction)
arguments (_this select 3): Anything - arguments given to the script if you are using the extended syntax
fervent kettle
#

that worked, thanks
one more question for now, i have this line

_items = items player;

if ("MCC_bakedBeans" in _items) then {

execVM "quest\mario\bsuc.sqf";

} 
else {
execVM "quest\mario\bfail.sqf";
    }
};

but it drops me a missing ; error

still forum
#

this is not a line, thats multiple lines

#

also yes you have a syntax error after the second execVM

fervent kettle
#

argh, i`m stupid -_- thanks

safe pilot
#

Are executing sqfs from execVm a good idea for MP?

still forum
#

Any reason why it could be a bad idea?

#

related to MP I mean?

fervent kettle
#

worked fine for me so far

safe pilot
#

When would someone use the server only option for triggers?

mighty vector
#

hi.

Is there an asset for groups? (ie. creating "scout_sqad" instead of creating unit by unit and joining them...)

vague geode
#

Hi, I wonder if it is somehow possible to get the player that requested support of a support provider module? What I am trying to achieve is having artillery support modules but in order to request support the player has to pay a certain amount of CP (in Warlords) to prevent people from misusing it. I know that I can put in a cooldown but I feel like that's not enough since I want to make a powerful artillery strike and some unexperienced player or troll could just wait for the cooldown to run out and then waste the strike either my accident (in case of the unexperienced player) or on purpose to give the team a disadvantage (in case of the troll).

cunning crown
#

Hey, calculatePath has a strange behavior when it comes to helicopters, it seems that using the helicopter/plane type the path is not calculated, the agent stays in place and doesn't move. Is anyone able to reproduce the issue or am I doing something wrong?

Example code (tested on Altis):

player setPos [12900, 15500,0];
player setDir 45;
// private _type = typeOf player;
// private _type = "B_Heli_Light_01_dynamicLoadout_F";
private _type = "helicopter";

private _origin = (position player) vectorAdd [0,0,1000];
private _destination = player getRelPos [5000, 0];
(calculatePath [_type, "CARELESS", _origin, _destination]) addEventHandler ["PathCalculated",{
    systemChat format ["CalculatePath | Agent: %1 (%2)", (_this#0), (typeOf (_this#0))];
}];
exotic flax
#

It's known that calculatePath is not perfect when not used for infantry or (land) vehicles, especially when there are obstructions (like water).
I haven't tested with airframes yet, although my solution would be to simply ignore it and just set a direct waypoint (since it doesn't need a more optimal route than a straight line through the air).

#

For airframes it only would make sense if a min/max flight height could be set, or no-fly zones.

cunning crown
#

Yeah I don't use it on airframe but I was curious, might be worth adding a note on the wiki then.

high horizon
#

Does anyone know if ctrlAddEventHandler are working?? I wrote this and its not working

_boton = _ui displayCtrl 16022220;
_boton ctrlAddEventHandler [ "onButtonUp", {
    pressed = false;
}];
warm hedge
#
  1. Make sure _boton exists
  2. You have to get rid of "on" from onButtonUp
cunning crown
#

Also 16022220 is a big number, Arma is precise only for 1-6 digits number, more it's not garuenteed (in script that is, dunno about configs or engine itself)

high horizon
#

@warm hedge @cunning crown New code, not working:

_boton = _ui displayCtrl 16022;
_boton ctrlAddEventHandler [ "ButtonUp", {
    pressed = false;
}];
unique sundial
mighty vector
#

i'll dare to ask again: Is there an asset for groups? (ie. creating "scout_sqad" instead of creating unit by unit and joining them...)

winter rose
#

F2?

exotic flax
#

with scripting; no

winter rose
#

BIS_fnc_spawnGroup??

exotic flax
#

didn't knew about that one

winter rose
#

paddlin' for you too :p

exotic flax
#

but does it run Crysis? ๐Ÿ˜‰

winter rose
#

does it blend?
Let's spawn a helicopterโ€ฆ

#

@mighty vector did you check F2 in Eden, or BIS_fnc_spawnGroup for scripting?

mighty vector
#

just copied BIS_fnc_spawnGroup to google it xD

winter rose
#

โ€ฆever heard of the wikiโ€ฆ?

vague hull
#

what was the command to get all script commands?
output looks like:
u:goggles OBJECT

winter rose
#

supportInfo? @vague hull

vague hull
#

thanks alot

vague hull
#

about time sqf lint gets a little update ^^

winter rose
#

You are behind it? @vague hull

vague hull
#

Well, got into scripting again lately. Figured it needs some features I am missing. Appears to be abandoned and its MIT.. so I am just gonna fork and release a new version

mighty vector
#

@winter rose works!

winter rose
#

@vague hull thanks, and good luck ๐Ÿ˜‰

vague hull
#

gonna need it.. its setup was.. an adventure to say the least

#

its a freaking netbeans project..

oblique arrow
#

netbeans ConfusedDog ?

vague hull
#

exactly

cunning crown
#

so I am just gonna fork and release a new version
That would be awesome ๐Ÿ˜ƒ

civic pine
#

I've definitely not got my script pants on, this should be simple and straight forward but my brain doesnt seem to be able to logic this one out atm.
This script is intended to keep the driver of a boat alive as the players race up a river while the banks are lined with opfor, I would like to use ace heal (we use ace basic medical (latest)) so it gives the feel of "driver passed out, panic, driver woke up, panic, drive away"
Currently is not throwing any errors but it is also not healing the driver in a multiplayer environment
My immediate thinkings is either incorrect ace module or incorrect usage of something

// auto heal
fnc_wee_heal = {
_d = (driver (vehicle player));   //_d = boat driver
if ((damage _d)>0.1)      // if driver damaged {heal driver}
    then {[objNull, player] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;}; 
};

//call auto heal, while player is driving repeat autoheal
while {(driver (vehicle player)) isEqualTo player} 
    do {
        sleep 15;
        []spawn fnc_wee_heal;
    }foreach allunits;


// execute script in boat init
/*
null = execvm "i_driver.sqf";
*/
spiral fractal
#

use allowDamage

civic pine
#

if I cant find a solution that lets the driver pass out then wake up a few seconds later, I might have to but i'd really rather not

spiral fractal
#

[player, true, 5, true] call ace_medical_fnc_setUnconscious;?

civic pine
#

does that wake em up?
is there ace function documentation anywhere? cant seem to find any

spiral fractal
#

I tried it and player wakes up

civic pine
#

awesome will have a go, cheers ๐Ÿค™

spiral fractal
#

but if you set player allowDamage to false, its seems that there will be no transition into unconscious state only from, it will set black screen instantly

austere sentinel
#

You could probably use allowDamage and the "Hit" EH (if allowDamage doesn't prevent it from firing) and force conciousness states manually.

vagrant urchin
#

Does RemoveAction work for all clients?

oblique arrow
#

ConfusedDog Why would it not?

#

Or am i misunderstanding the question

vagrant urchin
#

I don't know

#

it doesn't

#

Sorry not addaction, but removeaction

#

it doesn't remove it for everyone

#

just for the one who used the action

#

In the script that the action runs I do _action_object RemoveAction _action_id;

oblique arrow
#

Havent used that before so I cant help with that sorry

vagrant urchin
#

okay thanks

gilded rover
#
class Altis : CAWorld
    {
        cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
    };
    class Stratis : CAWorld
    {
        cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
    };
    class Tanoa : CAWorld
    {
        cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
    };
    class Malden : CAWorld
    {
        cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
    };
    class Enoch : CAWorld
    {
        cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
    };
    class VR : CAWorld
    {
        cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
    };
    class Livonia : CAWorld
    {
        cutscenes[] = {"TF461JungleOverwatch"}; // Class names of used scenes. When more than one is present, the system will pick one randomly.
    };

can anyone tell me why Livonia , stratis and what ever enoch is , are the only ones that run my cutscene... the rest have there default cutscenes and are not overwritten

meager granite
#

Check what you actually get in the config through config browser

#

Probably issue with addon hierarchy

#

requiredAddons

gilded rover
#

I did , thats how i know that those are the only maps that worked as their cutscenes are replaced

urban tiger
#

btw Enoch is Livonia.

gilded rover
#

hmm never thought of that tho

meager granite
#

Make sure to have addons that define these worlds in your addon's requiredAddons

gilded rover
#

thought so , so do i remove enoch or livonia

meager granite
#

So it loads after them and properly overwrites

gilded rover
#

I'll try that once my new PC parts arive , my Motherboard died this morning

winter rose
#

also, not #arma3_scripting and crossposting @gilded rover ๐Ÿ‘€ ๐Ÿ‘€ ๐Ÿ‘€

gilded rover
#

I appologise

winter rose
#

adding another name to the paddlin' list

mighty vector
#

is there something like "setConvoySeparation" ? i would love the convoy vehicles being closer
I remember something but can't remember if it was a dream...

mighty vector
#

lol

#

i need to sleep.

winter rose
#

Definitely ๐Ÿ˜„ don't code while drunk tired

mighty vector
#

btw, @winter rose a trigger to check "no emenies at zone X" is it really checking every frame?
...is there any way to know when a population has been captured in event-like format?

winter rose
#

triggers are checked every 0.5s iirc?

mighty vector
#

ie: i dont want to loop&check, nad i can trigger on certain guy dead, but perhaps using "locations" or something i havent explred yet

#

...u arent serious...

#

"killed" event is not a function executed when someone is killed, but internally checked each 0.5???????

cunning crown
#

no, triggers are checked every .5s, events are checked every frame or something similar I guess

still forum
#

events are checked every frame or something similar I guess
events are never checked

winter rose
still forum
#

thats what makes them events

mighty vector
#

sorry, my bad

cunning crown
#

Oh no yeah, not checked but idk how to phrase it xD

mighty vector
#

i explained incorrectly

winter rose
#

triggered

mighty vector
#

event handlers

#

they arent internally checking, right?

winter rose
#

they trigger when it happens, that's it

mighty vector
#

(if they, ill jump from roof right now)

winter rose
#

that's the definition of an Event Handler

mighty vector
#

ok...

#

so....is there an event for a "position taken/conquered"?

winter rose
#

there is no "position taken/conquered" in the default game state

cunning crown
#

not an engine one, maybe a scripted one (and what misison/gamemode are you talking about?)

winter rose
#

if you mean in a specific game mode, then perhaps

mighty vector
#

im making a mission, i know i could set a trigger (but that, if using internal loop+check) seems unefficient

#

i was looking for a way to fire an event, and the best way i cant think by now is killed on a certain guy within the hood

#

as i havent played with "cities" on editor, didnt know if there was something like "CapturedEvent"

winter rose
#

Captured means nothing, in unscripted Arma

#

you could use/set a Location, and determine there are no enemies in it

mighty vector
#

and that would be "checking each x seconds", right?

ruby island
#

hi, i'm trying to make triggers, with : Systems> Module> Effects> close air combat (CAS) ModuleCAS_F.for the plane to attack when i use the JTAC laser; but I can not .

winter rose
#

@mighty vector you could, yes

mighty vector
#

as the major issue im having with arma is the "heavy usage of cpu", i would prefer to use a less consumming approach.

#

probably some "take" event would also make sense in the mission context

#

i'll let you know

winter rose
#

event handler "take"โ€ฆ seriously?

#

for capture?

#

if you have to do something, do it - optimise later
if you are afraid of a side check for units in a location every second, your mission is already broken and has other issues

spice vigil
#

Hello (I aplogise if this does not go here), I'm finialising a sqf script used on a vechile I created. The final thing I would like to do is when the vechile hits the ground (or goes below 0 meters or something) I want it to freeze where it hit rather than skid or bounce up. I've tried a few things now but my sqf knowledge is limited so wondering if anyone has any suggestions.

winter rose
#
waitUntil { getPos _vehicle select 2 < 0.01 || isTouchingGround _vehicle };
_vehicle enableSimulation false;
young current
#

You would need to swap it into a building

#

Doesn't that disable collision too?

winter rose
#

not that I know of

young current
#

Oh then that's good way

winter rose
#

that or setVelocity [0,0,0]

#

that would limit moving

young current
#

Physics would still affect it

#

From the sound of it, vehicle in question might be some sort of drop pod

#

Which is supposed to hit ground and stay there

spice vigil
#

Haha, thanks for info, I had something similar but in a bit of the wrong order so I'll try your suggestion.

#

And yeah, kinda like a drop pod.

young current
#

Arma ground just is not especially friendly for such as its unyielding

sage flume
#

does it matter if I use.....

#

if ((toLower _class) in _myweaponblacklist) exitWith {};

#

or...

winter rose
#

โ€ฆnot?

sage flume
#

if (_lowClass in _myvehblacklist) exitWith {};

#

lol

winter rose
#

the suspense is killing me

sage flume
#

way ahead of me @winter rose

#

HAHAH

winter rose
#

no difference, except that you would store a variable in the latter

#

if it were a while, storing a var prevents toLower recalculation every loop; since an if is a one-time, you can go the former way

#

also note that there is toLowerANSI, which I believe is safe for classnames

sage flume
#

4 of the 5 blacklists are good but the ammo throws an error

#

which way is most efficient (like I know what I'm asking,...a liitle bit)

#

those were givento me by Rydygier

#

so knwing hiim, there has to be a perfect reason

#

maybe not?

#

I'm just trying to follow in giant footsteps

#

๐Ÿ˜‹

winter rose
#

the secret is: it depends

#

also, if you get an error then this code is not the issue

sage flume
#

if ((toLower _class) in _myweaponblacklist) exitWith {};
Line 4926: if ((toLower _class) in _myammoblacklist) exitWith {};
Line 4976: if (_lowClass in _myvehblacklist) exitWith {};
Line 5134: if ((toLower (configName _class)) in _mygroupblacklist) exitWith {};
Line 5325: if ((toLower (configName _class)) in _myFactionBlackList) exitWith {};

#

and the ammo throws the error

#

time to sparamint

winter rose
#

@sage flume and the error isโ€ฆ?
also, if _class is a string, configName _class sure throws an error!

sage flume
#

{
_class = _ammoClass select _i;
if ((toLower _class) in _myammoblacklist) exi>
15:44:07 Error position: <toLower _class) in _myammoblacklist) exi>
15:44:07 Error tolower: Type Config entry, expected String

#

there what .rpt says

#

nounnerstan

still forum
#

well you cannot toLower a config entry

#

as it says

#

Error tolower: Type Config entry, expected String

#

you gave a config entry to toLower

#

but

#

doesn't even take a config entry

sage flume
#

strange thing though, I've used this in a few other ports, and it works

#

Sp

#

not COOP

#

maybe an issue there??

cunning crown
#

I don't see how toLower could be impacted by that

still forum
#

I've used this in a few other ports, and it works
No you didn't

urban tiger
#

anyone know a way to force AI to collide with enviroment?

winter rose
#

โ€ฆ?```sqf
player setPosATL (getPosATL player vectorAdd [0,0,0.1]);
player setVelocity [0,500,0];

urban tiger
#

๐Ÿ˜‚

winter rose
#

Agents collide more, according to a wiki comment

urban tiger
#

sadly tried that. still runs through a wall likes its nothing when telling them to do an animation

cunning crown
#

animations (mostly) don't care about collision iirc

winter rose
#

^

urban tiger
#

weird thing is if it an AI it doesn't care if it the player the collisions work fine... Looks like it's back to having to write a whole AI movement system. Le sigh.

ornate marsh
#

having some trouble, this command works in singleplayer and Dedicated perfectly fine, but on Local Host, the Text appears for a split second and then disappears again for everyone:

[4, ["wave","PLAIN"]] remoteExec ["cutRsc",0,true];
_disp = uiNamespace getVariable ["wave",DisplayNull];
_ctrl = _disp displayCtrl 19;
_text = format["%1", waveDisplay];
_ctrl ctrlSetStructuredText parseText _text;
manic sigil
#

@winter rose Why did you curse me with offloading everything into .sqf files T_T I've spent days just tweaking and modifying the first 5 minutes of my mission because I keep thinking of something else cool to add and how to fit it into a stack of scripts and deleting almost everything I put on the map to begin with

winter rose
#

Hue hue hue, because so is my destinyโ€ฆ and now yours, too!

cunning crown
#

You will thank him later ^^

exotic flax
#

And that's why I have a ton of small missions with small scripts I made and combine them when needed in a mission.
Each script works on it's own, so I know they always work even when combined

manic sigil
#

Yeah... but now I'm fighting my same old issues, but in exciting new detail XD

#

My deploying helicopter follows a unitPlay path, lands, begins offloading troops... but inevitably, begins taking off again and thus accidentally airdropping the last two+ guys.

#

Even with

waitUntil {count fullCrew [Taru,"Cargo",false] == 0};
#

Hrn... the last action for the group is an orderGetIn, and they do get in and wait... I wonder if it's pegged a waypoint at that xyz, so when the unitPlay ends, they suddenly realize 'I'm not at xyz, gotta go!'

#

Nope, just going to the default 50m hover :/

#

Damn, not even disabling the pilots simulation or "ALL" AI works :c

#

And I put in so much work to get that flight path looking good.

slim bloom
#

So I'm trying to set up a cargo box to spawn in with Weapons and ammo already inside them as they will be used as supply crates during events. Run up to a laptop and request a Ammo supply crate and the crate with ammo will spawn in. Im having trouble setting up the crates to spawn in with the items i want.

Code used so far:
_this = createVehicle ["UK3CB_BAF_MAN_HX60_Container_Green", [8281.296,10029.59,0], [], 0, "CAN_COLLIDE"];

_crate = _this;
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
_crate addItemCargoGlobal ["ACE_CableTie", 10];
_crate addMagazineCargoGlobal ["UK3CB_BAF_9_17Rnd", 10]; // error missing

Can get cable ties to work but any weapon or magazine wont work. Anyone help??

#

Tried calling in Vanilla based items as well still wont work.

#

I get a blank box appear in the inventory but i cant move it onto the player which suggest its registered i want said item but doesn't fully process the command.

slim bloom
#

Problem fixed.

karmic swift
#

Hello. Is there any way to duplicate units/groups? Copy&paste, but for scripts. I created and configured in editor group with some init-scripts and some loadouts, and I want it to respawn every 5 minutes but without deleting already spawned groups (dead or alive but they should remain).

safe pilot
#

@manic sigil a wonky way I get around that is to remove all the fuel from the helicopter and make the crew not able to eject

manic sigil
#

I ended up abandoning the unitPlay option :/ I'm given to understand it doesn't work well in multiplayer

glass zinc
#
_win = false;
_winnerside = West;
_loserside = East;
switch (_result) do {
    case "win": {if (CTI_P_SideJoined isEqualTo _side) then {_win = true; if (CTI_P_SideJoined isEqualTo West) then {_winnerside = West;_loserside = East;} else {_winnerside = East;_loserside = West;};}};
    case "loose": {if (CTI_P_SideJoined != _side) then {_win = true; if (CTI_P_SideJoined isEqualTo West) then {_winnerside = West;_loserside = East;} else {_winnerside = East;_loserside = West;};} else {if (CTI_P_SideJoined isEqualTo West) then {_winnerside = East;_loserside = West;} else {_winnerside = West;_loserside = East;};}};
};

43:1 error sqflint:error Binary operator "!=" arguments must be [(Number,Number),(String,String),(Object,Object),(Group,Group),(Side,Side),(String,String),(Config,Config),(Display
,Display),(Control,Control),(TeamMember,TeamMember),(NetObject,NetObject),(Task,Task),(Location,Location)] (lhs is Anything, rhs is Nothing)

how do i fix this error?

digital hollow
#

Use isEqualTo like every other comparison in the code. Also change loose to lose

glass zinc
#

@digital hollow thanks

meager granite
#

I wonder what would be a way to find if object has flag proxy so forceFlagTexture can be used on it.

warm hedge
#

selectionNames?

meager granite
#

Yep, just found it out, gotta pull all simulation = "flag" classes from CfgNonAIVehicles first though to check against

#

Looking for simplest object which can have flag on it

warm hedge
#

Such what? I don't think I get what โ€œsimplest objectโ€ you meaning

meager granite
#

Something that isn't a vehicle or a man

#

Ideally I wanted object that's nothing but flag but there is no such thing

#

Flagpole is huge pole that I don't need

ornate marsh
#

OK so regarding my above problem, if I use 2 to target just the server it pops up and stays there, but only I can see it

shut shadow
#

@astral dawn sorry, didn't see your reply yesterday about looping scripts. The only code I want looping is calling a single function from a script. I got it working and it seems to have minimal impact as far as I can tell, but will run it through Dedmen's script profiler before going live.

astral dawn
#

What does it do then?

#

single function can do a lot of things ๐Ÿ˜„

ruby island
#

In module> effects> close air support (CAS); Not in module> suppport.
How to intervene the plane after aiming with the jtac or a smoke.

mighty vector
#

hmm. this might be really basic, but how to get the first unit of a group...

units grp[0] ?
units grp select 0 ?

for making it the leader ?:

group selectLeader units group select 0 ?

#

@still forum a cat just died?

winter rose
#

@mighty vector
if you check the wiki, selectLeader does not take a String.

Let me break it down for you so you understand:

private _groupUnits = units _group;
private _firstUnit = _groupUnits select 0;
_group selectLeader _firstUnit;
mighty vector
#

...is not the "same" i did?

#

group selectLeader units group select 0;

#

?

warm hedge
#

It isn't

mighty vector
#

...

#

apart from any typo i just saw...

warm hedge
#

Is that โ€œStringโ€ just a typo?

mighty vector
#

yep...to refer the upper 2nd option

#

just updated

winter rose
#

we cannot guess, and code has to be precise

mighty vector
#

sorry

winter rose
#

so yup, typos + string were the mistake
maybe also some parentheses needed, idk

mighty vector
#

perhaps group selectLeader [units group] select 0; ?

#

or even:

#

group selectLeader [[units group] select 0]; ?

warm hedge
#

No...

#
_group selectLeader (units _group select 0);```
still forum
#

square brackets != parenthesis think_turtle

ebon ridge
#

How can I check that a given class name (e.g. B_Heli_Light_01_armed_F) is valid? Is there a general method?

warm hedge
#

e.g. isClass (configClass >> "CfgVehicles" >> "B_Heli_Light_01_armed_F")

ebon ridge
#

Thanks, does CfgVehicles always contain all infantry and vehicle class names from vanilla and mods?

warm hedge
#

Yes

ebon ridge
#

Awesome thanks

scenic pollen
#

Anybody here familiar with CMake?

round scroll
#

is it possible to sling load a wreck through some scripting?

real tartan
#

@round scroll hideObject real_object + attachTo wreck_of_object of object maybe

finite sail
#

if you mean slingload using the games built in sling load system

#

yes, using m1ke suggestion, but it will look nasty

#

the sling load assistant will show you as trying to sling the hidden object, rather than the wreck

#

you could (excuse the pun) lash up your own sling load system but again, it would not be a nice and integrated as the BI one

spiral fractal
#

it is possible but not recommended... extremely bug

spiral fractal
#

when vehicle (for example chinook) "drawn" MPkilled event not fired?

#

it goes underwater and switches to wreck damage is 1 but for some reason, MPkilled event not executed

finite sail
#

guys, is there a way of getting when player is using spectator or splendidcam?

#

my tactical HMD (if player wears vr goggles or similar) is still on screen when using cam or spec to take screenshots/video

potent depot
#

Are you putting them in spectator with a script?

finite sail
#

no

#

im starting it from debug console

#

its only me who does it, or perhaps another mission dev

#

the HMD is only shown to players who are on foot, have the vr goggles and are in first person

#

so i thought, switch to 3rd before starting cam/spec

#

but splendidcam seems to override 3rd person.. the hmd shows even if i start spec after being in 3rd person

runic edge
#

Hello guys !
Is there a way to count thรฉ number of red groups ?

warm hedge
#

OPFOR groups?

#
({side _x == OPFOR} count allGroups)```?
runic edge
#

Yeah opfor

finite sail
#

do groups have a side?

warm hedge
#

They do

#

AFAIK

finite sail
#

yes, confirmed.. side group player returns west

#

in mission now

#

side doesnt return OPFOR though

#

at least not in the mission im in right now

#

opfor guys are side east

#

actually EAST

mighty vector
#

parenthesis only for order preference?

#

then why [foo] call bar ?

#

is there a good wiki page about arma's (, [... ?

runic edge
#

Works, thanks @warm hedge

finite sail
#

@mighty vector that [foo] call

#

is for when the function you are calling requires an array to be sent to it

mighty vector
#

@finite sail so theorically I could (foo) call fn?

finite sail
#

if foo is an array, yes

mighty vector
#

then, my last statement seems false.
"functions receive arrays" seems to be more correct, based on your statement

finite sail
#

you wouldnt need to put the ()

#

if that is what you are asking

mighty vector
#

not really...

#

do functions always expect an array of params? In order to use params

finite sail
#

usually, yes

mighty vector
#

can a function expect a single number, and hence invoke it using _mynumber call fn?

finite sail
#

depends on the function, some do

#

most functions expect an array

ornate marsh
#

does anyone have an idea as to why this isn't showing the Rsc? shows up perfectly fine on a Dedicated Server and SP, but as soon as I do it on a local host, if flashes up briefly then disappears again. It works for me if i target the server and not everyone, and -2 to target everyone but the server doesn't work either.

[4, ["wave","PLAIN"]] remoteExec ["cutRsc",0,true];
_disp = uiNamespace getVariable ["wave",DisplayNull];
_ctrl = _disp displayCtrl 19;
_text = format["%1", waveDisplay];
_ctrl ctrlSetStructuredText parseText _text;
high horizon
#

Which function is to move vehicle?? vehicle player moveTO [coord,coord,coord] doesnt work and doMove neither

nimble cove
#

you mean for an ai?

high horizon
#

a vehicle drived by an ia and player as cargo @nimble cove

mortal shoal
#

Its there a way to stop group leader spamming "regroup" command sin the chat ?

#

I tried:
enableRadio false;
enableSentences false;
showSubtitles false;
player disableConversation true;
player disableAI "RADIOPROTOCOL";
0 fadeRadio 0;
player setVariable ["BIS_noCoreConversations", true];
player setSpeaker "NoVoice";

civic coyote
#

How could I make a script so that if a player uses a drone or other vehicle with a camera, then they can take a picture and when they return to the HQ there will be a photo (leaflet) of the picture(s) taken? I am trying to get a small recon mission that must be done before performing the other task

exotic flax
#
// should work when placed in any unit
(leader group _this) disableAI "RADIOPROTOCOL";

// set on all groups in mission
{(leader group _x) disableAI "RADIOPROTOCOL"} forEach allGroups;
mortal shoal
#

I am already doing disableAI "RADIOPROTOCOL" on every player in initplayerlocal. So it should work right?

exotic flax
#

unless AI are players, that doesn't work

mortal shoal
#

no AI only players

exotic flax
#

regroup isn't something that players say automatically (afaik), reporting enemies yes, which can be disabled with unit setSpeaker "NoVoice", or create a custom Difficulty Preset with autoReport = false

mortal shoal
#

difficulty setting is ok (checked with difficultyOption commmand)

exotic flax
#

I only play with ACE, which has a feature to disable all communication (voice and text) for players. And I never play with AI in my team, so never had the problem ;)

Looking at ACE, they created a custom voice (which is set with unit setSpeaker "ACE_NoVoice";), which doesn't have any text or sounds.

loud python
#
{ _x setVariable ["name", "Mercapyrgos", true] } forEach synchronizedTriggers this

Any idea what might be wrong with that? It's in an init field

#

the error I'm getting is

20:00:01 Error in expression <["name", "Mercapyrgos", true] } forEach synchronizedTriggers this>                                                             20:00:01   Error position: <synchronizedTriggers this>                                                                                                       20:00:01   Error synchronizedtriggers: Type Object, expected Array
#

AAAAAH!

#

It took me posting it here

exotic flax
#

what is this? Because it should be a waypoint

loud python
#

to realize how dumb I am

#

never mind, I just realized that

#

oh well, sorry for wasting your time xD

#

does synchronizedObjects return triggers as well?

exotic flax
#

it should return a list of triggers

high horizon
#

Which function is to move vehicle?? vehicle player moveTO [coord,coord,coord] doesnt work and doMove neither
@high horizon Anyone?

ornate marsh
#

regarding earlier point, tried this as well as a workaround, has the same effect as the previous:

waveDisplay = "Wave: " + str (Wave);
{_id = owner _x; ["waveLayer", ["wave","PLAIN"]] remoteExec ["cutRsc",_id];} forEach allPlayers; 
_disp = uiNamespace getVariable ["wave",DisplayNull]; 
_ctrl = _disp displayCtrl 19; 
_text = format["%1", waveDisplay]; 
_ctrl ctrlSetStructuredText parseText _text;
winter rose
#

remoteExec is not guaranteed to execute immediately on every machine (even locally); you maybe should use a```sqf
waitUntil { not isNull uiNamespace getVariable ["wave",DisplayNull]; };

#

@ornate marsh ^

ornate marsh
#

should that be at the start, on encompass the entire script in it?

winter rose
#

right after your remoteExec - call it, then wait for it to exist

ornate marsh
#

gotcha

#
waveDisplay = "Wave: " + str (Wave);
[4, ["wave","PLAIN"]] remoteExec ["cutRsc",0,true];
waitUntil { not isNull  uiNamespace getVariable ["wave",DisplayNull]; };
_disp = uiNamespace getVariable ["wave",DisplayNull];
_ctrl = _disp displayCtrl 19;
_text = format["%1", waveDisplay];
_ctrl ctrlSetStructuredText parseText _text;

like that?

winter rose
#

like that```sqf
private _waveDisplay = format ["Wave: %1", Wave];
[4, ["wave", "PLAIN"]] remoteExec ["cutRsc", 0, true];
if (hasInterface) then
{
waitUntil { sleep 0.1; not isNull uiNamespace getVariable ["wave", displayNull]; };
};
_disp = uiNamespace "wave";
_ctrl = _disp displayCtrl 19;
_ctrl ctrlSetText _waveDisplay;

ornate marsh
#

i'll test it out now

#
20:23:14   Error Missing ;
20:23:14 Error in expression <splayNull]; }; 
}; 
_disp = uiNamespace "wave"; 
_ctrl = _disp displayCtrl 19; 
>
20:23:14   Error position: <"wave"; 
_ctrl = _disp displayCtrl 19; 
>
20:23:14   Error Missing ;
20:23:14 Error in expression <splayNull]; }; 
winter rose
#

ah perhaps some parenthesis```sqf
waitUntil { sleep 0.1; not isNull (uiNamespace getVariable ["wave", displayNull]); };

#

wait no

vivid monolith
#

I need some help on scripting bcoz Iโ€™m trying to make it look like a Marine is on patrol and theyโ€™re clearing a house but one of them gets shot and they have to call in for extraction and drag the wounded to the landed helicopter at the extraction point. But I want three soldiers to stay back and provide covering fire for the extraction

winter rose
#

@ornate marsh I forgot a getVariable:```sqf
private _waveDisplay = format ["Wave: %1", Wave];
[4, ["wave", "PLAIN"]] remoteExec ["cutRsc", 0, true];
if (hasInterface) then
{
waitUntil { not isNull (uiNamespace getVariable ["wave", displayNull]); };
};
private _disp = uiNamespace getVariable "wave";
private _ctrl = _disp displayCtrl 19;
_ctrl ctrlSetText _waveDisplay;

ornate marsh
#
Error in expression <f (hasInterface) then
{
waitUntil { not isNull (uiNamespace getVariable ["wa>
  Error position <not isNull (uiNamespace getVariable ["wa>
  Error Generic error in expression
winter rose
#

โ€ฆwhat

ornate marsh
#

that's what it says in the .rpt

winter rose
#

where are you running the code?

ornate marsh
#

in the debug console for testing

#

can run it from a script

winter rose
#

well yes, you cannot waitUntil from the console - surround this with a [] spawn { };

ornate marsh
#

same thing as before, flashes up for a brief second then disappears

winter rose
#

then idk, magic

#

if you do ```sqf
4 cutRsc ["wave", "PLAIN"]; // instead of remoteExec

ornate marsh
#

yea, the remoteExec works with -2 for me in the targets section

winter rose
#

if you are the server, it should not

ornate marsh
#
waveDisplay = "Wave: " + str (Wave); 
[4, ["wave","PLAIN"]] remoteExec ["cutRsc",-2,true]; 
_disp = uiNamespace getVariable ["wave",DisplayNull]; 
_ctrl = _disp displayCtrl 19; 
_text = format["%1", waveDisplay]; 
_ctrl ctrlSetStructuredText parseText _text;

this makes the text show up perfectly fine for me

winter rose
#

again, if you are the player-server, it should not work

ornate marsh
#

im on a localhost and local exec-ing that from the console works, so idk

#

doing it with 2 also works

winter rose
#

also, wait, ther is something wrong.
I guess that the server is supposed to be the one using remoteExec, right?

ornate marsh
#

that script will be in an sqf

winter rose
#

that will be called byโ€ฆ?

ornate marsh
#

execVM

winter rose
#

by? server, client?

ornate marsh
#

localexec from my debug console

winter rose
#

you will use the debug console during the mission?

ornate marsh
#

yea, i execute the scripts from there. I only execute the wave changing scripts and spawn Ai. I'm gonna make them into modules soon

winter rose
#

what you are doing here is:
remoteExecute "show the display" to everyone
and only locally change your text, others will not have the change.

ornate marsh
#

but if im local executing a execVM from the debug console with that script, it should work, right? or is it because those local variable don't happen on each clients machine?

winter rose
#

I don't know what else to say:

  • you remote exec "show the display" to everyone
  • you edit the display only on your side
ornate marsh
#

if do an execVM from the console, the file will only execute on the server, so those variables in the sqf (the code you did) only changes for the server (me), correct?

winter rose
#

if you do an execVM from the console by pressing LOCAL EXEC, it will run on your computer, not on the server.
so again, yes, it will run the following steps from your computer:

  • execute "show the display" on every computer
  • modify the text on this computer only
ornate marsh
#

so how would i go about modifying the text for everyone? make the variables public?

#

or could i just global exec it with the remoteExec removed?

#

but would that then break other sqf files that should only run on the server

#

because some of the sqf files which that code is in will break if global executed

winter rose
#

nope, UI data should never be public
you should remoteExec code or script that does all the thing

I think I know where you were confused; your remoteExec tells all the computers to create a "wave" display yes, but each computer creates its own one - it is not creating i.e a "multiplayer object" that is the same to everyone (and you expected that editing it once would spread the change)

you could for example do a "displayWave.sqf" file and use```sqf
[wave, "displayWave.sqf"] remoteExec ["execVM"]; // not great, but next step is using CfgFunctions

and in displayWave.sqf:
```sqf
params ["_waveNumber"];
4 cutRsc ["wave","PLAIN"];
private _disp = uiNamespace getVariable ["wave", displayNull]; 
private _ctrl = _disp displayCtrl 19; 
_ctrl ctrlSetText format ["Wave: %1", _waveNumber];
#

this way, you would manage all the display locally.

ornate marsh
#

seems to work with just me, i'll try it with another player

winter rose
#

I suppose wave is the wave number, correct?

ornate marsh
#

yea

winter rose
#

@ornate marsh works?

ornate marsh
#

Can't test currently, will ping later with results

wooden plaza
#

anyone got file for Remove radiation zone screen effects

grave torrent
#

Sounds like a question for the exile discord

manic sigil
#

Okay, trying to wrap my head around scheduled environments. Would this be valid, assuming I'm not cramming a whole mission's worth into each block/appropriate use of uiSleep?

  Task1 = spawn {waitUntil (thingIWantDone)}
  Task2 = spawn {waitUntil (otherThingIWantDone)}
  waitUntil {scriptDone Task1 && scriptDone Task2}
robust hollow
#

the concept is correct, though obviously what you have written there would return syntax errors at multiple points.

manic sigil
#

Yeah, not written to be executable, just legible ๐Ÿ˜›

#

Okay, that beats me running if-then after if-then when I have multiple objectives.

half inlet
#

could somebody please confirm or deny this hypothesis (regarding object locality) for me?

imagine a dedicated server with two connected players; ply1 is in a car's driver seat, and at some point they dismount - ply2 then gets in the car's driver seat.

when ply2 gets in, the car's locality is transferred from ply1 over to ply2, however (this is where I'm unsure) - is there an intermediate step where the car is briefly local to the server?

(note: I'm specifically asking this in regards to the Local EH, which supposedly only triggers on the "old" and the "new" owner of an object during locality change (in my example this would be ply1 and ply2), which makes it sounds like the EH wouldn't trigger on the server (which is what I'm after))

#

...perhaps @still forum? ๐Ÿ˜„

finite sail
#

@half inlet , last time I checked this, the car remains local to ply1 for some time, perhaps indefinitely , until ply2 gets in the drivers seat

round scroll
#

is there a better way to add a 0 in front of a single digit? Something with format maybe? sqf private _hourStr = (str(_hours) splitString ".") select 0; if (_hours <10) then { _hourStr="0"+_hourStr; };

half inlet
#

@round scroll

private _hourStr = "0" + str floor _hours;
_hourStr = _hourStr select [count _hourStr - 2, 2];
round scroll
#

thanks

calm bloom
#

Hello, folks! Can i track the radar lock status?

lucid junco
#

hola hola, does anyone know how to disable ambient player staggering/stretching etc (mean just those ambient animations). I need him to stay straight and dont move.

tough abyss
#

Guys I'm a Python/C# coder. Does anyone have a link or suggestion for the most up to date video tutorials or easy to read documentation other than API reference for the scripting language in Arma 3?

#

I want to learn how to script for my missions but I dont know where to start.

calm bloom
#

thats the script command reference, most of guys i know learn from simple examples they find in workshop/elsewhere

winter rose
#

and of course, this channel is here to help.

calm bloom
#

So, it would be handy to learn PBO unpacking first

#

i use mikero tools, integrated into the winwows explorer, but it is always a quest for me after every os change

lucid junco
#

and who help me lol? ๐Ÿ˜„

calm bloom
#

try disableai "all"

#

also, ace_noidle.pbo

winter rose
#

@lucid junco no one ๐Ÿ‘€

warm hedge
#

Doubt disableAI will work for it

winter rose
#

some noted some interferences, such as some disableAI would prevent a player to leave a vehicle so perhaps

lucid junco
#

nope. doesnt work ๐Ÿ˜•

warm hedge
#

My very best guess is to use AnimChanged EH

high horizon
#

Does anyone know if it is possible to create a camera in a delimited screen position?

winter rose
#

yes.

lucid junco
winter rose
#

this function only shows cinema borders, nothing else ^^

manic sigil
#

Me: Ha, I'm so clever, if I run my tasks in spawned blocks, I can have multiple waitUntils running!

Also me: running all those tasks in separate .sqfs already.

verbal saddle
#

@half inlet
IIRC the car stays local to the original driver until either the owner is changed through commands or a new person gets into the drivers seat.

high horizon
#

this function only shows cinema borders, nothing else ^^
@winter rose Do you know which function would be appropriate?

winter rose
#

I was talking about what prababicka said

lucid junco
#

๐Ÿ˜„

winter rose
#

as for you, you would need to create a control, and use Picture-in-Picture on it if you want a "partial" camera

#

(if I understood correctly @high horizon)

high horizon
#

@winter rose Yes, just that, that the camera you created is seen in a control, Picture-in-picture is RscPicture?

winter rose
#

I don't know UI I am afraid

#

See Example 3

calm bloom
#

Hey, guys, and what about the radar info? Can one get anything like the current target?

winter rose
calm bloom
#

cursorTarget also returns locked target for the duration of the lock even if there is another target under the cursor.
thanks! i have used cusrorobject all the time and didnt even know it has that behavior)

winter rose
#

you would have to check if the radar is locked on something though

high horizon
calm bloom
#

Well, i am making the automatic SACLOS tracking for SA-19 and starstreak, so it probably wouldnt need radar check very much

#

ill just need to borrow some lockcamerato ideas from rhs folks)

#

with all credit of course

mighty vector
#

Hi.

I know this is not the more efficient way, but I'm having issues setting up a convoy, and wondering if Im doing something wrong. (A few mods loaded)

veh1 = "LIB_SdKfz124" createVehicle ([1731,50,0]);
_grp = createVehicleCrew veh1;
veh2 = "LIB_OpelBlitz_Tent_Y_Camo" createVehicle ([1731,40,0]);
_grp = createVehicleCrew veh2;
veh3 = "LIB_OpelBlitz_Fuel" createVehicle ([1731,30,0]);
_grp = createVehicleCrew veh3;
veh4 = "LIB_OpelBlitz_Ammo" createVehicle ([1731,20,0]);
_grp = createVehicleCrew veh4;
veh5 = "LIB_OpelBlitz_Ambulance" createVehicle ([1731,10,0]);
_grp = createVehicleCrew veh5;
veh6 = "LIB_SdKfz251" createVehicle ([1731,0,0]);
_grp = createVehicleCrew veh6;
grp = createGroup west;
[veh1, veh2, veh3, veh4, veh5, veh6] joinSilent grp;
grp selectLeader (units grp select 0);

systemChat str(units grp);

What I expect:
B Charlie 1-6:1, B Charlie 1-6:2...B Charlie 1-6:6 created with first veh. being leader and THAT'S CORRECT

BUT, it additionally it creates Bravo 2-5 and Bravo 1-5 groups. (?)

https://paste.pics/87e90fc61102b812a98e238dc663688c
Any ideas?

On the other hand, when using:

grp = [[1731,50,0], WEST, ["LIB_SdKfz124", "LIB_OpelBlitz_Tent_Y_Camo", "LIB_OpelBlitz_Fuel", "LIB_OpelBlitz_Ammo", "LIB_OpelBlitz_Ambulance", "LIB_SdKfz251"],[[0,0,0],[0,-10,0],[0,-20,0],[0,-30,0],[0,-40,0],[0,-50,0]]] call BIS_fnc_spawnGroup;
grp setFormation "FILE";
grp selectLeader (units grp select 0);

the first vehicle of the convoy is not the LIB_SdKfz124, but the 2nd, then the 3rd and so on...until the LIB_SdKfz124 (the first in the array)

loud python
#

Anybody here know how to script the destroyers cruise missiles?

#

as in, just have them fire at some object

ornate marsh
#

You need to place a VLS on it and then it should auto target enemies and fire

plush breach
#

Hey does anyone know what I'd need to do to make it so I can remove an addaction right after it has been interacted with. Currently I have it in a trigger so that it adds the addaction when the players are nearby. I've been trying to use the removeAction in deactivation section but it doesn't seem to be working.

OnActivation: _myID = mcn1 addaction ["Speak with Sgt. Mcnemera", {mcn1 say3D ["mcn1", 1000, 1];}];

OnDeactivation: player removeAction _myID;```
loud python
#

the variables are local

#

not 100% sure, but _myID should be nil in the deactivation handler

#

you can just use thisTrigger setVariable ["actionID", ...] instead though

high horizon
#

Hello again, do you know a way to create an array but that has certain values in the name? For example, the array must be _array (+ nameplayer) (+ life_cash) = [];

loud python
#

no

#

well, yes, but still no

#

the array doesn't have a name

#

it's stored in a variable

high horizon
#

how? @loud python

loud python
#

how what?

#

as I said, you can't really do it

#

setVariable and getVariable accept strings, so you could use format to actually create a string on the fly

#

but that would just make your code hard to read

#

I assume you really want something like an associative array, which isn't a thing in arma

#

hmmm...

#

why can't I spawn a laserTargetW object?

#

or rather, why does it instantly despawn?

high horizon
#

I assume you really want something like an associative array, which isn't a thing in arma
@loud python kind of

ebon ridge
#

We are generating random waypoints in a town for a group to clear area using SAD waypoint type. The group leader is spamming "2 observe that position", "3 observe that position", "4 observe that position" over and over. Is this expected?!

winter rose
#

no

ebon ridge
#

okay thanks

#

lol nm its my code i forgot about sorry

austere sentinel
#

Given a crate like C_IDAP_supplyCrate_F, is there a way to remove the Inventory action, while keeping actions added via addAction? I know that removeAction only works on user added actions. I tried making it a simple object, but that disables all actions.

winter rose
#

not possible

#

unless maybe you destroy it and immediately disable its simulation, big perhaps

austere sentinel
#

๐Ÿ˜’ I'll look into modding a non-storage version of it. Disable sim doesn't remove either from what I can tell.

exotic flax
#

you should be able to create a new config with the model and textures, but without the variables which make it a supply box

warm hedge
#

Think a dumb solution, do addAction to the player and put any codes to filter if cursorTarget is the crate to the condition of the action

ornate marsh
#

๐Ÿ˜’ I'll look into modding a non-storage version of it. Disable sim doesn't remove either from what I can tell.
@austere sentinel I use the PLP containers mod, has a bunch of non cargo storage objects. I wanted to do the same thing you wanted to do, but couldn't script it so used that mod

austere sentinel
#

you should be able to create a new config with the model and textures, but without the variables which make it a supply box
This is the plan. Gotta look into what to subclass.

@warm hedge Thats not a bad idea, but it'll probably be a bit less performant than I'd want.

@ornate marsh I'll look into that, if it's been done then I don't wanna reinvent the wheel, thanks!

exotic flax
#

@austere sentinel the following config should do the job already (just requires a custom mod to implement it):

class CfgVehicles {
   class ThingX;
   class TAG_IDAP_supplyCrate_F: ThingX {
      class SimpleObject {
         eden = 1;
         animate[] = {};
         hide[] = {};
         verticalOffset = 0.892;
         verticalOffsetWorld = 0;
         init = "''";
      };
      editorPreview = "\A3\EditorPreviews_F_Orange\Data\CfgVehicles\C_IDAP_supplyCrate_F.jpg";
      scope = 2;
      scopeCurator = 2;
      displayName = "IDAP Supply Crate (no inv)";
      model = "\A3\Weapons_F\Ammoboxes\Supplydrop.p3d";
      hiddenSelections[] = {"camo"};
      hiddenSelectionsTextures[] = {"\a3\Supplies_F_Orange\Ammoboxes\Data\supplydrop_idap_co.paa"};
      slingLoadCargoMemoryPoints[] = {"SlingLoadCargo1","SlingLoadCargo2","SlingLoadCargo3","SlingLoadCargo4"};
   };
};
#

could be that I've missed some stuff from inheritance, but it shouldn't have an inventory

austere sentinel
#

Damn you're quick. Thanks, I'll give that a shot.

#

@exotic flax Worked flawlessly. You sir are a gentleman and a scholar.

exotic flax
#

you're welcome, always happy to help ๐Ÿ™‚

loud python
#
private _source = param [0];
private _target = "LaserTargetW" createVehicle (position param [1]);
target = _target; // For debugging only

_p = position _source;
private _missile = "ammo_Missile_Cruise_01" createVehicle [_p select 0, _p select 1, (_p select 2) + 1];
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
missile = _missile; // For debugging only

_target setVehicleTIPars [1,1,1]; // Maybe the laser target has TI parts?
(side _missile) reportRemoteTarget [_target, 3600]; // Maybe the missile doesn't know about the target?
_missile setMissileTarget _target;

Any idea why this doesn't work?

#

as in, does nothing

#

tells me to f### off, essentially

#

tried it step by step in the debug console and setMissileTarget returns false

winter rose
#

with what do you call this?

loud python
#

with thisTrigger and synchronizedObjects thisTrigger select 0 (which is a game logic object off in the distance)

#

it happens in the trigger activation field

#

the missile spawns and just flies up

#

I've tried it with a missile shot from the actual "turret" and the designator target of a remote designator and it does work

#

so setMissileTarget can, in theory at least, be used that way

winter rose
#

setMissileTargetPos is a thing, too
so

[trigger, triggeringUnit] call theScript;
#

reportRemoteTarget is useless, an ammo doesn't have a side

loud python
#

yes, that was just a hopeless attempt to get the game to do what I want xD

#

setMissileTargetPos also did nothing though ๐Ÿคท

winter rose
#

ยฏ_(ใƒ„)_/ยฏ

mighty vector
#

may I post my gigantic question again?

winter rose
#

also no frequent bump, thanks

loud python
#

I just confirmed it again

#

missile setMissileTargetPos (getPosATL target) returns nothing and has no visible effect

#

well I guess arma 3 just hates me

winter rose
loud python
#

yes

#

I've read that, which is why I initially tried it out with 1. the same missile type and 2. the same target type

#

but the missile shot from an actual turret, using the "fired" event handler to save the missile into a global variable and getting the laser target directly from a remote designator

#

that actually worked quite well

#

confirmed it again

#

forcing the turret to shoot makes the missile go straight up

#

then run missile setMissileTarget laserTarget harry in the console (harry is the remote designator ;D) and the missile instantly curves right and hits the laser target

#

and if I spawn the missile with createVehicle, the exact same code returns false instead and nothing happens

winter rose
#

is the ammo type correct?

loud python
#

typeOf missile returns "ammo_Missile_Cruise_01" for the one the turret fires and that's the one I use in the createVehicle command

#

I can only assume that the missile is somehoe magically linked to either the unit that fired it or the side or something

warm hedge
#

ammo_Missile_Cruise_01 only takes a target by Data Link

loud python
#

all I can say is that setMissileTarget works ๐Ÿคท

#

does the missile share any datalink information with the unit that shot it?

#

vehicleReceiveRemoteTargets missile returns false for the missile where setMissileTarget works

winter rose
#

simplified your debug script```sqf
private _target = "LaserTargetW" createVehicle (player modelToWorld [0,0,300]);
private _missile = "ammo_Missile_Cruise_01" createVehicle (player modelToWorld [0,0,10]);
_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
[_missile, _target] spawn {
params ["_missile", "_target"];
sleep 0.1;
(side _missile) reportRemoteTarget [_target, 60];
sleep 0.1;
_missile setMissileTarget _target;
};

loud python
#

thanks ๐Ÿ˜‰

#

hmmmmm... interesting...
Killing the "gunner" in the turret and forcing it to fire another missile makes it stop working

#

so the missile is somehow linked with the unit that shot it (and its side, I guess)

vague geode
#

Is it possible to customize the loadout of dynamic loadout vehicles in the mission config so that if they are called in by any player they automatically come with the changed loadout?

warm hedge
#

Yeah, missile scripts are something weird thing I've ever did in Arma

winter rose
#

@vague geode dynamic loadoutsโ€ฆ respawn gear is configurable, yes?

#

@loud python works with "M_Scalpel_AT" and "Missile_AGM_01_F" yes

vapid wadi
#

I'm currently trying to use modelToWorld to spawn objects inside of buildings around my map, can anyone tell me how I can get the position inside of the building from where the player is standing?

vague geode
#

@winter rose Not sure what you mean. I would just like to change the default loadout of the Black Wasp II so that if anyone calls in a Black Wasp II in my Warlords mission it automatically comes with the changes to its loadout...

winter rose
#

worldToModel @vapid wadi

#

@vague geode "Warlords" context was missing

vapid wadi
#

@winter rose Thanks,

woven flame
#

Hello, excuse me for disturbing you, I am currently working on a mod that will replace the main menu of Arma 3 for my server. I created a "Play" button, I would like with an "onbuttonclick" that the game connects itself to a server, I found the STS mod that will allow me to do this but it only seems to work via a server, do any one, know what I can use inside of a "onbuttonclick" to do it ? Thanks

||Excuse me for my bad English||

winter rose
loud python
#

IT WORKS! Well, kind of, for now

#

but it still needs the actual missile launcher to work

#

have to missile setShotParents [turret, gunner turret] after spawning it; then it will know about the laser target

winter rose
#

ah, not bad! didn't think of that.

sage flume
#

is there a limit to what can be read?

#

2700 setFog [0.05, 0.0001, 200];

winter rose
#

maybe you only need a unit of said side @loud python

sage flume
#

0.0001 is to many digits?

warm hedge
#

No

woven flame
#

Thank you @winter rose I'll try asap ๐Ÿ˜‰

loud python
#

I had hoped that, but no

#

tried with [player, player] instead, but since I'm not a "vehicle", it didn't work

winter rose
#

a radar-receiving vehicle then

#

okido

loud python
#

what's the best thing I could use as a dummy for that though?

winter rose
#

a missile pad at [0,0,1000] ? ๐Ÿ˜„

loud python
#

That's exactly the thing I'd like to avoid xD

#

but worst case that might work

winter rose
#

a drone could do, I suppose

loud python
#

gonna try spawning a "B_Ship_MRLS_01_F (kim)" and disable AI and make it invisible ๐Ÿ˜„

#

YESSSSS

#
private _source = param [0];
private _target = "LaserTargetW" createVehicle (position param [1]);

_p = position _source;
private _missile = "ammo_Missile_Cruise_01" createVehicle [_p select 0, _p select 1, (_p select 2) + 1];

_missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
blufor reportRemoteTarget [_target, 3600];

private _launcher = ("B_Ship_MRLS_01_F" createVehicle position _source);
createVehicleCrew _launcher;
{ _x disableAI "ALL" } forEach crew _launcher;
hideObjectGlobal _launcher;
_missile setShotParents [ _launcher, gunner _launcher ];

_missile setMissileTarget _target;
#

this works

#

a bit of extra magic, like a delay before setting the target so the missile rises a bit further (looks more cinematic ;D) and disallowing damage on the launcher and the script is pretty much ready to be used now โค๏ธ

sage sluice
#

Hiya lad, I was wondering if you could help me. This is my first post here so sorry if this has already been covered. I am running the current script;

_talkers = [talker1,talker2,talker3,talker4,talker5,talker6,talker7,talker8];

_seltalker = _talkers call BIS_fnc_selectRandom;

while {{alive _x} count _talkers > 0} do {

_voicelist = [
            "china1",
            "china2",
            "china3",
            "china4",
            "china5",
            "china6",
            "china7",
            "china8"
    ];

_voice = _voicelist call BIS_fnc_selectRandom;

[_seltalker, _voice] remoteExec ["say3D"];

sleep 5;
_seltalker = _talkers call BIS_fnc_selectRandom;
sleep random 20;

};

However, I am also using a ragdoll mod that prevents AI units from dying instantly and instead they set into an unconscious type state. I was wondering if there was a way that I could stop the script running per individual 'talker' if there health falls below a certain % such as 0.3?

Any help would be greatly appreciated; apologies again, I'm new to all this.

loud python
#

```sqf
// code here
```

#

@sage sluice

#

write it like that and the code gets highlighted like this

#
// code here
sage sluice
#

So just to be clear // like this

#

guess not aha

#
// ``
#

ah gotcha

#

sorry

#
// _talkers = [talker1,talker2,talker3,talker4,talker5,talker6,talker7,talker8];

_seltalker = _talkers call BIS_fnc_selectRandom;

while {{alive _x} count _talkers > 0} do {

    _voicelist = [
                "china1",
                "china2",
                "china3",
                "china4",
                "china5",
                "china6",
                "china7",
                "china8"
        ];

    _voice = _voicelist call BIS_fnc_selectRandom;

    [_seltalker, _voice] remoteExec ["say3D"];

    sleep 5;
    _seltalker = _talkers call BIS_fnc_selectRandom;
    sleep random 20;
};
runic edge
#

hello guys ! I've a question about the createDiaryRecord : i can't find the utility of the second parameter : subject. I cant see what object i can or cannot put there and what it does once i'm in game !

#

in the examples it shows "diary"

finite sail
#

when you use creatdiarysubject, you provide subject

#

then all creatediaryrecords with the same subject are shown together

placid badger
#

is there a way to mod the Old Man mission?
Can I just extract the pbo files and then repack them after modding, or will that have a problem with file validation?

still forum
#

That will have a problem with file validation yes

#

because exactly that is what file validation should prevent, you just modifying stuff

#

but as its singleplayer, you just have to revert to the originals before you play multiplayer

placid badger
#

I see, but will it let me launch the game as usual? Or should I change anything in the launcher?
I don't really know, never modded before, but want to have some fun with that mission. Is there another way to do so?

still forum
#

yes. no. yes you could make a addon mod, instead of modifying the original, but thats harder to do