#arma3_scripting

1 messages · Page 151 of 1

fair drum
#

Not necessarily, you can make a basic loop for it too.

ornate whale
#

Is there any way to add a preprocessor variable into a string like this?

#define COLOR #112233
private _text = "<t color='COLOR'>Hello</t>";
hallow mortar
#

format can probably do it

#
private _text = format ["<t color = '%1'>Hello</t>", COLOR];```
blissful current
#

Is there a reason why, if you have more than one hold action in the action menu the text for the hold action isn't shown for the other hold actions?

faint burrow
#

That's a bug.

blissful current
faint burrow
#

Don't know.

blissful current
#

Is there a ticket or something I can view on it to check progress?

proven charm
#

i have multiple BIS_fnc_holdActionAdd in mission, i think...

#

ah nvm, i have the same bug

blissful current
proven charm
blissful current
#

Where do you search for the tickets?

granite sky
#

If it's a bug in BIS_fnc_holdActionAdd then you can just write your own fixed version.

granite sky
#

I imagine that's not the simplest piece of code though.

proven charm
#

anyone know where "defines.inc" is located? which pbo...

deft zealot
#

@tough abyss do you know a better way than setGroupOwner?

hallow mortar
#

Which defines.inc? I'm pretty sure there are several for various systems

#

The one for Revive appears to be in one of the Marksman DLC addons

proven charm
#

looking for the one BIS_fnc_holdActionAdd uses

hallow mortar
#

#include looks at the script file's folder if there's no leading \, so it's going to be in functions_f in the holdActions folder

proven charm
#

ok thx

hallow mortar
#

Advanced Developer Tools shows you the function's file path at the bottom of the window in the Function Viewer

blissful current
#

I have a hold action. When it completes it gives the player and addAction. It's all working well except if the play that has the addAction dies it is removed from their action menu on respawn. Is there a way to have it so they can keep the addAction on respawn?

I could do onplayerSpawn.sqf to give them the addaction but I don't want them to have access to it every time they spawn. Only if they had access before they died (as in it wasn't used yet)

faint burrow
#

Seems like you add the action to player itself? If so then add it to an object.

blissful current
faint burrow
#

Yes.

blissful current
#

Oh but the other consideration is if I put it on the object then ALL players would have access to it right? I just want the player that did the hold action to have it.

faint burrow
#

Depends on how the action was added. addAction has local effect.

#

Then you should use, for example, global variable holdActionActivated, check it in Respawn handler and add the action to player itself if it's true.

blissful current
faint burrow
#

It's an example of your variable.

blissful current
#

Oh okay so yeah my backup was to have a global variable fire in onPlayerRespawn. Is that the same thing as RespawnHandler?

faint burrow
blissful current
#

I've no experience with this one. Does it go in initPlayerLocal?

faint burrow
#

If you're going to use Respawn event handler, then it should be added where player is local.
As I wrote, I believe it's the same as onPlayerRespawn.sqf, so you can continue to use this file.

blissful current
#

Okay so heres what I got:

onPlayerRespawn.sqf: GivePlayerDetonate = true;
that global variable is the condition for the addaction to be shown.

When the player dies they dont have the addaction but if they look at their dead body they DO. So it seems that the addaction stays with the corpse and isn't transferred to the respawned player.

faint burrow
#

Yes, since it's different objects. Remove the action from the corpse (it's passed to the event handler).

blissful current
#

Okay I just read the wiki for removeAction How do I find the actionID? On the addaction wikie it says Return Value But doesn't explain how to find out what it is.

faint burrow
#

You should store it somewhere. For instance, in player object.

blissful current
#

I can't store it if I don't know what it is 😛

#

Gotta find out what the number is.

tough abyss
#

@nocturne bluff >count instead of foreaching a crime
Isn't count faster?

nocturne bluff
#

Yes but it's a semantic thing

lapis nest
#

hello! I need help with a script for subtitles. it says "Suspending not allowed in this context" the script in question

call{cutText ["<t color='#00bfff'size='1.4'>Officer: </t> <t size='1.4'>TEXT</t>", "PLAIN DOWN", -1, true, true];sleep 5;call{cutText ["<t color='#00bfff'size='1.4'>Officer: </t> <t size='1.4'>TEXT</t>", "PLAIN DOWN", -1, true, true];

}};

Thank you in advance!

faint burrow
#

Use spawn instead of call.

lapis nest
#

changed both "call" to "spawn" and now it says missing ;

faint burrow
#

Well, add missing ";".

lapis nest
#

where

#

im new to this whole thing

faint burrow
#
[] spawn {
    cutText ["<t color='#00bfff'size='1.4'>Officer: </t> <t size='1.4'>TEXT</t>", "PLAIN DOWN", -1, true, true];

    sleep 5;

    cutText ["<t color='#00bfff'size='1.4'>Officer: </t> <t size='1.4'>TEXT</t>", "PLAIN DOWN", -1, true, true];
};
lone glade
#

spawn the AI directly on the machine you want them on.....

lapis nest
#

so the second "spawn wasnt needed? I should learn how to code haha

faint burrow
#

I believe so.

lone glade
#

or switch the locality of the group leader

lapis nest
#

works. Thank you. I will name a character after you

indigo snow
#

the speed difference is negligible even in a pretty much empty code block

#

as soon as you start executing more code within the loop

#

its negligible

scarlet tiger
#

Need some help with certain trigger actions

last cave
#

Can someone help me to turn the array into this.

[["30Rnd_65x39_caseless_mag",2,30],["30Rnd_65x39_caseless_mag",2,24],["30Rnd_65x39_caseless_mag",1,2],["Titan_AA",1,1]]

I collect all the magazines to store them in the database, so I want to reduce the length of the array code.

_mag=magazinesAmmoCargo  cursorTarget; //The result and you need to turn it into what is written above
[["30Rnd_65x39_caseless_mag",30],["30Rnd_65x39_caseless_mag",30],["30Rnd_65x39_caseless_mag",24],["30Rnd_65x39_caseless_mag",24],["30Rnd_65x39_caseless_mag",2],["Titan_AA",1]] // <-- _mag
faint burrow
last cave
#

I'll have to modify the function so that the number is between the string and the bullets.hmmyes

#
_mag =magazinesAmmoCargo  cursorTarget; //[["30Rnd_65x39_caseless_mag",30],["30Rnd_65x39_caseless_mag",30],["30Rnd_65x39_caseless_mag",24],["Titan_AA",1]]
_result=_mag call 

{ 
    
    if !(_this isEqualType []) exitWith {[_this, "isEqualType", []] call (missionNamespace getVariable "BIS_fnc_errorParamsType")}; 
    
    private _cnt = count _this; 
    private _cntNil = count (_this - _this); 
    private _ret = []; 
    
    {_ret append [[_x # 0, _cnt - count (_this - [_x]),_x # 1]]} count (_this arrayIntersect _this); 
    
    if (_cntNil > 0) then {_ret pushBack [nil, _cntNil]}; 
    
    _ret
}
//_result = [["30Rnd_65x39_caseless_mag",2,30],["30Rnd_65x39_caseless_mag",1,24],["Titan_AA",1,1]];
// {_ammobox addMagazineAmmoCargo _x; } foreach _result;

Rdy hmmyes

grizzled cliff
#

@candid sun no, but when using macros like GVAR(_protected) it expands out to tag_sys__protected

#

which is nice for FUNC too because then the filenames are going to be fnc__protected.sqf

#

which makes it all the more noticable to people working with your code that this is something different

eternal spruce
hallow mortar
#

You need to use attachTo to attach it to an appropriate memory point or selection on the vehicle. You can use selectionNames to find candidates.

deft zealot
#

for zeus created units?

eternal spruce
#

Ok gonna do some research on that

#

@hallow mortar i checked out the wiki https://community.bistudio.com/wiki/selectionNames and i ran the line of code in the debug console and got this in return

["proxy:\a3\data_f\proxies\truck_heavy\driver.001","wheel_1_1","wheel_2_1","wheel_1_2","wheel_2_2","steeringwheel","fork_1","fork_2","loadbed","light_01","light_02","camo_01","zbytek","wheel_1_1_hide","wheel_1_2_hide","wheel_2_1_hide","wheel_2_2_hide","gas_pedal","reverse_light","daylights","reflectors","mph","fuel","rpm","throttle_handle","fork_handle","decal","id_number_00","id_number_01","proxy:\a3\data_f\volumelightcar.002","proxy:\a3\data_f\volumelightcar.001"]

is this what I'm suppose to look for as the memory point?

blissful current
#

Whats a good way to get an AI to not move in a multiplayer evironment. I am trying disableAI MOVE which seems to work but enableAI MOVE wont unfreeze him.

faint dove
#

ahhh i see, thanks for the explanation @grizzled cliff

granite sky
#

Normally it does?

lapis nest
#

how to make a trigger fire when ai in said trigger changes behaviour mode?

indigo snow
#

@deft zealot you basically want to keep a unit local to where it was created

fair drum
blissful current
# granite sky Normally it does?

I think I know whats going on I have a trigger thats server only and player distance pilot <10; in the condition field that lets the AI move.

granite sky
#

well, player not existing on the server would be a problem.

blissful current
#

indeed

scarlet tiger
#

So i have multiple zones set so that when controlled by independents they will complete my zone control tasks, and if they are taken(Opfor control) the tasks are changed to failed, like they are going back and forth taking control of the area. The problem is that if the zones are controlled fully(All zones captured) once but some are taken back by the enemy the trigger doesn't count the newly lost zones and fires anyway. I want the independents to successfully hold all zones AND eliminate all enemy forces, but since i have the zones controlled by IND from the start and they manage kill all the Opfor before retaking the lost zones the trigger activates prematurely. How to fix??

Isn't there a script line for checking or counting if said triggers activated/tasks complete?

hallow mortar
fair drum
scarlet tiger
#

ty

lone glade
#

units in a group are local to the machine the group leader is local to

#

just switch the leader locality....

#

and units are local to the machine they're created on

last cave
#

Interesting bug in Local texture.
I rejoin in lobby and rejoin in server but anyway after setunitloadout unit in local have texture uniform. (but no have in inventory)
mb need wait complete loading screen thonk (example "time >5")

meager granite
#

I didn't get anything, what are the repro steps?

meager granite
#

Any ideas how to reliably tell if weapon is a horn? 🤔

#

Looking at vanilla and mods they use default string for displayName, could check getTextRaw against horn string name, but that won't cover some mods that might use custom name

warm hedge
#

I'd check if that uses a lethal magazine, does it use FakeMagazine though?

meager granite
warm hedge
#

Duh...

meager granite
#

SOG:PF horns have magazines though as car horn don't work on non-car vehicles 🤔

little raptor
#

A "horn" is just the dry sound of the weapon firing

warm hedge
#

Which means it's hard to detect if it is

meager granite
#

SOGPF horns gonna need more complex checks

#

they have simulation="sound" in them but there is nothing like it in vanilla, I guess this does nothing

little raptor
#

From what I see reloadTime is 0 for horns (not sure how reliable it is)

#

There's also enableAttack 0 (probably for AI) and canLock 0

warm hedge
#

I'd ask "But why?" too. Why you need to check a horn?

meager granite
warm hedge
#

By reliability, I'd say blaming someone who thought it is a good idea two decades ago is reliable

meager granite
#

Mod-level solution for something that should've been in-engine bohemia_interactive

ivory lake
#

horns are a shitshow - im pretty sure they're exclusive to car sim too

#

like I don't think they work on tanks for example

meager granite
#

Yeah, that's why SOGPF horns on boats do use mags

ivory lake
#

Yeah

#

I don't even know WHY this is the case because it's just a 'drySound'

#

its like the tank sim is excluded from it

#

eh, all other sims*

meager granite
#

I guess it is in-engine then, so its both mod-level hacky stuff AND in-engine bit that only works for one specific simulation kind

#

Even worse

#

Arma bad

deft zealot
#

yes but i know zeus who disconnect to move the units to the server

#

i just wnat to give them back if he reconnects

proven charm
tired cargo
#

Hi guys !

Is it real to calculate distance between player and missile from vls ?

#

Or find out the missiles flight time to the target ?

flint topaz
tired cargo
lone glade
#

back to .... zeus ? you mean just make them appear ?

warm hedge
#

speed velocity etc

deft zealot
#

no i am talking about locality

lone glade
#

why the fuck would you want to switch locality to a player when you have a HC ?

#

it's increased network traffic for no gains.

flint topaz
#

It should also be in the ammos config aswell as max speed

deft zealot
#

do i have a HC?

blissful current
proven charm
sweet jungle
#

every one can figure out what is wrong on these scripts

#

script is loaded in game, but it didn't lock any turret, and no warning no error, nothing changed

granite sky
#

What's [0,2] supposed to be?

obtuse depot
#

cuz that’s what the wiki has iirc

faint burrow
#

AFAIK Abrams tank may have such turret path, so such a path is possible.

#

In any case, you need to make sure that a turret path is correct.

proven charm
#

and _vehicle local

hallow mortar
# obtuse depot cuz that’s what the wiki has iirc

If there was only one possible value for that argument, there wouldn't be any point in letting you specify it.
That argument is the turret path, a way of specifying which turret you want to lock within the vehicle's hierarchy of turrets. [0] is the first turret on the base hull; [0,2] is the third turret on the first turret on the base hull. It's unusual for vehicles to have that many sub-turrets on one turret, but it is possible, and [0,0] is certainly not the only correct turret path.

ivory lake
#

isn't too crazy. spearhead tanks 0,2 is the pintle MG turret path for the commander/loader

#

0 gunner, 0,0 commander, 0,1 loader, 0,2 pintle mg

sweet jungle
#

the turret path is correct, because it works in class UserAction

#

the hatch script works, it allow player get in commander turret after get out from commander mg

faint burrow
#

Try to replace _vehicle by _this.

stable dune
sweet jungle
#

no, it just doesn't work

half juniper
#

simple question or stupid one, how make Ai enter helicopter and start up but not take off_

stable dune
winter rose
stable dune
sweet jungle
half juniper
sweet jungle
#

why my arma3 dev updates this time

#

100mb size updates

hallow mortar
fair drum
half juniper
faint burrow
ornate whale
#

What is the best and easiest way to loop a positional sound? playSound, if I am not mistaken, plays only once. So I need createSoundSource, right?

hallow mortar
#

"need" is a strong word

#

That's one way to do it, but you can also just make a while loop

ornate whale
sharp grotto
#

For each type of soundsource yea

ornate whale
#

And there is probably no way of CfgVehicle pointing to a normal CfgSound, only to CfgSFX?

sharp grotto
# ornate whale And there is probably no way of CfgVehicle pointing to a normal CfgSound, only t...

idk, why bother.
add to description.ext and done

class CfgSFX
{
    class rummagingCorpse
    {
        name = "Exile Client Rummaging";
        sounds[] = {"noise01"};
        noise01[] = {"sfx\rummaging.ogg",db+10,1,20,1,0,0,0};
        empty[] = {"",0,0,0,0,1,3,5};
    };

};

class CfgVehicles
{
    class Exile_Sound_Rummaging {sound="rummagingCorpse";};
};
private _soundSource = createSoundSource ["Exile_Sound_Rummaging", ASLtoAGL (getPosASL _corpse), [], 0];
hallow marsh
fair drum
drowsy geyser
#

attachTo example 3 says “automatic offset”.
Does anyone know how to keep this offset but just adjust the height?
Because when I use example 3 it aligns the object perfectly to the surface, but when I do this:
_obj attachTo [player, [0,0,0]];
The object is below the surface

torn stream
#

I'm trying to make a vehicle spawn at a specific location, with a pre-defined variable, via an addAction, but my vehicle doesn't spawn at the precise location i want it to spawn, any reason why?

reconUAV setDamage 1; 
        private _reconUAV = "mavik_3T_BLU" createVehicle [10966.8,7605.22,1.215247];  
        reconUAV = _reconUAV;
        publicVariable "reconUAV";
        [_reconUAV, "reconUAV"] remoteExec ["setVehicleVarName"];

#

i got this code from a forum

sharp grotto
torn stream
#

ty

graceful kelp
#

need some help on an error

_canvasCtrl drawRectangle
    [ _ctr
    , (_width/2.8)*vectorMagnitude _canvasVect
    , (_length/2.8)*vectorMagnitude _canvasVect
    , _dir
    , [1,1,1,1]
    , format (["#(rgb,8,8,3)color(%1,%2,%3,%4)"]+_color)
    ];
#
 2:15:39 Warning Message: Cannot load mipmap #(rgb,8,8,3)color(0,1,0,1)
sacred turret
#

Is there a way to end functions prematurely (e.g. void return)? Should I avoid using it?

graceful kelp
sacred turret
#

Sorry man, I don't know how to help you; I was asking a question of my own 😅

graceful kelp
sacred turret
graceful kelp
#

exitwith yh

eternal spruce
#

I'm still having issues trying to animate an attached bomb/missile to a bomb loader to be sync together.
this is the code i used
GBU_4 attachTo [BombLoader_1, [0,2,-0.7], "loadbed", true]; GBU_4 setDir 90;
"loadbed, fork_1 and fork_2" are the likely attach points to use but none seems to work, is there something wrong with the code I used or is there something else that I'm missing?

graceful kelp
#

it will just be the wrong mempoint

#

it will only move if there is a mempoint actualy moving

#

the bed being animated dosent necessarily meant the mempoint it moving

#

worst case you could interpolate the offset position between the up and down based on the animation

eternal spruce
#

@graceful kelp i'm not sure what you meant by interpolate the offset position

ornate whale
#

Do you know why removing all items and gear from newly created units via script right after spawning does not remove their facewear (balaclavas)? Is it possible that the class gear is being added to a unit even after the createUnit commad has finished, ie. overrinding my gear? Because when I appply the script that removes all things from a unit via debug console during the game, it works OK.

//Example
_newGroup = createGroup opfor;
private _newUnit = _newGroup createUnit ["CUP_O_RU_Soldier_MSV_VSR93", position player, [], 5, "NONE"];
removeAllContainers _newUnit; //Backpack, vest, uniform.
removeAllWeapons _newUnit; //Guns.
removeAllAssignedItems [_newUnit, true, true]; //All assigned items (including facewear).
_newUnit;
//Units still keep the balaclavas on their faces.
graceful kelp
#

you might also need to do that so it moved fowards and backwards a bit

#

this would need to be in a perframe handler

blissful current
#

if you deletevehicle trigger will a JIP player have a copy of it and can potentially trigger it?

#

Im trying to find a work around for this anyplayer present trigger. Condition is player distance pilot <10; . The activation fires some sound files, system chat, and enableAI "PATH", among some other things. Im trying to find a way that JIP players would trigger all that stuff from happening since they will easily satisfy the condition.

although setting the trigger to server only would solve the JIP issue, I cant do that because it would never fire because player in the condition field wont work

fallow pawn
#

As for the condition, try going through a list of players and to check the presence of at least one

#

Maybe something in the realm of:
allPlayers findIf {_x inArea myTrigger} > -1

#

Then you can have it only serverside

blissful current
#

Interesting. This might work for me. Except I don't want the trigger to fire with players in the area. but if i replace that with a marker that might work

torn stream
#

what am i doing wrong here? my current problem is that the interaction doesn't appear at all, the Object is currently a ducttape just to see if the action appears

_Hackersman = ["Hackerman","Hackerman", "", {player setUnitTrait ["UAVHacker", true];},{true}, {}, [0,0,0], 100] call ace_interact_menu_fnc_createAction;
[Hacker, 0, ["ACE_MainActions"], _Hackersman] call ace_interact_menu_fnc_addActionToObject;
last tapir
#

can i change variable type in SQF? like, initialize a variable as string:

_var = "foo";

and then change it to, lets say array?
_var = [2, _var];

last tapir
#

awesome!

#

thanks

willow shore
#

In the dev branch there is getBoneNames, I save this as a variable, then copy it to clipboard, then can paste it in a text file to get all the bone names, how come when using certain bone names as the mempoint and attachTo with followBoneRotation being true, objects don't attach to the correct bone?

#

I'm assuming a memPoint is a bone name.

meager granite
willow shore
meager granite
#

Example uses RightForeArmRoll which is returned by selectionNames so it must be it

willow shore
meager granite
#

Name memPoints suggests its Memory LOD

willow shore
meager granite
#

"spine3" in (player selectionNames "Memory") => true

#

Each uniform changes unit selection names btw, it could be modded uniform with non-standard names

#

Vanilla uniforms are all "uniform" with selection naming nowadays

willow shore
#

Ok, I think I understand it now, thank you very much!

meager granite
#

I think bones are different from memory points
Don't quote me on that, I'm a nobody when it comes to models, maybe somebody with better knowledge can explain

willow shore
acoustic abyss
#

I'm trying to penalize players for looting enemy weapons by simulating unfamiliarity. Using https://community.bistudio.com/wiki/setUnitRecoilCoefficient partially solves it.

I also thought of drastically increasing the reload time. The command https://community.bistudio.com/wiki/setAnimSpeedCoef controls animation such as running, but as the BIKI says, not "upper body animations (reloading, etc.)".

Is there another command that specifically affects those animations?

meager granite
#

GIB setGestureSpeedCoef

little raptor
#

Engine doesn't have gesture speed coef

#

Tho it doesn't seem it would need much work to add

little raptor
meager granite
#

As well as for cinematics and such

zealous solstice
#

@lone glade no he want to move the AI that spawnd with Zeus to the server

high marsh
#

is the function parameter in Params class JIP? I know it's executed globally upon mission start

proven charm
deft zealot
#

no i want to move them back to zeus

tired cargo
#

Hi guys!

What does it mean ? <no shape>

I used: attachedObjects player

cosmic lichen
#

could be a trigger

tired cargo
#

How does this happen ? When a player enter into the trigger, the trigger attached to him ??

stable dune
#

Maybe you could collect from an attached array of your objects,

_objects = attachedObjects player findIf {typeOf _x == "yourWantedType"};
if (_objects != -1) then {
  //do stuff if attached object is x
}
tired cargo
#

Thank you so much
I never would have thought that the trigger would attached when activated

hallow mortar
#

It might not be. It could be some other kind of invisible placeholder thing, maybe from a mod or something.
Triggers don't attach themselves to objects that activate them by default. There would have to be a script actively doing that.

tulip ridge
#

Just check the type of object

manic flame
#

How can I force the AI to not turn off the engine when stationary?

#

Im trying to make enemy vehicles visible in thermals lol

faint burrow
manic flame
#

yeah but AI turns it off after a minute @faint burrow

faint burrow
#

Use a loop where check if engine is turned off.

manic flame
#

That's the issue im having, and init scripts dont allow suspending so I cant make a loop.

I tried the following though;

[] spawn {
  while { true } { 
     this engineOn true;
     sleep 1;
  };
};

But it says this is not a variable.

#

(Init box)

faint burrow
#

It's true.

manic flame
#

So.. any alternatives?

faint burrow
#

Pass vehicle object into the script.

hallow mortar
#
this spawn {
  while { alive _this } do {
    _this engineOn true;
    sleep 5;
  };
};```
manic flame
#

