#arma3_scripting

1 messages ยท Page 467 of 1

little eagle
#

Too little context.

verbal otter
#

for prevent duplicate items

little eagle
#

Where is this script located?

verbal otter
#

two and more players in one vehicle open inventory and with clicker drop items. Vehicle bugged and items duplicate

#

@little eagle i'm run it on editor

#

with debug console

peak plover
#

Clicker, you mean like auto clicker?

verbal otter
#

yes

peak plover
#

๐Ÿค”

verbal otter
#

SpeedAutoClicker

little eagle
#

Does it display the hint text this?

peak plover
#

There are probably macros you can setup with some mice as well

verbal otter
#

@little eagle no,just for example

little eagle
#

What?

#

Does it display it or not.

#

Of course it is for debugging.

#

But knowing the results of the debugging would help a lot.

meager heart
#

btw idd is 602

little eagle
#

uiNamespace getVariable "RscDisplayInventory"

#

Is the woke way to write this.

#

ChewDev, this will not prevent people from duping items anyway. You could just access the inventory from outside the vehicle.

#

Arma is a game for closed milsim servers. You should get used to that. Only play with people you know and trust, (and you can punch ban if they misbehave).

verbal otter
#

commy2, from outside dupe fixed

little eagle
#

Cool. Disregard then.

#

Does it display the hint or not?

verbal otter
#

idk, now trying to solve it

little eagle
#

You don't know if the hint is displayed or not? Why don't you try to open the inventory?

verbal otter
#

disabled hint

#

not changed

little eagle
#

Why would you disable it if you want to see if it works or not? This makes no sense to me.

#
// initPlayerLocal.sqf
params ["_unit"];

_unit addEventHandler ["InventoryOpened", {count crew cameraOn > 1}];

Personally I would do this.

verbal otter
#

ty will try add to initPlayerLocal

#

get it working ๐Ÿ˜„

#
player addEventHandler ["inventoryOpened",{
        _this call {
            if !(objectParent player isEqualTo objNull) then {
                if (count (crew vehicle player)>1) exitWith {
                    hint "ะะตะปัŒะทั!";
                    true;
                };
            };
        };
    }
];```
little eagle
#

This looks unnecessarily complicated, but it's essentially the same as mine. So ๐Ÿ‘

meager heart
#

ura ๐Ÿ˜„

verbal otter
#

as i understand all event handlers for correct work must contain _this call {...} ๐Ÿ˜ƒ

little eagle
#

No, they must not.

#

For some reason you insist on using exitWith though.

#

And that is bugged inside the main scope.

#

So you have to open a child scope.

#

You could instead of _this call {...} also write isNil {...} or if (true) then {...} and it would be the same thing.

#

OR

#

Just don't use exitWith to begin with.

#

Like I did.

verbal otter
#

hmm, ty will remember ๐Ÿ˜ƒ

meager heart
#

also if you have _this in eh, probably you missed params or just in slightly wrong direction imo ๐Ÿ˜€

#

except those with one param maybe ๐Ÿ˜„

cedar hollow
#

can anyone help and tell me what button this is on my keyboard "37450"

drowsy axle
#

Hey guys, Could someone help me?

errant jasper
#

@cedar hollow Sure it's not life code and it is a control id?

cedar hollow
#

yeah its for dialog, just remembered

drowsy axle
#

I'm wanting to create a mission, that has three main 'paths' each path is per faction. And I'd like 'faction specific buildings' to be chosen based on the 'path' chosen. These 'faction specific buildings' will be for example; the Medical Tent, which has three types: AAF, NATO and CSAT. How can I utilise the hideObjectGlobal command to be able to hide the 'faction specific buildings' that aren't the players faction?

#

Anyone? ^

gleaming oyster
#

@tough abyss @open vigil

#

Posting invite links to cheats.

molten quartz
#

Hello guys! I'm currently in the process of making an Exile server and looking for a Dev to help out.

arctic veldt
#

Casually copy and pastes all over ^

molten quartz
#

lol what's your issue?

arctic veldt
#

No issue, it doesn't inspire confidence if you can't take a moment to change it slightly

molten quartz
#

Why does it need changing

gleaming oyster
still forum
#

@molten quartz #rules stop the spam.

drowsy axle
#

Anyone able to help me out with my query up above ^^^^^^^^

still forum
#

how does one select the path to take?

#

I'd say give each building a variable

#

make script files for each path with a bunch of hideObjectGlobal for each building

drowsy axle
#

That's undefined at the moment, just wanting a simple and expandable hideObject command file(s).

#

So for ref: I have natoFlag, affFlag and csatFlag. These are all object variables.

still forum
#

make script files for hideNatoObjects.sqf hideAAFObjects.sqf hideCSATObjects.sqf
in each of them just list all the objects like natoFlag hideObjectGlobal true;

#

and then after the path was chosen. You just execute both the hideObjects scripts of the paths that were not chosen

drowsy axle
#

I also have: natoTent , aafTent and csatTent. is there a way to include all variables that have nato etc.

#

Sweet. Sounds good. (I'm hoping to have it as a parameter in the lobby.)

still forum
#

you can use allVariables missionNamespace and then filter the ones that start with nato yeah

#

but I wouldn't use just nato that could get you in trouble.

#

Use some more unique tag

drowsy axle
#

I could do two arrays:sqf FactionArray = [nato,aff,csat]; ObjectArray = [Flag,Tent,]; ahh allvariables.

still forum
#

like CAP_NatoObject_
and then filter by that

drowsy axle
#

Yeah

#

Might do that. Thank you!

still forum
#
{(missionNamespace getVariable [_x, objNull]) hideObjectGlobal true; } forEach ((allVariables missionNamespace) select {_x select [0,15] == "CAP_NatoObject_"})
drowsy axle
#

oooh thank you very much!

#

I cannot react ๐Ÿ˜ข

still forum
#

keep in mind that it should be executed on the server

drowsy axle
#

Yup.

#

Does isServer I forgot what the command is exactly.. something along those lines.

peak plover
#

I can't believe dedmen thumbed his own post ๐Ÿ˜ฎ

still forum
#

Capwell said he wanted to react. So I gave him the button so he could click it

#

but he didn't ๐Ÿ˜ข

digital jacinth
#

there you get one from me as well

peak plover
#

๐Ÿ‘๐Ÿป

meager heart
molten quartz
#

I posted it in 2 channels Is that considered spam now?

still forum
#

Yes.

#

Also as #rules says. Post in the right channel. You posted in two channels that are not right.

drowsy axle
#

I did @still forum

#

I was busy ๐Ÿ˜›

#

@still forum Do you suggest a way to have the file author and info at the top of a script?

still forum
#

yes. one sec

peak plover
#

I like the data types

#

I gotta use that

drowsy axle
#
/*
 * Author: Capwell
 * Hides all object variables names start with "C_NATO_Object_".
 *
 * Arguments:
 * None
 *
 * Return Value:
 * Actions <ARRAY>
 *
 * Example:
 * if (isServer) then {
 *     execVM 'hideNatoObjects.sqf';
 * };
 *
 */

{
    (missionNamespace getVariable [_x, objNull]) hideObjectGlobal true; 
} forEach ((allVariables missionNamespace) select {_x select [0,14] == "C_NATO_Object_"});
systemChat "All NATO Objects: Hidden.";``` this okay? ๐Ÿ˜ƒ
still forum
#

maybe

 * Arguments:
 * None
#

Bahh. I need to rewrite what I just deleted :U

#

Your description and return value are wrong

drowsy axle
#

Awww

still forum
#

it returns what systemChat returns which is Nothing

#

it doesn't return the variables.

drowsy axle
#

Oh

still forum
#

it hides all objects who'se variable names start with C_NATO_Object_

#

also your _x select [0,15] is wrong now. You change the length of the name. You also need to change the entry on the select.
your name is now 14 characters long. not 15

drowsy axle
#

Ah, so that's what the 15 is okay.

#

entry as in the _x?

still forum
#

ye

#

_x is the variable name

#

select [0,15] cut's off the first 15 characters

#

and you then compare these first characters

drowsy axle
#

Ah okay

#

So I need to change *_x* select?

still forum
#

๐Ÿค”

#

no

#

just the 15

drowsy axle
#

Oh nvm then. I thought that's what you where asking me. xD

still forum
#

the number has to be the length of your C_NATO_Object_ string

drowsy axle
#

Yup, got iot.

still forum
#

you could theoretically just write count "C_NATO_Object_" instead of 15. But that will count the length of the string at every iteration and probably halve your speed

drowsy axle
#

Okay.

#

I won't do that.

#

๐Ÿ˜›

#
_FactionSelection = "FactionSelection" call BIS_fnc_getParamValue;
_NATO = createGroup west;
_AAF = createGroup independent;
_CSAT = createGroup east;

if (_FactionSelection == 1) then {
    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
    } else {
    if (playerSide != west) then {
            [player] joinSilent _NATO;
        };
    };
};

if (_FactionSelection == 2) then {
    if (isServer) then {
        execVM 'hideAffObjects.sqf';
    } else {
    if (playerSide != independent) then {
            [player] joinSilent _AAF;
        };
    };
};

