#arma3_scripting

1 messages · Page 521 of 1

nocturne forge
#
{
    if ( name _x == "DrunkDwarf" ) then {
        _x enableFatigue false;
    };
} forEach allPlayers;```

So something like that?
still forum
#

yes

tough abyss
#

Unless enableFatigue is local then you need to remoteExec

still forum
#

it is local

#

just checked. was too slow tho

tough abyss
#

Also I think it has been deprecated and stamina is what is left

still forum
#
{
    if ( name _x == "DrunkDwarf" ) then {
        [_x, false] remoteExec ["enableFatigue", _x];
    };
} forEach allPlayers;
nocturne forge
#

by "local" do you mean things that are on the client only?

#

so would getVariable/setVariable be an example of that too, if i'm looking for a variable set for that client?

#

for example:

player getVariable "score";

with score being a variable set on the client, the above command returning for my user if run with local exec.

tough abyss
#

Depends on how you set the variable

#

If it is local then you could only read it on client you set it on

nocturne forge
#

I think i understand, thanks

real moat
#

Okay so the 5 thing was just weird. I left the editor and went back in and suddenly itt was workiing right.

still forum
#

the wiki says whether arguments are local or not

tough abyss
#

often says

real moat
#

Is there something wrong with

params [
    "_placeboA",
    "_placeboB"
];
_styleOpen = "<t size='1' font='PuristaSemiBold' color='#58D3F7'>";
_styleClose = "</t>";
_target addAction [
    format ["%1Base%2", _styleOpen, _styleClose],
    {
        [
        _this select 0, _this select 1, _someArray
        ] call func;
    }
];
robust hollow
#

yes

#
addAction ["",{ /* stuff */ }]```
the addAction argument is an array, not code. the second element of the array needs to be code or string, not the code the action should execute. also _someArray isnt defined but i assume thats just for the example.
real moat
#

Hold on

#

II copiied that way wrong

#

There we go @robust hollow

robust hollow
#

it looks fine, aside from the already mentioned _someArray and func (hopefully) being an example varname too.

real moat
#

I get told that _someArray is undefiined iin the recieviing func

robust hollow
#

good. because it is.

#

where in here do you define _someArray?

    {
        [
        _this select 0, _this select 1, _someArray
        ] call func;
    }
real moat
#

Sorry, I leftt that detail out

#
// Establish Array
_someArray = [
    ["_tpNodeBase", "Base" ,2],
    ["_tpNodeRange", "Range",2],
    ["_tpNodeExplosives", "Explosives" ,2],
    ["_tpNodeIsland", "Island Runway" ,2],
    ["_tpNodeUSS", "USS Freedom" ,2],
    ["_tpNodeRGS", "RGS Posidon" ,2],
    ["_tpRandom", "Random" ,2]
    /* Value 2 = coordinates */
];
robust hollow
#

you should paste exactly what ur working with otherwise whoever is helping has to piece together.

real moat
#

Sorry, I try to simply it so sundry things are cut out

#

But ill stick to stiiickiiing all of it next time

tough abyss
#

Pastebin

real moat
#

Okay guys.

#

So since _someArray is defined

#

Where am I going wrong since im being told its undefined?

robust hollow
#

it isnt defined

#

not in the action

#

the action executes in its own script instance, it cant use local variables defined in the script that added the action. (assuming _someArray is defined outside the action)

real moat
#

I see

#

So then how would I pass on an array?
Perhaps:

_target addAction
[
    format ["%1Base%2", _styleOpen, _styleClose],
    {[_this select 1, _this select 2] call RGTA_fnc_teleportPlayer}, _someArray
];

?

robust hollow
#

you had it there before you deleted the message 😦 though you will need to use _this select 3 inside the action to use the array.

real moat
#

Oh my bad, didnt think II had done something right for a change

#

Okay cool, thanks a lot. Im sure this is all very menial.

#

Would select 3 be going after select 2?
I thought that would tthen select the 2nd param?

robust hollow
#

params ["_target", "_caller", "_actionId", "_arguments"];

real moat
#

Ahhh

#

Arguments

#

I see!

#

Thanks very much @robust hollow

fringe yoke
#

does SQF have something like continue for loops?

robust hollow
#

not to my knowledge. closest thing is to put your loop code in an if statement.

compact maple
#

@fringe yoke What do you want to do ?

fringe yoke
#

just something like ```sqf
{
if (something about _x) continue;
_x setDamage 1;
} forEach allUnits;

copper raven
#

Invert the condition (opposite to what you would need to call continue for) and put the code in the if, and there’s your continue.

radiant needle
#

Is it possible to remove the smoke particle effect from a campfire?

robust hollow
#

you might be able to remove the particle effect from the config file with a mod.

radiant needle
#

Is there an easy way just to recreate the fire particle effect, and the sound?

robust hollow
#

yea

#
createSoundSource ["Sound_Fire", getPos _fire, [], 0];
#

for the particle effect i'd take a look at the fire module function.

radiant needle
#

So effects is "SmallFireF"

thorn saffron
#

Why do I keep getting generic error in the expression error? Im trying to write a waitUntil loop that checks if the vehicle cargo (VIV stuff) is empty. (count (getVehicleCargo _craft)) == 0; does work on its own and returns true if the cargo hold is empty, but when I put it into the waitUntil it stops working.

 if (count (getVehicleCargo _craft) > 0) then {
     _craft setVehicleCargo objNull;
        waitUntil  
      { 
        sleep 1;
        (count (getVehicleCargo _craft)) == 0;
      };
 };  
robust hollow
#

are you running that script in unscheduled environment?

thorn saffron
#

you mean the console? Yeah

robust hollow
#

debug console is unscheduled. sleep & waituntil only works in scheduled (spawn/execvm) environments.

thorn saffron
#

btw is this correct?
if !(ALIVE(_craft)) exitWith {};

robust hollow
#

depends what the alive macro does.

thorn saffron
#

well it checks if unit is alive

fringe yoke
#

@copper raven that's what I'm doing now, just was hoping for something cleaner

broken forge
#

hey, silly question but. how do i set a task state to succeeded once a fuel truck has been destroyed?

fringe yoke
#

You can use a trigger that is activated when the truck is destroyed

broken forge
#

i'm seeing if i can go script-free in this mission

fringe yoke
#

I don't think you'll be able to go entirely script free, you can create a blank trigger and have it activated when the vehicle is destroyed

#

In the activation use something like

#
!alive myvehicle
broken forge
#

ahhhh, i was putting that in condition

#

ty

fringe yoke
#

in the condition yeah

#

My bad

broken forge
#

oh

#

xd

thin pond
#

Is there any way i can set vehicles as medical by classname ?

#

same with repair vehicles

#

talking about ace of corse

fringe yoke
#

myvehicle setVariable ["ACE_isRepairVehicle", true]

#

Pretty sure it's the same thing for medical

thin pond
#

were should i put that init ? first time working with ace after the modules are gone

fringe yoke
#

init will work yeah, change myvehicle to this

#

Should work for you

thin pond
#

I think i explained to stupid.... I have multiple vehicle spawners and only a few vehicles are meant to be medical..... i was wondering if i can configure all vehicles with a certain class to be medical like in the modules some months ago

restive leaf
#

Only option I think is to set the variable ace_medical_medicClass to 1 for the vehicles when they spawn: sqf (_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0

#

The code in fnc_isMedicalVehicle.sqf only checks that now

#

If you have your own mod, then you can mod the config for certain vehicle classes that you want to set attendant = 1;

next scaffold
spark turret
#

addaction to class is an amazing tool which gives players the possibility to rely that a certain object will always be a teleporter or shop or arsenal etc and you can customize said actions in a centralized script.

#

also its Zeus compatible if you want to spawn in more shops etc.

frigid raven
#

what again was needed to have scripts be recompiled and devleoped at runtime?
Description.ext allowFunctionsRecompile = 1 - was that all?

still forum
#

filepatching

grim coyote
#

allowedFilePatching

#

server.cfg

still forum
#

if you want to connect to a server ^

grim coyote
#

yeah

#

Is there anyway to check if objects variable is public to clients?

#

other than testing it on a client and sending the return value to back to server

tough abyss
#

That won’t tell you if it is public only that there is a variable with the same name and possibly the same value

still forum
#

A variable cannot be public

#

so no. You cannot check for that

frigid raven
#

So.. when my functions are actually changing in the Ingame-Functionviewer shouldn't they actually apply this "added" functionality when I press "recompile" ?

#

I really have a terrible time getting this to work

tough abyss
#

Yes

frigid raven
#

wtf

#

why does it work now

#

it like took 5min until the change really arrived??!

#

fucking hell - forget it. I am going crazy it seems

tough abyss
#

Get a faster pc

frigid raven
#

If I go faster I travel back in time

tough abyss
#

Maybe you already do, 5 min in the past that would explain it

frigid raven
#

God I hate you clever clogs

dark tulip
#

could I use a simple trigger to turn off setcaptive on a unit, so as the enemy will start shooting back once they escape a area?

winter rose
#

Yes.

dark tulip
#

would it just be unit name, setcaptive false

#

it is, stupid me, I wasn't syncing the unit to the trigger

#

Thank you for the Yes, Lou, I wasn't hunting all over why it wasn't working when it was just me not finishing my work

tough abyss
#

@still forum trigger statements are not cached any more, so your trigger condition is now recompiled every time, congratulations everyone!

still forum
#

Aren't they stored as code internally?

#

Guess you have to stop writing shit code now

#

and stop complaining about like 0.2 milliseconds compilation time every 0.5 seconds

tough abyss
#

Who knows instead of leaving an option, all improvements that some clever guy added, got hacked in their entirety. So yeah, it is not just trigger statements

still forum
#

Some "improvements" that some guy made that caused a terrible memory leak got reverted yes.

#

A bug was fixed. o no.

tough abyss
#

the cache could have been limited as well, so after it reached certain size it could have started overwriting it from the beginning

#

A bug was fixed you call it a fix?

still forum
#

Yes

#

the memory leak was fixed

tough abyss
#

reverting something is not fixing, it is just undoing it

still forum
#

reverting a bugged feature is fixing a bug yes

#

there are many different ways that could be fixed.
BI just doesn't have the programmers to do it differently. So if you wanna. Send them a application and move to czech

tough abyss
#

wow if only everything was "fixed" this way we would still live in caves

still forum
#

jup

#

Complain to BI management for not assigning more engine programmers to Arma 3. But don't complain to me for getting a terrible memory leak fixed

tough abyss
#

So if you wanna. Send them a application and move to czech please do not be this naive

frigid raven
#

I think I get something wrong with scopes somehow. I have the following function call:

[_reconDestination, _taskId, "RECON"] call coopr_fnc_createTaskMarker; // _reconDestination itself came from params

Then in my fn_createTaskMarker I have the following:

params [["_position", objNull],
        ["_taskId", ""],
        ["_taskMarkerType", []]];

if (_position isEqualTo objNull) exitWith { ERROR("_position was objNull") };
if (_taskId isEqualTo "") exitWith { ERROR("_taskId was empty string") };
if (_taskMarkerType isEqualTo "") exitWith { ERROR("_taskMarkerType was empty string") };

if (isServer) then {

    switch (_taskMarkerType) do {
        case "RECON": {
            DEBUG2("destination: %1", _reconDestination); // _reconDestination was never declared in this scope nor the params have a variable called that way
            _reconTaskMarker = createMarker [_taskId + "_marker" + "_area", _reconDestination];
            _reconTaskMarker setMarkerSize [300, 300];
            _reconTaskMarker setMarkerAlpha 0.5;
            _reconTaskMarker setMarkerColor "ColorRed";
            _reconTaskMarker setMarkerShape "ELLIPSE";
            DEBUG2("recon task marker created: %1", _reconTaskMarker);
        };
        default {
         // other stuff
        }
    };

} else {
    SERVER_ONLY_ERROR;
};

My log statement happily tells me

 [Server] COOPR.TASKS.debug - destination: [16589.5,11179.8,0]

Now what I don't get is how does _reconDestination received its value here? Is the scope where the function got called still valid for called functions? Since I asummed private variables are only available in their scope and are not delivered to the next nested function scope.

still forum
#

private variables don't overwrite parent scopes

#

still carry over to lower scopes though

frigid raven
#

Ok so then the value is doubled here as _position and _reconDestination

still forum
#

If you do _reconDestination = 5 inside createTaskMarker you will overwrite the one in your parent function

#

yes

frigid raven
#

Alright - thanks bud

#

happened so often I never realised it it seems

tough abyss
#

Why you default taskmarkertype to []?

sinful flame
#

Anyway to trigeer a sound every time a lighting strike plays? I want to add my own thunder claps

winter rose
#

@sinful flame not sure there is an event handler about thunder (maybe), but taking the problem from the other end you can create a Zeus lightning yourself and play sound whenever you create it

sinful flame
#

Ahh Good idea. Thanks What command do I use to do that?

winter rose
#

createVehicle with the lightning classname, that I don't remember of course

#

seems to be "Lightning_F"

#

Try Lightning1_F and Lightning2_F, should work

sinful flame
#

NP, Thanks I will check it out. I wish Arma could support ambisonic files.

radiant needle
#

So in editor I can toggle foliage. Can I do that in game via script

robust hollow
#

like grass? setTerrainGrid 50;

high marsh
#

hideObjectGlobal ?

#

Or setTerrainGrid

#

Needs to be executed for each player if you're going to want to use setTerrainGrid. Local effects

#

Or, if you want to consistantly apply this across missions. You can also set it on server and have it be applied to the player that way

radiant needle
#

If you hit control G in editor you'll see what I mean

#

like it even removes leaves off of trees, without getting rid of the trees themselves

robust hollow
#

G isnt doing anything 😟

radiant needle
#

Control+G

robust hollow
#

oh hey thats cool

#
‏ @KarelMoricky
13 Apr 2016

@DejanJankovic20 I'm afraid it's limited to the editor, there are technical reasons which prevents us from making it a full feature.
radiant needle
#

WOnder if it it's a rendering trick

#

with the foliage alpha

robust hollow
wary vine
#

anyone know of the top of their head what could be causing

 4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x356a4140],"Cock_random_F",[4793.96,552.461,0]]
 4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x7430c0c0],"Sheep_random_F",[4699.35,1094.74,0]]
 4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x12bf4100],"Hen_random_F",[4014.53,689.683,0]]
 4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x3cb20140],"Sheep_random_F",[3775.54,1367.08,0]]
 4:55:02 [88059,142.857,2292.06,60.426,[Agent 0x3137c180],"Goat_random_F",[4744.45,1074.46,0]]
``` but for all objects, it looks similar to cba's logs, so not sure if it could be something to do with that
tough abyss
#

