#arma3_scripting

1 messages · Page 703 of 1

half moon
#

Tell me why this doesn't work? RemoteExec makes the same code run through all the machines but my friend sees smoke yet I don't

winter rose
#

hm-hmm… commented code

little raptor
#

if it's in object init it's already locally executed

jade acorn
#

and one ";" too many

little raptor
#

no need for remoteExec

little raptor
half moon
#

Init field, but I seem to remember that was a big no no if you remoteExec from init field :d

#

So I should put it somewhere else then

winter rose
#

yyyyyyes.

little raptor
#

you can put actions in init field

#

if you intend it to be there for the whole lifetime of the object

#

but without remoteExec

half moon
#

I run it through Zeus code executor, as global & jip. Still no luck. We see the addAction but only the one who presses the action sees the smoke..

#

Run it as local through the same code executor and no luck.

#

I can't wrap my head around this..

#

Could it be because the addAction is remoteExec'ed, that it doesn't remoteExec the CBRN_fnc_spawnMist?

#

Because if I run the fnc_spawnMist through the code executor, my friend does see the smoke.

little raptor
#

not the addAction itself

#

altho it depends what that function does

#

but according to your description I'm gonna guess it does need it

half moon
half moon
# little raptor see the pinned messages

Cheers mate. Probably got it working now. Put the remoteExec of fnc_spawnMist part on a seperate .sqf, and remoteExec'd a addAction that launches the said .sqf.

past wagon
#

instead of doing this:```sqf
_var1 = "a";
_var2 = "a";
_var3 = "a";
_var4 = "a";

```sqf
{
  _x = "a";
} forEach [_var1, _var2, _var3, _var4];
```?
little raptor
#

no

#

you can use arrays tho:

_a = [];
_a resize 10;
_a = _a apply {"a"};
past wagon
#

wait what

little raptor
past wagon
#

yeah

#

ok

little raptor
#

and use the array elements

past wagon
#

okay

#

another question: if im not using any AI in my mission, will it still screw things up to change setFriend during the mission?

little raptor
#

¯_(ツ)_/¯

past wagon
#

guess i'll find out

winter rose
#

_a _a _a _a stayin' alive, stayin' alive

jolly matrix
#

Can I pester someone for some help?

winter rose
#

both genuinely horrible solutions, as @little raptor's reaction will be proving 😁

winter rose
little raptor
past wagon
#

i'll just do it the old fashioned way

winter rose
#

let's see who can get the dirtiest code 😂

past wagon
#

you forgot to put it inside an if ( true )

winter rose
#

that's implied, of course

little raptor
jolly matrix
#

When I run this script I get an error saying missing ) on line 52. This is the line but I don't see the issue with it: sqf if (_Spawntarget distance _x ˃ _Deletedistance) then { deleteVehicle _x; };

winter rose
#

try above

little raptor
#

at least line 51

#

I guess you have a missing ;

jolly matrix
#
 {
  _EditGroup = _x;
  for "_i" from count waypoints _EditGroup - 1 to 0 step -1 do  { deleteWaypoint [_EditGroup, _i];};
  _NewGroupWayPoint = _EditGroup addWaypoint [position _Spawntarget, 0];
  _NewGroupWayPoint setWaypointType "MOVE";
  {
   if (_Spawntarget distance _x ˃ _Deletedistance) then { deleteVehicle _x; };
  } forEach units _EditGroup;
 } foreach (allGroups select {side _x == _Spawnside && (_x getVariable ["spawned",true])});

 sleep (random [_Spawnmindelay,_Spawnavgdelay,_Spawnmaxdelay]);
};
#

That the segment.

little raptor
#

it doesn't show in the game

#

therefore not the actual > character

#

it's char 707

#

definitely not ASCII

#

ASCII for > is 62

jolly matrix
#

Ah thanks that fixed the issue. I couldn't work it out for the life of me.

winter rose
#

copy pasting from the web can be misleading sometimes unfortunately (“ quotes ” included)

little raptor
#

also using non-English language when typing can lead to these issues

winter rose
#

no u

#
if (_jeSuisFrancais) then
{
  hint "Ça marche, biches !";
};
```should work 😛
little raptor
#

not all non-English languages... meowsweats

