#arma3_scripting

1 messages Β· Page 708 of 1

spark turret
#

add that at the very end and post result from .rpt:

diag_log["chose:",_jakerodgear,"got:",headgear player];
#

!rpt

wicked roostBOT
#
Arma RPT

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.

dreamy kestrel
#

it may; try the momentum approach though

hearty hound
spark turret
#

and are there any "error" messages in the rpt nearby?

still forum
#

when does the script run?

hearty hound
#

I wiped out my RPT then executed the script and that line is the only one in there

spark turret
#

wait is balaclave even headgear?

hearty hound
#

On Radio Alpha

spark turret
#

have you tried the example gear: player addHeadgear "H_HelmetB";?

hearty hound
#

😭 it's facewear

#

πŸ€¦β€β™‚οΈ

past wagon
#

Use selectRandomWeighted instead so you don’t need repeats

winter rose
past wagon
#

Well at least you figured out the problem 🀷

hearty hound
# winter rose _goggles?_

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

winter rose
#

yeah well, Arma I guess πŸ˜„

dreamy kestrel
#

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.

winter rose
dreamy kestrel
winter rose
#

you say "no message"

dreamy kestrel
#

i.e. player customchat [1, 'test'], no message

winter rose
#

0, no?

dreamy kestrel
#

pretty sure not; 0 means create failed, correct?

winter rose
#

yep indeed

dreamy kestrel
#

and +5 for 'normalized' channel

winter rose
#

plz provide ez repro code

#