looks like you're creating some animal objects

unborn ether
#

@still forum Sorry for personal mention, but that's pretty delicate question about engine. Is there any "normal" scripted way to detect client connectivity loss in <10s, without constant remoteExec ping-pong. Maybe some utility commands that shows that behavior to base off? Thanks.

queen cargo
#

uhm ... why would you want to do that @unborn ether ?

unborn ether
#

@queen cargo Disable keyboard inputs on some value threshold, until back to normal.

queen cargo
#

for what reason

tough abyss
#

You want to run check on client to see if it is lagging?

#

There has to be something you can set in server config to purge bad clients

regal ibex
#

Hi all ..is there a way to find all the mod used by a client ..via script ? thx for your replies..

copper raven
regal ibex
#

not this one..maybe like cba,ace, etc

copper raven
#

configFile>>"cfgpatches" and read stuff from there

regal ibex
#

thx dude..it's the way !

unborn ether
#

@tough abyss Yes there is kickClientsOnSlowNetwork[] but I don't need exactly to purge people and honestly it's not really reliable. Last time I've used that - they were reacting pretty incorrect with MaxPing and not really smart. I want people to be locked temporary not to throw them out for any single ping packet over that value.

quartz coyote
#

Yo boys !
Does doArtilleryFire execute locally or server side ?

unborn ether
#

@quartz coyote If there is no mention of argument or effect - usually that's AL EL

#

And not server-only too.

quartz coyote
#

Okay thanks

willow trail
#

Trying to work on a new script, My objective is to give everyone within a 20m radius a black screen for 2 seconds EXCEPT the person who ( For example ) Clicked the addaction. how would i go about executing this script onto people?

digital hollow
#

Which part of it are you having trouble with? The entire concept could look like addAction > blackout.sqf > check distance of allPlayers > use something like titleText for black screen

willow trail
#

i'm having trouble with the executing it to everyone within the radius except for the person executing it

#

like how do i make the "Executor" exempt from the script

digital hollow
#

_allplayersWithin20m - [player]

willow trail
#

Could you brief me on how to incorporate this within what i want?

digital hollow
#

use select alternate syntax 5 to get the players that are within 20 meters allPlayers select {_x distance _caller < 20}

willow trail
#

Thank you 😉

still forum
#

@unborn ether scripted way to detect client connectivity loss no

#

on serverside*

#

on clientside.. Maybe you can detect the text UI element that get's shown

unborn ether
#

Like, send serverTime to fill text control and then compare it on client with current serverTime?

still forum
#

don't know if current serverTime keeps updating when you get no messages

#

would ofc be awesome if it didn't

dim kernel
unborn ether
#

@still forum No, serverTime is not synced. Seems to be once client recieve it it goes on its own.

iron sand
#

Rip

#

Did any public Zeus servers go down lately because they were all locked for me

#

Fuck wrong channel

still forum
#

(delete your messages before you repost in the right channel)

dim kernel
#

any help?

queen rain
#

guys i did this a long time ago but i forgot
its about server and templates
how to make that when i enter to the server i need to choose template what i want ?

dense idol
#

Unlike CUP, it just changes the lighting color and not the darkness or anything else. Subtle effect, but makes a huge difference

tough abyss
#

how much?

unborn ether
vagrant urchin
#

Hello, how can I stop an AI unit firing after commanding it with commandFire

digital hollow
#

Try setCombatMode to hold fire

weary pivot
#

Is there a script I can use to have a heli start the rotators when I’m not in it? I’m trying to simulate where an emergency call has gone out and the heli is now just waiting for the passengers.

digital hollow
#

engineOn

weary pivot
#

Thanks
Also how would I go about having a unit have his pistol holstered until he is in contact.

#

I seem to remember a script for it I just can’t remember it.

weary pivot
#

I figured it out. But I am trying to change the waves of the ocean. I’m trying to make them bigger, is there a specific script I can use?

young current
#

you cant

#

the maximums are set in terrain config

#

more wind should make the waves as big as they get I think

weary pivot
#

Really? I read on a forum that this one guy did it, but he never used any code. I was hoping there are bigger waves because I got some warships and I’m trying to have them go through a storm. I found this, and I’m running it through the console it executes but nothing happens

#

WaterMapScale = 20;
WaterGrid = 50;
MaxTide = 0;
MaxWave = 0.25;
SeaWaveXScale = "0.1/50";
SeaWaveZScale = "0.1/50";
SeaWaveHScale = 100;
SeaWaveXDuration = 30000;
SeaWaveZDuration = 30000;

young current
#

yeah that wont do anything

#

if you have the link to that forum post paste it here pls

young current
#

yeah its a config patch addon that they make there

#

you cant do it on runtime

weary pivot
#

What do you mean by run time?

young current
#

live in game

#

what you want can not be done

weary pivot
#

Crap, ok well thanks.

calm bloom
#

hello, guys, do you know any way to get rifle reloading time instead of this?

getnumber (configfile >> "CfgGesturesMale" >> "States" >> (gettext (configfile >> "CfgWeapons" >> _cmuzzle >> "reloadAction")) >> "speed") * -1

this one works well on some weapons (like the most of rhs), but others return strange numbers like 0.37 (bis mx)

vapid crypt
#

The speed value there is the speed at which the animation plays rather than how long it will take to complete the animation

leaden venture
#

Anyone know if its possible to make the commander and gunner viewpoints viewable from the passenger seats of a vehicle?

vapid crypt
#

that... might be possible. Ideally a config approach would be best rather than a script approach for that, but I'm not sure if it will let you apply the same optic to the cargo spots.

wary vine
late silo
#

Is it possible to load a file into arma's config during a mission?

robust hollow
#

@wary vine display the image using a structured text control with align center attribute.

wary vine
#

its not centered vertically,

#

and valign='middle' doesn't seem to work

robust hollow
#

valign isnt a valid attribute

wary vine
#

check the wiki 😉

robust hollow
#

🤔

wary vine
#

it is on there in multiple places

robust hollow
#

not sure how ive never noticed that before

robust hollow
#

i must not have looked at this page since before KK rewrote it in january 🤷

#

anyway, is the image itself just not centered or is it how it shows on the control? may need to make it taller

wary vine
#

then the others wouldn't fit, from what i have seen most images are centered, just this one so far xD

calm bloom
#

@vapid crypt thanks for the hint, do you know how to find the time animation will take?

young current
#

@late silo if I understand what you ask right, then no. But if you explain what you are trying to do might find better answer.

#

@leaden venture you have to explain more what you mean by that.

leaden venture
#

@young current

You know how if you sit inside one of the Marshalls crew seats, you can push the MFD cycle mode keys and see the passenger count, then the Commander optic, then the gunner optic? I'd like to enable that for passengers

young current
#

So that passengers could see what the commander sees? Or use the optics independently?

lost copper
#

Hello everyone! I have some problem with understanding ACE3 scripts. I see this class in ace_mk6mortar addon, in CfgVehicles.hpp:

class GVAR(rangetable) {
                    displayName = CSTRING(rangetable);
                    condition = QUOTE([_this] call FUNC(rangeTableCanUse));
                    statement = QUOTE([_this] call FUNC(rangeTableOpen));
                    icon = QPATHTOF(UI\icon_rangeTable.paa);
                    exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"};
                };

How i can determine params in _this variable? Where i can find it?

still forum
#

on the ace wiki

#

I'm assuming you are talking about a ACE interaction. You didn't say that. but the code looks like it

lost copper
#

Yes, you are right. Sorry for my inaccuracy. Thanks! 🤗🤗🤗

thin pond
#

Is there a way to make a vehicle be controlable through the uav terminal ? like a blackbird ?

young current
#

you can use remoteControl script command for similar control, but I dont think you can use the default UAV terminal stuff on non UAV vehicles

#

do note that every UAV/UGV has invisible hidden AI units in them

#

that the terminal then controls

thin pond
#

already found out... only possible through config.... thanks anyways

short sleet
#

Hey guys, I'm having a little trouble. Forgive me if my scripting looks stupid, I'm a novice. :P

For context, I'm intending to make a script that has a laptop with several options on it. You scroll on the laptop, and it has several addActions on it. One of those addActions enables a lot more addActions, giving you options to harm and heal yourself. It's all part of medical training.

