#arma3_scripting
1 messages ยท Page 663 of 1
its armas way of telling you where the error is
disableAI #"MOVE";
This is wrong
<object> disableAI <property>
}; forEach units _gGroup;
i know the hash isnt really there i was indicating like arma does
}; is wrong
if (isServer) then
{
_allpositions = nearestBuilding _gGroup buildingPos -1;
_gGroup = [getPos aPosition, independent, 5] call BIS_fnc_spawnGroup;
{
_randomPos = _allpositions deleteAt (floor (random (count _allpositions)));
_x setPos _randomPos; disableAI "MOVE";
} forEach units _gGroup;
};```
actual script,
arma is throwing missing ; between disableAI and "MOVE"
no
it's just a rough indication of where something is wrong
I showed you the error
...
if (isServer) then
{
_allpositions = nearestBuilding _gGroup buildingPos -1;
_gGroup = [getPos aPosition, independent, 5] call BIS_fnc_spawnGroup;
{
_randomPos = _allpositions deleteAt (floor (random (count _allpositions)));
_x setPos _randomPos;
_x disableAI "MOVE"; // FIXED HERE
} forEach units _gGroup;
};
yeah yeah i just noticed that now im getting a different error yay
Revo,
[player, ["cp_mission_accomplished_1", 1000, 1] ] remoteExec ["say3D"];
Would this play a sound that everyone can hear?
probably not
since player is not defined on the server
Are you sure you want the player to play the sound?
well the goal is to play a sound when objective is done (its in the EH)
but i want all players to hear it.
// Objective Event Handler (check if alive)
[_objective,["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
[taskName, "SUCCEEDED"] call BIS_fnc_taskSetState;
[player, ["cp_mission_accomplished_1", 1000, 1] ] remoteExec ["say3D"]; // SOUND HERE
}]] remoteExec ["addEventHandler",0,_objective];
Sorry to butt in but might i ask is this even the right code to change the vanilla splashscreen? c++ class RscStandardDisplay; class RscDisplayStart: RscStandardDisplay { class controls { class LoadingStart: RscControlsGroup { class controls { class Logo: RscPictureKeepAspect { text="\mv_data\ui\logo.paa"; onLoad=""; }; }; }; }; };
@copper narwhal #arma3_config And I don't know. Test it
I dont think its working for me
about the channel also sorry ill move it to there
@cosmic lichen got a problem nearestBuilding neads an object is there any way to get the name of the leader of the group i spawn in
Why not remote execute playSound since you're already using CfgSounds?
[player, ["cp_mission_accomplished_1", 1000, 1] ] remoteExec ["say3D"];
Isn't this remoteExecing
?

It is
But player is evaluated and is null or nil on the server
and null or nil is send to the other clients. EDIT: It's objNull
thanks
Also I'm not entirely sure if adding the Killed EH on every client and then also remote executing the sound to every client is a good idea. Not sure about Killed EH MP behaviour though.
R3vo
Yeah, double check the locality of MPKilled
Mmmm
again thanks for the assist R3vo
yw
// Objective Event Handler (check if alive)
[_objective,["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
[taskName, "SUCCEEDED"] call BIS_fnc_taskSetState;
[player, ["cp_mission_accomplished_1", 1000, 1] ] remoteExec ["say3D"]; // SOUND HERE
}]] remoteExec ["addEventHandler",0,_objective];
Well this code only executes for the guy who starts the mission.
its in a function for starting the mission so..
not sure?


What about ?
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
}];```
I am not sure if you need to kill multiple units or just one specific one
_objective = createVehicle [selectRandom _vehicleList, _markerPosition, [], 0, "CAN_COLLIDE"];
Just one
a truck for example.
_randomTruck= random 1 ??? @heady quiver
?
nah nevermind
its select a random from an array
truck, car, etc
Not sure where you got that idea x)?
But i was asking about EH's
@cosmic lichen How would i change to locally?
Have you ever read https://community.bistudio.com/wiki/remoteExec ?
createVehicle
attach EH
Always read the documentation when using any command for the first time.
Always read the documentation when using any command for the first time. ๐
๐
But in the execRemote it asks for a objective for example
but in
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
}];
it doesnt
What are you now doing? Have you fixed the error I pointed out earlier?
Objectiv?
yeah got it wroking and the bunch of other errors
variable
remoteExec ["addEventHandler",0,_objective];
how would i point out to the EH that he needs to check the _objective var.
params remoteExec [functionName, targets, JIP]
What is he doing?
Yes, but now i need to do it locally you said.

cuz there is no need to add EH to all clients yes?
How long have you been in #arma3_scripting now?

