#arma3_scripting
1 messages Β· Page 708 of 1
Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.
To get to your RPT files press Windows+R and enter %localappdata%/Arma 3
Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files
To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.
it may; try the momentum approach though
18:31:32 ["chose:","G_balaclava_blk","got:",""]
and are there any "error" messages in the rpt nearby?
when does the script run?
I wiped out my RPT then executed the script and that line is the only one in there
wait is balaclave even headgear?
On Radio Alpha
have you tried the example gear: player addHeadgear "H_HelmetB";?
Use selectRandomWeighted instead so you donβt need repeats
goggles?
Well at least you figured out the problem π€·
It says facewear in the armory. But yeah goggles is the scripting command. Thank you for saying that because I was just about to ask since the biki wasn't returning facewear or face or anything like that
yeah well, Arma I guess π
does not seem to be working. 99% sure that the custom channel is created and enabled and my player object is registered with the channel. but nothing, no messages.
did you add both emitter and receiver?
a what what now?
you say "no message"
i.e. player customchat [1, 'test'], no message
0, no?
pretty sure not; 0 means create failed, correct?
yep indeed
and +5 for 'normalized' channel
plz provide ez repro code
(plz provide code itself, for we can't know what nor how you do stuff)
well, it is factored, so I am distilling a snapshot.
args provided by name/value pairs:
_label = _args get "_label";
_callSign = _args get "_callSign";
_color = +(_args getOrDefault ["_color", [1,1,1,1]]);
_chat = _args getOrDefault ["_chat", true];
_voice = _args getOrDefault ["_voice", true];
_customChannelID = radioChannelCreate [_color, _label, _callSign, []];
// Track as you will, I use CBA namespace objects, and a HASHMAP to a UUID key
I can also verify _channel getVariable ['MY_radios_players'] does in fact contain my player object, as a result of _customChannelID radioChannelAdd [_player], effectively.
i sure hope for your own sake that your _args hashmap is filled with all the required argumentsβ¦ π
And log indicating successful creation:
18:37:41 [KP LIBERATION] [24351.3] [RADIOS] [fn_radios_custom] Fini: [isNull _customChannel, _customChannelID, _uuid]: [false,1,"d8d75c29db889a849ed9f2ea72c41ac8"]
for my sake, ha ha, yes:
private _args = +[
["_label", localize "STR_KPLIB_LOGISTICS_RADIO_CHANNEL_LABEL"]
, ["_callSign", "$STR_KPLIB_LOGISTICS_RADIO_CHANNEL_CALL_SIGN"]
, ["_permission", "Logistics"]
, ["_chat", _chat]
, ["_voice", _voice]
, ["_color", _color]
];
private _channel = [_args] call KPLIB_fnc_radios_custom;
HOW
get works with HASHMAPs
try this```sqf
private _id = radioChannelCreate [[1,0,1,1], "theLabel", "theCallsign", [player]];
player customChat [_id, "Hello there"];
but but.. thats an array 
yes, _args = createHashMapFromArray _args;
with a absolutely needless copy :u
createHashMapFromArgs what
typos π
agrrrrrr
okay will do...
hmm ok that does work
indeed
call sign is this, '$STR_KPLIB_LOGISTICS_RADIO_CHANNEL_CALL_SIGN', should lookup from string table?
General kenobob
dunno
check all your values
ze simple code werkz, therefore issue somewhere before π
Don't see why it would if you don't do localize
according to the docs that is one of the allowed patterns, is it not? "$..." and several "%..."
but I can try simply localize and see if that makes a difference
at least according to this obscure reference:
https://community.bistudio.com/wiki/radioChannelSetCallSign
only mentioned here by virtue of the examples:
https://community.bistudio.com/wiki/radioChannelCreate
radioChannelSetCallSign != radioChannelCreate
the examples on radioChannelCreate don't show localized strings
as I read those two references localization happens from that pattern on the client machine
either from the '%...' pattern or the '$...'. can you tell me how that should read, then?
yo I appreciate that man, thankfully I figured it out and wrote one very similar π
back in a moment. will try without the fancy localization reference.
when discovering, go simple, then add the sparkles π
what Dedmen says is
https://community.bistudio.com/wiki/radioChannelCreate does not mention localized "$str" string; only https://community.bistudio.com/wiki/radioChannelSetCallSign does
okay I think I got it figured out. double checking adding player to the channel.
the good news is that, through and through, the localization template does work.
w00t!
No problem, glad you figured it out
ah I see also... the player object that connects is not the same one that 'deploys' to the field in the mod.
Big discovery after much frustration:
Get a turret to look at something:
Gunner _myCar doWatch _thisPos.
(Pos works better than object)
Dont know why i had so much trouble in the past with that
Im trying to add "stateIgnore: Boolean - (Optional, default false) Whether to ignore if the Unit is dead and/or cannot move"
to this vVv
_sequence = [cc130, _movementData] spawn BIS_fnc_UnitPlay;
i tyed
_sequence = [cc130, _movementData,true] spawn BIS_fnc_UnitPlay; but didnt work
yep
you provided varDone here
https://community.bistudio.com/wiki/BIS_fnc_unitPlay
[unit, data, varDone, stateIgnore, obsolete_1, obsolete_2, skipTime]
@brisk harness nil, true or [], true
so it will not assume default if theres parameters befor a changed parameter?
it does not guess what you try to set, no
Sorry to bother ya'll,
I've been trying to blacklist blank ammo and so far I looked into config dumps (https://forums.bohemia.net/forums/topic/191737-updated-all-in-one-config-dumps/) and the arma website for cfg. (https://community.bistudio.com/wiki/Arma_3:_CfgMagazines) for their class names but... I can't find them.
Why does the wiki lists "B_BlankRound" but it's no where to be found on config dumps? Which is a more reliable source to go search for stuff like this. So far I know how to get rid of "ACE_PreloadedMissileDummy" from NLAW. But I'm not sure where to even find more blank round class names to filter out.
Also does anyone know what "Fakemagazine" and "Fakeweapon" they look like it's being used as some kind of a holder for mounted weapons on vehicles? but I assume blacklisting them is not good.
@winter rose thank you! fixed the error and my weird play back!
Yo guys i have a scp composition and i want it to kill someone when it touches them triggers are not working for some reason.
how would i specify an entity for this to attach to?
private _posATL = player modelToWorld [0,10,0];
// Fire
private _ps0 = "#particlesource" createVehicleLocal _posATL;
_ps0 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 10, 32], "", "Billboard",
0, 1, [0, 0, 0.25], [0, 0, 0.5], 1, 1, 0.9, 0.3, [1.5],
[[1,1,1, 0.0], [1,1,1, 0.3], [1,1,1, 0.0]],
[0.75], 0, 0, "", "", _ps0, rad -45];
_ps0 setParticleRandom [0.2, [1, 1, 0], [0.5, 0.5, 0], 0, 0.5, [0, 0, 0, 0], 0, 0];
_ps0 setDropInterval 0.03;
// Smoke part 1
private _ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 1], "", "Billboard",
1, 10, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
[[0.3, 0.3, 0.3, 0.33], [0.4, 0.4, 0.4, 0.33], [0.2, 0.2, 0, 0]],
[0, 1], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0, 0, 0], [0.33, 0.33, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps1 setDropInterval 0.5;
// Smoke part 2
private _ps2 = "#particlesource" createVehicleLocal _posATL;
_ps2 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 9, 1], "", "Billboard",
1, 15, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
[[0.1, 0.1, 0.1, 0.75], [0.4, 0.4, 0.4, 0.5], [1, 1, 1, 0.2]],
[0], 1, 0, "", "", _ps2];
_ps2 setParticleRandom [0, [0, 0, 0], [0.5, 0.5, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps2 setDropInterval 0.25;```
also would that also function in MP?
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
how would i specify an entity for this to attach to?
What do you mean?
also would that also function in MP?
No
im creating a downed plane mp mission, ide like to attach an effect to the plane and have it be visible to players
see attachTo documentation?
no
because I don't know his level of knowledge or knowledge structures ^_^
Well, the joke is that I sent the main page for the wiki...
I got that dw π
Had me worried! π
{_x setDamage 1;} foreach thisList;
In the trigger Activation and set the trigger to "present" + "amy player"
So question, I'm trying to spawn a unit using a script, but somehow the unit always "puts away their weapon" in an extremely laggy animation first. Any way I can prevent that?
private _ref = _this select 0;
private _pos = getPos _ref;
private _dir = getDir _ref;
private _grp = createGroup civilian;
private _unit = _grp createUnit ["C_man_p_beggar_F", _pos, [], 0, "FORM"];
_unit setDir _dir;
_unit setFormDir _dir;
_unit attachTo [_ref];
_unit setCaptive true;
because of attachTo
_unit setDir _dir;
_unit setFormDir _dir;
???
you're attaching the unit. what's the point?
hm
good point
lmao
ok for all intents and purposes that I need, doing _unit disableAI "all" seems to not make him swap out his invisible weapon
I'm spawning a beggar, so idk why it even spawns as if they're holding a weapon.
that's their default animation
ye but when I spawn a dude in zeus/eden, they don't do that lol
if you want to skip the animation just do:
_unit switchMove "AmovPercMstpSnonWnonDnon"
I think
oh I'll give that a try too
test the animation name yourself (I wrote that from memory)
for now I got
private _ref = _this select 0;
private _pos = getPos _ref;
private _grp = createGroup civilian;
private _unit = _grp createUnit ["C_man_p_beggar_F", _pos, [], 0, "FORM"];
_unit attachTo [_ref];
_unit setCaptive true;
// set unit loadout, removed for brievity
_unit disableAI "all";
I think a simple _unit switchAction "STOP" will work too
Hey everyone I was wondering if someone can point me in the direction of knowledge to fulfill this idea.
Effectively what i want to do is:
Have a player be able to look at a unifrom object and get an addaction to tear it into rags, and add a first aid kit to the said players inventory. the main thing i am having trouble finding is how do i make it for a) all uniform objects and b) obj cursor stuff
_unit disableAI "ANIM"; seems sufficient, I don't need these units to move ever again. In fact, they'll be deleted a couple seconds later :P
The only thing I'm still struggling with is I call _unit setFace "myCustomFace", and it seems to work the first time, but on the second time, it quickly shows myCustomFace and then reverts back to a random vanilla head...
Is that caused by the identity not having the head I'm assigning it to?
yep
using setIdentity instead of setFace seemed to fix it