#
if (_jeSuisFrançais) then
{
  hint "Ça marche, biches !";
};
```![meowsweats](https://cdn.discordapp.com/emojis/707626030613135390.webp?size=128 "meowsweats") (was just testing the syntax highlighting)
winter rose
#

yeah, noticed that too ^^

#

but I think it will work in sqf, not certain though

little raptor
#

no

winter rose
#

iirc, in C# one can name their variable ☺ = 33;

winter rose
#

ANSI only, heh?

little raptor
#

but my mod formats it as if nothing's wrong:

winter rose
#

need a ticket? 😛

little raptor
#

no I'll write it myself! 😛

#

I'm the ticket man after all meowsweats

little raptor
#

I guess this'll work

winter rose
#

that's actually great
no more “ ” either nor > (707) I assume!

little raptor
#

well the 707 one cannot be displayed at all meowsweats

#

“ ”
this was correct tho

#

I was using \w+ in regex

#

changed it to [_a-zA-Z0-9]

winter rose
#

noice

undone flower
#

so how'd I trigger a mission failure if the player leaves the AO? using a trigger?

#

there might be a built-in module or function in eden that I haven't discovered yet

winter rose
#

if the player is not present you mean…? 😉

undone flower
#

while I could make a simple approach using triggers, I'm debating if I should make a script that constantly swarms the player with missiles from random directions

undone flower
winter rose
undone flower
winter rose
#

for infantry it uses a mine, for vehicles a rocket, for anything else setDamage 1 ^^

undone flower
#

ooo very nice. you know its name?

winter rose
#

It's Jim

#

dang, can't find it

undone flower
#

"neutralize" >literally obliterates

#

I was using ctrl+f with "kill" or "destroy" but naah euphemism

winter rose
#

well, he's "neutralised"

#

I went with "disable", but I browsed the whole functions list twice to find it

undone flower
#

disabled is the very best outcome

#

now I just need to find the missile beeping sound

copper raven
#

just spawn a missile instead, ez fix

undone flower
copper raven
#

pretty sure i had a script somewhere for it 🤔

undone flower
#

it would be cool but I'm not really sure how to implement it

copper raven
#
params [
    ["_target", objNull, [objNull]],
    ["_minMissiles", 1, [0]],
    ["_maxMissiles", 6, [0]],
    ["_minDistance", 1000, [0]],
    ["_maxDistance", 6000, [0]],
    ["_missileTypes", ["ammo_Missile_s750"], [[]]]
];

if (isNull _target || {!(_target isKindOf "Air") || {_missileTypes isEqualTo []}}) exitWith {false};

private _cfgAmmo = configFile >> "cfgAmmo";

private _targetPosition = getPosASL _target;

for "_i" from 1 min _minMissiles to _minMissiles + round random (_maxMissiles - _minMissiles) do {
    private _type = selectRandom _missileTypes;
    private _missile = createVehicle [_type, [0, 0, 0], [], 0, "CAN_COLLIDE"];
    private _missilePosition = AGLToASL (_target getPos [_minDistance + random (_maxDistance - _minDistance), random 360]) vectorAdd [0, 0, _targetPosition # 2 + random 500];
    _missile setPosASL _missilePosition;
    private _vectorDir = _missilePosition vectorFromTo _targetPosition;
    _missile setVectorDir _vectorDir;
    _missile setVelocity (_vectorDir vectorMultiply getNumber (_cfgAmmo >> _type >> "maxSpeed"));
    _missile setMissileTarget _target;
};

but they obviously can flare the missile, if in the plane 😄

undone flower
#

replacing that "for" with "while"

copper raven
#

wrap the spawning part into isNil { } then

undone flower
#

that's a function, right? how do I make those work in my mission? I read you need to mess with a file on mission root

copper raven
#

use cfgFunctions

winter rose
#

freshly rewritten!\®

copper raven
#

true, it was like 3years old

undone flower
#

bis_fnc_neutralizeunit works in a very similar way apparently, but far less customiseable

winter rose
copper raven
#

ohhh, i see 😄 meowsweats

undone flower
copper raven
undone flower
#

also, question. does trigger performance degrades with its size?

winter rose
#

thanks! that was the hoped result 😄

copper raven
winter rose
#

it does by its list, in a way

copper raven
#

yea, but you could have many objects in a small trigger area, and it would basically mean the same as a big area with small amount of objects

winter rose
#

yep yep

#

just worth mentioning that "any object" triggers waste perfs :p

#

anyway
don't use triggers
problem solved 😄

undone flower
winter rose
#

a trigger without any conditions / a map marker + inArea 🙂

undone flower
undone flower
#

I wonder if the zeus "hide map" module would work with inArea

undone flower
#

hmm... vehicle crew bails out of the vehicle when it has critical damage despite the vehicle being locked. is there a way to stop this?

winter rose
#

yes

#

you're welcome.

undone flower
#

super epic

winter rose
#

nah, Steam only 😉

undone flower
winter rose
#

no

#

1/ forEach takes an array, not code (forEach allUnits
2/ only for units already in a vehicle at the time
3/ a bit redundent, try using vehicles

#

@undone flower ↑

undone flower
tidal idol
#

Anyone know a way to make both units in a two-seater plane eject on mission init? I've tried putting [this] spawn BIS_fnc_PlaneEjection; in the init of one of SOG's F-4s, and only the front seater would eject. Today, I tried it with Firewill's F-15D, and the front seater was ejected, but not with the seat, and the back seater went down with the ship like in the F-4.

Multiplayer compatible method preferred

winter rose
#

initServer.sqf
and use the SOG VN_fnc ejection method

tidal idol
#

actually, I'm trying not to have sog as a dependency, I just used the F-4 to test cause it's a two seater

tidal idol
winter rose
#

I say that for you, not the Script Police

round scroll
#

as you discovered. SOG:PF has a special function for it, maybe Firewill's plane too?

tidal idol
#

I might try digging around in the configs again but Im not very experienced in that so it wont be fun. Ive also tried using a simple pilotname action eject (with proper syntax im on mobile rn) but to no avail.

If i cant figure something out ill just start the players on the ground

past wagon
#

could I declare variables from an if exitWith statement, like this:

_var = if ( condition ) exitWith { "value" };
#

also, is the exitWith code executed in the same scope as the rest of the script?

fair drum
#

so that the exitWith only exits that scope and not your whole script

past wagon
#

okay

#

that makes sense

#

i'll do that

still forum
past wagon
#

im doing it in a function, which I call

still forum
#

setting local variable from higher scope?

past wagon
#

idk

#

ill use hypoxic's method

still forum
#

His method won't exit your function, like yours did

fair drum
#

its actually faster than using a switch as well, but its a lot more writing.

_result = call {
    if (false) exitWith {};
    if (false) exitWith {};
    if (true)  exitWith {};
    if (false) exitWith {};
    if (false) exitWith {};
};                            // 0.0032 ms

_result = switch (true) do {
    case (false): {};
    case (false): {};
    case (true) : {};
    case (false): {};
    case (false): {};
};                            // 0.0047 ms

past wagon
#

yeah, the thing is my "apple"s and "pear"s are actually huge arrays

still forum
#

Like maybe you actually want
if ( condition ) exitWith { _var = "value" };

undone flower
#

do I need to terminate my single run scripts? or they're automatically unloaded?

undone flower
#

ahh good

little raptor
past wagon
#

still forgot to wrap it in an if (true)

fair drum
little raptor
fair drum
#

yeah, but this guy asking the question is super super new. made it as plug and play as possible for him

tired delta
#

Hello everybody, i got a problem with a script of mine. I want to spawn a Praticel effect after a player interacts with a object. In the Editor on my test mission it just works fine but when i put it on my Server it dose not work anymore. Dose someone know why?

This is the code i use to spawn the effect:
_smoke = "#particlesource" createVehicleLocal _pos;
_smoke setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 16, 1], "", "Billboard",
1, 8, [0, 0, 0], [0, 0, 2.5], 0, 10, 7.9, 0.066, [2, 6, 12],
[[0, 0, 0, 0], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.1, 0.1, 0.1, 0.5], [0.125, 0.125, 0.125, 0]],
[0.25], 1, 0, "", "", _smoke];
_smoke setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_smoke setDropInterval 0.1;

little raptor
#

local means on the current machine

tired delta
#

ohhhhh

#

"createVehicle" should do the trick then right?

fair drum
#

keep it local though as a particle effect. just turn it into a function and call it on the machines you want it to

little raptor
#

note sure if it works with particle effects

#

even if it does, setParticleRandom has local effect

tired delta
#

thank you guys, but i want that all players can see it. Is that possible if i make a local function?

fair drum
#

all players can see it if you create it locally on every machine

#

does that make sense?

tired delta
#

it dose xD. Thank you so much ❤️

little raptor
#

just not exactly the same thing

fair drum
#

not different enough for you to care about it for your application though

little raptor
#

but still it's random particle effect so it can never look the same

#

¯_(ツ)_/¯

round scroll
#

in years of using remoteExec for the Nimitz catapult smoke, noone ever complained about not seeing the exact same smoke. Hope I didn't jinx it now

little raptor
round scroll
#

yes

tidal idol
little raptor
tidal idol
#

Yeah

round scroll
cold cloak
#

Ok I am in need of of help again

taskState task3 == Succeeded

I cant get this simple as condition to work

#

Yes

little raptor
cold cloak
#

thank you bro

#

like I just switched the condotion to the bis one but I got the variable wrong xd

anyways thanks a lot

cold cloak
#

the task1 completion trigger doesnt have anything in the activation so idk what causes that

#

it does it sometimes, sometime it doesnt

#

pretty weird

hushed tendon
#

If I'm making code in initPlayerLocal.sqf can I use player to reference the current client in MP? Like if I wanted to give that one person an addAction I could do

player addAction ["Play Intro", {[] execVM "introLocal.sqf";}];

and it would only execVM "introLocal.sqf" for that client?

fair drum
chrome wraith
#

Another noob question from me - is it possible to specify some commands to be executed when a script is terminated?
I know it's better etiquite to use exitWith, but I've got a 5-minute sleep timer running for a spawn protection script, as I don't want "x minutes since mission start" flooding the chat. I'd love to be able to allow damage upon the script terminating, rather than having a second script or putting it all in a trigger on-activation field.

hushed tendon
fair drum
chrome wraith
#

Will do, thanks

fair drum
#

if you accidentally call it on a dedicated server, nothing happens with your cutText

chrome wraith
#
_pis = true;
{_x allowDamage false} forEach ((getMissionLayerEntities "Spawn") select 0);
{_x enableSimulationGlobal false} forEach ((getMissionLayerEntities "Enemies") select 0);
{doStop _x} forEach ((getMissionLayerEntities "DoStop") select 0);

while {_pis == true} do {
    chief sideChat "Weapons are cold, AI disabled -- Waiting for all players to leave spawn";
    sleep 540;
};

//The trigger activation:
//terminate sp;

Ideally, I just want to toggle simulation for the spawned enemies and damage for players upon termination.

hushed tendon
chrome wraith
#

@still forum lmao is it that bad?

still forum
#

is bed time
walks away quickly

fair drum
#

lol theres a lot to unpack here, give me a sec

#

where is this script located btw?

chrome wraith
#

It's just sitting in my mission folder, called in my init.

chrome wraith
fair drum
fair drum
chrome wraith
fair drum
hushed tendon
fair drum
chrome wraith
#

Thanks!

tender fossil
#

Note!! Arma 2: CO

Why does this https://sqfbin.com/mojojicebiralojasiyi print

this stuff in globalChat: civ31 was spotted near Location NameCity at 10314, 2159!

Even the coordinates make no sense 😄

fair drum
#

_wantedCiv is grabbing the civilian variable, not the name of the unit

fair drum
#

so in your global chat section

#

add name before _wantedCiv on the format

tender fossil
#

Oh yeah, that was intentional (just for testing)

hushed tendon
tender fossil
#

But that Location NameCity at 10314, 2159! still puzzles me

still forum
#

why are the coordinates wrong?

#

10km east and 2km north from map corner

#

looks viable to me

tender fossil
#

Ok, so they differ from map coordinates

#

Then it's correct

fair drum
tender fossil
#

It should print "Elektrozavodsk" though?

still forum
#

think theres a command to get the name of a location

hushed tendon
still forum
#

NameCity is the type of the location

fair drum
#

name can do locations I believe

#

When argument is Location, the location's name is returned

#

@tender fossil use name before the location variable on the formats for your global chats as well

tender fossil
fair drum
#

If the argument is location, returns location's text value (see Alt Syntax).

tender fossil
#

I see, trying it now

hushed tendon
#

In my Description.ext I've set

respawnDelay = 0;
respawnOnStart = 1;

and the player does have a respawn (module) but they spawn in debug at the start of the mission for some reason.

past wagon
distant oyster
past wagon
#

yeah but I dont know what that means

#

i have never worked with waypoints before

distant oyster
#

eg the group already has 2 waypoints to move to a location but at some point they encounter enemies and now you can insert a SnD waypoint between the two move waypoints

#

the new behaviour is: Move > SnD > Move

jovial steeple
#

If I spawn a missile with BIS_fnc_exp_camp_guidedProjectile can I force a flight profile? Specifically Cruse.

tight cloak
past wagon
distant oyster
#

most likely the case, though I am not sure what happens if you give them an index of 100 or similar

past wagon
#

ok

tight cloak
#
if (side player == west) then {

        _subtitles = [
            [ "System",            "Loading, please wait. This may take some time...", 0],
            [ "System",            "Almost done, final touches...", 10],
            [ "System",            "Loading complete, transmitting data...", 20]
        ];
        _subtitles spawn BIS_fnc_EXP_camp_playSubtitles;
        sleep 30;
        0 fadeMusic 0;
        sleep 0.1;
        titlecut ["","BLACK IN",7];
        playMusic "EventTrack01a_F_Tacops";
        6 fadeMusic 1;
        _camera = "camera" camCreate [12031.02,4828.08,0.92];
        _camera cameraEffect ["internal", "back"];
        _camera = "camera" cameraEffect ["terminate", "back"];
        camDestroy _cam;
        sleep 30;
};
``` trying to get a camera to work
#

