#arma3_scripting
1 messages ยท Page 722 of 1
interesting, preprocessing any file called "description.ext" doesn't crash the game on bad include, but it does for other files ๐ 
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
Can live with it it was just missing that from the wiki so figured ill add it but i could not ๐
#community_wiki welcomes you
Quick ?, is there anyway via script function to determine who in the aircraft, pilot or copilot has control of the helicopter
private _copilotHasControl = _vehicle turretUnit [0] isEqualTo currentPilot _vehicle
thank
"currentPilot" is weird to me. Throws NullObj at my face when I'm copilot that took control.
wat vehicle?
Helicopter. RHS MH-6M to be precise.
Correct, and http would never work :U
I might add domain support in 2.08 if I don't forget
uh i just started reading it and it's gone @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?
no
Iirc "exitWith" leaves current scope so it will leave that loop once the condition happens.
it exits the whole block doesn't it, not just that iteration
lets say I use a then/else
Maybe. Depends on the condition and what you run in the "more code".
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
not what was asked tho
was meant for this, and yes, seems like I didn't read to closely ๐
Just use a while-loop 
How can I disable the red target square thingies to appear in a SP scenario?
difficulty settings
not for myself, but for the scenario
so that anyone playing it, wont have them appear every now and then
so, i should make a server.cfg and all that fancy stuff?
and that'll work even tho the scenario is not MP?
you aren't supposed to make it
the guy hosting the server is
difficulty settings are not mission related
well where and how do i disable it 
well if you're playing in singleplayer, you'd just go into the game settings and edit it there
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
you can't
make the target captive?
But they wont be attacked 
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
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
contact the mod creator
its not an specific mod bug, happens with all mods
I was trying to find that channel!!! was even dubble checking!
We have continue/break script commands now that better do what you expect
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
did you even define _caller?
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
Ahh yes Iโm correct
no you're not
โLocalโ aka โprivateโ variables have underscored
local != private
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.
actions have a condition
I'm very unskilled in the world of scripting
I believe he is talking about door actions of buildings, not related to addAction.
No, I was referring to an addaction on some external console
It'll open a door as part of a custom composition
an actual item? or "virtual" item?
It'll be an RFID keycard from one of several mods installed.
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
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
so the console's init field would look like this?
this addAction
[
"Open Armoury Doors", // title
{
armouryDoor animate ["Door_1_rot", 0]; // script
},
nil, // arguments
1.5, // priority
true, // showWindow
true, // hideOnUse
"", // shortcut
"'className' in uniqueUnitItems _this", // condition
3, // radius
false, // unconscious
"", // selection
"" // memoryPoint
];
Do you use a command of the setMarker*-kind with the markers in question?
"J_Mark" setMarkerPos [4928.26,10808.8]
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.
better use arguments than armouryDoor
in case someone wants to make more than 1 instance of your composition
I assume the only issue with that solution would be late JIP
Or players that join after marker is moved
May I interest you in some https://community.bistudio.com/wiki/Arma_3:_Remote_Execution
So remote execute would fix that?
The JIP queue can be used to fix that, yes.
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?
That was just a placeholder variable name
What does the trigger do right now? How is it set up?
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
And what does it do?
The first trigger sets a map marker placement
Like this
It moves a marker from a corner outside of the map to a place
So the action of
hold action -> setpos -> talkTrig = true -> setmarkerpos
Triggers are a delicate matter, but the suspected locality issues aside, why not do setPos and setMarkerPos directly in the hold action?
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
Well it is ...
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
How do you create your hold action?
And what specifically did not work when the server host was not the one completing the action?
well
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];
["J_Mark", [4928.26,10808.8]] remoteExec ["setMarkerPosLocal", 0, true];
``` but why not use setMarkerPos instead?
this
oh okay
Now I just need to figure out how to disable side and global chat
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
When testing keep in mind that global chat is always available to admins (and you are usually an admin when testing).
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
Apex respawn is using the one with menu (MenuPosition)
simple respawn on group members is respawn = 4
https://community.bistudio.com/wiki/Arma_3:_Respawn#Respawn_Types
Dose that work even if there is no AI?
It should, guessing from the description.
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?
enableChannel is a command, and those do not belong in description.ext.
In the case of enableChannel it would make sense to place it in an init script.
sure
After testing it seems to not work
It seems tailored for AI squad mates
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
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
How can I make players invincible after respawning for a short period of time?
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");};
_units is a group, and you're passing that to setUnitLoadout when on wiki its clearly stated that it takes an object
But what is the object name?
returned by https://community.bistudio.com/wiki/createUnit
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?
So the object name is object? I honestly don't understand any of this. I would be really grateful if you could just tell me the solution instead of linking wiki articles I don't understand
no, createUnit returns the created object, just like 5+5 returns the sum and you can store the return value to a variable, e.g _sum = 5 + 5;
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.
since you posted this in scripting https://cbateam.github.io/CBA_A3/docs/files/xeh/fnc_addClassEventHandler-sqf.html#CBA_fnc_addClassEventHandler that?
if that's not what you're looking for, i suppose you can find an answer here: https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new) specifically Extended_Init_EventHandlers
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?
I'm looking to ideally do this from config
then see that link
#arma3_audio message
This is the way.
i'll have a look, thx
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;
};
}
];
locality. the setParticleXXX commands have local effect. try to use remoteExec
how can i make a custom command/radio message/whatever its called
you know, the one that goes 0 -> 9 (Custom)
is that what you mean @meager epoch
maybe 
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
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?
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
right
so you want to send out a thing in system chat or you want a player to say something?
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 
cant find it on the biki D:
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 
btw, i need it to be under Custom, not Support
i agree
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
No, it's doable via scripting as well
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?
There was a doc. I think it was on bissimulations wiki
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)
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
isn't there an "any player" activation type for triggers?
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
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.
tag_myGroup = <group>? not sure i understand
you assign like any other variable
@copper raven Did the trick. It's always the basics that I'll forget. Appreciate it, man.
Still dosent seem to work, generic error
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)
Hello, at the time I used this https://community.bistudio.com/wiki/All_Arma_Commands_Pages to look for commands, but it seems that the page has been moved somewhere else, do you have a link please ?
thanks ๐
how dare you ninja me 
I added a redirection ๐
awesome ๐
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
Error in expression <_x}; private _inArea = _alivePlayers count {vehicle _x inArea _this}; _inA>
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
well this is straight out of the RPT
did you check your RPT?
11:55:54 Error Generic error in expression
11:55:55 Error in expression <_x};
private _inArea = _alivePlayers count {vehicle _x inArea _this};
_inA>
thats everything? no more info below that?
what is in _alivePlayers? maybe it has a nil inside it?
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>
11:56:08 Error count: Type Array, expected code
count doesn't take code on the right side
the condition goes on the left
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) }
If you run profiling branch and run the game with -debug paramter.
It will tell you the coordinates of the trigger in RPT
I mean I have Eden enhanced on if that helps
no ๐
Looks like my guess was correct
I found the source and it was the listed above code used in the condition of a trigger
https://community.bistudio.com/wiki/count
code count array
So just use something like allPlayers inAreaArray myLocation;
yes but you need to still filter alive ones, atleast you were in your previous code
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
select {alive _x}
How to get current weapon loaded magazine?
private _a, _b;
if (bla) then {
_a = 3;
_b = 4;
else {
_a = 2;
_b = 1;
}
is this okay ?
Thank you, I'm sorry, I put it wrong.
I need to get the currently loaded magazine from primaryWeapon and secondaryWeapon
That's what i need! Thanks!
what is _player ?
the player object ?
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
No
do I need to do private [_a, _b, _c]... ?
for multiple var declaration with no values
I remember someone told be that private [] is very lazy
I guess wiki already explains it
It should be an array of strings
alright ty
lazy?
uh, I meant slow
private _a = 2
private _b = 1;
if (bla) then {
_a = 3;
_b = 4;
}
?
yup I did that tho
thanks
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.
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
if (hasInterface) addEventHandler perhaps ๐
not what I meant
also, I see that you are using this
so I guess these are init fields we are talking about, riiight?
yes
so everytime you hit a unit, it spawns some smoke
sparks
make a CfgFunctions function (instead of elect_fnc = )
then you can remoteExec your HECKS_fnc_electricSpark flawlessly
wouldn't that require access to the files?
โฆif your script is server-side, how do you expect the client to know it
Hey, how can I place ammo on the floor in eden editor?
What script could help me do that
Well because that's up to you. There's no "BIS_fnc_addJumpScare" function 
I know would be nice if that was added xD
remoteExecing the addEventhandler might be smarter
why? here it is called locally, without bothering the JIP queue
who knows when the message from the server reaches the client
i was gonna say that fixes locality only, but then it's ran in the init field, so no
I would say just run the Hit EH locally on every machine, and don't remoteExec the effect
but it will execute only where the unit is local, no?
not afaik
oh wait, https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Hit
local argument indeed.
use HitPart or addMPEventHandler or Dammaged or whatever :D
hitpart won't work either, mphit will probably be the best
Anyone got any ideas? Been lookin around for a while but nothing found
I don't think there's any natural way to do it in eden. (maybe Eden Enhanced has one?)
Im using eden enhanced
I just want some script to spawn ammo on the ground
I know wasteland has managed that
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
to do that you have to create a weapon holder first, then fill it with ammo
well placing a pre-existing one makes it invisible apon being edited
wat?
what I mean is:
_wh = createVehicle ["WeaponHolderSimulated", _pos];
_wh addMagazineCargoGlobal ["mag_class", _cnt];
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
Temp object?
yeah. it gets deleted and you get a mag instead
ho ok
no
- _cnt
What should _cnt be replaced with?
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
works for me:
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
when you place the mags using the inventory on the ground are they visible?
yep
then you're doing something wrong
I can pick up the same mag I placed and palce it myself and works fine
what is the current code you're running?
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
that's weird 
only the mag part
HM
that's weird. I see them now:
yeah
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
theyre probably upside down
maybe the way I interoperated that was just silly but
no they're just below the ground 
flipping it dosent seem to do much
when I move the wh higher I see them
How may I do this?
you have to use a different wh type
the original one I posted
without _scritpted
so change _wh to a number?
wat
nvm lol
@stray flame try a non-simulated weapon holder:
_wp = createVehicle ["GroundWeaponHolder", ASLtoAGL getPosASL player, [], 0, "CAN_COLLIDE"];
Will do
the rest of the script is as before
soo
if (!isServer) exitWith {};
_wp = createVehicle ["GroundWeaponHolder", ASLtoAGL getPosASL player, [], 0, "CAN_COLLIDE"];
_wh addMagazineCargoGlobal ["OPTRE_32Rnd_762x51_Mag", 5];
deleteVehicle this;
Shouldnt it be _wh twice instead of
_wp
and
_wh?
aaand
it works
Thank
ok weird
this time
they automatically spawn under my feet
When I spawn 5m away
ho
replace it back with this
Current: if (!isServer) exitWith {}; _wh = createVehicle ["GroundWeaponHolder", ASLtoAGL getPosASL player, [], 0, "CAN_COLLIDE"]; _wh addMagazineCargoGlobal ["OPTRE_32Rnd_762x51_Mag", 5]; deleteVehicle this;
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
_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?
why are triggers bad? Do they take a lot of processing?
i dont think its possible in battleye server, because createVehicle is a blackListed remoteExec command, and particles are local to the client they are spawned on
Question
What is the cleanest way to exit an iteration for a forEach loop?
I've learned it's not exitWith
break
Awesome, thanks
if you're in the loop scope exitWith works too
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
so what's wrong?
Only executes it for the first one
Or not at all
I can send you the script if you'd like
ok
continue sounds like what you are looking for. Or continueWith depending on your setup.
Hu
I think just putting it in initServer.sqf will suffice, because according to the wiki it's still synced
Thanks a ton, worked perfect!
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.
it doesn't work anymore since PiP was changed.
if you mean KK's, it works just fine. You're just doing it wrong.
Hey, is there any way to manually change a player's FOV using scripts?
And/or zoom out the camera?
https://community.bistudio.com/wiki/lockCameraTo hope this helps. As for displaying camera on a screen, look for uavturret in the config of the vehicle you are using. Should be along the lines of "PIP0_turret". Search Procedural textures for help on displaying.
https://community.bistudio.com/wiki/setCameraEffect this maybe? I don't believe there is a way to get an instance of a player's camera
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;
};
};
if i wish to create an addaction for the player only. eg other player cannot see, i assume i put radius at 0?
that, or you execute addAction only where it is needed
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
Addaction only gives the action to the client it is executed on. If you addAction to a player on THAT players client, no one else will see that action. For example: if I run addAction on an ammobox for Arsenal, Iโm the only one that will see that action
what can i use as a equivalent of "iskindof" but for the assignedvehiclerole
what
if i use assignedvehiclerole player, it return the seat i am using
so far, so good
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
private _vehicleRoleArray = assignedVehicleRole player;
private _vehicleRole = _vehicleRoleArray select 0;
if (_vehicleRole == "cargo") then { /* ... */ };
@digital torrent
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";
what's the error? I bet its cause you might not be executing this in scheduled space
you have a miss matched { and ]
of course it doesโฆ then takes code - also, can't wait in an init field
ya fixed that and still won work
if (isServer) then
// { missing
waitUntil {triggerActivated moveWorkers};
{"switchMove",0]; // yeahโฆ?
worker1 enableAI "ANIM";
// } missing
that's your code, without changes
@winter rose so copy that into the init section and should work ?
that's your code, without changes
so no, I did not apply any "fix" forโฆ you should see your code is weird
i am a noob so i really have no idea what i am doing lol
start by reading
#arma3_scripting message
we won't get far tonight before you have a basic understanding
well isnt that just the arma community in a nut shell .... Good day sir
Lou showed you what was wrong. You are missing some { } and the switch move command you have is incorrect as well
you also need to read about the scheduled environment
https://community.bistudio.com/wiki/Scheduler
because you can't use waitUntil in the current form you have in an init box
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?
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
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
What you wrote should throw you an error
You can't sleep in unsch env
_helo setAmmoOnPylon ["pylon1", 250] && _helo setAmmoOnPylon ["pylon2", 250]
wat?
selectWeapon or switchWeapon action
@little raptor ah okay^^ thx. switchweapon worked ๐
it does not (init of vehicle). But I guess the init is scheduled anyway?
init is scheduled anyway
it's not. and your code is not running in init. it's running inside the EH
the reason you haven't seen the error is because _ammo was never 50 for you
_helo setAmmoOnPylon ["pylon1", 250] && _helo setAmmoOnPylon ["pylon2", 250]
and this is pure nonsense.
it isn't
do you even know what && is?
it is
&& is AND
so why do you put it there?
because I want the command to run on pylon1 AND pylon2 ?!
&& 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
well tbf, the Ammo gets applied and it never gave an error. So I never noticed the issue
that's because EH code is unschd, and unschd never throws error for undefined variables (usually)
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
Aka type boolean expecting code or how this is called
no error for that either
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)
no
but I changed the code now, thanks
no error per se
the reason the code seemed to work was because&&has a lower precedence that other binary commands, so the other two commands (setAmmoOnPylon) ran first
ah
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?
host
@copper raven Awesome! Thank you ๐
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?
is the marker local to where the code runs?
are you testing it in MP?
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
yeah
but if I do z1 inarea "SG_SPAWN_MARKER" in debug console on server/local (either) it returns true
well yeah probably either the marker doesn't exist, or z1 is not that z1 
isn't a var without a _ at the start always global?
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?
in your log message add:
z1 == _lead, getMarkerPos _end_marker inArea _endMarker
I guess either the first one or the second one is false
hmm
wait wouldn't you want to do getmarkerpos _end_marker inarea "SG_SPAWN_MARKER" for the second?
no
cuz how is getmarkerpos _marker inarea _marker ever not going to evaluate to true?
just try
sure
@little raptor also did you mean for it to be inarea _end_marker because _endMarker isn't defined
ye 
@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
in that case you should (unless you want to restart your script)
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?
player 
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
how does this solve your problem?! 
like each loop iteration, check if the unit is dead. if it is, use remoteexec to get the new alive player unit
also you shouldn't execute everything on the server 
not really. depends
it is best to save the server performance for syncing stuff and performing more crucial tasks
fair
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
if (_x == "B_Clouds_Heli_Light_02_unarmed_cloudrider_01_AM") then
also wrong
i tried pos = position _x; and _pos = position _x;, doesnt work
yup, theres where is calling an error
sorry but im not good at sqf :/
how to fix it?
as simple as that, thanks, got it working, have a nice rest of the day
_pos = getPos _x;
deleteVehicle _x;
_veh = "B_Clouds_Heli_Light_02_unarmed_clouds_01_F" createVehicle position _pos;
did you fix this too?
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;
};
i think so
yeah
typeOf vehicle _x do just typeOf _x
i mean, it works for now, wont touch it so i dont break it lol
you won't break it by that... 
ikik, but u never know what im capable of๐
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?
And what one i can use to get position AGLS?
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
" there are a bunch of conversion commands." None convert to AGLS. But thanks for trying to help ๐
what is your end goal?
question, is there a way to send a message in chat to the logged in admin like for example #monitor does?
remoteExec systemChat
so like this?
format ["hello %1", name player] remoteExec ["systemChat"];
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
format ["hello %1", name player] remoteExec ["systemChat", allPlayers select {admin owner _x > 0}];
but server only
oo
there might be a better way i think though
hm, it doesn't necessarily need to be systemChat, could use a hint too
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
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];
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;
};
};
target 1 or target2 could be undefined
In what sense?
I don't understand that question
undefined is undefined
there are no different senses
Right I think i see it now. I need a get position of the markers?
So I have marker1 and 2 on map. I need to define them as target 1 and 2.
How do I do it?
Ah yeah .. of course ๐ .. Thanks
i dont think that works. Instead of apply you'd want select, and then parenthesis instead of {}. The code you have would return an array of true or false to remoteExec
oh yeah select
i totally formatted that wrong, how do i do the inline code thing
and no, not parenthesis
everything else is ok but apply
i was thinking one thing but typing another
๐
Hey i am new to all this and i am down to learn allot how do i start this?
is the answer is local argument, global effectace_medical_fnc_adddamagetoUnit local or global?
is there a way to attach music to an object, like say3D? playSound3D doesnt follow the object
define it in cfgSounds instead then
not possible, want to do it in pub zeus
eeeek, then no. you are limited to playMusic if its a Arma 3 music defined in CfgMusic
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?
i'll test it for some numbers in a second, let me finish what I'm doing
what values are you getting for the return? do a quick systemChat str _damage after you modify the _damage. I'm getting some decent values
i think i figured it out. The return value of the eventhandler OVERWRITES the damage on the hit part. So i'm overwriting damage instead of adding 20% of the damage
yea, i thought the return value changed the damage, not the damage of the hit part
so do _damage = _damage * 0.2; _damage
how do you do that inline
code
that's exactly what i had before
i have to do (_unit getHit _selection) + _damage / 5
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
idk how. _damge = _damage * 0.2 is the same as _damage/5
This seems to work how i intended
this addEventHandler ["HandleDamage",{
params ["_unit", "_selection", "_damage"];
(_damage - (_unit getHit _selection))/5 + (_unit getHit _selection);
}];
_damage is the resulting (final) damage, not damage to be added
yes my code block incorporates that, it works now
I know. just saying
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)
static objects have a lower update frequency, so yes
//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
just for testing purposes, what if you remoteExec the setPosATL? (i know it doesn't make sense, just curious)
remoteExec the command functions as intended.
its a problem between a remote unit being in a vehicle and any of setPos/ATL/ASL commands
I swear this used to work fine before... maybe a bug?
worth to add a note i guess on the wiki 
dunno, never tried it, so can't tell
I'd probably verify with Lou or Dedmen first that its intended
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
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.
noping
Does anyone know where missionNamespace getVariable ["paramsArray", []] is created?
you just created it if it was undefined before
im guessing https://community.bistudio.com/wiki/BIS_fnc_initParams not at pc to confirm though
tried that but it didn't create the array
create how?
the params code is creating it.... somewhere
would like to get those parameter values while still in lobby
and the value doesn't exist then?
nope
have you tried perhaps BIS_fnc_getParamValue?
https://community.bistudio.com/wiki/BIS_fnc_getParamValue
yes its undefined
then no luck
if you have your .hpp file that has your params in it, you can use missionConfigFile and go directly to your user defined array of values
I believe he wants to know which option has been selected
seems like it yeah
exactly
wanted some load-game stuff in lobby...
lobbying is bad, mmkay?
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
๐
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?
apparently the majority of the units guns trained on the surrendered pilots.
setCaptive should be used locallyโฆ
'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...
you need to find out which machine the unit is local to and run that_unit setCaptive status on that machine
remoteExecCall support object as target so it should not be really hard
I would recommend looking at these links, they helped me when I was learning how to safely script for a MP environment
https://community.bistudio.com/wiki/Multiplayer_Scripting#Locality
http://killzonekid.com/arma-scripting-tutorials-locality/
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.
by training do you mean firing?
no, trained is trained
mods?
What do you believe _crew apply { captive _x; }; does?
Though it is showing that the two of them are captive
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
try vanilla repro
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
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
mostly vanilla
it's a boolean, not a float ๐
the curve is approaching zero, AFAIK; if there is anything suspicious there, please educate me. lol
right, correct. no the dynamic in this case is I have east units patrolling, of effectively civilian created units in surrendered captives.
which to me seems like possibly side relations.
how did you create those "civilians"?
I don't know nor do I keep track of mods and their effect;
1/ you didn't try vanilla
2/ you didn't show us how they are made captive
so it could be anything really
setting captive:
if (!captive _unit) then {
_unit setCaptive true;
};
as far as creating the civilians:
_grpTemp createUnit [_className, _spawnPos, [], 10, _special];
The temp group is civilian, but we join the unit to a given _grp which is also civilian.
what is classname?
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.
try a civilian class name
such as C_Man_1
both side _unit and side group _unit report [CIV, CIV]
why? what is your hypothesis?
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
that does not explain why the east units and groups are breaking waypoints and training on the civ pilots, though.
just try 
they might be two separate problems
that does not explain
it does explain
what did I just say?
they get a buggy side
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 (?).
okay, go your way
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?
Buildings are dynamic 
So should be 200
@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"?
I think by static objects it means objects that have no animations at all. Like a rock
Strange, because most of the buildings i'm setting feature 2 are simple objects.
Simple objects can have animations
Ah, ok.
There are a LOT of piers, and they have ladders, but those ladders don't work since the piers are simple objects.

When those piers are created as normal objects the ladders works.
But as simple objects the ladders don't work.
yeah I know I'm still not sure what wiki means by static objects
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.
btw I hope you're not actually writing 500 lines of code like this 
ok good then ๐
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.
ยฏ_(ใ)_/ยฏ
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โ?
I believe "map objects" = pre-baked buildings, and "dynamic" = anything else
buggy does not tell me much. that's like the floating point curve, approaching zero but not quite.
maybe there is a better waypoint instruction I can tell the east units than 'move' and in a cycle.
yes absolutely
Oh, huh.โI wonder why it appears that no one has done that before, then.
actually, the clue then is maybe the pilots go in east side as well, even though technically they are 'surrendered'. that would not be the worst thing if it side steps the behavior.
where can i find the important variables stored in the missionnamespace such as BIS_fnc_getRespawnInventories_list ?
Anyway to make helicopters crash without losing everyone
Use this.
[this,true] call BIS_fnc_replaceWithSimpleObject;
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?
assignedVehicleRole player;
Ah this lets me find out. Never mind.
use the correct turret index instead of [0]
you can try handleDamage event handler
allVariables missionNamespace?
maybe they didn't feel the need to? or maybe they just didn't want to share 
I gueลฟs ลฟo.โIf I figure out how to do that, Iโll poลฟt it here for everyone.
it's not that difficult. I think you can use a FiredMan event handler to know when a player places a mine and save it as a variable in player's var space (using setVariable), and then use a Killed or MPKilled event handler to delete them.
altho what I said probably won't work with mines placed using ACE interaction menu or something
Hello
I uลฟe ACE and havenโt done anything with the vanilla, but thank you for the directionโ!โThatโs helpful to know.
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
Iโll look into it~
@wide jacinth You might as well remove fired EH need from that.
https://community.bistudio.com/wiki/getAllOwnedMines (Assuming this returns explosives as well ofc)
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.
i meant maybe a wiki page where it shows the use of all those variables
they're mostly used by modules and stuff
and no there's no such wiki page
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];
};
}];
ever heard ofโฆ indentation?
removeAllEventHandlers
don't do that
tried to give as much info as possible to avoid questions
helicopters don't care
helicopter damage system is a bit different
do you even know what indentation means? 
indentation is the fact of tabbing your code to the right - not splitting your code
thought you meant my grammar facepalm
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]; }; }];
well yeah, the grammar in ur code it is, you can say.
i always end up removing the tabs somehow i read it better on a new line ๐ฆ
only villains do that.
really? line 7. is that in a bracket or not? 
My buddy suggested systemchat _projectile to spot the damage types, i see one called "HelicopterExploSmall" and "FuelExplosion", "HelicopterExploBig", could that be the culprits?
well yeah
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
Gonna give this a swing in the if statement
(_projectile == "") || (_projectile == "HelicopterExploSmall") || (_projectile == "FuelExplosion") || (_projectile == "HelicopterExploBig")
_projectile in ["", "HelicopterExploSmall", ...]
```๐
giving it all a whirl when the game wants to comply with me lol
its still registering "FuelExplosion" as a source of damage sadly
hope this ain't the case ๐ฆ
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?
remoteExec? setVariable?
does remoteExec work while still in lobby?
most likely, perhaps
try the usual ways; if they do not work, there are no unusual ways
unless maybe using UI through the mod
ok thx will try
do you mean like set a variable on a player when you start the game and make the server recognize it?
If so I had issues and my issue was setvariables third element..
this setvariable ["variablename",value,true];
I want admin to be able to send variable to server in lobby
setVariable it is then
to which object?
hmm
missionNamespace setVariable ["GC8_MyAdminValue", 42, 2]; // sends to the server only - other machines don't know about it
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
missionNamespace getVariable ["adminVarTest", 0]```
maybe
the server inits before anything else; if you check the variable before any client set it, it won't exist
shouldn't matter
better check that in a loop
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
yea I was trying to send the var to server from lobby (before game start) which probably doesn't work
keeps looping false...
you tried to diag_log it before the game started and before a client joined I believe
yea
think I got it working but server needs to wait for the admin/client to send the var before proceeding
now that's another story; what if you never have an admin, the game should never start?
exactly my next question ๐
are you trying to see if a player is an admin?
that is a design questionโฆ which lies on your side ๐
not yet.. but at some point need to do that too
ok ๐
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
goal is to allow admin set some startup settings
from lobby...
findDisplay 46
I think 
why not Mission Settings?
see https://community.bistudio.com/wiki/Mission_Parameters @proven charm
that's what I use. But I wanted to modify the lobby so that you can set some settings by a button click
ok.. hope that works
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
Use https://community.bistudio.com/wiki/triggerActivated in the condition.
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
@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.
So buildings are Dynamic.
are these buildings created with scripting commands?
after re-reading your text, I believe you say so yes
yes I believe terrain objects can go up to 500, as the wiki page says
Yes.
I'm trying to make player bases visible above viewObjectDistance. All objects was placed by players.
what you could do is regularly change which item is setFeatured or not; it would imply some framework but you could do this
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.
yeah so that's a no-go ๐
If the limit was 500... but 200 
I wonder why it was set to these (low) limitsโฆ fear of MP abuse, engine stress, other?
Dedmen, fix this!
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 ^^
๐
Only if this base was... a single object.
now you know what to do
lol
one mod of one big base object ๐