Is it possible to create a map cover mid-game or to move an already exsiting one to a different part of the map?
If yes, how?
BIS_fnc_moduleCoverMap I guess
Thanks
Help you in a couple hours when I get home
cheers mate I will be asleep by then most likely but any advice would be a godsend
Q: re: custom radio channels and map markers... is there a way to hide markers completely when players are not added to the channel? I do not mean grayed out, but removed from their maps entirely.
deleteMarkerLocal or setMarkerAlphaLocal
alpha, got it, thank you
Alpha makes them invisivlr but doesnt delete them. So be careful with it .
Dont confuse it with deletion
correct, I understand. also needing to be aware of potentially JIP concerns. and bookkeeping + managing which players should see that behavior.
I would think, though, that they would be auto-alpha'ed when player is not added to the custom channel, or has been removed. however, I guess not.
If yiu make all invisible at start and only reveal on channel join, then yes
Q: how does the marker naming convention work when you start mixing channels etc.
i.e. vis-a-vis _USER_DEFINED #<PlayerID>/<MarkerID>/<ChannelID>
or, <ChannelID> - id of the chat channel on which marker was placed
https://community.bistudio.com/wiki/allMapMarkers
thanks...
Good day. Can i lock a player in free look mode (like if he is pressing left alt)?
not with scripting
but I think if you make an animation for that you can
@little raptor thanks for the answer. For that i will need to use a mod?
yes. you have to create a mod and add that animation
I think you should set aiming = "Empty" and aimingBody = "Empty" in the anim's config
if you don't want to create an animation yourself (rtm), just use a vanilla animation as the base, and create a new anim config
Nice! Thanks a lot π―
if I make an effort to maintain unique naming conventions, is that a problem ever?
Can I somehow force the player/AI to un-holster their weapon while skydiving and be able to shoot (while in the skydiving animation)?
What you use for your scripted markers is entirely your thing, unless you want them to be deletable by the player.
how do i know if an effect will be visable in a multiplayer setting? (smoke, fire, ect)
afaik they never are. you have to create effects locally for each client
I used this to create smoke & fire (serverside) and it was visible for all players without executing it for every client..
"test_EmptyObjectForSmoke" createVehicle (getPos this);
"test_EmptyObjectForFireBig" createVehicle (getPos this);
is there a way to get this to do that?
private _posATL = player modelToWorld [0,10,0];
// Fire
private _ps0 = "#particlesource" createVehicleLocal _posATL;
_ps0 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 10, 32], "", "Billboard",
0, 1, [0, 0, 0.25], [0, 0, 0.5], 1, 1, 0.9, 0.3, [1.5],
[[1,1,1, 0.0], [1,1,1, 0.3], [1,1,1, 0.0]],
[0.75], 0, 0, "", "", _ps0, rad -45];
_ps0 setParticleRandom [0.2, [1, 1, 0], [0.5, 0.5, 0], 0, 0.5, [0, 0, 0, 0], 0, 0];
_ps0 setDropInterval 0.03;
// Smoke part 1
private _ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 1], "", "Billboard",
1, 10, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
[[0.3, 0.3, 0.3, 0.33], [0.4, 0.4, 0.4, 0.33], [0.2, 0.2, 0, 0]],
[0, 1], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0, 0, 0], [0.33, 0.33, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps1 setDropInterval 0.5;
// Smoke part 2
private _ps2 = "#particlesource" createVehicleLocal _posATL;
_ps2 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 9, 1], "", "Billboard",
1, 15, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
[[0.1, 0.1, 0.1, 0.75], [0.4, 0.4, 0.4, 0.5], [1, 1, 1, 0.2]],
[0], 1, 0, "", "", _ps2];
_ps2 setParticleRandom [0, [0, 0, 0], [0.5, 0.5, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps2 setDropInterval 0.25;
not that i know, if you want to use that you have to execute that on every client like Leopard20 said.
that's not a particle effect
i know
is there an easyer way to get a downed plane effect (not exploded)... ive been in the editor all week and so far i have the opening scene @90% complete
idk if anything else i have done so far will even be useable in multiplayer
vis-a-vis the naming conventions? i.e. <Channel-ID> ...
That's not me, or 'my thing' saying that, that's the docs saying that.
I just need to know when that is the case.
is it possible to get creator of simpleobject? i mean by which client it was created global?
no
but you can setVariable
(know that the creator can be disconnected, too)
okay thx π
yes get its netid, grab the ownerid of the creator out of there, and then find it by checking the ownerid's of all players
okay thx π
//[CONTROL, STRING, PATH] call fn_Blah
params ["_control", "_mode"];
_configSizePath = param [2, configFile];
There's a better way of writing this so that I require the first two but not the third right...?
I don't really wanna define defaults to the first two
how to make units get in 2 vehicles
what do you mean? π two units in two diffrent vehicles? @fading dust
danger.fsm. Does the dangercausedby value sometimes undefined for "Enemy Detected" danger cause?
How do I check if a weapon has an underbarrel grenade launcher?
Check its muzzles in the config
Is there an EH that detects a new line added in CT_Edit? For example the user doing Shift and enter or should I jsut monitor this key press
no such EH AFAIK
Yeah couldn't see one just wanted to double check
I imagine an event handler as a table(or other dataset) of scripts, that is executed every time the underlying event happens. addEventHandler just adds a new entry to that pre-mentioned table (no loops involved) - does that make sense?
ye
thx
hey yall just asking again with a twist. Does anyone know how I can add an add action to every uniform item? ie; if a player takes the uniform off it will be applied to that. or enemy uniforms if they are taken off.?
if they are actually taken off by some unit, you can use the "Put" event handler and add it to all units. you can use CBA's extended event handlers for that
however it won't work for the case where the uniforms are added by scripts/already placed in containers
Hello. I'm trying to add smoke/fire to my helicopter crash script. I've tried attachTo with smoke/fire modules but it didn't work. How can I do that?
ah no dice with that way then
you still get what you want mostly though. whats the end result that you are looking for?
Can someone point towards something that would help me make an add-on/mod from scratch?
Cause literally 90% of the tutorials I've found are for how to put your own uniform/vest/model in ARMA and the rest are either outdated or contain little to no information.
i think @little raptor is going to do a wiki write up at some point. how I learned was I reverse engineered single pbo mods until I figured it out. I still get lost on multi pbo mods like ACE and how they set up the file organization and cfgPatches
the tutorial assumes that you're already familiar with configs tho
Except I'm not. 
Is the config.cpp where I write the main script for what I'll be trying to achieve?
Explains the configs
https://community.bistudio.com/wiki/Class_Inheritance
Interesting assumption, how can one without making an addon have an idea about configs? 
it's about making the pbo itself
Which is the core thing to create an addon?
This page explains the steps required to create an addon (PBO file).
both
but #community_wiki plz
hi
so
i am working on several factions where units spawn in with randomized gear
and im pretty sure i did it horribly
i mean it works and all
but i dont know if it will work in multiplayer
if it causes issues with the server or clients
class EventHandlers : EventHandlers {
class CBA_Extended_EventHandlers : CBA_Extended_EventHandlers_base {};
init = "if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear; (_this select 0) addVest (selectrandom [ ""CUP_V_OI_TKI_Jacket5_04"", """", """", """", """"]); (_this select 0) addHeadgear (selectrandom [ """", ""H_FakeHeadgear"", ""SRB_Komitska_Kapa"", ""SRB_Komitska_Kapa_Orao"", ""SRB_Komita_Sajkaca"", ""SRB_Komita_Sajkaca_Eaglecockade"", ""SRB_Komita_Sajkaca_Emblemcockade"", ""SRB_Komita_Hat"", ""SRB_Komita_Hat_Tilted"", ""SRB_Licka_Kapa""]); (_this select 0) forceAddUniform (selectrandom [ ""SRB_Komita_jacket"", ""SRB_Komita_Military_uniform"", ""SRB_Komita_suit"", ""SRB_Komita_Black_uniform"", ""SRB_Komita_White_uniform""]); (_this select 0) addBackpack (selectrandom [ ""SRB_Komita_Double_Bandolier_Black"", ""SRB_Komita_Left_Bandolier_Black"", ""SRB_Komita_Right_Bandolier_Black"", ""SRB_Komita_Double_Bandolier"", ""SRB_Komita_Left_Bandolier"", ""SRB_Komita_Right_Bandolier""]); (_this select 0) addPrimaryWeaponItem ""lib_acc_k98_bayo""; (_this select 0) addMagazines [""CSA38_7_92_5xMauser"", 20]; sleep 1; (_this select 0) addGoggles (selectrandom [ """", ""aif_mustache"", ""VSM_beard_2"", ""drrpg_english_mustache"", ""drrpg_english_mustache_black"", ""drrpg_english_mustache_black"", ""drrpg_english_mustache_black"", ""drrpg_verdi"", ""TRYK_SBeard_BK"", ""TRYK_SBeard_BW""]);};";
};```
this is in the unit config
im doing it wrong aint i
should work?
for one thing no one is gonna look at it here like that
use syntax highlighting
if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear; (_this select 0) addVest (selectrandom [ ""CUP_V_OI_TKI_Jacket5_04"", """", """", """", """"]); (_this select 0) addHeadgear (selectrandom [ """", ""H_FakeHeadgear"", ""SRB_Komitska_Kapa"", ""SRB_Komitska_Kapa_Orao"", ""SRB_Komita_Sajkaca"", ""SRB_Komita_Sajkaca_Eaglecockade"", ""SRB_Komita_Sajkaca_Emblemcockade"", ""SRB_Komita_Hat"", ""SRB_Komita_Hat_Tilted"", ""SRB_Licka_Kapa""]); (_this select 0) forceAddUniform (selectrandom [ ""SRB_Komita_jacket"", ""SRB_Komita_Military_uniform"", ""SRB_Komita_suit"", ""SRB_Komita_Black_uniform"", ""SRB_Komita_White_uniform""]); (_this select 0) addBackpack (selectrandom [ ""SRB_Komita_Double_Bandolier_Black"", ""SRB_Komita_Left_Bandolier_Black"", ""SRB_Komita_Right_Bandolier_Black"", ""SRB_Komita_Double_Bandolier"", ""SRB_Komita_Left_Bandolier"", ""SRB_Komita_Right_Bandolier""]); (_this select 0) addPrimaryWeaponItem ""lib_acc_k98_bayo""; (_this select 0) addMagazines [""CSA38_7_92_5xMauser"", 20]; sleep 1; (_this select 0) addGoggles (selectrandom [ """", ""aif_mustache"", ""VSM_beard_2"", ""drrpg_english_mustache"", ""drrpg_english_mustache_black"", ""drrpg_english_mustache_black"", ""drrpg_english_mustache_black"", ""drrpg_verdi"", ""TRYK_SBeard_BK"", ""TRYK_SBeard_BW""]);};

if (local (_this select 0)) then
{
[(_this select 0), [], []] call BIS_fnc_unitHeadgear;
(_this select 0) addVest (selectrandom [ "CUP_V_OI_TKI_Jacket5_04", "", "", "", ""]);
(_this select 0) addHeadgear (selectrandom ["", "H_FakeHeadgear", "SRB_Komitska_Kapa", "SRB_Komitska_Kapa_Orao", "SRB_Komita_Sajkaca", "SRB_Komita_Sajkaca_Eaglecockade", "SRB_Komita_Sajkaca_Emblemcockade", "SRB_Komita_Hat", "SRB_Komita_Hat_Tilted", "SRB_Licka_Kapa"]); (_this select 0) forceAddUniform (selectrandom [ "SRB_Komita_jacket", "SRB_Komita_Military_uniform", "SRB_Komita_suit", "SRB_Komita_Black_uniform", "SRB_Komita_White_uniform"]); (_this select 0) addBackpack (selectrandom [ "SRB_Komita_Double_Bandolier_Black", "SRB_Komita_Left_Bandolier_Black", "SRB_Komita_Right_Bandolier_Black", "SRB_Komita_Double_Bandolier", "SRB_Komita_Left_Bandolier", "SRB_Komita_Right_Bandolier"]); (_this select 0) addPrimaryWeaponItem "lib_acc_k98_bayo"; (_this select 0) addMagazines ["CSA38_7_92_5xMauser", 20]; sleep 1; (_this select 0) addGoggles (selectrandom [ "", "aif_mustache", "VSM_beard_2", "drrpg_english_mustache", "drrpg_english_mustache_black", "drrpg_english_mustache_black", "drrpg_english_mustache_black", "drrpg_verdi", "TRYK_SBeard_BK", "TRYK_SBeard_BW"]);
};
weird
oh, it's just the SQF size @little raptor
should
if (local (_this select 0)) then
{
[(_this select 0), [], []] call BIS_fnc_unitHeadgear;
(_this select 0) addVest (selectrandom [ "CUP_V_OI_TKI_Jacket5_04", "", "", "", ""]);
(_this select 0) addHeadgear (selectrandom _theHeadgearList);
};
oh okay thank you
sleep 1;
just checking to be sure in case i dont ruin a session i was gonna host
yes how would i implement that into the script
because the first part confuses me
i read somewhere that you can only put sleep in certain places under certain circumstances
so i dont know where to put it here
spawn
you will have to pass parameters```sqf
_this spawn {
sleep 1;
// your code
};
if (local (_this select 0)) then
_this spawn {
sleep 1;
// my code
};};```
this way?
for example yes
what I would do:```sqf
if (local (_this select 0)) then
{
// _this spawn { // works too
[_this select 0] spawn {
params ["_theUnit"];
sleep 1;
// my code
_theUnit addVest // ...
};
};
Is it possible to destroy the render pips for an array of vehicles (mirrors, cameras) so that disabling pips in video options isn't necessary?
no
poorly formulated question, my bad. I guess I was shocked to see the performance cost of the render pip. I didn't realize the pip is only rendered when a player is in a vehicle. I thought the crushing framerate was a result of the pip being rendered on multiple vehicles but no, it's just the one currently occupied.
Technically this destroys the cameras but not in any desirable way,
{
this cameraEffect ["terminate","back", _x]
}forEach ["rendertarget0", "rendertarget1", "rendertarget3"]
Accidentally posted this in editor instead, my bad! I was wondering if I could get a bit of help from someone with a bit more skill at scripting than me. I've got a portion of a mission where I have friendlies entering a nightclub. This is more for ambience's sake, but I was hoping to trigger a ColorCorrections effect which changes the screen tint between red, blue, green and yellow every few seconds, to simulate being in a nightclub environment. If someone has the time and would be willing to help, or even just point me in the right direction I'd really appreciate it!
I understand the usage of the effect, I'm more wondering how to make it alternate and loop. The best alternative I've got the skills to do right now is just make a bunch of square triggers all over the floor and hope people run into them, which would be disorienting and probably not worth it π
oh, no. We can build a loop just based the example from the wiki.
_colors = [
[1,0,0,0.25],
[0,1,0,0.25],
[0,0,1,0.25]
];
_colorIndex = 0;
while {true} do {
_color = _colors#_colorIndex;
_ppeffect ppEffectAdjust [...];
_colorIndex = (_colorIndex + 1) % count _colors;
sleep 0.25;
};
something like that. I'm not familiar with ppEffects so it's up to you to make it work.
Thank you very much! π I'm not super familiar with the scripting language itself, but I've played with effects a fair bit, so I'm sure with that I can make some sort of frankensolution π
@little raptor 's example is tighterβ this is just the wiki example in a loop. You can add colors to the color array and end the loop with missionNameSpace "club_lights",
colors=[
["ColorCorrections", 1500, [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]]]
];
colors spawn {
waitUntil { sleep (random 10);
if (missionNameSpace getVariable ["club_lights", true]) then {
(selectRandom _this) params ["_name", "_priority", "_effect", "_handle"];
while {
_handle = ppEffectCreate [_name, _priority];
_handle < 0
} do {
_priority = _priority + 1;
};
_handle ppEffectEnable true;
_handle ppEffectAdjust _effect;
_handle ppEffectCommit 5;
waitUntil {ppEffectCommitted _handle};
sleep 3;
_handle ppEffectEnable false;
ppEffectDestroy _handle;
};
!(missionNameSpace getVariable ["club_lights", true])
}
};
Hey guys just a quick question, How to do that playMusic will be Global?
remoteExec it
Thanks! π
Is there a variable that's scope is within the mission, and not outside?
so for example, I have 2 SQF scripts
same trying to get randomzied weapons to work (from a specified pool), tried selectRandom but didn't work
and I don't want the variable to go outside the mission I'm making
it⦠won't? if you use default global variables
mySuperVar = 666;
// identical to
missionNamespace setVariable ["mySuperVar", 666];
really? I've been under the impression that i should avoid using global variables due to them being out of the mission scope
nope, nevah
okay, thanks!
if (!local this) exitWith {};
comment "Remove existing items";
removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;
comment "Randomize weapons";
private _gunArray = [["rhs_weap_akm", "rhs_30Rnd_762x39mm", "rhs_30Rnd_762x39mm_polymer_tracer"],["rhs_weap_ak74n", "rhs_30Rnd_545x39_7N6M_AK", "rhs_30Rnd_545x39_AK_green"]];
private _gunInfo = selectRandom _gunArray;
comment "Add weapons";
this addWeapon _gunInfo select 0;
this addPrimaryWeaponItem "rhs_acc_dtkakm";
this addPrimaryWeaponItem _gunInfo select 1;
this addWeapon "rhs_weap_tt33";
this addHandgunItem "rhs_mag_762x25_8";
comment "Add containers";
this forceAddUniform "UK3CB_TKM_O_U_05";
comment "Add items to containers";
for "_i" from 1 to 2 do {this addItemToUniform "FirstAidKit";};
for "_i" from 1 to 2 do {this addItemToUniform "rhs_mag_762x25_8";};
for "_i" from 1 to 4 do {this addItemToUniform _gunInfo select 1;};
for "_i" from 1 to 2 do {this addItemToUniform _gunInfo select 2;};
this addHeadgear "UK3CB_H_Shemag_red";
comment "Add items";
this linkItem "ItemMap";
this linkItem "ItemCompass";
this linkItem "ItemWatch";
this linkItem "ItemRadio";
comment "Set identity";
[this,"PersianHead_A3_03","male01per"] call BIS_fnc_setIdentity;```
a friend sent me this, i tried it but it did not grab either ak and said items couldn't be found
you don't have the needed mods (most likely RHS)
i had RHS installed, TT-33 was given but AKs were not
@rose pike
this addWeapon _gunInfo select 0;
``````sqf
this addWeapon (_gunInfo select 0);
```should be enough
same with ```sqf
this addPrimaryWeaponItem _gunInfo select 1;
i'll test when i can
How does command of AI units work? As in, how do I script it so that if a player gets in a vehicle with an AI driver as the gunner, they can control the vehicle with WASD?
1/ make the gunner the effective commander
or
2/ use remoteControl (I think it works)
@winter rose will 2 let them still shoot
I think so yes
how about when they get out
then un-remoteControl
would I have to script setting control back to their unit
and then follow up how would 1 work
what makes a unit the effective commander
rank?
now i just need to add the ace throwable.... p a i n
almost a week on, guess what
ace_Advanced_throwing_enabled = false;
thankyou ace for being simple
Yeah π
_dammages = _dammages - 0.25;
if (_dammages < 0) then {_dammages = 0};
_dammages = (_dammages - 0.25) max 0;
animationState player == "ainvpknlmstpslaywrfldnon_amovpknlmstpsraswrfldnon" || !alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5};
if (vehicle player != player) then {exitWith {_cancelled = true};};
if (!alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5) then {exitWith {_skip = true};```
wtf?
oh