this is passed onto the spawn as _this?

faint burrow
#

Yes in this case.

hallow mortar
#

Yes, although the names aren't causally connected - inside a script scope, the autogenerated variable _this contains all the arguments that were passed to the script. In this case, there is only one argument, the object reference that was in this in the init field, so we can just use _this directly.
If we'd passed an array of arguments, e.g. [this, 10] spawn { ... then _this would contain that array and we'd need to use select or params to grab the right element.
https://community.bistudio.com/wiki/Variables#Scopes

manic flame
#

I see, thanks.

blissful current
#

is there a command to disable the simulation of an object?

I have a missile launcher in my mission that shoots down an aircraft. Afterwards it aims the big missile at players LOL. I was thinking of using a trigger to somehow disable it from moving so that it wont break immersion.

hallow mortar
#

Yes, disableSimulation, although you might prefer disableAI (or just deleting the launcher's crew) if you'd like it to remain destructible

#

Sorry, it's actually enableSimulation with true/false for on/off

blissful current
#

SOG:PF uses this one. I will give your advice a try!

hallow mortar
#

I know it doesn't look like it has a crew, but it does, it's just an invisible UAV brain unit

blissful current
hallow mortar
#

Use crew (for disableAI) or deleteVehicleCrew (for...deleting)

blissful current
#

No effect for this one either.

samlauncher disableAI ALL;

Ill try the deleteVehicleCrew now.

hallow mortar
#

* you might also need to use remoteExec depending on where the unit is local and where the script is running - disableAI is Local Effect

eternal spruce
blissful current
#

No effect for this one either. I just had an idea. below will be a picture of the group the unit is in. I think these other units are needed for the function of the missile so maybe I try to diable those instead. But first I try your other examples Nikko

samlauncher deleteVehicleCrew samlauncher;
acoustic abyss
acoustic abyss
blissful current
hallow mortar
#

Yes, remove the ammo with setVehicleAmmo and it won't have any missiles to reload

blissful current
hallow mortar
#

Yes, the action code is run only on the machine that activated the action

little raptor
#

Making tickets doesn't annoy anybody. At worst it gets ignored

blissful current
hallow mortar
#

The forEach structure is not one of the arguments of disableAI; you don't put that in the remoteExec.

#

The original formulation is composed of these two sub-structures:

{ } forEach crew samlauncher;
_x disableAI "ALL";```
The `disableAI` is the only part you're trying to convert to a remoteExec. The `forEach` remains as it is.
```sqf
{
  [_x,"ALL"] remoteExec ["disableAI",0,true];
} forEach crew samlauncher;```
graceful kelp
#

in the vehicle init

blissful current
faint burrow
#
{ { _x disableAI "ALL"; } forEach (crew samlauncher); } remoteExec ["call", 0, true];
blissful current
#

How would I go about searching for animations? I'm looking for a "pilot takes helmet off" animation.
Its implementation would look something like:

pilot playmove "Takes Off Helmet";
Sleep 1;
removeHeadgear pilot;
hallow mortar
#

There's an animation viewer in the Editor tools menu

#

Which reminds me:
@little raptor have you ever considered asking POLPOX if you can put their improved animation viewer from the Artwork Supporter into Advanced Developer Tools? It's substantially easier to use than the BI version, not to mention faster, and would be really useful for development stuff.

neon plaza
#

Trying to get this line of code so that players spawn In the vech when the fast travel as to outside

#

 
this addAction ["Teleport to Medical Truck", {  
params ["_target", "_caller", "_actionId", "_arguments"];  
if (vehicle b_medical_truck != b_medical_truck) then{ 
    _caller moveInAny (vehicle b_medical_truck); 
}else{ 
     _caller setPosASL (getPosASL b_medical_truck);  
}; 
}, nil, 1, true, true, "", "true", 5]; 
warm hedge
#

And where is your issue/question

neon plaza
#

One second

#

Polpox J3FF helped us a year ago to write this line of code that would allow players to fast travel to a different player acting as an officer. We are trying to modify the code so that we can have the player fast travel to the truck and spawn IN the truck. As of now that line of code above cause players to fast travel to the truck. The Issue we have Is they are glitch In the truck and should fast travel INSIDE the truck.

#

I am trying to modify It so that It will allow players to fast travel In the truck Is all.

warm hedge
#

Your wordings is very confusing so I can't really understand what's the point

neon plaza
#

We need a line of code that will put the player In the truck

#

This Is all

warm hedge
#

And what your current code does

neon plaza
#

The code provided above allows players to fast travel to the truck but not inside the truck

warm hedge
#

Then it does mean that if statement is wrong

neon plaza
#

How would this be wrote In correct format?

warm hedge
#

IIRC using vehicle to a vehicle simply return objNull. Which means it always return false

blissful current
# neon plaza How would this be wrote In correct format?

I dont have a specific answer for you because Im a novice but I have this code which puts players in a vehicle. You could try to adapt it to your needs.

{
    if (vehicle _x == _x) then {
        _x moveInAny vehicle;
    };
} foreach units playerGroup; //moves all player to inside vehicle.
warm hedge
#

Doesn't your if does only if they're in the vehicle?

#

Oh sorry misread

blissful current
neon plaza
#

Lets give this a try

blissful current
# neon plaza Lets give this a try

And since Im new I like to make things simple to start then add. So try this and see what it does first:

this addAction ["Teleport to Medical Truck", {  
    {if (vehicle _x == _x) then { _x moveInAny b_medical_truck;};
          } foreach units playerGroup; //moves all players to inside vehicle.  
}; 
}, 
nil, 
1, 
true, 
true, 
"", 
"true", 
5];
neon plaza
#

Its still the same result. Player fast travels to truck but on the bottom of the truck glitched In It as to spawning Inside a passenger seat

warm hedge
#

playerGroup there is undefined then no?

#

And the last code does not have any setPos. Which means you're not running that code but your old one

neon plaza
#

We had a line of code that worked with the officer that Is very similar that was created by J3FF on request from me. I will post It.

#

It works perfect. If the officer Is In a car the player will fast travel to the officer and be placed Into the car

#

Here the code...

#


this addAction ["Teleport to Officer", {  
params ["_target", "_caller", "_actionId", "_arguments"];  
if (vehicle BlueForCommander != BlueForCommander) then{ 
    _caller moveInAny (vehicle BlueForCommander); 
}else{ 
     _caller setPosASL (getPosASL BlueForCommander);  
}; 
}, nil, 1, true, true, "", "true", 5]; 

#

All we are tyring to do Is make It so that the medical truck players fast travel to, the script will place them Inside the car and not outside.

warm hedge
#

Why you want to post a very unrelated code when you aren't even trying that this time?

warm hedge
neon plaza
#

Understood. I have to find a script that will.

warm hedge
#

...?

neon plaza
#

Everything works

#

just the player spawns outside the car

#

This Is why we are here asking

#

Its just that one...thing

warm hedge
#

Why don't you just try Fox's code then?

neon plaza
#

I did use foxes code

#

It did what the last code I posted did. It allows you to fast travel to the medical truck but It spawns you outside

warm hedge
#

Are you sure? 100%? Because Fox's last code does not have setPos

neon plaza
#

I can try again

blissful current
neon plaza
#

I thank you. Jeff has responded. I am speaking to him now/

#

Thank you both

blissful current
#

So I have this in my initServer. Its a loop that updates some marker positions on the map. It works great. But since its a loop I was worried about performance issues. Maybe I dont need to be worried. I dont know. But I was wondering if there was a way to turn the loop on and off at will perhaps with a publicvariable?

[] spawn {
    private _offset = [(sin(random 360) * random 100), (cos(random 360) * random 100), 0];
    while {true} do {
        "PilotArea" setMarkerPos (getPos pilot vectorAdd _offset);
        "RescuePilotText" setMarkerPos (markerPos "PilotArea");
        sleep 1;
    };
};
granite sky
#

Depends how many similar things you're running, but unless it's in the hundreds then it's probably not worth worrying about. Swap getPos for getPosATL though, as the getPos is the slowest thing in the code.

scarlet tree
# neon plaza Here the code...

Actually the old code is useful because it helps understand where you made the error. Your commander used to be a character, and the check (vehicle _x != _x) determines whether the character is on foot or in a vehicle. The logic being that in Arma the vehicle of an on-foot character is the character itself. The code goes on to provide two alternative executions: one for if the commander is in a vehicle and the other when they are not. You don't need that check or those alternatives if the respawn target is a vehicle.
So, instead of the whole if then statement just put: _caller moveInAny b_medical_truck

#

Sorry for the unformatted code, I'm on mobile.
And I understand you probably got your issue resolved already but I hope my response can help someone else.

neon plaza
#

I am trying to add a sleep timer to this @scarlet tree

#

The timer should be for 1 hour and then It can be used again.

#

this addAction ["Teleport Truck", 
{
    params ["_target", "_caller", "_actionId", "_arguments"];  
    [true] remoteExec ["openMap", _caller];
    
    _caller onMapSingleClick {
        b_medical_truck setPosASL (AGLToASL [_pos #0, _pos #1, 0]);
        _str = (format["%1%2%3%4%5%6%7", "<t color='#ffffff' size='3'>", "Truck teleported to: [",round (_pos #0), ",", round (_pos #1), "]", "</t>"]);
        titleText [_str, "PLAIN DOWN", 0.25, true, true];
        [false] remoteExec ["openMap", _this];
    };
}, nil, 1, true, true, "", "(str(side _this) == 'WEST')", 5];

#

as of now the player can keep teleporting this

stable dune
# neon plaza The timer should be for 1 hour and then It can be used again.

You could just add variable time+3600 to object.
something like

this addAction ["Teleport Truck", 
{
    params ["_target", "_caller", "_actionId", "_arguments"];  
    openMap true;
    _caller onMapSingleClick {
        b_medical_truck setPosASL (AGLToASL [_pos #0, _pos #1, 0]);
        _str = (format["%1%2%3%4%5%6%7", "<t color='#ffffff' size='3'>", "Truck teleported to: [",round (_pos #0), ",", round (_pos #1), "]", "</t>"]);
        titleText [_str, "PLAIN DOWN", 0.25, true, true];
        openMap false;
    };
    _target setVariable ["HBZ_time",time+3600];
}, nil, 1, true, true, "", "(str(side _this) == 'WEST') && _target getVariable  ['HBZ_time', 0] < time", 5];

And you dont need remoteExec on client, because addaction stament is local, and it will be executed on client machine where its used.

velvet merlin
#

what are ways to get addActions duplicated?

#

selectPlayer use, respawn from old to new body, teamswitch?

hallow mortar
#

Ill-conceived remoteExecs

half juniper
#

so with flyInheight0 does work but the helicopter does fly up first then it goes down and stays at 0 m. Is there a way to avoid the flying up?

little raptor
little raptor
half juniper
little raptor
#

I mean like this:
heli flyInHeight [x, true]

half juniper
#

Oh you have to type it like that?

#

With the brackets?

little raptor
#

There's an alternative syntax

#

See the wiki

hallow mortar
ornate whale
#

I have a problem that passengers are disembarking, thus the vehicle is not following its waypoints, when they spot an enemy. Do you know how to prevent this from happening? It happens even if the target is out of the line of sight. I tried disabling COVER and TARGET, but it doesn't help. I don´t necessarily want to turn all AI features off or lock the vehicle. Thanks

hallow mortar
#

Try setUnloadInCombat

ornate whale
jovial aspen
#

hi

#

so i have this script

zCurator addEventHandler ["CuratorObjectPlaced", {
  params ["_curator", "_entity"];
  _unitName = typeOf _entity;
  private _message = format ["%2", _curator];
  _message remoteExec ["diag_log", 2];
  if (_unitName == "ModuleEndMission_F" || _unitName == "zen_custom_modules_33") then 
  {
    isEndex = true;
    publicVariable "isEndex";
  }
}];
#

it logs the curator's placed objects

#

my issue is, there are times that players get promoted to zeus

#

the zCurator is a placed object in the eden

#

how do i go about promoted zeus?

frozen seal
#

Does anyone have any suggestions how I could go about reproducing a bug that only occurs when there are at least 5-6 players on the server? Do I just run 6 instances of arma on my PC and pray that it does not explode?

fair drum
jovial aspen
#

never knew allcurators existed and ive been scripting for 2 years :v

frozen seal
frozen seal
sacred turret
#

Are there any utility functions to populate a crate with ammunition and supplies for a specific unit (not a class, but an instance)? Just trying to not reinvent the wheel, BIS_fnc_spawnVehicle helped me a lot

granite sky
#

@frozen seal The usual trouble with simulating multiple players is that Arma won't allow more than one player to connect with each steam UID unless you enable loopback in the server config.

#

And if you do that, only 127.0.0.1 works.

frozen seal
fair drum
#

Best to use GitHub

granite sky
#

I'd take the offer. At that point the first thing you want to do is get a second pair of eyes on your code to spot potentially problematic things.

frozen seal
granite sky
#

Localhost might have different rules. Personally I couldn't make localhost + client work at all.

#

If it does work for you then maybe spamming clients with the launcher could work.

frozen seal
# fair drum Best to use GitHub

alright I appreciate, I do have it in a local git repo but it's been a while since I pushed anything to github because it keeps complaining about my SSO credentials and I can't be bothered.
But I'll try to fix it and push the repo.

tired cargo
#

Hi guys!

Can't understand why are the 2 sound playing instead of one

{
    switch (side _x) do
    {
        case east: { ["Game_Lose"] remoteExec ["playSound", _x]; };
        case west: { ["Game_Win"] remoteExec ["playSound", _x]; };
    };
}
forEach playableUnits;

hallow mortar
#

If this is locally hosted MP and the unit on the other side is an AI, then both your player and that AI playable unit will be local to your machine, so both remoteExecs will be sent to your machine

still forum
#

Nvm dedmen can't read

tired cargo
hallow mortar
#

Mostly.
If any playable units on the same side are AI, then they'll be local to their group leader and the group leader will receive multiple of the same remoteExec, so they could still get duplicate sounds if you have AI turned on for playable slots.

tired cargo
#

But I have similar case, and in it everything work fine:


switch (_hostage) do 
{
    case hostage_1:
    {
        {
            if(side _x == west) then
            {
                ["AreaLeaveHostage_one"] remoteExec ["playSound", _x];
            };
        } forEach playableUnits;
    };
...
hallow mortar
#

Well, you've only got one possible sound there, so it would be harder to notice.
If there are multiple playable units, then it's quite possible you are hearing the same sound multiple times, but when that happens it just makes it louder, so you might not be able to tell easily.
(because the remoteExec is only travelling internally in local MP, it can happen on the same frame)

tired cargo
#

So, with local test, I hear two sounds: one, because of my side, and one, because I am a server, right ?

hallow mortar
#

You'll hear as many sounds (or copies of the same sound) as there are playable units that are local to your machine. AI are typically local to the server, or to their group leader if their group leader is a player, and remoteExecs targeting playable AI units go to the machine where those units are local.

#

You send a remoteExec to the machine where each playable unit is local.
When you're hosting a game alone with AI turned on for the playable slots, all those AI units are local to you.
So you receive every remoteExec being sent, which is one per playable unit.

#

On a dedicated server, things still work the same way, but the playable units will be local to different machines.
Units that are actually inhabited by a player will be local to that player's machine, so that player will receive the remoteExec targeted at them.
Units that aren't inhabited by a player and whose group leader isn't a player will be local to the DS, and the DS will receive all remoteExecs targeted at those units. Fortunately the DS doesn't care about hearing all these sounds.
Units that aren't inhabited by a player and whose group leader is a player will be local to their group leader, and that player will receive all remoteExecs targeted at those units, in addition to their own.
* units that aren't inhabited and don't have AI enabled for their slot don't exist, and so aren't counted

tired cargo
#

If not playable unit will be in player group, the player get two remoteExec instead one ?

#

Because of locality unit - player leader

hallow mortar
#

Well, it depends on the remoteExec. Your remoteExec only targets playable units, so a non-playable AI wouldn't have a remoteExec sent to where it's local.
If you did have a remoteExec that also targeted non-playable AI, then yes, the machine where they are local would receive as many remoteExecs as it has targeted units.

blissful current
#

I'm using POW2 setHit ["legs", 0.5]; to simulate a limp on an AI unit. But players can heal this unit removing the limp. What would be a solution to stop the unit from being healed and keeping the limp animation?

hallow mortar
#

In theory, a handleHeal EH can prevent heals, but at the moment that part of it seems to be broken, to be fixed in 2.18

#

You could still use a handleHeal to simply immediately do setHit again upon being healed

frozen seal
blissful current
frozen seal
#

things I have to do to reproduce a bug.
Sadly my PC was not able to launch 9th instance of Arma

#

bad news: the bug did not reproduce on the local server. Probably the bug is dedicated-only. I am so screwed 😢

granite sky
#

Can you give a rough description?

granite sky
blissful current
granite sky
#

you'll need to spawn it too. Can't sleep in an EH.

blissful current
hallow mortar
#

spawn INSIDE the EH code

#

Also, you can use the _injured variable provided by the EH rather than hardcoding it to POW2 specifically (though you'll need to pass it as an argument into the spawned scope)

blissful current
#

ahhh just the sleep then

hallow mortar
#
this addEventHandler ["HandleHeal",{
    params ["_injured"];
    _injured spawn {
         sleep 1;
         _this setHit ["legs",0.5];
    };
}];```
blissful current
#

And its a while loop which scares me cause I already have 1 while loop in my mission and I don't know how many will hurt performance. Though @granite sky has assaged my fears some since he mentioned you need hundreds.

compact vortex
#

I don't see the last postet script having much of an impact. Its only 1 command every 1 seconds

blissful current
#

Leon! Nice to see you in here!

#

I'm making a SOG mission. I'd love to have you try it when its ready. Did you see Spearhead is going to do a big update?

granite sky
#

hmm. I guess handleHeal fires at the start of the heal animation?

#

surely not...

compact vortex
granite sky
#

Ah shit, it actually does. There's no EH for when the heal is actually applied at the end of the animation.

#

I guess you could just sleep for longer.

blissful current
#

Like time the heal animation and match the sleep time to that?

granite sky
#

well, it doesn't really matter if it's a bit off.

#

just as long as it happens afterwards.

#

If the guy doesn't limp for a couple of seconds then that's not a problem, right

blissful current
#

Well when the heal animation finishes the unit gets fresh clothes. So you would see: Bloodly > fresh > bloody if not timed properly is my guess.

#

Ill try it right now.

fair drum
#

Theres an event handler for detecting when an animation is done

blissful current
granite sky
#

Might need to wait a frame or two. You're not gonna find any documentation on exactly when the engine applies the healing relative to the animation.

blissful current
#

the sweet spot is sleep 7 for this heal animation.

fair drum
#

Remember what we talked about with how it's not guaranteed to be 7 seconds

#

John is suggesting a frame delay instead.

blissful current
#

I'm unfamiliar with what frame deplay is. I do see the AnimDone EH on the wiki. Gonna try this real quick

granite sky
#

Are there multiple heal animations used here?

blissful current
#

Im not sure. but its default ARMA

#

Triggered every time an animation is finished. Triggered for all animation states in a sequence. This means that the EH would be for the unit doing the healing not the unit being healed though right?

granite sky
#

Well, so's the HandleHeal

#

wait

#

what the fuck

#

oh right, added to target but fires local to healer.

#

I guess that makes some kind of sense.

blissful current
#

I'm overwhelmed, LOL. I'm moving on. This is the least jank part of my mission (And I've spent 2 hours already) so the EH that Nikko wrote is good enough. And I can always come back for a polish pass later and revisit the issue.

#

Thank you for the help everyone! 🫡

ornate whale
#

Is it possible to prevent player from being moved to sideEnemy (renegade) when doing an illegal action? Especially in MP, where you are then no longer a squad leader, and the AIs are just standing doing nothing?

granite sky
#

You can use a rating EH to prevent rating changes:

player addEventHandler ["HandleRating", {0}];
tulip ridge
#

Not my internet points
Could also just prevent it from going negative

acoustic abyss
sacred turret
#

is "Steerable_Parachute_F" exclusively for units while "B_Parachute_02_F" exclusively for vehicles? Is there a command to distinguish between the two? typename seems to reduce both to "Objects" and getObjectType doesn't seem to be for this

sacred turret
#

but let's say, one is a rifleman and another is a rifleman AT

#

it will return different values, no?

winter rose
#

you can get the "vehicle" in which they are

typeOf vehicle player = "Steerable_Parachute_F"

sacred turret
#

it is a function that creates and deploys a parachute at a given object

#

I was trying to make it work for both units and vehicles, but I don't know how to distinguish them

faint burrow
#
_parachute = if (_unit isKindOf "CAManBase") then { "Steerable_Parachute_F" } else { "B_Parachute_02_F" };
sacred turret
#

thanks!!

fair drum
#

alternatively

_parachute = ["B_Paracute_02_F", "Steerable_Parachute_F"] select (_unit isKindOf "CAManBase");
ornate whale
#

What would be the final skill level if an AI unit had 0.7 set via Eden skill slider, but a player set the global skill level to 0.4?

fair drum
#

test it in your mission

granite sky
#

but yeah, if you can test it yourself.

#

skillFinal

jade abyss
#

Wich is a HC (Headless Client) or a Player?

velvet merlin
#

Ref to nonnetwork object 735298: <no shape>

#

from what i understand this indicates sqf command tying to interact with non local entity (FX object here)

#

what i dont get, why this gets logged in eden hosted - yes its MP, but you are server+client. so its not remote

#

or is it rather the sqf command expects an object that needs network sync, but the FX object isnt one

fair drum
#

I've been seeing it on local only created objects.

tired cargo
#

Hi guys!

Does anyone know what the problem could be?
When AI unit is sitting in the vehicle, player can't get on the vehicle. But when AI disembarks - player can get into the car

proven charm
tired cargo
#

It happen after I told my AI unit get in the vehicle

#

Using radio command

proven charm
#

what kind of vehicle, script created, or editor perhaps?

tired cargo
#

Doesn't matter. I try it with two vehicles: one, created by the editor, second created by the script command createVehicle

proven charm
#

ok

tired cargo
#

All happen after I told my AI unit get in the vehicle. After that, nobody can get in the vehicle

proven charm
#

weird

tired cargo
#

Is it right implementation ?


private _hostageArray = [hostage_1, hostage_2, hostage_3];
{
    _x addEventHandler
    [
        "Killed",
        {
            params["_unit", "_killer", "_instigator", "_useEffects"];

            _killerSide = side _killer;

            {
                if(side _x == _killerSide) then
                {
                    ["Game_KillHostage"] remoteExec ["playSound", _x];
                };
            }
            forEach playableUnits;
        }
    ];
} forEach _hostageArray;

#

Player can't hear playSound

cosmic lichen
#

you can omit the side check and playable unit stuff by just passing the side that should hear the sound as target parameter

#
private _hostageArray = [hostage_1, hostage_2, hostage_3];
{
  _x addEventHandler
  [
    "Killed",
    {
      params ["", "_killer"];

      ["Game_KillHostage"] remoteExec ["playSound", side _killer];
    }
  ];
} forEach _hostageArray;
tired cargo
#

Thanks)

umbral condor
#

I've had an issue where music triggered by a script stops when players leave a vehicle. Is there any way to fix that?

umbral condor
# proven charm pls show the code

there's no code associated that I can visually see anywhere. I'm using vanilla trigger modules and using the Effect dropdown to play music. I'm wondering if there's a script-based workaround for this or something I'm missing.

proven charm
#

im not familiar with effect dropdown but maybe its attached to the vehicle only or something

manic sigil
umbral condor
#

I might, but I've had this issue across mod lists. I appreciate it, I'll just work around it tbh

proven charm
#

maybe it stops playing the music when the trigger's condition is no longer met - just a guess

tardy osprey
#

I have a problem with a mission, and unfortunately it only popped up now, 1 hour from the mission starting, if anyone has suggestion on how to fix it, i would really appreciate it.

I have made use of the Artillery support module, and i synced it to a 2 players, and they both works - In Singleplayer. I also tried to host a server on my computer and it worked just fine. However the support does not seem to be enabled on a dedicated server, any ideas? (Edit: I have tried to look online for fixes, but it's all about scripting, and it's too convoluted to make sense for me 😦 )

abstract bay
#

how to create sleep between spawn scripts? I already have sleep in every spawn script, but it's more complicated because I can't type the same one, for example, sleep 5; for each spawn, I write so, sleep 5; sleep 10; sleep 15; if I want to spawn units in order

stable dune
abstract bay
#

problem is there are waitUntil loops, how to spawn in order

granite sky
#

Uh, not 100% sure what you're trying to do, but just put the unit creation serially and spawn the escape/retreat loops instead?

#

Also put a sleep in those waituntils. They're wasting a lot of script time.

#

Example with some refactoring:

private _fnc_spawnGroup = {
  private _group = [getMarkerPos "spawnunits", west, (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "SpecOps" >> "B_T_DiverTeam")] call BIS_fnc_spawnGroup;           
  {             
    _x setSkill ["general", 0.9];            
  }            
  foreach units _group; 
  _group;
};

private _fnc_retreat = {
  params ["_group"];
  waitUntil { sleep 1; {alive _x} count units _group <= 3 };
  _wpp = _group addWaypoint [getMarkerPos "escapepoint", 0];  
  _wpp setWaypointType "HOLD";  
  _wpp setWaypointSpeed "FULL";  
  _wpp setWaypointCombatMode "BLUE";
};

sleep 5;   
private _grp1 = call _fnc_spawnGroup;
[_grp1] spawn _fnc_retreat;
sleep 5;
private _grp2 = call _fnc_spawnGroup;
[_grp2] spawn _fnc_retreat;
abstract bay
#

Wow, this is not bad, I will also try this way. what I want is to spawn different units together with the escape loop in order after sleep. I put another script with different units along with different escape loops to see what I want: ```0 spawn {

--1--

    sleep 5;   

_grp1 = [getMarkerPos "spawnunits", west, (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "SpecOps" >> "B_T_DiverTeam")] call BIS_fnc_spawnGroup;
{
_x setSkill ["general", 0.9];
}
foreach units _grp1;

waitUntil {({alive _x} count units _grp1 <= 3)};
_grp = group leader _grp1;
_wpp = _grp addWaypoint [getMarkerPos "escapepoint", 0];
_wpp setWaypointType "HOLD";
_wpp setWaypointSpeed "FULL";
_wpp setWaypointCombatMode "BLUE";

};

0 spawn {

--2--

    sleep 10;      

_grp1 = "CUP_B_M163_Vulcan_USA" createVehicle getMarkerPos "spawnvehicles";
createVehicleCrew _grp1;
{
_x setSkill ["general", 0.6];
}
foreach units _grp1;

waitUntil {({alive _x} count units _grp1 <= 1)};
_grp = group leader _grp1;
_wpp = _grp addWaypoint [getMarkerPos "escapepoint", 0];
_wpp setWaypointType "HOLD";
_wpp setWaypointSpeed "FULL";
_wpp setWaypointCombatMode "BLUE";

};```

granite sky
#

I leave the rework as an exercise for the reader

blissful current
#

setCombatBehaviour is a Global Execution. So if I have that in the activation field of a Server Only trigger I *shouldn't * need to remoteExec it right?

faint burrow
#

Global effect. But yes, you don't need to use remoteExec to apply effect globally, but you need if you want to use this command to non-local units.

stable dune
blissful current
#

The unit is placed in the editor. So who is it local to then?

fair drum
#

@blissful current translation for the other comments. because the command requires a local argument (shown by the LA at the top of the page), it needs to be fired on the local client that owns that unit/group, but the effect of the command, is seen everywhere

[_unit, "AWARE"] remoteExec ["setCombatBehaviour", _unit];
[_group, "COMBAT"] remoteExec ["setCombatBehaviour", _group];

if a player takes over that group, then the locality changes. so its best for LA arguments to use remoteExec or CBA target events. If the group/unit is already local to where the script is running, then it will just do it without the network usage. Applies to all LA commands.

blissful current
#

So to keep everything in sync for JIP players you would need to add that true to the last index in the command right?

faint burrow
#

I would add _unit and _group respectively.

hallow mortar
# faint burrow I would add `_unit` and `_group` respectively.

I'd be careful of doing that, because only one JIP message can be attached to an entity (e.g. unit or group) at a time.
For example, if you do this:

[_unit, "AWARE"] remoteExec ["setCombatBehaviour",_unit,_unit];
[_unit, "AUTOTARGET"] remoteExec ["disableAI",_unit,_unit];```
the disableAI JIP message will overwrite the setCombatBehaviour JIP message, and only that one will be applied for JIP clients.
If you know what you're doing it can work to your advantage (for example, overwriting old JIP messages with new ones that countermand them) but it's risky, because some other mod or script can still butt in with their own JIP message and overwrite yours. \*and even if you do know what you're doing, it's still only one at a time per entity
faint burrow
#

I know that.

hallow mortar
#

but they might not, and their script might include other remoteExecs that would conflict with this

blissful current
#

Yeah I didn't know that. So in my case, since its only one JIP message per unit then this should work, right?

[ranger, "CARELESS"] remoteExec ["setCombatBehaviour", ranger, ranger];
[rangercopilot, "CARELESS"] remoteExec ["setCombatBehaviour", rangercopilot, rangercopilot];
[doorgunner1, "CARELESS"] remoteExec ["setCombatBehaviour", doorgunner1, doorgunner1];
[doorgunner2, "CARELESS"] remoteExec ["setCombatBehaviour", doorgunner2, doorgunner2];
proven charm
#

does setCombatBehaviour remExec need JIP support even when the execution is global?

#

i thought that might be something arma handles automatically

fair drum
#

its a pretty rare instance that you need JIP compat for this scenario

#

not everything needs JIP when using remoteExec. only in specific instances. but I've been seeing that you seem to use it on every idea @blissful current

blissful current
# fair drum not everything needs JIP when using remoteExec. only in specific instances. but ...

Yeah it has to do with my anxiety that the mission would break if my friends computer crashes (happens a lot) and has to return to the mission. And since I don't have a full understanding of the functionality its my first worry.

For example: I had [pilot] join (group player); in a .sqf and if the group leader left and came back the unit pilot wouldn't be in anyone's group. So then I decided to remoteExec this and JIP true. Now the player that left and came back still has pilot in their group.

Now there's a lot of moving pieces that I don't understand so this was my perception of the events but something else might have been going on.

#

And since I dont know the answers to this stuff I just test it with the client connected to LAN like you showed me and adjust from there until it works.

abstract bay
blissful current
#

Okay perfect example. I have this in an addaction:

[ptboat, ["timebomb",50]] remoteExec ["say3D", 0] //play tick tock sound file
sleep 40; //wait till sound file is done playing
"M_Mo_82mm_AT_LG" createVehicle (getPos ptboat); //spawn explosion

If the client that does this addaction exits the server then the explosion never happens. Even if they they come right back. So this is where I want to do the true for JIP right?

opal zephyr
#

Does anyone know of a way to set unit 2's move/gesture on unit 1's client (so locally) when both units are players? Using switchMove/gesture work only when unit 2 is moving, if they are stationary then their original gesture is played instead

tired cargo
#

After taking the item, and put on the same place, show 0 items in area instead of 1


    private _objectsInTrigger = nearestObjects [getPos e1, ["Item_SecretFiles"], 5];

    private _neededItems = _objectsInTrigger select {typeOf _x == "Item_SecretFiles"};

faint burrow
#

The item is in a weapon holder.

tired cargo
faint burrow
#

Yes.

tired cargo
#

But if I want to check items by the class name, which locate in the area, which way should I choose to implement this ?

faint burrow
#

Try this:

_holder = (nearestObjects [e1, ["GroundWeaponHolder"], 5]) select { "Item_SecretFiles" in ((getMagazineCargo _x) select 0) };
grizzled cliff
#
1>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe'
1>      Please choose the Technical Support command on the Visual C++
1>      Help menu, or open the Technical Support help file for more information

When you really broke something.

#

😛

crimson cedar
#

Can someone please tell me why this is not triggering a flare to launch? (Coordinates are accurate) Also independent is the enemy faction (I'm running a script to make them hostile))

granite sky
#

If you added JIP to the remoteExec then all it'd do is start the tick tock sound for players that joined afterwards.

tulip ridge
#

Also are indep hostile from the start? If so, you can just change allegiance in "Attributes > General... > Misc"

crimson cedar
#

So Type could be set to guarded by indep I guess
as for global variable I was told that If I wanted the flare to activate a script that would spawn a helicopter reinforcement I needed to do it this way... this may be wrong correct me if it is
and eys Indept are hostile although its through a script

tulip ridge
#

So Type could be set to guarded by indep I guess
That's for guard waypoints

as for global variable I was told that If I wanted the flare to activate a script that would spawn a helicopter reinforcement I needed to do it this way... this may be wrong correct me if it is
That depends on how you're calling that script, and if you don't touch the flare object itself, then there's no point in making it global

and eys Indept are hostile although its through a script
I was asking if they're hostile from mission start, if they are, just change the setting

#

Also you can ignore the type thing I said, I haven't touched triggers in a long time

crimson cedar
#

Sorry I miss type Yes they are hostile

#

from mission start

tulip ridge
#

Then just change their allegiance in Attributes > General, you don't need to script it

#

As for testing your trigger, try just having something like systemChat "trigger executed"; to make sure it's being activated correctly

crimson cedar
#

I'll see if it triggers (I've tried already and there was no flare so I at least want to see if it tries to run it)

#

So I can confirm that the trigger is excecuted but no flare 😦

vapid scarab
vapid scarab
# tired cargo Thanks)

Hey, real quick, using side can have some unusual results when used on units.

// use
side group _killer
// instead of 
side _killer
tulip ridge
vapid scarab
#

no.

#

When they get called, they are JIP'd. So when do they run for JIP players.... Clarification added ^

tulip ridge
vapid scarab
#

🙃 thats why im asking here, so hopefully someone that knows, answers....

tulip ridge
#

I meant it more as surprised that it wasn't listed

vapid scarab
vapid spoke
#

anyone got the antistasi loot crate script? i need something that allows vehicle inventory to be sent to the arsenal

tulip ridge
crimson cedar
#

will do thanks

granite sky
#

Also the order seems to be wrong in that table, and initPlayerLocal actually fires after postInit.

vapid scarab
granite sky
#

Well, there's a BIS_fnc_log entry for initPlayerLocal that fires before postInit, but it doesn't seem to actually execute the file until after the postInit.

vapid scarab
#

So remote execs run after global variables.
From my testing, it seems that remoteExecs and global variables are ran before even preInit functions...
Which is kinda wild.....

#

But that is on my two clients on a single computer... So I dont know if network latency over a server may have a different scenario (order not gauranteed)....

granite sky
#

The remoteExecs ran after preInit here. Also local.

#

Maybe nothing is guaranteed and Arma is a total shitshow :P

vapid scarab
#

So my testing is a setting a variable, and I checking to see if the variable exists in a preinit function, if it does then do not set to the preinit variable value (var=1)
Global variable set (var=0)
*test join -> global variable ran before preinit (var = 0)
remoteExec spawn function that sets that same variable (var = 2)
test join -> remoteExec ran after global variable set and before preinit function.(var = 2) (would this reverse if I ran remoteExec spawn before global variable?)

RemoteExec is after preInit.

granite sky
#

Curiously, all the remoteExecs appear to maintain execution order (both for JIP and non-JIP), regardless of remoteExec and remoteExecCall mix.

#

But then it is apparently possible for remoteExecs to be silently dropped under heavy network load.

still schooner
#

How do I make it so that a NPC with a machine gun shoots semi automatic and not automatic

granite sky
#

Config only. You can't do that with script, as far as I know.

#

Well, unless you disable a bunch of AI entirely and use manual fire, but that's not usually an option.

still schooner
#

his addEventHandler ["Fired",{
params ["_unit","_weapon","_muzzle","_mode"] ;
private _scripted = _unit getVariable ["_scripted",false] ;
if (_weapon == handgunWeapon _unit and _unit ammo _muzzle != 0 and !_scripted) then {
[_unit,_muzzle,_mode] spawn {
params ["_unit","_muzzle","_mode"] ;
for "_i" from 0 to 2 do {
sleep ((random 1) + 5) ;
_unit setVariable ["_scripted",true] ;
_unit forceWeaponFire [_muzzle,_mode] ;
_unit setVariable ["_scripted",false] ;
} ;
} ;
} ;
}]

vapid scarab
still schooner
#

This is the opposite case tho

granite sky
#

What's it for?

#

@still schooner

vapid scarab
#

An easier way might(apparently not?) be setting group fire behavior between fire at will and forced hold fire?

granite sky
#

They're not gonna stop mid-burst just because you changed group behaviour.

#

Well, I'd be very surprised anyway. That would be a horrible waste of CPU cycles in most cases :P

#

IIRC even with semi-auto they're kinda hard to break in the middle of a volley.

vapid scarab
#

Ive zeused before and Im 99% sure thats how it works (that 1% is a pain in the butt cause nothing 100% with arma)
But testing it rn, GROUP setCombatMode "GREEN" does seem to stop the MG from firing almost instantly

#

And swapping to YELLOW causes him to fire again

granite sky
#

yeah but can you make them fire one bullet at a time with 0.1s sleeps :P

vapid scarab
#

Hammer meet nail😁

#

definitely be a inefficient way of dealing with it

hallow mortar
#

Perhaps you could use a Fired EH and setWeaponReloadingTime to force something that is like semi-auto

faint dove
#

what's the best way to get CfgSounds/CfgMusic entries from just the mission's description.ext?

tired cargo
#

Hi guys!

Do not understand a little bit: this event handler should be in initServer.sqf or in init.sqf ?

faint burrow
#

In initPlayerLocal.sqf I would say.

sharp grotto
#

How bad are publicVariable hashmaps with less than 100 entries ?
[playerUID, [123,1234]]

Shouldn't be to bad, or ?

opal zephyr
#

Depends on how often you set or get it. If its used in the scheduled environnent then it should be fine

blissful current
#

If I have a trigger named Trigger1 set to Server Only and reference it in a if statement withing initPlayerLocal will it work? Im

if (triggeractivated trigger1) then {}```
blissful current
#

The trigger could be local or remote Does remote mean Server?

tulip ridge
tulip ridge
tulip ridge
opal zephyr
#

Broadcasting a hashmap of 100 entries every couple seconds wont clog the scheduler

little raptor
#

What does scheduler have to do with this anyway?! blobdoggoshruggoogly
Every command is unscheduled. It doesn't make any difference where you run a command. All of them affect the game the same way
The only thing the scheduler can help with is running CODE (i.e. groups of statements) because then it can pause between commands (with the exception of isNil ofc, as it runs the code unscheduled)

ornate whale
#

Do you think it is a good idea to give players an option to choose from two or three enemy AI skill levels at the start of a mission, or is it better to have just one default difficulty? Thanks

hallow mortar
#

There is no technical answer to that.
It literally just comes down to "do you want to put in the effort to implement a difficulty parameter?"

tulip ridge
granite sky
#

There's also the preference for more/worse enemies vs fewer/better enemies.

ornate whale
#

But they will not be able to change it later on the fly.

hallow mortar
#

If you've already put it in then 🤷
It doesn't do any harm to have it in as long as you're willing to maintain it and balance for it. The only reason not to have it is "I don't want to do it" - which can be a valid reason, but my point is there's no real technical or philosophical argument why it shouldn't be done in principle.

ornate whale
hallow mortar
#

That's quite normal. There are plenty of full complete AA+ games where you can't change difficulty partway through.
That's not a "should I or should I not implement the system" issue, that's a "do I want to put in the effort to make a mechanism for mid-mission changes" issue, and if the answer is "no" that doesn't mean you have to remove the system entirely.

ornate whale
#

I will probably need to learn creating some simple GUI dialogues for these kind of things. Action menus are not the best for this. But thank you guys for tips. 🙂

grizzled cliff
sharp grotto
granite sky
#

yes, but how often?

#

hashmaps are just sent as a pair of arrays.

sharp grotto
meager granite
#

Drop in an ocean then

sharp grotto
vapid scarab
last cave
#

I don't know which channel is better to write to on EXTDB3, so I'm writing here.
I've been trying to figure out why I have an error for 6 hours now
(SQL Invalid Number of Inputs)

extDB3: SQL: Error extDB3Exception: SQL Invalid Number of Inputs Got 1 Expected 6
extDB3: SQL: Error extDB3Exception: Input: createPlayer:13456:and:["1"]:1:1:3
[createPlayer]

Input SQF Parser = false

SQL1_1 = INSERT INTO players_table 
SQL1_2 = (uid,name,lastloadout,rank,playedtime,status)
SQL1_3 = VALUES
SQL1_4 = (?,?,?,?,?,?)
SQL1_INPUTS = 6
"Extdb3" callExtension "0:SQLState:createPlayer:13456:and:[""1""]:1:1:3"

I have already tried all possible changes and options for passing arguments. I even looked at the sources of the abstract class, but I still do not understand why the error appears.

Sqf parser = true
(Config Invalid Number Number of Inputs)
->

[createPlayer]

Input SQF Parser = true

SQL1_1 = INSERT INTO players_table 
SQL1_2 = (uid,name,lastloadout,rank,playedtime,status)
SQL1_3 = VALUES
SQL1_4 = (?,?,?,?,?,?)
SQL1_INPUTS = 6
"Extdb3" callExtension "0:SQLState:createPlayer:[13456,and,[""1""],1,1.2,3]"
extDB3: SQL: Error extDB3Exception: Config Invalid Number Number of Inputs Got 1 Expected 6
extDB3: SQL: Error extDB3Exception: Input: createPlayer:[13456,and,["1"],1,1.2,3]

Help me :'c

Ps.
Find problem...
need was write
SQL1_INPUTS = 1,2,3,4,5,6

SQL1_INPUTS its array params , not number count

manic sigil
#

'huh, I mean I know its been ages since I touched this script, but why isn't it advancing past thi-'

sleep 4043;

Oh. 🙃

sharp grotto
mellow scaffold
#

So I have an array of itemtype, count pairs (from getItemCargo) and I want to set another unit's cargo to it. But foreach deep-iterates the nested array. What is the simplest way to write the non-deep version of {_car addItemCargo [_x select 0, _select 1]} foreach _savedItems;?

hallow mortar
#

forEach does not "deep iterate", the way you've written should work fine (aside from _select 1 -> _x select 1)

mellow scaffold
#

let me get some logging going

hallow mortar
#

That being said, if each element of your array is already in the ["classname",3] format and has no extra elements, you can just use _x and not bother selecting each element individually

mellow scaffold
#

So I log both the whole array I am foreach'ing over and each _x in the loop. and I get:

19:59:46 (0:00:07) Adding [["ACE_rope6"],[1]] to cargo
19:59:46 (0:00:07) Add ["ACE_rope6"] to  1e238442040# 1779972: lsv_01_f.p3d
19:59:46 (0:00:07) Add [1] to  1e238442040# 1779972: lsv_01_f.p3d

Code:

            ["", "Adding %1 to cargo", _vicItemCargo] call mc_fnc_rptlog;
            {
                ["", "Add %1 to  %2", _x, _spawnUnit] call mc_fnc_rptlog;
                _spawnUnit addItemCargo _x;
            } foreach _vicItemCargo;
#

Oh I am anidiot, it's not pairs. it's alternating.

#

sigh whyyyy

hallow mortar
#

That'll do it

mellow scaffold
#

Guess I'll have to whileloop it an use i=i+2

#

Unless someone knows of a helperfunction (CBA?) to save and load whole-vic inventories

indigo snow
#

@faint dove _music = "true" configClasses (missionconfigFile >> cfgMusic);

blissful current
#

I'm trying to remoteExec this working code:

playSound3D [getMissionPath "sound\PlaceBomb.ogg", getPosASL ptboat, false, ptboat, 5];

So I used the [left, right] logic to get this but it doesn't play the sound like the above one does:

[getMissionPath "sound\PlaceBomb.ogg", getPosASL ptboat, false, ptboat, 5] remoteExec ["playSound3D", 0];
faint burrow
#

playSound3D has already global effect.

blissful current
#

Even when played from within an addAction like Im doing?

faint burrow
#

Yes.

hallow mortar
#

The reason your remoteExec doesn't work is because remoteExec is interpreting your array as an array of arguments, like this:

[_left, _right, _wait, _up?, _down?, _what?] remoteExec ["playSound3D"];```
if one argument is an array (as playSound3D's right argument is) then it needs to remain an array within the array of arguments given to remoteExec
#
[[getMissionPath "..", getPosASL ptboat, ...]] remoteExec ["playSound3D"];```
(don't actually do this because of playSound3D being global effect already, but it applies to other single-argument commands too)
blissful current
#

Ahhh Okay so In this instance it doesnt have a "left" spot. And I need the double brackets.

#

What are the use cases of PlaySound3d versus Say3d? I cant figure out which one is better over the other?

hallow mortar
#

playSound3D is global (by default), can use positions without needing an object source, uses file paths instead of CfgSounds classes, isn't one-per-object-at-a-time, and doesn't follow the object source [if there is one]

#

It's not a case of "one is better", they do different things

unborn field
#

Greetings folks, would anyone care to help me out with a certain problem? It's about an .sqf script not being found. 😦

#

I'll create a thread about it if anyone wants to join.

#

sqf script not found

deft zealot
#

@jade abyss a player

celest vale
#

I’m trying to find a way to turn an aircraft into a UAV to make it controllable similar to a CoD killstreak. Any ideas on how to script it?

Context: I want my player base to have air support that is player piloted by Zeus/scenario controlled. I’d much rather keep the gun in the fight than have him sit in the airfield. Ideally, I imagine having an aircraft suspended in air, engine on, with a set velocity but simulation disabled. On queue, I notify the players “air is on station and ready for tasking, nominate a controller and go to town”. At that point, I’m faced with either teleporting a player from the ground into the aircraft or allowing it to appear on his UAV terminal and he take control of the aircraft (simulating a JFO/JTAC coordinating with it)

rich frost
#

The Init.sqf is also being executed on JIP players, right?

fair drum
#

yes

rich frost
#

thanks for the sanity check

crimson cedar
#

Does anyone have an explanation as to why this script works only for the transport unload and not for the Move?

    _x disableAI "TRANSPORT UNLOAD"; 
} forEach units Heli; 
{ 
    _x disableAI "MOVE"; 
} forEach units Heli;  
    _x enableAI "TRANSPORT UNLOAD"; 
} forEach units Heli; 
 
