#arma3_scripting
1 messages ยท Page 770 of 1
Okay! Thanks a ton! I'll experiment with that and try to understand it.
hideSelection is for simple objects only
and you can't hide the wing
yep already done that
not hide the wing, I want to hide everything but the wing
is it possible?
which one of these types of LODs:
"Memory" "Geometry" "FireGeometry" "LandContact" "HitPoints" "ViewGeometry"
is responsible for the wings?
so that I can hide all selections except the wings?
I doubt it. but you can try using setObjectTexture too (if it's not super simple)
well
I tried that, it does hide the main hull, but the wing's texture is a part of the bomb bay doors, tail etc
I don't think there's a "wing" selection for any aircraft in the game
well that's not a problem
what is the selection that the wing is a part of?
you can try hiding all selections to see if the wing is affected
it does get affected
tried that and it got hidden along with every part of it (elevators, slats, flaps etc)
what I mean is I don't think the wing is a stand alone selection, so it's probably getting hidden together with the body
but I'm not sure which type of these LODs is responsible for body parts, like memory does nothing when all of it is hidden, same for Geometry and LandContact and Geometry
yeah I'm aware thats not a problem, I will be placing the aircraft inside a bigger object, I'm just trying to give an object "wings"
so it will be only the wings protruding
that is my problem, I don't know which type is responsible for body parts
because all of these mentioned have not effect on the body parts of the aircraft?
turning them true or false with hideSelection does nothing
I think this is a problem for me...
"Using publicVariable too frequently and/or with a lot of data can cause other aspects of the game to experience bandwidth problems."
I'm going to be essentially spamming this thing...
like I said many times they're all together. the wing is not separate from the body
they make a whole
Thanks!
is the wing not a part of the hull??
because flaps and elevators are their own things
use https://community.bistudio.com/wiki/BIS_fnc_getServerVariable to download the variable to the client locally, be sure to place it in scheduled environment
because through my testing, the wing seems to be a part of the hull (the middle section of the aircraft, not including the tails and cockpit and nose and engines etc)
Hi guys, can I control VTOL plane vectoring by script?
for players only yes
AIs I don't think so
there's also a down version
well yeah that's what I mean
if you hide the "hull" the wings are gone too
so you can't have just the wings
alright thats not a problem, I will not hide the hull
but which one of these types of LODs:
"Memory" "Geometry" "FireGeometry" "LandContact" "HitPoints" "ViewGeometry"
I can use to find the name of the hull selection (to not hide it)?
it's none of those
what you want is part of the res lod
how would I obtain that?
is there a command or do I need to go to the config etc?
allLods
you don't need that tho
you just need LOD res 0 (or 1)
LODresolution that equal 0?
you mean index 1?
just use obj selectionNames 1
https://community.bistudio.com/wiki/LOD_resolutions
is that geometry?
so 1 is the closest LOD (and 5 is for far away objects?)
yes but that doesn't matter
just use 1... 
or 0
whichever exists
alright thanks lol
very appreciated
if you want my advice, just make a loop that goes through all lods (using the allLods command), grabs their selections, and hides and unhides them one by one (with a 1-2 second delay so you can see what's happening)
then see which ones can be hidden and save their names
yeah I had one which scans all selectionnames and hides them with 2 seconds delay, but unhiding them is clever, I will do that thanks
Hmm, I'm expected function like _vehicle setVTOLAngle _angle, but thanks, that's also good point
Still holding out hope that someone can help with getting these respawn templates sorted out. Any info is appreciated.
Apparently it just requires "MenuPosition". Slightly aggrivating, but I'll live.
Hey, does anyone know if its possible to change the slipperiness of a road or specific material type on the fly? or can it only be done through the map source.
I'm not really sure if there is a command to do that, but you can always use setVelocitySpaceModel to fake it
Is there actually a way to play a video on a TV screen or advertisement board?
Is there a known way to turn off flyInHeight, like with -1?
Hello, I need some help please.
Basicly I want to make a script for the A3 "Praetorian" (https://community.bistudio.com/wiki/Arma_3:_CfgVehicles_WEST#B_AAA_System_01_F) and i want him to shoot randomly in the sky.
But I start with this command and it's doesn't work :
panpan forceWeaponFire ["weapon_Cannon_Phalanx", "Single"];
If anyone can tell me a tips or something like that, thanks in advance.
||Sorry for my english, I'm French x)||
weapon_Cannon_Phalanx doesn't have a "Single" fire mode
Your options are "manual", "close", "medium", and "far"
Where dire you fund that ?
In the Editor:
Tools menu > Config Viewer > double-click CfgWeapons in the left list > double-click weapon_Cannon_Phalanx in the left list > scroll to modes[] in the main panel
By the way, forceWeaponFire only causes one "pull of the trigger". In order to create a realistic sustained burst, you'll need to run it several times in close succession.
Does anyone know if there is a way to unitcapture a car/tank and have the wheels/tank tracks move? When I do a unitcapture/unitplay on it the wheels are static.
no way, all the function does is just https://community.bistudio.com/wiki/setVelocityTransformation
you can maybe do your own one and try to make them move somehow 
i don't know how wheel animations are handled exactly, i'm assuming you can get the current rotation via some animationXXX command and include that with the data
Is it essential that it's done that way or can you use a series of "domove" with very precise locations to get what you want?
I just need a car to drive down the road without the AI doing their usual bad driving.
I was told by another that setdriveonpath might work?
Try experimenting with doMove and see if you can get what you want.
I've never heard of this, but it sounds good!
It isn't though :P
It has very weird waypoint-transition behaviour.
So if you give a driver a path along a road, it'll just try to cut the corner through a building.
hello, do cfg function tags get inherited?
class CfgFunctions {
class IRN {
class preInitCat {
preInit = 1;
kitten1{};
kitten2{};
};
};
};
would kitten1 and 2 inherit the preinit flag?
idk what im doing wrong here?
21:24:58 Error in expression <do_movclass CfgFunctions { class IRN { class p>
21:24:58 Error position: <CfgFunctions { class IRN { class p>
21:24:58 Error Missing ;
21:24:58 Error in expression <do_movclass CfgFunctions { class IRN { class p>
21:24:58 Error position: <CfgFunctions { class IRN { class p>
21:24:58 Error Missing ;
class CfgFunctions {
class IRN
{
class preInitCat
{
file = "IRN\functions\preInitCat";
class kitten1 {
preInit = 1;
};
class kitten2 {};
};
};
};
you need to specify class
wdym?
class kitten1{};
that didnt fix it.
did you put this in a sqf file?
in a cpp thats being included in the description .ext
so before that, you are missing a ; closing a previous class
well there is nothing else tho ๐
Its an empty mission with minimal mods
before the include
let me test again
what
this is my description.ext as it is right now:
author = "IR0NSIGHT";
onLoadName = "AA Ambient Showcase";
onLoadMission = "A showcase mission for the ambient aircraft api";
class CfgFunctions {
//#include "IRN\functions\init.cpp"
class IRN {
class Catergory1 {
file = "IRN\functions\Category1";
class kitten1 {
preInit = 1;
};
};
};
};
and it throws this error on mission start:
21:51:08 Error position: <CfgFunctions { class IRN { class p>
21:51:08 Error Missing ;```
hold on
wat? are you executing that as sqf?!
this is sqf error, not config error
im just trying to define some functions in a cfg ._.
i have a script executing from an objects init, but its 100% unrelated to the functions
and how are you executing the function?
not at all, it just has the preInit flag, and the function itself is an empty sqf file
kitten1 in that case
anyone more intelligent than i am know what im doing wrong here:
this addEventHandler ["Killed",{_scriptedCharge = "DemoCharge_Remote_Ammo_Scripted" createVehicle (getPos _this); _scriptedCharge setDamage 1;}];
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
o.O
this addEventHandler ["Killed",{_scriptedCharge = "DemoCharge_Remote_Ammo_Scripted" createVehicle (getPos _this); _scriptedCharge setDamage 1;}];
_this is an array
also don't use getPos...
I wonder how many times have I said that? 
let me search...
OMG
i dont know why, but i managed to put do_movclass CfgFunctions { class IRN { class preInitCat { preInit = 1; kitten1{}; kitten2{}; }; file = "IRN\functions"; file = "IRN\functions"; e
into the pause menus variable field watchers
hrmmm
every time i paused the game, it would try to run that code
FML
as wiki says:
params ["_unit", "_killer", ....];
so where are you trying to spawn the charge here?
on the vehicles position
_this is a magic variable. usually an array containing parameters the function was given. you have to know whats in it and parse it into usable variables with "params"
then use _unit, or _this#0
is array#index a new syntax?
and as I mentioned before, don't use getPos
ya this works:
this addEventHandler ["Killed",{(_this select 0) spawn {deleteVehicle _this}}];
what does it have to do with the previous code?
just in reference to the parameters
this addEventHandler ["Killed",{
_scriptedCharge = "DemoCharge_Remote_Ammo_Scripted" createVehicle [0,0,0];
_scriptedCharge setPosWorld getPosWorld (_this#0);
_scriptedCharge setDamage 1;
}];
you might want to try triggerAmmo instead
not sure if setDamage works on that
let me take a look at that, thx
okay yea that worked, thanks
yup triggerammo is pretty cool as well
this addEventHandler ["Killed",{
_scriptedCharge = "Bo_GBU12_LGB" createVehicle [0,0,0];
_scriptedCharge setPosWorld getPosWorld (_this#0);
triggerAmmo _scriptedCharge;
}];
I am trying to decrease the accuracy of all player firearms. Of course this can be done by manually re-defining each value for each weapon config in a new mod, but that would be overkill for both me and the player for this mission.
Have considered manually wounding the player's arms at (re)spawn. But then the character groans nonstop. Is there a way of disabling these noises through scripting? Or a different way of decreasing player accuracy?
I'm not sure it's possible to alter the shot dispersion of the weapon itself without altering config. However, there are some things you can do:
https://community.bistudio.com/wiki/setUnitRecoilCoefficient - increase the effect of recoil
https://community.bistudio.com/wiki/setCustomAimCoef increase the effect of weapon sway
It's possible to add dispersion with a Fired EH, but I'm not entirely sure on the locality consequences.
if you were to say, add a random force vector to a bullet at the time of shooting, it has a global effect
https://community.bistudio.com/wiki/addForce
IME it does not.
It's like most bullets are separately local everywhere.
So if you change the path of the projectile on one client it doesn't necessarily affect it on the others.
Hmm that would be best for performance
IIRC larger projectiles do only exist once.
The setup to test that would be pretty tedious lol
Yeah, I never figured out a good method.
need dedicated server, then spawn remote unit via server, add fired EH to unit, force unit to fire just to see the locality of it's bullets
Of course, the Fired EH itself is quite weird about when it activates on remote objects.
It does fire universally on a DS, but not on headless clients.
Their camera is considered to be at the headless client logic object :P
this rabbit hole is more than sufficiently deep for me to pursue the answer, but I sat down with high motivation to work on my own project tonight
in a rare twist of fate
Doing per-bullet trajectory adjustments for every shot on multiple high-RoF weapons seems like a great way to cause performance issues
it won't be that bad, I mean I've seen scripts using nearestObjects onEachFrame
nearestObjects is itself pretty quick :P
Would be nice to have a dynamic dispersion factor command in general.
Thank you for these commands. They seem to be pretty much what I asked for.
The context is: I'm struggling with weapons in the IFA3 mod that are far too accurate for the period: STENs that can headshot at 150 meters for instance, despite various sources and YouTube demonstrations showing at least 6 MOA dispersion.
I'm very curious to what you come up with, Oh Dreaded One :D.
is there a function that the watch box uses in debug console?
or maybe a command?
Does anyone have any theories about this one? A mission where groups of random compositions are spawned periodically. After some time (like an hour or two), In A3, but NOT in A2, EVERY bluefor (only) side men will fail to create via createunit. Empty vehicles are being created at their spawn points. But the men just don't create. This is a mission I made in A2, and ported to A3. Nothing like this ever happened in A2. No script errors occur.
yep
group limit reached
Nothing like this ever happened in A2.
it does happen in A2 as well
in fact in A2 it can even happen faster, due to lower group limit
but maybe the game didn't prevent you from creating the units, which was a bug
Hi guys i have a question how can i make carpet bombing in formation. So i will put down 3 tu-95 flying in V formation and i want them to carpet bomb the area how would i go about doing that ?
if you want formation the best way is just setVelocityTransformation
(fake motion)
I want them to carpet bomb the area how would i do that ?
fire command
make them fire the bomb weapon when they reach a certain destination to the target area
Is there any way i can make so they fire more ammunition then the vehicle is carrying ?
just add the ammo/mag back to them after they've fired
using Fired EH for example
Also possible to just spawn bombs, which might work out better for carpet bombing.
Hey, could anyone help me on the arma 3 horn ive got a custom OGG file and would like to use that ik its on fired but when i use the FIRED EVH it doesnt actually work so if someone could open some light on it would be amazing.
punctuation please
what is it you want?
I would like some information on how to use my custom OGG file on default non modded arma for the horn
you cannot without creating a mod
or, well, it would be a dirty hack
ok np
fired event handler never triggers for horns
basically the horn sound is the dry sound of weapon fire
like the click you hear when you attempt to fire an empty weapon
can anyone help me find a script thatll spawn OPFOR soldiers using the debug console
yeah cheers ive found out a way to do it
it's not much of a script:
https://community.bistudio.com/wiki/BIS_fnc_spawnGroup
[getPos aPosition, east, 5] call BIS_fnc_spawnGroup;
thank you
example from that page ^
do you want to spawn a group? or just a single guy?
a single guy
you can just use the createUnit command then:
createGroup east createUnit ["className", _position, [], 0, "NONE"];
put your own position in place of _position
e.g. getPosATL player
createGroup east createUnit ["rhs_msv_rifleman", getPosATL player, [], 0, "NONE"];
would this be correct
it is correct
thank you god bless you man
does anyone know how to make plane afterburner mechanic avalible for planes in zeus?
afaik there's no vanilla afterburner script
whichever mod you use that adds that feature most probably has a function that you can call on other planes
What's the best command to put into an object init to avoid a helicopter from attacking (just using it for transport)?
set behavior to careless and combat mode to blue
why use the init field when you can use group behaviour ๐
gotcha
thanks guys
The unit respawns though
Transport heli
So init is the better approach I guess?
Would I have fewer locality problems if I declare some of these variables publicly or at least just declaring them to the server? If so, how (for sake of understanding)?
//High command block.
BHA66HC = LogicSide createUnit ["HighCommand",[0,0,0],[],0,"NONE"]; //Create commander module.
BHA66HS = LogicSide createUnit ["HighCommandSubordinate",[0,0,0],[],0,"NONE"]; //Create subordinate module.
BHA66HS SynchronizeObjectsAdd [BHA66HC]; //Synchronize subordinate to commander module.
BHA66HC SynchronizeObjectsAdd [BHA66]; //Synchronize commander module to commander.
{BHA66 HCSetGroup [_x];} foreach [BA11, BA12, BA13, BA21, BA22, BA23, BA31, BA32, BA41, BA42]; //Assign commander to subordinate groups.```
This was nailed as a local host, then required reworking for dedicated server, and now it's broken again with these subordinate elements being created by headless clients.
hcSetGroup might need a local arg, is BHA66 local the the machine?
BHA66 was on the server, but is now on a headless client, on the same machine, but not on the player client, if that answers your question.
try remote executing stuff then accordingly, until it works
Why is that superior to declaring public variables so everyone can reach it? These won't be called very often, and I don't think are very large.
I'm only questioning for better understanding.
declaring a variable public != remoteexec
I get that, but I thought idea is to reach the variable. Why does it need to exist on any particular machine if we can reach it otherwise? Because we can't manipulate it?
i mean you don't need to broadcast it, publicvariable just assigns an x value on all machines to y identifier, that's it, nothing changes in terms of manipulation
i have some functions that were designed as a kind of library/in mission use.
Im now converting it into a module addon.
Modules produce wierd input parameters, and i dont want to rewrite all my functions inputs.
can i use some kind of wrapper function maybe?
Way over my head, Ironsight!
Do you know if it's bad practice to just run some of these module creation scripts globally? Is there a reason not to do that?
my first thought is: there is never a reason to run anything globally by default. its always special circumstances if you want to accomplish something
My reason for running globally is that it's not working otherwise.
Had high command and support modules correctly working as a client host. Had to be reworked on move to dedicated server. Broken again on move to headless clients. Lots of strange locality.
I might do a global remote execution and just try to target specific clients with an "if" wrapper in the script.
yeah arma locality is difficult
a helicopter can airlift a crate, if the crate is on a different machine. But it cant drop it if its on a different machine
That's strange. Some notes like that for high command and support modules on the wiki would be nice. If it just told me where to put everything, this would be solved.
are you trying to run AI on headless clients?
The high command modules and the support modules each have unique locality preferences. Friggin wild.
Yeah, one server, three headless clients, one for blufor, one for opfor, one for civilians and maybe scorekeeping.
are those vanilla modules?
They are vanilla modules that I'm spawning with a script.
yes, why not
i see. im slowly starting to remeber, lots of type saftey checks in the wrappers
Any other theories? Any theory on why group limit could be reached in A3, but not in A2? Any reason why a group could fail to be deleted in A3, but not A2?
in A3 empty groups are deleted after 1-2 minutes
I'm deleting groups manually when they contain no units.
any idea why that would work continuously for hours in A2, but fail after a while in A3?
And only on bluefor?
Can you paste in the relevant code?
no, because I've never seen it happen except for what I said (exceeding group limit). I recommend keeping a debug console around to debug it when it happens
and start by checking if the group limit is reached
Well, the mission is 4000 lines of code. I would have to make a big assumption about where the problem lies, if it is in the code. I'm more fielding general ideas about what might be going wrong. I could post all code related to creating groups and units and removing groups, but that's still quite a bit.
I gotcha.
How can I set a random start time for an editor mission please?
very random:
does arma have some kind of regex support?
i dont feel like writing extensive typechecks for me text-input fields, and would like to let some kind of regex do that for me
an array of [("...",number)*] for example
yes, but only for strings
idk what that's supposed to mean
Are chat text commands visible in debug console or splendid camera mode? If not, is there a command which is?
what other types would regex work with?
You can check data types with typeName and param/params have built-in type checking + default value
are there separate group limits for bluefor and for opfor side?
I'm pretyt sure it's 256 hard limit
Hi guys question how i can create like a garage function where players can store and get vehicles from and if possible so it saves in array so i can get it in other mission as well ?
currently you have to save them into profileNamespace
https://community.bistudio.com/wiki/profileNamespace
in v2.10 you can create a mission specific namespace
https://community.bistudio.com/wiki/missionProfileNamespace
you can try the latter on current dev branch
Ty very much i will look in to that. So how would i go about creating garage system. Where i can put vehicles in garage and spawn them. Also Remove them from the garage and get the list of all vehicles in garage. Then from that list in next mission bascily be a list of vehicles in garage ?
Anyone have an idea why spawning an ai group, a vehicle or vehicles, and putting crew and passengers in the vehicle.... why ai sometimes immediately eject 1 or 2 passengers from the vehicles, for no apparent reason. Even if they're miles away from enemies?
that's up to your own creativity 
you can add an action to the garage to save the vehicles, and use the inArea command (you can put a trigger that covers the garage as area) to check vehicles that have been placed in there
then save the vehicles as array of class names, and other stuff you want to save such as textures, animations, animation sources, etc.
and to show them to the user, you can either create your own GUI, or more simply, just a communications menu:
https://community.bistudio.com/wiki/Arma_2:_Custom_Command_Menu
https://community.bistudio.com/wiki/Arma_3:_Communication_Menu
do you assign them to their seats?
I often seeing an ai passenger repeatedly getting in and out of a vehicle, before the vehicle finally leaves without them.
case "Driver": {
_new_unit assignasDriver _crew_vehicle;
_new_unit action ["getInDriver", _crew_vehicle];
};
case "Turret": {
_new_unit action ["getInTurret", _crew_vehicle, _crew_role_data select INDEX_GROUP_CONFIG_UNIT_CREW_ROLE_TURRET];
};
case "Cargo": {
_new_unit assignAsCargo _crew_vehicle;
_new_unit action ["getInCargo", _crew_vehicle];
};
case "Commander": {
_new_unit assignasCommander _crew_vehicle;
_new_unit action ["getInCommmander", _crew_vehicle];
};
};```
That's how I'm assigning them to a role and getting them in the vehicle
I suggest that you throw in the whole get in stuff in there
e.g. addVehicle, orderGetIn, etc.
and isNil them too
ordergetin and action getin?
i'm already addvehicle ing.
Will they get out of a vehilce to rearm if they think they are low on ammo?
I hear them saying out of ammo sometimes when they first spawn
not sure why since I gave them tons of ammo. Maybe because launchers are disposable? (CUP launchers)
well it's worth a try, but I doubt it
spawn a normal soldier instead, just for testing
yeah, and make sure you isNil the whole thing
back to the deleting groups problem. I see a huge difference between the number of groups my mission thinks are active, and count allGroups. 25 vs. 97.
whereas toward the start of the mission, those numbers only differed by 1.
then it's your own script's fault 
does arma 3 delete groups automatically when they're empty?
yes
but after ~1 minute
to make sure you can just use: https://community.bistudio.com/wiki/deleteGroupWhenEmpty
In spectator view, the entities list shows 28 groups. But count allgroups is now 127.
allGroups has all sides
including logic
also spectator doesn't show empty groups
but they're supposedly deleted automatically
shit... i wonder if it could be the invisible targets.
sigh... why they need crew in the first place is a mystery to me
so what group or side are they even being added to?
I have another idea which you can try
just spawn 1 unit for that side, and use addVehicle to make the target belong to that group
then you can just disableAI/enableSimulation false that unit
if that doesn't work just use agents instead
agents don't have groups
Hi. How would I figure out what is re-enabling the simulation and collision on my objects? This is my script:
_player = player;
_terrainObjects = nearestTerrainObjects [_player, ["BUILDING", "BUNKER", "HOUSE"], 50];
{
_obj = [["", getModelInfo _x select 1], getPosWorld _x, getDir _x] call BIS_fnc_createSimpleObject;
_obj enableSimulation false;
_player disableCollisionWith _obj;
_obj disableCollisionWith _player;
diag_log ("collission: " + str collisionDisabledWith _obj);
diag_log ("simulation: " + str simulationEnabled _obj);
_x hideObject true;
} forEach _terrainObjects;
I have no idea how to add an agent to an invisible target
The logs there post the desired result, but the next frame, simulation is back on and so is collision.
createAgent
then moveInAny
until it's full
do agents have a side?
I don't see anything in there about how to determine which side they're on
they have a config
their config decides which side they're on
well, now I have to try to find out what their type name is since i was just using createvehiclecrew before.
what are you trying to achieve with that anyway?
I want a player that, to others, can appear to "noclip" through walls
can an invisible target be crewed by any type as long as it's an agent?
do you test that in single player?
So the idea was to hide the terrain for that player and rebuild the terrain with simple objects that have collision disabled, so you can walk through
Yes
I know I will have to test it in mp
but I can't even get it working in sp
Which?
idk. maybe. it should
createSimpleObject
oh, the object is being created just fine
its purely the collision and simulation that get reenabled constantly
I never said it isn't
like I said maybe the function is messing with it
why do you even use simple objects? can't you disable collision with normal terrain objects?
don't believe so.
that will be super slow
terrain objects are optimized for streaming
normal objects aren't
that's the thing
I don't need any streaming
it's purely for one player to walk through walls
what if you do player disableAI "MOVE"?
iirc it was possible before
not sure if it's been fixed
nope
is a unit which is deleted gone instatly? There's no risk that if i delete a unit, then delete the group that it comprised, that it will somehow be moved to a new group unexpectedly?
is a unit which is deleted gone instatly?
no, it's deleted in the next frame
There's no risk that if i delete a unit, then delete the group that it comprised, that it will somehow be moved to a new group unexpectedly?
no
actually that doesn't even work 
because the unit should still be in its group
so you have to delete the group in the next frame
so in order to hard kill an inivisible target, its crew, and its group, i can't just delete the crew, delete the vehicle, and delete the group all at once?
I guess not 
I've never done that tho
the vehicle and group are not problem ofc
the problem might be the crew themselves (because units must always have groups in Arma)
better delete the group in the next frame
so if i attempt to delete their group, what happens? Does it just not delete the group at all? Or does it move them to some other (or null) group?
Does it just not delete the group at all?
if a group has units, iirc yes, deletion fails
Hmm... looks like i might actually be in the clear here: The actual object deletion, when object becomes objNull, happens on the next frame after command execution, but there are some object modifications that happen immediately. For example if the object is unit in a group, it immediately becomes groupless isNull group _unit; //true
yeah I just tested and it's fine
{
deleteVehicle _x;
} forEach units g1;
deleteGroup g1;
g1
I think the invisible targets was the cause of the group count inflating. After a few minutes, the numbers no longer are diverging.
Now back to the crew and passenger problem(s)
_player = player;
_terrainObjects = nearestTerrainObjects [_player, ["BUILDING", "BUNKER", "HOUSE"], 50];
{
_obj = createSimpleObject [getModelInfo _x select 1, getPosWorld _x, true];
_obj setVectorDirAndUp [vectorDir _x, vectorUp _x];
_obj setObjectScale getObjectScale _x;
_obj enableSimulation false;
_player disableCollisionWith _obj;
_obj disableCollisionWith _player;
diag_log ("collission: " + str collisionDisabledWith _obj);
diag_log ("simulation: " + str simulationEnabled _obj);
_x hideObject true;
} forEach _terrainObjects;
try that
nah I believe I figured it out
well your script was wrong 
you can't have disabled collision on multiple objects
you only used dir
your object wasn't local
and you never accounted for the object scale
yeah, the up and scale didn't make much of a difference in my testing but I was going to account for that once I had the bigger problem solved
Quick question is it possible to put insignia on vehicle if the player is not in the vehicle with out makeing a mod ?
Is there something I can do about ai vehicle commanders spamming way too many orders to his crew in a few seconds? Vehicles tend to get stuck doing nothing, and I wonder if this is the cause.
About my problem with ai being immediately ejected from newly spawned groups and vehicles. I just noticed that one circumstance in which it happens, the ejects a passenger from one vehicle, and moves them to a different vehicle. Any way to prevent this from happening?
Another circumstance in which it appears to happen is with small cars that have no weapon (turret). The passengers get out and just stand there while the vehicle drives off.
is it possible to disable the Spectator Mode for the player? make the player spectate everyone but himself?
["Initialize", [player, [west], true, false, true, false, false, false,false,false]] call BIS_fnc_EGSpectator;
i'm using this, but i can spectate myself too.
okay i found a workaround using the command joinSilent to switch players side.
Hide the player
does anyone know the in game category for air vehicles (planes /helicopters)
I know the all ground vehicles are "landvehicle"
"Air"
or "helicopter" / "plane"
will try air
includes drones iirc
don't drones fall in either plane(S-70) or helicopter(Darter)
I found an area script that reads the vehicle and repairs it
is there a way to convert it to be radio operated
I mean instead of present blufor, calling radio alpha will make the trigger initiate
looks like it, just tested , tried pelican and greyhawk
darter is also a heli
found a script can I post it so someone can tell me what to change to make it available through radio
private ["_veh","_vehType"];
_veh = _this select 0;
_vehType = getText(configFile>>"CfgVehicles">>typeOf _veh>>"DisplayName");
if ((_veh isKindOf "Plane") && (driver _veh == player)) exitWith {
_veh sidechat format ["Servicing %1.", _vehType];
_veh setVehicleAmmo 1;
_veh sidechat format ["%1 Rearmed.", _vehType];
_veh setDamage 0;
_veh sidechat format ["%1 Repaired.", _vehType];
_veh setFuel 1;
_veh sidechat format ["%1 Refueled.", _vehType];
_veh sidechat format ["Service Complete", _vehType];
};
This was the original
if ((_veh isKindOf "landvehicle") && (driver _veh == player)) exitWith {
_veh sidechat format ["Servicing %1.", _vehType];
_veh setFuel 0;
sleep 3;
_veh setVehicleAmmo 1;
_veh sidechat format ["%1 Rearmed.", _vehType];
sleep 3;
_veh setDamage 0;
_veh sidechat format ["%1 Repaired.", _vehType];
sleep 3;
_veh setFuel 1;
_veh sidechat format ["%1 Refueled.", _vehType];
sleep 2;
_veh sidechat format ["Service Complete", _vehType];
};
it is a ground vehicle script
you could just drop the radio trigger in the editor. don't know how to add that via script
I mean is my script (the top one) even correct?
looks like it but depends on how you call it
I'll probably end calling it through a any player present script
yes you're right hiding the player works even better
they only do that if you have added multiple vehicles to the group
and if one of the vehicles has empty "useful" seats (e.g gunner)
they got out of a car to ride on the back of a tank. (not a gunner seat)
Probably FFV turret seats
In any case, is there a way to stop them from doing that?
Try using this to remove the vehicle from the group
I hope you don't have the same group spread in multiple cars
Because that's a problem
Hello! I would like to know if it is possible to make a supply box filled with the ammo of players.
Most things are possible, the question is, how hard is it and are there easier alternatives that achieve the goal.
Can you explain what you mean by filled with the ammo of the players? Like, will it actively mirror the players' inventories, or do you just want it to carry the type of ammunition they need to refill?
Just the type of ammo they need to refill
if you just want the magazines the players have
https://community.bistudio.com/wiki/addMagazineCargoGlobal to add to the box
So do I have to just add this to the supply box?
You would create an array of magazine types and use that array to add to the box
Do some trials. If it works, congratulations, if it does nothing, *tweak it and try again, and if it throws an error, read the error and if you can't understand it, paste it in here and I'll try help you understand it.
Also, if this is going to be a multiplayer mission, player is unlikely to work, depending on how it's called.
it won't work because the syntax is wrong
instead of writing random code just take a quick look at the wiki
I will, thanks anyway!
private _magazineClasses = []; //declaration of _magazineClasses as array
{
private _player = _x; //sets local variable _player for use in nested forEach
{
_magazineClasses pushBackUnique _x; //appends magazine to _magazineClasses if it is not already in the array
} forEach (magazines _player); //magazines to iterate through
} forEach allPlayers; //players to iterate through
{
_ammoBox addMagazineCargoGlobal [_x, 15]; //adds 15 of iterated magazine
} forEach _magazineClasses; //previously constructed array of magazines to iterate through
``` here's an example of constructing an array. Disclaimer there's bound to be a more efficient way than what I wrote, but this constructs an array of every unique ammo type carried by players and adds 15 of each to `_ammoBox`
Oh I see, thank you for the example!
added notes; see https://community.bistudio.com/wiki/forEach
Anyone have any ideas on player client vs headless client ownership of AI groups?
I've gotten headless clients to spawn AI groups and successfully add them as high command subordinates, but I'm having quite a bit of trouble with the support modules being appropriately registered.
This may possibly be remedied by having player high commanders also host (own) their subordinate AI groups on their own PC. Advantage mostly boils down to reducing locality obstacles between player high commanders and their subordinates. The big disadvantages are that the AI's cleverness will be directly related to their commander's framerate and latency. Player commanders would typically have about 100 AI under their command but in certain circumstances, could have up to 400.
Or alternatively does anyone understand the locality needs of the support provider and requester modules?
What is the proper syntax of this, BA11 being a group, BA11V being a vehicle: (BA11 select _0) moveInDriver BA11V;
units BA11 select 0
Thanks!
Appreciated!
underscore denotes local variables
Indeed. I swear I'd seen like _this select _0 or some such thing around, though. Likely not!
now wondering whether that's possible :P
SQF is ugly enough without obfuscating it though.
indeed it is possible
Most likely I was just misremembering.
i choose to believe someone out there is numbering their variables instead of naming them
select here is selecting an element from an array anyway, so second parameter is just a number.
Haha, mine basically look like numbers... Probably not a good thing.
the engine wont care but your life expectancy might take a hit
Anyone have any insight on the locality requirements of the support provider and requester modules?
I'll give it a shot!
hey im looking for an experienced scripter to help me create cool scenarios
https://community.bistudio.com/wiki/Arma_3:_Difficulty_Settings#Difficulty_Menu
how can I disable friendlyTags using script?
Anyone got any examples on how to implement CBA keybindings?
What I am trying to do is to add keyBinds to the options menu:
options >> controls >> configure addons
generally those things were created for singleplayer, so i would assume they do not work in MP
it is rare to see MP missions have the support request system
as you need to manage multiple players requesting the same thing at the same time
What
Are those for artillery support?
If so I think they work
But I have tried it for a single person only
They do work in MP (source: have used them). I'm not sure how they handle multiple players requesting at the same time, we usually only have the one JTAC who can use them.
Same
TROALINISM: I hope you don't have the same group spread in multiple cars [06:37] TROALINISM: Because that's a problem Since when?
Is there a command to make ai immediately fire a mag from a weapon. Not at a target, just fire the mag out of the weapon.
Added: "EntityCreated" and "ProjectileCreated" mission Event Handlers - FT-T124460, FT-T155096
if you have the squad leader in a vehicle, he will order all of his soldiers to the same vehicle he is in
so if you have 8 guys in a squad, 4 in one vehicle and the others in another vehicle, the squad leader will ask whoever is in a vehicle outside of his to embark in his vehicle
even if that's so, it only explains a small amount of the bullshit i see. Is there a way to stop ai leaders from ever ordering guys in/out of vehicles under any circumstances?
in fact, not just the squad leader, i don't want the ai making any decisions about getting in or out of vehicles
well https://community.bistudio.com/wiki/leaveVehicle will make them leave the vehicle
and never get back in
i need the opposite, for them to stay in vehicles
addvehicle/assignAsX/allowcrewinimmobile , are really your only options
you can also use some "disableAI" options but that affects other things too while they're in the vehicle
@drifting sky I think this answered all of your questions
doesn't say anything about forcing ai to stay in vehicles
it has a list of commands in the page
read all of the commands to figure a way out of what you want
Don't forget setUnloadInCombat, which will prevent them from being prompted to dismount by enemy activity
https://community.bistudio.com/wiki/allowCrewInImmobile is really the baseline for preventing dismount
i need them to be forced to stay in the vehicle under every possible circumstance. Since they seem to leave vehicles for no apparent reason.
and if you really need to brute force it, you can use "deletevehicle" in a "getoutman" eventhandler to kill the dismounted unit, and replace them with a fresh AI
here's one scenario. I spawn a group, add a car to it. EVERYONE gets in the same car. Enemy is miles away. Half the guys immediately get out of the car and just stand there. The car leaves without them.
Can you think of any reason why that should happen?
and why it only happens with some cars and not others?
the group is in combat behavior?
or the car config faction is not the same faction as the group
like blufor in an ifrit
probably only prevents them from getting in the vehicle
tbh i have no problem with keeping AI in a vehicle, using simply "allowcrewinimmobile" and "setunloadincombat" commands
I remember locking players in vehicles using this command
use it, maybe it will work?
It definitely prevents players from exiting. It's possible the AI can ignore it but it's also worth testing.
if a vehicle is a different faction, would that explain why only some of the men in the group leave the car, and others remain in it?
if all the guys are on the same faction?
those in crew positions dont dismount like cargo/passenger positions do
driver/gunner/commander will never be ordered to dismount
can you force a car to be on their faction?
less questions more trial and error, you've been given a few different things to try
yes
This is only one of about 20 problems i'm working on
i ask questions because there's tons of work to do and I'm trying to save time
I had a problem with AI where I had to spend 6 Hours fixing, its asking AI to drive
and presumably people who've been playing this game for 10 years know something about it
nobody knows anything about AI lol
nor anything else apprently
you've been handed some links to explore by people who have solved this issue
only a few people here will write your scripts for you
its pure trial and error, I can assure you will either find the solutions in one of the things we have given you or a combination of them
you need to execute those commands on your vehicle, before the AI are moved into it
so you mentioned that there is a way to force a car to join a faction, any more info on that?
theres no way
Does that mean that passengers will always leave the vehicle?
even if same faction crew is in it?
have you tried the links posted above?
and tested dismounting after applying "setUnloadInCombat" and "allowCrewInImmobile"?
I'm gathering as much information as possible before trying anything else. Because the circumstances in which I'm having problems are varied and complicated.
yeah first go through the list of suggested fixes then you might encounter a fix or encounter something to help you fix it
yeah we pretty much gave you everything, including stuff as trivial as https://community.bistudio.com/wiki/setVehicleLock
lol
does locking a vehicle stop ai from leaving it?
from experience, generally no
try it
if you ran out of everything that is
you can also test with a same-faction vehicle to see if the problems go away
write the list and start trying because arma 3 AI is a journey by itself
while I'm working on this, anybody know if there's a way in A3 to force the ai to fire a specified weapon using a specified mag. In A2, I used "fire". But it doesn't seem to work in A3.
fire's alt syntax should work, if you have the locality right. Also consider using reload's alt syntax followed by a fire command.
will reload instantly change mags for ai?
https://community.bistudio.com/wiki/BIS_fnc_fire is a friendly script-wrapper for "forceWeaponFire"
what happens if I do reload and then fire.... will it try to fire before the reload is complete?
Unfortunately, like forceWeaponFire it still doesn't allow magazine selection, only muzzle selection
I don't know. If you're worried, try using a sleep between commands.
I believe it plays the animation and has no ability to force instant loading. But you can always try it.
You can also use addWeaponItem to add a magazine directly to the weapon. Bear in mind that this creates a new magazine.
Does a RscPassword exists ?
I need a RscEdit where the content is hidden
Thank you
interesting
shame
how can I detect if init.sqf is finished? I have a mission intro done in it and I want a trigger to be executed once the init ends, so far I figured out I can add a variable in the end of init file for which the trigger waits, but maybe there's other way.
I think it is the only efficient way to do it in A3
Make a intro.sqf put all your code of intro in that intro.sqf and in the init execute intro.sqf and you have command waituntil {scriptdone script};
https://community.bistudio.com/wiki/scriptDone
Before I forget about this, does anyone know if A3 still has this but from A2? Ai men equipped with pistol would sometimes get stuck with their pistol out and prone, unable to ever move or switch weapons. Hopefully that's been fixed.
never experienced that in my 4 years of playing Arma 3 so I guess it was fixed or at least mitigated
sometimes AI draws binos or pistol instead of the main gun but I assume it's just their behaviour depending on the combat distance and "scanning horizon", they switch back to main gun later anyway
No, it doesn't
I hope you're right, I hope it's been fixed. it totally borked ai in A2. You pretty much could not give them pistols if you expected them to remain active for a good length of time.
Create your trigger in init.sqf
Wat? No need. Just call it
Do you have a reasonably concise repro case for this?
I am having trouble using draw3D to show AI positions in 3D for players
Every AI has an orange circle in 3D but the render is not fluent when they are moving, any idea?
(With onEachFrame event, it is like the game is sleeping 50 milliseconds every time the 3d icon is draw : but we can see the frequency difference with our eyes and it is quite agressive)
Are you using getPos***Visual?
no
using this, it seems to be fluent
it solved the problem!
Where do I find modules in the config viewer to unpack? Are they found in the same location or do I have to hunt for it?
no
why do you need to unpack modules anyway?
you can read their functions using the function viewer
Looking for support and supportrequester modules to explore their locality requirements.
Okay.
"A3\modules_f\supports\init_provider.sqf";
Tells me look here. Do I have to unpbo?
"BIS_fnc_moduleSupportsInitRequester"
"BIS_fnc_moduleSupportsInitProvider"
no
you can just do:
copyToClipboard loadfile "A3\modules_f\supports\init_provider.sqf"
That's a solid magic trick! I've been looking for that or something similar for a while! Thanks tons!
How do I get the Promet sight onto other weapons
I experimented with it and it's beyond my scripting skills. I'm sure there is a way to force it, but I didn't find a simple method.
This support module shit is going to blow my mind to confetti. I don't understand its locality at all. Even straight up editor placed modules don't appear to work for what I need on a dedicated server situation. Infuriating.
not possible via scripting
It adds my support and then they disappear. This is driving me batty.
Works on local host, doesn't work on dedicated. Talya_Taya had worked up a script that worked on dedicated, but even that didn't work on headless clients.
Ah
Ok thanks guys
how do I get the plane icon in the pylon settings tab? (eden editor)
Hi hi! I've been trying to wrap my brain around this, but...
How do I teleport all my players?!
Basically, i've made a starting cutscene where a helicopter crashes.
For obvious reasons, i'll make it "look" like the players are in the helicopter.
When the helicopter crashes, it'll go into a blackscreen, and when it comes back, they'll be next to the "crashed" heli. But I can't manage a way to make all players get TPed without some sort of add action! Any idea's guys? Thanks :D
@fallow vector kinda a cheaty way to do it but have a trigger with some area to cover all your units, start it in the corner of the map. When the players get into this cutscene simply move the trigger over the players and do a simple player setpos (I know its not the right way to do it but whatever it works) make sure the trigger has repeatable and all the other settings correct and they should all get tp'd
How would I move the trigger? 0.o
I apologise, i'm a bit new to scripting :)
@fallow vector If your cutscene is consistent in timing you could sync it up with the time of day in Arma that the trigger gets moved, look up "Arma 3 Mission Editing: Time based triggers and changing time" by Dayz medic on youtube, and see if that works for your mission
skip to like 5:25 for the actual bit on how the timing works lol
lots of filler
What's the secret for making forceFlagTexture working in MP?
The wiki says it has global effect, but I can only see it on my character. Other people can not see it one me.
Quick question. I'm trying to use the BIS_fnc_initIntelObject function on a surrendered AI to simulate interrogating the AI for intel. Unfortunately, that BIS_fnc deletes the object its added to.
Is there any way to either: a)Make it so BIS_fnc_initIntelObject doesn't delete the object? My other alternative is to try just addAction-ing on the surrendered AI, and then using createDiaryRecord as the code that gets run, but I don't know how to share the DiaryRecord created with all of Blufor, not just the person who did the action.
I'm assuming if I do the addAction way, I'll have to run a script to check if each thing is a player (through isInterface?) and then create the diary record for them too?
find it in the functions viewer and pick out what you want to do, then write your own function
yeah.... that's way above my head. Just know basic scripting! ๐
Thanks for the suggestion though
createDiaryRecord has local effects so you can use remoteExec to run on other machines. To run it on all west:
[createDiaryRecordParams] remoteExec ["createDiaryRecord", west];
so... jut to make sure I understand, I'd fill in the params for createDiaryRecord , and that whole thing put it in under the script portion of the addAction?
Here's what I've got so far, but it's not working:
["Search for Intel",
{
[player, ["Found Intel", "After searching the captive, a cell phone with a photo of an important HVT was found. <br /><img image='HVT.jpg' width='128' height='64'/>"]] remoteExec ["createDiaryRecord", west]
}
];
Basically, add the action to the surrendered AI, and when the action is done, I wanna remoteExec a createDiaryRecord. Not sure where my syntax is going wrong, though. Eden tells me I'm missing a ]
I haven't scripted in Arma for ages but maybe the quotes on your picture are escaping the string that they are in? maybe need to escape them?
I fixed it up with true, but still got the same error.
looks like you also have double quotes inside double quotes
replace this image="HVT.jpg" width="128" height="64" with this image='HVT.jpg' width='128' height='64'
oh god, Im an idiot. I think that was it. Bulldoza had it right.
Hmmm. So, I'm definitely getting an Action on the surrendered AI now. But when I execute the action, don't seem to be getting the diary Record.
Fellas, I need some help, I am trying to have add action work for one person on the server so they can activate audio that is heard by everyone, I am currently using this:
a1 addAction ["Play intro speech", {m1 say3D ["music11",5000,1];}]; };
When using this only the person who has the action can hear it, how can I have it work on dedicated server and where everyone can hear the sound that is being played that the player selects
say3D also has local effects so you too will need to use remoteExec, luckily I posted an example of that above
This one I assume?
yeah
Alright, ill give it a shot, thank you mate
np
Hmmm, I think the problem is with how I'm trying to do createDiaryEntry in the first place. Even when I tried doing it without the remoteexec, just for my character, it wasn't working:
this addAction
["Search for Intel",
{player createDiaryRecord
["Found Intel",
"After searching the captive, a cell phone with a photo of an important HVT was found. <br /><img image='HVT.jpg' width='128' height='64'/>"
]}
];
Sorry DreadedEntity; do you have any thoughts about what's going wrong? If not, no worries; I'm mostly using this as an excuse to practice scripting more complex things (for my standards, I mean)
i dunno if it's the "player" part that's causing problems, but dunno what else could go there instead. Do I need to define a variable=player, and then use that or something? I have no clue with the createDiaryRecord doesn't seem to wanna go thru at all, whether locally or when I tried through remoteExec
in here? no. but the player in your remoteExec code is wrong
this should work (it should show the diary record for whoever uses the action)
anyone got an idea?
RHS vehicles have an icon in the eden's edit pylon tab that is different from the map icon that is defined in vehicle's config
all mod stuff is in the mod config somewhere
damn
can't I grab the icon from the eden property tab itself?
by some script?
yo bros do you think its possible to make a unitcapture loop itself with a good and smooth transition?
context: helicopter loitering above AO, with flight path defined using unitcapture
I don't know about that
darn
just interpolate from the last frame of the unitCapture data to the first frame
ooooh makes sense
you can use setVelocityTransformation for that
i was never able to figure out how that command works
or a better idea
make a fake "unit capture" data
with [lastFrame, firstFrame] values
and make the unitPlay function play it for you
is there a explanation about the unitcapture data array?
theres a bunch of numbers but idk whats what
wouldnt this instantly snap the unit between the positions?
if you adjust the times no
how to adjust times
read the unit play function
^
is there explanation @little raptor
the function is extremely simple. plus the data part is fairly obvious:
_data params ["_object", "_recording", "_recordingCount", "_ignoreDisabled", "_startRecordingTime", "_startPlaybackTime", "_step", "_currentTime", "_nextTime", "_velocityTransformation"];
the data taht gets copied after you press f1
no
you have to figure it out for yourself
actually this was for something else 
because there are thousands of frames
you just need the first and last frame as I just said
the capture data is an array of frames
[10333.5,18076.6,244.988] is this 1 frame?
what is the contents of that array
theres 3 items
no
that's just a position
first frame is:
_data#0
last is:
_data#(count _data - 1)
were you seriously reading the data visually? 
yes
thats why i need explanation on the copied unitcapture array
just paste it into a file
yes its like 20k characters
then you can just load it as:
_data = call compile loadFile "file.sqf"
or just include it if your script is preprocessed:
_data =
#include "file.sqf"
;
then you can make your own data from that
_firstFrame = +(_data#0);
_lastFrame = +(_data#(count _data - 1));
_lastFrame set [0, 0];
_firstFrame set [0, _desiredDuration];
_newData = [_lastFrame, _firstFrame];
Does it matter if AI group leader is vehicle driver vs. vehicle commander?
matter in what?
does it affect performance of the vehicle in any way?
or change behaviour of the squad as a whole?
I am trying to setup a zeus captive/hostage mission but can figure out the execute code I need for the hostages. The group isn't using ACE. Please help me out.
well you better put the leader in the commander seat
I think if he is driver he will be the one that drives to the location he orders
If he is a commander he will ask his squadmate that is driving to drive to that location
if it doesn't have one set the leader as effectiveCommander
What effect will it have making the leader the commander?
It'd be nice making them the driver if that means they'll get moving more quickly

that's how the game does it
well I guess so
because otherwise the leader will have to give command, which takes time to transmit
In CUP anyway, some of the vehicles have the group leader as the commander, and others as the driver
https://community.bistudio.com/wiki/setCaptive in inti field of a hostage just put this setCaptive true;
probably because they don't have a commander
so this new data is for the fake unitcapture played after the actual one to connect them?
can we just modify the actual unitcapture data, replace the last frame with the first one?
well you can just add the first frame to the end instead
but you also need the last frame's time, to add to a delta time
you can't just add it as it is
so just modify last frame's time?
ohh yes thats what i mean lol
_firstFrame = +(_data#0);
_lastFrame = _data#(count _data - 1);
_firstFrame set [0, _lastFrame#0 + 1];
_data pushBack _firstFrame
that adds a 1 second duration for the last frame
(it's too long tho)
you should probably use 1/60 instead
awesomeness wait let me try
is there a way to find out if the unitcapture has finished?
no need to "find out"
just call it
i need to loop the next unitplay after the first one is finished
since you want to loop, do:
while {alive _obj} do {
[_obj, _data] call BIS_fnc_unitPlay;
};
waitUntil {
_data = call compile loadFile "wp2.sqf";
_firstFrame = +(_data#0);
_lastFrame = _data#(count _data - 1);
_firstFrame set [0, _lastFrame#0 + 1];
_data pushBack _firstFrame;
[heli2, _data] spawn BIS_fnc_Unitplay;
//sleep 1;
false;
};
this makes it stay in place because it keeps looping before its finished
as I said call it
not spawn
see what I wrote
_data = call compile loadFile "wp2.sqf";
_firstFrame = +(_data#0);
_lastFrame = _data#(count _data - 1);
_firstFrame set [0, _lastFrame#0 + 1/60];
_data pushBack _firstFrame;
while {alive heli2} do {
[heli2, _data] call BIS_fnc_unitPlay;
};
okok 1 sec i havent touched a3 scripting in months
yes i'm just trying to make it work first then i'll change it
sorry
it froze my game ._.
where did you put it?
on a trigger
no its in the on act
that's an unschd environment
ok so from sqf?
I mean you should've spawned it:
[] spawn {
_data = call compile loadFile "wp2.sqf";
_firstFrame = +(_data#0);
_lastFrame = _data#(count _data - 1);
_firstFrame set [0, _lastFrame#0 + 1];
_data pushBack _firstFrame;
while {alive heli2} do {
[heli2, _data] call BIS_fnc_unitPlay;
};
};
but u said call 
I said call the unitPlay function
ok it now loops correctly but still instant jump from last pos to starting pos?
i used the 1/60
then I guess it's too fast (or should I say your loop is not "closed") 
try 1
or bigger
[] spawn {
_data = call compile loadFile "wp2.sqf";
_firstFrame = +(_data#0);
_lastFrame = _data#(count _data - 1);
_firstFrame set [0, _lastFrame#0 + 9999999];
_data pushBack _firstFrame;
while {alive heli2} do {
[heli2, _data] call BIS_fnc_unitPlay;
};
};
still instant snap 
let me read the code again
appreciate your help bro ๐
ah the function never reads the last frame 
just push the last frame twice 
[] spawn {
_data = call compile loadFile "wp2.sqf";
_firstFrame = +(_data#0);
_lastFrame = _data#(count _data - 1);
_firstFrame set [0, _lastFrame#0 + 1];
_data pushBack _firstFrame;
_data pushBack _firstFrame;
while {alive heli2} do {
[heli2, _data] call BIS_fnc_unitPlay;
};
};
also change that 9999999 ๐ฌ
otherwise it'll never end
use 1 for now
๐ค
with this code it transitioned smoothly and gloriously
Leopard you are a legend bro fr, always solved any problem i encountered
thanks a lot brother now i can finally make some banger cinematic missions
oh and also, if i want to change the delta time for the transition, i can just change that 1 to a bigger number right?
yeah
dope stuff
curious tho why does it need double pushbacks for the last frame to work 
it never uses the last frame
when you add something twice only the one to last will be used
e.g. if you had 1 to 8 and added 9 twice, it would only read 1 to 9 (last 9 is not important)
this is why:
_step = _step + 1;
_currentData = _recording select _step;
_currentTime = _currentData select 0;
_nextData = _recording select (_step + 1);
it's a bug in the function
it increments the step first
but it should do it last (after those lines)
oooo i see i see
awesome explanation bro
while still on the topic, do you know if theres a performance impact for a very long sequence of unitplay? (ex. 5 mins?)
duration is not important
number of objects is
but I don't think that function supports multiple objects in the first place 
because it uses global vars 
oh nvm it does
it has a counter.
but that's a pointless since you can just save the variables into the object var space
i heard that it could make save game file bigger because its stored in memory or smth?
i was able to make 5 unitplays at once
yeah
but that's not really a "performance impact". I assumed you meant FPS
if you dont preprocess it, it should be fine right?
like if you only need to run it once
no
it saves the capture data as a global var
and when you save that var has to be serialized
yes i was wondering about fps also, but glad to hear theres no impact
you can make your own unit play that works around it tho
if that's very important to you
i dont mind the big size, but im planning to make a mission with like 10 or more unitcaptures
will that make the savegame gigabytes in size?
10 unitcaptures 5 mins each ๐ค
no
once a unit capture is done its data is cleared
missionNamespace setVariable [_dataVar, nil];
that's what the function does
if you play all of them at once and save while they're playing yes the save can get big
worst case i can just disable saving
and give autosaves
so if i run many unitcaptures (10 maybe) at once, will the fps be affected?
also make sure you don't save the variable as global variable
otherwise it won't be cleared
use local vars like this
right the data right? so add _ to make it local?
okok ๐
yeah
will this?
probably yeah
greatly?
the function doesn't seem to be that slow tho
dunno. depends how slow the function is
from what I see it should be around ~0.1 ms every frame
so 10 would be 1 ms
it will reduce your FPS a bit but hopefully won't bring it below 60
actually it's probably faster
for the unitcapture data, will it make a difference if the record fps is low (20) vs high (60)?
on FPS? not much. it does have a bit of impact if you record at too high FPS but play back at very low FPS (e.g. record at 120 FPS but the user who plays your mission can only do 20 FPS)
it depends how smooth you want it to be
also the bigger the FPS the larger the save file
if your object changes velocity too much (path is curved or linear acceleration is too sharp) use a higher FPS (60)
if the path is pretty much straight and the object doesn't accelerate/decelerate much use low FPS
I see and longer data array too right
Thank you very much for your time and all the very useful information mate ๐๐๐ค๐ฏ
How to handle doArtilleryFire in a multiplayer mission?
I'm calling it on the server, I see the guns animate, the casings being ejected and hear the sounds, but there is no muzzle flash
arg is local
I mean the command must be executed where the arg (the mortar) is local
well, the guns are local to the server
they are not on HC
and I'm calling it on PostInitServer
_gungroup = [arty_gun_1,arty_gun_2,arty_gun_3,arty_gun_4];
{
[{
params [["_gun", objNull, [objNull]]];
_gun setVariable ["artyFnc", {
_this params [["_gun", objNull, [objNull]]];
if (_gun isEqualTo objNull) exitWith {};
_gun setVehicleAmmo 1;
_gun doArtilleryFire [getpos arty_target_1, getArtilleryAmmo [arty_gun_1] select 0, 5];
[{
params [["_gun", objNull, [objNull]]];
[_gun] call (_gun getVariable ["artyFnc", {}]);
}, [_gun], 40 + random 8] call CBA_fnc_waitAndExecute;
}];
[_gun] call (_gun getVariable ["artyFnc", {}]);
}, [_x], 40 + random 8] call CBA_fnc_waitAndExecute;
} forEach _gungroup;
you better use remoteExec just in case:
[_gun, [ASLtoAGL getPosASL arty_target_1, getArtilleryAmmo [arty_gun_1] select 0, 5]] remoteExec ["doArtilleryFire", _gun];
Yeah, but I was thinking that because It's being called on the server, and clients are seeing everything BUT the muzzle flash
remoteExecing it would just create more of the same
kinda hard to explain
in that case the command is buggy 
yeah lol
Hi, is there any way to apply AddCamShake* to a specific camera ?
no
you can make a script that simulates camShake tho
Mmh ok. Thx !
Tried scripting today. I wanted to add an action to an object via an .sqf file, but i want the name to be variable. If I add an variable to my code like this: object addAction[variable, action] it says variable undefined ofcourse. Is there a way I can say to proccess the variable before adding the addaction to the object?
I'm unclear on what exactly you mean. You don't need to use any "processing", you just need to define the variable.
The title will be whatever the variable contained at the time the action was added (assuming it was a valid string). The title will not automatically update when the variable content changes; for that you would need https://community.bistudio.com/wiki/setUserActionText
The title is a string, so it should be changeable as a variable... but obviously, the variable has to be defined first, before the addAction is run.
If youre already playing around with .sqf and external files, youll need to define the variable, THEN run the addaction.
Yes i defined it earlier ofcourse, but the addAction is placed including the variable name in the INIT of the object. If the user interacts with the addAction it tries to look up the variable but its ofcourse not defined because its coming from an external script.
Because its in the init, its loading in and using that variable name at that time - it cant change from there.
The most sloppy way I can think of is define the variable with a default, like variable = 'empty', then change the init to read
[] spawn {
WaitUntil {sleep 1; variable != 'empty'}
AddActionStuffHere
}
Inits are executed at mission launch - and when players join, which make them really treacherous.
Is there not a way to convert your variable to its full definition. like the variable is defined as "Interact" so when you run: object addAction(_variable, code); it becomes object addAction("interact", code); in the object?
what
That's what happens already. But because of initialisation order: https://community.bistudio.com/wiki/Initialization_Order your variable is not defined yet, has no value, does not exist at the moment the init runs.
private _actionName = "Use the dang action!";
object addAction [_actionName, { hint "OK, it works!" }];
Hrn... now im wondering if its worth putting something like
If (time > 10) exitWith {};
...
In my init's would resolve some issues...
Oh i'm stupid ๐คฆโโ๏ธ I see I was using the variable in the code bit of the addAction so addaction["name", hint variable]
JIP and init scripting problems, my code is barely MP stable as it is :p
solved thanks for clearing up my brain๐ญ
โฆdidJIP?
I am trying to write a script to generate rectangle area markers that align with the bounding boxes of selected objects to basically emulate the way houses are marked on the map, because I built a few settlements in EDEN and I want the players to have them "show up" for them without having to do all of the marking manually.
Currently, when I execute the script from within EDEN's debug console, nothing happens. The markers don't show up on the map nor do they spawn in the hierarchy. I bet it's a super simple mistake somewhere but seeing as this is the first script I have ever written for Arma, I just can't quite figure it out...
// Get all EDEN selected buildings
_selectedObjects = get3DENSelected "object";
// Loop through them and add a marker for each one
{
_marker = createMarker["marker_house_" + name _x, "Empty"];
// Set the marker as rectangular, grey and solid
_marker setMarkerShape "RECTANGLE";
_marker setMarkerBrush "Solid";
_marker setMarkerColor "ColorGrey";
// Set the marker's transform to match the building's transform
_marker setMarkerPos (getPosWorld _x);
} forEach object;```
How can I make a script for chatting between 1 player and zeus.
Hmm. Im starting to wonder if I misunderstand the scope of the problem.
If a play joins in progress, does it run every init block, or just the unit the player is taking control of?
Keep in mind that because of get3DENSelected it will only create markers for objects you have selected. If you don't have anything selected nothing will happen.
Also, some things work differently in the Editor. Try running the mission preview and doing it from the debug console there instead (minus get3DENSelected)
you can create a communication channel for you and the zeus
} forEach object;
isobjecteven defined?
Hmm, good question. Let me see if rewriting it will help
createMarker["marker_house_" + name _x, "Empty"];
also wasn't the syntax of createMarker:createMarker ["name", _pos]?
Ah shit yeah that's also a good point
It has a couple of extra parameters now but type isn't one of them
You don't necessarily need a total rewrite. That particular problem is as simple as replacing object with the _selectedObjects variable you define at the start.
Ooooh ok, I was wondering how to write a forEach loop for every object in an array. Gotta get used to the lang lol
Let's see what it does now
well another mistake you have is using name _x
if those are objects they have no name
use str _x instead
And with that 1 player can anonymously send messages to the zeus?
well yeah
Yes if you set the callsign parameter for the radio channel properly (see radioChannelCreate)
callsign or units?
Callsign controls anonymity, units controls privacy
I was thinking of like a support chat/ ticket.
where you can privately message the game master
or an admin
well you can control anonymity using HandleChatMessage (remove message if sender is not player) 
That's true, but callsign is also a fine way to do it.
Hold on, let's be clear. Anonymous messaging is where you can see the message but don't know the sender's identity (obfuscated callsign). Private messaging is when only some people can see the message. *can be both
by anonymous do you mean the message should only be shown to the zeus and the player that sent the message? or should the name be hidden but the message shown to everyone?
I think 1:1 direct messaging is likely to be impractical if you expect that every player on the server can have a separate 1:1 convo with the GM. An out-of-game method would probably be better.
it is possible but no good way to do it 
for example the zeus's message can be shown to the last sender only ๐ฌ
but if another person sends a message while Zeus is typing that would be bad 
You could get Zeus to prefix their message with the recipient's name and only display it to that person. But that requires perfect name typing from Zeus.
you can use regex ๐
e.g.:
to:lprd: ok reinforcements sent
and regex match with:
"^to\:(.*?\:)"
and match the captured name using splitString and stuff 
Ok so the loop actually gets run for every object I have selected within the Editor, which is a good sign, but I still get no markers sadly.
Like you said, I changed the createMarker func to contain the position now, used setMarkerType and changed the loop to forEach _selectedObjects
For the name, is it possible to get the ID of an object? I tried diag_logging the names of each selected object and it's in this format:
"2b821d7b580# 164123: i_stone_housesmall_v2_f.p3d"
Any idea how to get just the 164123 part?
I guess I'll try a different approach of "find all user-placed houses on the map and slap a marker on them" and run that from within the mission preview. Maybe that'll work
what's the new code?
I don't think you really need the specific name, just use the object's _forEachIndex
// Get all EDEN selected buildings
_selectedObjects = get3DENSelected "object";
// Loop through them and add a marker for each one
{
diag_log str _forEachIndex;
diag_log str _x;
// Set the marker's transform to match the building's transform
_marker = createMarker["marker_house_" + str _x, getPosWorld _x];
_marker setMarkerType "Empty";
// Set the marker as rectangular, grey and solid
_marker setMarkerShape "RECTANGLE";
_marker setMarkerBrush "Solid";
_marker setMarkerColor "ColorGrey";
} forEach _selectedObjects;```
That was my original idea, but if I used _forEachIndex and did groups of selections (eg. 5 houses, then another 3, then 4 and so on), it would lead to naming conflicts
empty markers are not shown iirc 
also you don't need the setMarkerType if you want a rectangle. setMarkerType is used for non-shape markers like unit icons etc. Setting shape as RECTANGLE on its own is fine.
Ooooh so that's how you make area markers through code. Was wondering about that
still doesn't work sadly
Hm
I'm pretty sure you need more parameters to show the marker
I don't mess with them a lot but iirc I have used a lot more parameters
You might be missing setMarkerSize
The docs say: The marker will be visible only once at least markerType has been defined
Let's see if size fixes it
setMarkerDir will also be helpful but I'm not sure if it's essential
oh yeah that
I have a script in front of me that does something similar (not quite similar enough to just send you it though sadly) and it does not require type for shape markers
Kind of an obvious thing to miss now that you mentioned it lmao
The default troubleshooting approach is to assume your code is broadly correct and therefore the problem must be something small and overlooked.
Unfortunately, this makes it difficult to spot things that should be blatantly obvious :U
Oh yeah, got plenty of experience with that from regular programming lmao. It's always something small that's super obvious once you figure it out, but leaves you bashing your head against the wall until you do
is it possible to save current mission then launch another mission, And when it's finished, again roll back to previous mission?
Thanks a lot guys, I appreciate the help
Let's say there're missions A and B (in two separated folders), I want to launch B from A
afaik no
not sure if it's possible using campaigns tho
I feel like there is some kind of arcane way to do it because the SP campaign does it for the hub worlds. I'm not sure it's exposed to us, though.
so there's no way? :(((
There's also this, which I suspect is relevant but I think the documentation is lacking https://community.bistudio.com/wiki/Campaign_Description.ext#isHub
playMission seems to only work from main menu
Ohh thanks :DD I just needed a starter clue, I'll take it from here
actually both of those seem to only work in the main menu
ahh :((
https://feedback.bistudio.com/T77329 @little raptor yeah, it's fubar
The one specific message that has been typed in, should only be shown to the player that wrote it and zeus.
As a one-way system this is [probably] not too difficult.
If you want it two-way.......man, just use Discord :U
I think it supports direct chat
Is there a way to check if a vehicle has a seat that you can use "moveincommander" with?
yes. both from config and also using the fullCrew command
the simplest solution is count (fullCrew [_veh, "commander", true]) != 0
is there a way to get a list of all passengers seats? Including person turret?


