#arma3_scripting

1 messages ยท Page 770 of 1

drifting portal
#

since people are more active now, anyone knows the solution to this?

shadow sapphire
#

Okay! Thanks a ton! I'll experiment with that and try to understand it.

little raptor
#

and you can't hide the wing

drifting portal
drifting portal
#

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?

little raptor
drifting portal
#

I tried that, it does hide the main hull, but the wing's texture is a part of the bomb bay doors, tail etc

little raptor
drifting portal
#

what is the selection that the wing is a part of?

little raptor
#

you can try hiding all selections to see if the wing is affected

drifting portal
#

tried that and it got hidden along with every part of it (elevators, slats, flaps etc)

little raptor
drifting portal
drifting portal
#

so it will be only the wings protruding

drifting portal
#

because all of these mentioned have not effect on the body parts of the aircraft?

#

turning them true or false with hideSelection does nothing

shadow sapphire
#

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...

little raptor
#

they make a whole

drifting portal
#

because flaps and elevators are their own things

drifting portal
drifting portal
# little raptor they make a whole

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)

flat jolt
#

Hi guys, can I control VTOL plane vectoring by script?

little raptor
#

AIs I don't think so

#

there's also a down version

little raptor
#

if you hide the "hull" the wings are gone too

#

so you can't have just the wings

drifting portal
#

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)?

little raptor
#

what you want is part of the res lod

drifting portal
#

is there a command or do I need to go to the config etc?

little raptor
#

you don't need that tho

#

you just need LOD res 0 (or 1)

drifting portal
#

you mean index 1?

little raptor
little raptor
#

it's a res lod...

drifting portal
little raptor
#

just use 1... meowsweats

#

or 0

#

whichever exists

drifting portal
little raptor
# drifting portal 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

drifting portal
flat jolt
elfin comet
#

Still holding out hope that someone can help with getting these respawn templates sorted out. Any info is appreciated.

elfin comet
tough abyss
#

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.

drifting portal
lone vapor
#

Is there actually a way to play a video on a TV screen or advertisement board?

hallow mortar
granite sky
#

Is there a known way to turn off flyInHeight, like with -1?

lavish canyon
#

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)||

hallow mortar
#

weapon_Cannon_Phalanx doesn't have a "Single" fire mode

#

Your options are "manual", "close", "medium", and "far"

lavish canyon
hallow mortar
#

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.

quasi zenith
#

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.

copper raven
#

you can maybe do your own one and try to make them move somehow blobdoggoshruggoogly

#

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

shadow sapphire
quasi zenith
#

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?

shadow sapphire
shadow sapphire
granite sky
#

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.

spark turret
#

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?

spark turret
#

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 {};
        };
    };
};
spark turret
#

wdym?

copper raven
#

class kitten1{};

spark turret
#

that didnt fix it.

winter rose
spark turret
#

in a cpp thats being included in the description .ext

winter rose
#

so before that, you are missing a ; closing a previous class

spark turret
#

well there is nothing else tho ๐Ÿ˜„
Its an empty mission with minimal mods

winter rose
#

before the include

spark turret
#

let me test again

winter rose
#

what

spark turret
#

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

little raptor
little raptor
spark turret
#

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

little raptor
spark turret
#

not at all, it just has the preInit flag, and the function itself is an empty sqf file

#

kitten1 in that case

rose osprey
#

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;}];

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
rose osprey
#

o.O

#
this addEventHandler ["Killed",{_scriptedCharge = "DemoCharge_Remote_Ammo_Scripted" createVehicle (getPos _this); _scriptedCharge setDamage 1;}];
little raptor
#

_this is an array

#

also don't use getPos...

#

I wonder how many times have I said that? thonk

#

let me search...

rose osprey
#

lol, im just trying to get it work

#

so i assume _this to this then?

spark turret
#

OMG

little raptor
#

this is not defined in the EH

spark turret
#

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

rose osprey
#

hrmmm

spark turret
#

every time i paused the game, it would try to run that code
FML

little raptor
#

so where are you trying to spawn the charge here?

rose osprey
#

on the vehicles position

spark turret
little raptor
#

then use _unit, or _this#0

spark turret
#

is array#index a new syntax?

little raptor
#

and as I mentioned before, don't use getPos

