#arma3_scripting

1 messages ยท Page 21 of 1

copper raven
#

copyToClipboard str allVariables uiNamespace

pseudo ridge
#

๐Ÿ‘ the bushes don't have a classname AFAIK

#

So no way to create them with createVehicle

granite sky
#

Where does configSourceMod get its data from? I ask because RHS has some weapons that return empty string for it.

frank mango
south swan
#

or some debug console magic to directly get the classname

exotic flax
smoky verge
#

anyone knows a good way to use unitplay on a dedicated server?
tried it with an aircraft but its very "laggy"

open fractal
smoky verge
#

globally

#

oh no

#

I am dumb of ass when dealing with scripting I assumed if I did it server side the players would not be able to see it

little raptor
#

well tbf unit capture "lags" even in SP

#

and it's even worse in MP

#

but when you execute it globally it's much much worse

#

because of contention

smoky verge
#

so I should execute it server side?

little raptor
#

I assume wherever the plane is local

#

check the wiki

#

doesn't say anything meowsweats

#

well it uses setVelocityTransformation under the hood

#

so local arg it is

smoky verge
#

local?

#

so I should execute it only for the players locally?
how do I even do that?

little raptor
#

actually what do you do right now anyway?

#

have you put it in init.sqf?

smoky verge
little raptor
#

execute this locally:

["path.sqf"] remoteExec ["execVM", plane] 
smoky verge
#

what does it do?

#

does it only executes for the players in the plane?

south swan
#

it executes on whichever machine plane is local at

smoky verge
#

forgive my smooth brain but

whichever machine plane is local at
how do I know who the machine plane is local at?

hallow mortar
#

When you pass plane (i.e. the variable name of the plane) as the locality argument to remoteExec, it automatically detects it

south swan
#

Leo's code takes care of that

smoky verge
#

alright I'll try it

tough abyss
#

how fix? the message makes me confused

smoky verge
hallow mortar
tough abyss
#

sounds like a skill issue

granite sky
hallow mortar
# tough abyss sounds like a skill issue

The error does not contain enough information to deduce the full problem.
Trace back everything you're passing as an argument to modelToWorld, find out where it's coming from and what it actually contains, and see if it matches the documented requirements for the command.

granite sky
#

If they're not real items then it's not important in this case, but that seems like odd behaviour.

little raptor
smoky verge
little raptor
#

which results from incorrect calculations in previous lines

tough abyss
#

ok

little raptor
#

or maybe from using a nil value in a command that returns a number (e.g. sin nil)

smoky wagon
#

anyone know how to get water particles from like boats?
i wanna give an illusion of the USS freedom and it's liberty escorts moving for a jet mission... i tried looking everywhere on bohemia forums for clues.

winter rose
reef edge
#

For anyone familiar with CBA, do keybinds added via CBA_fnc_addKeybind only work for the mission display (46), and not when spectating, etc.? Seems to be the case, but wanted to verify.

stable dune
untold copper
#

Woah! When did ACE move from slack? ๐Ÿง

drifting portal
#

How do I create a large fire? I'm trying to find which particle parameter is responsible for the effect's "size"

untold copper
drifting portal
#

it has a good sprite

untold copper
drifting portal
#

Well I'm trying to do it for a scenario

#

I can't change config really

winter rose
#

there is a particles tutorial if you want ๐Ÿ™‚

#

(for scripting)

untold copper
#

I'm waiting looking forward to hearing on the Dad Joke.

#

Question:
What are you using inside the Suppressed EH?

this addEventHandler
[
    "Suppressed",
    {
        params ["_unit", "_distance", "_shooter", "_instigator", "_ammoObject", "_ammoClassName", "_ammoConfig"];
        
        hintSilent "I am suppressed!";
    }
];
languid slate
#

Any scripts for ai to kill civillans (Opfor)

untold copper
languid slate
#

instead of only Blufor

untold copper
#

What mod?

languid slate
#

sense the civillan setting is broken

untold copper
#

Any idea what side the Zombies and Demons are?
Been a while and I can't be arsed downloading it.

woeful agate
#

Is there way to skip missions in editor/sp since my scenario is very long ๐Ÿ˜„

#

i want to test if my late game tasks work as supposed

untold copper
untold copper
woeful agate
#

There is no debug console command or something for this?

languid slate
#

aka blufor

open fractal
#

what does "skip missions" mean?

woeful agate
#

Oh yeah sorry ๐Ÿ˜„ So basically i have many tasks which active after completing previous task. So i would like to skip tasks to test my late game tasks since it would take huge amount of time to complete it every time from start to finish just to test how tasks work.

untold copper
languid slate
#

i am talking about with the scirpt

untold copper
languid slate
#

no

#

the civillan presence is

open fractal
#

if you're using triggers you can activate the triggers with a variable

#

if you're using variables you can... set the variables

untold copper
languid slate
#

yes

untold copper
languid slate
#

no

untold copper
sharp grotto
#

Im trying to fix a problem with the enhanced movement rework but it's scripted in a way i have no clue about ๐Ÿ˜…
So i found this CBA_fnc_addClassEventHandler which resets a variable on death which fixes my issues.

\emr_main\XEH_preInit.sqf