{ 
    _x enableAI "MOVE"; 
} forEach units Heli;```
#

I should mention 1st script is on the heli 2nd script is on the trigger

granite sky
#

chatGPT?

#

TRANSPORT UNLOAD isn't a valid option for disableAI. MOVE might not do anything for units when they're in a vehicle. It's not clear what you're trying to do with it.

crimson cedar
#

I'm trying to have the heli move until its the right time to move and then when it IS time to move that It just drops off the troups

granite sky
#

Ok, what's probably happening is that disableAI "MOVE" prevents the units from unloading.

#

but it doesn't prevent the pilot from flying.

#

Not tried either though.

crimson cedar
#

essentially when the trigger gets activated the chopper should fly and come bring the troupes down and then it should fly away

granite sky
#

Not sure exactly what units does with a vehicle input either. It's undocumented.

crimson cedar
granite sky
#

Why are you expecting it to fly away?

crimson cedar
#

because after the transport unload there's a move waypoint placed further

granite sky
#

You mean after a transport unload waypoint?

crimson cedar
#

exactly

granite sky
#

How far away is the move waypoint?

crimson cedar
#

about 500m

granite sky
#

Normally the two waypoints are sufficient. It'll land near the transport waypoint and unload the cargo group. Then it'll take off and fly to the move waypoint. All the other stuff isn't necessary and is possibly breaking it.

#

just tested in editor.

broken forge
#

When using the Respawn EventHandler I'm having problems getting the unit to play an animation, the unit goes into the animation, but doesn't move about like the animation is supposed to. It's almost as if the simulation is disabled? Here's the snippet:

...
_unit attachTo [_stretcher, [0, -0.125, 0.45]];
[_unit, "Acts_LyingWounded_loop"] remoteExec ["switchMove"];

["Initialize", [_unit, [], false, true, true, true, true, true, false, false]] call BIS_fnc_EGSpectator;
...
granite sky
#

Where's the respawn EH in this?

#

Are you trying to animate corpses or something?

broken forge
#

This is just the snippet of it, I'm trying to animate the _unit or _this select 0 The unit is moved to the stretcher and lays down like the animation does, but then no simulation of the unit moving his eyes, head, breathing and etc

#

Here's the EH:

player addEventHandler ["Respawn", {
    params ["_unit", "_corpse"];
    [_unit, _corpse] spawn sof_client_medical_fnc_respawn;
}];
crimson cedar
#

Heli flyInHeight 50; Adding this to the TRANSPORT UNLOAD waypoint completely fixed my issue now I just need to find how to despawn it that should be easy though

opal zephyr
#

deleteVehicle Heli;

broken forge
#

No simulation, just lays there, not sure what I did wrong, lol

#

That's the _unit or _this select 0 that would spawn in if I enable the respawn, the _corpse or _this select 1 gets deleted.

granite sky
#

Is this a player or an AI?

broken forge
#

I'm working on the economy part of my framework, the player needs to have enough money to spawn back in, if not they spawn on a stretcher and go into spectator mode until an admin spawns them back in.

#

This would be the player once the respawn process finished.

#

Maybe it's working as intended when it comes to the engine, because as soon as I give myself or the player money to pay for the respawn, that unit becomes the player. Which then the player gets up from the stretcher and is back to normal, lol

formal grail
#

A quick question for replication: is there a reliable way to, on "Fired", move the projectile ownership from the client that launched the projectile to another client to fix the problem with lagging/rubberbanding jets avoiding SAMs? Could also avoid people who fired the SAM shot from lagswitching too, but that's less of a concern for me.
Seems like there could be a lot of issues with doing this, but wondering if any of the more multiplayer focused scripters have explored this approach.

tired cargo
#

Hi guys!

Can you give me a couple of tips for my case:

I'm interesting in set upping an AI units. So, in my mission I made hostages ( AI units ) which players can lead and force to follow. The technical part is ok, but units behaviour - something incomprehensible
So, the first problem was when units run away if hear some sounds, like a shoots. To solve this, I used behaviour shutdown - well, helped. So each time when units stayed by themselves, they stayed with behaviour shoutdown

The second problem was when player force to get in the vehicle, but in this case, after unit got in the vehicle, vehicle closed for everyone. After so many tests, I think, that this closing the vehicle by the unit maybe was because of different sides between player and unit - maybe no, just assumption

And the last problem was when a player give unit some radio command ( move to, get in ) and after this, unit, after he leaved a player group ( when player force to follow - unit join to group player, when stop follow - on the contrary) he could perform a previous tasks. For example, player give a radio command move to the place, but after stop following, unit could perform previous command get in the car

#

Units side: independent
Players sides: west, east

little raptor
formal grail
little raptor
#

And like I said they are local to every client. The game replicates them for everyone

still forum
mellow scaffold
#

ty! having a look.

#

yeah, that's roughly what I implemented, though my code is not as fancy 🙂

kindred zephyr
# ornate whale Do you think it is a good idea to give players an option to choose from two or t...

I think this depend on your mission. Its not a bad decision to add them, but if you set up parameters there is always the possibility of no one ever using anything but default or nothing but the easiest, imo it will be related to your design view of your own mission and how flexible you are willing to be. For example, If I desing a mission to be extremely hard, and thats how I go on a balance it, I would probably use the hardest AI option I give as default.

blissful current
#

I'm looking for a way to reverse the keybinds for how you back up and turn in a tank. For some reason it's opposite cars and other vehicles. I've done some research and havent found exactly what I'm looking for but maybe someone has seen the solution before? Here are some options that might work.

  1. A mod that lets you have separate vehicle keybinds. For example: in default ARMA you have separate helicopter and vehicle keybinds. Some way to further separate the keybinds to make tanks their own keybind list would work.

  2. The following page seems to be talking about keybind chaging on the fly. In theory I could add an event handler to a vehicle to look for a keypress and execute this keybind mod? https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding

scarlet tree
#

The reason it feels different is because tanks have tracks instead of steerable wheels. If you were to somehow reverse the controls then it would be opposite moving forward.

blissful current
#

This makes it so the tanks reverse like in all other games while still driving forward with regular turn keys. Only problem is it does that for all vehicles in reverse. Cars too. So my idea was to somehow use that modded keybind to achieve this effect for just the tanks. And if I was able to get that working then maybe it would be possible to switch positions in the tanks with number keys too like all other games "1: Driver, 2: Gunner, etc" (instead of the cumbersome action menu).

granite sky
hallow mortar
still forum
#

There is only one left/right shared with all the vehicles.
There's no way to split them to have an extra set for tanks

#

and you also cannot change the keybinds when you get into tank

blissful current
cosmic lichen
hallow mortar
west umbra
blissful current
formal grail
opal zephyr
#

Is it expected for an object with its simulation disabled to collide with another object? There isnt a roadway lod in either of them. One is a simple object, the other is a car

vapid scarab
#

Is there an eventHandler (vanilla or modded) for when a player swaps sides?

jade acorn
#

swap sides in what way

#

there is UnitJoined if by swapping you mean being added to a different team

granite sky
#

I suppose you could use the createGroup mission event handler plus the UnitJoined group handler for the general case.

#

oh, there is UnitLeft as well.

#

not sure what the locality is for the group event handlers.

vapid scarab
mint hill
#

I am trying to use a script to allow medics to full heal all units inside a vehicle (using ACE medical). I have used the below script to successfully allow a full heal of all damaged units, however it allows all units regardless of traits to use the heal action. I would like only units with the ACE medic trait to be able to use it

"Heal soldiers", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",     
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa", 
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)", 
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)", 
{hint format ["%1 is providing medical care inside the vehicle.", name player]}, 
{format ["%1, you're providing medical care inside the vehicle.", name player] remoteExec ["hintSilent", _this select 1]},
{
    {[player, _x] call ace_medical_treatment_fnc_fullHeal;} forEach crew _target; format ["%1, you've provided medical care.", name player] remoteExec ["hintSilent", _this select 1]; 
}, 
{format ["%1, medical care was not provided!", name player] remoteExec ["hintSilent", _this select 1]}, 
[],     
10,     
0, 
false, 
false  
] call bis_fnc_holdActionAdd;```
stable dune
proven charm
#