The problem is that the addActions aren't actually appearing. Through using hints, I have determined that the first script successfully passes True to the script below, so I don't believe that's the problem.

#

selfMedicalActions.sqf

/// Passing "True" from "Terminal.sqf" when "Self Medical" addAction is selected by the player.
_enableSelfMedical = _this select 0;

/// Variables
private ["_assignDamage"];

/// Determining if _enableSelfMedical is true when ran
{
if (_enableSelfMedical = True) then {
    player addAction ["Damage Head: Light", {_assignDamage = 0;}];
    player addAction ["Damage Head: Heavy", {_assignDamage = 1;}];
    player addAction ["Damage Torso: Light", {_assignDamage = 2;}];
    player addAction ["Damage Torso: Heavy", {_assignDamage = 3;}];
    player addAction ["Damage Left Arm: Light", {_assignDamage = 4;}];
    player addAction ["Damage Left Arm: Heavy", {_assignDamage = 5;}];
    player addAction ["Damage Right Arm: Light", {_assignDamage = 6;}];
    player addAction ["Damage Right Arm: Heavy", {_assignDamage = 7;}];
    player addAction ["Damage Left Leg: Light", {_assignDamage = 8;}];
    player addAction ["Damage Left Leg: Heavy", {_assignDamage = 9;}];
    player addAction ["Damage Right Leg: Light", {_assignDamage = 10;}];
    player addAction ["Damage Right Leg: Heavy", {_assignDamage = 11;}];
    player addAction ["Remove Self Medical Options", {["False"] execVM "Scripts\MedicalTraining\selfMedicalActions.sqf";}];
    }
    
    // Removing the actions when the "Remove Self Medical Options" addAction is selected by the player.
    else {
    player removeAction DamageHead:Light;
    player removeAction DamageHead:Heavy;
    player removeAction DamageTorso:Light;
    player removeAction DamageTorso:Heavy;
    player removeAction DamageLeftArm:Light;
    player removeAction DamageLeftArm:Heavy;
    player removeAction DamageRightArm:Light;
    player removeAction DamageRightArm:Heavy;
    player removeAction DamageLeftLeg:Light;
    player removeAction DamageLeftLeg:Heavy;
    player removeAction DamageRightLeg:Light;
    player removeAction DamageRightLeg:Heavy;
    player removeAction RemoveSelfMedicalOptions;
    };
still forum
#

your remove action stuff is clearly a syntax error

#

also you cannot access local variables from other script

#

you are setting _enableSelfMedical to true, not checking whether it's true

#

You can find out yourself that the local variables inside the addActions cannot possibly work by just thinking how that stuff is executed time wise.
You create the _assignDamage variable in your script. Then add the action. Then your script ends. _assignDamage goes out of scope and disappears

#

now half an hour later someone executes the action..
Cannot possibly set a variable that has been deleted half an hour ago

sonic slate
#

Hi people!

#

So, I'm working on a warlords mission, and I have tweaked the units on the map a bit in terms of gear. They initialize correctly on mission start, but after respawn the custom gear is replaced with the generic gear the unit has.

#

So, with some help I've worked out that I need to include a onPlayerRespawn.sqs in the missions folder

#

But I can't find any documentation on how to set that up.

Mission is pvp, with players on both opfor and blufor. How can I make that script so that on respawn a blufor player gets his gear, and an opfor player gets his gear?

verbal saddle
#

If you create a file called onPlayerRespawn.sqf in the root directory of your mission along side your mission.sqm That file will be run when a player respawns and it also has some parameters passed to it but I can't quite remember what they are exactly. @sonic slate

#

Its the same as a normal sqf file but is only called when a player respawns and only on their client.

sonic slate
#

How to differentiate sides then?

verbal saddle
#

PlayerSide will return either east or west and you can check against those

sonic slate
#

Thanks, I'm very new to scripting, so this helps a lot

verbal saddle
#
Switch(playerSide)do{
    Case west: { bluefor script };
    Case east: { opfor script };
}

Something simple like that will work for you.

#

And allows for you to easily add more sides if needed

sonic slate
#

Thanks a lot!

verbal saddle
#

👍

sonic slate
#

So there is no need to call the script from missions.sqf or description.ext?

round scroll
#

onPlayerRespawn.sqf is executed automatically on the client where the respawn happens, from what I know

verbal saddle
#

Yes as @round scroll said

sonic slate
#

Thanks a lot guys

#

hm, so it seems I can't use

removeGoggles this; etc

#

or can I?

high marsh
#
removeGoggles player;
#

player will be defined as the client local when executing onPlayerRespawn.sqf

sonic slate
#

Makes sense

high marsh
#

it is unsdefined as it should be on the server

sonic slate
#

How about AI players though?

high marsh
#

AI are created on the server

#

If you want to execute a script when creating AI, you'll need to do it when creating.

sonic slate
#

Well, player slots that can be AI controlled

#

As in, the slots at mission selection

high marsh
#

Their locality changes when the player controls them and when the player disconnects. When the player disconnects they're back on the server

#

There is a specific event handler that fires when this event occurs

sonic slate
#

I see

#

I'm going to play around with it some then, thanks for all your help

high marsh
#

:+1:

astral tendon
#

How to know if a vehicle was fliped over?

high marsh
#

No commands or functions, you're going to need to write your own solution

#

vector commands have some help with this

astral dawn
#

well it has some commented things inside it, don't remember what exactly I was doing :D
actually you need to check roll, isTouchingGround, and canMove

#

I think arma returns canMove = true for flipped tanks, don't recall it correctly, so I had to check roll manually

marble shell
#

Can anyone assist me with a script? Most of its written with help of another, he's not around atm, and I'm unsure how to continue testing what the issues is. I'd appreciate anyone if they'd offer their help. Just PM and I can paste it there. The script will addAction to laptop to cause damage to a helicopter, but there are 4 helicopters to choose from and 3 respective damages to pick from

quartz coyote
#

Hello all.
Can't figure out how to write this.
Can someone help me with the logics ?

        {
            _x setDamage 1.0;
            _idiotName = name _x;
            {
                private _size = 1 * (getResolution select 5);
                [format["<t size = '%2' shadow='1' align='center' font='PuristaBold'>%1 was killed in <t color='#004399'>BLUE</t> Respawn Zone</t>",_idiotName,_size],-1,0.885 * safezoneH + safezoneY,15,1,0,4001] spawn bis_fnc_dynamicText;
            } remoteExec ["bis_fnc_call"];
        } forEach ((list SpawnProtectW) select {side _x isEqualTo opfor});```
#

obviously my _idiotName var isn't getting the name of the player

still forum
#

does it disp.. AH I see

#

Pass it as arguments to the call

#

Local variables don't carry over to different scripts running on a different machine

#

and pass the name as argument

quartz coyote
#

okay thanks !

#

i'm guessing params = args ?

still forum
#

Yes

#

they will then be in _this inside the script

quartz coyote
#

ok so I got this far

#
        {
            _x setDamage 1.0;
            {
                private _size = 1 * (getResolution select 5);
                _this = name _x;
                [format["<t size = '%2' shadow='1' align='center' font='PuristaBold'>%1 was killed in <t color='#004399'>BLUE</t> Respawn Zone</t>",_idiotName,_size],-1,0.885 * safezoneH + safezoneY,15,1,0,4001] spawn bis_fnc_dynamicText;
            } remoteExec ["bis_fnc_call", _x];
        } forEach ((list SpawnProtectW) select {side _x isEqualTo opfor});```
But am sure i'm getting the position of my _x wrong. i'm getting mixed up about the fact that it's remote exec-ed
still forum
#

I don't really see the difference

#

_x is now undefined

#

and why are you setting _this

#

you set the target parameter of remoteExec to _x

#

But I told you to set the parameters of bis_fnc_call

quartz coyote
#

Ok i'll try again

#
        {
            _x setDamage 1.0;
            [_x, {
                private _size = 1 * (getResolution select 5);
                [format["<t size = '%2' shadow='1' align='center' font='PuristaBold'>%1 was killed in <t color='#004399'>BLUE</t> Respawn Zone</t>",name _this,_size],-1,0.885 * safezoneH + safezoneY,15,1,0,4001] spawn bis_fnc_dynamicText;
            }] remoteExec ["bis_fnc_call"];
        } forEach ((list SpawnProtectW) select {side _x isEqualTo opfor});```
#

did I do it write ?

still forum
#

yep

quartz coyote
#

cool ! Thanks

devout harness
#

Hey guys, I'm fairly new to scripting in Arma, and I'm trying to add intel to an object; I've got the intel part down, I'm placing it in theinit of a whiteboard, but I want the object to stay there. Any advice on how to do this?

quartz coyote
#

@devout harness what you want is a information pannel, that kind of thing ?

devout harness
#

I've got the popup now, like "Intel added: [intel name]", I would just want the object that 'contains' the intel to remain

quartz coyote
#

you will need to explain better, was is exactly you are trying to do ?
What do you mean by "remain"

devout harness
#

When you pick up intel, it gives you the popup, opens the map, and deletes the object that had the intel

#

But I want it to get the pop up, open the map, but keep the object that had the intel in the game

quartz coyote
#

well... delete the line of code that deletes the object ?

#

show us the script

devout harness
#
[ this ] call BIS_fnc_initIntelObject;

if (isServer) then {    
    [
        this,
        "RscAttributeDiaryRecord",
        ["UAV Instructions","These Docs outline the enemies defenses",""]
    ] call BIS_fnc_setServerVariable;
    
    this setVariable ["recipients", west, true];    
    this setVariable ["RscAttributeOwners", [west], true];
};
quartz coyote
#

Ahhhhh

devout harness
#

So it's in that BIS_fnc_initIntelObject that it probably tells it to be deleted when the intel is found

quartz coyote
#

indeed

split ice
#

Hey guys, I have been trying for about 5 hours yesterday night and today to get this script to work that probably should not be that hard, but I am greatly inexperienced when it comes to scripting. So I am trying to make a Unarmed Opfor AI surrender when a certain opfor AI gets killed. I have a trigger down that has the following condition: !alive Guard; This seems to work when I set the activation to end mission, but that is not my goal. I have tried using setCaptive and playAnimation

arctic quest
#

Vanilla or with Mods?

split ice
#

mods

arctic quest
#

With ace3 you can use ace_captives_setSurrendered

split ice
#

so like this?: man1 setCaptive true; ?

#

I have tried that and it does not work

#

in the "on activation tab

arctic quest
#

Using ace3 or not?

split ice
#

yeah

arctic quest
#

With ace3 you cant use setcaptive

#

You have to use ace_captives_setSurrendered

split ice
#

would that just be: man1 ace_captives_setSurrendered or would you have to add a something else?

arctic quest
#

It's all in the link i send you

split ice
#

I do not know some of the things there because like I said earlier, I am very new to this

astral tendon
#
    if (_pecentage) then {
    //stuff
    }

I need to do a random possibility with variable percentage, so the higher percentage the more it has a possibility to it be true, how I do that?

#

I already have my _pecentage setup.

split ice
#

[man1, ace_captives_setSurrendered, _reason? ("SetSurrendered")]

#

not sure what reason is

arctic quest
#

@split ice ["ACE_captives_setSurrendered", [_unit, true], _unit] call CBA_fnc_targetEvent

split ice
#

hmm, can't seem to get this to work

tough abyss
#

Try random 100 < _pecentage @astral tendon

arctic quest
#

@Slav ["ACE_captives_setSurrendered", [man1, true], man1] call CBA_fnc_targetEvent; doesnt work?

quartz coyote
#

Hi again,
I am having problems with the ppEffectCommit command. If I set the value to 0 or to 3 it doesn't change a thing. the effect will appear instantly... Can anyone help ?

private _hndl = ppEffectCreate ["WetDistortion", 400];
_hndl ppEffectEnable false;
_hndl ppEffectAdjust [1, 0, 1, 4.10, 3.70, 2.50, 1.85, 0.0054, 0.0041, 0.05, 0.0070, 1, 1, 1, 1];

private _hndlClrCorr = ppEffectCreate ["ColorCorrections", 1500];
_hndlClrCorr ppEffectEnable false;
_hndlClrCorr ppEffectAdjust [1,1,0,[0, 0, 0, 0],[1, 1, 1, 0],[0.299, 0.587, 0.114, 0],[-1, -1, 0, 0, 0, 0, 0]];


[...]


_hndl ppEffectEnable true;
_hndl ppEffectCommit 3;
_hndlClrCorr ppEffectEnable true;
_hndlClrCorr ppEffectCommit 3;```
astral dawn
#

Can I just give myself Zeus abilities by script or do I have to add a module to the map, etc?

tough abyss
#

@quartz coyote you are enabling effect that has some default values already applied when created this is why it is instant

#

you need to find default setting that doesn't look different from normal screen and set it with 0 delay then adjust it to the final values and then commit with time needed

quartz coyote
#

Okay thanks @tough abyss

tough abyss
#

@astral dawn you can

astral dawn
sturdy cape
#

i have something strange going on,i have an object that is created as a reference for effect sources and i want it to disappear on an event.everything works but it wont deletevehicle or hideobjectglobal it (server execution) any known problems deleting objects in MP or whats wrong theere?=

astral dawn
#

I haven't worked with effects, but deleteVehicle accepts non-local objects. Are you sure that you have a valid object handle and that it's not objNull?

sturdy cape
#

no its even been found by nearestobjects select 0

tough abyss
#

Is effect object createVehicleLocal?

sturdy cape
#

@tough abyss nope normal createvehicle

#

i create it with this here sqf _burp_sphere = createVehicle ["Sign_Sphere25cm_F", [getposATL _anomaly_object select 0,getposATL _anomaly_object select 1,1], [], 0, "CAN_COLLIDE"]; _burp_sphere setObjectMaterial [0,"A3\Structures_F\Data\Windows\window_set.rvmat"]; _burp_sphere setObjectTextureglobal [0, "tzr\tzr_images\01_burper.jpg"];and trying to delete it with sqf deleteVehicle _anomaly_object; [_burp_sphere, true] remoteExec ["hideObjectglobal", 0]; deletevehicle _burp_sphere;but no sucess

astral dawn
#

and if you create it and then instantly delete, does it still stay around @sturdy cape ?

tough abyss
#

You should not remote execute global command globally. What madness is this?

sturdy cape
#

it was just an experiment,doesnt work either with just hideobjectglobal nor with deletevehicle only

#

@astral dawn and no,its the same

#

its like theres some dark force acting^^

astral dawn
#

well, if you try to not set its material, or not set its texture?

wary vine
#

anyone know why, if i set a mouseExit eventHandler on a control that is the same width then the controlsGroup containing said control. If i enter, works fine from any direction, if i exit, works perfect in any direction but to the right. unless I make the controls group slightly bigger then the control

vapid crypt
#

I can only assume that its because the control group may be expected to be larger than the control itself. Having it the same size could be expected to produce unknown results. But, thats just a guess based off what you said as I don't remember where I saw that.

nimble raven
#

So im trying to create a script to send a message out to everyone on a server when someone loads a specific mod, Personal Arsenal in this case, we can get it so it end mission for said person but we are trying to convert it to say "this person is loading Personal Arsenal"
This is the script so far:

if( isClass(configFile>>"CFGPatches">>"PA_arsenal"))then{
    ["Dovev_SEH", "onPlayerConnected", {
        _notFound = true;
        _player = objNull;
        while {_notFound} do {
            {if (getPlayerUID _x isEqualTo _uid) exitWith {_player = _x; _notFound = false}} forEach playableUnits;
            sleep 0.2;
        };
        [_player, "Player " + _name + " Has Personal Arsenal Loaded","BIS_fnc_log"] call BIS_fnc_MP;
    }] call BIS_fnc_addStackedEventHandler;
};```
astral dawn
#

So... is this a question or a statement? Is there something which doesn't work or works not as you expected?

#

Also you should not sleep inside event handler, why do you absolutely need to sleep for 200 milliseconds there?

nimble raven
#

Well im not 100% great on scripts so i took a few that i knew about and put them together. the sleep part i forgot to remove but for some reason the

    }] call BIS_fnc_addStackedEventHandler;
};```
just doesnt want to work at all. 
the prior part works fine
#

We can it to find the mod and all but just cant get it to announce it server wide

astral dawn
#

It's also recommended to not use BIS_fnc_mp, use remoteExec / remoteExecCall instead

#

I've never used BIS_fnc_mp but it seems like your paramteres are wrong
[params, functionName, target, isPersistent, isCall] call BIS_fnc_MP;

nimble raven
#

So how would i go around doing it through the remoteexec? as i have barely any experience at all using that command

astral dawn
#

(format [" %1 is using the arsenal mod", _name]) remoteExec ["diag_log", 2]; something like that should make server write the string to diag_log

#

so it formats the string on client, and asks server to write the pre-formatted string to diag_log

#

never tried BIS_fnc_log 🤷 I guess you can adapt it to bis_fnc_log

nimble raven
#

so just to confirm

enableSaving[false,false];
if( isClass(configFile>>"CFGPatches">>"PA_arsenal"))then{
    ["Dovev_SEH", "onPlayerConnected", {
        _notFound = true;
        _player = objNull;
        while {_notFound} do {
            {if (getPlayerUID _x isEqualTo _uid) exitWith {_player = _x; _notFound = false}} forEach playableUnits;
        };
        (format [" %1 is using the arsenal mod", _name]) remoteExec ["diag_log", 2]};
};```
is that correct?
astral dawn
#

remoteExec part should work I guess, I am not sure about the rest
like, where is _uid coming from?

tough abyss
#

You remote exec from server to server, huh?

#

what _player is for? it is assigned but never used

#

actually what the while loop is for? has no purpose

#

Running it on the server makes no sense

#

running it on client won't work

#

is that correct? hell no

astral dawn
#

Oh yeah it looks like onPlayerConnected is run on server, I thought that it runs on players, lol

unborn ether
#

@nimble raven

params ["_id", "_uid", "_name", "_jip", "_owner"];

Comes with onPlayerConnected. Also if you are running this on server, you ask a server configFile not clients. If you run this on client, you ask your clients configFile but making diag_log to its RPT will give you zero informativity. You need to place EVH on client side, and then report that to server via remoteExec, but do not allow diag_log plain execution - that's an easiest way to let somebody kill your server with RPT spam, make some function to process data.

tough abyss
#

Not really, those params are part of mission EH PlayerConnected which is like onPlayerConnected is server only event so no idea how you think it will work on client

frigid raven
#

Can't I post screenshots in here?

robust hollow
#

nope. you're not special 😢

frigid raven
#

My mum said I am

astral tendon
#

Any tip to make the driver not hold the brakes? hes unit capture is going backwards

astral dawn
#

Can you explain?
You order the unit to move but he is still standing at one place?
The driver is setCaptive ?
😕

astral tendon
#

I use unit captrue and the vehicle hold the brakes and just keep sliding.

winter rose
#

@astral tendon unitCapture/unitPlay is recommended to use only with air vehicles

#

Try setDriveOnPath or other commands

nocturne basalt
#

Hi guys. Can I get both players and AI to stay inside a vehicle even when ejectDamageLimit is reached? I wanna prevent them from disembarking automatically

winter rose
#

wait, no

astral dawn
#

I think it's only meant for damaged tracks and wheels (can't move) but still worth trying?

nocturne basalt
#

yeah I tried that. they are still bailing once the damage value gets to 0.99

astral dawn
#

but then it's about to explode anyway, right? maybe you could hide them or delete them 🤔

#

oh wait, you need it for players too, sorry

nocturne basalt
#

yeah

#

I am planning on adding an eject feature though. could auto eject and move crew inside escape pod instead maybe

#

maybe that'll work

winter rose
#

lock ?

#

myTank lock 2 should lock for everyone, AI and players

frigid raven
#

I have a slighty complicated (for me) scriptlogic to get done.
Given:
An Array of 10 Markernames
Requirement:
Mentioned markers are all in a slightly narrow area - so they also overlap each other or in other words, the center of some markers is within the area of another one.
Those markers who overlap to others should be removed so in the end there only exist markers that cover an area on their own.
My Problem:
I was not able to find functions like nearMarker where I might could compare the markerPosition against since the functions do not exist. I found nearEntities or nearObjects but markers do not count to those types do they?

Any ideas how to get this logic done?

winter rose
#

if three markers overlap each others, which one do you want to keep?
my overall question is: why on Earth would you need that at first hand 😄

still forum
#

if three markers overlap each others, which one do you want to keep?
The newest one

#

allMarkers to get all markers.
then get their position and filter them to be in a certain area

#

then you do the rest

frigid raven
#

so...

getMarkerPos markerA isInArea getMarkerPos markerB
winter rose
#

nope

frigid raven
#

yea that doesnt make sense

winter rose
frigid raven
#

I like need the stuff markerName setMarkerSize [a-axis, b-axis] is setting

winter rose
#

IDK if you use only round circles or ovale ones, etc?

#

if circle, you can use distance

frigid raven
#

distance is for determining length between position and size?

#

ok I understand

winter rose
#

position and position, simply check if it is over the marker's radius yep

frigid raven
#

thx buds

winter rose
#

👍

nocturne basalt
#

@winter rose yeah but then I wont be able to get out manually before its destroyed. And the AI seems to disembark anyway

astral tendon
#

Does anyone knows a script to change the tanks ammo rack in game?

young current
#

ammo rack?

#

and which tank

astral tendon
#

all tanks

young current
#

by ammo rack do you mean the ammunition they use?

astral tendon
#

Yes?

young current
#

It was just odd way to say it. In any case yes, you can alter the ammo loadout with commands

#

but what ammo the tank can use depends on what weapon it has

astral tendon
#

Is there any script biuld to do that like ACE does with pylons?

young current
#

there might be but I dont know any.

shadow sapphire
#

Would anyone tell me how I could store everything in the foreach braces in this script in a smaller form and call for each group individually as they spawn, rather than all at once?

lusty canyon
#

how can i make it easier for ppl that join my server to get into my discord/ts/site?
i can add stuff to clients map:

    player createDiaryRecord 
    [
    "Diary", 
    ["Server Links", "url/here"]
    ];

they still have to manually type it tho so:

  1. copytoclipboard doesnt work, any CBA fnc, or other means?
  2. how can i make the above JIP?
queen cargo
#

you also can let the player copy stuff to clipboard via a textbox

#

though.... unless your url literally is some unicode garbage, all should be fine

astral tendon
#

How to lock the usage of the UAV terminal to the UAV operator only?

lusty canyon
#

@queen cargo textbox? how? (im no good at ui controls too much magic numbers)
@astral tendon there is this: https://community.bistudio.com/wiki/disableUAVConnectability
its close (u can foreach allplayers - uavoperator) but not what we really want which is making a uav object exclusive to a player regardless of terminal items

queen cargo
#

you already solved the riddle yourself, UI stuff

tough abyss
#

isInArea

astral tendon
#

Already tried that, it gets defeated if the player gets another terminal.

tough abyss
#

@shadow sapphire

_x addeventhandler ["Handledamage",{
            if (_this select 2 > 0.8) then {
                _unit = _this select 0;
                _unit setunconscious true;
                IndiCasualties pushbackunique _unit;
            };
        }];

pushbackunique returns index of inserted element, which will affect how much damage the unit _x will get. if IndiCasualties array has just one element, the index returned will be >=1 which means insta death for other units running this EH. On top this event handler fires for every selection, i.e. multiple times. No idea what you are trying to do, but this is a poor piece of code you have there

shadow sapphire
#

I'd like more information if you'd be willing to share it, but I've tested the code and what you're saying definitely does not happen.

What happens is that units that are critically wounded are placed in an incapacitated state and added to an index, then an AI medic rushes over to treat them in the order in which they were added to the index. In single player, it works flawlessly as of the last time I tested it.

Once again, I value your input regardless, @tough abyss.

tough abyss
#

I don't think I can help you to make it better than works flawlessly

shadow sapphire
#

Well, it doesn't seem to work in multiplayer, but also I didn't post the script for critique, I posted it because I'm wanting to know if it can be placed into a variable or some other way to shorten it and call it as groups are spawned.

vapid crypt
#

@shadow sapphire are you looking to have it work only when you spawn units in your script, or are you expecting Zeus to be able to place down any random unit?

If its just your script spawns, you can assign the code to a variable that can then be used like a function.

ie

{
        _gearhandle = _x execvm "Gear\AAF.sqf";
        waitUntil {scriptDone _gearhandle};
 
        if ((_x getunittrait "medic") && {"Medikit" in items _x}) then {
            [_x, IndiCasualties] execVM "Combat Medic.sqf";
        };
 
        _x addeventhandler ["Handledamage",{
            if (_this select 2 > 0.8) then {
                _unit = _this select 0;
                _unit setunconscious true;
                IndiCasualties pushbackunique _unit;
            };
        }];
    } foreach units (_this select 0);
    _x deletegroupwhenempty true;
};

_HQ = [_Base, INDEPENDENT, ["I_officer_F","I_medic_F","I_officer_F","I_soldier_UAV_F"],[],["LIEUTENANT","PRIVATE","SERGEANT","PRIVATE"],[],[],[],180] call BIS_fnc_spawnGroup;
[_HQ] call _applyMedicalScript;```
shadow sapphire
#

@vapid crypt, awesome! Perfect! I'd love it if it would happen when Zeus plopped down his stuff, but it's ultimately not necessary.

vapid crypt
#

or alternatively, you can also shorten your spawn calls as well, but applying different variables becomes a bit harder.

{
        _gearhandle = _x execvm "Gear\AAF.sqf";
        waitUntil {scriptDone _gearhandle};
 
        if ((_x getunittrait "medic") && {"Medikit" in items _x}) then {
            [_x, IndiCasualties] execVM "Combat Medic.sqf";
        };
 
        _x addeventhandler ["Handledamage",{
            if (_this select 2 > 0.8) then {
                _unit = _this select 0;
                _unit setunconscious true;
                IndiCasualties pushbackunique _unit;
            };
        }];
    } foreach units (_this select 0);
    _x deletegroupwhenempty true;
};

for "_i" from 1 to 6 do {
    _units = [_Base, INDEPENDENT, ["I_officer_F","I_medic_F","I_officer_F","I_soldier_UAV_F"],[],["LIEUTENANT","PRIVATE","SERGEANT","PRIVATE"],[],[],[],180] call BIS_fnc_spawnGroup;
    [_units] call _applyMedicalScript;
};```
shadow sapphire
#

Interesting stuff!

#

Thanks a ton!

vapid crypt
shadow sapphire
#

Thanks for the link!

astral tendon
#

The coment of Ffur2007slx2_5 has a wrong exemple because of hes “quotes” are givin erros, can some one edit it?

vapid crypt
#

is it C_man_p_begger_F specifically? Use a different classname is all you need to do. Its perfectly valid if you have a unit with that classname.

#

See the example section for a different classname that will work.

astral tendon
#

the problem are the quotes, and as it was happening to me I was running is circles trying to figure what was wrong in my script and I was victim of bad exemple and other missions makers may give up on the command and not use it.

vapid crypt
#

ah, you mean the specific ASCII character used in it. Yep, I see the problem now. That is rather unfortunate its in there like that.

robust hollow
#

ayee, skid menu david 👋

radiant egret
#

Déjà-vu😂

nimble echo
#

hello can someone tell me how do i get AI to GetIn player vehicle ? i am creating a scenario where i have to pick up some AI and drop off to another location in a plane

#

created task for player to go pick up AI but the AI just stands close to the plane and wont get in

west venture
#

Are you using Waypoints @nimble echo?
You can use a Hold Waypoint - make it Waypoint Activation synced to a Skip Waypoint Trigger (that activates when Player is Present), and then tag the player vehicle with a Get In waypoint.

#

@runic sandal, rude.
@nimble echo Some experimentation may be required with the getting out part though.

forest ore
#

Would need to get this to work somehow: when there are more than 0 on the side west AND zero on the side east OR zero on the side resistance the do magic but what I have now is failing:
({side _x==west} count thislist > 0) && ({side _x==east} count thislist == 0) || ({side _x==resistance} count thislist == 0)
What to do differently?

still forum
#

!purgeban @runic sandal 0 Ban evasion ref D: 415967863409737731 B:1158994

lyric schoonerBOT
#

*fires them railguns at @runic sandal* Ò_Ó

robust hollow
#

@forest ore tried wrapping the first two conditions together?

(({side _x==west} count thislist > 0) && ({side _x==east} count thislist == 0)) || ({side _x==resistance} count thislist == 0)

also though it wont fix your issue you could look at using countSide instead of count with condition.

still forum
#

Wow that guy is pathetic. He got a warning on BIF yesterday and was told to not attempt that stuff again.
His answer to that is that he posts on BIF again even though he was told not to. And ban-evades in discord to ask the same question again.

robust hollow
#

he used that discord account a couple of days after his first acc got banned here 😦

#

guess he gave up for a few weeks

forest ore
#

So does the stuff after || substitute everything what is before it or just the side _x==east part?

still forum
#

x or y
x || y

If not x. Then maybe y. If not y either then false

#

If you see him again. Please ping me @robust hollow
He got banned on BIF now too

forest ore
#

I'd need it to be x AND y OR z

#

(if that makes any sense)

still forum
#

Then do

#

(x && y) || z

robust hollow
#

is what i pasted above ^ 😦

still forum
#

Or
x && (y || z)
whatever you want

forest ore
#

imho I tried the x && (y || z) version but that did not work or then I just had it wrong to in the first place.
I had it like this
({side _x==west} count thislist > 0) && (({side _x==east} count thislist == 0) || ({side _x==resistance} count thislist == 0))

still forum
#

Btw.. findIf

#

You are always iteration through the whole list. Even if you have a match on first result already

#

Couldn't you also instead of the or at the second. Just do

({side _x==east || side _x==resistance} count thislist == 0)

?

forest ore
#

Will need to try that. I had something similar at one point but guess I had it typed up all wrong

still forum
#
(thislist findIf {side _x==west} != -1) && (thislist findIf {side _x==east || side _x == resistance} == -1)
forest ore
#

findIf could indeed be more efficient in my case. Will try that!
edit: and works very well. Thanks for the suggestions Dedmen and Connor as well!

tough abyss
#

Why not countSide?

forest ore
#

It would seem that the EntityKilled mission event handler does not concern players. Someone would have some idea why it is like that?
I mean if I as a player kill an AI this EH does what you script it to do but the same does not happen to me if an AI kills me

tough abyss
#

Stating something as a fact doesn’t make it so. I bet your code is bugged

forest ore
#

I bet you do

#

What is this script then missing or has bugged then that it removes weapons from killed AI but not from killed player

    private _soldier = _this select 0;

    if (_soldier isKindOf "Man") then {
        _soldier spawn {
            sleep 0.1;
            removeAllWeapons _this;
        };
    };
}];```
still forum
#

I assume that script runs on server? players are not local to server

forest ore
#

It is true that the script will eventually be run on dedi but currently I am testing it by creating a MP session through the in-game editor. Shouldn't the script work there since my local PC is the server and the player as well 🤔

still forum
#

probably

#

Just add some logging and see what actually happens

#

don't make up rumors and guess around. just check.

sinful flame
#

Any of you guys know of cell phone/telephone animations?

young current
#

there are none

#

there are very very very little new animations made

compact maple
#

Hello 😃

#

It is possible to do a forEach on a array like this ?

{

} foreach _myArray select 3 == true;
#

So basically do the statement if the current element select 3 is true

high marsh
#

Are you trying to modify the array?

compact maple
#

Nope, just want to execute the script if the third element is true

#

Oh maybe with a for instead ?

high marsh
#
if(_myArray # 3) then
{
    //execute script
};
compact maple
#

Lmao time to go to bed, thats so obvious, thanks

#

Sometimes it just so hard to think xD

high marsh
#

:+1:

frigid raven
#

Anybody knows adhoc the position 2D grid max values for Altis?

#

like 6000x6000 ?

shadow sapphire
#

Would someone tag @me if they know any easy way to transfer a group of AI to a specified headless client? Thank you.

astral dawn
shadow sapphire
#

@astral dawn, thanks! That should do it, but I have had a terrible time trying to learn how to reference the headless clients for this very command in the past.

quaint oracle
#

So, here's what I'm trying to do. I'm making a mission and want to fly the players into an area with extremely aggressive AA (They'll be with other AI planes that get shot down). I've reached the limits of what default Arma AI can do. I want these AA units shooting at them from max range continously, but setting them to red, datalinked with a radar, fire at will, etc, max skills, ain't doing it. Thoughts, suggestions?

winter rose
#

@frigid raven worldSize?

nocturne basalt
#

hi guys. Im trying to get animationSourcePhase from a UV animation, but it always returns 0 even though I know its animated. any ideas?

dawn kayak
#

@quaint oracle reveal, fireAtTarget?

#

Anyone knows how to update text/string for one specific row in custom GUI?
https://community.bistudio.com/wiki/lnbAddRow
I can add picture, set invisible text/data etc. but i can't find a way to update visible text to specific row.

EDIT: nevermind, it just worked now. I have no idea why and how, refresh all rows do the work.

frigid raven
#

@winter rose legend

winter rose
#

\o/

tough abyss
#

@nocturne basalt wrong animation name maybe?

nocturne basalt
#

hm no. but Im supposed to use the animatonSource name right? not the animation name?

lofty spear
#

hi. got some problem with EntityKilled event

addMissionEventHandler ["EntityKilled", 
{ 
params ["_killed", "_killer", "_instigator"];
systemChat format["%1 - %2", side _killer, side _killed];
}];

Got
WEST - CIV
but it should be
WEST - GUER

check before kill entity via "side cursorTarget" - its ok, GUER. but on handle its CIV
WTF? Any idea?

#

even WEST - sometimes shows as CIV

young current
#

@nocturne basalt yes animationSource

#

but you apparently need a fake model.cfg animation that uses the same source for it to work right

nocturne basalt
#

ahh

#

thanks

young current
#

or so I understood at elast xD

nocturne basalt
#

makes sense. when I needed to check a value of a vanilla animSrc before, I needed to make a dummy animation for that too where I just moved a single vertex around

astral dawn
#

@lofty spear as I know, when something is destroyed in arma, it switches side to civilian

#

maybe if you do side group _killed instead 🤔
As I know, killed soldiers are ungrouped not instantly, but after a bit of time 🤔

lofty spear
#

it sometime show wrong side even for me, not WEST - but CIV also

#

@astral dawn thx, i'll try this

astral dawn
#

if my suggestion doesn't work, you would have to write initial soldier's side somewhere, maybe in a variable assigned to him, like _soldier setVariable ["initialSide", side _soldier] or smth like that

lofty spear
#

@astral dawn looks like idea with group work

#

sometimes %)

