#arma3_scripting
1 messages ยท Page 21 of 1
thx
๐ the bushes don't have a classname AFAIK
So no way to create them with createVehicle
Where does configSourceMod get its data from? I ask because RHS has some weapons that return empty string for it.
use a mod which "unhides" them
or some debug console magic to directly get the classname
It gets it's data from the configs and it checks which mod adds them.
Although I believe it only returns config classes which are public, so weapons with attachments may return nothing because they're hidden.
You could try to use BIS_fnc_baseWeapon before running it through configSourceMod
anyone knows a good way to use unitplay on a dedicated server?
tried it with an aircraft but its very "laggy"
Are you running it globally or serverside
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
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
so I should execute it server side?
I assume wherever the plane is local
check the wiki
doesn't say anything 
well it uses setVelocityTransformation under the hood
so local arg it is
how would that be any different than what you do now?
actually what do you do right now anyway?
have you put it in init.sqf?
no I made its own sqf for it which I execute from the console globally with
nul = [] execVM "path.sqf";
execute this locally:
["path.sqf"] remoteExec ["execVM", plane]
it executes on whichever machine plane is local at
forgive my smooth brain but
whichever machine plane is local at
how do I know who the machine plane is local at?
When you pass plane (i.e. the variable name of the plane) as the locality argument to remoteExec, it automatically detects it
Leo's code takes care of that
alright I'll try it
well it does activate the plane
but I have no idea if it'll wobble or not I guess.
I have that problem only when there is a full server
You're giving an argument to modelToWorld that uses the wrong data type. Can't tell what with only that error.
sounds like a skill issue
Ah, the weapons it's returning blank on seem to be base weapons, eg "rhs_weap_fnfal50_61_base".
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.
If they're not real items then it's not important in this case, but that seems like odd behaviour.
it shouldn't cause any problems
I'll test it properly whenever I have all players on
thanks
the error means you have a "NaN"
which results from incorrect calculations in previous lines
ok
or maybe from using a nil value in a command that returns a number (e.g. sin nil)
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.
iirc, the water particle is in "\A3\data_f\ParticleEffects\Universal\Universal", provided you want to use the particle system to design your own effect
yep perfect thanks
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.
There is ace discord where is #cba channel if you want
https://acemod.org/discord
Woah! When did ACE move from slack? ๐ง
How do I create a large fire? I'm trying to find which particle parameter is responsible for the effect's "size"
What class name are you using?
ObjectDestructionFire2Smallx
it has a good sprite
Check this page out.
https://community.bistudio.com/wiki/Arma_3:_Particle_Effects
You're best asking in #arma3_config.
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!";
}
];
Any scripts for ai to kill civillans (Opfor)
What's your scenario?
It will narrow down the many ways to kill civilians... Provide the most efficient way to kill the civilians.
A zombie one. and i want them to actually kill civillans
instead of only Blufor
What mod?
Any idea what side the Zombies and Demons are?
Been a while and I can't be arsed downloading it.
Opfor.
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
https://community.bistudio.com/wiki/Side_relations
Scroll to the bottom.
If that doesn't work...
Add a BLUFOR guy to a group of civs but change his probability of presence to 0.
It will make the civilian group appear as BLUFOR.
Test it before you do anything.
Split the operation in parts in the editor to test each event out.
There is no debug console command or something for this?
how can i make them join the west side
aka blufor
menu'=
You're the author, no one else knows how to manipulate your mission unless you have more specific questions
what does "skip missions" mean?
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.
Try my second method in the above post.
i am talking about with the scirpt
Oh. My bad.
Are you spawning the civilians?
active after completing previous task
by what system
if you're using triggers you can activate the triggers with a variable
if you're using variables you can... set the variables
You're using the Civilian Presence Module?
yes
Did you state that in your first posts?
no
Good.
Read this:
https://community.bistudio.com/wiki/Arma_3:_Civilian_Presence
I am done.
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 ?
https://ace3.acemod.org/wiki/development/coding-guidelines.html
Search the page for QGVAR.
"emr_main_isCliming?
You can't use QGVAR outside of the mod.
Check if my first example works before you go any further.
Thanks, that did the trick โค๏ธ
player setVariable ["emr_main_isClimbing",nil];
No bother.
Le Parkour!
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?
Yes.
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.
That sounds about right.
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.
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.
I see, I had used it from an existing ace heal script we use. I'll remove it.
I attempted to copy it, however it did not go to the clipboard like normal
What are you REALLY up to?
Seriously, you need to be more specific.
What are you overwriting and where is it?
it'll show up in the rpt
From what I can tell, it couldn't get a position or direction for the lightning. I'll redo the error real quick.
Double check addAction arguments.
this as an argument seems wrong. ๐ฉ๏ธ
It looks either correct or like I'm supposed to have _this from the wiki so far.
Yeah, this is correct implementation, it's an action attached to a prop, and that's even one of the examples on the wiki
this is correct for code called from object init
Inside an addAction? Lemme check.
Of course!!
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
the action function isn't called from object init ergo this is not defined
Does it now work?
I'm trying to figure out how best to define the target first.
params ["_target", "_caller", "_actionId", "_arguments"];
``` parameters passed to the action script
I found an old Dedman post that answers my question, thanks for responding though, i appreciate it
Wait _caller is a valid parameter?
That just makes the position the person doing the action doesnt it
I feel dumb
yes, as _this select 1 or just _caller if you add that line to the top of the expression
@cosmic prairie https://community.bistudio.com/wiki/BIS_fnc_moduleLightning
Look at the page, brother.
so [_caller, nil, true] will work as long as this is in the top line
I'm on that page, I just lack intelligence and reading capability
if the function takes an object, yes
Got it
any Police Scirpts?
how do i separate turrets from vehicles so i can put them on other vehicles
You can't. Not with scripting anyway.
Hey Iโm looking for someone or some people to do some development is this the right place to look with scripting
theres a bunch of compositions with turrets
from different vehicles
like a t34 turret on a m113
Most of them just hide the part of hull/turret, then. It's easy to check how's compositions work, no?
Dirty tactics, my friend.
Yeah, dirty enough
animateSource won't do it.
I do believe most of them just use setObjectTexture to hide a part of them
Now. That is dirty. And a little bit smart... If it works.
will this work? (a call inside a forEach): ```sqf
{
call {
if () exitWith {};
if () exitWith {};
};
} forEach units _group;
how about ```sqf
if (condition) then { don't continue };
Ohhh... so it exits that unit and jumps to the next one... well then it is perfect...
Thank you
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.
{
if (uniform _x isEqualTo "U_C_E_LooterJacket_01_F") then {_x setObjectTextureGlobal ""; continue};
if (uniform _x isEqualTo "") then {_x setObjectTextureGlobal ""; continue};
} forEach units _group;
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
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.
Yeah but in this case each uniform uses a different texture that is located on the mission folder so the array would be useful if several uniforms shared the same custom texture which is not the case for my mission
Thank you very much!
{
private _uniform = uniform _x;
switch(true) do {
case (_uniform == "SomeOtherUniform"): {
_x setObjectTextureGlobal [0, "someothertexture.paa"];
};
case (_uniform == "U_C_E_LooterJacket_01_F");
case (_uniform == ""): {
_x setObjectTextureGlobal [0, ""];
};
}
} forEach units _group;
```another way
Yeah but wouldn't that go though all the cases taking longer to complete? I prefer if the forEach jumps to the next unit as soon as it finds the correct texture for each uniform
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;
this is the first time I hear about createHashMapFromArray! Very very awesome! Using now! Thanks
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.
I will! A new toy is always fun!
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!
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
Yes. e.g 50% chance:
if (random 1 > 0.5) then {
}
isNull _vehicle
As for the action, use the action code parameters
See the wiki
params ["_target", "_caller"]
hey with the action stuff is there a way to make it a hold for x amount of seconds?
ok thanks!
can you implement this for a EH Script as well?
Yes. Anywhere
ok Thanks!
Yo bros is it possible to animate players weapon with animateSource?
Nnnnope (sad ๐ญ)

