#arma3_scripting
1 messages Β· Page 143 of 1
I would like to:
enableEnvironment false;
On the player when they enter a trigger. But don't Eden editor placed triggers execute their onAction globally? Would I have to remoteExec it?
I have no easy way of testing this multiplayer, so would like to hear from someone with experience...
they execute locally or on server, not the same as global like an init field.
also to test for multiplayer on your PC, turn off battle eye and hit start game a second time. 2 instances will start and you can use the second one to test
Is there any other way to set multiple fields in an array given by a reference?
```sqf
_target = (object getVariable "VARNAME") select 1;
_target set [5, false];
_target set [4, time];
_target set [3, 0];
_target set [2, 0];
_target set [1, 0];
Ok. So executions are local, unless either a) trigger is set to Server, or b) the command is global?
save the variable locally, do the sets, then reassign the target namespace variable
It is stored in a namespace of an object, and the _target is a subarray. It is local.
your edit now makes it that way
now all you do is reassign _target to the object namespace var
after you do your sets
The set command affects the original array too. I understand it is like a pointer, not a value. But using a pure assignment treats it as a value.
oh okay i see what you are asking
you want reduce the amount of sets? and use an array to set them?
Yes, sir.
And since it is a subarray, setVariable is probably useless.
That is probably what I need.
I could just take the whole array, adjust some elements and re-setVariable it, but I would need to write my function for it. π
And I am lazy.
I am going to stick with sets. π
I'm teleporting players between ladders using:
player action ["ladderUp", ladder_1, 0, 1];
In a trigger. But the character first needs to 'dismount' the ladder before mounting the new one. I'd like to minimize the visual bug of characters dismounting and falling to the next ladder. Is there a specific method/command of skipping or speeding up this animation? PS I'm aware of actionNow that is in the dev branch.
Is there a right way to remote call a "createMarkerLocal" to a group?
A group might have multiple units with different locality.
Depends what you're trying to achieve.
Well, I want to call it inside a addAction, available only to the leader of the group. When the leader uses the action, I want to spawn a marker that's only visible to this group, for example a "Respawn" marker.
Is the group membership permanent or does it change?
permanent
you can always create the markers globally, then hide them for everyone but the group units as well
using setMarkerAlpha?
yes, local version
sorry, can you give me an example? xd
I know, I mean, the whole process
I did this a bunch. It works fine if you just make sure it's not marked server-only. I had mine on repeatable, just to be sure. On act, enable false, on deact, enable true.
support @Sa-Matra's ticket then π
is BIS_fnc_showSubtitle local?
Yes
Thanks
Hey anyone know how to get the lastest all-in-one config for A3?
Thanks
Is their a script to add people to / fill a vehicle?
Thanks for the definite reply! One less thing to worry about in the group mission...
Is there any single command that will find and filter out all enemy units within a radius for me, without seeing or otherwise detecting the enemy units? There is targets command, but it only finds those units which are already known to the asking unit.
Also pit them against each other in combat
https://community.bistudio.com/wiki/nearEntities, then do a side check
And is there a way how to retireve all units within a range both on foot and inside vehicles?
_units = allUnits select {
alive _x &&
!isNull objectParent _x &&
_x distance <= someDistance
};
add in lazy eval if you want:
alive _x && { !isNull objectParent _x && { _x distance <= someDistance } }
Many thanks, I figured that the nearEntities returns even crew units, but you have to specify that you are looking for Cars.
Reason why I am looking for a native solution is that I will have to call this function often, so I want something performant.
2.18 syntax should help with most of that soon
does the eventhandler onKeyDown return multiple keys if multiple are pressed? Or does it fire the eventhandler for each key
each key, multiple firings
what are you trying to do? maybe we can figure out a workaround
Got a system for movement, it uses keyDown and keyUp to move, Currently it works fine with moving in one direction but moving diagonal has proven difficult while only detecting one input
You can use inputAction to detect the state of the movement inputs and something something maths now it's a direction
Just set a flag when key is pressed and remove the flag when it isn't.
I guess you'd need an eachFrame to handle the movement.
Not that I've seen.
Already have that
I've always set the flags in keyDown/keyUp and then done the calc in eachFrame.
I could use the existing keyUp to remove said flag
Alright, I'll try that
That was my idea.
If it's proper keybindings then you could skip the keyDown/keyUp and just use inputAction in the eachFrame, I guess.
Not proper keybinds sadly, otherwise I would prob get around this
keyDown / up is good if you want to offload EachFrame handler from processing unneccessary checks of inputAction.
if keyDown / keyP detected appropriate key and assigned inputAction, then turn the PFH on (or add a task to the PFH queue). Scanning inputAction each frame even if the user doesn't push the key is not good IMO.
This has worked, thanks
Good day. Is there a way to get array of all modules on map? Tried
allMissionObjects "Logic";
player nearEntities ["ModuleHideTerrainObjects_F", 30000];
No luck so far
If you're just doing it in a placement routine then it's fine. Ideally you don't just leave an eachFrame running all the time, yeah.
Which projectile or weapon class attributes can I use to determine the sound intensity or sound range of a gunshot or explosion? Thanks
for weapons, its on the ammo:
configFile >> "CfgAmmo" >> "AmmoClassHere" >> "audibleFire"
for weapons, using a suppressor, its modified in the suppressors config
configFile >> "CfgWeapons" >> "SuppressorClassHere" >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"
Exactly what i've done actually
Is there any event handler that fires when player switches a weapon?
["weapon", {systemChat str _this}] call CBA_fnc_addPlayerEventHandler;
bet you its the ^ on the setVectorDirAndUp line that is messing it up
and no _x?
did it copy paste right?
i still bet its the ^
I think Discord is hiding the _s
yeah i think so
onEachFrame {
{
_x setPosASL ((getPosASLVisual plane1) vectorAdd [(forEachIndex+1) * 30, (forEachIndex+1) * 30,0]) ;
Γ setVectorDirAndUp [vectorDir plane1,vectorUp plane^];
_Γ set Velocity velocity plane1;
} forEach [plane2,plane3,plane 4];
} ;
Two of the xs are weird
eww, still doesn't copy right. but it looks like the space between set and velocity is a problem too
Yeah that too
I'm on mobile so it doesn't do syntax highlighting for me rn 
also a problem between plane and 4
i think this is the author's intended:
onEachFrame {
{
_x setPosASL ((getPosASLVisual plane1) vectorAdd [(_forEachIndex + 1) * 30, (_forEachIndex + 1) * 30, 0]);
_x setVectorDirAndUp [vectorDir plane1, vectorUp plane1];
_x setVelocity velocity plane1;
} forEach [plane2, plane3, plane4];
};
try that
needs underscores on the forEachIndex
youtube apparently does not like pasting code in the description lol. I bet it removed _ as well
The "Argument local" on wiki means what exactly?
That if I want to run it on a let's a projectile, it has to run wherever the projectile is local?
Or can anyone run it if he has a reference to this projectile?
for example in https://community.bistudio.com/wiki/triggerAmmo
It means it must run on the machine where the argument is local.
Copy that, thanks
Note that projectiles are a bit of a special case for locality, because some types of projectiles have separate copies on every machine, with only the owner's copy actually being real. So you can't really use remoteExec with them or pass references between machines.
this will be interesting 
I would assume that projectile would be local to either whoever pressed the trigger, or the server
The shooter's copy is usually the real one, yes
is it okay to remote exec like this?
sure, its valid
Ok so tested it a bit. Was on editor hosted server (first instance) and connected client (second instance)
When fired, both instances said that the projectile that was passed into the fired event is local to both... 
We did a massive battle scene with around 200ish present and players, 1 HC.
Server FPS took a huge dip, but it was awesome
Yes. Each machine has their own separate copy, like I said.
yo how do i remoteexec a function but spawn it? like i have a function named "MOS_spawnparty" and i want this function to be remote exec'd but in spawn so that the rest of the code in that block gets processed instead of waiting for the "MOS_spawnparty" to be completed
// some code here
=> remote exec the function "MOS_spawnparty" here
// some other code running while that function is being executed``` i dk if u understand what im tryna say
It is already like that by default
remoteExec doesn't wait for the function or command to be completed on the target machine before allowing the local script to proceed. (It would actually be impossible to do that, because JIP clients don't even run the remoteExec'd script at the current time). It doesn't wait for any kind of callback at all, it just transmits the instruction and that's it, job done.
then why remoteexec is bad and people say not use much?
Well, there are plenty of bad or plain wrong ways to use remoteExec
That doesn't mean you shouldn't use it. It means you should understand what you use.
remoteExec isn't inherently bad. It just creates network traffic - messages being sent over the network. If there are a lot of remoteExecs being sent, that's bandwidth and network processing being used for handling that instead of other traffic that might be more important. So generally, you want to be judicious with it and not overuse it.
It's also easy for less experienced scripters to end up using remoteExec in scripts that are already being executed globally, or for commands that already have global effect and/or global argument, which is straight-up unnecessary and can cause problems due to duplicate commands.
Like, remoteExec'ing one function is fine. But if you get to the point where you're remoteExec'ing 5 commands in a row in a loop that runs every second, you should probably run that loop locally on the clients instead.
i am looking at code which has lots of remoteexec within it that is run so i am trying to put it all together into 1 function to remoteexec as this function will be made available to all clients to increase performance. but these set of codes are executed in spawn so i was wondering if remoteexec has spawn similar to remoteexeccall
remoteExec runs the specified command or function in a scheduled environment, like spawn does. That's why remoteExecCall exists - it is the unscheduled counterpart to remoteExec. In terms of scheduling, these two are both the same:
[_argument] spawn my_fnc_function;
[_argument] remoteExec ["my_fnc_function"];```
Things _within_ the spawned/remoteExec'd function will be executed in order as normal; other scripts will not wait for it to complete. If you want to make more separate threads within the function that the function itself won't wait for, you still need to use `spawn` to create new threads.
The main issue might be that mods can "forbid" the usage of remote exec.
So if you load the mod with some poorly written one, you might have an issue. CBA events way better
Hey, do anybody know how to make ai in apcs turn out? In Arma 3
apcs turn out what?
ah, so NPC
use vehicle action ["TURNOUT"]
Thanks!
ah, that might not work
not sure, you might need to call it for everyone inside
just now noticed it has SQS around it
Yeah the error code it's saying is " vehicle: Type Nothing, expected object"
group1 setBehaviour "SAFE"```
Ah, mine are for OFP, didn't notice, sorry
It's still not working π
Well it is what it is I appreciate the help giys
Guys*
What you've done and how it doesn't work is my question then
I nameD the squad composition group 1 and I type your code and it says it missing ";" and vendors I place it it's still saying the error
group 1 is not group1
Whether the AI will want to turn out is partly controlled by the vehicle's config, and heavily controlled by their group behaviour mode. In general they'll be OK with turning out when their group behaviour is set to Careless; sometimes Safe will do it depending on the vehicle. Usually they prefer to turn in when in Aware or Combat mode.
Setting them to Careless has...some drawbacks, but it can be fine if they're not expected to fight.
Setting them to Safe is OK, if the vehicle is set up for that, because they'll automatically switch modes when entering combat, so they can still fight properly...but they'll automatically switch modes when entering combat, so they won't stay turned out.
It's hard to force them to stay turned out if they don't want to.
And this way I don't need to use remoteExec, even within the event handler?
If I want to display some intel on a pub zeus server without using remoteExec (because it's a blocked command), I presumed a simple example would be something like this?
"showIntel" addPublicVariableEventHandler
{
player createDiaryRecord ["Diary",[
"Mission Intel",
"some mission intel here"
]];
};
showIntel = true;
publicVariableSerer "showIntel";
Where I could load this into an invisible helipad comp and place it during an active zeus session?
I saw in a tutorial they showed the addPublicVariableEventHandler code going into a server init, so I hope it works running it from an object init during live gameplay
sort of a shot in the dark because I have really no idea what this is going to do lmao
I guess there is no way to show intel to all players in a pub zeus server via scripts
Ahhh OK, appreciate it
@outer bay are you allowed to hit the server, local, and global exec buttons in the debug? if so, you don't need to remoteExec anything, just use those buttons
also, just choose a public zeus server that allows either remote exec or allows composition inits
or better yet, make your own public zeus server with the settings you want
Yeah unfortunately the official servers don't allow it I guess
Hello, is it possible to make bots on vehicles move not through the roads, but just towards the point? For example, even tanks like to move through the roads, so is it possible to make them move through forests?
https://community.bistudio.com/wiki/setDriveOnPath
If it doesn't help, I don't know what else I can suggest
thanks
AI are more willing to go offroad when in combat mode. Obviously that's not ideal if you need them to not be in combat mode for some other reason, though.
thanks, but problem is that combat mode makes bot's behaivour stupid
What's the algorithm to find vehicle seat positions? Checking proxy names?
I see there is CPDriver, CPGunner, CPCargo, CPCommander proxies in CfgNonAIVehicles, but how does the game decide to use CPCommander for certain turret? Turret's commander status? I wonder what happens if you have two commanders in config π€
there's a proxyType config parameter
can be set in each turret and on the vehicle itself (if you want to change the driver)
I don't think cargo proxies can be changed other than cargoTurrets
Thanks, this explained it for me!
What a clunky system
s1 = createSimpleObject ["I_Heli_Transport_02_F", player modelToWorldVisualWorld [-10,20,5]];
s2 = createSimpleObject ["a3\air_f_beta\heli_transport_02\heli_transport_02_f.p3d", player modelToWorldVisualWorld [10,20,5]];
[getDir s1, getDir s2]
```=> `[0,0]`
I see that `namedProperties s1` and `s2` both return `[...,["reversed","1"],...]`, why are models in different direction then? π€
What does "reversed" means anyway? Model rotated 180 degrees in game?
Oh there is also reversed in CfgVehicles
as I understand in the model space the actual model axis can have arbitrary direction and not always matches the model space axis.
Hello. It seems like this variable it's not passing the data inside this code. Anyone know why is this happening?
Event handlers don't run in the same context.
You're just providing a piece of code to be executed later.
If you use addMissionEventHandler instead then you can pass data in directly.
just by changing directly addStackedEventHandler to addMissionEventHandler?
Yeah. There are other slight differences, like removing the "On".
Okay. This mission event handler will work inside a function right?
uh
It's pretty similar, just a command instead of a function.
And you get the "arguments" parameter which you can use to pass in data.
It'll still run the code in a different context.
well it seems like it's not passing the data at all. If I use an "object" like a trigger directly, it works.
from .rpt:
11:20:38 Error position: <createLocation ["Name", _centerpos, _ran>
11:20:38 Error 0 elements provided, 3 expected
11:20:38 File C:\Users\Murilo\Documents\Arma 3 - Other Profiles\PiG13BR\missions\VR\TEMPLATE_TvT_HALOJUMP.VR\scripts\PiG_halo.sqf..., line 34```
And urm how did you do that
initPlayerLocal
I mean your code, that is throwing the error
this you mean?
Yes but updated one
it is possible to pass additional arguments to the EH code via optional param. The args are stored in _thisArgs variable
is this that am I missing?
Yes
Can you give me an example? I saw the example 2 but I don't know how to do it in my code
addMissionEventHandler is doing it later, as John already said the concept, so it will not recognize any variables outside automatically
addMissionEventHandler ["MapSingleClick",{
_thisArgs params ["_sideParadrop"];
},[_sideParadrop]]```
Thank you, it's working now 50% π it creates the location but I have a problem with this mission event handler, this event handler in particular doesn't work for me. I click on the map and nothing happens, but when I use a different command/function using onMapSingleClick, works
updated
can this also work on addEventHandler? or is there another way to pass arguments to for it?
No
well this also works lol
_pos doesn't exist there, except maybe by accident.
need params ["_units", "_pos", "_alt", "_shift"];
```{
_x = _target;
if (["marker1"] findIf {_target inArea [(getMarkerpos _x), 750, 750, 0, false]} >= 0) then {_target setDamage 1};
}forEach [vehicle0,vehicle1];```Is there a way to have _x and _target work here? _target in the inArea statement comes back undefined
you meant _target = _x; I think.
forgot that
can someone explain what the second line does? - sqf DUMMY_code = { hint "inside dummy code"; }; "DUMMY_code = {};";
does it just call the function above?
no it does nothing
so the "DUMMY_code = {};"; is useless?
yes
oh ok thanks
DUMMY_code = compile "DUMMY_code = {}; DUMMY_code = nil;";
Can I use an empty define var in preprocessor to expand to an empty string of code? Like this:
#define SOMETHING
#ifdef SOMETHING
#define COND && _x && _z
#else
#define COND
#endif
if (alive _x COND) then {};
If COND is only defined, but empty, it will be just removed from the SQF, right?
i mean
you can just define it as && true regardless
This is just a silly example. π I meant, if I can expand macro to an empty code without any errors or something.
I started using it as a way to inject some additional debugging options inside conditions, because I donΒ΄t want to slow down the computation in the release version. So I wanted to know, if it is OK to do so.
Does anyone know what would be the easiest way to get an array saved to a file on the server, that I can open in a readable format in notepad or something?
probably requires an extension. instead, you can copy paste into a file using copyToClipboard str _myArray
You can also use diag_log on the server to write stuff to the server RPT log
This shouldn't be a frequent thing you use for regular outputting but it's OK for debug
That might work, I only need to run it once at the end of OP
That is perfect for me thank you
Anyone know where I can find a persistent crate script? Doing a survival mission for a few friends
Is there a way to playsound local to a player / to a specific player wiht the same parameters used in playSound3D such as soundPitch, volume, and distance?
does the isTouchingGround function still work? Bc when I scripted a heli crash I made it a trigger to activate a task so "isTouchingGround heli_1"
But even though the heli is touching the ground it is not initiating the task
If you mean you want to play one only on specific person's game, just remoteExec it
Yes it does
Isn't remoteExec'ing GE/GA bad?
Yea but playSound does not take in sound positions, volume and distance unlike playSound3D
How?
Last argument
Wait I'm just blind sorry π
Lets start a list of such missing objects so it can be added in bulk
- Invisible object to attach rope to. What the best simulation for it? Current list on wiki has objects with such simulations:
"motorcycle"
"car"
"carx"
"tankx"
"airplanex"
"helicopterrtd"
"shipx"
"submarinex"
"paraglide"
"parachute"
```What's the cheapest simulation to have? Wonder what ACE uses there.
- Invisible objects to attach TO rope. Some invisible `thingx` object?
Other things I had in mind recently:
- UserTexture that is a ground decal
- Object with nothing but a proxy flag so you can attach it anywhere and
forceFlagTextureit
Anything else?
- I'd really love to have even larger clutter cutter object. Sure you can make it yourself with simple object now but having it in 3DEN without mods would be very useful.
I'm not sure if the existing invisible wall object is roadway/walkable. If not, then one of those
I'd also love to have invisible copies of the chest rig and tac vest but I guess that's a slightly different thing
Not sure either but sounds like very useful object to have
yes
callExtension + .DLL / .SO with your primitive I/O functions. You can read files, memory, streams, ALCs / LPCs, sockets, pipes, make SQL queries, whatever you want.
RVExtension() is a synchronous function (the next frame won't be rendered / processed until the function returns the control), try to move your job into separate thread and then use callback to return result. It sounds a bit scary but this mechanism opens the doors into the "mature" world of countless posibilites.
https://community.bistudio.com/wiki/callExtension
* not async
_fpsCoef = ((time - bis_fnc_halo_para_loop_time) * 20) / acctime; //Script is optimized for 20 FPS
BIS knew how their game ran (Arma 2)
Sometimes it's necessary. For example, setMass is GE but the propagation is slow, so if you want an object not to kill players within the next few seconds then you have to remoteExec it.
but otherwise yeah, if something's GE then you just run it in one place.
Is this correct for checking if a unit is west and not player? if ((side _this == west) and not (!isPlayer _this)) then
you have a double-negative on isPlayer.
-fixed
if (!(isPlayer _this) && {(side _this) == west}) then {...};
are you referring to SQF or C/C++?
SQF
I was asking @meager granite π but it seems he deleted his message (probably found the solution)
SQF, I have old implementation but pretty sure seen a better one somewhere
Decided not to bother others and just redo it myself properly later
In case somebody will search like I did, rotate vector around axis by amount of degrees:
// Params: [Array (Vector), Array (Axis), Number (Angle)];
// Returns: Array (Vector)
both_func_rotateVectorByAxis = {
params ["_vector", "_axis", "_angle"];
private _cos = cos _angle;
private _sin = sin _angle;
private _mcos = 1 - _cos;
_axis params ["_ax", "_ay", "_az"];
_vector params ["_vx", "_vy", "_vz"];
// https://wikimedia.org/api/rest_v1/media/math/render/svg/7dc67eaa6d74f6629767726f854a5ff8bf7e5477
[
_vx * (_cos + _mcos * _ax * _ax) + _vy * (_mcos * _ax * _ay - _sin * _az) + _vz * (_mcos * _ax * _az + _sin * _ay),
_vx * (_mcos * _ay * _ax + _sin * _az) + _vy * (_cos + _mcos * _ay * _ay) + _vz * (_mcos * _ay * _az - _sin * _ax),
_vx * (_mcos * _az * _ax - _sin * _ay) + _vy * (_mcos * _az * _ay + _sin * _ax) + _vz * (_cos + _mcos * _az * _az)
]
};
Was wondering if this could be sped up with matrix commands
[[2, 3, 4], [1, 0, 0], 90] call both_func_rotateVectorByAxis; // 0.0130 ms
[[2, 3, 4], [1, 0, 0], 90] call both_func_rotateVectorByAxis2; // 0.0058 ms
It think it can be optimized even more
Nice! Share the code please.
both_func_rotateVectorByAxis2 =
{
params ["_vector", "_axis", "_angle"];
private _cos = cos _angle;
private _sin = sin _angle;
((_vector vectorMultiply _cos) vectorAdd ((_axis vectorCrossProduct _vector) vectorMultiply _sin)) vectorAdd ((_axis vectorMultiply (_axis vectorDotProduct _vector)) vectorMultiply (1 - _cos));
};
Good stuff, thanks!
Yeah, in SQF, ! and not are interchangeable.
nice, stealing that in case I need it later :P
ah wait, I already did this. It's called Rodriguez's formula, right
Used in Antistasi's dive bomb code :P
It's probably can be optimized even more, because I used Rodrigues' rotation formula for the vectors. Here is https://en.wikipedia.org/wiki/Rodrigues'_rotation_formula.
The problem of using matrix-based solution (from the article) it still requires to calculate cross-product for the _vector.
https://i.imgur.com/bV0tdaC.png
It works well in SQF because it cuts down the total command count.
giving up here.
tested in debug menu, i havea totally functioning fucntion, and cba settings commands for a mod.
but making it an actual MOD for arma is the most difficult thing ive ever done for any game.
all the guides are missing 1 or 2 bits of info but every other guide says every other guide and packing program is bad.
Does anyone just have a barebones 'empty mod example' i can go off of? Ill understand that, i dont understand any of these guides.
throw your stuff on github and i can see what you got
It really is a pain to get started. Mikero and HEMTT have heavy setup requirements. Addon builder command line is just broken.
hemtt i think is still the best outside of doing terrains
Otherwise the actual requirements for a working mod is just a config.cpp with a CfgPatches in it.
also, if you use vscode @twin anvil , there is a remote feature where I can view your code space in real time. i think you can make suggestions too
I love Antistasi. Can you fix the statics which are not being despawned when player goes off of spawning area? π I submitted a ticket in #suggestons π
I got the mod to load via the cpp.
i just cant seem to define what it wants to have a callable function in a mod.
Same for the CBA settings. Load in game i can run the contents of the settings file and it works, but every attempt after packing it (tbf ive been using addon builder) it just leaves me with a near-empty addon options list.
Ive seen 3 different commands for both which also drives me mad.
It's a fundamental structural change. I have a 50-file-change branch for it but it keeps getting benched to do other stuff.
you got a cfgfunctions?
Cant i just define them in the cpp?
you can, but you need the cfgfunctions WITHIN the cpp
oh yea, sorry, brain scrambled. Yes i do
Usually the issue with CfgFunctions and mods is getting the file path right.
so like i said, post what ya gooooooooooot
Each PBO has a "prefix" which is the virtual path it's placed at when loading Arma.
In the addon builder UI it's in the options tab.
The file paths in CfgFunctions need to include that path.
i have 10 different vastly diverging versions from a week ago and today of me trying to get this to work.
as far as im concerned im just starting form blank again and have nothing to show you.
i can make you a hemtt template example if that is what you want
Then in CfgFunctions you do something like this:
class CfgFunctions {
class myTag {
class whatever {
file = "pboprefix\functions";
class myFunction {};
};
};
};
Then the file functions\fn_myFunction.sqf in your PBO is mapped to myTag_fnc_myFunction.
HEMTT template example would be neat anyway.
im poke at this abit but yeah.
a functioning example would help.
been looking at other mods on the github but ngl, going form no idea how this file structure works to looking at someone's take on a possible way to do it when its flooded with content isnt helping loads. Normally reverse engineering is how i figure this shit out too.
Usually real mods use opaque macros and black-box build tools so they're not great examples.
many of the bigger mods use the CBA framework, which is very confusing on first look. You'll have to build up to using that if you want to use it later.
i wanna use it now.
the function relies heavily on a CBA command and i want to use CBA settings.
but as far as i can tell, the settings is just some commands run in preinit (works in post but should be pre). both should (right?) just need me to add CBA as a dependency and include the script macros.
having your PREP in pre and post secures them from vulnerabilities. won't really matter if you aren't making a large pvp mission
you can define functions either through CfgFunctions, or by using PREP (in CBA)
you don't HAVE to use the CBA framework in order to use their functions btw
the framework is there to make managment of multiple addons within a mod easier
famework meaning the macro framework
You can also use the macro framework without having CBA as a dependency :P
It took me days to figure out what was going on with the macro framework though. I would recommend setting up a mod manually first so that you understand what the framework is trying to do.
i'll build him a heavily commented template that I'll put up publicly on github for others in the future
This is very common problem how to start from scratch, define functions etc
I'm running an ALiVE mission and want to add an item to all spawned AI of side West
I have this in my description.ext
``class Extended_Init_EventHandlers {
class Man {
init = "_this call (compile preprocessFileLineNumbers 'BFT.sqf')";
};
};``
And in BFT.sqf is this:
``private "_this";
_this = _this select 0;
if ((side _this == west) and (!isPlayer _this)) then {
_this addItem 'ItemAndroid';
};``
But it doesn't work. What am I doing wrong?
first off, dump the unit into diag_log instead of adding the item
at the very beggining of the BFT.sqf add this
diag_log (format ["[BFT.sqf] _this: %1", _this]);
then start the mission, and check .RPT
_this must not be null or any
after the test, move this line into your if block and repeat. The diag_log should dump only AI units.
if everything is ok, the last thing you have to experiment)
oh wait what is that???
private "_this";
that's bad idea to make _this private when it passes the argments from the outside into the fucntion
I have no answers. I googled, some post said βdo thisβ and here I am. In tears. I have no idea how any of this works
params ["_unit"];
if ((side _unit == west) and (!isPlayer _unit)) then
{
diag_log (format ["[BFT.sqf] _unit: %1", _unit]);
_unit addItem 'ItemAndroid';
};
you need to know some basic aspects of SQF and what exactly _this means
_this is a magic word typicaly used to pass arguments to the function from it's parent scope
Basically it is just a variable like the other ones, but defined by the game engine implicitly like some other variables (_forEachIndex, _thisTrigger, etc).
So the primary goal of _this is to PASS the data through the border - between two (or even more) scopes
For example
"Hello, World!" call {hint _this;}; // _this contains text "Hello, World"
[1, 2, 3] call {hint (str _this);}] // _this contains ARRAY
[4, 5, player] spawn {hint (str _this);}; // _this contains ARRAY with 2 numbers and one object reference
// the script named myshit.sqf receives the data stored into _this variable
[player, damage player, "YEAH!"] execVM "myshit.sqf";
you can extract the data from _this if it is ARRAY by using select or # commands. But it's good practice to use param or params for this specific purpose
[player, damage player, "YEAH!"] call
{
// old way
private _unit = _this select 0; // _unit is player
private _dmg = _this select 1; // _dmg is damage of player
private _message = _this select 2; // _message is "YEAH!"
// new way, completely identical
params ["_unit", "_dmg", "_message"];
};
private keyword (or command) is used when you want to isolate the locally created variable from the parent scope:
// parent scope
_x = 1;
call
{
// same context, child scope
private _x = 2;
hint (str _x); // HINT: 2
_x = _x + 1;
hint (str _x); // HINT: 3
};
// parent scope again
hint (str _x); // HINT: 1
so when you made this:
private _this;
you basically created new undefined variable (because it doesn't receive any value) _this in the local scope and then trying to use it.
Jesus this is alot to take in. Thank you so much for taking the time
Where is the log saved?
Found it
Got nothing diag_log in the log
no messages even if you put the diag_log line at the very top of the file?
Yeah got it, I had messed up. It works now! Thank you for the help!
there is way to change the color of the coordinates references in map. by mod or script?
and any idea where to start lol
ok i found i can change something with configFile >> "ctrlMap" but it only works in 3den
In configFile >> RscMap (iirc)
The map is under controlsBackground
ive tryed but it didnt work ( im using mods, idk if ACE modifies something in the map too)
rcsmap dont have controlsBackground
Reverse Simple Map Tools by @warm hedge or ask him directly
Did I do what?
this setUnloadInCombat [false, false];
^ will this work to prevent my APCs from unloading before a waypoint
do i need to specify the vehicle instead of "this" ?
Depends where you're running it from.
Hello. In a dedi server, if a global variable is created inside initServer, it will not be broadcasted to the clients, right?
use of the word "global" is confusing with Arma.
but generally a global variable is global scope but only on one machine. You need to publish it with publicVariable before it's visible anywhere else.
The server isn't any different to any other machine in this regard.
Thank you, I got it working using publicVariable.
you also can do it in one line with setVariable (and also send it to specific machines if you want)
nice, thank you
Well I said iirc, so the class name might be wrong
Check if its idd is 12 in config
That would be the main map
You can also use the config search feature in ADT, and search for a property with name idd and value 12
Can somebody tell me how to make an ai drive their vehicle to their way point when a player is inside their vehicle
For some reason the ai would not move to their waypoint when a player is inside their vehicle
what seat is the player in?
But mostly the gunner seat
setEffectiveCommander on the driver might work.
you'd probably need to set it again each time a player switched seats.
Thanks π
How could convert a base64 string into an image that could be displayed in game?
I strongly doubt there's a way to do it in-game.
Doing it out of game ahead of time, just google a base64 to image converter, there are some online tools. Then plug the resulting image into the Arma image-to-PAA tool to convert it to Arma's .paa texture format.
I figured, I was just looking for a way to dynamically add images
I'm not sure how esoteric of a situation this is, but I'm trying to fix an issue with a custom BLUFOR tracking system for my community and for some reason when a player changes units with our class selector (essentially a new unit gets spawned, they take command, and the old one is deleted) they're unable to see the marks from the BLUFOR tracker. Hasn't really been updated in 8 years so probably not the best way of doing things but it's worked until we built our class selector
Note: Apologies for the delete and repeat, I realised the previous message had the wrong code in it and the proper one is just too long for Discord to like so file is attached.
Is there a way to check the body armor values via a script? How much protection is offered?
You just read those config values via script
looks like the script quits when _unit is dead / inexistent. so in your class selection you probably need to run the script for new units
Thatβs the weird bit though, itβs not just when the one with the marker dies, anyone that uses the class selector loses the ability to see those markers
well the marker is deleted at the end
I get that, but the script only runs on units with markers so why would a unit without a marker lose the ability to see it?
By the way, I apologise since it seems like I did somewhat of a poor job initially explaining that
its ok but i dunno whats the problem exactly , i bet it has something to do with markers being deleted
Perhaps...it's definitely weird that it'd be affecting units that the script isn't running on
well they are supposed to all see the same marker because markers are global
Okay, hold on. Let me try explaining it a bit better.
Player A is a teamlead so has a marker for the tracker. Player B is a part of their team and so doesn't have a marker.
Player B uses the class selector, Player A doesn't.
Player B loses the ability to see the marker, but everyone else can still see it.
So the markers being global, if they got deleted for one person, would they not get deleted for everyone?
yes deleted for everyone
But in this case it isn't...it's just not showing up for the one person
hmm
That does seem to be the consensus, yeah π
this is the only thing I can think of: https://community.bistudio.com/wiki/setCurrentChannel . maybe channel is changed somewhere?
which would effect the marker channel, or not
Doesn't look like it, and we've pretty much got channels locked down in description.ext's so I'm not sure if that'd have an effect π€
Defaults to the marker channel anyways due to the behaviour of createMarker
decode BASE64 to the byte-stream and then treat it as a picture
IMO using callExtension is the best choice for that. There is fast algorythm available on Stack Oveflow.
Example:
http://renenyffenegger.ch/notes/development/Base64/Encoding-and-decoding-base-64-with-cpp/
And SO codec performance comparison
https://stackoverflow.com/questions/342409/how-do-i-base64-encode-decode-in-c/41094722#41094722
doing the same job on SQF is waay slower.
Is it possible to change a groups callsign, that which is displayed in game of a player group via setGroupId?
yes
Would you have the patience to explain to me how?
is it possible to add tracer rounds to handguns?
wiki has lot of examples : https://community.bistudio.com/wiki/setGroupId
how do you create your groups?
At the moment you can't display whatever image you want in the game. It has to be part of a mod or mission.
But after 2.18 you can use this:
#arma3_tools message
It basically allows you to draw anything you want in Arma 3. Even another game π
Decoding isn't really the problem. Showing the picture is
Placing them in the editor
then you can change the group callsign there. right click the group, open the dialog
But when the players join in whatever I enter as the group call sign does not carry over. Theyβre Alpha 1-1 and so on
thousands upon thousands of square markers on the map acting as a makeshift bitmap
follow me for more solutions π
Does anyone have a "low cost" script based idea on how to return positions on roads within cities (in a way it does not consume an absurd amount of computation power) ?
The approaches I had in mind were either making use of bis_fnc_findSafePos (which I would like to avoid) or "spraying" points in a circular pattern and check if those positions are on roads. Any good ideas around otherwise?
@gritty parrot that is a hard one. Find safe position though is one of my favorites.
You want a position from the area that is on the road?
Ty
In theory you could do this with UI-to-texture and a display with a CT_STATIC per pixel.
probably shouldn't though :P
Yes, preferably multiple so it is not predictably the closest one to a location center
@little raptor but how do I reference it via a in-game script?
Example:
getNumber (configfile >> "CfgWeapons" >> _className >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Chest" >> "armor");
`getNumber (configfile >> "CfgWeapons" >> _className >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Chest" >> "armor");``` sort of like that?
I found a solution
you have a floating backtick.
Good, how did you solve it
I used https://community.bistudio.com/wiki/BIS_fnc_nearestRoad on a radial basis
We just used nearRoads because we didn't have distance preferences.
Makes life easier. But I think to pay the attention necessary to this great game I need to scale up the search pattern a bit π
The ai is still not moving to its waypoint
would you happen to⦠have AI mods?
Yeah I do but the mod only make the ai stay stand up
Hmm... Are you sure that's all it does. π€£ You would be surprised at some of the stuff that happens behind the scenes. Why not try it in vanilla first and then come back.
Are the AIs in a different group to the player?
huh, AMV-7 Marshall won't drive with the driver set as effective commander.
Arma things :/
Yeah they are
I'm doing a task where a player enters another ai vehicle which is in a convoy
Ok, make the driver the group leader as well as effective commander. Seems to work.
Although this assumes that the vehicle crew has their own group, which may not be the case for a convoy. That case might be impossible.
Hi, I wanted to create a type of interaction on arma 3 but I don't know how to do it because I hadn't seen it before. If I remember correctly, it replaces the wheel interaction menu (not the ace one) and is installed directly on a vehicle door, for example, to open it or start the ignition by aiming at a vehicle's ignition key.
You're trying to replicate arma reforger's system?
I've seen that menu about ten (or even more) years ago in the games like Rainbow Six and Call of Duty
The UI is attached to the object directly
Hello, is there a way to make it so a player unit doesnt trigger wake up for dynsim?
Use case would be aircrew working with ground forces, i dont want the pilots to trigger wake up for the enemy ground units for performance reasons.
could it be
player triggerDynamicSimulation false;
?
nope, players always trigger dynSim
It is possible to make your own dynamic simulation system that lets you exclude units from it
Keep in mind though, excluding pilots could mean they end up spotting and trying to engage AI that aren't being simulated, which would be bad
it works, but only if the player is in the passenger seat. But when the player enter the gunner the ai does not move
Do you think it's bc it's a humvee?
From the limited information you've given me so far, it seems most likely that the problem is the convoy. But I don't know much about the situation you're testing.
If you provide a minimal replication case then it's much more likely that I can find a working solution for you.
@still forum had someone recommend I reach out to you about this - having an unexplained issue while trying to run a script that has been used successfully before - it is now causing the entire game to crash. I've included the RPT and mission files in case you have time to take a look. The gist of the code is found in the introvideo file and is also pasted below. It is currently executed in the onPlayerRespawn file.
private _video = ["images\newsreel.ogv"] spawn BIS_fnc_playVideo;
0 spawn {
sleep 5;
hint "Scroll and press your use key (MMB, Enter) to skip the cutscene...";
};
player addAction [
"Skip Video",
{
missionNameSpace setVariable ["BIS_fnc_playVideo_skipVideo", true];
player removeaction _this#2;
},
[],
100,
true,
true,
"Action",
"_target == _this",
0
];
If anyone else has any ideas it would be greatly appreciated
That's a ridiculous modlist :/
mine?
When does it crash though? When the video starts or when you hit the skip action?
when you load in to the scenario after chooseing a slot
the modlist really isnt very intensive, its only a little over 60. And a good majority of those are very small.
It runs the video code at that point?
correct
So basically I have a task for the player to enter the 3rd vehicle in the convoy (there is 5 vehicles in total) and all five vehicles is connected to the 1st car. And once the player is in the vehicle and the task complete then the convoy is allowed to drive to their way point.
yeah good luck with that then. The convoy logic is just one layer of broken shit too many.
convoy logic is really borked in arma
especially if you use any AI mods
Ah, I deleted all my ai mods after someone pointed it out
It's busted in vanilla.
Should I use the convoy module?
I just avoid it personally and write my own monitor scripts, but that's a lot of work if you're just making a mission.
Ah ok, also is their any convoy mods I can use?
I don't know. I'd expect them to trip up with a player in the gunner/commander seat anyway.
as a super-dumb alternative you could consider not actually putting the player in the vehicle and having a camera follow it instead.
but if you want the player to fire vehicle weapons then that's not going to work.
Well it is what it is, I'll just keep the player as a passenger
Between the following methods what's the best way to do a bunch of simple objects that's JIP friendly:
- something in each object's init
- big long sqf that I have to manually generate and place
- Something in a gamelogic's init (using its position, maybe?)
X) something else I don't know about
the JIP friendliness is really important.
global simple object creation on the server
trying to set up mobile vehicle spawn points for multiplayer
i'm getting an error message from this init.sqf
trying to figure out what the problem is
when i start the server, i spawn in normally and i can hear game sounds and even move the vehicle i spawn in but i'm still stuck with the loading screen
this is what's inside the respawnmkr.sqf files
and the description.ext
So in, for instance, initServer.sqf?
here's the error message
missing ; in line 3, i guess i'm not sure where that's supposed to go
execVM not exec VM
setPosASL does network traffic, so having a for-loop moving an object with a bunch of SetPosASLs is a bad idea, correct?
I'm trying to figure out how to get around this.
Objects changing position causes network traffic.
Is there any way to smoothly move a non-physx object without that kind of spam?
In single player, it's easy to go "heehoo repeatedly bump the z coord 800 times"
that won't do at all for MP
It's not necessarily any worse than any other method of moving the object.
Aside from having it local everywhere.
thank you i will try this
If you use a correctly calculated setVelocity as well then it's less likely to jump if the network perf is bad. Same principle as setVelocityTransformation.
Bridges are problematic because they have low simulation rates.
IIRC you need to attach them to an object with higher simulation rate and move that instead.
....But does setVelocity actually do anything to non-physX?
Like say, a building.
I have never tried.
It probably does with airplane sim type.
but in this case it's the simulation type of the object you attached the bridge to that matters anyway.
Hmm. Something that won't fall back down would be key.
Hi!, im having a little confusion, i need to check that a group of ships(the names are "Bote1", "Bote2", "Bote3", "Bote4","Bote5", "Bote6", "Bote7", "Bote8") are destroyed, and that should finish the task, can anyone help?
if (!isServer) exitWith {};
[true, ["Objetivo", ""], ["Tarea De Ejemplo", "Tarea De Ejemplo", ""], objNull, "CREATED", 10, true, "rifle", false] call BIS_fnc_taskCreate;
private _boats = [];
for "_i" from 1 to 8 do {
private _boat = missionNamespace getVariable [format["Bote%1", _i], objNull];
if !(isNull _boat) then {_boats pushBackUnique _boat};
};
_boats findIf {alive _x} == -1;
// returns true if all boats 1-8 are destroyed
Hey I got an issue with a very simple crate config, not showing up in zeus.
this is the config:
class CfgPatches
{
class Pattys_Abilities
{
name = "Pattys Special Abilities";
author = "Patty (Design) & Tally (Code)";
requiredVersion = 2;
requiredAddons[] = {"A3_Functions_F", "CBA_settings", "A3_Supplies_F_AoW"};
units[] = {"PSA_resupplyCrate_F"};
weapons[] = {};
};
};
class CfgVehicles
{
class B_supplyCrate_F;
class PSA_resupplyCrate_F:B_supplyCrate_F
{
scope = 2;
scopeCurator = 2;
author = "Tally";
displayName = "[ABILITIES] Resupply Box";
class EventHandlers
{
init = "_this call PSA_fnc_initNoManCrate";
};
};
};
Anyone got an idea why it is not showing up in Zeus?
Make sure you have in game master module selected all add-ons (including unoffial ones).
You can unlock more using the Manage Addons module.
All addons (including unoffial ones).
Hmm, I have another addon already loaded that is unoficial, and it does show
uh
Ok
strange
It worked
Thank you
You're welcome
Good day. Is there a way to get all the file names inside the specified folder? We do have fileExists so some sort of file management is available I believe?
Do you mean folder in a PBO or?
addonFiles is the closest you can get without a mod
To get access to the real file system you need something like Pythia and write it in python. Or an extension.
Got it, thanks
how would I disable the V (vault) key in a keyHandler?
question, is there any reason:
mfresizeeh = addMissionEventHandler ["EachFrame", {player setObjectScale 1.15}];
doesnt work on the server, but works in SP?
In DS or local MP? If former no it won't because player is nobody there
What do you mean DS or local MP?
I also tried giving me or AI a variable and replacing "player" with variable, but still nothing happens
You may need wait until your unit is initialized .
I am confused by what do you mean?
where do you add current event
I am currently in zeus using Execute module to do it. Naming soldiers with "name" = _this; and executing the code globally
works with all other scripts like animation speed
Dedicated or you host your game
And you run that on the server?
I tried local, server and global
As I said make sure you're executing it in client computer
commands like setAnimSpeedCoef works no prob, no idea why setobjectscale does not want to play along
oh
but global should still do it
as global executes it well, on server and each client
in SP, it works fine
I will try local MP
Works fine in Local MP
Hm... π€
could there be some sort of limitations imposed by server? but if that would be true, than setAnimSpeedCoef wouldnt work
Honestly I've never heard DS doesn't support it. Probably it is an issue to have that command on live object though
I get it, but its weird
I will try KJW height mod, to see if that will works, but that is really less than ideal. I am really very confused
If I attach an object, it starts working, but I need to do it on live. Also if its just sim disabled it still doesnt work
Afaik it only works on units in 3den
If by "SP" you mean 3den SP it should explain why
KJW's mod should have a similar problem
It works in Editor and Local Multi
But doesnt work on Dedi
okay so as I see it, its impossible
shit
Dumb question but does anyone know how I can get into arma 2.18? do I need to pick a different branch on steam or how does that work? I'm on 2.16 right now
Right click on the game in Steam
Select Properties
Then go to Betas and select the development branch
uh on the website it said dev branch was 2.15 π€
I'm doing it now tho
but that was what I checked first, it said 2.15
THANK GOD FOR FAST INTERNET 11GB IN LIKE 20 SECONDS HAHAHA
Which site? Wiki?
My dev build shows 2.17.15
Correct, 2.17 is candidate for 2.18
Where's 2.15? 
...Wait
technically 2.15 doesn't exactly "exist" as 2.16 was but an update for the RF CDLC, everything was moved to 2.17/2.18
hmm the landAt command I was looking to see if would work doesn't actually work, you can't land a vtol aircraft on a helipad
I want to land an F-35b in VTOL mode in a given helipad, but as soon as I run that command, it automatically leaves VTOL mode.
Alright, can anyone tell me what I'm doing wrong here please?
28.8.2022 β Only helo AI pilot can land on helipad. VTOL are planes. They land at airport(s).
Just snippet from wiki.
You may have an issue because it's not an airport.
Yeah 2.18, sorry.
If you have dev branch on use , then you r
Apparently it's very bugging
alright so it doesn't actually work
Just tried with action and somehow it ups the gear if the camera is close to the plane, will lower it when it goes away
landAt example 2 is workaround you might want to use, it looks working, at least, seems to
which is fine, I use velocitytransformation to move stuff around cuz Arma is too brainless for it
BUT
I can't get a damn landing gear to go down on ai controlled planes
_id = addMissionEventHandler ["EachFrame", {
f35 action ["LandGear", f35];
systemChat str time;
}];
am I doing something wrong here?
As I said, it is buggy
i mean even without the landAt thing that doens't actually work
just getting the damn landing gear down
I mean without action but landAt
landAt doens't work at all for me, the f35 just goes to a near airport
See example 2 closely
what about this
_id = addMissionEventHandler ["EachFrame", {
f35 action ["LandGear", f35];
systemChat str time;
}];
What about what
What is landat example 2? you mean landat [helipad, "land"]?
This is a mission event handler that forces landgear down on each frame, still doesn't work
As I said it is buggy and it doesn't work, as I said, once again
It is Syntax 3 not Example 2
This one? Doens't work
_hpad = "Land_HelipadEmpty_F" createVehicle [0,0,0];
_hpad setPosASL _pos;
heli landAt [_hpad, "LAND"];
Just any landing pad, doesn't work for VTOL aircraft
That won't land as VTOL
I thought your goal right now is just let the gear down?
Yeah but that closes the VTOL fan nozzles and unvectors the rear nozzle too
I need to to have nozzeles down and landing gear down
imma test something
W...ell
I thought I could but now I can't with landAt
It is very whacky workaround even if it works, anyways
This one only works if I set the time acceleration to 2 or more haha
_id = addMissionEventHandler ["EachFrame", {
f35 action ["LandGear", f35];
systemChat str time;
}];
And there's no way to just force the animation?
No
if I do landat [helipad, "land"] it the landing gear works fine but then the f35 closes it's fan doors and stuff
stops vectoring
wait a second, if I'm far from the f35, it works perfectly fine lmfao
it lands perfectly
but if I'm super close
this is dumb af
Bumping this for visibility
that's a ticket, not scripting
Ded is not a big fan of being mentioned lol
I didnβt saw the rpt since im on my phone, but probably you have some problem with the video file, or something else is causing the crash
Thanks @winter rose ! Thanks @open hollow, I apreeciate the advice and heads up. The video file is in .ogv and runs fine otherwise, it's only 19mb.
I'll open a ticket, again I apreeciate the help guys!
@winter rose just to be clear, did you mean a ticket on the discord?
Is there a way to have a script to give an NPC a random (or one from a custom list) face? I am trying to do smth with compositions
setFace
Is it faster to execute code like _x in [a,b,c];, with the array being defined as a global variable or as a hardcoded array through preprocessor #define?
Preprocessor doesn't save your array so it gets recreated every time you invoke the macro
A variable saves your array and you just reference it
if its not a constant (numbers etc) then its almost always faster as a variable iirc
I wonder if it'd be possible to add a const keyword that does that for you on script compiling.
That would be nice
doubt the performance gains would be huge tbh
dont we also have compileFinal already? expanding that to other data types would be more realistic but i suppose we'll see what dedmen says
I mean it wouldn't be significantly better that declaring a global, but that's a bit of a faff.
Is there any particularly effective way how to optimize performance of various unit to unit checks, like visibility check, so that I donΒ΄t have to check all to all units every time, e.g. if they are too far away?
Hello everyone. I was looking at the Spaceship composition at Steam and tried my hand at its code and make everything local as possible for the players. I have finally arrived at this solution - https://gist.github.com/A3-Root/5e468fa49c56e199206e6f619f223fcf
The problem? The create and launch works FLAWLESSLY across all clients (all effects are good and works in sync) however, the "LANDING" causes a lot of desync to players (even if it is only rendered for them locally)
and by desync - I meant, the creation, subsequent landing of the created object, and the effects produced within as a result are all out of sync or does not work right out.
@timber shore you return true
Well, you can use inAreaArray to cut out far units.
{
if(_this select 1 isEqualTo 47 && myCondition) then {
true;
} else {
false;
};
}];```
RscMapControl was the one π
Busy right now, sorry
Hello. What is this? got from .rpt file
20:01:55 Performance warning: SimpleSerialization::Read 'PIG_opfLoc' is using type of ,'LOCATION' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types```
Is there a missing semi colon at the end of your first line?
It means you're saving something of type Location into a global variable (PIG_bluLoc)
And then you serialize it (e.g. saving game) which causes that error
You can try using a different type if possible (e.g. if you use the location for storing variables, use a hashmap instead, or if you use it for its position, use a marker/object/position instead)
Is it normal that adding laser targets enemies slows down the game a lot?
I have a script that adds laser targets to enemies so that airplanes can target them and drop bombs on them, for effective cas purposes.
But this slows down the game A LOT
So i have two questions
- Am I doing something wrong in the way I create laser targets and attach them?
- I could also optimize it, so for example, only attach a laser target to one target per group, and on death, this laser target gets unattached and attached to anew unit of the same group, or better yet and more cleanly, delete this laser target and create a new one attached to a new enemy of the same group, and if the group has no alive units left then delete the lazer. Basically only have one laser target per group. So, 10 squads that total 120 men only have 10 laser targets cumulative.
How many laser targets are you having at the same time?
count allMissionObjects "LaserTarget"
Well attaching is slow by itself
But I assume in this case it could be because the AI have too many laser targets to iterate over and check?
Good day everyone, I wrote this script which spawns a searching helicopter that patrols the area to detect the player, if it happens to fly too close over the player
using "knowsAbout" command it will give hint that it detected the player. What I want is try increase detection range to spot player further away, I tried "setSkill
spotDistance/spotTime" seems like they never really work. any suggestions?
_pos = [_patrolpos, 1000, 1200, 3, 0, 20, 0] call BIS_fnc_findSafePos;
_helisearch = createVehicle ["CUP_I_412_Mil_Transport_AAF", _pos, [], 0, "FLY" ];
heli_crew = createVehicleCrew _helisearch;
[heli_crew, _pos, 2500] call BIS_fnc_taskPatrol;
{_x setSkill ["spotDistance", 1];} foreach units heli_crew;
{_x setSkill ["spotTime", 1];} foreach units heli_crew;
heli_crew spawn { sleep 1;
waitUntil {{_x knowsAbout player > 0} foreach units _this};
hint "Caution! Enemies marked your location"; };
will the hint actually trigger?
yes, but has to be very close
oh ok i dont really understand the code, foreach in condition? i think you are also missing } at the end
plus you are doing "units _this" when the _this should already have the heli_crew
sorry i forgot to put that here in the chat
np
Your waitUntil waits for last unit to know about player
You probably wanted this: units _this findIf {_x knowsAbout player > 0} >= 0
thanks also works, but still detection range seems unchanged, i tested 2 times
i guess thats another "welcome to arma 3 AI"
could be the helicopter itself, its sensors and such
Try changing group behaviour so they search better?
heli_crew setBehaviour "AWARE"
heli_crew setCombatMode "RED"
Something like this
the only solution i found so far is creating more units in heli cargo group to be able to spot from all sights and it worked detecting from further distanceβ
Well, I'm doing a PVP scenario. Is this going to be a real problem? Because so far is working nicely
afaik no
looking for some help.
I am trying to use the script of CfgUnitInsignia to add a patch to everyone and have done the description.exe settings, but i am missing something.
I added the [this, "NAME"] call BIS_fnc_setUnitInsignia; to a person on the Init area, but there is no insignia.
Any help?
this is what i am using
{
class 111thID
{
displayName = "111th Infantry Division"; // Name displayed in Arsenal
author = "Bohemia Interactive"; // Author displayed in Arsenal
texture = "\A3\Ui_f\data\GUI\Cfg\UnitInsignia\111thID_ca.paa"; // Image path
material = "\A3\Ui_f\data\GUI\Cfg\UnitInsignia\default_insignia.rvmat"; // .rvmat path
textureVehicle = ""; // Does nothing, reserved for future use
};
};```
But I am not understanding the material line. I have made the patch, 128x128 saved as paa and named it. updated the script, but not sure where to go from there
111thID is the name you need to use in script
so that is for the standard one right. but the class name needs to change to the new insignia?
className is always used to fetch/refer in anywhere, so yes
so if i am understanding:
The image goes in the mission folder
The discription.exe has the above code with the following changes - 1) class "testpatch" 2) texture is the path of the patch
Then i need to put something in the init section on the players? or somewhere else?
It's Description.ext not discription.exe
Yes and yes if you do it correctly
ok thanks. i will take a look at it again.
how do i make it so dynamic sim AI are only triggered my trigger/executing a script?
not by player proxomity at all, but only by script
Use enableSimulation / Global to manage them rather than the dynamic simulation system
48 or so
This is what I was thinking actually
Alternatively, I could have an AI controlled UAV that is marking targets with its laser designator, but then all planes in the vicinity would be targeting the same laser target no? Which is fine if we have a couple fighters in the air, but in my mission I have 16 fighters at a time (carrier based mission).
Making a UAV loiter in a designated area is ezpz, but make it target a specific unit and "firing" the laser designator might be complicated given how ai doesn't like targetting and firing manually through scripting, so not sure if I wanna go down that rabbithole.
Is there any other better way to achieve this - break from a spawned loop in a single frame? I want to make sure that the exit condition does not change. I donΒ΄t like it much, because it reminds me of goto jumps in code execution.
spawn {
...
while { _condition } do
{
scopeName "while";
isNil {
_units = units _group select { alive _x };
if (_units isEqualTo []) then { breakOut "while"};
};
...
For frame by frame precise stuff, use the cba frame functions.
plus, why do you need your scheduled thing to be frame precise anyways, what is the context?
I am doing some things with the AI, detection, forgetting, etc. Sometimes I do condition checks, and perform actions based on those conds. If the execution of a schedule code pauses, the condition might not be valid anymore at the time of the action, thus breaking my state machines - freezing, looping infinitely etc.
question. I got this to work, but only on certain uniforms. is there something specific that is happening or i need to do for mods that we use for uniforms?
No, the uniform may not support it
Backpack can do a retexture, but they most unlikely have insignia selection
then you should be using different namespaces to save states then, instead of local variables
That is a good point, I probably need to think this throug a little more, although, I do store states in a separate namespace, but this function is basically the point, where I do all the checks to know whether to change the state or something, then this function can be halted, and reinstantiated again when the state goes back.
I need to use sleeps in this loop, so I need do desync/spawn the code, but then I have to sync it back again somehow, and this it the critical point.
do you need to sleep it though? 
It is basically a timer with conditions.
Wait, check, add some time and repeat, or don't add and exit.
wait could this help me force landing gear down on ai controlled planes?
did you already do the each frame handler method mentioned on the wiki?
yeah, don't think this will do much otherwise huh?
Each frame mission event handler only works if you're "far" for the plane you're forcing gear down from. If you get close I guess the simulation gets higher priority.
There a function to lower the turn speed of a player/unit
Anybody had a need for something like selectSum alongside selectMin and selectMax?
Maybe applySum so you can both modify values and sum at once
Muh syntaxic sugar 
_r = ropeSegments r select 1;
[
_r selectionPosition "start"
,_r selectionPosition "end"
,_r selectionPosition "start" vectorDistance (_r selectionPosition "end")
,_r modelToWorldVisualWorld (_r selectionPosition "start") vectorDistance (_r modelToWorldVisualWorld (_r selectionPosition "end"))
]
```=>
[
[2.23517e-009,-3.26703e-009,0.0154323]
,[2.23517e-009,-3.73551e-009,0.292284]
,0.276852
,0.426513
]
I don't get it, shouldn't these distances be the same?
r is a proper rope with all segments
Thought its the scale, but in my case getObjectScale _r => 1.20666, but 0.276852 * 1.20666 is 0.334066, nowhere close to 0.426513
even if I multiply by scale twice 
Just nag Ded
wlen is modelToWorld length, mlen is length between selection positions
No idea what kind of magic is going on with the ropes
Maybe they're scaled in XYZ and getObjectScale returns average or something?
My guess: Ropes are scaled by Y only and getObjectScale for them returns average of all 3 components so you end up with lower number
@still forum Can you please take a peek at what getObjectScale does for rope segments?
0.426513 / 0.276852 = 1.54058 is real scale
(1.54058 + 1 + 1) / 3 = 1.18019 is sort of close to getObjectScale of 1.20666
Maybe it also scales by XZ a bit too
GIB getObjectScaleArray
Probably something more complex
ropeLength returns 0 for segments, maybe it can be modified to return real segment length
Does BoundingBoxReal change? Maybe you could do some basic trig to extract length if it does
Nope, its static just as selectionPosition
I would use waitUntil instead, it's easier to breakout from, in my taste, and it is executed once per frame in worst case scenario:
spawn {
...
waitUntil {
//sleep 0.1;//Optional delay
if (call _condition) exitWith {true};
_units = (units _group) select { alive _x };
if (_units isEqualTo []) exitWith {true};
...
false
};
...
There is some engine model transformation magic going on under the hood it seems
Also β€οΈ Cortex Command
Hell yeah
Anyone know what BIS_fnc_playEndMusic actually plays?
Description:
Play mission end music (when it is nearing the end)
What, specifically is the "mission end music"?
try and thou shalt see?
Wasn't sure if it would work for me. Winning side needs to hear one track. Losing hears another.
You can open functions in the Functions Viewer from the Editor Tools menu to see what they actually do
Learn something new everyday.
It plays one of eventtrack01_f_epa and eventtrack01a_f_epa, randomly selected. There is no side distinction.
Thanks. For both.
BIS_fnc_endMission plays different music depending on the isVictory argument btw
Any ideas on how or if it's possible to snap and wrap a texture to sea level rather than to terrain level? Similar(ish) behaviour to the oil spill as regardless where the actual object is placed, it will snap to the terrain
What you refer to is called a decal but it doesn't snap to water
You can probably make your own custom texture object and break it into a grid shape and move each point vertically to match the water surface but it's not a nice solution (also idk if it actually works)
Fair enough, cheers
How do I intepret the performance output:
0.135646 ms
Cycles:
7373/10000```
Does it meant that 7373 cycles took 0,13 ms to execute, or that one cycle took 0.13 ms? And why does it try specifically 10000 cycles? Thanks
0.135646 total
One took 0.13ms
Array format [duration, cycles], where: duration: Number - average duration of 1 execution in milliseconds cycles: Number - actual number of cycles executed
https://community.bohemia.net/wiki/diag_codePerformance
10k is for the sake of averaging
I am trying to estimate how much it takes from my per frame or per second CPU time budget.
Is there any way to tell?
use arma script profiler for a full frame by frame analysis. if you are running your current thing every frame, you should optimize it to be much faster than what you have above
I donΒ΄t know where to start with this, is it an official tool or what? π
not official, but its a project dedmen made. its on the workshop and you'll need the intercept sqf to c++ mod as well
I would like to run it around 5 times per sec or similar.
then if you do it with CBA_fnc_addPerFrameHandler set the delay argument to (1 / 5)
this is sort of what the profiler looks like:
this is for instance, a very heavy frame (frame during init phase of the mission)
this would be a normal frame + some of my things going per frame (this is the start of a single frame, 600 micro seconds in)
it will tell you a bunch of info of your current frame handlers
Thanks man.
Sup everyone! So i made some custom buildings that you can enter and get teleported to a custom construction way up in the sky so you would not be able to see it from normal map. the problem is, every time that i teleport the player up he changes to the halojump animation and spawns laying on the ground rubbing his belly LOL.
I tried this:
_handlerIndex = _player addEventHandler ["AnimChanged", {
params ["_unit", "_anim"];
Diag_log format["ANIMATION: ", _anim];
if (["halofree",_anim] call Bis_fnc_instring) then {_unit switchMove ""};
}];```
and also tried this:
```_player playMoveNow "AmovPercMstpSrasWrflDnon";
_player playMove "AmovPercMstpSrasWrflDnon";
_player switchMove "AmovPercMstpSrasWrflDnon";```
none seem to work, do you guys have any idea to prevent this?
@fair drum suggested the second one, but did not work
i am using exile btw
dont know if that matters
damnnnnn i must have missed the creation of that command
awesome! can that be ran to a specific player, right? so it only affects the teleported player, and not others
Should be
testing now
also, this is what I meant. the halo animation happens so fast but still takes more than 1 frame (> 1 frame but still small enough it goes in a blink of an eye, can't use CBA_fnc_execNextFrame in this instance). you get around this by adding a slight delay:
[] spawn {
player setPosASL [0,0,100];
sleep 0.1;
player switchMove "AmovPercMstpSrasWrflDnon";
};
what do you have so far, i'll log in and see what i can do
works fine for me
i have everything, its just this animation problem and some detailing that is missing
wanna join voice?
i can show it
yeah i can hop in a second
Hi! im trying to make a mission for a multiplayer server. i want to check if some task are completed, and if they are call a BIS_fnc_endMission with the blufor winning and opfor loosing, how should i make it? someone can direct me to an example?
how familiar 1-10 are you at scripting; what method are you using to set your tasks completed?
Solid 5. my mission is something like this:
[west,["trigger", ""],["missionDescription", "missionName", ""],getMarkerPos "MK1","CREATED",10,true,"destroy",false] call BIS_fnc_taskCreate;
repeat for all tasks and for each side(so the west gets a compled and east a destroyed.
my mission has triggers to check if the objetives are completed.
i have formated text with colors and linebreaks but the function only accepts string - is it possible to send formated text as string but still produce the text colors and linebreaks i want it to?
Method 1 (since you are already using triggers), Using 2 Triggers and 2 sets of win/loss debriefings for each team:
Both are server only triggers
// BluforVictory Trigger
// Condition
[
"blufor_task_1",
"blufor_task_2",
"blufor_task_3"
] findIf {!(_x call BIS_fnc_taskCompleted)} == -1
// Activation
["bluforWin", true, true, true, false] remoteExec ["BIS_fnc_endMission", west];
["opforLoss", false, true, true, false] remoteExec ["BIS_fnc_endMission", east];
"serverEnd" call BIS_fnc_endMission;
[BluforVictoryTrigger, OpforVictoryTrigger] apply {deleteVehicle _x};
// OpforVictory Trigger
// Condition
[
"opfor_task_1",
"opfor_task_2",
"opfor_task_3"
] findIf {!(_x call BIS_fnc_taskCompleted)} == -1
// Activation
["opforWin", true, true, true, false] remoteExec ["BIS_fnc_endMission", east];
["bluforLoss", false, true, true, false] remoteExec ["BIS_fnc_endMission", west];
"serverEnd" call BIS_fnc_endMission;
[BluforVictoryTrigger, OpforVictoryTrigger] apply {deleteVehicle _x};
what do you have so far, and what commands are you looking to use
private _smsmessage = formatText["%1%2%3%4%5","<t color='#ff0000'>Person 1:</t><t color='#ffffff'>wazzap homie watchu doin?</t>", lineBreak, "<t color='#ff0000'>Person 2:</t><t color='#ffffff'>Gfucking dying</t>", lineBreak, <t color='#ffffff'>Call disconnected</t>"];``` this is my formated text i want to display with linebreaks
Not possible, strings are just letters, no meta data. Few commands treat \n as line breaks though.
What function do you want to use anyways?
im trying to use this https://github.com/zen-mod/ZEN/blob/master/addons/modules/functions/fnc_addIntelAction.sqf but i am open to other functions that can print the same in multiple lines with colors for all players
Vanilla addAction supports formatting, something tells me hold action and ACE menu should too
title: String - title of the action shown in the action menu.It can contain Structured Text tags, such as <t color='#FFAA00'>text</t>
oh ok i will look into that
but is there a function that can add my messages to the briefing / intel / anyother place for people to read?
Can't advise with that, I like to re-invent the bicycle all the time myself
the function you mentioned only allows structured text during hold not after to store so my big problem is with storing it someplace for people to read as in a conversation
Oh I thought you had problem with action title not being formatted
[QGVAR(addIntel), [_title, _text], _targets] call CBA_fnc_targetEvent; can't get where this addIntel function is 
is it not _fnc_addIntel right above that line?
This line is right inside of it, and its a local variable
lol I didn't even notice you HAVE to be logged to search on github
I didn't even read the message and thought search found nothing
yea github made it so unless you login you cant search code :/
would this work? https://github.com/zen-mod/ZEN/blob/131eeb35d478039f3f523f4eb447648e7342a458/addons/modules/functions/fnc_moduleCreateIntel.sqf#L121
Its a wrapper for createDiaryRecord
It takes STRING and turns it into TEXT by itself
Replace lineBreak with "<br/>", formatText with format
Thank you Microsoft, very cool
ok formating works except for the color
should be managable thanks a lot β€οΈ β€οΈ
alright, looks like i might have to go down this road. whats the major order of things?
- Add
FiredManto relevant units (players, bots if they can damage your reactors - Send each relevant projectile into a function that initializes it
- That function should add
SubmunitionCreatedandHitExplosionandHitPartto the projectile SubmunitionCreatedsends new projectiles into same function above so all submunitions are tracked- You track damage in
HitExplosionandHitPart, projectile event handlers work properly in 2.16 unlike entityHitPart
Unlike HitPart on targets (entities), HitPart on projectiles only triggers for direct hits
Depending on your damage tracking you might want either HitExplosion or HitPart or both
Trying to play music during my mission outtro. Everything except the play music works. Anyone know what I am doing wrong?
{
private _playerSide = side _x;
private _playerID = owner _x; // Get the player's ID
if (_playerSide == _winningSide) then {
titleText [_endingWinMessage, "PLAIN", -1, true, true];
// playMusic ["LeadTrack01_F_Bootcamp", 132];
["LeadTrack01_F_Bootcamp", 132] remoteExec ["playMusic"];
} else {
titleText [_endingLoseMessage, "PLAIN", -1, true, true];
//playMusic "BackgroundTrack03_Fο»Ώο»Ώ_EPC";
["BackgroundTrack03_F_EPC"] remoteExec ["playMusic"];
};
} forEach allPlayers;
Try "BackgroundTrack03_F_EPC" remoteExec ["playMusic"];
and for other RE with playMusic too
Fired:
_shot setVariable ["reactors_hit", []];
_shot call initShot;
SubmunitionCreated:
params ["_shot", "_subshot"];
_subshot setVariable ["reactors_hit", _shot getVariable "reactors_hit"];
_subshot call initShot;
initShot:
params ["_shot"];
_shot addEventHandler ["SubmunitionCreated", ...];
_shot addEventHandler ["HitExplosion", ...];
_shot addEventHandler ["HitPart", ...];
HitExplosion
params ["_shot", "_target"];
if(_target is your reactor) then {
if(_shot getVariable "reactors_hit" pushBackUnique _target >= 0) then {
//Your reactor was hit by this projectile for the first time
};
};
Similar stuff in HitPart, you can also do more checks like distance from explosion to reactor, hit parts if you only care about precise penetrations, etc.
gotcha, will start working on it
Sadly there is no way to know exactly how much damage engine is going to make to decide if shot was good enough to be considered a damaging hit, you'll need to estimate it
Same "reactors_hit" array is passed from shot to submunitions so you don't get twice the damage from RPG and its penetrator for example
Up to you to decide how to track the damage
Also do some class checks inside Fired to not to track irrelevant shots like bullets and such
yeah just needed a way to get that projectile first hit, was pulling my hair out the handleDamage on server way earlier
FiredMan is vastly superior to Fired, use that instead
getOrDefaultCall is the best choice for fast cached checks
FiredMan:
private _class = _this select 4;
if(isShotRelevantCache getOrDefaultCall [_class, {
//List of classnames checks, config value checks, etc.,
}, true]) then {
// Track the shot here...
};
```and
```sqf
isShotRelevantCache = createHashMap;
```somewhere
Once I grab the shot from the client, should I pass it to the init and calculations to be done on the server? or calculate it all locally and send the result to the server?
You'll need to do everything on client and only send the result to server
Because some shots aren't global, by the time shot entity broadcasts to server it can already by dead, etc.
for placed explosives that do not have a direct projectile, use HitExplosion? all the others (rockets, bullets, etc) use HitPart?
Up to you, you could use both for everything
HitExplosion will trigger even for slightest splash damage though
Same with HitPart, will trigger even for non-penetrating shots
Client Unit:
#include "script_component.hpp"
params ["_unit"];
if !(local _unit) exitWith {};
_unit addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
if (isNil QGVAR(Carrier_Reactor_RelevantShots)) then {
GVAR(Carrier_Reactor_RelevantShots) = createHashMap;
};
if (GVAR(Carrier_Reactor_RelevantShots) getOrDefaultCall [_ammo, {
private _simulation = getText (configFile >> "CfgAmmo" >> _projectile >> "simulation");
private _valid = _simulation in ["shotMissile", "shotRocket", "shotBullet", "shotMine", "shotGrenade"];
!_valid
}, true]
) exitWith {};
_projectile setVariable [QGVAR(Client_Reactor_Shot_ReactorsHit), []];
_projectile call FUNC(Client_Reactor_ShotInit);
}];
Client Shot:
#include "script_component.hpp"
params ["_projectile"];
_projectile addEventHandler ["HitExplosion", {
params ["_projectile", "_hitEntity", "_projectileOwner", "_hitSelections", "_instigator"];
if !(_hitEntity in GVAR(Carrier_AllReactors)) exitWith {};
if !(_projectile getVariable QGVAR(Client_Reactor_Shot_ReactorsHit) pushBackUnique _hitEntity < 0) exitWith {};
private _simulation = getText (configFile >> "CfgAmmo" >> _projectile >> "simulation");
[QGVAR(Carrier_Reactor_HandleHit), [_hitEntity, _simulation]] call CBA_fnc_serverEvent;
}];
_projectile addEventHandler ["HitPart", {
params ["_projectile", "_hitEntity", "_projectileOwner", "_pos", "_velocity", "_normal", "_components", "_radius" ,"_surfaceType", "_instigator"];
if !(_hitEntity in GVAR(Carrier_AllReactors)) exitWith {};
if !(_projectile getVariable QGVAR(Client_Reactor_Shot_ReactorsHit) pushBackUnique _hitEntity < 0) exitWith {};
private _simulation = getText (configFile >> "CfgAmmo" >> _projectile >> "simulation");
[QGVAR(Carrier_Reactor_HandleHit), [_hitEntity, _simulation]] call CBA_fnc_serverEvent;
}];
you forgot submunitions
i wasn't thinking that I wanted to track those
You could also send other relevant info like distance from hit to reactor, classname, etc. to server instead of just simulation
There are some shots that instantly turn into submunition after firing
I think Ghosthawk side miniguns, they turn into submunition few meters after flight
Also your simulation check is case sensitive
private _damage = call {
if (_simulation in ["shotMissile", "shotRocket"]) exitWith {GVAR(Carrier_ReactorHP) / 8};
if (_simulation in ["shotBullet"]) exitWith {GVAR(Carrier_ReactorHP) / 1000};
if (_simulation in ["shotMine"]) exitWith {GVAR(Carrier_ReactorHP) / 4};
if (_simulation in ["shotGrenade"]) exitWith {GVAR(Carrier_ReactorHP) / 30};
0
};
private _reactorCurHP = _reactor getVariable [QGVAR(Carrier_ReactorHP), GVAR(Carrier_ReactorHP)];
_reactorCurHP = _reactorCurHP - _damage;
_reactor setVariable [QGVAR(Carrier_ReactorHP), _reactorCurHP, true];
LOG_1(SCRIPTNAME + "Reactor Taken Damage: New Damage: %1", _reactorCurHP);
currently iternally I'm doing this... which reminds me, I need to send the server the hit reactor as well
shotbullet won't register for example
I just went after the case sensitive config entries for every ammo and wrote them down
Some mod could have it in different casing
but i'll add a case change in there just in case
There are examples of BI messing up casing too
Engine doesn't care about simulation string casing so you shouldn't either
Looks like there aren't any simulation name casing differences in vanilla
Still, engine allows any casing, some mods might have it
yeah, I've seen it.
If there is any scope for casing screwups then you can guarantee that at least one major mod does it :P
@meager granite how do you handle placed explosives? I can't seem to get them to register with this method. At least on the "Land_Device_disassembled_F" class. It picks up when I blow my own character up though.
10k is the maximum number of cycles to try in 1 second
If it exceeds 1 second it stops running a new cycle
For example in this case it stopped at 7373 cycles because 7373*0.135646 becomes greater than 1 second
As a safe estimate make sure your code doesn't go beyond 1 ms per frame in the worst case (you also have to consider the stuff the game and other mods do)
(for example if you intend to run that code for 10 units in a loop it's ok-ish but not for 100 units)
Also I'm assuming you're talking about unscheduled environment
In scheduled environment a slow code doesn't slow down the game (unless you run a slow "chunk" of unscheduled code) but it takes longer to finish
Don't ask to ask or wait someone to get your answer
he told me to come back to him later
are you able to help me with extdb3 for amra 3 server database?
i have it set and running but is saves data locally to .vars not to a db on my server
No but just post your Q. Nikko or I am not the only ones who can answer
is anyone able to help me with extdb3 for amra 3 server database? i have it set and running but is saves data locally to .vars not to a db on my server. Somthing has caused my server to imprint a bad local db save to the players .vars file causing the scripts on my server to not run for select players. I know it is in the .vars because when i told them to delete it, it worked. A few joins later the server re-imprints on their profile making the scripts no longer run again for select players out of random. what do i do
Satchels are very wonky with damage, try on flat terrain instead of carrier?
hello
if (!isServer) then {
tp_1 addAction ["Teleport MenΓΌ ΓΆffnen", {
private _player = _this select 1;
_player createDialog "TeleportMenuDialog";
}];
};
```and
```sqf
Im too stupid, where is my bug? it says "missing ;" on _player createDialog "TeleportMenuDialog";
https://community.bistudio.com/wiki/createDialog is unary command, no left operand
save _player into global variable or get display from createDialog with alt syntax and setVariable it there.
tried that. Didn't seem to work.
6:58:26 Error in expression <playmusic>
6:58:26 Error position: <>
6:58:26 Error Invalid number in expression
6:58:26 Error in expression <playmusic>
6:58:26 Error position: <playmusic>
6:58:26 Error GIF pre stack size violation
and that is after I removed the "start from" time. I need the song to start at 132 seconds in or 2:12.
private _playerSide = side _x;
private _playerID = owner _x; // Get the player's ID
if (_playerSide == _winningSide) then {
titleText [_endingWinMessage, "PLAIN", -1, true, true];
// playMusic ["LeadTrack01_F_Bootcamp", 132];
"LeadTrack01_F_Bootcamp", remoteExec ["playMusic"];
} else {
titleText [_endingLoseMessage, "PLAIN", -1, true, true];
"BackgroundTrack03_F_EPC" remoteExec ["playMusic"];
};
} forEach allPlayers;```
also forgot how to format sqf on discord. apologies.
thx prisoner
```sqf
Your code here
```
Sure you don't have some weird unicode characters there?
Also you have a comma after music name string
ok. getting coffee. will test. that was big dumb on me.
what about the start time? do I need to bracket that?
Good day. Sometimes in SP (in the East Wind for example) we get on-screen messages looking right from Task Framework. But they are not tasks - just some hints like 'go further and patrol will start'. What is the command/function for them?
this https://community.bistudio.com/wiki/Arma_3:_Notification ? (just a guess)
Ah, yes yes, that's it. Thanks a lot 
just tested:
"LeadTrack01_F_Bootcamp" remoteExec ["playMusic"];
[["LeadTrack01_F_Bootcamp", 132]] remoteExec ["playMusic"];
and just to be safe
[["LeadTrack01_F_Bootcamp", 5]] remoteExec ["playMusic"];
no error, no music plays in any. /shrugs
["LeadTrack01_F_Bootcamp",132] remoteExec ["playMusic"]```?
tried that yesterday. that was my 1st attempt. just tested again for posterity. No music plays, no error.
Do you have your music volume above 0 in your settings?
yes. i have intro music. it works, however I set that up to run once on the first player respawn in onPlayerRespawn.
ah, that might be that then
are you sure the code triggers?
Yes.
{
private _playerSide = side _x;
private _playerID = owner _x; // Get the player's ID
if (_playerSide == _winningSide) then {
titleText [_endingWinMessage, "PLAIN", -1, true, true];
["LeadTrack01_F_Bootcamp",132] remoteExec ["playMusic"];
} else {
titleText [_endingLoseMessage, "PLAIN", -1, true, true];
"BackgroundTrack03_F_EPC" remoteExec ["playMusic"];
};
} forEach allPlayers;
TitleText shows.
ok (worth checking π)
Definitely.
Just tried playMusic ["LeadTrack01_F_Bootcamp", 132]; without any conditions, no music. I'm gonna give up on this for now.
try ```sqf
playMusic "Defcon";
nada.
soooβ¦ you apparently have music issues π ?
Apparently. Tried storing some of the stuff globally and then remote executing "endMusic.sqf" on each client. Same thing. Wondered if it had anything to do with the endMission camera stuff, so moved it to execute in my scoring function, same deal, no dice.
[["LeadTrack01_F_Bootcamp",132]] remoteExec ["playMusic"]
@stuck palm
tried that.
there's something weird going on. playMusic ["LeadTrack01_F_Bootcamp", 132]; works fine in debug local exec
I just tried it ant it works
btw, you remoteExec forEach allPlayers π
here
Try if
_player = _x;
[["LeadTrack01_F_Bootcamp",132]] remoteExec ["playMusic",_player];
(and don't use _playerID)
Hello. Is there other way to remove the respawn counter after killed/forced respawn? This option seems to only remove the scoreboard.
Thanks, yeah, I am trying to write a detection mechanism, I did some benchmarks, 1 player * 50 AI units, at the rate of 5 times per sec. FPS dropped from 100-77. Or no drop but stuttering was noticeable. I might let it run in the scheduled evn., but this way it would get unpredicatable.
Found a workaround
_seg = (ropeSegments testrope select 3);
[vectorMagnitude vectorSideVisual _seg, vectorMagnitude vectorDirVisual _seg, vectorMagnitude vectorUpVisual _seg]
``` => `[1,1,1.54066]`
measuring orientation vectors yields 3d scale
And multiplying model distance by vector up magnitude produces real rope segment length
God damn Arma requires days of R&D to get anything done
Wont post this on wiki, let people suffer 
Does anyone know if itβs possible to cause people to lose blood in ACE after someone takes morphine? Someone in my unit wants to make a βtainted medical suppliesβ op and I have no idea how to code this for them.
_unit setVariable ["ace_blood_volume",_unit getVariable ["ace_blood_volume",6]-2];
its probably ace_medical_blood_volume though
Where can I find BI's FSM files in Arma 3?
Missing , after ]
It might, rn Iβm stuck on causing the blood loss. Once that is solved I need to make it after like an hour or so it applies it
no im not
Like very very specifically morphine
Check config dump, search for .fsm
Otherwise unpack addons and search for *.fsm
True. Too much in one array for me π€
im simply too kjwpilled
This makes sense but Iβm not sure how to make it apply after some uses the specific item. Technically speaking itβs the units custom painkillers he wants it to apply to, but if we can apply it to morphine specifically I should be able to change the class name so it does it to the painkillers
cba event handler
Sorry if Iβm asking alot but how do these work? The GitHub is confusing me
look at the cba docs
Ty!
Is there a way how to make a specific AI unit/group ignore another single enemy unit?
probably forgetting on frame
i vaguely recall some command proposed for that specifically but idk if it came to be
Currently I use repeated forgetting, but it has its side effects for my case.
Would love to know any other options.
It's not out yet:
wiki be like has a page called "How to do X"
you open it and it be like
"todo"
nope. might have to track satchels the old handle damage way