it works fine, but it wont leave the camera at the end

#

any idea why?

winter rose
#

Yes
Wrong usage of cameraEffect @tight cloak

#

plus, you create and destroy the camera immediately

tender fossil
#

Me gusta

tight cloak
#

ive added a sleep between creation and termination

winter rose
tight cloak
#
if (side player == west) then {

        _subtitles = [
            [ "System",            "Loading, please wait. This may take some time...", 0],
            [ "System",            "Almost done, final touches...", 10],
            [ "System",            "Loading complete, transmitting data...", 20]
        ];
        _subtitles spawn BIS_fnc_EXP_camp_playSubtitles;
        sleep 30;
        0 fadeMusic 0;
        sleep 0.1;
        titlecut ["","BLACK IN",7];
        playMusic "EventTrack01a_F_Tacops";
        6 fadeMusic 1;
        _camera = "camera" camCreate [12031.02,4828.08,0.92];
        _camera cameraEffect ["internal", "back"];
        sleep 30;
        _camera cameraEffect ["terminate", "back"];
    camDestroy _cam;
        sleep 30;
};
#

would this work then?

winter rose
#

most likely yes.

tender fossil
#

@winter rose Wanna save me once again?

winter rose
#

nope 😄

tender fossil
#

🥲

tight cloak
#

getting more general errors in expression

winter rose
# tender fossil 🥲

you throw in 200 lines of code and say "this doesn't work", soooooo hmyeah ? 😬 ^^

tight cloak
#

and its playing the subtitles before the cam / cam not at all

tender fossil
tight cloak
#

the error seems to be with sleep

winter rose
#

init field / trigger, right ?

#

ps : you delete _cam @tight cloak

winter rose
tight cloak
#
if (side player == west) then {

        _subtitles = [
            [ "System",            "Loading, please wait. This may take some time...", 0],
            [ "System",            "Almost done, final touches...", 10],
            [ "System",            "Loading complete, transmitting data...", 20]
        ];
        _subtitles spawn BIS_fnc_EXP_camp_playSubtitles;
        sleep 30;
        0 fadeMusic 0;
        sleep 0.1;
        titlecut ["","BLACK IN",7];
        playMusic "EventTrack01a_F_Tacops";
        6 fadeMusic 1;
        _camera = "camera" camCreate [12031.02,4828.08,0.92];
        _camera cameraEffect ["internal", "back"];
        sleep 30;
        _camera cameraEffect ["terminate", "back"];
    camDestroy;
       
};
winter rose
#

now you camDestroy nothing

#

Please read the wiki

tight cloak
#

i have 😦 im just slow

winter rose
tender fossil
winter rose
#

I see it thrice

tender fossil
#

Yes, it's just because of the loop

winter rose
#

ok
so you get two outputs each time, ok

tender fossil
#

Yes

#

I think it's the broadcast?

#

Here's the code

ISSE_pub_varCount = _this select 0;
ISSE_pub_varNum   = _this select 1;
ISSE_pub_varName  = format["ISSE_pub_Pstr_%1", ISSE_pub_varNum];

for [{_i=0}, {_i <= (ISSE_pub_varCount)}, {_i=_i+1}] do 

{
                    
_varName = format["ISSE_pub_Pstr_%1", _i];                                                        
call compile format['%1 = " ";', _varName];        
_varName addPublicVariableEventHandler {call compile (_this select 1);};

};

broadcast = 

{
                                                            
if ((TypeName _this) == "STRING") then 

    {
                                                                                                                                                        
    call compile format['%1 = ''%2'';', ISSE_pub_varName, _this];                                        
    publicVariable ISSE_pub_varName;                                                                                                                        
    call compile _this;
    //player groupchat str _this;
        
    } 
    else 
    {
                        
    hint "Public Error: expecting String.";        

    };

};

ISSE_pub_execStr = 

{
        
if ((TypeName _this) == "STRING") then {call compile _this;} else {hint "Public Error: expecting String.";};

};
#

This is like 10-15 years old code 😄

tight cloak
#

oaky i cant figure out cam stuff.... so

#

i just blended two of my broken scripts together

#

the one that keeps you stuck in the cam

#

and the one that blips you in and out

#

its....

#

horrific behind the scenes. but looks good

#

it serves its purpose

tender fossil
tight cloak
#

so i use


if (side player == west) then { 
 
  _subtitles = [ 
   [ "System",   "Loading, please wait. This may take some time...", 0], 
   [ "System",   "Almost done, final touches...", 10], 
   [ "System",   "Loading complete, transmitting data...", 20] 
  ]; 
  _subtitles spawn BIS_fnc_EXP_camp_playSubtitles; 
  sleep 30; 
  0 fadeMusic 0; 
  sleep 0.1; 
  titlecut ["","BLACK IN",7]; 
  playMusic "EventTrack01a_F_Tacops"; 
  6 fadeMusic 1; 
  _camera = "camera" camCreate [12031.02,4828.08,0.92]; 
  _camera cameraEffect ["internal", "back"]; 
};
  _camera cameraEffect ["terminate", "back"]; 
 camDestroy camera; 
#

to start it

#

then

#
if (side player == west) then { 
 
  _subtitles = [ 
   [ "System",   "Loading, please wait. This may take some time...", 0], 
   [ "System",   "Almost done, final touches...", 10], 
   [ "System",   "Loading complete, transmitting data...", 20] 
  ]; 
  _subtitles spawn BIS_fnc_EXP_camp_playSubtitles; 
  sleep 30; 
  0 fadeMusic 0; 
  sleep 0.1; 
  titlecut ["","BLACK IN",7]; 
  playMusic "EventTrack01a_F_Tacops"; 
  6 fadeMusic 1; 
  _camera = "camera" camCreate [12031.02,4828.08,0.92]; 
  _camera cameraEffect ["internal", "back"]; 
  sleep 30; 
  _camera cameraEffect ["terminate", "back"]; 
 camDestroy camera; 
};

to get out of it

#

XD

#

but im gonna change some stuff such as the lines of text

#

and add a cut music line

undone flower
#

how come my code only works when it wants to redchain

#