(plz provide code itself, for we can't know what nor how you do stuff)

dreamy kestrel
#

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.

winter rose
#

i sure hope for your own sake that your _args hashmap is filled with all the required arguments… πŸ‘€

dreamy kestrel
#

And log indicating successful creation:

18:37:41 [KP LIBERATION] [24351.3] [RADIOS] [fn_radios_custom] Fini: [isNull _customChannel, _customChannelID, _uuid]: [false,1,"d8d75c29db889a849ed9f2ea72c41ac8"]
dreamy kestrel
winter rose
#

get works with HASHMAPs

#

try this```sqf
private _id = radioChannelCreate [[1,0,1,1], "theLabel", "theCallsign", [player]];
player customChat [_id, "Hello there"];

still forum
#

but but.. thats an array think_turtle

dreamy kestrel
#

yes, _args = createHashMapFromArray _args;

still forum
#

with a absolutely needless copy :u

dreamy kestrel
#

typos πŸ‘

winter rose
#

agrrrrrr

dreamy kestrel
#

hmm ok that does work

dreamy kestrel
#

call sign is this, '$STR_KPLIB_LOGISTICS_RADIO_CHANNEL_CALL_SIGN', should lookup from string table?

spark turret
#

General kenobob

winter rose
#

ze simple code werkz, therefore issue somewhere before πŸ˜„

still forum
#

Don't see why it would if you don't do localize

dreamy kestrel
#

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

still forum
#

radioChannelSetCallSign != radioChannelCreate
the examples on radioChannelCreate don't show localized strings

dreamy kestrel
#

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?

atomic crystal
#

yo I appreciate that man, thankfully I figured it out and wrote one very similar πŸ˜„

dreamy kestrel
#

back in a moment. will try without the fancy localization reference.

winter rose
#

when discovering, go simple, then add the sparkles πŸ˜‰

dreamy kestrel
#

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.

winter rose
#

w00t!

past wagon
dreamy kestrel
#

ah I see also... the player object that connects is not the same one that 'deploys' to the field in the mod.

spark turret
#

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

brisk harness
#

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

winter rose
#

yep
you provided varDone here

#

@brisk harness nil, true or [], true

brisk harness
#

so it will not assume default if theres parameters befor a changed parameter?

winter rose
#

it does not guess what you try to set, no

tropic spruce
#

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.

brisk harness
#

@winter rose thank you! fixed the error and my weird play back!

wary needle
#

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.

brisk harness
#

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?

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
warm hedge
#

how would i specify an entity for this to attach to?
What do you mean?
also would that also function in MP?
No

brisk harness
#

im creating a downed plane mp mission, ide like to attach an effect to the plane and have it be visible to players

snow blade
#

Oh, Lou. Should make it easy on him. Like this:

winter rose
#

no

because I don't know his level of knowledge or knowledge structures ^_^

snow blade
#

Well, the joke is that I sent the main page for the wiki...

winter rose
#

I got that dw 😜

snow blade
#

Had me worried! πŸ˜›

spark turret
mental wren
#

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;
little raptor
#

_unit setDir _dir;
_unit setFormDir _dir;
???

#

you're attaching the unit. what's the point?

mental wren
#

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.

little raptor
mental wren
#

ye but when I spawn a dude in zeus/eden, they don't do that lol

little raptor
#

if you want to skip the animation just do:

_unit switchMove "AmovPercMstpSnonWnonDnon"
#

I think

mental wren
#

oh I'll give that a try too

little raptor
#

test the animation name yourself (I wrote that from memory)

mental wren
#

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";
little raptor
#

I think a simple _unit switchAction "STOP" will work too

lament grotto
#

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

mental wren
#

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

meager epoch
#

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?

little raptor
meager epoch
#

Thanks

fair drum
lament grotto
dreamy kestrel
#

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.

willow hound
#

deleteMarkerLocal or setMarkerAlphaLocal

dreamy kestrel
#

alpha, got it, thank you

spark turret
#

Alpha makes them invisivlr but doesnt delete them. So be careful with it .
Dont confuse it with deletion

dreamy kestrel
#

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.

spark turret
#

If yiu make all invisible at start and only reveal on channel join, then yes

dreamy kestrel
#

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...

low sierra
#

Good day. Can i lock a player in free look mode (like if he is pressing left alt)?

little raptor
#

but I think if you make an animation for that you can

low sierra
#

@little raptor thanks for the answer. For that i will need to use a mod?

little raptor
#

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

low sierra
#

Nice! Thanks a lot πŸ’―

dreamy kestrel
meager epoch
#

Can I somehow force the player/AI to un-holster their weapon while skydiving and be able to shoot (while in the skydiving animation)?

willow hound
brisk harness
#

how do i know if an effect will be visable in a multiplayer setting? (smoke, fire, ect)

little raptor
sharp grotto
#

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);
brisk harness
#

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; 
sharp grotto
#

not that i know, if you want to use that you have to execute that on every client like Leopard20 said.

little raptor
sharp grotto
#

i know

brisk harness
#

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

dreamy kestrel
velvet umbra
#

is it possible to get creator of simpleobject? i mean by which client it was created global?

winter rose
#

(know that the creator can be disconnected, too)

velvet umbra
#

okay thx πŸ˜‰

still forum
velvet umbra
#

okay thx πŸ˜‰

brave jungle
#
//[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

copper raven
#

you don't have to

#

params ["_control", "_mode", ["_configSizePath", configFile]]

brave jungle
#

Ah perfect

#

Thats more what im after ty

fading dust
#

how to make units get in 2 vehicles

velvet umbra
#

what do you mean? πŸ˜„ two units in two diffrent vehicles? @fading dust

velvet umbra
#

if its just for moving them in u can use moveinany

fading dust
#

thx i find out how

drifting sky
#

danger.fsm. Does the dangercausedby value sometimes undefined for "Enemy Detected" danger cause?

drifting sky
#

How do I check if a weapon has an underbarrel grenade launcher?

little raptor
brave jungle
#

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

winter rose
#

no such EH AFAIK

brave jungle
#

Yeah couldn't see one just wanted to double check

signal kite
#

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?

still forum
#

ye

signal kite
#

thx

lament grotto
#

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.?

little raptor
mental prairie
#

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?

lament grotto
fair drum
meager epoch
#

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.

fair drum
meager epoch
#

Except I'm not. notlikemeowcry

#

Is the config.cpp where I write the main script for what I'll be trying to achieve?

crude vigil
little raptor
crude vigil
little raptor
winter rose
little raptor
#

I don't care about the rest

#

people can read it elsewhere

warm coral
#

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

winter rose
#

should work?

little raptor
warm coral
#

i tried but it didnt pick up

#

c++

#

wait

little raptor
#
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""]);};
winter rose
#
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"]);
};
warm coral
#

weird

winter rose
#
if (true) then {};
#

hehehe

warm coral
#

so this should work in mp right?

#

or not

winter rose
#

oh, it's just the SQF size @little raptor

winter rose
#
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);
};
warm coral
#

oh okay thank you

little raptor
#

sleep 1;

warm coral
#

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

little raptor
warm coral
#
[] spawn {
    sleep 5;
    hint "after (at least) 5 seconds...";
};```
#

like this?

winter rose
#

you will have to pass parameters```sqf
_this spawn {
sleep 1;
// your code
};

warm coral
#
if (local (_this select 0)) then
_this spawn {
  sleep 1;
  // my code
};};```
this way?
winter rose
#

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 // ...
};
};