๐คฃ
_objective addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
[taskName, "SUCCEEDED"] call BIS_fnc_taskSetState;
}];
_objective addEventHandler ["Killed", {
[taskName, "SUCCEEDED"] call BIS_fnc_taskSetState;
}];
Added where _objective is local
_objective addMPEventHandler ["MPKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
if (local _unit) then {
[taskName, "SUCCEEDED"] call BIS_fnc_taskSetState;
{ player say2D "cp_mission_accomplished_1"; } remoteExec ["call"];
};
}];
wow wow
I see you have read the addMissionEventHandler page.
productVersion should
addMPEventHandler vs addMissionEventHandler
addMPEventHandler executes on all players
BUt thats not needed.
I tried productVersion, but it shows the client platform, not server platform. @still forum
if you execute on server it shows the server platform
oh... really? I just tested it on debug console, and clicked local. thanks.๐
Because there is not ONE way
addMissionEventHandler variant, though the objective variable needs to be global.
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
if (_unit == objective && local _unit) then {
[taskName, "SUCCEEDED"] call BIS_fnc_taskSetState;
{ player say2D "cp_mission_accomplished_1"; } remoteExec ["call"];
};
}];
Oke ๐ค , doesn't it need to be objective addMissionEventHandler then ?
โ๏ธ
x)
you have no power here ๐
๐ฆ
oke oke it works
thanks guys..
I can't imagine how you guys must feel after so many questions x)
I wrote the original remoteExec he was using. I added it for all clients rather than only where it's local because it's an enterable vehicle and so could change locality.
Good to know.
Quick question if i put on the initServer this: testVar = 1; does that mean that everyone has that available to them?
or do i need to set it global
Only the server has that then.
can i stack two color corrections on top of each other? say i want a brownish color then screen that with greenish color
colors are rbg format so yeah you can add them together
not sure in what context tho
solution is to create two colorcorrection effects with different handles and overlap them making sure your priorities are correct with the colors.
Yeah you can stack them like that
hey I tried that scriped apparently theres a missing } within it
if ( isServer ) then{
[this, "AmovPercMstpSnonWnonDnon_exercisePushup"] remoteExecCall ["playMove", this, true];
this setVariable ["TAG_originalPosition", getPos this];
this addEventHandler ["AnimDone",{
params ["_unit", "_anim"];
if ( toLower _anim == toLower "amovpercmstpsnonwnondnon_exercisepushup" ) then{
[_unit, "AmovPercMstpSnonWnonDnon_exercisePushup"] remoteExecCall ["playMove", _unit, true];
_unit setPos (_unit getVariable ["TAG_originalPosition", getPos _unit]);
};
}];
};
sqf lint and VSC is your friend, friend
if I wanted to make say half the screen one color and the other part another (sort of like a horizon) would i use the radial access parts?
there isn't. it's a misplaced ]
Yes that should work
ah, looked like a } from distance
thanks
yep wrong closing bracket. fixed the original message
im not sure, but there are (afaik) invisible target object (aka dummy humans) which you could maybe use. i think cba has that?
Ill look
there is, though not sure how to make them function, they dont work out of the box
though I wonder if theres a script to make a enemy unit invisible but AI will still engage it.
are triggers a big hit to performance if just using them to detect the player
the size of the trigger and the amount of triggers matter
as always, try to keep things small.
10m trigger np but 3km trigger...
on a timed loop. sleep 5 or sth like that
want to make a crap ton of radiation hot spots i think using markers and inArea will work well
so I'd like to learn how to do a parameter check for things I create. Could someone post an example for one of the parameters in the following so I can kinda get an idea and make the rest? Use of param to do it.
/*
Filename: ionStorm.sqf
Author: Hypoxic
Parameters:
[0] = Object or Array [x, y, z]
[1] = Radius (Number)
[2] = Intensity (Number from 1 to 5)
[3] = Time (Number in seconds)
*/
params ["_pos", "_arearadius", "_intensity", "_time"];
private _timer = [_time, false] call BIS_fnc_countdown;
private _interval = linearConversion [1, 5, _intensity, 10, 2, true];
while {[true] call BIS_fnc_countdown} do {
private _target = createvehicle ["land_HelipadEmpty_F", (_pos getPos [random _arearadius, random 360])];
[_target, nil, true] call BIS_fnc_moduleLightning;
uiSleep random _interval;
deletevehicle _target;
};
params [["_pos", objNull, [objNull, []], 3],..]
[variableName, defaultValue, expectedDataTypes, expectedArrayCount]
should I be using param for this now that I think about it? or something like a if then check for the datatype given and if it doesn't match, have it do an exitWith or error message?
that's what this is already doing
Robust functions that Just dont accept false inputs are the best way
Otherwise you get wierd unwanted stuff happening
it's only necessary for functions with a public interface
if it's something "private" it's not really justified (especially if performance matters)
not sure but i think this will work key word 'think'
if (isServer) then
{
_radiation = ["m1", "m2","m3"];
_gasmask =["g_airpurifyingrespirator_02_black_f", "g_airpurifyingrespirator_02_black_f", "g_airpurifyingrespirator_02_sand_f",
"g_airpurifyingrespirator_02_olive_f", "g_regulatormask_f"];
while {true} do
{
{
if (_x !(inArea in _radiation) && (!(toLowerANSI goggles _x in _gasmask)))then
{
_x setdamage (damage _x + 0.1);
}
} forEach allUnits;
sleep 10;
};
};```
For each unit, you also need to check each radiation area
private _unit = _x;
if (not ((toLower (goggles _unit)) in _gasmask)) then {
{
if ((getPos _unit) inArea _x) exitWith {
_unit setdamage (damage _unit + 0.1);
};
} forEach _radiation;
};
} forEach allUnits;
sleep 10;```
some edits added ^
(_x !(inArea in _radiation) does this not do the same thing with _radiation being an array of markers ? and and _x being allUnits
what on earth is that?

https://community.bistudio.com/wiki/inArea
check out the syntax for inArea
position array or object inArea Marker
forEach _radiation
toLower
first of all inArea is faster than in
second of all those "edits" were either unnecessary or nonsense
_x representing all units ! in any of the markers listed in the array
that's not the problem
then what is instead of getting on here and shiting on my attemt you help me
that would be my attempt
tell me what the hell im doing wrong
@winter rose can I borrow your railguns plz?
@still forum or yours?
@tough abyss ,
_radiation = ["m1", "m2","m3"];
Are these markers?
literaly every time i have posted a bit of script instead of helping the first thing you do is give me hell for my attempts
@crimson walrus yes
https://pastebin.com/jhDevesh
edit: there are errors, hold on ^
im sorry itsd not my fault every time i post a bit of script the formula seems to freeking change for what works
alright, that's better.
for each unit, we check if they're not wearing a gas mask
if not, we check if they're in any one of the radiation markers
if so, damage the unit
Hi guys, how would i check if fobCargoBox = createVehicle ['B_CargoNet_01_ammo_F', getPos player, [], 0, "CAN_COLLIDE"]; is undefined ?
isNil "fobCargoBox", I think.
Yea thought so myself but that didnt work
how do you add crew to specific positions in a vehicle?
moveInDriver/Gunner/Commander/Turret
sooo... how much will I slow a mission if I add 3000 objects loool. might need to tone it down...
may wanna ask the mission_maker boys on that
its a joke. its going to cause problems.
is there any primary difference between executing code during gameplay and having code execute in a config file on init? or is it the same thing?
Same code, but some initialisation happen before/after others, see the wiki to see the order
(thanks! I'm on mobile)
wow thats a great page. I feel like that should be pinned somewhere.
too many great pages to pin
true lol
i suggest bookmarking these ones since they are the most frequented...
https://community.bistudio.com/wiki/Category:Arma_3:_Scripting_Commands
https://community.bistudio.com/wiki/Category:Arma_3:_Functions
https://community.bistudio.com/wiki/Description.ext
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
make a nice arma 3 bookmark folder
nice! is there also like a set of tutorials i can watch to get a solid foundation on arma 3 scripting? i think im hitting the ceiling with config files that scripts on init might by able to fix...
i've looked through a lot of youtube videos when I was learning and theres not really much that is great. I've been thinking about making a comprehensive beginners guide but haven't really gotten around too it. best to ask things here and we can point you to things
Killzone Kid has a nice site, but I don't think its really for beginners. http://killzonekid.com/
fobCargoBox = createVehicle ['B_CargoNet_01_ammo_F', getPos player, [], 0, "CAN_COLLIDE"];
Does anyone know how i can check if the var fobCargoBox is set at all ?
(undefined)
do you want a boolean as a result?
yes.
Because i wanna see if there is a cargo there already, if so remove that and create a new one.
isNull fobCargoBox; //returns boolean for an object (needs to be entity)
isNil "fobCargoBox"; //returns boolean for a variable
but that variable is not set at all when checking for the first time.
heyyy
that worked
or not.
undefined Variable fobCargoBox
send the whole code with https://sqfbin.com/ if its long
if!(isNull fobCargoBox) then {
// Delete Previous FOB
createdFob call BIS_fnc_removeRespawnPosition;
deleteVehicle fobCargoBox;
};
Okay well, I basically want to add 5 different types of units to 5 separate positions in an empty tank on init.
try
if !(isNil "fobCargoBox") then {};
how's that Jet's DLC action named?
so for this you will need a few things...
1.) class names of the units you want to add
2.) name your vehicle variable
and when you make your script you will need:
createVehicle
join
moveInAny
moveInCargo
moveInCommander
moveInDriver
moveInGunner
found it, seems to be https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
cool ill start with that
at the start of your script, create the units, then join their groups with join, then use the moveIns to move them into the tank
you can use the position of [0,0,0] or a "debug island" position to create them because it won't matter when you move them.
so how do i make it so this executes from a config? i use the eventhandler class right?
then whatever script i want to use goes under:
{
init = VEHICLE CODE
};```
yes im using cba
check out this bad boy https://cbateam.github.io/CBA_A3/docs/files/xeh/fnc_addClassEventHandler-sqf.html#CBA_fnc_addClassEventHandler
you can use init with it
wow that looks way more streamlined.
@little raptor only rule violations I saw is from you
Though I ignored plenty of violations from Darklight in the past and just deleted them
Does anyone know if the new Suppressed Event Handler works on Agent Units?
I had my reasons
no
can someone explain the math behind wanting a square root vs just a random radius if you want true random position?
// random radius
private _angle = random 360; // angle definition (0..360)
private _distance = random _radius; // distance from the center definition (0..radius)
private _position = _center getPos [_distance, _angle];
// random position
private _angle = random 360; // angle definition (0..360)
private _randomSquareRoot = sqrt random 1; // random square-root to obtain a non-linear 0..1 value
private _distance = _radius * _randomSquareRoot; // distance from the center definition (0..radius)
private _position = _center getPos [_distance, _angle];
is it essentially creating a random percent to multiply the radius by?
I think second example returns positions closer to the center more often than not:
https://www.wolframalpha.com/input/?i=plot+sqrt(x)+from+0+to+1
thats not a true random position then within a circle if it favors the center?
Agreed.
How would you react then?
interesting, it appears we actually have it the opposite way
https://sqf.ovh/sqf math/2018/05/05/generate-a-random-position.html
Interesting, I like your source.
"the area of a circle grows with its radius squared"
makes sense
I didnt take anything past calc 1 so I'm pretty garbage at math
I ignore such people and stop replying.
And tell them "okey if you don't want help then bye"
@little raptor you are one of the most helpful and knowledgeable guys around these parts so don't let a few rude people mess with your peace of mind...
Whats going on?
Hi folks, I've got a particle effect that I want to trigger for 0.2s after a player fires - I can't figure out how to set a timer and remove the particle effect, currently it just runs endlessly (and my understanding is I can't use sleep because it's in an eventhandler). Anyone able to spare me a few brain cells? Thanks!
Code:
player addEventHandler ["Fired", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; _ProjectileVelocity = velocity _projectile; _ProjectileVectorDir = vectorDirVisual _projectile; _ProjectilePos = getPosVisual _projectile; private _ps1 = "#particlesource" createVehicleLocal _ProjectilePos; _ps1 setParticleParams [ ["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 9, 16, 0], "", "Billboard", 1, 0.2, [0, 0, 0], [(_ProjectileVelocity select 0) *-.01, (_ProjectileVelocity select 1) *-.01, (_ProjectileVelocity select 2) *-.01], //velocity 0, //rotation 10, //weight 7.9, //volume 0.066, //rubbing [0, 3], //size [[0.5, 0.5, 0.5, 0.5], [1, 1, 1, 0]], //color [0.25], 1, 0, "", "", _ps1]; _ps1 setDropInterval 0.01; }];
what else do i have to add to this line to have all vanilla content in the blacklist?
it's an arsenal blacklist and vanilla + apex stuff is still showing up. i want mod content exclusively
_blacklist = ["gm","kart","mark","tank","enoch","orange"];
apex is expansion and vanilla could be a3 (not sure about that though)
_x addMagazineCargoGlobal [_mag, 4];
how can I randomize the amount of magazines I am adding to this crate?
currently, it adds 4 mags, but I would like it to be 2 - 4
_amount = [2, 3, 4] call BIS_fnc_selectRandom;
_x addMagazineCargoGlobal [_mag, _amount];```
_x addMagazineCargoGlobal [_mag, 2 + (round random 2)];
wouldn't that give him always more then 2 Terra?
well not if random 2 gives <0.5
btw @hollow lantern instead of BIS_fnc_selectRandom you can use selectRandom as a command
on that thought maybe 2 + (floor random 3) might be better for equal chances
and can I use this whenever I need a random value? for example:
player setDamage 0.25 + (round random 0.5);
player setDamage (0.25 + (round random 0.5));
``` otherwise setDamage will be evaulated first without adding the random value
oh yeah
thanks
the reason it doesn't have the parenthesis around the 2 in my code, is because it is already adding 2 magazines, plus the random extra value
what exactly does round random do?
also, round random 0.5 will always give 0
random <value> picks a number between 0 and value, round rounds it, so round 0.4 -> 0 and round 1.5 -> 2
since you cant add half a magazine
order of precedence is:
(round (random 0.5))
ok nice
what's a good way to gradualy slow down a chopper (for landing)? I thought about a while-loop, However my code is broken in a way that it is not slowing down the chopper, however the while-bool-expression is true when the helo is 1599m near the target: ```sqf
waitUntil {(_aircraft distance _destination) < 1600};
_previousSpeed = speed _aircraft;
while {_previousSpeed > 10 && (_aircraft distance _destination) > 500} do
{
scopeName "landingCycle";
sleep 1;
_speedCache = _previousSpeed - 1;
if (( speed _aircraft) > _speedCache) then
{
_aircraft limitSpeed _speedCache;
_previousSpeed = _speedCache;
};
};```
I guess the if-bool is the issue here. It checks if the speed is 1km/h slower then the speed it had when coming into the 1600m range. However it will never go lower probably.
My main-issue is that I need to gradualy slow it down so it doesn't run out of speed too quickly, however I can't use a fixed speed as the script should be modular.
Maybe I can get the max speed of a helo via the Config and based on that calculate a decend path to the target
Hello i have a question i suck at coding but i was wondering how can i add height adjustment code to a sandbag mod
Ty in advance
need a little more than that. you want the sandbag to be placed higher?
Yeah i just want to be able to adjust its height as i place it
so its already placed in game and you want to look at it and increase its height?
Yes. It only sticks to the ground with no height modification and i was wondering if all i need to do is attach some code to it for the usual scroll wheel option
Basically im just trying to modify the bags of sand mod if you know it
do you have the class name for the sandbag that is placed?
I have absolutely no ideea about anything
no i dont know it, nor will i learn the ins and out of its scripting
Was just wondering if all it needed was some extra code
you need to look into addAction, setPosATL, CBA_fnc_addClassEventHandler
Ty ill check that out tomorrow since rn its 1 am
you will use the CBA add class event handler to attach some code to any object that has the same class. the code you will attach is an addAction which you will write to increase the height using setPosATL
I think i can kinda make it work from there it doesnt have to be perfect just decent
this will avoid you having to look through the mod and figure out how they did it
random 0.5 will give 0 to <0.5. if you round both it always goes to zero.
Thank you mate you are a good man man :))
ik not my example :P
the random [min, mid, max] syntax changes the distribution from equal to gaussian though
btw what is the alt syntax 3 seed random [x, y] about? why does it need an extra implementation?
neat, maxSpeed can be returned via
(getNumber(configFile >> "CfgVehicles" >> (getDescription _aircraft select 0) >> "maxSpeed"));```
Hello guys, once again im having trouble, the code makes the object do 2 actions, when the hold action is complete. but idk why only the sound work but the text doesnt. But when i remove the codeline from the sound the text do appear.
titleText ["<t align = 'center' shadow ='2' color='#FF0000' size='1.7' font='RobotoCondensedBold' >speaker: </t><t color='#ffffff' size='1.7' font='RobotoCondensed' >chat here</t>", "PLAIN DOWN", -1, true, true]
how would i delete a vehicles crew on init?
{ _this deleteVehicleCrew _x } forEach crew _this; on the vehicle right?
I've got a strange error. trying to implement a queue of sorts using an array. literally boils down to:
private _changeOrder = if (_changeOrders isEqualTo []) then {
locationNull;
} else {
_changeOrders deleteAt 0;
};
The queue is known to have two elements in it. First one pops just fine.
The second one tries to, but I get an ACCESS_VIOLATION and Arma crashes.
How might I avoid this scenario? Would _changeOrders select [1, count _changeOrders - 1] be any better?
{ this deleteVehicleCrew _x } forEach crew this;``` without the underscores.
if you put it in the init field
The whole sequence logs as follows:
18:49:31 [KP LIBERATION] [315.862] [CHANGEORDERS] [fn_changeOrders_process] Entering: [isNull _target, isNull _changeOrder]: [false,true]
18:49:31 [KP LIBERATION] [315.862] [LOGISTICSSM] [fn_changeOrders_tryDequeue] Entering: [isNull _target]: [false]
18:49:31 [KP LIBERATION] [315.862] [LOGISTICSSM] [fn_changeOrders_tryDequeue] Popping front element: [_countBefore]: [2]
18:49:31 [KP LIBERATION] [315.862] [LOGISTICSSM] [fn_changeOrders_tryDequeue] Front element popped: [isNull _changeOrder, _countBefore, _countAfter]: [false,2,1]
18:49:31 [KP LIBERATION] [315.862] [LOGISTICSSM] [fn_changeOrders_tryDequeue] Fini: [isNull _changeOrder, _countBefore, _countAfter]: [false,2,1]
18:49:31 [KP LIBERATION] [315.862] [CHANGEORDERS] [fn_changeOrders_process] Processing: [isNull _target, isNull _changeOrder]: [false,false]
18:49:31 [KP LIBERATION] [315.867] [CHANGEORDERS] [fn_changeOrders_process::onProcess] Processed: [isNull _target, isNull _changeOrder, _entering, _result, _processCount]: [false,false,false,false,1]
18:49:31 [KP LIBERATION] [315.867] [LOGISTICSSM] [fn_changeOrders_tryDequeue] Entering: [isNull _target]: [false]
18:49:31 [KP LIBERATION] [315.867] [LOGISTICSSM] [fn_changeOrders_tryDequeue] Popping front element: [_countBefore]: [1]
Before ACCESS_VIOLATION.
ah okay... what are the underscore used for then?
This is all "running" in a CBA state machine "pending" state. Neither here nor there really, apart from context.
any chance that _changeOrders isn't an array?
underscores define a lokal variable
_supplyDropSpawn = [[SupplyDropArea], ["water",]] call BIS_fnc_randomPos;
it says I am missing a [ but I dont see where
remove the ,
@crimson walrus no, it is an array for sure. during enqueue or insert operations, I get a default starting value, effectively this:
private _changeOrders = _target getVariable ["KPLIB_changeOrders_orders", []];
it's working just fine until now, but now I am piling up more than one element... which I wonder if one of those operators has a stronger than normal lock on the array instance.
the offending operator seems to be deleteAt. so I wonder if I get creative to workaround that operator.
it's a pretty heavy operator IMO, it does a lot, affects the array itself, and returns the first element. this appears to be the line where things go wonky:
private _changeOrder = if (_changeOrders isEqualTo []) then { locationNull; } else { _changeOrders deleteAt 0; };
open to suggestions, maybe a creative use of select around the desired element, something like that.
how can I temporarily hide a marker from the start of a mission?
there are a couple of markers that I dont want shown on the map until specific points in the mission
does not seem to matter which way I handle it, deleteAt working around with a _changeOrders select [1, count _changeOrders - 1], still with a ACCESS_VIOLATION
maybe I just "get" the array as-is, and forEach over them...
thanks guys
What is your goal with deleteAt 0. Returning the first element always?
Nevermind, I just wrote your inital post
I don't see how deleteAt can cause an Access Violation and crash. It should just fail.
Yes, basically that. but really, just want to process the queue. probably being too finicky with my usage around that.
re: deleteAt, or select for that matter, re: AVs, me neither, ๐คทโโ๏ธ , but it is.
trying to isolate just when that might be occurring.
deleteAt is not the issue.
whats wrong with this code? i'm trying to clear a vehicle crew, create a new group, then add that group to the vehicle:
"FBHPT_or8_ofw_p08" createUnit [[0,0,0], []];
"FBHPT_or6_ufw_p38" createUnit [[0,0,0], []];
"FBHPT_or4_uffz_p38" createUnit [[0,0,0], []];
"FBHPT_or3c_gfr_p38" createUnit [[0,0,0], []];
"FBHPT_or1_pzsch_p38" createUnit [[0,0,0], []];
[FBHPT_or8_ofw_p08, FBHPT_or6_ufw_p38, FBHPT_or4_uffz_p38, FBHPT_or3c_gfr_p38, FBHPT_or1_pzsch_p38] join (group panzeriv);
FBHPT_or8_ofw_p08 moveInCommander this;
FBHPT_or6_ufw_p38 moveInDriver this;
FBHPT_or4_uffz_p38 moveInGunner this;```
all it does is delete the old crew
You should read the docs of createUnit
@cosmic lichen maybe not, but that's what I am attempting to isolate. perhaps one other area that things might be falling over on, but given which, difficult to imagine that is the cause, either, it's been working just fine to this point as well.
pm'd solution
is there a equivalent for addPrimaryWeaponItem that works with any weapon placed in the 3DEN editor?
you trying to add an action to a placed weapon on the ground in the editor?
@hollow lantern
no, I'm trying to add a weaponItem e.g. scope or laser to a weapon on the ground. These are normally just created weapons via weaponGroundholders.
addPrimaryWeaponItem needs a unit to function
so it doesn't work with the plain weapon
so I'm searching for an alternative
ah yes, i think i ran into that earlier this year and didn't find a solution as of yet
might just need to have them in pieces until a solution is found...
i do know that base arma, and some mods like RHS and CUP have premade weapon class names that have things attached to them by default.
for now manual placement is needed https://i.imgur.com/CoLvZpJ.jpeg
I mean I could create a groundWeapon holder and then do addWeaponWithAttachmentsCargoGlobal
would be a hacky workaround
but should work
@fair drum that works:
KI_wGround01 = "GroundWeaponHolder" createVehicle [5849.19,5005.69,0.880923];
KI_wGround01 addWeaponWithAttachmentsCargoGlobal [["rhs_weap_M107_d","rhsusf_acc_nxs_3515x50f1_md_sun", "", "", ["rhsusf_mag_10Rnd_STD_50BMG_mk211",1], [], ""], 1];
KI_wGround01 setPos [5849.19,5005.69,0.880923];
noted, good find
@cosmic lichen lovin the additions to 3den Enhanced
KI_wGround01 = "GroundWeaponHolder" createVehicle [5849.19,5005.69,0.8];
KI_wGround01 addWeaponWithAttachmentsCargoGlobal [["rhs_weap_M107_d","rhsusf_acc_nxs_3515x50f1_md_sun", "", "", ["rhsusf_mag_10Rnd_STD_50BMG_mk211",1], [], ""], 1];
[KI_wGround01,270,0] call BIS_fnc_setPitchBank;
KI_wGround01 setPos [5849.19,5005.69,0.8];
[KI_wGround01,0,-10] call BIS_fnc_setPitchBank;``` final: https://i.imgur.com/zncoj7Y.jpeg
_veh1 = format (_veh1 select 0);
I currently have this where _veh is currently referencing a helicopter. Im wondering how i can turn this object reference into text?
sorry if this is really stupid
BIS_fnc_randomPos only gives X and Y coordinates, correct?
what do you mean by turning the reference into text? You want the vehicle name? Or do you want the variable name of the helo?
3d, atleast according to wiki
beginner question, how can I assign the gunner of a tank a rank. I have:
_tank1 = [ [getMarkerPos "tankMarker", 0, markerDir "tankMarker" ] call BIS_fnc_relPos, markerDir "tankMarker", "cwr3_o_t72b1", _tankgroup] call BIS_fnc_spawnVehicle;
_tank1Com = commander _tank1;
_tank1Com setRank "LIEUTENANT";
I keep getting a type Array expected Object error on the second line and I'm not following that. I get the same error trying to use this which is an example from the biki page: (driver _tank1) action ["getout", _tank1];
_randomSupplyDropSpawn = [[SupplyDropArea], ["water"]] call BIS_fnc_randomPos;
// SupplyDropArea is a trigger
_supplyDropSpawnX = _randomSupplyDropSpawn select 0;
_supplyDropSpawnY = _randomSupplyDropSpawn select 1;
"SupplyDropMarker" setMarkerPos [_supplyDropSpawnX, _supplyDropSpawnY];
isNil {
private _parachute = "B_Parachute_02_F" createVehicle [_supplyDropX, _supplyDropY, 750];
_parachute setPosATL _randomSupplyDropSpawn;
supplyDrop attachTo [_parachute, [0,0,0.5]];
};
why isnt this working? the parachute and crate just spawn on the ground
https://community.bistudio.com/wiki/BIS_fnc_spawnVehicle returns an array, not an object, you're providing commander an array, but it expects an object instead
oh okay. That makes sense now. Thank you. I normally use createVehicle and was viewing _tank1 as the tank itself and not as a return from spawnVehicle.
can anyone figure out whats going wrong with my code ^^
iirc createVehicle ignores Z coordinate, set pos the parachute with the proper height after you create it
also since you set pos, initial position doesn't matter, so use [0,0,0] when creating, it's abit faster that way ๐
ok
also does BIS_fnc_infoText not work in multiplayer?
if not, how can I get it to work?
because it is working fine for singleplayer but it wont work for me in multiplayer
where are you executing it?
UI stuff has to be executed locally on clients/playerhost, obviously running it on server won't make clients see anything
oh
im new to this lol
well how can I fix that? do i need to use something else or can I fix it
you most likely want to put it in initPlayerLocal.sqf or something similar that runs on clients, and not only server
ok that sounds good
yeah I can make that work
@copper raven does initPlayerLocal.sqf run right as players finish loading in to the mission or as they select a role?
for exact time it's ran look up initialization order, it can't run when they select a role obviously(the player object is even passed to the script itself)
any advice on using BIS_fnc_initVehicle?
I'm currently running it in a script run with extended init event handlers only on the server
it seems like it should work, but it doesn't appear to
Without sharing your code and issue, nobody will debug
oh this is odd. If I create new vehicles with Zeus it works but the units already there at the start don't have the correct appearance. I wonder if bis_fnc_initvehicle doesn't work well with JIP
my description.ext has this: sqf class Extended_Init_EventHandlers { class Man { init = "_this call (compile preprocessFileLineNumbers 'set_uniform.sqf')"; }; class LandVehicle { init = "_this call (compile preprocessFileLineNumbers 'set_texture.sqf')"; }; class Air { init = "_this call (compile preprocessFileLineNumbers 'set_texture.sqf')"; }; };
set_texture.sqf:```sqf
private "_this";
_this = _this select 0;
if (!isServer) exitWith {};
_ru_texture_primary = 'textures\ru_digital_snow.paa';
_ru_texture_secondary = '#(argb,8,8,3)color(0.5,0.5,0.5,1)';
_us_texture_primary = 'textures\us_bdu_snow.paa';
_us_texture_secondary = '#(argb,8,8,3)color(0.7,0.7,0.7,1)';
if (typeOf _this == "CUP_O_SU34_RU") then {
[
_this,
["White",1],
true
] call BIS_fnc_initVehicle;
};```
sleep 180;
["The safe zone has been", "marked on the map in blue!"] spawn BIS_fnc_infoText;
sleep 5;
["Get inside within", "15 minutes or die!"] spawn BIS_fnc_infoText;
why the hell wont it show the second message?
the first one works fine, but the second one does not appear on screen
when I set the first sleep value to something smaller like 20, it works perfectly
but when I want it to wait 180 seconds before doing it, it wont work
also would I want to put this in my init.sqf or serverInit.sqf file:
civilian setFriend [civilian, 0];
works for me just fine, are you in the escape menu while you wait to test it?
this is SO bizarre. I've tried to work around this ACCESS_VIOLATION error, to no avail.
as long as the change order array (really, queue) is empty or has one element, it's all good. as soon as I add a second element, it goes to shit.
what are you trying to do?
no im not
i think it might be because I have other code running at the same time in initServer.sqf
this code is in initPlayerLocal.sqf
private "_this";
_this is always private
are you spawning it?
yes
sleep 180;
["The safe zone has been", "marked on the map in blue!"] spawn BIS_fnc_infoText;
sleep 5;
["Get inside within", "15 minutes or die!"] spawn BIS_fnc_infoText;
works for me
ok
@final storm when I change the first sleep value from 180 to something much higher or much lower, it works just fine
initServer
ok thanks
// // tried both ways of getting the var, var is got either way...
// ([_target, [
// [KPLIB_changeOrders_orders, []]
// ], _callerName] call KPLIB_fnc_namespace_getVars) params [
// "_changeOrders"
// ];
private _changeOrders = _target getVariable [KPLIB_changeOrders_orders, []];
if (_debug) then {
[format ["[fn_changeOrders_process] Got vars: [count _changeOrders]: %1"
, str [count _changeOrders]], "CHANGEORDERS", true] call KPLIB_fnc_common_log;
};
if (_changeOrders isEqualTo []) exitWith {
if (_debug) then {
["[fn_changeOrders_process] Nothing to process", "CHANGEORDERS", true] call KPLIB_fnc_common_log;
};
true;
};
// ACCESS_VIOLATION
_changeOrders = +_changeOrders;
private _changeOrderCount = count _changeOrders;
if (_debug) then {
[format ["[fn_changeOrders_process] Processing: [_callerName, _changeOrderCount]: %1"
, str [_callerName, _changeOrderCount]], "CHANGEORDERS", true] call KPLIB_fnc_common_log;
};
what should _changeOrders look like?
if the _changesOrders array is empty or count 1, it is fine. adding a second CO, it pukes
_changeOrders is a a simply array, nothing magical about it
treating it as a FIFO queue
preferably pushBack, deleteAt 0, or forEach, whatever works
would CBA per frame handlers that potentially touch the variable cause something like that?
@little raptor ok thanks, but is that likely to be my issue? it seems to be some sort of locality problem or that bis_fnc_initvehicle doesn't work for players that join after the command is run
i dont understand the purpose of ur code _changeOrders = +_changeOrders;
when I do
civilian setFriend [civilian, 0];
it makes it so that civilians cannot access storage crates because they are enemies with the side the crate is on. how can I fix this?
i need civilians to be enemies because I dont want civilian vs civilian to show up as friendly fire
@final storm I am trying to get a snapshot of the array.
Hey there, i'm trying to script something to create an object in front of the player that they can place, rotate etc etc. Now this is probably one of the newbiest questions out there but google hasn't helped. I've managed to get the sandbag i'm creating to pop up in front of me with attachObject using addAction but i can't get it to detach, let alone rotate or anything else. Any ideas where to start?
I suppose by Occam's razor, if that's the obvious potential issue, that may be the simplest answer. don't copy the array. I could try that.
in the code you sent _changeOrders = +_changeOrders; doesnt do anything
prob not the most simple beginner project
i'm not totally a beginner. I've gotten both of those to work, i just can't get it to allow me to move the sandbags location around and detach. I can have it attach but when i use my action to drop it won
't detach
why dont you show us your script so far?
i'll be honest i found it on the internet and kind of hotwired it to get it to work. ``` objectDirection = 180;
objectHeight = 0;
init ={
removeAllActions player;
player addAction ["Open Menu", {
call main;
}];
};
main =
{
removeAllActions player;
player addAction ["Barricades", {
call barricades;
}];
player addAction ["Towers", {
call towers;
}];
};
barricades =
{
removeAllActions player;
player addAction ["Sand Bags Long", {
_sbag1 = "Land_BagFence_Long_F" createVehicle position player;
_sbag1 attachTo [player, [0, 5, 0]];
[_sbag1]call objectAdjustment;
}];
player addAction ["Sand Bags Round", {
_sbag2 = "Land_BagFence_Round_F" createVehicle position player;
_sbag2 attachTo [player, [0, 5, 0]];
[_sbag2]call objectAdjustment;
}];
};
towers =
{
removeAllActions player;
player addAction ["Tower Tall", {
}];
player addAction ["Tower Short", {
}];
};
objectAdjustment =
{
removeAllActions player;
_object = (_this select 0);
player addAction ["rotate", [_object]call rotateOr];
player addAction ["raise", [_object]call raiseObject];
player addAction ["lower", [_object]call lowerObject];
player addAction ["drop", [_object]call dropthing];
}];
rotateOr =
{
_object = (_this select 0);
objectDirection = objectDirection + 20;
_object setDir objectDirection;
};
raiseObject =
{
_object = (_this select 0);
objectHeight = objectHeight + 1;
_object attachTo [player, [0, 10, objectHeight]];
};
lowerObject =
{
_object = (_this select 0);
objectHeight = objectHeight - 1;
_object attachTo [player, [0, 10, objectHeight]];
};
dropthing =
{
_object = (_this select 0);
detach _object;
call init;
};
call init; ```
syntax will probably make you want to puke
i need some quick help with something
how can I automatically make all crates/vehicles unlocked for all players?
when I do
civilian setFriend [civilian, 0];
it makes it so that civilians cannot access civilian containers/crates because they are enemy containers/crates
i need to make civilians enemies with other civilians so that it doesnt say "friendly fire" when a civilian kills another civilian
It doesn't? doesn't it make a copy of the array? that's the + operator, right?
if ur makeing a new variable
is there any more to that code? and are you 100% sure that's the line it crashes on?
99.75% certain of that, yes @copper raven
at least according to the debug statements
the log literally gets that far then dumps
1:10:32 [KP LIBERATION] [241.22] [CHANGEORDERS] [fn_changeOrders_process] Entering: [isNull _target, _target, _callerName]: [false,Location CBA_NamespaceDummy at -1000, -1000,"fn_changeOrders_process"]
1:10:32 [KP LIBERATION] [241.22] [CHANGEORDERS] [fn_changeOrders_process] Got vars: [count _changeOrders]: [2]
did you try not running PFHs(ones that do any modifications to the array reference)? even though i highly doubt that's the issue, still worth trying
what is pfhs?
per frame handlers*
oh right, I see. hmm well... no, BUT... it's key to many parts of other subsystems.
though I wonder per my Occam's thought, Arma 3 sees it as trying to overwrite itself with a snapshot, and so that's the simple answer.
anyway kind burnt on it tonight, that'll be first tomorrow, maybe into a separate var, i.e. private _snap = +_changeOrders
although I do that in other places and have not seen the same issue, so it's still a bit odd to me
can anyone help me figure out the solution to the problem I posted above? ^^^^^^^^^
@copper raven wait you said deep copy? I thought that was a snapshot? i.e. 'new array', leave the other bits alone
which wouldn't be right, I don't want a deep copy of course. those are CBA namespaces in there. I just want a new array.
No
i'm not sure if i get what you mean, cba "namespaces" are just some objects, copying it won't make a different one, if that's what you were thinking @dreamy kestrel
can someone link me to a wiki page really quick
i just need players to be able to access vehicles and containers from sides that they are enemies with
@ me
can I set the side of an object?
has to do with rating i think
what do you wanna do have everyone on bluefor and have a free for all?
No
@little raptor well then how can I make it so that even though civilians are enemies with civilians, they can still access vehicles and crates?
Does anyone have a script to end the game automatically when the "Commander" slot is not filled? I want to make the Liberation gamemode only playable when the Commander slot is filled by admin.
@Any one with experience with attachTo and multiplayer. Given: serverObj attachTo [clientObj] does this change the locality of serverObj to the client in question?
@limber stump if the commander unit is named in editor (say: comUnit) then you could check for !isNull comUnit
comUnit would be null until a player loads into that role AFAIK
as for ending the game see: https://community.bistudio.com/wiki/endMission
How about the event?
Sorry, which event are you refering to?
Is there any event I can use to trigger when role assignment are done by player?
if (!isNull comUnit) then {
sleep 1;
endMission "END6";
};
like this?
in it simplest form, yes that would do it
but since endMission has local effect you'd want to make sure it executes an all clients
so like this? btw how I can make it executes an all clients?
if (isNull comUnit) then {
sleep 1;
endMission "END6";
};
I don't think it does. But the best thing to do is try it yourself
@little raptor Cheers was hoping to have avoid fire up the mp test bench
It's typically better to use BIS_fnc_endMission
also there is endMission for MPnvm, seems like it's deprecated
but looks like ill have to
@limber stump to execute for everyone, use remoteExec.
Also that script is not suitable. It probably always fails the mission (especially in dedicated server)
like this? "End2" remoteExec BIS_fnc_endMission;
I mean
"End2" remoteExec BIS_fnc_endMission;```
Syntax of remoteExec is a bit off but that's the gist of it
/* in initServer */
[] spawn {
if(isNull comUnit) then {
"End2" remoteExec ["BIS_fnc_endMission"];
};
};
@dusk shadow @limber stump as I mentioned that'll probably always fail the mission.
The simplest way to fix it is to wait a few seconds before checking that condition.
it's not robust, but at least it's better
Why thou? unless i misunderstand this: https://community.bistudio.com/wiki/Initialization_Order the init of object variables on the server happens before initServer.sqf
ofc, we're talking a player object... which is initalized by the client right?
The slots are not necessarily filled at the start. (JIP)
but that was @limber stump's goal, to end the mission if they weren't
unless i missed somethin
It's worked! Thanks โค๏ธ @dusk shadow @little raptor
@little raptor About the attachTo locality thing: From my limited testing I'd say you were right. Locality does not seem to change when attachTo is used.
what is the floor for in this line code?
_possibility = floor (random 10) < 3;
https://community.bistudio.com/wiki/floor
BIKI is always your friend
i looked at that but i am still unsure to what it does ๐คฃ
You're asking what floor does generally or in the code? If later, I don't think it's making sense at all for me
indeed. if a number is less than 3, so is its floor
floor will "floor" the value, a.k.a round to the lowest integer, which looks like truncating for positive numbers:
floor 5.1 = 5
floor 5.999 = 5
but
floor **-**4.1 = **-**5
thank you i understand it now
how would i go about getting the difference of a count if it changes
You would store it beforehand
and i do that by running count as a variable right?
sosqf _countGroup = count units group group1
if you want to check if someone died from within the group, add them a "killed" EH, no?
i want to get how many have been killed so that i can spawn that number of replacment troops to reinforce the squad
so squad started with 8 now its got 6 so spawn 2 more riflemen
how would you do with logic?```sqf
private _startCount = count units _group;
while { true } do
{
waitUntil { sleep 1; count units _group < _startCount };
private _difference = count units _group - _startCount;
/* spawn _difference units */
};
that's not ideal and Killed/EntityKilled EH is better, but you get the idea
ah perfect thanks @winter rose lou i had the right idea then was going about it wrong, was juggling how to write it in my head
its not going to be counting large numbers so it dosnt have to be very efficient, and event handlers scare me i havnt go a clue where to start on them XD
the "perf impact" is not really number-related, it is about the check cycle
an EH takes no resource
ahh
see https://community.bistudio.com/wiki/Code_Optimisation#Rules for your code ๐
- Make it work
- Make it readable
- Optimise then
cool thanks Lou for the help
is there any way to convert getPos (PositionAGLS?) position to positionWorld?
use case - i have a position and need to create simple object, but BIS_fnc_createSimpleObject accepts only world position
No
i have a position and need to create simple object, but BIS_fnc_createSimpleObject accepts only world position
don't use getPos in the first place.
@smoky rune also converting AGLS makes no sense. Imagine a multi story building. No matter which floor you stand on, your AGLS position is always: [x, y, 0]
do missiles not fire their "killed" eventhandler?
they dont seem to ever fire for me.
diag_log ["missile",_missile,"target",_target];
_missile addEventHandler [
"Killed",
{diag_log ["missile killed:", _this, " target: "];}
];
_missile addEventHandler ["Killed", "hint format ['Killed by %1', _this # 1];"];
they don't
iirc EH don't work on "bullets"
is there any other way than a loop to do stuff with bullets?
rip. well then
thanks anyways
i have a params command that expects certain data types as input, if i input a wrong one, it throws and error BUT continues my function?? wth
is there a way to make it auto exit?
if (!params []) exitWith {};
BUT I believe it would exit on using default values as well
ah i misread in the biki:
"checks if passed value is one of listed Data Types. If not, default value is used instead. "
sorry could you explain what !params[] does? dont get it
params returns bool which indicates if it was successful
aaaaaaaah okay i should really read the biki more carefully
sorry lol i promise to read the whole section next time
https://community.bistudio.com/wiki/params
Return Value:
Boolean - false if error occurred or default value has been used, otherwise true
you better!!1!
!!1!1!!!elf
can I spawn enemies only locally for a player?
I currently got about 20 objects that I want to delete, how do i do this best? I tried
_Vessel = [obj1, obj2...]deletevehicle _vesselbut is shows an error "type array, excpeted object"
https://forums.bohemia.net/forums/topic/188346-creating-local-ai-unit/
No.
~ das attorney, February 22, 2016
I see thanks
@smoky verge you can although create enemies and hideObject them where wanted
because deleteVehicle is expecting an object not an array:
_Vessel = [obj1, obj2...];
_Vessel apply {deleteVehicle _x};
it was more of a way to improve performance, since in my missions there are enemies a certain group will never see, and I don't think hideObject helps with that
Doesn't dynamic simulation technically achieve that?
to explain myself better
team A goes to point A
team B goes to point B
Team B will never see the enemies in point A
and vice versa
is there a way for team A to not simulate the enemies in point B?
or does the game automatically do that?
I though dynamic sim enables sim for everyone in the server not just who's close by
but I don't really understand perfectly how MP stuff works so I might just be saying stupid stuff
ACCESS_VIOLATION == game crash, report on feedback tracker.
You can indeed disableSimulation locally as well
what benefit has that?
the units are remote-server entites anyways, so whats the point in disabling them on some clients?
It does. It copies the array. Before that its a reference to the global variable.
I think it might very slightly help reduce the network sync (position etc) but the gain might be null as well
but isn't it the server that updates the object information (i.e. tells the clients that something has been updated)?
how can it reduce network traffic then?
mhm I see
nevermind then
was hoping to get some method to increase performance due to this particular mission I'm making
I don't really know, more like "data processing time"
altho if the object is disabled locally then I guess the client won't tell the server that it has been updated. in this case it might actually reduce network traffic
maybe arma is smart enough to tell the server to not update disable units positions.
anyways other topic:
are there invisible target objects i can use to make AI shoot at something?
I have in the past tried literally everything else, down to tick-loops forcing fire if muzzle pointed at right direction.
cba has some
yeah thats what i heard
you can create your own
they are like vehicles
is B_invisibleTarget_F an object i can already use? i dont want to mod my own
I gues cba only makes it more easy to create
sanchez you got a classname for the cba one?
I don't but they should be like vehicles you can place
aaah cool, listed under nato -> targets
CBA_B_InvisibleTargetAir
CBA_B_InvisibleTarget
CBA_B_InvisibleTargetVehicle
that was a good guess 
does AI recognize it automatically like an enemy or do you have to reveal it via script?
they're just empty (but invisible and massless) vehicles
if you add crew to them they might
nope, CBA_B_InvisibleTarget is directly attacked by opfor
they're not supposed to attack it tho 
just target it
it's an empty vehicle
I guess if you place them in 3den it also adds the crew
maybe that's why
that makes sense
clients also tell the server what local objects updated
yeah, my invisible target vehicle is called "shawn faulkner", placed in 3den
Not unless the object is local to that client, or the client modifies the object (such as using setPos), right?
i think i am doing something wrong:
where do i put a eventhandler?
I am trying to call it via CfgFunctions in the config.cpp
as fn_Needler.sqf.
is that ok or do eventhandlers require a special envirioment/calling?
Depends on the event handler
and of course what you do in the function
ok so this is the evenhandler:
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_ammo isEqualto "AmmoNeedler")
then
{
_dt = cursorTarget;
player globalChat (format ["%1",_dt]);
if (_dt isKindOf "Man")
then
{
[_dt] spawn
{
sleep (5 + random 6);
_dt setDamage 1;
};
};
};
}];```
igonre the globalchat i tried to test it, but it doesn't work
for what ever reason
i can use cba eventhandlers normally, but i have no experince wit hbis eh yet
this function has many flaws
first of all, player depends on the client
second of all, you're using player inside the event handler (the player may have changed)
use _unit
hmm
third of all, _dt is not defined inside the spawn
fourth of all, lots of unused variables
so do i have to do: params["dt"];?
i wasn't sure because i thought u can only use predifined in params
params ["_dt"]
ahh ye sry
that still doesn't mean that the function will work
only when the object is local to the client. Atleast supposed to. Arma is still Arma somtimes
Hello, everyone. How to use SelectPlayer for current player, for example: cursorTarget -> player. I want to change the model of the player I'm looking at.
you can use selectPlayer for other players in any order?
in other words, I want to replace the model with the player I'm looking at, and get him instance from cursorTarget
selectPlayer cursorObject
you could add more checks, but technically this can work (beware of MP locality issues)
selectPlayer -> transformation shooter to target
I need selectPlayer -> turn the victim into an animal for example
I have script for transformation
but script works, only for shooter
Hi guys !
i wanted to know, is there a way to know if a controller (xbox or others) is detected ?
selectPlayer locally works for script executor, and transform player to victim, but I need turn the victim into an arbitrary object
how to execute selectPlayer on victim side
remoteExec
none I know of I'm afraid
sorry i forgot to mention that i work in arma 2
then local script on the killed person
removeExec don't work in arma 2 as far as I know
yep, A3 only
how to?
ok thx !
e.g an event handler
player addEventHandler ["Killed", {
_rabbit = createRabbit;
selectPlayer _rabbit;
}];
```(pseudo code, of course)
humm, cursorTarget can't help?
why would you care about cursorTarget?
adding an event for the player every time is not very rational as it seems to me
the EH is kept upon respawn iirc; and if not, it's still not a negative performance impact
the more I need to turn the player without damaging him or killing him
and you could kill someone with a grenade, therefore nulling cursorTarget
or shoot through wooden planks, etc
Hi guys, how can i add smoke to something ๐ค ?
see the addCigarette command
-.-
nooo
kidding
private _ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 1], "", "Billboard",
1, 10, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10],
[[0.3, 0.3, 0.3, 0.33], [0.4, 0.4, 0.4, 0.33], [0.2, 0.2, 0, 0]],
[0, 1], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0, 0, 0], [0.33, 0.33, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0];
_ps1 setDropInterval 0.5;
Wouldnt this just create it local and only for one person ?
yikes
not really, since you can create sources on each machines
lets say i create a vehicle:
objective = createVehicle [selectRandom _vehicleList, _markerPosition, [], 0, "CAN_COLLIDE"];
I wanna make sure everyone sees the smoke.
That code above runs on the server (1x)
on function call
do i still need to exec it then?
remoteExec with JIP = true

// Create Objective
objective = createVehicle [selectRandom _vehicleList, _markerPosition, [], 0, "CAN_COLLIDE"];
// Add smoke effect to objective
private _ps1 = "#particlesource" createVehicleLocal getPos objective;
_ps1 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 16, 1], "", "Billboard",
1, 8, [0, 0, 0], [0, 0, 1.5], 0, 10, 7.9, 0.066, [1, 3, 6],
[[0, 0, 0, 0], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.1, 0.1, 0.1, 0.5], [0.125, 0.125, 0.125, 0]],
[0.25], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_ps1 setDropInterval 0.05;
This works (for me) but like you said it wont work MP cuz i need to remote exec how would i make that entire function remote?
hello again, is it possible in any way to prevent someone changing weapon attachments through the inventory instead only allowing them to do so through the Ace interaction menu?
You take your Add smoke effect to objective code block, put it in a separate function, substitute objective with _this in that function and then modify your original code to be ...
// Create Objective
Objective = createVehicle [selectRandom _vehicleList, _markerPosition, [], 0, "CAN_COLLIDE"];
// Add smoke effect to objective
Objective remoteExec ["BS_fnc_addSmokeEffect", 0];
```... and set the JIP parameter as needed.
really need to make a seperate function for that?
I don't know the inner workings of the inventory, but disabling the attachment controls might work. Just an idea though.
Not if you know how to avoid that. But if you know how to avoid that you probably know enough about scripting to know that this is the proper way.
would it be something along the lines of this : https://community.bistudio.com/wiki/ctrlEnable and then disabling the use of the actual attachment boxes on the GUI?
Yep, that's what I meant.
Not sure if im following gotta dig a bit deeper i guess.
oooooo okay i guess ill give it a go, thanks for the reply ๐
@willow hound Can't i loop over all the players in the server and add the smoke like that?
The only way to execute code on another machine is using Remote Execution.
Read https://community.bistudio.com/wiki/Multiplayer_Scripting and pay special attention to the Locality section, I think you're missing some understanding there.
["#particlesource", getPos objective] remoteExec ["createVehicleLocal"];
Something like this? 
no ๐ฑ