if (_FactionSelection == 3) then {
    if (isServer) then {
        execVM 'hideCsatObjects.sqf';
    } else {
    if (playerSide != east) then {
            [player] joinSilent _CSAT;
        };
    };
};```
peak plover
#

hideAff

#

Is the file name the same, because faction name is aaf

still forum
#

=== is invalid

peak plover
#

isEqualTo is similar to ===

drowsy axle
#

Just =?

still forum
#

playerSide isEqualTo east || independent is invalid. independent is not a boolean

#

no. = assigns variables.

drowsy axle
#

oh right

#

== ? :/

still forum
#

yes

drowsy axle
#

๐Ÿ˜ƒ

still forum
#

playerSide isEqualTo east || independent -> playerSide != west

drowsy axle
#

Changed above

#

Oh okay.

#

I want to do the check, as I could make each faction slots.

#

(separate missions - slots)

still forum
#
    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
    };
    if (playerSide == east || independent) then {
            [player] joinSilent _NATO;
    };

->

    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
    } else {
        if (playerSide != west) then {
                [player] joinSilent _NATO;
        };
    };

doesn't make sense to check playerSide or player on serverside

drowsy axle
#

Why the else?

#

I don't understand. I thought that the two if statements are separate?

still forum
#

yes..

#

That's the problem

#

you are checking playerSide on the server too. Which doesn't make sense. The server doesn't have a player

drowsy axle
#

How? the isServer is within it's own scope.

still forum
#

yes..

#

exactly that

drowsy axle
#

Or can I place the playerSide above isServer??

still forum
#

๐Ÿคฆ

drowsy axle
#

I don't understand..

still forum
#

You are executin the execVM part only on the server. That's correct.

drowsy axle
#

Yup.

still forum
#

but the joinGroup part is executed on server AND client

#

serverside that check doesn't make sense though

drowsy axle
#

Ah

#

IsDedicated is for client (local host) correct?

still forum
#

no

#

it checks if the machine is dedicated. Aka has no UI

drowsy axle
#

right

#

How would I execute on the clients?

still forum
#

execute what?

drowsy axle
#

[player] joinSilent _NATO;

still forum
#

using the else exactly like I posted above

drowsy axle
#

So the else puts it out of server, okay.

#

edited above

still forum
#

you still didn't fix the other syntax error I told you about

drowsy axle
#

Sorted

peak plover
#

So if a gun fires 1000rpm, it fires a round every 60 ms?

errant jasper
#

Yes... Unless it is a trick question, in which case... maybe?

peak plover
#

haha, not really trying to trick anyone ๐Ÿ˜„

errant jasper
#

Hehe, could have fooled me... And you almost did ๐Ÿ˜„

#

Real question is if no one is around when it fires, does Arma make a sound?

still forum
#

โ˜ ๐Ÿค” ๐Ÿ™„ ๐Ÿค” ๐Ÿ˜ ๐Ÿ˜ฅ

arctic veldt
#

Dedmen using emojis instead of text?!

#

What is this sorcery!

peak plover
#

Future games will be written entirely in emojis

errant jasper
#

๐Ÿ˜ ๐Ÿ”ซ ๐Ÿ˜ƒ <- I just played Arma 4

still forum
#

Problem is.. That is indeed a legit question.. Does Arma make the sound and tell other units that a sound was just made at that location

#

I'd say it probably does. Because checking if anyone is around would be way too expensive

peak plover
#

yeah and you can hear many things from huge distances

errant jasper
#

Actually it is more complicated than that. Example, if you join (or maybe you were already joined but not loaded the following area) a MP session that has been running. But earlier in a location far away from your spawn point, a helicopter was scripted in and destroyed, you will still hear the explosion when you get closer.

meager heart
#

fix > _heli setDamage [1, false]; ๐Ÿ˜€

errant jasper
#

I'll take your word for it, much of my experience with that was before that optional argument was added.. Though you will still experience it with game modes that creates dynamic mission (e.g. side missions), then the spawn scripts screws up and puts a vehicle inside a too small garage or something.

meager heart
#

yeah ^ also if that was just "accidental explosion/destruction/collision with explosion" sometimes you can hear it even if that vehicle already was deleted

#

plus for "sound weirdness" is cool mods, with models that have some ambient sounds... you just delete that vehicle, but sound still there ๐Ÿ˜€

quartz coyote
#

Hello, Is it possible for a script executed server side, to detect if a player has a variable set to a given state (0 or 1) in a script executed locally for the player(s) ?

still forum
#

no

#

the server doesn't know about locally set variables on the client

quartz coyote
#

That's what I thought... Logical I most admit

peak plover
#

Wait, how do I measure ms ?

#

diag_tickTime shows me seconds with 1 decimal

meager heart
#

1 tick = 1 ms

peak plover
#

I wanna make forceWeaponFire shoot at 4000 rpm exactly

still forum
#

Can't @peak plover

peak plover
#

๐Ÿค”

still forum
#

you can shoot once per frame

peak plover
#

Whoa

#

Really?

#

How on earth do we get 4000 rpm ?

still forum
#

You could maybe custom spawn multiple projectiles via script though

#

so shoot 1 bullet at first frame. And shoot 5 bullets at next frame because the time interval was too long

peak plover
#

๐Ÿค”

still forum
#

Will look very nice in multiplayer when you have 5 fps and your mates look at you shooting bursts

meager heart
#

lol

still forum
#

So Arma does what I said by itself then

peak plover
#

firing for 1 second

still forum
#

or not?

#

Are these numbers fired per second or fired per frame?

peak plover
#

while true fire

#

1 second of fire for littlebird

#

minigun

still forum
#

scheduled script == unreliable

peak plover
#

WEll

#

well

#

I can't get more than 246 fps even with 640*480 at 50% 3d resoltuion

#

I can't really do this in unschedueld can i?

still forum
#

eachFrameHandler

#

you can disable sound to get a little more fps

#

-noSound parameter

peak plover
#

each frame handler, but

#

it's limited to fps

#

while loop terminates after only 1 bullet in unscheduled

#

ie. 10k loops

still forum
#

yes..

#

each frame handler

#

one execution per frame

peak plover
#

for _i mite work 'tho?

still forum
#

yes

peak plover
#

I will try it

#

But in theory it should freeze the game

meager heart
#

also you can try -noLag and -gibFPS startup params /s

peak plover
#
for '_i' from 0 to 1 step 0 do {
#

heavy breathing

meager heart
#

gl

still forum
#

also exits after 10k

#

........ should.....

peak plover
#

nah

#

It runs infinity, but I put a ```sqf
if (diag_tickTime > _stopAt) exitWith {};

still forum
#

๐Ÿ˜„

peak plover
#

Freeze stops after this is hit

#

But yeah unscheduled freezes it, like it should

#

only 1 bullet fired

#

tbh

#

I was stupid to use while in scheduled, beacause if like you said, max 1 bullet per frame, it can run 3ms of fire, but 1 bullet will still fire

#

Just like what happend now

still forum
#

I guess it's because reloadTime is at min 0. But reload is done in simulation cycle. Which runs once per frame

#

if you want more you can still go shotgun mode

#

atleast I think you can spawn projectiles via script.. There has to be a way

peak plover
#

for loop ran 588k times with 1 second

#

yeah that can be done

#

I'm just gonna try investigate how fast can I shoot and how much does fps play role

meager heart
#

just clicked more info in vscode helper (hover on box) and got on vigorgame page...wtf ๐Ÿ˜‚

peak plover
#

Wtha the fuck

#

same

#

I serached the wiki and got vigor game page

meager heart
#

lol

peak plover
meager heart
#

isNil < try that one, nigel

still forum
#

@lavish ocean ^ Wiki still redirecty to Vigor page sometimes

peak plover
#

@meager heart for what?

still forum
#

I cannot reproduce that though

peak plover
still forum
#

which browser?

peak plover
#

firefox

still forum
#

nope

meager heart
#

chrome here

peak plover
#

probably like a cache

still forum
#

maybe they broke the DNS and I still have to old nonbroken one

peak plover
#

juist started happening to me

#

It was working like a few hours ago when I used it

meager heart
peak plover
#

I'm using poseidon

#

so F1 brings me to wiki page

meager heart
#

oh... i thought you are using vscode

still forum
#

you should already get used to vscode. Because poseidon won't get the debugger soon ๐Ÿ˜‰

peak plover
#

What do you mean

#

VSCODE getting debugger?

still forum
#

yeah

#

Kamen is working on it. The guy who also made the vscode linter plugin

peak plover
#

Ohh, that's hella nice

peak plover
#

whopooa

#

That's nutty

#

super nice

meager heart
#

looks promising ๐Ÿ‘

peak plover
meager heart
#

lol

digital jacinth
#

i am waiting for something like that for a long time

still forum
#

we already had it a year ago. But the IDE was too deep in development and no one really cared about it

digital jacinth
#

java debugger spoiled me good.

peak plover
#

So

#

remotExec has to be sent to server even if you do it as object local to player as target?

still forum
#

That's a haard question. We don't know

#

easy way to test. log diag_tickTime in your code.

#

if delay is very low then it doesn't. If delay is about the same as the servers ping... then.. you know

#

Please test it and add the info to biki. Many people asked that question and no one knows so far

peak plover
#

I can't add info to biki

#

I can test it by unplugging my cable ๐Ÿ˜„

hollow thistle
#

๐Ÿ˜„

peak plover
#

@still forum I unplugged cable, nothing happed until I plugged cable back in

still forum
#

Dunno...

#

Doesn't mean that's the cause

peak plover
#

SO it's confirmed, ```sqf
remoteExec ['spawn',ten_man];

https://i.imgur.com/1Mqy22p.jpg
didn't run until I plgged it back in
#

ten_man local = true

#

RE seems to always go to server

still forum
#

Wouldn't call that confirmed

#

there might be other things which cause that to not run before you are connected to the server again

still forum
#

Maybe this means we'll get quoting support soon

drowsy axle
#

Nice.

digital jacinth
#

Cannot do this as normal user.

drowsy axle
#

uhm @still forum I've broke what "we" where creating. Could you check it over for us, been trying to sort it myself for 40 minutes.

still forum
#

show me code

drowsy axle
#

Will do.

#

Init.sqf : execVM 'factionSelection.sqf';

still forum
#

@digital jacinth guess could be debug mode only then. It's under the debug mode Copy ID button

digital jacinth
#

ah, yeah running in browser, so no debug anywhere in sight

still forum
#

Debug works the same in browser

digital jacinth
#

interesting

drowsy axle
#