rose osprey
#

ya this works:

this addEventHandler ["Killed",{(_this select 0) spawn {deleteVehicle _this}}];
little raptor
#

picks array element

rose osprey
#

hrm

#

lets see

little raptor
rose osprey
#

just in reference to the parameters

little raptor
#

you might want to try triggerAmmo instead

#

not sure if setDamage works on that

rose osprey
#

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;
}];
acoustic abyss
#

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?

hallow mortar
granite sky
#

It's possible to add dispersion with a Fired EH, but I'm not entirely sure on the locality consequences.

tranquil jasper
granite sky
#

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.

tranquil jasper
#

Hmm that would be best for performance

granite sky
#

IIRC larger projectiles do only exist once.

tranquil jasper
#

The setup to test that would be pretty tedious lol

granite sky
#

Yeah, I never figured out a good method.

tranquil jasper
#

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

granite sky
#

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

tranquil jasper
#

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

hallow mortar
#

Doing per-bullet trajectory adjustments for every shot on multiple high-RoF weapons seems like a great way to cause performance issues

tranquil jasper
#

it won't be that bad, I mean I've seen scripts using nearestObjects onEachFrame

granite sky
#

nearestObjects is itself pretty quick :P

#

Would be nice to have a dynamic dispersion factor command in general.

acoustic abyss
acoustic abyss
drifting portal
#

is there a function that the watch box uses in debug console?

#

or maybe a command?

drifting sky
#

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.

little raptor
#

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

fleet sand
#

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 ?

little raptor
#

(fake motion)

fleet sand
#

I want them to carpet bomb the area how would i do that ?

little raptor
#

fire command

#

make them fire the bomb weapon when they reach a certain destination to the target area

fleet sand
#

Is there any way i can make so they fire more ammunition then the vehicle is carrying ?

little raptor
#

using Fired EH for example

granite sky
#

Also possible to just spawn bombs, which might work out better for carpet bombing.

tacit tartan
#

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.

winter rose
#

punctuation please meowsweats what is it you want?

tacit tartan
#

I would like some information on how to use my custom OGG file on default non modded arma for the horn

winter rose
#

or, well, it would be a dirty hack

tacit tartan
#

ok np

little raptor
#

basically the horn sound is the dry sound of weapon fire

#

like the click you hear when you attempt to fire an empty weapon

tough abyss
#

can anyone help me find a script thatll spawn OPFOR soldiers using the debug console

tacit tartan
#

yeah cheers ive found out a way to do it

little raptor
#
[getPos aPosition, east, 5] call BIS_fnc_spawnGroup;
little raptor
#

example from that page ^

tough abyss
#

at

little raptor
#

do you want to spawn a group? or just a single guy?

tough abyss
#

a single guy

little raptor
#

you can just use the createUnit command then:

createGroup east createUnit ["className", _position, [], 0, "NONE"];
tough abyss
#

thank you

#

how would i make him spawn on my position

little raptor
#

e.g. getPosATL player

tough abyss
#

createGroup east createUnit ["rhs_msv_rifleman", getPosATL player, [], 0, "NONE"];

#

would this be correct

#

it is correct

#

thank you god bless you man

tame raptor
#

does anyone know how to make plane afterburner mechanic avalible for planes in zeus?

little raptor
tame raptor
#

well i tried firewills and some mods

#

neither of them are worked

modern meteor
#

What's the best command to put into an object init to avoid a helicopter from attacking (just using it for transport)?

little raptor
winter rose
modern meteor
#

gotcha

#

thanks guys

#

The unit respawns though

#

Transport heli

#

So init is the better approach I guess?

winter rose
#

Scripting, respawn EH

shadow sapphire
#

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.
copper raven
shadow sapphire
copper raven
#

blobdoggoshruggoogly try remote executing stuff then accordingly, until it works

shadow sapphire
copper raven
#

declaring a variable public != remoteexec

shadow sapphire
copper raven
#

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

spark turret
#

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?

shadow sapphire
#

Way over my head, Ironsight!

shadow sapphire
spark turret
#

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

shadow sapphire
spark turret
#

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

shadow sapphire
#

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.

spark turret
#

are you trying to run AI on headless clients?

shadow sapphire
#

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.

spark turret
#

