#arma3_scripting
1 messages Β· Page 757 of 1
technically you can do: 10 * call KK_fnc_trueZoom * (_cameraInUiWidth / _cameraInUiHeight) to get x10 zoom, no?
and use that with camSetFov
well
the two local variables you added
you mean this?
RscPicture ctrlSetPosition [0.301595 * safezoneW + safezoneX, 0.22786 * safezoneH + safezoneY, 0.386302 * safezoneW, 0.363 * safezoneH];
yeah
what shall I input, the first two coordinates? or the first two in _cameraInUiWidth and the last two in _cameraInUiHeight?
no, width and height accordingly
I guess 0.301595 * safezoneW + safezoneX, 0.386302 * safezoneW is for width but how would I put this array into that variable I don't think I should do that?
0.386302 * safezoneW and 0.363 * safezoneH
thought so, thanks mate
stay sharp I guess
i'm not sure if it will work
so when the value is between 10-4
the fov doesn't change
but when its below 4
it changes drastically
and at 0 it zooms very far
for example
KK_fnc_trueZoom = {
(
[0.5,0.5]
distance2D
worldToScreen
positionCameraToWorld
[0,3,4]
) * (
getResolution
select 5
) / 2
};
(1 * call KK_fnc_trueZoom * (0.386302 * safezoneW / 0.363 * safezoneH))
this returns 0.76
below 1 the zoom actually starts
oh yeah π you want to divide, not multiply
divide? divide (call KK_fnc_trueZoom * (0.386302 * safezoneW / 0.363 * safezoneH)/10 ??
try it, yeah
i'm waiting for my new motherboard, don't have anything to run arma properly with 
well
it makes more sense now
but the zoom still looks a bit weird
so I guess I will have
to multipy it
by a small factor
to make it more plausible (its stretched)
yeah because it still uses the ratio from your actual screen
there isn't much documentation on how the entire fov/zoom stuff works
and
the fov calculator for arma 3
is down
if its not down it would have made my day much easier
i'm pretty sure it uses made up value for scaling anyways
fovLeft = fovTop / height * width is all you need to know really
yea
thats what I meant
anyways It looks good now after I found a good number to multiply the thing with, thanks
To properly #include CBA stuff into .sqfc files, do I need a copy of CBA on my P: drive?
yes
How do I set up an AI wing man
Need help with this
Condition to open lock the door
Code, scripting the required conditions to unlock the door, can be anything, must return BOOL
I tried this
_Bob2 setOwner 76561198202693127 = True;
Well, that's a command, not a condition. So that just means that every time the condition is evaluated (maybe every frame if it's an addAction π¬ ) you're setting the network owner of the _Bob2 unit to whoever's Steam ID that is, assuming they're in the game.
Except that's probably not working, because you're taking that command and trying to set its value to true, which is fundamentally incorrect syntax.
It would help to know what you actually want the condition to be.
can i shoot you a dm of my screenshot?
I'd prefer it if you described what you want the condition to be
If it's a screenshot of the error, that won't help; the error is caused by an underlying major flaw in the script and it needs to be changed regardless of what the error says
its a door im trying to have people's uid be checked if true from list then it will unlock. using Mrhmilsim tools biometric scanner
Then your condition will probably need to look something like
(getPlayerUID _this) in [array,of,UIDs];```
obviously fill that array with the UIDs you want.
its giving me a bool error though so how would I need to implement =True?
You don't.
= true means "set this variable to true", so using it on a command is wrong syntax. You probably meant == true, "compare this variable to true", but you don't need to do that since that since _variable == true will just return true if the variable is true...so you can just return the original variable (in this case the output of the in command)
Based on how completely incorrect the original code was, I suspect you may have other errors elsewhere that will also be popping up. Script errors usually display the position of the error in the code, which would be useful info for fixing it.
Note: "completely incorrect" sounds harsh. I'm not attacking you; sqf can be complex and unintuitive. But...it was completely incorrect.
its a fill in on eden module not a scripted document
Okay, so it probably won't give a line number, but what does it actually say?
Condition to open lock the door
Code, scripting the required conditions to unlock the door, can be anything, must return BOOL
....the error
got a Bool error
A bool(ean) is a type of data that has two possible states, true or false. You have an error that involves a bool, not a bool error. What does it say exactly?
call compile _condition;
if (typeName |#|_condition != "BOOL") exitWith {
system...'
Error Undefined variable in expression: _conditon
Filr MRHMiscItemsFunctions\fn_MilsimTools_miscItems
if !([_building,_do...'
Error Undefined Variable in expression: _condition
Okay, that's not actually a bool-related error, that's an undefined variable error. Something inside that script is looking for a variable called _condition that doesn't actually exist.
Btw, script errors are logged in a special text file called an RPT file. This is stored in %localappdata%\Arma 3 and will save you a lot of transcription.
so what do i need to put in the Condition to open lock the door for only certain people to open it
i look at the mods wiki and it say wip
Either exactly what I posted or something very similar.
This script error means one of 3 things:
- the Condition field is empty
- a different Condition field is empty
- the mod is broken
I don't know which. I don't have this mod installed and I don't know anything about it. Maybe you can check the Workshop comments or contact the author.
ok thank you for the help and teaching me the correct meaning of bool in arma
It also means that in any sort of programming
hello, i wanna change the magazine to cluster rockets in mk41 VLS. the variable name is g2. is this how i do it?
g2 loadMagazine [[0], "weapon_VLS_01", "ammo_Missile_Cruise_01_Cluster"];
i put it in object init
you aren't supposed to pass ammo classname but magazine
yep
is it because my code is too long?
tried shortening it and it worked
but I'm still facing a problem
did you read it? I did, it says "Number, expected Array"
a variable that should be an array is actually a number
check the values around the error location
shall I go in config?
configfile?
isn't this error a script error?
nope
when I remove a bunch of lines it seems to work
really weird
I have about 500 lines
then Β―\_(γ)_/Β―
does
owner (allplayers select 3);
give me the OwnerID of the fourth player?
Assuming that you run it on the server, and they've been connected for long enough for control to transfer to that machine?
owner only works on the server.
clients don't know the owners of remote units.
They just know if it's them.
then I'm better off doing
[player, {
_caller = _this;
_caller setVariable ["GrabID", clientOwner];
}] remoteExec ["spawn", _unit];
?
local exec
What is this actually for?
need to grab the clientID of a _unit that I will select through a list
Why?
You know the data has to go through the server anyway, so generally you're better off telling the server to do stuff like this.
well
can you show me an example of how to grab the ID?
through the server
kinda lost
from the server it's just owner
by that I meant
I want the clinetID to be grabbed and defined as a variable locally to me
so I route it from the server to me locally basically
I feel that the approach here is probably fundamentally wrong, but yeah, you could setVariable the machine ID on the player object if you really wanted to.
But it needs to be player setVariable ["GrabID", clientOwner, true], otherwise it won't be broadcast.
hm
player
in that case
is who?
me or the fourth player I'm grabbing?
I mean you can just run that as global if you like.
and then everyone has their machineID published on their player unit.
_longResult is a number when it should be an array.
A WeaponHolderSimulated, after it stoped to move, is like a GroundWeaponHolder? I ask that because i will create 200 Weapons Holders, and i don't want to use the simulated one if it will use more server and clients resources. But simulated is better since some will be created in air and need to fall to the ground.
IIRC from profiling they still continue to use simulation resources.
So if you want them to drop initially then ideally you'd manually transition them after a few seconds.
@granite sky thanks!
yeah
although its actually a length problem
that was fixed by either shortening the code in debug console
or putting the code in an init of an object or sqf file
debug console basically gave up at 500 lines of code
so I had to change the execution method
I'm using leopard20's debug console
trying to make a script that spawns a copy of an object that your looking at, and then be able to manipulate it.
specifically. spawn the object your looking at; at your feet and attach it to you
cursorobject and cursortarget return obj null
disregard, forgot typeof exists
Hi, how can i find class name for a missile used in drone's loadout? i'm trying to remove all its weapons using removeWeapon "some_class" but don't know how to find the class name..
go into gunner of the drone, select the missile and then try
vehicle player currentWeaponTurret [0]; vehicle player magazinesTurret [0];
should return the weapon and its ammo
thanks
how do i spawn a group of objects each with own variable name
returns empty string and array
you'll have to be more specific.
i need to spawn a checkpoint with each object (about 15 objects total) having a unique variable name e.g. obj_1 obj_2 etc. i need it because i want to make a hold action that "builds" a checkpoint object by object and if interrupted, removed the checkpoint object by object
wouldnt an array be more useful then?
:)
yeah what real artisan foods said
yeah!
sorry im very bad at coding, how would one do that?
how are you spawning the checkpoint?
i'm not sure: i asked how to do it, got no response
is it relative to the player or is it a predefined emplacement
i thought about having the checkpoint somewhere far away and just setting their position so they already have variables and i can use it
predefined
like when you hold a button in a lego game and the thing builds?
personally I would just hide the objects and unhide when the player "builds" them
hide? like move away?
Where that example said vehicle player, try getConnectedUAV player instead.
You can also look up weapons by name here: https://community.bistudio.com/wiki/Arma_3:_CfgWeapons_Vehicle_Weapons
both sp and mp
hideObject has a local effect, you either execute it for everyone or execute it on one machine with hideObjectGlobal
depends on how you're writing the script
on the server I believe?
does it just hide the visual? physically it's still there?
no you can walk through it
Yes, must be server only
oh ok
but if it's mp and i hide it locally?
so it's not visible for me and i can still walk through? what will the other players see?
i haven't tested it myself but I'd imagine it would allow local objects to pass through
They will see the object and will not be able to walk through it
okay
dont quote me on that though
so to hide it from start i type hideObjectGlobal "objectvariable";?
if you're in eden editor you can just uncheck "Show Model"
okay
it's under special states
thank you
np
appreciate that
The wiki page explains how to format the command properly.
Take note that where it says "server execution", it means server execution only, executing on all clients can have negative effects. If you run it in an init field you need an if isServer then { }; to make sure it only runs on the server.
so what if i'll be running it in multiplayer AND sp sometimes for myself? how would it look?
if server then hideobjectglobal, else: hideobject?
okay
That works, thanks!
to unhide objectName hideObject false;?
yeah
thanks
Hi guys i have a simple question why is this code not showing the hint?
_veh = "B_G_Van_01_transport_F" createVehicle position player;
_veh addEventHandler ["Fired", {
if(_this select 1 == "CarHorn") then {
hint "Test";
};
}];
Are you certain that that vehicle has a CarHorn? There are several different horn weapons
Yea i even copy and paste it from weapons cfg of that vehicle
Okay, this came up a while ago and it seems like horns just don't set off the Fired EH
Instead, you can try the new user action EH to detect the primary fire action. https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#UserAction_Event_Handlers
You'll need to do some extra checks within the EH to verify that the player is in the right vehicle and has the right weapon.
okay, i used sleep + hide object false but i found an issue: if i interrupt, the code to unhide objects contrinues while the other code tries to hide them. what mistake did i do?
im sorry im just pretty bad at coding
you don't need to use sleep
codeProgress: Code - (Optional, default {}) code executed on every progress tick.
so it's executed every tick? how do i make the code spawn different objects then?
when you hold down the action it'll count from 1 to 24 and pass that to the code expression
okay, im getting lost. 24 ticks to finish hold action, right?
yes
it gives you the tick it's on
and you can turn that number into an index number for your array
so if my array is a list of objects to spawn, the 1st object will be spawned at the first tick, the second on the second tick etc., right?
Also quick question why dose this https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#UserAction_Event_Handlers
has parameter "this" before action. And here its without: https://community.bistudio.com/wiki/addUserActionEventHandler is that a typo or are there diffrent useractions ?
{
params ["_target", "_caller", "_actionId", "_arguments", "_progress", "_maxProgress"];
private _multiplier = ((count your_array) / _maxProgress);
private _index = (_progress * _multiplier);
if (_index % 1 == 0) then {
(your_array select (_index - 1)) hideObject false
}
},
@digital wasp
this will count how many objects are in the array, get the progress as a fraction of that number, and then if it's divisible by 1 it will hide the object at that index
my array should be in init.sqf?
yeah that'll work
and i have to put it in?
vad_buildArray = [Obj1, Obj2, ...]
init of the object? code start? code progress?
what I posted is the codeProgress parameter
thank you
can I disable the briefing screen when I use initIntro.sqf ? I have the "Show Briefing" unchecked in mission attributes but when I playtest my mission (from the editor) with an intro, it is still shown instead of a smooth transition to the actual game.
what?
i wrote the wrong variable at one part
oh okay
edited the block
i also just realized this will only work with an even number of objects, I'm not good at math so if nothing else you can do a isObjectHidden check and ceil to round up the index so it's always an integer
to hide everything on interrupt i would have to:
{_x hideObject true} forEach your_array;
```? im trying to figure some things on my own so correct me if 'm wrong
besides the typo that's correct
i have 18 and 6 objects in 2 arrays so i should be fine?
sounds good lol
thank you
that is a very good question. I would say that the this parameter is wrong here
no actually my code is wack that should work for some objects but let me rewrite it real quick
okay
i should have paid attention in algebra class 
same
Is there a way to globally set AI skill for all current and future units in 3den editor? Or do i have to set the skill of units i spawn with scripts manually?
@winter rose what do you have to say in your defense (if it was you who added them)?
@digital wasp ```sqf
{
params ["_target", "_caller", "_actionId", "_arguments", "_progress", "_maxProgress"];
private _multiplier = ((count your_array) / _maxProgress);
private _index = ((ceil (_progress * _multiplier)) - 1);
private _object = your_array select _index;
if (isObjectHidden _object) then {
_object hideObject false;
};
},
ur mom is a nice lady
touchΓ©
now how come you did not fix it π
i am trying to find the messages in #community_wiki with more info but discord doesnt find anything
[] spawn {
while {true} do {
{
_x setSkill ["general", 1];
_x setSkill ["aimingAccuracy", 1];
_x setSkill ["aimingSpeed", 1];
_x setSkill ["endurance", 1];
_x setSkill ["spotTime", 1];
_x setSkill ["courage", 1];
_x setSkill ["aimingShake", 1];
_x setSkill ["commanding", 1];
_x setSkill ["spotDistance", 1];
_x setSkill ["reloadSpeed", 1];
} forEach allUnits;
sleep 10;
};
};``` I guess something like this is what you need but its quite expencive becouse of the infinite loop.
i like to verify my contributions unlike some other people
π
I fixeded it π
https://community.bistudio.com/wiki/BIS_fnc_EXP_camp_setSkill I don't know how effectively this works but it feels cleaner
oh yea or that didnt even check if fnc like that even existed. ;D
it effectively does the same thing i believe, just adds a little variation
might be better to set a variable for all of the units and run a check if they've already been assimilated
I have a quick question so i have this code:
[] spawn {
_veh = "B_G_Van_01_transport_F" createVehicle position player;
waitUntil{!isNull findDisplay 46};
(findDisplay 46) displayAddEventHandler["MouseButtonDown",{
params["_display","_button"];
private _car = objectParent player;
if(!isNull _car && {_button == 0 && driver _car == player && _car isKindOf "B_G_Van_01_transport_F"}) then {
hint "Test";
}
}];
};``` how would i check if player pressed left click in only that vehicle that is _veh with out makeing the variable global ?
im not sure why, but it doesn't work. my arrays ii int.sqf:
objlist1 = [obj1, obj2, obj3, obj4, obj5, gate5];
objlist2 = [gate6, obj6, obj7, obj8, obj9, obj10, obj11, obj12, obj13, obj14, obj15, obj16, obj17];
i put your code in "Code Progress", i changed "your_array" to objlist1, i thin i did everything right. what could be an issue?
can you send the holdAction parameters
i cant send sscreenshots
have you considered setting a variable to the vehicle and then using vehicle player getvariable
why not use a global variable?
you can also add an event handler to the vehicle to pass the _veh to a player variable and then check if the player variable matches the vehicle
could you pls elaborate a bit how would i do that.
_veh addEventHandler ["GetIn", {
params ["_vehicle", "_role", "_unit", "_turret"];
player setVariable ["clickVic",_vehicle];
}];
if (player getVariable ["clickVic",objNull] == vehicle player) then {...}
Ty very mutch it worked i really need to touch up set and get varaibles ;D
you're welcome
Is there any way I can disable a specific function in the controls menu (keyboard)?
No, it keeps being simulated even if it stops (more expensive)
I may be a day late. And if you're thinking that, you'd be correct! 
Im trying to get a squad to add the nearest vehicles to use. Help. _list = P1 nearEntities ["CAR", 200]; { p1 addVehicle _x; } forEach _list;
what is P1?
is there a way of doing this
_selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
[_x, 0.2, _selection, "vehiclecrash"] call ace_medical_fnc_addDamageToUnit;
``` for all units around an object? (around 5 meters) Normally id use `forEach units grp_1;` but I'm trying to make have an effect around a certain position
to make it more complicated, the object moves around, and up and down
yes, see nearEntities
Forgive me for maybe giving somebody an aneurism, but is this the correct usage?
{_selection = selectRandom ["body","head","hand_r","hand_l","leg_r","leg_l"];
[_x, 0.2, _selection, "vehiclecrash"] call ace_medical_fnc_addDamageToUnit}
forEach getPosATL _obj1 nearEntities [type, radius]```
getPosATL redundant and you have precedence issues, add () around the right argument of forEach
I just saw that haha, it has to be an object not a number, but thank you!
it wasn't a number 
Sorry, array
Hi guys so i have math question. So how can i make it so the cannon shoots from direction that is point at. So i have a cannon that is rotating on X angle 360. and i want to fire a object from direction that cannon is faceing but every time i fire the bullet is going to the left or front depending on what side of X rotation cannon is: code:
_Bullet = createVehicle ["Land_GasTank_01_khaki_F", position smokeeffect, [], 0, "CAN_COLLIDE"];
_dir = direction cannon;
_vel = velocity cannon;
_speed = 20;
_Bullet setVelocityModelSpace [
(_vel select 0) + (sin _dir * _speed),
(_vel select 1) + (cos _dir * _speed),
(_vel select 2)
];```
setVelocityModelSpace is relative to the bullet's heading, so that won't work as intended.
If you don't care about the facing of the bullet then setVelocity should work.
i did try with Setvelocity and it shoots but it shoots sideways, how would i fix so it shoots just in direction that is pointing at.
Remind me what direction 0 is in Arma :P
Also i do care abou the faceing of a bullet i would like to make it so the bullet is actually looking so its fired from a cannon.
Also does this cannon have a 3d direction or just 2d?
_bullet setVelocity ((vectorDir cannon vectorMultiply 20) vectorAdd velocity cannon);
_bullet setVectorDir (vectorDir cannon);
better just to work with vectors if you have them.
Can't guarantee that the direction part is sensible because it depends which way up the objects are modelled.
who executed the scripts passed by execVM?
Is it only the client calling the execVM, or server, or all clients and server?
the machine where it's executed
Thanks man, appreciated!
can I change the position of 3rd person camera without creating a mod for it? I'm checking out some mods like this on workshop and all of them have to refer to CAManBase in CfgVehicles (config.cpp) so I assume it's impossible to be changed by a sqf/hpp script on fly or defined in description.ext?
no
How could I... at a certain point in a mission. Switch to a AI on a emeny team for me to control
^
There is also https://community.bistudio.com/wiki/remoteControl
Seems like it can be bugger for MP
mostly works IME :P
Buggy
Follow the caveats and you should be ok.
Thanks 
this is wrong
{
params ["_target", "_caller", "_actionId", "_arguments", "_progress", "_maxProgress"];
private _minIdx = floor (((_progress-1) / _maxProgress) * count your_array) - 1;
private _maxIdx = floor ((_progress / _maxProgress) * count your_array) - 1;
for "_index" from (_minIdx max 0) to _maxIdx do {
private _object = your_array select _index;
if (isObjectHidden _object) then {
_object hideObject false;
};
};
},
what you had there might've skipped objects
if it skips for you like I said here then yes
depends what maxProgress is
then the number of your objects is fewer than maxProgress
Yeah we went over it in dms there are fewer than 24 so it works as is
appreciate the correction though
is this the script to check if group is in vehicle:
call{units group_name findIf {!(_x in vehicle_name)} < 0}
```?
If any of that group are in that specific vehicle? Should work.
_x addEventHandler ["Local",
{
params [["_entity", objnull,[objNull]], >
Error position: <params [["_entity", objnull,[objNull]], >
Error Params: Type String, expected Bool```
code used
_x addEventHandler ["Local",
{
params [["_entity", objnull,[objNull]], ["_isLocal", false, [false]]];```
this the string return a bug or part of the "expected" behavior of local EH?
for large public MP, is it better to define your variables in the config security wise?
that's all, not any
afaik no
if you want them to be read only that's one way, ye
you can also use complieFinal or something
Is it possible to check if a map coordinate is on-screen when looking at a map?
Regarding structured text, is it possible to put text alongside an image? I've been messing with the vertical alignment, but that just adds a single line of the paragraph and the rest goes underneath
It checks that all of them are not in the vehicle, which is equivalent.
Worded my question a bit badly, changed
do you mean like this:
bla bla #####
blaaaa #####
test te #####
sting this wh
at it be like
``` with # being the image area?
That's the one
then no
Balls
it checks if any is not in a vehicle -> all in vehicle
so not equivalent, no
ugh, might be losing the plot :P
convert the two ends of the screen to map coordinates, then use inArea
or the opposite. convert the map pos to screen coords (not sure if a command existed for that one)
_man = param[0,nil,objNull];
Error Type Object, expected Array 
third parameter of param is an array of expected types, so:
_man = param[0,nil,[objNull]];
I suppose I did not notice I was missing that for a while because [] unintentionally works for arrays.
wooooh black betty, man param
[] unintentionally works for arrays.
[] means any data type
not arrays
I know, but there will be no error so you can make the mistake indefinitely without noticing
["woo", "", "", "wee"]
how can I use joinString/splitstring to get
"woo", "", "", "wee"
I don't get it. You just removed the brackets?
yeah I want to change the array to a flat string while retaining empty strings
figured it out:
copyToClipboard (str primaryWeaponItems player splitString "[]" joinstring "")
//returns
"ACE_muzzle_mzls_smg_02","","",""
Does anybody know a way to get the specific WeaponHolderSimulated a unit creates when it dies?
It might be the last index when calling "vehicles" in Killed EH.
No that's not right
Unfortunately I did find the answer though. When you kill a unit with a primary weapon, the "Put" event handler fires...
unfortunate because I don't want my script responsible to put an event handler on every unit in a mission
alrighty so i have a script that i want to have stacking effects of increasing the animation speed coef when its activated and i have some code that essentially is this
_current = (getAnimSpeedCoef _target);
_increase = _current + 0.5;
_apply = _target setAnimSpeedCoef _increase;
the issue is atm _current gets stuck with the initial value of 1 for some reason and i cant increase the coef past 1.5 no matter how many times the script activates
@tranquil jasper Put handler attached to the dead unit or the killer?
@winter rose sorry for tagging but can you send that biki sqf editor programs page that you sent in this channel again?
you can use <sqf> now
I think you misunderstood me
the page contained a bunch of debug consoles
and sqf editors
such as notepad++ and visual studio
thank you
Anyone knows where to get the armor on a infantry Vest?
So far the closest I am getting is:
(getText (configFile >> "CfgWeapons" >> "V_PlateCarrier1_rgr" >> "descriptionShort"))
Which returns:
"Armor Level III"
And that is fine in most cases, but then you got mods with other values, and there are explosive-resistant vests and this throws the system into the bin.
What I am asking, is there somewhere in the config I can extract a numerical value of some sort, that represents the armor given by said vest
The description is just a description, doesn't represent the actual value. Are more like a flavor text
Hang on, let me check what it was
Nice!
yeah it's just a string assigned in the description of the item, mods can either write their own, ignore it, or mistakenly inherit it. so you might have a baseball cap that's level II armour or something stupid, it doesn't mean its actually armoured
you'd have to check the HitpointsProtectionInfo class inside ItemInfo
https://community.bistudio.com/wiki/Arma_3:_Soldier_Protection
Yeah what Kerc said
The practical issue there is that the new data has a lot more numbers, so you'd need to figure how you want to combine them.
(getNumber (configFile >> "CfgWeapons" >> "V_PlateCarrier1_rgr" >> "itemInfo" >> "HitpointsProtectionInfo" >> "Chest"))
This is not working, so I have some error somwhere
Yeah, ATM I am just looking to extract 1 number
You need >> "Armor" on the end there.
Yeah that
if you want to collect all hitpoints from a vest or similar you'll want something like:
untested:
_configs = "true" configClasses (configFile >> "CfgWeapons" >> "myVestClass" >> "ItemInfo" >> "HitpointsProtectionInfo");
typical range for the chest armour value is 8-28 for armoured vests.
Carrier GL has 78 but high passthrough, so that's gonna look weird.
I'm not 100% sure what it actually does :P
You can check Arsenal function if you want to check how it behaves in Arsenal stat bar
Got it, basically see what the difference is on high and low passthrough
Thank you guys! I really appreciate the help!
how do I check if the vehicle is an air vehicle?
i think it was
_vehicle isKindOf "Air"
``` to make sure check the config parents
vehicleClass = "Air";
works thanks
_abc = ["_array1",1,2,3];
//stuff
_varNameToCreate = _abc select 0;
//whatgoeshere
//Result
_array1 set [count _array1,(_abc select 1)];```
is this possible
want to dynamically create an array based on a string name
yes, if you use call compile
but⦠it seems wrong
so don't π
what ails you here?
That i need to generate a var based on a stringname
I mean i can do setvariable but i dont quite know if thats the best solution
Often the better option these days is hashmaps.
but things like missionnamespace getVariable ("myarray_" + str _n) are also possible.
yeah im on a2
thats what i was looking for
appreciate it
the set/getvar was my initial thought too but wasnt quite sure
but ill use that
The slightly hacky logic-object "namespaces" that people used before hashmaps probably work in A2 as well.
If you don't want to dump too many arbitrary variable names into global namespace.
what do I use if I want to check if a button is pressed in an If statement?
What, like a UI button?
keyboard, mouse or anything
i want to modify this script from killzone kid so that I can exit the camera with a button press
_null = _this spawn {
_missile = _this select 6;
_cam = "camera" camCreate (position player);
_cam cameraEffect ["External", "Back"];
waitUntil {
if (isNull _missile) exitWith {true};
_cam camSetTarget _missile;
_cam camSetRelPos [0,-3,0];
_cam camCommit 0;
};
sleep 0.4;
_cam cameraEffect ["Terminate", "Back"];
camDestroy _cam;
};
}];```
i'd also like to know if its possiblet o make this script not remove control of your character
inputAction would be the direct answer, but if you want to avoid polling every frame then displayAddEventHandler + keyDown.
Can you make a vehicle explode with a trigger?
Making a vehicle explode is just _veh setDamage 1
if you want it more realistic like getting hit with a missile you can use
BIS_fnc_EXP_camp_guidedProjectile
Hmm interesting
It bothers me a lot that that description spells it "hooming" every time
sorry if I wasn't clear, the dead unit will "drop" his weapon when it dies, thus a "Put" event handler will fire
drag and drop
also this is an #arma3_editor question. not #arma3_scripting
Sorry
Hey, does anyone know how I can find the class name of an RPG round from a mod? Something along the lines of "M_Titan_AT" but obviously thats for the titan launcher.
would be in the mod config somewhere I'd imagine
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
systemChat _ammo;
copyToClipboard _ammo;
}]
then just fire the weapon
Would I run that in debug menu?
yeah you can just slap it in there
Thank you so much!
So i did manage to come up with a system that returns consistent values
_finalArmour = (_chestArmor / _chestPenetration)
The following numbers represent the _finalArmour variable.
16 Level 1 vests.
30 Level 2 vests.
53 Level 3 vests.
100 Level 4 vests.
130 Explosive resistant vests (should be the same as lvl 3, some potential errors here).
240 Level 5 vests.
Anyway, now I am trying to figure out the armor values on uniforms
And that is a lot harder
I am looking to extract the ballistic protection for this:
"U_O_R_Gorka_01_F"
However "ItemInfo" on uniforms does not contain any "HitpointsProtectionInfo"
Anyone got any clues?
Anyone know if Ace3 website is actually down or if it's just me? I can't find anyone else anywhere confirming it's down.
(ace3mod.com)
do uniforms even provide any protection? 
afaik they don't 
@somber radish I never found it, which is strange because it's definitely a thing. I even swapped a CSAT uniform onto a blufor guy to test.
The CSAT uniforms definitely reduce damage. Not a myth :P
probably related to the unit itself
not the uniform
That's what I figured, so I swapped the units.
uniforms have a body
They do, look at it in Arsenal. CSAT uniforms shows having balistic protection
what I mean is each uniform has a body it goes with
called uniformClass
ooh
maybe that's what provides the "ballistic protection"
How would I get to this class in config?
it's a CfgVehicles class
looks like the CSAT guys all have armorStructural 4 while everyone else has 3.
No idea if that one actually does anything though.
the hit points themselves have a huge armor value too π
so yeah, that explains it
ah yeah, 6 in most places & .33 passthrough compared to 1 & 0.8 for normal people.
Could someone tell me, if via the mapping I can put an area in which the damage on buildings would be deactivated?
mapping?
You mean the editor?
I guess you could drop down a logic object and allowDamage false on all nearby buildings in the init statement.
This one to do the search:
https://community.bistudio.com/wiki/nearestTerrainObjects
If you want a non-circular area you could filter with inAreaArray and a marker.
Editor yep
Ok thank, I think this will do the job π
Hello, is there a way to make an AI Jet do a scripted move? Such as the equivalent of holding A and S as a player?
Can someone help me on converting type "string" to type "object"? Basically, I have 144 walls, and I want to unhide them all when some code executes. They are in sets of 4, of g*w#, where * is 1,2,3, or 4, and # is 1-36. I have a for loop to automate hiding the walls, but using FORMAT to combine "g1w" with the 1-36 number results in a string, and I can't find any command to convert a string into a object type?
private _gWalls = ["g1w","g2w","g3w","g4w"];
{
for [{private _i = 1}, {_i < 37}, {_i = _i + 1}] do {
private _wallName = format ["%1%2",_x,_i];
//_wallName = _wallName select [1,-1];
[_wallName,1,-1] call BIS_fnc_trimString;
//_wallName = call compile _wallName;
_wallName hideObject false;
};
} forEach _gWalls;
(spacing is weird as it's nestled into a bunch of other control structures with tabs)
I've tried select, trimString, and something I heard about call Compile being able to convert the string, but none seems to work.
Probably missing something basic here I bet
I can't find any command to convert a string into a object type?
missionNamespace getVariable _string
for [{private _i = 1}, {_i < 37}, {_i = _i + 1}]
don't use for like this
Alright, how should I use it then/what other loop should I use?
for "_i" from 1 to 36
My code is probably kinda cursed right now as I'm taking a java class and it bleeds into my sqf
Ah, so formatting like example 3 for FOR is discouraged?
for [{ _i = 0 }, { _i < 10 }, { _i = _i + 1 }] do { systemChat str _i };
you have to move the plane every frame using setVelocityTransformation
yes
it's both slow to type and execute
understood, thank you
this page is useful:
https://community.bistudio.com/wiki/Code_Optimisation#for
that's a good one, i'll give it a look and see if this can be done
hello people very good evening someone will have the script to put the ace arsenal in a box
what?
sorry it was the arsenal of the ace
It's already documented on ACE framework wiki
Just google arma 3 add ace arsenal to box
addMissionEventHandler ["Draw3D", {
drawLaser [
muzzle player vectorAdd [0,0,0]
player weaponDirection currentWeapon player,
[0, 1000, 0],
[],
0.05,
0.05,
-1,
false
];
}];
``` im getting an error at the ```sqf
player vectorAdd [0,0,0]
player weaponDirection currentWeapon player,
``` line im not very experienced with vectors this was just a one off script for a friend i think ive done something basic wrong
You forgot a comma
where?
Between vectorAdd [0,0,0] and player
thx
Using UnitPlay to have a helicopter fly in and land for the intro of a mission, but after the movement finishes, the helicopter just shoots up into the sky, I've tried turning the engine off after it finishes, setting the velocity to 0, deleting the crew, helicopter still shoots up.
// intro_flight.sqf
_movementdata = [...];
heli engineOn true;
heli allowDamage false;
_sequence = [heli, _movementdata] spawn BIS_fnc_UnitPlay;
waitUntil {scriptDone _sequence};
heli engineOn false;
heli setVelocity [0, 0, 0];
deleteVehicleCrew heli;
still doesnt work says missing ] at
player vectorAdd [0,0,0], //error
player weaponDirection currentWeapon player,
Full code please
There's no such thing as muzzle player
Ask in #arma3_config
i did something similar a bit ago is there another place i put the muzzle as it is a location on the player
like the part of their body
or am i misunderstanding this?
Record a longer move data
Or make the helicopter actually land using the "land" command
You're misunderstanding it
To get the muzzle end you need to do some vector math
There's no direct command for it
ah is there a general location similar or not?
I once posted something in this channel for someone. I'll see if I can find it
thx for your help
Hi all, been several years since I've played with ArmA and going to start messing around with creating a mod. Can someone please confirm that each client that connects should also execute server sided code? E:G: looking at Altis Life framework it has an initServer.sqf which then runs the server sided init
Also hoping someone is able to advise the best development env? Is stopping/starting a server the best way or do most people just do most on the editor?
hey guys, how do i remove players from the squad (i need a trigger that removes all the ai from my squad when i enter it)
just do [player] joinSilent grpNull
so all players will leave their squads?
this will create a new group and the player will join it, which is pretty much the same to what you wanted
hmmm okay thanks
not sure what you mean, clients don't execute server side code. initServer runs once at mission start on the server machine only
I see. So on the mission file, the initServer will only execute once (E:G: the first player to login)?
count (allPlayers select {alive _x && _x in heli_1}) isEqualTo count allPlayers
``` is this the correct way to check if all players are in the heli?
not necessarily first player, it runs on mission start, yes the first player might start the mission, but there is also persistent option in server.cfg which starts the mission regardless(on server start)
so ```sqf
call{allPlayers findIf {!(_x in heli_1)} < 0}
it does nothing
oh okay
so if i were to check if all players are in the heli and if all tasks are completed, i'd have this as a trigger condition?
allPlayers findIf {!(_x in heli_1)} < 0 && tskall == 1;
looks ok yeah
ok thanks
apart from tskall == 1, are you just setting the value to 0 or 1?
i have a trigger that sets tskall = 1 if all 3 tasks are completed
yeah so you should use booleans, true or false
hmm okay
at which point you can remove the == 1
and just use tskall?
yes
and it will fire if tskall == true?
yes, but no need to do that(the comparison)
interesting, i'll take a look into it
this would be best way: tskall && { ... findIf ...} as your condition
so for tasks instead of tsk1 = 1; i use tsk1 = True;?
this uses short circuiting, if your tasks havent been completed, it won't bother checking for players, thus better performance
yes
okay thanks
and in trigger condition that checks for all tasks and sets tskall to true, i should use tsk1 && tsk2 && tsk3?
if they're all true
yeah
okay, great, thanks
Well it's a relatively precise movement, that Arma ai just can't really recreate, and just making the unit play longer feels like a duck taped solution, is there really no other way to just make it stop after running?
wait, only one player or all players?
maybe [allPlayers] joinSilent grpNull?
no
can i make an empty squad for my players to join then?
i mean what you sent will make all players join a single group
allPlayers joinSilent grpNull should be like this
so if i do this, all players join into a new group/squad?
yes
into the same group
yes
so if my player's variable is p1 then:
group player selectLeader p1;
you have to execute it where the group is local
[group player, p1] remoteExec ["selectLeader", group player];
so my trigger on activation field will look like this?
allPlayers joinSilent grpNull; [group player, p1] remoteExec ["selectLeader", group player];
grpNul should be grpNull
also you should either add isServer check, or make trigger server only
because you will run that code on all machines otherwise
typo, sorry
i'll make it server only
cheers, thank you
but then, group player is wrong
just create the group then, and pass it to all the commands
private _group = createGroup <your side>; and use _group everywhere
<your side> is like WEST or EAST?
yes
so if i were to create a blufor team it would be private _grp1 = createGroup WEST and then use _grp1?
i changed it to _grp1 since i may add other groups
edited
do i put it in init.sqf?
no, in the trigger activation
above this code, and replace grpNull and group player with the group
private _grp1 = createGroup WEST; allPlayers joinSilent _grp1; [_grp1, p1] remoteExec ["selectLeader", _grp1];
yes
thanks
is p1 a player?
if it's not, then you have to also join it to the group before calling selectLeader
it's a player
i have 8 playable ai slots, the first one is original group leader which is always a player and therefore set to p1
so after players join new group, the leader stays the same
[]spawn {
[0,0,false] spawn BIS_fnc_cinemaBorder;
private _grp1 = createGroup WEST; allPlayers joinSilent _grp1; [_grp1, p1] remoteExec ["selectLeader", _grp1];
[
["HQ","HQ to Beta 3-4.",0],
["Pilot","Beta 3-4 to HQ.",1],
["HQ","We need a helicopter transport, on Delta 1-1's position, how copy? Over",4],
["Pilot","Affirmative, on my way now.",8]
] spawn BIS_fnc_EXP_camp_playSubtitles;
uiSleep 8;
[1,1,false] spawn BIS_fnc_cinemaBorder;
};
``` did i implement it correctly?
no that's wrong, the code has to be ran server side only
well the part you sent earlier
this
it is server side, trigger is server only
yeah but then your code makes no sense
why?
because cinemaBorder and the subtitle functions are ran locally
thus only the server would see them(if it's a dedi it won't anyway)
oooooooooooh that makes sense yeah
so i did see cinema borders because i was the server
okay, thank you
glad i asked lol
Me again -- is there a standard for database interactions? Otherwise, I think I might have to take EXTDB3 and Altis Life framework inspiration π
not really
extDB is more commonly used though
Alright... thanks sharp. We don't deserve you β€οΈ
so remoteExec?
or just make another trigger for this
better to just do if isServer then { ... server only code }; ... rest here
and make trigger global again
if isServer then { private _grp1 = createGroup WEST; allPlayers joinSilent _grp1; [_grp1, p1] remoteExec ["selectLeader", _grp1]; }; []spawn {
[0,0,false] spawn BIS_fnc_cinemaBorder;
[
["HQ","HQ to Beta 3-4.",0],
["Pilot","Beta 3-4 to HQ.",1],
["HQ","We need a helicopter transport, on Delta 1-1's position, how copy? Over",4],
["Pilot","Affirmative, on my way now.",8]
] spawn BIS_fnc_EXP_camp_playSubtitles;
uiSleep 8;
[1,1,false] spawn BIS_fnc_cinemaBorder;
};```
looks ok now
global as in not ran server only?
yes
Has anyone else confirmed that the Ace3 framework wiki is down for them as well?
question for you im having problems where the driver of a vehicle keeps getting out of the vehicle and unwanted
is there any scripts that would force him to stay in the drivers seat
?
Depends why he's leaving. With vanilla AI, a lone driver won't get out of a driver seat even if he's in combat mode, with no orders, and you literally shoot him in the face.
If he's part of a larger squad then he probably will get out. If the vehicle loses wheels or engine then he'll bail unless you set allowCrewInImmobile.
heyo, i have a question regarding stealth in arma. Could there be a possibility of creating a script that simulates stealth in Arma? For example an EH or something that checks in a trigger if a player has weapons drawn for example, if yes and opfor detects the player they switch sides from maybe civilian to bluefor or any other combination. Would this be feasible? is there something laying around maybe already? Maybe a way to simulate this easier?
he is part of a larger squad and rest of the squad has an order to get out
i would normally use transport unload
but thats not working only getout gets the other squad mates out
so to summarise he needs to stay in but his squad mates need to disembark
Is splitting the group an option? Because that's by far the easiest.
wait one ill test
@finite imp Usually it's done with setCaptive rather than group-switching. But yeah.
You will typically find that you need a lot of event handlers, plus some polling.
Would there be a point in creating a trigger that sets the unit un-captive once OPFOR spots players inside the trigger?
the simplest thing i can think of right now
didnt work for further context ive got a vehicle which is driving a taru bench pod around and the guys in the bench seats are really picky about when they get out
If you're gonna set them un-captive when spotted then I don't see the point of setting them undercover in the first place.
Generally undercover systems are to stop enemies shooting at players even when they're spotted.
Yes, correct. I was thinking more of like for example areas that are off limits or something.
yeah that's reasonable.
Or, maybe if the AI sees a player with a weapon that is not holstered or like with a weapon equipped. But I wouldnt know a way to check for that
you can check their weapon slots in an InventoryClosed EH.
The spotting part is expensive to do properly though. There are no EHs for units gaining or losing vision on a unit.
Probably best to drop all protection when a unit has a weapon drawn, or maybe use camoflage coefficients if you want more of a range.
using the create vechile command can you make a VLS cruise missile visually? ive seen people do something similat just trying to make an controllable vls missile and know what other scripts im going to use if so what is its name like in terms to make it for example I_Mortar_01_F for a mortar etc
Hey guys, could somebody point out what I've done wrong here?
__Intention : __
Players enter trigger,** screen fades to black for 7 seconds**, title shows with text, mission ends
What's currently happening :
Players enter trigger, no fade, title shows with text, mission ends
Script:
cuttext ["", "BLACK OUT", 7];
sleep 5;
titleText ["<t color='#ffffff' size='1'>7 TROOP, 22 SAS - UKSF REALISM UNIT<br/>____________________</t><br/><t color='#ffffff' size='5'>OPERATION BOREAS</t>", "BLACK FADED", -1, true, true];
sleep 10;
'end1' call bis_fnc_endMission;
[0, "BLACK", 7, 1] spawn BIS_fnc_fadeEffect;
sleep 5;
titleText ["<t color='#ffffff' size='1'>7 TROOP, 22 SAS - UKSF REALISM UNIT<br/>____________________</t><br/><t color='#ffffff' size='5'>OPERATION BOREAS</t>", "BLACK FADED", -1, true, true];
sleep 10;
'end1' call bis_fnc_endMission;
try that
What's the easiest way, to concatenate an array, into a string, while changing the connectors? Let's say I've got
_terms = ["bla","blo"];
_result = _search apply {format ["This is %1",_x]}; //["This is bla","This is blo"]
And I want the result to be "This is bla && This is blo"?
Update: For some reason, during my initial search, I didn't notice https://community.bistudio.com/wiki/joinString. I guess that solves it.
I showed you 2 solutions. Longer flight was one. The other was making them actually land
There are more. You can just disableAI the pilot completely
yes, its an ammo classname defined in CfgAmmo
thx will look there im just a dumbass and looked in cfg weapons
if you know the magazine's classname, in it's class there is ammo property, which points to a CfgAmmo class
when you say cfg ammo do you mean magazines or is there a subcategory somerwhere im missing? im looking in https://community.bistudio.com/wiki/Arma_3:_CfgMagazines
configfile>>cfgammo
use the ingame config viewer
you can also just do:
vehicle player addEventHandler ["Fired", {copyToClipboard configName configOf (_this select 6)}]
and it will copy the classname for you after you shoot the weapon
thx
I've got an array of units, and I wanna find the first of a given class in that array, but I can't for the life of me find the command to compare a unit's classname with a string.
I swear I used to know how to do this, but I can't find the exact command I need and I'm going insane.
Edit: Yup, I was going insane, it's typeOf, which I swear I scanned the list of commands and didn't see.
doesnt work with the vls as you have to remote control it
k thx
can anyone help me with the set object to scale script im abit new to arma scripting within eden and i honestly dont know where to start
ok so you first need to either attach the object or disable sim or maybe make it a simple object then just use the basic syntax anything with a decimal in it is smaller you cant go into negatives (as that would reverse an object that just wouldnt work) it is pretty basic if you have other details lmk
btw to anyone seeing now im helping via dms
can someone correct me a list of assets for warlords? I don't know why but it doesn't work
is there a way to disable the ability of setVariable to broadcast a variable globally or at least to the server? i'm storing data on my server that i wouldn't want tampered with by a malicious actor.
store in a non-networked namespace
profileNamespace, or uiNamespace, or... there are others forgot the names, the new stuff
People cannot pubVar to a namespace thats not network synced
ah okay, thanks
Is it possible to figure out if a object is local to the client? Not if the current client is the owner (I guess he still would be though...).
But if the object is only spawned locally for that player, like fish, snakes, rabbits that spawn randomly (agents).
I don't think so, maybe worth a ticket?
They seem to have a owner of 0, while player is 2 (local MP session). But that won't work in SP I believe.
Also netId returns nothing... I guess I'll create a ticket.
Well, it doesn't really matter if it doesn't work in SP, because in SP everything is only local to the current client :P
True.... And what I'm doing won't be used in SP anyway...
But it doesn't feel clean to do it like that.
Oh, their netId is "0:0". That might be more reliable.
what do i have to write into the init line of a group to affect all members? 'this' doesn't seem to work
trying to make all members 'doStop' btw
{ <code> } forEach (units this), with the magic variable _x representing the current unit the forEach is working on
beware of locality when using init fields as they are executed on all clients
so "doStop forEach" and then? (I'm really bad at scripting
units this didn't work
oh, I got it to work. I wrote "doStop (units this);"
Interesting, I didn't realise doStop also accepted arrays.
For future reference as it's a useful command:
https://community.bistudio.com/wiki/forEach
oh wow it does
thanks!
{
doStop _x
} forEach units _group;
//or
units _group apply {
doStop _x
};
but if I recall correctly, doing doStop on a group without filtering out the leader can cause some wonky behavior
doStop can break a few things. Be careful with it.
I remember it one time making all units belong to a 'object' side. ai ceased to function and its side was unknown
I'm keeping an eye on it. Currently only using it on machine gunners in a bunker
doStop can make units appear to be "empty" in Zeus but they do behave normally (aside from being stopped)
how can I stop the AI from abandoning good static weapons mid combat to wander around? setUnloadInCombat doesn't do the job
Try locking them
A vehicle being locked is supposed to remove the option to dismount as well as the option to mount. It's possible the AI will be able to ignore it because Arma, but it's worth trying
nope they still unload
@abstract girder localNamespace is probably the one Dedmen was trying to remember :P
Do you happen to use any mods? π
Hey guys. I'm working on a blackhawk down type mission.
Starts at the airbase with AI squads set to hold for the briefing. They all mount up on radio alpha. It looks cool. Then radio bravo is take off. Check they fly in. I set altitude to 25meters check. They arrive at their fast rope positions then just site there... anyone have any ideas how to get the advanced rappel to work?
so im making little guerilla type units that have a light and fast vehicle a bike and a passenger, what i want them to do is drive circles around the enemy and the passenger shoots them a harrasment hit and run style sort of thing
what would be the best way to achieve this?
You might be overestimating how much fine control you can have over Arma AI. This sort of behaviour could be possible, but it might need some in-depth work from #arma3_ai, and of course you will also need a bike that actually has an FFV passenger seat (most don't).
_unit disableAI "PATH"
they shouldn't move out of the gun now
Can someone help me whitelist a function?
I am getting this when trying to use a third party mod to spawn in zombies.
0:23:58 Scripting function 'rvg_fnc_zed_spawn' is not allowed to be remotely executed
#arma3_config, also see the wiki for Functions and CfgRemoteExec (iirc)
^ what he said
https://community.bistudio.com/wiki/Arma_3:_CfgRemoteExec
Is it possible to get the position of the cockpit of any vehicle?
By cockpit I mean for example HEMET driving cockpit
Not like the position where the driver sets
But the environment used for rendering the cockpit in 1st person
With all the details of the steering wheel and speedometer eyc
Might not be exactly what you're looking for, but you could probably use https://community.bistudio.com/wiki/selectionNames
And possibly use some of the linked commands
Never had to deal with that myself, but I would assume something could be achieved with https://community.bistudio.com/wiki/disableAI ?
Are there commands to output certain parts of AI behaviour and thinking?
Ex. Seeing what position an AI wants to move to when in Combat mode, or the created orders during a Seek and Destroy waypoint
Really interested in wanting to see how the AI works on a deeper level, especially since it managed to outmaneuver me
use PathCalculated event handler to see the path
use expectedDestination to see where they want to go
Thank you!
Does PathCalculated work live, or does it only work for fake/commanded calculatePath calls?
live
Cool!
Yeah I suppose any resources into learning how the vanilla AI works / calculates situations / commands would help my curiosity a lot.
Anyone know of a script that would add an item added to a container inventory to an ACE arsenal on the same object?
They meant only local π
(not network object)
Like createVehicleLocal
like at school, read the full question before answering π
:poutcat:
It feels I'm watching me
I use netId: https://community.bistudio.com/wiki/netId
Local only objects have a id of "0:0"
Yea I figured that out as well after some more testing. Seems to work for what I need. Just wondering if createVehicleLocal objects are also included in that though.
I can't remember, but i believe yes, since they are no-network objects also.
Yeah that's what I'm thinking as well, just didn't test it.
is it possible to place objects inside vehicle cockpits without them being outside it when you are sitting in the vehicle?
You can simply use attachTo for this, can you not?
let me add photos to clarify
so here I placed a jerry can for example inside the taru pod, it is attached to the object
from outside it looks normal, inside the pod (i made it float for presentation)
BUT when I take a seat in the taru, the jerry can is rendered enlarged + outside the cockpit
how can I make it render in the same proportions (as outside the cockpit) inside the cockpit ?
same thing with the HEMTT https://imgur.com/a/N0cBt2v
I understand that this happens because the cockpit of vehicles are rendered separately in another location and overlayed on current view, but is it possible to get the position of where the cockpit is rendered? so I can place the object in that position and have it appear normally in the cockpit?
No, you can't. Vehicle cargo geometry will always be in front of outside geometry. afaik there isn't a trick around that.
aren't vehicle cargo geometry rendered somewhere along [0,0,0]?
so if I'm able to grab the vehicle cargo geometry location and put an object in the position wouldn't it render inside the cockpit?
no
and no
if that is how RV did cargo geometry everything would be PIP. Imagine the performance....
i was wondering if anyone could help me get my custom flag working online. I am using this setflagtexture "flag.jpg"; it works fine in the editor, but online I see the flag for a few seconds and it disappears.
try
if (isServer) then {
this setFlagTexture "flag.jpg";
};
global*?
you saw nothing π
god damnit lou i was writing a novel here
huehuehue
I don't know why, but I was persuaded there was something like setFlagTextureGlobal
I may have mistaken it with forceFlagTexture in some (weird) way
Going to try it right now, yeah ive tried a few things and its really weird because I see it then it just goes away like only the flag pole
thought so too first
thats because the init field is executed for every joining player, not sure why its empty afterwards though
uuh okay maybe
if (local this) then {this setFlagTexture "flag.jpg";};
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
if (isServer) then {
this setFlagTexture "\A3\Data_F\Flags\flag_green_CO.paa";
};```
i tried that to make sure it wasnt my flag that was the problem and it was still empty going to try that other command now
```sqf <line return>
Ya that code didn't make it show up on the server it worked on the editor though, by the way this is on a dedicated server if that matters.
yeah, does LAMBS cause any weird behaviour? they also sometimes shot into nowhere
well, it's an AI mod
we cannot help with mods
rather, mods make it difficult to know where the issue is, etc
this setflagtexture "flag.jpg";
that works in the editor, and on multiplayer for a brief moment then the flag dissapears complety. I tried ```sqf
if (local this) then {this setFlagTexture "flag.jpg";};
oh, try getMissionPath perhaps?
how do I do that I am a noob lol
hmm i just noticed something
running the mission from arma it works fine but the problem only happens on my dedicated serve
so annoying
i see it for a few seconds on the multiplayer server and it vanishes on the dedicated server
I'm trying to execute an SQF whenever I place a module in the terrain from my custom addon. This is my first few lines for init:
params ["_logic"];
_marker = createMarker ["mymarker", getposatl "_logic"];
null = ["mymarker"] execVM "\MyTestMod\scripts\create_entity.sqf";
sleep 3;
deleteMarker "mymarker";
When I try to execute the module in Zeus menu, I do not receive an error. However, upon closer analysis in the error and remote files, I get this error:
Bad conversion: array and more detailed as:
Error in expression <rker = createMarker ["mymarker", getposatl _logic];
null = ["mymarker>
Error position: <getposatl _logic];
null = ["mymarker>
Error getposatl: Type Array, expected Object
Error in expression <\MyTestMod\scripts\create_entity.sqf";
sleep 1;
deleteMarker "mymarker">
Error position: <sleep 1;
deleteMarker "mymarker">
Error Suspending not allowed in this context
Error in expression <_marker = createMarker ["mymarker", getposa>
Error position: <createMarker ["mymarker", getposa>
Error 0 elements provided, 3 expected
Info: Zeus interface queued deletion of Alpha 3-1 group with 0 units inside.
Info: Zeus interface deleted Alpha 3-1 group.
TL;DR - When executing this command _marker = createMarker ["mymarker", getposatl "_logic"]; , I get two erros,
One - Error getposatl: Type Array, expected Object
Two - Error position: <createMarker ["mymarker", getposa> and Error 0 elements provided, 3 expected
null =
don't do that, thats nonsense
getposatl "_logic" GetPosATL doesn't take a string, it takes an object
getPosATL _logic
but I don't see any need to do this, as wiki says you can just pass object as
createMarker ["mymarker", _logic];
I apologize, I was trying with the quotes on to see if that works. I initially had _marker = createMarker ["mymarker", getposatl _logic];
The entity spawns as per line 3. but it spawns at [0,0,0] instead of the position from getposatl _logic
would this create the marker in the set position of the logical entity without needed the getPosATL?
yes
Ah cool thanks!
Does anyone know a way to remove built in actions?
The action in question is the "Treat X" action when wounded.
I'm unable to find a reliable method for this.
no can do without mods
try using a normal soldier without First Aid Kit
How do you mean?
It has to work with all player inventories.
My current workaround is returning any FAK used and reverting the wounds to before the healing.
I tried also overwriting the healing animation but that lead to all actions for everything disappearing permanently afterwards.
then mods
Damn it.
Well that's out of the question.
If a script is server side and uses CBA functions do all connecting players need CBA too?
It depends. If the CBA functions are only executed on the server, then no, only the server needs CBA. If the script runs server-side but involves remoteExec'ing CBA functions to the clients, then the clients will need CBA.
*provided the CBA functions don't themselves remoteExec other CBA functions on the clients - hopefully the CBA documentation, or inspecting the functions in Function Viewer, can answer that
With reference to this, my script works without any visible errors in the RPT files, however, the entity seems to be still stuck at [0,0,0] instead of the position "mymarker" and idk where it is broken. Is there a method on running stack trace to see how the executions are being made when placing the module for debugging?
You can use diag_log to write arbitrary things to the RPT
or systemChat if you want to do it live
Guys tell me how to make sure that after recording with the help of unit capture, the bot does not shoot directly, because during the recording I shot in different directions in the ver, down the building. And after I activate the recording, the bot repeats all the movements except shooting at the top and down purely straight.
I'm already tormented with this question.
did you forget this
the firing capture I believe does not take in consideration the turret aiming - this function does not copy 1:1 all the captured behaviour
and please, don't crosspost
I deleted in #general_chat_arma
And there is such a script ready to be tested.
params ["_logic"];
_marker = createMarker ["mymarker", _logic];
``` I'm trying to create a incrementing marker variable (for example, mymarker_1, mymarker_2, etc) that is created whenever the module above is executed. There are no examples for the ``BIS_fnc_counter`` in the wiki that I can refer. Ideally I want the markername take unique values and globally available for other scripts to execute.
A rough version of what I've come down with is:
```sqf
params ["_logic"];
my_markerNumber = 1;
final_marker = "mymarker" + my_markerNumber;
_marker = createMarker [final_marker, _logic];
[final_marker] execVM "\MyTestMod\scripts\create_entity.sqf";
my_markerNumber = my_markerNumber + 1;
I fear I'm doing something wrong here but don't know what exactly it is.
if (isNil "PEPE_markerIndex") then { PEPE_markerIndex = 0 };
private _markerName = format ["theMarkerName_%1", PEPE_markerIndex];
PEPE_markerIndex = PEPE_markerIndex + 1;
```etc π
otherwise you always reset it to 1
unit capture is not supported for ground units if that is what you are doing
there is a modified unit capture script that someone made, but it still isn't going to give you what you want
I see, it's sad thanks for informing me
https://community.bistudio.com/wiki/BIS_fnc_replaceWithSimpleObject
Use with caution as this technique is not very clean - it should not be used for many objects and definitely not in MP games.
//initServer.sqf
private _simples = [] spawn {
{
[_x] call BIS_fnc_replaceWithSimpleObject
} forEach ((getMissionLayerEntities "Simple Objects") select 0);
};
waitUntil {scriptDone _simples};
sleep 10;
[intro_heli] spawn art_fnc_opening_server;
``` I have this in initServer.sqf, but I don't quite understand why I should *definitely not* use in MP. I understand that deleting and replacing a bunch of objects can saturate the network, but what is the detriment if I give the server time to do it before anything else (and before players have loaded in)? Does the function behave differently in MP?
would issues be mitigated if I spawn the function instead?
and last question, is there a better workflow for placing simple objects using eden editor that don't have a Simple Object checkbox in the properties?
My script/module works fine in the initial stage. However, after sometime, if I invoke the script/module again, it throws the BIS_functions_mainscope error. Googling the issue had a fix for manually setting creator logic and side or use CBA (which I already do).
Edit: No matter what module/script I use, I see this error.
https://youtu.be/BuUWw_Jm8Lo?t=482 Guys, how to do it like in the video, animation is played and shooting from weapons is there a script or does anyone know how to do it?
Is there a way to prevent this 'see through wall' and shot cheating?
https://youtu.be/9SJFqWCAAAs
depends where the model actually is. you could probably do a check for the corners of the bounding box and see if it intersects with a building.
but imo, I'd just hit him with lightning
and call it a day
haha... but I can't watch players all day to punish them with lightning. give me any more detail, plz. @fair drum
i'd just hit em with the ban
Can anyone help me with this problem. I have a custom flag using ```sqf
this setFlagTexture
https://community.bistudio.com/wiki/setFlagTexture
The command will get run on every client on dedicated server, so the problem may lie with the texture you're setting and it not being available on the client?
Does the same happen when you use a base game flag?
afaik you'd get a big pop-up on that client > saying it wasn't found.
That is true
I never had any errors pop up on the screen, I tried it with the base arma flag and it did the same thing it shows the flag and then dissapears. Its werid because it works fine if i host it thru arma thru the .pbo but on a dedi it seems to have issues. Solution I was not running the mission through the .pbo but through the folder and that was causing some bugs. Problem fixed appreciate the help π
Any server side mods/scripts not on your client?
I dont think so, its just a mission i made in editor no addons or anything
This behavior occurs (3 seconds show then disappear) when the code is executed by remote for a command that has to be applied locally.
Then the flag pole is local to the server, gotta execute the command on there.
How can I fix that im new to arma misssions and scripting. I have that code in the init on the flag in the mission
in the mission file its in the flag pole init in the editor.
if (isServer) then {
this setFlagTexture "PATH";
};
if isServer then {
setflagTexture
}
you were quick
is there anything else affecting that object?
someone reccomended that last night, and I tried it, but that made the flag not spawn at all. Let me try it again. I put this in the flag pole init in mission correct?
Yes, the flag is in the mission folder right?
yes in the root folder called flag.jpg
flag extension requires .paa according to wiki.
Although if it shows it , I doubt thats a problem.
ya it shows
Might be on the server. Try to convert to paa to be sure.
if it can accept paa, use paa.
i used a different .paa also
and it showed and did the same thing
thats the flag on local server
let me try that code and put it on my dedi real quick
are you sure there isn't a mod interfering
oh
Uhm, is this a capture the flag mission or something?
and i also wanted to say
Looking at the score board
when i go to the screen to choose a character
and spawn in i can see the flag and it goes away
and im using these mods actually
its a TDM mission, but i was just trying to learn custom flags cause i thought it was neat.
okay i got ```sqf
if (isServer) then {
this setFlagTexture "flag.jpg";
};
okay with that flag poles are empty, doesn't even show the flag at the start im going to try a default flag
going to use this texture too see if its a texture problem "\A3\Data_F\Flags\flag_green_CO.paa"
To save yourself some issues, enable the debugconsole for admins in de description.ext and give the flag poles a variable name. Then you can test without having to reload the mission everytime.
if (isServer) then {
this setFlagTexture "\A3\Data_F\Flags\flag_green_CO.paa";
};
okay
wow that works perfect
i see the green flag and its not dissapearing so i guess its a problem with the flag.jpg?
convert it to .paa to play safe.
so my problem with is, it says flags are suppose to be 200x200 and i cant covert that resolution to a .paa
does anyone have a flag.paa i could use and test it?
yeah sure. give a sec
awesome thank you
DIRECT DOWNLOAD LINK: https://github.com/Walthzer/WFAR/raw/main/addons/flags/data/WfarBlack.paa
Sorry for that but thats easier then trying to explain github rn.
Seeing as it relies on the vault key and I assume this is multiplayer, simple disableUserInput while someone vault and use hideObject to hide all other enemy players aswell? not clean, but its all client side so no real performance loss.
use a https://community.bistudio.com/wiki/addUserActionEventHandler with "GetOver" to detect someone vaulting, works even if someone rebinds their keys then.
@steel fox i just tried that flag, and same result no flag just the poles
Then you have a mod or mission conflict, maybe even some server side script.
Make a clean mission, just you and a flag pole and try that.
okay ill try that
And how are you putting the flag into the mission folder? Are you putting a PBO on the server?
@steel fox i just put the .paa in the root of the mission folder
Alright and how is that mission going to the dedicated server?
going to test a fresh mission making it right now on the dedi no mods
oh
So i make the mission in the editor and it saves to my documents folder as the mission folder and i copied that mission folder to my dedicated not the pbo
the folder and mission name look like 'DonJulio_Kavala_CQC_V1%2e7.Altis"
Export to multiplayer and use the PBO. It gets exported to your arma 3 install folder > MPMissions
also just made a fresh mission on the dedicated and same problem Solution I was not running the mission through the .pbo but through the folder and that was causing some bugs. Problem fixed appreciate the help π
can a dedicated server run the mission from just the .pbo
Let's move this to DM
its just pretty heavy. that function moves through 2 other heavy functions to finish, things like making sure turrets are in the correct position, and offsets etc. multiply that by thousands of objects and it gets pretty heavy. I would just create your own simple objects script that is just the basics.
Thanks, good idea
just gather position and direction and model and you're good.
I think I have that already done for another mission now that I think of it
what's the command to get the center of an object again?
modelToWorldWorld right?
private _obj = _this;
private _path = (getModelInfo _obj) # 1;
private _vector = [vectorDir _obj, vectorUp _obj];
_simpleObject = createSimpleObject [_path, getPosWorld _obj];
_simpleObject setVectorDirAndUp _vector;
isn't this all I need if it's just static objects?
I typically use getDir and BIS_fnc_getPitchBank and BIS_fnc_setPitchBank
but you are also gonna want to delete your first object too after you make the simpel one
lmao good call forgot that part
Question I am using this in my initplayerlocal.sqf ```sqf
player addEventHandler ["Respawn",{
params ["_newObject","_oldObject"];
deleteVehicle _oldObject;
_newUnit = _this select 0; // Get the respawned unit
private _spawn_pos = selectRandom["random_start_1", "random_start_2", "random_start_3", "random_start_4", "random_start_6", "random_start_7", "random_start_8", "random_start_9", "random_start_10", "random_start_11", "random_start_12", "random_start_13", "random_start_14", "random_start_15"]; // Get a respawn position at random
_newUnit setPos (getMarkerPos _spawn_pos); // "Teleport" the unit
}];
it is working fine, but how can I make it so the the independent team has different spawns. I triedsqf
if (side player == guerrila) then {