warm coral
#

oh okay

#

thanks a lot guys

hot kernel
#

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?

winter rose
#

no

hot kernel
#

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"]
woven nimbus
#

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!

woven nimbus
#

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 πŸ˜„

hot kernel
#

oh, no. We can build a loop just based the example from the wiki.

little raptor
#

something like that. I'm not familiar with ppEffects so it's up to you to make it work.

woven nimbus
hot kernel
#

@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])
    }
};
gusty lantern
#

Hey guys just a quick question, How to do that playMusic will be Global?

gusty lantern
#

Thanks! πŸ™‚

mental prairie
#

Is there a variable that's scope is within the mission, and not outside?

#

so for example, I have 2 SQF scripts

rose pike
mental prairie
#

and I don't want the variable to go outside the mission I'm making

winter rose
#
mySuperVar = 666;
// identical to
missionNamespace setVariable ["mySuperVar", 666];
mental prairie
#

really? I've been under the impression that i should avoid using global variables due to them being out of the mission scope

mental prairie
#

okay, thanks!

rose pike
#
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
winter rose
#

you don't have the needed mods (most likely RHS)

rose pike
#

i had RHS installed, TT-33 was given but AKs were not

winter rose
#

@rose pike

this addWeapon _gunInfo select 0;
``````sqf
this addWeapon (_gunInfo select 0);
```should be enough
#

same with ```sqf
this addPrimaryWeaponItem _gunInfo select 1;

rose pike
#

i'll test when i can

brazen lagoon
#

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?

winter rose
brazen lagoon
#

@winter rose will 2 let them still shoot

winter rose
#

I think so yes

brazen lagoon
#

how about when they get out

winter rose
#

then un-remoteControl

brazen lagoon
#

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?

brazen lagoon
#

and I'd want to remoteexec this

#

cool thanks

tight cloak
#

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

little raptor
#

if (_dammages <= 0) then {exitWith {};};

#

_dammages
🀣

tender fossil
#

Yeah πŸ˜„

little raptor
#

_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

tender fossil
#

Don't mind that, I'm trying desperately to fix a bug in that code lol

#

So there's some redundancy

little raptor
#

well all of these are nonsense: then {exitWith {};}

tender fossil
#

Yeah, fixed them

little raptor
#

if (_dammages <= 0) {exitWith {}};
...

winter rose
#

those damn mages…

crude vigil
#

Im still waiting for Leo's comment on for loop :grabs popcorn:

little raptor
#

didn't even see it meowsweats

