#arma3_scripting

1 messages ยท Page 722 of 1

meager epoch
#

& looks cooler :d

copper raven
#

interesting, preprocessing any file called "description.ext" doesn't crash the game on bad include, but it does for other files ๐Ÿ˜„ meowsweats

sage wind
#

https://community.bistudio.com/wiki/connectToServer
Command does not support DNS addresses and need IP (arma v2.06)

connectToServer ["my.server.domain", 2302, "test"];
connectToServer ["http://my.server.domain", 2302, "test"];
class joinExampleServer : Campaigns {
    idc = -1;
    text = "Join example server";
    tooltip = "Join the best example server!";
    y = "(3 *     1.5) *     (pixelH * pixelGrid * 2) +     (pixelH)";
    action = "";
    onbuttonclick = "connectToServer ['my.server.domain', 2402, ''];";
    Onload = "";
};

Just throwing it out there in to the wild if it is a fitting note for the wiki @unique sundial @still forum

copper raven
#

yes it doesn't support domains

#

you can use an extension to resolve them i guess

sage wind
#

Can live with it it was just missing that from the wiki so figured ill add it but i could not ๐Ÿ™‚

graceful kelp
#

Quick ?, is there anyway via script function to determine who in the aircraft, pilot or copilot has control of the helicopter

willow hound
copper raven
graceful kelp
#

thank

quick lagoon
#

"currentPilot" is weird to me. Throws NullObj at my face when I'm copilot that took control.

copper raven
#

wat vehicle?

quick lagoon
#

Helicopter. RHS MH-6M to be precise.

still forum
copper raven
#

uh i just started reading it and it's gone @fair drum meowsweats

fair drum
#

i kinda have an idea... let me test it before I ask

#

if I have:

for "_i" from 1 to 10 do {
  if (_condition) exitWith {_i = _i - 1};
  //More Code
};

will this attempt a retry continuously until all 10 have succeeded?

copper raven
#

no

quick lagoon
#

Iirc "exitWith" leaves current scope so it will leave that loop once the condition happens.

fair drum
#

it exits the whole block doesn't it, not just that iteration

#

lets say I use a then/else

quick lagoon
#

Maybe. Depends on the condition and what you run in the "more code".

upper siren
#

should just exit that for loop, mine is

code
if (!isServer) then {
  if (isNil "HC1") exitWith {code};
  if (isNil "HC2") exitWith {code};
};
code that also runs
fair drum
#

not what was asked tho

upper siren
meager epoch
#

How can I disable the red target square thingies to appear in a SP scenario?

copper raven
#

difficulty settings

meager epoch
#

not for myself, but for the scenario

#

so that anyone playing it, wont have them appear every now and then

copper raven
#

server difficulty settings then

#

well same thing, in sp you're the server

meager epoch
#

and that'll work even tho the scenario is not MP?

copper raven
#

you aren't supposed to make it

#

the guy hosting the server is

#

difficulty settings are not mission related

meager epoch
#

well where and how do i disable it notlikemeow

copper raven
#

well if you're playing in singleplayer, you'd just go into the game settings and edit it there

meager epoch
#

like i said, not for myself but for the people playing it

#

im making a scenario

#

and i want that disabled

#

by default

#

like

#

override their difficulty settings

copper raven
#

you can't

meager epoch
#

Welp

#

Any way to force the ai and the player not to target people then

copper raven
#

make the target captive?

meager epoch
#

But they wont be attacked nootnoot

copper raven
#

how does that work then

meager epoch
#

actually theres no ai present for that one guy that keeps getting targeted so that could work

#

tryna implement stealth in my mission

#

Will setting him captive prevent the player from targeting him?

#

targeting as in the red square thingy

copper raven
#

it's not the player that targets him, it's the squad leader

#

but it should yeah

meager epoch
#

great

#

thanks

shadow river
#

this is my problem:

#

i've got a map with some addon scripts, and it all works perfectly

#

if the game is saved, and then opened again

#

the scripts aren't running, any way to reset them somehow?

#

for example, the left shoulder holster mod

fair drum
shadow river
sage wind
still forum
flint topaz
#

Reference this and itโ€™s conversation. I got the Ace Interaction to show up but when I put the call to openBox nothing happens to the player if anyone has any idea why it would be greatly appreciated.
Current code within action execute area:

[limited_arsenal, _caller] call ace_arsenal_fnc_openBox

#

^ limited_arsenal is a box being created in Server Init

flint topaz
#

Iโ€™ve used most calls for the player by now

#

Would that be via the params [] call?

#

Also a bit of a theory question here why do half the variables use _ at the start I presume due to private variable just want to confirm that

flint topaz
#

Ahh yes Iโ€™m correct

little raptor
#

no you're not

flint topaz
#

โ€œLocalโ€ aka โ€œprivateโ€ variables have underscored

little raptor
#

local != private

tough trout
#

Is it possible to have an action not appear on an object (i.e tablet) unless a player has a specific item in their inventory? If so, how do I do it? Trying to do a prison/armoury door setup.

tough trout
#

I'm very unskilled in the world of scripting

crude vigil
#

I believe he is talking about door actions of buildings, not related to addAction.

little raptor
#

well are you @tough trout ?

tough trout
#

No, I was referring to an addaction on some external console

#

It'll open a door as part of a custom composition

little raptor
tough trout
#

It'll be an RFID keycard from one of several mods installed.

little raptor
#

ok. well for the condition you can try this:

"'itemName' in uniqueUnitItems _this"
```where itemName is the class name of the key item.
note that it's case sensitive
stray flame
#

So i tested the script yesturday with a friend and for some reason it seemed to have some reliability issues when I wasnt in the group

#

that could be an issue with something else like MarkerPos breaking but just thought it was worth a mention incase something like that can be easily explained

tough trout
stray flame
#

Also, a general question

#

how can I turn off side and global chat?

willow hound
stray flame
#

"J_Mark" setMarkerPos [4928.26,10808.8]

willow hound
#

Switch to setMarkerPosLocal.
The non-local marker commands always synchronise the entire marker state across the network. In your case that means that if a machine where the marker is visible runs setMarkerPos, the marker will be synchronised to the same status on all other machines, i.e. it will also be made visible on all machines.

little raptor
stray flame
#

I assume the only issue with that solution would be late JIP

#

Or players that join after marker is moved

willow hound
stray flame
#

So remote execute would fix that?

willow hound
#

The JIP queue can be used to fix that, yes.

stray flame
#

Sorry for my utter baby level knowledge of scripts but

#

Would that be added to the trigger activation or to a script run by trigger activation?

tough trout
willow hound
stray flame
#

Become I am an utter nut at scripts

#

It's set to trigger from another trigger

#

That trigger triggers from object owner not present

#

Object owner gets moved by hold action on an npc

willow hound
#

And what does it do?

stray flame
stray flame
#

It moves a marker from a corner outside of the map to a place

#

So the action of
hold action -> setpos -> talkTrig = true -> setmarkerpos

willow hound
#

Triggers are a delicate matter, but the suspected locality issues aside, why not do setPos and setMarkerPos directly in the hold action?

stray flame
#

i have

#

but for some reason hold cation seems almost local

#

in how it fails consistently do things when the server host inst the one triggering the action

willow hound
stray flame
#

so the only thing i can get it to do without fail when triggerd by a JIP seems to be setpos of another object

#

which thankfully is an effect that then can be setup to trickle down to non-local triggers

willow hound
#

How do you create your hold action?

stray flame
#

Eden Enhanced

#

has a pre-made template for it

willow hound
#

And what specifically did not work when the server host was not the one completing the action?

stray flame
#

well

stray flame
#

its that it failed to activate another trigger

#

sorry for the delay, complications

#

anyway

#

What should I write to set this script working?

#

remoteExec ["J_Mark" setMarkerPosLocal [4928.26,10808.8], JIP]
would this work or is this just foolish?

#

if this is worng id like someone to correct me

#

"J_Mark" setMarkerPosLocal [4928.26,10808.8] with remoteExec

#

is this an improvement?

#

"J_Mark" setMarkerPoslocal [remoteExec [4928.26,10808.8], 0, true];

distant oyster
#
["J_Mark", [4928.26,10808.8]] remoteExec ["setMarkerPosLocal", 0, true];
``` but why not use setMarkerPos instead?
distant oyster
#

