Does anyone have any familiarity with R3F? I see when you use their full Creation Factory, it has the ace repair items: tracks and wheels, but I can't for the life of me figure out how to add them to a custom whitelist. None of the parent groups seem to work, and I can't find it through the R3F files. It's like the last thing I need to hash out my mission lol
#arma3_scripting
1 messages · Page 669 of 1
Don't they have a discord or forum post where you can ask questions?
Not that I know of or could find, and the original forum post for the mod is dead it seems.
how can I make it so that players cannot use saved loadouts to bypass virtual arsenal limitations?
and is it possible to lock the inventory (and arsenal) of a container to a specific side?
Try "Ammoboxinit" with condition
https://community.bistudio.com/wiki/BIS_fnc_arsenal
I'm planning this feature too, but seems like the only way is to check entire player loadout on arsenal close
Hello, i was wondering if i could save data in a data/ folder and read from it?
Nope. not without an extension
But i can save things like 'money ' in the namespace right?
profileNamespace getVariable ["money", ''];
and set ofc.
Please use a unique tag if you safe something there. e.g. "BSH_Money"
yea
profileNamespace setVariable ["SMM_money", [player] call HALs_money_fnc_getFunds];
saveProfileNamespace;
You don't really need to save the profile namespace
oh
BIS documentation says otherwise
Use it only if you wanna make 100% sure that it's saved since this command is quite performance heavy
Yea will i need to make sure that its saves so when he comes back next time its still there
So yea when he 'quits' thats fine
And, if it's for a MP environment, I wouldn't store info like that on the client. It will be very easy to simply modify it to gain an unfair advantage
its SP
SP/co-op
no PVP
Hey (for video creation purposes); im looking for a quick and simple way to adjust an ingame light objects (e.g 'tent lamp')'s;
- Brightness/Luminosity
- Light Colour (if possible)
Can anyone assist please?
By default the variables set in this namespace will exist while the game is running. In order to make variables save permanently, use saveProfileNamespace before the game is over.
but
The profileNamespace is also saved when the game is closed.
So I gut the wiki needs a minor update (could be depending on which game)
Yeah, I am trying to figure it out
Just tested it and when i
'exit' it saves.
// Check if user has money from before
_money = profileNamespace getVariable ["SMM_money", false];
if(_money != false) then {
[player, _money] call HALs_money_fnc_addFunds;
systemChat format ['Welcome back! You currently have %1', _money];
} else {
[player, 4000] call HALs_money_fnc_addFunds;
}
Where am i missing ; 🤔
At the end (last })
oh
Yep
profileNamespace setVariable ["SMM_money", [player] call HALs_money_fnc_getFunds]; btw how often should i run this
_money = profileNamespace getVariable ["SMM_money", false];
if(_money == false) then { <-- This breaks
``` 🤔
generic error.
yeah, because you cannot compare number to boolean
except… with isEqualTo
but the best would be to have -1 as value
mm
// Check if user has money from before
_money = profileNamespace getVariable ["SMM_money", -1];
if(_money == -1) then {
[player, _money] call HALs_money_fnc_addFunds;
} else {
[player, 4000] call HALs_money_fnc_addFunds;
};
[] spawn {
while {true} do {
sleep 5; // Save money every 60 seconds
profileNamespace setVariable ["SMM_money", [player] call HALs_money_fnc_getFunds];
}
};
Not working 
oh..
wait a second..
wrong operator x)
Not sure whether this question is meant for here or #arma3_scenario, (lol @winter rose ), but, how do i put my texture on e.g a flat tv as part of a mission?
My attempt - do i just make a subfolder within the mission folder and viola?
( Dont quite understand the brief explanation - https://imgur.com/F2nsAxo )
(it's et voilà)
and yeah you can make a subdirectory and paste the relative link here 🙂
Lou, i wanna save my gear also in the namespace profile i think i almost have it but not there yet:
// Check if user has money from before
_gear = profileNamespace getVariable ["SMM_gear", []];
systemChat format['%1', _gear];
if(_gear isEqualTo []) then {
systemChat format['%1', profileNamespace getVariable ["SMM_gear", -1]];
[player, _gear] call BIS_fnc_loadInventory;
// <-- (Array in format [ < Namespace, Group or Object >, String ] or [ output of BIS_fnc_saveInventory ] - usable with inventories saved via BIS_fnc_saveInventory)
};
[] spawn {
while {true} do {
sleep 15; // Save gear every 60 seconds
_gear = [player, [missionNamespace, "BIS_inv"], [], true] call BIS_fnc_saveInventory;
profileNamespace setVariable ["SMM_gear", _gear];
}
};
handleDisconnect
sure why not
et voilà monsieur! tres bien! tu vas savoir les dimensions en pixels devrait être? (Do you know what the pixel dimensions of a texture should be?) please 😄
All textures must have resolution 2^x / 2^y (16x16, 16x32, 64x256, 512x512, ...). The largest texture size commonly supported by graphics cards and RV engine is 4096x4096
Revo, if the players leaves does it still updates hes profile ns ?
addMissionEventHandler ["HandleDisconnect", {
params ["_unit", "_id", "_uid", "_name"];
_gear = [_unit, [missionNamespace, "BIS_inv"], [], false] call BIS_fnc_saveInventory;
profileNamespace setVariable ["SMM_gear", _gear];
true;
}];
yes
mmm
use DeepL instead of Google Translate please 😂
as R3vo said, power of two resolutions - 64×128, 512×512, 1024×32 etc
😂 😂 😂 Well i am learning French via Duolingo, and still get alot of stuff, esp tenses wrong 😂 but will take that advise on in future
Got the gear saved now, but not loading up 🤔
[player, _gear] call BIS_fnc_loadInventory;
oh.
Nvm
if(_gear isEqualTo []) then { <-- how can i make this notEqualTo 🤔
@winter rose - HDD\Users\username\Documents\Arma 3 - Other Profiles\profilename\missions\folder\mission\mission_textures\texture1?
How much of the file path is required?
profilename\missions\folder\mission\mission_textures\texture1?
they say it, the mission-relative directory
so from mission_textures\
isNotEqualTo 😬
didnt know that was a thing
😄
// Check if user has money from before
_gear = profileNamespace getVariable ["SMM_gear", []];
if(_gear isNotEqualTo []) then {
player setUnitLoadout _gear;
};
Nah this is not right 
or maybe it is 🤔
textures/temp1.gif << picture not found? (someone told me gif would work)
afaik is .gif not supported, only .taa, .tga, .png and .jpg
pretty sure someone before told me .gif is possible? well, the motive is to show a motion picture on e.g a flat tv? any suggestions please?
that someone was wrong then
and no, animated images are not a thing
motion picture would be a succession of images, especially in MP
or PiP (or ogv to texture but that's hacky and ugly)
Lou, is there a specific file for when a user has actually spawned into the world?
there are ways to just check to see if the player is in the world without specific files as well
_gear = profileNamespace getVariable ["SMM_gear", []];
if(_gear isNotEqualTo []) then {
player setUnitLoadout _gear;
};
When i test this on local exec it works but as a script it wont cuz the player not loaded yet
spawn it and do a waitUntil {alive _unitOrPlayer}
cause i'm guessing you are calling that in the init.sqf which will fire before players spawn in.
[] spawn {
waitUntil {alive _unitOrPlayer}
_gear = profileNamespace getVariable ["SMM_gear", []];
if(_gear isNotEqualTo []) then {
player setUnitLoadout _gear;
};
}
and change the var ofc.
but like that?
yeah thats the idea behind it. now feed the spawn the necessary parameters and define them in the scope and replace _unitOrPlayer with whatever you want.
No need to feed it right cuz i will only use it right there and then use waitUntil {alive player};
i think i know whats wrong, when joining my server i force respawn.
respawnOnStart=1; i think thats messing with it
-
.ogv would be good, but
a) How to do get a .ogv file though? (using adobe premiere, no .ogv export option afais) -
'motion picture would be a succession of images, especially in MP' so basically the files would be named 'temp1trial0001-1200'? how would you even put that in?
you would script it
(and the downsides)
Hi, i try to edit my spawn.sqf
All my slot have this script and it works.
_handle = this execVM "spawn.sqf";```
On my spawn.sqf, I have and it works
[this, "soldier"] call BIS_fnc_addRespawnInventory;```
and now, i try to make
[this, "soldier"] call BIS_fnc_addRespawnInventory;
[this,'legion_Medic'] call BIS_fnc_setUnitInsignia;
legion_Medic is the classname insignia from one of my mod
My problem is that insignia don't appear when my unit respawn, any ideas ?
you have to set the insignia after they spawned
yeah i remember reading this link before tbh, well, .ogv files playing on textures afais have been great, no real playback issues, but;
'3. You cannot stop the video once it started playing, but you can know when it is finished.' is not the best situation, but could be worse
ok, my to do list for today, consists of;
- get .ogv file successfully working on flat tv 😂
(Thanks again 😄 )
How i can do it ?
https://community.bistudio.com/wiki/Event_Scripts#onPlayerRespawn.sqf
Will allow you to execute code in your mission after someone (re)spawned
// Check if user has gear from before
[player] spawn {
params['_player'];
waitUntil {alive _player};
_gear = profileNamespace getVariable ["SMM_gear", []];
if(_gear isNotEqualTo []) then {
_player setUnitLoadout _gear;
} else {
removeAllWeapons _player;
removeAllItems _player;
removeAllAssignedItems _player;
removeUniform _player;
removeVest _player;
removeBackpack _player;
removeHeadgear _player;
removeGoggles _player;
player forceAddUniform "rhs_uniform_cu_ocp_101st";
};
};
What am i doing wrong 🤔
I found a script on https://forums.bohemia.net/forums/topic/213223-adding-insignias-to-units/
onPlayerRespawn.sqf:
{
if (str(player)in ['A1','A2']) then {
[player,''] call BIS_fnc_setUnitInsignia;
[player,'TTB_Alpha'] call BIS_fnc_setUnitInsignia;
};
if (str(player)in ['B1','B2','B3','B4','B5','B6']) then {
[player,''] call BIS_fnc_setUnitInsignia;
[player,'TTB_Bravo'] call BIS_fnc_setUnitInsignia;
};
if (str(player)in ['C1','C2','C3','C4']) then {
[player,''] call BIS_fnc_setUnitInsignia;
[player,'TTB_Charlie'] call BIS_fnc_setUnitInsignia;
};
} remoteExec ["bis_fnc_call", 0, True];```
What's A1, A2, B1... ?
Those are the variable names of the units you placed in the editor, so unless you did that the script won't work
So, if I apply the variable name to each of my slots, it'll work for sure?
it works, thanks @exotic flax 🙂

I tried doing this on initServer.sqf but its not working 🤔
addMissionEventHandler ["HandleDisconnect", {
params ["_unit", "_id", "_uid", "_name"];
systemChat 'Player leaving (saving gear)';
_gear = getUnitLoadout _unit;
profileNamespace setVariable ["SMM_gear", _gear];
true;
}];
profileNamespace is local to the client, while the HandleDisconnect EH is serverside
So no way of saving before disco?
I mean i can make manual button for it but thats kinda lame
you can save it on the server, that's safer
and reapply when player with identical uuid connects
you can by executing the code on the client (remoteExec) the moment the EH triggers
unsure about that, the client might already be disconnected?
true...
i was thinking of tattoos for black shadow to get on the back of his hands. So far I've come up with... check params, check scheduled and now i can add check locality
lol we've all been there and still do it too. you're just vocal about it atm lol
You know what they say
He who asks a question is a fool for five minutes; he who does not ask a question remains a fool forever.
in my case
20 minutes.
x)
looks like a fool for five minutes 😉
Not sure about this.
wai
cuz i am already saving money the user profile way 😮
and you allow them to edit that too 😬
lets join his game and be billionares
its just 'co-op'
x)

