#arma3_scripting
1 messages · Page 590 of 1
in config would be #arma3_config @tough abyss
oh alright thanks
How do I make a trigger timers or command like for example when I want make the car go from A to B but when I’m start the game the will not move yet it will follow my command to move PLEASE SOMEONE ONE TEACH ME
@tough abyss no crossposting
anyone knows if its possible to have an unitcapture script on a vehicle that is using unitplay?
@smoky verge so like you have a heli flying your recorded pathway and you want to record some shooting off of it or something?
Please read my problem again
show me what you have done so far noodmaster, give some examples. don't just blanket ask
I did read your problem again and I did in 3 channels already
@fair drum
basically I have an heli doing a prerecorded path to an LZ
the helicopter reaches the roof and hovers for a long time waiting for people to get in and then leaves
to avoid a situation where players are already in but the heli is still waiting I was hoping to record the moment when it takes off and play it when everyone is in so to create a seamless transition
@fair drum I’m haven’t done anything bc I don’t know how to do it that why I’m asking
so basically my question is
would the unitcapture still record a plane that is currently on uniplay?
@fair drum I follow the video https://youtu.be/enbafESNQOY and I try to do exactly like the video but it won’t work
@smoky verge what i would do is set a waypoint for getIn on the squad, and load on the chopper. then have a shorter recording to where it gets to its pad and stops playing. then set a second trigger with a second recording and sync that to the getIn waypoint completion
might have to tweak the waypoint completion radius a bit to get it right
the squad is made of players misread
also the heli is hovering not landing
so if I were to give control back to AI it would immediately move away from the collisionLOD
i was just gonna say you might have to disableAI pathing. and yes its okay that the squad is all players.
thanks I'll make some attempts
ive done something similar using a boat that dropped off, they did the mission, came back and got it, and it scooted away
doing the same method
@tough abyss the vehicle that you are trying to move, the AI driving it, is it in your squad? you don't want it in your squad
I’m play single player so what do you mean in my squad
@tough abyss so i watched that video and he's explaining it in the sense of of a flyby. however, you are trying to get into the said vehicle and then have it move you around. you are going to need a waypoint at the pickup location using load. You would then have to have your player have a waypoint get in and you would have to sync the load from the vehicle crew to the get in of the player. then when those 2 conditions are met, it will carry on to the next waypoint
I just want do the trigger timer like exactly the video does but I replace heli by car
I hoe you understand what I meant
Is there a way to spawn a complex effect via sqf?
Only way im seeing is setParticleClass which just sets a particle effect from CfgCloudlets
Trying to use createVehicle has 0 effect it seems.
Im not understanding if that answers my question. I have looked and as far as I can tell there is no way to spawn a complex effect. Am I wrong? I have looked at setParticleClass which differs from a complex effect.
Define “complex effect”?
Ah that one
Yes, i have some i built out which im wanting to spawn dynamically in runtime.
I don't see any big difference between particle effect as far as I read in the terms of possible effects
You ever tried any of particle related commands other than setParticleClass?
https://community.bistudio.com/wiki/User:POLPOX#Examples
This is an WIP (forever) article but there's some copy-and-paste examples of particle effects that can be spawned on-the-fly
A complex effect lets me take several particle effects and spawn them with one definition, also if my particle has a https://community.bistudio.com/wiki/Simple_Expression setParticleClass cant spawn it
Yes, some of Simple Expression-related things can't use in script commands AFAIK
PArticle commands im aware of are setParticleCircle, setParticleClass, setParticleFire, setParticleParams, setParticleRandom
You're true
So its looking like a no on complex particle spawns via sqf :/
Well, if that is the question (maybe I misread something), that's a no, sadly
You could to emulate it but this will become complexer
As in spawn multiple particle to emulate the complex effect?
Maybe
Yeah, this makes me sad but alright. My script just got more annoying XD
anyone familiar with the conditions for addAction? I cant seem to figure out how to write my target == caller...... trying to have an addaction appear for only a specific player
the addaction is on a vehicle
"_target == _this" // I thought I would change target to objects name and caller to be the units specific name but not working
_target == _this means only visible when your player is the vehicle itself, thus never shown. Supposesqf _this in [unit1,unit2,unit3]or so?
Ok, I know this is wrong but // "nameofobjectw/theaddaction" == "nameofspecialplayer" // I was trying to have the addaction appear on the "nameofobjectw/theaddaction" only for "nameofspecialplayer"