oh okay

stray flame
#

Now I just need to figure out how to disable side and global chat

stray flame
#

I have tried this to no use

#

//--- Control Chat - Format: {channelID<number>, disableChat<bool>, disableVoice<bool>}
disableChannels[] = {
{0, true, true}, //--- Global Chat
{1, true, true}, //--- Side Chat
{2, true, true}, //--- Command Chat
{3, false, false}, //--- Group Chat
{4, false, false}, //--- Vehicle Chat
{5, false, false}, //--- Direct Chat
{6, true, true} //--- System Chat
};

#

and I think I tried a version of what was listed there

#

but I can try

willow hound
#

When testing keep in mind that global chat is always available to admins (and you are usually an admin when testing).

stray flame
#

Im aware

#

How can I setup a apex style respawn?

#

not with the menue and stuff

#

just one where they respawn on teammates

#

becouse all I can find is the standard ones and take over AI apon respawn

hollow thistle
#

Apex respawn is using the one with menu (MenuPosition)

stray flame
#

Im mainly intrested in just

#

spawn on teammate

hollow thistle
stray flame
#

Dose that work even if there is no AI?

hollow thistle
#

It should, guessing from the description.

stray flame
#

well

#

I checked my mission description

#

and ive already put it there

#

but whenever someone dies

#

they go to spectator

#

my description is just

#

`respawnOnStart = 0;

respawn = 4;

0 enableChannel false;
1 enableChannel false;
2 enableChannel false;`

#

Could it have anything to do with what settings ive imput in eden?

willow hound
#

enableChannel is a command, and those do not belong in description.ext.

stray flame
#

ah

#

where then?

willow hound
#

In the case of enableChannel it would make sense to place it in an init script.

stray flame
#

sure

stray flame
#

It seems tailored for AI squad mates

gleaming oriole
#

Hey,

I have this code to spawn units on custom positions:

for "_i" from 1 to 16 do { _units createUnit ["UK3CB_NAP_O_RIF_1", _positions deleteAt floor random count _positions, [], 0, "CAN_COLLIDE"];};

How do I customize their loadout? I have 12 loadouts I want them to choose from

gleaming oriole
#

I don't understand how to combine that

#

I put the loadouts in the description.ext and named the classes ei_1 to ei_12

stray flame
#

How can I make players invincible after respawning for a short period of time?

copper raven
gleaming oriole
# copper raven syntax 4 should do what you want, also see examples

syntax 4 would be ```sqf
_units setUnitLoadout (missionConfigFile >> "ei_1");


And it doesn't work in the script 
```sqf
for "_i" from 1 to 16 do { _units createUnit ["UK3CB_NAP_O_RIF_1", _positions deleteAt floor random count _positions, [], 0, "CAN_COLLIDE"]; _units setUnitLoadout (missionConfigFile >> "ei_1");};
copper raven
#

_units is a group, and you're passing that to setUnitLoadout when on wiki its clearly stated that it takes an object

gleaming oriole
#

But what is the object name?

copper raven
tidal ferry
#

Hey, question

#

So, I need to add an event handler to a human unit that will execute code on init

#

However, there's an existing init eventhandler in the config that I don't want to overwrite

#

Anyone know XEH event handlers well enough to advise me on what to do?

gleaming oriole
copper raven
#

So the object name is object?
no, an object is a value type in sqf, a unit is an object, a building is an object, a vehicle is an object, etc.

copper raven
limber panther
#

hello,
zeus>modules>audio>play sound
Is there a way to add a custom sound there so that i can as a zeus put it anywhere at any time in the game and have a certain sound be played in a loop in that area until i delete the module?

tidal ferry
copper raven
#

then see that link

red rune
#

I'm trying to add a "Hit" event handler that creates some particles when the unit is hit. I can see particles as Zeus but players can't. Any ideas?

#
this addEventHandler [ 
    "Hit", 
    { 
  params ["_unit", "_source", "_damage", "_instigator"]; 
 
  if (!hasInterface) exitWith {}; 
 
  private _pos_hit = getPos _unit; 
  private _particle = "#particlesource" createVehicle (_pos_hit); 
  _particle setParticleCircle [0,[5,5,5]]; 
  _particle setParticleRandom [0.5,[0,0,2],[-5,-5,-5],0,0.25,[0,0,0,0.1],0,0]; 
  _particle setParticleParams [["\A3\data_f\blesk1",1,0,1],"","SpaceObject",1,0.3,[0,0,0],[0,0,0],5,10,7.9,0,[0.005, 0.0006], [[1, 1, 1, 1], [1, 1, 1, 0.5], [1, 1, 1, 0]], [0.08], 1, 0, "", "", _pos_hit]; 
  _particle setDropInterval 0.01; 
 
  _particle spawn { 
   sleep 0.2; 
   deleteVehicle _this; 
  }; 
 } 
]; 
distant oyster
meager epoch
#

how can i make a custom command/radio message/whatever its called

meager epoch
#

you know, the one that goes 0 -> 9 (Custom)

cunning oriole
meager epoch
#

maybe blobdoggoshruggoogly

cunning oriole
#

you can create a custom radio channel that will appear like normal, you might create when the mission starts then in initPlayer when a player joins the mission add them to it

meager epoch
#

it can be done from the editor with a trigger by setting the activation to radio alpha/beta/etc, however, from my time in this discord ive learned that triggers are bad so im tryna find the command for it

#

so, those are it?

cunning oriole
#

ohhh i think i misread you, I thought u wanted to create a custom channel

#

na my bad, that command wont do what you want

meager epoch
#

right

cunning oriole
#

so you want to send out a thing in system chat or you want a player to say something?

meager epoch
#

i need a script to be executed when the player selects it (0 -> 9 -> 1)

#

that's not the problem, i just need the command to create it nootnoot

#

cant find it on the biki D:

bitter jewel
#

i think ypu want the commandingMenu thing

#

but it is done with

#

eww

#

config

meager epoch
#

are you sure? cause, like i said, it can be done from the editor by simply slapping a trigger and changing its activation to radio alpha or whatever

#

so why would smth so simple require messing with configs or whatever

#

idk, u could be right tho blobdoggoshruggoogly

#

btw, i need it to be under Custom, not Support

bitter jewel
#

sorry i meant communicationMenu

meager epoch
#

yeah im looking at it rn

#

like i said, i need it to be under Custom, not Support

#

this adds it under support i think

bitter jewel
#

i think so too

#

ive used it but dont remember

#

am on phone so cant check

little raptor
meager epoch
#

how

stray flame
#

Eyo

#

I would like some help with multiplayer chat text

#

using the default "Radio Chat" module seems to bring some issues when assigned to a group in multiplayer

#

since I have to bind it to everyone so that if the player it was originally bound to isnt there, it wont break

#

but

#

THis makes it duplicate

#

so I would like an alternative solution for short dialogue activated by trigger

#

that local to players in an area

#

Any advice?

little raptor
#

Basically each commanding menu goes like this:

My_menu = 
[
 ["Menu name", true],
 ["ItemName",..],
 ...
]
#

you can take a look at my AIO command menu mod if you don't find the doc

#

(again it's not on BI's wiki, it's on BisSimulations' wiki)

stray flame
# stray flame I would like some help with multiplayer chat text

Okay so I did some looking around and found this:
(Trigger)
Condition:
allUnits inAreaArray thisTrigger findIf {isPlayer _x} != -1

On Activation:
private _unit = allUnits inAreaArray thisTrigger select {isPlayer _x} select 0; "That should do it.... Location discovered!" remoteExec ["systemChat", group _unit];

but it gives a generic error

copper raven
#

since i see "ANYPLAYER" (Since Arma 3 v1.67) in https://community.bistudio.com/wiki/setTriggerActivation i assume there is, your trigger should literally be "any player", this as condition, and "Location discovered!" remoteExec ["systemChat", group (thisList select 0)] as activation, i remoteExec because i assume you have this trigger set as server-only