#

i'll use variable instead

#

thank you

astral dawn
#

then make sure you write the variable and read it on the same machine, if you write it locally
or write it globally

lofty spear
#

if i write/read it on server - any problems?

#

use it for AI only

astral dawn
#

no problems, it's perfect then

#

i thought you might write it on client respawn and read it on server's event handler, then there might be problem if you do that incorrectly

astral tendon
#

is there a way to remove the cutText initial fading?

astral dawn
#

cutText [text, type, speed, showInMap, isStructuredText]
what speed value do you use?

#

At the bottom Krzmrzl sais this

The value for speed has to be greater 0. If 0 is used as speed the default value (1) will be used.
If you want to create an "instant" effect you can use a really small value (e.g. 0.001)
astral tendon
#

that is for the last fading when the text is fading out, not in.

astral dawn
#

well it says at wiki that speed is for fade in, so IDK, I actually never worked with cutText, so I thought you might have overlooked the wiki note 🤷

tough abyss
#

@astral tendon what effect are you using with cutText?

astral tendon
#

"PLAIN DOWN"

tough abyss
#

So how long the fade in takes if you set 0.01 speed

astral tendon
#

instant

#

I dont even see the text right.

tough abyss
#

So all good then, this is what you wanted?

astral tendon
#

No, I cant even see the text