You still need more reading I'm afraid.
if you create the particle source locally, you still have to use settings on it
That's why you need a separate function 
my best advice would be to execute a script (better, a function) on client's machines
You always have the magic variable _this available in scripts and functions.
How do you find out about this? You search the wiki for an article on functions.
Mmm
fncSmokeEffect = {
params ["_objective"];
// Add smoke effect to objective
private _ps1 = "#particlesource" createVehicleLocal getPos _objective;
_ps1 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 16, 1], "", "Billboard",
1, 8, [0, 0, 0], [0, 0, 1.5], 0, 10, 7.9, 0.066, [1, 3, 6],
[[0, 0, 0, 0], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.1, 0.1, 0.1, 0.5], [0.125, 0.125, 0.125, 0]],
[0.25], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_ps1 setDropInterval 0.05;
};
// Call function remote
[objective] remoteExec ["fncSmokeEffect"];
I have a feeling im close ๐ค
_nearTargets = _zombie nearEntities [["CAManBase", "Dog_Base_F", "Goat_Base_F", "Sheep_random_F", "LandVehicle", "Helicopter", "Boat_F"], _zCheckRange] select {
((getPosWorld vehicle _x) select 2 < 50) &&
(abs speed _x < 30) &&
(lifeState _x isNotEqualTo "INCAPACITATED") &&
(isNil {_x getVariable "vIsZombie"}) &&
(_x != _zombie)};
``` Why is this resulting in _nearTargets still having incapacitated units? Am I doing the select wrong?
You are pretty close actually, the problem is that the variable fncSmokeEffect might not exist on the clients (unless you put the upper code block into init.sqf or something). Using the functions library (which is also described in the A3 Functions Library page) eliminates that and other problems.
And where does initServer.sqf run? ๐

initServer is not client!
just run the same code in initPlayerLocal.sqf
problem solved
done that now
so the function is in the initPlayerLocal.sqf but i have a feeling that something is off: [objective] remoteExec ["fncSmokeEffect"]; right here.
Is there a script error manifestation of that feeling?
no
i didnt run anything yet
objective remoteExec ["fncSmokeEffect", -2];
``` <--- shouldn't it be this ?
The secret ingredients are reading the documentation and testing one's code a lot.
"Example 1" remoteExec ["hint", -2]; // Executed everywhere except on the server.
-2 excludes a potential player-hosted server
Ah, but hint does not take an array argument.
oh ye..
how does that smoke effect look like?
Since your function uses params, it takes an array argument, in this case, an array with only one element.
[objective] remoteExec ["fncSmokeEffect"];
So this is fine?
It should be.
๐ฆ
_smokeEffect = createVehicle ["test_EmptyObjectForSmoke", getPos objective, [], 0, "NONE"]; ``` (This is global since createVehicle is global. Fixes all your problems unless you want a very specific type of smoke)
๐ @heady quiver
I can't tell why it doesn't work, try debugging it with some systemChat (lifeState _x); to see what's going on.
only local
"test_EmptyObjectForSmoke"``` That is a very specific item created by BI to create a smoke effect and also being spawned via createVehicle. You cannot do that with user created smokes unless it is a mod... not for scripts.
Well it seems to work right now.
so im gonna keep it like this
x)
ty for the help @willow hound
๐
@heady quiver โ @wind hedge :p
no no, nothing ^^ if it works it's good!
Well i cant really check if it works with other ppl but i seem to get the smoke
I just need to find a better way to do this:
taskName = format['task_%1', round(random 9999)];
Cuz this is bound to ask for problems x)
round time + "_" + round random 9999 ?
// Create random task name
taskName = format['task_%1_%2', round(random 9999), round(time)];
it's not a javascript function ^^ you can use round random 9999 and round time
as a funny note, I added this handleDamage event handler to a NPC: SQF private _hits = _zombie getVariable "vHits"; _maxHits = _zombie getVariable "vHitPoints"; _hits = _hits + 1; _zombie setVariable ["vHits", _hits, true]; systemChat format ["hits %1, MAXhits %2", _hits, _maxHits]; And then shoot at the zombie ONCE and I get the systemchat "hits 56,57,58,59" !!! So a single pistol shot causes the EH to fire 59 times!!!!
I see that now, i thought getVariable would copy it not be a reference, just had to re read the wiki
Yea im so used to stuff like that and PHP x)
thats why functions and parameters where a bit weird for me
function(parameter){ } is what im used to lol
yes, with SQF you have to re-learn some basics
all in all it's "not that bad", but some quirks
Well atleast i learned how to do it now so thanks for that.
then there's me who learned .sqf first now I'm trying to learn an actual language...
there a wiki page with all of the hidden variables like setVariable ['bis_disabled_Door_1',1,true]?
not really no
Where could you go about finding all the variables so I see them
ahh
Would adding a remoteExec to an addAction for this object work in MP?
anyway to see a list of all of these for all objects? In a PBO somewhere or would it be an engine thing
yes
if in an init field, it would multilply by the number of players ๐
it's a script thing
And would the {} of the addAction be global?
no
action would be added locally everywhere
โฆjust what do you want to do?
So it would add the same addAction for each player? Like if there were five players would you have the option 5 times?
Or would it just allow every client to perform the addAction?
if you use this addAction *** without any remoteExec, everyone will see that action - and it will not be common to everyone as in "one activate it then the other cannot see it"
Another question i have a supportRequester module that has a limit of 0 (support runs need to be earned) how would i add +1 to CAS for example?
i think i already found it:
[player, "Transport", -1] call BIS_fnc_limitSupport;
Doesn't seem to work tho
Yea im trying but its not updating the support menu i think
quantity: Number - support run limit. -1 for unlimited support
correct; fixing
So i linked up the virtual modules to the requester and the requester to the JTAC unit, i spawn in as him and i call this in console:
[player, "Artillery", 1] call BIS_fnc_limitSupport;
Do i need to refresh the menu or something?
did a bit of testing from yesterday and got past the issue. I am satisfied that _array = +_array is a SQF anti-pattern, in the sense that, _array has a lock on it as + tries to operate, and cannot replace itself when it has a lock, so ACCESS_VIOLATION. makes perfect sense.

