#arma3_scripting
1 messages · Page 553 of 1
i used to script for ragnarok back then, it was different, i could even use goto case "whatcase": wherever i want in the script. 😅
maybe different framework i guess
vomits
I don't blame the game though
does [] spawn { waitUntil {} }; run once or everytime the condition is met?
[] spawn {
waitUntil {
sleep 1;
(east countSide allUnits == 0);
};
["Task_001_01", "Succeeded"] call BIS_fnc_taskSetState;
would it run again if i spawn enemy and kill it after the spawn ran the first time?
ah good to know.
so it is better to check the task if i want to do multiple of these codes right?
[] spawn {
waitUntil {
sleep 1;
((["Task_001_01"] call BIS_fnc_taskState) == "ASSIGNED" && (east countSide allUnits == 0));
};
["Task_001_01", "Succeeded"] call BIS_fnc_taskSetState;
something like this
how can i check if all units in array is in vehicle type boat
findIf {vehicle _x GetTypeSomehow == "boat")
maybe simulation type from vehicle config
findIf {typeOf vehicle _x == "Boat"} forEach array```?
no
isKindOf maybe, probably not though
I guess simulation entry in vehicle config is most reliable
yes
ok
anyhow this should work ```sqf
findIf {typeOf vehicle _x == "O_Boat_Transport_01_F"} forEach array
hey guys.
Having some issues with the Hold Action function.
I´m trying to use the CBA function addClassEventHandler to attach a holdaction on every object that is a "Land_PaperBox_open_full_F"
But for some reason I cannot get it to work. Do you have any clues?
["Land_PaperBox_open_full_F", "initPost", {
params ["_object"];
[
_object,
"Tag Supplies",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3" ,
"_caller distance _target < 3",
{},
{},
{ hint "Supply box tagged";
deletevehicle _object; },
{},
[],
5,
10,
true,
false
] call BIS_fnc_holdActionAdd;
}, false, [], true] call CBA_fnc_addClassEventHandler;
have you tried adding diag_log or some kind of logging in the class eventhandler to make sure it runs?
The eventhandler is called InitPost not initPost
when i´m running it in the debug it returns true.
tried to change the initPost to InitPost but still no difference.
If I give a object the variable name "box" and then just paste the following code in the hold action works... seems to be something with the CBA function?
[
box,
"Tag Supplies",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3" ,
"_caller distance _target < 3",
{},
{},
{ hint "Supply box tagged";
deletevehicle box; },
{},
[],
5,
10,
true,
false
] call BIS_fnc_holdActionAdd;
no errors in RPT?
And you added logging and it worked?
tried logging the contents of _this inside the classEH?
If i define an array arr1= [1,2,3] and arr2 = arr1, if i now modify arr2 with deleteAt it modifies arr1
Is that how it is supposed to work?
yes
So = creates no copy but rather a link?
@still forum
this is what I have from the RPT.
Im not sure how the diag_log works gonna read about it now 🙂
That stuff says literally nothing relevant
I know 😦
you asked if I had any errors in the RPT. Maybe you could see something I couldn´t either way.I try to do some more testing
Ah that. yeah.
hey im struggling with something that really should be super simple, i need to create a bounty system for enemy kills. The method i currently use works perfectly in the editor, but as soon as i run it on the dedicated server it will not work.
initServer.sqf
#include "scripts\fnc_BountyPayout.sqf"
fnc_BountyPayout.sqf (Relevant portion)
fnc_BountyPayout = addMissionEventHandler ["EntityKilled",
{
_killed = _this select 0;
_killer = _this select 1;
_killedSide = (side group _killed);
_killedFaction = faction _killed;
if (_killedSide == resistance) then
{
if (isplayer _killer) then
{
[_killer, 500] call grad_moneymenu_fnc_addFunds;
"You received 500$" remoteExec ["hint",_killer];
};
};
_this select
use params.
fnc_BountyPayout = fnc_ prefix makes it look like it contains a function, while it doesn't.
Have you added logging to see what's going wrong?
no i havent tried logging, i did try several other methods of basically doing the same thing. I took this example from a reply on the VASS (Virtual arsenal store) forum page, original is here;
fnc_BountyPayout = addMissionEventHandler ["EntityKilled",
{
_killed = _this select 0;
_killer = _this select 1;
_killedSide = (side group _killed);
_killedFaction = faction _killed;
if (_killedSide == resistance) then
{
if (isplayer _killer) then
{
_money = _killer getVariable [TER_moneyVariable,0];// get the variable, if not defined use default (0)
_money = _money + 500;//add kill reward
_killer setVariable [TER_moneyVariable, _money];
};
};
if (_killedSide == east) then
{
if (isplayer _killer) then
{
_money = _killer getVariable [TER_moneyVariable,0];// get the variable, if not defined use default (0)
_money = _money + 500;//add kill reward
_killer setVariable [TER_moneyVariable, _money];
};
};
if (_killedSide == civilian) then
{
if (isplayer _killer) then
{
0 = [_killer] execVM "scripts\fnc_CivilianKilledPenalty.sqf";
};
};
// Player death
if (_killedSide == west) then
{
if (isplayer _killed) then
{
};
};
}];
why tap around in the dark for hours/days. instead of simply adding logging and seeing what goes wrong where
logging would have told you that if you logged the arguments
i will, in the future 😛
In the carpet bombing module I wrote for Sabre's secret weapons and Unsung one must specify the weapon that is used for the carpet bombing, e.g. Uns_Mk83Launcher_dl for the A-6 in Unsung. Ideally I would like to make this more user friendly and offer users a selection of light/heavy/napalm/CBU or whatever bombs instead of having them dig in the config viewer for a long time to get the weapon name. Any ideas how to add this? Maybe a key->value map in the _logic of the module? Any suggestions how to auto generate such lists?
Your honor, i may have shot the man. But really, he killed himself. <- ACE attorney
killed: reb_564, _killer: reb_564, _instigator: <NULL-object>
Any suggestions how to auto generate such lists?
Maybe just add a "isCarpetBombLauncher" entry to supported weapons configs?
and then iterate over the weapons config and add them to some list, nice idea, thanks
Or just make a new root level config class that contains the name of supported weapons
Like
class SupportedCarpeteers {
Uns_Mk83Launcher_dl = 1;
blablub = 1;
...
}
for posteritys sake, i used ace_medical_lastDamageSource to get _killer's real identity.
_killer = _killed getVariable ["ace_medical_lastDamageSource", objNull];
It now works
I'd say: no
"InBaseMoves_table1" can someone tell if its somehow possible to smoothly change from this animation to default stand animation? (without weapon - without that cross animation when unit move his weapon on his back).
is possible to get magazine ammo from magazines in container?
You should be able to do it with: https://community.bistudio.com/wiki/magazinesAmmoCargo
@finite dirge thank you a lot!
No problem! Good luck with your script.
anyone use the calculate path command? Seems to be outputting an interesting Z co-ord: [14012.3,17348,17348] Tried various conversions to no avail.
deleteAt 2 seems to delete both Y and Z co-ords to which again, strikes me as odd
What is more weird, Y and Z are the same
Fixed: The PathCalculated Event Handler would fill each path node with [X, Z, Z] instead of [X, Z, Y]
Does he mean 'instead of [X, Y, Z]` ?
depends actually 😅
I think internally it's XZY (such as Y being the altitude axis) whereas in SQF it's XYZ where Z is the altitude
Yes z is y internally
is there a way to detect when a mortar shell hits the ground (and where) ?
or artillery shell, etc
or just any bomb
i just want to know where the ammo explodes
usually where it lands, but not always!
sure, but it would be great if the game could tell me in detail
i'm thinking of a fired event handler in combination with find nearest, but this seems awful complicated
fired can give you the fired ammo though
but what do i do with that. detect when it explodes?
wasnt there some ammo explosion trigger something something
maybe i just have to check if it i alive
let's test
an alive check should work, you could also check the position of the bullet to see when its z axis is less than 0.5 or so above terrain level
Add on each frame and monitor pos until it is null, last not null position will be close enough
Which command do I use to add an item defined in cfgVehicles to the cargo space of a vehicle?
For instance, "Item_FirstAidKit"
addItemCargo ?
Unfortunately, no, or am I looking at the wrong class name
Yeah indeed, it should be "FirstAidKit", not "Item_FirstAidKit"
to add an item defined in cfgVehicles to the cargo space of a vehicle?
Items are not defined in CfgVehicles
Items are CfgWeapons
CfgVehicles entries are just prefilled dummy WeaponHolders
Ahh ok, makes sense
@tough abyss That post, if im reading it right, its revision 145765, im running 145977, or is this the diff between stable and dev branch?
yes there is diff between stable and dev
but bigger build number "usually" means you have that
right ok, for now at the advice of someone else im just using set to change the 3rd element to 0. Seems to work fine, cheers guys
@plain raven sometimes things from dev don’t get merged to stable. The bug is fixed in the next stable
Use dev for now
Can some one tell me where i went wrong please? i am about to explode.
init
if (isServer) then {
sleep 1;
["002"] execVM call HKB_fnc_multiSpawnCall;
};
fn_multiSpawnCall.sqf
params ["_mscIDs"];
switch (_mscIDs) do {
case "001": {
[East,[2039.222, 7379.76, 0],"O_T_Soldier_F",5,[1948.333, 7369.368, 0],[1833.130, 7339.478, 0],[1703.357, 7324.028, 0]] call HKB_fnc_task001SG;
[East,[1909.678, 7372.375, 0],"O_T_Soldier_F",2,[1909.678, 7372.375, 0],[1834.790, 7424.806, 0],[1762.071, 7472.087, 0]] call HKB_fnc_task001SG;
};
case "002"; {
[East,[2958.123, 7118.643, 0],"O_T_Soldier_F",5,[2958.123, 7118.643, 0],[3058.665, 7157.612, 0],[2938.392, 7234.15, 0]] call HKB_fnc_task001SG;
[East,[3728.521, 7609.846, 0],"O_T_Soldier_F",5,[3728.521, 7609.846, 0],[3643.559, 7592.115, 0],[3566.231, 7569.459, 0]] call HKB_fnc_task001SG;
_newGroup = CreateGroup civilian;
PERISIK2 = _newGroup createUnit ["C_man_polo_4_F", [3616.062, 7562.843, 3.415], [], 1, "CAN_COLLIDE"];
sleep 0.05;
PERISIK2 setPosASL [3616.062, 7562.843, 3.415];
PERISIK2 setUnitPos "UP";
PERISIK2 disableAI "MOVE";
PERISIK2 setDir 72;
};
};
i got an error saying _mscIDs undefnied variable in expression. It went well for case "001". when it is time for case "002", the error shows up
when using execVM before converting multiSpawnCall.sqf to a function, it does not work but does not even shows any error
execVM call?
execVM call syntax error
@grave stratus use the -showScriptErrors flag in the launcher please
flag.
Tick a "show script errors" box
@winter rose what does it do? i dont see any different apart from the usual script error box
So maybe you had it already somehow. It shows script errors
Eden has force enabled
execVM call "description.ext"
oh
btw, i fixed the command to ["002"] call HKB_fnc_multiSpawnCall;, still doesnt spawn enemy unit like it supposed to. case 001 is fine.
Hello does anyone here have a bit of time to spare with a simple bomb arming and bomb defusing script?
I used the the script from this page as baseline for my script:
https://steamcommunity.com/app/107410/discussions/18/135512133545421115/
But when used on my scenario, the bomb will still go off when I have activated the addAction. Any possible fix?
not gonna work, private vars are used across different scopes
so i cant use params then?
@bold bane this faulty code really cannot work, don't use it.
i thought private vars only for innermost scope?
@bold bane
private _bombTimer = 3 * 60; // 3 minutes
bombObject setVariable ["defused", false, true];
bombObject addAction ["Defuse me", {
params ["_bomb"];
_bomb setVariable ["defused", true, true];
hint "bomb defused";
}];
[] spawn {
while {sleep 1 ; not (bombObject getVariable "defused") } do
{
_bombTimer = _bombTimer - 1;
if (_bombTimer <= 0) exitWith {
for "_i" from 1 to 4 do { // change number for more booms
"R_60mm_HE" createVehicle position bombObject;
};
};
};
};```
@grave stratus addAction code is a separated scope
but im not using addAction
not gonna work, private vars are used across different scopes
was aimed at Ustio
…I @'d him
FACEPALM (╯°□°)╯︵ ┻━┻
hah
Wow @winter rose thanks a bunch
@grave stratus @grave stratus @grave stratus
show your code again?
( @finite dirge )
execVM compileFinal call spawn ITGH_fnc_winGame;
I like execVM compileFinal call spawn "description.ext" more
True.
Gotta put my function in there. That's truely how ARMA wants it. Works 100% of the time everytime.
it works all the time 60% of the time*
[ WEST, "Task002_01", ["Perisik Leftenan Akram di Bandar Komarovo.", "Cari Perisik.", "Cari Perisik"], [3637.699,7591.825,0], TRUE ] call BIS_fnc_taskCreate;
if (isServer) then {
sleep 1;
["002"] call HKB_fnc_multiSpawnCall;
};
fn_multispawnCall.sqf
params ["_mscIDs"];
switch (_mscIDs) do {
case "001": {
[East,[2039.222, 7379.76, 0],"O_T_Soldier_F",5,[1948.333, 7369.368, 0],[1833.130, 7339.478, 0],[1703.357, 7324.028, 0]] call HKB_fnc_task001SG;
[East,[1909.678, 7372.375, 0],"O_T_Soldier_F",2,[1909.678, 7372.375, 0],[1834.790, 7424.806, 0],[1762.071, 7472.087, 0]] call HKB_fnc_task001SG;
};
case "002"; {
sleep 1;
[East,[2958.123, 7118.643, 0],"O_T_Soldier_F",5,[2958.123, 7118.643, 0],[3058.665, 7157.612, 0],[2938.392, 7234.15, 0]] call HKB_fnc_task002SG;
[East,[3728.521, 7609.846, 0],"O_T_Soldier_F",5,[3728.521, 7609.846, 0],[3643.559, 7592.115, 0],[3566.231, 7569.459, 0]] call HKB_fnc_task001SG;
};
};
fn_task002SG.sqf
https://pastebin.com/w7h6Bk24
it does create the task but it doesnt spawn
before that happens, spawn in case "001" was working fine
while {_looper < _manCount} do {
might be an issue, idk? where does the code run, where does the code stop
the code stop after spawning
init.sqf
["001"] call HKB_fnc_tasker;
fn_tasker.sqf
params ["_taskIDs"];
switch (_taskIDs) do {
//Task001
case "001": {
[] execVM "Semboyan\Task\001.sqf";
};
//Task002
case "002": {
[] execVM "Semboyan\Task\002.sqf";
};
};
001.sqf - https://pastebin.com/h3gkVvgw
at the end of 001.sqf, it call for ["002"] call HKB_fnc_tasker;
that is where it start
identify the blocking point and tell us
it is after ["002"] call HKB_fnc_tasker;
where it supposed to create task, which is working,
then call for the spawn
which is not happening, but no error shown
002.sqf
[ WEST, "Task002_01", ["Perisik Leftenan Akram di Bandar Komarovo.", "Cari Perisik.", "Cari Perisik"], [3637.699,7591.825,0], TRUE ] call BIS_fnc_taskCreate;
if (isServer) then {
sleep 1;
["002"] call HKB_fnc_multiSpawnCall;
};
001.sqf, "002", "_mscIDs", HKB_fnc_task001SG…
that's a great way to organise your code… NOT
it's hard to tell what does what where
(btw)
so:
["001"] call HKB_fnc_tasker;
→
[] execVM "Semboyan\Task\001.sqf";
→
(…)
yeah no I don't debug that sorry.
place diag_log or systemChat to see where it stops or gets stuck in an eternal loop, and tell us here the precise point that blocks exec
okay
(for further reference: https://community.bistudio.com/wiki/Debugging_Techniques)
so it stop between 002.sqf ->
[ WEST, "Task002_01", ["Perisik Leftenan Akram di Bandar Komarovo.", "Cari Perisik.", "Cari Perisik"], [3637.699,7591.825,0], TRUE ] call BIS_fnc_taskCreate;
if (isServer) then {
sleep 1;
systemChat "msccallreturn";
["002"] call HKB_fnc_multiSpawnCall;
systemChat "msccallreturn2";
};
and fn_multiSpawnCall.sqf
params ["_mscIDs"];
switch (_mscIDs) do {
case "001": {
[East,[2039.222, 7379.76, 0],"O_T_Soldier_F",5,[1948.333, 7369.368, 0],[1833.130, 7339.478, 0],[1703.357, 7324.028, 0]] call HKB_fnc_task001SG;
};
case "002"; {
systemChat "mscreturn";
[East,[2958.123, 7118.643, 0],"O_T_Soldier_F",5,[2958.123, 7118.643, 0],[3058.665, 7157.612, 0],[2938.392, 7234.15, 0]] call HKB_fnc_task001SG;
[East,[3728.521, 7609.846, 0],"O_T_Soldier_F",5,[3728.521, 7609.846, 0],[3643.559, 7592.115, 0],[3566.231, 7569.459, 0]] call HKB_fnc_task001SG;
};
};
where systemChat "mscreturn"; doesnt goes off
systemChat "msccallreturn1" & "msccallreturn2" in 002.sqf is working fine.
*ding ding ding* we have a winner!
Not sure how long that's been there unnoticed, I just kinda scrolled to the bottom. lol
stop for a while before diving back in
yeah i guess i'll take a break tomorrow
also, staying on one problem for too long is not efficient; if you block for ½h, just switch to something else then come back to it
benefits: fresher head, reduced stress, new eyes on the issue
well actually i planned to take a break after this code is done, didnt know its going to take me a whole day just to solve this.
anyway thanks @winter rose and @ruby breach
awesome
Is it possible that you can take an empty magazine out of your weapon and store it in your inventory ? Because when i take an empty magazine out of my weapon and put it in my inv it instantly gets removed, but if i put it on to the ground first and then pick it up it remains in my inv. Just wanted to ask if thats a bug or intention
Intentional, you can mod it so empty mags don’t disappear
i think you get me wrong, they don't disappear, even though they should
but only if you put the empty mag on to the ground
if you put it in your inv it disapperas as it is supposed to
You asked is it possible to make empty mags not disappear when you put them in inventory, the answer is yes, you can make a mod
@ruby breach is a very epic gamer and helps the people a ton
My question refers to magazines not being removed when they should to, sorry if i expressed myself a little unclear there
i just want to know if it's feature that you can drop empty magazines on the ground, without them being deleted
because if you put them directly in your clothing they do get deleted
Does anyone have a good script for detecting when another player does not kill but only "INCAPACITATED" another player? i cant find a reliable one on the webs.
if i set a variable to a civ, if it die, would it delete the variable as well?
by default yes
as in; a dead unit still contains the variable, but the moment it respawns or gets picked up by the garbage collector you lose the unit and therefor the variable connected to it
so if it's mission specific, I would connect set a variable to the missionNamespace instead.
eg.
missionNamespace setVariable ["some_variable_UNITNAME","some_value"];
@exotic flax ah i want to lose the variable, i am just wondering if i have to delete it manually after the unit get picked up by the garbage collector
if you run deleteVehicle on a unit then the unit variable will return <NULL-Object>
to test you could check if variable is nil by running
if (isnil {missionNameSpace getvariable "YOURVARIABLE"}) then {systemChat "nil man";} else {systemChat "not nil";};
i havnt looked in garbage collector hence that test would be best as after using deleteVehicle YOURVARIABLE; the variable wont be nil and you can make it nil by using YOURVARIABLE = nil;
to test you could check if variable is nil by running
nil != null
Hi all, I'm trying to create some ambient wildlife but when the animals spawn they don't move, the server executes this, and number and origin are both defined. The animals spawn fine, but then they don't move, does anyone know why?
params [
["_number",1,[0]],
["_origin",[],[[]]]
];
private _animals = ["Sheep_random_F","Goat_random_F","Hen_random_F","Cock_random_F","Rabbit_F"];
for "_i" from 0 to _number do {
private _type = selectRandom _animals;
private _position = _origin getPos [250 * sqrt random 1, random 360];
private _animal = createAgent [_type,_position,[],0,"NONE"];
_animal setDir (random 360);
};
well you don't ever tell them to move
Arma has a animal FSM I think. Or maybe SQF
that needs to run on the animal
https://community.bistudio.com/wiki/createAgent
When looking at this, namely the note, it suggests that I have to disable the animalBehaviour, so I'd assume it works automatiically?
Confusingly, if I execute that code in debug using server exec, the animals spawn and start moving 🤔
Well, I delay the spawning by 30 seconds and now they move 🤔
Ah, yes, some delay may be required for agents, I met that once
is it possible to denote a string without 'apostrophes' or "quotes"?
in code you mean?
yes
…why
Yes
i am trying to send out srtings from a diary record link
{string} 😄
the expression is already in quotes and apostropes
tried that {string}
didnt seem to work
Yeah was semi joke-ish.
Parser handles "'{ as strings
Maybe a preprocessor define
can you send example script of how it would look?
1 sec
You can double the quotes @waxen tendon
""string""?
private _myString = "this is a ""quoted"" string";```
player createDiaryRecord ["Important Subject", ["Open this tab", "<execute expression = '[{string}] call fnc_doStuff'>Click here!</expression>"]]```
@still forum
""
ill try
error type any, expected string
nvm works, thank you @winter rose @still forum
@brittle burrow do you know how to spawn normal units?
re-reading your request, what do you want to do?
make a mod spawn units, or spawn mod units?
spawn mod units
then spawn them the same way as normal units, but with their class name
how to ad their name to the spawner
Copy/Paste to the class list
do you have the mod installed
if so, then they are in the right-side unit list somewhere (you can filter by mod)
i can see it
but not in the attribute of the spawner
now how do i make it spawn that unit
Well maybe if you twiddle that other stuff it will work
. . . 👍
i am trying to make a civi ai do a animationg to treat wounds. so i put this in the init of the unit this playMove "Acts_TreatingWounded02"; is playMove the wrong command? nothing is happening
try switchMove
playMove cannot play animations that do not have a "transition path" from the current unit animation.
"Acts_" means Cutscene, and most of the time these anims don't have a transition from "normal state" to them
tried that too, same result
yes
stuff in init is run on every connecting client; so ideally don't
if you only know that, use some isServer
if (isServer) then {
this spawn {
sleep 0.1;
_this switchMove "Acts_TreatingWounded02";
};
};```
im not going to put it in a script but just to test the animation, i put it in the unit box
Anyone happen to know if there is a way to check if a unit has a forced speed? Trying to check if a unit is garrisoned by Achilles.
a getForcedSpeed doesn't exist afaik
yep or at least its not in the biki
and i would rather not have to make a custom version of the garrison module if i can avoid it.
is there actually a command that isnt documented?
well, none as far as I know ¯_(ツ)_/¯
lol, yeah my problem atm is that when transferred to HC the forcespeed seems to reset
which makes our zeuses unhappy
even limitSpeed doesn't have a getter
you can still set/getVariable, eventually
yeah, thats likely going to be the workaround, make a new garrison module and add a variable to the group that gets checked when it transfers
was just wondering if there was any other way.
though i have no idea why forcespeed gets reset when transferred unless its only enforced on the zeus's end since they are the ones processing
yep, dunno
rip simplicity
Why the usage of forceSpeed btw? @potent depot
@winter rose i've tried both in the init box and script, both playMove and switchMove, does not do anything.
_newGroup = CreateGroup civilian;
_newciv = _newGroup createUnit [C_Man_Fisherman_01_F, [3641.039, 7534.907, 0.631], [], 1, "CAN_COLLIDE"];
_newciv setPosATL _spawnPos;
_newciv setDir _dir;
//_newciv setUnitPos _states;
_newciv switchMove "Acts_TreatingWounded02";
Achilles garrison uses force speed when it garrisons the units to keep them from moving
It’s a mod that expands the Zeus toolbox
You could force the transfer first, then garrison?
Is there a way to get the servers actual real Date? not in game date
Hi everyone
Is there any way to read the whole config file from the ingame by the script? Or at least a certain sub-class. And write it somewhere, to the clipboard, rpt file or else
@exotic tinsel There's an extension for that: http://killzonekid.com/arma-extension-real_date-dll-v3-0/
By default, no.
I'm looking for some special subclasses in the Livonian config, but it can't be opened directly because of ebo format
3Den's config viewer shows these parameters separately, this is not so convenient
{configfile >> "CfgWorlds" >> "Enoch"} returns just a config.bin name
@finite dirge thanks
@potent depot there are plenty of commands that have not been documented https://community.bistudio.com/wiki/All_Arma_Commands_Pages all red commands don’t have pages and this list is pretty old too
i'm trying with script - take weapon from car with accessories
but i when i'm trying to take weaponsItems (objectParentPlayer) - i'm getting only ```
[["CarHorn","","","",[],[],""]]
when i see to car inventory - weapon have accessories
ah, i find the reason xD
@dusky pier objectParentPlayer returns the object the player is attached to so in this case a car. it doesnt get accessories to a weapon.
also objectParentPlayer isnt a thing your looking for objectParent Player
https://community.bistudio.com/wiki/objectParent
i have tryed and is working for now
@exotic tinsel ty, i understand that. My unit seat in vehicle, script is take weapon from vehicle gear
So, if you wanted a bunch of random dead bodies, what would you guys use? I find that setDamage 1 puts all the bodies in the exact same pose, no matter how I use it
@grave stratus _newciv playMove "AinvPknlMstpSlayWrflDnon_medic";
hey all if i want to get player currentWeapons (in vehicle) and how much ammo it has remaining how can i get that data?
i want to make an alternative hud
@frozen knoll oh it doesnt playMove properly because of the move is for cutscene?
the above animation works
Is it possible to hide all player and ai postions on map via script? I dont want to modify the profile.
@frozen knoll thanks it works. now i wonder how to loop the animation until a certain condition is met
is it possible to forEach for get commands and write all answers to an array?
eg.sqf {_x call fnc_isCaptured} forEach arrayZones
fnc_isCaptured would return true or false
thanks
what are the benefits/use cases for https://community.bistudio.com/wiki/customChat ?
it seems to display the source units name vs the other variants, but otherwise?
it's more about radioChannelCreate, which can be useful if you want to have more different channels (eg. "AirChat", "BaseChat", "SupportChat", etc.)
similar to ACRE/TFAR where people use different channels/frequencies for specific purposes
customChat allows to custom add units you want to see the same chat where as other chats have specific groups hardcoded
i see. one has to transmit the chat message manually, unless its predefined text, right?
in more general terms looking for ways to separate player chat from system messages (MP)
the only way i know to do this is to intercept the chat input, transmit that manually over net and display it again - however the different channels, desc.ext options etc make this fairly complex
Custom chat is just like systemchat, but will only be shown to added units. And you need remote executing it globally. Might as well use remote exec with specific targets and systemchat to save headache of setting up custom chat
but if you use radioChannelCreate all units who have access to it can also use it to chat over this channel
with systemChat one would need to make the sender name part of the chat message, right?
yes, because it's not send by a unit
with custom chat channels one could determine how sees it, but isnt it more simple just to pV to the needed clients or handle the receiving logic locally?
Custom channels works just like GroupChat, all units connected to this channel can send/receive over it.
well you need to adjust channel participants, so you can handle it by other means locally/on each receiver, no?
In theory yes, but you are limited by the amount of custom channels you can add.
so depending on what you try to achieve you most likely need SystemChat or a custom Hint system
well as said to decouple the chat display from system messages
the only other alternative i can see would need the ability to intercept incoming chat message/manipulate the chat display control
(which would need some engine change/sqf cmd)
Is there a way to denote a square area, and everyone inside it?
Like, create a square area and then do like nearestobjects it somehow to get only things inside it
how do i return answer from a function
the last value left on the stack is the return value
yes
although I also noticed the following:
fnc_test = {
if (true) then {
"good"
};
"bad"
};
Will always return "bad"
so if you need a default, use a return variable:
fnc_test = {
_return = "bad";
if (true) then {
_return = "good";
};
_return
};
Obviously that will return "bad"
It's the last statement
You can either use exitWith or else
exitWith exits the current scope. A scope is equivalent to a code block enclosed in curly braces.
Does anyone know how to disable an aircraft's targeting pod?
the only commands I find are
hasPilotCamera, getPilotCameraPosition, getPilotCameraDirection, getPilotCameraRotation, getPilotCameraTarget, setPilotCameraDirection, setPilotCameraRotation, setPilotCameraTarget
IDK if one can disable it (maybe breaking it with setHitPointDamage!)
@leaden venture try to find a hitpoint with getAllHitPointsDamage and damage the pod fully
Yeah I'd really like to remove that thing
so if you need a default, use a return variable:
exitWith
@still forum
is there a debug console script to restore my rocket launcher ammo?
i tried in the mission editor but I click "Triggers" and no box opens with trigger lists.
disableChannels channels stilled bugged? aka is this https://discordapp.com/channels/105462288051380224/105462984087728128/411593729674313728 workaround still needed?
dont quite get https://community.bistudio.com/wiki/enableChannel even after reading the page and multiple discussions here - does it only not display text/transmit voice for the given channel?
im using
disableChannels[] = {{0, false, true},{2, true, true }};
works perfectly
what tool do you use to build the mission/pbo?
according to https://discordapp.com/channels/105462288051380224/105462984087728128/411583258493714432 and FF false/true is wrong - must be be 0/1
yep with defines its fine
and as u asked "what tool do you use to build the mission/pbo?" definitely depends on that as some you dont need to define some you do
@velvet merlin
any idea why It isnt working?
i hit
Local execute on a single player mission and it isn't restoring my ammo.
have you checked the wiki for the commands you use @strange elk ?
… except the proper, working code 😄
i was told to put the gun in ""
tried that also
never changed the ammo count
i literally copied the line from the wiki
(also, "you're done for")
Yeah well, launchers are a bit different
Their "magazine" is 1-bullet, and gets discarded as soon as it is fired so you can't set its ammo (no more mag)
You can add a magazine to the player though (maybe to the weapon itself, I am not too sure about that)
👍
which code did you use in the end?
add magazine
noice. to the weapon itself? I can't remember if one can directly insert a magazine into a weapon by script (or if you still have to remove/readd weapon)
any idea why It isnt working?
Syntax error
hey i'm new to scripting, i'm trying to create a trigger that forces players into first person while they're in the zone, would anyone be able to help or point me in the direction of some good learning material? seems very hard to find
Add player switchCamera "INTERNAL" into on activation but it will do it once and player would be able to switch back
can one disable chat displayed on clients fully with enableChannel or setCurrentChannel? i am seeing different statements on this in discord here, BIKI and BIF
like with
addMissionEventHandler [
'EachFrame',
{
if ((getPlayerChannel player) in [0,1]) then {
setCurrentChannel 5;
};
if (currentChannel in [0,1]) then {
if (!isNull (findDisplay 55)) then {
setCurrentChannel 5;
};
};
}
];```
or
```sqf
while{true} do {
waitUntil{getPlayerChannel player < 3 && getPlayerChannel player > -1};
setCurrentChannel 5;
};```
@velvet merlin don't https://community.bistudio.com/wiki/Description.ext#disableChannels or https://community.bistudio.com/wiki/enableChannel work? they… should?
oh, didn't know this issue on disconnection/reco
put some enableChannel in the init.sqf then? that's how I would do it
some people say it cant block global and sideChat/groupChat
Any way/script to see which pbo an asset is loaded from?
I dont think so
you can get model info https://community.bistudio.com/wiki/getModelInfo
but pbo names dont mean anything to the engine
You can hide chat with showChat @velvet merlin
reading different things about it again when searching BIKI, BIF and discord 😬
does it hide only player chat messages? what about admin (logged/voted)?
system messages (MP or BE) are still shown right?
what about AI radio messages?
Probably everything
What would be the best workaround for disabling the map marker on the side chat? I haven’t read all messages but if enableChannel has bugs what I should do?
is there a simple way to convert a string to structured text and change special characters like & to the appropriate &
apart from doing a replace loop
Convert special chars no, convert string yes, just use text
yeah more need the special char aspect 😦 just looking to sanitize briefingname output
I don’t think text takes any notice of special chars
I tried it and it just made the string cut off at the first &
Hi guys! Any ideas on how to make AI unit to run and shoot simultaneously? I now can make them run (through Zeus waypoint placement) and then shoot or vice versa (depends on when I apply while loop - before or after waypoint movement).
but that might have been parsetext
And other text commands?
(like it was going through parsetext after it)
Yeah parsetext would do that
where you execute?
"in game" yeah.. all scripts run ingame
where, how?
debug console?
tried adding logging to make sure its really running?
like drop a chat message or so (not sure if they show up in SP)
@still forum i ran it in the debug console
but a YT video showed it placed in init box via editor
console should work just fine
lemee see if it worked
@still forum Hey one other question
what key did I press as my character is locked looking one direction and I cant turn him in any other direction.
Double Alt?
hmm?
i believe so
@tough abyss it was the issue?
how can I disable that keybind?
Like any key bind in options controls
found it.
Try it and don’t ask million questions
does anyone know of a command that can find the parent display of a control? Similar to displayParent but for controls and not displays?
At least I think so!
There is also one which returns the parent group control https://community.bistudio.com/wiki/ctrlParentControlsGroup
question: can you play character animations on dead bodies?
no
Sure you can
so which one of these answers is true
thanks @astral dawn that is exactly what I needed
so now i have another question, I have a control group in a UI that I want to be forced to scroll back to the top of its height. How would I go about doing that?
hello~I typed the script file in and init.sqf
I want to use Pierre MGI. But what should I enter variables for an object?
@jolly wolf create the script called MGI_HALO.sqf create it inside your mission name.nameofthemap and then just put this in init file of the objects _halo_jump =[500,100,this] execVM "MGI_HALO.sqf";
got an error with my vehicle init Eventhandler script (defined in config) I want to hide/unide some stuff based on config settings. This worked since many months. Now i added some new option to it and i get error
Error in expression <_this animate ["hide_conf_EA_front", 0];,
_this animate ["hide_conf_EA_front_ha>
Error position: <,
_this animate ["hide_conf_EA_front_ha>
Error Invalid number in expression```
ah nvm, i put comma after the semicolon 😄
weird how you can look for the error for minutes going back and forth... think you hit a wall. The moment you post it somewhere you see the error...
Coined as rubber duck debugging
Hi, anyone can tell how i can do to disable damage in water?
for what?
you can't kill water in Arma 😄
No just want to prevent or disable drowning.
scuba gear is for that
😂
Im not sure if you can even do what you want
"set oxygen remaining", you can
but a loop has to be done
Thanks i'm checking this right now.
player addEventHandler ["SoundPlayed",
{
params ["_unit", "_soundID"];
if (_soundID == 8) then { _unit setOxygenRemaining 1 };
}];
@tough abyss will increase oxygen every time player is about to choke
rokuninYesterday at 5:30 PM
Hi guys! Any ideas on how to make AI unit to run and shoot simultaneously? I now can make them run (through Zeus waypoint placement) and then shoot or vice versa (depends on when I apply while loop - before or after waypoint movement).
Anyone? 🙂
0 = this spawn {for "_i" from 1 to 100 do {[_this, currentmuzzle _this] call BIS_fnc_fire; sleep 0.1}}; this playmove "amovpercmtacsraswrfldf"; this playmove "amovpercmtacsraswrfldf";this playmove "amovpercmtacsraswrfldf"; this playmove "amovpercmtacsraswrfldf"; this playmove "amovpercmtacsraswrfldf";
try this
hi i just wonder about does https://community.bistudio.com/wiki/findEmptyPosition actually work with building object
when I spawn tank, It's stuck inside of building
@tough abyss that actually did work wonderfully, thank you sir!
@lapis viper no it does not cope with objects very well.
@young current very well. Thank you for information!
I mean as far as I know, it's purpose is to find a objectless space.
_animate = true;
_newGroup = CreateGroup civilian;
_newciv = _newGroup createUnit ["C_Man_1", [9423.552, 9228.516, 0.502], [], 1, "NONE"];
_newciv setPosATL [9423.552, 9228.516, 0.502];
_newciv setDir 126;
_newciv setUnitPos "UP";
_newciv disableAI "MOVE";
if (_animate) then {
while {true} do {
_newciv switchMove "AinvPknlMstpSlayWrflDnon_medic";
waitUntil {animationState _newciv != "AinvPknlMstpSlayWrflDnon_medic"};
};
};
any one know how to properly loop an animation? i googled a few solution (this and using EH) but both of them seems not looping it properly.
isn't there some playMove command which adds the animation into the queue?
playMove adds them to a queue (so will only execute when the previous animation is done)
playMoveNow will execute directly and replaces the queue
both playMove and switchMove does not execute the loop properly, only execute it once
Is there any event handler, or recommendation way of knowing if it's raining or not?
nextWeatherChange and then checking rain when it changes could work.
Not sure on an EVH.
There is no event handler
Thanks for the confirmation!
addRainEventHandler ["BloodyRaining", {}];
player addEventHandler ["isWet", {
params ["_unit", "_wetness"];
}];
^ The true EVH we need 
I'm trying to get use the civilian presence module to spawn civilians from unsung, but for some reason identities aren't working _this setUnitLoadout (selectRandom [ (getUnitLoadout "uns_civilian1"), (getUnitLoadout "uns_civilian2"), (getUnitLoadout "uns_civilian3"), (getUnitLoadout "uns_civilian4"), (getUnitLoadout "uns_civilian1_b1"), (getUnitLoadout "uns_civilian1_b2"), (getUnitLoadout "uns_civilian2_b1"), (getUnitLoadout "uns_civilian2_b2"), (getUnitLoadout "uns_civilian3_b1"), (getUnitLoadout "uns_civilian3_b1"), (getUnitLoadout "uns_civilian3_b2"), (getUnitLoadout "uns_civilian4_b1"), (getUnitLoadout "uns_civilian4_b2")]); [_this, selectRandom ["AsianHead_A3_01","AsianHead_A3_02","AsianHead_A3_03","AsianHead_A3_04","AsianHead_A3_05","AsianHead_A3_06"]] remoteExec ["setIdentity", 0, _this];
their loadouts spawn fine
why do you need to get all loadouts and then select one if you can select unit and THEN get loadout for it
As for Identity, a head name is not identity, identity is a class for example
class SomeGuy
{
face = "WhiteHead_10";
glasses = "G_Tactical_Clear";
name = "Adams";
nameSound = "Adams";
pitch = 1.0;
speaker = "Male01ENG";
};
you want setFace
ah that'd probably be why
i was just copying the wiki pretty much
didnt realise it wasn't head names
probably
How to make a entry to my missions file to escape the "no entry" errors?
Where are those coming from? Some mod?
yes, is just anoying
You'd need to fix the configs in that mod.
You may be able to create your own mod and override the config, but otherwise, no.
Hey, I'm having an issue in a script where it isn't grabbing the list box that I want it to. The script is acting as if the list box doesn't exist.
_listBoxIDC = 1500; // IDC of our list box
_index = lbCurSel _listBoxIDC;
systemChat format ["index = %1", _index];
_vehClass = lbData [ _listBoxIDC, _index ]; // retrieve the data (previously set) from the listbox's currently selected index
if (_index == -1) exitWith {hint "No vehicle selected to buy"}; // Make sure the player selected a box
// Attempt to buy the vehicle //////////////////
closeDialog 0; // This was lowercase before 'action = "closedialog 0; nul = [vehSDKBike] spawn A3A_fnc_addFIAveh";'
systemChat format ["Veh Class: %1 | index = %2", _vehClass, _index];
[_vehClass] spawn A3A_fnc_addFIAveh;
whereas I have another file that populated the list and I can read the data from the list just fine.
The script above only returns -1 for index
Do I need to reference this script in a header file?
-1 means nothing is selected
try alternative syntax of lbCurSel maybe
also make sure that control really exists (finddisplay ... displayCtrl 1500)
I tried the alternate control earlier - will try to see if it exists
yes just diag_log the control
it will return something meaningfull or controlNull if it couldn't find it
will this work? I'm fairly new to the arma language.
_control = findDisplay displayCtrl 1500;
systemChat format ["control: %1", _contorl];
Check parameters... no it's wrong, findDisplay gets a display IDD
where are you creating your control? it should belong to some display
yes it has an idd of 9999
Then
_ctrl = (findDisplay 9999) displayCtrl 1500;
this is in my header
class BUY_Menu{
idd = 9999;
movingEnabled = false;
class controls{
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT START (by theav, v1.063, #Lemiqy)
// Shift + CTRL + S for export ***********************
////////////////////////////////////////////////////////
// was IGUIBack
class BUY_Background: BOX
{
idc = 2200;
x = 0.29375 * safezoneW + safezoneX;
y = 0.225 * safezoneH + safezoneY;
w = 0.4125 * safezoneW;
h = 0.55 * safezoneH;
};
class BUY_List: RscListbox
{
idc = 1500;
x = 0.304062 * safezoneW + safezoneX;
y = 0.335 * safezoneH + safezoneY;
w = 0.391875 * safezoneW;
h = 0.33 * safezoneH;
};
class BUY_BuyBtn: RscButton
{
idc = 1600;
text = "Buy"; //--- ToDo: Localize;
x = 0.304062 * safezoneW + safezoneX;
y = 0.687 * safezoneH + safezoneY;
w = 0.391875 * safezoneW;
h = 0.066 * safezoneH;
action = "closeDialog 0; nul=[] execVM ""jacobGUI\buy_selected.sqf""";
};
class BUY_ExitBtn: RscButton
{
idc = 1601;
text = "Close"; //--- ToDo: Localize;
x = 0.597969 * safezoneW + safezoneX;
y = 0.247 * safezoneH + safezoneY;
w = 0.0928125 * safezoneW;
h = 0.066 * safezoneH;
action = "closeDialog 0;"
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
////////////////////////////////////////////////////////
}
}
the printed result was 'any'
Because you misspelled _control
Hey there, iam looking for help. I try to limit this script to a maximum range of 3 meters between player and victim but i dont get the syntax. It uses ACE medical. How do i use "distance cursortarget" in this array? Can anybody help me please?
[cursorTarget, 1, "head", "stab"] call ace_medical_fnc_addDamageToUnit
@slate ferry
simple stuff from the basics of scripting
if (cursorTarget distance player <= 3) then {
...
};```
Thank you X39. Iam a beginner and try to learn.
that is why i tell you that 😉 simple stuff, basics of scripting
chances are, you would have found this yourself if you have had searched for eg. "distance" on the biki: https://community.bistudio.com/wiki/distance
Anyone know how I through BIS_fnc_spawnVehicle can set a spawn height?
Would that not be in the position array?
If you are getting the height from a marker, use set and set a height.
How exactly do I set a height for a marker?
You really shouldn't, I'm saying to get the pos, and then use set: https://community.bistudio.com/wiki/set
private _spawnPos = (markerPos "myMarker") set [2, _zValue];
Thank you!
is there perf gain to disable simulation of wreck objects? (mission object - not destroyed vehicles)
you mean a vehicle which was destroyed due to damage?
or just a plain model of a wreck, like the ones you can find in eden?
Don't some of those have animations and sounds?
Perhaps this is a very basic question but is there any simple way to refer to a specific player on the server in a script (to be executed in console) without knowing the id for that player's specific slot? An example of the manner of thing I am trying to accomplish:
[PLAYER 1] setpos(getpos [PLAYER 2]);
How are you running it? You could get them from a selection or cusorObject maybe.
It really depends on the situation.
and then use set
set returns NOTHING
yeah the "set" thing didn't work out
Oh yeah lol
Save the var first and set it haha. Need some coffee this morning.
private _spawnPos = markerPos "myMarker";
_spawnPos set [2, _zValue];
Thanks Schnellführer!
Gonna give that a try now
I can't get it to work but that's most likely due to my own incompetence in sqf, here's the code I'm using:
private _Spawn_Heli_1 = markerPos "Spawn_Heli_1";
_Spawn_Heli_1 set [2, 5];
Spawn_Heli = [ getMarkerPos "Spawn_Heli_1", 0, "RHS_UH60M", WEST] call BIS_fnc_spawnVehicle;
Spawn_Heli_Veh = (Spawn_Heli select 0);
Spawn_Heli_Veh addItemCargoGlobal ["ace_rope36", 2];
Spawn_Heli_Veh call ace_fastroping_fnc_equipFRIES;```
You didn't change it in the spawn and are still getting the position from the marker.
Yeah, sorry, I have no idea how to do that unfortunately.
Spawn_Heli = [ getMarkerPos "Spawn_Heli_1", 0, "RHS_UH60M", WEST] call BIS_fnc_spawnVehicle;
You are getting the marker position here instead of using the _Spawn_Heli_1 you set with the correct Z.
This would be actually using that new position:
Spawn_Heli = [_Spawn_Heli_1, 0, "RHS_UH60M", WEST] call BIS_fnc_spawnVehicle;
Still spawning way above where I want it to.
getPos standing at the height you want it in the editor, and use that Z value.
Continued via PM we found that it was actually setting the variable given to 50m and thus spawning at the same height, so that function isn't useful for this specific situation.
is there a good way to roll a vehicle to the side?
Any good animation rolling? setVectorUp is instant
no
nothing controlled at least
there is a set velocity /force or something like that command
but theres no animations you can play to do stuff like that
you will have to play with the physics if you want stuff to be moving live
there is a set velocity /force or something like that command
👆
but theres no animations you can play to do stuff like that
could always use setVelocityTransformation
addForce, but the results may vary. Sometimes the vehicle rolls over. sometimes it decides to do a outer space trip 
most vehicles have pretty low center of mass and they tend up rolling back on their wheels
so depends on what you want to achieve if you need to freeze the vehicle to some certain direction at some point of your roll
The torque will be fit the best but dammit rhs is really doing some stupid stuff
Some of their mraps are very much self stabilizing 😬
the new m-atv is just i don't know. I reached the max number cap trying to roll them to the side
US_Veh_CAR_2 addTorque (US_Veh_CAR_2 vectorModelToWorld [0,99999999999999999999999999999999999999,0]);
Is not enough torque
https://community.bistudio.com/wiki/in
exemple 6 does not work, gives generic error
@young current
https://i.imgur.com/iQfxGwc.png
¯_(ツ)_/¯
👌
works on my end, no idea why not on yours
Read wiki properly
(Since Arma 3 v1.95.146032) and my version is 1.94
exactly. Jackpot
oh true im running diag exe
would be better just do like the other ones that had DEV tags or "Not implemented yet"
I wasted a unesessary amout of time trying to figure it.
(Since Arma 3 v1.95.146032)
@astral tendon
Existing command can’t have DEV tag
Yeah, I will check it every time I see that "Since" next to the comand.
(oops, Discord didn't sync well)
well, we could add A3dev besides the A3 icon for now, but the patch is days away I think sooo
Then you have to monitor and remove it with release
Fire and forget is much better
Can’t fix everyone if people don’t read
yep, that's the issue - the forget part
Funny though how string in string is so obvious yet wasn’t implemented
maybe a date when the comand will be avaialbe?
or (Available in Arma 3 v1.95.146032)
You can’t have date if it is not known
It's fine as is. People need to learn to RTFM.
Typically 'since' refers to some moment in the past, that's why it might be misleading
What would you suggest to write instead?
NYI, Will be available after 1.99 ?
Probably wiki doesn't allow to automate that, I have no idea
After 1.99 means from 2.00?
Well how do you phrase version >= 1.99 properly? 😄
Since
🙄
since meaning after version xx is released
could be "will be included in version XX"
But usually version is already available on dev
if goal is to make less informed ppl aware of that, then it can be mentioned
or dev version users already know its there
what stage is the wiki intended to follow
dev or stable
there will always be users that dont even know there is a dev branch
Well it is only confusing between stable releases, for someone who doesn’t use dev so ¯_(ツ)_/¯
id wager most people dont use dev
And this is bad
Though if you are on biki you are probably developing so technically by not using dev you limit yourself
but if you develop stuff for stable build then youre not
most servers run stable build
not dev
so if you build on dev, most of the time your stuff cant be used
if you use things that are not on stable that is
if you develop for your own fun/own group who all run same version == no problem
if you develop public mod that you intend to update more often than Arma updates == problem
Yes but on dev you normally get improvements and fixes that are going to hit next stable so if you want to make sure you don’t get any surprises you want to at least have parallel build
sure that is good practice especially on more complicated projects
but if youre in that advanced level of making stuff you probably know your stuff already and can read wiki like a pro
What is the worst case scenario if you haven’t paid attention to since version? You try it and it doesn’t work, you go to discord and embarrass yourself, and I think this is what the actual issue here
Which is good, because next time you gonna pay more attention which is a good thing
Worst thing is that everyone's time is wasted
I love this community.
well if the problem stems from simple phrasing on wiki why could that not be made so that there is no problem at all?
That's what I was trying to say but gave up, thank you...
But really it's also the question if we assume that user is free to play on any version he likes or do we assume his version 🤷
Generally it's better not to assume things
Anyway, does anyone knows how to swich the light of Land_TransferSwitch_01_F to the green one below? I don't want to swich the color of the current light, but change it to the one that is below
I get the lever to work but did not figure about the light.
well if the problem stems from simple phrasing on wiki why could that not be made so that there is no problem at all?
Because the problem is with people not paying attention at all
well that applies to anything and is a problem far beyond Arma modding
Maybe they do but not enough to catch this
if changing few words might help some people why not do it?
why not educate people?
Oh really? CreateUnit has red box saying pay attention this syntax doesn’t return an object, doesn’t seem to stop anyone
we were talking about the version numbers?
Same thing
im not saying you have to do it either. Im sure the red box helps some people
it wasnt always there either
There is no empirical data to judge the usefulness of that red box but it sure increases embarrassment factor if you missed it
now you do see your attitude towards this matter is not at all helpful or progressive
Then again the version thing is a thing only between stable releases for someone who is not using dev and only when some existing command gets some love, so really quite marginal, yet somehow it goes on for several pages already
Let’s not go personal, ok?
Let's look at it this way... does it move wiki into a better state? I think it does. Now can it be easily done so that it compares a function version VS the current stable version?
You have to retro edit all such notes, are you up for it? Dooo eeet then
_> Hey man, I have NO idea how wiki works, nor I'm registered there, that's why I'm asking
I have no idea either
However it answers my question, thx
but instead of mocking us for asking if it would improve wiki you could have said its very difficult and time consuming to do for little gain
That’s what I tried to say when I mentioned marginal nature
yes indeed. could have started with that,
Im having a hard time getting this to work on a dedicated server
if (!isServer) exitwith {};
_lightspawn = selectRandom ["lightarm1","lightarm2","lightarm3","lightarm5","lightarm6"];
_lightArm = [getMarkerPos _lightspawn,0,"rhsgref_BRDM2_vmf",East] call BIS_fnc_spawnVehicle;
[_lightArm select 2, getmarkerpos "patrol", 1000] call BIS_fnc_taskPatrol;
im pretty sure that the problem is im spawning it localy and not on the server.. setup is, a laptop with addaction to run .sqf
well, yeah
unless the player that is activating the script is the server, you can't get it to work like that
I also tried this to no avail
_armorSpawns = selectRandom ["armor1","armor2","armor3","armor5","armor6"];
_veh = createVehicle ["rhs_t72ba_tv", getMarkerPos _armorSpawns, [], 0, "NONE"];
[_veh select 2, getmarkerpos "patrol", 1000] call BIS_fnc_taskPatrol;
https://community.bistudio.com/wiki/switchLight
Are the effects global or local?
@astral dawn
"Then
_ctrl = (findDisplay 9999) displayCtrl 1500;" from yesterday.
I did what you requested and it now prints 'No Control".
Hey
Well I have no idea, need to see more
More code, and how you create the dialog maybe
And how the dialog is defined
this is called on action and works -
// Don't want to cache this dialog
disableSerialization;
createDialog "buyMenu";
waitUntil {!isNull (findDisplay 9999)};
// Create List Box ref
_listBoxIDC = 1500;
{
// %1:price %2:name
_displayString = format ["%2: %1 €",[_x] call A3A_fnc_vehiclePrice, getText (configFile >> "CfgVehicles" >> _x >> "displayName")];
_index = lbAdd [ _listBoxIDC, _displayString ]; //Display string needs to be grabbed from the vehConfig which is based off of _x
lbSetData [ _listBoxIDC, _index, _x ]; // _x is our class name we want to reference
} foreach vehBuyList; // Global list containing all vehicles we can buy in the format of class name strings
buy_selected.sqf
_listBoxIDC = 1500; // IDC of our list box
_control = (findDisplay 9999) displayCtrl 1500;
systemChat format ["control: %1", _control];
_index = lbCurSel _listBoxIDC;
systemChat format ["index = %1", _index];
_vehClass = lbData [ _listBoxIDC, _index ]; // retrieve the data (previously set) from the listbox's currently selected index
if (_index == -1) exitWith {hint "No vehicle selected to buy"}; // Make sure the player selected a box
// Attempt to buy the vehicle //////////////////
closeDialog 0; // This was lowercase before 'action = "closedialog 0; nul = [vehSDKBike] spawn A3A_fnc_addFIAveh";'
systemChat format ["Veh Class: %1 | index = %2", _vehClass, _index];
[_vehClass] spawn A3A_fnc_addFIAveh;
called on action
you know that you can't suspend inside unscheduled environment?
You say that it works, so you mean that it's adding stuff into the listbox after all?
Cool, so what was the problem again?
Read into scheduled and unscheduled environment on wiki
control
class buyMenu {
idd = 9999;
class controls{
class buyFrame: RscFrame
{
idc = 1800;
x = 0.29375 * safezoneW + safezoneX;
y = 0.225 * safezoneH + safezoneY;
w = 0.4125 * safezoneW;
h = 0.55 * safezoneH;
};
class buyCombo: RscCombo
{
idc = 2100;
x = 0.309219 * safezoneW + safezoneX;
y = 0.258 * safezoneH + safezoneY;
w = 0.252656 * safezoneW;
h = 0.033 * safezoneH;
};
class buyCloseBtn: RscButton
{
idc = 1600;
text = "Close"; //--- ToDo: Localize;
x = 0.618594 * safezoneW + safezoneX;
y = 0.247 * safezoneH + safezoneY;
w = 0.0721875 * safezoneW;
h = 0.044 * safezoneH;
action = "closeDialog 0";
};
class buyListBox: RscListbox
{
idc = 1500;
x = 0.309219 * safezoneW + safezoneX;
y = 0.302 * safezoneH + safezoneY;
w = 0.252656 * safezoneW;
h = 0.44 * safezoneH;
};
class buyBtn: RscButton
{
idc = 1601;
text = "Buy"; //--- ToDo: Localize;
x = 0.5825 * safezoneW + safezoneX;
y = 0.61 * safezoneH + safezoneY;
w = 0.108281 * safezoneW;
h = 0.132 * safezoneH;
action = "closeDialog 0; nul=[] execVM 'jacobGUI\buy_selected.sqf'";
};
};
};
The issue is that the buy_selected can't see the control
and always returns -1
for index
Yeah I see. Does it (finddisplay 9999) return an existing display at least?
"No Display"
from
_control = (findDisplay 9999); //displayCtrl 1500;
systemChat format ["control: %1", _control];
So... If this display/dialog if still open at the moment when you click the button, then the display should be found!
It could find the 9999 display before after all!
Ha, you see, right what I said...
action = "closeDialog 0; nul=[] execVM 'jacobGUI\buy_selected.sqf'";
You need to close the dialog after you run the script
🤣
also probably there is no need for execVM there... unless you are super sure what you are doing
Im not
Are you modifying antistasi things actually?
execVM and spawn are (almost) like creating a new thread, when you create a new thread you should have a damn good reason to do so, typically
anyway yeah try this instead
action = "nul=[] execVM 'jacobGUI\buy_selected.sqf'";
then run the closedialog command from your buy_selected when you won't need the dialog any more
ah I see - if it is scheduled behind other scripts it will just close and we wont have access to it
Even if you did a call from the button action after closing the dialog, result would be the same
because first it would close the dialog, then you would try to find the control from the script
yeah, I was under the impression that the dialog was global and always available - this is starting to make more sense now.
Awesome yep that resolved it. I really appreciate the help!
NP, now do the homework: https://community.bistudio.com/wiki/Scheduler
👍
And this is also good: https://ace3mod.com/wiki/development/arma-3-scheduler-and-our-practices.html
Aye
when you select a new item in a combo box does it fire the 'action' line of the comboBox?
will setPosASL safely place a player on top of the aircraft carrier, or do I need to use something else?
hmm, looking at the wiki article for Position (https://community.bistudio.com/wiki/Position#PositionASL), it looks like setVehiclePosition might be more appropriate?
I went with setPosATL since that's what was being reported in the editor when I placed something on the carrier
setPosASL with the editor value (around 114) put me way up in the air, and setPosASL with 0 put me (as expected) in the ocean
thanks for the help
Excuse me, how can I make it possible for players who only add UIDs to their servers to play? Thank you!
yeh setPosASL does require you to getPosASL first but works great
@mystic plaza i've learnt that you need to put an airstrip platform on the carrier, in order to place a unit properly, or it will drop into the ocean. But make sure not to clash with take off barrier and the ropes.
I've got some scripts that are keeping players in a zone, and teleporting them back in if they leave it. I currently have every player selected like so:
_allPLs = allPlayers - _allHCs;```I want to exempt some players who are playing as CAS from this script. I've tried giving the CAS players a variable name ``pcas1`` and ``pcas2``, then deleting them from ``_allPLs`` with ``_allPLs deleteAt (_allPLs find pcas1);``, which works... but it throws an error about ``pcas1/2`` being null if the player isn't present.
I tried fixing this with ```if (!isNull pcas1) then {
_allPLs deleteAt (_allPLs find pcas1);
};``` but this is also giving me an error on ``isNull`` if ``pcas1`` isn't present. Is there an easier way to do something like this?
but it throws an error about pcas1/2 being null if the player isn't present.
no it doesn't
it throws an error about them being NIL, not null. Different things
important difference
!isNull pcas1
vs
!isNil "pcas1"
_allPLs = allPlayers - _allHCs - [pcas1,pcas2,....]
When I use _allHCs = entities "HeadlessClient_F"; _allPLs = allPlayers - _allHCs; if (!isNull pcas1) then { _allPLss deleteAt (_allPLs find pcas1); };, I get the error 18:47:55 Error Undefined variable in expression: pcas1 for each unoccupied CAS slot.
With _allPLs = allPlayers - _allHCs - [pcas1,pcas2]; I get the same thing.
The if statement with !isNil "pcas1" with the quotes added seems to work, however, so I'll just go with that. The help is very much appreciated.
Did we get an update or something? I'm getting weird results from a script that has worked consistently for months. It's an "ANYPLAYER" trigger and for some reason as of this morning it fails to detect the player once the player boards a vehicle. After the vehicle has moved, the trigger fires as usual.
inexplicable: changing nothing else but the height of the trigger fixed it. Even though the vehicle is only about 1 meter higher than ground level, with the trigger height at 3 meters the trigger deactivates. At 6 meters it works as usual. Pretty weird and inconsistent trigger behavior.
that or you set a trigger height
@winter rose , this is a common trigger I use a lot. It's properties never change. This morning it behaved differently than last night-- even though the game was still running (which I guess means it wasn't update related). That seems pretty inexplicable.
3 meters has worked for months, now it's 4 for some reason
no update though ¯_(ツ)_/¯
I'm not sure if it's little things like this that keep me going or make me want to quit but it's all good, trigger works again... for now.
*armagic*
I mean, I'm drawing the trigger in my imagination and the vehicle is well within it. Boarding the vehicle definitely makes the player exit the trigger area. Starting the engine and moving a inch makes the trigger fire again. That's weird. I know that's weird because I've play-tested this scenario a hundred times. Another vehicle in the same zone but at the exact altitude of the trigger works as expected. So two vehicles next to each other have different behavior with the only difference being one is about a tire's height higher. Both vehicles are vanilla, empty, unnamed.
3m height trigger may use older bounding box, I don't know
@winter rose , I'm probably just venting. Thanks for your help as always, Lou
well, didn't really help here but triggers can be bitchy
if your trigger is 3m high but terrain is bumpier than usual, you are out of it very easily
I probably moved the stupid truck while I was tired or something and it had just always been right on the edge-- it has a grace area now-- oh @winter rose , regardless whether it accomplished anything or not , I appreciate your time
Suppose that I have an array with the IDs of the players' units in a mission, which I then shuffle. I now want to execute a script on each given place in the array. (unit 1 gets a specific script, unit 2 gets a specific script, and so forth.) What would be the best (and hopefuly simplest) way to accomplish this? The only thing I can think of so far is running a series of convoluted if-cases, but intuitively this solution feels a like a recipie for errors and disorganization.
The ambition here is having a "random" role selection which, while unpredictable from the perspective of the individual player, make sures to hand out the most important roles first.
make an array of script functions.
Then just forEach through the players, and select from your function array by forEachIndex
Thank you. Haven't written any code for a few years so I'm a bit rusty haha.
what kind of IDs do you have, and what kind of scripts do you want to execute. Do these scripts need to run local to the player?
something like this probably
_unitsArray = [1,2,3];
_scriptsArray = [{hint "script1"},{hint "script2"},{hint "script3"}]
{
_x call (_scriptsArray select _forEachIndex)
} forEach _unitsArray;
Nice, thanks this seems to be just what I wanted.
ID-array is _playerlist = allplayers; and optimally I would just run an .sqf corresponding to each index. I don't suppose there is an easy way to change the global variable refering to a unit once mission has started?
Good day ladies and gents! Got a little trouble here using sqf cfgRoles and sqf CfgRespawnInventory I get the concept and all, you got a role that players pick (given in cfgRoles) and to them you got loadouts assigned. Sure. But how do you assig a role from sqf description.ext to a playeable unit you put down in Eden? Using the Role Description field in the units attributes only seems to change the actual description in the MP lobby. Thaks in advance, folks!
Just confirming that your method works so far when testing in a singleplayer environment. Thanks Dedmen! 👌
what is unscheduled in diag_captureSlowFrame? what is the short name/what section is it in?
all eventhandlers
@daring trout [player, "YOURROLE"] call BIS_fnc_addRespawnInventory;
@frozen knoll oh, so the BIS_fnc_addRespawnInventory is the link connecting the role with the unit? Thank you VERY much!
yeh its been a year or so since i played with that but should be what your looking for
@frozen knoll you the man, thanks!
I want two waituntil's running at the same time. If I embed them in if/then statements, that'll work, right?
if (alive player) then {endBlue=[]spawn {waitUntil {sleep 10; player getvariable "scoreBLUE" > 99};"Success!" call BIS_fnc_endMission;};};
if (alive player) then {endRED=[]spawn {waitUntil {sleep 10; player getvariable "scoreRED" > 99};"Failure!" call BIS_fnc_endMission;};};
waitUntil one or the other is 99+, then if it's blue victory, else failure
Else you can have a win then a loss! ☝
waitUntil {sleep 10; player getvariable "scoreBLUE" > 99 or player getvariable "scoreRED" >99};
if (player getvariable "scoreBlue" >99) then {call bis_fnc_endMission};
so more like that?
yes
cool, thanks guys!
also, I'm passing a variable through a function like
fnc_example=
{
_mark=mark
mark=something else
call function with variable
mark=_mark
};
Is that the right way or is there something better?
I want mark to exit the function with the same value
the function is editing mark ?
Sure you can do that, but I'd say you should re-plan your logic such that such a thing is not necessary
like this,
MMF_tankOFF=
{
_currentMARK=currentMARK;
currentMARK=baseAREA2;
baseAREA1 call MMF_fnc_bluTANK;
baseMARK3 call MMF_fnc_redTANK;
currentMARK=_currentMARK;
};
It's not really for me, it's so when other people try to use the MMF framework they don't have to keep track of default values, just set it and forget it
What's really the purpose of this? Are you worried about many scripts running in parallel or what?
i assume the functions modify the variable
it wouldn't help at all against scripts running in parallel
As you can see above he wants to modify the variable, and then revert it again
you really should just pass a argument to the function instead of temporarily modifying globals
Global variable is bad unless there is really no other way
Think three times before using globals
four even
This isn't a typical use type scenario and none of the actual functions use the above method. However, I've written several shortcut functions for users to spawn (like a batch), and this is strictly so they don't have to manage defaults
you dudes are welcome to look at the actual script,
https://drive.google.com/open?id=1ksxSFp6NzlLGtOmwu0KawmsJXtlUWCxl
the functions are in MMF_functions.sqf and the shortcuts in question are in MMF_fnc_design.sqf
Yeah looks like that could still be done with local variables being passed implicitly, or just arguments being passed ¯_(ツ)_/¯
would ofc have to rewrite big parts of that stuff
looks to me like you are just missusing global variables as parameters. To avoid having to pass them manually
yes, I'm totally doing that but I didn't know that is misusing them.
oh,
https://community.bistudio.com/wiki/params
okay. I think I get it. Cool. So release date gets pushed back a week and I re-write this thing, again.
I should probably start asking these questions before I write the thousand line .sqf
thanks @still forum , I think...
just tell me this, if I successfully rewrite the file using correct parameters, will that put the project a step closer to being MP compatible?
I assume so
passing parameters to remoteExec is easy
setting global variables, then remoteExec'ing and then resetting them is way harder
great! Because ultimately that's what users will want, is MP
is way harder
and can even lead to asynchronous shit because we don't know how publicVariable is ordered relative to remoteExec and other things?
I would assume publicVariable/remoteExec would be properly ordered.. But I never tried and wouldn't even want to try it
re-write this thing, again.
That's how you learn. ^^
I know, I know... and I am thankful I was just being snarky
Ordering constraint is why I never use remoteExec and only remoteExecCall. Even if the messages themselves are ordered, the scheduled script executions might run interleaved.
How would I get a vehicles location actual and re-purpose that data to spawn something on said location?
So I'm trying to create a script that replaces CUP structures with Contact equivalents, and I've ran into a bit of a roadblock. Namely trying to get relative positions of structures
This is what I've gotten so far: https://pastebin.com/UZLPY1kP
the method I use to get relative positions is this: copyToClipboard str (getPos _obj1 vectorDiff getPos _obj2);
and to get placement position I use this: ((getPosATL _building) vectorDiff _offset)
Though it doesn't seem to place things in the correct position and I need help with finding a good solution to this, or at least some pointers.
Yeah I know, I'm trying to get the offset between them as mentioned
you could try comparing the bounding boxes
and model centers from that
and turning that into an offset
From what I understand and why CUP team hasn't just done it already is that reason
Particularly with bounding boxes and model centers.
Yeah
cup has tools to automate that stuff, but its still alot of work
how would i force an ai VTOL to use forward flight on a certain waypoint. I want them to take off/hover to my first waypoint and then zoom off at my second. Right now they only hover off to my second waypoint even though its 3km away. I tried setting the ai setting to run but it didnt work
nevermind, for anyone that wants to do this, just look into the unit capture function in arma 3
what? set unit to captured will force it to fly instead of hover?
no. unitCapture, a BIS fnc made to "capture" position and direction of a vehicle (mostly air vehicles)
well... that only works with static movements, not on the fly waypoints (like in Zeus)
guess playing a single waypoint close to the take-off area also "fixes" this issue
Hello, I want to implement a system identical to ArmA 2s construction interface. I'm setting up the camera stuff now but I was curious if it is possible to just use the eden editor camera controller or zeus's as they both already have most of the functionally I need from the camera. I couldn't find much information on modifying them so figured I'd ask here
Also assuming they are scripts, where would they be?
Hey, I need some help with a situation I've found myself in trying to make a simple mission. To begin, I'm very novice and all of my knowledge comes from the biki that I can barely decipher 90% of the time, so sorry if my stuff seems kind of ghetto.
My add action is on a unit with the variable name "cop". The addaction changes convcop1 to true, which activates the trigger to play the subtitles and progress the mission. The issue only comes in multiplayer. When one of my players activates the action, the dialog plays for them exclusively, the Create Task module connected to the trigger doesn't activate, and the action remains for everyone else despite the action being removed for the user.
cop's int is:
this addaction ["Talk to Constable", {convcop1 = 1; cop removeaction 0;}, [], 1, true, true, "","_this distance _target<2"] call bis_fnc_mp;
My Trigger (trig1)'s condition is:
Convcop1 == 1;
and the int is:
execvm "conv1.sqf";
When one of my players activates the action, the dialog plays for them exclusively im no expert but I think its a locality issue? I.e. its executing on the client that selected the addAction. This client (the players computer) isn't where the task is stored cuz thats on the server.
I'm not great at this but here goes, in arma (and i imagine other games) the code executes on certain machines, namely client and server. The two are linked via the internet/a network or whatever. Not everything in arma broadcasts across the network across all client, this in turn means that if you create something on the server (such as you placed create Task module) the client (the players machine) might not know about it. This means in scripts, you have to remotely execute on the intended machine OR use something global.
Look at the top of addaction page: https://community.bistudio.com/wiki/addAction
and you'll see AG and EL (arguements global and effects local). In your case, this means the effect (i.e. the removal of your action and executing of your convo.sqf) happens on the machine that executed only, so the player in your case.
@bitter lark I'm happy to PM you with what I can to help if you want?
@bitter lark you already got a answer on reddit
Hi, I need help with the carrier and having ai launch off it as well as raise and lower the deflectors, and yes I've googled it and yes none of the scripts that I found accomplish what I need. sorry for the hostile tone, All help is welcome
@spice axle I posted this here before I got my response. Cheers.
Ah ok
Hello all. Using waypoints for a group with each waypoint set to safe and limited speed. It appears only the squad leader is taking a casual walking stance and not the rest of the squad. Ideas?
@sudden yacht I can take a look in my editor if I’m getting the same thing and are you using any mods?
I’m not getting that problem
@still forum , okay I researched params last night and I'm sitting down to re-write some functions and I'd like to see if I understand this,
right now I'm saying something like (misused globals),
spawnNUM=2
spawnState=1
baseMark3 call MMF_fnc_soldierEAST
and if I understand correctly it should be something like,
[basemark3, 2, 1] call MMF_fnc_soldierSIDE (provided those params are available)
Is that anywhere near correct?
yes
thank goodness
and then something like
params ["_baseMark", "_spawnNum", "_spawnState"];
if MMF_fnc_soldierWEST makes a west group using bis_fnc_spawn, how do I consolidate EAST and WEST in the same function and use the params of bis_fnc_spawn group in addition to the params I set?
so like an if statement inside the function?
if (_caller==basemark3) then {side east};-- pseudo
- addition (the params I added + the params built into the function)
you could do that too
I was thinking adding the side as a parameter to the function
[basemark3, west, 2, 1] call MMF_fnc_soldierSIDE
a specific example is "spawnNUM", I put that global where the param goes for number of units so it should be unnecessary
- addition (the params I added + the params built into the function)
I don't understand that. how are your params related to the params of some other function you might call?
okay, then clearly I don't understand that part either. What I'm trying to say is that bis functions have params, and I can make up new params for my functions. So if I have a bis_fnc in my function how to I send params to where they need to go
old:
MMF_fnc_soldierEAST = {
east call spawnGroup;
}
new
MMF_fnc_soldierSIDE = {
params ["_baseMark", "_spawnNum", "_spawnState", "_spawnSide"];
_spawnSide call spawnGroup;
}
So if I have a bis_fnc in my function how to I send params to where they need to go
same as with everything else.
You pass params via the array on left side ofcallJust out in there what you need to put in there
OH! yes that makes things more clear
Okay I'm going to rewrite a function or two. I'll make a forum post so I can share my learning with everybody. Thanks for your help @still forum , I'll check back in with some progress later
can't wait to comment on the mistakes you'll make in that forum thread :3
😄
Whats the best way to get the name of the seat that a unit occupies in a vehicle? Ex: return "Driver" when checking the driver of a vehicle?
a chain of if statements?
elseif?
switch statement?
nevermind, I got it figured out now
{
_result = "";
_unit_vehicle = vehicle _unit;
{
_x params ["_seat_unit", "_seat_name"];
if (_seat_unit == _unit) exitWith {_result = _seat_name};
} forEach fullCrew _unit_vehicle;
_result```
incase you were curious
that will return "cargo" for each of the cargo seats tho
names aren't unique in your code
also.. you should probably use findIf, and private keyword for that
I'm fine with it returning Cargo tbh
because im not trying to find the driver, I'm trying to find what seat a specific unit is occupying at the time code is run
unless I can get the exact seat name from the seat Index that fullCrew would return
private _crew = fullCrew vehicle _unit
private _result = (_crew param [_crew findIf {_x select 1 == _unit}, []]) param [1, ""]
that's my variant.
Well you can just append the cargo index to the name
I'm building a dialog similar to Ctab that in part will return what vehicle the selected unit is in, and what role/seat they are taking if in a vehicle. Which is why Cargo is an acceptable result tbh but thank you for the input though. I'll remember that incase I decide I want to give more info than just Cargo
Another question now: What is a quick way to determine if a mag is compatible with a weapon?
awesome, thanks again Dedmen
Is there someone in here who has knowledge/experience with the antenna & component system of ACRE2?
What I'm trying to do is use a script to change an antenna on a radio, however I don't see it actually changing...
// script to change antenna (simple component)
_radioId = ["ACRE_PRC117F"] call acre_api_fnc_getRadioByType;
_hash = [] call acre_main_fnc_fastHashCreate;
_antenna = "Some_Custom_Antenna"; // exists in CfgAcreComponents
_return = [_radioId, 0, _antenna, _hash, true] call acre_sys_components_fnc_attachSimpleComponent;
systemChat format ["Antenna Attached: %1", _return];
^^ this always return "Antenna Attached: true"
However if I call acre_sys_components_fnc_getAllConnectedComponents on the same _radioID, it keeps showing the original antenna.
So instead of going with the soldier function to start I thought I'd use my go-to example script, which is based on GOM teaching me to count a few months ago,
I would define these,
rings1=[objNull, ring1_1, ring1_2, ring1_3];
rings2=[objNull, ring2_1, ring2_2, ring2_3];
rings3=[objNull, ring3_1, ring3_2, ring3_3];
In an area trigger,
[1,[rings1],ringOBJ] call FTA_fnc_ringCourse;
and,
FTA_fnc_ringCourse = {
params ["_courseID","_rings","_ringGoal"];
currentRing=currentRing+1;
_ringGoal setpos (getpos [_rings] select currentRing]);
if (currentRing==4) then {currentRing=0};
};
I'm not sure about the syntax but I think the logic is correct
Hi guys, quick question: What's the best way to check if a animation is over? I saw there is an event but idk how to properly use it in my script
did we make _courseID irrelevant?
or maybe that could be one step easier by just having the ringObj call the function?
ringOBJ [rings1] call FTA_fnc_ringCourse;
FTA_fnc_ringCourse = {
params ["_rings"];
currentRing=currentRing+1;
ringOBJ setpos (getpos [_rings] select currentRing]);
if (currentRing==4) then {currentRing=0};
};
and calling it _this,
_this setpos (getpos [_rings] select currentRing]);
dont have time right now to feedback. might remember later tho o7
(getpos [_rings] select currentRing]) syntax error, and precedence error, and logic error all in one
the ] is closing an array that was never opened.
getPos takes precedence over select, and getpos on array with one element no work.
logic error your select can only ever work with 0, because the array only has one entry
@still forum , thanks I'm on it
@zealous meteor Huh, i didn't think the adding multiple at a time worked in vehicle init
did it add 2 ak's?
yea multiples dont work in the init
can you give me a really quick crashcourse on sqf scripting?
like where do I put the file and how do I run it
create a new text file in your missions root folder
name it customVehicleInventory.sqf
done
then past this into it
clearItemCargoGlobal _mrap1;
clearMagazineCargoGlobal _mrap1;
_mrap1 addWeaponCargoGlobal["rhs_weap_aks74u", 2];
_mrap1 addWeaponCargoGlobal["ace_bloodbag500", 10];```
done
again check the ace wiki for for correct classname, and you will have to add all the clears for relevant items eg backpacks all on the arma wiki
yeah yeah I get that
then just give the vehicle the variable name _mrap1
Already did
thats it
if it didnt do something stupid, its 2am for me
trying it out
you might have to reload the editor/mission file for it to recognize the new .sqf file in the mission folder
will do
didnt work
without it
reloaded it, didnt work...
man this is frustrating 😅
did the clears work?
nope
I restarted the editor and everything
the file is saved, in the mission's root directory
wait
wait I messed up, 1 sec
sure you put the .sqf file in your mission folder, the one in documents>arma>"profile">missions?
no I didnt
its called _mrap1
yeah its there
does it have to be in profile?
I have no such folder
im putting it in arma/missions/missionblabla
no thats were the packed .pbo mission file goes
whoopsie
lemme try then
the mission doesnt show up in the editor
this way
cant load it
if you save a mission in eden it saves to your profile under missions or mp missions
you will have a folder called "my mission name" and inside that is a file called mission.sqm
you want to put your sqf file in the same folder as the mission.sqm
it doesnt save to my profile, it saves to arma 3/missions
not arma 3/UserSaved/missions
and yes, I put it in the Documents\Arma 3\missions\Test.chernarus_summer
which is my mission
which contains the mission.sqm file
and I which I can load
that is your profile folder, just the default profile
ic
so just chuck the .sqf file in the same folder as the mission.sqm
then reload the editor/mission and test it by placing a unit and RMB play as unit
yeah I did
if that doesn't work or a least throw some kind of error then i dunno, and i dont have arma on this pc to test it.
Will have to wait for someone smarter than me, to point out the dumb thing i did 😂