astral dawn
#

@shadow sapphire how do you work with your HCs then? I think if you have placed some HC modules on the map and names them somehow, you should be able to do ownder HC_1 or something like that, no? Alternatively you can find out owner ID of headless clients when they connect and store them in some array at the server

shadow sapphire
#

So far for me, naming things headless clients in the editor does not allow me to leverage those names. There could be something else that I’m doing wrong, but so far that’s never worked.

Your idea about capturing their owner ID as they enter the server sounds like something that I wish had been suggested months ago. Ugh! That’s genius. Unfortunately, my scripting skills aren’t strong enough for that straight up, but I’m going to take a note and get back to you if I figure out how to do it, @astral dawn!

astral dawn
#

well that should be done through connection and disconnection event handlers

tough abyss
#

@astral tendon then the only option left is to make custom Rsc where you can set all speeds and use cutRsc

winter rose
#

@astral tendon "BLACK FADED"

astral tendon
#

It turns my screen black.

winter rose
#

…isn't that what you want ?
oh, wait. you want a "PLAIN" effect, indeed. my bad for misreading.

astral tendon
#

I just would like to display the text with out fading, im using the text every second to update the message, but its blinking

brave jungle
#

Yeah he just corrected himself - "PLAIN"

quaint ivy
#

How does a for loop work if one of the numbers isn't whole, like for example :