factionSelection.sqf : ```sqf
_FactionSelection = "FactionSelection" call BIS_fnc_getParamValue;

ifReady = false;

_NATO = createGroup blufor;
_AAF = createGroup independent;
_CSAT = createGroup opfor;

t1pos = getPos Tank1;
t2pos = getPos Tank2;
t3pos = getPos Tank3;
t1dir = getDir Tank1;
t2dir = getDir Tank2;
t3dir = getDir Tank3;

if (_FactionSelection == 1) then {
if (isServer) then {
execVM 'hideAafObjects.sqf';
execVM 'hideCsatObjects.sqf';
} else {
if (playerSide != blufor) then {
[player] joinSilent _NATO;
playerSide = blufor;
ifReady = true;
Playernato = true;
};
};
if (_FactionSelection == 2) then {
if (isServer) then {
execVM 'hideNatoObjects.sqf';
execVM 'hideCsatObjects.sqf';
} else {
if (playerSide != independent) then {
[player] joinSilent _AAF;
playerSide = independent;
ifReady = true;
Playeraaf = true;
};
};

if (_FactionSelection == 3) then {
if (isServer) then {
execVM 'hideNatoObjects.sqf';
execVM 'hideAafObjects.sqf';
} else {
if (playerSide != opfor) then {
[player] joinSilent _CSAT;
playerSide = opfor;
ifReady = true;
Playercsat = true;
};
};``` Continues -

#

if (Playernato) then {
globalChat "Players Joined: NATO.";
globalChat "Hiding AAF and CSAT Assets";
};

if (Playercsat) then {
globalChat "Players Joined: CSAT.";
globalChat "Hiding NATO and AAF Assets";
};

if (Playeraaf) then {
globalChat "Players Joined: AFF.";
globalChat "Hiding NATO and CSAT Assets";
};

if (ifready) then {
C_NATO_Object_Tank1 setPos t1pos;
C_NATO_Object_Tank1 setDir t1dir;

C_NATO_Object_Tank2 setPos t2pos;
C_NATO_Object_Tank2 setDir t2dir;

C_AAF_Object_Tank1 setPos t1pos;
C_AAF_Object_Tank1 setDir t1dir;
C_AAF_Object_Tank2 setPos t2pos;
C_AAF_Object_Tank2 setDir t2dir;
C_AAF_Object_Tank3 setPos t3pos;
C_AAF_Object_Tank3 setDir t3dir;

C_CSAT_Object_Tank1 setPos t1pos;
C_CSAT_Object_Tank1 setDir t1dir;
C_CSAT_Object_Tank2 setPos t2pos;
C_CSAT_Object_Tank2 setDir t2dir;

globalChat "Faction-specific, Tanks have been placed at Range 9.";

};```

still forum
#

why so complicated?

austere granite
#

dedmen how do i embrace vs code and not hate it?

drowsy axle
#

Because I couldn't do systemChat inside the if statements of sqf [player] joinSilent _CSAT; playerSide = opfor; ifReady = true; Playercsat = true;

#

And I wanted all Vehicles gone (hidden) before I put them all on the same position.

still forum
#
t1pos = getPos Tank1;
t2pos = getPos Tank2;
t3pos = getPos Tank3;
t1dir = getDir Tank1;
t2dir = getDir Tank2;
t3dir = getDir Tank3;

    C_NATO_Object_Tank1 setPos t1pos;
    C_NATO_Object_Tank1 setDir t1dir;
    C_NATO_Object_Tank2 setPos t2pos;
    C_NATO_Object_Tank2 setDir t2dir;

    C_AAF_Object_Tank1 setPos t1pos;
    C_AAF_Object_Tank1 setDir t1dir;
    C_AAF_Object_Tank2 setPos t2pos;
    C_AAF_Object_Tank2 setDir t2dir;
    C_AAF_Object_Tank3 setPos t3pos;
    C_AAF_Object_Tank3 setDir t3dir;

    C_CSAT_Object_Tank1 setPos t1pos;
    C_CSAT_Object_Tank1 setDir t1dir;
    C_CSAT_Object_Tank2 setPos t2pos;
    C_CSAT_Object_Tank2 setDir t2dir;

->


{
    _x params ["_tank1","_tank2","_tank3"];
    _tank1 setPos (getPos Tank1);
    _tank1 setDir (getDir Tank1);
    
    _tank2 setPos (getPos Tank2);
    _tank2 setDir (getDir Tank2);
    
    if (!isNil "_tank3") then {
        _tank3 setPos (getPos Tank3);
        _tank3 setDir (getDir Tank3);
    };
} forEach [[C_NATO_Object_Tank1, C_NATO_Object_Tank2], [C_AAF_Object_Tank1, C_AAF_Object_Tank2], [C_CSAT_Object_Tank1,C_CSAT_Object_Tank2]];
#

your globalChat is syntax error

#

playerSide = opfor; syntax error. You cannot set commands.

drowsy axle
#

Does it need a person? global

still forum
#

Click the link and read.

drowsy axle
#

Will do.

meager heart
#

those discord "messages links" works if you paste them anywhere (another servers chats, browser...etc)

drowsy axle
#
_FactionSelection = "FactionSelection" call BIS_fnc_getParamValue;

_NATO = createGroup blufor;
_AAF = createGroup independent;
_CSAT = createGroup opfor;

if (_FactionSelection == 1) then {
    if (isServer) then {
        execVM 'hideAafObjects.sqf';
        execVM 'hideCsatObjects.sqf';
    } else {
    if (playerSide != blufor) then {
        [player] joinSilent _NATO;
        debugGuy globalChat "Players Joined: NATO.";
        debugGuy globalChat "Hiding AAF and CSAT Assets";
    };
};
if (_FactionSelection == 2) then {
    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
        execVM 'hideCsatObjects.sqf';
    } else {
    if (playerSide != independent) then {
        [player] joinSilent _AAF;
        debugGuy globalChat "Players Joined: AFF.";
        debugGuy globalChat "Hiding NATO and CSAT Assets";
    };
};

if (_FactionSelection == 3) then {
    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
        execVM 'hideAafObjects.sqf';
    } else {
    if (playerSide != opfor) then {
        [player] joinSilent _CSAT;
        debugGuy globalChat "Players Joined: CSAT.";
        debugGuy globalChat "Hiding NATO and AAF Assets";
    };
};

{
    _x params ["_tank1","_tank2","_tank3"];

    _tank1 setPos (getPos Tank1);
    _tank1 setDir (getDir Tank1);
    
    _tank2 setPos (getPos Tank2);
    _tank2 setDir (getDir Tank2);
    
    if (!isNil "_tank3") then {
        _tank3 setPos (getPos Tank3);
        _tank3 setDir (getDir Tank3);
    };

    debugGuy globalChat "Faction-specific, Tank has been placed at Range 9.";

} forEach [[C_NATO_Object_Tank1, C_NATO_Object_Tank2], [C_AAF_Object_Tank1, C_AAF_Object_Tank2, C_AAF_Object_Tank3], [C_CSAT_Object_Tank1,C_CSAT_Object_Tank2]];```
still forum
#

@meager heart I guess they join the server then?

meager heart
#

yes afaik

still forum
#

@drowsy axle for a normal chat message you can also use systemChat
playerSide == blufor; wtf are you trying to do there?
debugGuy globalChat "Faction-specific, Tank has been placed at Range 9."; you are spamming that 3 times.

drowsy axle
#

I was using that, but it wasn't working. I'll change it back when everything else is.

#

Oh I don't need it xD

#

And I know.

#

lol

#

Sorted above ^

still forum
#

still spamming. Otherwise I don't see any errors anymore

drowsy axle
#

Yup, it's just for testing :/ So I know it's doing it over.

#

Do I need to change anything for this to work in SP?

still forum
#

no

#

or wait..

#

the else of the isServer. You won't get moved into the group if you are the server. Which you are in SP

#

also you are missing the }; for every else

drowsy axle
#

Sorted the }; for else

#

How would I change the else?

#

To be both SP and MP compat.

#

(If PlayerUID == _SP_PLAYER_)??

peak plover
#

How did you get the link to your post

drowsy axle
#

@peak plover copy it

still forum
#

right side of message. press the 3 dots and Copy Link

#

@drowsy axle replace the else by a if (!isDedicated)

drowsy axle
#

Okay

austere granite
#

capwell probably needs to start with SQF basics

#

: (If PlayerUID == _SP_PLAYER_)
that isnt anything at all

still forum
#

He has been here for almost half a year now @austere granite

#

He just isn't able to learn. We tried MAAANY times

drowsy axle
#
if (_FactionSelection == 3) then {
    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
        execVM 'hideAafObjects.sqf';
    }; 
};
if (!isDedicated) {
    if (playerSide != opfor) then {
            [player] joinSilent _CSAT;
            debugGuy globalChat "Players Joined: CSAT.";
            debugGuy globalChat "Hiding NATO and AAF Assets";
        };
    };
};``` like this?
austere granite
#

no

still forum
#

no

austere granite
#

do you have the wiki bookmarked?

drowsy axle
#

I do, I have it open

still forum
#

you should maybe look at the wiki page for if if you are writing a if

austere granite
#
if (!isDedicated) {
    if (playerSide != opfor) then {
#

i mean... that should instantly tell you something is up

#

Also if you want actual side switching the better solution is to use selectPlayer

drowsy axle
#
{
    STATEMENT1;
    ...
}
else //just (!dedicated)
{
    STATEMENT2;
    ...
};```
#
{
    STATEMENT1;
    ...
}
(!dedicated)
{
    STATEMENT2;
    ...
};```
austere granite
#

no

still forum
#

๐Ÿคฆ

#

See what I mean @austere granite ?

austere granite
#

yeah

still forum
#
if (_FactionSelection == 1) then {
    if (isServer) then {
        execVM 'hideAafObjects.sqf';
        execVM 'hideCsatObjects.sqf';
    };
    if (!isDedicated && playerSide != blufor) then {
        [player] joinSilent _NATO;
        debugGuy globalChat "Players Joined: NATO.";
        debugGuy globalChat "Hiding AAF and CSAT Assets";
    };
};

Here take that.

drowsy axle
#

That is what I put, but with extra }; which you could have told me...

#
{
    if (someAmmo player) then
    {
        hint "The player is alive and has ammo!";
    }
    else
    {
        hint "The player is out of ammo!";
    };
}
else
{
    hint "The player is dead!";
};```
still forum
#