amber sapphire
#

I recently got back into mission making and am trying to get back into the hang of things. Can anyone refresh me on how to assign global variables to groups spawned in through a script? I thought I had a note of it, but apparently not.

copper raven
#

you assign like any other variable

amber sapphire
#

@copper raven Did the trick. It's always the basics that I'll forget. Appreciate it, man.

stray flame
#

Anyone else got any suggestions for how I can add a local chat message to everyone inside of a trigger zone? (There will be people elsewhere that I dont want seeing it)

compact maple
winter rose
winter rose
compact maple
#

awesome ๐Ÿ˜„

stray flame
#

quick question

#

any way to quickly find a bothersome trigger?

#

keep getting generic error from a trigger I thought I cleaned

#

and it is

#

But it keeps showing up a generic error

stray flame
#

Error in expression <_x}; private _inArea = _alivePlayers count {vehicle _x inArea _this}; _inA>

still forum
#

inAreaArray exists

#

is there any more info about your error?

#

your error message seems incomplete, it almost always shows the actual reason for the error, below the "Error in Expression" you posted

stray flame
#

well this is straight out of the RPT

still forum
#

did you check your RPT?

stray flame
#

11:55:54 Error Generic error in expression
11:55:55 Error in expression <_x};
private _inArea = _alivePlayers count {vehicle _x inArea _this};
_inA>

still forum
#

thats everything? no more info below that?

#

what is in _alivePlayers? maybe it has a nil inside it?

stray flame
#

hmm

#

well

#

how much of the following information would you like me to post?

still forum
#

everything relating to that arrow

#

maybe 2 or 3 more lines below

stray flame
#

11:56:07 Error in expression <_x};
private _inArea = _alivePlayers count {vehicle _x inArea _this};
_inA>
11:56:07 Error position: <count {vehicle _x inArea _this};
_inA>
11:56:07 Error Generic error in expression
11:56:08 Error in expression <_x};
private _inArea = _alivePlayers count {vehicle _x inArea _this};
_inA>
11:56:08 Error position: <count {vehicle _x inArea _this};
_inA>
11:56:08 Error count: Type Array, expected code
11:56:08 Error in expression <_x};
private _inArea = _alivePlayers count {vehicle _x inArea _this};
_inA>
11:56:08 Error position: <count {vehicle _x inArea _this};
_inA>

still forum
#

11:56:08 Error count: Type Array, expected code

#

count doesn't take code on the right side

#

the condition goes on the left

stray flame
#

hmm

#

I mainly wish to find if the source is a trigger or script

#

and what script or trigger that is

#

May have found it!

#

thisTrigger call { private _alivePlayers = allPlayers select {alive _x}; private _inArea = _alivePlayers count {vehicle _x inArea _this}; _inArea > 0 && _inArea == (count _alivePlayers) }

still forum
#

If you run profiling branch and run the game with -debug paramter.
It will tell you the coordinates of the trigger in RPT

stray flame
#

I mean I have Eden enhanced on if that helps

still forum
#

no ๐Ÿ˜„

stray flame
#

Looks like my guess was correct

#

I found the source and it was the listed above code used in the condition of a trigger

winter rose
stray flame
#

So just use something like allPlayers inAreaArray myLocation;

copper raven
#

yes but you need to still filter alive ones, atleast you were in your previous code

stray flame
#

my intention was for the trigger to activate when all players on a server are currently รญnside of it

#

ho I borrowed it

#

I am too green to read the function and faults of something like that

copper raven
#

select {alive _x}

dusky wedge
#

How to get current weapon loaded magazine?