for "_i" from 0 to 2.41 do {};```
#

Would it only go up to 2 or go up to 3 or not work at all?

tough abyss
#

Put systemChat str _i in it and see for yourself

high marsh
#

I imagine it's whatever amount it takes from 0 to the first step.

tough abyss
#

Hey guys, quick question. What's the best way to spectate someone? I have a list of players online and I want to spectate the one that I chose? Ive been looking at BIS_fnc_EGSpectator but I don't think that is what I'm looking for

high marsh
#

That's what you're looking for, you can select from all units and players if you'd like

tough abyss
#

So instead of putting

["Initialize", [player]] call BIS_fnc_EGSpectator;

I put

["Initialize", [_playerChosen]] call BIS_fnc_EGSpectator;

will it work?

high marsh
#

Sure, not sure if the function takes global args though

tough abyss
#

the first command I put was the example on the wiki

#

second one my example and idk if it will work

tawdry harness
#

Hey, anyone know of an easy script that holsters a weapon by key press

#

couldnt seem to find one that worked

#

?

young current
#

holsters a weapon where?

#

isnt there just a keybind for that

#

lower weapon or something like that

high marsh
#

Lower weapon is double tapping left control by default, but I believe grim is talking about shouldering your weapon

halcyon crypt
#

soo, we've been having this issue for a while now

#

getting this error

Error reverse: Type Number,Not a Number, expected Array

on this code

            if !(_unitAssignments isEqualType []) then {
                _unitAssignments = [];
            };

            reverse _unitAssignments; // must remove in reverse order
#

how is that even possible 🤔

astral dawn
#

maybe it was nil somewhere in the path

halcyon crypt
#

I wish

#

reverse nil doesn't throw any error

tough abyss
#

The code is fine the error is elsewhere

halcyon crypt
#

it's saying specifically that reverse is expecting an array but it wasn't

astral dawn
#

I would suggest you to load Arma Debug Engine and see what's going on at this error, but unfortunately I can't 😄

tough abyss
#

Maybe it is NaN which happens elsewhere because there is nothing wrong with code you’ve shown

#

Have you tried to systemChat the value of _unitsAssignments just before reverse?

halcyon crypt
#

I've added some logging and playing the waiting game currently

halcyon crypt
#

@tough abyss you were right, is was trying to reverse a scalar NaN according the diag_log 😛

#

took ages for it to pop up :/

bronze swallow
#

Yo, I am working on an Airborne FTX where my guys get dropped using the RHS paradrop feature, I wanted to have an enemy APC (BRDM) in the mix but the pilot breaks course and flies low if there is an APC on the map.

Is there any script to make my pilot ignore enemies on the map by chance?

round scroll
bronze swallow
#

I've got FlyInHeight ASL on

#

Just need him to not break flight pattern because there is a BRDM 5km away

#

I will try this, thank you.

tough abyss
#

Hey. Could someone help me whats the best way to allow 3rd person view on a hardcore server?

#

It's an Exile server

#

Is it your server?

#

Yes of course.. I mean allow 3rd person in vehicles

#

whats the best script for that

#

You need to allow 3rd person in server settings and restrict it for persons on foot, you cannot allow it for vehicles only if it is restricted in server settings

#

what would be the best script for that then

#

There is no good script all scripts are hacks more or less successful. Google maybe

cedar heart
#

don't understand why

if (player distance pz_com < 30) then {...};```

the condition doesn't work. when, as 
```sqf 
waitUntil {player distance pz_com < 30}; ```
works
tough abyss
#

@cedar heart not the same innit? You check once in the 1st and check continuously in the 2nd

cedar heart
#

@tough abyss hmm ok. thank you for the explanation

calm bloom
#

Hey, guys, does anyone know if i can track player using a person turret in a vehicle?

tough abyss
#

What do you mean track?

calm bloom
#

i mean something like```sqf
if ((vehicle player != player) and !(currentmuzzle player in weapons vehicle player))

#

may be script method i dont know

tough abyss
#

You want to know if player is in ffv position in vehicle?

calm bloom
#

Yep

#

sorry, didnt remember that firefromvehicle term

tough abyss
still forum
#

see what's going on at this error, but unfortunately I can't Oh right.. I knew I forgot something.

tough abyss
#

Hey guys, I've been looking into it but no success so far. How can I rename or disable some of the options available when the Pause Menu is active (OnPauseScript bla bla bla)?

#

...and yada yada

#

Okay, does anyone know the idcs for the ctrl on Pause Menu options?

still forum
#

You need to find the display. Then find the control you want to disable.

#

No. You can grab a "AiO" config and look it up

#

manually

#

I don't know of any public list

tough abyss
#

What do you mean by AiO if I may ask?

still forum
#

"All in one"

#

But I wrote it in quotes up there

#

because I meant you to google it exactly like that

#

"Arma AiO config"

tough abyss
#

oh, ill look into it, thanks!

tame axle
#

Hi all,

still forum
#

👋

tame axle
#

i'm trying to find out if a particular building is destroyed, as its part of the mission. ive got as far as assigning the array of close buildings myBuilding = nearestterrainObjects[[[1907.03,5713.65,0]],[],5];

#

but when I try to find is it alive with
!Alive myBuilding Select 0
the building is the only one in 5 meters, so it should be the correct one. what does myBuilding Select 0 return?

calm bloom
#

you can alsp get the buildings ID with the old editor (press control+O on the island selection menu), there is show id button

#

id would be the variable name of the building

#

AFAIK

still forum
#

numbers cannot be variables

#

so that kinda doesn't make much sense

astral dawn
#

Not sure if alive works with buildings
In arma, when a building gets destroyed, the game moves the old building under the ground with an animation, and it has damage 1.0, and it stays there. Then it creates a new building with another model (model of a damaged building). It stays on the ground.

still forum
#

@tame axle you can use diag_log to print it to the RPT log, and see for yourself what it returns

calm bloom
#

ok sorry for the wrong info, here is the id usage:

(getpos _pos) nearestObject 190609;
tough abyss
#

Using object id is unsafe please do not suggest this

tame axle
#

Thanks partyzan, but several posts point to the 'nearestterrainObject' as being most reliable.

still forum
#

I think easiest method is checking
typeOf (myBuilding select 0)

#

I assume that changes to a damaged variant if it's damaged

tame axle
#

@Dedmen It is giving me an elements error, needs 3 got 1. So im guessing it its not gonna write to the hint window, its not going to the diag_log also.

still forum
#

uh

#

what are you actually executing?

#

the diag log is not what's failing there

#

it doesn't need 3 elements. That is probably some command that takes a position

tame axle
#
hint str(mybuilding select 0)```
still forum
#

🤔

calm bloom
#

guys, can you tell more about the unsafe id's?

tough abyss
#

not guaranteed to stay the same

#

in Arma 3 these ids changed gazzilion times

tame axle
#

Made some progress,
myBuilding = nearestterrainObjects[[1907.03,5713.65,0],[],5];hint str(mybuilding select 0)
Had too many braces....

tough abyss
#

but only returning [] your radius is 5 m

halcyon crypt
#

yep, we rely on building IDs for ALiVE terrain indexes and whenever these change (often when a terrain is updated) we have to re-index the terrain to fix the IDs

#

kinda annoying but it's fairly automated so not that big of a deal for us

tame axle
#

@tough abyss had ....select [0], changed to select 0. But not returning the building details. will try to make the radius bigger. Not giving error now.

tough abyss
#

you should check if returned array is not empty then select

tame axle
#

@tough abyss bigger radius now got a return

young current
#

the object ids are not realible if map is still in development

#

oh there was more text here

#

¯_(ツ)_/¯

#

carry on

tame axle
#

OK got this out
17:12:03 "66208: concrete_smallwall_4m_f.p3d"

#

this is an array so how can I check if its destroyed. ?

still forum
#

it's not an array

#

atleast that console output says it isn't

astral dawn
#

nearestTerrainObjects sorts by 3D distance, if you don't pass a special parameter to it to sort by 2D distance
and your blown up house can be 10 meters under the ground

tame axle
#

ok then its a string

still forum
#

because you did str

tame axle
#

ah indeed.

still forum
#

you can just try alive <your object here>

#