Don't mind that, I'm trying desperately to fix a bug in that code lol
So there's some redundancy
well all of these are nonsense: then {exitWith {};}
Yeah, fixed them
those damn magesβ¦
Im still waiting for Leo's comment on for loop :grabs popcorn:
didn't even see it 
/*
Script: Engineer Skill System by Benny.
Description: Add special skills to the defined engineer.
*/
Private ['_dammages','_skip','_vehicle','_vehicles','_z'];
_vehicles = player nearEntities [["Car","Motorcycle","Tank","Ship","Air","StaticWeapon"],5];
if (count _vehicles < 1) exitWith {};
_vehicle = [player,_vehicles] Call WFBE_CO_FNC_GetClosestEntity;
_dammages = getDammage _vehicle;
if (_dammages <= 0) exitWith {};
WFBE_SK_V_LastUse_Repair = time;
_skip = false;
_cancelled = false;
for [{_z = 0},{_z < 3},{_z = _z + 1}] do {
sleep 0.5;
player playMove "AinvPknlMstpSlayWrflDnon_medic";
sleep 0.5;
waitUntil {animationState player == "ainvpknlmstpslaywrfldnon_amovpknlmstpsraswrfldnon" || !alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5};
if (vehicle player != player) exitWith {_cancelled = true};
if (!alive player || vehicle player != player || !alive _vehicle || _vehicle distance player > 5) exitWith {_skip = true};
};
if (!_cancelled) then {
if (!_skip) then {
_dammages = _dammages - 0.25;
if (_dammages < 0) then {_dammages = 0};
_vehicle setDammage _dammages;
};
};
The situation is critical then
just modify original code, dont keep pasting ur code again and again or Lou will use his banhammer
?
or yeah u can delete previous ones too 
if (!_cancelled) then {
if (!_skip) then {
//
if (!_cancelled && !_skip) then {
_cancelled is not even necessary I think? I just want to prevent players from exploiting the repair functionality. (Atm they hop out of damaged vehicle, start the action/animation and get in the vehicle instantly after that, that results in the vehicle being repaired successfully prematurely.)
I'm not sure whether the bug is caused by the semantics of the script or it's caused by some syntax error (as I still get the error with the last bracket in the script)
I can't find any reason for it, that's the thing π
What error do you get?
arma2:OA. Is there a way, via script, to force an AI unit to disengage and to move?
setBehaviour "CARELESS" + move order?
also set fire mode to BLUE or something
does that change the behavior of the unit or of the whole group?
what trick?
create a temp group, join the unit into that temp group, set behavior or combat mode on the temp group, move him back into original group and delete the temp group
sounds like an illegal char error? 
No, too many things could go wrong there.
So there's no normal way of forcing a single unit to move?
I have never seen such error, I think it is either illegal character or mmmmmmmmmmmmmmmaybe so many stuff in if () conditions has messed up priority, confusing them?
actually i believe so
someone showed me a script demo for firing lines - musket combat
all AI would make a 2 column line, front crouch and rear stand. if anyone in the front would die then the rear would backfill
I thought u were going to talk about a trick that makes a single unit change combatMode I misread that.
yes, I did
i assumed he made them all an array and orchestrated their movement (individual groups being ordered as if they are all one)
oh he means their stance / combat ready
not their actual movement
kekw
i didnt scroll up
there are several things you can try
for example disabling AUTOTARGET and TARGET and AUTOCOMBAT
whilst im here, could someone solve a problem for me?. nothing complex i just feel ive made a stupid mistake
execVM "BassbeardsExtenders\drawleadership.sqf";
if (hasInterface) then {
//Sets a variable to players "safezone" indicating safe mode is on, required to break the loop later
safezone = true;
//displays to players that safe mode is on
cutRsc ["SafetyOn", "PLAIN"];
hint "in safe zone";
//disables all damage and swapping weapons
player allowDamage false;
player action ["SwitchWeapon", player, player, 100];
ace_Advanced_throwing_enabled = false;
//adds eventhandler to stop double tap G or G press so no accidental grenades
throwable_mags = [];
"throwable_mags append getArray( _x >> 'magazines' )" configClasses( configFile >> "CfgWeapons" >> "Throw" );
throwable_mags = createHashmapFromArray (throwable_mags apply {[_x, nil]});
player addEventHandler ["FiredMan",
{
params ["_unit", "", "", "", "", "_magazine", "_projectile"];
if ( _magazine in throwable_mags ) exitWith
{
HintSilent "You attempted to throw a grenade";
deleteVehicle _projectile;
};
}];
//deletes your bullets as they leave your gun
player addEventHandler ["Fired", {
params [
"_unit",
"_weapon",
"_muzzle",
"_mode",
"_ammo",
"_magazine",
"_projectile"
];
if (isNull _projectile) then {
_projectile = nearestObject [_unit, _ammo];
};
deleteVehicle _projectile;
}];
//Creates an infinite loop based on the variables state that we set earlier, will constantly loop you so you can equip your weapon
//To break the loop set "safezone" to false - safezone = false
while {safezone} do
{
player action ["SwitchWeapon", player, player, 100];
sleep 1;
};
};
this was all functional until i misclicked and then it broke
a3 isnt throwing any errors
Ctrl+Z then
it just isnt behaving the same
i did and it still broken, which is what concerns me
Not seen AUTOCOMBAT before, is there a wiki page for that?
its an ai behaviour
Yeah I want to know the specifics though
looks like A3 only
click show list on string values
AUTOTARGET should work tho
uh cant u just try doStop this;
will stop all its actions and should reset the ai
(a2)
I could swear I had seen Arma 3 logo near that despite I remember it existing for an eternity 
I'll try those.
will a domove undo a dostop? such that they're able to resume moving normally?
but if the unit is stopped using the commanding menu it won't
with doStop, you can order and they will move
with stop, no
I remember reading somewhere about a command that can toggle on or off a unit's built-in cover seeking ability. Does anyone remember the name of that function for A2?
sure. but doStop != commanding menu stop
disableAI "COVER" 
think that's a3 only
how so though? I always seen them as identical
nope. player issued commands are more strict
can't be undone using doMove or doStop
"Just move to A3"
I read one for a2 but I cannot remember where or what it was called
I tested it now, it doesnt look so.
what did you test?
I tried and it could not π
I did a 2, halt
then tried joe doMove getPos player etc, wouldn't
You just have rookies that must be why 
I did 1-6 then issued a doMove ?
huh? 
nope. player issued commands are more strict
can't be undone using doMove or doStop
did you even give them a player command?
what I said is true anyway. so no need for you guys to test
dont you mean "ordering an halt order" --->> Issued 1-6 on commanding menu
I guess so yeah
Issued 1-6 then used doMove , the unit moves to the targeted position.
did you select any AI?
yes, I know how to use AI
, it is literally the reason I buy Arma 
well just to be sure I did a test myself. and as I said it doesn't work
So just to be clear, You make it stop with player issued order from commanding menu and then, doMove doesnt make that unit move to a new position? 
yes
are you sure you're trying in vanilla?
π
I think I mixed up the variables of the squad I created nvm 
gniiiiiiiii
'night π (mind the flying hammer)
was there an update or soemthing that broke
player action ["SwitchWeapon", player, player, 100];
nolonger puts your gun on your back
try 299
_unit action ["SwitchWeapon", _unit, _unit, 299];
this is such a ludicrous fix idea i love it and im gonna test it
this worked
i have no fucking idea why
but perfect
thankyou so much
haha
legit one second the script worked
magic
you can use weaponState to find things like that
β€οΈ
its part of a safe start script i have worked on, stops u doing everything other than walking / running around and interacting with shiz
so i just need to say "gun on back, loop the action" then when they leave: "gun out, end loop"
and it broke for some reason and gave me pain for 2 hours
hm, wasn't there a "get drop info" on a particle source? I remember it, yet cannot find it 
Q: re: detach versus setPos. it appears like maybe setPos is competing with detach slightly. does not always release the object the position is not always set, or it does not appear to be. do we need to pause, perhaps, until the object is completely free before setting position?
or perhaps even waitUntil {isNull attachedTo _object} ?
How does the geometry of an object work for ai pathfinding and collision registration whilst in midair?
Because if i make an environment on the ground, they seem to navigate fine
but as soon as this environment is raised off the ground (Doesnt matter how much) they consider the geometry LOD to be non existent, substantially phase through the walls and jump off to go a location thats underneath the waypoint
I know they do this when they dont register a valid path to their waypoint
but like yea idk whats going on for them to think like this as soon as they are 0.0000001m off the ground
As they think jumping off a cliff is a more correct path to their waypoint
AI can only use objects that have a path LOD
also, their waypoint destination pos MUST be AGL. Maybe they could use the object if you gave them an exact pos
No. Just stop using setPos
I've added a note on the wiki as to why
But these objects do have a path LOD itβs just when itβs midair it appears to not?
Then give them accurate pos to move to
I think itβs the waypoint yea
Like I said, it must be AGL
Yea cheers Iβll give it a squizz
Don't use waypoints tho
Is there a way to set a custom AGL
I mean I was using them for testing purposes
Like Iβm trying to make a custom environment in midair
And just testing if they actually use their path finding
Wat?! AGL is a position format
https://community.bistudio.com/wiki/Position#PositionAGL
And like I said, don't use waypoints. Use doMove instead
Mid air won't work. Path lod needs a ground connection
Anyone know why only the second addAction works on dedicated and the first one doesn't? It works in SP, hosted MP and my own launched server, but doesn't work on my units server
co addaction ["Start New Mission",
{CODE;},nil,1.5,true,true,"",'!condition',5];
co addaction ["Play Previous Mission",
{CODE;},nil,1.5,true,true,"",'!condition',5];```
where do you add it?
In an .sqf run by command ["scripts\EndMission.sqf"] remoteExec ["execVM", 0];
where?
well I mean how does it execute, and on which PC
Trigger or BIS_fnc_holdActionAdd
By player pc
Really confused about why it runs fine on my server launched with TADST but doesn't work in my units server
what doesn't work?
The first addAction
it's hard to tell without seeing the whole code
They are added in the same way and with the same conditions and still the first one doesn't show up
Trying to fix it by changing the condition for the addactions and running them in init
I need some help. Iβm trying to remove the turret off either the CUP or GM t-55 tank. Can any one help me?
I got kinda close on the T-55 tank using the SetObjectTexture script, but for some reason it removed both the turret and the tracks. Is there anyway for me to specify which one to get ride of?
it would mostly be using animateSource, not object's texture
if the vehicle is not meant to do that, you can't
Ok, so it would be βthis animate source turretβ?
more or less, yes
This would work for setting the players side right? (MP) Because _x is the player so playerSide works?
{
switch (playerSide) do
{
case west: { _x setVariable ["WAG_playersSide", "west"] };
case east: { _x setVariable ["WAG_playersSide", "east"] };
};
}forEach allPlayers;
no
playerSide is "local player's native side"
ah so side player then
no.
You don't even need switch for that
oh yeah 
vehicles may not be configured with such features so it may very well be that you can not do that
_x setVariable ["bla", str side _x]
WFSideText? π¬
(I know, obscure command π€£)
Not in the mood to type that on mobile 
for the record, stringified sides
https://community.bistudio.com/wiki/Side
WTFSideText?! π€£
kinda yes π the command that was created for one game mode
you have to check the vehicle's config files... first look at a vanilla apc, you should see under animationSources that there is a "hideTurret" if that doesn't exist, which I don't think they do on CUP or GM, then you can't do it
I actually got something working. Check the screen shot chat. It looks pretty cool!
can I grab the current iteration index with apply or is forEach really the only way to do it with _forEachIndex
no such thing for apply
you can still make an external _i var and _i++ it (if ++ were accepted in SQF)
Im wounder how to make the sam's more accurate (ive up'ed all ai skills) and how to attach a smoke generator to the plane cuz its not very clear currently (just doing 100% damage on trigger to get current effect) also needs to be visible in multiplayer. https://youtu.be/_ORR7coPWpI
I have this little custom command and I'm getting an issue from _namespace getVariable _variableName. I hinted both values and they came back as Namespace even though they should be missionNamespace, "WAG_unitsKilledCiv". Anyone know could be the issue?
//Caller\\
[missionNamespace, "WAG_unitsKilledCiv", +1, false] call WAG_fnc_updateSetVar;
//WAG_fnc_updateSetVar\\
private _namespace = (_this select 0); //Namespace
private _variableName = (_this select 1); //Variable Name as String
private _newValue = (_this select 2); //Updated Value of Variable
private _isPublic = (_this select 3); //Boolean
//hint format ["%1\n%2",_namespace ,_variableName];
_varValue = _namespace getVariable _variableName;
_varValue = _varValue + _newValue;
_namespace setVariable [_variableName, _varValue, _isPublic];
private _namespace = (_this select 0); //Namespace
private _variableName = (_this select 0); //Variable Name as String
private _newValue = (_this select 0); //Updated Value of Variable
private _isPublic = (_this select 0); //Boolean
how can a single argument be so many things?
use params 
I was told using select was faster?
who told you that?
idk
it's not that much faster
maybe I mixed it up and it was params
for your case it doesn't matter
it'd probably be only 0.002ms faster
you only need that much optimization if you're working with something that runs every frame
and you do it so many times that it takes a significant time (close to 1 ms)
that and it looks much prettier.
I recommend that you test the performance of commands yourself instead of listening to what others say
then do the math and see how much performance you'd be saving if you tried an alternative method
and if it is worth it you can pick the faster method
if I create an addon and I want it to run a script when the mission starts, in my config.cpp, do I add the postInit tag to the function I want it to run? or is it going to attempt to run it in the menu or something
yeah it does run it in the menu too
Hello guys. Does anyone know a way to prevent functions from launching in the main menu? When I set up my functions to pre-init or post-init, they also execute in the main menu but I dont want this to happen.
okay will try that. did you find any issues with it for briefings and stuff?
hmmm... so say I spawn a script instance, it will fire at menu, at briefing, and at mission leaving me with 3 instances if not checked?
no just one
it executes every time a new mission starts
and ends when the mission ends
I've got this code running when someone dies (with the custom command from before) and it works for the most part but every once in a while when 1 unit dies their faction killed count goes up by 2 for some reason and it does that for every kill forwards (unless I end key a unit and then it goes up by one for that unit). (ACE is in mission)
_x addMPEventHandler ["MPKilled", {
params ["_killed", "_killer", "_instigator", "_useEffects"];
[_killed] call KC_fnc_updateDeathCounter;
}];
//KC_fnc_updateDeathCounter\\
if (!isServer) exitWith {};
_killed = (_this select 0);
_killedSide =
if !(isPlayer _killed) then {
_killedSide = side group _killed;
_killedSide;
} else {
_killedSide = _killed getVariable "WAG_playerSide";
[missionNamespace, "WAG_unitsKilledTotal", ((_killed getVariable "WAG_unitsKilledTotal") + 1), false] call WAG_fnc_updateSetVar;
_killedSide;
};
if (_killedSide == CIVILIAN) then { [missionNamespace, "WAG_unitsKilledCiv", +1, false] call WAG_fnc_updateSetVar; };
if (_killedSide == WEST) then { [missionNamespace, "WAG_unitsKilledBlufor", +1, false] call WAG_fnc_updateSetVar; };
if (_killedSide == EAST) then { [missionNamespace, "WAG_unitsKilledOpfor", +1, false] call WAG_fnc_updateSetVar; };
if (_killedSide == INDEPENDENT) then { [missionNamespace, "WAG_unitsKilledIndfor", +1, false] call WAG_fnc_updateSetVar; };
[missionNamespace, "WAG_unitsKilledTotal", +1, false] call WAG_fnc_updateSetVar;
okay, I'll add a waitUntil {time > 0} to prevent it firing in briefing
MPKilled triggers for every PC iirc
Triggered when the unit is killed. EH can be added on any machine and EH code will trigger globally on every connected client and server. This EH is clever enough to be triggered globally only once even if added on all clients or a single client that is then disconnected, EH will still trigger globally only once.
I used to think I was really smart until I started scripting. For some reason when I read that earlier I saw global and was like "It's global so it only runs once"....
it happens to everyone when they're new to something! π
So good news is that the side death counts are accurate, bad news is total killed still goes up by two....
did you change that?
hmm, still getting "cannot import, some items are unavailable" - tried with and without your changes as well as with vanilla weapons, same situation
yeah it's now the local killed EH
Yeah....
_units = allUnits select {alive _x AND !(_x getVariable ["WAG_fnc_markedForDeath",false])};
//systemchat str _units;
{
_x setVariable ["WAG_fnc_markedForDeath",true,true];
_x addEventHandler ["Killed", {
params ["_killed", "_killer", "_instigator", "_useEffects"];
[_killed] call KC_fnc_updateDeathCounter;
}];
} forEach _units;
:/
how's that better?!
just use MPKilled
but only record the death on the server

So I made sure only the server was running it and the death count still goes up by two
if (!isServer) exitWith {};
[missionNamespace, "WAG_unitsKilledTotal", ((_killed getVariable "WAG_unitsKilledTotal") + 1), false] call WAG_fnc_updateSetVar;
[missionNamespace, "WAG_unitsKilledTotal", +1, false] call WAG_fnc_updateSetVar;
don't you read your own code?!
if (_killedSide == CIVILIAN) then {
if (_killedSide == WEST) then {
if (_killedSide == EAST) then {
if (_killedSide == INDEPENDENT) then {
Uuuuuuuuhhh
instead of worrying about how fast select is vs params (which is almost nothing), you might want to optimize that
Hey so I've been creating scripts for my unit, but I want to push them out as mods eventually.
The only issue with that is to make these things usable I would need to create a in game menu or a eden editor module
Not really sure where to start with that, can anyone point me in the right direction?
Thank you
Yeah I just ignored finishing it because the issue came up and never fixed it because it never ran. I also just used the setVar and getVar to see if it was my custom command screwing it up but I still get +2 for the killed total when they get killed by units and +1 when I end key the unit.
if (_killedSide == CIVILIAN) then { missionNamespace setVariable ["WAG_unitsKilledCiv", (missionNamespace getVariable "WAG_unitsKilledCiv") + 1]; };
It seems like when the units kill each other the added score +1 gets doubled somehow
I've got this bit of script in the init of a radio object that when clicked "audio on" it plays sound simultaneously out of two different speaker objects
rad1 addAction ["Audio On", { spk1 say3D ["music", 1000, 1]; spk2 say3D ["music", 1000, 1]; }];
How can i make the music loop? And then could I add something to turn it off?
Is there a way to tell if a unit gets killed by zeus? (End key while in interface, not as player)
yeah
he's dead
Check whatever Killed EH is returning regarding instigator, considering AI is not concerned about kills caused by "natural causes", there surely is a way.
There a way to tell if a player is in the zeus interface?
u can check if curatorCamera returns an object
Actually just found this
"It's a slightly old thread, but I found a solution and wanted to document it.
_display = findDisplay 312;
returns a display if the curator interface is open. It return null if not.
You can use
if ( !isNull(findDisplay 312) ) then { ... interface is open ... };"
Anyone able to confirm?
like this?
_x addMPEventHandler ["MPKilled", {
params ["_killed", "_killer", "_instigator", "_useEffects"];
{
_object = curatorCamera;
if !(_object == objNull) then {hint "Player is in zeus interface"};
} remoteExec ["call", _instigator];
}];
unsure if this would classify as dialog or scripting but unable to find a function or post relating to this, but its there a way to make a password box use a 'password char' ie * .
Or is it a chase of having a weird loop constantly running counting the chars inside and then throwing that to another var and replacing?
(leopard if you say 2.06...
)
can't compare objNull this way
use isNull
You can just script it, use keyDown event handler for wherever this pass is being written, then make it replace it with * ? Record the value somewhere else instead.. (No loop is required due keyDown EH)
I am 99.99% sure there is no vanilla function. 
whats the fastest way to test addons as you make changes to them? I'm having to restart the game every time
currently its
addonName\addons\@addonName.pbo
and i just add it as a local file and I have to repack the .pbo with every change
I meant as in dev/stable/diag 
oh just sittin on stable atm
and its just a sqf tweak in one of the functions as i test it
I personally got a mission for each of my mods, with allowFunctionRecompile = 1 in description.ext , with filePatching on ofc.
open function viewer and recompile whatever func u want(which is greyed if ...recompile = 0)
whatever your addon's prefix is, the filePatching is checking that destination to see if there are any changes..
okay good to know i'll try it
ofc the root is being a3 folder
can I do it from somewhere easier like my scripts folder in docs?
no, filepatching for safety reasons only allows files to be loaded from a3
Leopard is about to write, he has a different way (easier according to him) so u may wanna hear that out too.
Creating a mission is the best way imo
Just put a folder inside the mission folder and set the name the same as your addon prefix
Then put the config.cpp and stuff in it
And #include the config.cpp file in description.ext
As for functions just recompile them
If you use my mod, it has a button for it in the function viewer
Select your function tag and hit recompile subclasses
You can also make your own script that recompiles the functions (that's how I do it)
Doh, well that was more simply than I thought
all working
Β―_(γ)_/Β―
Elaborate pls?
kk noted, thanks
It's just a sqf file that calls BIS_fnc_recompile for all my functions. Nothing fancy 
I call the script from a commanding menu
Are you solely doing it for the sake of avoiding recompiling everything , and only your functions?
Yes
pushing recompile all button is faster than rewriting the same functions over n over again, my preference
Rewriting what?
what particle source could I use for underwater... uh... heal effect? currently if I use "billboard", the smoke does not show underwater
then don't use "Billboard", try "SpaceObject"
(though I am not sure this is the issue, it might)
follow up question. say I'm using the class "AirFireSparks" and I want to change its color. do I have to copy over all the params for setParticleParams? or can I just change a single param?
probably an easier way is to do it config based define and inherit the sparks class I think
yep to copy all & yep to config
I'm brand new to scripting... be gentle. I got something working in the editor and am trying store hits and misses of a pop-up target for each player. Only one player at a time when he is in the trigger area. I got it registering hits and misses but I am not sure how to store individual players scores into variables. SO MUCH TO LEARN! I'm just overwhelmed reading all the bikis.
@orchid nymph How are you registering hits and misses?
Furthermore, not every variable has to exist on every client, so another question is: On which machine(s) do you want the player score variable(s)?
I'm using addeventhandler, hit. I guess I want to put the variables on the server. I haven't figured out how to use client scripts from server scripts. Guess that's another question.
see setVariable
is this a correct key signature setup? do I make a key folder in the root like other mods?
@Soothing Water
addons
soothingWater.pbo
soothingWater.pbo.soothingWater.bisign
actually its this isn't it?
@Soothing Water
addons
soothingWater.pbo
soothingWater.pbo.soothingWater.bisign
keys
soothingWater.bikey
first one. keyfolder in workshop mods is for using the mod on your server (copy key to server key folder)
so if your mod is only for one server (private for example) you don't have to include it
so if i want people to be able to use the mod on their servers, i do the second one and I include the base public key?
yeah that's a typo i got the bikey in that folder
and every time I change something to the pbo in later updates, I have to resign?
yes
okay gotcha
best is to make a new key
otherwise people could join with old versions
Does setGroupOwner work for empty group ?
how can I set a texture onto the ground? is it possible?
By script no
You can place a decal on it if you have it, but not to the ground itself
how would I go about placing a decal on it?
By place it in Editor. Search like "decal" or "graffiti"
It is a object (more like model) dependnt feature. Not everything can do
are there any I can retexture?
No. Thing you need to do is make your model IIRC
There is an empty texture object in differemt sizes which can be retextured by script iirc
yes but it wont wrap around the terrain
They aren't decals which fit to the terrain, what Infamous said
Ah yes
it is possible
but I don't know how exactly
look at the helipad or dirt objects for example
IIRC it cannot be changed than the texture that on the model itself, even if it is configured properly. As far as I tested, might be wrong
But if you know how to make a decal, maybe worth a try
can anybody help me out with the TOPOGRAPHY command?
I'm running arma 3 as administrator and it says Activated TOPOGRAPHY when I run it, but I can't find any file in C:\
works fine here with v2.04, hmm are you running arma3 as administrator?
just wrote this recently, maybe you can trace your steps https://pmc.editing.wiki/doku.php?id=arma3:exportnogrid
does it have to be in the 2d editor?
yes
great π
used irFanview last time to convert EMF files as EMFtoPNG gave some errors on some files. emf exe should be available to download in.. here https://drive.google.com/folderview?id=0B29LgF9v_YpQd1pjcjRsbXhTRHc&usp=sharing
I'll try that
btw https://community.bistudio.com/wiki/diag_exportTerrainSVG is also a thing
am i blank walling a simple thing on converting a input to string? think i need my coffee..
fn_thing ={
_s = str (_this select 0);
_arr = ["y","n"];
_arr = _arr + [_s];
hint format ["%1", str(_arr)];
};
[a] call fn_thing;
Ummm what is that supposed to be?! 
my brain getting stuck in other languages π¦
I mean what were you trying to do?
You say convert input to string, but it's not what you're doing...
so with a function have the input 'a' be converted to a string and added to the array without the use of "a" in the call
params
pushBack
π
you mean you want the character "a" itself?
pretty much, tried with pushback, both works perfectly fine if its ["a"] call fn_thing not even sure if its a engine limitation or just lack of familiarity with some of the sqf language as most languages you could just to 'toString' or \qt
Props like a popup target are local to the server I think, so you need to add the EH on the server anyways. Thus, since the EH only exists on the server, any variables assigned in that EH also only exist on the server (but this can be changed if needed).
TargetHitsHashMap = createHashMap; //You only need to do this if you go with Option 2. If that is the case, make sure that this line only runs once!
Target addEventHandler ["Hit", {
private _unit = _this # 3; //Get the unit that hit the target
//Option 1:
private _hits = _unit getVariable ["TargetHits", 0]; //Get the number of hits so far (default value: 0)
_hits = _hits + 1; //Add this hit
_unit setVariable ["TargetHits", _hits]; //Store the new value
//Option 2:
private _uid = getPlayerUID _unit; //Get the unique ID of _unit (will not work properly with AI)
private _hits = TargetHitsHashMap getOrDefault [_uid, 0]; //Get the number of hits so far (default value: 0)
_hits = _hits + 1; //Add this hit
TargetHitsHashMap set [_uid, _hits]; //Store the new value
}];
```Option 1 stores the hits together with the unit object. If a player disconnects, his hits are no longer accessible.
Option 2 stores all hits in one HashMap (https://community.bistudio.com/wiki/HashMap). If a player leaves, his hits are still available on the server. You can of course adapt the HashMap to store more than just the number of hits, for example the player name too.
You also mentioned you were interested in running scripts on different machines - check out https://community.bistudio.com/wiki/Arma_3:_Remote_Execution to learn how that works.
well, a is an undefined variable
"a" is a string
well a is a variable. so with str you're just converting what it contains to string
if it doesn't contain anything you'll be getting any I think
actually str will fail I think
str will give back 'string'
you sure? never seen that...
ah it's a nil string thing 
Thanks. That will get me started!
so not actually possible with sqf?
what's wrong with passing "a"?
perhaps if you explained what you're trying to do exactly I could help better
The 'a' is actually user added via text input, however as what is displayed on the screen is gets changed with some obfuscation 'ie abc123 is now ******' when you press the button if the text it grabs is from the box its just going to send the string ******, however the actual letters would be stored in a separate array and are the ones that correctly get sent.
that's already a string tho
so you never have an a variable
basically this is what you should do
use an event handler to catch key presses
then read the text box's text
if it contains anything but * replace them with *
and record them
but they could also enter * themselves... 
thats the little thing why it needs to be converted to a string somewhere
as i need to allow for !Β£$%^&*?@ etc
but it already is a string
not sure what you mean Β―_(γ)_/Β―
doing it via event handler doesn't work for !Β£$%^&*?@
yeah mine
then just create a static text control below the text box control
disable it
and for the actual text box use [0,0,0,0] color
that way anything you put into it is invisible
now just show * for all characters in the textbox control in the underlying static text control
that way you don't have to "store them somewhere"
everything is already in the textbox control. you just don't show it
of course the problem with this method is that the caret will become invisble
you can create an invisible font instead
that's what I do in my mod
I use a structured text control below the textbox
the textbox is using an invisible font, so I don't have to use the [0,0,0,0] color and the caret is visible
does 'onkeydown' detect every key?
it should. why?
so in theory, onKeyDown = "hint 'hi'"; would hint on every keypress?
yes
because it does nothing lol
what do you add it do?
repack? do you use pbo to test? 
save* 
Is there away to remove a specific texture on a vehicle model via scripting? (Like searchlights, windows, antennas, ect) found the class names for the assets, but I donβt know a script to use to remove those specific parts.
I used that to get rid of the turret on a T55, but now I got the little searchlights, viewports and alike still floating in the air with out the turret. If I put the name of the assets into that command, it will remove the left over bits?
Like if the turret is texture β2β, I would then put the name of the specific texture asset Iβd like removed in the ββ in the script?
It depends if they are defined as hiddenselections in the vehicleβs config
Weβre could I find out if they are?
In the config viewer
Ok
what is the fnc that can be called to bring up the tooltip, similar to that of official missions, for examples how to use something (top right by default)
and ofc when I ask I find what I need
advHint
advanced hint indeed
You are curious after all
haha π
I normally read it again and ask myself a question that makes it clearer, then bam I find it from that haha
so I should just write myself a question everytime I goto write here haha
That's actually an useful way to remind how it should be
asking as someone who has never scripted anything before, whats the best way of creating units that randomize the uniform texture they get on spawn?
I think there is no βbestβ way to do, but βrather goodβ, βrather badβ or βah... that's not a wise wayβ since there is a hundreds of hundreds of way to do.
So, what exactly is the situation? You got the units on Eden Editor and want to replace uniforms? Or, they'll spawn on-the-fly?
ive been working on a faction that add insurgency units. Last night i created a fair amount of different textures for a uniform (like shirt with camo pants / camo shirt with green pants etc).
i just got the thought of instead of randomizing the uniformClass, i could maybe have a script randomize the texture of the model instead
Is there a script I can use that adds all (and only) the west Germany weapons into an ammo crate?
But like, a limited amount of them
Not an Arsenal
Anyone know how to tell if the player is in a UAV camera? Either pilot or gunner
That tells me if a player is controlling a given UAV, I am wondering if I can tell if the local player is currently in a UAV camera
https://community.bistudio.com/wiki/shownUAVFeed (I think this will still return true if it is using one of small panels like GPS etc is shown though)
That only returns true when using the small panels
It returns false when you are using the UAV directly
then use getConnectedUAV and check UAVControl output from that.
I may just have to do use CBA extended event handlers to get the onLoad and onUnload events
What are you trying to do?
I want to show ACE laser codes on laser targets on sensor targets
Is there a guide on how to create a custom module anywhere? I haven't been able to find any kind of walkthrough for it so far.
https://snipboard.io/3EZStb.jpg Basically I want to know when I'm in any vehicle in any camera that can show sensor targets, like the dotted cross there, so that I can show the laser code on any that are laser designators
Wow, no idea how I missed that one.
Cant blame you, till you expand the SQF parts which are teeny tiny bits of the page, it looks like it is giving something else than you look for.
Hiya, im trying to create a module that when placed plays a sound and loops it, but i do not know anything about scripting.
How would the function for such a module look like?
do you know how to register a module?
because the code the module executes could be quite simple
an infinite loop of a sound isnt too hard, but i wouldnt recommend it
id suggest you make another module that turns it off
anyway, the code.
_sound = true
while {_sound} do
{
playSound "soundname";
sleep soundlength;
};
I already made a placeable module through cfgVehicles
to break the loop - "_sound = false"
Will that stop the sound when i delete the module in zeus?
with cycle i guess you mean full sound length?
was hoping to make something where sound sstop as module is deleted
hence a second module, unless you want to get into it and try to add a variable update when the module is deleted
why create a module? you can create objects that loop sounds
i was curious as to why he would want to blow out peoples ears for the remainder of the op
or mission should i say
Because im creating a modpack of sounds to be used on ops.
So instead of flooding the BIS "Playsound module" menu, i want to create my own.
And no i dont want to blow out any ears, as said i want the sound to stop when module is deleted.
BIS playSound module should be repeating till module is deleted?
I know as said i want to create my own module.
You got 2 solutions, you either create the crate locally (using createVehicleLocal, each player has their own crate in their own world, not seeing others) or you can populate the inventory of crate locally (the crate is synced but inventories are different )
well I doubt there are any scripts that do such a specific thing
but you can make one
I dont see a reason why you wouldnt be able to, considering you know how to do it.
All I need is an ammo crate with all the German weaponry but the DLC only includes ammo crates and not weapon crates and I really donβt have the time or patience to make them
can't you just do it in eden?
There might even be a composition for that on workshop, doesnt necessarily nneed to be a script? (Altho not sure if comps actually store inventories)
Yeah but that means making one, but I donβt have time to go through all the weapons and ammo and make one
If it is only weapon and ammo, then it surely would be shorter to do by hand on 3den than with a script...
Hello all, I'm trying to make an AI constantly check to see if an "enemy" is in a certain range and then move to them while also being able to retain the ability to follow waypoints. I know of ways to do this but I know that some commands can drop fps quickly so I was wondering how you guys would generally do this without killing fps.
Again i know how to create the module, its the function i need guidance in.
@tough abyss
well it is pretty easy. I can point you in some direction:
_configs = "getNumber (_x >> 'scope') == 2 && {
getNumber (_x >> 'type') in [1, 2, 4] && {
count (['addon1', 'addon2'] arrayIntersect configSourceAddonList _x) != 0
}
}" configClasses (configFile >> "CfgWeapons");
{
_crate addWeaponCargoGlobal [configName _x, 1];
} forEach _configs;
There is guidance to make function as well (SQF bits must be expanded tho so hard to see in case you didnt)
I don't know the GM weapon addon names
that's up to you to figure out
then replace addon1 addon2 etc. stuff with those addon names
At this rate Iβm more just disappointed there isnβt already one made for it
maybe there is
or maybe they didn't share it
Β―_(γ)_/Β―
There isnβt, Iβve looked everywhere in the supplies tab, the DLC just doesnβt add weapon or equipment crates, just ammo and smokes
If I had the dlc crates already I wouldnβt need the scriptβ¦
If you found the examples and still having trouble, I just suggest you to check fn_modulePlaySound.sqf , you can easily see it on function viewer in game. Assuming it is for Zeus as you mentioned. (3den Modules are receiving different parameters)
you can easily see it on function viewer in game
not in function viewer
You gonna make me launch the game wont you ? 
Β―_(γ)_/Β―
You mean the fn_modulsfx.sqf ? seems to be the one connected to the playsound module.
Next step is to understand wtf is in it π
yeah it is. 
okay so it looks like this: https://pastebin.com/8yEPHRJZ
What i dont understand is what RscAttributeSound is ?
It basically creates and updates the associated createSoundSource object position (so u can move module and next sound is played on new position) till module is deleted
RscAttributeSound is the GUI of it
when you open the module, you see a list of sounds etc right? Thats the part rscAttributeSound handles
So the gui is setting the sound that is decided by user then this function grabs it from there
basically gui's OK button is doing
_logic setvariable ["RscAttributeSound","WhateverYouChose"]
then this function gets that value.
Okay, so how would i work around the gui and just tell it which cfgsfx class to use?
Would that be _sound = "classname"; ?
ah no doesnt make sense to me π«
which part didnt u get?
You need something to play
How do you ask user what to play, by GUI
how does GUI communicate with function? In this case; object's (logic's) namespace
Speak, naow! 
Okay so how would i work around the GUI, and just tell it which classname to play directly in the function
Do you have a GUI, first of all? Or are you gonna use this one? (Cos technically from what I understand you want to do the same module for a reason I do not get?)
You dont do this because you wanna put your own custom sounds there , do you!?
I want a module that plays a specific sound when placed.
And yes i have my own custom sound classes.
it dont need any GUI
Oh.
Im sorry if i have been unclear
Am i doing something wrong or?
You can just straight give a function to the module and dont include curatorInfoType(it will receive whatever value it is from Module_F as you should be inheriting from there) at all which receives the GUI part.
I do not want the GUI part.
I want 1 module to play 1 sound on placement.
I do not want the option for all the other sounds.
Thats what I'm saying, if you dont want GUI, you leave curatorInfoType as it is. The GUI comes from there.
Upon dropping your module, the function will be called straight without any GUI popping up...
Okay i get that now π
But where would i define which sound class to play?
Guess that needs to be defined inside the function
You dont need to define it anywhere, you write it in your function.
the reason moduleSFX does it , is because it needs a way to make function and GUI communicate
gui sets a value, function gets the value, plays it
You want to play Beethoven in your module, you straight give it as input to createSoundSource in your function.
got its all fully working, walked away and came back when not poopbrain and sorted it all
Okay so i can delete the:
((_logic getvariable ["RscAttributeSound",""]) != _sound)
And just add classname to _sound = "";
Or am i misunderstanding again? π
yes you can do _sound = "whateverSoundYouGonnaUse";
You are aware you ll be cluttering module list a lot by doing this right? (One for each sound, why dont you just use the existing system? Out of curiosity?)
Im just trying to do alot of different stuff for arma to learn it.
Ill be putting these sounds in categories so they dont clutter
Ah okay, it is okay if it is for "educational purposes". 
You ll regret starting to this, once you will want GUIs for each of your modules, if it ever comes to that point. π
Sure is.
I already regret, started doing models and getting them ingame and now im on this mess π
Okay i did what we talked about and my function looks like this: https://pastebin.com/nMBC6Acb
But when placing the module ingame it tells me there was an error in the function.
I'm trying to get the AI to move to the closest person who is not on the same side as the unit or the unit themself but they keep doing that...
doStop _animalAI;
while{alive _animalAI} do {
private _targets = ASLToAGL getPosASL _animalAI nearEntities [["CAManBase", "Car", "Motorcycle"], 50];
private _targetsSorted = [_targets, [], {_animalAI distance _x }, "ASCEND"] call BIS_fnc_sortBy;
private _target = { if ((_x == _animalAI) or (side group _x == (missionNamespace getVariable ["GD_animalSide", EAST]))) then { breakWith _x; }; } forEach _targetsSorted;
hint str _target;
if !(isNil "_target") then {
if (!alive _target) exitWith {};
_animalAI moveTo getPosATL _target;
};
sleep .2;
};
You wont give the SFX, you ll give the sound class that uses SFX, sound entry of yours should already be targeting SFX.
If thats a sound class, then I dont see any other potential issue in this code. You copied the code anyway..
Okay so i just changed it to be a sound class, still reports an error in the function.
would be good if you had said what sort of error it reports 
Thats the thing it doesnt tell π
did u check rpt?
Yeah
Then apparently game is wrong, blame BI and move on 
Disclaimer: User had is3Den=1 for a module he was developing for Zeus. (Parameter structure changing, causes script error) 
I wanted to get some quick help, since I'm trying to finish a mission for a unit after the main creator had something pop up. I'm trying to make an empty turret, a SPG-9 from RHS to be precise, fire a single round through the 'Hold Action' function. I've been trying to scramble to figure it out for a while. Any advice?
Empty turrets can't fire by themselves
Add a check then 
oof
How do i do polpox animation on a dude
How do custom vehicle makers make there vid targetable by AI? My T-44 can target and shoot enemies, but enemies canβt seem to see it, even if itβs right in front of them.
Any ideas on how I can get the AI to acknowledge my cursed tank?
Hey ! you know the " hold space action "
Can i make a hold space action with the name " Talk to civil "
and when the loading is done, a text appears as a chat ?
like a sidechat
hahaha everytime i ask something , there is already something existant
thats crazy
i feel like scripting is endless
Everytime i read the tutorial i understand nothing
[player, "Kill", "", "", "true", "true", { hint "Started!" }, { systemChat str (_this select 3) }, { player setDamage 1 }, { hint "Afraid of death?" }, [], 10, nil, true, false] call BIS_fnc_holdActionAdd;
i tried this on a civlian, it doesnt work properly
i just would like to hold space on a guy named " Mister "
the action show " Talk to Mister "
you hold space
then, at the end of the loading, it shows a sidechat " Mister : blablabla "
and it activate a trigger
it sounds not really hard but it actually is for me hahahaha
Wooooow okay wait, there is a tool already with ace
i just discover it, in the "Atribute" to any unit !
my idea works, with less scripting
@sharp arch i can show you if you want
THanks sharp anyway !
you're adding the action to the player's unit, then you're making it always visible by having constant true in the condition, i don't see the "i tried this on a civlian" part
look at the examples, all you need to do is pretty much ctrlc ctrlv, and change a few things to suit your needs
second one in particular
that is a question for #arma3_config i believe
Oh yes okay sharp, i understood now with the 2nd exemple
you probably don't need to remoteExec
its more about my english than about my scripting
which polpox mod you using?
"_this distance _target < 3"
_this = the civilian
_targer = the player ?
So "Civ1 distance Player < 3" ?
umm, because your condition is the opposite of what you want? also use findIf instead
if you add the action to the civilian, you don't need to change anything in that part
it shows an error message
what message?
Its like a black box with a lot of stuff inside about holdaction
unreadable to be honest
well, i can't tell you the cause without seeing it
i'm guessing you messed up the argument(s) somewhere
What means the argument ?
i probably know what it is but not the name
arguments is the stuff you feed to a function
I placed in the " when completed (the hold action)
unit1 sideChat "Show this text";
but it doesnt show any sidechat
and the rest works
when i place in the " when completed "
" unit1 setdamage 1.0"
it does kill the unit
but when i do the sidechat script, it doesnt work
wait i think im dumb, because the civilian is not in my side
OK IT WORKS hehehe
sorry for my dumbness
i use the globalchat instead
ok thanks
I'm getting this error error undefined variable in expression: _startpos when trying to run:
_startMarkers = [];
{
_currMarker = toArray _x;
if(count _currMarker >= 4) then {
_currMarker resize 4;
_currMarker = toString _currMarker;
if(_currMarker == "start") then{
_startMarkers append [_x];
};
};
} foreach allMapMarkers;
_startPos = selectRandom _startMarkers;
hint format ["%1", (_startPos select 1)];
//player setpos (markerPos _startPos);
//player setdir (markerDir _startPos);```
in `init.sqf`
What I am doing wrong here?
Could be _startMarkers there contains ony [] so can't select one, which returns nil in this case?
start pos is going to return [] every time since you are resizing the marker name. any marker named start is actually going to be star and it won't trigger your condition to add it to the start markers.
Thank you! Changing those 4s to 5s helped. I had originally gotten part of that code from a steam topic of someone who was using the word "zone" instead of "start" so that explains it. I didn't fully get how it worked so I didn't think about that
Hello favorite group on the interweb.
Quick question, how do I do exception handling for undefined variables? sqf IsNil does not seem to work
private _myVar = nil;
isNil is the command. You probably using in a wrong way
if u want check
if (IsNil "_myVar") then {hint str "Var doesnt't exist"};
Nosqf if (isNil "_myVar") then {};
are u sure?
Yes
I ddin't think so
isNil takes a string or a code, not a variable
Aaah
Yeah
I did this ```sqf
if (isNil _myVar) then {};
Forgot the bendito quotation mark
if (isNil "_myVar") then {};
I should start whipping myself everytime I forget the ""
I should start whipping myself everytime I forget the ""
please, don't take our fun away
how do i get sqf to work together with config?
What...?
i said something stupid didnt i?
Maybe maybe not. Elaborate please
i found a uniform randomization script last night, and i wonder how i get it to work when i place down the units
That's what the thing called Event Handler
oh so i dont need an sqf?
Yes you need?
What's you got so far?
its just a copy paste that i changed classes and such
//Loadout Array
_IWW2gwGruntSpawnUniform = selectRandom ["IWW2_GW_BasicSoldier_Uniform","IWW2_GW_CamoSoldier2_Uniform","IWW2_GW_CamoSoldier3_Uniform","IWW2_GW_CamoSoldier4_Uniform","IWW2_GW_CamoSoldier6_Uniform","IWW2_GW_CamoSoldier8_Uniform"];
_IWW2gwNcoSpawnUniform = selectRandom ["IWW2_GW_CamoSoldier1_Uniform","IWW2_GW_CamoSoldier5_Uniform","IWW2_GW_CamoSoldier7_Uniform","IWW2_GW_CamoSoldier16_Uniform","IWW2_GW_CamoSoldier17_Uniform"];
_IWW2gwMedicSpawnUniform = selectRandom ["IWW2_GW_CamoSoldier9_Uniform","IWW2_GW_CamoSoldier10_Uniform","IWW2_GW_CamoSoldier11_Uniform","IWW2_GW_CamoSoldier12_Uniform","IWW2_GW_CamoSoldier13_Uniform","IWW2_GW_CamoSoldier14_Uniform","IWW2_GW_CamoSoldier15_Uniform"];
//Unit Init
removeUniform B_GW_AT_01;
B_GW_AT_01 addUniform _IWW2gwGruntSpawnUniform;
Welll..... where should I start explain?
Yes it should work, but not really well made
no it won't work either
Only for B_GW_AT_01 yeah
yea thats my sort of test ai
but what could be improved with it?
_IWW2gwNcoSpawnUniform,_IWW2gwMedicSpawnUniformwhy they are here just do do nothing?removeUniformis not neccessary- The entire will remove all items on the uniform too
_IWW2gwNcoSpawnUniform and _IWW2gwMedicSpawnUniform have different uniforms compared to _IWW2gwGruntSpawnUniform
or am i getting things wrong?
yes, but you don't use them
oh yea youre right
so do i just copy the _IWW2gwNcoSpawnUniform under my NCO units eventhandlers?
nvm
guys.. can I have a little help with trig and vectors, please?
I have a script that reliably spawns an empty prairie fire nasty boat close to a pier object
i want to give the boat a gentle shove towards the pier so that it looks better for players
_nbdboat setVelocity [(sin (_nbdboat getDir _np )) * 2, (cos (_nbdboat getDir _np)) * 2,0];
nbdboat is the boat and np is the pier object
I'm very much out of my area of expertise here... above code seems to always push the boat backwards
not towards the pier
are there likely to be issues using setvelocity to push a boat sideways?
setVelocityModelSpace π
i dont know how to work out the vector it needs
afaik setVelocity doesn't work on vehicles touching the water? 
above code seems to always push the boat backwards
nvm 
to the left: [-1,0,0]
to the right: [1,0,0]
forwards: [0,1,0]
backwards: [0,-1,0]
in model space
vectorFromTo
no
just use setVelocity
boat setVelocity (getPosASL boat vectorFromTo getPosASL pier vectorMultiply _speed)
can i make planes taxi on the runway?
ok, i was plugging in code rather randomly and wasnt even close to that, Leo,
thanks, i try it
with an awful BIS_fnc_unitPlay π¬
@little raptor stahp :notlikemeow:ing

If you need them to taxi only on straight line then it could easily be done with setVelocity.
Depends if you need the planes to actually go around by themselves. Or just a taxi for cineamatic or smth.
Shame that setDriveOnPath does not work for planes π
Yeah
OH YEAH IT'S THAT BETTER
let me

you
.
agrrrrrr π€£
Ah, viper1zero already made a video for aircraft moving around Tanoa without scripting
I love the community
_nbdboat setVelocity (getPosASL _nbdboat vectorFromTo getPosASL _np vectorMultiply 4);
pushes the boat backwards or forwards, but never sideways
engine limitation, perhaps?
yes
hmm, ok
setvelocitymodelspace can shove it sideways
vehicle player setVelocityModelSpace [-1,0,0]
in debug console
so perhaps, take earlier code and convert it to modelspace?
you're probably pushing it downwards
no what difference does it make?
dunno yet