compact maple
#
private _a, _b;
if (bla) then {
  _a = 3;
  _b = 4;
else {
  _a = 2;
  _b = 1;
}

is this okay ?

dusky wedge
#

Thank you, I'm sorry, I put it wrong.

I need to get the currently loaded magazine from primaryWeapon and secondaryWeapon

compact maple
#

becarefull it returns an array of magazine

flint topaz
#

Can someone please help me explain why this is not doing anything

compact maple
#

the player object ?

flint topaz
#

I guess

#

these params are always weird to me

compact maple
#

I think

#

last param of the ace_interact_menu_fnc_createAction call should be true ?

#

it's the condition for the action to be shown

compact maple
#

for multiple var declaration with no values

#

I remember someone told be that private [] is very lazy

little raptor
compact maple
#

alright ty

compact maple
#

uh, I meant slow

still forum
compact maple
#

thanks

candid condor
#

Hey all Im working on a horror op for a unit and I wanna add some jumpscares into it any idea on how to add those because I cant find anything online.

red rune
# distant oyster locality. the setParticleXXX commands have local effect. try to use remoteExec
this addEventHandler [ 
    "Hit", 
    { 
    params ["_unit", "_source", "_damage", "_instigator"]; 
 
    if (!hasInterface) exitWith {}; 
 
    [_unit] remoteExec ["elec_fnc",0];
    }
    
]; 

elec_fnc = {
    
    private _pos_hit = getPos (_this select 0); 
    private _particle = "#particlesource" createVehicleLocal (_pos_hit); 
    //etc...
};

Am I doing it wrong? I'm trying to add it all into the init code of a unit since I don't have access and can't save the particles in a file

winter rose
red rune
#

It works for me but players can't see the particles

#

I'm adding them to AI units

winter rose
#

not what I meant

#

also, I see that you are using this
so I guess these are init fields we are talking about, riiight?

red rune
#

yes

winter rose
#

so everytime you hit a unit, it spawns some smoke

red rune
#

sparks

winter rose
#

make a CfgFunctions function (instead of elect_fnc = )
then you can remoteExec your HECKS_fnc_electricSpark flawlessly

red rune
#

wouldn't that require access to the files?

winter rose
#

โ€ฆif your script is server-side, how do you expect the client to know it

stray flame
#

Hey, how can I place ammo on the floor in eden editor?

#

What script could help me do that

little raptor
candid condor
#

I know would be nice if that was added xD

distant oyster
winter rose
distant oyster
#

who knows when the message from the server reaches the client

copper raven
#

i was gonna say that fixes locality only, but then it's ran in the init field, so no

winter rose
#

I would say just run the Hit EH locally on every machine, and don't remoteExec the effect

copper raven
#

but it will execute only where the unit is local, no?

winter rose
#

use HitPart or addMPEventHandler or Dammaged or whatever :D

copper raven
#

hitpart won't work either, mphit will probably be the best

stray flame
little raptor
stray flame
#

Im using eden enhanced

#

I just want some script to spawn ammo on the ground

#

I know wasteland has managed that

little raptor
#

I didn't say it's not possible

#

you said in Eden

stray flame
#

Well I dont mean manually

#

I just mean like

#

how you place mines and stuff like that

#

just place over an area

#

or around an object

#

just some ammo on the gorund, nothing big

little raptor
#

to do that you have to create a weapon holder first, then fill it with ammo

stray flame
#

well placing a pre-existing one makes it invisible apon being edited

little raptor
#

wat?
what I mean is:

_wh = createVehicle ["WeaponHolderSimulated", _pos];
_wh addMagazineCargoGlobal ["mag_class", _cnt];
stray flame
#

hm

#

Could try

little raptor
#

actually I think you need a scripted suffix there

#

if you want to do it in eden:

if (!isServer) exitWith {};
_wh = createVehicle ["WeaponHolderSimulated_scripted", ASLtoAGL getPosASL this, [], 0, "CAN_COLLIDE"];
_wh addMagazineCargoGlobal ["mag_class", _cnt];
deleteVehicle this;
#

put it in the init field of a temp object

stray flame
#

Temp object?

little raptor
#

yeah. it gets deleted and you get a mag instead

stray flame
#

ho ok

little raptor
#

it can be anything you want

#

like a wrench or something

stray flame
#

(!isServer)

#

it is locally hosted server

#

player hosted

#

if that matters

little raptor
#

no

stray flame
#

Good good

#

is the thing I should replace
"mag_class"

little raptor
#
  • _cnt
stray flame
#

What should _cnt be replaced with?

little raptor
#

count meowsweats

#

a number

stray flame
#

ho

#

my bad

#

Now I just need to find the mag names

#

Hmmm

#

seems like it works but

#

the models for the mags them selves arent visible

#

I tried placing a mag from my inventory on the ground next to it and well

#

both can be picked up but one is invis (when not in inventory)

#

Im guessing thats a quirck of using weapon holders

little raptor
stray flame
#

hu

#

I am doing it with a mod

#

Operation Trebuchet

#

For me it places invis mags

#

I found the mags by exporting a loadout with em, then looking at the copied text and clipping out the mag

little raptor
stray flame
#

yep

little raptor
#

then you're doing something wrong

stray flame
#

I can pick up the same mag I placed and palce it myself and works fine

little raptor
#

what is the current code you're running?

stray flame
#

if (!isServer) exitWith {};
_wh = createVehicle ["WeaponHolderSimulated_scripted", ASLtoAGL getPosASL this, [], 0, "CAN_COLLIDE"];
_wh addMagazineCargoGlobal ["OPTRE_32Rnd_762x51_Mag", 5];
deleteVehicle this;

#

Sadly I dont seem to have the ability to send a picture to demonstrate

little raptor
#

that's weird thonk

stray flame
#

yeah got the same result

#

Did you copy my script?

little raptor
#

only the mag part

stray flame
#

HM

little raptor
stray flame
#

yeah

little raptor
#

it seems like there's a problem with the model

#

for some reason I only see its shadow...

#

but after I add a second mag next to it I see the model

stray flame
#

Could be as simple as just a tribuchet mod

#

problem

still forum
#

theyre probably upside down

stray flame
#

maybe the way I interoperated that was just silly but

little raptor
stray flame
#

flipping it dosent seem to do much

little raptor
#

when I move the wh higher I see them

stray flame
#

How may I do this?

little raptor
stray flame
#

Idk how to change altitude on them

#

when I try it just dosent change

little raptor
#

the original one I posted

#

without _scritpted

stray flame
#

so change _wh to a number?

little raptor
#

wat

stray flame
#

nvm lol

stray flame
#

ok im lost

little raptor
#

@stray flame try a non-simulated weapon holder:

_wp = createVehicle ["GroundWeaponHolder", ASLtoAGL getPosASL player, [], 0, "CAN_COLLIDE"]; 
stray flame
#

Will do

little raptor
#

the rest of the script is as before

stray flame
#

soo

#

if (!isServer) exitWith {};
_wp = createVehicle ["GroundWeaponHolder", ASLtoAGL getPosASL player, [], 0, "CAN_COLLIDE"];
_wh addMagazineCargoGlobal ["OPTRE_32Rnd_762x51_Mag", 5];
deleteVehicle this;

little raptor
#

ye

#

but the shadows are still broken:

stray flame
#

Shouldnt it be _wh twice instead of

_wp
and
_wh?

little raptor
#

ye

#

it was a typo obviously meowsweats

stray flame
#

aaand

#

it works

#

Thank

#

ok weird

#

this time

#

they automatically spawn under my feet

#

When I spawn 5m away

little raptor
#

yeah

#

I put player there

#

for testing

stray flame
#

ho

little raptor
#

replace it back with this

stray flame
#

Current: if (!isServer) exitWith {}; _wh = createVehicle ["GroundWeaponHolder", ASLtoAGL getPosASL player, [], 0, "CAN_COLLIDE"]; _wh addMagazineCargoGlobal ["OPTRE_32Rnd_762x51_Mag", 5]; deleteVehicle this;

little raptor
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
stray flame
#
_wh = createVehicle ["GroundWeaponHolder", ASLtoAGL getPosASL player, [], 0, "CAN_COLLIDE"]; 
_wh addMagazineCargoGlobal ["OPTRE_32Rnd_762x51_Mag", 5]; 
deleteVehicle this;```
#

Seems like I now have a fully functional ammo drop

#

danke

#
_wh = createVehicle ["GroundWeaponHolder", ASLtoAGL getPosASL this, [], 0, "CAN_COLLIDE"]; 
_wh addMagazineCargoGlobal ["OPTRE_32Rnd_762x51_Mag", 5]; 
deleteVehicle this;```
#

On another note

#

if I want to change the date of a mission

#

to something beyond what eden lets me

#

wiht setdate

#

do I need to do it in Init.sqf for it to apply to a server?

night sundial
night sundial
tidal ferry
#

Question

#

What is the cleanest way to exit an iteration for a forEach loop?

#

I've learned it's not exitWith

tidal ferry
little raptor
tidal ferry
#

Yeah, I'm using a foreach scope

#

But won't break, break the loop?

#

Basically I'm running an evaluation in each cycle, and if the evaluation is true, I want it to skip the rest of the loop

little raptor
#

so what's wrong?

tidal ferry
#

Only executes it for the first one

#

Or not at all

#

I can send you the script if you'd like

little raptor
#

ok

crude needle
stray flame
#

Hu

little raptor
# stray flame Hu

I think just putting it in initServer.sqf will suffice, because according to the wiki it's still synced

tidal idol
#

Does anyone know how to get a UAV camera to target a specific unit and display it's camera on a screen (Rugged Large Screen, Black)? I found an old tutorial, but apparently it doesn't work anymore since PiP was changed.

The UAV is the KH-3A Fenghuang from APEX, and I gave it a loiter waypoint attached to a unit in the player group. In this case, I want the drone's camera to also track that unit.

little raptor
tidal ferry
#

Hey, is there any way to manually change a player's FOV using scripts?

#

And/or zoom out the camera?

night sundial
night sundial
still forum
#

zes

#

no

#

almost

#

either that, or switch/case

#

yes

#

or

private _myResult = call { 
  if ( /*statment*/ ) exitWith {
    _var1; 
  };
  if ( /*statment*/ ) exitWith {
    _var2; 
  };
  if ( /*statment*/ ) exitWith {
    _var3; 
  };
};
digital torrent
#

if i wish to create an addaction for the player only. eg other player cannot see, i assume i put radius at 0?

winter rose
digital torrent
#

what do you mean on the second part?
if i put an addaction with default setting on a player, the player around him would also be able to action it

night sundial
digital torrent
#

ohh i see

#

thanks @winter rose and @night sundial

digital torrent
#

what can i use as a equivalent of "iskindof" but for the assignedvehiclerole

digital torrent
#

if i use assignedvehiclerole player, it return the seat i am using

winter rose
#

so far, so good

digital torrent
#

what can i use if i want to match it with a if function.
eg: if (assignedvehiclerole player iskindof "turret") then etc..

ofc the iskindof is wrongly used here. i wanted to know what was the correct command i should be using

winter rose
#
private _vehicleRoleArray = assignedVehicleRole player;
private _vehicleRole = _vehicleRoleArray select 0;
if (_vehicleRole == "cargo") then { /* ... */ };
#

@digital torrent

digital torrent
#

ohh i see

#

thanks a lot @winter rose

spare vector
#

I am making a mission for some friends... I am trying to set some aircraft workers to a repair animation using the 3den advanced animations until a trigger and then have them walk off with a trigger activation ...
tried this but it just errors and i dont know what i am doin wrong... any help would be appreciated

if (isServer) then waitUntil {triggerActivated moveWorkers}; {"switchMove",0]; worker1 enableAI "ANIM";

fair drum
spare vector
#

it just gives a init error

#

with no error text

fair drum
#

you have a miss matched { and ]

winter rose
#

of course it doesโ€ฆ then takes code - also, can't wait in an init field

spare vector
#

ya fixed that and still won work

winter rose
#
if (isServer) then
// { missing
  waitUntil {triggerActivated moveWorkers};
  {"switchMove",0]; // yeahโ€ฆ?
  worker1 enableAI "ANIM";
// } missing
#

that's your code, without changes

spare vector
#

@winter rose so copy that into the init section and should work ?

winter rose
#

that's your code, without changes

#

so no, I did not apply any "fix" forโ€ฆ you should see your code is weird

spare vector
#

i am a noob so i really have no idea what i am doing lol

fair drum
spare vector
#

well isnt that just the arma community in a nut shell .... Good day sir

fair drum
#

because you can't use waitUntil in the current form you have in an init box

hollow lantern
#

I got a vehicle with two weapons (rockets & explosive machine gun). I now want to have unlimited ammo on the gun but not the rockets, what's the best way to do this?

hollow lantern
#

thanks to pylons I wrote this small EH to suit my needs. ```sqf
this addEventHandler ["Fired",{
params ["_helo"];
_ammo = _helo ammoOnPylon "pylon1";
if (_ammo == 50) then {sleep 0.75};_helo setAmmoOnPylon ["pylon1", 250] && _helo setAmmoOnPylon ["pylon2", 250]
}];

#

so the question is solved. I'm sure there are better ways to do this, but I'm no expert :D

woeful mirage
#

its possible to switch on binocular with scriptcommand? Keybind is "b". but i need a script without keybinds

#

playaction and so on is not permanently. the player switched back in old animation

little raptor
#

You can't sleep in unsch env

_helo setAmmoOnPylon ["pylon1", 250] && _helo setAmmoOnPylon ["pylon2", 250]
wat?

little raptor
woeful mirage
#

@little raptor ah okay^^ thx. switchweapon worked ๐Ÿ™‚

hollow lantern
little raptor
#

the reason you haven't seen the error is because _ammo was never 50 for you

little raptor
hollow lantern
#

it isn't

little raptor
#

do you even know what && is?

little raptor
hollow lantern
#

&& is AND

little raptor
#

so why do you put it there?

hollow lantern
#

because I want the command to run on pylon1 AND pylon2 ?!

little raptor
#

&& is a conditional operator, which returns a boolean. e.g:

alive player && alive _someotherguy
#
_helo setAmmoOnPylon ["pylon1", 250];
_helo setAmmoOnPylon ["pylon2", 250]
#

that's what you should've written

hollow lantern
#

well tbf, the Ammo gets applied and it never gave an error. So I never noticed the issue

little raptor
#

that's because EH code is unschd, and unschd never throws error for undefined variables (usually)

hollow lantern
#

wdym undefined variables? The variable _helo is defined, if anything the error that should return is the issue that I used a conditional operator in the wrong place. Aka type boolean expecting code or how this is called

little raptor
#

Aka type boolean expecting code or how this is called
no error for that either

hollow lantern
#

yes, it returns nothing, does that mean the code after the && just gets threated as null? Then it would kinda explain why there is no error per se, as null && null = null (if that makes sense)

little raptor
#

no

hollow lantern
#

but I changed the code now, thanks

little raptor
hollow lantern
#

ah

little raptor
torn basin
#

if i start a script with execVM in a trigger where "server only" is checked, does the script only get started on the host or on each client?

copper raven
#

host

torn basin
#

@copper raven Awesome! Thank you ๐Ÿ™‚

brazen lagoon
#

This makes no sense to me.

    private _counter = 0;
    while {!(_lead inArea _end_marker)} do {
        hint format ["waiting (%1) for lead (%2) to spawn in marker (%3)", _counter, _lead, _end_marker];
        _counter = _counter + 1;
        sleep 1;
    };

_lead is the player unit (set as z1 in the editor and passed into this function from initServer), _end_marker is "SG_SPAWN_MARKER"

#

I get this in the game

#

it just endlessly waits

#

but if I do z1 inarea "SG_SPAWN_MARKER" it returns true

#

so what gives?

little raptor
brazen lagoon
#

it's placed in the editor

#

doesn't that make it global

little raptor
#

are you testing it in MP?

brazen lagoon
#

editor MP

#

I have changed it to sqf private _counter = 0; while {!(_lead inArea _end_marker)} do { hint format ["waiting (%1) for lead (%2) to spawn in marker (%3) [%4]", _counter, _lead, _end_marker, _lead inarea _end_marker]; _counter = _counter + 1; sleep 1; };

#

to see what the script thinks and I am going insane

little raptor
#

so?

#

what does it give?

#

false?

brazen lagoon
#

yeah

#

but if I do z1 inarea "SG_SPAWN_MARKER" in debug console on server/local (either) it returns true

little raptor
#

well yeah probably either the marker doesn't exist, or z1 is not that z1 meowsweats

brazen lagoon
#

isn't a var without a _ at the start always global?

little raptor
#

so?

#

what does it have to do with that?

brazen lagoon
#

so if the script thinks _lead == z1, wouldn't that necessarily mean z1 executing on the server in the debug console would be the same?

little raptor
#

in your log message add:

z1 == _lead, getMarkerPos _end_marker inArea _endMarker
#

I guess either the first one or the second one is false

brazen lagoon
#

hmm

#

wait wouldn't you want to do getmarkerpos _end_marker inarea "SG_SPAWN_MARKER" for the second?

little raptor
#

no

brazen lagoon
#

cuz how is getmarkerpos _marker inarea _marker ever not going to evaluate to true?

little raptor
#

just try

brazen lagoon
#

sure

#

@little raptor also did you mean for it to be inarea _end_marker because _endMarker isn't defined

little raptor
#

ye meowsweats

brazen lagoon
#

kk

#

ok that's it

#

OK this makes perfect sense

little raptor
#

?

#

but you don't ๐Ÿ˜›

brazen lagoon
#

@little raptor when the player respawns, _lead no longer points to z1

#

because _lead is attached to the unit object

#

so I can just cheat and not use local vars and just use z1

#

i'd prefer to not use globals but at this point I don't care

#

i'll test with just using the z1 global

little raptor
brazen lagoon
#

yeah

#

is there a way to get a variable that's always bound to the 'alive' unit associated with a player?

#

or I guess is there a 'player' object I can attach to?

little raptor
#

player meowsweats

brazen lagoon
#

yeah, that's the only option?

#

I guess I could do something silly like using remoteexec to pass the object back to the server

#

but at that point the global var is probably less awkward/more readable

little raptor
brazen lagoon
#

like each loop iteration, check if the unit is dead. if it is, use remoteexec to get the new alive player unit

little raptor
#

also you shouldn't execute everything on the server meowsweats

brazen lagoon
#

right but this is mission flow

#

so it should be on the server imo

little raptor
#

not really. depends

#

it is best to save the server performance for syncing stuff and performing more crucial tasks

brazen lagoon
#

fair

fleet plaza
#
while {true} do {

   { 
       if (_x == "B_Clouds_Heli_Light_02_unarmed_cloudrider_01_AM") then  
       { 
            _pos = getPos _x;
            deleteVehicle _x;
            _veh = "B_Clouds_Heli_Light_02_unarmed_clouds_01_F" createVehicle position _pos;
            _veh animateSource ["proxy",0]; 
            _veh animatesource ["hideweapons_DL",0];
            _veh addMagazineTurret ["5000Rnd_762x51_Yellow_Belt", [-1]]; 
            _veh addMagazineTurret ["5000Rnd_762x51_Yellow_Belt", [-1]];        
            _veh addWeaponTurret ["M134_minigun",[-1]];
            _veh addMagazineTurret ["PylonRack_12Rnd_PG_missiles", [-1]]; 
            _veh addMagazineTurret ["PylonRack_12Rnd_PG_missiles", [-1]]; 
            _veh addWeaponTurret ["missiles_DAGR",[-1]];
       }; 
    } forEach Vehicles;

sleep 5;

};
#

how to fix this? in game it makes an error

copper raven
#

position _pos you're passing an array here

little raptor
fleet plaza
#

i tried pos = position _x; and _pos = position _x;, doesnt work

fleet plaza
#

sorry but im not good at sqf :/

copper raven
fleet plaza
little raptor
fleet plaza
#
while {true} do {

   { 
       if (typeOf vehicle _x == "B_Clouds_Heli_Light_02_unarmed_cloudrider_01_AM") then  
       { 
            deleteVehicle _x;
            _veh = "B_Clouds_Heli_Light_02_unarmed_clouds_01_F" createVehicle position _x;
            _veh animateSource ["proxy",0]; 
            _veh animatesource ["hideweapons_DL",0];
            _veh addMagazineTurret ["5000Rnd_762x51_Yellow_Belt", [-1]]; 
            _veh addMagazineTurret ["5000Rnd_762x51_Yellow_Belt", [-1]];        
            _veh addWeaponTurret ["M134_minigun",[-1]];
            _veh addMagazineTurret ["PylonRack_12Rnd_PG_missiles", [-1]]; 
            _veh addMagazineTurret ["PylonRack_12Rnd_PG_missiles", [-1]]; 
            _veh addWeaponTurret ["missiles_DAGR",[-1]];
       }; 
    } forEach (vehicles);

sleep 5;

};
little raptor
#

yeah

copper raven
#

typeOf vehicle _x do just typeOf _x

fleet plaza
#

i mean, it works for now, wont touch it so i dont break it lol

little raptor
#

you won't break it by that... meowsweats

fleet plaza
#

ikik, but u never know what im capable of๐Ÿ™ƒ

low sierra
#

When a vehicle is on a slope, on the terrain or in a object, getPos and position functions return a high Z value. I got Z values from 0.25 to 1.68 on different slopes.

#

This is some weird behavior of those functions?

fair drum
#

stop using getPos outside of its [radius, heading] use

#

use any of the other ones

low sierra
#

And what one i can use to get position AGLS?

fair drum
#

there are a bunch of conversion commands. you won't be able to go to AGLS (you can go to AGL), but its better to work with the others anyways. ATL and ASL will work better

low sierra
#

" there are a bunch of conversion commands." None convert to AGLS. But thanks for trying to help ๐Ÿ‘

fair drum
#

what is your end goal?

mental wren
#

question, is there a way to send a message in chat to the logged in admin like for example #monitor does?

still forum
#

remoteExec systemChat

mental wren
copper raven
#

yes

#

well not really

#

that will show it to every client

mental wren
#

yeah I only want to show it to the logged in admin though

#

ok so basically, I just want to send a message only to a certain person. I was thinking logged in admin makes the most sense, but it could also just be a unit with a certain var name

copper raven
#
format ["hello %1", name player] remoteExec ["systemChat", allPlayers select {admin owner _x > 0}];
#

but server only

mental wren
#

oo

copper raven
#

there might be a better way i think though

mental wren
#

hm, it doesn't necessarily need to be systemChat, could use a hint too

copper raven
#

you can make a function on server that hints all admins, and then you can remoteexec that function to the server with the wanted message

mental wren
#

bruh

#

how hard can it be to just send a message to a single unit XD

mental wren
#

if you want to know what we did:

_receiver = missionNamespace getVariable "z6";
_channel = radioChannelCreate [[1, 0, 0, 1], "Curator Chat", "%UNIT_NAME", [_receiver]];

// ...

_channel radioChannelAdd [_x];
_x customChat [_channel, format ["%1 is remote controlling me!", name _owner]];
_channel radioChannelRemove [_x];
devout gazelle
#

What is breaking this script?
I get error at _targetsel

[] spawn {
_ammo = getArtilleryAmmo [gun1] select 0;  
_rounds = 15;   

while {_rounds>0} do {
private _targetsel = SelectRandom [target1,target2,target1]; 
 _tgtdir = round random 360;
_rnda = round random 50;
_rndb = round random 50; 
_rnddist = _rnda + _rndb;
_basedist = 150;
_basedist = _basedist - 25;
_tgtdist = _rnddist + _basedist;
 _tgtpos = _targetsel getRelPos [_tgtdist, _tgtdir];  
 gun1 doArtilleryFire[_tgtpos,_ammo,1];  
 _rounds = _rounds - 1;  
  hint format ["Artillery has %1 rounds left", round _rounds];
Sleep 2;
  hint format ["Round will land %1 meters away from player", round _tgtdist];   
  
 if (_rounds == 0) exitWith 
{ 
Hint "Artillery has no more rounds"; 
};   
 sleep 15; 
}; 
};
still forum
#

target 1 or target2 could be undefined

devout gazelle
#

In what sense?

still forum
#

I don't understand that question

#

undefined is undefined

#

there are no different senses

devout gazelle
#

Right I think i see it now. I need a get position of the markers?

still forum
#

what markers?

#

There is no mention of markers

devout gazelle
#

So I have marker1 and 2 on map. I need to define them as target 1 and 2.
How do I do it?

still forum
#

I guess?

#

but getRelPos needs an object

devout gazelle
#

Ah yeah .. of course ๐Ÿ˜› .. Thanks

night sundial
copper raven
#

oh yeah select

night sundial
#

i totally formatted that wrong, how do i do the inline code thing

copper raven
#

and no, not parenthesis

#

everything else is ok but apply

#

i was thinking one thing but typing another meowsweats ๐Ÿ˜„

gentle dune
#

Hey i am new to all this and i am down to learn allot how do i start this?

fair drum
#

is ace_medical_fnc_adddamagetoUnit local or global? the answer is local argument, global effect

night sundial
#

is there a way to attach music to an object, like say3D? playSound3D doesnt follow the object

fair drum
night sundial
fair drum
night sundial
#

This code is inside an init:

this addEventHandler ["HandleDamage",{_this#2 / 5}];

However it just makes the target invulnerable, unless they take a large amount of damage. They should take 20% damage in this case. Is there a minimum damage value that a unit has to take for it to actually register? If so, does anyone know what that damage value is?

fair drum
#

i'll test it for some numbers in a second, let me finish what I'm doing

fair drum
night sundial
#

yea, i thought the return value changed the damage, not the damage of the hit part

fair drum
#

so do _damage = _damage * 0.2; _damage

night sundial
#

how do you do that inline

#

code

#

that's exactly what i had before

#

i have to do (_unit getHit _selection) + _damage / 5

fair drum
#

that... doesn't seem right... the return value should be the damage that is going to be added to whatever the part it wants to

#

so for instance, when I was testing, I was shooting a guy in the leg for 0.1 damage which stacked. 0.1, 0.1, 0.1, etc until killed

night sundial
#

idk how. _damge = _damage * 0.2 is the same as _damage/5

night sundial
#

This seems to work how i intended

this addEventHandler ["HandleDamage",{
  params ["_unit", "_selection", "_damage"];
  (_damage - (_unit getHit _selection))/5 + (_unit getHit _selection);
}];

little raptor
night sundial
#

yes my code block incorporates that, it works now

little raptor
#

I know. just saying

high vigil
#

Are there issue with attachTo when you attach static weapon to ground marker and then spawn AI on the static ? (im getting the AI glitching like crazy, like they are moving at 1 frame per second)

little raptor
fair drum
#
//Unit is in a vehicle when this fires
units HYP_survivors apply {
    private _pos = teleport_0 call BIS_fnc_randomPosTrigger;
    _pos set [2, 0];
    _x setPosATL _pos;
    _pos
};

interesting issue... so when fired only on the dedicated server, I get correct returns for _pos but the unit is not moved, it stays in vehicle. however, if I fire it locally, I get its intended effect. I get two different values for HYP_survivors:

[bis_o2_9798] - local
[B Alpha 1-1:1 (Hypoxic) REMOTE] - dedicated

not sure what I messed up.

#

I think it has to do with the units being in a vehicle. If I take them out, then the dedicated execution starts working as intended

copper raven
fair drum
#

I swear this used to work fine before... maybe a bug?

copper raven
#

worth to add a note i guess on the wiki thonk

copper raven
fair drum
#

I'd probably verify with Lou or Dedmen first that its intended

copper raven
#

what about other commands?

#

or have you tried it already?

fair drum
#

tried already

#

same issue

copper raven
#

there are many other things that have global arg but don't necessarily produce the same result when executed locally, so i'm not suprised by this one

fair drum
#

I'll wait till Dedmen or Lou responds. If they don't respond today, I'll ping them during the work week. Until then, I guess I'm remoteExec the position function lol.

winter rose
#

noping

proven charm
#

Does anyone know where missionNamespace getVariable ["paramsArray", []] is created?

fair drum
proven charm
proven charm
#

the params code is creating it.... somewhere

winter rose
#

engine-side iirc

#

why do you ask?

proven charm
winter rose
#

and the value doesn't exist then?

proven charm
#

nope

winter rose
proven charm
#

yes its undefined

winter rose
#

then no luck

fair drum
winter rose
copper raven
proven charm
#

exactly

fair drum
#

yeah that's a no go then i think.

#

what are you thinking of doing?

proven charm
#

wanted some load-game stuff in lobby...

winter rose
#

lobbying is bad, mmkay?

proven charm
#

check if the game was saved with the same mod as selected in params

#

(custom save mechanism)

#

well the values exist in the params GUI, maybe fetch them from there if possible

#

no Idea how to do that though

#

๐Ÿ˜„

dreamy kestrel
#

Q: I have some east groups set on patrolling waypoints. they start off well enough.
they start off patrolling the perimeter, I have some 'rings' and coordinates calculated.
they are patrolling a downed heli, I have civilian pilots disarmed and surrendered.
then I in Zeus I heard the patrols engage something, and immediately all of them converged on the wreck site.
any ideas what that might be and how I can keep them patrolling?

dreamy kestrel
winter rose
#

setCaptive should be used locallyโ€ฆ

dreamy kestrel
#

'locally'? like on server?

#

which btw yes part of the surrendered procedure does include that. pending clarification.

#

are they perhaps breaking their waypoints for side relation reasons? I'm not sure...

bitter jewel
spark sun
dreamy kestrel
#

right, as in the server.

#

these are all AI units, patrolling, as are the pilots.

fleet stirrup
dreamy kestrel
#

it's not a locality issue. I am running a self hosted in dev cycle anyway.

#

i.e. client and server are both machine 2. Verified:

_crew = kplib_seares_singleton getvariable ['kplib_seares_crew', []];
_crew apply { captive _x; };
// [true, true]
#

why are the AI training their weapons on the civilian captives?

#

they break their waypoint cycle. that is the issue.

bitter jewel
#

by training do you mean firing?

dreamy kestrel
#

no, trained is trained

winter rose
#

mods?

fleet stirrup
#

What do you believe _crew apply { captive _x; }; does?

#

Though it is showing that the two of them are captive

dreamy kestrel
#

the question on the table is whether the crew are truly captives, so yes, verified, they are

#

however I do not see how that is relevant to them breaking their waypoints

winter rose
#

try vanilla repro

bitter jewel
#

i have had infantry ai groups break waypoints by going into fleeing state

#

but it doesnt sound like they are getting overwhelmed in your case

dreamy kestrel
# winter rose mods?

it's a good question. mostly vanilla, nothing I think that would effect waypoints, instructions, etc, AFAIK.
i.e. CBA, Intercept, CBAStatemachineView, KPRanks, Arma Script Profiler, Personal Arsenal, Enhanced Movement, Advanced Urban Rappelling, Advanced Towing, Advanced Sling Load, DUI Squad Radar, 3den Enhanced

winter rose
#

mostly vanilla
it's a boolean, not a float ๐Ÿ˜„

dreamy kestrel
dreamy kestrel
#

which to me seems like possibly side relations.

little raptor
winter rose
dreamy kestrel
#

setting captive:

if (!captive _unit) then {
    _unit setCaptive true;
};
dreamy kestrel
little raptor
#

what is classname?

dreamy kestrel
#

classes are ["B_helicrew_F","B_Helipilot_F"], however, it is not about the class of the unit, but the SIDE of the group, which is civilian AFAIK.

little raptor
#

such as C_Man_1

dreamy kestrel
#

both side _unit and side group _unit report [CIV, CIV]

little raptor
#

it doesn't matter

#

do what I said

dreamy kestrel
#

why? what is your hypothesis?

little raptor
#

it's not a hypothesis. I've noticed that when you create units that are not on the same side as their group they get buggy

dreamy kestrel
#

that does not explain why the east units and groups are breaking waypoints and training on the civ pilots, though.

little raptor
#

just try meowsweats

bitter jewel
#

they might be two separate problems

little raptor
#

that does not explain
it does explain

#

what did I just say?

#

they get a buggy side

dreamy kestrel
# bitter jewel they might be two separate problems

it could be, but the pilots IMO are not in question. they surrender and they are captive.
it is the east units that are misbehaving, breaking waypoints.
which to me feels like possibly side relations (?).

winter rose
#

okay, go your way

low sierra
#

About setFeatureType: https://community.bistudio.com/wiki/setFeatureType
First i do thatsqf {_x setFeatureType 0;} forEach nearestObjects [_centerMap,["All"],_mapSize,true];them i do that sqf _obj_001 setFeatureType 2; _obj_002 setFeatureType 2; _obj_003 setFeatureType 2; _obj_004 setFeatureType 2; (...) _obj_176 setFeatureType 2;after doing that in 167 buildings i start to get false returned by the function. I'ts not supposed to be 500 buildings?

#

Can anyone help please?

little raptor
low sierra
#

@little raptor Thanks for your answer. I also use Feature Type 2 on AI and vehicles, this can explain the 167 limit. Buildings are dynamic? What are the "500 map/static objects"?

little raptor
#

I think by static objects it means objects that have no animations at all. Like a rock

low sierra
#

Strange, because most of the buildings i'm setting feature 2 are simple objects.

little raptor
#

Simple objects can have animations

low sierra
#

Ah, ok.

little raptor
#

Do your buildings have anims?

#

i.e doors?

low sierra
#

There are a LOT of piers, and they have ladders, but those ladders don't work since the piers are simple objects.

little raptor
low sierra
#

When those piers are created as normal objects the ladders works.

#

But as simple objects the ladders don't work.

little raptor
#

yeah I know I'm still not sure what wiki means by static objects

low sierra
#

May be the engine thinks those piers are dynamic because they have a ladders, even if not working.

#

They are simple objects, not super simple objects.

#

They have classname.

#

I will try to make them super simple.

little raptor
low sierra
#

No

#

It's just to exemplify

little raptor
#

ok good then ๐Ÿ˜…

low sierra
#

I made all 293 piers super simple objects (no config/classname), and tried to set feature to 2 on all of them. It returned true on just 175 of then. Those "true" piers became visible on screen above viewObject distance.

#

On this last test I tried to set feature to 2 a second time, it returned true for all 293 piers... but no additional piers became visible above viewObject distance.
ยฏ_(ใƒ„)_/ยฏ

wide jacinth
#

Iโ€™ve been curious, for that I havenโ€™t ลฟeen anything like itโ€‰:โ€‚Is a ลฟcript that deletes player-placed mines upon that playerโ€™s death poลฟลฟible and feaลฟibleโ€‰?

winter rose
dreamy kestrel
wide jacinth
#

Oh, huh.โ€ƒI wonder why it appears that no one has done that before, then.

dreamy kestrel
night sundial
#

where can i find the important variables stored in the missionnamespace such as BIS_fnc_getRespawnInventories_list ?

odd ridge
#

Anyway to make helicopters crash without losing everyone

leaden haven
tidal marten
#

I'm attempting to add weapons to a tank. But it just adds it to the main gun.

    _this addMagazineTurret ["Laserbatteries",[0]];```
Is there a way I can add weapons to the driver and commander individually?
tidal marten
#

assignedVehicleRole player;
Ah this lets me find out. Never mind.

little raptor
little raptor
little raptor
little raptor
wide jacinth
#

I gueลฟs ลฟo.โ€ƒIf I figure out how to do that, Iโ€™ll poลฟt it here for everyone.

little raptor
#

altho what I said probably won't work with mines placed using ACE interaction menu or something

worldly dirge
#

Hello

wide jacinth
#

I uลฟe ACE and havenโ€™t done anything with the vanilla, but thank you for the directionโ€‰!โ€ƒThatโ€™s helpful to know.

little raptor
#

it was just a guess tho. I don't know how ACE places them

#

and if it doesn't, I think ACE does have event handlers of its own for its interaction menu

wide jacinth
#

Iโ€™ll look into it~

crude vigil
wide jacinth
#

Oh, well thatโ€™s neat.โ€ƒYeah.โ€ƒI find in deathmatch/team-deathmatch ลฟtyle games, you probably donโ€™t want mines juลฟt ลฟitting there after you die, otherwiลฟe youโ€™ll juลฟt end up with mines forever, which is clearly not a good thing.

night sundial
little raptor
#

and no there's no such wiki page

quaint oyster
#

Anyone able to help me with something? I've got a script that's main function is to execute an eventhandler on a vehicle when a player enters it (it has things to stop spam as well), and stop impact damage from getting absorbed, but every other kind of damage can cuck it as normal. That stuff works, but the problem i'm facing is, helicopters don't care whatsoever about any of this, but otherwise it works great on land vehicles. It seems as if the getinman is not the problem, but perhaps the handledamage is my guess.

Anyone got any ideas what I could do to make it work on all vehicle types since helicopters are being stubborn?

player addEventHandler ["GetInMan",{ 
params ["_unit", "_role", "_vehicle", "_turret"]; 
 
//if (driver _vehicle != _unit) exitwith {}; 
if (_vehicle getVariable ["alreadyprotectedunderscripts",0] isEqualTo 0) then {//variable check to stop spam maybe 
_vehicle setVariable ["alreadyprotectedunderscripts",1,true]; 
_vehicle addEventHandler ["HandleDamage", { 
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"]; 
if ( _projectile == "") then { 
    if (_selection isEqualTo "") then {damage _unit} else {_unit getHit _selection}; 
}; 
}]; 
}; 
}]; 
 
 
player addEventHandler ["GetOutMan",{ 
params ["_unit", "_role", "_vehicle", "_turret"]; 
if (count crew _vehicle isequalto 0) then { 
_vehicle removeAllEventHandlers "HandleDamage"; 
_vehicle setVariable ["alreadyprotectedunderscripts",0,true]; 
}; 
}];
winter rose
little raptor
quaint oyster
little raptor
#

helicopters don't care
helicopter damage system is a bit different

little raptor
winter rose
quaint oyster
#

thought you meant my grammar facepalm

winter rose
#

e.gsqf player addEventHandler ["GetOutMan", { params ["_unit", "_role", "_vehicle", "_turret"]; if (count crew _vehicle isequalto 0) then { _vehicle removeAllEventHandlers "HandleDamage"; _vehicle setVariable ["alreadyprotectedunderscripts",0,true]; }; }];

crude vigil
quaint oyster
#

i always end up removing the tabs somehow i read it better on a new line ๐Ÿ˜ฆ

crude vigil
#

only villains do that.

little raptor
quaint oyster
#

My buddy suggested systemchat _projectile to spot the damage types, i see one called "HelicopterExploSmall" and "FuelExplosion", "HelicopterExploBig", could that be the culprits?

little raptor
#

if ( _projectile == "") then {
you only "stop the damage" if _projectile is ""

#

but iirc helicopter damage system doesn't go through the normal handleDamage event all the time

#

so you can't fully stop helis from taking damage

quaint oyster
#

Gonna give this a swing in the if statement

(_projectile == "") || (_projectile == "HelicopterExploSmall") ||  (_projectile == "FuelExplosion") ||  (_projectile == "HelicopterExploBig")
little raptor
quaint oyster
#

giving it all a whirl when the game wants to comply with me lol

#

its still registering "FuelExplosion" as a source of damage sadly

quaint oyster
proven charm
#

I'm working on a lobby mod and wanted to ask if it's possible to send variable to server from the admin/client somehow at mission start?

proven charm
winter rose
#

most likely, perhaps

try the usual ways; if they do not work, there are no unusual ways

#

unless maybe using UI through the mod

proven charm
#

ok thx will try

quaint oyster
winter rose
proven charm
#

I want admin to be able to send variable to server in lobby

winter rose
#

setVariable it is then

proven charm
winter rose
#

wherever you want to read it

#

it can be a namespace too

proven charm
#

hmm

winter rose
#
missionNamespace setVariable ["GC8_MyAdminValue", 42, 2]; // sends to the server only - other machines don't know about it
proven charm
#

cool will see if I get that to work ๐Ÿ™‚

#

Didn't get that to work, I think the server is not ready in lobby to receive the variable

#

tried: ```
missionNamespace setVariable ["adminVarTest", true, true];

#

in lobby

#

in initServer.sqf ```
diag_log format [">>> adminVarTest >>> %1 ", missionNamespace getVariable ["adminVarTest", false] ];

#

which prints false

quaint oyster
#
missionNamespace getVariable ["adminVarTest", 0]```
maybe
winter rose
winter rose
#

initServer.sqf

missionNamespace setVariable ["GC8_testVar", 0];
sleep 1; // wait until mission starts
[str GC8_testVar] remoteExec ["systemChat"];

initPlayerLocal.sqf

missionNamespace setVariable ["GC8_testVar", 42, 2];
#

this way:

  • server inits the var to 0
  • client connects, sets the var to 42 server-side
  • game starts
  • server sends the value to everyone
#

@proven charm

proven charm
#

yea I was trying to send the var to server from lobby (before game start) which probably doesn't work

proven charm
winter rose
#

you tried to diag_log it before the game started and before a client joined I believe

proven charm
#

yea

#

think I got it working but server needs to wait for the admin/client to send the var before proceeding

winter rose
#

now that's another story; what if you never have an admin, the game should never start?

proven charm
quaint oyster
#

are you trying to see if a player is an admin?

winter rose
proven charm
quaint oyster
#

is the goal to see if the player is one though? or am i not following right?

#

i can show you how i make players admin on mine if you want

#

then that player gets specific rights over others that others do not

proven charm
#

from lobby...

quaint oyster
#

ahh yeah i got nothing for that then

#

pre-game stuff ain't my forte

proven charm
#

np

#

btw how do you check if the mission is already running?

#

_didJIP?

little raptor
#

I think thonk

proven charm
proven charm
stray flame
#

Heya, I wanted to know what way one would make triggers dormant until another trigger is activated?

#

I want a trigger that activates when a unit isnt inside of an area but i want it to be dormant until a sustain point

#

So that it dosent activate at the start of the mission

willow hound
stray flame
#

Also

#

how do I set a trigger's owner to be a group but only the members who are actually on a server

#

so that "all members" dosent include members who arent there/ player slots that arent ocupied

low sierra
#

@little raptor @winter rose @leaden haven thanks for the help. Indeed, if i don't use setFeatureType 2 on AI and vehicles i can use it exactily in 200 of the buildings i created. So buildings are Dynamic. Buildings AI and Vehicles all share the same 200. Some objects you place on map already comes with setFeatureType 2, and they will count as part of the 200 ones. I'm not sure if fixed buildings of the map with setFeatureType 2 also count as the 200 ones. **I wish we can have more than 200 ๐Ÿ˜… **. Sorry for the long text.

winter rose
#

after re-reading your text, I believe you say so yes

low sierra
#

Yes.

#

They are created by script.

winter rose
#

yes I believe terrain objects can go up to 500, as the wiki page says

low sierra
#

Yes.

#

I'm trying to make player bases visible above viewObjectDistance. All objects was placed by players.

winter rose
#

what you could do is regularly change which item is setFeatured or not; it would imply some framework but you could do this

low sierra
#

Yes, i did.

#

But some bases have more than 1000 objects.

#

I'm using feature 2 only on the big ones.

#

sizeOf > 45 meters

#

Only piers count as 293 in one base.

#

They have 56 meters of sizeOf.

winter rose
#

yeah so that's a no-go ๐Ÿ˜‰

low sierra
#

If the limit was 500... but 200 meowsweats

winter rose
#

I wonder why it was set to these (low) limitsโ€ฆ fear of MP abuse, engine stress, other?

low sierra
#

engine stress

#

because you get a performance message on RPT if you try to go over 200

winter rose
#

Dedmen, fix this!

low sierra
#

I believe i was not supposed to "Feature" a entire base ๐Ÿ˜ฌ

winter rose
#

yeah, I think it is "in the idea" more about having landmarks or "always visible target vehicle" for example than to display an entire city/base 2km away ^^

low sierra
#

๐Ÿ‘

low sierra
winter rose
#

now you know what to do

low sierra
#

lol

winter rose
#

one mod of one big base object ๐Ÿ˜„