#arma3_scripting
1 messages ยท Page 80 of 1
Any vanilla scripted damage handling?
Judging by the one Note on https://community.bistudio.com/wiki/damage there isn't exactly a correlation between component Damage and actual Damage, that is if we take it as gospel.
Does it do setDamage/setHit on the units involved?
Did you check dammage?
anecdotally anyhow... thanks...
Your issue as described was that death messages don't display the killer, right? Not that they completely fail to appear
Just refreshing my memory
It doesn't exist on the wiki from what I can see, must have been removed at some point
Well, it kinda smells like something is causing the killer to be lost. Nullifying the "real" damage and applying new damage with setDamage would do it, since there's no killer to attribute it to. Creating new bullets and not setting their shotParents would also do it...but are you really doing that for every enemy?
getDammage
but still
they are effectively one in the same, damage and getDammage are literally Aliases
if you're just doing setDamage 0 that's not what's doing it
If the setDamage is the cause of death then that's what's doing it
Except
Do not use this command. Use setDamage instead!
Why would i not use this command, who is gonna stop me?
I'm not setting any damage, only the hit points at the moment... but that is the question, shouldn't damage approximate the other? if not take the average of major components?
setDamage has no source, it's purely scripted and cannot be attributed to any unit. So the killer is null if someone dies because of setDamage.
You can test it.
because it's old and not getting maintained likely
seems to me its just an alias
partially true, notwithstanding the alternate syntax, but yes
And i will setDammage and getDammage as much as i damn please
getDammage doesn't say to not use it though ๐ only setDammage
LOL nope you used one have to use the other...
I shalt track you, I shalt find youโฆ and I shalt pout so you feel bad about it
Oh, I missed they added that to the alt syntax
@granite haven If you still want to have setDamage involved in your system, you can use the alt syntax to specify a killer that the damage will be attributed to. Note that if you do this, you must execute setDamage on the server.
I will setDammage upon you
yes, because the getter is straightforward, the setter has alt syntaxes (and basically setDammage is not maintained)
please do not dammage the Lou, we need him
Yeah wiki would be more dammaged without him
Just like I said earlier then because it's old and not getting maintained likely
yep, you are correct
so no insights approximating damage based on hit points
I guess you could calculate it. I know wheels have minimal effect
Average it across all components? or maybe average only ones you deem Major, like Engine, Fuel, Hull, etc
I mean it seems appropriate to average at least major components
I planted a script that adds one more m every week I don't log in ๐
The pure dammmage you have caused us
To all funcs? Like vectorMmmultiply?
alrightie then, thanks gents
Uhhh, am I using this incorrectly?
uni = uniformContainer player;
uni setMaxLoad 100;
what about adding another World to modelToWorldWorld
Well, I have no idea whether 100 is a reasonable value, but the syntax is correct
Note that in multiplayer it must be executed on the server
You could get the maxLoad first then add an arbitrary amount to it
Nothing changed, I've tried 3, 5, 10, 100, 1000 and nothing changed :(
Will try that
try getContainerMaxLoad for a check
you can also increase the carry ability per unit using setUnitTrait
player setUnitTrait ["loadCoef", 0.5];
// can now carry twice the weight
// does not change the containers' capacity though
I don't believe the Load Coef is what he is looking for specifically
It was specifically adding an Item to an already full container in this case being a player's Uniform
on activation?
this
I - know - that
I - am - providing - related - knowledge, that's it ๐
Ah
Make sure you're doing this at a point where the unit actually has their final uniform. If they change uniform (loadout frameworks, arsenal, etc), maxLoad changes applied to the old one don't apply to the new
Def helps, that would solve one of my other issues with loadouts that are too heavy.
I'm not sure how you would want to implement it
Yep, have not change my uniform yet, still trying with the one I spawned with
I have been messing with an Idea of updating Player Traits based on the Items and/or class they are
Stances, Ghillies and Speed affecting the camouflageCoef is something I quite like so far
Ghillies already affect camouflage (if they're configured properly)
If they do I have no way to determine to what level at all
Ghillies are... weird, I've had better luck sneaking around AI without them than with them.
From what I could see it was the Unit's Classname that determined it not the uniforms
when this chinook has all of its passenger seat filled up with players in multiplayer it will land on the waypoint
sort of like a Infill to the mission that it
What happens if you don't have enough players and it never becomes full?
it will hover and wait untill it fills up
That wasn't the question, but OK
in theory it should always hover untill the seats have been fulfilled thats the plan I just dont know how I can script it
So if you have less players on the server than the number of seats, they're just stuck forever
Than I have to zeus the heli
@sweet zodiac @hallow mortar Thanks for the help, turn out while I was executing it on the server I was not passing the uniform technically since player does not refer to me when executed on the server.
the heli has around 18 seats and on a Scripted Op I am expecting 20ish players
I also learned how to use publicVariable properly today, so yay!
All uniforms have a camouflage rating in their config. For ghillies (properly configured) it's higher and for uncamouflaged uniforms (properly configured) it's lower, and this affects AI visibility
...I think, hold on
I couldn't determine a difference between Ghillie and non Ghillie prior
no, it is in the unit config not the uniform config
Now you can see my issue
now where did I read that it was the uniform ๐ค
Okay I just tested the empty Positions thing, my Heli isn't landing even when the condition is true
Thanks Arma
I used a scripted waypoint checking for the Heli's Empty Positions and waiting until it == 0, side note EmptyPositions I don't believe accounts for FFV
if you can get the players to spawn in the heli than it should work
because the script is working but when the positions are empty afaik know sqf
it had better account for FFV if it's got FFV type filters
This should not be returning 3
Well that's not even right for non-FFV, it's got 4 internal seats
Either I am handicapped or "" is straight up not working as advertised with emptyPositions
You also can't test for Copilot seat with it apparently
If the Additional Waypoint is too close the Helicopter just refuses to do it, that's concerning
It looks like this was fixed in Feb but too late for 2.12, so should land in 2.14
if you've got dev branch you can test it there
I don't like scripting on the Dev branch
Because any commands unique to it I have to wait to deploy essentially
"test it", as in to see if it was actually fixed, not "write a whole script with it"
something to do with this?
Was _heli actually defined?
heli1 emptyPositions "Cargo" == 0 in the scripted Waypoints Condition, make sure the Helicopter has the variable name heli1
I haven't used Waypoints in a long time so I had to double check it
In my case this doesn't actually work at all because the Land waypoint I assume is just too close and the Pilot doesn't know how to handle it
oh the heli is far is quite far and I kinda was hoping that the heli would hover till condition met to initiate the land
in this case filling up the passenger seats
It will
Mine just wont land, could be because I am stupid and don't have a Pad for it to land on
This probably will work but you will have to test it, I had to use "Cargo" because "" is borked so it won't account for anything that isn't FFV or a regular Cargo Seat
Because you didn't read what I said
You want to Mirror this setup
well apart from the Helicopter of course
I just used the Littlebird for my testing
changing the variable name should work no?
hmm
I need some help
in the "show" condition of this holdAction
I need getGPS && X, but for X I need to check if someone is in the truck in one of the front seats
because they're supposed to be checking the truck's GPS history
I would be okay if they just needed to be the driver, if that's easier
how would I do this
_caller in crew of truck?
_unit in _vehicle
driver would work universally, as in ```sqf
driver vehicle _caller == _caller
Not this?
is getGPS a variable?
if you're going to have that global variable for the truck you can do
driver gpsTruck == _caller
to be clear the truck just has gpsTruck as its name in editor
I think that's global
so I want getGPS && drive gpsTruck == _caller?
driver
I think so, so long as the module correctly handles _caller
it's likely to be _this and not _caller
if you want "any front seat" you will have to find the front seats' id ๐
see https://community.bistudio.com/wiki/getCargoIndex
and _target is the thing the action is on
getGPS && { driver gpsTruck == _this || getCargoIndex _this in [0, 1] };
```assuming 0 & 1 are front seat IDs
so im thinking about how to manage ai for multiple zones to be handled later. Would it be efficient to store them as an array in a missionNamespace variable? Like:
missionNamespace setVariable ["zone_1_units", [unitObj1, unitObj2], true]
lazy eval gaming ๐
always
maybe a hashmap instead?
I don't recall how easy it is to manipulate arrays within hashmaps
for multiple zones
if the zones are triggers or objects of some sort you can just setVariable on the object
so im not really sure how to use a hasmap. From what I have ready they are like dictionaries in python right? key : value. since it can only have one value, wouldnt I just be stored an array there later and doing the same thing I would be with an array anyway?
ah true I was thinking I couldnt cause the zones are initially just markers, but I create triggers so I can store them there instead.
"manipulating arrays" is the same everywhere
so when you retrieve an array from a hashmap you're just passing a reference to that array and you can modify the data within?
yeah
cool
I feel like keeping track of Elements in Hashmaps is easier on the brain than Arrays
well as long as you use set, resize, pushback , etc. not =
depends on the use case
I just dont understand the use of a hashmap here
since im using setVariable
and getVariable
if you just want to iterate over something arrays are the way to go. if you want to search for something then hashmaps
If it works, it works
well I think what he meant is storing everything in one hashmap: [["zone1", units1], etc.]
in my mind the use in this case would be using the zone identifier as a key and broadcasting the hashmap, I'm not sure if that's more or less efficient though
yeah that
Hashmaps don't keep order as well so keep that in mind
well missionnamespace is also a hashmap so it doesn't matter
hmm. So your saying it would probably be better to just keep a global zone units hashmap rather than assigning a variable to each zone trigger and storing an array of units
since you have triggers using setVariable on the triggers is better
would it make a difference in terms of looping through and broadcasting all of the zones, for example, vs broadcasting one hashmap for MP performance
alrighty then, thank you
not much afaik
Add it to the wiki!
well i probably should, good advice
when I set trigger statements it seems to run them on creation? why is that? I know at the very least for some reason TRA_fnc_spawnMilitary is being run on trigger creation
_trigger setTriggerStatements
[
"true",
format["thisTrigger setVariable [%1, true, true]; [thisTrigger, %2] call TRA_fnc_spawnMilitary;", str _activeVarName, _x],
format["thisTrigger setVariable [%1, false, true]; [thisTrigger, %2] call TRA_fnc_deactivateZone;", str _activeVarName, _x]
];
why do you set a variable on the trigger to indicate whether it's activated? and to make it worse you broadcast it? 
you can just use triggerActivated command
I know at the very least for some reason TRA_fnc_spawnMilitary is being run on trigger creation
what is the trigger activation type?
hmm I was doing it that way so in the deactivation script can monitor if the zone is re-activated at any point in the next two minutes. I didnt know about the triggerActivated command though ill check that out
EmptyDetector
activate is Anyplayer and Present though
so you mean no player is in the trigger area but it gets activated nonetheless?
yep
oh
you know what I think I know what it is
yep thats my bad, I forgot the example had this for the empty condition, not true
is this forever true once the trigger has been activated once? it appears to be
if you're trigger is not repeatable yes
my trigger is set to repeatable but it appears that triggerActivated was still true when I used it.
_trigger setTriggerActivation ["ANYPLAYER", "PRESENT", true];
maybe I need to wait a few seconds before using triggerActivated?
triggerActivated was called from the deactivation event, yet was true
it is called in TRA_fnc_deactivateZone
{
// Create trigger
_trigger = createTrigger["EmptyDetector", getMarkerPos _x, true];
_trigger setTriggerActivation ["ANYPLAYER", "PRESENT", true];
_trigger setTriggerArea [TRA_milActivationRadius / 2, TRA_milActivationRadius / 2, getDir this, true];
// Set Trigger Statements
_trigger setTriggerStatements
[
"this",
format["[thisTrigger, %1] call TRA_fnc_spawnMilitary;", str _x],
format["[thisTrigger, %1] call TRA_fnc_deactivateZone;", str _x]
];
} forEach _military;
sure, I get Deactivation Aborted here in the middle.
params ["_trigger", "_marker"];
private ["_timerStart", "_deactivate"];
diag_log format["[TRA] Deactivating Zone: %1", markerText _marker];
_timerStart = diag_tickTime;
_deactivate = false;
while {!(triggerActivated _trigger) || !_deactivate} do {
if ((_timerStart - diag_tickTime) >= TRA_zoneInactiveTime) then {
_deactivate = true;
diag_log format["Time Since Deactivation: %1", (_timerStart - diag_tickTime)];
};
};
if (triggerActivated _trigger) exitWith {
diag_log "Deactivation Aborted";
false
};
{
// Current result is saved in variable _x
if (_x isKindOf "man") then {
deleteVehicle _x;
} else {
{
// Current result is saved in variable _x
unassignVehicle _x;
deleteVehicle _x;
} forEach crew _x;
};
} forEach _trigger getVariable format["%1%2", _marker, "_units"];
true
no, singleplayer at the moment
that last forEach I havent actually got to yet, may or may not work
using while in that code makes no sense because it's unscheduled
ah, I was thinking about spawning this function since I think ill need to sleep that while loop every 5 or so seconds
The forEach wouldn't work due to precedence issues. The getVariable needs wrapping in brackets.
In situations where switch case is suitable, if i use a sequence of ifs i will loose performance?
The difference is big?
yes. no
but if with exitWith should be faster than switch
Thanks.
so I spawned this code and added a sleep 5; just before the if statement in the while loop and it appears nothing else is going on now.
I got the log [TRA] Deactivating Zone: zone_name so the script ran, but nothing else. I also tried logging outside of any conditionals/loops later in the code and that doesnt run either, so I assume the script never finishes
did you fix what John said?
_timerStart - diag_tickTime looks backwards
I do believe you are right
ah
and im diag_log inside the if statement, that was an accident
if (whatever) exitWith { ... } is a much cleaner way to exit the while loop than your _deactivate var.
I forgot you could exit loops with that, thank you
back to this once again, one of the reasons I was using a global variable was to check in the condition if that trigger is already activated for all clients, this way the trigger isnt activated when another player enters the zone. Will triggerActivated be good for this or could it be true for the player who activated it and false for other players?
wassup i get this error when doing action menu repair refuel command
_heli is string, stead of object like error message states?
_heli = "RHS_AH64D_wd";
yes that is a string...
so how to make it object? like what it should be
you could use a global variable, that you put into variable name in editor
When using CBA does anyone know how to get a value from an addon option? Example is I have a setting appear in addon options and I want to be able to get the value of it in my script
still not working same error
then you are still assigning string...
object isnt a text.
Text is enclosed within quotes "
it's just a global var
lol i felt like the meme, i hate programming then i love programming.
yeah it works
thanks
https://cbateam.github.io/CBA_A3/docs/files/settings/fnc_addSetting-sqf.html
_setting param is also global variable
Do you know what string its saved under?
move your mouse over it and it tells you
you can also export all settings (vars) and paste them in a text file and inspect them for yourself
Ah thats quite simple then, thankyou both very much :)
how should I go about spawning a zone's ai/vehicles without suddenly tanking performance? I was thinking maybe give a 2-3 second sleep between each squad spawning in?
You could try 1 sec between unit i guess...
you could also preloadObject and stuff
oh nvm, with spawning in you can ignore preloadObject
Hello, im doing a script that compares the mods you have loaded with a list of mods saved in a config in a mod, and if you have a missmatch i want to show an error.
the idea behind it, its preventing ppl to even try to join the server if the mods you have loaded are no the exact same as the server.
ive saved this big list in a mod, and made a function that executes when the game opens ( prestart =1) but im not sure on how to do it, since
the code in the fuction:
if !(hasInterface) exitwith {};
[] spawn {
waitUntil {!isNull (findDisplay 0 )};
private _mods_loaded = ("true" configClasses (configFile >> "CfgPatches") apply {configName _x});
private _mods_allowed = getArray (configFile >> "nsn_mods");
_nope = _mods_loaded findif {!( _x in _mods_allowed) };
if (_nope isnotequalto -1) then {
(findDisplay 0 ) createDisplay "errorMessage";
};
};```
any ideas on what im doing wrong?
ive tryed to use `["warning text"] call BIS_fnc_guiMessage;`, but with out any sucess
what's the issue
at that point why not just use verifySignatures = 2; in server cfg?
afaik that check is made after you tried to connect to the server, i want to do it before you even try to connect
im not sure why the message its not shown, since ive tested the code and it works
systemchat working?
i think its initialized too early, maybe a waituntil {!isnull ( finddisplay 0 displayctrl 999) } might fixit
run a systemchat where stuff should be happening
youd probably wanna wait until dashboard appears before trying to display anything.
ive tryed and i didnt saw any systemchat, but im quite sure the function is running
then ur code isnt getting to that line
test with diag_log
yep, its not being executed 
for some reason the spawn its not working there
and the code is executed before the display 0 is created 
just a btw for here but it looks like sqfbin has fallen to some ad website now
anyway, anyone have any suggestions/changes I should make for this script to spawn units at an objective? its clearly not done but I want some advice about it.
I originally planned to sleep the for loops for a second or two between each spawn however maybe its just singleplayer, but it felt so much worse than spawning without any sleeps.
https://pastebin.com/7b8nKNEz
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
without sleep it feels like 2-3 seconds of 10-12 fps, with sleep its like every 3-5 seconds I bounced from 60 fps to 10 fps for 2 seconds
If I had to make a guess the poor FPS is due to several Units being created in quick succession
I tried sleeping every 2 units for 2 seconds, its was horrid
guess I could try sleep every 1 unit
createUnit iirc is fairly expensive so there is likely only so much you can do
So, I'd like to put this in the init field of a bunch of vehicles to save on performance.
I only want them to enable sim when a player is near them:
_distance = this distance player;
if (_distance <= 25) then {
this enableSimulation true;
} else {
this enableSimulation false;
};```
I'm putting this in the init of the vehicles:
```sqf
[this] call compile preprocessFile "enablesimvehs.sqf";```
I've tried a couple things, I'm thinking this isn't working because player is evaluated different in MP Dedicated?
player refers to the running machine's player object
yea, thats what I thought..
enableSimulation is also global
so you would effectively be enabling simulation on the same objects for exactly how many players are in the distance
I'm thinking that is what I'm wanting? But this is how I normally evaluate players in MP Dedicated:
_players = allPlayers select {alive _x};```
But the problem is, I need it to be concurrent, I need to always be running if that makes sense?
I normally put that in a trigger and have it evaluate by counting nearest object. but that is only activated when the trigger conditions are met.
Is it only certain objects you want to disable and enable sim on?
yea, I have a motor pool with about 30 vehicles. I want them to only be enabled when a player is near them, within 25 meters so that (I assume) cpu cycles/PhysX are not used until needed?
You probably could have a loop running on the Server that just looks for players in a Triggers Area and then enables simulation on all of them if the Sim isn't already enabled and vice versa
Downside is if there are no players in the area they all stop simulating
regardless if someone is driving them
hmm i could do this:
_allObjects = (allMissionObjects "" inAreaArray thisTrigger);
{
_x enableSimulation true;
} forEach (_allObjects inAreaArray thisTrigger);
Do you think that would achieve what I'm looking for?
they need to be simulated when they are training with them. so yes.
its not going to be used all the time, but the days they need to, it needs to be simulated. but what I've seen is, because there are so many, it causes frame drops. but when they are not simulated, there is better preformance
have you tried Dynamic Simulation?
yea, but because that controls all vehicles I've had it at a higher value. Now that I'm thinking about it, I could just do that. hmmm
well it only affects vehicles I tell it too
yea, ill do that
It's definitely the better choice I think, if it's not sufficient at all then you should try a handcrafted solution imo
yea, no I'm gonna do that and just force them all if empty 50m dynamic. that is a better solution
okay, another question lol
I created this a while ago.. I have a museum and I have speakers in the museum that play 2 songs. I have them playing sound 3d which works great. I have this activating in a trigger:
OnAct:
edbuildsong = true;
publicVariableServer "edbuildsong";
if (isServer) then {
[] spawn {
private _speakers = [speakers, speakers1, speakers2];
private _speakersin = [insidespeakers1, insidespeakers2, insidespeakers3, insidespeakers4];
waitUntil {
private _song = selectRandom ["armysong.ogg", "orgarmysong.ogg"];
if (_song == "armysong.ogg") then {
{
playSound3D [getMissionPath _song, _x, true, getPosASL _x, 1, 1, 40];
} forEach _speakers;
{
playSound3D [getMissionPath _song, _x, true, getPosASL _x, 1, 1, 40];
} forEach _speakersin;
uiSleep 130;
hint "armysong Complete";
} else {
{
playSound3D [getMissionPath _song, _x, true, getPosASL _x, 1, 1, 40];
} forEach _speakers;
{
playSound3D [getMissionPath _song, _x, true, getPosASL _x, 1, 1, 40];
} forEach _speakersin;
uiSleep 70;
hint "Oarmysong Complete";
};
!edbuildsong
};
};
}; ```
OnDeact:
```sqf
edbuildsong = false;
publicVariableServer "edbuildsong";```
I've been reading about RemoteExecCall and the only difference to my understanding is that RemoteExec immediately sync over the network and RemoteExecCall waits unil all is synced?
Should I use remoteExecCall here?
Also, it seems that sometimes it becomes out of sync with the speakers when you move outside of the 40 meters. Basically, is there a better way?
yea, I was just wondering because sometimes I see the speakers come out of sync.
Also you could forgo the publicVariableServer if this only fires Server side
okay
So you have a trigger that Does this and it's ticked for Server only yeah?
yea
everything is working, just the sync problem lol
but that is good advise about the publicVariable
I went and changed it up https://pastebin.com/5BDwrZvE It should do everything it did before but with less bloat and it's super easy to add more songs if you wanted to
deactivation can stay the same bar the publicVariableServer since It's running on the server anyways so no need to assign it for the server then broadcast it to itself
Was just doing some messing about with Unit spawning and this feels good to me, but I do need to stress test it in a scenario with a full modlist https://pastebin.com/j8MZgHmX
Using this method I am unable to visual see any Hitching even while spawning 5 instances of this at once.
50 Squads, 250 Units. FPS just gradually decreases as you would expect with 250 active Units, I suck at math
thank you! I didn't know I could use switch in arma
I obviously didn't test it but I would imagine it works flawlessly, unless I am dumb which is likely
it looks good! Ill test it though!
You can always revert if it doesn't work just make sure to backup things while you test
yeppers, being a Windows SysAdmin, I've learned the importance through mistakes lol
whats your opinion of publicVariables in the init.sqf file? Should I use them?
Like the command or that you have Global Variables in it?
that I have global variables in it. Are they necessary?
It's required if you want something to be accessed by multiple disjointed scripts and in the case of Multiplayer some you want to broadcast over the network which is what publicVariable is used for so that everyone is on the same page.
I tend to do it on a case by case basis, given how massive your file is and how it already works, I wouldn't be too concerned with it unless you suspect they actually cause problems and even then you need to find a solution that would actually improve it
I often find myself refactoring small things often for little to no benefit, it's a bad habit of mine
yea hmm
I feel like Im taking crazy pills
player rspAdd = ["mike","jed"];
player hint str rspAdd;```
This is erroring on me
You can always attach variables to the missionnamespace too Jaeger
with or without the first player
whats the error
"Missing ;"
why is player even there
I tried several things
hmm whats the benefits?
the first player was added as a last ditch effort and changes nothing
remove both
is there any performance friendly alternatives to createUnit?
Not that I know of but I did some messing around earlier #arma3_scripting message
Maybe just try a couple different approaches to unit Spawning for your Mission
I cant think of an example off the top of my head, but its handy when you want to avoid using a global variable for whatever reason
It's a global Variable attached to a mission that everyone can see
respawnInfo = [player] call BIS_fnc_getRespawnInventories;```
returns the current loadout (zeusGM in my case) in a single-entry array. Adding more loadouts manually results in `"["zeusGM","loadout2"]"` being returned instead. This has an external set of quotes on it that
```sqf
rspAdd = ["zeusGM","loadout2"];
hint str rspAdd;```
does _not_ have. The hint doesn't have the second set of quotes.
Even thought they're both being cast to string
ah thanks ill give that a try here soon.
Do note that I'm not doing any extra Handling for the Units or Groups after they are spawned, since I was just trying to do a raw performance test of sorts
yep ill let you know what I try when I do try it and my results
was gonna say that should return an Array of Strings ["Loadout1", "Loadout2"]
yeah no the second set of quotes is because I used sidechat to return the value the first time
I'm very tired and stupid as a result
Bahaahaha
Don't worry I lost 4 hours trying to get a GUI to work meanwhile it was broken because I had a waitUntil being a little too egregious
Literally just that funny box on the left
....I'm baffled now, instead, that when I get the default Respawn Loadout name for an NPC, it gives me... the 5th out of 10 available loadout name from cfgRespawnInventories. Which is the 7th of 10 available in cfgRoles.
"moony" is a player's specific loadout that inherits from TL which inherits from Rifleman
It's not the last one added or the first, it's not alphabetically the first or last
BIS_fnc_getRespawnInventories returns all of the available Loadouts for the Unit
right
so why.... does this random zeus-spawned unit have this person's loadout
and not just them
anyone I spawn has that loadout so far
even a civilian
I'm gonna try resetting the mission
Do you have a Loadout script?
ok that was something fucky
resetting the mission fixed it
I think it was an earlier tinkering command assigning that loadout to Everyone
I am guilty of doing that too
I did figure it out
so there's a mod by Webknight that adds a funny little enemy that rips your head off and then steals your body, but doing this makes a new unit of the same class as you, that isn't you, and thereby doesn't have your respawn inventories
so the code I just came up with, meant to go on an internal eventhandler, is ```sqf
// assume player is dying unit, just for the sake of demonstration
// assume _newUnit is new unit, just for the sake of demonstration
private _respInv = [player] call BIS_fnc_getRespawnInventories;
{[_newUnit, _x] call BIS_fnc_addRespawnInventory;} forEach _respInv;
since I think you have to add respawn inventories one at a time
....bizzarely, trying to run the first part on one unit and then run the second part on a different unit gets me a "missing ;" error
hmm
oh well, doesn't matter
I'm actually looking at it and the onPlayerKilled.sqf is of interest
because I might be able to put half of this in OnPlayerKilled
Does the second unit know about _respInv?
so I altered it when I was doing that to be a global variable, since I'm just tinkering around
so it was xxx = [_this] call etc etc and then {[_this, _x] ...... forEach xxx on the new unit
and it hated that
I'm really bafffled now though
Whats the current problem?
private _vvva = _this getVariable tfar_squad;
_this sideChat str _vvva;```
gives me zero response
```sqf
private _vvva = _this getVariable [tfar_squad, 4];
_this sideChat str _vvva;```
gives me Error Type Any, expected String
even though that default value should be able to be an integer
now, double baffle:
private _vvva = _this getVariable [tfar_squad, "4"];
_this sideChat str _vvva;```
ALSO gives this error
what string does it want
Its default for the entity variable space, not current variable space
tfar_squad is undefined in current namespace (missionNamespace likely)
.....oh
It doesn't even get to part where it operates entity namespace and where default can be used
so to put that on there I go to each player and go this setVariable ["tfar_squad",2,true];
private _vvva = _this getVariable ["tfar_squad", 4];
_this sideChat str _vvva;
```You probably meant this
Also getVariable takes a string. Are you sure tfar_squad is a string?
I wanted tfar squad's contents, which are usually an integer
I'm having flashbacks to java and typing var instead of valueOf(var)
Also note that SQF does have only Number (basically float), there is no int
Variable names are strings, you're supplying value of tfar_squad, not "tfar_squad" string to getVariable in your example
Okay...
I'm trying to fetch _oldUnit's tfar variable so their new unit doesn't need to completely reset their radio
player setVariable ["test", 123];
player setVariable ["something", 321];
test = "something";
player getVariable "test"; // 123
player getVariable test; // 321
My slow brain had a hard time reading that
I'm still having a hard time reading it
ok
yeah ok I get it now
private _vvva = _this getVariable "tfar_squad";
_this sideChat str _vvva;```
was indeed what I wanted
You can probably combine it into one life if you done use _vvva later
Yeah I did figure it out
I'm just waiting to hear what the right eventhandler to use is here
ok cool
Okay, I think a full version of all this is:
addMissionEventHandler ["TeamSwitch", {
params ["_previousUnit", "_newUnit"];
private _respInv = [_previousUnit] call BIS_fnc_getRespawnInventories;
private _tsq = _previousUnit getVariable "tfar_squad";
{[_newUnit, _x] call BIS_fnc_addRespawnInventory;} forEach _respInv;
_newUnit setVariable ["tfar_squad", _tsq];
}];
But
where do I put this?
InitPlayer?
init.sqf should be OK
thanks
out of curiosity, did you spawn that second for loop for any reason other than I assume the entire script itself isnt being spawned?
The main thing itself is also Spawned
It's so it doesn't have to wait for the squad to be done spawning to start spawning the next one
oh alright
I have half a mind to put !! before my condition checks
im done testing for tonight as its nearly 2 am, but I think this is the best I have gotten so far in terms of performance, not much different from yours. I could certainly be wrong though, plus I only spawned 19 patrolling infantry, 9 garrisoned inf, and 2 vehicles.
I cant seem to think of the general amount of infantry KP Liberation spawns per objective.
I think tomorrow im gonna rewrite the script a bit for a more dynamic enemy count based on the enemy awareness
https://pastebin.com/TCzS4jyy
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
aaaaaah sh*t.
Oh goddamnit
ugh
How would I make every AI group inside the trigger area go from "hold fire" to "weapons free"? Something like...
{_x setCombatMode "RED"; _x setBehaviorStrong "COMBAT";} forEach group in thisList```
But I don't know the precise bits of it.
Close, not most optimal way but sqf { (group _x) setBehaviourStrong "COMBAT"; (group _x) setCombatMode "RED"; } forEach thisList
it's only ever gonna be like 5 groups so it should be fine
benefits of running missions for only 8-10 players
Yeah no worries then
Hi, attempting to create a custom faction for the first time. I'm wondering if there is a list somewhere where I can find available basegame identities, and the face wear available to them?
exactly what I was looking for. Thank you!
allMissionObjects also return simple objects? I ask that because i just found allSimpleObjects ๐ฌ
Just to you know, allMissionObjects don't return simple objects.
This come to hand for what i'm doing.
thanks, I will update the wiki
Hi, I have a short question. Is it possible to add Magazines to the vest? Like a combination of addItemToVest and addMagazine? Thanks a lot ๐
the first one, with the magazine classname ๐
sup i am doing spawn vehicle script and what it does is it checks if the trigger at spawn is activated if it is then it wont spawn else it should create the vehicle
but actually nothing happens not even error idk what to do
// Spawn.sqf
if(triggerActivated trigger2) then{
hint "There is a vehicle in service";
}
else{
"apache" createVehicle getMarkerPos "spawn_marker" ;
};
Yes, but i need to add the magazine with a specific amount of ammo, like you can do with unitName addMagazine [magazineName, ammoCount]
ah, then that IDK
you might have to remove all other containers, addMagazine, re-add other containers ๐ฌ
Okay, thank you! ๐
when/where is this script executed?
// init.sqf
repairAction1 addAction ["Repair,Refuel ", "repair.sqf"];
repairAction1 addAction ["Spawn Heli", "spawn.sqf"];
also "apache" might not be a proper classname. place a hint in the else
?
place the heli in Eden, right-click, Log > class to the clipboard, Ctrl+V in the script
between quotes or object?
between quotes; createVehicle takes a string
still saying missing }
hint "test'; use the same quote on both sides, please?
yes it works now
Afaik it does return everything
How did you use it?
Use addMagazineAmmoCargo
Get the container using vestContainer
Do I add the ear plugs script in init.sqf?
player addAction ["Enable earuplugs ",{
params ["_plyr","_caller","_id"];
private _actMenu = (_plyr actionParams _id) select 0;
if (_actMenu isEqualTo "Disable earuplugs") then {
_actMenu = "Enable earuplugs";
call disableEarplugs;
} else {
_actMenu = "Disable earuplugs";
call enableEarplugs;
};
_plyr setUserActionText [_id,_actMenu];
},nil,0.8,false,true,"", ""]call BIS_fnc_MP;
Oh I'll try this out! Thank you very much!
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
plz
First of all use syntax highlighting
Second of all the script looks incorrect and as far as I see it doesn't even compile
Sorry my apologies
Well remove the call bis_fnc_mp part then put the script in initPlayerLocal.sqf
Okay thanks!
Also I don't see where you've defined the disableEarPlugs function
Is it really defined?
Showing up isn't a problem. It won't work tho
hello can anyone help me
I think you're missing a }? I can't read your code because I'm on mobile
And I doubt others can either because it's not syntax highlighted
I donโt understand the syntax highlight sorry
Iโm also sending from mobile
When you removed the call, are you sure you didn't remove the ] next to it?
This message explains how to create syntax highlighting. You have to surround the code in the ` (not ') character as it shows.
Note that on mobile this will create a code block but not show the syntax highlighting colours - big thanks to Discord for that... - but people on desktop will be able to see it.
Not sure
Will update in a few when Iโm at my pc and can properly do the highlight
My apologies
Anybody has a convenient way to simulate lag between two local clients?
As in block sending or receiving from local client game process to local server game process?
Bet there is a software for that but I wonder if somebody can point me at a solution
Well, he's already got the external network lag figured out
There is software for it, just need to find the name I saw it recently
Oops, I thought I changed my mind and didn't post it ๐ค
"Clumsy"
Looking it up, thanks
I wonder why there is exactly 3 frame delay between remoteExecCall to the same client and function firing?
somefunc = {systemChat (diag_frameno toFixed 0)};
systemChat (diag_frameno toFixed 0);
123 remoteExecCall ["somefunc", 2];
- sending
- travelling
- receiving
- executing
๐
(don't take my word for it, it is only a joke)
Good, keep wondering. Curiosity is good
Mostly in Arma it just drives you slowly insane.
I call it Armanormal activity
consider game loop with unscheduled scripts -> receive network -> send network -> scheduled scripts :P
Are you sure it's the same client? You're doing 2
Executing this one a listen server with no other clients
and that wouldn't work outside of where it's run anyways because somefunc isn't publicVariable'd 
I want to find objects that can be destroyed, so it is good for me that it has no simpleObjects.
Well like I said it does return them. Maybe you've done it wrong
E.g. simple objects don't have class inheritance and super simple ones no classes at all
Did you do allMissionObjects ""?
Then that's your answer
And there's allObjects now
Much faster than allMissionObjects
can you please revert my last edit? I am in transit rn
can't ask a single thing
thanks tho :p
@winter rose really sorry.
Can i spawn a crater texture my self?
And may be make it permanent.
Yes. They're decals tho
Not textures
i.e. they stick to the ground
actually not sure about crater decals 
There are crater objects tho
I will check Eden first.
Custom crater!
sqf createSimpleObject ["a3\data_f\krater.p3d",_posASL];
Is there an elegant way to spawn blood spatters/pools on units that are spawning with 0 health? For ambience reasons
rather than manually placing a blood spatter object on each unit
What effect are you trying to achieve?
blood pools under bodies
I'm thinking something like
bloodPools = ["bloodPool1","bloodpool2"...];
{
selectRandom bloodPools createVehicle getPosATL _x;
} forEach synchronizedObjects deadBodies;
I meant more, are you looking for something the player experiences, or just to make building a scene easier?
it's meant for an actual mission
is the object an addAction is on passed to the condition of the addAction at all?
like the _target provided to the script/code option
huh?
Does anybody know how to make a Restricted ACE Arsenal like Rifleman, Grenadier, etc where these roles can only access the specific items?
I suspect you are slightly tired
go to bed, stat
how to disable the PeripheralVision as a config or in the config for the ifa 2 iron front mod
on veteran
difficulty
at_gui is a mod and it disable the effects
in arma 2 they disabled but in iron front mod not
Hey
can i somehow put an icon in the text of drawIcon3D?
I tried parseText but i get the error Type Text, expects a string which makes sense.
Is there any way?
(I want to make a Playertags script, maybe other commands are better suited for this?)
Wait, but, what? is there some reason you can't just make the drawIcon3D you know, draw said Icon?
Ah sorry forgot to mention, in certain cases i want to use multiple icons
Oh that makes sense
I don't know of a way to do that, I don't believe it would be possible really without just another drawIcon3D but they would just collide visually
mhm yea
thanks for the answer
My mod would allow you to do this.
So you could create a variable/list, call it "infantry" and assign items belonging to that list. I then add specialist roles for specific slots like sniper or MG etc. I don't want to clog this channel so just dm any questions.
https://steamcommunity.com/sharedfiles/filedetails/?id=2909743623
Oh, interesting, I just did this manually with mission specific scripts, I probably could find it again if you want a version that doesn't require a mod
I think it was something along the lines of adding a Variable to each player for their role, and checking it locally when they joined and added an Ace action to the Listed Crates that would basically Fake the Ace Arsenal by force opening a different Arsenal that was placed in the editor with the correct equipment
Yeah we used to have a script that did it that way too. But I updated to this version that has an arsenal for every role. Then check the players tags for each arsenal and add them all up.
Our community likes to go a little extra on the arsenal management. Not everyone goes that hard tho
Yeah my Implementation only supports having one Arsenal for each Role effectively and You can't change roles mid mission
It was a Cookie Cutter situation so to speak so I didn't design it with a lot of flexibility
While mine does allow mid mission switching I've never done it... I can't think of a use case in a milsim community that has set gear.
Maybe for an insurgent style op
If I was going to redesign it I would probably do it similar in the sense that several Tags could be used to determine which weapons they could access and have a couple Zeus Modules along with it and the ability for it to regenerate the Arsenal Contents when their "Tags" have been updated
Uniforms aren't a concern for my Group so I would only do it for Weaponry
Simple addaction and setVariable would be enough. Then just run the check whenever the arsenal gets accessed
I don't like the idea of checking it every time personally
It would lead to an unnecessary amount of checking
I would just do it once on mission start and subsequent times if their Tags update
What's the best way to check for nearby players around a point in a script that fires often?
I imagine there's a better way than looping through allPlayers
Small mock up, untested
_nearPlayers = [];
_nearMen = _position nearEntities ["Man", _radius];
{
if (isPlayer _x) then {_nearPlayers pushback _x};
} forEach _nearMen;
there might be a nicer method
Yeah but that loops through all the ai which may be just as bad
Hmm...I can see how that might be better in some cases
It's a bit specific but if the classnames of the AI are different from the Players you could filter it like that, nearEntities can accept an Array of Strings instead of just a string.
_position nearEntities [["ClassName1", "ClassName2"], _radius]
Won't work in single player I don't think, but pretty fast. Can also replace My_Object with PositionAGL if using a marker.
#define MIN_DISTANCE 10
#define LOCATION My_Object
private _nearPlayers = playableUnits select {
(LOCATION distance _x) < MIN_DISTANCE
};
That's real cheeky if that works
I think the distance command can be pretty taxing
not even remotely.
Ive found it to take longer than nearestObject in my testing
With SQF the less commands you run, the better
And if you're checking lots of objects against lots of players, then that adds up exponentially
There is inAreaArray which is great for mass distance checks btw
Well it's only checking playableUnits if my understanding is correct
my example is checking players against one position, it's not taxing.
playableUnits inAreaArray [LOCATION, MIN_DISTANCE, MIN_DISTANCE]
Or even preset your area to be a location, trigger or even marker and do:
playableUnits inAreaArray myLocation
Locations don't support Z, triggers do
You can also https://community.bistudio.com/wiki/attachObject so you don't even have to manually update it if you want it to follow some object
But I haven't tested how well it works, that stuff is ancient
these are some damn spicy one liners, makes my version look horrific in comparison 
playableUnits inAreaArray _trigger seems to be the fastest in my tests
My small test results while running on Perf Build, 23 Units including myself, take from this what you will.
swapped it to a Pastebin https://pastebin.com/GQKXk20c
I swapped out PlayableUnits to AllUnits to include AI for Testing purposes, I aimed to simulate 23 player Objects but your mileage may vary.
Hmm. Are you running perf build?
The select version may be a lot faster on perf than on stable.
Oh shoot you right, I am running perf
I updated the message, I legit forgot about it even though it has a massive green stripe to indicate it
23 units
Result: 0.0210386 ms
Code: allUnits select {(player distance _x) < 40};
Result: 0.00984627 ms
Code: allUnits select {;;(player distance _x) < 40};
So yea a bit fasterish
<.> how does having two semicolons there make it faster?
Thats just my thing to enable SimpleVM in my test stuff
;; == new thing
Oh that's nuts
what would be the code to get an init to repeat itself?
i.e get a sound file to play on repeat from an object
Create a while {} do {} construct.
Must be in a scheduled environment (eg, within [] spawn { here} or otherwise), and use Sleep # to delay the desired seconds.
Is there any kind of script that can simply change the color of a mission's fog? Ideally it would operate locally for all players so as to put less stress on the server.
I'd like to change the standard white/light gray fog to something like red for example.
Cool markdown ๐
Actually it seems to have the way via diag_setLightNew but haven't made the good script
Feels like the 'oh its permanent btw, but heres how to reset' shouldnt be a footnote, but ooooooh
Yeah I know what to pass, but I don't know how to make everything else normal
Mood
what's the name of a function that lets player hold space to execute code? I forgot to bookmark its page on biki and can't find it now
and it is a specific function with a progress bar, not holdaction nor holdKey
not holdaction
it's displayed in lower third of screen, shows text "Press and hold [BUTTON]" and a progress bar below
I'm not delusional, it definitely exists, I used it once when I was working on a Far Cry mission and tried to add custom healing system with it, unfortunately I deleted this scenario so I have to find it in biki again
too bad I don't remember its name
omg
Ah, bohemia.. and their function naming. Good thing it isnt keyHoldHold
... okay, Im looking at it, but what is it for.
Am I missing the 'on execution' portion?
Theres arguments for what it says, how long you hold, but not 'code to be executed when it finishes'
now I recall I did something to it to work as a hold to heal action
It doesnt even return anything, you cant waitUntil, what even...
Check ze source.
Allow for hold button interactions.
Parameters:
_this select 0 (Optional): STRING - Description of the performed action, displayed inside the progress bar.
_this select 1 (Optional): NUMBER - Duration of the action. (Default: 2 seconds)
_this select 2 (Optional): STRING or CODE - Condition that must be met for the action to display.
_this select 3 (Optional): ARRAY - Arguments passed to the code executed.
Returns:
True if the action was successful, false if it was interrupted.
So its simple waitUntil
But tbf it needs to be fixed on wiki. No return listed, and function seems to be pointless
Question, since im AFK and cant test... would you have to define a variable for the return of the hold action, then waitUntil {thatVar}, or could you waitUntil { [] holdAction command} ๐ค
ye I'll start editing rn
If youd do that, it mostlikely wouldnt work;
_var = [PARAMS] spawn bis_fnc_keyHold;
//_var would be false at that time
waitUntil {_var}; // would wait forever
So u have to do the second
As in, put it inside the waitUntil?
Ye
Wierd as it is, cause its completely diffrent than other, callback based actions.
or as artemoz posted some time ago,
[] spawn {
private _success = [PARAMS] call BIS_fnc_keyHold;
if (_success) then {hint "Successful execution"} else {hint "Interrupted"};
}```
Really weird, wouldnt think to put active functions inside of a waitUntil :x
Idk, tbf, ill try it later
I guess if you did that call inside a spawn, it would be cleaner than waitUntil
another Q, what was the function name for displaying the warning window pausing simulation with custom text like "Do you want to do this?" and buttons OK or Cancel
I have a really bad memory 
ye, thx
In options you have select build config, select scriptedFSM
Can you screenshot real quick?
The top bar?
Try fsm attributes
Compile config
In steam path\arma3 tools\fsm something
thanks btw!
how to disable the PeripheralVision as a config or in the config for the ifa 2 iron front mod
on veteran
difficulty
at_gui is a mod and it disable the effects
in arma 2 they disabled but in iron front mod not
Or how to delete
https://community.bistudio.com/wiki/showHUD perhaps
also don't crosspost thank you - I deleted your message in #arma3_config for you
I think this is not what i mean, can i disable it as a addon/ mod how at gui mod?
IDK myself
see how they do it in that mod?
Depbo the mod that does it, see how they do it, then undo/override it in your mod.
how to active mission voting in Arma 3 server ?
#server_admins may help you ๐
oh i'm sorry.
no probz at all, I hope you find what you want
I have
Or can i play on mercenery (pro) in the difficulty settigs with the third person
You can make custom difficulty settings
And how?
Game settings?
I have but on profi it doent work
Im unsure what you mean. Also is it for sp or ingame hosting or dedicated server?
In arma 2 you has on the difficulty peripheral vision you can see in a unit green red and white dots
Wait... is this for a2 or a3
I will it disable it kills the realism in arma 2 there is a mod it disable these but in arma 2 with the iron front mod it wont work
I has write the config file for the mod but it dont work and on the difficulty settings you dont see this things at Expert but on veteran etc
And maybe it is ifa2mod= iron front mod for arma 2 or the config is false idk
Or delete these in the arma/ iron front folder
But anyways for a3 difficulty option for this is:
enemyTags and friendlyTags and it has nothing to do with scripting or config
Also idk how they are called in settings
And in arma 2 yes but on veteran they must disabled but i can see this dots
Inside the Arma community there are two wolves. One complains that it cant identify enemies, the other complains about the enemy identification helper.
Uff peripheral vision = enemy tags friendly tags etc
And it it is dont disabled on veteran in arma 2 and idk why
It make no sense
Yes. Readings above ^
Also, this is for Arma 3, as is this channel
visionAid iirc
Ping him with that, not me ๐
Thanks
Having an issue with the Warlords modules Dynamic "Airport" from the carriers in game
Line that pops up on dyanmic airport feature from the USS liberty
class USAF_A10 : USAF_A10
{
// ...
tailhook = true;
// ...
};
says missing ;
aaaand do you #define true anywhere? Or include any headers that include that?
well it should already be defined by BIS_WL_Aircraft_Arrial
I used this from the forum
class CfgVehicles
{
class AirportBase;
class DynamicAirport_01_F: AirportBase
{
scope = 1;
displayName = "Dynamic Airport";
DLC = Jets;
editorCategory = "EdCat_Structures";
editorSubcategory = "EdSubcat_AircraftCarrier";
icon = iconObject_1x1;
// airplanes with "tailHook = true" will be able to land here
isCarrier = true;
ilsPosition[] = { -5, 150 };
ilsDirection[] = { -0.5, 0.08, 3 };
ilsTaxiIn[] = { 40, -60, 35, -80, 25, -80, 20, -70, -10, 110 };
ilsTaxiOff[] = { 40, -60, 35, -80, 25, -80, 20, -70, -10, 110 };
};
Just can't tell if it's not going to the right file
the above one says it is a config.cpp
I have a description.ext mission.spm and config.cpp
all packed into the PBO
replace true with 1 and try again, i guess 
this even says missing ;
Does that belong in the SQF or the .cpp
or the EXT
i don't see any mentions of dynamic airport support in what WL code i've browsed right now 
Is there anyway?
Chernarus 2035 doesnโt have any Airports created that follow the lines the BIS_WL_Aircraft arrival sqf
So is my best bet to just place the aircraft and put a respawn timer then?
i guys i need help, i try making B_AAA_System_01_F ataque civilian in air vehicle i try this :
, but shis dont work
Why not make the Aircraft Opfor?
You can also make the Rating of the Pilot really low so they become an enemy to everyone
only have praetorian in blufor editor,
how to make that?
Praetorian is not the aircraft
air craft is a jet?
I don't follow what you mean
my idea is for secure the island from civilians in helli only
^ You can simply put an OPFOR pilot into a civilian plane @fresh wing
Anybody else thinks that limiting owner to just server is a strange engine design decision? Why can't client know which clients own certain entities? Sure they can't address other clients directly, but this knowledge is very useful for gameplay design features.
Wonder if this is fixable at this point
why would the path not be found? its certainly in the sounds folder in the root of the mission with the name alarm.ogg
/* Path to the alarm file */
_alarmPath = "sounds\alarm.ogg";
/* Objects to play the alarm sound from */
_alarmObjs = nearestObjects[_markerPos, ["Land_Loudspeakers_F"], 200, true];
{
playSound3D[_alarmPath, _x, false, [0,0,10], 1, 1, 100];
} forEach _alarmObjs;
also while im here, how should I go about looping said sound. I want to it play endlessly
fixed the file not found error with getMissionPath but it still plays nothing, hmm
try other play commands, like playSound
I had no idea it was server only
i often have issues with this, and it feels weird just using an object variable as a getter
I don't even know if really only server knows the owner
Certainly during owner transfer it can happen that clients would have the wrong owner
For perfect loops createSoundSource. However, if clients go too far out of range, sound will permanently stop playing. And since this is global, you will have to delete sound object and respawn it, but there is no good way of detecting if someone went too far. Also respawning it causes interruption of sound for those who can still hear it.
If you dont need perfect loop, say3D with sleep <sound duration> in a while loop should do.
what's the best way to filter CfgWeapons for different types of weapon (e.g primary, secondary, sidearm, item, etc) - is it some combination of "scope" and "type"? is this documented anywhere?
(Arma 3)
scope 2 or scopeArsenal 2 and their slots.
scope == 2 is what? primaries?
no, that means that the weapon scope is public
scopeArsenal means it's available in arsenal.
ahh so that should exclude base classes?
yes.
You're better using scopeArsenal, that removes debug weapons used by BI.
such as the spotter variant of the cyrus.
thanks very much man, super helpful
can't find any mention of scopeArsenal in anything
gimme a sec,
Hi, how to create mods & scripts ? did u have a web page for explain, or youtube tutorial ?
scopeCurator
thanks
this returns pretty much everything:
_weapons = "(getNumber (_x >> 'scopeCurator') == 0)" configClasses (configFile >> "CfgWeapons");
The distance in nearestObject and nearestObjects (when the position parameter is an object) is measured between the model certer of the objects?
scopeCurator == 1 and scopeCurator == 2 return a few hats and some optics?
erf, BI and it's consistency
Yes
and lack of fkn documentation :'(
So those are equivalent searchs:sqf nearestObject _object;``````sqf nearestObject ASLToAGL getPosWorld _object;
Oh you meant the center of the object used as pos
dunno not sure about that one. But I guess yes
i might just manually add all the entries, dunno if i can trust these config files
is for altis life server the players is are civilian i need the praetorian atack civilian air
change the rating of the pilot to -8000 or something
that makes them considered Rogue and everyone will shoot them
a CfgWeapons entry is considered a weapon when
the config entry "type" is anything between 1 and 7.
type is a bit mask
2^0 == 1 for primary weapons
2^1 == 2 for handgun weapons
2^2 == 4 for launchers/ secondary weapons
can you give me example how to make that?
"the idea is have praetorian making to destroy all approach the island that is not on the independent side"
Warning to this is: all other ai will engage them too. Which is probs not what you want
Why not just make them opfor?
Deja vu
Oh It's because I suggested that when you asked ages ago
If you temporarily have them join an Opfor group it would do the job, otherwise the only real way I can think of is lowering the rating below -2000 for the Pilot or all players
5 would use the primary and secondary slot, but Arma 3 no longer supports this and it causes weird duplication bugs
Docs are decent now days ;D
_player addRating -2000 but the Argument is local so it needs to be executed on the player locally I believe
https://community.bistudio.com/wiki/addRating
What script line do you need to use on a Object to Scale it bigger but its visible to everyone in Multiplayer?
( This setObjectScale 3.5 ) Isnt visible when i test it in Lan mode
object scale isn't something that really works in multiplayer
qwq
well its just like a Logo on a building i want to make bigger
attach the object to something else
Attach the logo to the building then resize the logo
how?
the opfor is enemy too civilian right?
if is enemy maybe can use something like this "_myLocation setSide east;"
_logo attachTo _building
in praetorian object
setSide doesn't work on units
It's intended for Locations
ah thanks commy
Nobody is enemy to civilians
where's this documented? i could only find docs on arma 1 cfgweapons
except sideEnemy which is the rogue side
they hate everyone equally including themselves
I guess that's not entirely accurate, everyone hates them, I don't think they actually engage anyone if they start as a civilian
I only ever messed with it once with like 40 civilians and I set them all to -2000 rating and watched the battle royale, was good fun
2^12 == 4096 is for binoculars which are weapons too
I did ( _GDILogo attachTo _Buildingref; This setObjectScale 3.5 )
It still doesnt scale it in Lan mode
the refinery building need to be attach to something else?
I don't think it is documented anywhere
Only the logo should need to be attached to another thing
Oh you might have to put _Buildingref into an Array _GDILogo attachTo [_BuildingRef]
i spend all my ideas for making that working
Why can't I remove items with addItemCargo? :C Passing a negative number doesn't seem to be working.
which game version do you have?
2.12.150301
what version does the doc mention?
Works pretty good from what I see
iu cant use that because i have other side missions using AI and is go making conflit
thanks very much, you da man
It doesn't have the nice little 2.14 icon :c
yay got it to work with ( [this, Buildingref] call BIS_fnc_attachToRelative; This setObjectScale 3.5 )
headpat @sweet zodiac for help
I mean, its more on me for not reading the fine print and double checking my own version, assuming that I was running the latest and all :/
Well 2.14 is dev right now
So what is the preferred 'delete item from vehicle cargo' method?
now it has
i bet you arma 3 has a large hadron collider function in game somewhere but it's undocumented...
Wait how do you remove from Cargo?
The only option I see is getting the cargo as an Array and removing things you don't want in it and adding it back, unless the Unit ones like removeItems works on them
I might be missing something, I am very tired
That's what I found as well :/
Which I mean, I'm currently aiming at removing first aid kits, so it works, but I'm not a fan.
This system certainly is weird and backwards
if i make trigger civilian setFriend [west, 0];
Try, but by default none are hostile
https://community.bistudio.com/wiki/Side_relations
probably due to it being a mod on Arma 2 / ArmA / OFP
you don't (or, well, you walk to the crate and pick up the item you want)
:c
Especially weird is the mine detector , which actually is a secondary weapon
Which leeds to bugs like: http://feedback.arma3.com/view.php?id=20997
well at least we will have a way once 2.14 rolls around
that's the idea
Simple work around: spawn ai with biggest backpack, order it to pickup items, despawn ai
that's ridiculous
simple work around start server and get players to grab the items then kick them
Took me days to debug all this :/
how would i force the ai to stay in one stance?
thanks should work
you are doing god's work
on an ace3 note, is it documented anywhere how to add custom things to the interaction menu?
it's cool, i'll wait for proper docs, nice one
yeah dont work maybe is not possible make that :/
is there a way to adjust the audio volume via sqf of ogv videos played?
or do you have to adjust the volume in the video itself
allGroups doesn't sound like it returns sides
need replace _x to player side? is that?
player and X
civilian to west like that?
the value need to be 0 ?
like this ? west setFriend [civilian, 0];
Is there a way to get all map markers (player drawn lines too)?
Basically what I want to do is save all the map markers, and then re-add them when the mission reloads
Returns all markers in map including user placed markers
https://community.bistudio.com/wiki/allMapMarkers
something like: there should be no arrows between yellow diamond-shaped blocks. Only box-diamond or vice versa 
Okay, okay, okay, so.
this && !alive ka50 && triggerActivated HQSEIZE && triggerActivated noindi
Why this no work?
This is in the condition of a trigger
no idea.
magic, maybe. or something is wrong
Nothing stupid that I've missed or anything?
*hint hint more details please* ๐
Both triggers it's waiting for are triggering correctly. The KA50 is dead. There are players in the trigger.
Trigger no fire
This is the 4th trigger that I've had that will not work with &&s
try to test by segements
first only triggerActivated HQSEIZE && triggerActivated noindi
if that works, move on to adding more
^ yep - and what is this trigger's condition?
Any Player Present
server-only triggers?
That's the issue, NONE of my triggers are working when I include any form of the && (and) condition. The rest of them I just found a way to get around. This one isn't so simple to do
No
Just regular triggers
Do they need to be server-only?
well...
if you don't want to trigger multiple times
But Repeatable is turned off
not "server only" + multiple players = multiple triggers
Ah. Well so far it's just me in the trigger area as a player
https://community.bistudio.com/wiki/triggerActivated
The trigger could be local or remote but the result returned by this command will be for the trigger activated status on the client that executed the command.
i use && alot and it works, all the time. BUT triggerActivated will only return activated on machine where it is actually activated
that
This is why I've never noticed an issue... The triggers it's depending on will be complete on all clients as they're just checking if OPFOR or INDFOR are in a 500 metre radius of this trigger
But so far I'm just testing with only one player and it's not firing, and it's the 4th trigger I've used with && that refused to trigger at all. I've verified that all the conditions independently are met, but the trigger isn't realizing that all the conditions are met.
okay, you could get around it by placing in onActivation of these triggers a ```
My_Trigger_1 = true;
publicVariable "My_Trigger_1";
and then in condition of your master trigger ```this && !alive ka50 && !isNil "My_Trigger_1" && !isNil "My_Trigger_2"```
The trigger is firing when I use "this" "!alive ka50" and the other conditions on their own. It's only when I use && to check that all of them are met at the same time that it won't trigger
Okay
Like, it's not an issue with the triggers its waiting on not firing, they're firing fine and it can detect that via triggerActivated, it's just when I check for them all with && that it doesn't work
complete all requirements and test (in debug console) systemChat format ["Cond1: %1, Cond %2, Cond %3", !alive ka50, triggerActivated HQSEIZE, triggerActivated noindi];
Let me see if it's specifically the triggerActivated parts that are making it fail by testing if it works with this && !alive ka50 as well
are you sure those triggers are active at the same time?
did you check in debug console?
Yeah, both detect whether or not a specific faction is in the area of the master trigger, both of them do work and fire correctly (I've added an ai in the bottom corner to use for 'sideChat "trigger1 complete" ' so it's popping up in the sidechat that the trigger is completing)
try printing it out in console.
how do you know it hasn't been deactivated? test in debug console
Can we step back for a sec lmfao y'all are speaking enchanting table from my point of view XD
I'm still very new to scripting
^
This is gonna take a while, it's the very last trigger in the entire mission so I currently have to run the entire mission through in order to get to it XD
plop down gm module in editor and just hack it ๐
also spawn yourself as friendly to enemy or civilian so you dont take fire
Yee I'm doing that rn but it still takes a little bit because a lot of the triggers for this mission are waiting for certain amounts of IRL time to pass...
for testing purposes just decrease timers
also noindi and HQSEIZE are non repeatable triggers yes?
Then perhaps they shouldnt deactivate Leopard20, going off this:
If trigger already activated at least once, triggerActivated will only return false if trigger is set to activate Repeatedly. In other words, a trigger set to activate Once will always return true once activated at least once (even if trigger is no longer activated).
Yeah that's the intended effect
keep testin ๐
They're supposed to activate once and stay activat....
Oh
I think I know what's going on
The mission starts with the trigger conditions met
AHA!
The OPFOR and INDFOR forces don't enter the area until later
but is ka50 dead?
But in that case... Shouldn't they just be triggered already and then be waiting for the KA50 to die and then a player to be in the trigger area?
There is easy way to know for sure
Yeah man I have no idea what to do with that bit of script XD
you dont actually need to complete all requirements, you can run that at any point and time in game, go ahead treat yourself.
I am like
okay, put it in debug console yes?
and click local exec
Toddler level scripting
you know where to find debug console?
cond1 bool, cond true, cond true
!alive is returning a bool, HQSEIZE and NOINDI are both true
Why tf is !alive returning a bool
That should be false because it's alive
kill it and run again
Still a bool
funny
Weird
Hold on, crew were still alive
Wait did I remember to name the KA-50 ka50...
i was just about to ask
and you blamed &&
Yeah because I've been having issues with && all mission
Watch it still not work now
lets watch
Setting the seize triggers to be repeatable so they can be false and aren't always active...
Okay ka50 is returning false now like it should
for testing purposes you could keep it as it is, and now test master trigger first, you know whats wrong with other two.
Changing bunch a variables between the test is not prudent
if i wanted to do watchai battles should i create battles in eden or zeus?
Now we wait for the 2 minute timer to trigger
๐คฆโโ๏ธ
whatever is easier for you. If what you mean is "watch ai battle eachother"
Man it's so cool watching your op play out when you've spent a while on it
so i take it worked?
awesome, and remember to use debug console for testing stuff ๐
as the name suggests it helps with well ... debugging
yeah thats what i meant sorry,
yeah, whichever you find easier to use, eden editor will allow you to do more advanced stuff later on, and also allows you to prepare battle first and then watch it, without having to do anything. But requires more setup
Okay so, does anyone have a parachute script for AI? Got a Xi'an full of spetsnaz but I need them to jump out and parachute to the ground. Don't know how to script it at all, if anyone has a working script for it that'd be madly helpful. Nothing too special, Xi'an reaches waypoint, AI jump out, pop a chute and then hit ground.
ACE3 does.
I'm using ACE3 already, no sign of a waypoint for it
I uh, I need it to be on existing AI
The reinforcement module makes AI and only works from the zeus interface
wait thats only the first part
NOPE
You've lost me
i didnt. Youve lost it.
There's a pretty simple solution actually.
Never had it to lose it
you've lost a chance i guess then*
Yeah like, 6 helicopters and waypoints
A chance to lose my mind, get extremely infuriated, and take another 6 month Arma 3 hiatus? Yeah.
Give your passengers parachutes, have a waypoint for the Xi'an to hit, inside the waypoint activation do:
[MY_VEHICLE_NAME] call zen_common_fnc_ejectPassengers
Is that it?