https://community.bistudio.com/wiki/activatedAddons
Im trying to use this to check players mods/client sides, how would i go about it?
should use https://community.bistudio.com/wiki/getLoadedModsInfo so you can differentiate between mods and official dlcs
Ahhhhhh do i put this into the mission file itself or do i run ingame?
sorry
wat? the command returns an array with the mods, it's up to you what you want to do with it
Basically what i wanna do is run a command so i can check people's client sides on the server
client sides?
like Personal Arsenal, Expanded Inventory ect
sorry weird question ik XD
but they arent allowed and ppl are using em
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
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
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
is there a way to check whether all players are alive or not
you can do something like,allPlayers findIf { !alive _x } < 0
but https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Killed is probably more fitting for what you want to do
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
How can i revive players using a script?
In the first place, you can't set someone unconscious without using a script... what revive system you use?
just vanilla
Probably setUnconscious itself
May have consequences if you don't reset internal data. Depends if it's designed for that.
im talking you get shot and downed waiting for revive
Yes?
Vanilla effect is that you just die.
Anything else needs to be added or enabled by mods or missions.
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
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?
disable? just don't add it?
Its default arma
tried player addEventHandler ["HandleRating", { 0 }]; in init.sqf and initPlayerLocal.sqf but both methods did not work
Ok i can try that
Do i need to rerun it after respawn or does it still work after that
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.
So how do you run your code? In init.sqf?
the safest way to run it is on initplayerlocal.sqf
its executed when the player object already exist
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?
if it's stacked, then only one of the ehs return value is considered, not sure which one though (top or bottom)
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)
I bet you'll hear it if you stand at [0,0,0]
what should I place instead of that?
getposasl probably
Seems likely
yep
PlaySound3D's optional parameters are rather unfortunately-laid-out
there we go
I'm getting more and more confused. It works fine when I run the server localy, but it doesn't work on my dedicated server ๐ข
there is one of those #commands used by the system itself to revive players while making the system continues it normal behaviour
is there a way to stop a human from getting 'scared' by explosives (human spawned through createvehiclelocal)?
createVehicle should be already limited, try additional disableAI perhaps?
I did, tried all and ANIM, they still jump and do evasive animation
Very weird
I will test it in vanilla next time to not anger you
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?
you mean for use in public zeus?
yea
let me see if i can come up with something for you. give me a sec
hey also im playing around with setObjectTextureGlobal how do i know what numbers are used to hide certain things?
trial and error, or look through the config. not all things can be hidden though (that way)
ok thanks
do you want them to die if they fail the dice roll?
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
thanks!
should execute on every client when that object you put it on initializes
what do you mean by the object you put it on initializes
like a invis heli pad or something
yes
sweet
just make sure that helipad never gets deleted, so that JIP players will still have it run when they init the mission objects
modify it how you want. should be straightforward looking at it
hmm actually, let me make a modification real quick
ok thanks for this!
fixed, there ya go. id like to write comments so you know what does what, but its not allowed in init boxes
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'];
you sure that index is the correct one for the object you are using?
what object classname are you using?
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?
3denEnhanced mod has a texture search tool
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
ok
hey in the config veiwer some of the text gets cut of to the right is there a way to scroll left somehow?
i use advanced developer tools which has its own config viewr
ok
hey does anyone know how to avoid the magazine loading upon vehicle spawning with modified weapons using addWeaponTurret
I'm not sure of vehicles, to unit need addMagazine before weapon so there is full mag and do not need reload from bag.
So try use addMagazineTurret before adding weapon.
https://community.bistudio.com/wiki/addMagazineTurret
Does unitCreated EH work on alive spawn, in editor attached units and zeus created units?
Or do i need do for all own ?
If you mean entityCreated, yes
if i wanna play a sound from a 3D object does the description ext need to be changed?
depends what command you use
say3D requires a config, playSound3D does not
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
yes
[OBJECT, ["classNameToUseInScript", 125, 1]] remoteExec ["say3d", 0, true];
for a trigger
if you're gonna remoteExec from a trigger, make sure it's server only trigger
It's a single player mission. If that matters?
then why remoteExec at all?
I just copied from a forum
sorry what?
does a hc or dedicated server run EachFrame EHs and with what frequency?
need it to have more volume
You can adjust the sound volume in the description.ext sound config or by editing the original file
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
I'd wager yes (EachFrame = simulation frame AFAIK)
leaning on the no side for "Draw3D" obviously
sorted it thanks
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?
My initial thought would be to change true to triggerActivated your_trigger_name
i see
playSound "zombattle" spawn {
_zombattle = _this;
while {triggerActivated zom} do {
if (isNull _zombattle) then {_zombattle = playSound "zombattle"};
sleep 1;
};
};
``` like that?
ugh i cant seem to get anything working
More like this (untested).
0 spawn {
while {triggerActivated zombattle_trg_1} do {
playSound "zombattle";
sleep 1;
};
};
Adjust the sleep value to the length of the zombattle soundfile.
Any scripts to create AI traffic?
Russia dashcam simulator
Have you seen how the Ai drive? It would be chaos
well, I assume he doesn't mean heavy traffic :P
but even with simple road paths they tend to get wedged after a bit.
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
easiest way is to use waypoints. they work as destinations for the AI to go to and when they reach it, the waypoint objective activates. like "Transport Unload" and it will force everyone off
its using unit capture not AI
sorry, i cant help you.
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
player group or AI group?
player group, also works on AI
BIS forums, mentions a trigger init field and group
https://forums.bohemia.net/forums/topic/205951-unload-specific-group-from-hemmit/
Hi to everyone, I am trying to create a campaign style mission. I have read every article there is at the point where whenever i type something with arma 3 eden in the search field i only see pink urls. Making a big scenario creates a lot of questions but until now with a good time consuming sear...
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/
Hello, A server owner has tasked me with creating a script to teleport him and his group of admins to a position on the map determined by a mouse click. Were doing this via player addAction and he already has a trigger set up to removeAllActions player when done. The owner needs the action to fir...
how do i create a group anyway
in the forum post it says to put the group name
where even is that
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?
using scripts or in the editor? in the editor, you can right-click and group some AI to a player. if scripting, you can use join found here
https://community.bistudio.com/wiki/join
i'd say something like this https://sqfbin.com/onovukegojeboyijaqaj . Untested, but should work (question mark)
because Alpha 1-2 isn't a variable name
im so confused
so the game can't parse your command, so it spits out the error ๐คทโโ๏ธ
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
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)
alr
this joinSilent grp1; will this work
in the init of every unit
didnt work
im so
confused
thanks for the help, i'll ping you tomorrow if it works satisfactorily.
why joinsilent
so no radio message
are they not in the group already?
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
didn't you already make Alpha 1-2?
aight tho nobody is in the vehicle and also that i want it to just destroy a tire or the fuel
joinSilent takes an Array of units to join the group. Proper syntax would be [this] joinSilent grp1;
and i was directed to a forum post that uses leave vehicle
and i tryed this
this addAction ["Przebij bak",v1 setHitPointDamage["hitfuel",1]]
is there any other way of kicking units out a heli
apart from using the group name then leave vehicle
crew
witch destroyed the fuel tank but it did it without anyone clicking on it
which script would i use
because for the code to get executed at action activation you should actually make it a code by surrounding it with {...}. So this addAction ["Przebij bak",{v1 setHitPointDamage["hitfuel",1]}]
_everyoneButDriver = (crew _vehicle) - [driver _vehicle];
{ moveOut _x } forEach _everyoneButDriver;
there may be a faster way
i will try this thank you
Thank you so much im really new to all of this stuff
can i make it also so it plays a sound when the command runs
like say3D?
nope didnt work
did you define _vehicle?
my bad
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?
still no
yeah didnt work
isPlayer (driver _vehicle)
Try this
truck1 setHit ["motor", 1];
But replace truck1 with the name of your truck, and if you have to damage the fuel instead of the engine then change motor to whatever the fuel tank is. I'd find it for you but the A3 wiki leaves a lot to be desired when it comes to searching.
Put all of that into an addAction code and you should be good
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.
yeah all ready some guy helped but do you maybe know how to make the car make some noise?
hey, is there an existing way to filter out markers that overlap?
Only thing that comes to mind is using a sound effect inside a triggerโs attributes.
should
What do you mean by filter out? You should be able to select markers from the entity browser on the left side of your screen in the editor.
its fine I figured it out
any idea how to fix it?
wont work
given a list of markers i wanted to filter out markers that overlapped
was hoping that was a built in but w/e
#arma3_gui message use that if you want 100% accuracy, you'd have to change it from screen coordinates to world and it should work fine
if I wanted to check if a vehicle has a driver, does
isNull(driver _entity) //return true if driver is in vehicle
work?
true ๐
_vehicle is undefined if it doesn't work
i have defined the vehicle
its now ```_everyoneButDriver = (crew heli_1) - [driver heli_1];
{ moveOut _x } forEach _everyoneButDriver;
it doesent eject anyone full stop
ive been looking at the wiki and would this work? (unit names) action ["eject", heli_1 (unit names)];
it doesnt.. why wont anything stop this fucking sound grrr
how are you playing it?
no, why are you using that code?
im not
playsound "soundname";
ext in the mission file
i was looking in the wiki
add debug like i said
fadeSound doesn't work?
that fades all sound then
wth is fademusic for then?
for playMusic
alr i ran it
and what did it print?
so the vehicle is undefined
theres no other way to stop it??
like you said
you're running crew nil which silently breaks the rest of the expression
heli_1 is undefined
deleteVehicle, but it won't fade
playSound returns a handle
tried that. didnt seem to work either
alr it worked
no idea why it wont work on the waypoint
waypoint?
it should
trigger, my bad
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.
well it worked on single player
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
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 ๐คทโโ๏ธ
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.
DeleteVehcichle noise; is in a trigger.
The trigger in which the Playsound "zombattle"; is called noise.
forgot quotes on the command
fixed, thanks
change as in via scripting command, or like a gui interface to adjust loadout?
if the latter, there's no such thing in vanilla, no
The DeleteVehcichle trigger doesn't stop the sound
you are not supposed to delete the trigger
you're supposed to delete the sound handle which playSound returns
read this
whoo, boy, in-game pylon editors. I believe i've written one. Or two. Or three (?)
_source = playSound "zombattle";
_source spawn
{
sleep 200;
deleteVehicle _this;
};
something like that look right?
the latter, ill attempt writing one myself if need be I just wanted to check. I want to allow my players to get rid of the garbage MPAT in the abrams for proper HE or swap their 50 for slap rounds lol
https://community.bistudio.com/wiki/GUI_Tutorial is a good place to start
yes
roger, thanks
works well thanks!
Thanks
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
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)
Exactly, but every time I start the mission I get an error saying that it's undefined
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
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
and it says that _num_objects is undefined?
debug _this
diag_log [_this]
in the reset_objs.sqf
then run the mission and check rpt
Gotcha
Where exactly does that get logged too? I didn't necessarily see anything
!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.
change it to diag_log ["_this", _this] so you can just ctrl+f _this in the logs
Okay that'll help, I tried searching for just "_this" and just found the diag_log message itself, but no result it seems
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
where did you add the diag_log?
top of the file
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
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
...
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
well yeah i told you it had nothing to do with the action, it was something elsewhere ๐
Yeah, knew that the code was right, but I was just confused as to how "11" would be evaluated to true lol
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
Why don't you use the vanilla dynamic simulation system ?
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
True, sounds like a job for dedmen ๐
naaa, just wondering about other methods to get position of vehicles when simulation is disabled
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)
is there any way to determine if 2 points have a path between them?
oh I guess I could do https://community.bistudio.com/wiki/calculatePath
actually will this ever fire for impossible paths?
Name your units.
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
What do you mean "impossible paths"?
(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.
_action = ["Spawn M1A1","Spawn M1A1","",{execVM "vehicleSpawn.sqf"},{true}] call ace_interact_menu_fnc_createAction;
{
[
_x,
1,
["ACE_SelfActions"],
_action
] call ace_interact_menu_fnc_addActionToObject;
} forEach ["Me_1", "Me_2", "Me_3"]; // Add your unit names.
like let's say you're in a car on an island with no connection to another island. this is an impossible path if you want to go between the islands
would you just time out?
What the fuck are you talking about?
You would swap "wheeled_APC" for "boat".
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?
Using the initial example?
yes
Did you change the start and end point?
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
Not that I know of.
I've yet to stress a unit that far.
I wanted to test it on Tanoa.
ok well I will see what I can think of then because this would be a very useful thing to have
Let me know how you get on?
I'll see what happens I guess
Ah nice, thank you for that
Wow. You are welcome.
Does it work?
@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
You have to change start and end pos Array.
You do know that right?
Read the brief!
https://community.bistudio.com/wiki/calculatePath
Are you using it mid-mission?
If the same script is to be executed more than one time, declaring it as a Function is recommended to avoid recompiling and wasting performance with every execution.
https://community.bistudio.com/wiki/execVM
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
Just got home, going to try it soon and I will be happy to let you know
Thanks, I will look into this also
Can you explain how to create a function?
It's explained here
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
Nice.
What's funny about that ? 
I think you know how to do it ๐
I'm winding you up.
"Read the link and figure it out" is how I figured it out.
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"]
];
Oh, Mummy.
I need a beer.
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
Seems to? Make sure.
Good on you.
Check out the ACE3 Coding Guidelines:
https://github.com/acemod/ACE3/blob/master/docs/wiki/development/coding-guidelines.md
I think I figured it out.
Does it work?
Yes ofcourse, the main mod we use (ExileMod) is built that way, so i never tried anything else.
And at this point i have to many functions to rework everything.
#Never change a running system.
Very nice resource, thank you. Gosh this would have been useful so many times in the past lol
I did learn one command today.
compileScript command.
What's the advantage of using missionNamespace setVariable [_function, _code]; then?
You ask the wrong person, probably it has no advantage because you bloat missionNamespace ๐คทโโ๏ธ
ExileMod is quite old, maybe it was like that back then (No clue tbh).
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.
Ah. Method of countering hacks?
Don't think so, more for customizability.
Ah, of course.
Normal players can't access the console.
Good chatting with you, @sharp grotto.
I am offsky.
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
There is no good way but there are a lot of bad ways :P
_closestHelicopters = [[_heli1,_heli2,_heli3], [], { player distance _x }, "ASCEND"] call BIS_fnc_sortBy;
A bad way is better than no way lol
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?
sleep
thanks
or waitUntil
noted
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
ok, thanks!
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
"GroundWeaponHolder"?
IIRC it is simulated variant
"GroundWeaponHolder_Simulated" or something like that
maybe "WeaponHolderSimulated"
yeah i think it's that one
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?
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
And which jeep you mean?
the syndicat jeep
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
setObjectTextureGlobal is buggy and does not work sometimes
anyways thats not the issue
MB 4WD and what is this in this context?
the jeep
the code is in the jeep
part of the jeep turns blue if that means anything
but its supposed to turn invisible
This doesn't look like an usual behavior, probably an issue with the model
so probaly nothing i gan do then
Or report in https://feedback.bistudio.com/
how would I prevent damage to a unit other than damage to the legs, so only allow damage to the legs?
handleDamage event handler
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"?
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(""): {};
};
}];
hello! how can i make 2 objects communtcate Eg. Object 1 Var = true, Object 2 Var = true then Script
hint "works"
};```
if (ob1 && ob2) then {
};```
but can i do this between 2 objects?
like E.g Hunter and quad bike
im trying to have 2 objects communicate
What is that?
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
So, you want to wait until two scripts are done?
What...?
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
and how are variables linked to objects?
idk that what im asking
can i have a global variable that can be detected in int boxes from any object / vehicle
Yes
Variable = true;```this is a global variable that can be used (almost) anywhere
and if you use missionNamespace setVariable ["Variable", value, true]; it even gets sent to other clients in multiplayer ๐ฟ
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?
separate?
in the computer i have _var1 = true; and in the hunter i have:
hint "Press W to move forward.\nPress S to move backwards."
};```
because variables with names starting with _ are local. And aren't available anywhere else
In Init section am I right?
ah ok
see https://community.bistudio.com/wiki/Variables#Scopes for details
so i removed the _ and still doesent work?
so how can i delay it by using sleep or something?
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?
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
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
is there an event handler when a vehicle has locked on its radar on a vehicle? somehting like IncomingMissile EH but for radar?
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
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.
how do i make a unit "shout" for still screenshots?
https://community.bistudio.com/wiki/setMimic, but the preferred way for screenshot creators is to use the POLPOX's Artwork Supporter mod, which provides a more convenient interface for posing. (As well as more mimics)
thanks - i do have polpox but i cant seem to figure out how to use it to pose faces? its not in the steam guide
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.
damn, cant believe i missed that, thanks.
quick question... steam is indisposed or I would verify there...
_obj getVariable ["",objNull] yields what? objNull?
it acts as a regular varname iirc
though iirc empty varname was throwing errors as being "reserved variable"
in arma2 i think? ๐ค
I only recall the error on setVariable.
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
Line 93
_items = ["MineDetector","Rangefinder","Laserdesignator","ItemCompass","ToolKit","acc_flashlight"];
and now look at yours
?
Yours
_items = ["MineDetector,Rangefinder,Laserdesignator,ItemCompass,ToolKit,acc_flashlight"];
how would that change _weaponholder
Error reporting is not always correct
never mind I finally circled around and checked.
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
bruh
pain
i stopped working on this because of the error
and it was just a ;
i need to send things here more
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?
i don's see it defined ever
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
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.
{...}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 {...}` ๐คทโโ๏ธ
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
"((_this distance _target) < 5) && {expl in (magazines _this)}"
_this is an array and _target is not defined
That's not true. _this and _target are special variables available in the conditions for hold actions
also I think that part takes code and not a string
doesn't look like expl is set anywhere except where the original code is called
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
This is probably the answer, if this code is being run on the server then that variable is only being set on the server
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
true
expl = "SatchelCharge_F"; publicVariable "expl"; or missionNamespace setVariable ["expl", "SatchelCharge_F", true]; should fix than if you still want to use a variable ๐คทโโ๏ธ
is there a way to openGPS specifically on the right side of the screen? by default it opens on the left...
hmm ok thanks ill keep investigating
and is there a alternative?
I have a feeling this is based on the user's UI settings, since the placement of panels like the GPS panel is something you can change.
https://community.bistudio.com/wiki/enableInfoPanelComponent to control the right-hand panel, i guess?
it can either be opened on the left or right with the ] and [ keys
okay, I'll check that out
thanks
correction, https://community.bistudio.com/wiki/setInfoPanel seems to be the command
hey is there a alternative to player for MP Compatible
Eg.
hint "test"
};
!Alternative! call TAG_fn_test```
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.
setInfoPanel ["right", "MinimapDisplay"] seems to work
and for a EH
...This example? This doesn't do anything with player, I can't see the relevance.
yep, thank you
That seems to be mostly correct as long as it's run in initPlayerLocal.sqf
yea the issue is that im running it in a composition
This is really designed to be run in initPlayerLocal.sqf.
hmm
ok
well ill probs keep tinkering with it but is there a way to make it run on composition?
define "composition"
why? What semantic link is there between a random object on the map and players self-reviving?
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
playerConnected EH and https://community.bistudio.com/wiki/setUnitLoadout, probably. You'll probably want to make it a local function that waits until they're loaded and slotted though.
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]).
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]];
how do i use it? is it 360 degrees?
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.
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
how do I cause a mine I spawned to detonate? setdamage 1 is not working
how do you spawn it?
createMine ["APERSMineDispenser_F", player modelToWorldVisual [0, 12, 0], [], 0];
(hmm - is it active when created like this?)
have you tried triggerAmmo?
yep that's the command I have seen before and been looking for in google for 15 minutes and knew would fix my problem, lol, thanks
So, do i get with setup disconnecEH and connectedEH or is there somekind of workaround this?.
I didn't find examples from wiki
@past wagon use sqfbin.com please
right mb
I am getting Error: type control, expected number _ctrlMessage |#|ctrlSetPosition [1.2, -0.31, 0.3125... in this script: https://sqfbin.com/ejicicalekasinotilur
can you guess why?
what do you expect from setting the control height to value of the control itself?
๐ ding ding ding!
https://community.bistudio.com/wiki/ctrlSetPosition
controlName ctrlSetPosition [x, y, w, h]
yep
but it says its a control
you are giving a control as lefthand parameter
why add it after again?
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
oh
maybe should be _ctrlsHeight or something
โฆhold on, take a step back - and write your logic in human language (before converting it to SQF)
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];
is any of this wrong?
/* NUMBER */ _ctrlMessage Not A Number
ohhhhhh
i didnt see that haha
mb
thought it was _messageHeight instead of ctrlMessage
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
not exactly what im looking for i dont think
unless i need to input something specific into the parameters
? example is on the page. It's straightforward enough.
it doesnt output the desired return value though
what do you run, what it returns, what do you expect?
well is there any way to get the cfgPatches classname of every unit in the scenario?
Im using a heavily modded game with many faction mods and this is what it returns
["A3_Data_F","A3_Characters_F","A3_Data_F_Curator","A3_Air_F_Heli","ace_thermals","zen_attributes"]
that's one answer out of three questions
"what do you run" and "what do you expect" still stand
ah sorry i took that as something else
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?
what command
i ran this in the watch of the debug console:
configSourceAddonList (configFile >> "CfgVehicles" >> "Man");
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
so what parameters would i need to insert instead?
๐คทโโ๏ธ 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
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?
[hostage] joinSilent group player;
Is [hostage] the variable name or is it actually hostage
the hostage unit
Got it thanks I'll give it a shot
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?
Using reveal it doens't effect right away
you can help them by telling them yourself "yo, there's a dude"
I check that (knows about)
I think spotTime is what im missing
this could work
Yeah , but I need get target first
Is there possibility to get player from array? I mean from nearentities , select it from it.
yes
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?
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?
I read that a couple of times and I still can't tell what you're asking.
_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;
...
};
Trying select player from nearEntities array, if I'm using ["MAN",10], and ..
Well this was what I was looking for
Awesome
Thanks guys! ๐
yeah, in Finland we call this "rally English", so I'm sorry for the bad argumentation.
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.
Why there is select 1? Not 0?
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)
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?
Thanks
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...)
"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"];
I'm aware of that, I'm testing it by spawning in vehicles via zeus, they are local to zeus, are they not?
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
ghost ping?
Yeah, was writing for your face problem but didnt got good answer.
https://community.bistudio.com/wiki/Arma_3:_CfgIdentities
If face it not avaible it will return default.
But I do not know short command to check player class and face from it . And if it is not default how to return it to default
You can use the server config option MaxCustomFileSize for this. Set it super low and people won't be able to connect with custom faces.
You could build a list of CfgIdentities faces, use face to check if the player's face is in that list, and if not, set it to a random one from the list with setFace. Not perfect but it's something.
The server config option is better though, it's more universal.
Does anyone know of configs or functions that alter the speed of status changes? (crouch, stand, prone or weapon switching)
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
Is that with some interval messing around
This line means that the time taken for the path is fixed at five seconds, right: _interval = _interval + diag_deltaTime / 5;
I believe so as it's faster the further away you are
While the velocity is set at 10m/s.
Ah so I'd need to calculate the time taken to travel the distance at 10ms instead of having 5?
I don't know which of these is supposed to be correct.
But they're different, so you get the velocity jitter.
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
distance/5 if you wanted to match the interval-driven velocity.
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?
If you double what?
The velocity
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 
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
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
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.
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?
what
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 
milliseconds?
I never did vector maths this complex in school
metres?
meters per second im used to ms^-1
private _totTime = (_playerPos distance _entityPos) / 30;
_interval = _interval + diag_deltaTime / _totTime;
Ah thank you
And the matching velocity:
_velocity = (_playerPos vectorFromTo _entityPos) vectorMultiply 30;
Would the first line go inside the oneachframe or will the first line be calculated just once?
Well, it's a constant value over the onEachFrame so you could precalculate. You would need to pass it in as a parameter.