sometimes it works fully. sometimes only partially. sometimes it just doesn't

tough abyss
#

what is your code? @undone flower

undone flower
# tough abyss what is your code? <@!324351220779319300>
{
(objectParent _x) setVehicleCargo objNull;
} forEach (thisList);

This runs in a "move" waypoint and goes in the "on activated" field. it paradrops the vehicles inside another vehicle. "thisList" returns the array of both pilots

tough abyss
#

as far as I can tell that should work

#

not sure why it would only work sometimes

#

(im sure someone else will know why)

undone flower
#

ahhh, I see now. setVehicleCargo objNull only works if the vehicle CAN eject the vehicle inside. if the conditions are unsafe, it won't work

undone quiver
#

What exactly would cause a 'safepositionanchor/' is not a class ['type' accessed] Nothing in the RPT

gusty epoch
#

Is there a script to make a Vehicle drive along a road?

tidal ferry
#

Is there any way to log every chat message sent in side/global channel to log file?

gusty epoch
#

Thanks

#

:)

fair drum
chrome wraith
fair drum
brittle harness
#

hello im having some trouble

#

hopefully someone will be able to help me

#

so i have this script here

#

if ((side _x) == east) then { pc1 doFollow (side _unit);
};

#

(x) and (unit) need to be defined

#

but i do not want them defined with a unit name

#

I want them basically defined as any OPFOR

#

hopefully that makes sense

verbal geyser
#

Hi!
I'm trying to add death markers when anyone dies. It works with the first death and guess I have to add a counter to the marker name.
Can someone please help me with that?

_x addEventHandler ["Killed", {   
_marker = createMarker ["Death", getPosATL (_this select 0)];   
_marker setMarkerShape "ICON";   
_marker setMarkerType "KIA"; 
"Death" setMarkerColor "ColorWhite";}];  
} forEach allUnits;```
brittle harness
#
}``` would this work?
warm hedge
#

No...?

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

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

@brittle harness @verbal geyser

little raptor
little raptor
willow hound
# verbal geyser Hi! I'm trying to add death markers when anyone dies. It works with the first de...

I would suggest something like this for singleplayer:

_x addEventHandler ["Killed", {
  private _marker = createMarker [format ["Death %1", PPR_markerID], getPosATL (_this select 0)];
  PPR_markerID = PPR_markerID + 1;
  _marker setMarkerShape "ICON";
  _marker setMarkerType "KIA";
  _marker setMarkerColor "ColorWhite";
}];
```Put `PPR_markerID = 0;` into an init script that runs at the beginning of the mission.
willow hound
verbal geyser
#

@willow houndThe original code worked, but only for first death. Edited code doesn't work at all. Or maybe I'm just too stupid 😋

plucky hornet
#

Do you still have this mission? Would like to see how you made the setup 🙂

spark turret
#

Huh i can look but probably not

#

I have a video of it but thats probably not helpful

#

heres a download link, it has a pretty big mod setup so you might not be able to start it, the shooting range is at IRON/Schiessbahn. Theres some REALLY bad code in that mission so dont judge me 😄

willow hound
plucky hornet
#

Awesome man! I will try, thank s :)

tender fossil
#

Oh, and @fallow quarry edited it too

verbal geyser
#

@willow houndSeems to be working. Will test it live soon. Thank you very much. 👍

fair drum
silk ravine
#
if (local this && isPlayer _this) then {
    [true] call ACE_spectator_fnc_setSpectator;
};

doesn't work
local _this = me want object not array
local this = no me want defined variable
this is called via onPlayerRespawn.sqf

#

is this one of those rumbly cases where I have to go for _x?

#

Even tho its not a loop

willow hound
#

The player is always local to the client where onPlayerRespawn.sqf runs and the player is also always a player.

#

So as far as I can tell you should be able to call ACE_spectator_fnc_setSpectator without that if-statement.

silk ravine
silk ravine
#

@willow hound is there a way in ZEUS to execute code for a spicific player? never did that before

brazen lagoon
#

not sure where this goes, just kinda guessed it was here because its maybe scriptable - how would I change an existing vehicle to allow shooting from the passenger seats?

brazen lagoon
#

rgr

#

what channel is that most fitting for

#

config?

little raptor
#

yeah

brazen lagoon
#

lol

#

i wonder if that ever works

silk ravine
#

@willow hound I checked

#

there is

silk ravine
#

souble click on the unit

#

has execute field

brazen lagoon
#

neat

#

thanks leopard

silk ravine
#

@willow hound Do you know if that execute field is local to the client?

#

Or will it fire [true] call ACE_spectator_fnc_setSpectator; on all cleints like when someone puts it in an objects init field?

#

Would _this call ACE_spectator_fnc_setSpectator; be better?

drifting portal
#
while {true} do {
if ((date select 3) == 4 && (date select 4) == 0) then {
waitUntil {alive ifvD && alive ifvG};
[player,"AmovPercMstpSnonWnonDnon_exercisePushup"] remoteExec ["playMove"]; 
[player,"AmovPercMstpSnonWnonDnon_exercisePushup"] remoteExec ["playMove"];
{
_x disableAI "all";
_x action ["Eject", vehicle _x];
_x switchMove  "Acts_Dance_02";
_x switchMove  "Acts_Dance_02";
_x enableAI "all";
}forEach units west;
};
};

I'm trying to make it so that when its 4:00 in game the players start doing push ups while the enemy soldiers dance (its a joke), but when it hits 12:00 the code is executed but then it keeps looping the same code even when it is supposed to end because its not 4:00 anymore, what is the problem?

undone quiver
#

Eh, not a fan of while loops

#

I'm wondering if there's an event handler of some sort you can use

little raptor
#

wat?

#

plus your while loop has no sleep

drifting portal
#

also what delay do I need to add?

#

you mean the code is being executed multiple times when it hits 4:00? oh ok lol

#

sound

undone quiver
#

Yeah it doesn't make much sense. But I'm more concerned about the while loop. Not a fan

drifting portal
undone quiver
#

Yeah, just feel there's a better way

drifting portal
#

I wanted it to verify the if statement every frame, so I used while, I'm not sure if there is a better way

little raptor
drifting portal
willow hound
tired delta
#

Hey its me again, i got a question about the sleep command. Dose it stop the execution of all scripts or just the one its in?

still forum
#

just your script

#

not others

tired delta
#

thx 😄

#

❤️

hexed crown
#

Works but the cam doesn't move or change view direction.

params ["_pipTarget", "_source"];
_cam = "camera" camCreate [0,0,0];

_cam cameraEffect ["External", "Back", _pipTarget];

/* make it zoom in a little */
_cam camSetFov 0.7;

/* attach _cam to _source cam position */
_cam attachTo [_source, [0,0,0], "PiP0_pos", true];
/* switch _cam to NVG */
_pipTarget setPiPEffect [0];
/* adjust uavcam orientation */
addMissionEventHandler ["Draw3D", {
    _dir = 
        (_source selectionPosition "PiP0_pos") 
            vectorFromTo 
        (_source selectionPosition "PiP0_dir");
    _cam setVectorDirAndUp [
        _dir, 
        _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
    ];
}];
hexed crown
#

It's defined in the editor when calling the script.

little raptor
#

neither is _cam

hexed crown
#

I feel kinda dumb now.
I went to college for this.

#

I can't believe I forgot about that.

#

How would I pass that into the draw3d form the rest of the script?

little raptor
#

also only create 1 such EH, and do many things in it (if that's what you want to do, e.g. handling multiple cameras)

#

for performance reasons

hexed crown
#

I still have the issue of the camera not attaching to the drone correctly.
It gets moved to the drone's location on init, but doesn't move with the drone.

little raptor
#

not sure

#

but I think I couldn't do it the last time

hexed crown
#

I have it working in another script.
The issue with the other script is that it won't create multiple cams.

#

But it works exactly how I want it to otherwise.

#

Works but will only ever do one cam even with the variables being different.
Cam from first will display on device from second.
V1```sqf
/* create render surface */
tv setObjectTextureGlobal [0, "#(argb,512,1024,1)r2t(uavrtt,0.5)"];

uav lockCameraTo [tgt, [0]];