are those vanilla modules?

shadow sapphire
spark turret
#

i see. im slowly starting to remeber, lots of type saftey checks in the wrappers

drifting sky
# winter rose yep group limit reached

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?

little raptor
drifting sky
#

any idea why that would work continuously for hours in A2, but fail after a while in A3?

#

And only on bluefor?

shadow sapphire
little raptor
drifting sky
# shadow sapphire Can you paste in the relevant code?

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.

modern meteor
#

How can I set a random start time for an editor mission please?

spark turret
#

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

little raptor
drifting sky
#

Are chat text commands visible in debug console or splendid camera mode? If not, is there a command which is?

tranquil jasper
#

what other types would regex work with?

#

You can check data types with typeName and param/params have built-in type checking + default value

drifting sky
#

are there separate group limits for bluefor and for opfor side?

tranquil jasper
#

I'm pretyt sure it's 256 hard limit

drifting sky
#

global for all sides?

#

or for each side individually

fleet sand
#

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 ?

little raptor
#

you can try the latter on current dev branch

fleet sand
drifting sky
#

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?

little raptor
# fleet sand Ty very much i will look in to that. So how would i go about creating garage sys...

that's up to your own creativity blobdoggoshruggoogly
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

little raptor
drifting sky
#

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

little raptor
#

I suggest that you throw in the whole get in stuff in there

#

e.g. addVehicle, orderGetIn, etc.

#

and isNil them too

drifting sky
#

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?

little raptor
#

no

#

at least not in vanilla

drifting sky
#

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)

little raptor
little raptor
drifting sky
#

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.

little raptor
#

then it's your own script's fault blobdoggoshruggoogly

drifting sky
#

does arma 3 delete groups automatically when they're empty?

little raptor
#

yes

#

but after ~1 minute

drifting sky
#

In spectator view, the entities list shows 28 groups. But count allgroups is now 127.

little raptor
#

allGroups has all sides

#

including logic

#

also spectator doesn't show empty groups

drifting sky
#

but they're supposedly deleted automatically

#

shit... i wonder if it could be the invisible targets.

little raptor
#

yeah

#

it could

#

if you're adding crew to them

drifting sky
#

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?

little raptor
#

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

livid mist
#

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;
drifting sky
#

I have no idea how to add an agent to an invisible target

livid mist
#

The logs there post the desired result, but the next frame, simulation is back on and so is collision.

little raptor
#

then moveInAny

#

until it's full

drifting sky
#

do agents have a side?

little raptor
#

they do iirc

#

yes

#

but no groups

drifting sky
#

I don't see anything in there about how to determine which side they're on

little raptor
#

their config decides which side they're on

drifting sky
#

well, now I have to try to find out what their type name is since i was just using createvehiclecrew before.

little raptor
livid mist
#

I want a player that, to others, can appear to "noclip" through walls

drifting sky
#

can an invisible target be crewed by any type as long as it's an agent?

little raptor
livid mist
#

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

livid mist
#

I know I will have to test it in mp

#

but I can't even get it working in sp

little raptor
#

maybe the function itself is messing with it blobdoggoshruggoogly

#

why don't you just use the command?

livid mist
little raptor
little raptor
livid mist
#

oh, the object is being created just fine

#

its purely the collision and simulation that get reenabled constantly

little raptor
#

like I said maybe the function is messing with it

livid mist
#

How else could I recreate the terrain?

#

I don't mind if it's not "simple objects"

little raptor
#

why do you even use simple objects? can't you disable collision with normal terrain objects?

little raptor
#

terrain objects are optimized for streaming

#

normal objects aren't

livid mist
#

that's the thing

#

I don't need any streaming

#

it's purely for one player to walk through walls

little raptor
#

iirc it was possible before

#

not sure if it's been fixed

livid mist
#

nope

drifting sky
#

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?

little raptor
livid mist
#

oh, wait a second

#

i think i understand what is happening perhaps

little raptor
#

actually that doesn't even work thonk

#

because the unit should still be in its group

#

so you have to delete the group in the next frame

drifting sky
#

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?

little raptor
#

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

drifting sky
#

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?

little raptor
#

Does it just not delete the group at all?
if a group has units, iirc yes, deletion fails

drifting sky
#

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