something like this for vanilla medics: sqf isMedic = { params ["_type"]; getNumber (configFile >> "CfgVehicles" >> (_type) >> "attendant") == 1 };

mint hill
mint hill
#

No, it's from the forums

proven charm
#

oh ok

#

and it works?

mint hill
#

Not sure, I'm trying to read through the ACE pages rn to see if that's the proper syntax

proven charm
#

ok.. the condition : ```sqf
"([_this] call ace_medical_treatment_fnc_isMedic) && (_this in _target)"

mint hill
proven charm
#

oh right i forgot **in **checked vehicles 🙂

mint hill
flint topaz
proven charm
#

isnt it ace_common_fnc_isMedic ?

#

not ace_medical_treatment_fnc_isMedic

mint hill
#

Yeah I'll try that now. Didn't realize that

proven charm
#

cant google for the later 😄

mint hill
#

Full working script if anyone wants it:

"Heal soldiers", 
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",     
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa", 
"([_this] call ace_common_fnc_isMedic) && (_this in _target)", 
"([_this] call ace_common_fnc_isMedic) && (_this in _target)", 
{hint format ["%1 is providing medical care inside the vehicle.", name player]}, 
{format ["%1, you're providing medical care inside the vehicle.", name player] remoteExec ["hintSilent", _this select 1]},
{
    {[player, _x] call ace_medical_treatment_fnc_fullHeal;} forEach crew _target; format ["%1, you've provided medical care.", name player] remoteExec ["hintSilent", _this select 1]; 
}, 
{format ["%1, medical care was not provided!", name player] remoteExec ["hintSilent", _this select 1]}, 
[],     
25,     
0, 
false, 
false  
] call bis_fnc_holdActionAdd;```
blissful current
#