/* create camera and stream to render surface */
uavcam = "camera" camCreate [0,0,0];
uavcam cameraEffect ["External", "Back", "uavrtt"];

/* attach uavcam to gunner uavcam position */
uavcam attachTo [uav, [0,0,0], "PiP0_pos"];

/* make it zoom in a little */
uavcam camSetFov 0.05;

/* switch uavcam to NVG */
"uavrtt" setPiPEffect [0];

/* adjust uavcam orientation */
addMissionEventHandler ["Draw3D", {
_dir =
(uav selectionPosition "laserstart")
vectorFromTo
(uav selectionPosition "commanderview");
uavcam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
}];

V2```sqf
/* create render surface */
tv1 setObjectTextureGlobal [1, "#(argb,512,512,1)r2t(uavrtt1,1)"];

uav1 lockCameraTo [tgt1, [0]];

/* create camera and stream to render surface */
cam1 = "camera" camCreate [0,0,0];
cam1 cameraEffect ["External", "Back", "uavrtt1"];

/* attach cam to gunner cam position */
cam1 attachTo [uav1, [0,0,0], "PiP0_pos"]; 

/* make it zoom in a little */
cam1 camSetFov 0.1;

/* switch cam to NVG */
"uavrtt1" setPiPEffect [0];

/* adjust cam orientation */
addMissionEventHandler ["Draw3D", {
    _dir1 = 
        (uav1 selectionPosition "PiP0_pos") 
            vectorFromTo 
        (uav1 selectionPosition "PiP0_dir");
    cam1 setVectorDirAndUp [
        _dir1, 
        _dir1 vectorCrossProduct [-(_dir1 select 1), _dir1 select 0, 0]
    ];
}];
still forum
#

You can get sqf highlight with

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
little raptor
#

they're both the same code

#

just different r2t and objects

hexed crown
#

Correct.
These scripts run alongside eachother.

little raptor
#

ok, so what's the problem?

idle jungle
#

Evening gents!

(Apologies for the format on mobile👀)

  params ["_unit", "_killer", "_instigator", "_useEffects"];
  hint ( (str _unit) + " just died!");
}] call CBA_fnc_addClassEventHandler;

How performance hogging would this EH be if

We used it remoteExec ["diag_log", 0]; to record hits/kills so my friends bot can record some form of after action reports?

I'm concerned this could.. kinda run down the server with the amount of times it would be fired if that makes sense?

little raptor
#

not sure

#

it shouldn't have much impact

#

but why do you remote exec that to every body?

#

just remoteExec it to your friend

idle jungle
#

@craggy temple you getting this?

So how do you target a player with remoteExec? Steam user id?

#

Oh i know, it's because his bot reads the servers RPT file thats why the 0

#

Then wouldn't it be -2 for server

craggy temple
#

We use the server log though (the rpt thats on the server) I dont always play the ops so can we get it to server only then?

idle jungle
#

1 mo

craggy temple
#

Its 2 yea

hexed crown
# little raptor ok, so what's the problem?

The "tv" from the first script is black. The "tv1" from the second script will almost always display the cam from "uav" from the first script, even though, according to the scripts, there seems to be no reason for this.

little raptor
#

duplicate r2t names

#

and not deleting the old r2t

hexed crown
#

"uavrtt" and "uavrtt1"

#

The vars in the second script all have "1" at the end.

little raptor
#

also what on earth is this?

"#(argb,512,1024,1)r2t(uavrtt,0.5)"
#

it must always be 1

#

not 0.5

#

or any other number for that matter

hexed crown
#

Hey, it worked this way, at the chosen resolution.

little raptor
#

afaik aspect ratio must always be 1

#

or >= 1? 🤔

hexed crown
#

Even when it is 1 and not 0.5 it changes nothing.

little raptor
#

are both uavs the same?

hexed crown
#

No, one is a Greyhawk and the other is a Darter.

little raptor
#

or PiP0_dir

#

why do you just copy paste stuff?

#

check them first

hexed crown
#

The Greyhawk isn't using those.

#

The Greyhawk is using the first script.

little raptor
#

uavcam attachTo [uav, [0,0,0], "PiP0_pos"];
cam1 attachTo [uav1, [0,0,0], "PiP0_pos"];

#

¯_(ツ)_/¯

hexed crown
#

It attaches fine and follows the Greyhawk.

little raptor
#

then maybe it was the darter that didn't have it

#

I don't remember which one was which

hexed crown
#

The Darter also works fine.

little raptor
#

you just said one of them doesn't....

#

if they both work fine then what's the problem?

hexed crown
#

It just won't render both cams to their separate devices.

winter rose
winter rose
little raptor
#

before even creating the r2ts

#

not sure if it affects anything, but it certainly isn't right

#

also afaik you shouldn't use setObjectTextureGlobal for r2ts

#

they're local afaik

hexed crown
#

Everything I saw online of people getting this working, were using setObjectTextureGlobal.

#

And it does set it for me.

little raptor
#

anyway, just close the game and start it again

#

r2t can be buggy in Arma sometimes

#

if you use an incorrect r2t name even once, the game breaks

hexed crown
#

Overview of issues:
Currently these 3 scripts work.
First script cam doesn't attach or follow its parent.
Second and third attach and follow, but only cam form 2 renders to device from 3.

#

Rebooted with the suggested changes, zero difference.

crude vigil
#

If so, put a 1 second sleep between them, it gets fixed

hexed crown
#

They are executed in the inits of the uavs.

little raptor
#

then together

hexed crown
#

So put 1 sec sleep in one script?

little raptor
#

spawn it too

little raptor
#

so even sleep 0.001 should work

crude vigil
#

sleep 0.001 doesnt always guarantee next frame afaik

#

hence I said 1

little raptor
hexed crown
#

Okay, sleep 1; in one of the scripts fixed script two and three.
Script one is still busted.

crude vigil
little raptor
crude vigil
hexed crown
#

Script one is executed when interacting with the device through addAction

spark turret
little raptor
hexed crown
#

The issue is still the fact that it does not attach with attachTo.

little raptor
#

check your variables then

#

put a systemChat in your code

#
systemChat str [_cam, _pipTarget, _source];
#

you can also try removing the followBone parameter from attachTo

craggy temple
#

If I do "name _vehicle" but _vehicle is null, what will happen? Will it crash or simply return null as well?

little raptor
#

it'll return an empty string

hexed crown
little raptor
#

just tested

craggy temple
#
name _vehicle,
_vehicle call BIS_fnc_objectType,
typeOf _vehicle,
roleDescription _vehicle,
getPos _vehicle,
groupId (group _vehicle),
#

Will any of those crash or just return some default values?

craggy temple
craggy temple
hexed crown
#

After running systemChat str [_cam, _pipTarget, _source];

#

Before Draw3d:
[164426<no shape>,"firefly1cam1",firefly1D]

little raptor
#

is it a simple object?

hexed crown
#

The Darter's variable name.

#

firefly1cam1 is the output texture.

#

obviously

crude vigil
#

What object is the tv1?

little raptor
#

tested in the game

hexed crown
#

Both those scripts work fine currently.
The only script left that doesn't is this one.

#
params ["_pipTarget", "_source"];
_cam = "camera" camCreate [0,0,0];

_cam cameraEffect ["External", "Back", _pipTarget];

/* make it zoom in a little */
_cam camSetFov 0.7;

/* attach _cam to _source cam position */
_cam attachTo [_source, [0,0,0], "PiP0_pos", true];
/* switch _cam to NVG */
_pipTarget setPiPEffect [0];
systemChat str [_cam, _pipTarget, _source];
/* adjust uavcam orientation */
addMissionEventHandler ["Draw3D", {
    
    _dir = 
        (_source selectionPosition "PiP0_pos") 
            vectorFromTo 
        (_source selectionPosition "PiP0_dir");
    _cam setVectorDirAndUp [
        _dir, 
        _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
    ];
}];
little raptor
crude vigil
#

Is this another one from first 2? >.>

hexed crown
#

I posted it before the other 2, you may have missed it.

crude vigil
#

_source is not defined in draw3d

crude vigil
hexed crown
#

Okay, so how would one pass those as an arg to the draw?
Can I see an example?

little raptor
#

why do you ask a question multiple times?

crude vigil
hexed crown
#

Is this the way to do that then?```sqf
addMissionEventHandler ["Draw3D", {

_dir = 
    (_source selectionPosition "PiP0_pos") 
        vectorFromTo 
    (_source selectionPosition "PiP0_dir");
_cam setVectorDirAndUp [
    _dir, 
    _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];

},[_cam,_source]];