lol I thought if you saw my homework you could see what im doing wrong
_this in [unit1,unit2,unit3]```?
this addAction ["dislpay distance","dd.sqf",nil,-10,true,true,"","_this in [unit1]",3,false];
While unit1, unit2, unit3 are your units supposed to use the action
Well that totally worked @warm hedge thank you for you patience
I thought I had to use and == statement in the condition, what exactly does "in" do in this
If unit1 is the only guy, == will do also
cheers, im sure this wont be the last you see of me 🙂
As long as you're here 🙂
@winter rose Sorry Lou, was on my phone in bed and fell asleep - I was trying to create a random spawn selector for initplayerlocal. Once a location has been chosen it is removed from the array. Which I believe has been successful, now to identify how to do this to the AI on server start. (Essentially it is a deathmatch type game which rolls round but I am trying to learn MP scripting as I do this)
Is there any way to load a script from anywhere else than the mission file?
Yeah
Just put the PBO prefix before the path to the script
If you wanna load it from a mod
well its my own script.
So i can take my script and pack it as pbo and then do like _handle = [] execVM "POD_Rang\hello.sqf";
PBO will be in @POD_Rang\addons\POD_Rang.pbo
i will put _handle = [] execVM "POD_Rang\hello.sqf";
in onPlayerRespawn.sqf
No need for the square brackets
But yeah sounds good mate
Does anybody know how I could check if a unit is unconscious while playing with ACE?
Will lifeState work as intended?
Okay, it doesnt work. script is not found
@modern adder If its still the same as before Unit getVariable ["ACE_isUnconscious", false];
So have my "mod": @POD_Rang
Addons
POD_Rang.sqf
In the mission file i call:
_handle = execVM "POD_Rang\POD_Rang.sqf";
Also, have you actually set the pbo prefix in the addon builder?
Okay
Its a mod i try to call through the mission
Okay i see i gotta set an Addon prefix in addon builder
\myAddon\myPath\file.sqf
Yep, took me ages to figure that out haha
Actually, you don't need to it'll work as long as the source and destination are setup correctly and if you're signing it with a key, the path to the priv key exists
But its good practise to add a prefix yes
If it still wont work, see if un-binarizing it works
Well doesnt return an error message now, though doesnt add the custom insignia as i want it to.
I think uiSleep @waxen tendon
Hey, is it possible to create "POLYLINE" markers? setMarkerShape has listed this option but i was unable to create one 😅
@waxen tendon you can't. There is no reliability in scheduled scripts
@viral basin afaik not yet
oh okay 🙂
am I allowed to post links to a BI forum thread here so that I can get more answers?
Is here someone experienced who would be able to take a look at my PBO and scripts and see where everything goes wrong?
///stuff above here
{//Not original placement but to make this block logical.
_textabovehead = _curPlayer getVariable ["VKN_Title_Above", " "]; //Gets value which works just fine
addMissionEventHandler
[
"Draw3D",
{
alphaText = linearConversion [2, 8, player distance _curPlayer, 1, 0, true];
drawIcon3D ["", [0.85, 0.85, 0, alphaText], ASLToAGL getPosASL _curPlayer, 0, 0, 0, str _textabovehead, 1, 0.05];
}
];
} forEach allPlayers;
error I get is |#|drawIcon3D ["" Type any expected string
Any ideas?
Okay re-read drawIcon3D its needs string in text not structured text, for the time being using str and no says 0 elements passed, 3 required
I'm gussing the variables aren't passing right?
It complains about nil
_curPlayer and _textabovehead are nil
Why do you add so many draw handlers
why don't you just add one and do the forEach inside of the handler?
also _curPlayer is also defined outside of the eventhandler, the player from the forEach is in _x
I only want names above players heads 😅
_curPlayer is defined as _x above for to add it when I put the solo {
So in short, theres a much better way to do this then
just put the forEach inside the eventhandler
For scripts, whats the variable that contains the players colour scheme?
IGUI_TEXT_RGB_R
IGUI_TEXT_RGB_G
IGUI_TEXT_RGB_B
IGUI_BCG_RGB_R
IGUI_BCG_RGB_G
IGUI_BCG_RGB_B
in profileNamespace.
BIS_fnc_displayColorGet does also
Thanks
https://community.bistudio.com/wiki/isEqualTo When comparing arrays, with the 'same' elements, does the position of individual elements matter? Will it return false on [1,2] isEqualTo [2,1]?
thanks
How can I properly test MP scripts in dedicated environment? I did follow the wiki and launched the dedicated LAN server and then launched arma and properly connected to it.
I tested my script on local dedicated and it worked, but on real dedicated it did not. How can I debug that? Is there any way to get the server to confirm it's running the scripts I want without digging into the rtp?
Alternatively, how do I test scripts on my own without bothering friends that have dedicated servers running?
s there any way to get the server to confirm it's running the scripts I want without digging into the rtp?
Add diag_log's and check the rpt
Alternatively, how do I test scripts on my own without bothering friends that have dedicated servers running?
I run arma on my laptop to join my server
run a virtual machine for a second client
you can run the server with localhost=true in config
then you can run arma client twice and connect to the same server locally
You are asking how to debug issues, without wanting to debug..
Well.. just don't debug at all and give up then.
how do I find all the classes defined in class wheels of a plane?
e.g. wheel_1, wheel_2, wheel_3 or wheel_front, wheel_left, wheel_right or however the wheels may be named
this gets me the wheels class: private _wheels = configFile >> "CfgVehicles" >> typeOf _obj >> "Wheels";
call BIS_fnc_getCfgSubClasses; might be it?
"true" configClasses (configFile >> "CfgVehicles" >> typeOf _obj>> "Hitpoints");```
then you can parse that array based on "wheel"
thanks, that works!
you can also try selectionNames
Hello everyone, is there a way to pick up uniforms from another faction?
Well, kind of... You can set the player as civilian and then use SQF [player] joinSilent (createGroup "side")
Well, kind of... You can set the player as civilian and then use
SQF [player] joinSilent (createGroup "side")
@grim coyote does it work on MP?
Hey fellas, my mind is currently drawing up blanks for this:
Given 2 points in the world, how do you retrieve the required position and zoom level (to be used in the likes of mapAnimAdd) so both points are in view?
Getting the center position is simple enough but the zoom level slight more complicated (I think)
yeah, it works in mp
You just have to execute this locally on each civ player client
You just have to execute this locally on each civ player client
@grim coyote perfect, it could be on initPlayerLocal
Should work 👍
is there any way i can set up a reactivatable trigger f.e. Activation -> waits x seconds -> after x seconds the trigger can be activated again -> waits x seconds...
https://community.bistudio.com/wiki/setTriggerActivation ? third parameter repeating will do what you need I think, also there are options to set timeout etc
is it possible scriptwise to forbid ai to open doors ?
@naive needle Limit your questions to 1 channel.
@naive needle If you mean in general i have no idea.
If you mean specific door, then i am not sure if it actually prevents AI from using the door, but maybe worth a try:
building setVariable ["bis_disabled_Door_1", 1, true];
make sure you change the number in bis_disabled_Door_1 according to which door it is supposed to be.
thanks
I will give it a try
@supple matrix its working so far ,but that means players cannot open the door as well. I'm currently working on zombies and I want to remove the behaviour to open doors
ahh, good to know it acutally stops the AI :)
...isn't the opening of doors an action you could remove from the CfgMoves the zombies use?
i dont know 😦 it was just a quick idea
Its might be in one of the fsm's which are controlling the ai
Another idea - if using the "bis_disabled_door_#" is not too inconvenient (i guess you have to do that to every door in every building, which may suck), then to allow players to use the door, maybe you could add some event handler to players to watch for some event related to when they try opening the door (no idea right now what it should be, maybe watch for an animation if there is one?) and then you could unlock the door (and maybe open in same time).
thanks, but it will notbe the solution for me
...and i just remembered - wasn't there a "bug" when snakes and other ambient life creatures were able to open doors?
Was it ever fixed? if yes, maybe you should have a look at how it was fixed - maybe it was really just about removing some action from the creature's config.
I'll check ,thanks !
Does Dynamic Simulation globaly activate simulation of an object for every player on the server if a player is nearby or only for the player who is next to the object ?
So I want to create a anti air "map boundary" where if the player leaves the AO, the anti air will target them and shoot them down. I wrote this so far but I don't really know how to target the player that left the AO in a multiplayer setting.
Could I get a work check?
//set aa1 to anti air asset
//disableAI targeting at start
aa1 disableAI "target";
aa1 disableAI "autotarget";
//place the following in a trigger area for when player exits the AO
aa1 enableAI "target";
aa1 enableAI "autotarget";
if (canFire aa1) then
{
aa1 doTarget player;
aa1 doFire player;
} else
{
aa1 disableAI "target";
aa1 disableAI "autotarget";
};
wondering if it would just be better to just enable the AI and leave it at that, but I would like to target them quickly and shoot instead of having the AI search first.
I'm working on some script but it seems there's no global broadcasted variable which stores the location varible where mission is going.
What I've found is when EA create the mission, they use array of locations and when they finish creating the missions they discard the first index of that array while using that location as local variable.
However I have to use that location variable so I made global variable which get the local variable before it discard the first index of locations array and used publicVariable command.
It looked alright for hosted game and dedicated game(when dedicated sever was at same PC) but when I uploaded it on server and opened server, I only got empty location variable.
Is there any problem with publicVariable broadcasting location to JIP players? Or should I use missionNamespace setVariable command? Thanks for reading :)...```
else, is there any global variable which stores the center point(ok even ambiguous) of the missions?
I want to do it eventually for MP.
I tried messing around with nearestEnemy but it looks like nearestEnemy only works on those that are revealed to the unit. So then I looked at reveal and was messing around with nearTargets but then that gives me a huge array that I can't input into reveal... So not sure where to go at figuring out what target actually crossed that barrier and targeting them.
hey, if an object I want to get the worldtoscreen of (https://community.bistudio.com/wiki/worldToScreen) and it's off-screen, the array is null. How do i prevent the game from throwing a scripting error? isnull/isnil didn't work in my implementation.
Use count
https://community.bistudio.com/wiki/setTriggerActivation ? third parameter
repeatingwill do what you need I think, also there are options to set timeout etc
@spiral fractal but that doesnt add an timer between the activations, it just makes the trigger repeatable
i think enableSimulationGlobal did the trick, didnt test on server yet
There was, but not anymore
my bad, it didn't exist. you could set it with setVehicleInit and re-run them with processInitCommands
I think
if you can parse mission.sqm, you maybe could find them
but ideally, don't use init fields or rely on them
Hey guys is something like this:
_testarray = [1,2,3,4,5,6];
_a = 3;
switch (_a) do {
{
case _x: {hint str (_testarray select (_forEachIndex + 1);
}foreach _testarray
};
not allowed or am i doing something wrong here?
lol wow.
(@knotty mantle ```sqf)
you can't should not forEach in the switch
That.. should be allowed.. but is rather stupid
you can't forEach in the switch
You can
what you are doing is
hint str (_testArray select ((_testArray find _x) +1))
that switch and foreach is just stupid.. but.. should work if you want to do stupid garbage
You have a missing }
and a missing )
ah right. Thanks 🙂
@knotty mantle just to know, what are you trying to achieve?
i just did a way to faster export loadouts and be able to import them again in the next mission. Saving just one string for all players instead of one per player.
Guise, is it possible to change side relations over the course of mission? setFriend article does not recommend that. setRating and just re-spawning the same unit with a different side workarounds aren't really applicable to my situation. Am I out of luck?
setFriend works
Neat, thanks!
Changing value during mission can cause unexpected errors in AI behavior
it was true in ArmA (such as units taking ages to see you as an enemy, or having to run away to come back, etc)
but I used it recently and it (ouch) works
Any way to prevent AI in a group to all fire at the same target? My Static AA weapons are currently lobbing a missile each at the same helicopter whilst there are 4 in the Sky. wasting tons of ammo.
setPos it after - it's createVehicle that is "inaccurate"
^ yep (other syntax)
If I create an object, then assign a number of handlers to it. Should I clean handlers if I delete the object?
What handler?
any kinds of handlers. fired, MPKilled
If an EH is assigned to an object, the EH will be removed when the object is removed
That sounds logical, but who knows that arma.. Especially if the server leaks memory
I hope you removeWeapon and removeUniform before deleteVehicle'ing a soldier then 😄
Hi I need some help for script for my mission : (oh and sorry for my bad english)
So i have some sound in my mission folders (with the description.ext) ready to listen in game
I would make something like :
-If 0 players / not all (no ia) are not in trigger the ia nearby to the circle say one sound and if sound is end is game over
But
-If all players are in the trigger the ia say another sound (and make some gesture movement for the ia) and when the ia finished to speak the players can go out of the trigger and do anyone they want (i don't whant when players go out of the trigger the ia start to replays sound)
i make that :
_playerCountT = 0;
{
if ((side _x) isEqualTo blufor) then {
_playerCount = _playerCount + 1;
};
} forEach allPlayers;
{
if (side _x isEqualTo blufor) then {
_playerCountT = _playerCount + 1;
};
} forEach thisList;
if (_playerCount isEqualTo _playerCountT) then {
playSound "okStart"
} else {
playSound "noStart"
};```
but is not verry working :
the noStart (when 0 players/notall are in trigger) the sond are loop and when im in the ring he dosen't change to "okStart"
tanks for help and i'm verry sorry for m'y bad english
Is their a way to make a vehicles health go as low as 1% but never hit 0%. The purpose it so the vehicles does not explode and an engineer can come in and repair the vehicle back to 100% health.
ok thanks and what is the best way to learn how to use scripting because idk how to.
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting and links in this article 😉
@hidden bronze ↑
Does anyone have experience with the boat rack, speedboats and the destroyers? I can deploy a speedboat, but not recover it. When testing on dry land, I can Zeus up a rack and a speedboat and recover and deploy to my heart's content - unless I move both rack and speedboat in one operation. Then the recover action vanishes. I'm finding the whole thing rather frustrating.
Strike that second part. I can't duplicate losing the recover action when moving objects around in Zeus (so far).
how could I make the following:
//Conditional
({alive _x} count units group) < 3
//On Activation
{
_x setCaptive true;
_x action ["Surrender", _x]
} forEach units group;
into something that accepts the percentage of units in a group rather than an int?
The boat rack issue seems to be that the two emptyDetector objects that it uses to spot boats on either side aren't updated after the rack is created (rotation and movement don't change their positions). They also aren't deleteted when the rack is deleted. Does anyone know if I could be interfering with the rack's normal behavior through scripts? No mods are loaded.
({alive _x} count units group) < (count units group * 0.12)
for 12 percent
ok ty
Tested the boat rack in an empty mission. Same issues. Placing a rack in the editor allows for position and rotation, but creating a rack during a session with a rotation will leave the triggers at the wrong locations. Deleting the rack leaves the triggers behind. Bug report time.
Hey, does anyone know how to place objects in the eden editor that would usually spawn in via a script once you are in game?
Could you elaborate a bit? What do you want to achieve?
So pretty much we have a "Training" server we use but to save on performance we put all ranges in to scripts. Which then only spawn in via a GUI option. But now I wanna change it back to where they are already on the map.
Is there a way I can spawn them while in 3DEN Editor and save them to the map
Because that would be much easier than re-doing all the ranges haha
you could probably modify your script to use this command to spawn the objects
https://community.bistudio.com/wiki/create3DENEntity
execute it in the 3den debug console and then save the sqm
I am trying to create a Zeus module that will reduce respawnDelay but nothing I do seems to work
I have the delay set to 99999 in the desc.ext and I have a module with the following:
[{0=0},5,"Running Respawn"] remoteExecCall ["BIS_fnc_setRespawnDelay",0];
But it doesn't set the respawnDelay
I need some ideas and help to make it work
Alternatively, is there a way to make a module to run a respawn?
0=0 you mean 0 == 0, which is better known as true
no need to compare values if they are always the same
if I have nested foreach, I cant use the first loop's _x by its magic name inside the 2nd loop right?
idk if it a bug or I dont understand something in VcomAI functions/fn_SniperEngage.sqf ln 53
ah I am using the 3.3.3 develop branch
yes, I added private variable outside this loop and use it instead of the first _x
this file is full of errors. then line 83 has error
I just tried to patch it quick because I dont have time to fix the code
clearBackpackCargoGlobal can be used on player backpack?
no I just added it to my mission that I am working on
its possible to use it as script, I forgot where was this guide about it
afaik you have to add code from the files there like init, description etc to your code and edit file path in Vcom
its seems to work because my AI companion became much smarter 😄
clearBackpackCargoGlobal can be used on player backpack?
I want to remove all items from player but leave the uniform and backpack just empty it
clearAllItemsFromBackpack wiki page dont say what execution and arguments it takes..
ok, Thank you!
when I pass array to the addToRemainsCollector if I later add items to this array it will also be collected?
clearAllItemsFromBackpack wiki page dont say what execution and arguments it takes..
But.. it does tell you that the argument is an object.. and the example says "player"..
clearBackpackCargoGlobal can be used on player backpack?
That wouldn't make sense, you can't have backpacks inside your backpack
if I later add items to this array it will also be collected?
no
That wouldn't make sense, you can't have backpacks inside your backpack
can't you have empty ones? 🤔
But.. it does tell you that the argument is an object.. and the example says "player"..
I can learn from it if its EG or EL?
clearBackpackCargoGlobal removes backpacks from the vehicle, so it is not the proper command for you
clearAllItemsFromBackpack
yep
is it EL or EG?
given the wiki is not filled, if you MP test I can fill it
you can however use clearItemCargoGlobal and backpackContainer
is it possible to remove the gear action from dead body?
can I make it simple object?
(well, maybe through mods but idk and this is #arma3_scripting channel)
can I make it simple object?
if you want T-posing soldiers, sure
Simple Object can't rtm animated so...
can I see the code of addToRemainsCollector in functions viewer? I cant find it there...
Its a command, not a function. so no
😐 can I make my own commands?
when I pass global variable (A = true;) to function, inside it I have while loop that check if value is true, I use params private _ao = _this select 0;, will it store ref to A? so if I change A value it will stop the loop while {_ao} do {?
will it store ref to A
no
Well yes..
But no for what you're thinking
it will reference the same value
I use params private _ao = _this select 0;
That's not params, thats select.
params isparams.

yes its like it was made especially for me
haha
how can I pass global variable to while loop inside function so it will check it on each iteration?
just use the global variable
Do you want to have a function be able to handle multiple global variables?
yes
you could pass the condition as argument.
{A} call {
params ["_condition"];
while _condition do {}:
}
Does {A} work here? [A]?
what?
{A} ? its not [A]?
I mean, this argument looks illegal
{A}
I never saw it, what is it?
you never saw it?
you never saw
call {
hint "hello"
}
or
if (...) then {
hint "hello"
}
?
1 params ["_a"];
_a //This is 1```
what {A} mean before the call
I think he means he didn't know { } could be used instead of [ ]
yes
What I said is what he meant
he didn't know { } could be used instead of [ ]
Well they are both completely different things
Yeah my point is I think he needed some explanation on it
what is happening?
the wiki has it cube 😉
{0} params ["_a"];
5 params ["_b"];
player params ["_c"];
[_a,_b,_c]; //[{0},5,B Alpha 1-1:1]```
You got it?
while {A} do {};
is equal to
_conditionFunction = {A}
while _conditionFunction do {};
is equal to
{A} call {
while _this do {}:
}
is equal to
{A} call {
params ["_conditionFunction"];
while _conditionFunction {}:
}
is it cryptography?
It allows you to put code in place
Its basic SQF..
so instead of having { condition } you can put in whatever the passed thing is
I'd give the wiki page another read if you still don't get it
params article has this sentence:
argument: Anything - A usual array of params is expected. If a non-array argument is passed, it will be converted to 1 element array
To make this Quick:
Every "control structure" in SQF is operator driven.
{...} just creates a code value and passes it to (eg.) the <LEFT> call <RIGHT> operators righthand side, with left being what the operator uses as arguments for when it calls the code value you passed
TL;DR:
{...}is a value-typecalloperator lefthand accept any value-typecalloperator righthand accepts only code value type<ANY> call <CODE>
I use C# so this looks really strange to me
it is fairly simple
there is no control structure in SQF and all is implemented by operators
call, then, else, ... all are operators
not control structures
Good morning all. So I have a simple .sqf which causes an enemy to pursue the player. [] spawn { while { sleep 10; true } do { response_team addWaypoint [position player_1, 10]; } };
the only problem is it results in the AI rarely catching the player because they are always a step behind, simply following old waypoints based on previous player position
any ideas for making it smarter?
Change a waypoint's place instead of adding them?
include setCurrentWaypoint after adding it, so it will ignore old ones
or remove old ones with deleteWaypoint 🤔
or simply replace the waypoint if the group should only have one:
[] spawn {
while { sleep 10; true } do {
// notive the 3rd param, which will override the 0th waypoint
response_team addWaypoint [position player_1, 10, 0];
};
};
ooor move
@exotic flax ahhhh. i should've thought of that before!
or there is BIS_fnc_stalk
@winter rose BIS_fnc_stalk? What is this sorcery?
(link without description! 😱)
also, it should stop once there are no more living members
okay, NOW i feel dumb
why though
Once upon a time everyone was
being stupid != being uninformed 😉
Maybe 👆
@winter rose So i tried BIS_fnc_stalk but they only came to the initial position. ```sqf
_stalking = [response_team, testgroup] spawn BIS_fnc_stalk;
while {sleep 5; true} do {
"Response_mark" setMarkerPos getpos responder_1;
}
i added the marker so i could see their movement on the map
seems default is to follow, so i'm not sure whats wrong
could you check response_team getVariable ["BIS_Stalk",2];?
It should have the following results:
0 = not stalking at the moment
1 = currently stalking a group
2 = something is broken
nil = group is dead
mods? difficult environment?
I'm not sure which. I think I may just try "move"
try the example #4 maybe it will work if you set all parameters, I think I used that and it updated the waypoint
ok
@spiral fractal winning! entering all parameters made it work like a charm
additionally, for knowledge, a 30 second update is more than enough. doing 10 or 5 causes the responders to move very slowly
Ah yes
And more and more with increasing distance
BIS_fnc_stalk and BIS_fnc_spawnEnemy need edit I guess, you can take the source code for it and edit to make it work as you need.
idk why it works when more parameters set 🤔
possible to have more than 1 instance of BIS_fnc_stalk going at once?
I think you can run only 1 stalk function for every stalker group
yes _wp = _stalkerGroup addWaypoint [(leader _stalkedGroup),_radius];
is there any function like BIS_fnc_findSafePos that can find positions invisible to player? like behind buildings etc? I want to spawn AI enemies
you could couple this with lineIntersects, but I don't remember seeing a "shelf" one
checkVisibility maybe?
It is better to use checkvisibility I believe. And make sure you've done a proper exit from a loop - like if iterations count > 100
I would do something like that:
- get an array of, say, 1000 point on a cyrcle R>=spawn distance from a player.
- start to check it one by one
- if checkVisibility < 0.1, put this position to temporary array.
- chek the next point, and if it is not visible too - add it to temporary array.
- find out the circle segment large enough, that is not visible - i.e., 40 point = 15 degrees.
- get the center of arc, and find the point on the line between player and this point, then spawn the unit.
I think it is better than just selecting random positions, hoping it will not be visible by player - you can get an infinite loop.
Thank you! I will try to implement it
I don't remember if there a good function for selecting positions by radius and angle by default, but you can look at the SHK pos, if you didn't see it yet. It is very useful and comprehensive function library.
found it, its from 2014 hope it will not be too outdated, also I think it might be overkill for my mission, will check the code tomorrow
hello fellow comunity
i have a question: is there a script to freeze the AI?
in a MP mission
enableSimulation(Global) @austere silo
thank you very much Mr. Montana
Hello is there anyone can help about starting a new life server ? We have a script pack and a server but when we start the server there is some problems ?
Hey guys, is there a way to check if an event already attached to a unit?
eventhandler you mean?
yep
add a new one, and check the ID that you get back
hmm.. so I need a "registry"
that'll atleast tell you if there once was one attached, not sure if it tells you whether its still there
The plan is to attach an event to every new unit spawn (AI / Players) The units spawn dynamic and this stage I have no control over the createUnit
setVariable onto the unit. "eventhandlerIsAttached"
What would a good way to stop animals from walking through walls? Trying to develop a solution which works
I have animal (dog) he ignores walls
Probably placed down in MP, walls were not syncronized with the Client probably
they sorta phase through them
was wondering if there is a command for detecting if a wall is infront of them
_dog = createAgent ["Fin_random_F", getPosATL player, [], 5, "NONE"];
I was testing on altis
its the last thing I need to fix for my attack dog script
since my friend is using them for a COD zombies thing and it is a tiny bit unfair for the players
when the "hellhound" just waltzes through the walls and bits their balls off
probably issue with the simpler Agent simulation
hummm I wonder if https://community.bistudio.com/wiki/lineIntersects will work
welp, off to the land of testing weeeeeeeeeeeeeeeeeeee
lineIntersects only checks for a direct line of sight, it won't prevent bugged out AI warping through objects 😉
pathfinding is the thing you need to edit, but... erm... no.
how could I go about grabbing whatever AI the basegame units use, and shoving it in a dogs brain?
and would that be scriptable instead of modding
I dont think that can be achieved with scripting
maaaybe calculatePath, but it would be a pain
I have a Unitcapture set up for a chopper and I want to know if I can trigger V1 (chopper’s name) engineON true; using waypoints or something because the spinning blades are pretty annoying
Sure
is BIS_fnc_EXP_camp_playSubtitles buggy?
In what terms?
im consistently having issues with it where the text goes away after half a second, and sometimes the next line will be totally skipped and not show at all
And how do you even use it?
["Warhorse","Headquarters this is Warhorse, we are getting close to the distress call now.", 0],
["Headquarters","Warhorse, Do you see anything yet?", 5],
["Warhorse","Negative, but we can hear the siren and screams of civilians. Enroute ASAP.", 8],
["Headquarters","Copy Warhorse, report back once you get figure out the situation.", 16]
] spawn BIS_fnc_EXP_camp_playSubtitles;``` this is what ive got
in init.sqf
I don't see any problem here, just tested
Ah, custom audio playing off elsewhere is interfering with it because of the title
Thanks for checking
before blaming (here) the function, please test in an empty VR mission 😅
Lou, if I wanted to make a mission end when all players of a side are dead (in this example, Blufor and Indie) where and what would I have to place? I have found videos on how to make a mission end if all players are dead, or if a specific target dies, but I can't find a video/forum post regarding a specific team. (Its a Team Deathmatch)
Literally the first post has 3 different solutions

to end the mission use endMission "end1";
Ah, I didn't google that. I was googling something different. I am very new to scripting so I am unfamiliar with what specifics to use, sorry.
Thank you though.
np
So I found something that made more sense to me. Some mentioned creating a zone around the area, and set it to trigger "end1" or "end2" based on if there is no blufor/opfor present.
I am just now figuring out how to link the end1 and end2 triggers to the zone.
Use endMission
in activation
its so much easier
less trigger use
then set the condition
Or hell even just put blufor not present
on activation
endmission "end1";
Curious mind if I PM you?
Go for it
Hi guys, would you know why this line throws generic error in expression when executed in a scheduled environment, but not in an unscheduled environment?
if (_oPlayer distance _x <= 500) then ```
It's inside a forEach loop
```sqf
forEach allPlayers - entities "HeadlessClient_F";```
_oPlayer is the value of sqf player
because unscheduled environment can not throw exceptions 😄
fix the error!
Well, now the question is why it throws a generic error in expression 😛
I don't think it's a type issue, as distance returns a number
_oPlayer undefined?
No
maybe error is on a nearby line, but not on that exact line
{
private _iPl>
13:36:04 Error Generic error in expression```
I believe that's the error
your code so we don't play the guess game 😄
Fairly sure it's that if statement
OK, give me a minute
That's the entire function
Input should be correct, as that's definitely a player object
As in, the argument supplied
as that's definitely a player object
🍿
btw, shouldn't it be
forEach allPlayers - entities "HeadlessClient_F"
↓
forEach (allPlayers - entities "HeadlessClient_F")
```?
if (isNil{_oPlayer getVariable "XIM_bIterating"})
I'd prefer
if !(_oPlayer getVariable ["XIM_bIterating", false])
Ah
Are you running that on server? that script?
On a player host, yes
Ah meh.
Because on a dedicated server player doesn't return a player, but it should on player host
Typo if (!(_aPlayerMachineIDs findIf {_x = _iRecentMachineID}))
I'm not using player
Maybe just add logging and check what values your variables actually have
instead of assuming what they should be
I'm using the debug engine
btw, _oPlayer distance _x and checking on all the players… he won't be far from himself
I'm using the debug engine
Then it should tell you the variable values, what are they?
Debug engine isn't giving me the variable values though
huh 🙃
Only gives them through the vscode extension right?
I haven't seen anything that I assume would be the variable values
Let me send the RPT
if (!(_aPlayerMachineIDs findIf {_x = _iRecentMachineID})) also doesn't need to be a findIf, just need a find.
Actually, just need a in
Actually that can never work at all
findIf doesn't return a boolean, you cannot ! that
I thought it does?
if (!(_aPlayerMachineIDs findIf {_x = _iRecentMachineID}))```
what you are doing ↑ here is using ! on a number
the image compares it to -1
really? where?
> -1
the wiki is fine 👀 😄
Ok, so I'll fix that and see if that solves the issue
wow, TMI Discord, TMI
lol
Ok, so I fixed some stuff, but same issue 😛
Let me put the RPT in a pastebin
if !(_oPlayer getVariable ["XIM_bIterating", false])``` throws a generic error
original works though
points towards an issue with _oPlayer
But why does the other work though?
didn't throw error if it was undefined inside the isNil, isNil is gone now undefined throws errors
diag_log the _oPlayer value
Ok, I'd prefer to get the debug engine working though
yep, it's a Number
What is?
Error getvariable: Type Number, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
line 50:
14:45:13 Error getvariable: Type Number, expected Namespace,Object,Group,Display (dialog),Control,Team member,Task,Location
😄
XIM_bIterating is?
Yeah
Launcher says the engine is loaded
Perhaps WINE is interfering with it?
Oh well
Time to figure out why _oPlayer is a number hahah
Wine??
I'm using linux
might fix someday 🙃
but I don't really want to set up a test environment in wine oof
It's not easy that's for sure haha
Can't use ACRE either as windows system calls aren't properly implemented in proton yet :(
Oh
Oh dear
Yeah, I know TFAR works, but me and the lads had issues with it breaking mid mission haha
Ok, I found the value
It's two
Which means it's replacing the player object with the client's machine ID somewhere
epic style
somewhere
had you used params with filter params, you would have seen it immediately 😉
Filter params?
params ["_oPlayer", objNull, [objNull]];
I recommend doing so for every entry point
this ↑ checks that _oPlayer is actually an object
Ah, okay
and if not provided, it defaults to objNull.
Thanks
when I use spectator from console I can see dead enemies that were "removed" by remainsCollector, is it ok or I made some error and have memory leak?
I got it
Argh
onPlayerConnected returns a machine ID
That's why
I was calling that function with _owner in onPlayerConnected
how can I get access to the remainsCollector array?
or know if object was collected?
You can't
Besides
https://community.bistudio.com/wiki/isInRemainsCollector
isNull ?
I think the bodies go under map but not removed in my mission
check isNull after 5s
but I have random collection time
what do you want to know, and why?
and I allow couple bodies
when I go to spectator from console I see long list of enemies and most of them have skull icon and they not appear on map
is it "memory leak"?
close/reopen? IDK much about the spectator thing
also everytime I play the mission to debug it I end up playing it and waste time :|, also I still forget the then in if 
I will try to delete bodies without remainsCollector and see what happens
hmm I had addToRemainsCollector [_unit]; now when I removed this line and add each spawned unit to global array instead and then do arr = arr - [objNull]; its seems to work without "memory leaks"
is it possible to remove all ACE interactions from unit? there is ace_common_fnc_claim but I dont think its the right function to use
If you want to remove them from all units/objects, you can probably override the configs and global variables used by ACE.
For single units, you probably can't unless you abuse something like _unit setVariable ["ace_common_isHandcuffed", true, true];, which should disable all/most interactions.
ace_interact_menu_fnc_removeActionFromObject will not work?
that only removes the interactions from an object (eg. Carry Box)
I guess the big question is; why would you want to remove interactions from ACE?
claim is easiest way to block interaction with some object.
if you want to remove only some types of actions you can't do that without config edits.
I want to remove all interaction on enemy, I use claim now, but I thought there may be better way to do it...
making the object claimed by itself is recommended solution and there's no better way atm.
hmm, well then I will use it I guess 🙂
is there way to get the number of rounds in magazine? I use getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"), then I select 1st element in the array and I want to get the number of bullets in that magazine
@spiral fractal see https://community.bistudio.com/wiki/magazinesDetail
number of rounds total and current rounds
I just found this page, but I want to check magazine that is not in player inventory
I am very bad at cfg, (not that I am good at anything else) but idk anything about it, I saw the CfgMagazines page but I dont know how to use it 
configFile >> "CfgMagazines" >> _magClassIguess >> ?
getNumber (configFile >> "CfgMagazines" >> _magazine >> "count")
and in case you want to know info about the currently loaded magazine: currentMagazine
yes I saw that command, but I am making ammo pickups and I want to check if player can take it or not
Is it possible to script full screen night vision when spectating a unit in first person using EGSpectator, always thought its not possible by game limitations
Killzone_Kid
This command will return time since last client restart as float. However because of Number format used in Arma, the more time has past since restart the less precise the returned value will be.
This comment in the diag_tickTime wiki page. How long of a time before the float is innacurate? I'd imagine its many many hours? If its under 6 its a problem if its over then i'm not phased.
https://community.bistudio.com/wiki/diag_tickTime
1e7
cheers @winter rose
So does that end up being about 2777 hours if i'm right? That seems incredibly high. I imagine thats the absolute maximum limit, but at what point is it innacurate as described? assuming 1e7 being the maximum float
no maximum
there is no "maximum float" before infinity
thats the specialty of floating point
its just not exact anymore
maybe it was 1e6
no, 7 digits
Yea ofcourse, so basically once we start hitting 7 digits, diag_ticktime becomes innacurate? which is still incredibly high
So, basically, I get precision to the second for around 27 hours, i'd likely get sub second degradation reasonably at about 3 hours? Is that what i'm gathering? Wildly guessing the degredation occurs a digit earlier?
Wildly guessing the degredation occurs a digit earlier?
no thats not hot floating point numbers work
what is your definition of being accurate?
floating point isn't even "accurate" at 0.003
Oh look there's probably a better way to do what i want to achieve.
Basically I want to use diag_tickTime to stop the handleDamage eventhandler from sending the damage twice when damage occurs. For example if you're shot in the head, that happens twice because it happens in such a short space of time. So, it sends, lets say 3 damage (what you get from a sniper headshot within 100m) twice to my script. Basically just have
_TickCheck = player getVariable ["EAMS_LatestDamageTick",diag_tickTime];
if ((diag_tickTime - _TickCheck) > 0.01) then {
player setVariable ["EAMS_LatestDamageTick",diag_tickTime];
//systemChat format ["%1 to %2 at %3",_damage,_hitPoint,diag_tickTime];
} else {
systemChat format ["SKIPPED %1 to %2 at %3",_damage,_hitPoint,diag_tickTime];
};
Thats what i've got at the minute for testing how it's all working and what it's "ignoring"
If there's a better way i'd do that instead, but this seems to do the job. Basically just don't want say, 3 hours into a mission for it to start doing both again because of the innacuracy mentioned
Would that not still have some discrepency if someone had better or worse frame rate or am I also misunderstanding how that diag works?
you can probably calculate with 60 fps
if damage accidentally triggers twice
it will do so within same frame
But if someones frames are worse or much much better than that, it won't necesarrily happen in the same frame? I was thinking in that case just a ~2 frame window to allow for that?
completely forgot that I wanted to fix that double firing
^ that'd be amazing aha
it won't necesarrily happen in the same frame?
Quite sure it will
but sure you could do two frame window
but at that point, I'd also check the damage bodypart if you get that in handledamage
because a bullet might go through your arm into your torso
at that point you might receive damage twice
The other thing is. If you get shot in the Arm for example, the bodypart that takes the damage first, isn't necesarrily what ends up firing first
The image above shows that. The arm, with the most damage, is what is shot first.
The other damage is passthrough
¯_(ツ)_/¯
Fair point 😆 Its why i'm basically just getting the highest damage and using it. Well, plan on doing that, haven't as yet. I don't think its actually a bug per say, its probably just the eventhandler and how it reports.
Thank you however, I'll use FrameNo instead if its going to be more reliable for longer times
can I use exitWith inside HandleDamage event code? ... exitWith {0};?
you can certainly do
call {
.. exitwith...
}
it doesn't work as intended @spiral fractal
from a KK's wiki note
so I cant use exitWIth* inside event handlers
- regular exitWith
nope.
I am not that good with SQF...
this is madness 
this absolutely needs a fix!!1! 😄
player addEventHandler ["HandleDamage", {
call {
if (alive player) exitWith { 0 };
1;
};
}];
#wontfix
BI doesn't care about its customers @#%$!1!!
Blame dedmen 🤓
😦 inside HandleDamage I have: if !(isPlayer _instigator) then {_damage = damage _unit;}; _damage; why its not working?
its copy paste from wiki and this is the code I added inside
😢
_damage is from params
yes, in my case green on green
maybe instigator isn't what you expect
oh ah that non player, not player 🙃
are you sure returning damage _unit is correct? instead of returning 0?
I dunno
found this code: if (side (_this select 3) == side (_this select 0)) then {false}; also not working
I got this feeling that I will spend the night trying to figure it out 
Well I'll spend the night sleeping, bye 😄
Dedmen sleeping already… the end is near
maybe ACE has something to do with it?
. . . yeaaaaaah it would be nice to mention that first @spiral fractal! as ACE changes the system damage _a lot _
ACE should be added to the game... or the game should be added to ACE...
this code seems to work:
_damage = 0;
if (isPlayer _instigator) then {
_damage = _unit call ace_medical_fnc_handleDamage;
};
_damage
Heey, does anyone here have a vehicle pannel hud script I could use in Exile? Thanks 🙂
…the car script?
The one that shows, fuel, speed, damaged modules, etc..
yes, the exile mod straight up disable's arma's default hud
it has custom hud
So, I was told to either straight up make a custom mod for the vanilla hud, or build it with scripts xD
try to use the showHud command, or check description.ext, they probably disabled it there so this command will not work
also they probably made something else instead
My understanding of it is, the Exile mod disable's it, not with a config, but the mod itself replaces it for its own custom one.
This is the only hud options it's gives in the description.ext
"showHUD[] =
{
true, // Scripted HUD (same as showHUD command)
true, // Vehicle + soldier info
true, // Vehicle radar
true, // Vehicle compass
true, // Tank direction indicator
false, // Commanding menu
false, // Group Bar
true, // HUD Weapon Cursors
true // Vehicle Panel (Required for GPS)
};
"
So, what are the functions to check for ammo, mags, fire rate, etc... So I might aswell try and make a custom HUD my way with scripts xD
Anyone willing to give me a hand maybe?! xD
I'm kinda new on this xD
custom hud is probably not the best way to start
making a custom HUD takes more than just calling some functions, so be prepared for that
Not too shure @spiral fractal , the mod isn't but when setting up a server, you can custom overwrite anything
maybe you can learn from this: https://github.com/dulanw/A3ExilePilotHUD
when I add ACE interaction menu item, is it possible to use _this inside the title? I want to set the title to "Take ___" and get the object name
How do you know what you are suppose to put into different event scripts ?
it… depends on what you want?
we have a wiki that lists all the available commands
idk I just feel like im stuck understanding what you need to do in each .sqf
can you link me in the wiki the list of commands?
Does it explain what needs to happen in every event script?
no; it just tells when it runs and which parameters are available
because how is the engine able to know what you want to do with it? 🤔
Yeah I guess i'm just overthinking it
Does it explain what needs to happen in every event script?
Do whatever you want in them, event scripts are triggered on events, it just execute the code inside them when the event happens, nothing more
"Hello World!" is probably the simplest 🤣
Other than that, if you think you're missing something in-game try to figure out if it can be scripted and if yes; try to build it
now that is well designed "inheritance":
Man > Animal > Animal_Base_F > Dog_Base_F
Motorcycle > Bicycle
@simple notch
See https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting 😉
and the specifics for event scripts
https://community.bistudio.com/wiki/Event_Scripts
how the "take" action works when I pick weapon from the ground?is there source code?
if Take EH is triggered, you get access to the params provided and you can do with it what you want
I disabled the HUD so now I dont have this action, I want to use ace instead
I believe the scroll wheel actions are still available even not showing a HUD, and otherwise SPACE will still work...
I tried and I was unable to pick weapon
and you're sure it was a weapon, and not a prop?
and does it work when you still have a HUD?
I killed AI and tried to pick the weapon
I've got a request for the Nimitz to support animateSource for tailhook deployment of a plane when landing on the carrier. Now the F/A-18E/F does not support animateSource and probably quite a few other carrier based planes neither. Is there a smart way to figure out if a plane supports animateSource for 'tailhook' animation or not? Maybe checking config AnimationSources in for 'isClass tailhook'? Any other ideas?
Hey folks, there's the function getMissionLayerEntities and get3DENLayerEntities. They return the object given the layer- is there a function that does the inverse? I want to find the Layer that an object is in without scrubbing through every single layer. Thanks!
not aware of that being a thing
Hello. I need some help. In my template mission I'v create 3 ammobox. Where there will be different content in each box. In one of the ammoboxes i'v written in the init line:
"[""inf"",this] call Supplies.sqf";
Then in the misison folder i'v made a supplies.sqf where i'v added all the content of all 3 ammocreates in. Before the content of one of the create i'v written
case "inf":
So I'm hoping that it will execute the commands under case "inf"; however this seams not to be the case. Anyone would know what to do?
Possible to elaborate @still forum, my scripting skills in arma are very limited.
see the examples:```sqf
switch (_providedString) do
{
case "string1": {
// do stuff 1
};
case "string2": {
// do stuff 2
};
};
not aware of that being a thing
@still forum
darn was hoping to mitigate lag 😦
store layer on the object when placed?
@winter rose aha. I am missing the
switch (_providedString) do.
and i assume I must also add something in the script to understand its "_providedstring"?
"[""inf"",this] call Supplies.sqf";
this ↑ won't work
either use execVM for a file, or call for Code
(https://community.bistudio.com/wiki/execVM)
(https://community.bistudio.com/wiki/call)
(https://community.bistudio.com/wiki/Code)
in supplies.sqf:
// defines the parameters, their default value and their accepted types
params [
["_type", "", [""]],
["_unit", objNull, [objNull]]
];
switch (_type) do
{
case "inf1": {
_unit setDamage 0;
};
case "inf2": {
_unit setDamage 0.5;
};
case "inf3": {
_unit setDamage 1;
};
};
(https://community.bistudio.com/wiki/params) @winter wraith
and to execute it:```sqf
["inf1", _myUnit] execVM "supplies.sqf";
**Don't** put that in the init field.
Do you mean setVariable the layerName on the object? @unique sundial Would defeat the purpose of the code if I did that 😦 - I think I'll just search every layer. Now that I'm looking into that though, I'm not seeing a way to do that. No reliable way to find the layerID or the highest layerID, right?
add3DENLayer would give you the highest ID, I assume they just count up from 0 as usual
which ofc doesn't work if in mission
Cheers for your time so far.
I'm afraid I coulnd't get it to work. I added two ], one on each line in params to prevent error ingame. The executable, why do I have to include _myunit. I thought that was inrelevant. Also why can i not use the init field?
I don't understand the params, even after reading the wiki. I am simply out my league here. So I just trust they are correct and needed.
is there a way to get a decal terrain object? (has no class and no named property class) cursorObject nor neareastObject lists it
hey @spiral fractal, no I want to have 3 gearboxes in my tamplate with a standard loadout. Instead of creating 3 sqf files I want it all in one so it easier to edit later if the loadout change. So my issue is to have the correct command line in the gearbox init. In the SQF file i'v sorted all the commands for gear and that stuff. But I dont understand how to use the switch command correctly. If you look at what Lou Montana typed above, who helped me. I dont get that to work and I also dont understand by my lack of knowledge about how the params work.
@velvet merlin any example?
okido!
Nvm solved it: In init i added:
["infordinance", this] execVM "supplies.sqf";
in sqf I edit
params [
["_type", "", [""]],
["_unit", objNull, [objNull]]
];
thank you @winter rose
with pleasure @winter wraith; SQF is a painful mistress but she's worth it on the long run (…I hope?)
I have been looking at the createVehicle information on the WIKI and whenever I create something to the position of player it appears all around them. I am wanting something to spawn at their feet. Can someone point me in the right direction?
Spawning something right exact place? Use "CAN_COLLIDE"
ye I just re-read example 9 on there thanks for the help!
@warm hedge regarding that texture path problem...
Maybe first get the extension from current texture path (as it should always contain the extension),
then take that many chars from the end of the other texture path, and compare those two strings.
If the "extensions" are equal, you compre the rest of the texture paths.
If the "extensions" are not equal, you can compare the current texture path without extension with the other texture path.
it is in the hands of BI now; see #arma3_feedback_tracker
As I mentioned supported extension is limited so maybe like:
private _objTex = "a3\bruh\swag_ca.paa";
private _cfgTex = getText (configFile >> "CfgVehicles" >> "bruh" >> "texture"); //just an eg
private _ext = "";
{
if ((_objTex select [count _tex-count _x]) == _x) exitWith {_ext = _x};
} forEach [".paa",".pac",".jpg"]; //more exts should be here
(_objTex == _cfgTex or _objTex == (_cfgTex + _ext))```
Hehe, it's free to discuss about solutions!
What's the trick to attaching something to a turret so it rotates properly?
I have something attached to a turret memory point, and while its position is changing as you would expect when I move the turret, its orientation is fixed
That's how attachTo works. You can do draw3D and some setVectorDirAndUp
That doesn't seem like a practical solution
I think so either. Sadly this is current attachTo
your object os attached to the object (which does not rotate) and not to the turret, yeah
Maybe you can attach to the selection, but you will still have to rotate it accordingly iirc
I sort of expected that the memory point would have rotation as well as position, but obviously not
How would I fill in the params for this?
onPlayerKilled.sqf
Executed when player is killed in singleplayer or in multiplayer mission.
params [
"_oldUnit",
"_killer",
"_respawn",
"_respawnDelay"
];
thats copied from the website but how am I suppose to display the killer and stuff
How do you want to display the killer? In a message to all players, in a hint...?
That params line is what goes at the top of your onPlayerKilled.sqf script file. It defines all those local variables, which contain the information passed down from the game when the script is executed, so you can use them in the rest of the script.
Well for example I would want a box at the bottom to say who he was killed by and it disappears after they respawn
how would I do that?
Hello, does anyone know the proper way to create the client video settings dialog (RscDisplayOptionsVideo)? Need to open the display to read client settings from it.
can someone help me with writing a script. I'd want an item to equal damage 1 when picked up and put in inventory and back to 0 when dropped
@simple notch If you want to create a box at the bottom you'd probably want one of these things: https://community.bistudio.com/wiki/Arma:_GUI_Configuration which I don't personally know how to use.
Within those, at some point you get to the bit where you define the text to display, and inside that you'd use format and reference one of the variables defined in the params, which will then automatically display whichever information it is
I can tell you how to make it appear in the text chat (for the killed player only):
// in onPlayerKilled.sqf
params ["_oldUnit","_killer","_respawn","_respawnDelay"];
systemChat format ["You were killed by %1 and will respawn in %2",_killer,_respawnDelay];```
It's worth noting that death messages is a parameter in the multiplayer difficulty settings. You can replicate it with scripting, but if you have control over your server's configuration, you don't need to.
what seems to be the issue with this script
_player = _this;
while{alive _player} do {
if ("red_radioshack_base" in backpack player) then {
_player setHit ["radioshack",0];
} else {
_player setHit ["radioshack",1];
};
sleep 0.1;
};
```
im trying to make the item "radioshack" equal to damage 1 when its in the backpack slot
this is the error in arsenal^
How do you call it? And seems error says everything to fix your problem: use select to define _player
im calling it via an eventhandler
Then just do select it, don't know what EH but every EH does have _this as an array
do i have to use an event handler to call the script?
I'm trying to create a long range radio. I want it to look like two different models when being worn and when it is on the ground.
When it is worn on the player, I want it to look like a backpack. And when it's on the ground, I want it to look like something else.
I was thinking a hide/unhide animation with damage source would work.
Backpack does have nothing to do with it, and your script you wrote tries to do something to player not backpack
Maybe changing matetial? Dunno...
well the TFR radio is attached to the backpack
What is "well"? I get nothing... I know there's some Modded LRRs but I believe backpacks have no damage to take
Also you can't use while inside EH directly
Giving a backpack a different appearance when it's on the ground is, at a general appraisal, wildly impractical if possible at all
I strongly suggest that it's not worth it
Can anyone offer assistance helping me remove VON channels for specific players? I hoped I could just use enableChannel in each players init, but that appears to have a universal effect...I tried RyaanDunne's scripts here https://forums.bohemia.net/forums/topic/207816-disable-sideany-chat-channels-not-working/ but still seems to apply to every player, and I wanted to give special VON permissions to the squad RTO's, not groupleader.
Disable base channels for everyone and create custom channels for specific people?
You can't really pick and choose who gets side chat because its whole purpose is to talk to the entire side. If you want a limited net, you should create one for that purpose
I see. Thank you for the explanation @hallow mortar. I will use radioChannelCreate and list the unit names I want to have access to this custom channel.
Be advised that that alone will not allow the channel access to be transferred (e.g. if the RTO dies, their channel access dies with them). It is possible to create a system where channel access is tied to possession of an object such as a radio bag, probably using bis_fnc_hasItem but that wasn't my project so I don't have an exact blueprint
deeper down the rabbit hole I go then thanks
Shouldn't be too complex, you just want a loop that frequently checks players to see if they have whatever thing it is (might not need fnc_hasItem if it's a backpack actually) and adds or removes their access accordingly
while, forEach, if, backpack _x == and sleep are key components but I don't wanna think too hard about it atm
Love the idea, dont think im there yet. Is it wise to have something like that running throughout a mission performance wise?
If you use a sleep so it runs once a second or whatever it should be fine.
Someone else might be able to help you in more detail but it's like 4am in the core EU TZs so yknow
Thanks for your guidance, very insightful. My knowledge of scripting isnt there yet to implement your suggestion. I may try and just cheese it with command channel and just call my group leaders rto's or something.
If I remember in the morning I will try to construct something more useful, if no one else sorts you out first
I am using this script in an init.sqf radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Long Range Net", "%UNIT_NAME", [rto]]; // to apply a custom channel to only the RTO. Now if I chose a different role, still works as intended (not giving radio ch permissions) but I get an error message " Undefined variable in expersion: rto" What am I doing wrong here?
Undefined variable in expersion: rto means rto is undefined. Also see the pin to format the code
Now if I chose a different role, still works as intended (not giving radio ch permissions)
I can't understand this sentence
radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Long Range Net", "%UNIT_NAME", [rto]];
``` Sorry for not formatting. My intention is to give "Long Range Net" only to the "rto", when I select say "medic", the role does not have the "Long Range Net" channel which is what I want, but I get the error message for rto being undefined.
How rto's defined?
it is the variable name of a player
And what do you mean
select say "medic"
?
spawning in as any role besides the role with the variable name rto
I don't get it. What exactly did you do to “select the role”?
In other words, when players join the mission, on the role selection there are your standards roles, Platoon leader, medic, Riflemen ext. One of the roles, the radio telephone operator, has the variable name rto.
I mean what code did you do? Or anything other?
I apologize this is so difficult for me. I dont understand what your asking by what code I used 😦
I think I understand my problem. When I load the mission with AI to fill the empty slots I dont get the error message. But if I am the only player and I choose a role besides the rto role, and there is no ai to fill that role, only then do I get the error message.
So I suppose rto is undefined in the expression if there is no player or ai filling that role/slot
So you meant to select the role in mutiplayer lobby, and get into the mission right?
yes, should have said multiplayer lobby
Your mission should have AI mates or not?
it should not
So i wont get the error message if the role is filled, but I want every squad to have an rto role, so if say I only have enough players to fill 2 squads and the 3rd squad is empty including the third sqauds rto role I will still get the error message
If your mission is JIP-compatible, this won't solve it
Don't create it, just add the player to the channel
Ok so I still need to create the channel, somehow find out what its index is returning and use that number to radioChannelAdd
Probably save the index and share with publicVariable
Thank you both for your help, Im obviously not knowledgeable enough yet to implement what I thought was such a basic feature. Even if I learn indexing/public variables I still have to tackle what to do on respawns. Think I will search for a simpler solution. Also heard there are problems with voice on the custom channels, would break my heart to spend another day getting this working and then find out the custom channels suck for voice.
if ( isServer ) then {
private _channelName = "Air Traffic";
private _channelID = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], _channelName, "%UNIT_NAME", []];
if (_channelID == 0) exitWith {diag_log format ["Custom channel '%1' creation failed!", _channelName]};
missionNamespace setvariable ["airTrafficChannel",_channelID];
};
``` This is what I used in my init.sqf```sqf
_pilots = ["uns_men_VC_Mainforce_RTO","B_helipilot_F"];
_iampilot = ({typeOf player == _x} count _pilots) > 0;
if (_iampilot) then {
_airTrafficChannel = missionnamespace getvariable "airTrafficChannel";
_airTrafficChannel radioChannelAdd [player];
};
``` this is what I used in my OnPlayerRespawn.sqf not sure if these will both work with JIP but its what I was looking for, assigns channels via unit config names
word thank you
Is there a way to incorporate a delay into the code executed by an event handler?
Use spawn
@warm hedge Can you tell me exactly how do use it? I tried it before without the desired effect.
addEventHandler ["Something",{
_this spawn {
/*
Your code
*/
};
}];```This is enough
@warm hedge And how do I incorporate a delay?
Just sleep?
@warm hedge That didn't work...
@warm hedge sleep 30;
I'm not asking it; I'm asking the entire
My guys
I came back
With yet another inquiry
That boggles the mind
How doest thou make thine entity detectable on the mine detector yet its not a mine
Nah but really no shitpostery now, is there a script that makes an object detectable on the mine detector radar?
No
Well that's bad
I was planning on making a nice encounter about a bus full of people and from that bus theres a ping from the mine detector
And that would have led to the players doing some interrogation
Well what do i do when all passengers get out?
Delete the mine?
Passengers
And when the players go to check for mines?
The guy goes boom
Cause they got too close
Hmm
Arent AT mines really big and visible?
What do you mean by attach?
@warm hedge It works now. Thank you.
Does the reload command reload weapons instantly or similar to reloading on an ammo truck?
Anyone have a good way to make a SAR practice script (random aircraft crash)
been using the following lines after a fire eventHandler so that when a shot is fired it teleports to a predefined position, direction and rotation
_projectile setVectorUp [356.394, 341.78, 35.881];
_projectile setPos(getPos h1);
_projectile setDir(getDir h1);
but when I do the projectile does move to that positon but still uses the direction and vertical rotation of the turret I fire it with
am I doing something wrong?
tried with setVectorDirandUp but got the same result
you need to set its velocity
👆 Also setPos, setDir do overwrite your vectorUp, so setVectorUp or setVectorDirAndUp must be executed after, don't know if it does matter
oh right the velocity
let me see
used the rotation of h1 in the velocity parameters but now it seems to follow a slightly off velocity than intended
also no vertical rotation
you could try setVectorDirAndUp
this addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
_projectile setVelocity(velocity h1);
_projectile setPos(getPos h1);
_projectile setDir(getDir h1);
_projectile setVectorUp [356.394, 341.78, 35.881];
}];```
setPos overwrites your velocity
can anyone help me with the Loiter radios
tried both before and after velocity but now the bullet doesn't even appear
@vale urchin “Can anyone help me” without introducing your problem is really a bad idea, nobody could help you
ok returned to the no vertical rotation
airconvoy_task setTaskState "Succeeded";
airconvoy_big_task setTaskState "Succeeded";
using this i get the error "generic error in expression"
this is the syntax on the wiki - guessing its wrong?
What's airconvoy_task and airconvoy_big_task? I suppose these aren't tasks
they're the variable name for the tasks.
Just give me how did you define them
oh I think I misunderstood the concept of Dir and UP
i used modules
And?
i placed two task modules on the map. One is airconvoy_big_task, which is the parent task. The child task is airconvoy_task. airconvoy_big_task is visible at mission start, and airconvoy_task is available once player goes to the location airconvoy_big_task indicates
So, airconvoy_task and airconvoy_big_task are variable name of modules? That are Objects not Tasks
Ahh. I see said the blind man.
However I have also tried using "task ID". I suppose that is not the task either?
Hang on... I'm not kinda familiar with those modules
Could use this instead:
https://community.bistudio.com/wiki/BIS_fnc_taskSetState
i'll give it a try
@warm hedge That worked using taskID as a stand-in for taskName. Thank you.
I'm thinking we need to have a Arma3 wiki clean-up project
Writer for BIKI is always welcomed! #community_wiki 😄
Yeah, i will definitely be posting some things i've learned in the Notes, at minimum
Guys i am using this code in players init to spawn players in parachutes, but it spawns as many chutes for each player on map, do you know how can i solvde it :
chute = "Steerable_Parachute_F" createVehicle [0,0,0];
chute setPos [getPos this select 0, getPos this select 1, 200];
this moveIndriver chute;
I tried with variable name instead of this, but it didnt helped.
chute = "Steerable_Parachute_F" createVehicle [0,0,0];
chute setPos [getPos this select 0, getPos this select 1, 200];
this moveIndriver chute;
@obtuse crypt this is why you should not use init fields, as without proper and heavy controls they multiply by the number of units
are you familiar with scripting?
Not that much
try```sqf
{
private _parachute = "Steerable_Parachute_F" createVehicle [0,0,0];
private _pos = getPosATL _x;
_pos set [2, 200];
_parachute setPos _pos;
_x moveIndriver _parachute;
} forEach [ unit1, unit2, etc ];
Will do right now
@winter rose it works in sp, but not on dedi from some reason
Maybe if some of players wich variablename is listed is not spawning it breaks?
tried to use setWeaponReloadingTime on a turret but didn't work
this setWeaponReloadingTime [gunner (vehicle frank), currentMuzzle (gunner (vehicle frank)), 0.1];
@winter rose i have tried with init, it work but spawns para for each player, and from iniserver it does not work at all
Any idea what this means and how to fix it?
19:16:21 Server: Object 2:6233 not found (message Type_160)```
Found it in my server log.
struggling to get dead ai crew out of heli.
Scenario, ai crew flying huron with prisoner players in
Helo gets hit
atm setting damage 1 to ai crew
Heli crashes
cannot action eject, or setpos them out of the heli.
Heli not locked;
At the moment this isn't a locality issue as testing on my local machine in mp mode
If i don't kill them or mainly the driver heli then the gear comes down and lands normally, even if i set him unconscious
Wiki does mention that i should be able to setpos them out, but isnt working
Code is running setpos command is correct
Any ideas ?
Is there any particular reason you need to move them out? If they're dead either way it doesn't make much difference, right?
wrong i need to make their inventory available to the players (Escape mission)
Can you just add stuff to the inventory of the helicopter or on the ground nearby?
and if it blows up
If it blows up it will probably kill the players
nope the heli eventually blows up, it isnt very realistic to have a prisoner escort with weapons in the chiopper invenmtory, there are 2 pilots and 2 military police, these objects need to be pilfered to grab their gear
nope it wont they are sethit eh
The issue is getting dead ai out of a helo
The "chopper inventory" is an entirely abstract concept and it's perfectly legitimate to claim that it also represents the inventory of the dead crew.
I am looking for other ways of getting them out, but I am also looking for alternate ways to approach the problem in case it turns out to be easier.
i can work aroiund by deleting the crew and recreating them but thatas a bit of a hack
If you just need those bodies out and the subsequent status of the seat doesn't matter, you could try creating an invisible VR man and moving them into the seat. That should force out whoever's in there.
ah maybe that would work thanks
Is there a way of copying a string to a client clipboard?
On a dedicated MP server
Or basically make that string somehow available to copy it
@knotty mantle yes, see https://community.bistudio.com/wiki/copyToClipboard
Yeah i am currently looking through the fnc_buttonexport.sqf to see how it was done in ace arsenal.
But i am make very little progress on how to use it in a script
@knotty mantle what are you trying to do, make a url in the briefing ? or pass a url maybe ?
I put a string together containing all unit loadouts and want to export that to import it again next mission.
Is diag_log still restricted to 1044 characters? Cause that might not be enough with ~20 players