@winter rose it does return true but the support radio menu (0-8) has no options available after i run it
you may have to add support, dunno
@heady quiver Because the player is wrong parameter in [player, "Artillery", 1] call BIS_fnc_limitSupport;
You need to pass the supportRequester module instead of player
i tried that too but the docu says caller.
the unit able to request support
maybe the docu is just wrong
Alright i linked up everything again virtual module -> requester -> unit , i now have 1 CAS_Heli available and when i use it its gone then i try this: [player, "CAS_Heli", -1] call BIS_fnc_limitSupport; nothing happends or [supRequester, "CAS_Heli", 0] call BIS_fnc_limitSupport;
wait.
it works now
x)
It must be requester module, documentaiton is wrong
@winter rose Can I get your attention on https://community.bistudio.com/wiki/BIS_fnc_limitSupport
1st parameter is misleading
caller: Object - the unit able to request support <-- should be support requester module
it's correct? 
I checked the file
are you two drunk or what
it also says Support Requester Module
that's my routine joke I love doing, forgive me ๐คฃ
Thanks :)
@dreamy kestrel it's not an anti pattern, make a support ticket as Dedmen said, the cause is probably elsewhere
Scrap that
it makes zero sense
_array has a lock on it as + tries to operate, and cannot replace itself when it has a lock
in sqf no data can be accessed at the same time by two commands
full client.sqf https://pastebin.com/XuFz4DGR
This error spamming .rpt
over 9000 times of this:
Only on clientside .rpt tho, nothing on server.rpt
22:24:42 Error position: <select 12 == 1) then {
_text = (amm_CMar>
22:24:42 Error Zero divisor
22:24:42 File xx\addons\d_map_adv_markers\client.sqf..., line 135
22:24:42 Error in expression <(d_restr_enable_freeze) then {
if (_mar select 12 == 1) then {
_text = (amm_CMar>
i even dont't understand where divisor is
_mar select 12
_mar might have less elements than that
if (_mar select 12 == 1) then {
_text = (GVAR(CMarkerChannelToChar) select MAR_CHAN(_mar)) + " " + _text;
} else
{
_text = ((_mar select 11) select 0) + " " + _text;
};
for select with bound checking use param
i need to plug your big brainz for a bit........
i'm trying to add a "custom arsenal" to warlords. more like, having all vanilla content blocked. warlords has two functions where to hook that in, but i had no joy yet.
first option was, using the warlords blacklist filter:
_blacklist = ["gm","a3","kart","mark","tank","enoch","orange","exp","exp_a","exp_b","epa","epc","Expansion"];
_cfgWpns = configFile >> "CfgWeapons";
_cfgVehs = configFile >> "CfgVehicles";
_cfgGlasses = configFile >> "CfgGlasses";
_cfgMags = configFile >> "CfgMagazines";
{
_cfg = switch (_x) do {
case 5: {_cfgVehs};
case 7: {_cfgGlasses};
case 22;
case 23;
case 26: {_cfgMags};
case 24: {_cfgMags};
default {_cfgWpns}
};
_arr = +(BIS_fnc_arsenal_data select _x);
_arr = _arr select {!(toLower getText (_cfg >> _x >> "DLC") in _blacklist)};
BIS_fnc_arsenal_data set [_x, _arr];
} forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 22, 23, 24, 26];```
i added everything after "gm", still apex and base game stuff shows up in the arsenal...
my second approach was, do directly influence the call for the arsenal:
```sqf
_funds = player getVariable "BIS_WL_funds";
"close" call BIS_fnc_WLPurchaseMenu;
_null = ["Open", TRUE] spawn BIS_fnc_arsenal;
player setVariable ["BIS_WL_funds", (player getVariable "BIS_WL_funds") - BIS_WL_arsenalCost, TRUE];
closeDialog 602;```
but i have no idea how to either restrict the vanilla content, or load a custom arsenal that is not a box.
any ideas?
please ping me if someone responds. i'm not monitoring this channel usually
thanks guys
@deft dock The first method might work, but you cannot use the dlc property since it's not define for expansion weapons and vanilla weapons
configSourceMod (configFile >> "CfgWeapons" >> "arifle_ARX_Viper_hex_F");
``` Would return "expansion"
since my knowledge of scripting is basically non existing, what would the first function look like?
You only want CUP items right?
So I guess it's easier to use a whitelist instead of a blacklist
indeed
_whitelist = ["CUP"]; //I dunno what configSourceMod returns for cup items so double check that
_arr = _arr select {(toLower configSourceMod (_cfg >> _x) in _whiteList)};
Later on, whitelist could be a missionConfig property or so which others can edit.
But first check if that brings the result your are looking for.
i doubt we have a tag like "CUP" that returns with configsourcemod
i'll check that
nope... no return on configSourceMod

This might help you
I use it for me inventory manager and it works reliably
i already have it (since today)
helping for what?
check the link ๐
nah
ok, what am i looking at? ๐
private _addonClass = "";
if (count configSourceAddonList _x > 0) then
{
private _mods = configsourcemodlist (configfile >> "CfgPatches" >> configSourceAddonList _x # 0);
if (count _mods > 0) then
{
_addonClass = _mods # 0;
};
};
You are looking at a reliable way to figure out what mod/dlc/addon a item belongs to
_x is the config of the item
excuse my ignorance, but how do i use that?
๐
oh...
i guess i ๐ฆed something when pasting your code
weapons are now returning "@CUP Weapons"
_configToItem = (configFile >> "CfgWeapons" >> "CUP_arifle_FNFAL5061_railed");
private _addonClass = "";
if (count configSourceAddonList _configToItem > 0) then
{
private _mods = configsourcemodlist (configfile >> "CfgPatches" >> configSourceAddonList _configToItem # 0);
if (count _mods > 0) then
{
_addonClass = _mods # 0;
};
};
_addonClass
@CUP Weapons is correct
modParams [_addonClass, ["name"]] # 0; // "CUP Weapons 1.16.3"
but mags, uniforms, ect are returning nothing
They do
_configToItem = configFile >> "CfgMagazines" >> "CUP_10x_303_M";
Also returns @CUP Weapons
so, the whitelist could look like this:
_whitelist = ["@CUP Weapons","@CUP Units"]; //I dunno what configSourceMod returns for cup items so double check that
_arr = _arr select {(toLower configSourceMod (_cfg >> _x) in _whiteList)};
?
Yes, that should in theory be reliable
However, if you only want cup stuff you could also just filter the class names since they all start with CUP_
keep in mind, i have zero scrip skills
"just" is like climbing mt everest without oxigen, gloves and boots for me ๐คฃ
i can't even find the function where the blacklist is called to change it to a white list.......
so much for that
A3\Functions_F_Warlords\Warlords\fn_WLArsenalFilter.sqf
BIS_fnc_WLArsenalFilter
This one?
yes. i cant find where this function is called
you got arma 3 data extracted?
yes
Then just use "Search in files"
"configName _x select [0,4] == 'CUP_' && (getNumber (_x >> 'scope') > 1)" configClasses (configFile >> "CfgMagazines");
This is how you filter cup items by the class name
searching 92k files now ๐
safe to say that scanning only .sqf files would be enough ๐
it's not in warlords functions
a3\missions_f_warlords\commonInitScript.sqf:
[] spawn {
waitUntil {!isNil "BIS_WL_arsenalSetupDone"};
call BIS_fnc_WLArsenalFilter;
};```
and "BIS_WL_arsenalSetupDone" leads to a3\functions_f_warlords\Warlords\fn_WLClientInit.sqf which also contains some sort of blacklist
if (BIS_WL_arsenalEnabled == 1) then {
BIS_fnc_arsenal_data set [3, BIS_WL_factionAppropriateUniforms];
BIS_fnc_arsenal_data set [5, (BIS_fnc_arsenal_data select 5) - BIS_WL_mortarBackpacks];
BIS_fnc_arsenal_data set [23, (BIS_fnc_arsenal_data select 23) - ["APERSMineDispenser_Mag"]];
BIS_WL_arsenalSetupDone = TRUE;
damn... this is getting worse and worse
i think the "whitelist" approach is a nope
any idea how to rewrite the blacklist to have the rest of vanilla stuff removed?
Thanks to Taro i have a solution to my problem (which sadly requires rebranding of functions_f_warlords for now):
combined custom warlords arsenal:
- place an arsenal box (or a box where the custom arsenal is attached to) in the mission and hide it
- name the box (in my case
CUP_Arsenal_Box) - open
fn_WLOpenArsenal.sqfand use this
_funds = player getVariable "BIS_WL_funds";
"close" call BIS_fnc_WLPurchaseMenu;
_null = ["Open",[nil,CUP_Arsenal_Box,player]] spawn bis_fnc_arsenal;
player setVariable ["BIS_WL_funds", (player getVariable "BIS_WL_funds") - BIS_WL_arsenalCost, TRUE];
closeDialog 602;
faction specific warlords arsenals:
- place two arsenal boxes (each with a custom arsenal for the specific faction)
- name the boxes (in my case
CUP_USMC_ArsenalandCUP_Russia_Arsenal) - open
fn_WLOpenArsenal.sqfand use this
_funds = player getVariable "BIS_WL_funds";
"close" call BIS_fnc_WLPurchaseMenu;
if (!(CUP_USMC_Arsenal isEqualTo objNull) && !(CUP_Russia_Arsenal isEqualTo objNull)) then {
private _arsenalBox = CUP_USMC_Arsenal;
switch (true) do {
case (side player == west): { _arsenalBox = CUP_USMC_Arsenal};
case (side player == east): { _arsenalBox = CUP_Russia_Arsenal};
};
_null = ["Open",[nil,_arsenalBox,player]] spawn bis_fnc_arsenal;
} else {
_null = ["Open", TRUE] spawn BIS_fnc_arsenal;
};
player setVariable ["BIS_WL_funds", (player getVariable "BIS_WL_funds") - BIS_WL_arsenalCost, TRUE];
closeDialog 602;
thx to everyone here who tried to help me out nevertheless
Has anyone experience addActions on containers with "Inventory" loosing they addActions a little while into the mission? Don't know what is causing that.
Any way to improve this code? Is there a way to check if the game has the pause menu open in MP?
h = [] spawn {
while {true} do {
waitUntil {! isNull (findDisplay 49)};
_btn = ((findDisplay 49) displayCtrl 2) ctrlSetText "";
_btn2 = ((findDisplay 49) displayCtrl 103) ctrlSetText "";
_btn2 = ((findDisplay 49) displayCtrl 2) ctrlSetBackgroundColor [0.7, 0.3, 0.9, 1];
_btn1 = ((findDisplay 49) displayCtrl 1005) ctrlSetText format ["ZGM83 Afghan war. %1 : Arma 3 v%2.%3!", "1.79", (productVersion select 2), (productVersion select 3)];
_btn3 = ((findDisplay 49) displayCtrl 120) ctrlSetText "Enemy insurgents have invaded Aghanistan. Destroy their assets and remove all enemies to free this suffering nation. This must be carried out in a humanitarian way, minimising damage to civilian assets.";
_btn4 = ((findDisplay 49) displayCtrl 523) ctrlSetText playername;
_btnclr = ((findDisplay 49) displayCtrl 2) ctrlSetBackgroundColor [0, 0, 0, 0];
_btnclr1 = ((findDisplay 49) displayCtrl 103) ctrlSetBackgroundColor [0, 0, 0, 0];
//_CEH = ((findDisplay 49) displayCtrl 2) ctrlAddEventHandler ["MouseButtonDown",{(findDisplay 49) closeDisplay 0; _ok = createDialog "MyDialog";}];
//_CEH = ((findDisplay 49) displayCtrl 2) ctrlRemoveEventHandler ["MouseButtonDown", 0];
waitUntil {isNull (findDisplay 49)};
};
};
This is meant to use the Arma 3 multiplayer pause menu to display various text. I should not use while {true}, but I need a better way.
bunch of unnecessary assignments in your code
use onGameInterrupt event handler
Thank you.
hello old friends,
i have a question, in a stream the vcom ai dev did, they use some sort of debug tool to see what the ai is "thinking" or well trying to do, their paths, commands etc. What is that and how do i access it (trying to figure something out in my mission and i want to avoid using unitCapture)
quick timestamp: https://youtu.be/mfY2ff9WZeg?t=697
When you use the dev beta branch there will be an arma3diag_x64.exe which will allow you to enable /disable diagnostics for specific things about the game.
Have a read about them on the wiki https://community.bistudio.com/wiki/Arma_3:_Diagnostics_Exe
The ones your looking for are under AI
ahhh i need a different branch i see, okay, ill check it out, thanks!
Hey there, trying to get an attached object to rotate through my addAction "Rotate". I can get it to go by setDir but i want to be able to select rotate again and keep rotating the object to optimal position. I was wondering if there was something i could do along the lines of setDir++ where it just keeps adding direction incrementally. Code below for reference ``` player addAction [
"Round Sandbag",
{
params ["_target", "_caller", "_actionId", "_arguments"];
JD_Barrier = ["Land_BagFence_Round_F"] call createObject;
},
nil,1.5,true,true,"","JD_Barrier isEqualTo objNull"
];
player addAction [
"Rotate Sandbag",
{
params ["_target", "_caller", "_actionId", "_arguments"];
JD_Barrier setDir 180;
},
nil,1.5,true,true,"","JD_Barrier isNotEqualTo objNull"
];```
if ( GVAR(CMarkerTagChannelVisibility) == MTAG_ALWAYS_ON ||
( !GVAR(CMarkerTagNameVisibilityTemporaryOn) && GVAR(CMarkerTagChannelVisibility) == MTAG_ON ) ||
( GVAR(CMarkerTagNameVisibilityTemporaryOn) && GVAR(CMarkerTagChannelVisibility) == MTAG_OFF )
) then
{
if (d_restr_enable_freeze) then {
if (_mar select 12 == 1) then {
_text = (GVAR(CMarkerChannelToChar) select MAR_CHAN(_mar)) + " " + _text;
} else
{
_text = ((_mar select 11) select 0) + " " + _text;
};
} else {
_text = (GVAR(CMarkerChannelToChar) select MAR_CHAN(_mar)) + " " + _text;
};
};
How to rewrite to use "param" instead of "select" for 2nd "if". Simply instead "select 12" use "param [12]"? That's all?
if ( GVAR(CMarkerTagChannelVisibility) == MTAG_ALWAYS_ON ||
( !GVAR(CMarkerTagNameVisibilityTemporaryOn) && GVAR(CMarkerTagChannelVisibility) == MTAG_ON ) ||
( GVAR(CMarkerTagNameVisibilityTemporaryOn) && GVAR(CMarkerTagChannelVisibility) == MTAG_OFF )
) then
{
if (d_restr_enable_freeze) then {
if (_mar param [12] == 1) then {
_text = (GVAR(CMarkerChannelToChar) select MAR_CHAN(_mar)) + " " + _text;
} else
{
_text = ((_mar select 11) select 0) + " " + _text;
};
} else {
_text = (GVAR(CMarkerChannelToChar) select MAR_CHAN(_mar)) + " " + _text;
};
};
Error with "select" which was spamming
22:24:42 Error position: <select 12 == 1) then {
_text = (amm_CMar>
22:24:42 Error Zero divisor
22:24:42 File xx\addons\d_map_adv_markers\client.sqf..., line 135
22:24:42 Error in expression <(d_restr_enable_freeze) then {
if (_mar select 12 == 1) then {
_text = (amm_CMar>
sorry, when i try to local exec diag_toggle "AIBrain"; it throws up an error 'diag_toggle "AIBrain";' Error missing ;
you may not be using the proper exe
it said Dev with the lil blue thingy on the launcher, is that not it?
The launcher only uses the default exe
ah heck
all the ctrlSet* commands you use return Nothing. All your local variables in there are useless. Mayb ejust get rid of them.
Also the h= [] spawn looks wrong too. If you intend to save it in a variable, you should use a TAG_ and a readable variable name that tells you waht it is, not h. And if you don't intend to save and use the result, you shouldn't save it in a variable
MAR_CHAN(_mar) we have a script command for marker channnel https://community.bistudio.com/wiki/markerChannel
Simply instead "select 12" use "param [12]"? That's all?
yes. But that would make param return nil, and comparing nil==1 will make your else statement not run.
Use param [12, 0] where 0 is the default value in case a 12th value isn't available.
An easy way around this is to rename the old exe arma3_x64.exe to something else, then rename the arma3diag_x64.exe to arma3_x64.exe.
Then when you start the game through the launcher it will launch arma3_x64.exe which is now the diagnostics exe.
Just remember to rename them back if you want to play multiplayer as diag exe has multiplayer disabled.
So, I am new to SQF, or to say better i've never did any SQF scripting, so I am not sure if this script of mine would work as intended
uisleep 5;
systemChat format ["Starting Heroes of Serbia Content Protection System..."];
sleep 10;
if (!isMultiplayer) exitWith {};
if (isMultiplayer) then
{
systemChat format ["Starting Heroes of Serbia Content Protection System..."];
//Gets Players Steam64ID
_igrac = getPlayerUID player;
//Banned Players Steam64UID
_listaID = [];
//Length of the Array
_velicinaBanListe = count _listaID;
for [{_i = 0}, {_i < _velinicaBanListe}, {_i = _i + 1}] do // A loop repeating 10 times
{
if (_igrac == _listaID # _i) then{
systemChat format ["Starting Heroes of Serbia Content Protection System - Check Failed"];
sleep 5;
titleText ["Using Heroes of Serbia Mod without permission? How about no? Keep playing and Markan will be big sad :(","PLAIN",5];
sleep 5;
disableUserInput true;
titleText ["Still not going to stop using the mods? Alrighty then","PLAIN",5];
sleep 10;
titleText ["Can't move? How about we kick it into overdrive?","PLAIN",5];
sleep 5;
player allowDamage false;
player enableFatigue false;
player setUnitRecoilCoefficient 15.0;
enableCamShake true;
addCamShake [10, 45, 10];
[getPos player, east, 10] call BIS_fnc_spawnGroup;
for "_j" from 1 To 10 do
{
[getPos player, east, 100] call BIS_fnc_spawnGroup;
if(vehicle player != player) then { vehicle player setDamage 1; };
_veh = "Bo_GBU12_LGB" createVehicle position player;
sleep 5;
};
titleText ["Still here hun? Well, you ain't anymore","PLAIN",5];
"end1" call BIS_fnc_endMission;
} else
{
systemChat format ["Heroes of Serbia Content Protection System - Checks Passed!"];
systemChat format ["Have fun using our mods"];
};
};
};```
gotcha, i thought since it said Dev on the side that it auto loaded the dev thingy, because i didnt want to load mods with launch parameters xd
It loads the dev exe, but the diagnostics exe is separate to the dev exe
i see
didn't you tell me you made a module? ๐ค
I call mods modules
Habbit I inherited from a buddy
ok
Sorry if a misunderstanding happened ๐
// A loop repeating 10 timeshuh? why?
(_igrac == _listaID # _i) you just want to check if id is in list no? Then just use in ?
I'm having some trouble with BIS_fnc_setObjectRotation. I have [JD_Barrier, [0,0,50]] call BIS_fnc_setObjectRotation; in an addAction to rotate. When i make the x, y, z 100,100,100 i can keep hitting space on the action and it will rotate, just not the way i want it to. I need it to rotate on its x axis. But when i change any of those values it doesn't change the rotation. Any ideas?
would this require the use of vectorDir?
THat comment wasn't a well phrased one lol ๐ Yeah, I wanted to check is UID is in the list
hm now im getting some weird error.... assert usr.. bad case in texture name?
..dev\futura\lib\txtbank.cpp[290]\func: Texture::SetName
anyone know what thats aout
(dont worry just hit ignore a buncha times, its fine, dont worryyy about it)
c:\bis \ source\ dev\futura \physx\physxintefface.cpp(5569)(fu nc: Physx3Transport::Init) [AssertRLS] MainThread= 5152 Config: Warning! suspForceAppPointOffset is set above the center of mass. This will result in odd vehicle behaviour Its highly recommended to set tireForceAppPointOffset to position below the COM and above the wheelCenter.
hmmmmmmmmmmm
gotcha, nah its just throwing a bunch of errors, persumably 1 one of the mods is broken
hi.
is there any way to have some sqf files in server paths (outside mission/pbo), and run their functions/invoke them inside mission (ie: external reference?) without being a mod?
not recommended but if you run the server with filePatching enabled, sure
@winter rose yet to investigate that, but to be sure I understood correctly:
if I have myserverfunctions.sqf and running mission altis.pbo...will I be able to edit/change sqf file "on the fly/hot" while playing?
maybe, but I don't think so
the server might lock it
if you do that for test purposeโฆ you are doing it wrong ^^
please, light my darkness
so far for me, scripting is a pita :S
much appreciated, but my main concern is having to exit to eden to just change a colon, and then back to play and wait the loading screen...to change another colon f**k again, and wait...and so on.
that's why i was looking some easier to read and handle than console...
why not write it properly in the first place ๐ฌ
you can test with a local server/client as well
Visual Studio Code shows you some code errors with some SQF plugins, too
1- same apply to winning the lottery
2- im testing local. the loading screens is what kills me.
3-I didnt knew vscode could handle that...ill take a look right now!
thanks Lou!
depending on your usual errors, if they are MP locality, or just script-writing issues
if you have script issues, then you don't even need to run a server @mighty vector; the script error window should tell you when starting preview in Eden anyway (if you enabled -showScriptErrors ofc)
hmmm im getting a generic error here on the # mark do sleep commands not work with event handlers
_soldierName groupChat "Popping green smoke"; #sleep 5; "Land_HelipadCircle_F" createVehicle _lzSite; ```
it works without the sleep command
but i need the delay