crude vigil
#

Read the parameter's description

hexed crown
#

So I am missing "[thisArgs, _cam]" and "[thisArgs, _source]"?

crude vigil
#

They are not _cam and _source anymore

#

they are inside the array called _thisArgs

#

you need to fetch them from there

hexed crown
#
addMissionEventHandler ["Draw3D", {
    
    _dir = 
        (_thisArgs select 1 selectionPosition "PiP0_pos") 
            vectorFromTo 
        (_thisArgs select 1 selectionPosition "PiP0_dir");
    _thisArgs select 0 setVectorDirAndUp [
        _dir, 
        _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
    ];
},[_cam,_source]];
#

If this is correct, it still does not work.

quaint oyster
#

Is it possible to segregate weapon types via their type with a config classname grabbing code? (I'm sorry I forget the proper name of the function)

For example, I understand pistols / main weapons / rockets are in a category of their own, but is there sub classes like assault rifles, snipers, shotguns?

And if so, would it be possible to grab say, "snipers" specifically?

crude vigil
#

if so, firefly1D is not the vehicle but the "D"river of the firefly1

hexed crown
#

So how would I fix that?

#

This is the addAction

this addAction ["<t color='#00FF00'>View Firefly Feed</t>", { ["firefly1cam1", ((units Firefly) select 0)] 
crude vigil
#

((units Firefly) select 0) ?

#

Why >.<

#

just Firefly

hexed crown
#

To select the first Drone in the Firefly Unit.

crude vigil
#

But the source has to be the vehicle itself, not the unit that is driving it?

#

in your other 2 scripts, when you used variable names called uav, uav1

#

did you assume they re drivers of uav?

hexed crown
#

I can't believe that flew over my head as a possibility for being the issue.
I knew uav and uav1 were the drone themselves. Just didn't think about the possibility that the selection method wasn't grabbing the drone and was instead grabbing an imaginary pilot.

crude vigil
#

You mean selectionPosition command?

hexed crown
#

No

#

this

((units Firefly) select 0)] 
#

I didn't realize that was what it was doing.

crude vigil
#

So does it finally work?

#

Is everything okay?

hexed crown
#

Running a final test now.

crude vigil
#

That imaginary pilot is still an AI but does not have a body. When you connect to a uav, you are basically remote controlling it.

#

It is what allows you to connect to UAVs basically, also decides to which side an UAV/UGV belongs.

hexed crown
#

Yee. It makes perfect sense after you pointed it out, just didn't think of it myself at first.

#

It's shakey as all hell, but that's the fault of the drone not having amazing flight stabilization.

#

It does work.

crude vigil
#

Well, next step is making an independent camera instead of fixed to camera of drone then. Jokes aside, yeah it is a bad issue but it doesnt do it that much if it is stationary to my experience.

little raptor
hexed crown
#

I mean, yes, but it wouldn't be shaky if the drone was stationary.

crude vigil
#

attachTo also has its effect but the significant part is drone's movement management.

winter rose
#

simulation cycles play a role too

hexed crown
#

So it is partially the drone too.

little raptor
crude vigil
#

simulation cycle of vehicles is enough to not feel that

crude vigil
little raptor
crude vigil
#

But the shake he is talking about is not caused "Mainly" by attachTo is what Im saying

hexed crown
#

Well, I'm not interested in it working amazing currently, just that it works.
Seeing as I am new to the editor and all.

winter rose
#

hi new, I'm dad!

crude vigil
#

it is not about simulation, it is about the drone AI that keeps speeding up and slowing down

#

that causes the shake.

#

Thats what he is talking about

little raptor
#

it is

#

you wanna bet?

winter rose
#

fight! 😄

crude vigil
#

nope, Im out of here

#

Problem fixed, adios lol

hexed crown
#

Final question for now, how would I set up an action that deletes/undoes everything this action did when it executed the script?
If it is simple enough to do at least.

crude vigil
#

Check script parameter, check actionId parameter of it

#

BUT

#

now that I remember , there is an additional parameter to actually self delete so you may not need it

#

(unless it is MP ofc which 80% wont handle itself then due your needs)

#

hideOnUse parameter if it is SP mission.

winter rose
#

nope

little raptor
hexed crown
#

Oh, I see what you are talking about.
Not what I am looking for though.

winter rose
crude vigil
#

Yeah, I should ve read it ok ok

#

Im lazy, dont judge me

little raptor
hexed crown
#

I'm talking like, delete the camera and turn the screen back off.

winter rose
crude vigil
#

hi dad

hexed crown
#

So there is no way to make this action togglable?

winter rose
crude vigil
#

Wasnt there a self delete parameter for addAction?

winter rose
#

but you have to do it manually

crude vigil
#

Am I confusing it with something else?

winter rose
little raptor
crude vigil
#

Oh well

winter rose
#

other than that you can removeAction _actionId still

crude vigil
#

thats what I said

winter rose
#

yep
nothing else

#

but the void

crude vigil
#

but for some reason Leo is not happy with it and I didnt get the reason :P

winter rose
#

because it is not undoing the action, it is removing the action ^^

#

@hexed crown is asking for a "revert code" thingy 🙂

crude vigil
#

well thats what I thought he asked at first :(

#

(At some point, he ll need it too though)

hexed crown
#

Okay, so I would need to delete them in the editor, or I could make a second action that runs a script to delete them?

crude vigil
#

just change the texture of tv and live happily

#

ignore rest

#

I can already see a negative emote coming from Leo

hexed crown
#

But it is so massively inefficient to leave those cameras there if they are not needed.

crude vigil
#

Ah, another leo

winter rose
hexed crown
#

Is there a way to delete things using a script? If so I can do this, just need to find their IDs.

winter rose
hexed crown
#

True. I infer since you said that, that their is a way to delete using a script?

crude vigil
#

ooor ignore lou and use benefit of global variables that you used already , delete these vehicles using deleteVehicle (dont forget to finalize cameraEffect too)

#

oh I forgot about draw3ds tho

#

which he probably meant

winter rose
#

y u bulli mi

crude vigil
#

(just delete all mission event handlers with type "draw3d" it is ur mission anyway[so I can still say lou's way is unnecessarily complicated])

little raptor
crude vigil
#

Giving codes to people dont teach em anything😤

little raptor
#

I got bored 🥱

crude vigil
#

where are removal of draw3ds?

#

Giving absent codes to people dont teach em anything and confuse them!notlikemeowcry

hexed crown
#

Actually, I learn quite well by sent other people's code. Before college it was how I learned most of what I knew.
If I can see it in action, I can usually figure out what is doing.

crude vigil
#

The point is, you learn more by suffering

hexed crown
#

You're not entirely wrong.

winter rose
crude vigil
#

Success doesnt bring experience

little raptor
#

oh no

#

fixed 😛

winter rose
still forum
crude vigil
#

Honestly, my mistakes regarding modding has not only given me experience but new ideas as well but I doubt that applies to all :P

crude vigil
little raptor
crude vigil
#

then you learn that you are not the type to do these stuff and move on with your life blobcloseenjoy

little raptor
#

success and failure both bring experience

hexed crown
hexed crown
#

Welp, that's all for now.
Thanks for the assistance y'all.

cold cloak
#

Alright so, I got problems, again. I tried to look smth up but couldn't find anything but yeah.

Basically cancelAction didn't work for the Salute action for my AI officer and switchMove is janky looking.

#

People wiser than me here know smth that'd work for that?

hexed crown
#

Did you try playMoveNow?

hexed crown
cold cloak
#

Lemme try

cold cloak
#

the dude keeps saluting

hexed crown
#

Try playActionNow

#

I think I just gave you the wrong command is all.

cold cloak
#

so

officer playActionNow;
hexed crown
#

You need the ""

cold cloak
#

on the target?

hexed crown
#
officer playActionNow "";
cold cloak
#

Ooh

#

Lemme try

#

Nooope.

#

I think the problem is that the salute action is playing an animation

hexed crown
#

Well, from what I understand on a player, salute is an infinitely looped animation until the player moves.

cold cloak
#
officer1 action ["Salute", officer1];
hexed crown
#

If that doesn't work, I'd try using playAction instead of action.

cold cloak
#

Type array, expected string

#

didn't work on either

#

""

hexed crown
#
officer1 action ["", officer1];

This is what you used?

cold cloak
#

yes

hexed crown
#

Weird.

cold cloak
#

Yuh

#

My simple reporting to Cpt. Robinson got Arma'd

hexed crown
#

Old game in an old engine doing old game things.

#

¯_(ツ)_/¯

#

Oh, yeah that's what I meant by using playAction instead of action.

#

Using action might be causing unexpected issues with what you are trying to accomplish.

cold cloak
#

playAction still kidnaps my officer for an forever salute

hexed crown
#

After using playAction to start it, try using playActionNow to end it.

#
officer1 playAction ["Salute", officer1];
officer1 playActionNow ["", officer1];
#

Well, yeah. I inferred they knew that already.

#

Just showing what I meant.

cold cloak
#

That doesn't work

#

I just get an error message

#

Imma just go back on using the switchmove

hexed crown
#

@cold cloak Not mine. But it might help you figure your thing out. ```
Trigger 1:

Con: manm distance player < 10;

( If player is 10m or closer do: )

Act: manm playMove "AmovPercMstpSlowWrflDnon_SaluteIn"; manm disableAI "anim"; hint "Sir!"

( ..."Amove....." = do salute, disable animation in salut so that soldier holds the salute pose. Soldier says "Sir!" )

Trigger 2:

Radio Alpha (In the "Text" box write "At ease" (not the "" )

Act: manm enableAI "anim"; hintsilent "At ease soldier.)

( Re enable animation so solder goes back to default. Salute goes down. Say text "At ease soldier." )

cold cloak
#

Uuuh

#

UUUUUH

hexed crown
#

If you are having trouble understanding it, I am retyping it now.

#
/* Trigger to salute happens: */
officer1 playMove "AmovPercMstpSlowWrflDnon_SaluteIn";
officer1 disableAI "anim";
/* ..."Amove....." = do salute, disable animation in salute so that soldier holds the salute pose. */

/* Trigger to stap salute happens: */
officer1 enableAI "anim";
/* Reenable animation so solder goes back to default. Salute goes down. */
crude vigil
#

Execute "salute" action again , to turn it off

#

ie.

officer1 action ["salute", officer1];
#

both to salute and to stop salute

hexed crown
#

Ahh. a toggle style command.

cold cloak
#

My goodness, what an idea. Why didn't I think of that in the first place?

#

Anyways thanks man I'll switch the SwitchMove when I get on to edit the mission next time xd

brittle harness
#

basically i have a trigger attached to a unit, if any (not a specific) opfor unit passes him I want him to follow that opfor unit he initally saw

#
};``` so ive got this, but i need side _x defined, it wants a unit name, but i need to give it something that represents opfor or any enemy (being that any enemy will be opfor)
#

but obviously this isnt working because my variables are not defined

pure socket
#

Hello, may I ask where CAN I find information about using myself to create a new PBO to translate others' mods without changing others? What about the mod itself? Or who has an example of this kind of PBO?

#

Make English into Chinese

idle jungle
#

A pbo isn't what changes it's language and you can't repackage other mods unless they specify you can

wild prairie
#

What's the quickest way to check if a unit is freefalling?

copper raven
#

check velocity?

copper raven
wild prairie
little raptor
crude vigil
willow hound
# brittle harness basically i have a trigger attached to a unit, if any (not a specific) opfor uni...

Assuming your activation is OPFOR present, you can just use pc1 doFollow (thisList # 0); as On Activation expression (because of the activation setting (OPFOR present), the trigger's thisList will only contain units belonging to side east).
Unfortunately, while this approach is formally correct, it probably will not work. According to https://community.bistudio.com/wiki/doFollow, doFollow works only within the same group.

crude vigil
winter rose
#

because of you

willow hound
#

Does my message suggest otherwise? notlikemeow

winter rose
#

but why do you start your message with this?! 😅

you can just use pc1 doFollow (thisList # 0);

crude vigil
#

you can just use part confuses this message a lot :(

#

when he can clearly not use it

#

Blame engine, the easiest!

#

or blame whoever named that command, for misleading

#

doReturnFormation etc. would be more clear :P

winter rose
#

I blame everything 😄

#

and everyone, of course

crude vigil
winter rose
#

I, huh, wanted to fix that!

#

I will make you a wiki editor 👀

#

leaves on vacation

finite sail
#

I'm a wiki contributor too.. please can it be my fault as well?

winter rose
#

just so everyone is frustrated 😄

crude vigil
finite sail
#

*logs in

winter rose
#

I never touched that page.

winter rose
finite sail
#

hehe

crude vigil
winter rose
# finite sail hehe

I actually toyed with my cookies so I don't get delogged every 2 or 4h whatever it is 😄

winter rose
crude vigil
winter rose
#

👖
👌

hue hue

#

fixed anyway!

winter rose
#

no u

crude vigil
winter rose
#

:D

crude vigil
winter rose
#

and you didn't do a thing. how disgusting.

crude vigil
winter rose
#

stop finding excuses!

hexed crown
craggy temple
#

Im using the FiredMan event to log to the rpt. This works fine when testing on multiplayer in the editor, but on a dedicated server, the event fires 5 times for every time I pull the trigger, any way to fix this?

hexed crown
hexed crown
#

switchMove (what they were using): Use _unit switchMove ""; to reset animation. For a smooth transition use playMove.
playMove: The difference between playMove and playMoveNow is that playMove adds another move to the move queue, while playMoveNow replaces the whole move queue with new move

These taken together imply that it could be used to force a smooth transition back to idle.

winter rose
#

oh, implied.
I know switchMove does yes

hexed crown
#

Give me a second.
I miss hit enter.

winter rose
#

I am not pressing you, I am just stating "if you see mistakes" ^^ no issue here 🙂

hexed crown
#

msg fixed.

#

Also, tbf, I never said it does do that, just said I believe it did.
Which is what I understood it to do after reading the wiki. I now know that it does not do that, so issue resolved.

winter rose
#

I hope we are all up to date now 😉

hexed crown
#

lol
I don't really find issue with it, as I am new here and the people that have been around longer haven't gotten a good taste of the way I go about things yet.
So getting misunderstood/misinterpreted, is to be expected.

idle jungle
little raptor
hexed crown
#

That was specifically in response to their statement about saying their plan got ARMAd.

little raptor
undone flower
#

is there a built-in way to call/run code without the need of making a script or function from scratch? for example, I want to call bis_fnc_endmission after a task is complete and a certain time has elapsed

little raptor
undone flower
nocturne canopy
#

Anyone know the code in ACE3 Medical for forcing a character to have a broken limb?

little raptor
undone flower
hexed crown
little raptor
hexed crown
#

So @undone flower would just need to add a sleep with the amount of time they want to wait right before calling the end mission function. No actual script needed.

#

Just 2 lines.

undone flower
#

I'll add other lines just for the sake of it. a special effect or two

little raptor
willow hound
#

@hollow thistle Documented ACE Medical API when? 😦

hollow thistle
#

When someone will write the documentation 🙂

fair drum
hollow thistle
hollow thistle
fair drum
nocturne canopy
hollow thistle
little raptor
#

set it to 1 and it'll be broken

#

you might need to use the function Hypoxic linked

hollow thistle
#

I'm not sure if tinkering in the internal arrays is the best idea.

little raptor
#

because you need to update the state machine

nocturne canopy
#

Nice one, I'll run some testing and see if works, of not I'll go on hypoxics method

fair drum
# nocturne canopy Nice one, I'll run some testing and see if works, of not I'll go on hypoxics met...

my method is not "guarenteed" to cause a fracture but it is one of the only public functions for it. it applies the damage to the limb based on the damage or "projectile type". I'd make the damage something super severe but it still is going to be based on your "fracture chance" setting. But this is the function I used to cause say a scene of injured civilians that people had to triage and transport.

#

keep in mind, you have to disable AI auto healing or they will heal it all up (even without medical items)

nocturne canopy
#

Right, thanks Hyp

fair drum
#

let me find the specific variable. its a variable that makes it so the unit is always in medical danger and doesn't go into the healing state

little raptor
#

maybe this'll work

fair drum
#
_unit setVariable ["ace_medical_ai_lastFired", 9999999]; //Disable AI to self healing
#

this is how you disable the auto heal for AI

nocturne canopy
little raptor
#

I changed the function

undone flower
#

is there a way to preview sounds? like the music utils?

fair drum
nocturne canopy
undone flower
#
_playTrack = "Track_R_17"
while {alive player} do {
         playMusic _playtrack;
         waitUntil {isNull _playtrack};
};

Will this "waitUntil" work?

little raptor
#

no

winter rose
#

and no

undone flower
#

damn. why?

winter rose
#

because a string cannot be null

little raptor
#

_playTrack is a string

#

now look at BIKI

#

does isNull take strings?

#

no
so what you wrote is a generic error

fair drum
#

there is also a music event handler you can use

#

that will detect when music is done

undone flower
fair drum
undone flower
#

is there a way to get the length of a music/sound track? I guess the event handlers will conflict with some other scripts where the music is forced to stop, while the eh will keep the music playing

fair drum
#

and it only works if that value actually exists (depends on mod maker. base game has duration on all of them)

undone flower
#

I'm using the ost. that'll do. thanks

fair drum
#

you can also grab the class names of stuff that has a musicClass such as "stealth"

undone flower
undone flower
#

excellent

royal siren
#

Hey guys, i have a problem with my mission

#

I'm making a OPFOR camp
if i put everyone in the same group, if we kill 1 one them, even at 40000m from them, with a silencor, they will going to COMBAT mod
So i made different group

But if i fire the group 1

the group 2 doesnt fire, even at 20m from their OPFOR friends

how can i do ?

#

i tried
" if U1 is in combat mod, then U2 is going to combat mod"
it works but if i kill U1 by shooting the chest, U2 is in combat mod also

fair drum
#

by default, enemies are only reported within groups not between them.

royal siren
#

So what is your suggestion to make a good infiltration mission
OR
if i kill someone secretly, they notice
OR if an enemy is shooting at me, the others dont care

fair drum
#

i'm having some trouble understanding what you want though. you want it so that if you kill one guy, it doesn't alert the other guys?

royal siren
#

Yes, but if this guy is SHOOTING , then it altern the others

#

alert *

fair drum
#

I see. You can use knowsAbout to check to see if a group knows about a specific target and do a comparison there

#

if one guy just gets off'd silently, it probably won't raise it much

royal siren
#

what is that

fair drum
#

the best way, is to probably have each unit in their individual groups, then use LambsDanger.fsm mod to have them communicate between groups. this would have the least scripting

royal siren
#

So

Group1 knowsabout Group2

If i kill group2
then group1 doesnt know

but if group2 is fighting
then group1 know ?

fair drum
#

it would be more like... make all the enemies in individual groups, then you would do a constant check to see if the side itself knows about the player, and if it does, set all the units to combat mode and if you want reveal the player to the side

#

is this single player or MP

royal siren
#

MP

#

im not sure to understand the last thing yous aid

#

you said *

fair drum
#

so the steps:

1. Make all the enemy units in individual groups
2. Make a loop check that checks allPlayers vs the enemy side's knowsAbout value
3. If knowsAbout is larger than what you want, set all enemy units to combat mode
royal siren
#

Well i think it doesnt help for my problem, otherwise i dont understand the way it will

#

Is there not something like

" If U1 is shooting, then U2 join U1 " ?

fair drum
#

yes you can do that too

royal siren
#

i'm on the wiki but i dont know what i have to search

little raptor
royal siren
#

i tried " shooting " or " fire " but its not this

fair drum
#

behaviour

royal siren
#

the behavious is not perfect bc if i kill the enemy by shooting in the chest
the 1st second will turn him in combat mod and it will attract the others, even if the guy didnt shoot

royal siren
little raptor
royal siren
#

this addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
}];

fair drum
#

means the instant a unit fires that the handler is attached to, you can execute code, AKA make the other groups in combat mode

royal siren
#

SO i write this in the trigger
and i attached the unit

If one unit fires, it activate " set behaviour " ?

#

sorry i'm new to this

im confuse about the " params " part of this

fair drum
#

the params are variables that are sent from the engine when the event fires. its stuff to use

#

so _unit is the unit that fired

#

_weapon is his weapon

#

etc etc

royal siren
#

But i can leave it blank right ?

#

like the weapon

fair drum
#

its not blank, its what the engine is GIVING you to use, you can choose not to use it

silk ravine
#

Okay... so I am kinda clueless why this doesn't work.
This is supposed to go into the init field of a playable unit:

[this] spawn {
    if (local _this && not isServer && hasInterface) then { //!isHC, !isServer, !isDedicated
        waitUntil { player == player };
        [true] call ACE_spectator_fnc_setSpectator;
    };
};```

Would this work out locally to each client if copy pasted into various slots?
royal siren
#

in the trigger

this addEventHandler ["Fired", {
params ["THE UNIT I WANT", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
}];

When activation : set behavious things

right ?

fair drum
royal siren
#

Hypoxic can i dm you,

#

?

silk ravine
#

@fair drum Okay, is it true that player == player waits until the player is actually spawned?

fair drum
silk ravine
#

I saw some many examples with player == player what does that do then if alive does check player spawn.

fair drum
#

its just silly. alive will return false if the player isn't initialized or alive so its better to use that

silk ravine
little raptor
#

when player is not alive yet player is objNull and objNull == objNull

#

so it never works anyway

silk ravine
#

Yeah nice, thats written in one of the comments in the biki tho xD

little raptor
#

I'll delete it

silk ravine
#

@fair drum somehow this works in EditorMP but not on dedicated

#
this spawn {
    if (local _this && isPlayer _this && hasInterface) then {
        waitUntil { alive player };
        sleep 1;
        [true] call ACE_spectator_fnc_setSpectator;
    };
};```
fair drum
#

you did not mention that you wanted it for MP

silk ravine
#

Thats true. In that case it would be alive _this right?

fair drum
#

correct

little raptor
#

anyway, deleted that stupid comment

silk ravine
#

@little raptor Cool stuff, thanks 🙂

fair drum
silk ravine
#

wat

fair drum
#

yeah...

little raptor
#

still that's stupid. also objNull isEqualTo objNull

silk ravine
#

Still won't execute on the server

#
this spawn {
    if (local _this && isPlayer _this && hasInterface) then {
        waitUntil { alive _this };
        sleep 1;
        [true,true,true] call ACE_spectator_fnc_setSpectator;
    };
};```
#

What fucking heresy is going on right now

tidal ferry
#

Hey, how would I check to see if a player has access to Zeus interface?

little raptor
tidal ferry
#

Hmmm okay

#

What if I have a Zeus module whose owner is #adminLogged?

#

Basically I want to execute a local-to-remote script that will only fire if the player can access Zeus

silk ravine
#

@little raptor But isPlayer asks for a unit to read

little raptor
tidal ferry
#

Sweeeet, thanks

little raptor
#

also local will return false too

#

first you have to put the waitUntil

#

then the other conditions

silk ravine
#
this spawn {
    waitUntil { alive _this };
    if (local _this && isPlayer _this && hasInterface) then {
        sleep 1;
        [true,true,true] call ACE_spectator_fnc_setSpectator;
    };
};```
little raptor
#

maybe

#

¯_(ツ)_/¯

silk ravine
#

why will local return false if its within a units init field?

little raptor
#

it was just a guess

#

because it's not occupied by a player yet maybe (so locality is not changed yet)

#

¯_(ツ)_/¯

silk ravine
#

oh boi, okay, will test now

silk ravine
#

Can I even spawn code within a players init field?

undone flower
#

anyone knows a script that will bring me an array with all vehicles of a given side?

silk ravine
#

For some reason it still wont do anything. I am not sure why. Might be the if condition no idea

little raptor
tidal ferry
#

^

undone flower
tidal ferry
#

Ah okay gotcha