and see if that works. I assume not though.
Is "smallwall" really the building you wanted tho?

tame axle
#

@still forum yeah, I haven't focused on the actual object yet, but your suggestion sounds good,

winter rose
#

also, why not nearestBuilding(s?) ?

tame axle
#

@astral dawn Yes I can see finding this particular building will be a challenge...

astral dawn
#

just make the function sort by 2D mode
nearestTerrainObjects [position, types, radius, sort, 2Dmode] you see the 2DMode parameter?
you will easily see then WTF is going on with arma handling of destroyed buildings

#

as I remember arma creates a new building object even when, like, a wall of house breaks, but I am not sure

digital hollow
#

Doesn't it just move it below the map and spawn the ruin?

astral dawn
#

AFAIK yes

tame axle
#

Cracked it.
This in the mission init. Allowed me to narrow in on the building, and know which place in the array list. (In my case it was 0)

myBuilding = nearestterrainObjects[[1910.5,5713.64,0],[],5,true,true]; 
{diag_log str(myBuilding Select _forEachIndex);} foreach mybuilding

Now in the trigger condition...
damage (myBuilding Select 0)==1

Thanks for the input @astral dawn @still forum @tough abyss

digital hollow
#

fyi you can just use _x instead of myBuilding Select _forEachIndex

tame axle
#

@digital hollow nice👌

tough abyss
#

damage (myBuilding Select 0)==1 could just !alive (myBuilding Select 0)

tame axle
#

@tough abyss Cool. Think damage might give more flexibility , but I guess Boolean is quicker to process.

thin pond
#

if (primaryWeapon player isequalto "XXXXXXXXXX") any chance i cant add 2-3 items with classname to this our would i need to make a seperate one for each weapon ?

lean estuary
#

if (primaryWeapon player in _weapons) then {doSomething};```
thin pond
#

ah nice thankyou

#

also is there a way to define "no weapon equiped" within the "_weapons "?

ruby breach
#

""

#

Just to be on the safe side, you likely want to use toLower or toUpper as in is case sensitive. e.g. toLower(primaryWeapon player) in ["arifle_mx_f",""]

thin pond
#

works perfectly in SP not tested on dedicated tho

#

its excecuted through addAction

leaden summit
#

What's the best way to narrow down sqf _closeGuys = nearestObjects [player, ["Man"], 1500]; to only OPFOR units?

high marsh
#

use nearEntities first

#

then use SoldierEB instead of Man

#

as your type filter

#

Ex:

_blufor = player nearEntities["SoldierWB",1500];
_opfor = player nearEntities["SoldierEB",1500];
leaden summit
#

Ok cool SoldierWB is part of the class right? So that'll work for modded units as well

high marsh
#

In most cases I believe so, if not then you may have to patch it if you are making a mod. Else, get the mod maker to fix it.

leaden summit
#

Awesome thank you that's exactly what I needed

high marsh
#

:+1:

#

nearEntities is ALOT faster than nearObjects when testing with supported nearEntities types like units.

tough abyss
#

How often do you execute it @leaden summit ?

leaden summit
#

At the moment every 10 seconds

tough abyss
#

NearEntities might be ok but if you find it struggling with big radius you might want to just loop via interested players and check the distance

leaden summit
#

Ok I might drop the radius anyway it's really just a horrible hacky way to fix something I don't like about ALiVE garrisoning

tough abyss
#

Trigger is another way of checking presence of units of particular side

leaden summit
#

Hey just saw this in the wiki sqf while {_a =_a + 1; _a < 10} do {...}
Is that essentially a counted loop? ie it'll just run 9 times

still forum
#

looks to be, yeah

leaden summit
#

cool thanks

mellow obsidian
#

Anyone know if there is a command like addmagazinecargoglobal but also takes ammoCount like addMagazine does it?

still forum
#

It's linked in the "See also" on addMagazineCargoGlobal wiki page

mellow obsidian
#

Holy shit im blind, as always im thankfull for the help dedmen

halcyon crypt
#

does anyone know if you can get the status of all the AI behaviours?

#

like the ones you can disable/enable with disableAI and enableAI

tough abyss
#

Does anyone know a workaround on setObjectTextureGlobal not working properly on dedi servers?

#

I've added a skin to an outfit yet it only displays for me

still forum
#

What path do you use for the texture?

tough abyss
#

"images\skin.paa"

#

It displays just fine for me but not others. If others use the outfit tho, it works

#

for them only as well though

lost copper
#

Hi everyone! How i can cancel "unconscious" animation?

still forum
#

Do you mean the falling over of units when they get shot?

#

That might be ragdoll. Don't know if you can cancel that

#

Probably can try forcing the unit into a different animation

lost copper
#

So i can't escape from ragdoll?

still forum
#

There is no command to stop a ragdoll. There is a hardcoded time delay until it stops

#

But maybe you can just playMoveNow the player into a standing animation

#

not sure if he'll be able to control his body then though

lost copper
#

Cause i try to experiment with can with 10^6 kg mass and attaching them to unit for force ragdoll 😁

#

But the problem is that i can't set timer for this process

still forum
#

But yeah. Can't set timer. It's hardcoded. I looked into that too.

lost copper
#

And than i try to get the unit to ragdoll after current ragdoll ends

#

But after 2 or 3 ragdolls my player get into "unconscious" animation (checked by animationState player). And he didn't want to wake up 🙃

still forum
lost copper
#

if works for a very small time, i want try to make it for custom timer

digital jacinth
#

there is a really buggy way to perma ragdoll, I am usingit in a private mod of mien to just fling myself across the floor. You basically apply setUnconscious over and over again.

#

the result is you wobble around the floor, kill all kinds of walls and small objects and then are a vibrating mess in the end

lost copper
#

So using forced ragdoll with object of using "setUnconscious" can't make forced ragdoll correctly?

digital jacinth
#

well you just reapply it over and over. it may look like a ragdoll on others players end if they are 50 meters away.

#

any closer and they see the vibrating of the ragdoll and can tell that person is still alive.

#

for example how koth and some life mods do it, you actually die, but people can revive your corpse

#

that is the most reliable way in making a "perma ragdoll"

lost copper
#

@digital jacinth but this dead people are in animation, not in ragdoll, is it?

digital jacinth
#

no they are dead, as dead as a unit can be in arma

#

so they are ragdolled and in no animation

#

i made a mod which makes units go into custom animations after ragdolling. that is also "as good as it gets" right now

lost copper
#

I see them, if works like Russian AK rifle - reliably and efficiently

#

But if you come closer to this unit - you can understand, that he alive, not dead

digital jacinth
#

yup

lost copper
#

And its a little cheat for detection unconscious players

digital jacinth
#

i tied to mitigate in pestering Kola in making more animations, so therea re around 20 now in total.

#

so it gets a bit harder to spot

lost copper
#

Ok, i understand

#

And last question for this topic - is any way to detection start and end of ragdoll process?

digital jacinth
#

start is always when you setUnconscious to true, end can be detected with animationstate change EH

tough abyss
#

@tough abyss how do you set the texture?

#

It's in "uniformskin.sqf and i execVM the sqf

#

Execvm from where

lost copper
#

@digital jacinth thx for discussion and also for your work🤗

tough abyss
#

assigngear.sqf

#

And assigngear.sqf you execute from?

#

can i come back to you once im home? sorry for the inconvenience

#

No problem

#

I googled setObjectTextureGlobal issue and some people had it in the past but solution seems weird

tough abyss
#

@tough abyss So this is how it goes: uniformskin.sqf > assigngear.sqf > init.sqf where its executed this way:

if (!isDedicated) then
{
    waitUntil {!isNull player};
    
    ["InitializePlayer", [player]] call BIS_fnc_dynamicGroups;
    
    sidePlayer = side player;

    fnc_addRadio = compile preprocessFileLineNumbers "addradio.sqf";
    fnc_assigngear = compile preprocessFileLineNumbers "assigngear.sqf";

After that, another sqf file is executed

#

wait maybe the !isDedicated is fucking it all up 🤔

#

but according to wiki it shouldnt

astral tendon
#

Is there a way to know what box can be sling loaded?

radiant egret
#

question, is it possible to detect a reload of a gun(primary / secondary) on start of the reload since the eventhandler reloaded triggers only when its done ?
Problem is the Take eventhandler fires when you drag and drop a magazine in the player inventory on the weapon mag slot and i need to setvar to disable another function in that time.

tough abyss
#

You still did not show where the functions are executed from, all it shows where they are defined which is horribly insecure and error prone @tough abyss

tough abyss
#

im confused myself, so dont worry about it

nocturne forge
#

Okay, when using forEach allPlayers; how do I get the ClientID? is that _x? or what syntax would I use to get the ClientID of _x?

tough abyss
#

owner _x?

nocturne forge
#

cheers, i'll try that

tough abyss
#

Server only

nocturne forge
#

Understood, yeah

#

I've another related query, say I want to set up a onPlayerDisconnected {} event for my dedicated server, I assume I just execute that as "server exec" from my debug console as an admin, and it'll set up the event? I assume the event stays after I disconnect? is there somewhere else I need to put this script?

tough abyss
#

You might want to use mission event handler PlayerDisconnected instead as it is stackable. And yes setting it on the server will make it stay if server is dedicated

nocturne forge
#

Excellent, thank you

late gull
#

🤔

shadow sapphire
#

Does anyone know of a script that respawns Huron and Taru pods in a similar way to how vanilla vehicle respawn works?

quartz coyote
#

Help I need a second pair of eyes on my code to check if i'm not missing something :

if (_unitsDone isEqualTo (count _allESMUnits) && count _allESMUnits > 0) exitWith {};```
So if _allESMUnits returns 0 then my output is "false" correct ?
still forum
#

correct

#

0 is not > 0

quartz coyote
#

ouf perfect

#

thx

#

Okay so I've got this piece of code here that checks twice (at two different stages) if all players are ready.
But I also want it to take into account the fact that if no one is on the server, then it carries on.

while {true} do {
    private _allESMUnits = playableUnits;
    private _unitsDone = {_x getVariable ["loaded", false]} count _allESMUnits;
    if (_unitsDone isEqualTo (count _allESMUnits) && count _allESMUnits > 0) exitWith {};
    sleep 0.25;
};

Intro_Start = true;
publicVariable "Intro_Start";

while {true} do {
    private _allESMUnits = playableUnits;
    private _unitsDone = {_x getVariable ["introDone", false]} count _allESMUnits;
    if (_unitsDone isEqualTo (count _allESMUnits) && count _allESMUnits > 0) exitWith {};
    sleep 0.25;
};

Intro_Passed = true;
publicVariable "Intro_Passed";```
#

how would I change my code

robust hollow
#

it would do that without the && count _allESMUnits > 0 wouldnt it?

quartz coyote
#

mmmh that's also what I thought but since it isn't something I can actually see because i'm not myself on the server I dunno how to test it

robust hollow
#

shouldnt need to test it. if no one is connected, playableUnits will be [] and so the empty array count is 0. _unitsDone will be 0 because its also counting the empty array.

quartz coyote
#

ah you're right

#

thanks

#

hadn't thought about that

#

Working as intended ! Thanks Connor

#

Ah found a weird thing

#

looks like Intro_Passed never get's to "True"

#

why would that be ?

#

error in my code crashing the script instead of continuing ?

winter rose
#

do you have -showScriptErrors flag enabled?

quartz coyote
#

should yes

#

why ?

winter rose
#

to see if your errors show up top left of the screen (white on black)

quartz coyote
#

so when i'm on the server ?

#

is that it ?

robust hollow
#

did you make the same change to that condition to allow 0 units?

quartz coyote
#
while {true} do {
    private _allESMUnits = playableUnits;
    private _unitsDone = {_x getVariable ["loaded", false]} count _allESMUnits;
    if (_unitsDone isEqualTo (count _allESMUnits)) exitWith {};
    sleep 0.25;
};

Intro_Start = true;
publicVariable "Intro_Start";

while {true} do {
    private _allESMUnits = playableUnits;
    private _unitsDone = {_x getVariable ["introDone", false]} count _allESMUnits;
    if (_unitsDone isEqualTo (count _allESMUnits)) exitWith {};
    sleep 0.25;
};

Intro_Passed = true;
publicVariable "Intro_Passed";```
robust hollow
#

