#arma3_scripting
1 messages Β· Page 673 of 1
something more like this?
//Run whole file on every machine's init
tag_engineCycle_heli = {
params ["_vehicle"];
if (!canSuspend) exitWith {_this spawn tag_engineCycle_heli};
_vehicle setVariable ["turbineSoundPlaying", true];
_vehicle engineOn false;
playSound3D [getMissionPath "turbineSound.ogg", _vehicle, false, [0,0,0], 5, 1, 300, 0];
sleep 5; //However long the turbine sound is when you want rotors to spin (probably best to overlap them with vanilla)
_vehicle engineOn true;
_vehicle setVariable ["turbineSoundPlaying", false];
};
vehicleNameHere addEventHandler [
"Engine",
{
params ["_vehicle", "_engineState"];
private _evaluate = {
!(_vehicle getVariable ["turbineSoundPlaying", false]) && !(_engineState) && (speed _vehicle < 5)
};
if (_evaluate) then {
[_vehicle] remoteExec ["tag_engineCycle_heli", _vehicle];
};
}
];
Would someone be able to help me with using the "disableUAVConnectability" command? I've been able to get this working if I assign a variable name to an Eden placed object. But I would like this to apply to all "B_UGV_02_Demining_F" objects that are spawned after the mission starts. While still allowing other defined players access to them.
would i have to declare each vehicle that the script works on or does it affect every vehicle globally?
yeah. you could do a forEach for them if you wanted
Okay okay, so the code above doesnβt βwork globallyβ so to speak? π
global and local is where things are fired, not on what they are fired on. client/server/owner etc
if you want it to apply to every vehicle of a class, look at the function i posted above for fearmonger
I getchu now, Iβll have a go when Iβm back inside π
@fair drum if i wanted certain vehicles to have a different sound and startup time then i guess i'd have to add a single classname to multiple iterations of your code?
You just change what you want to change, or copy pasta and change and have multiple. This was just the basic idea you'll have to modify it to suit your needs.
okay excellent, thanks for your time and help! π
if (isServer) then {
_playerList = if (isMultiplayer) then { playableUnits; } else { switchableUnits; }; // For testing in editor mostly
_randomPlayer = _playerList call BIS_fnc_selectRandom;
[[_randomPlayer], "btk_fnc_MPexecVMLocal"] call BIS_fnc_mp;
};
i found this script online, can i use _randomPlayer as my target and then execVM "script.sqf";?
yes�
thanks
oh epic
do I have to include if (isServer) then {
in the script or can I just use _randomplayer = selectRandom _playerlist;
and call that in a sqf?
its best to leave the isserver stuff in there
if (isServer) then {
_playerList = if (isMultiplayer) then { playableUnits; } else { switchableUnits; }; // For testing in editor mostly
_randomPlayer = _playerList call BIS_fnc_selectRandom;
[[ _randomplayer = selectRandom _playerlist;
So like this?
wait
if (isServer) then {
_playerList = if (isMultiplayer) then { playableUnits; } else { switchableUnits; };
_randomplayer = selectRandom _playerlist;
@finite sail
yep
tysm
No
where's the timer?!
Also _evaluate = {} is a code. it's not a condition (bool)
also it never "_evaluates" (it does but wrongly)
@finite sail ok so now I have playable units and also _randomPlayer.. How do I exclude the randomPlayer. Is there something thats like allPlayableUnits - _randomPlayer?
yes.. allplayableunits - [_randomplayer]
gotcha
also @finite sail if I want all the characters to have a random spawn should I use empty markers on each position and then use an array and also the getrandom command?
nevermind on the last one, apparently you can set a random start in the 3den editor. My next question in this case would be, is there a way to have all my units use all the available spawns, or would I have to have separate random spawns for each player in order to prevent them from spawning potentially on top of each other...
well hmmmm that wouldnt work either. It needs to be called with roundStart.sqf so I would need to use setPos
was trying to keep my if statements clean. I saw in other languages some people take large and/or/etc statements and store them, then just have a single variable for the result for the if line to keep things clean. probably did it wrong then. I should have used ().
Thank you for the suggestion, but I'm not seeing how to do this. I'm not good a scripting at all, if you could give me a little more direction that would be great.
look specifically at the "init" handler. it allows you to place code for the init of any vehicle of that class. like calling an editors init box if you will.
_pos = [allplayableunits - [_randomplayer] , 1, 150, 3, 0, 20, 0] call BIS_fnc_findSafePos;
setPos [allplayableunits - [_randomplayer] = _pos;
what i have atm
Ok, I've come up with this, but it doesn't work. Am I going down the wrong path?
["B_UGV_02_Demining_F", "init", unit setVehicleVarName "drone"] call CBA_fnc_addClassEventHandler;
You want your disable uav code in that slot so it can run on every vehicle that spawns. Plus, if you named everything drone, you'd overwrite your previous drones name.
So take out the unit setvehiclevarname line and replace it with the disable uav code you wrote earlier (which you never posted. I'm assuming you had something)
By setting the variable name of the "B_UGV_02_Demining_F" to Drone. Then running
player disableUAVConnectability [drone, true];
that would keep the player from having access to that UAV. But if another "B_UGV_02_Demining_F" is spawned, the player has access to it.
is this single player or multiplayer
Right now it's in single player, but will be moved to a dedi.
k standby
Thank you very much for all your help!!
[
"B_UGV_02_Demining_F",
"init",
{
params ["_entity"];
{
if (local _entity) then {
_x disableUAVConnectability [_entity, true];
};
} forEach allPlayers;
},
true,
[],
true
] call CBA_fnc_addClassEventHandler;
should mention that all machines need CBA loaded
Understood, thank you. I'll let you know how it works out.
rookie scripter here: how would i get a while-do loop to run in a scheduled environment? i know of no other solution besides just
[] spawn { while {true} do {
Need help with a small script
Why doesnt this work?
this addAction ["Teleport", {player setPos (10067,2680,0)}]
To add a teleport option to an object?
player setPos [10067, 2680, 0]
needs to be an array
So how would I put that into the command?
your error is that you used (), you want []
that's typically what you do if you started in unscheduled
post it
@fair drum do you know anything about multiplayer scripting?
yes whats up
yeah post the full thing
sleep 1;
[manteam, 1] setWaypointPosition [position alphasergeant, 0];
};```
ope should be 1 instead of 0 but that's not where the error is being spit out at
wait no its fine, the numbers are what they should be
is alpha sergeant manteams leader?
yes it is
k
[manteam] spawn {
params ["_group"];
while {true} do {
sleep 1;
[_group, 1] setWaypointPosition [position leader _group, 1];
};
};
let me type up explaination
thanks
How do I add hideobject to the object that has the command I asked about?
[1, 2, 3] spawn {
params ["_apple", "_pear", "_cherry"];
_apple; //returns 1
_pear; //returns 2
_cherry; //returns 3
};
//same thing as
[1, 2, 3] spawn {
_apple = this select 0;
_pear = this select 1;
_cherry = this select 2;
};
multiplayer or singleplayer
So in this case we have a box we want to put into an unopenable door to make it "openable"
in this case you tp and go to a bunker
The rest we got - just the teleport
I see, so you want the door to "disappear" when activated simulating that its open?
No, we want the door to be interactable when it isnt - so we add an invisible box to add the teleport
ohhh okay
@fair drum hey sorry was gone for a minute. So I've gotten into a rut with scripting atm. I want to have a round system, and several things I want the game to do at the start of the round.
- I want the game to select a random player and assign them a variable name.
- I want the varName guy to have several different predertimened random spawns, and everyone else gets spawned randomly across the map.
- Play an animation and intro screen into the round.
And then when the round ends it has to reset. I would be able to do if it was only 1 round, but since its multiple, my brain doesn't know where to start. However, I already have a script for the get random player and assign them a variable name, and the random spawns. I just don't know how to do it, could you look at/ give me advice on it
//Everything in the init box of that "invisible box"
if (isServer) then {
this hideObjectGlobal true;
};
this addAction [
"Teleport",
{
player setPos [10067, 2680, 0];
},
nil,
1.5,
true,
true,
"",
"true",
5, //DISTANCE FROM THE OBJECT YOU WANT
false,
"",
""
];
so which step are you stuck at then? the resetting of everything back to original start?
if (isServer) then {
_playerList = if (isMultiplayer) then { playableUnits; } else { switchableUnits; };
_randomplayer = selectRandom _playerlist;
allplayableunits - [_randomplayer]
_pos = [allplayableunits - [_randomplayer] , 1, 200, 1, 0, 20, 0] call BIS_fnc_findSafePos;
setPos [allplayableunits - [_randomplayer] = _pos;
right now im pretty sure this will move all the units outside random into the same spot :/ can I do forEach?
im not exactly sure right now give me a movment
your last two lines on that don't make sense
Yea that is true. I don't know how to get a different random spawn for everyone, and also the level and objects in the level need to somehow reset. Like I have objects that have addactions that need to be restored at the beginning of each round as well
alright let me think
so you want to create a function that does the randomRespawn and randomPlayer selection in one. for the reset you are going to need a function that moves all alive units back to start, deletes dead bodies, and resets your mp objectives then
so this is what i would do...
oof ill try to do that, is it possible to restore the addactions on objects. In the init I have the addAction and to call a script
that init is run every time the vehicle spawns, so force kill it, and force respawn it
how would i do that?
what kinds of actions are you adding
It says "invalid number" when pasted
/* Me tring to think
Round start Function.
1. Delete dead bodies
2 Spawn players and generators in. give generators addAction to sqf and teleport them randomly accross map
3. assign a random player _randomplayer
4. teleport the player randomplay accross the area (Different if they are _randomplayer or not)
5. play intro text and whether they are _randomplayer or not and an intro animation */ ```
`Round start Function.
- Delete dead bodies
2 Spawn players and generators in. give generators addAction to sqf and teleport them randomly accross map - assign a random player _randomplayer
- teleport the player randomplay accross the area (Different if they are _randomplayer or not)
- play intro text and whether they are _randomplayer or not and an intro animation `
works fine for me. what line is the error?... also take out the comment starting with //
ok Im pretty sure thats all I want done in the roundStart function
gotcha. i already have most of that done here... one sec
oh and delete generators as well
@fair drum does it need to be a fnc or can it be a script? im not sure what the differene is
difference
rough draft
HOLY CRAPPP
and you'd just call the round end function on the server
I thought you were doing the set Random pos
Holy crap thank yo use much
what does VIP and ETC mean
can I dm you
made an edit. vip is just what i gave the "random person" thing. ETC means etcetera
sure
ah
pretty simple thing
what do i write in the condition of a trigger if i want it to complete only when it and another trigger's conditions are met?
i've tried giving the other trigger a variable name and just writing this, one
doesn't seem to be working though
is the proper format a + or something?
thank you!
@fair drum been fiddling around with it and i keep on getting an error message
Error Missing;```
there is what ive gone and named my trigger
this is just in the condition box of a trigger right?
yes

felt that no joke
anyone got an example of using both param and params together? like to validate a variable brought in with params?
what's the most feature complete text editor plugin right now? i've checked out a few for vscode but they all seem outdated
@tough abyss what plugins are you looking for? I just started with vs code with plugins and it has everything Iβve needed.
anyone know what is the problem with this script?
//
[_civ1, ["Killed",
{"A Civilian has been killed!" remoteExec ['hint']; playSound "Alarm"; _numkilled=_numkilled+1; systemchat format["%1",_numkilled];}]
] remoteExec ["addEventHandler ", 0];
//
I basically want to make eventhandler but for a dedicated server.
what errors are you getting
//run this on every machine, init.sqf is fine
addMissionEventHandler [
"EntityKilled",
{
if !(isServer) exitWith {};
params ["_unit", "_killer", "_instigator", "_useEffects"];
if (side group _unit == civilian && (_unit isKindOf "CAManBase")) then {
["A civilian has been killed"] remoteExec ["hint", allPlayers];
["Alarm"] remoteExec ["playSound", allPlayers];
civiliansKilled = civiliansKilled + 1; //This better be defined as number somewhere before this add handler
[format ["%1", civiliansKilled]] remoteExec ["systemChat", allPlayers];
};
}
];
@fair drum Hey thank for the reply.
So long story short, i want player to enter a hostile area but on temperal friendly term. Therefore those "civilian" are actually opsfor but from another "imaginary" faction/clan. However, when player shot, both the opsfor and the "imaginary faction/clan will return fire. The thing is that i want a warning only on those "imaginary" faction/clan which is technically returning fire bc they see some shooting going on.
As such, i cant use your suggested script given it is based on "side group _unit == civilian"
not even gonna read that. delete it and use sqfbin.com
oh ok, with that param i assume
so if i understand correction, i will need to:
Params ["_civilianCloth","_civilianHat", etc...] ;
_civilianCloth = []//etc. being defined;
publicVariable "_civilianCloth";
publicVariable "_civilianHat";
etc...
Not sure why u you would want it private unless it is to count on server and relay result to clients? but given i want sound to be play by all player i though it should be global?
Kinda lost sorry
pretty far off. i'm gonna be headed to bed soon so I can't explain it atm. be sure to look at the picture with the orange, green, blue, and purple bars...maybe tomorrow i can explain
but first, you are missing a }; at the end of your pasted code
@digital torrent
your if isServer then { has no closing squiggly
Question regarding dairy records and use of variables.
So when defining a variable for examples
_myName = name PL;```
Then defining it in a diary record like.
```c
_myText = format [
"Hello %1"
_myName
]; ```
What exactly is %1 in terms of knowing it's the _myname text? Like is it just by order so if I have multiple variables it would be %1, %2, %3 ect?
Ah thank you.
Is there an API for mouse-actions in arma3?
as in, i want to intercept player left-mouse clicks
API? 
ah, sorry
event handlers is what you're looking for
but those dont pick up on left clicks
onKeyDown doesnt fire on mouse clicks
oh
onMouseButtonDown
π
onMouseButtonClick requires a control, no?
mouseButtonDown can be bound to display 46
right?
afaik yes
so onMouseButtonDown would be the way to go for me
i want to stop the player from firing and execute my own script instead
CBA was a no go
It correctly intercepted the mouse click
but advanced features, such as continuous press and overriding vanilla function didnt work
and because there's no CBA-portal

wut?
i jsut mean that im the rodent kind of developer
let me know if im wrong
ok, so MouseButtonDown detects the mouse-press
but it doesnt intercept the action when returning true
damn
how would i prevent the player from performing the action
of firing a weapon, for example
without adding eventhandlers that fire the weapon
is there a config method i can use to entirely wipe out the keybind for firing weapons?
for a mouse-seeker, now that's ironic
essentially, i want to handle the firing of weapons myself
(but for real though, what does it mean? ^^)
it means i nibble around and take what bits i find but never contribute to anything meaningful
wow
oh ok, thanks for the definition π don't worry, we support people that simply want to learn - sharing is another (welcome) process π
Google is your best friend, if you know how to keep him/her/it happy with proper search queries π
Same applies to Lou, just let him make a dad joke once in a while and he'll be your best friend
i have done some minor projects for private milsim units but im still too inexperienced to dare and upload any of my work online
π
you are oh so correct, you have no idea π
hi back, I'm dad!!!
MAKE THIS GUY A MODERATOR, QUICK! π

no, please dont
XD
i said im a rodent
anyway, so it is kind of offtopic, since it isnt vanilla
but i still have the issue of CBA continuous press not working with left mouse button
there is no continuous mouse eh
you can use down = hold, up = release
i figure CBA tracks this by setting up a missionEH that waits until the mouse is raised
or firesthe script until the mouse is raised
correction
it's an optional toggle here
_holdKey
for buttons
ahhh...
i wonder why they didnt do it for the mouse
π€ k
because that same function works for the mouse
but the continuous fire only works for the buttons
oh...
it's catching the BIOS level key-spam
damn
they use vanilla stuff. they don't create anything new
i was expecting something more legant
well, looks like i'll have to make my own keybinding system for the mouse buttons
the continuous button isnt even true continuous
it is just catching the BIOS key-spam
so you press it first time
there is a short pause
and then it starts to spam
is there a method for making the player aim down sights?
i know switchCamera, but that switches too fast
is the smooth method somehow available?
syntax plugins mostly, inline docs would also be nice
Is it possible to make an empty vehicle fire it's gun? I'm messing around with mortars and I want to have it fire "from outside" ie. with nobody in it after it was ranged and set up
nope
but for mortars you can just create the projectile
they have no drag
so you can just use the good ol projectile equation of motion
y = -x^2/(2v0gcos t^2) + x*tan t
I actually made a pretty simple script that generated a range card for the Mk 6 mortar, just for giggles. I can get the exact angle the tube is set at. Thing is it won't be the same without the firing effect
just put an invisible AI in it then
I was thinking about it, but there is a VERY good chance he will move the mortar around. I need to check if disabling the AI targeting or something will prevent him from doing so
Ok, so disabling AI does prevent him from moving the mortar around
yes and no
can you make it look and act as if there was no one in the gun? YES. But is the gun empty? No
How do I add a mission event handler that runs stuff on init on anything that might spawn in the mission? I know how to do that for an addon, but no idea how to do this for a single mission
See https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers - there is no EntityCreated
What do you want to do @thorn saffron?
Just wanted to see if you can add an init eventhandler similar to how you can do it via addon config. I think I saw that you can do some config tweaks/overrides in missions, but I'm most likely wrong.
ask for the next patch :3
heh,
Anyway: is it possible to check if weapon is being loaded, or has been reloaded? canFire does not work for this.
We have setWeaponReloadingTime, but no way of checking what is the current reloading time on a weapon?
I realize the really dumb solution would be to just get the reload time and set variable of time + reload, but that is inelegant
needReload?
nope
removeAllWeapons @thorn saffron
needReload now? π
I don't want to break anything. I want to keep stuff as compatible as possible, so I will just go with variable
you could check for magazine capacity vs magazine max capacity from config
and get the reloading time from weapon config yup
IDK if there is a reload EH, check the wiki perhaps
I would still have to add some variables to track it, so I will do it the easy way: time + reload time and see if the current time is more than that
Reloading = false;
findDisplay 46 displayAddEventHandler ["KeyDown", {
if (_this select 1 in actionKeys "ReloadMagazine") then {
Reloading = true;
};
}];
player addEventHandler ["Reloaded", {
params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
Reloading = false;
}];
Something like that maybe?
@thorn saffron
@final storm Thanks, but the idea is that an invisible AI is firing the weapon
ohh its for a vehicle?
yeah
oh ok
the EH would work, but I don't think its really needed
Yeah, I do want to see if it got reloaded. I need to do it as you can span force weapon fire since it does not check the reload time.
configFile >> "CfgWeapons" >> _wpn >> "magazineReloadTime"
not sure if that's what you want
but you can check when the reloading will be complete
also didn't you want an invisible AI thing? why not just reload it manually? (adding the magazine to the weapon yourself, and faking the reload time)
force weapon fire only works if AI is present
did I say otherwise?!
oh, by reload I meant reload between the bullets, not just magazine reload
reload between bullets can only be caught with a timer
there's no event handler for that
fun fact: weaponState only works after firing something once, otherwise it returns empty stuff
at least when I try to use it in addAction
ah, I see now. If the vehicle/mortar is empty then no weapos were selected and thus you can't get info unless you specify a muzzle
what is a side's equivalent of objNull/[]/""/grpNull etc?
a side should always have a value: https://community.bistudio.com/wiki/Side
just trying to figure out what to put in param to expect a side
side grpNull returns unknown so that might work?
I would probably say sideUnknown π€
hmmm yeah that might work, let me try
but I doubt it works as an expected type
How do I rescript a unit from ind>opf?
with a quick test
[independent] spawn {
sideplayertest = _this param [0, sideUnknown, [sideUnknown]];
};
sideplayertest
this returns GUER
so it works
if I understand the wiki correct you should be able to use Side as a datatype
but if the above works it's also good π
(AI)
does the interpreter recognize the case sensitive of Side vs side?
no idea, never worked with sides in that manner
private _eastGroup = createGroup east;
[_civilian] joinSilent _eastGroup;
This is probably the best method
answer, nope doesn't look like it. always reverts to the command
so this changes the units with this in the init to opfor?
possibly add a server check in there so you don't create a bunch of groups for every player that joins though
yes, although you will need to change the code to make it work (it's just an example code)
wdym?
and why would you want that anyway?
Thanks!
just use isEqualType
what would I need to edit @exotic flax
Side (datatype) vs side (command)
writable data type is not a thing in SQF, so Side, side and SIDE are the side command
param [0, sideUnknown, [sideUnknown], 1]; //works
param [0, sideUnknown, [Side], 1]; //doesn't work
we were testing to see if SIDE could be used
side is a command
plus the syntax for params requires data
not type
(type is "deduced" based on the data you provide)
expectedDataTypes (Optional): Array of direct Data Types - checks if passed value is one of listed Data Types. If not, default value is used instead. Empty array [] means every data type is accepted.
it's wrong
so fix it π
I don't have wiki access 
all I know is that
param [0, sideUnknown, [sideUnknown], 1];
works as I fed it independent and it output GUER
so there's our answer
git -blame "Dwarden"
yes because typeName sideUnknown == "SIDE" == typeName independent
you could also just use [west]
or any other side
still? heh, I thought you did
here's a summary of my conversations with Dwarden:
Dwarden:
hi, q your BIKI account isn't working yet?
Me:
Hi. No
Dwarden: disappears

Dwarden:
π₯βοΈ β¦
How do you get heading from weaponDirection? I worked out how to get the elevation, but I just cannot get the heading
what heading?
angle?
or vector?
angle
[0,0,0] getDir (unit weaponDirection "");
that's weird
when I try to login it directs me to my BI Account page (instead of that "Registration Stop" page).
but I still have no wiki access it seems 
@little raptor Oh man, thank you so much. I could not get it working otherwise
Hey guys, quick question, is uiSleep more effective in multiplayer than sleep or is there no difference?
no difference
if you are doing some sort of on screen text or something that relies on sleep and its being fired on the client, that its better to use uiSleep as sleep will continue if they are in the escape menu? or am I misssing something
no difference
isn't there one 
The difference between Sleep and uiSleep are that sleep doesn't continue while the game is paused, while uiSleep also runs while the game is paused
Pause == Esc menu in singleplayer (unless you run with -noPause)
There is no pausing in multiplayer
i see
neither of them was ever "more efficient" the only difference is that Sleep pauses when game simulation pauses
wait -noPause does not cancel SP pausing; it cancel simulation pausing if the window is not focused
Sure?
well as far as I know yes!
Pretty sure I could Esc in SP and it kept running in background while I used debug console
I always run noPause
-noPause Allow the game running even when its window does not have focus (i.e. running in the background) from wiki
NB: this also prevents singleplayer pausing if you are a BI employee oh that's why
execVm "roundInit.sqf";
does anyone know why this code isn't working?? I don't understand, the semi colon is not expected in the code, but I don't know why... any help?
something else is wrong in your script, most likely before that line
SP editor preview usually π’
How do i get check if Unit health is below .25 and then trigger a cmd?
you could do it 2 ways
- have a loop that checks the unit damage on specific intervals
or have a dammaged EH on that unit that checks if the health is below .25
It wil be connected via HandleDamage EH
or as we say in arma, damage is above .75
Its the command that checks Unit health / damage I can't find. Eg. _Unit Dmg < .25
getDammage
and getDammage _unit > 0.75
damage goes from 0 to 1
1 being dead
and yes, it IS 2 m's
also, i recommend Dammaged EH instead of HandleDamage
How come?
on another look, for your purpose handledamage might be better
especially if you want to override damage
I'm gonna play the unit an animation if Getdamge is > .75 and play sound from unit.
Thank you for the help!
be careful with the syntax
What do ya mean?
if ((getDammage _unit) > 0.75) then {
//your code here
};```
2 m's
you can setDamage
and setDammage
but apparently you have to getDammage
not getDamage

im only reading the biki, thought
feel free to correct me if im wrong
is it possible that
_crate addItemCargoGlobal ["FirstAidKit", 1000];
is not working?
where is getDamage?
it's not listed on the biki
damage is the getter
anytime I want to add FirstAidKit via addItemCargoGlobal it wont show up in the crate, but any item before and after it in the same script - even when I set the count lower (e. g. to 10)
can you send some code?
_crate addItemCargoGlobal ["Medikit", 5];
_crate addItemCargoGlobal ["FirstAidKit", 10];
_crate addItemCargoGlobal ["Toolkit", 5];
firstaidkit is not an item
im pretty sure
i think it's a magazine
I'll try it
configFile >> "CfgWeapons" >> "FirstAidKit"
it's a weapon

or not
there was some real overlap with these
some items said theyre weapons but were tools and so on
it's a helter skelter
any mods? @spiral temple
the whole addWeapon/addMagazine/addItem/addTool is weird
RHS/3CB
there's no addTool
works for me
maybe no space in the crate for the 10 FAKs
should still add
i managed to add 1 million faks after a bit of lag
setting a setVariable to public is essentially doing the same thing as publicVariable with all of its drawbacks right?
yes, but which drawbacks?
like sending lots of publicVariables clogs the network
AAAAAAAAAAAAAAH, this CBA keybinding system is so half-thought
what if i want to catch a key no matter if shift, alt or ctrl is down
but if one of these is down, i dont get a keydown detection
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah
looks like i'll have to make my own keybinding system
such a shame that CBA is so useless on this regard

but sometimes we have to do things on our own
can you use colors for systemchat?
[format ["<t color='#FF004C99'>%1 FIRING SEQUENCE INITIATED</t>", _launcher getVariable "launcherName"]] remoteExec ["systemChat", allPlayers];
didn't seem to work for me
oh i think i might have to use formatText
systemChat doesn't take structured text
how can i exec somthing if any task succeed anytime?
are you in control of the task?
no, its generated#
then who completes it? 
no I mean how does it complete?
there can be demo map object, kill vehicle or man
ok let me ask it this way
do you (or a script you use) create the task?
anyway, if you do, just put the code where you (or the script) completes the task
if you have no means of editing the task code, use a loop
oh yes, sorry. maybe i thought its a easy answer to reach all tasks globally. i use drongo map population. it has scripting wise for example: dmpAllTasks pushBack _taskInfo; but thats a bit far ahead for my knowledge. i am quite a beginner.
I tried using setObjectscale in the init in Zeus. It works for a moment but the Size gets reverted after maybe 0.5 sec. Any Ideas how I can make the size permenant?
only works for editor stuff. its mainly used for pictures
you can get it to work with soldiers too
Setting the scale of actively simulated objects (Vehicles with players/AI in them) is possible, but not officially supported, you may encounter issues.
This command works on all objects in Eden Editor or scenario preview, but it will not save and will reset when objects get moved
I have tried using the editor but since I need to attach it to something The unit goes all wonky
Is there Anyway I can skip the Attachscript part?
but if its just in the editor for images, then you don't need to attach to anything since you can just force the object in the position you want?
Its not for images. Its for a unit
if you are actively using it in game, it literally tells you you are going to get problems
I know. I thought it still might be worth a shot
@little raptor how do I correctly use your advanced developer tools code performance button? It only seems to ever run through a single run of it instead of 10,000. Never used the normal ingame one either.
If the code execution takes too long it only runs it a few times (it only adds cycles up to 1000 ms)
Also what kind of code do you run?
Note that it should not be scheduled.
selectionNames _object returns some selections that are not attainable in any of the LODs: "Memory" "Geometry" "FireGeometry" "LandContact" "HitPoints"
oh, those are hiddenSelections
Is there any way to disable gravity for a player without using attachto or disabling simulation?
Ohhh thats not a bad idea
what a lovely weather for mission making 
Ngl, that would actually have some pretty cool utility for like, making planes seem like they're going a lot faster than they actually are
is there a way to force the player to keep the weapon in the raised state when walking?
as in, not the way where the weapon is slightly canted to the side
but the one where it is fully raised and aimed, but not aimed down sights
if you double tap C you get this mode
the "tactical" moves
not really.
you can use the tactical move anims
but the player switches back after the move finishes.
the alternative is a animChanged event handler
you can force it with that
but it's not "pretty"
π
why
i'll just mod my own movement behaviour
i already modded my own keybinds

@dusty whale ```sqf
player addEventHandler ["AnimChanged", {
params ["_unit", "_anim"];
if (_anim select [0,8] in ["amovperc", "amovpknl"]) then {
if (_anim select [9,3] != "tac") then {
_unit playActionNow format ["playertact%1", reverse(_anim select [21,2])];
}
}
}];

Hey all. I'm brand new to arma coding and have gotten hungup on some code I'm trying to write. I need to find the config name of objects around me and add that name to a combo box. I can get the name using "typeof" but adding it is for some reason not working. I feel it's staring me in the face but I can't see it. So how would I do that with my current code?

```sqf plz
see the pinned messages
sorry mate still trying to get everything down
it's ok.
anyway, what do you want to find again?
and what is v_feature_153_inventory_types?
@winter rose
could you change this to:
#arma3_scripting message
"...if your code is too long to show in discord (more than 2000 characters)..."
so im trying to get the config names of the objects around me to display in my combobox, that variable there is where I've defined all of whitelisted objects, it's held within my init file. SO in the if satement I'm making sure that the config name of the objects around me matches one of the whitelisted config names.
that variable there is where I've defined all of whitelisted objects
I know.
but if it's a list of classnames why don't you just use it directly with the nearestObjects?
private _found_objets = nearestObjects [player, v_feature_153_inventory_types, 5];
{
//assigning the variable _x_found_objects to each item individually in _found_objets
// temp v_feature_153_inventory_types
private _x_found_object = _x;
private _x_found_object_type = typeOf _x_found_object;
//if the object found is inside the varibale v_feature_153_inventory_types then execute code
hint "It worked you dipshit";
private _x_object_netid = _x_found_object call BIS_fnc_netId;
_ctrl_object_id = _ctrl lbAdd name _x_found_object;
_ctrl lbSetData [_ctrl_object_id, _x_object_netid];
} foreach _found_objets;
no, because even if it fits in Discord I don't want people to post walls of code text
2000 characters isn't that long 
I can make 2000 lines with it
switch (_value) do
{
case 0:
{
hint "zero";
};
case 1:
{
hint "one";
};
case 2:
{
hint "two";
};
case 3:
{
hint "three";
};
};
```etc @little raptor
and I don't want that, we don't want that
@little raptor Thank you, I don't know why I was doing that, think it had to do with testing early on, appreciate the tip.
note that it also includes the objects that are derived from that class
I'm not sure whether it matters
I do! π
you're fired!
hello anyone here

ready...
set...
GO!!!
im playing arma 2 co and im making a parachute mission with a c130 so i set a load waypoint for the plane and a get in one for the squand and sync the two then a unload way point for the plane with a eject script so far so good and the plane parachute the squad correctly but as soon as they touch the ground the squad commander starts giving orders to go back to the plain
plane
i tried getout command wont work and i tried delete waypoint script nd still wont work
and how can i apply this i just want them to simply paradrop and move to the next waypoint
I'd say add it to the eject script.
this script says crew and im looking to stop the squad only from getting in
this script says crew
no.
What does your current ejection script look like?
man20 action ["EJECT",plane1]; man21 action ["EJECT",plane1]; man22 action ["EJECT",plane1]; man23 action ["EJECT",plane1]; man24 action ["EJECT",plane1]; man25 action ["EJECT",plane1]; man26 action ["EJECT",plane1];
this one works but the squad leaders keep ordering to get back in the plane right after they get to the ground
{
unassignVehicle _x;
_x action ["EJECT", plane1];
} forEach (units MyGroup);
```Try something like this (assuming all the `man##` units are in the same group `MyGroup`).
You can change the group to grp1, MyGroup is just a placeholder variable name I made up.
I've been testing various lengths. Something simple like an array modification.
_array = ["apple", "orange", "pear"];
_array append [1, 2, 3];
_array
still only executes 1/10000 times
ok im gona test it
Better replace the old script with that code.
As the name suggests, the forEach-loop executes the code within the {} for each element of a given array (in this case the array returned by units MyGroup). That saves us from having to write
unassignVehicle man20;
man20 action ["EJECT", plane1];
unassignVehicle man21;
man21 action ["EJECT", plane1];
...
```because that's always the same code, just for different units.
it workedπ
and what is the exec time?
I'm not sure what I did but I restarted the game and did it and it did the full 10000. Sometimes I leave the game on standby while I close my laptop for the night. So sometimes I don't get a restart of the game for a few days
I can only think of 3 reasons:
- your code probably contained errors the last time you did it
- the code took longer than 1 s to complete so it couldn't go past 1 cycle
- your antivirus blocked the execution of the preprocessor (the preprocessor is a separate dll)
btw how can I check if my extension is whitelisted by battleEye?
I sent a request but I don't know if they did anything about it
were you in singleplayer?
does debug in editor not function right if you currently have a mp listen editor up?
cause I'm not sure, but I can test it real quick
only one cycle in MP
https://community.bistudio.com/wiki/diag_codePerformance
For security purposes, this command will only run for 1 cycle in MP, unless in-game debug console is available via description.ext option or Eden attribute setting.
that could have been why come to think of it
I don't know if it is linked, but it sure looks like it might be
unless in-game debug console is available via description.ext option or Eden attribute setting.
doesn't seem to be true
attribute, not "just MP editor"
I set it to everyone 
ah, woops then.
Did you try enableDebugConsole in description.ext as well?
Maybe diag_codePerformance doesn't use getMissionConfigValue, who knows.
How can you setup a invade and annex server? (public vanilla) Is it allowed to use otherβs pbo file and modify it? We will just give them the credit on the loading screen or in the map.
[missionNamespace, "arsenalClosed", {
profileNamespace setVariable ["Saved_Loadout",getUnitLoadout player];
hint "Selected gear saved!"
}] call BIS_fnc_addScriptedEventHandler;
player addEventHandler ["Respawn",{
0 = [_this select 0] spawn {
params [["_player",objNull,[objNull]]];
waitUntil {sleep .2; alive _player};
_player setUnitLoadout (profileNamespace getVariable ["Saved_Loadout",[]]);
};
}];```
I want user "Saved_Loadout" in profile folder, not in mission, so each time when player connected to server mission, he already receives his loadout automatically
You'll probably find that scripted event handlers are not serialized when the mission is saved.
Which means when the mission is loaded those event handlers no longer exist.
You'll want to test which event handlers don't exist after loading the mission, then setup a way to re-add them once the mission is loaded."```
ELI5 pls 
either enable respawn on start, or apply the loadout when player joins(preferably some init script)
also all that spawn/waitUntil stuff is useless
LaserTargetE (CfgVehicles: WEST) and LaserTargetW (CfgVehicles: EAST)
I'm guessing that LaserTargetE creates a bluefor target that opfor can then target and vis versa?
i'd assume so,yes
hmm just running into an issue I guess. The laser target exits. The rhino can pick it up, laser guided artillery can pick it up, but the VLS can't pick it up on its own at all. It can pick it up if the rhino exists next to it though.
not sure. if i manually lase the target, it shows up for the VLS to lock on, it just doesn't pick up any of the script created targets
im currently looking through zeus enhance's github trying to find out how they did it with their create target and artillery fire mission commands but its all messy as I don't understand any of their script macros to find my answer
@copper raven
found it if interested. still looking through it. had to look through a bunch of old commits to find it.
reportRemoteTarget being the key I think
yup just messed around with it, thats the key command
Ok, so I have a script that allows you to fire a mortar from outside. It works in SP, but in MP it does not fire. I was able to kinda hotwire it using console and global exec to get it to fire.
How do you properly set up the remoteExec for a global exec, at least for the BIS_fnc_fire?
What I currently have is this:
[[_arty, _muzzle], BIS_fnc_fire] remoteExec ['call',0];
And that does not cause the mortar to fire in the end. And yes the _arty and _muzzle are properly defined.
@thorn saffron π¨ π
hey, without it the AI didn't get deleted
[_arty, _muzzle] call BIS_fnc_fire;
Didn't work either
other fire commands are not as good as the AI is unable to fire the weapon using the player fire modes and having it to fire in AI fire modes resets the mode for the players, with is a bit annoying.
Best ask these questions in the community that develops / hosts the specific I & A version you want to use.
[[_arty, _muzzle], BIS_fnc_fire] remoteExec ['call',0]; pls never execute like that, you're sending contents of BIS_fnc_fire to every client
Don't know if anyone else has done it, but they're probably just setting the player as the unit inside the UGV. Every UAV has a special unit controlling it. You can insert a normal AI (which is weird, don't do) or a player inside there and directly control it, I think (it's been a while since I tried this). Just have to do it with scripting commands. Can also use remoteControl
I would be more than happy to execute it properly, thing is I don't know how to do it so it also works
wel first off you don't need to remote execute that function, as shown in screenshot here: #arma3_scripting message
it didn't work when I used [_arty, _muzzle] call BIS_fnc_fire;
maybe try providing turret?
[_arty, _muzzle, [0]] call BIS_fnc_fire; (implying its gunner turret)
[_arty, _muzzle] call BIS_fnc_fire;works fine in SP, also there is no place for defining a turret
my bad, there is a turret path stuff
well if it works in SP, providing a turret won't change anything
π€ Maybe I could try changing the ownership of the _triggerDude dummy AI that fires the gun
it says that the vehicle doesn't have to be local to the machine that runs the function(so not a locality issue), sooo, don't know why it wouldn't work in mp π€
Ok, the thing is its not a function that is run serverside: the idea was for it to be a local mod. So I'm executing the whole firing function locally
And now the AI does not use proper fire mode even in SP, it just kinda broke π₯²
id suggest just using https://community.bistudio.com/wiki/forceWeaponFire and manage everything yourself
tried all kinds of the fire commands
what vehicle specifically?
mk6 mortar
_triggerDude forceWeaponFire [_muzzle, _aiFireMode]; does not work
[_arty, _muzzle] call BIS_fnc_fire; works, but the AI always fires in close/burst1 fire mode, even though yesterday it worked fine for the fire mode
[_entity, ["UseMagazine", _entity, _firerer, _owner, _id]] remoteExec ["action", _entity turretOwner _thisTurret];
that's what the function uses for vehicles
useMagazine action
_firerer
well now the I just cannot get the AI to fire in correct fire mode at all
Ok, _arty fire [_muzzle, _fireMode,_magazine]; seems to be working
sort is broken
it doesnt do anything
i tried with [2 ,1 ,2] sort true
BIS_fnc_sortNum works
How?
Because if you simply wrote that, you may want to read the doc again
you can't sort that
it's a "literal" (temp value)
it gets destroyed as soon as it's sorted
try:
_arr = [2 ,1 ,2];
_arr sort true;
_arr
Heyyy, leave him some mystery!
Anyway, plz check before saying it's broken @dusty whale π
I see you're doing it my way! π
my old way at least! π
some people found it annoying so...
i had this
i had an actual value
but it wasnt working
but as soon as i switched to the bis function it worked
i was using it like this:
switch (_moveKeys sort true) do {
...```
in a switch case
and i was getting nothing
WHY IS IT MADE THAT WAY
This will modify the original array!
NOTHING IN THIS GAME WORKS THAT WAY
WHY IS IT THIS ONE SCRIPT COMMAND THAT WORKS THIS WAY
yes it does
set, pushBack
append
insert
etc
pushback and the rest are assignment commands
but why does the sort assign to the original array?
also that's how many other languages work
im not doing that
like C++
im sticking to the BIS function
because that atleast works according to standard
if you have to make a notification saying "this modifies the original array" then MAYBE people weren't expecting it to
and MAYBE you have established a standard people assume you to abide to
why is this so hard with Bohemia?
always
π
even C++ does that
Β―_(γ)_/Β―
as I said it's cheaper
? it's not exclusive to SQF lol
Ngl, sort got me the first time like this as well.
if you need to remind people that it modifies the original array
then maybe people werent expecting it to
im going to stick to BIS_fnc_sortNum
because i need the original array unmodified
and im not going to start playing with extra arrays
BIS_fnc_sortNum is just more convenient
/************************************************************
Sort Numbers
Author: Andrew Barron, optimised by Killzone_Kid
Sorts an array of numbers from lowest (left) to highest (right).
The passed array is modified by reference.
Example: [9,8,7] call BIS_fnc_sortNum; //[7,8,9]
This function uses the quick sort algorithm.
************************************************************/
/// --- validate general input
#include "..\paramsCheck.inc"
paramsCheck(_this,isEqualType,[])
_this sort true;
_this
it just sorts the original array
and returns it to you

and it's more convenient
i get away with writing less stupid code
i want sort but i want it to return the array
Hello everyone,
I posted this in #arma3_questions but I was told it belonged here. I'm trying to make a script that adds jamming to the game via a script. I've found this link to someone who made a script like this (http://killzonekid.com/arma-scripting-tutorials-how-to-override-lmb/) but when i try the script even with the edit (this is the script I'm using https://pastebin.com/kJpzKPhp) I can't get it to work like I want to. The problems I'm having is that every time you reload it says Unjammed, the fact that you need to reload to unjam the gun instead of an action, and if you switch to a secondary without reloading/unjamming the pistol is also jammed. I have a little experience with scripting but nothing like this. I've also been trying to change the player tags in it to this tags so that only the player with the script is affected but I can't get that to work either. Is there anyone who can help me and knows if it is even possible like I want it to.Thanks in advance.
every time you reload it says Unjammed... instead of an action
add an action then. don't use the Take event handler
if you switch to a secondary without reloading/unjamming the pistol is also jammed.
use a better alternative likecurrentWeapon _unit in (_unit getVariable ["jammed_weapons", []]), where jammed_weapons is an array of jammed weapons of course.
Thank you for the advice. I will try it.
I got it to work as an action
Turns out I made a mistake when I tried it earlier
what do you mean with an array of jammed weapons
how?
player addAction["Unjam", {
hint "Un-Jammed";
allowFire = True}]
what did you mean then??
currentWeapon _unit in (_unit getVariable ["jammed_weapons", []])
instead of allowFire, use that "jammed_weapons" array
when a weapon gets jammed, add it to the array
when it's unjammed remove it
Oooooh like that
and that code is what you should use instead of isNil "allowFire"
(you'll have to define _unit first; check the wiki page for addAction)
okay
I thought you meant that to resolve the weapon switching problem and still use allow fire for the rest
I will try to alter the script
it's for both
I've been trying that and how do I remove the variable Jammed weapons
for the action
player addAction["Unjam", {
currentWeapon _unit in (_unit removeVariable ["Jammed_Weapons", []])
hint "Unjammed"}]
This is what I have now but I suspect removeVariable is not a real command

for jamming:
player addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
if (random 1 < 0.05 && {_ammo = _unit ammo _weapon; _ammo > 0}) then {
_unit setAmmo [_weapon, 0];
[_unit, [_weapon, _ammo]] spawn {sleep 0.001; _this#0 setAmmo _this#1};
_unit setVariable ["jammed_weapons", (_unit getVariable ["jammed_weapons", []]) + [_weapon]];
};
}];
for unjamming:
_unit setVariable ["jammed_weapons", (_unit getVariable ["jammed_weapons", []]) - [currentWeapon _unit]];
is there a function to set camera pitch and roll?
and this is a condition. it does nothing
I told you to use it instead of isNil "AllowFire"
yes
unless you mean player camera
in which case no
I thought it was the command that adds it to the array
(it can be modded tho)
https://community.bistudio.com/wiki/camSetDir doesnt seem to work
and yes, i committed
do you mean player camera?
nope, a created camera
i see
@hardy vector ```sqf
player addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "", "", "_ammo"];
if (random 1 < 0.05 && {_ammo = _unit ammo _weapon; _ammo > 0}) then {
_unit setAmmo [_weapon, 0];
[_unit, [_weapon, _ammo]] spawn {sleep 0.001; _this#0 setAmmo _this#1};
_unit setVariable ["jammed_weapons", (_unit getVariable ["jammed_weapons", []]) + [_weapon]];
_unit addAction ["Unjam", {
params ["_unit", "", "_actionID"];
_unit setVariable ["jammed_weapons", (_unit getVariable ["jammed_weapons", []]) - [currentWeapon _unit]];
_unit removeAction _actionID;
}, [], 7, true, true, "", format ["currentWeapon _target == '%1'", _weapon]];
};
}];
player addAction ["", {
playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0];
}, "", 0, false, true, "DefaultAction", "currentWeapon _target in (_target getVariable ['jammed_weapons', []])"];
is that the complete script??
yes
thank you very much
I'm trying my hand at some light scenario making and I want to make a trigger that sets it so when every opfor character within a 500m radius of a trigger is dead, that triggers a 'win'. How do I do that?
What I do is set the trigger to opfor, not present and then set it to the end
So, under 'on activation', just 'end'?
Oh, there's an "end scenario" module. That's neat.
by type: end 1 should be a mission accomplished screen
your question is more related to #arma3_editor
It worked like a charm.
Thank you very much.
I owe you one
is there a way to get the player weapon's muzzle position?
not really
damn
there are ways to approximate it
i was thinking about a matrix transform
because i can get the weapon direction
and the weapon position
dont even have to be amtrix, tbh
vectormultiply is enough
but matrix is easier
then grab the mem point of the gun
the gun is a proxy, is it not?
how do i get a memory point of a proxy
not the gun itself
no the player's mempoint for the gun
there are separate mempoints for every different weapon
what im currently doing:
onEachFrame
{
_beg = player modelToWorld (player selectionPosition ["proxy:\a3\characters_f\proxies\weapon.001","memory"]);
_endE = (_beg vectorAdd (eyeDirection player vectorMultiply 100));
drawLine3D [ _beg, _endE, [0,1,0,1]];
};```
all you have to do is add the length of the weapon to it
but this is OFF by a wild margin
where?
or even near it
but i cant add the length of the wepaon to it because it's not the first memory point
these proxies have 3 vertices
which one i get is up to chance
selectionPosition doesnt return the vertice i want it to
what it returns is dependent on which order the vertices were in when the model was binarized, it seems
and it's not the weapon position
but just happens to be one OFF the barrel to the front and a bit down
this is the whole issue with the selectionPosition
when there are more than just 1 vertex in the selection, it depends on luck which one you get
and by luck i mean on BIS models
since we dont have any input on how those are done
like I said it's an approximate
but i need exact figures
im trying to make a dynamic camera mod
and i need to get the position the player is aiming at, so that i can target it with the camera
and draw a crosshair there
Use attachTo
not good
if i want it to change pitch as the player aims their weapon up and down, i need to attach it to a bone and take that bones transform
which means im also getting weird pitches and angles and banks
since most bones in arma 3 are not level
and i want this to be a more dynamic camera
so that i can move it around objects and such in real time
That's why I said use attachTo
at the same time having it center at whatever the player is aiming at
did you not read what i said?
^^
this whole story
if i attach the camera to the player bones, lets say head, the camera angle and pitch get warped
i cant change it, because it gets overwritten every frame
followBoneRotation: Boolean - (Optional) follows the memory point's rotation (if attached to one) Since Arma 3 v2.01.147011
THIS EXACT THING
it causes the issue
because i am not only following the bones pitch and direction, but also its bank
and the bank keeps putting the camera in weird angles
if i dont followBoneRotation to the bone, then i dont get the pitch, only the direction
the path of least resistance is to get where the player weapon is aimed at and use that information to draw my crosshair and target the camera at it
but i cant get where the player wepaon is aimed at
because i cant get the muzzle position
the best accuracy i can get is OFF by 1.2m at 15m straight wall
that's like an extremely curved barrel
tldr. Not even sure what exactly was the result, but hey I just tried this and worked perfectly fine, if I get the question properly: sqf player enableMimics false ; private _cam = "logic" createVehicleLocal [0,0,0] ; _cam attachTo [player,[0.3,-0.3,0],"head",true] ; _cam switchCamera "INTERNAL" ;
(Except when look up/down somehow)
you dont see what's wrong with this angle?
https://i2.paste.pics/a11161c81491cc152c95c53f839b3a71.png
I don't
see the bank?
how the camera is banked to the right?
and how aiming is extremely wonky
try it
Try what?
try that script
Which?
and try to aim with it
THIS ONE
do i need to draw you a horizon on that image?
and then draw an angle between the horizon and the image frame
I thought you're just making a cinematic, but you're trying to use this in an actual gameplay?
the player camera should be level with the horizon
yes
why would i draw a crosshair for a cinematic?
then bank it a bit 
omg
i cant bank it
Why?
because it's attached to the bone
You can
so the bank gets overwritten by the engine
btw will this code work on units that are set to playable and played by players online or just on units set to player??
im half ready to ditch controlling a player and controlling an AI instead
just the player(s)
won't work on AI
so if i set a unit to playable in the editor and a player plays as tat unit it will work
depends where you add the script
in the object init
you also have to add them on respawn
how do you mean
Does anyone know where jumping out of a car while driving is set to avoid damage?
https://community.bistudio.com/wiki/createDisplay example 2 crashes the game without fail
cant someone confirm?
How did you do that? In Eden Editor?
do you mean in onPlayerRespawn.sqf??
my mod does that
you'll have to spawn it
(use the scheduled exec button)
^^
as KZkid said
in the comments
weaponDirection is inaccurate
it does NOT point where the unit weapon is pointed
only roughly there
and "roughly" is 7m off at 100m distance
in terms of weapons, this is pretty bad
cant get camSetTarget to work
even with committing
it wont follow the vehicle i tell it to
and by follow i mean the camera wont turn to face the target
there's also something called zeroing 
which this command does not take into account
non-factor
im firing 7.62x51 at zeroing of 300m
and im looking at the angle of the weapon
comparing that to the angle of weaponDirection
and these 2 lines should NEVER cross
but they do cross
and quite soon
it's not a mild inaccuracy
angle of the weapon
angle of weaponDirection
weaponDirection IS the angle of the weapon
angle of the weapon to the visual examination
no it's not
screenshot time?
anyways
i cant get my camera to target
i am using camsettarget
but this seems to have no effect whatsoever to the camera
and yes, i am committing
have you ever heard of weapon sway?!
doesnt exist when i have turned it off
now the camera issue
the camera is not locking to a target i give it and commit
what gives?
can someone try out if targeting a created camera still works?
because i cant get it to work
oh ok, so camera target isnt even meant to make it look at that thing

how DO i make a camera look at a target?
or do i just have to work out the trigonometry myself?
this doesnt work
_camera camPrepareTarget player; // a camera will automatically target the human target's face
it does, just not on an attached camera
can you please stop saying "it doesn't work" on first look? π
there is more than meet the eye π
init field of a vehicle:
[this, 1500] call carIsBuyable;
carIsBuyable = {
params['_car', '_price'];
_description = format['Unlock for β¬%1', _price];
_car addAction[_description, {
params ["_target", "_caller", "_actionId", "_arguments"];
if([player] call HALs_money_fnc_getFunds >= _price) then {
[player, -_price] call HALs_money_fnc_addFunds;
_target setVehicleLock "UNLOCKED";
_target removeAction 0;
{ [west, 'HQ'] sideChat format['%1 just purchased a car for β¬%2', name player, _price]; } remoteExec['call'];
}
}];
}
Can anyone explain to me why this is not working π€
it doesnt work even on a non-attached camera
camSetTarget does work with cameraEffect but you don't want that I don't think
i want a camera to follow a target
it doesnt work. I wouldnt say it if it did
it does, you are just using it wrong - otherwise, people would have complained a long time ago I think
you can't make it to work, that's different
i was about to make a political comment about there on systems that dont work yet people dont complain, but wrong chat
yeah, wrong chat.
which is why i asked ^^
my hypothesis is that it doesnt work
happy now?
show your code
@winter rose once you got some time, can you help me with this?
A3RPG_CAMERA = "camera" camCreate (ASLToAGL eyePos player);
switchCamera A3RPG_CAMERA;
A3RPG_CAMERA camSetTarget player;
A3RPG_CAMERA camCommit 0;```
Setting cam target on player works. I did it yesterday
it does not work with switchCamera
how does that make sense?
why can i switch to a camera
using switchCamera
but the camera works
but it doesnt
π€
what functionality do i give up by using cameraEffect as opposed to switchcamera?
switchCamera is for object's view camera
cameraEffect is for cameras
https://community.bistudio.com/wiki/Camera_Tutorial
because of this
why does cameraEffect surrender all controls of my mouse and unit?
because that's what cameras are, cinematic cameras
then you play with remoteControl and switchCamera
what doesn't work?
and where did you define that function
and now i should use switchCamera?
no, don't do it. don't do anything.
just stop
init.sqf executes AFTER the object inits
aaah fuck
really?
how would i solve that π€
class CfgFunctions
{
class bsTag {
class buyShop {
file = "functions\filename.sqf";
class vehicleIsBuyable {};
};
};
};
[this, 1500] call bsTag_fnc_vehicleIsBuyable;
Like this? π€
no - read the page please π
(don't put SQF in config)
forward slash 
lmfao
(or maybe it doesn't matter ?!)
this part class buyShop { <-- category its required?
doesn't
that's wrong