I'm using a public variable AllSecTasksCokmplete as a condition check in a if statement. Works fine. Now if I want to check if that public variable was not activated would it be like this !AllSecTasksCokmplete or maybe AllSecTasksCokmplete = false?

proven charm
#

unless the variable is not defined... then its nil

blissful current
proven charm
#

isnil "AllSecTasksCokmplete"

lone glade
#

not being able to create code snippets on discord sucks, time for a feature request

ornate whale
#

How to black out the screen before the world starts to render. What I get is that the display is normal, until the game completes saving, and then it blacks out the screen, creating an ugly effect, and when I use titleText, it also blocks any other texts other than the title. Thx

fair drum
fair drum
crimson cedar
#

does anyone know why deleteVehicle Heli; Doesn't work for me? (the trigger in theory is set up correctly (type none activation opfor at present) (it is an ai heli) Name of the varibale is indeed "Heli" and the trigger is linked to the heli and the crew for good measure

#

I also found out that the trigger will only activate if I'm in the area

blissful current
crimson cedar
#

I see what I did wrong thanks I also think that my heli is being stupid and is stopping right outside the trigger so when it finally decides to move it despawns

blissful current
#

Has anyone experienced this behavior with helicopters? It happens to me seemingly randomly when I test my mission. Maybe only 2/50 times I've tested it. I have no idea how to reproduce it. And its not like Im doing anything crazy. Its just a standard invisible heli pad and land waypoint in the editor.