is Intro_Passed set false anywhere in a loop or something? perhaps try adding logs through that script to see how far it gets before stopping

quartz coyote
#

Huuuuuuuuuuuuu hold on

#

rebooted my server and now it looks like it's working

#

wtf

#

i'll do more tests

#

nope rebooted again and not working anymore

#

both vars are initialized in initServer.sqf

missionNamespace setVariable ["Intro_Passed", false, true];
missionNamespace setVariable ["Intro_Start", false, true];

#

omg found my mistake

#

ok i'm my own idiot

#

sorry

winter rose
#

what was it?

quartz coyote
#

hum ... actually I have no clue

#

thought i'd found what was the problem but ends out not

#

i'm lost

#

still looking

#

would there be another way to check if a server is empty ?

robust hollow
#

the way ur checking shouldnt be the problem

quartz coyote
#

I remember now why we'd put && count _allESMUnits > 0
It's because without, the check would end before players had finished loading the map. It would act like no player was in the slots before we'd even launch the game

robust hollow
#

so you dont want it to continue when there are no players connected?

quartz coyote
#

Well... I'd like it to halt and check if payers are connected and have intentionally started the mission, but also want it to bypass the check if no players are connected and that server is set to autoinit/persistent

#

That's what making it so dumb

robust hollow
#

i dont think you're going to get it both ways.

next scaffold
#

Maybe delaying the execution until the mission actually starts?

#

maybe I misunderstood the problem but if the mission started and there are 0 players is because the server launched with auto init and thus you can bypass the check

thin pond
#

Any chance i can add multiple conditions to ´´´IF´´´ ?

thin pond
#

ah okay was unable to find it.... can i extend it to more than A and B ?

robust hollow
#

you can do it as many times as you need

#

a && b || c
(a || b) && (c && d)
mix and match however you need. just gets harder to read the more you add.

thin pond
#

i only need 3 at max so thats enough thanks

#

also ist there any chance i can excecute commands like player addBackpack and player linkItem within then i know i can put it between the
bracket but i want it to look a bit cleaner... if possible

robust hollow
#

not sure what you mean exactly

thin pond
#

if (but condition here) then {player addBackpack "Backpack"; and player linkItem "Item";}; thats how i do it now but i wonder if can do it looking something like this if (but condition here) then {_items}; item = [player addBackpack "Backpack"; and player linkItem "Item";];

#

item = should be _items sorry

robust hollow
#

you're wanting to call another function from the if statement?

thin pond
#

when if is present then excute functions definded in _items

robust hollow
#
private _addItems = {
    // addBackpack
    // linkItem
};

if (condition) then _addItems;```
thin pond
#

nice thats what im looking for..... testing it no

sick drum
#

Hey guys i need help. What do I need to do to make an objective complete after doing a certain action like killing something

tough abyss
#
_unit = param[0];
//_unit = _this select 0;

if ((uniform _unit) isEqualTo "U_B_CTRG_Soldier_F") then 
{
   _unit setObjectTexture[0, "images\ctsfo_co.paa"];
};

hey ive been told I should try to do this and remoteExec it to all clients for the skin to apply but I get _unit undefined issue

#

Anyone know whats wrong?

robust hollow
#

why not use setObjectTextureGlobal?

tough abyss
#

because its fucked and only shows it locally when hosted on dedi server

robust hollow
#

the whole point of the global command is for it to work globally.............. but ok.
_unit undefined suggests you havent defined _unit, sooooo, have you defined _unit?

tough abyss
#

I know that the global one is meant to do that, but when I use it it only displays the skin for yourself, others cant see it

#

tbh idk if _unit is defined anywhere since this is a solution i've received from someone, if you can enlighten me that'd be appreciated

robust hollow
#

show where you remote execute it

tough abyss
#

in init.sqf:

if (!isDedicated) then
{
    waitUntil {!isNull player};
    
    ["InitializePlayer", [player]] call BIS_fnc_dynamicGroups;
    
    sidePlayer = side player;

    fnc_addRadio = compile preprocessFileLineNumbers "addradio.sqf";
    fnc_assigngear = compile preprocessFileLineNumbers "assigngear.sqf";
    fnc_texture = {_this execVM "uniformskin.sqf"};
    [player] remoteExec ["fnc_texture",-2];
    
    isJoining = false;
    
    execVM "briefing.sqf";
    execVM "unitmarkers.sqf";
    [] execVM "anticheat.sqf";

    //execVM "uniformskin.sqf";

    [] call compile preprocessFileLineNumbers "defineclasses.sqf";
    
    // Add mitsnefet handling for IDF.
    if (attackerFaction == 0) then
    {
        [] call compile preprocessFileLineNumbers "mitsnefet.sqf";
    };
    
    sleep .01;
    
    execVM "roundclient.sqf";
};
robust hollow
#

you dont do it as a jip message

#

so that is a problem but honestly doing it as a remoteexec seems like so much more work compared to just doing

if ((uniform player) isEqualTo "U_B_CTRG_Soldier_F") then 
{
   player setObjectTextureGlobal[0, "images\ctsfo_co.paa"];
};

which has no reason not to work globally and for jip.

tough abyss
#

@robust hollow thats exactly what I did but skin only shows for you

#

I had that script like that and then just used execVM where it was needed

#

yet it only shows for you, others see the outfit normally without any applied texture

leaden venture
#

Hey! I'd like to open BIS_FNC_Garage onto a specific vehicle to allow a user to change the vehicle appearance (camo, etc). How do I do this using call bis_Fnc_garage?

tough abyss
#

@robust hollow and how do I make it as a JIP message? add true after -2? im still struggling with remoteExec's so far

leaden venture
#

@tough abyss
You should do a remoteexec to set the texture in initserver.sqf using -2

#

and true, yes

#

RemoteExec is a pretty cool command, I'll try and break down the parameters of it for you.

tough abyss
#

I don't have initserver.sqf just init.sqf

leaden venture
#

Add initserver.sqf

#

Lets think about this

tough abyss
#

is it necessary that its in initserver.sqf?

leaden venture
#

We want the server to tell all JIP players to change the skin of a unit, right? Otherwise, every person who joins will tell all th other players to set the skin again whenever someone joins, recursively. We don't want that

#

Yes

#

Otherwise, you are storing a remote exec call inside of every machine that joins

#

Players 1 and 2 are in game, they do init.sqf and its a JIP command.

Player 3 joins, he sends the JIP command to players 1 and 2 and runs it himself.

Player 4 joins, he sends the JIP command to players 1 2 3 and runs it himself.

#

Its not a good practice

#

You need to be very careful with how you control your remote exec, especially with JIP commands.

tough abyss
#

alright, the issue is that this mission file is not made by me, im editing it to my needs. It has initplayerlocal and init.sqf but not initserver.sqf, if I make initserver.sqf, do I just add the

fnc_texture = {_this execVM "uniformskin.sqf"};
    [player] remoteExec ["fnc_texture",-2, true];

in there?

leaden venture
#

Players aren't gonna have fnc_Texture. Try using remoteexec to set the texture directly.

#

So something like

[player, [selection, texture]] remoteExec ["SetObjectTextureGlobal", -2, true]

#

But it looks like someting like if (local this) then {this setObjectTextureGlobal [0,"mypaafile.paa"]};

#

Will work just fine

tough abyss
#

yeah I looked into that too

#

so pretty much initServer.sqf has that one line

robust hollow
#

dont RE setObjectTextureGlobal 😱😱

tough abyss
#

RE the local version of it right?

robust hollow
#

RE is RE. it executes the given command or function on the provided targets. setObjectTextureGlobal has a global effect though, so using it in RE will tell everyone to tell everyone else to set the texture to the given filepath.

tough abyss
#

@leaden venture it doesn't locally apply the texture now either 😦

#

or at all

leaden venture
#

Connor's right, don't RE setobjectextureglobal

#

Just use setobjecttextureglobal in init.sqf, ensure that your usage is correct

tough abyss
#

ill look into it right now

#

but thing is I had it in init.sqf

#

with execVM uniformskin.sqf

#

and uniformskin.sqf is this:

if ((uniform player) isEqualTo "U_B_CTRG_Soldier_F") then 
{
   player setObjectTextureGlobal[0, "images\ctsfo_co.paa"];
};
leaden venture
#

use debug console and execute the setobjecttextureglobal part

#

see if it works

#

yeah it is,

#

Try executing it with debug console without that, just in mission. If that works, then you can work your way backwards to getting it to run when you want.

tough abyss
#

the setObjectTextureGlobal part w the texture works

#

if i put it in debug

leaden venture
#

Great, now you can work backwards and see if your conditional check works

tough abyss
#

this is honestly triggering the fuck out of me

leaden venture
#

Well, that's the process

#

Then you get better.

#

But if anyone else is online. I need a way to get BIS_FNC_Garage to enable for one vheicle, or at least a way to add specific parts to vehicles through garage. I'd like to add Slat-Cages to the AMV-7, but i only know how to do it through the UI

sly mortar
#

Does anyone know how to create modules via sqf script? Basically I want to be able to create a support requester module, a few providers, and sync them together with a group by script rather than having to do it in the editor all the time.

queen cargo
#

that is literally step-by-step

sly mortar
#

That describes creating "modules" in the context of addons. What I am looking for is a way to create an editor module as you would in the editor, but via script instead.

queen cargo
#

uhm ... wut?

#

the hell are you talking about

sly mortar
#

In the editor, when you place a "module". For example a support requester module. You just click and place it. I would like to be able to do that via script.

queen cargo
#

so you want to know, how to place those modules via scripting and not how to create one

sly mortar
#

Yeah, so I can call it like a function in sqf when I need to rather than having to do it in the editor manually.

queen cargo
#

that is a different story indeed, but the procedure is the same
read the article, it remains relevant
just that you now have to do a few things on your own rather then letting the game do it for you

#

a module is essentially an empty game object (forgot the name and cannot look it up as i am at work)

#

the parameters are set on it via setVariable iirc

#

links can also be done via scripting (there are commands for that)

sly mortar
#

I think I saw a way someone did it by creating a Logic with createUnit then set the type with setVariable. But I can't recall the exact syntax.

queen cargo
#

and in the end, you thenn pass that game object to the method set in the modules config

sly mortar
#
private _grp = createGroup sideLogic;
"ModuleSmokeWhite_F" createUnit [
    getPos player,
    _grp,
    "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];"
];
still forum
#

Do you want to do it in-editor? or ingame?

sly mortar
#

Via script, not in the editor.

still forum
#

Not sure if createUnit works properly in editor

swift crane
#

how can I get array of all units in trigger area?

still forum
#

thisList in the trigger code contains all units

winter rose
#

Not sure if createUnit works properly in editor afaik it works just fine