tender fossil
#
/*
    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;
    };
};
crude vigil
#

just modify original code, dont keep pasting ur code again and again or Lou will use his banhammer

tender fossil
#

?

crude vigil
#

or yeah u can delete previous ones too meowsweats

winter rose
#
if (!_cancelled) then {
    if (!_skip) then {
//
if (!_cancelled && !_skip) then {
tender fossil
#

_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)

winter rose
#

fix the brackets

#

no errors should arise, ever

tender fossil
crude vigil
#

What error do you get?

drifting sky
#

arma2:OA. Is there a way, via script, to force an AI unit to disengage and to move?

winter rose
#

also set fire mode to BLUE or something

drifting sky
#

does that change the behavior of the unit or of the whole group?

little raptor
#

whole group

#

you can use a trick to make it change a single unit

tender fossil
#

etc

drifting sky
#

what trick?

little raptor
# drifting sky 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

little raptor
drifting sky
#

No, too many things could go wrong there.

#

So there's no normal way of forcing a single unit to move?

crude vigil
#

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?

tight cloak
#

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

crude vigil
little raptor
#

yes, I did

tight cloak
#

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

little raptor
tight cloak
#

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

winter rose
#

Ctrl+Z then

tight cloak
#

it just isnt behaving the same

tight cloak
drifting sky
#

Not seen AUTOCOMBAT before, is there a wiki page for that?

tight cloak
#

its an ai behaviour

drifting sky
#

Yeah I want to know the specifics though

tight cloak
little raptor
tight cloak
#

click show list on string values

crude vigil
#

He wants A2OA though

#

Auto*** ones are introduced in A3

little raptor
tight cloak
#

uh cant u just try doStop this;

#

will stop all its actions and should reset the ai

#

(a2)

crude vigil
drifting sky
#

I'll try those.

#

will a domove undo a dostop? such that they're able to resume moving normally?

winter rose
#

yes

#

doStop is 1-6 order, "halt"

unit stop true is a harsher command

little raptor
winter rose
drifting sky
#

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?

little raptor
drifting sky
#

think that's a3 only

winter rose
little raptor
#

nope. player issued commands are more strict
can't be undone using doMove or doStop

crude vigil
#

"Just move to A3"

drifting sky
#

I read one for a2 but I cannot remember where or what it was called

crude vigil
little raptor
#

what did you test?

winter rose
#

I tried and it could not πŸ˜„

#

I did a 2, halt

then tried joe doMove getPos player etc, wouldn't

crude vigil
#

You just have rookies that must be why meowsweats

crude vigil
little raptor
#

huh? meowhuh

#

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

crude vigil
#

dont you mean "ordering an halt order" --->> Issued 1-6 on commanding menu

little raptor
#

I guess so yeah

crude vigil
#

Issued 1-6 then used doMove , the unit moves to the targeted position.

little raptor
crude vigil
#

yes, I know how to use AI meowsweats, it is literally the reason I buy Arma blobcloseenjoy

little raptor
#

well just to be sure I did a test myself. and as I said it doesn't work

crude vigil
#

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? meowsweats

little raptor
#

yes

little raptor
winter rose
#

πŸ‘€

crude vigil
#

I think I mixed up the variables of the squad I created nvm meowsweats

winter rose
#

gniiiiiiiii

crude vigil
#

yep see ya!

#

Imma go sleep meowtrash

winter rose
#

'night πŸ˜„ (mind the flying hammer)

tight cloak
#

was there an update or soemthing that broke

player action ["SwitchWeapon", player, player, 100];
#

nolonger puts your gun on your back

fair drum
#
_unit action ["SwitchWeapon", _unit, _unit, 299];
tight cloak
#

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

fair drum
#

haha

tight cloak
#

legit one second the script worked

fair drum
#

magic

tight cloak
#

then it didndt

#

adding 199 to the number did the trick

fair drum
#

you can use weaponState to find things like that

tight cloak
#

❀️

#

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

winter rose
#

hm, wasn't there a "get drop info" on a particle source? I remember it, yet cannot find it thonk

dreamy kestrel
#

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} ?

magic sundial
#

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

little raptor
#

also, their waypoint destination pos MUST be AGL. Maybe they could use the object if you gave them an exact pos

little raptor
#

I've added a note on the wiki as to why

magic sundial
#

But these objects do have a path LOD it’s just when it’s midair it appears to not?

little raptor
magic sundial
#

I think it’s the waypoint yea

little raptor
#

Like I said, it must be AGL

magic sundial
#

Yea cheers I’ll give it a squizz

little raptor
magic sundial
#

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

little raptor
#

And like I said, don't use waypoints. Use doMove instead

young current
#

Mid air won't work. Path lod needs a ground connection

lavish coral
#

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];```
lavish coral
#

In an .sqf run by command ["scripts\EndMission.sqf"] remoteExec ["execVM", 0];

little raptor
#

where?

lavish coral
#

In another .sqf πŸ˜„

#

But not in init

little raptor
#

well I mean how does it execute, and on which PC

lavish coral
#

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

lavish coral
#

The first addAction

little raptor
#

it's hard to tell without seeing the whole code

lavish coral
#

They are added in the same way and with the same conditions and still the first one doesn't show up

lavish coral
#

Trying to fix it by changing the condition for the addactions and running them in init

sharp arch
#

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?

winter rose
#

it would mostly be using animateSource, not object's texture
if the vehicle is not meant to do that, you can't

sharp arch
#

Ok, so it would be β€œthis animate source turret”?

winter rose
#

more or less, yes

hushed tendon
#

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;
winter rose
#

playerSide is "local player's native side"

hushed tendon
winter rose
#

no.

little raptor
hushed tendon
#

oh yeah meowfacepalm

young current
little raptor
#
_x setVariable ["bla", str side _x]
winter rose
#

(I know, obscure command 🀣)

little raptor
#

Not in the mood to type that on mobile meowsweats

winter rose
little raptor
winter rose
#

kinda yes πŸ˜„ the command that was created for one game mode

fair drum
sharp arch
fair drum
#

can I grab the current iteration index with apply or is forEach really the only way to do it with _forEachIndex

winter rose
#

you can still make an external _i var and _i++ it (if ++ were accepted in SQF)

brisk harness
#

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

hushed tendon
#

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];
little raptor
#

how can a single argument be so many things?

hushed tendon
#

ohhhhh my god

#

I'm an idiot

little raptor
hushed tendon
little raptor
#

who told you that?

hushed tendon
#

idk

little raptor
#

it's not that much faster

hushed tendon
#

maybe I mixed it up and it was params

little raptor
#

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)

fair drum
#

that and it looks much prettier.

little raptor
# hushed tendon I was told using select was faster?

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

fair drum
#

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

little raptor
fair drum
little raptor
#

no πŸ˜…

#

I mean it does initialize then too iirc

#

but I didn't care

fair drum
#

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?

little raptor
#

no just one

little raptor
#

and ends when the mission ends

hushed tendon
#

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;
fair drum
little raptor
#

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.

hushed tendon
little raptor
hushed tendon
rose pike
hushed tendon
little raptor
#

added to whom?

#

are you testing in MP?

hushed tendon
# little raptor are you testing in MP?

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;
little raptor
#

:/

#

how's that better?!

#

just use MPKilled

#

but only record the death on the server

hushed tendon
hushed tendon
little raptor
little raptor
hushed tendon
#

Uuuuuuuuhhh

little raptor
#

instead of worrying about how fast select is vs params (which is almost nothing), you might want to optimize that

tough abyss
#

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?

hushed tendon
# little raptor > [missionNamespace, "WAG_unitsKilledTotal", ((_killed getVariable "WAG_unitsKil...

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

frail orbit
#

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?

hushed tendon
#

Is there a way to tell if a unit gets killed by zeus? (End key while in interface, not as player)

winter rose
#

yeah
he's dead

crude vigil
hushed tendon
#

There a way to tell if a player is in the zeus interface?

crude vigil
#

u can check if curatorCamera returns an object

hushed tendon
#

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?

crude vigil
#

obviously it will work too..

#

but I think curatorCamera would be a faster check

hushed tendon
urban tiger
#

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... MillerTarget )

winter rose
crude vigil
fair drum
#

whats the fastest way to test addons as you make changes to them? I'm having to restart the game every time

crude vigil
#

depends on what sort of changes you are doing

#

also depends on where you develop

fair drum
#

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

crude vigil
#

I meant as in dev/stable/diag meowsweats

fair drum
#

oh just sittin on stable atm

#

and its just a sqf tweak in one of the functions as i test it

crude vigil
#

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..

fair drum
#

okay good to know i'll try it

crude vigil
#

ofc the root is being a3 folder

fair drum
#

can I do it from somewhere easier like my scripts folder in docs?

crude vigil
#

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.meowsweats

little raptor
#

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)

urban tiger
crude vigil
#

Β―_(ツ)_/Β―

little raptor
#

I call the script from a commanding menu

crude vigil
#

Are you solely doing it for the sake of avoiding recompiling everything , and only your functions?

little raptor
#

Yes

crude vigil
#

pushing recompile all button is faster than rewriting the same functions over n over again, my preference

little raptor
#

Rewriting what?

crude vigil
#

well you probably dont cos u got a mod for that

#

anyways

fair drum
#

what particle source could I use for underwater... uh... heal effect? currently if I use "billboard", the smoke does not show underwater

winter rose
#

(though I am not sure this is the issue, it might)

fair drum
#

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

winter rose
#

yep to copy all & yep to config

orchid nymph
#

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.

willow hound
#

@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)?

orchid nymph
#

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.

fair drum
#

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
sharp grotto
#

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

fair drum
#

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?

sharp grotto
#

yea

#

its the .bikey tho

fair drum
#

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?

sharp grotto
#

yes

fair drum
#

okay gotcha

sharp grotto
#

best is to make a new key
otherwise people could join with old versions

high vigil
#

Does setGroupOwner work for empty group ?

silent latch
#

how can I set a texture onto the ground? is it possible?

warm hedge
#

By script no

#

You can place a decal on it if you have it, but not to the ground itself

silent latch
warm hedge
#

By place it in Editor. Search like "decal" or "graffiti"

#

It is a object (more like model) dependnt feature. Not everything can do

silent latch
#

are there any I can retexture?

warm hedge
#

No. Thing you need to do is make your model IIRC

spark turret
#

There is an empty texture object in differemt sizes which can be retextured by script iirc

silent latch
#

yes but it wont wrap around the terrain

warm hedge
#

They aren't decals which fit to the terrain, what Infamous said

spark turret
#

Ah yes

little raptor
#

but I don't know how exactly

#

look at the helipad or dirt objects for example

warm hedge
#

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

light stirrup
#

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:\

bitter magnet
#

works fine here with v2.04, hmm are you running arma3 as administrator?

light stirrup
#

I am

#

I'm on Windows 10

bitter magnet
light stirrup
#

does it have to be in the 2d editor?

bitter magnet
#

yes

light stirrup
#

i'll be damned

#

that worked

#

ty

bitter magnet
#

great πŸ™‚

light stirrup
#

now I can't find EMFtoPNG

#

I've got Arma 3 Tools

bitter magnet
light stirrup
#

I'll try that

still forum
bitter magnet
#

thanks, didnt know it existed.

#

and packed with features, that is awesome.

urban tiger
#

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;
little raptor
urban tiger
little raptor
#

I mean what were you trying to do?

#

You say convert input to string, but it's not what you're doing...meowsweats

urban tiger
#

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

winter rose
#

params
pushBack
πŸ˜‰

little raptor
urban tiger
# little raptor 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

willow hound
# orchid nymph I'm using addeventhandler, hit. I guess I want to put the variables on the serve...

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.
winter rose
little raptor
#

if it doesn't contain anything you'll be getting any I think

#

actually str will fail I think

urban tiger
#

str will give back 'string'

little raptor
#

you sure? never seen that...

little raptor
#

ah it's a nil string thing meowsweats

orchid nymph
urban tiger
little raptor
#

perhaps if you explained what you're trying to do exactly I could help better

urban tiger
# little raptor what's wrong with passing "a"?

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.

little raptor
#

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... think_turtle

urban tiger
#

thats the little thing why it needs to be converted to a string somewhere

#

as i need to allow for !Β£$%^&*?@ etc

little raptor
#

not sure what you mean Β―_(ツ)_/Β―

urban tiger
#

doing it via event handler doesn't work for !Β£$%^&*?@

little raptor
#

here's a question

#

what text box are you trying to do this for?

#

yours?

urban tiger
#

yeah mine

little raptor
#

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

urban tiger
little raptor
#

it should. why?

urban tiger
#

so in theory, onKeyDown = "hint 'hi'"; would hint on every keypress?

little raptor
#

yes

urban tiger
#

because it does nothing lol

little raptor
#

what do you add it do?

urban tiger
#

meowfacepalm meowfacepalm meowfacepalm meowfacepalm just going to casually disappear

#

forgot to save*

little raptor
#

repack? do you use pbo to test? meowsweats

urban tiger
#

save* meowfacepalm

sharp arch
#

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.

ripe sapphire
sharp arch
#

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?

ripe sapphire
sharp arch
#

We’re could I find out if they are?

ripe sapphire
#

In the config viewer

sharp arch
#

Ok

brave jungle
#

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

winter rose
#

advanced hint indeed

brave jungle
#

πŸ˜„

#

everytime i ask I just end up finding a solution seconds later

ripe sapphire
#

You are curious after all

brave jungle
#

haha πŸ˜„

warm hedge
#

Think about it

#

You ask then internet got a new info about your curiosity

brave jungle
#

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

warm hedge
#

That's actually an useful way to remind how it should be

manic grail
#

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?

warm hedge
#

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?

manic grail
#

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

tough abyss
#

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

fringe yoke
#

Anyone know how to tell if the player is in a UAV camera? Either pilot or gunner

fringe yoke
#

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

crude vigil
fringe yoke
#

That only returns true when using the small panels

#

It returns false when you are using the UAV directly

crude vigil
#

then use getConnectedUAV and check UAVControl output from that.

fringe yoke
#

I may just have to do use CBA extended event handlers to get the onLoad and onUnload events

crude vigil
#

What are you trying to do?

fringe yoke
#

I want to show ACE laser codes on laser targets on sensor targets

errant magnet
#

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.

fringe yoke
#

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

errant magnet
crude vigil
opaque snow
#

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?

tight cloak
#

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;
};
opaque snow
#

I already made a placeable module through cfgVehicles

tight cloak
#

to break the loop - "_sound = false"

opaque snow
#

Will that stop the sound when i delete the module in zeus?

tight cloak
#

and it will stop at the end of the cycle

#

uh, i guess

opaque snow
#

with cycle i guess you mean full sound length?
was hoping to make something where sound sstop as module is deleted

tight cloak
#

hence a second module, unless you want to get into it and try to add a variable update when the module is deleted

little raptor
tight cloak
#

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

opaque snow
#

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.

crude vigil
opaque snow
crude vigil
#

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 )

little raptor
#

but you can make one

crude vigil
#

I dont see a reason why you wouldnt be able to, considering you know how to do it.

tough abyss
little raptor
crude vigil
#

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)

tough abyss
crude vigil
#

If it is only weapon and ammo, then it surely would be shorter to do by hand on 3den than with a script...

hushed tendon
#

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.

opaque snow
little raptor
#

@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;
crude vigil
little raptor
#

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

tough abyss
#

At this rate I’m more just disappointed there isn’t already one made for it

little raptor
#

or maybe they didn't share it

#

Β―_(ツ)_/Β―

tough abyss
# little raptor maybe there is

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

little raptor
#

oh you mean the DLC crates

#

I thought you mean scripts

tough abyss
#

If I had the dlc crates already I wouldn’t need the script…

crude vigil
little raptor
crude vigil
opaque snow
crude vigil
#

yeah it is. meowsweats

opaque snow
crude vigil
#

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.

opaque snow
#

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 😫

crude vigil
#

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

crude vigil
opaque snow
#

Okay so how would i work around the GUI, and just tell it which classname to play directly in the function

crude vigil
#

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!?

opaque snow
#

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

crude vigil
#

Oh.

opaque snow
#

Im sorry if i have been unclear

opaque snow
crude vigil
#

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.

opaque snow
#

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.

crude vigil
#

Upon dropping your module, the function will be called straight without any GUI popping up...

opaque snow
#

Okay i get that now πŸ˜„

But where would i define which sound class to play?

Guess that needs to be defined inside the function

crude vigil
#

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.

urban tiger
opaque snow
#

Okay so i can delete the:

((_logic getvariable ["RscAttributeSound",""]) != _sound)

And just add classname to _sound = "";

Or am i misunderstanding again? πŸ˜„

crude vigil
#

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?)

opaque snow
#

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

crude vigil
#

Ah okay, it is okay if it is for "educational purposes". meowtrash

#

You ll regret starting to this, once you will want GUIs for each of your modules, if it ever comes to that point. πŸ˜›

opaque snow
#

Sure is.
I already regret, started doing models and getting them ingame and now im on this mess πŸ˜„

opaque snow
#

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.

hushed tendon
#

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;
};
crude vigil
opaque snow
crude vigil
#

would be good if you had said what sort of error it reports meowsweats

opaque snow
#

Thats the thing it doesnt tell πŸ˜„

crude vigil
#

did u check rpt?

opaque snow
#

Yeah

crude vigil
#

Then apparently game is wrong, blame BI and move on meowtrash

opaque snow
crude vigil
#

Disclaimer: User had is3Den=1 for a module he was developing for Zeus. (Parameter structure changing, causes script error) meowsweats

warm kestrel
#

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?

little raptor
warm kestrel
#

oof

karmic dagger
#

How do i do polpox animation on a dude

sharp arch
#

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?

royal siren
#

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

royal siren
#

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

sharp arch
#

Bro that’s really cool!

#

I ought to try that in a mission.

royal siren
#

[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 !

copper raven
#

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

royal siren
#

Oh yes okay sharp, i understood now with the 2nd exemple

copper raven
#

you probably don't need to remoteExec

royal siren
#

its more about my english than about my scripting

fair drum
royal siren
copper raven
copper raven
royal siren
#

it shows an error message

copper raven
#

what message?

royal siren
#

Its like a black box with a lot of stuff inside about holdaction

#

unreadable to be honest

copper raven
#

well, i can't tell you the cause without seeing it

#

i'm guessing you messed up the argument(s) somewhere

royal siren
#

What means the argument ?
i probably know what it is but not the name

fair drum
#

arguments is the stuff you feed to a function

royal siren
#

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

hearty hound
#

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?
warm hedge
#

Could be _startMarkers there contains ony [] so can't select one, which returns nil in this case?

hearty hound
#

it does the same thing without using Select

fair drum
hearty hound
#

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

somber radish
#

Hello favorite group on the interweb.
Quick question, how do I do exception handling for undefined variables? sqf IsNil does not seem to work

rough summit
#
private _myVar = nil;
warm hedge
#

isNil is the command. You probably using in a wrong way

rough summit
#

if u want check

if (IsNil "_myVar") then {hint str "Var doesnt't exist"};
warm hedge
#

Nosqf if (isNil "_myVar") then {};

rough summit
#

are u sure?

warm hedge
#

Yes

rough summit
#

I ddin't think so

warm hedge
#

isNil takes a string or a code, not a variable

rough summit
#

Let me check

#

Ah, I confused it with null

somber radish
#

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 ""

winter rose
#

I should start whipping myself everytime I forget the ""
please, don't take our fun away

manic grail
#

how do i get sqf to work together with config?

warm hedge
#

What...?

manic grail
#

i said something stupid didnt i?

warm hedge
#

Maybe maybe not. Elaborate please

manic grail
#

i found a uniform randomization script last night, and i wonder how i get it to work when i place down the units

warm hedge
#

That's what the thing called Event Handler

manic grail
#

oh so i dont need an sqf?

warm hedge
#

Yes you need?

manic grail
#

ah

#

my big brain strikes again

warm hedge
#

What's you got so far?

manic grail
#

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;
warm hedge
#

Welll..... where should I start explain?

#

Yes it should work, but not really well made

little raptor
#

no it won't work either

warm hedge
#

Only for B_GW_AT_01 yeah

manic grail
#

but what could be improved with it?

warm hedge
#
  1. _IWW2gwNcoSpawnUniform, _IWW2gwMedicSpawnUniform why they are here just do do nothing?
  2. removeUniform is not neccessary
  3. The entire will remove all items on the uniform too
manic grail
#

_IWW2gwNcoSpawnUniform and _IWW2gwMedicSpawnUniform have different uniforms compared to _IWW2gwGruntSpawnUniform

#

or am i getting things wrong?

little raptor
manic grail
#

oh yea youre right

#

so do i just copy the _IWW2gwNcoSpawnUniform under my NCO units eventhandlers?

karmic dagger
finite sail
#

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?

winter rose
#

setVelocityModelSpace πŸ™‚

finite sail
#

i dont know how to work out the vector it needs

little raptor
#

above code seems to always push the boat backwards

#

nvm meowsweats

winter rose
#

to the left: [-1,0,0]
to the right: [1,0,0]
forwards: [0,1,0]
backwards: [0,-1,0]

#

in model space

finite sail
#

boat vectorfromto pier

#

and convert it to modelspace?

little raptor
#

no

#

just use setVelocity

#
boat setVelocity (getPosASL boat vectorFromTo getPosASL pier vectorMultiply _speed)
oak coyote
#

can i make planes taxi on the runway?

little raptor
#

they do it automatically

finite sail
#

ok, i was plugging in code rather randomly and wasnt even close to that, Leo,

#

thanks, i try it

winter rose
#

@little raptor stahp :notlikemeow:ing

little raptor
#

there is another way too

#

you can attach the plane to a car or something

hollow thistle
#

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 πŸ˜„

oak coyote
#

Yeah

winter rose
#

let me

#

you

#

.

#

agrrrrrr 🀣

oak coyote
#

Ah, viper1zero already made a video for aircraft moving around Tanoa without scripting

#

I love the community

finite sail
#

_nbdboat setVelocity (getPosASL _nbdboat vectorFromTo getPosASL _np vectorMultiply 4);

#

pushes the boat backwards or forwards, but never sideways

#

engine limitation, perhaps?

little raptor
#

yes

finite sail
#

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?

little raptor
little raptor
finite sail
#

dunno yet