alright you got a point
But what if i host my server through the arma launcher thingy can i still save data ?
missionNamespace returns the global namespace attached to the mission
All variables defined in mission namespace will cease to exist when mission ends
wat?
Saving data on the server and reading it when a user joins
I really dont wanna use a DB or inidb2 mod.
yeah, that you can do
use the servers profilenamespace
So if i execute saveProfileNamespace on local it saves on my side and if i execute it on initServer it executes on server?
hi, if I use cursorTarget setVehicleInit "selectPlayer _unit" this is was executed locally for cursor player?
cursorTarget is local
setVehicleInit has global effect
I know
The code added to a unit with it will be executed for every client and jip
The statement will be sent to clients connecting after the command has been executed.
Note that the statement will be executed automatically by JIP clients before init.sqs/init.sqf have been executed - see Initialization Order.
Ah
Doesn't even work in Arma 3
But, if I use selectPlayer on target, target will be switching?
In other words, selectPlayer _unit my solution will be working for all players on server?
If the biki is correct then this will not work at all
Because the command was disabled in Arma 3
I use arma 2
Is there a script that lets you increase a vehicles top speed?
not naturally. you could increase the velocity yourself but otherwise you are looking at config edits
_veh setMass -1
Hi! I'm trying to make an AI soldier to move in a circle while looking at a center object. I tried working with only playMove and lookAt some time ago but it wasn't as smooth as I wanted it to be so I resorted to other methods. I wanted to do something similar to the unitPlay function but instead of having to rely on data from unitCapture, I can use math to calculate the movement data so I can adjust it for different positions, radii, etc. . I looked into the code of the unitCapture and saw that it's based on the setVelocitytransformation function which according to a note in the wiki is "likely a combination of setPositionASL, setVectorDir, and time multiplier". Since, I have an equation for the points, (I thought I don't need setVelocitytransformation) I decided to make my own function that calculates the next positon and direction vector of the AI soldier and sets it to that. The AI soldier does move in a circle and look at the center but it's nowhere near as smooth looking as my unitCapture I manually recorded. Should I just use setVelocityTransformation? Here's the code:
k, then just test it
lol cause arma calculates physics well as it is lol
params ["_PieFighter","_PivotPoint", "_MovementSpeed", "_radius"];
_pivotPostion = getPosASL _PivotPoint;
_FighterPosition = getPosASL _PieFighter;
_UcircleForm = [((_FighterPosition select 0) - (_pivotPostion select 0))/_radius, ((_FighterPosition select 1)-(_pivotPostion select 1))/_radius]; //Unit circle form
_PieFighter setVectorDir [ -(_UcircleForm select 0), -(_UcircleForm select 1), 0]; //face toward center
_spf =1/10; //seconds per frame
_AngleChange = (_MovementSpeed /_radius)*_spf*180/pi; //change in angle in degrees
sleep _spf;
_newX = _radius*((_UcircleForm select 0)*(cos _AngleChange)-(_UcircleForm select 1)*(sin _AngleChange))+(_pivotPostion select 0); //new x coordinate
_newY = _radius*((_UcircleForm select 1)*(cos _AngleChange)+(_UcircleForm select 0)*(sin _AngleChange))+(_pivotPostion select 1); //new y coordinate
_PieFighter setPosASL [_newX, _newY, _FighterPosition select 2];
// repeated in a while loop
Please do note that I suck at math and coding
Please see the pinned messages to find out how to properly post code
what do you mean by "increase the velocity yourself"?
setVelocity
get the current velocity of a vehicle and then slam it through the roof with setVelocity
ill give that a shot, thanks
its clunky and if you don't want to hurt yourself with math, just use it in a straight vector.
vectorMultiply etc 🙂
are you referring to setVelocityTransformation?
Hey, so, ran into another issue, when replacing "Land_FlatTV_01_F" with "Land_TripodScreen_01_large_black_F"
(ISSUE: theres 3 of these in the same room, only need it played on one of them, also, does enable simulation need to be ticked?),
how to make it play on one specific rugged large screen please?
with uiNamespace do {
_tv = "Land_TripodScreen_01_large_black_F" createVehicle (player modelToWorld [0,0.5,0]);
_tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
how to make it play on one specific rugged large screen please?
well, _tv will be that screen
_tv is a generic term, so can replace _tv with the variable name?
SetVelocityTransformation interpolates between 2 points on a line, so you'd need to approximate your circle with line segments. If its choppy, I just recommend lowering _spf further in your function, giving it more operations per frame.
Error notifi: https://imgur.com/undefined
with uiNamespace do {
_tv = "Land_TripodScreen_01_large_black_F";
***_tv setObjectTexture***;[0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
hint "good!";
Cant seem to make sense of where the error is, as far as my knowledge goes, sorry. can you please assist one in its quest to uncover the hidden secret of this mystery?
bruh
_tv = "Land_TripodScreen_01_large_black_F";
or...
Televishun1 = "Land_TripodScreen_01_large_black_F";
?
_tv = theTelevisionIhave
with uiNamespace do {
_tv = missionNamespace getVariable "MyTV";
_tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
hint "good!";
(_tv = MyTV; → _tv = missionNamespace getVariable "MyTV";)
I'll give it a shot. Thanks.
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh i get it now, 😂 think all this coding is starting to make some sense, at last, thanks
see, this kind of stuff doesnt come naturally to me, im an abstract, creative thinker naturally, so this stuff isnt my forté, appreciate you again 💪
with pleasure! anytime
https://tenor.com/view/booyakasha-gif-3572374 (it works and makes sense, the coding above)
so this is where, we can use foreach to have the same .ogv play on different objects? how would i include that? 😄 😄 😁
properly!
if i disable simulation on a mine, can someone still disarm it?
try and thou shalt see! 😃
uggh okay... just brainstorming away from home
sorry in advance, but looking at the biswiki (https://community.bistudio.com/wiki/forEach)
notifi error: error missing ;
?
_tv = forEach [1, 2, 3, 4];
_scr = forEach [1, 2, 3, 4];
with uiNamespace do {
_tv = missionNamespace getVariable "ifyourreadingthisitstoolate";
_tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
hint "Not good";
well, i did try my best, just my best wasnt good enough 😿 😂
forEach takes Code on the left, and Array on the right
so <code> forEach <array>
{ /* do stuff */ } forEach [tv1, tv2];
Hi Louis nice that you are using this code. Would also be nice if you wouldn't pretend it is yours. Because it isn't.
If anyone made progress with those issues, come see us at https://github.com/PaxJaromeMalues/arma3_cram.
{ /* do stuff */ }
^^ whats this? just got me stumped
Hi there! First of all, by "my code" i dont mean code i wrote, i mean code i posted in here 🙂
Im not claiming it as mine.
Secondly, i havent managed to find a workaround or fix to it sadly, but good luck with your attempts too, sorry for the misunderstanding
a comment
oh, so put all code in {} then put the forEach [tv1, tv2];? (Well atleast this makes sense to me)
{ systemChat str _x; sleep 1; } forEach [3,2,1];
hint "go";
```@opal sand
https://i.imgur.com/wLsiqsS.jpg
Your formulation made me highly doubt that intention.
I wish you best of luck with the workaround.
So I need to execute this user action when the vehicle reaches a certain waypoint.
This is what it is: ```statement = "[this,true] spawn LIB_fnc_changeLightStatement";
**This is what I put: **```Transport1 LIB_fnc_changeLightStatement true = true;```
**This is the error:** Error missing ;
I just started getting into arma 3 scripting and it seems pretty fun.
{
with uiNamespace do {
_tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
}
_tv = forEach [tv1, tv2];
This is as far as i got to understanding, played via own radio channel, you can hear the audio but cant see the visuals
@little raptor @copper raven
this addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
}];
Quick question: Can this be used on a group?
no
```sqf plz 👀
also, I see no Code ({}) on forEach's left
Gotta loop over each unit and set a EH then.
yes
Hello, i trying to convert playerUID (i have number format) to string, but when trying to use toFixed 0 - is works wrong for me and given wrong id.
Is possible to somehow convert it to string?
str
str won't work
why?
you'll get the scientific notation stuff
then read it digit by digit
str - return this one "7.65612e+016"
{
with uiNamespace do {
_tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
}
{ _tv = forEach [tv1, tv2]};
This doesnt work?
…
{} forEach []
playerUID is a string, where do you get the number value?
_digits = ceil log _uid;
_dig_array = [];
for "_i" from _digits to 1 step -1 do {
_quo = floor (_uid/10^_i);
_dig_array pushBack str _quo;
_uid = _uid - _quo * 10^_i;
};
_dig_array joinString "";

wait wat?
then I wrote all that for nothing?! 
For ZCIENCE!!
that doesnt even make sense to me, the way i understand what youve just said is have everything as {[ ]} ??
i know, but i got from database - this value (returns) in number format 😄
cuz there is no "" in varchar - is return me number
i mean - i can change them, but need to change it in multiple tables, with foreign keys
So needed to find way to convert it somehow
I gave you an example here
#arma3_scripting message
https://community.bistudio.com/wiki/getPlayerUID
The unique ID may be up to 100 characters long and may contain numbers, uppercase letters and underscores
your db is wrong 😬 it is SteamID now
What does error missing ; mean most of the time
ye, little bit 😄
some wrongly written code; that's quite a general error
yeah, but this doesnt make sense? ive already done this? wrapped all the code in {} (inc _tv and _scr) and then at the end had foreach []; to make it all work? only audio plays?
ur db is bs 
oh look a sentence with only two-letter words!
you are risking losing numbers with Arma number precision; you should better switch to string
Ah
Did I execute this action correctly? Transport1 LIB_fnc_changeLightStatement true = true; Its suppose to enable once it reaches a waypoint but keeps giving me the error I just talked about. Can't figure out what I did wrong. lol
@little raptor @winter rose thank you a lot! Gonna try to get uid in string format from database 🙂
nope
see the function's user guide
Where would I find that?
¯_(ツ)_/¯
Is there a way of getting a direction from 2 different pos? pos 1 is looking at pos 2 (west)
getRelDir?
Ah nice
systemChat format['Enemy reinforcements coming in from the %1', player getRelDir _spawn]; this gives me a direction in numbers (360) now, so how do i convert this do NW/W/ etc
@little raptor has a magic function for that
😮
You probably want to use player getdir _spawn. Reldir returns the direction relative to player's facing
_direction = _pos1 getRelDir _pos2;
if (_direction < 45 && _direction > 135) then { _return = 'N'; }
if (_direction > 45 && _direction < 90) then { _return = 'E'; }
... etc
Yea
Was working on that but uif @little raptor has a function ready that i would happily use it^^
["N", "NE", "E", "SE", "S", "SW", "W", "NW"] select floor (_dir % 360 / 45)
Yeah select does the rounding
edited, need to floor actually
_moveMarker = [_position, 10, 20, 0, 0, 20, 0] call BIS_fnc_findSafePos;
_dirUnits = player getRelDir _spawn;
_dir = ["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west"] select floor (_dirUnits % 360 / 45);
[west, 'HQ'] sideChat format['Enemy reinforcements coming in from the %1', _dir];
you can remove the mod, not needed in that case
What website?
mod?
%
oh
¯_(ツ)_/¯
means I don't know
I don't know where you got that LIB function
Missing ) 🤔
["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west"] select floor (_dirUnits 360 / 45);
Also getRelDir -> getdir
with the 360 😄
Modded aircraft. I checked the user actions folder in config view. This is what it original gave me and I tried my best to interpret that as something that works for what I am trying to do ```statement = "[this,true] spawn LIB_fnc_changeLightStatement";
Removing the % 360 bit yea?
you forgot the modulus
@copper raven not missing 359°?

_dirUnits = player getRelDir _spawn;
_dir = ["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west"] select floor (_dirUnits / 45);
{[west, 'HQ'] sideChat format['Enemy reinforcements coming in from the %1', _dir];} remoteExec['call'];
stahp

huh, so I learned something interesting, I have a CBA_fnc_waitAndExecute scenario in which I want to relay [player] as its arguments...
apparently, when you do that, you no longer have the actual player object, but a snapshot OBJECT of sorts, VARIABLES INCLUDED!
so, when I want to re-issue the wait, I have to do [player] for best results.
LOU_fnc_gimmeDirections 🤣
just add an extra "N" at the end of the array 
["N", "NE", "E", "SE", "S", "SW", "W", "NW"] select ((_dir / 45) % 8);
it has to be rounded, not floored
Code attempt
{
with uiNamespace do {
_tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
}
_tv = forEach [tv1, tv2];
_scr = foreach [tv1, tv2];
Issue
Well and truly stumped, **error missing ; **as a refresher;
Target
to use foreach instead of _tv = missionNamespace getVariable "a3icsmpm1ctpcs6";, to no avail, (error missing 😉 on more than one object screen texture
attempt#1
(used the following resources):
i) https://community.bistudio.com/wiki/forEach
ii) https://community.bistudio.com/wiki/_Syntax#Comments
iii) { systemChat str _x; sleep 1; } forEach [3,2,1]; hint "go";
iiii) { /* do stuff */ } forEach [tv1, tv2];
iiiii) also, I see no Code ({}) on forEach's left
What i did
as far as my knowledge and learning slope permits, i got as far as closing the main bit of code with {}, and, trying to use foreach [tv1, tv2];, instead of _tv = missionNamespace getVariable "a3icsmpm1ctpcs6"; to no avail
Query
Can someone please help advise, it would be much appreciated
Im getting 'any' from this.
code forEach array
so
{ /* some code */ } forEach _array
Patch it with an extra "N" at the end of the directions array
It's not pretty but it works
that's what % does
try 359.1
do you even know what % is?
param you pass
%1, %2 etc
but im still getting any.
I forgot the round
that's why
["N", "NE", "E", "SE", "S", "SW", "W", "NW"] select (round(_dir / 45) % 8);
still any ^^
just that code is fine
you are trying to remoteExec something with an undefined variable
onEachFrame {
hintSilent str (["N", "NE", "E", "SE", "S", "SW", "W", "NW"] select (round(getDirVisual player/ 45) % 8));
};
try that
guys, please dont forget my dissertation message (#arma3_scripting message) on making foreach work with my code, if anyone can help, thatd be great 😄
forEach just means, hey let me take some code and do the code with every element in the array. <code> forEach <array>
code is inside squiggle brackets
im just trying to figure out your thought process in the original code anyways...
sec
Good day. Sorry for probably stupid question, but is there an easier way to store variable values between script calls rather than using 'localNamespace'?
toss what you are doing up as well
my thought process comes from basic understanding of maths, with brackets {} and [], but not competent in coding, hence why im stumped, if that helps 😄
first you dont have any magic variable _x
trying to make one video play on multiple screens via one trigger, via for theeach code (#arma3_scripting message)
localNamespace?
How in all hell do I get append to only add an object to the given array if it is not already in it (unique)
pushBackUnique apparently only allows for Arrays to be modified. Maybe I am just 
what do you mean only allows for Arrays to be modified?
uhm what? can you send some code
x = y pushBackUnique (_dud nearObjects["base",_range]);
This gives me the error message that a number was given but an array was expected
because of x =
as I told you
pushBackunique returns number
okay
_array = [];
{
_array pushbackunique _x
} forEach blah blah
use insert
_earplugsActivated = localNamespace getVariable ["EarplugsActivated", false];
SOUND_TRANSITION fadeSound ( if(_earplugsActivated) then {SOUND_MAX} else {SOUND_MIN} );
localNamespace setVariable ["EarplugsActivated", !_earplugsActivated]
_x = [];
_x insert [-1, (_dud nearObjects["base",_range]), true];
use global variables ...?
would this work?
yes
thanks alot folks, I will try it out right now
localNamespace makes more sense in this scenario.
to avoid overwriting the variable by public flag I guess...
yea, but it's a boolean anyway
it looks like you have two variables that need to be iterated through at the same time which you'll have to find another way around..
you got the scopes backwards
just working with what he gave to give the basic structure. i'm not familiar with doing things with uiNamespace. let me fix it
if he's going to use tv1 and tv2 your old structure would be better
otherwise the game will look for those variables in the uiNamespace
(but they're clearly in the missionNamespace)
killin me lol. furbzeyy, its just {code} forEach [element, element, element];
Is it possibile to remotExec sideChat with a format (and param) 🤔
yes
Looking at the wiki but very confusing
can find a lot of other ways to do it but i need need make a function first.
so i can remotely call it.
[west, 'HQ'] sideChat format['Enemy reinforcements coming in from the %1', _dir]; <--
think A command B is normal, but remoteExec its [A,B] remoteExec [command, destination];
so whats your A and B?
[[west, 'HQ'], format['Enemy reinforcements coming in from the %1', _dir]] remoteExec ["SideChat"]```

yeah but do you understand how he got that?
Does he really need this to be remoteExec'd, it will send sidechat message by CROSSROADS wherever you call it, no?
Uhm
sideChat is local, no?
i do know
now*
according to wiki it has local effect yes
GA, LE
Gale?
woosh
Got it, thank you all
this channel has been popping recently
yeah, but thats exactly what ive done, and it doesnt work?
do you have a _x? cause i saw you didn't earlier
did try _tv = missionNamespace getVariable "tv1, tv2"; also, at first, aswell as foreach [tv1,tv2] both dont work, still looking for a solution
@winter rose can you please help me out here if you could be so kind? trying to figure this out, so can crack on with video prod tomorrow,please 😄
the way I see it right now, is if you choose _x for your setobjectTexture to iterate through, you are going to overwrite your ctrl screen how ever many times
You guys, i cant find the missing link when you ask me questions/suggestion questions, i dont have a knowledge base to fill in the missing blanks, its like filling in the missing blanks on a language test for (e.g, arabic), when you dont even know even the slightest hint of knowledge, although i have made many attempts, all were futile and in vain*
{
_x setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
} forEach [_tv1, _tv2]
this sets your textures to both displays
the problem I'm seeing is that you are grabbing display 1100 multiple times and it overwrites the previous every time if you include that code and its only going to function on the last run of the forEach
Somewhat sure that you can't set videos as object texture
functionality is there but its not "supported"
from KK's blog
1. BIS do not officially use/support this even though the functionality is there, so you are on your own (they did however fix the crash pretty quickly).
2. The sound in not positional and the volume is the same if you are next to the object or miles away.
3. You cannot stop the video once it started playing, but you can know when it is finished.
4. There is currently no way to make video to start on its own on the object, additional UI element must be used to trigger playback.
5. Depending on codec used you might have desync between video and sound.
Evening fellas, I'm having some issues with sector control.
Basically I'm trying to have the sector control tactic apply to AI that I have already spawned in game with a custom script, the same way it applies to those spawned by the Spawn AI module.
So I looked into BIS_fnc_moduleSpawnAI, BIS_fnc_moduleSector, BIS_fnc_moduleSpawnAISectorTactic and their related sub-functions for clues, sadly I wasn't able to find any.
I know that you can sync 'extra' AI to the Spawn AI module and have the Sector Control tactic apply to them, so I checked if BIS_fnc_synchronizedObjects was used in BIS_fnc_moduleSpawnAI to collect synced AI but still nothing.
I've run out of options, any suggestions?
maybe this will help?
https://sqfbin.com/erunezogojaliripoxit
the wiki doesn't list the full function of those. do you need me to pull them from the game for you?
Thanks, but I already pulled them from the pbos. I'm having trouble deciphering where exactly the synced AI fit in
ah okay let me take a look
What direction you guys think this is? : https://ibb.co/wczjVsL
I guess if I can figure out where the synced AI are handled I could probably pass my own AI to the script
West?
Yep, im getting northwest from this lil function tho
_affectedEmitters = [_module,["ModuleSpawnAI_F"]] call bis_fnc_synchronizedObjects;
_allEmitters = allMissionObjects "ModuleSpawnAI_F";
this is the part on tactics. its pulling all synced objects that are attached to the module logic and the units that are synced to the original module only. checking original for a workaround.
I see, what function is this in if you dont mind me asking?
the sector tactics one
@potent dirge heres the hidden main function you can't find in the function viewer i just pulled
that is where entities are sent after the initial module load
so try ["_emitters","_sideStr","_cfgRoot","_side","_groupsVar"] call bis_fnc_moduleSpawnAI_main
This is great. Thanks alot 👍
Alright I'll test this and get back to you 🤞
Is there a way to get a position on a trigger?
of a trigger? or things in a trigger area
the trigger
[_task_name, thisTrigger] spawn {
params ['_task_name', '_trigger'];
for 'i_' from 1 to 3 do {
if(count (allPlayers select { _x distance2D _trigger < 10 }) > 0) then {
why the "_i" line
cuz its gonna spawn 3 times a wave
but if there area no players in the area
mission is failed.
and where do you have this placed?
wym?
where is this code executed?
init
of a trigger? the init box?
no no
init.sqf
_trg setTriggerStatements ["this", "
_task_name = thisTrigger getVariable ['current_task', ''];
[_task_name, thisTrigger] spawn {
params ['_task_name', '_trigger'];
for 'i_' from 1 to 3 do {
if(count (allPlayers select { _x distance2D _trigger < 200 }) > 0) then {
[getPos _trigger, 6] call spawnPatrolUnits;
sleep 120;
} else {
[_task_name, 'FAILED'] call BIS_fnc_taskSetState;
};
};
sleep 60;
[_task_name, 'SUCCEEDED'] call BIS_fnc_taskSetState;
{ playSound 'cp_mission_accomplished_1'; [player, 2500] call HALs_money_fnc_addFunds; } remoteExec ['call'];
{[west, 'HQ'] sideChat 'Mission Completed, you have earned $2500.';} remoteExec['call'];
call createMissionLocations;
deleteVehicle _trigger;
};
", ""];
But wasnt done yet
need to remove trigger once that happends
Hello. I'm looking to spawn a custom AI in the Zeus interface but I can't seem to find any information on this. Anyone know any articles on this?
but yes your distance line is fine
custom units you built configs for?
Oh I need a config. Found what I was looking for, thanks.
[units] call bis_fnc_moduleSpawnAI_main didn't work sadly, gave Generic errors. I tried using group object, an array of objects etc. But no joy
two calls?
two?
you have call call
oh sorry typo no it was a single call
Alright so it seems once the AI get off the boat they just break. I give them waypoints once they got off the boat but they seem to only get to the start of the beach head then all crowd around the squad leader and go around in circles and not do anything. I am not sure what would be causing this but if any of you have an idea please let me know. Thanks.
This is the code inside the innit for the final waypoint
boat5 setFuel 0; boat5 setVelocity [0, 0, 0];
statement = boat5 animate ["Ramp", 1];boat5 say3d "fow_lcvp_ramp_lower";
null = [] spawn {
{
if(((assignedVehicleRole _x)select 0) =="Cargo") then {
unassignvehicle _x;
moveout _x;
sleep 1.2;
};
} forEach(crew boat5);
};
add this to the scope you are in
_path = "\A3\Modules_F_Heli\Misc\Functions\ModuleSpawnAI\";
[
_path,
"bis_fnc_moduleSpawnAI_",
[
"init",
"initEmitters",
"initSpawnpoints",
"initGroups",
"getManpower",
"getRandomGroup",
"getRandomPoint",
"getGroupUnitCount",
"getGroupCost",
"getGroupWeight",
"getGroupComposition",
"getUnitCost",
"getGroupType",
"spawnGroup",
"spawnVehicle",
"cleanGroups",
"cleanGroup",
"startGarbageCollector",
"deleteGroup",
"getCargoSlots",
"countCargoSlots",
"logFormat",
"log",
"mergeGroup",
"generateGroupId",
"main"
]
]
call bis_fnc_loadFunctions;
then retry
Roger that
do you have a waypoint set for the group after they get out?
and try using the action "getout" instead of moveout under arma 3 actions wiki page
I do yes
@fair drum its because they try and get back in
thats the issue.
I just moved the boat to them so it was within reach and they all ran inside and just stayed there then.
So how would I disable the ais need to get back inside the boat?
unassign their vehicle
How do I do that?
unassignVehicle 😐
Ah
but... you already had that in your original code?
or better use:
https://community.bistudio.com/wiki/leaveVehicle
Yeah I do.
Thanks
@fair drum still no luck. It doesnt seem to do anything. I'm using an array of unit(s) as the argument for the function. If I try to use anything other than an array it gives a typeError
eh worth a try tho
hello, I've got a path to an image that we use for HUD overlay, i.e. \A3\ui_f\data\map\markers\handdrawn\warning_CA.paa, or \A3\ui_f\data\map\mapcontrol\tourism_CA.paa... is there documentation, or a way, that we may enumerate these for reference?
I'll try and look into the functions further and trace where the AI goes
is bis_fnc_moduleSpawnAI_main even a function? did not see it documented online; besides which, bis_fnc_moduleSpawnAI itself seems rather "sparse" shall we say in its docs
it is like a compiled subfunction within BIS_fnc_moduleSpawnAI
Like many others it is not documented
it is compiled and ad hoc then?
is there any guarantee it will "be there" between invocations?
Anyway to detect when a specific unit is spawned?
Well I mean its part of the game's pbos...
I'm just curious really; I do not have any special insights other then where/how to consider looking
You can decompile modules_f_heli.pbo if you want to looks at it
it will only "be there" once it's defined (it's a global variable)
Like this? ```_x leavevehicle boat1;
you only need the group
like the squad?
some_group leavevehicle boat1;
and they will exit automatically
Ah
yes
so I need to put the variable name for the composition?
you mean the group? yes
yeah
So Squad1 leavevehicle boat1;
yeah
So, this is the "!" marker, right: "\A3\ui_f\data\map\markers\handdrawn\warning_CA.paa". which one is the "?" "...\handdrawn\....paa" (?)
or is that literally unknown_CA.paa, following the same convention analogous to hd_warning and hd_unknown in the editor?
you'll have to find them manually. they're not necessarily all in one place. (and they're not documented)
They don't seem to want to get out
then throw them out like before
with moveOut
also have you defined squad1?
yea
This is what I got
statement = boat1 animate ["Ramp", 1];boat1 say3d "fow_lcvp_ramp_lower";
null = [] spawn {
{
if(((assignedVehicleRole _x)select 0) =="Cargo") then {
unassignvehicle _x;
Squad1 leavevehicle boat1;
sleep 1.2;
};
} forEach(crew boat1);
};```
that's wrong
[] spawn {
{
if (assignedVehicleRole _x select 0 == "Cargo") then {
moveOut _x;
};
} forEach crew boat1;
Squad1 leavevehicle boat1;
};
What if I locked it
Would they still try and get in?
probably not
Anyway to run a script upon a specific type of unit being spawned? or am I forced to use a loop
I looked through the EH and the only one that seemed close was CuratorObjectPlaced
Alright, I've made some progress on my little sector control thing.
I've figured out that the real AI Sector Tactic is handled by FSM, and I'd easier speak French than figure out what those FSMs are doing, or worse try to replicate them.
Instead I think I'll just inject my custom AI into one of the functions and have it pass along the chain.
So right now all I need to know is how the engine 'calls' moduel functions, specifically what arguments are passed to BIS_fnc_moduleSpawnAI. I know it has at least 3 from looking at its contents, but can't figure out what exactly those arguments are.
fsms are easy, i can show you if you want.
like one big switch do
so i've been working on some modules, this is the usual params that get passed to the function that you point out of the module
I don't know, have you seen the contents of the FSM files in the AI sector control? Plus I think there are other things the function handles as well that I don't know about
Use CBA (or you can create your own if you know what you're doing)
something like requires modding
I'd rather just have BIs function handle everything, and if that doesnt work I can try figuring out the FSMs
these are your 3 params that come to a module
private _modulelogic = param [0, objNull, [objNull]]; //this is the logic itself. think of it as the "object" itself of the module. it contains the variables that are passed from the module you can use get variable for
private _syncedentities = param [1, [], [[]]]; //this is an array of all synced thingys
private _isActivated = param [2, true, [true]]; //this returns true if all triggers are activated and the module starts
bigger example
if !(isServer) exitwith {};
// MODULE PARAM
private _modulelogic = param [0, objNull, [objNull]];
private _syncedentities = param [1, [], [[]]];
private _isActivated = param [2, true, [true]];
//VARIABLE DEFINES
private _units = _syncedentities;
private _rearmClasses = [];
{
_rearmClasses pushBackUnique typeOf _x;
} forEach _units;
private _rearmTime = _modulelogic getVariable ["MagTime", 150]; //these are passed in the module config with whatever people select on the modul
private _persistent = _modulelogic getVariable ["Persistent", false]; //these are passed in the module config with whatever people select on the module
//CODE
if (_isActivated) then {
Hey leo, i just tested a couple missions with;
_dirUnits = player getRelDir _spawn;
_dir = ["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west"] select (round(_dirUnits / 45) % 8);
[[west, 'HQ'], format['Enemy reinforcements coming in from the %1', _dir]] remoteExec ["SideChat"];
But the direction is completly off 
could it be because i use player (player getRelDir _spawn;) 🤔
Gives north are west.
getRelDir gives the relative direction (front, back, left, etc.)
not absolute direction (north, west, etc.)
How do i get absolute direction.
getDir
Ty sir
Thanks for all the help it started working and works like a dream.
For some reason this will not work. When a vehicle hits a waypoint inside that waypoints innit is suppose to be this and what its suppose to do is change the light color inside the vehicle.
This is what it is: statement = "[this,true] spawn LIB_fnc_changeLightStatement";
**This is what I put: **Transport1 LIB_fnc_changeLightStatement true = true; Not sure what I'm doing wrong. Can't find anything about this on the forums so if anyone here has a link to a forum post or knows what I am doing wrong please let me know thanks.
Transport1 LIB_fnc_changeLightStatement true = true; 
that's not even a valid statement
Now that you say it.
it's probably:
[Transport1, true] spawn LIB_fnc_changeLightStatement
thanks
Anyone who know what this means?
Trying to make custom Aircraft list in Warlords.
'...calize "STR_WL_aridrop_restr1";
if (|#|_category == "Infantry" && (count units ...'
Error Undefined variable in expression: _category
File
A3\Functions_F_Warlord\Warlords\fn_WLSubroutine_purchaseMenuAssetAvailablility.sqf [BIS_fns_WLSubroutine_purchaseMenuAssetAvailability]..., line 60
Helicopters just parachute in without any AI inside to land them.
If there is a .sqf file in an existing mod that I'd like to patch (make a small change to), is there any way to patch specific lines of these files, or do I just have to replace the whole .sqf file? The reason I'm asking is because I want to avoid hosting any code I didn't write in my patch mod; only the lines I want to change.
The whole file has to exist for sqf. Hpp and cpp you can do includes though.
I am trying to fire an action once the plane reaches a waypoint but it keeps giving me this. https://cdn.discordapp.com/attachments/825188867820879913/826606995016384562/unknown.png
**My code: ** ```[Transport1, true] spawn LIB_cargoStandUpStatement;
How are you defining _unit?
Go find it lol
Any tips on where I should look lol.
Well you sure your params are correct for that function?
Under config viewer this is what I find under its features
statement = "[this,(call ww2_fnc_findPlayer)] spawn LIB_cargoStandUpStatement";
No, for the others it works like turning on lights but I assume this is different because its dealing with the passengers.
Hello, I'm looking for a script that enables you to set AI as zombie (without mods, a zombie mod in the mod list is a bit too obvious in a "suprize zombie attack mission" and a script that makes it so that dead players will "ressurect" as zombie AI, anyone know some good ones?
hate to break it to you but you might have to use a zombie mod
post the ww2_fnc_findPlayer function
and is there a params []; inside of the LIB_cargoStandUpStatement file?
findPlayer is just missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player];
and cargoStandUpStatement assumes both arguments are objects. it doesnt use params
private _plane = _this select 0;
private _unit = _this select 1;
Inside of the config viewer?
There is a conditions section which has this condition = "[this,(call ww2_fnc_findPlayer)] call LIB_cargoStandUpCondition";
Hi, most programming languages have a continue keyword for going to next iteration of a loop. Is there an analogous feature in SQF?
sqf has continue and continueWith
Great, thanks!
connor just showed you the info you needed
you had [plane, boolean] call.. instead of [plane, unit] call
I didn't see that lol.
is there an equivalent of goto in sqf? it looks pretty useful for sqs
you can use multiple scopes and breakTo
but I don't recommend it
does anyone have an error locator program for script?
Hey guys, made a working teleport script (interact with a map board to get teleported to a nearby FOB) for the player and his squad. However, once teleported I get a big freeze (as the FOB is quite far) that can last a good 20/30 seconds at times! Could I add a "sleep" to it, to simulate a loading time and basically hide the freeze ?
said script : this addAction ["Fast travel to C.O.P Mike", {
params ["", "_caller"];
{
_x SetPos getMarkerPos "marker_cop1";
} forEach units _caller;
}];
this addAction ["Fast travel to C.O.P Mike", {
params ["", "_caller"];
_caller spawn {
/*some blackout effect*/
{
_x setPos getMarkerPos "marker_cop1";
} forEach units _this;
sleep 5; //suspends the script for 5 secs
/*some blackin effect*/
};
}];```
hey , I have zeus scripting question. Can you somehow disable zeus camera rotation (right mouse move) for a while?
Ayo Polpox, thanks!
Check the pinned please
I don't mean you have to delete
ok
what is a script I can add to an ai to make it completely unresponsive to the player's presence or actions(shooting at it)?
for target practice
disableAI
so soldier1 disableAI "AUTOCOMBAT"?
or "all" if you prefer
well autocombat doesn't seem to work
i suppose all will stop them from moving, is there a way to disable all and then enable moving again?
Ok, so i have a video (.ogv) in a subfolder, within the mission folder "temp1.altis\videos\temp1.ogv", but on preview, it cannot be found? help? please
https://ibb.co/ZW2qCk1 <-- when i call in a pickup chopper and it gets destroyed.
Might have found an arma bug.
hey @winter rose
where do i start writing the filepath to have the picture texture found please ? (Does it start in the mission folder to subfolder or..?) (in this case, .ogv) is it;
a) missionfolder1.stratis\videos\temp1.ogv
OR
b) videos\temp1.ogv
?
The mission folder is the root, except for some special snowflakes, everything is searched for relative to that root. Usually it is option b.
ok, so having tried option b), it doesnt work, it says
'no picture found 'videos/temp1.ogv'
not sure what to do...
p.s you calling me a special snowflake? bruh
No, BIS_fnc_StrategicMapOpen is a special snowflake for example
What code are you trying to use this path with?
well, had tried two methods;
- object
- variable name
screen 1 - texture
videos\temp1.ogv
- (trigger - on act - via radio delta)
with uiNamespace do {
_tv = missionNamespace getVariable "screen1";
_tv setObjectTexture [0,"videos/temp1.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
At one point tried to preview scenario with both on
Questions;
- what does BIS_fnc_StrategicMapOpen do?
- what is a special snowflake exactly, never heard of a code be a special snowflake... (if you dont want to answer **question2, dont)
I guess this is a script issue.
Anyone who know what this means?
Trying to make custom Aircraft list in Warlords.
'...calize "STR_WL_aridrop_restr1";
if (|#|_category == "Infantry" && (count units ...'
Error Undefined variable in expression: _category
File
A3\Functions_F_Warlord\Warlords\fn_WLSubroutine_purchaseMenuAssetAvailablility.sqf [BIS_fns_WLSubroutine_purchaseMenuAssetAvailability]..., line 60
@willow hound if it helps;
with uiNamespace do {
_tv = missionNamespace getVariable "screen1";
_tv setObjectTexture [0,"\A3\Missions_F_EPA\video\A_in_intro.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
works
notice, it uses the default .ogv, so,
could it possibly be my video? is that a possibility?
It's not possible to set videos as object textures.
just found that out via trial and curiosity before you mentioned
so
we know
with uiNamespace do {
_tv = missionNamespace getVariable "screen1";
_tv setObjectTexture [0,"**\A3\Missions_F_EPA\video\A_in_intro.ogv**"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
does work, but;
with uiNamespace do {
_tv = missionNamespace getVariable "screen1";
_tv setObjectTexture [0,"**videos\temp1.ogv**"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
does not...
- the file path, names, the videos name, have been cross referenced about 10 times
BIS_fnc_StrategicMapOpen opens a special map view and one of the things that can be done with that special map view is adding images. That's where the special snowflake comes in because if your image is in the mission folder, you need to provide the full path to that image on the hard drive instead of the path relative to the mission root.
So instead of simply using "images\MyImage.jpg" you have to use something like [str missionConfigFile, 0, -15] call BIS_fnc_trimString + "images\MyImage.jpg" to get BIS_fnc_StrategicMapOpen working with your image.
_tv setObjectTexture [0, "\A3\Missions_F_EPA\video\A_in_intro.ogv"];
```What do you mean "this works", the screen remains untouched black. 
maybe, ive just missed a whole bunch of code, courtesy of killzone kid
(original site, fwd to me by @winter rose)
(http://killzonekid.com/arma-scripting-tutorials-ogv-to-texture/)
class RscMissionScreen
{
idd = -1;
movingEnable = 1;
duration = 1e+011;
fadein = 0;
fadeout = 1;
onload = "uinamespace setvariable ['BIS_RscMissionScreen',_this select 0];";
class controls
{
class Picture_0: RscPicture
{
idc = 1100;
text = "";
x = "safezoneX";
y = "safezoneY";
w = "safezoneW";
h = "safezoneH";
autoplay = 1;
loops = 1;
};
--- snip ---
think this is the solution
(also, forward to from earlier, on some trigger activations, the pc screen object does flash white/colours, but doesnt actually play .ogv actual)
hence why my above maybe solution?
Will give it a test and let u know
ok,so...
with uiNamespace do {
_tv = missionNamespace getVariable "screen1";
_tv setObjectTexture [0,"videos\temp1.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "\A3\Missions_F_EPA\video\A_in_intro.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
class RscMissionScreen
{
idd = -1;
movingEnable = 1;
duration = 1e+011;
fadein = 0;
fadeout = 1;
onload = "uinamespace setvariable ['BIS_RscMissionScreen',_this select 0];";
class controls
{
class Picture_0: RscPicture
{
idc = 1100;
text = "";
x = "safezoneX";
y = "safezoneY";
w = "safezoneW";
h = "safezoneH";
autoplay = 1;
loops = 1;
};
Error missing ; (https://imgur.com/0khPd2q) (updated)
bruh, what now? lol
Oh boy, I'm not entirely sure how and why KK's code works (How on earth does the video remain attached to the ingame object?!), but if you want to have any chance at using it with your own video, you are going to have to replace both instances of "\A3\Missions_F_EPA\video\A_in_intro.ogv":
with uiNamespace do {
_tv = missionNamespace getVariable "screen1";
_tv setObjectTexture [0, "videos\temp1.ogv"];
1100 cutRsc ["RscMissionScreen", "PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "videos\temp1.ogv";
_scr ctrlAddEventHandler ["VideoStopped", {
(uiNamespace getVariable "BIS_RscMissionScreen") closeDisplay 1;
}];
_scr ctrlCommit 0;
};
@willow hound dude it works!!! looks so dope aswell, (would send you image of finished item, but cant 😉 )
but appreciate your help, and @winter rose once again haha, thankyou and thanks to the others who also assisted
Further question please, how do i loop/auto replay the .ogv file being played on the pc screen? is that possible? please advise
sleep _videoDuration
repeat
sorry can u provide more info please, just copy pasted
sleep_74
repeat
(https://imgur.com/45WcvO7)
You're doing this in an incorrect context, you need to spawn or execVM it instead of call or something
that makes no sense to me, this is the last call for help will make in #arma3_scripting before going completely silent (as dont really need much further help after, hired scripter doing the rest)**, so any further help would be very much appreciated good sir
so... this applies?
(https://community.bistudio.com/wiki/Scheduler)
Suspension
Suspension is the process to wait a period of time or to wait for something to happen. Commands for suspension are sleep, uiSleep, waitUntil.
Suspension is forbidden in an unscheduled environment and trying to use such command will fail with an error; you must ensure that you are running your code in a scheduled environment and can suspend with the canSuspend command.
Category: Scripting Topics
?
Yes. Seems like you're doing this
ok, will keep it to trigger radio activation on manual repeat (trigger repeatable box tick) then, not feasible to carry out this process at this time, but thanks for the heads up/help dude, also saved me alot of time, much appreciated
Ah, figured it out now. Took me a while. KK is elegantly cheating the system with that video playback 
playing the video as a texture (OK)
playing the video on an invisible control to have the sound
He has to play the video in an invisible control to play it at all, not just for the sound.
When you setObjectTexture on TV, no playback happens, but the texture is loaded. In order to start playback the same texture has to be loaded into RscPicture control, and not just any RscPicture control, but the one that has autoplay = 1
At first I didn't know what to make of this, but now I do. The video is loaded, sized and "attached" to the ingame object bysetObjectTexture, but it doesn't play until the same resource starts playing somewhere else - that is what the hidden control is used for. When you place a bunch of screens, set all their textures to\A3\Missions_F_EPA\video\A_in_intro.ogvand then run KK's code once, all those screens start playing.
okido, the control itself loads the video - noice
hi, very simple answer to my problem probably, but i cant figure out what is wrong.
i have a trigger that will do On Activation this:
hint"The bomb is in the house marked on the map! Help!"; sleep 10; caller1 allowFleeing 1;
So i want the ai(caller1) to say the hint, than wait 10 seconds and run away. the sleep part is calling an Generic error, what do i have wrong? thanks
in 'On Activation' put:
[] spawn {
hint"The bomb is in the house marked on the map! Help!";
sleep 10;
caller1 allowFleeing 1;
};
By putting your code in spawn it will allow you to use sleep (see a couple of comments higher: #arma3_scripting message)
Thanks and sorry for spam!
It's a legit question and learning moment, so no problem 👍
Anyone know what arma's coding/scripting language is called?
Thx
@winter rose is the wiki still locked down from making contributions?
Hello guys, little question
I have a mission in wasteland.pbo its a convoy. i ahve a little bit problem with last AI driver and that is when he (sometimes) reach waypoint he will freeze, if i push him with zeus power he will continue but otherwise he will be still there (wont move)
if (speed _lastCar <= 1) then
{
_lastCar setVelocity [0, 2, 0];
};
i tried to create this lines added in mission file to check its velocity and if he will reach less then 1m/s then add 2m/s (forward) speed, problem is it will run only once when mission is spawned
any idea how to create like a loop or how to do it to check _lastCar speed each 10-30 sec?
Hello, have a question. Is possible to somehow get coords from selection on model, but for camera view?
I have a custom camera - focused on object camera placed just above the object.
// Got screen coords - this way, but for camera - they wrong
_selPositions = [];
for "_i" from 1 to 9 step 1 do {
_selPositions pushBack (the_Obj selectionPosition [format["m%1_axis",_i],"Memory"]);
};
_tdPos = _selPositions apply {the_Obj modelToWorld _x};
_scrPos = _tdPos apply {worldToScreen _x};
while {true} do {
if (abs (speed _lastCar - 1.8) <= 1.8) then
{
_lastCar setVelocityModelspace [0,2,0];
};
sleep 1;
}
it won't really help you tho
if the camera is not the current camera you'll have to do it manually (not use worldToScreen)
understood, thank you!
yea :/ and there is no other way how to do that :/ thx anyway 🙂
You cannot set variables onto projectiles right?
Hi guys, quick question please.
Does using _groupA join _groupB or any of its related commands, add the assigned vehicles of _groupA to _groupB's pool or do I have to do that manually?
And one last question for today 🙂 how to disable AI (one specific AI in car) to get out from vehicle?
_President disableAI "MOVE";
I used this and it doesnt work
yeah, unless something changed
yes but this worsk for whole vehicle crew? doesnt?
🤔
set the AI leader to driver then use setUnloadInCombat
That's what I usually do if I want AI to remain in a vehicle
a sligt interruption :D, does anyone know if there's a command to get the "precise coordinates of the crosshair".
Something similar to getPos cursorObject but without the requirement of an object to exist there.
cursorObject might just work here in fact, but it's not ideal
you'd for sure have to put that unit into a seperate group, then maybe careless behaviour?
allowCrewInImmobile also works for if the vehicle is damaged
hmm
https://community.bistudio.com/wiki/screenToWorld is the closest thing you will get im pretty sure
Have you tried cursorTarget?
cursorTarget seems to still require an object of some sort
haven't heard of this, I*ll look into it
still not close. The crosshair can be on locations other than center of screen
nah, he will still eject himself from vehicle when is under fire
well, tbh center of screen would work for this, too
It's really the same as I'd be looking thru a scope when executing the code anyway
or close nuff for me if not exactly the same
no
Yep, this seems perfect for it. Thanks!
Hey, is there any way to attach an object to something where only the position attachment is preserved, not the rotation? E.g. wanting a large background object like a planet to always move when the player moves, but stay the same distance/orientation away
remember that screen to world does not check for object intersection
you might as well not attach it
just move it yourself
But is there a way to do it?
I want it to follow the player's position, but not their rotation
just move it yourself
With?
an eachframe event handler
Hmmm... alright
What commands would you recommend using with that? SetPosRelative or something?
for testing you can try this:
onEachFrame {
someObj setPosWorld (getPosWorld player vectorAdd [...]);
}
don't use onEachFrame in the final (release) version. use the event handler
np
but when you actually release whatever you're making, be sure to change it to:
https://community.bistudio.com/wiki/addMissionEventHandler
addMissionEventHandler ["EachFrame", {...}]
Will do, thanks a ton!
@tidal ferry also change getPosWorld to getPosWorldVisual (it's smoother for eachframe stuff)
Sure thing, thanks!
@tidal ferry also change use vehicle player instead of player so that it also works when the player gets into a vehicle:getPosWorldVisual vehicle player
(I don't know why I remember the stuff in chunks 😅 )
actually no need (I think)
Sounds good, made no difference either way haha
Hello. I'm trying to run a script that only runs for every unit with the "C_man_p_beggar_F" classname. So far I have this but I don't know exactly what to put in place of the _x.
if (typeOf _x isEqualTo "C_man_p_beggar_F") then {
hint "it works";
};
I'm also running that script from this code here. Should I be using a param with the execVM?
["C_man_p_beggar_F", "init", {[] execVM "killerBunny.sqf";}, true, [], true] call CBA_fnc_addClassEventHandler;
at the very crudest form, you'd put the whole if-then statement in a forEach setup with allunits
{
if (typeOf _x isEqualTo "C_man_p_beggar_F") then {};
} forEach allUnits;
Anyway to make it a little less crude?
also, I believe CBA_fnc_addClassEventHandler doesn't let you bring in parameters from outside of it. so you'd have to use getVariables
no CBA_fnc_addClassEventHandlerArgs yet... (please I want)
depends what you want in context. if you want it on a fast frequency loop, you probably want to do something other than allUnits as its a slow command. Sorry was thinking allMissionObjects
you aren't passing anything to your script, CBA calls the code you pass, passing the object itself,
["C_man_p_beggar_F", "init", {_this execVM "killerBunny.sqf";}, true, [], true] call CBA_fnc_addClassEventHandler;
params ["_object"];
if (typeOf _object isEqualTo "C_man_p_beggar_F") then {
hint "it works";
};
but please avoid execVM, compile your script and store it into a variable, simply use img_fnc_killerBunny = compileFinal preprocessFileLineNumbers "killerBunny.sqf" <args> call img_fnc_killerBunny or spawn if you need suspension
well "init" only allows for "_entity" i believe. so if he wanted to port something else like say, a time variable or a range variable, he couldn't get it into that addClassEventHandler since that command doesn't bring in external args like addEventHandler does
when i load 3 crate in the "y32 xian" with setvehiclecargo command this work perfectly but when i land on a runway the vtol explode when the ground contact the gear
why ? someone have an idea ?
bug? 🤷
i don't know if it's a bug but it's very strange
but the cargo doesn't use the "attachto" command because the attachto command doesn't have collision but what i need to do then ?
So like this?
KB_fnc_killerBunny = compileFinal preprocessFileLineNumbers "killerBunny.sqf";
["C_man_p_beggar_F", "init", {[_this] call KB_fnc_killerBunny;}, true, [], true] call CBA_fnc_addClassEventHandler;
leave just call KB_fnc_killerBunny, _this will carry over
are you doing a monty python scenario?
if you want to suspend (sleep etc), then _this spawn KB_fnc_killerBunny
I don't know enough to make config stuff like mods so that you can spawn the rabbit in as zeus so I'm changing an already made unit. When "C_man_p_beggar_F" spawns they will be replaced by a rabbit that will run to players and start nibbling on their legs. Kinda like a zombie rabbit
so you are doing a monty python scenario lol
remote IEDs/Explosives show up in allMines right?
I don't think so
They should(?)
At least vanilla and ACE stuff does
or at least did (didn't test it recently)
So I think I messed something up and I'm not sure what.
initServer.sqf
KB_fnc_killerBunny = compileFinal preprocessFileLineNumbers "killerBunny.sqf";
["C_man_p_beggar_F", "init", {[_this] call KB_fnc_killerBunny;}, true, [], true] call CBA_fnc_addClassEventHandler;
killerBunny.sqf
params ["_rabbits"];
if (typeOf _rabbits isEqualTo "C_man_p_beggar_F") then {
hint "It works";
];
Hint won't show up
testing in a MP scenario rn
listen server or dedicated
planning to run this on a dedicated server tho
server
Trying to only hint for those who are "C_man_p_beggar_F"
I think you are doubling the array. correct might be:
initServer.sqf
KB_fnc_killerBunny = compileFinal preprocessFileLineNumbers "killerBunny.sqf";
["C_man_p_beggar_F", "init", {_this call KB_fnc_killerBunny;}, true, [], true] call CBA_fnc_addClassEventHandler;
still doesn't work
killerBunny.sqf
params ["_rabbits"];
if (_rabbits =="C_man_p_beggar_F") then {
hint "It works";
};``` ?
nope
params ["_rabbits"];
if (typeOf _rabbits == "C_man_p_beggar_F") then {
hint "It works";
};``` ?
That's the same as
params ["_rabbits"];
if (typeOf _rabbits isEqualTo "C_man_p_beggar_F") then {
hint "It works";
];
isEqualTo is just more efficient than ==
no the bracket is wrong
badda bing, there it is lol
also isEqualTo is case sensitive, might be a source of error in other cases
I'm an idiot
Alright, remarkably stupid question here- is there any function or method to get the same functionality as eyePos, but with 3rd person camera instead of 1st person camera?
positionCameraToWorld
Ah right, thanks!
To flex my last brain cell even harder, what's the best way to get the current position of the player camera?
Nvm, may have got it
Actually, would CameraOn be the right direction in getting the cameraPos for positionCameraToWorld?
positionCameraToWorld [0,0,0]
That works great, but I get the same issue I had before using eyePos, where the background object I'm moving with the player's screen keeps bobbing whenever I move the camera
Probably can't be fixed but thanks for the assistance!
what exactly do you want to do, and how do you do it?
So basically, one of the people in my unit makes custom planet models, and I'm working to get it so we can basically upscale a planet and skybox and get it to appear in the distance as if it were actually in the night's sky
Someone earlier helped me get it working, and it works great for night sky
Can someone give me a quick idea bout how to trigger a script on a remote machine, with arguments? Is there an event handler for that? Or what?
But when you're indoors, there's just this tiny little bobbing effect that gives away the illusion- it's not noticable with the skybox but it is with the planets
Did some changes to the code, I replaced getPosWorld with eyePos and it fixed it in first person, but still not working in third person
And sure @drifting sky, not as experienced as others here but I can try to help, what are you looking to do?
You'd probably want to use remoteExec for that IIRC https://community.bistudio.com/wiki/remoteExec
forgot to mention: A2OA.
Ah, yeah sorry, no clue
I'm thinking CBA events are what I'm after, but I'm not sure.
RE?
can RE execute custom scripts?
it has execVM 🙂
and I can specify only to run on specific machines, such as the server?
afaik yes - but why do you want to remote exec it? the trigger can happen on the server, and if isServer then { ... } no?
I want a player to be able to initiate an action which happens on the server
for example, buying a unit and adding it to the group in which the player belongs
maybe publicVariableServer and callVar (but that's hacky I would say)
buying a unit etc can happen client-side eventually
eh, well the server needs to verify certain constraints
RE + execVM I would say then
you could execVM with a function name as a parameter, that could do
i'm reading the wiki for that function now. So far not seeing where i specify to run on server only
Anyways, basically it's working in 1st person, but still broken in 3rd- I can use cameraView to check POV and switch between position methods, but I'm not sure what the best way to do that for 3rd person is, or if there's a more efficient way to do it
make a logic, logics are local to the server
(or an AI)
What exactly is a logic?
F7 iirc, a logic is a virtual unit
ok, so how would i use it to solve my problem?
geez, isn't there just a generic run this script on that machine with these parameters, function?
create one logic
name it "server"
use "server" as target for RE
just a sec
okay, so here's the syntax for RE: [nil_or_caller, nil_or_target_object, "loc", script_to_execute, par0, par1...] call RE;
So target_objects, would be the "server" logic?
and server doesn't need anything in it, just an empty logic?
yeah
okay, what's the deal with the "caller". Is that made available somewhere on the machine in which the function is executed?
IDK, the page is all there is
yeah, but BIS wiki is hard to understand
yeah A2AO
um, it's not clear to me how to set up parameters for a script with rEXECVM
I presume one of the params needs to be the script name
but then I need to get the actual parameters for that script in there as well
maybe you can decompile A2 campaigns to see how it's done (and tell me so I can amend the page)
or make your own framework with addPublicVariableEventHandler, too
I was thinking something like that, but I'm not sure how to handle conflicts, for example, when multiple clients are manipulating the same variable
whether or not the ev will necessarily trigger for each change
or what
IDK 🙃
I'm thinking CBA event handlers are what I'm really after. However, I'm struggling to find documentation for CBA.
I seem to recall there's some way to read documentation in game, but I don't remember how to.
using the debug console, [] call BIS_fnc_help for functions info
actually, i just found the doc for cba. So I'll be reading that for a bit.
damn it, if anything their documenation is even worse than bis's. Is dev-heaven totally dead, or what? I try to follow links there and get nothing but a blank screen.
dev-heaven is dead yes
I am a bit confused with this code. It creates multiple concentric rings each time the for loop runs, but I wish it to start high and move down each time it runs, but I cannot work oput how to change the _zpos each time it creates a ring.
LtargetPos = [12302,17686.3,0];
_radius = 200;
while {_radius > 0} do {
_k = 0;
for "_k" from 0 to 360 step (270 / _radius) do {
_xpos = (LtargetPos select 0) + ((cos _k) * _radius);
_ypos = (LtargetPos select 1) + ((sin _k) * _radius);
_zpos = (LtargetPos select 2) + 150;
_location = [_xpos,_ypos,_zpos];
createVehicle ["Sign_Sphere200cm_F", _location, [], 0, "CAN_COLLIDE"];
};
_radius = _radius - 20;
};
I want it to create a cone shape instead of a huge set of concentric flat rings.
define the _zPos outside of the while 🙂
and reduce it on each loop
Thanks.
Does anybody know if addPublicVariableEventHandler will fire every time the variable it is attached to is changed, even if it changes several times in a single server tick?
I'm trying to spawn each rabbit Exactly on the position of their beggar but they seem to spawn generally around where the beggar was. Anyway to put them directly on the position of where the beggar was?
params ["_rabbits"];
if (typeOf _rabbits isEqualTo "C_man_p_beggar_F") then {
_currentUnit = _x;
deleteVehicle _currentUnit;
{
_bunnySpawn = getPos _currentUnit;
KB_rabbit = "Rabbit_F" createUnit [_bunnySpawn, createGroup [civilian, false]];
} foreach [_currentUnit];
};
yes, getPosATL the unit and setPosATL again after their creation
I get an error with KB_rabbit setPosATL _bunnySpawn;. I also get an error with deleteVehicle _currentUnit; when I spawn a new "C_man_p_beggar_F".
params ["_rabbits"];
if (typeOf _rabbits isEqualTo "C_man_p_beggar_F") then {
_currentUnit = _x;
deleteVehicle _currentUnit;
{
_bunnySpawn = getPos _currentUnit;
KB_rabbit = "Rabbit_F" createUnit [_bunnySpawn, createGroup [civilian, false]];
KB_rabbit setPosATL _bunnySpawn;
} foreach [_currentUnit];
};
_currentUnit = _x;
deleteVehicle _currentUnit;
``` is outside the forEach loop so _x is not defined
is this the same thing you were trying to do earlier?
The killer bunny 🐰
that if is redundant, it will always be true, _rabbits is not just some random variable, it's the reference to the unit, _currentUnit = _x; thats not how it works, plus you already have the unit reference from the params, you named it _rabbits for some reason.
setPosATL fails because the syntax you're using for createUnit doesn't return the reference to the created unit
yeah I don't know how to reference a created unit
I thought KB_rabbit = ... was the way you can reference a spawned unit but it doesn't seem to work.
that syntax of createUnit doesn't return anything
I honestly have no clue what to do
createUnit has two syntaxes
use the other one
also rabbits should be created with createAgent, not createUnit
Also can you tell rabbits to move to a specific position if they are spawned? or do I have to attach them to an invisible person
you can but they're slow
anyway to speed them up?

maybe setAnimSpeedCoef
alrighty
I'm getting an error with [_spawnedAnimal] call WAG_animalAttack;, it's saying that it's an undefined variable.
call compile preprocessFileLineNumbers "JBOY\JBOY_AnimalAIFuncs.sqf";
call compile preprocessFileLineNumbers "WAG\WAG_AnimalAIFuncs.sqf";
params ["_replacedAI"];
//Settings
WAG_animal = "Rabbit_F";
WAG_docileSpeed = "LIMITED";
WAG_hostileTo = ["EAST", "WEST", "INDEPENDANT", "CIVIALIAN"];
WAG_animalDetectionRange = 50;
deleteVehicle _replacedAI;
{
_animalSpawn = getPos _replacedAI;
_spawnedAnimal = createAgent [WAG_animal, _animalSpawn, [], 0, "CAN_COLLIDE"];
[] spawn {sleep 0.1};
[_spawnedAnimal] call JBOY_spawnAnimalAI;
[_spawnedAnimal] call JBOY_enableAnimalToMove;
[_spawnedAnimal] call WAG_animalAttack;
} foreach [_replacedAI];
WAG_AnimalAIFuncs.sqf
WAG_animalAttack =
{
params["_animal"];
_target = nearestObjects [_animal, ["Man"], WAG_animalDetectionRange;
hint _target;
};
[] spawn {sleep 0.1};
_animalSpawn = getPos _replacedAI;
you deleted that already
} foreach [_replacedAI];
why?
_target = nearestObjects [_animal, ["Man"], WAG_animalDetectionRange;
missing]
(but again why?!)
[] spawn {sleep 0.1};
I was getting an error without calling the sleep.
And the rest is me being an idiot.
_animalSpawn = getPos _replacedAI;
you deleted that already
I don't get what you mean.
} foreach [_replacedAI];
why?
Should I not run it for each beggar?
spawned code detaches from the current code
so that does nothing
oh yeah. I have to put the rest inside the spawned {}
I don't get what you mean.
you deleted that unit
Should I not run it for each beggar?
there's only one unit. why forEach?
Also the forEach has no _x, no point to do it
And please check the spelling in
WAG_hostileTo = ["EAST", "WEST", "INDEPENDANT", "CIVIALIAN"];
WAG_hostileTo is used nowhere, also since they're just strings will do nothing?
How can I give a random value for R, G, B?
cursortarget setobjecttexture [0,"#(argb,8,8,3)color(R,G,B,0,co)"];
format ["#(argb,8,8,3)color(%1,%2,%3,0,co)",random 1,random 1,random 1]```
Good, thanks!
Morning all!
Bit of a niche Question this morning, would the following Script in the execute box in Zeus mode, Lock out (and off) the Autohover ability for Rotary Assets?
chopperOne action ["autoHoverCancel", chopperOne]
hey , I have a question. Is it possible to disable zeus camera moving such as the rotation?
Probably you can set the Zeus camera position/rotation for each frame to achieve this
hey guys i know this is a bit off the subject but i thought i might be able to get some help, im trying to find a way to call a value in a xml config like set/get var but not having much luck
loadFile and some process to profit I guess
thx POLPOX, I will try that 🙂
Quick one; does setOwner change its locality I forgot, when done on a vehicle
If it's AI Driven probably yes
If player is in it I'd assume it fails
But cannot be certain without testing
right right
I tried this code but it doesn't stop the camera from rotating;
@proven charm see pinned messages about how to post code (```sqf) 😉
ok thx 🙂
https://community.bistudio.com/wiki/Arma_3:_Curator#Camera
Use this method
camLastDir = vectorDir curatorCamera;
addMissionEventHandler ["EachFrame",
{
curatorCamera camSetDir camLastDir;
curatorCamera camCommit 0;
hintsilent format["TESTING %1 %2",curatorCamera, camLastDir ];
}];```
@proven charm and that's because vectorDir returns an array, and camSetDir takes a number
Looks like it takes an array?
@cosmic lichen Found the problem, i was trying a local command too quick. The owner transfer was too slow, and the script was already trying the local command and failed
ty all! it works now 🙂
HAH!
direction: (Prior to Arma 3) [[Number]] - direction in degrees, range 0 to 360.
direction: (Since Arma 3) [[Array]] - direction of camera
then someone removed the Number, how nice è_é
is there a way to make the (Portable Lights (single) light up in the day? (need it for a portrait photoshoot of my character 😄 )
Why has BIS_fnc_endMissionServer recently changed to "somewhat deprecated" on the biki?
because it uses BIS_fnc_MP in its code which is not ideal. instead remoteExec BIS_fnc_endMission on all clients will work too. Only advantage that this function gives you is to automatically determine the endType of the mission
ah, I see. Thank you
Is addItemToBackpack command multiplayer-friendly or it needed to be broadcasted via remoteExec?
I know about this wiki entry, but there is no information about how it works in multiplayer environment
Global Arguments
Global Effect
Anyway to make all factions hostile to civilians? kinda like how they do it with zombie mods?
setFriend?
Oh. Didn't even know that existed. Thanks
inb4 a warcrime time
You probably can't set a single unit to be hostile to everyone right?
make civilians enemies to everyone?
I'll probably just make them inde then so they can be hostile to almost everyone
Making custom factions sides needs to be a thing
Side relationships are handled by sides, not factions... sadly. So you can't make AAF and Syndikat hostile (directly, there's some workaround though)
meant to say sides
i think ravage creates a new side that works well. might want to look into how they do it
Huh? Is this even possible? Sides are completely Engine-driven I thought
so when i was messing around with it, they had an option for a rogue faction. at first i thought they just did some sort of add rating manipulation, but when you go into zeus to look at the units, they represent a whole different color other than blue, red, green, purple. I think it was yellow like an object color.
other thing i could think of is some sort of doStop manipulation on team leaders since I screwed up a script once that had doStops and what ended up happening was the squads left the opfor side and joined a "yellow" unknown side that was hostile to everyone. I should look into how i accidentally did it.
yellow being objects, so maybe agents?
well then these agents were allowed to function as normal AI as far as targetting and visual cones and stuff
Any way to disable "Eject" action on aircraft?
lock doesn't work for some reason
What are you trying to achieve?
I have custom action - paradrop from aircraft
If player will use default "Eject" action, he will bypass code tied to this custom action
They're controlled by UserActions config, which doesn't have any condition related to the lockstate
Since Arma 3 Jets introduced a scripted ejection system, this is how it is
and that means there is no way to remove it, right?
condition = "player in this && {speed this > 1}";Technically you can remove, technically
buuuuuuuuuuut?
But make your plane stop midair isn't what you wanted to do
well, i guess it's looks like it's time to do old good waitUntil {vehicle player != aircraftVehicle} 😅
to be honest, i noticed that everything that touches player input should be as quick as possible
You can _plane setVariable ["bis_ejected",true]; even before you do an eject action, so the ejection function will be terminated
https://community.bistudio.com/wiki/addRating add a negative value like several thousand and they'll be changed to side enemy like a team killer does
this means everyone, including their own side/group will shoot them tho
Addon 'CUP_Afghan_Data' requires addon 'CA_E'
^Anyone know what's throwing this error? Or what addon CA_E is from?
CA_E should be inside cup
I know, but any idea what it does? I've got it loaded on our server but it's throwing this as not being loaded
Think it might be corrupted but I'm not sure
sounds like corrupted to me
Alright
Do you know if it's CUP Core or Terrains?
Will save a lot of time on downloads if it's the former
CA_E should be core
Hmmm... just redownloaded Core, and it's throwing the same erroor
Going to try redownloading Maps just for the hell of it, but I'm open to suggestions
Anyone know where I can find some info on making an invisible ai target?
Try these:
Anyways, reinstalling CUP didn't work
Any suggestions on the error?
Try checking the mod PBOs. I know once with ace I had to manually delete the old PBOs when it updated
also #arma3_troubleshooting (and be sure to subscribe from the original CUP, not a reupload of course)
Good day. I can't find, is there a command to holster a weapon (make unit empty handed) ?
try _unit selectWeapon "" maybe?
Nope, does nothing, but thanks for sharing
Is there any condition to check if a vehicle is in a spezific gear? I want to make a reverse driving sound for a truck
I believe you can check if speed _vehicle is < 0
there are no gear-related commands unfortunately
ok thanks
I use this:
this action ["SwitchWeapon", this, this, 100];
Thanks a lot, man!👍