why extra };?`

austere granite
#

no you didnt put that

#

at at all

still forum
#

What I just posted is completly different of what you posted

austere granite
#
if (!isDedicated) {
    if (playerSide != opfor) then {

Do you not see the problem tehre?

still forum
#

Because I applied some logical thinking and programming knowledge to optimize that script in my head

drowsy axle
#
if (_FactionSelection == 3) then {
    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
        execVM 'hideAafObjects.sqf';
    }; 
if (!isDedicated) {
    if (playerSide != opfor) then {
            [player] joinSilent _CSAT;
            debugGuy globalChat "Players Joined: CSAT.";
            debugGuy globalChat "Hiding NATO and AAF Assets";
        };
    };
};```
austere granite
#

NO

#

look at what i posted

#

use your eyhes

#

read it

still forum
#

you really don't see the difference?

#

Dude...

drowsy axle
#

I don't

austere granite
#
if (_FactionSelection == 3) then {
    if (isServer) then {
..
if (!isDedicated) {
    if (playerSide != opfor) then {
#

one of these things is not like the other

still forum
#

I've given you the solution. Now go. And stop making yourself a fool.

drowsy axle
#

@austere granite ...

austere granite
#
if _something then {
if _something then {
if _something
if _something then {
#

one of these things is not like the other!

#

can you spot it?

drowsy axle
#

oh

#

wow

#

My bad

#

๐Ÿ˜ข

still forum
#

You have been at this for almost 1,5 years now. And still don't have the basics

drowsy axle
#
if (_FactionSelection == 3) then {
    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
        execVM 'hideAafObjects.sqf';
    }; 
if (!isDedicated) then {
    if (playerSide != opfor) then {
            [player] joinSilent _CSAT;
            debugGuy globalChat "Players Joined: CSAT.";
            debugGuy globalChat "Hiding NATO and AAF Assets";
        };
    };
};```
#

is that correct?

still forum
#

I've already sent you the solution above..

drowsy axle
#

I know..

#

but you want me to learn, yes.

still forum
#

no

drowsy axle
#

๐Ÿ˜ฆ

austere granite
#

also why opfor and so? Are you assigning those?

#

By default opfor isnt anything

still forum
austere granite
#

or am i wrong on this

#

oh lel

still forum
#

That's why the syntax highlighter also highlights it as command

drowsy axle
#

:/

austere granite
#

does anyone use that? I was ocnfused why the syntax highlighting was even highlighting it

drowsy axle
#

It was only intro'd in a3

still forum
#

well. it's the opfor side.. If you want the opfor side then you use that yeah

austere granite
#

EAST ๐Ÿ‘Œ๐Ÿป

drowsy axle
austere granite
#

my bad ๐Ÿ˜ƒ

#

yea i just use west/east everywhere

#

don't most?

drowsy axle
#

I do.

#

But I was seeing what my issues where ๐Ÿ˜›

still forum
#

east is shorter than opfor. So east is obviously the better choice

austere granite
#

i bet opfor just points to east in c++ as well doesnt it? ๐Ÿ˜„

#

just like config / "something" points to >>

queen cargo
#

/ is not the same as >>

#

opfor on the other hand most likely ist just an alias

still forum
#

no one said that โ˜

#

/ is also just an alias for >>

queen cargo
#

just like config / "something" points to >>

still forum
#

yeah

queen cargo
#

wasn't / slower then >> ?

still forum
#

it does that. / points to >> internally

#

yes

austere granite
#

yes

#

that's my point ๐Ÿ˜„

queen cargo
#

so it is not the same

still forum
#

no

#

no one said it is

#

"points to" != "same"

queen cargo
#

it does that. / points to >> internally

still forum
#

I can point at you. Am I you now?

austere granite
#

okay X39 and semantics

#

yes you are

#

back to coffee

queen cargo
#

i could use some coffee

#

..

#

or that the bloody girl i met last friday responds
both are acceptible options

austere granite
#

"""""girl"""" (male)

still forum
#

Interesting... opfor and east point to different functions. But both functions return SideEast

#

opfor -> getOpfor -> sideEast
east -> getEast -> sideEast

for comparison

-> getConfigEntry
/ -> >> -> getConfigEntry

drowsy axle
#
if (_FactionSelection == 1) then {
    if (isServer) then {
        execVM 'hideAafObjects.sqf';
        execVM 'hideCsatObjects.sqf';
    };
    if (!isDedicated && playerSide != west) then {
        _NATO = createGroup west;
        [player] joinSilent _NATO;
        debugGuy globalChat "Players Joined: NATO.";
        debugGuy globalChat "Hiding AAF and CSAT Assets";
    };
};

if (_FactionSelection == 2) then {
    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
        execVM 'hideCsatObjects.sqf';
    };
    if (!isDedicated && playerSide != independent) then {
            _AAF = createGroup independent;
            [player] joinSilent _AAF;
            debugGuy globalChat "Players Joined: AFF.";
            debugGuy globalChat "Hiding NATO and CSAT Assets";
        };
    };
};

if (_FactionSelection == 3) then {
    if (isServer) then {
        execVM 'hideNatoObjects.sqf';
        execVM 'hideAafObjects.sqf';
    };
    if (!isDedicated && playerSide != east) then {
            _CSAT = createGroup east;
            [player] joinSilent _CSAT;
            debugGuy globalChat "Players Joined: CSAT.";
            debugGuy globalChat "Hiding NATO and AAF Assets";
        };
    };
};

{
    _x params ["_tank1","_tank2","_tank3"];

    _tank1 setPos (getPos Tank1);
    _tank1 setDir (getDir Tank1);
    
    _tank2 setPos (getPos Tank2);
    _tank2 setDir (getDir Tank2);
    
    if (!isNil "_tank3") then {
        _tank3 setPos (getPos Tank3);
        _tank3 setDir (getDir Tank3);
    };

    debugGuy globalChat "Faction-specific, Tank has been placed at Range 9.";

} forEach [[C_NATO_Object_Tank1, C_NATO_Object_Tank2], [C_AAF_Object_Tank1, C_AAF_Object_Tank2, C_AAF_Object_Tank3], [C_CSAT_Object_Tank1,C_CSAT_Object_Tank2]];``` Boom, sorted. Let's see if it works SP and MP this time ๐Ÿ˜›
queen cargo
#

an actual girl @austere granite
gah .. fuck damned should have kissed her on that bloody friday
but well .. she was kinda akward from time to time
still enjoyed that

drowsy axle
#

awkward how? @queen cargo

austere granite
#

tsundere

drowsy axle
#

Anyway, i've got to get back to work. Only having my lunch break ๐Ÿ˜„

queen cargo
#

hard to describe without wandering too much into the offtopic land @drowsy axle
short version is: it was not supposed to get into the โค section that day

austere granite
#

_tank1 setPos (getPos Tank1);

I also dont recommend setpos getpos btw

#

also if you're placing the tank on the position of another tank, bad things will happen probably

#

setPos height 0 puts it on surface level (Terrain / sea)
getPos height 0 can also be on top of an objectr, so lets say tank is on top of some composition you create, then shit will 100% reliably fuck up

#

getPosRealWorldModelVisual3D is the patricians command

little eagle
#

Get you icky girl talk out of here. This is a nerd channel.

peak plover
#

Yeah, this kind of talk threthens the nerd population world wide

tulip smelt
#

Can somebody help me with some code? I wanna make a trigger that activates when the player enters a helicopter and the engine turns on.
waitUntil { player == cargo _T1; };
vehicle player engineOn true;

little eagle
#

How do you play the sound?

tulip smelt
#

I'll have to look

little eagle
#

Is this supposed to play on only one specific object, or every object of a specific class? Do you use any mods? Is this for a mission or a mod?

drowsy axle
#

@austere granite Don't you think I know this ...

tulip smelt
#

It's for a mission, and it plays for a specific helicopter

little eagle
#

It should still be repeated every day. Though idk what he means by getPosRealWorldModelVisual3D. That is not actually a thing.

#
0 = this addEventHandler ["Engine", {
    params ["_vehicle", "_isEngineOn"];

    if (_isEngineOn) then {
        _vehicle say3D "Alarm";
    };
}];
#

Put this into the init box.

tulip smelt
#

1 fadeMusic 5; playmusic "music1"; in the activation field,

little eagle
#

No idea how you play the sound, or which one, so "Alarm" it is.

#

Oh, so you don't play any sound, but music.

#

Is this music supposed to play for everyone on the server, or just the pilot?

tulip smelt
#

It plays for just for the player, when they enter the chopper. The chopper is a support

little eagle
#
0 = this addEventHandler ["Engine", {
    params ["_vehicle", "_isEngineOn"];

    if (_isEngineOn && {player == driver _vehicle}) then {
        1 fadeMusic 5;
        playmusic "music1";
    };
}];
#

This into the helicopters init box.

tulip smelt
#

Cool deal, thank you

little eagle
#

Question. Should this music only play once per mission? Or every time the engine is turned on?

tulip smelt
#

every time. In the trigger I have set to repeat

little eagle
#

OK, then leave it as I wrote. You can delete the trigger. It is not needed for turning on the engine of a vehicle, and this event handler based solution is better in every way.

tulip smelt
#

Does your code require the player to be the pilot? Would it be player == cargo?

little eagle
#

The pilot when he turns on the engine.

#

they*

tulip smelt
#

Ok, cause the way I've got it setup is the AI flying the heli

little eagle
#

So let's rething this then. The music should start playing for everyone inside the helicopter once the engine is turned on.

#

Would that make sense?

meager heart
#

he had ^ vehicle player engineOn true; aka manually start it and that is wrong > 1 fadeMusic 5; max volume is 1, should be fadeTime fadeMusic volume commy ๐Ÿ˜€

tulip smelt
#

yes

little eagle
#

What if someone enters the heli, but the engine is already turned on?

tulip smelt
#

Yeah, it should probably play then too.

gleaming oyster
#

All you need now is strobe lights

meager heart
#

and disco ball

tulip smelt
#

hell yeah

little eagle
#

Should it start at the beginning of the track or in the middle of it depening on when the engine was started. ๐Ÿค” It think now I am overthinking it.

tulip smelt
#

At the beginning. The scene in Blackhawk Down when they're taking off to Voodoo Child, is the inspiration.

little eagle
#
0 = this addEventHandler ["Engine", {
    params ["_vehicle", "_isEngineOn"];

    if !(player in _vehicle) exitWith {};

    if (_isEngineOn) then {
        5 fadeMusic 1;
        playmusic "music1";
    };
}];

0 = this addEventHandler ["GetIn", {
    params ["_vehicle", "", "_unit"];

    if (_unit != player) exitWith {};

    if (isEngineOn _vehicle) then {
        5 fadeMusic 1;
        playmusic "music1";
    };
}];
lone glade
#

0 = this
reeeeeeeee

little eagle
#

Init box, alganthe. And they're using no cba to fix it.

still forum
#

why not just write 0=0 at the end.

little eagle
#

Because every statement has to have no return value. Or do you want me to use commas everywhere instead?

still forum
#

every really? uhhh

little eagle
#

Yes.

#

Welcome to vanilla.

#

Anyway

tulip smelt
#

Sorry, I do have cba

little eagle
#
this addEventHandler ["Engine", {
    params ["_vehicle", "_isEngineOn"];

    if !(player in _vehicle) exitWith {};

    if (_isEngineOn) then {
        5 fadeMusic 1;
        playmusic "music1";
    };
}];

this addEventHandler ["GetIn", {
    params ["_vehicle", "", "_unit"];

    if (_unit != player) exitWith {};

    if (isEngineOn _vehicle) then {
        5 fadeMusic 1;
        playmusic "music1";
    };
}];
#

There.

#

Happy?

lone glade
#

yes

little eagle
#

Cheese.

#

Erm.

#

This starts the music if:
- the engine of the helicopter is turned on and the local player sits inside the heli
- the player enters the heli while the engine is turned on

lone glade
#

you forgot to fade it out once they get out or die

#

MY IMMERSION IS BROKEN

little eagle
#

The music fades on its own after 5 seconds I believe.

meager heart
#

0 fademusic 0; > 5 fadeMusic 1; maybe

#

or music eh ๐Ÿ˜€

tulip smelt
#

It doesn't. Keeps playing until you enter the heli and give it orders again.

little eagle
#

Is that good or bad?

tulip smelt
#

Kinda, I just want it to play while in the heli.

#

Sorry I'm picky ๐Ÿ˜„

little eagle
#
this addEventHandler ["Engine", {
    params ["_vehicle", "_isEngineOn"];

    if !(player in _vehicle) exitWith {};

    if (_isEngineOn) then {
        5 fadeMusic 1;
        playmusic "music1";
    };
}];

this addEventHandler ["GetIn", {
    params ["_vehicle", "", "_unit"];

    if (_unit != player) exitWith {};

    if (isEngineOn _vehicle) then {
        5 fadeMusic 1;
        playmusic "music1";
    };
}];

this addEventHandler ["GetOut", {
    params ["", "", "_unit"];

    if (_unit != player) exitWith {};

    playMusic ["", 0];
}];
#

Last block turns the music off once you leave the vehicle.

tulip smelt
#

allrighty, testing it out

little eagle
#

I guess you can replace the playMusic ["", 0] with 5 fadeMusic 0; to fade the music in 5 seconds.

tulip smelt
#

Works beautifuly. Thanks a million.

meager heart
#

what is better option allMissionObjects vs entities vs ... filter is > different kind of weapon holders, TimeBombCore... etc, without any radius or area, just all present at given time ?

little eagle
#

TimeBombCore

#

allMines ?

meager heart
#

hmm... yes i think, but for weapon holders ?

#

allMissionObjects < slowest afaik

little eagle
#

Report all weapon holders that contain at least one mine of this type?

meager heart
#

just all present in a mission

little eagle
#

So yes.

#

entities probably.

meager heart
#

ty, will try it

shadow sapphire
#

Anyone know of a good way to make a waypoint cycle similar to how BIS_FNC_TSKPATROL works? I've got one made up that works, but it has a few quirks, in that sometimes the loop doesn't pan out very well. Also, I'd like a touch more flexibility, like the ability to have elements wait for a time at waypoints before continuing along their route.

#
    _G1 addwaypoint [_this, 2400];
    _G1 addwaypoint [_this, 2400];
    _G1 addwaypoint [_this, 2400];
    _G1 addwaypoint [_this, 2400];
    _G1 addwaypoint [_this, 2400];
    _G1 addwaypoint [_this, 2400];
    _G1 addwaypoint [_this, 2400];
    [_G1, 6] setwaypointtype "CYCLE";
#

That's what I've been using, it works, but commonly the group will get caught in a loop that keeps them only retracing a vew of the waypoints, instead of cycling back to their original waypoint.

inner swallow
#

i don't remember if your unit uses CBA, but there's CBA version of task patrol too

#

but apart from that... i think they'll loop with the nearest waypoint

#

so maybe make sure the last waypoint is near the first?

#

(unless that's just an editor thing)

little eagle
#

Pretty sure it connects to the nearest. So just place the cycle waypoint onto the first one you want to loop to.

hollow thistle
#

^ that discord group. Have I missed something interesting? ๐Ÿ‘€

little eagle
#

Not really, no.

hollow thistle
#

๐Ÿค”

peak plover
#

what happend to commy ๐Ÿ˜„

hollow lantern
#

back in A2 there was this UAV Terminal Humvee. Is there a alternative for A3? So a scripting solution? So you don't need a UAV terminal on the player. Rather you are just at an object and can say "open UAV Terminal"

little eagle
#

What did the terminal do?

#

Just UAV?

hollow lantern
#

yeah opens the uav terminal so you could connect to a uav

austere granite
#

wait kommy is muted?

little eagle
#

Couldn't you just fill the vee's cargo with a lot of uav terminals?

hollow lantern
#

that is something I want to avoid

little eagle
#

Inconvenient, right?

hollow lantern
#

I want that the player is not able to carry one

#

so he is forced to be at that object

little eagle
#

Take it away from them if they leave the vehicle.

#

GetIn, linkItem terminal, GetOut unlinkItem, removeItem

hollow lantern
#

naah I just gonna play arround with sqf player action ["UAVTerminalOpen", player];

little eagle
#

Does this work when you have no terminal in the inventory?

hollow lantern
#

yes

#

ah no

little eagle
#

Well, then there you have your solution. Give the vehicle this script as addAction and you're golden. ... Oops.

hollow lantern
#

well you force him into the action. And after that his terminal will be removed. So he never knew that he had one

#

because he only can access the terminal via the addAction

little eagle
#

If you can figure out the "after that" part, then sure.

shadow sapphire
#

@inner swallow, no mods in my group. Thanks for the recommend. The waypoints are meant to be random. I think I'm approaching a solution, but we'll see.

inner swallow
#

yeah, wasn't sure if it was strict no mods or optional only

meager heart
#

for those waypoints ^ DEL-J's question maybe something like this

private _list = [/* coordinates */];

for "_i" from 0 to (count _list) - 1 do {
    private _wp = _group addWaypoint [_list select _i, 0];
    _wp setWaypointType "MOVE";
};

private _wpCycle = _group addWaypoint [_list select 0, 0];
_wpCycle setWaypointType "CYCLE";
little eagle
#

lgtm, but you really could use forEach instead of for loop if you're going to use select _i anyway.

#
private _list = [/* coordinates */];

{
    private _wp = _group addWaypoint [_x, 0];
    _wp setWaypointType "MOVE";
} forEach _list;

private _wpCycle = _group addWaypoint [_list select 0, 0];
_wpCycle setWaypointType "CYCLE";
meager heart
#

yep ^ even better option

shadow sapphire
#

Hmm... How do I grab a single character in a group?

Group select 1 or whatever. What's the correct way?

#

I don't know which wiki page to check. Tried group, leader, select, and units....

little eagle
#

selectRandom units _group

shadow sapphire
#

Okay! Wow. That's... easy. Almost what I wanted it to be, but I couldn't find an example. But I don't want it to be random necessarily. Any difference?

#

Select unit 1 group?

little eagle
#

Well

#
units _group param [0, objNull]
shadow sapphire
#

Hmm...

#

Okay, I'll see what I can do there.

#

So, I need to give a waypoint to this guy.

I've done it with named units, so I think that means its possible otherwise to give individuals within a group their own waypoints.

little eagle
#

You can give waypoints only to groups, not individual units.

shadow sapphire
#

How does the "DISMISS" waypoint scatter them? Must I break up the group and reform it as necessary? I believe you about not being able to issue waypoints to individuals, but I know that they can move independently of their group, because of a medic script I'm building.

little eagle
#

Most waypoints are internal magic.

shadow sapphire
#

I don't understand.

little eagle
#

Hard coded in C++, not editable by script.

#

There are a few scripted waypoints though.

shadow sapphire
#

Ah, okay, I see.

little eagle
#

Maybe that helps you putting something together.

meager heart
shadow sapphire
#

Hmm... There are actions that I've been able to do with my medic script that uses domove and dostop.

#

@meager heart, I'm familiar with the types, but the "DISMISS" waypoint allows the element to scatter. I want to replicate that myself. I think that domove is the key, as that's what I use in my medic script that has the medic depart his element to fix another group.

little eagle
#

You will probably not be able to copy paste and edit the behavior of DISMISS, because it is, iirc, a hard coded waypoint.

shadow sapphire
#

I didn't want its exact behavior anyway. If I wanted that behavior, I would just use that waypoint, but it doesn't work for my purposes.

little eagle
#

True. But you will have to do something from ground up, probably using doMove, doStop, unitReady etc.

shadow sapphire
#

I am building a recon patrol loop. A platoon makes a sweep, rests, and then makes another sweep, but DISMISS breaks the cycle, so I'm going to just have them domove, etc.

little eagle
#

Yes.

shadow sapphire
#

But I still need to select individuals from the group. Hmm... I may be able to select all of them and just have the domove positions random, but I'll have to have a catch to keep them from forming back up on the group leader when he takes his point.

#

Probably disableAI "path" in there...

#

So, something like this, but that works is the objective...

Select units _group domove getpos [(1 + round random 20), (getdir leader (_G3)) + round random 360]), 1];
 disableAI "paths";
 switchmove selectrandom "animations";```
inner swallow
#

i didn't follow things really but why not use sqf {_x bla bla} forEach (units group)?

shadow sapphire
#

Don't know. Why not?

#

Mostly because I am not good enough to refactor. I do exactly what I need line by line. I'll refactor later, when I'm literate.

little eagle
inner swallow
#

fair. just thought it would save the complicated selection process.

little eagle
#

The getdir part is also pointless, since you add random 360 anyway.

shadow sapphire
#

@inner swallow, you're definitely right, it's just a skill gap.

#

Good call, @little eagle.

#

That link for a random position is well over my head. I have to use this kind of thing often for my project, though. I may try to dig in and understand that, then just have a few functions once I figure it out that I can attempt to plug in. That must be down the line, though.

#

@inner swallow, how would I go about doing the foreach in this case?

inner swallow
#

erm i think

{ 
    _x doMove getpos [...];
    _x disableAI "PATH";
    _x switchMove selectrandom "animations"; 

} forEach (units _group);```
shadow sapphire
#

Even if it's not right, at least now I know what I'm working with. Thanks!

#

Hmm...

inner swallow
#

๐Ÿ‘๐Ÿฝ

#

that'll just cycle through each unit in the group

shadow sapphire
#

Perfect!

#

I might have to throw a timer or something in there to get them to their domove position before they stop moving, but ultimately, this is great to start with, thanks so much!

little eagle
#
private _units = units _group;
private _origin = getPosWorld leader _group;
private _delta = 360 / count _units;
private _start = random 360;

{
    _x doMove (_origin getPos [100, _start + _forEachIndex * _delta]);
} forEach _units;

This should make them scatter in a star pattern.

inner swallow
#

MVP ๐Ÿ˜ƒ

shadow sapphire
#

@little eagle, Very cool. I'll test this as well.

dry zephyr
#

@little eagle Nice link about shapes through distribution. I see you have gone Cyrillic.

little eagle
#

Jawohl.

meager heart
#

da

dry zephyr
#

Any opinions on the correct use of FSMs for mission coordination? I have the pattern that:

  • States create a task in their InitCode block.
  • Attached condition(s) check for completion of the task in their Condition block and complete the task in their Action block.
    Benefit is you can drag the arrow from Init entry node to any of the states and the mission starts from there (in terms of tasks).
    Haven't quite figured out a use for the PreCondition code blocks.
little eagle
#

Not a fan of FSM. They are hard to edit, and get diffs from.

#

They obscure what is going on in my opinion. No value in using them.

meager heart
#

atm trying to revive/remake old mission, there was fsm in b4 (beta times) ๐Ÿ˜€

dry zephyr
#

FSMs still do render as text and can be committed to source control with diffs as long you can tolerate the /%FSM<STATEINIT""">/""/%FSM</STATEINIT""">/ wrapping, but they certainly aren't as readable as SQF.

#

@meager heart the old mission had FSM and you are trying to remake it without FSM?

meager heart
#

yep

#

tolerate the /%FSM<STATEINIT""">/""/%FSM</STATEINIT
you're not using fsm editor ?

dry zephyr
#

I am using the FSM editor, but it outputs .fsm text files that are really C++ like files with hierarchy of classes that, for some reason, maybe to keep from SQF inside the quotes for class variables from messing up the ability to parse the C++ code, many of the variable values get wrapped with the extra comments.

#

At least with the scripted compile configuration - there may be other compile configurations that go to a non-text binary format.

#

Experimentation at this point. Trying different approaches. I've also had success with just Create Task, Set Task State, and Trigger modules in the Eden editor, though that can get a little wonky with lots of lines all over the place.

meager heart
#

never tried tasks modules... was enough troubles with just functions in b4

#

maybe they working now idk

dry zephyr
#

They work well. The challenge is that you need a Create Task module, Trigger, and Set Task State module for every task. Also, one weird behavior is that the notification for the next task assignment appears before the notification that the task you just completed is complete. So you see "B Assigned" and THEN "A completed".

#

Since you can't order the 'sync to' lines from the trigger to the Set Task State module of the current task and from the trigger to the next Create Task module, I haven't found a way to control which gets executed first.

meager heart
dry zephyr
#

That's what I use now in SQF behind the FSM. I don't put anything but simple logic in the FSM blocks and call out to SQF functions to create tasks, etc.

#

With the SQF/FSM approach, you can get the right order of "A completed" THEN "B assigned".

meager heart
#

if you're using that fsm only for tasks, imo that is pointless and overcomplicated ๐Ÿคท

dry zephyr
#

It could be. Just trying it out and gathering feedback at the moment because if I don't try it, I wouldn't know if it is something that could be useful.

meager heart
#

oh i see

#

well... good luck with that then ๐Ÿ˜€

unborn ether
#

@little eagle wtf commy? ๐Ÿ˜„

dry zephyr
#

I once saw a complete (?) list of all files in a mission folder that were executed/opened when a mission starts (like init.sqf, etc.). Now I can't find it. Anyone know where I can? Nevermind, found it: https://community.bistudio.com/wiki/Event_Scripts

tiny wadi
#

Everytime I update a public variable do I need to call publicVariable "myVar"; again?

merry canyon
#

Yessir.

little eagle
#

You don't have to, but otherwise it will no longer be the same everywhere.

little eagle
#

shush

meager heart
#

btw ะบะพะผะผัƒ that is "to whom" with extra m, commander > ะบะพะผะฐะฝะดะธั€ ๐Ÿ˜€

little eagle
#

I know, but the average speaker here only knows the Latin alphabet.

#

So compromises have to be made.

meager heart
#

๐Ÿ˜„

little eagle
#

And I like "whom". Sounds sophisticated and a bit pretentious.

half relic
#

"Sounds sophisticated and a bit pretentious"

#

Sounds like Commy2 alright ๐Ÿ˜„

winter rose
#

ooooooh! ๐Ÿ˜„

peak plover
#

๐Ÿค”

velvet merlin
#

does class Eventhandler work for buildings? editor placed or even as terrain object?

still forum
#

depends on which eventhandlers. I'd say init should work yeah

velvet merlin
#

thanks. BC is too "imprecise" as this is about partial destruction

#

i guess otherwise on init do a addEH forEach allTerrainObjects "House" basically

still forum
#

Better question. What are you trying to do?

sand anvil
#

Hey! I'm trying to create a MP mission where 2 players have conversation with KbTell. Player1 = in this case the host and has all the voice lines working, but when player2 says something to player1, it doesn't play neither the sound or display the text of the dialogue.

But if player2 is not controlled by a player, then the voice line works again.

Does anyone know what's going on? Is it possible to have voiced dialogue between players?

still forum
#

I'd say this sounds like locality. Where/how is the player2's "say something" script executed?

sand anvil
#

It's a ingame trigger with execVM

velvet merlin
#

@still forum handleDamage on buildings to use scripting for custom handling
some is done already via model.cfg and animations, yet door and windows cant be done this way it seems (due to normal animations with opening or breaking)

sand anvil
#

Like when player enters the zone it execs the .sqf file

still forum
#

so. The script is executed on both players then?

leaden quiver
#

Question: Is there a way to set the amount of space in a box with a line of code in the item's init field in the eden editor?

sand anvil
#

I suppose so because everything else is working until the 2 players try to have a convo

#

hq1 KbAddTopic ["introduction","hq1.bikb","",""];
player1 KbAddTopic ["introduction","hq1.bikb","",""];
player2 KbAddTopic ["introduction","hq1.bikb","",""];


hq1 KbTell [player1,"introduction","hq1"];        //playerLine_1 - Class name of the line defined above
waitUntil {
hq1 KbWasSaid [player1,"introduction","hq1",8];    //Search in 3 last seconds
};


player1 KbTell [hq1,"introduction","hq2"];    
waitUntil {    
player1 KbWasSaid [hq1,"introduction","hq2",1];    //Search in 3 last seconds
};
sleep 1;
        
player2 KbTell [player1,"introduction","hq2"];
#

Here's the thingy

#

last line don't work

#

unless player2 is not controlled by a player

still forum
#

@leaden quiver no

leaden quiver
#

Well shit. I have a box of items in a mission but it won't let you pull anything out of it.

still forum
#

Interesting.. Biki doesn't say.. But try this
player2 KbTell [player1,"introduction","hq2"];
->
[player2, [player1,"introduction","hq2"]] remoteExec ["kbTell", player2]

#

does player2 hear himself talking? Does player2 hear player1 talking?

sand anvil
#

I'm pretty sure I tried remoteExec, but I'm gonna try again

#

No he doesn't

#

he's completely mute

#

Not even text is displayed

#

from .bikb

radiant zenith
#

Soon we'll know if that works, I think we typoed it earlier.

still forum
#

player2 should atleast also hear the hq and player1 tho ๐Ÿค”

sand anvil
#

He does

#

It's really weird

#

Holy moly

#

It fucking worked!

#

Thank you so much ๐Ÿ˜„

still forum
#

Okey now! Be very careful! slowly walk away backwards and make sure to never touch it again

radiant zenith
#

Atleast he's very confident it works, we're testing in 1 sec

sand anvil
#

I literally tried to google all kinds of shit, but nothing came up

#

Thank you so much again, my brain was melting because of this

peak plover
#

what event will grenades and explosions trigger

#

When they explode

still forum
#

dont think any. Maybe Delete

meager heart
#

maybe you can check when projectile will be null with fired... so if that was grenade null > explosion ๐Ÿค”

digital jacinth
#

Is it possible to register CBA settings for eden with mission scripts alone? I mean while being in the editor and setting those up.

astral dawn
#

I'd also like to know how to detect explosives exploding

#

I think the explosive can also go Null when someone picks it up

#

Except for grenades

#

@digital jacinth As I remember CBA has a cba_settings.sqf file which it will parse at mission start and apply settings

digital jacinth
#

Not really what I mean, I do mean the Settings you can set vie "Addon options" in eden. I kind of want to move away form setting values in script for utility scripts of mine.

astral dawn
#

Oh... I don't know, sorry.

still forum
#

as long as you set them at preInit you can do that

#

aka description.ext CfgFunctions preInit

digital jacinth
#

๐Ÿค”
as in

class addCBASetting {preInit = 1;};

?

still forum
#

ye

shadow sapphire
#

Hey, could someone tell me the working version of:


hint GM getPos;
digital jacinth
#
hint str(getPos GM);
mint kraken
#

When is Killed and Respawn exactly called?

#

Is killed when the player has health as 0?

#

And respawn when they spawn in? or when they click respawn?

shadow sapphire
#

@digital jacinth, thanks!

digital jacinth
#

@mint kraken killed eh fires if the unit has 1 damage and dies, respawn is when the player respawns and not when they click the respawn button.

mint kraken
#

Alright thanks

#

@digital jacinth I am trying to do an incapacitated mode, when someone dies and I do damage to 0, then set them as incapacitated. If someone shoots them again and their damage is 1 will the Killed be called again?

digital jacinth
#

if the killed EH fires, the unit is dead and you cannot "save" that unit anymore

#

you need to do it with another EH such as Damaged or handleDamage

digital jacinth
little eagle
#

What did you do? They should appear at first load too when you open the mission.

digital jacinth
#

i added the cfgfunction entry as usual

class diw_unknownwp {
    tag="diw_unknownwp";
    class functions {
        file = "scripts\diw_unknownwp";
        class addCbaSettings {};
        class init {postInit = 1;};
    };
};

and then call it with a Extended_PreInit_EventHandlers like so

class Extended_PreInit_EventHandlers {
    class diw_unknownwp_settings {
        init = "call diw_unknownwp_fnc_addCbaSettings";
    };
};
little eagle
#

Is this addon or mission?

digital jacinth
#

Mission

little eagle
#

Replace:

#
        init = "call diw_unknownwp_fnc_addCbaSettings";
#

with:

#
        init = "call compile preprocessFileLineNumbers 'scripts\diw_unknownwp\addCbaSettings.sqf'";
#

And remove the CfgFunctions entry.

#

CfgFunctions is not reliable in 3den, especially when defined in a mission.

digital jacinth
#

So it is a load order issue then?

#

Ah

little eagle
#

No, CfgFunctions is just not working correctly.

#

Sometimes they're defined, sometimes not.

#

Depends on whether or not you load the map, vs. load a different mission on the same map, and such weird conditions.

#

diw_unknownwp_fnc_addCbaSettings was just undefined, and the script therefore not executed.

digital jacinth
#

That is good to know, thanks

little eagle
#

If this were an addon, you could write:

#
        init = "call (uiNamespace getVariable 'diw_unknownwp_fnc_addCbaSettings')";

to fetch the function from the functions cache.

#

But the cache will not have this function when you load the mission for the first time iirc, so you have to use preprocessFile etc.

digital jacinth
#

I am. Using the same setup that I've posted in my add on. So far that worked. That whole thing seems. Weird

little eagle
#

Because it's only in mission config CfgFunctions.

tough abyss
#

how would i use a function with a parameter

#

call what?

#

like player addAction["Test", myFunc[var]];

#

no how to use function parameter like in c++ you just make void myfunc(int a, int b) { ...code } and use it with myfunc(10, 5); as an example

#

it was an example ๐Ÿคฆ

#

you can bind a function to an action

#

so i've tried it like you said but i getting a error

#
    {
        player addAction[str(_x), [str(_x)] call Options];
    }forEach allUnits;
};```
#

error type number, expected string code

#

i thats not what i want

#

it says expected string code but i convert it already to a string

#

this is mostly a bug in the script engine

#

just help me

#

i gave you my code + error

#

without parameter it works fine like player addAction[str(_x), Options];

#

your parameter code seems to be wrong

#

so why is it working without then?

#

without your code to use parameter

#

this is not what i asked for omg

#

then maybe read?`

#

thats not my code if it use that it makes nothing

#

also that what you provided is using inline function and not a own function thats declared outside

#

its not its pure shit it isnt working it makes nothing than shit

#

i get it now

#

just saw your rank

#

sqf is a piece of shit ugliest syntax ever

#
    params ["_player"];
    removeAllActions player;
    player addAction["Kill", {_player setDamage 1;}];
};
getUnits = {
    {
        player addAction[str(_x), [str(_x)] call Options];
    }forEach allUnits;
};``` just tell me now how tf do i get this working
#

you dont call any functions there thats not what i asked 10 time now

#

now it says undefined variable

#
    params ["_player"];
    removeAllActions player;
    player addAction["Kill", {_player setDamage 1;}];
};
getUnits = {
    {
        player addAction[str(_x), Options,[str(_x)];
    }forEach allUnits;
};```
#

what?

austere granite
#

player addAction[str(_x), Options,[str(_x)];

#

player addAction[str(_x), Options,[str(_x)]];

tough abyss
#

i fixed that already just sendet the old version from notepad

#

the error is _player is undefined what doesn't make sense since i defined _players as a parameter

austere granite
#

Nah, you set it as a parameter in Options

#

you didnt set it as a parameter in { _player setDamage 1 }

#

also

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

as commy said, _arguments is the 4th parameter, but you use use it as first

#

so that would also be incorrect as second thing

tough abyss
#

i never used _arguments

austere granite
#

i never used _arguments
[str(_x)]

#

pick one

tough abyss
#

this is parameter

#

it's easier to learn something with a nice and clean syntac

#

syntax#

austere granite
#
player addAction[str(_x), Options,[str(_x)]];
[player, player, 123, [str _x]] call Options
#

thats what the engine is doing

#

it's calling Options with [_target, _caller, _actionID, _arguments, Arguments is in your case [str _x] (which is a string, so it won't result in a unit datatype to kill btw)

tough abyss
#

btw kommy also used it like me

austere granite
#

No he didnt

tough abyss
#
    "TEST 123",
    _function,
    _parameters
];``` what he wrote
#

because i don't need 2

#

why would i need to when i only use one?

austere granite
#

Because you weant it to work

#

I assume

#

And if you look at commys example and understand parameters in SQF then you'll understand

tough abyss
#

i only need _x so i only need to use one parameter makes sense doesn't it

austere granite
#

Except

#

You didnt read the addAction wiki

#
player addAction[str(_x), Options,[str(_x)]];
[player, player, 123, [str _x]] call Options
tough abyss
#

i did but it's so shitty documented that you can't understand anything

austere granite
#

Options(player, player, 13, [str _x])

#

Understand now? ๐Ÿ˜„

#

I mean if you're saying that the order is unpredicatable in SQF, then sure i'll go along with that, but if you look on the wiki page it does say in which order they go

tough abyss
#

i also looked into functions but these guys don't even give an example of how to use function with parameter

#

they just show to make a function with parameter

#

but never show how to actually use them

austere granite
#

[1, 2, 3] call { params ["_one", "_two", "_tree"]; hint str (_one + _two) }

#

there now you know SQF!

tough abyss
#

because bohemia seems to only care about $

austere granite
#

k lol

#

i made mistake ๐Ÿ˜ฆ

#

i mean Bircko all you need to understand is literally this line
[1, 2, 3] call { params ["_one", "_two", "_tree"]; hint str (_one + _two) }

#

What you are trying to do is ``[1, 2, 3] call { params ["_three"]; hint str (_three) }`

#

but... _three would be 1 then because thats the first arugment

#

I don't know C++ but i assume its the same there, its the same in python at least? ๐Ÿ˜„

tough abyss
#

explain why do i need more than one parameter if i want to use only one variable it's like making a simple calculator function where you add 2 numbers you obviously need only 2 parameter and then return the result

austere granite
#

Because the engine calls it with that many paramaters

tough abyss
#

apprently arguments is the third parameter so whats wrong

austere granite
#

๐Ÿค”

tough abyss
#

object addAction [title, script, *arguments*, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]

austere granite
#

i mean if you read 2 lines further

ruby breach
#
this addAction ["<title>", { params ["_target", "_caller", "_actionId", "_arguments"]; }, [], 1.5,  true,  true,  "", "true",  _target _this 50, false, "", ""]; //Default Values ```
austere granite
#

it'll tell you that this is how arguments are called from addAction

player addAction[str(_x), Options,[str(_x)]];
[player, player, 123, [str _x]] call Options
tough abyss
#

why 2 times player if i never used player in the paramters why 123 if i never used 123 in the paramters

#

???

austere granite
#

like if you just used commys couple lines it would be gut already and that's also how the wiki says usihng

ruby breach
#

Seriously, just read the addAction page

austere granite
#

Because that's how addAction works

#

it says so on the wiki lol

ruby breach
#

addAction passes more paramters than you define.

austere granite
#

it is described properly just fine, addAction page is 100% reliable

tough abyss
#

thats not how paramters supposed to work if a paramter is not given and it has no default value it will cause an error and not add random things

austere granite
#

okay buddy

#

i mean that's not an SQF thing either is it?

tough abyss
#

it should work like any other programming language

austere granite
#

okay

hollow thistle
#

๐Ÿคฆ

#

And it works.

austere granite
#

So what you're saying is that if i have a python function, i can't pass it through to another function and add/remove some arguments in between there?

#

i guess python is not a real language now

#

oh shit ican do that in C++ too? WTF C++ CONFIRMED NOT REAL LANGUAGE

hollow thistle
#

Rip javascript ๐Ÿ˜‚

tough abyss
#

c++ dont add 3 random paramaters when i only say it should have 1

austere granite
#

fuck you're dense

ruby breach
#

SQF doesn't either

#

addAction however, does

tough abyss
#

void kill(player); in c++ this would be one parameter and sqf just adds 3 parameters randomly there

ruby breach
#

(Only when you pass a function and not code)

hollow thistle
#

But you are passing your function as handler to engine functions.

tough abyss
#

said the muted guyx

austere granite
#
[1, 2, 3] call {
    params ["_one", "_two", "_three"]; // -- notice how argumetns aren't magically added
    ["fuck", "you're", "dense", _one, _two, _three] call {
        params ["_one", "_two", "_three"]; // -- REEEEEEEEE NOT REAL LANGUAGE!!! WHERE DID THESE ARGUMENTS COME FROM!!!
    };
}
ruby breach
#

If you were to do sqf player addAction["Do the thing",{[arguments] call gna_fnc_doTheThing},"". . . you'd probably get closer to what you want

austere granite
#

no he wouldnt lol, that's not even correct :p

hollow thistle
#

Like you if you pass your function to jQuery each you always receive index and value as the library calls your handler function with these arguments.

austere granite
#

jQuery isn't real though!

ruby breach
#

I'm too lazy to do proper syntax. Basically call the function in code with your parameter, rather than "fn_func,argument"

tough abyss
#

just make my function working and maybe i get it then

austere granite
#

the muted guyx did for you

#

like 5 times ๐Ÿ˜ƒ

hollow thistle
#

No offence but if you can't understand that and you are refusing to read what others have written you should look for help somewhere else.

austere granite
#

and explained why it wasnt working

#

and then also explained what you're missing on the page that you're looking at that supposedly doesnt tell you how it works

#

Kommy is my favorite guy honestly

tough abyss
#
    params ["_player"];
    removeAllActions player;
    player addAction["Kill", {_player setDamage 1;}];
};
getUnits = {
    {
        player addAction[str(_x), Options,"",[str(_x)]];
    }forEach allUnits;
};``` this doesn't even look simular to his "solution"
austere granite
#

that's because your shit is broken

#

and his shit is not

#

LOL!

tough abyss
#

lmao there is not even the usage of setDamage so tell me how would his be working

#

๐Ÿคฆ

austere granite
#

๐Ÿค”

#

aksually i guess thats broken too, Kommy not my favorite guy anymore

tough abyss
#

i know how to do that that still doesn't explain how to use it in addaction....

austere granite
#

well i expect him to want it to always show right?

#

that would be limited on range to _target

#

so it would only show within 15 meters

tough abyss
#

and _x addaction would basiclly give everyone this action

#

not only you

austere granite
#

locality , so no

#

he's adding it on the player for all other units

tough abyss
#

also _target is no where defined

austere granite
#

like that doesnt make any sense to me.... ๐Ÿ˜„

#

but its what he wrote, not me!

#

yes it is

tough abyss
#

it should kill a selected unit in the action thing

#
    params ["_player"];
    removeAllActions player;
    player addAction["Kill", {_player setDamage 1;}];
};
getUnits = {
    {
        player addAction[str(_x), Options,"",[str(_x)]];
    }forEach allUnits;
};``` is it so hard to understand what i try to do????
austere granite
#
JustFuckMyShitUpFam = {
    params ["_fuck", "_this", "_gay", "_earth"];
    removeAllActions player; // This is terrible to do, l2compatibility
    player addAction["Kill", { params ["", "", "", "_shutup"]; (_shutup select 0) setDamage 1;}, [_earth]];
};
reeeeeeeeee = {
    {
        player addAction[str(_x), JustFuckMyShitUpFam,"",[_x]];
    }forEach allUnits;
};
call reeeeeeeeee; // happy now
#

there

#

i fixed it for you okay

#

@tough abyss we usually teach people how to fish

#

i think literally every line has a mistake

#

but i fix np adanteh best guy 2018

#

kek

#

i fix np

#

i tried staying as close to the original as i could

tough abyss
#
    params ["_player"];
    removeAllActions player;
    player addAction["Kill", {_player setDamage 1;}];
};
getUnits = {
    {
        player addAction[str(_x), Options,[str(_x)]];
    }forEach allUnits;
};

player addAction["Units", getUnits];``` i fixed now and still not work
austere granite
#

FUCK YOU

#

;_;

#

i mean

#

just make my function working and maybe i get it then

#

i did make your function

#

use iit now

tough abyss
#

i want to make a list of all units on and then when i select one i get the option to kill the selected unit

#

and thats what my script should make but when i got it to work it only killed me but not the selected target

meager heart
#

๐Ÿฟ

austere granite
#
Options = { // shittyfunction name, learn to prefix
    params ["_player"]; // incorrect params, _arguments is the 4th param
    removeAllActions player; // Would fuck other actions up, basically never use this command its shit
    player addAction["Kill", {_player setDamage 1;}]; // what is _player? NOTHING IS WHAT
};
getUnits = { // shittyfunctioname pt2.
    { // This is actually correct
        player addAction[str(_x), Options,"",[str(_x)]]; // str _x is wrong, you want to pass the object, not a serialzied name of the object
    }forEach allUnits; // no space between bracket and foreach, disgusting honestly
};
#

there

tough abyss
#

@little eagle it does when the player use the added action

austere granite
#

even gave you comment on original code

tough abyss
#

setDamage is basiclly same as getUnits so is setDamage also a shitty function name

austere granite
#

setDamage also a shitty function name yes, setDammage much superior

#

The thing is that those are engine commands, yours are sqf functions, they work different and have different syntax when being called, thats usually why you want to call them differently

#

Also if you have overlap between other mods shit will have a high chance of fucking up, plus if some command gets added with the same name as your functions, then your functions will also break

tough abyss
#

@little eagle thats not what i asked for i want to select a unit than it goes to a submenu in addaction where i can have different options for a unit like kick it from the server kill it or mute it

austere granite
#

i mean jonas

#

you realize i already typed exactly what you want right

tough abyss
#

you just added commends lol

austere granite
#

2fast4u

#
JustFuckMyShitUpFam = {
    params ["_fuck", "_this", "_gay", "_earth"];
    removeAllActions player; // This is terrible to do, l2compatibility
    player addAction["Kill", { params ["", "", "", "_shutup"]; (_shutup select 0) setDamage 1;}, _earth];
};
reeeeeeeeee = {
    {
        player addAction[str(_x), JustFuckMyShitUpFam,"",[_x]];
    }forEach allUnits;
};

player addAction ["units", reeeeeeeeee]
#

here

#

i mean, it's going to be fun when the // This is terrible to do, l2compatibility comment clicks

tough abyss
#

@little eagle if i wanted to do everything in one function i wouldn't even be here because that i can do myself omg

austere granite
#

๐Ÿค”

digital jacinth
#

is there a physics enabled invisible object in the game which I can attach some simple object to and throw in a direction? So far I am trying "WeaponHolderSimulated", but that gets auto deleted as it does not contain any items.

cosmic kettle
#

The UAV's are the smallest iirc.

young current
#

grenades

digital jacinth
#

it would probably weird that there are 2 items flying away.

hollow thistle
#

hideObject

cosmic kettle
#

Hide the physics item, yeah ^

hollow thistle
#

But care it has local effect

digital jacinth
#

wouldn't that looks weird in MP then?

#

yeah that is what i was thinking

#

well

#

yeah

hollow thistle
#

hideObjectGlobal exists too.

#

^ call on server only, works for JIp

cosmic kettle
#

Am still wishing BI would allow you to attach ropes to non-physx objects ๐Ÿ˜ฆ

digital jacinth
#

jip is not really a problem as it will be delted after a few seconds.

meager heart
#

maybe just "groundweaponHolder" ๐Ÿค”

digital jacinth
#

yup

#

the one with physics just deletes itself

tough abyss
#
    params ["_p"];
    removeAllActions player;
    player addAction["KillPlayer", 
        {
            params ["_target", "_caller", "_actionId", "_arguments"];
            _arguments params ["_p"];
            _p setDamage 1;
        },
        [_p]
    ];
};
getUnits = {
    {
        player addAction[name _x, Options,[_x]];
    }forEach allUnits;
};

player addAction["Units", getUnits];```` your methode doesnt work at all it just kills myself
hollow thistle
#

You are using params wrong in first function

#

Your arguments array is passed as fourth argument to action handler function.

#

First three arguments are supplied by engine as described on wiki.

#

You need to extract the unit from arguments array like in your internal addAction function. Currently you are passing _caller (you) as _p

digital jacinth
#

๐Ÿค” nah the simple object will be still stuck mid air.

private _groundHolder = createVehicle ["WeaponHolderSimulated", position ace_player, [], 0.5, "CAN_COLLIDE"];
_groundHolder addItem "HandGrenade_Stone";
[_groundHolder, true] remoteExec ["hideObjectGlobal", 2];
private _dummy = createSimpleObject[_model,getPosASL ace_player];
_dummy hideSelection ["zasleh",true];
_dummy attachTo [_groundHolder,[0,0,0]];
_dummy disableCollisionWith ace_player;
// _dummy setDamage 1;
_groundHolder disableCollisionWith ace_player;
_groundHolder setPos (ace_player modelToWorld [0,.2,1.2]);
private _dir = getdir ace_player;
private _speed = 1.5;
_dummy setVelocity [_speed * sin(_dir), _speed * cos(_dir),4];
#

after 10 seconds both _dummy and _groundHolder get delted, but before that they stop

#

oh damn! i thought i did

#

i am blind

hollow thistle
#

Simple objects have no physics afaik

digital jacinth
#

ye the do not

#

that is why i attach it, but then of course i add the velocity to the wrong object

#

left over, really