little raptor
drifting sky
#

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)

little raptor
# livid mist Hi. How would I figure out what is re-enabling the simulation and collision on m...
_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

livid mist
#

nah I believe I figured it out

little raptor
#

well your script was wrong blobdoggoshruggoogly

livid mist
#

you can't have disabled collision on multiple objects

little raptor
#

you only used dir

#

your object wasn't local

#

and you never accounted for the object scale

livid mist
#

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

fleet sand
#

Quick question is it possible to put insignia on vehicle if the player is not in the vehicle with out makeing a mod ?

drifting sky
#

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.

drifting sky
#

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.

drowsy geyser
#

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.

drowsy geyser
polar belfry
#

does anyone know the in game category for air vehicles (planes /helicopters)

#

I know the all ground vehicles are "landvehicle"

polar belfry
#

ok thanks

#

I was making a radio call repair trigger

proven charm
#

or "helicopter" / "plane"

polar belfry
#

will try air

winter rose
#

includes drones iirc

polar belfry
#

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

proven charm
#

darter is also a heli

polar belfry
#

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

proven charm
#

you could just drop the radio trigger in the editor. don't know how to add that via script

polar belfry
#

I mean is my script (the top one) even correct?

proven charm
#

looks like it but depends on how you call it

polar belfry
#

I'll probably end calling it through a any player present script

drowsy geyser
little raptor
#

and if one of the vehicles has empty "useful" seats (e.g gunner)

drifting sky
#

they got out of a car to ride on the back of a tank. (not a gunner seat)

hallow mortar
#

Probably FFV turret seats

drifting sky
#

In any case, is there a way to stop them from doing that?

drifting portal
#

?

drifting portal
#

I hope you don't have the same group spread in multiple cars

#

Because that's a problem

quartz blade
#

Hello! I would like to know if it is possible to make a supply box filled with the ammo of players.

shadow sapphire
quartz blade
quartz blade
open fractal
#

You would create an array of magazine types and use that array to add to the box

quartz blade
#

_ammobox addMagazineCargoGlobal currentMagazine player;

#

Like this?

shadow sapphire
# quartz blade _ammobox addMagazineCargoGlobal currentMagazine player;

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.

open fractal
#

wait

#

is there just one player

little raptor
little raptor
quartz blade
#

I will, thanks anyway!