I get in a friendly AI controlled helicopter that has landed. The helicopter kicks me out then flys up about 50 meters and hovers.

hallow mortar
#

Are you the leader of your group, or do you have an AI group leader?

hallow mortar
#

I ask because if you have an AI group leader, they can decide they don't want you to get in a vehicle, and force you to immediately get out

still forum
#

@grizzled cliff i have those compiler errors quite often since MSVC 2015. Once even just removing a comment line fixed it for me its really weird

little raptor
#

I'm not 100% sure about missiles tho. But bullets are definitely local
Maybe steerable missiles are non-local blobdoggoshruggoogly

ripe wind
#

Hello,

I am trying to create a simple Scenario in which tanks spawn at random markers and move towards random markers. Essentially for target practice.
However, I can't figure out why the AI just stands still, is there something I am missing?

spawnTank = {
    private ["_marker", "_tank", "_pos", "_crew", "_group"];

    // Select a random unused marker
    _marker = call getRandomMarker;
    if (_marker == "") exitWith {}; // Exit if no available markers

    _pos = getMarkerPos _marker;

    // Adjust the spawn position to avoid collisions, by 1 meter
    _pos set [2, (_pos select 2) + 1];

    // Create the tank
    _tank = createVehicle [tankClass, _pos, [], 0, "NONE"];
    _tank setBehaviour "SAFE";
    _tank setCombatMode "BLUE";
    _tank setDamage 0.8;
    _tank disableAI "COMBAT";

    // Prevent crew from ejecting
    _crew = crew _tank;
    {
        _x allowGetIn false;
        _x allowFleeing 0;
    } forEach _crew;

    // Create a group for the tank
    _group = createGroup east;
    {_group addVehicle _x} forEach _crew;

    activeTanks pushBack _tank; // Add to active tanks

    // Select a random marker that is >200 meters away
    private _farMarkers = spawnMarkers select {_pos distance getMarkerPos _x > 200};
    private _targetMarker = selectRandom _farMarkers;
    private _targetPos = getMarkerPos _targetMarker;

    // Set initial waypoint towards the selected random marker
    _wp = _group addWaypoint [_targetPos, 0];
    _wp setWaypointType "MOVE";
    _wp setWaypointBehaviour "SAFE";
    _wp setWaypointCombatMode "BLUE";
};
proven charm
#