["CAManBase","Killed",{
    (_this # 0) setVariable [QGVAR(isClimbing),nil];
}] call CBA_fnc_addClassEventHandler;

But because of this QGVAR thing i can't just run this.

player setVariable [QGVAR(isClimbing),nil];

Can somebody explain to me what that QGVAR thing is ?
And maybe an easy way to solve this problem ?

untold copper
sharp grotto
cosmic prairie
#

So before I go on a wild goose chase attempting it, is it possible to add an action to an object that zaps whoever performs the action with a lightning bolt?

crude needle
#

Yes.

cosmic prairie
#

Awesome. I may be back to ask more about implementation, but I'm assuming it's just like a normal action that targets the player but calling the lightningbolt module instead.

crude needle
#

That sounds about right.

manic kettle
#

Hello Gents,

Lets say i want to make a mod that overwrites the function "ace_advanced_ballistics.pbo\initKeybinds.sqf" with my own version of this function. This is a random example, i'm not editing ACE. How would i go about this?

Any advice would be greatly appreciated, thank you.

cosmic prairie
#
call
{
this addAction ["<t color='#FF0000'>Recieve the Blessing...</t>",
  {player setDamage 0; 
  [player] call ace_medical_treatment_fnc_fullHealLocal; 
  [this,nil,true] spawn BIS_fnc_moduleLightning;
  hint "Your actions have stained your soul.";
  }
,nil,10];
}
#

So I used this and the lightning didn't spawn, only gave me an error.

open fractal
#

the call is redundant

#

you should share the error

cosmic prairie
#

I see, I had used it from an existing ace heal script we use. I'll remove it.

cosmic prairie
untold copper
open fractal
#

it'll show up in the rpt

cosmic prairie
#

From what I can tell, it couldn't get a position or direction for the lightning. I'll redo the error real quick.

untold copper
cosmic prairie
#

Yeah, this is correct implementation, it's an action attached to a prop, and that's even one of the examples on the wiki

open fractal
untold copper
#

Inside an addAction? Lemme check.

cosmic prairie
#

Wait

#

You mean the lightning

open fractal
#

oh

#

yeah

untold copper
#

Of course!!

cosmic prairie
#

Okay, so I've used that exact argument before to target an object, but not inside of an action

#

Very easily I could have screwed that up

open fractal
#

the action function isn't called from object init ergo this is not defined

cosmic prairie
#

I see

#

So that's why I have my positional errors

untold copper
#

Does it now work?

cosmic prairie
#

I'm trying to figure out how best to define the target first.

open fractal
#
params ["_target", "_caller", "_actionId", "_arguments"];
``` parameters passed to the action script
manic kettle
cosmic prairie
#

Wait _caller is a valid parameter?

#

That just makes the position the person doing the action doesnt it

#

I feel dumb

open fractal
untold copper
cosmic prairie
cosmic prairie
open fractal
#

if the function takes an object, yes

cosmic prairie
#

Got it

languid slate
#

any Police Scirpts?

echo swan
#

how do i separate turrets from vehicles so i can put them on other vehicles

untold copper
wanton socket
#

Hey Iโ€™m looking for someone or some people to do some development is this the right place to look with scripting

echo swan
#

from different vehicles

#

like a t34 turret on a m113

warm hedge
#

Most of them just hide the part of hull/turret, then. It's easy to check how's compositions work, no?

untold copper
#

Dirty tactics, my friend.

warm hedge
#

Yeah, dirty enough

untold copper
#

animateSource won't do it.

warm hedge
#

I do believe most of them just use setObjectTexture to hide a part of them

untold copper
#

Now. That is dirty. And a little bit smart... If it works.

wind hedge
#

will this work? (a call inside a forEach): ```sqf
{
call {
if () exitWith {};
if () exitWith {};
};
} forEach units _group;

granite sky
#

Yes.

#

but you can do if (condition) then { continue }; instead now.

wind hedge
granite sky
#

what would that mean?

#

continue means jump to the next loop iteration.

wind hedge
#

Thank you

granite sky
#

The call/exitWith chain can be pretty useful for non-loop cases though.

#

It's actually faster than switch when you only have a few cases.

wind hedge
#

That would work? Meaning that as soon as the unit has that uniform it will apply the texture and jump to the next unit without checking all the uniforms

granite sky
#

yes.

#

You could also do if (uniform _x in ["", "U_C_E_LooterJacket_01_F"]) then { /* do stuff */ } there though.

#

which is faster if you predefine the array.

wind hedge
#

Thank you very much!

meager granite
wind hedge
granite sky
#

It's similar in the sense that it stops at the first match.

#

If it's a straight mapping of uniform->texture then the best option is a hashmap as usual :P

#
private _uniformMap = createHashMapFromArray [["SomeOtherUniform", "someothertexture.paa"], ["U_C_E_LooterJacket_01_F", ""], ["", ""]];
{
   private _texture = _uniformMap get uniform _x;
   if (!isNil "_texture") then { _x setObjectTextureGlobal [0, _texture] };
} forEach units _group;
wind hedge
granite sky
#

bear in mind that this isn't performance-critical code, so you should use whatever method is easiest to write or looks cleanest for it.

#

but you should definitely play around with hashmaps. They're super-useful.

wind hedge
velvet linden
#

hello! is there a way to randomize an action E.g

Use add action
random chance output
false - Nothing happens, true - Moves to the next stage
The script becomes true/activated Eg If Statement

Thanks!

velvet linden
#

also is there a way to check if a vehicle is no longer on existing E.g

(I delete Vehicle)
Object is still there
#

Also again (Soz) is there a way to make an action usable by the object I assigned it to E.g

addAction [CODE]
[Script]```

Other Object can use action but i only want the object with code to be able to use it
little raptor
little raptor
#

As for the action, use the action code parameters

#

See the wiki

params ["_target", "_caller"]
velvet linden
#

hey with the action stuff is there a way to make it a hold for x amount of seconds?

little raptor
#

Use hold action

#

BIS_fnc_holdActionAdd

velvet linden
#

ok thanks!

velvet linden
little raptor
#

Yes. Anywhere

velvet linden
#

ok Thanks!

ripe sapphire
#

Yo bros is it possible to animate players weapon with animateSource?

warm hedge
#

Nnnnope (sad ๐Ÿ˜ญ)

ripe sapphire
open flume
open flume
#

sorry

copper raven
#

wat? the command returns an array with the mods, it's up to you what you want to do with it

open flume
copper raven
#

client sides?

open flume
#

like Personal Arsenal, Expanded Inventory ect

#

sorry weird question ik XD

#

but they arent allowed and ppl are using em

copper raven
#

why do you want to do it server side?

#

just check it client side

#

and end the mission or whatever, if they have the forbidden addons

open flume
#

its for a unit, live mission with other people

#

just didnt know if it was possible (cause that code looked like it) to record what connecting players client side mods were

velvet linden
#

is there a way to check whether all players are alive or not
and the ones that are not, get to progress through the script?

#

Player Dies ---> While Downed they receive a Hold Interaction Action on screen ---> They Hold it ---> [Pre Determined CODE] ---> END

copper raven
#

is there a way to check whether all players are alive or not
you can do something like, allPlayers findIf { !alive _x } < 0

rich frost
#

hi - only since recently, the rpt to my mission started get spammed by this stuff and i cannot seem to find the cause for this.
Does anyone has experience with that?

15:36:22 Attempt to override final function - bis_functions_list
15:36:22 Attempt to override final function - bis_functions_listpreinit
15:36:22 Attempt to override final function - bis_functions_listpostinit
15:36:22 Attempt to override final function - bis_functions_listrecompile
15:36:22 Attempt to override final function - bis_fnc_packstaticweapon
[...] 5500 lines of this in total

https://i.imgur.com/VjSz1qJ.png

velvet linden
#

How can i revive players using a script?

warm hedge
#

In the first place, you can't set someone unconscious without using a script... what revive system you use?

velvet linden
#

just vanilla

granite sky
#

Don't see a direct revive function there so you'd probably have to read the code.

warm hedge
#

Probably setUnconscious itself

granite sky
#

May have consequences if you don't reset internal data. Depends if it's designed for that.

velvet linden
#

im talking you get shot and downed waiting for revive

warm hedge
#

Yes?

granite sky
#

Vanilla effect is that you just die.

#

Anything else needs to be added or enabled by mods or missions.

copper raven
#

the example looks promising aswell

hallow mortar
#

The vanilla revive system is a bit of a black box and not very well documented, unfortunately

#

Looking at the code of BIS_fnc_reviveOnState, it definitely seems like that's the one you want

sacred wolf
#

Hey, i have a quick question. I'm tired of having to pardon my buddies because they crashed/destroyed their own vehicle by accident. Is it possible to disable the HandleRating EH with a mod or script?

sacred wolf
#

Its default arma

copper raven
#

then add the event handler and override the behavior as you wish

sacred wolf
#

tried player addEventHandler ["HandleRating", { 0 }]; in init.sqf and initPlayerLocal.sqf but both methods did not work

copper raven
#

might be too early

#

add, waitUntil { sleep .1; !isNull player }

sacred wolf
#

Ok i can try that

#

Do i need to rerun it after respawn or does it still work after that

copper raven
#

no idea

#

try it

sacred wolf
#

Ok will do

#

Thanks

granite sky
#

IIRC the event handler is respawn-persistent.

#

player addEventHandler ["HandleRating", {0}]; worked fine for us but we do wait until the player unit is valid.

sacred wolf
open hollow
#

the safest way to run it is on initplayerlocal.sqf

#

its executed when the player object already exist

sacred wolf
#

It just doesn't work for me. Maybe some mods are conflicted. I also run ace with setting: Disable negative rating enabled. I'll try it again with that setting disabled

#

Also when i run it via zeus or in OnPlayerRespawn.sqf it just works fine

#

@granite sky i'm running waitUntil { sleep 1; !isNull player }; player addEventHandler ["HandleRating", {0}]; in initPlayerLocal.sqf but it still doesn't work for some reason. Can send me how you managed to do it?

copper raven
#

if it's stacked, then only one of the ehs return value is considered, not sure which one though (top or bottom)

drifting portal
#
playSound3D ["a3\missions_f_oldman\data\sound\beep.ogg", player, false, [0,0,0], 10, 1, 20];

why can't I hear this?

#

(I'm the player)

hallow mortar
#

I bet you'll hear it if you stand at [0,0,0]

drifting portal
#

getposasl probably

hallow mortar
#

Seems likely

drifting portal
#

yep

hallow mortar
#

PlaySound3D's optional parameters are rather unfortunately-laid-out

drifting portal
#

there we go

sacred wolf
kindred zephyr
drifting portal
#

is there a way to stop a human from getting 'scared' by explosives (human spawned through createvehiclelocal)?

winter rose
drifting portal
#

Very weird

#

I will test it in vanilla next time to not anger you

velvet linden
#

is it possible to make a vanilla composition script where when incapacitated you can hold a action button to have a chance to self revive?

velvet linden
#

yea

fair drum
#

let me see if i can come up with something for you. give me a sec

velvet linden
#

hey also im playing around with setObjectTextureGlobal how do i know what numbers are used to hide certain things?

fair drum
velvet linden
#

ok thanks

fair drum
velvet linden
#

yea I was going to have a 40% Chance of them Instantly dying if they fail if they didn't die then they would continue to bleed out

velvet linden
fair drum
#

should execute on every client when that object you put it on initializes

velvet linden
#

what do you mean by the object you put it on initializes

#

like a invis heli pad or something

fair drum
velvet linden
#

sweet

fair drum
#

just make sure that helipad never gets deleted, so that JIP players will still have it run when they init the mission objects

velvet linden
#

ok!

#

how can i go about testing this?

fair drum
#

modify it how you want. should be straightforward looking at it

#

hmm actually, let me make a modification real quick

velvet linden
#

ok thanks for this!

fair drum
#

fixed, there ya go. id like to write comments so you know what does what, but its not allowed in init boxes

velvet linden
#

hey also im trying to change an objects texture and its not working and reasons why?

this setObjectTextureGlobal [4,'A3\Supplies_F_Heli\Bladders\Data\StorageBladder_Forest_CO.paa'];
fair drum
#

you sure that index is the correct one for the object you are using?

#

what object classname are you using?

velvet linden
#

im currently messing arround the CSAT Artillery and trying to make one of textures a bladder forest colour

#

nevermind i realised i was doing the wrong index

#

but the texture looks weird

#

probs cause its the wrong one

#

but thanks

#

@fair drum is there a list or database somewhere of all the textures in arma?

fair drum
#

it can take some time to go through all the configs (if you have a ton of mods), so make it so your arma client runs while not focused so you can alt tab and do something else

velvet linden
#

ok

#

hey in the config veiwer some of the text gets cut of to the right is there a way to scroll left somehow?

fair drum
velvet linden
#

ok

velvet linden
#

hey does anyone know how to avoid the magazine loading upon vehicle spawning with modified weapons using addWeaponTurret

stable dune
#

Does unitCreated EH work on alive spawn, in editor attached units and zeus created units?
Or do i need do for all own ?

little raptor
stable dune
#

Yeah that one

#

Thanks

coarse dragon
#

if i wanna play a sound from a 3D object does the description ext need to be changed?

copper raven
#

say3D requires a config, playSound3D does not

coarse dragon
#
class CfgSounds
{

    class zombienews
    {
      name = "zombienews";
      sound[] = {"sounds\zombienews.ogg", 1,1};
      titles[] = {0,""};
    };
    class zombattle
    {
      name = "zombattle";
      sound[] = {"sounds\zombattle.ogg", 1,1};
      titles[] = {0,""};
    };
};

that

copper raven
#

yes

coarse dragon
#

[OBJECT, ["classNameToUseInScript", 125, 1]] remoteExec ["say3d", 0, true];

#

for a trigger

copper raven
#

if you're gonna remoteExec from a trigger, make sure it's server only trigger

coarse dragon
#

It's a single player mission. If that matters?

copper raven
#

then why remoteExec at all?

coarse dragon
#

I just copied from a forum

copper raven
#

you can read on what it does there

coarse dragon
#

ah

#

which one is the sound level :S

winter rose
#

sorry what?

distant oyster
#

does a hc or dedicated server run EachFrame EHs and with what frequency?

coarse dragon
#

need it to have more volume

hallow mortar
#

You can adjust the sound volume in the description.ext sound config or by editing the original file

coarse dragon
#

sound[] = {"sounds\zombattle.ogg", 1,1};

1st or 2nd?

#

of the two ones

hallow mortar
#

What does it say in the documentation?

#

Keep in mind that your implementation of say3D (if you're still using the arguments from the remoteExec version) is limiting the audible distance to 125m regardless of volume

winter rose
coarse dragon
#

sorted it thanks

coarse dragon
#

new question

#
playSound "zombattle" spawn { 
  _zombattle = _this; 
  while {true} do { 
    if (isNull _zombattle) then {_zombattle = playSound "zombattle"}; 
    sleep 1; 
  }; 
};

how would i get that to stop whenever i leave the trigger area?

hallow mortar
#

My initial thought would be to change true to triggerActivated your_trigger_name

coarse dragon
#

i see

#
playSound "zombattle" spawn { 
  _zombattle = _this; 
  while {triggerActivated zom} do { 
    if (isNull _zombattle) then {_zombattle = playSound "zombattle"}; 
    sleep 1; 
  }; 
};
``` like that?
coarse dragon
#

ugh i cant seem to get anything working

sharp grotto
#

Adjust the sleep value to the length of the zombattle soundfile.

coarse dragon
#

doesnt seem to work

#

ah i give up

copper raven
#

(in trigger)

languid slate
#

Any scripts to create AI traffic?

open hollow
coarse dragon
#

Have you seen how the Ai drive? It would be chaos

granite sky
#

well, I assume he doesn't mean heavy traffic :P

#

but even with simple road paths they tend to get wedged after a bit.

cedar cape
#

what script do i need to unload all crew

#

ive got unit capture to land the heli but i just need a script to go in trigger that will unload the player and AI

unreal hornet
cedar cape
#

its using unit capture not AI

unreal hornet
cedar cape
#

i just need a script that unloads all cargo

#

basicly

unreal hornet
#

hello all, I've been tasked by a server owner to develop a Group Teleport script which will teleport a group leader and his group without breaking formation after a contextMenu action is triggered and the map is clicked. this is what i have so far.

//teleports the group with the leader upon a click of the map only once and then (is supposed to) disable itself
//(group leader Init) this addAction ["<t color='#0000FF'>Group Teleport</t>","groupTeleport.sqf",[],6,false,true]; 
//framework from mrcurry on BIS forums 
params ["_leader", "_caller", "_id", "_args"]; //don't know what to do with these params other than _leader 
_leader setVariable ["tp1",true]; //_leader is the target I want this run on 
openMap [true,false]; 
while { (_leader getVariable ["tp1",true]) && (call TMF_safestart_fnc_isActive) } do { 
//script from pierremgi on BIS forums
    onMapSingleClick " 
        params ['_pos','_units','_shift','_alt','_dir','_leader','_dist']; 
        _units = units player; 
        _leader = leader group player; 
        _teleport = _units apply {[_x,[_leader distance _x,_leader getDir _x]]}; 
        { 
            _x#0 setPos (_pos getpos (_x#1)); 
            openMap [false, false];
        } forEach _teleport; 
    ";
};
while { (_leader getVariable ["tp1",true]) && !(call TMF_safestart_fnc_isActive) } do {
    _leader setVariable ["tp1",false];
    //removeAllActions _leader;
};```
we have loaded a mod which enables SafeStart, a module that prevents shots from being fired while in briefing. I'm updating the server owner as this script progresses, but he advised me to "call in the cavalry and ask in the scripting channel of the Arma discord". I've already asked in BIS forums but the kind gentlemen there have stopped replying. the main problem i have is that this wont disable
south swan
#

player group or AI group?

unreal hornet
cedar cape
#

yo can anyone help me?

#

i need a script that unloads all ai/players from a vehicle

unreal hornet
# cedar cape i need a script that unloads all ai/players from a vehicle
south swan
unreal hornet
# south swan what's the intent behind `while {...}` lines?

i have a couple variables, "tp1" which is used to enable/disble the script, and call TMF safestart isActive. so that while both of these are true and not true, to allow or disallow Teleport of the _leader and his group
this is the relevant forum post where others have helped me
https://forums.bohemia.net/forums/topic/240079-teleport-player-group-of-other-players-onmapsingleclick/

cedar cape
#

how do i create a group anyway

#

in the forum post it says to put the group name

#

where even is that

chilly aspen
#

Hi so i am trying to make a script that if specific player presses the button on the scroll menu the car damages like the wheel is broken or the fuel tank is broken. Does any one know how to do that?

unreal hornet
cedar cape
#

grp1 = group this; this should work right?

#

nvm

#

doesent work

south swan
cedar cape
#

Alpha 1-2 leaveVehicle heli_1; any idea why this isnt working

#

it says im missing ;

south swan
#

because Alpha 1-2 isn't a variable name

cedar cape
#

im so confused

south swan
#

so the game can't parse your command, so it spits out the error ๐Ÿคทโ€โ™‚๏ธ

cedar cape
#

it says at the side

#

Alpha 1-2

#

and all the units

unreal hornet
# chilly aspen Hi so i am trying to make a script that if specific player presses the button on...

yes. you'd put this addAction ["Damage Vehicle","damageVehicle.sqf",[],6,false,true]; in the init of the vehicle in the editor (or if that doesnt work use init field of the player)
in damageVehicle.sqf where you'd put with the mission.sqm, you'd put vehicle player setDamage 0.5; and then a float between 0 and 1. but then you'd need to heal your player because it will damage both the vehicle AND your player so add player setDamage 0; so like 0.5 will damage the vehicle 50% but heal the player

south swan
# cedar cape Alpha 1-2

the readable group callsign isn't a variable name. You need to either assign a variable name to it in group's properties in 3DEN if it's editor-created; or get the group in the code some other way (say, group _unit for some unit in it)

cedar cape
#

alr

#

this joinSilent grp1; will this work

#

in the init of every unit

#

didnt work

#

im so

#

confused

unreal hornet
open fractal
cedar cape
#

so no radio message

open fractal
#

are they not in the group already?

cedar cape
#

idk

#

idk how to make a group

#

im so confused

#

i just need a script that kicks all the units except from the pilot out of a heli when it lands

open fractal
#

didn't you already make Alpha 1-2?

chilly aspen
south swan
#

joinSilent takes an Array of units to join the group. Proper syntax would be [this] joinSilent grp1;

cedar cape
#

and i was directed to a forum post that uses leave vehicle

chilly aspen
#

and i tryed this

this addAction ["Przebij bak",v1 setHitPointDamage["hitfuel",1]]
cedar cape
#

is there any other way of kicking units out a heli

#

apart from using the group name then leave vehicle

open fractal
#

crew

chilly aspen
cedar cape
south swan
open fractal
#
_everyoneButDriver = (crew _vehicle) - [driver _vehicle];
{ moveOut _x } forEach _everyoneButDriver;

there may be a faster way

cedar cape
#

i will try this thank you

chilly aspen
#

can i make it also so it plays a sound when the command runs

#

like say3D?

open fractal
#

did you define _vehicle?

cedar cape
#

my bad

upper siren
#

I'm checking if the driver of a vehicle is AI or not
driver _entity == player, is that the corret way to go about it?

cedar cape
#

still no

cedar cape
granite sky
#

isPlayer (driver _vehicle)

ruby bronze
#

Only throwing my hat into the ring because I literally just used this code in a mission a couple weeks ago and it worked like a charm.

chilly aspen
brazen lagoon
#

hey, is there an existing way to filter out markers that overlap?

coarse dragon
#

does fadesound work with custom music?

#

or fademusic even

ruby bronze
copper raven
ruby bronze
brazen lagoon
#

its fine I figured it out

cedar cape
#

wont work

brazen lagoon
#

given a list of markers i wanted to filter out markers that overlapped

#

was hoping that was a built in but w/e

copper raven
upper siren
#

if I wanted to check if a vehicle has a driver, does

isNull(driver _entity) //return true if driver is in vehicle

work?

copper raven
#

looks correct

#

except the comment ๐Ÿ˜„ it's true if no driver is in vehicle

upper siren
#

true ๐Ÿ˜„

copper raven
cedar cape
#

i have defined the vehicle

#

its now ```_everyoneButDriver = (crew heli_1) - [driver heli_1];
{ moveOut _x } forEach _everyoneButDriver;

copper raven
#

run systemChat str [_everyoneButDriver]

#

and see if you get the output you want

cedar cape
#

it doesent eject anyone full stop

#

ive been looking at the wiki and would this work? (unit names) action ["eject", heli_1 (unit names)];

coarse dragon
copper raven
copper raven
cedar cape
#

im not

coarse dragon
#

playsound "soundname";

ext in the mission file

cedar cape
#

i was looking in the wiki

copper raven
#

add debug like i said

cedar cape
#

and wondered if that would work

#

alr

copper raven
coarse dragon
#

nope

#

that

#

oops

#
sqf
5 fademusic 0;
copper raven
#

not fadeMusic, fadeSound

#

or did you try both?

coarse dragon
#

that fades all sound then

copper raven
#

well there's no other way

#

delete the sound then

coarse dragon
#

wth is fademusic for then?

copper raven
#

for playMusic

cedar cape
#

alr i ran it

copper raven
#

and what did it print?

cedar cape
#

i got [any]

#

in the chat

copper raven
#

so the vehicle is undefined

cedar cape
#

wdym

#

i just ran systemChat str [_everyoneButDriver]

coarse dragon
#

theres no other way to stop it??

cedar cape
#

like you said

copper raven
#

you're running crew nil which silently breaks the rest of the expression

#

heli_1 is undefined

copper raven
#

playSound returns a handle

coarse dragon
#

tried that. didnt seem to work either

cedar cape
#

no idea why it wont work on the waypoint

copper raven
#

waypoint?

copper raven
cedar cape
hallow mortar
# coarse dragon tried that. didnt seem to work either

I don't mean to be rude, but I have a strong suspicion that it "didn't seem to work" because you didn't do it right, although it's hard to know for certain without seeing the code.

When you're trying to get help with code troubleshooting, it really helps to be specific and clear. If your code isn't working, post the code. If there's an error, post the error. Explain what you're trying to do, in an understandable way. It's okay to take more than 3 seconds to write a message, in order to give all the important details (for example, whether you changed anything in a piece of code someone else gave you) and write it in a clear and understandable way. If you don't understand something, say what you don't understand so someone can help, or at least read the wiki - trying to jam commands together without understanding the syntax or how they work won't result in working code.

If you want to write your own code, take the time to think it through and figure it out. Rushing won't get you working code.
If you want someone else to do it for you, explain the overall goal you're trying to achieve, and do try to make an effort to understand why the provided code is the way that it is.

Many of us are here to help, but we can't read your mind or your screen, so you have to help us a little bit too.

chilly aspen
#

but when i try to launch it on multi it doesn't work for other pepole

#

i am the host and when i try to interact with a button

#

it just works

#

but when some players try to do it

#

it doesn;t work

south swan
# chilly aspen but when i try to launch it on multi it doesn't work for other pepole

https://community.bistudio.com/wiki/setHitPointDamage. "Local Argument, Global Effect". It needs to be executed on the computer where the vehicle is calculated at. Details are available at https://community.bistudio.com/wiki/Multiplayer_Scripting, https://community.bistudio.com/wiki/Arma_3:_Remote_Execution and https://community.bistudio.com/wiki/remoteExec. this addAction ["Przebij bak",{[v1, ["hitfuel",1]] remoteExec ["setHitPointDamage", v1]}] may work, but i haven't tested this ๐Ÿคทโ€โ™‚๏ธ

boreal parcel
#

does anyone know of any script's or built in methods to allow users to change ground vehicle weapon loadouts? Like changing ammo types in tanks/mounted machine guns basically.

coarse dragon
copper raven
south swan
#

fixed, thanks

copper raven
#

if the latter, there's no such thing in vanilla, no

coarse dragon
#

The DeleteVehcichle trigger doesn't stop the sound

copper raven
#

you are not supposed to delete the trigger

#

you're supposed to delete the sound handle which playSound returns

copper raven
south swan
#

whoo, boy, in-game pylon editors. I believe i've written one. Or two. Or three (?)

coarse dragon
#
_source = playSound "zombattle"; 
_source spawn 
{ 
 sleep 200; 
 deleteVehicle _this; 
};

something like that look right?

boreal parcel
coarse dragon
#

Thanks

tulip ridge
#

I'm getting an error that a variable is undefined despite me passing it as a parameter?
The script works fine, all it does is reset some skeets, but I still get the error saying that num_objects is undefined
All skeets have variable names of obj_

// object init
this addAction ["Reset Objects", {["obj_", 11] execVM "scripts\reset_obj.sqf"}];
// reset_scripts.sqf
_prefix = _this select 0;
_num_objects = _this select 1;

for "_i" from 0 to _num_objects do
  {
    _var = _prefix + (str _i);
    _curr_object = missionNamespace getVariable [_var, objNull];

    _curr_object animateSource ["Object_Hide", 0];
  };
#

I had to rename some things due to a word having a meaning that I did not know about lol

copper raven
#

is this the exact code you're using?

#

i see no issues here

#

apart from you commenting that it's reset_scripts.sqf, but you're execVMing a different one (i suppose you forgot to rename)

tulip ridge
#

Oh yeah lol

#

I had it as the actual script name, but a word in it is blocked

tulip ridge
copper raven
#

when you start the mission? then you're executing it elsewhere

#

because here you're adding an action, which you have to activate for the code to run

tulip ridge
#

I have a few different objects call these, so it's more like:

// Object Init
this execVM "scripts\firing_range_targets.sqf";
// firing_range_targets.sqf
// Other code here
_this addAction ["Reset Objects", {["obj_", 11] execVM "scripts\reset_objs.sqf"}];
// Other code here
// reset_objs.sqf
_prefix = _this select 0;
_num_objects = _this select 1;

for "_i" from 0 to _num_objects do
  {
    // https://steamcommunity.com/app/107410/discussions/17/4594236462790548977/
    _var = _prefix + (str _i);
    _curr_object = missionNamespace getVariable [_var, objNull];

    _curr_object animateSource ["Objs_Hide", 0];
  };
#

Probably should've specified that, but didn't think it was necessary and would just be extra clutter

copper raven
#

and it says that _num_objects is undefined?

tulip ridge
#

Yeah

#

I can get a ss of the error

copper raven
#

debug _this

#

diag_log [_this]

#

in the reset_objs.sqf

#

then run the mission and check rpt

tulip ridge
#

Gotcha

tulip ridge
copper raven
#

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

copper raven
#

change it to diag_log ["_this", _this] so you can just ctrl+f _this in the logs

tulip ridge
#

Here's the exact error btw while I do that

'...s = _this select 1;

for "_i" from 0 to |#|_num_objects do
{

_var = _prefix + (str...'
Error Undefined variable in expression: _num_objects
File <path to file>..., line 4
copper raven
#

where did you add the diag_log?

tulip ridge
#

top of the file

copper raven
#

above the error you should see it

#

if not, you didn't save the file

tulip ridge
#
14:39:04 [[false]]
14:39:04 Error in expression <;
diag_log [_this];

for "_i" from 0 to _num_objects do
{

_var = _prefix + (str>
14:39:04   Error position: <_num_objects do
{

_var = _prefix + (str>
14:39:04   Error Undefined variable in expression: _num_objects
copper raven
#

so yeah, i don't know where are you executing this, but you're passing false to the script

#

you can run diag_stacktrace above the diag_log and see where it's being executed from

tulip ridge
#

...
So I found out why it wasn't working...
Has nothing to do with the code, I just copy/pasted the _this addAction ... but I didn't change the script name

#
// Completely different object init
this addAction ["Lower Beach Walls", [true] execVM "scripts\reset_skeets.sqf"]; 
this addAction ["Raise Beach Walls", [false] execVM "scripts\reset_skeets.sqf"];

Gotta love programming lol

copper raven
#

well yeah i told you it had nothing to do with the action, it was something elsewhere ๐Ÿ˜…

tulip ridge
#

Yeah, knew that the code was right, but I was just confused as to how "11" would be evaluated to true lol

pulsar bluff
#

I have a player-side script which disables simulation on distant non-local vehicles (tanks, cars, etc). Issue is when the non-local vehicle moves significant distance, the position is not known. so it becomes hard to tell when the distant vehicle becomes nearby vehicle, and problematic when the vehicle shoots at the player.

#

I wonder what is the best way to receive a vehicle location update when "getPosX" still reports far away, even tho the vehicle is near

#

variable based updating works i guess, but adds some network traffic

sharp grotto
pulsar bluff
#

its not really optimised for multiplayer. sure it works, but Player A close to the action, wakes up simulation for Player B far from the action

#

theres no reason for Player B infantry guy to be running simulation calcs for an entity 10km away just bc Player A is over there

#

I do use it, but we can run dynamic simulation tighter than that

sharp grotto
#

True, sounds like a job for dedmen ๐Ÿ‘€

pulsar bluff
#

naaa, just wondering about other methods to get position of vehicles when simulation is disabled

ruby bronze
#

Hey guys, I'm trying to get this ACE Self-Interact to only let the group leader use it, not every player. How can I change this?

_action = ["Spawn M1A1","Spawn M1A1","",{execVM "vehicleSpawn.sqf"},{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToObject;
#

Is it as simple as changing player to leader?
(Also, I'm going to house this inside the initPlayerLocal.sqf most likely)

brazen lagoon
#

is there any way to determine if 2 points have a path between them?

#

actually will this ever fire for impossible paths?

open fractal
#

you can set a group event handler to check if the player is the group leader and create/remove the action accordingly, or you can add a ```sqf
if (leader player != player) exitWith {};

in the script itself
untold copper
#

(calculatePath ["wheeled_APC","CARELESS",[2173.78,772.128,0],[2923.23,6125.45,0]]) addEventHandler ["PathCalculated", {
    {
        private _marker = createMarker ["marker" + str _forEachIndex, _x];
        _marker setMarkerType "mil_dot";
        _marker setMarkerText str _forEachIndex;
    } forEach (_this select 1);
}];

#

Take it away, @brazen lagoon.

untold copper
brazen lagoon
#

would you just time out?

untold copper
#

What the fuck are you talking about?

untold copper
brazen lagoon
#

how does that answer my question

#

what I'm asking is, if you have 2 islands. let's say you try to pathfind from one island, to the other island, as a car (i.e. not amphibious), what would happen?

untold copper
#

Using the initial example?

brazen lagoon
#

yes

untold copper
#

Did you change the start and end point?

brazen lagoon
#

look what I'm actually asking is if there's a way to detect if two points are connected by land. the most obvious way to figure this out I could come up with was using calculatePath.

#

is there a better way of doing that

untold copper
brazen lagoon
#

ok well I will see what I can think of then because this would be a very useful thing to have

brazen lagoon
#

I'll see what happens I guess

untold copper
brazen lagoon
#

@untold copper I think the best choice is genuinely just to sleep for 30 seconds and if the path isn't calculated assume it's impossible and terminate the agent

untold copper
#

Are you using it mid-mission?

sharp grotto
ruby bronze
ruby bronze
untold copper
untold copper
#

Nice.

sharp grotto
untold copper
sharp grotto
#

I do it the "forbidden" way where devs would probably crucify you ๐Ÿ˜†

private ['_code', '_function', '_file'];
    {
        _code = '';
        _function = _x select 0;
        _file = _x select 1;
        _code = compileScript [_file];
        missionNamespace setVariable [_function, _code];
    }
    forEach
    [
    
        ["FN_function1","Code\function1.sqf"],
        ["FN_function2","Code\function2.sqf"]
    ];
untold copper
#

Oh, Mummy.
I need a beer.

ruby bronze
#

Seems to work Maff.
Going to also look into the functions thing in case it can be useful for this or something in the future

untold copper
sharp grotto
ruby bronze
untold copper
untold copper
sharp grotto
untold copper
#

Oh.

sharp grotto
# untold copper Oh.

Might be due to the fact that you can easily override it. ExileMod has a customCode "feature" that lets you easily overwrite every mod function in your missionfile.

untold copper
sharp grotto
untold copper
#

Ah, of course.
Normal players can't access the console.

#

Good chatting with you, @sharp grotto.
I am offsky.

somber radish
#

anyone got a good way to sort an array of positions by distance?

#

something like this:

params["_startPos", "_posArr"];

private _sortedArr = //do something:


_sortedArr;
#

Having it return positions from the closest to the furthest

#

ok

#

googeled

#

๐Ÿคฆโ€โ™‚๏ธ

#

found it

granite sky
#

There is no good way but there are a lot of bad ways :P

somber radish
#
_closestHelicopters = [[_heli1,_heli2,_heli3], [], { player distance _x }, "ASCEND"] call BIS_fnc_sortBy;
somber radish
velvet linden
#

Hello wonderful people!
I was just wondering does anyone know how to check a player's inventory, I'm trying to make a script where they plant explosives and I would like them to have them! it's probably obvious but you know me!

#

also is there a way to delay stuff? E.g Delay 30s then continue script. Sorta like Wait() in Lua?

velvet linden
#

thanks

open fractal
#

or waitUntil

velvet linden
#

noted

open fractal
#

getUnitLoadout will return an array of all items the player has

#

it's separated out into uniform, vest, and backpack, idk if the itemCargo commands work with units

velvet linden
#

ok, thanks!

open fractal
#

this is the one

velvet linden
#

ah ok

#

is there a way to compare these items with the ones i want?

tough abyss
#

Anyone know the config name of the weapon holders that are spawned upon death or able to run something to get them and send them

warm hedge
#

IIRC it is simulated variant

open fractal
#

"GroundWeaponHolder_Simulated" or something like that

#

maybe "WeaponHolderSimulated"

open fractal
oblique pewter
#

hey im trying to hide the texture of a 4w jeep

#

[this, mar2] call BIS_fnc_attachToRelative;
[this,[0,""]] remoteExec ["setObjectTextureGlobal",0 ,true];
[this,[1,""]] remoteExec ["setObjectTextureGlobal",0 ,true];
[this,[2,""]] remoteExec ["setObjectTextureGlobal",0 ,true];
[this,[3,""]] remoteExec ["setObjectTextureGlobal",0 ,true];
[this,[4,""]] remoteExec ["setObjectTextureGlobal",0 ,true];
[this,[5,""]] remoteExec ["setObjectTextureGlobal",0 ,true];
[this,[6,""]] remoteExec ["setObjectTextureGlobal",0 ,true];
this lockDriver true;
this lockTurret [[0,0], true];
this lockCargo true;

#

this is what i am using'

#

it has worked on other vehicles but the textures of the 4w jeep do not change.

#

is it possible that i can change the texture on the jeep?

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
#

And which jeep you mean?

oblique pewter
#

the syndicat jeep

warm hedge
#

Also urm... remoteExec ing setObjectTextureGlobal for 0 is a pointless execution, if you want to do that you don't simply need remoteExec at least I think

oblique pewter
#

setObjectTextureGlobal is buggy and does not work sometimes

#

anyways thats not the issue

warm hedge
#

MB 4WD and what is this in this context?

oblique pewter
#

the jeep

#

the code is in the jeep

#

part of the jeep turns blue if that means anything

#

but its supposed to turn invisible

warm hedge
#

This doesn't look like an usual behavior, probably an issue with the model

oblique pewter
#

so probaly nothing i gan do then

warm hedge
drowsy geyser
#

how would I prevent damage to a unit other than damage to the legs, so only allow damage to the legs?

open fractal
#

handleDamage event handler

neon lynx
#

Hi,
I would ask if
https://community.bistudio.com/wiki/addonFiles
also works for mission files?
My scenario: My script looks in a folder inside the "MyMission.pbo" and finds an unknown number(with unknown names) of "*.sqf". The mission register this sqf's in an array.
would this work with "addonFiles"?

drowsy geyser
# open fractal handleDamage event handler

did something like this but ๐Ÿคทโ€โ™‚๏ธ

player addEventhandler ["HandleDamage",{
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    switch (_selection) do 
    {
        case("head"):    {_unit setHitPointDamage ["HitHead", 0];};
        case("body"):    {_unit setHitPointDamage ["HitBody", 0];};
        case("hands"):    {_unit setHitPointDamage ["HitHands", 0];};
        case("legs"):     {_unit getHitPointDamage "HitLegs";};
        case(""):    {};
    };
}];
velvet linden
#

hello! how can i make 2 objects communtcate Eg. Object 1 Var = true, Object 2 Var = true then Script

  hint "works"
};```
warm hedge
#
if (ob1 && ob2) then {

};```
velvet linden
#

like E.g Hunter and quad bike

warm hedge
#

Eh, what?

#

What exactly you're trying aka your goal?

velvet linden
#

im trying to have 2 objects communicate

warm hedge
#

What is that?

velvet linden
#

so object 1 has a script at the end of the script it ends with boolen true object 2 has the same, both objects say to each other ok this Var is true and when both are true a script on both run at the same time

warm hedge
#

So, you want to wait until two scripts are done?

velvet linden
#

on different objects

#

yea

warm hedge
#

Scripts are not objects, there're no relations

#

Booleans are not objects as well

velvet linden
#

no

#

on a global level

warm hedge
#

What...?

velvet linden
#

ok listen

#

i have two objects lets say a quadbike and hunter vehicel with two different Var / Variables right

#

when both vehicles Var's Are true

south swan
#

and how are variables linked to objects?

velvet linden
#

idk that what im asking

#

can i have a global variable that can be detected in int boxes from any object / vehicle

warm hedge
#

Yes

Variable = true;```this is a global variable that can be used (almost) anywhere
south swan
#

and if you use missionNamespace setVariable ["Variable", value, true]; it even gets sent to other clients in multiplayer ๐Ÿฟ

velvet linden
#

ah ok ive just had a low IQ moment

#

so i just did a test and when the variable is in the same int box it works but when i separate it, it doesn't work?

warm hedge
#

separate?

velvet linden
#

in two different objects

#

i have a hunter and a computer

warm hedge
#

What exactly you did? I mean what's your code?

#

And doesn't work how?

velvet linden
#

in the computer i have _var1 = true; and in the hunter i have:

hint "Press W to move forward.\nPress S to move backwards."
};```
south swan
#

because variables with names starting with _ are local. And aren't available anywhere else

warm hedge
#

In Init section am I right?

velvet linden
#

ah ok

south swan
velvet linden
#

so i removed the _ and still doesent work?

warm hedge
#

It is because your Hunter's init is executed before the computer's

#

(Probably)

velvet linden
#

so how can i delay it by using sleep or something?

warm hedge
#

Since I really don't understand the goal of yours, I really can't say. Why you need to define a true somewhere in an init, so your hint is executed right after the start of mission?

velvet linden
#

so i want to make a explosive thing so when 2 explosives are placed by players using BIS_fnc_holdActionAdd and then when both are set i have a countdown to explode

#

i will remove explosives from inv and place them to be invis and that

oblique pewter
#

hi i have a question, i have a hunter with a quilin inside it. You can get into the gun from the outside and shoot it. I want to make it possible to enter the quilins minigun while in the hunter. I know i need to use add action, ut i dont know how to teleport the player into the quilin

hasty gate
#

is there an event handler when a vehicle has locked on its radar on a vehicle? somehting like IncomingMissile EH but for radar?

velvet linden
#

Hello! is there a way to compare items in players to a specific item? this is what i have so far!

expl = "SatchelCharge_F";

[ 
 laptop, "Hack Laptop", "\a3\ui_f\data\IGUI\Cfg\HoldActions\holdAction_hack_ca.paa", 
 "\a3\ui_f\data\IGUI\Cfg\HoldActions\holdAction_hack_ca.paa",  "true", "expl in pitems",{hint "Hack Begining\n Dont Stop!"}, {}, {hint "Hack Successful"}, {hint "Dont Stop!\nYou Could of Tripped the Alarm!"}, [], 12, 0, true, false ] remoteExec ["BIS_fnc_holdActionAdd", 0, laptop];```
#

this is not working for me, (My guy does have a satchel Charge in Inventory

hallow mortar
#

You're saving the player's items at the time you add the action, so if they acquire the charge later it won't be detected (or if they start with the charge and lose it later, they'll still have the action). You need to check the items live in the condition, e.g. expl in (items player).
However, satchel charges are secretly magazines (for the Put weapon) not items. So you need to check expl in (magazines player) instead.

You would probably also want to add a distance condition as well. Your final condition should probably look like this:

"((_this distance _target) < 5) && {expl in (magazines _this)}"

Note the use of the ( .. ) && { .. } structure to save performance by doing lazy evaluation - the item check will only be done if the distance condition is satisfied, so it won't be checking the player's magazines every frame throughout the mission.

tough abyss
#

how do i make a unit "shout" for still screenshots?

hallow mortar
tough abyss
hallow mortar
#

In the expanded Animation Viewer, there's a dropdown for Animations, Gestures, and Mimics. Face stuff is under Mimics. Gestures and Mimics are applied to a unit in the same way as Animations.

tough abyss
dreamy kestrel
#

quick question... steam is indisposed or I would verify there...
_obj getVariable ["",objNull] yields what? objNull?

copper raven
#

it acts as a regular varname iirc

#

though iirc empty varname was throwing errors as being "reserved variable"

#

in arma2 i think? ๐Ÿค”

granite sky
#

I only recall the error on setVariable.

tough abyss
#

https://sqfbin.com/epasolakonoqebabisuq running into a error missing ; at line 104 cant see the issue i believe it has something to do with the foreach as that is the only major change ive mad recently

sharp grotto
#

and now look at yours

tough abyss
#

?

sharp grotto
# tough abyss ?

Yours

_items = ["MineDetector,Rangefinder,Laserdesignator,ItemCompass,ToolKit,acc_flashlight"];
tough abyss
#

how would that change _weaponholder

sharp grotto
#

Error reporting is not always correct

dreamy kestrel
tough abyss
#

ill check now

#

same error with the pushback

#

nothing in that code block changes _weaponholder except the adding of items

#

wait my bad i put line 103 there i meant 104

#

sorry

sharp grotto
#
_weaponholder addItemcargo [_weaponR, 1]    
#

you miss a ;

tough abyss
#

bruh

#

pain

#

i stopped working on this because of the error

#

and it was just a ;

#

i need to send things here more

tough abyss
#

https://sqfbin.com/buruheyosoyizuvemera running into an error where _weaponR is undefined for the foreach because it is defined in the foreach should i use append and then a pushback or something?

south swan
#

i don's see it defined ever

tough abyss
#

it isnt what im asking is how i define it i defined it as an array around line 1 earlier and then in the spawn

hallow mortar
#

Using punctuation would make it a lot easier to understand what you're asking. Just saying.
Do you mean that you've defined it elsewhere in the script, and you now want to pass it into the spawn? If that's the case, then like this:

[_weaponR] spawn {
  params ["_weaponR"];
  // ...
#

On line 48 you have a misplaced [ that will break your case check.

#

I'm also dubious about the way your switch cases are formatted. I'm not sure exactly what you're trying to do there, but I think all of _weapon, _weaponL etc in the selectRandomWeighted should be strings, not local variables, e.g. "weapon", "weaponL", and the same where they're checked at the case level.

south swan
#
{...}foreach _weaponR;
...
_weaponholder addItemcargo [_weaponR, 1];
```looks suspicious. What is even stored in `_weaponR` beforehand? Or are you looking for assigning the result of `switch` to it? Then the code should read as `_weaponR = switch (_case) do {...}` ๐Ÿคทโ€โ™‚๏ธ
velvet linden
#

hello can someone please tell me whats wrong with this? im trying to check a players Inv but its not working


[ 
 laptop,
 "Hack Laptop",
 "\a3\ui_f\data\IGUI\Cfg\HoldActions\holdAction_hack_ca.paa", 
 "\a3\ui_f\data\IGUI\Cfg\HoldActions\holdAction_hack_ca.paa",
 "true", 
 "((_this distance _target) < 5) && {expl in (magazines _this)}" 
 ,{hint "Hack Begining\n Dont Stop!"},
 {}, 
 {hint "Hack Successful"}, 
 {hint "Dont Stop!\nYou Could of Tripped the Alarm!"}, 
 [], 
 12,
 0, 
 true, 
 false 
 ] remoteExec ["BIS_fnc_holdActionAdd", 0, laptop];```
#

also, what's an alternative to player?

#

as it is not executing

#

in MP

open fractal
#
"((_this distance _target) < 5) && {expl in (magazines _this)}"

_this is an array and _target is not defined

hallow mortar
#

That's not true. _this and _target are special variables available in the conditions for hold actions

open fractal
#

also I think that part takes code and not a string

hallow mortar
#

It takes string

open fractal
#

oh that's the condition

#

my b

#

misread

south swan
#

doesn't look like expl is set anywhere except where the original code is called

hallow mortar
#

I would kind of recommend having the condition to show and condition to progress be the same (you have the condition to show as true so it always appears even if you can't progress it) but that's not what's breaking it

hallow mortar
#

Honestly, unless you want that to be something you can change later during the mission, it doesn't even need to be a variable; just replace expl with "SatchelCharge_F" in the condition

velvet linden
#

true

south swan
#

expl = "SatchelCharge_F"; publicVariable "expl"; or missionNamespace setVariable ["expl", "SatchelCharge_F", true]; should fix than if you still want to use a variable ๐Ÿคทโ€โ™‚๏ธ

past wagon
#

is there a way to openGPS specifically on the right side of the screen? by default it opens on the left...

velvet linden
#

hmm ok thanks ill keep investigating

velvet linden
hallow mortar
past wagon
past wagon
#

thanks

south swan
velvet linden
#

hey is there a alternative to player for MP Compatible
Eg.

hint "test"
};

!Alternative! call TAG_fn_test```
hallow mortar
# velvet linden and is there a alternative?

player works in multiplayer, but only on clients. It doesn't work on the server, because there is no player on the dedicated server. There isn't a direct alternative because what it does depends on that. Instead, you would look for ways to get a reference to the unit you're looking for, rather than thinking of them as a player, but how you do that really depends on what specifically you're doing.

velvet linden
#

huh ok

#

im trying to get it as the example above

south swan
velvet linden
#

and for a EH

hallow mortar
velvet linden
#

but its not executing

#

on MP

past wagon
hallow mortar
#

That seems to be mostly correct as long as it's run in initPlayerLocal.sqf

velvet linden
#

yea the issue is that im running it in a composition

hallow mortar
#

This is really designed to be run in initPlayerLocal.sqf.

velvet linden
#

hmm

#

ok

#

well ill probs keep tinkering with it but is there a way to make it run on composition?

south swan
#

define "composition"

velvet linden
#

run in a Int box

#

of a object

#

Eg. hunter or something

south swan
#

why? What semantic link is there between a random object on the map and players self-reviving?

stable dune
#

Hello
If i do playerDisconnect EH, to save loudout , how do I reload that when player joins back to get saved loadout back to player

hallow mortar
velvet linden
#

hey how can i rotate a vehicle?

#

nope i still dont kno

#

know*

hallow mortar
#

In what axis?
Basic compass directions? setDir. Anything more 3D? Welcome to the wonderful world of setVectorDirAndUp.

#

In the Editor? There is a handy rotation widget on the top bar (also available by cycling through widgets with [Spacebar]).

velvet linden
#

im trying to set the yaw pitch and roll of my object that i spawned

#

this is what i have

#
_satc = createVehicle ["SatchelCharge_F", this, [], 0, "NONE"];
_satc setVectorDir [270, 270, 0]; 
_satc attachTo [tower, [0.4, 0, -15.5]];
hallow mortar
velvet linden
#

how do i use it? is it 360 degrees?

hallow mortar
#

No, it is not in degrees. That's the main difference between vectors and compass directions.
Vectors are not an exclusively Arma concept - you should be able to find educational materials on how vectors work by searching the internet for "vector maths" or something like that. The page I just linked also contains some explanation in both the page and the pages it links to.

#

The page also contains an example for a function that can convert degrees of yaw, pitch, and roll into a setVectorDirAndUp application.

velvet linden
#

when i use setVectorDir nothing happens

#

i have it set for 270 degrees = 0.75 on x and y

#

_satc setVectorDir [0.75, 0.75, 0];

#

and with setVectorDirAndUp

hallow mortar
#

attachTo resets the object's orientation

#

Do the direction change after that

drifting portal
#

how do I cause a mine I spawned to detonate? setdamage 1 is not working

drifting portal
#
createMine ["APERSMineDispenser_F", player modelToWorldVisual [0, 12, 0], [], 0];
winter rose
drifting portal
stable dune
winter rose
past wagon
#

right mb

south swan
#

what do you expect from setting the control height to value of the control itself?

past wagon
#

does ctrlSetPosition take a number?

#

wait

winter rose
past wagon
#

but it says its a control

winter rose
#

you are giving a control as lefthand parameter
why add it after again?

south swan
#

your code _ctrlMessage ctrlSetPosition [1.2, -0.31, 0.3125, _ctrlMessage];
_ctrlMessage isn't a number. You are trying to set its height to the value of control itself

past wagon
#

oh

south swan
#

maybe should be _ctrlsHeight or something

past wagon
#

ctrtTextHeight returns a number

#

I'm so confused

winter rose
#

โ€ฆhold on, take a step back - and write your logic in human language (before converting it to SQF)

past wagon
#
private  /* CONTROL */ _ctrlTitle = (uiNamespace getVariable "HintMessage") ctrlCreate ["RscStructuredText", -1];
private  /* CONTROL */ _ctrlMessage = (uiNamespace getVariable "HintMessage") ctrlCreate ["RscStructuredText", -1];

//set text of title and message controls
_ctrlTitle ctrlSetStructuredText parseText ("<t size='1.25'>" + _title);
_ctrlMessage ctrlSetStructuredText parseText _message;

private  /* NUMBER */ _titleHeight = ctrlTextHeight _ctrlTitle;
private  /* NUMBER */ _messageHeight = ctrlTextHeight _ctrlMessage;
private _ctrlsHeight = _titleHeight + _messageHeight;

/* CONTROL */  _ctrlTitle ctrlSetPosition [1.2, -0.37, 0.3125, /* NUMBER */ _titleHeight];
/* CONTROL */  _ctrlMessage ctrlSetPosition [1.2, -0.31, 0.3125, /* NUMBER */ _ctrlMessage]; 
_ctrlTitle ctrlSetBackgroundColor [0, 0, 0, 0.3];
_ctrlMessage ctrlSetBackgroundColor [0, 0, 0, 0.3];
south swan
#

/* NUMBER */ _ctrlMessage Not A Number

past wagon
#

ohhhhhh

#

i didnt see that haha

#

mb

#

thought it was _messageHeight instead of ctrlMessage

valid abyss
#

is there a way to find out what cfgPatches a unit is in?

#

like if i want to add a specific type of unit to the zeus interface i need to get the cfgPatches classname that the unit is in

valid abyss
#

unless i need to input something specific into the parameters

south swan
#

? example is on the page. It's straightforward enough.

valid abyss
#

it doesnt output the desired return value though

south swan
#

what do you run, what it returns, what do you expect?

valid abyss
#

well is there any way to get the cfgPatches classname of every unit in the scenario?

valid abyss
south swan
#

that's one answer out of three questions

#

"what do you run" and "what do you expect" still stand

valid abyss
#

i expected to get the cfgPatches classname of all entities present in the scenario when i run the code

#

and by "what do you run" do you mean hardware, OS or other?

south swan
#

what command

valid abyss
#

i ran this in the watch of the debug console:
configSourceAddonList (configFile >> "CfgVehicles" >> "Man");

south swan
#

then that returns CfgPatches where that specific class is defines ๐Ÿคทโ€โ™‚๏ธ

#

okay, i've missed the "every unit in the scenario" part, but that's easily scriptable

valid abyss
#

so what parameters would i need to insert instead?

south swan
#

๐Ÿคทโ€โ™‚๏ธ sqf _units = (allUnits + vehicles); _configs = _units apply {configOf _x}; _configs = _configs arrayIntersect _configs; // remove duplicate configs _addons = flatten (_configs apply {configSourceAddonList _x}); _addons = _addons arrayIntersect _addons; // remove duplicate addons _addons

#

changed to include vehicles as well

#

although "Include all addons present in the mission" is available as an option of the Game Master module itself if it's being added via 3DEN

dry cliff
#

Need some help with a basic script to free a hostage and have him join the squad. I currently have it so when the AI surrounding him die the task completes. Is it possible to use the same trigger that completes the task to make the hostage join the squad?

open fractal
dry cliff
dry cliff
stable dune
#

Good morning. I have a build script that gives weapons and ammo to civilians and changes his side to opFor when the player is near him. unfortunately he doesn't start shooting the right way, sometimes it waits about 10 seconds before attacking the player. So is it possible to make ai react to the player (enemy) faster?

stable dune
#

Using reveal it doens't effect right away

rich frost
#

you can help them by telling them yourself "yo, there's a dude"

stable dune
#

I check that (knows about)

stable dune
#

Yeah, that i though too, to set all of them to highest

#

Thanks for the links

young current
stable dune
#

I think spotTime is what im missing

young current
#

this could work

stable dune
#

Is there possibility to get player from array? I mean from nearentities , select it from it.

young current
#

yes

rich frost
#

hey. I have the following issue:

4:44:21 Attempt to override final function - bis_functions_list
4:44:21 Attempt to override final function - bis_functions_listpreinit
4:44:21 Attempt to override final function - bis_functions_listpostinit
4:44:21 Attempt to override final function - bis_functions_listrecompile
4:44:21 Attempt to override final function - bis_fnc_packstaticweapon
4:44:21 Attempt to override final function - bis_fnc_packstaticweapon_meta
4:44:21 Attempt to override final function - bis_fnc_unpackstaticweapon
4:44:21 Attempt to override final function .. [+4000 lines like this]```
Only since recently, m RPTs are filled with thousands and thosands of lines like these. 

- Once "this"is  in the system, it even shows up when i load no mods and run an empty mission from the editor with 0 scripts.

- I already reinstalled arma and deleted the old profile, which seems to temporarily remove the issue.
- Im currently working on a persistant mp mission called `Hearts and Minds` and constantly adapting it for our unit, so its hard to track down when exactly that started to happen and what exactly might have kicked this off.

Google tells me the following: 2018: `"Usually overriding final function means it was compileFinaled aka Const'd or ConstVAR'd"` 
Eventhough i am not really sure what that means.

https://feedback.bistudio.com/T77509

Everything works, but im ending up with 50MB rpt's and that surely shouldnt be the case.

Does anyone has advice on this or experience with it?
stable dune
# young current yes

I mean if i use

private _plrNear = _unit nearEntities ["MAN", 10];
      
        if !(_plrNear isEqualTo []) then {
            if (_plrNear findIf {isPlayer _x} > -1) then {....

And not.

private _plrNear = _unit nearEntities ["MAN", 10];
        sleep 0.1;
        if !(_plrNear isEqualTo []) then {
     _targetPlayer = _plrNear #0;
            if (isPlayer _targetPlayer) then {...

I know both of these work and 2nd i get target (but if there is more ppl and player is in area (10m) but he is not 1st in array it doesn't work)
So is there possibility with find, findIf or somekind of that command get any player from nearentities array?

granite sky
#

I read that a couple of times and I still can't tell what you're asking.

young current
#

you might be able to do the comparison with this

granite sky
#

_array findIf {isPlayer _x} returns the index of the first player in the array, so to get their object you can do:

private _plrNear = _unit nearEntities ["MAN", 10];
private _index = _plrNear findIf {isPlayer _x};
if (_index > -1) then { 
  _targetPlayer = _plrNear select _index;
  ...
};
stable dune
stable dune
#

Awesome

#

Thanks guys! ๐Ÿ‘

stable dune
violet gull
#

Personally, I do it this way:

private _enemy = AngryCivilian;

private _nearPlayers = [];

{
  _nearPlayers pushBack [ _x distance _enemy , _x ]
}forEach ( allPlayers select { alive _x } );

_nearPlayers sort true;

private _nearestPlayer = _nearPlayers # 1;


//Noticed its for a civ so here's the attack part
//NOTE: AGENTS cannot attack
_enemy addMagazine "WhateverProperMagazine";
_enemy addWeapon "WhateverProperGun";


//Makes him hostile and not give negative rating when killed
_enemy addRating -10000;


//Attack player
_enemy doTarget _nearestPlayer;
_enemy doWatch _nearestPlayer;
_enemy doFire _nearestPlayer;
#

A nearEntities search is fine if players aren't in vehicles but won't get detected if they are.

stable dune
#

Why there is select 1? Not 0?

violet gull
#

0 is the distance (number)

#

1 is the player object

#

The sort code then sorts by distance number of each player collected, then selects lowest number (closest)

stable dune
#

Okey thanks, i will do that if we move on vehicle. Now just walking around city and random civilians turn opfor and attack to us.
Good to know entities doesn't effect players if they are in vehicle

#

What does sort? Just sort array to those which return true from it?

violet gull
#

Can sort from alphabetical, numerical, etc... true = ascending, false = descending

stable dune
#

Thanks

upper siren
#

Can anyone explain why

//initserver
// EH to blacklist ai vehicles
["LandVehicle", "InitPost",
{
    params ["_entity"];
    if (!isPlayer(driver _entity) && !isNull driver _entity) then {
        group driver _entity setVariable["zhc_offload_blacklisted", true];
        "ZHC blacklisted!" remoteExec ["systemChat", _entity];
    };

;},
true, [], true] call CBA_fnc_addClassEventHandler;

does not fire on dedicated server but runs fine in localhost while

//initserver
// EH to blacklist ai vehicles
["AllVehicles", "InitPost",
{
    params ["_entity"];
    if (!isPlayer(driver _entity) && !isNull driver _entity) then {
        group driver _entity setVariable["zhc_offload_blacklisted", true];
        "ZHC blacklisted!" remoteExec ["systemChat", _entity];
    };

;},
true, [], true] call CBA_fnc_addClassEventHandler;

fires on both dedicated and localhost? (can't use that one because AllVehicles includes infantry...)

stable dune
# upper siren Can anyone explain why ```sqf //initserver // EH to blacklist ai vehicles ["Lan...
"message" remoteExec ["hint", 0];                //ย sends a hint message to everyone, identical to "message" remoteExec ["hint"]
"message" remoteExec ["hint", -2];                //ย sends a hint message to everybody but the server
"message" remoteExec ["hint", myCar];            //ย sends a hint message where myCar is local
"message" remoteExec ["hint", -clientOwner];    //ย sends a hint message to everybody but the current machine

It only shows systemChat where _entiny is local, show it will show that only on server.
I mean does it return anything if you remove after remoteExec
_entity
["systemChat"];

upper siren
covert inlet
#

could anyone point me towards an example of a PlayerConnected EH that checks if a player has a default face, and if not replace their face with a default one?

#

sick of telling people to not use custom faces

covert inlet
#

ghost ping?

stable dune
hallow mortar
hallow mortar
warped igloo
#

Does anyone know of configs or functions that alter the speed of status changes? (crouch, stand, prone or weapon switching)

sullen sigil
#

Hello fellows is anyone here smart when it comes to setvelocitytransformation as I have an issue

#

Here is said issue, having some desync errors but only inconsistently. On shooter's client it appears smooth, occasionally on viewer clients it appears smooth however won't post the video of that to not flood the chat

#

Sqfbin of the code there

#

This only happens in MP as well

granite sky
#

sighs

#

you have to make the velocity match the velocity.

sullen sigil
#

Is that with some interval messing around

granite sky
#

This line means that the time taken for the path is fixed at five seconds, right: _interval = _interval + diag_deltaTime / 5;

sullen sigil
#

I believe so as it's faster the further away you are

granite sky
#

While the velocity is set at 10m/s.

sullen sigil
#

Ah so I'd need to calculate the time taken to travel the distance at 10ms instead of having 5?

granite sky
#

I don't know which of these is supposed to be correct.

#

But they're different, so you get the velocity jitter.

sullen sigil
#

Okay I'll mess with them and get them matching and see how it works in SP atm -- thanks :)

#

I'd just have distance/10 wouldn't I

granite sky
#

distance/5 if you wanted to match the interval-driven velocity.

sullen sigil
#

Thanks it's been a while since I did maths

#

Okay so that seems to be changing the speed properly I just need to increase it from 10ms ๐Ÿ˜…

#

Thanks for the help :)

#

In fact, do I need to change the distance/5 bit if I change the velocity too? If I double it do I change 5 to 2.5 or 10?

granite sky
#

If you double what?

sullen sigil
#

The velocity

granite sky
#

I mean, your velocity is distance-variable?

#

twice the distance, twice the speed.

sullen sigil
#

wait so it is

#

erm

#

one moment

#

Oh yeah I had that so the player wouldn't be going like mach 3 at the end of the transformation iirc but I don't think that's correct thonk

granite sky
#

That interval calc I pasted means that it goes from 0 to 1 interval (and therefore covers the distance) in five seconds, regardless of the distance.

#

If it's a very short run then you will move very slowly :P

sullen sigil
#

Oh I remember now it's because I couldn't figure out how to make a velocity in the direction the player was looking at so took the easy way out :p

granite sky
#

The transformation is constant-velocity. You're not going any faster or slower at the end than at the start.

#

It doesn't have to be, but to do otherwise you'd need a non-linear interval calc.

sullen sigil
#

With your interval calc I think that's true but with the old one I think it's not due to it being distant dependent?

granite sky
#

what

sullen sigil
#

Hang on ignore me

#

It's not recalculating the distance every frame

#

Okay so what do I do if I want it as a 30ms transformation at constant velocity thonk

granite sky
#

milliseconds?

sullen sigil
#

I never did vector maths this complex in school

granite sky
#

metres?

sullen sigil
#

meters per second im used to ms^-1

granite sky
#
private _totTime = (_playerPos distance _entityPos) / 30;
_interval = _interval + diag_deltaTime / _totTime;
sullen sigil
#

Ah thank you

granite sky
#

And the matching velocity:

_velocity = (_playerPos vectorFromTo _entityPos) vectorMultiply 30;
sullen sigil
granite sky
#

Well, it's a constant value over the onEachFrame so you could precalculate. You would need to pass it in as a parameter.