open fractal
#
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`
quartz blade
#

Oh I see, thank you for the example!

open fractal
shadow sapphire
#

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;

shadow sapphire
open fractal
#

corrected lol

#

you threw me off writing _0

shadow sapphire
#

Appreciated!

open fractal
#

underscore denotes local variables

shadow sapphire
#

Indeed. I swear I'd seen like _this select _0 or some such thing around, though. Likely not!

open fractal
#

maybe someone used _0 as a placeholder for a number

#

or named a variable _0 eyess

granite sky
#

now wondering whether that's possible :P

#

SQF is ugly enough without obfuscating it though.

open fractal
#

indeed it is possible

shadow sapphire
#

Most likely I was just misremembering.

open fractal
#

i choose to believe someone out there is numbering their variables instead of naming them

granite sky
#

select here is selecting an element from an array anyway, so second parameter is just a number.

shadow sapphire
#

Haha, mine basically look like numbers... Probably not a good thing.

open fractal
#

the engine wont care but your life expectancy might take a hit

shadow sapphire
#

Anyone have any insight on the locality requirements of the support provider and requester modules?

spark turret
#

unpack the module functions?

#

and check the code yourself

shadow sapphire
#

I'll give it a shot!

topaz goblet
#

hey im looking for an experienced scripter to help me create cool scenarios

drifting portal
somber radish
#

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
pulsar bluff
#

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

drifting portal
#

Are those for artillery support?

#

If so I think they work

#

But I have tried it for a single person only

hallow mortar
drifting sky
#

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.

pulsar bluff
#

Added: "EntityCreated" and "ProjectileCreated" mission Event Handlers - FT-T124460, FT-T155096

drifting portal
#

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

drifting sky
#

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

drifting portal
#

and never get back in

drifting sky
#

i need the opposite, for them to stay in vehicles

pulsar bluff
#

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 portal
drifting sky
#

doesn't say anything about forcing ai to stay in vehicles

drifting portal
#

read all of the commands to figure a way out of what you want

hallow mortar
#

Don't forget setUnloadInCombat, which will prevent them from being prompted to dismount by enemy activity

pulsar bluff
drifting sky
#

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.

pulsar bluff
#

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

drifting sky
#

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?

pulsar bluff
#

the group is in combat behavior?

drifting sky
#

they're miles away from any enemies

#

and a brand new group

pulsar bluff
#

or the car config faction is not the same faction as the group

#

like blufor in an ifrit

drifting portal
#

well

#

locks them of getting out?

#

??

drifting sky
#

probably only prevents them from getting in the vehicle

pulsar bluff
#

tbh i have no problem with keeping AI in a vehicle, using simply "allowcrewinimmobile" and "setunloadincombat" commands

drifting portal
#

use it, maybe it will work?

hallow mortar
#

It definitely prevents players from exiting. It's possible the AI can ignore it but it's also worth testing.

drifting sky
#

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?

pulsar bluff
#

those in crew positions dont dismount like cargo/passenger positions do

#

driver/gunner/commander will never be ordered to dismount

drifting sky
#

can you force a car to be on their faction?

pulsar bluff
#

less questions more trial and error, you've been given a few different things to try

drifting portal
#

yes

drifting sky
#

This is only one of about 20 problems i'm working on

drifting portal
#

AI is pure tiral and error

#

sadly

drifting sky
#

i ask questions because there's tons of work to do and I'm trying to save time

drifting portal
drifting sky
#

and presumably people who've been playing this game for 10 years know something about it

drifting portal
drifting sky
#

nor anything else apprently

pulsar bluff
#

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

drifting portal
#

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

pulsar bluff
#

you need to execute those commands on your vehicle, before the AI are moved into it

drifting sky
#

so you mentioned that there is a way to force a car to join a faction, any more info on that?

pulsar bluff
#

theres no way

drifting sky
#

Does that mean that passengers will always leave the vehicle?

#

even if same faction crew is in it?

pulsar bluff
#

have you tried the links posted above?

#

and tested dismounting after applying "setUnloadInCombat" and "allowCrewInImmobile"?

drifting sky
#

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.

drifting portal
#

yeah first go through the list of suggested fixes then you might encounter a fix or encounter something to help you fix it

drifting portal
#

lol

drifting sky
#

does locking a vehicle stop ai from leaving it?

pulsar bluff
#

from experience, generally no

drifting portal
#

if you ran out of everything that is

pulsar bluff
#

you can also test with a same-faction vehicle to see if the problems go away

drifting portal
#

write the list and start trying because arma 3 AI is a journey by itself

drifting sky
#

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.

hallow mortar
#

fire's alt syntax should work, if you have the locality right. Also consider using reload's alt syntax followed by a fire command.

drifting sky
#

will reload instantly change mags for ai?

pulsar bluff
drifting sky
#

what happens if I do reload and then fire.... will it try to fire before the reload is complete?

hallow mortar
hallow mortar
hallow mortar
#

You can also use addWeaponItem to add a magazine directly to the weapon. Bear in mind that this creates a new magazine.

tough abyss
#

Does a RscPassword exists ?
I need a RscEdit where the content is hidden

pulsar bluff
#

yea

#

configfile >> "RscDisplayPassword"

tough abyss
#

Thank you

drifting portal
pulsar bluff
#

it wont censor the text without script though

tough abyss
#

shame

jade acorn
#

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.

tough abyss
fleet sand
drifting sky
#

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.

jade acorn
#

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

drifting sky
#

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.

little raptor
little raptor
granite sky
tough abyss
#

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)

granite sky
#

Are you using getPos***Visual?

tough abyss
#

using this, it seems to be fluent

#

it solved the problem!

shadow sapphire
#

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?

little raptor
#

no

#

why do you need to unpack modules anyway?

#

you can read their functions using the function viewer

shadow sapphire
#

Okay.

#

"A3\modules_f\supports\init_provider.sqf";

Tells me look here. Do I have to unpbo?

little raptor
little raptor
#

you can just do:

copyToClipboard loadfile "A3\modules_f\supports\init_provider.sqf"
shadow sapphire
#

That's a solid magic trick! I've been looking for that or something similar for a while! Thanks tons!

winged moon
#

How do I get the Promet sight onto other weapons

shadow sapphire
#

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.

little raptor
shadow sapphire
#

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.

drifting portal
#

how do I get the plane icon in the pylon settings tab? (eden editor)

fallow vector
#

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

fossil peak
#

@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

fallow vector
#

I apologise, i'm a bit new to scripting :)

fossil peak
#

@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

fallow vector
#

I'll give it a look :)

#

Thank you!

agile cargo
#

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.

pulsar pewter
#

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?

open fractal
pulsar pewter
#

yeah.... that's way above my head. Just know basic scripting! ๐Ÿ˜‚
Thanks for the suggestion though

tranquil jasper
#

createDiaryRecord has local effects so you can use remoteExec to run on other machines. To run it on all west:

[createDiaryRecordParams] remoteExec ["createDiaryRecord", west];
pulsar pewter
#

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?

pulsar pewter
#

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 ]

buoyant nova
#

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?

tranquil jasper
#

at a glance, JIP should be true or false

#

or non existent

pulsar pewter
#

I fixed it up with true, but still got the same error.

tranquil jasper
#

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'

pulsar pewter
#

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.

plush summit
#

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

tranquil jasper
#

say3D also has local effects so you too will need to use remoteExec, luckily I posted an example of that above

tranquil jasper
#

yeah

plush summit
#

Alright, ill give it a shot, thank you mate

tranquil jasper
#

np

pulsar pewter
#

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

little raptor
little raptor
drifting portal
#

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

tranquil jasper
#

all mod stuff is in the mod config somewhere

drifting portal
drifting portal
#

by some script?

ripe sapphire
#

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

tranquil jasper
drifting portal
little raptor
ripe sapphire
#

ooooh makes sense

little raptor
ripe sapphire
#

i was never able to figure out how that command works

little raptor
#

read the unitPlay function

#

it uses setVelocityTransformation for its movement too

little raptor
#

make a fake "unit capture" data

#

with [lastFrame, firstFrame] values

#

and make the unitPlay function play it for you

ripe sapphire
#

is there a explanation about the unitcapture data array?

#

theres a bunch of numbers but idk whats what

ripe sapphire
little raptor
ripe sapphire
#

how to adjust times

little raptor
little raptor
ripe sapphire
#

not much info here

little raptor
#

the function itself

#

not the wiki page

ripe sapphire
#

need to prepare my mental health :D

ripe sapphire
little raptor
# ripe sapphire oofff

the function is extremely simple. plus the data part is fairly obvious:

_data params ["_object", "_recording", "_recordingCount", "_ignoreDisabled", "_startRecordingTime", "_startPlaybackTime", "_step", "_currentTime", "_nextTime", "_velocityTransformation"];
ripe sapphire
#

the data taht gets copied after you press f1

little raptor
#

you have to figure it out for yourself

ripe sapphire
#

theres like thousands of item in the arrray lol

little raptor
little raptor
#

you just need the first and last frame as I just said

#

the capture data is an array of frames

ripe sapphire
#

[10333.5,18076.6,244.988] is this 1 frame?

#

what is the contents of that array

#

theres 3 items

little raptor
#

that's just a position

#

first frame is:

_data#0

last is:

_data#(count _data - 1)
#

were you seriously reading the data visually? meowsweats

ripe sapphire
#

thats why i need explanation on the copied unitcapture array

little raptor
ripe sapphire
little raptor
#

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];
drifting sky
#

Does it matter if AI group leader is vehicle driver vs. vehicle commander?

little raptor
#

matter in what?

drifting sky
#

does it affect performance of the vehicle in any way?

#

or change behaviour of the squad as a whole?

sonic hill
#

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.

little raptor
#

well you better put the leader in the commander seat

drifting portal
#

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

little raptor
#

if it doesn't have one set the leader as effectiveCommander

drifting sky
#

It'd be nice making them the driver if that means they'll get moving more quickly

little raptor
#

blobdoggoshruggoogly
that's how the game does it

little raptor
#

because otherwise the leader will have to give command, which takes time to transmit

drifting sky
#

In CUP anyway, some of the vehicles have the group leader as the commander, and others as the driver

little raptor
ripe sapphire
#

can we just modify the actual unitcapture data, replace the last frame with the first one?

little raptor
#

but you also need the last frame's time, to add to a delta time

#

you can't just add it as it is

ripe sapphire
#

so just modify last frame's time?

little raptor
#

no

#

you modify the first frame's time after adding it to the end

ripe sapphire
#

ohh yes thats what i mean lol

little raptor
#

that adds a 1 second duration for the last frame

#

(it's too long tho)

#

you should probably use 1/60 instead

ripe sapphire
#

awesomeness wait let me try

ripe sapphire
little raptor
#

just call it

ripe sapphire
#

i need to loop the next unitplay after the first one is finished

little raptor
#

since you want to loop, do:

while {alive _obj} do {
  [_obj, _data] call BIS_fnc_unitPlay;
};
ripe sapphire
#
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

little raptor
#

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;
};
ripe sapphire
#

okok 1 sec i havent touched a3 scripting in months

little raptor
#

and as I told you replace 1 with 1/60

#

do you even read what I write?

ripe sapphire
#

sorry

little raptor
ripe sapphire
#

on a trigger

little raptor
#

did you spawn it?

ripe sapphire
#

no its in the on act

little raptor
#

that's an unschd environment

ripe sapphire
#

ok so from sqf?

little raptor
#

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;
    };
};
ripe sapphire
little raptor
#

I said call the unitPlay function

ripe sapphire
#

OHHHHH

#

lol my bad

ripe sapphire
#

i used the 1/60

little raptor
#

try 1

#

or bigger

ripe sapphire
#
[] 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 Monkas

little raptor
#

let me read the code again

ripe sapphire
#

appreciate your help bro ๐Ÿ™

little raptor
little raptor
#
[] 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

ripe sapphire
#

OH MY GODPOGGERS

ripe sapphire
#

Leopard you are a legend bro fr, always solved any problem i encountered

ripe sapphire
#

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?

little raptor
#

yeah

ripe sapphire
#

dope stuff

#

curious tho why does it need double pushbacks for the last frame to work meowsweats

little raptor
#

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)

ripe sapphire
#

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?)

little raptor
#

duration is not important

#

number of objects is

#

but I don't think that function supports multiple objects in the first place meowsweats

#

because it uses global vars thonk

#

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

ripe sapphire
ripe sapphire
little raptor
#

but that's not really a "performance impact". I assumed you meant FPS

ripe sapphire
#

like if you only need to run it once

little raptor
#

no

#

it saves the capture data as a global var

#

and when you save that var has to be serialized

ripe sapphire
little raptor
#

you can make your own unit play that works around it tho

#

if that's very important to you

ripe sapphire
#

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 ๐Ÿค”

little raptor
#

once a unit capture is done its data is cleared

#

missionNamespace setVariable [_dataVar, nil];
that's what the function does

ripe sapphire
#

i see

#

then what makes the savegame big? if it saves while unitplay is running?

little raptor
#

if you play all of them at once and save while they're playing yes the save can get big

ripe sapphire
#

oooo i see i see

#

is there a limit so save file? can it cause crash?

little raptor
#

I don't think it can get too big

#

don't worry

ripe sapphire
#

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?

little raptor
#

otherwise it won't be cleared

little raptor
ripe sapphire
#

okok ๐Ÿ‘

little raptor
#

yeah

little raptor
ripe sapphire
#

greatly?

little raptor
#

the function doesn't seem to be that slow tho

little raptor
#

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

ripe sapphire
#

that is totally acceptable for me

little raptor
ripe sapphire
#

for the unitcapture data, will it make a difference if the record fps is low (20) vs high (60)?

little raptor
#

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

ripe sapphire
#

I see and longer data array too right

ripe sapphire
agile cargo
#

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

little raptor
agile cargo
#

I don't follow

#

You mean the gun that I'm assigning the command to?

little raptor
#

I mean the command must be executed where the arg (the mortar) is local

agile cargo
#

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;
little raptor
agile cargo
#

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

little raptor
#

in that case the command is buggy blobdoggoshruggoogly

agile cargo
#

yeah lol

reef cairn
#

Hi, is there any way to apply AddCamShake* to a specific camera ?

little raptor
#

you can make a script that simulates camShake tho

reef cairn
#

Mmh ok. Thx !

sacred wolf
#

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?

hallow mortar
#

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

manic sigil
sacred wolf
#

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.

manic sigil
#

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.

sacred wolf
#

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?

winter rose
#

what

hallow mortar
winter rose
#
private _actionName = "Use the dang action!";
object addAction [_actionName, { hint "OK, it works!" }];
manic sigil
#

Hrn... now im wondering if its worth putting something like

If (time > 10) exitWith {};
...

In my init's would resolve some issues...

winter rose
#

โ€ฆplz don't Oo

#

what do you want to detect with that?

sacred wolf
#

Oh i'm stupid ๐Ÿคฆโ€โ™‚๏ธ I see I was using the variable in the code bit of the addAction so addaction["name", hint variable]

manic sigil
#

JIP and init scripting problems, my code is barely MP stable as it is :p

sacred wolf
pale cosmos
#

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;```
bright sparrow
#