one way to debug is to print some messages to make sure the values are ok```sqf
systemchat (str [_group,_targetPos,_wp]);

#

@ripe wind that at the bottom

#

also i dont see the crew being created in that code. you might be interested in createVehicleCrew

ripe wind
blissful current
faint burrow
ornate whale
#

How to set viewDistance for MP games correctly in a mission scenario? Usually, when I start my mission, the viewDistance is very low compared to SP. Should I use a commad to set it to something more reasonable on all machines, or what is the best way to go about this? Thank you

faint burrow
#

AFAIK, in MP players can change view distance only via script command.

ornate whale
#

The thing is that I don't want to force their machines beyond their capabilities, but too low is not good either.

faint burrow
#

Provide them with a UI where they will be able to choose preferred view distance.

ornate whale
#

There is the video options distance, then server config, then mission parameter, also you can set it via sqf command. Who knows what is the right way, so that I don't override anything important. I just don't want it to be capped at 1600 meters from start.

granite sky
#

It's just setViewDistance and setObjectViewDistance. Local effect, but server caps clients.

#

hmm. Mission parameter?

ornate whale
#

I would like to set it to like 3000 meters, but if server config says 2000, it will set 2000 for the server. If client settings are set to 1900, then client will have his 1900.

#

Using set command will override all this.

faint burrow
granite sky
#

Video options distance works in MP. It's just capped by the server value. Same behaviour as the script commands.

faint burrow
#

Video options distance works in MP. It's just capped by the server value.
I was wrong then. Then you can increase view distance in the server profile to some big value, and players will be able to choose their preferred view distance.

Same behaviour as the script commands.
No, via script command you can set any value.

ornate whale
#

This is what happens if you use setViewDist on a client, and he has lower video options distance set. So this is not the optimal way.

faint burrow
#

I don't know why it looks like, but on my server in the server profile view distance is about 1500m, however players can set view distance up to 6000m via UI.

ornate whale
granite sky
#

If you're referring to the tree cutoff, trees are objects.

faint burrow
#

Yes, there is object view distance which isn't limited by server, unlike overall view distance.

ornate whale
#

Meaning, that either I have to force it from server, or create some GUI windows, as @faint burrow suggests, probably.

granite sky
#

Not sure if either works for that.

#

You have fog set to zero?

#

There's a "haze" that's a separate thing again. Not sure how that works.

jade acorn
#

is it possible to play an audio file while in the Briefing phase of a scenario? I know the execute tag exists but a simple <execute expression="playSound 'mySound'">Play audio</execute> doesn't seem to work. Classname is defined in mission config. Basically I want player to be able to listen to the wall of text during the briefing phase instead of reading it or having to do so once the actual scenario phase starts.

little raptor
#

(I have no knowledge of briefings tho so idk if you're doing it right at all)

ornate whale
#

Is there any way how to properly time a text intro? I use BIS_fnc_typeText followed by BIS_fnc_textTiles. And when the FPS are low, the effects tend to overlap, because of how SQF is being executed. Thanks

jade acorn
#

you could use waitUntil along with scriptDone to see if the first function ended

ornate whale
#

Thanks, my fault, I did spawned those functions instead of calling them.

drowsy magnet
still forum
drowsy magnet
still forum
drowsy magnet
still forum
#

No its your fault

drowsy magnet
#

ermmm

still forum
#

There is nothing broken here

drowsy magnet
#

is 2.18 dev branch or something

still forum
#

yes

winter rose
#

added devbranch to the page

drowsy magnet
lavish ocean
drowsy magnet
lavish ocean
#

erm, the information in the pictographics was clearly indicating build 2.18 you just ignored it

drowsy magnet
drowsy magnet
ivory lake
#

hard to point it out when you crop it out

drowsy magnet
#

thats all you need to see

lavish ocean
#

again on the page alternative syntax is with 2.18 pictogram

hallow mortar
#

If you notice an error on the wiki, feel free to politely and clearly point it out in #community_wiki - no need to ping anyone, the channel is monitored.

drowsy magnet
lavish ocean
#

oh, that's because someone added the 2.18 screenToWorldDirection in recent edit

#

@little raptor made that edit so you can tell him, but like said before optimal place is then #community_wiki

hallow mortar
#

It wasn't ansin, they just added the 2.18 indicator to the alt syntax. Leopard20 added the bluebox

winter rose
#

and now

#

(ofc here)

jade acorn
#

next time a full-screen pop-up will be needed

sharp grotto
young current
#

fancy new command ❤️

winter rose
#

that you could have with cameraToWorldPosition or something

fair drum
#

does anyone know why it isn't working? hmmyes

winter rose
obtuse depot
#

cuz I miss the tiny icons as well and usually assume it works 💀

sullen sigil
#

theyre impossible to miss dawg

west portal
#

how does while work? I'm trying to make the loop run if a unit is alive. Tried putting in alive unit1 and it doesn't seem to work

granite sky
#

You can't put the loop directly into an editor init box, because it'll just run 10,000 times and then bail.

#

You need to use spawn to create a scheduled thread instead.

west portal
#

I was putting this in my init.sqf and putting sleep 10; It wouldn't work like that? Since it would only be running every 10 seconds

warm hedge
#

Share your code

hallow mortar
# winter rose

I think it's fair to mention that the page their screenshot is from is the screenToWorld page, not screenToWorldDirection, which referenced screenToWorldDirection in an example without mentioning it was 2.18 (the link to its own page was broken because of the missing space, too). The indicator for the screenToWorld alt syntax was not relevant because the alt syntax wasn't used in the example. So none of those indicators were actually visible or applicable in the context of their screenshot, even if their overall approach was a bit unnecessarily spicy

#

(tbh it is true that sometimes people really get jumped on, including by BI staff, for making mistakes that seem obvious to veterans. Sometimes a question genuinely is obviously stupid, but sometimes people are just inexperienced or overwhelmed and they get rather rude responses)

winter rose
winter rose
ripe wind
#

How do you change the firing rate of a tank cannon?

winter rose
ripe wind
#

Applied on the "Init" of the Vehicle

hallow mortar
#

Do you happen to know if the tank carries its cannon ammo in magazines of multiple rounds, or in single-round magazines?

#

This is relevant because setWeaponReloadingTime affects the time between rounds in one magazine, while if it's multiple single-round magazines then each reload will be a magazine switch and so not covered

ripe wind
#

oh..

#

It's a Rhino MGS

#

so you're right

hallow mortar
#

The Rhino is a vanilla vehicle and those usually use multi-round magazines 🤔

ripe wind
#

I just shot 13 bullets to get 13 | 3 to 8 | 2 and I noticed no difference there too

hallow mortar
#

How odd. Well, I don't see anything wrong with the code, it is an intra-magazine reload which is covered, and that command should work fine on vehicles.

#

Can you try adding a systemChat in the EH code to prove it's actually being triggered?

jade acorn
# winter rose ?

I prefer the burning version but this one's ok if it fits the UI design

winter rose
cosmic lichen
#

Oh noooo

#

Why not show a cooking warning like message that blocks 99% of the screen. Additionally you have to 55 times solve a captcha.

ripe wind
ripe wind
# cosmic lichen Huh?

Yeah. systemChat does not work either if I put it in a script or init in the SP Scenario. It only ever shows up if I put it in the debug console

winter rose
#

delay it a little bit

hallow mortar
#

systemChat should work fine as long as it's inside the EH code itself - while the code is typed in an init field, the EH code is executed when the EH activates, rather than during the init phase where systemChat doesn't work

#

ex.

this addEventHandler ["Fired", {
    systemChat "test fire";
    _this # 0 setWeaponReloadingTime [_this # 0, _this # 2, 1/3];
}];
#

If it doesn't show up when you do that then the EH is not firing

ripe wind
ripe wind
#

Specifically

// Add an event handler to the tank
player_tank addEventHandler ["Fired", {
    _this # 0 setWeaponReloadingTime [_this # 0, _this # 2, 1/3];
    systemChat "Weapon fired and reloading time set!";
}];

In init_sqf

hallow mortar
#

Well, as far as I can tell, in principle this should work.
The only thing I can think of would be some quirk of how tank cannons work that makes the command not work on them (plausible, if unproven, because of how they fake reloading between shots). If that's the case, then I don't think there's much to be done about it.
Someone else might have more insight though.

ripe wind
#
player_tank addEventHandler ["Fired", {
    _this#0 setWeaponReloadingTime [gunner (_this#0),currentMuzzle gunner (_this#0),0.5];
    systemChat "Weapon fired and reloading time set!";
}];
winter rose
ripe wind
#

Thank you all for your help 🙂

#

While I'm still here, is addUserActionEventHandler the best approach to adding a custom keybind if I basically need just one custom button to execute a script?

hallow mortar
#

The fired EH reports the gunner as _this#7 btw, so you don't need to look them up with gunner. And once the gunner is provided properly, the reported muzzle name (_this#2) should work without needing to find it with currentMuzzle.

lapis nest
#

Anywone know how to spawn a waypoint for a unit, activated by a trigger? basically have a switchblade loitering near by and want to call it in and have it come to players position. thanks in advance!

lapis nest
#

thank you. but im trying to figure out how to make it a "loiter" waypoint

#

also says "type object, expected group" its a drone btw

hallow mortar
#

You can use setWaypointLoiterType, ...Altitude, and ...Radius to further customise the waypoint after creating it and setting its type

lapis nest
#

thank you. found an easier way by using SetWaypointPosition and syncing the second waypoint to that trigger

#

any way to get a position of the one that activates the trigger or "caller"? instead of getting a pos of a preset guy

faint burrow
#

thisList contains objects activated the trigger.

lapis nest
#

thank you. evrything works great and as imagined. but it shows an error when trigger is activated

faint burrow
#

What's the error? Could you provide its text from RPT file?

lapis nest
#

where do I find the RPT file?

faint burrow
# lapis nest

As error's text says, thisList returns array of objects, but getPosASL needs object, therefore select for instance the first object.

lapis nest
#

[group driver SD, 2] setWaypointPosition [getPosASL thisList, SD, -1];

So it should look like this? sorry I have no experience with any kind of scripting

stable dune
lapis nest
#

Im lost boys. any way to disable error messeges? I think its easier if I just raw dog this shit, I mean it works as intended.

warm hedge
#

Fix your issue works

lapis nest
#

aint big brain like that

#

but thank you all for your help

stable dune
lapis nest
#

[group driver SD, 2] setWaypointPosition [getPosASL thisList, -1];

this one from Schatten works as needed. just shows an error when activated

#

but it works so I kept it

#

I moved on haha. now im trying to figure out how to make it so that "radio" trigger is only shown to west. So that east cant call in the suicide drones

lapis nest
#

if(side _x == east) then
SDtrig hideObject true;

this is what ive pieced together. probably wrong to all shit tho

lapis nest
faint burrow
#
_waypoint = (group (driver SD)) addWaypoint [getPosASL (thisList select 0), -1];

_waypoint setWaypointType "LOITER";
faint burrow
#

Also, if SDtrig is trigger, then hiding it doesn't make sense -- it's alredy invisible.

lapis nest
#

it is the trigger. idk how to make it so that only west can call it

#

this whole coding thing is some witchcraft fr

faint burrow
alpine mountain
#

Quick question, can cursorTarget be player like checking

cursorTarget == player
proven charm
#

no because player is valid only in clients and player cannot point to it self

faint burrow
alpine mountain
#

Ok, thx for the info

faint dove
#

@indigo snow thanks very much!

delicate hedge
#

if i run "call" function in sheduled enviroment will it wait until the "call" func completes?

winter rose
#

yes, the code after that won't execute until it's done

faint burrow
#

In any environment call'ed function will be waited for to complete.

golden ridge
#

Hello! I'm having trouble finding out how to have a trigger activate a Keyframe Animation (basically trying to make it to where when a player steps in the area it will activate the Keyframe Animation) and I have been trying to google it for the longest time but, I cannot find it. Only one person ever made a post about it on online and he was asking the same thing. If anyone can help me that would be great!

open hollow
#
_circ = floor ( (2 * 3.14 * _areaSize) / 17 );
_class = "CUP_A2_Road_grav_1_1000";
_part = floor(360/ _circ); 
for "_i" from 0 to _circ do { 
    _pos = _sector getpos [_areaSize, _part * _i];
    _o = createSimpleObject [_class, (asltoagl _pos), false];
    _o setdir ( (_part*_i) + 90); 
};

Any idea why this happen?

faint burrow
#

Happens what?

open hollow
#

its like its using the wrong lod

faint burrow
#

Don't know. CUP bug?

open hollow
#

asltoaglblobcloseenjoy its **agltoasl **

faint dove
#

hmmmm, Error Undefined variable in expression: cfgmusic

acoustic abyss
#

Pardon me everyone.

A coop misison I'm playing has bugged. I am the host (have debug console).
What are the exact commands to create a curator and assign it to me?
Something with createVehicle and assignCurator, I know.

still forum
#

_music = "true" configClasses (missionconfigFile >> "cfgMusic");
@candid sun

ornate whale
#

I created a small scene where I test lights under water, because there are not flashlights available for divers. Is there any way how to make the light sources move smoother with the object they are attached to? Also, would this work properly in multiplayer, and affect AI spotting as well? Thanks

tulip ridge
#

Are you not able to turn a flashlight on underwater?

jade acorn
ornate whale
vapid scarab
#

keyframe_1 setVariable ["paused", false]

#

So to figure this sort of thing out, right click on the timeline and open in config viewer.
Open the drop down for it and find the attributes sub-config

#

These attributes are what are shown in the 3den attributes menu.

#

Select paused and view the property element.

#

That property element is what that variable is called on the keyframe logic object.
And you just set the variable on the timeline logic to un/pause the keyframe.

keyframe_1 setVariable ["paused", false]

tulip ridge
acoustic abyss
open hollow
#

Any idea how SPE make the bombs explodes 5 seconds after hitting the ground?

#

any way to made a script to replicate it with any bomb?

versed belfry
#

Hello :D

Quick question, how would I go about creating a smoke grenade somewhere specific? Not just the smoke effect but as if the smoke grenade was thrown by a player.

warm hedge
#

You can createVehicle it

versed belfry
#

Thanks

tulip ridge
open hollow
tulip ridge
#

Check function declarations maybe?

indigo snow
#

Fucking always make that error haha

grizzled cliff
#

@still forum it was cause i did a huge search and replace and it did something like constructor(int init) : val(init) to constructor(int init) : init

#

and it was like "woah, no idea"

gusty walrus
#

@indigo snow @still forum thanks for the help, music/sound/radio preview tool incoming!

indigo snow
#

sounds cool!

brittle minnow
#

Hey there people

I'm currently making a camouflage mod to reduce player detection by bots, I'm using an algorithm to compare surface texture to player uniform texture. I was wondering if I could take it further and apply weapon, vest and helmet to my calculations. Is there any way to get those object colors or textures?

I would be thankful if you could help me.

manic sigil
#

Would be more useful for vanilla, though, since mods tend to stray from overly descriptive item names.

brittle minnow
#

Uniform texture approach that I use now gives me a RGB value to compere with the surface texture RGB, I want this to be the same but I haven't found any references.

#

@warm hedge Any suggestions?