How can I make a script for chatting between 1 player and zeus.

manic sigil
# winter rose โ€ฆ`didJIP`?

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?

hallow mortar
little raptor
little raptor
pale cosmos
little raptor
#

createMarker["marker_house_" + name _x, "Empty"];
also wasn't the syntax of createMarker: createMarker ["name", _pos]?

pale cosmos
#

Ah shit yeah that's also a good point

hallow mortar
hallow mortar
pale cosmos
#

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

little raptor
#

well another mistake you have is using name _x

#

if those are objects they have no name

#

use str _x instead

bright sparrow
hallow mortar
#

Yes if you set the callsign parameter for the radio channel properly (see radioChannelCreate)

little raptor
#

callsign or units?

hallow mortar
bright sparrow
#

I was thinking of like a support chat/ ticket.

#

where you can privately message the game master

#

or an admin

little raptor
hallow mortar
#

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

little raptor
hallow mortar
#

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.

little raptor
#

it is possible but no good way to do it meowsweats

#

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 meowsweats

hallow mortar
#

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.

little raptor
#

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 meowsweats

pale cosmos
# hallow mortar Keep in mind that because of `get3DENSelected` it will only create markers for o...

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

hallow mortar
#

I don't think you really need the specific name, just use the object's _forEachIndex

pale cosmos
# little raptor what's the new code?
// 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;```
pale cosmos
little raptor
#

empty markers are not shown iirc thonk

hallow mortar
#

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.

pale cosmos
#

Ooooh so that's how you make area markers through code. Was wondering about that

#

still doesn't work sadly

#

Hm

little raptor
#

I don't mess with them a lot but iirc I have used a lot more parameters

hallow mortar
#

You might be missing setMarkerSize

pale cosmos
#

The docs say: The marker will be visible only once at least markerType has been defined
Let's see if size fixes it

hallow mortar
#

setMarkerDir will also be helpful but I'm not sure if it's essential

little raptor
hallow mortar
#

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

pale cosmos
#

BINGO

#

Setting the size seems to have made them appear

pale cosmos
hallow mortar
#

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

pale cosmos
fading magnet
#

is it possible to save current mission then launch another mission, And when it's finished, again roll back to previous mission?

pale cosmos
#

Thanks a lot guys, I appreciate the help

fading magnet
little raptor
#

not sure if it's possible using campaigns tho

hallow mortar
#

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.

fading magnet
#

so there's no way? :(((

hallow mortar
little raptor
#

playMission seems to only work from main menu

fading magnet
little raptor
fading magnet
#

ahh :((

little raptor
#

but using campaigns it should be possible

#

the saving part tho is up to you

agile cargo
bright sparrow
hallow mortar
#

As a one-way system this is [probably] not too difficult.
If you want it two-way.......man, just use Discord :U

drifting sky
#

Is there a way to check if a vehicle has a seat that you can use "moveincommander" with?

little raptor
#

the simplest solution is count (fullCrew [_veh, "commander", true]) != 0

drifting sky
#

is there a way to get a list of all passengers seats? Including person turret?

drifting sky
#

fullcrew isn't returning empty seats

#

oops my bad, didn't see there was a parameter for that

#

Is there any practical difference between "gunner" seats and "turret" seats in a vehicle? If I move a guy into a "gunner" seat using moveinturret, can anything go wrong?