#arma3_scripting

1 messages ยท Page 510 of 1

frozen knoll
#

in which case to achieve what you want you will just have to use script form

#

ive never tested though just wondering if you could place that code in the init of a "dummy" mapobject thats placed and called before the rest

vapid drift
#

I tried that with a logic and it still generated the error

#

it's probably I did something wrong though...

languid tundra
#

Define a function in cfgFunctions with preInit = 1;

vapid drift
#

ah yeah, that should work fine

frozen knoll
#

yeh nice

vapid drift
#

Disregard

#

I didn't adjust the path properly

#

Perfect Thanks @languid tundra , @frozen knoll , and @astral dawn

vernal mural
#

waitUntil{ (_target doorPhase _door) == 1 }; is raising a "generic error in expression"
given that :

  • _target exists
  • _door is a valid door on _target
  • I'm utterly tired

What am I missing ?

languid tundra
#

Are you sure you are running the script in scheduled env?

vernal mural
#

Gosh I'm an idiot...
Thanks mate, I think it's time to sleep !

tough abyss
#

Can only sleep in scheduled

winter rose
#

^ ๐Ÿ˜„
"oh my, I didn't schedule my sleep I am gonna be sooo tired tomorrow morning!"

austere hawk
#

welp, you just read my mind...

knotty arrow
#

anyone uses armadev on visual studio code?
i am getting this A proper PREFIX (x\your_addonname) is required for life_server\addons\life_server(editado)
and i have a $PBOPREFIX$ in the folder life_server with "prefix=life_server"

stable quest
#

Best way to restrict ability to fly to a certain player slot?

#

I did a set variable and if false eject driver but it didnโ€™t work

drowsy oak
#

I created a addon for my vehicles variations. For now, just a different skin on a Quadbike. It works fine and I can see the vehicle in the editor and the skin works fine. However, when I load it up on my test server and spawn the vehicle in from a server script, it has a different skin. I checked and the addon is loading both on server/client (can see the config). If I search area objects, its my custom class. I'm stumped. Everything seems to be there, but the skin just doesn't show up on the multiplayer version. Heck, I figured the vehicle would be invisible or some such if the skin didn't work, but its not, its black. Anyone had experience with this? I just got done testing it in multiplayer editor and the skins shows up there.

slim oyster
#

slot can just be a unit varname check

stable quest
#

I did that, it didnโ€™t eject them, should I just use the vehicle init instead of mission folder init?

winter rose
#

@stable quest can you show your code?
if it is short, in this chat within
```sqf your code here``` tags please, if not, pastebin.com

viral ice
#

is there a way to change the render circle, into a render "ellipse"?

high marsh
#

you mean the marker shape?

viral ice
#

@high marsh not sure what that is. but i mean in game, the render bubble around the character that causes things to render in at a certain distance.

high marsh
#

has nothing to do with "view bubble" and more about view distance and current lod of the object you're looking at

viral ice
#

@high marsh ok. im working on a city map with 200 meter buildings, and in my mock testing i realize i need more horizontal rendering but less vertical rendering.

high marsh
#

That doesn't make a lick of sense. The answer is no.

opaque birch
#

@viral ice your making a map? nice

viral ice
#

@opaque birch trying to.

opaque birch
#

@viral ice We could partner,

#

And do a carrier mod.

viral ice
#

@opaque birch no thanks.

opaque birch
#

why not?

viral ice
#

@opaque birch 1st im working on a dayz Enfusion engine map, in hopes i can port it to A4. next unless i can figure out a way to get smaller objects like desk, chair, and beds to load correctly and the way i want, the idea is pointless. lastly i don't work well with others.

thorn saffron
#

How do you properly remove a pylon weapon via script? When I use this:
(vehicle player) setPylonLoadOut ["pylon1", ""];
I end up with pylon model gone, but the weapon is still on the vehicle, able to be chosen, but with 0 ammo

thorn saffron
#

Ok so, if you use the setPylonLoadOut then it does remove the magazine, it is reported as just "" . The issue is not with the magazine, but with the weapon staying on the vehicle.
I also just checked, the weapons do stay, I used the setPylonLoadOut on both of the AH-9's pylons and the DAR launcher was still there with 0 ammo. The pylon magazines are gone, but the weapons command still shows that the helo has the DAR launcher weapon

tough abyss
#

If you do this by mistake if (_condition) then {code true...} then {code false...}; you will get no error message and your "if" will not work correctly. LOL, i lost some time on that.

thorn saffron
#

How do I change data type from string to ... uh data? Basically I want to go from "CUP_PylonPod_CMFlare_Chaff" to CUP_PylonPod_CMFlare_Chaff

robust hollow
#

call compile "CUP_PylonPod_CMFlare_Chaff" will return the value of CUP_PylonPod_CMFlare_Chaff if it is a variable in the namespace ur executing in.

#

is that what ur after?

#

getvariable would also work (and is probably the better way to do it)

viral ginkgo
#

hi guys, Iam trying to exit a waitUntil loop in 2 different ways when 2 different conditions are met

#

waitUntil {
sleep 1;
if (_mainVehicle distance _position < 50) exitWith {[_location,"supply",100] call AS_location_fnc_set};
if ((_mainVehicle) getHitPointDamage "hitEngine" > 0.95) exitWith {true};
};

#

this is forever stuck in the loop, on condition 1 if (_mainVehicle distance _position < 50) exitWith {[_location,"supply",100] call AS_location_fnc_set}; id like to execute a code after exitWith

#

on condition 2 only exit the loop without any code executions

thorn saffron
#

waitUntil waits until it returns true

#

exitWith ends the script

#
waitUntil 
                    {
                    _crewCargoAndFFV = fullCrew [_veh, "", false] select {_x select 1 == "cargo" || _x select 4} apply {_x select 0};
                        sleep 1;
                        _crewCargoAndFFV isEqualTo [];
                    };```
#

you need to add a check at the end that will return true once the conditions are met

robust hollow
#

or just return true after the function call

viral ginkgo
#

hm, that makes sense, however Id like to check the distance and damage on loop and exitWith different code

#

so I shouldnt use waitUntil in this case?

thorn saffron
#

waitUntil halts the script until its completed

#

so you still need to return true on it

viral ginkgo
#

so what I expected from the waitUntil was it checking the 1st if and if true it would exec the code after exitWith, then checking the 2nd if to get the damage and then just exiting the scope if condition met

#

so it just doesnt simply work that way, right?

thorn saffron
#

waitUntil executes the code on a loop until it it runs to true at the end

viral ginkgo
#

ok understand

#

thanks

thorn saffron
#

look at my code above: it waits until all soldiers get out and keeps checking if there is anyone left, if there is none, the check at the end returns true and the loop ends

viral ginkgo
#

ok so I just dont want to use waitUntil in this case I guess

#

would you have any idea on how to set it up that it would check for these 2 conditions on a loop and then exec different code when any one of these is met?

#

so it would constantly check if either the vehicle is close to the position or dead? and then exec different code?

thorn saffron
#

use II in an if check to get OR condition
if ((condition1 = true) II (condtion2 = true)) then {

#

ok the verical lines do not show up in discord

#

bascially the II

#

you get the I by using Shift+back slash on the keyboard

viral ginkgo
#

I had it set up this way before, but I want to exec different code on different conditions, not same code if any of the conditions is met :/

thorn saffron
#

then case

#

that if condition would be only to return true if any of the condition is met, in order to end the waituntil loop

#
if ((condition1 = true) || (condtion2 = true)) then {
true;
} else {
false;
};
#

Ok now is my turn:
Why does this not remove the weapon from a vehicle?

(vehicle player) removeWeaponGlobal "CUP_Vmlauncher_FFAR_veh";
#

ok I figured it out, removeWeaponGlobal does not work on vehicle pylons, the removeWeaponTurret does work though

#

how do I deal with nestled for each loops like this one:

 {
 _weaponToRemove = getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon");
     {
     _veh removeWeaponTurret [_weaponToRemove, _z];
     } forEach _vehTurrets;
 } forEach _pylonsToRemove;
thorn saffron
#

Turns out you don't need to do anything with nested forEach loops, you just use the _x for the nested one as well

winter rose
#

each _x is in its scope, but if you want to access both in the inner forEach, you will need a temporary var yes

brave jungle
#

This is driving me up the bloody wall.

I want to load the ORBAT from the main menu.
I looked into BIS's code and saw they assign a script to uiNamespace and then spawn it. So I tried this. Mine doesn't work unless it's done in the editor.

class RscDisplayMain: RscStandardDisplay
{
    class Spotlight {
        class Viking_Welcome {
            text = "VKN Offical Mod";
            textIsQuote = 0;
            picture = "\VKN_Misc\VikingLogo512.paa";
            video = "\VKN_Misc\VKNLOGO_512x.ogv";
            action = "disableserialization; _script = [] execVM '\VKN_Functions\Functions\fn_ORBATCreate.sqf'; _code = uiNamespace getvariable CUR_bis_fnc_credits; [_code] spawn _code;";
            actionText = "Developed By The Viking PMC Dev Team";
            condition = "true";
        };
    };
};

I first made it a function and tried it that way. Didn't work.
I then tried to do it all in a function, this didn't work either.
I looked at BIS's code and did the uiNamespace way, this kinda worked, but I only got it to work in the debug console.
The code in CUR_bis_fnc_credits:
https://pastebin.com/2L9k07WM
I think, as per, i've looked at it too long and am missing something super obvious, but that's what you lot are for (help :D)

astral dawn
#

I need some clarification about assignAs*** and assigned*** commands.
I've noticed that assignAsGunner can be replaced with assignAsTurret with proper turret path.
Is it true that absolutely all "gunner" seats are in fact "turrets"?

languid tundra
#

I would say yes. Drivers, gunners, commanders all have a corresponding turret path.

astral dawn
#

...drivers?

#

Allright let's check quadbike:
fullcrew [cursorObject, "", true];
[[<NULL-object>,"driver",-1,[],false],[<NULL-object>,"cargo",0,[],false]]

#

So, both cargo and driver seat have [] as turret path

languid tundra
#

Driver has [-1], but it's not reported by fullcrew I guess.

astral dawn
#

Well I can't make him get in as driver neither with assignAsTurret [] nor with assignAsTurret [-1]

languid tundra
#

No idea about that particular command. I used [-1] successfully with magazinesTurret, for instance.

astral dawn
#

You see, I was going to write some functions that will assign units to vehicles plus do some other things.
I think I can just remove "assign as gunnerr" function from my function list because it can be replicated with "assign as turret" ๐Ÿคท @languid tundra

tame axle
#

I have a script called from init.sqf, to modify case loadouts. Works fine on hosted server, but not on dedi one. Any ideas cheers.

if (!isServer) exitWith {};
_crates = [ammoCrate01,ammoCrate02,ammoCrate03,ammoCrate04];
{
clearitemcargo _x;
_x additemcargo ["rhs_mag_maaws_HE",4];
}foreach _crates;
astral dawn
#

Try addItemCargoGlobal
And probably clearItemCargoGlobal
@tame axle

languid tundra
#

Yeah, I guess gunner and commander should work, the rest with the cargo command. Not sure about the driver though.

slim oyster
#

For storing changed/new variables in a CBA perFrameHandler, is the best practice to store them in the passed array params? (setting the params array var values for changed/stored values) or is there a better way?

frigid raven
#

Is there an event or something to hook on when a player get's sighted by an enemy?

#

or attacked

astral dawn
#

@frigid raven No, as I know. You most likely will have to poll side knowsAbout ..., targetsQuery and such commands

frigid raven
#

ah alright thx

astral dawn
#

@slim oyster Do you mean that you must change some variables which will be accessed by the per frame handler without re-adding the same PFH with new _args value?

slim oyster
#

I am using a PFH as a loop that checks various conditions from multiple frames/passes of the PFH, and so far the only way I have successfully stored those variables is through set on an entry in a params array or through global vars.

#

I have looked through some ace 3 modules and they seem to use the params method, but I was wondering if there was a different standard/method as I am storing many vars and I don't know if this is efficient

celest plume
#

@astral dawn A moment of your time please when you are available

astral dawn
#

Me? o_O I'm right here

#

@slim oyster I guess it's fine ๐Ÿคท I share data through a common array sometimes as well, it's a nice feature of an array that you can use it like a pointer to your data.

celest plume
#

Copy!
This is in the "on activation" part:

0= [] spawn {
player in thislist;
while {true} do {
Mortar1 commandArtilleryFire [getposatl (thislist select 0), "rhs_mag_3vo18_10", 1];
};
sleep 5;
};

I am trying to get this script to fire at the triggering unit, but I keep getting an error that "thislist" is an undefined variable.

When I use "Mortar1 commandArtilleryFire [getposatl (thislist select 0), "rhs_mag_3vo18_10", 1]; " by itself, it fires fine. How can I fix this?

#

This is used in a trigger btw

astral dawn
#

I thought you had a different name?

#

Some guy was asking about a similar thing before ๐Ÿค”

celest plume
#

Aha. Well, this script is sort of popular for some reason....

#

Did you find a solution?

astral dawn
#

Oh nvm I guess the other guy was talking about a different thing

#

I have no idea what thislist is, it's some global variable

languid tundra
#

0=[...] what does that even mean? ๐Ÿ˜„

astral dawn
#

even more, there is no use to use in command if you don't use the result anywhere else

celest plume
#

I have stolen parts of this script, ripped some pieces out from some places and shoved them in here...

languid tundra
#

๐Ÿคฆ

astral dawn
#

Why ๐Ÿ˜„

celest plume
#

Well, I had a sort-of functioning script at first, and then I tried to develop it, seeing as it was not working as wanted... What I want is just a mortar-script that is capable of firing multiple barrages

astral dawn
#

Computer programs don't tolerate this ๐Ÿ˜„ Be happy you are not writing some proper programming language as this would probably not even compile ๐Ÿ˜„

celest plume
#

ad infinitum

#

I am very aware of this. Picked up scripting today so.... Newbie here ๐Ÿ˜…

slim oyster
#

Looks like it's from a trigger act

celest plume
#

It is part of a trigger, yes.

slim oyster
#

What is your condition? Is it set to repeatable and for player side?

celest plume
#

"Server only" is on and "repeatable" is offline

#

"Blufor - Present"

astral dawn
#

So... you probably have to rewrite it like this:

[] spawn {
    //player in thislist;
    while {true} do {
        Mortar1 commandArtilleryFire [getposatl (thislist select 0), "rhs_mag_3vo18_10", 1]; 
    sleep 5;
};
// sleep 5; Why sleep here if your code never reaches this place?? 
};
slim oyster
#

is thislist being passed to the spawn thread?

celest plume
#

I'll try it out now! Thank you!

slim oyster
#

Is there something special needed for the commandArtilleryFire command? Why is it in a loop?

languid tundra
#

Also this addEventHandler ["Fired",{(param[0]) setVehicleAmmo 1}] in the vehicle init of Mortar1 might help if you don't want it to run out of ammo.

celest plume
#

Got a "generic error in expression" message... The reason why I had the sleep so far down was because if I had it where you placed it, the game freezes for ten seconds. @languid tundra I already have that ๐Ÿ˜‰

#

I want it to loop because it is supposed to be a vital part of the defence of a base, keeping the attackers pinned (of course, the "sleep" will be longer and more random when I get the script to work)

slim oyster
#

make a timeout/countdown in the trigger and set it to repeatable

celest plume
#

OK! Thanks for all the help though! I'll get back to my work!

slim oyster
#

@celest plume

    params ["_triggerlist"];
    private _triggerPlayerlist = (_triggerlist select {isPlayer _x});
    if !(_triggerPlayerlist isEqualto []) then {
        private _roundNumber = 0;
        private _playertarget = selectRandom _triggerPlayerlist;
        while {(alive Mortar1) && {(_roundNumber < 3)}} do {
            sleep (random 2);
            Mortar1 commandArtilleryFire [getposatl (_playertarget), "rhs_mag_3vo18_10", 1];
            sleep (3 + (random 3));
            _roundNumber = _roundNumber + 1;
        };
    };
};```

Something like that maybe, it would be nice to have a fired eventhandler set a var that could advance the while loop for counting rounds since I don't think `commandArtilleryFire` guarantees a timely shot
celest plume
#

Thank you! Will test this before I go to bed

#

THis fires the first set of round allright, but do I need to set it to "repeatable" for it to fire multiple salvos?

tough abyss
#

@frigid raven try detected by trigger

slim oyster
#

yes set it to repeatable to fire the rounds multiple times

#

You could also set the trigger countdown/timeout to delay the first round and then get rid of the first sleep in the while loop

celest plume
#

Copy! Thanks!

#

You are a lifesaver btw!

slim oyster
#

no problem

astral tendon
#

do you guys know how I can get a legacy version of the game like the very old one so I could try to the some achievements like Puppeteer and Dressing Doll? all I got was the Arma3LegacyPorts that just revert like 2 versions.

frigid raven
#

@tough abyss what do you actually mean? Is this a command or do you mean I should create a Trigger around every enemy unit? Sorry a bit unclear - not used to triggers

tough abyss
#

You can create trigger with many different functions not just present not present, one of them fires trigger if enemy is detected

velvet merlin
#

whats the most reliable to find an empty position/make a vehicle spawn into an empty position these days?

#

and how much delay do you need in MP when spawning multiple vehicles

robust hollow
#

I've rarely had issues with the alt syntax of createVehicle with the last argument being "NONE". If you need a position before spawning the vehicle you could try findEmptyPosition, from reading it, it sounds like it would do the job.
https://community.bistudio.com/wiki/findEmptyPosition

still forum
#

@slim oyster For storing changed/new variables in a CBA perFrameHandler, is the best practice to store them in the passed array params? Never heard of that practice, so far I always stored stuff in global variables. But yeah that could work, very nice idea.
It might even be more efficient than global variables.

@languid tundra what does that even mean? https://discordapp.com/channels/105462288051380224/105462984087728128/534497970981306398
If you don't have CBA, the script boxes in 3DEN throw a hissy fit when you try to execute code in there that doesn't end with returning nothing.
Nothing nothing I mean, not Nil nothing.
@astral dawn I have no idea what thislist is, it's some global variable The list of units that are currently inside a trigger, in the trigger condition or onActivation script.
@slim oyster is thislist being passed to the spawn thread? no.
@astral tendon all I got was the Arma3LegacyPorts that just revert like 2 versions. That's the oldest available. Only the Linux Client might be older ๐Ÿ˜„

velvet merlin
#

@robust hollow doing both already (also tried canCollide)

#

the problem should be having multiple vehicle spawn "at the same time"

astral tendon
#

Well, RIP, any other way to get the achievements?

still forum
#

Why can't you get them?

high marsh
#

Bugs :-0

frigid raven
#

@tough abyss arent trigger more mission/editor specific usage? I need the mentioned behaviour within a mods script. Or is it a common practise to create triggers via script to achieve this?

high marsh
#

I know the paper doll one is bugged for sure. Unsure about the rest.

still forum
#

You can unlock achivements via script if you put them into the correct place ๐Ÿ˜‰

#

A lot of work tho.. Not worth it unless you really need to have 100% achivements.

high marsh
still forum
#

And if you're going to hack the achivements anyway there are easier ways than that. Just google for it

tough abyss
#

You can create triggers editor or script the only limitation of script you cannot trigger attach object afaik. @frigid raven

leaden summit
#

Is there a command to check if a player is in a certain unit? as in units.arma3.com unit

still forum
#

There is a command to retrieve squad info. Logo and name and such

leaden summit
#

Ahhh squad params, thanks I had no idea what to look under

tough abyss
#

@velvet merlin maybe setVehiclePosition with radius?

velvet merlin
#

will try

frigid raven
#

@tough abyss alright gonna try that - thanks a heap

modest temple
#
[_PC,"Contact NATO", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "_this distance _target < 3", "_caller distance _target < 3", {hint "Started the usage of the radio tower"}, {}, {hint "NATO contacted"}, {}, [], 60, 0, true, false, ] remoteExec ["BIS_fnc_holdActionAdd", 0, PC];
#

Why does this not work?

#

its gives error

still forum
#

what might that magical mysterious error be?

modest temple
#

"On activation: Generic error in expression"

still forum
#

Any more to that error in RPT?

modest temple
#

RPT?

still forum
modest temple
#
22:11:57 Error in expression <false>
22:11:57   Error position: <false>
22:11:57   Error Local variable in global space
22:11:57 Global namespace not passed during: false
22:11:57 Error in expression <false>
22:11:57   Error position: <false>
22:11:57   Error Local variable in global space
22:11:57 Global namespace not passed during: false
22:11:57 Error in expression <false>
22:11:57   Error position: <false>
22:11:57   Error Local variable in global space
22:11:57 Global namespace not passed during: false
22:11:57 Error in expression <false>
22:11:57   Error position: <false>
22:11:57   Error Local variable in global space
22:11:57 Global namespace not passed during: false
22:11:57 Error in expression <false>
22:11:57   Error position: <false>
22:11:57   Error Local variable in global space
22:11:57 Global namespace not passed during: false
22:11:57 Error in expression <false>
22:11:57   Error position: <false>
22:11:57   Error Local variable in global space
still forum
#

that's not it

#

scroll down further

modest temple
#
13:13:58 Wrong color format 
13:14:09 Error in expression <ontacted"}, {}, [], 60, 0, true, false, ] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:14:09   Error position: <] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:14:09   Error Missing [
13:14:09 Error in expression <ontacted"}, {}, [], 60, 0, true, false, ] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:14:09   Error position: <] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:14:09   Error Missing [
13:14:09 Wrong color format 
13:46:43 [CBA] (settings) INFO: Checking mission settings file ...
13:46:44 Wrong color format 
13:47:36 Error in expression <ontacted"}, {}, [], 60, 0, true, false, ] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:47:36   Error position: <] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:47:36   Error Missing [
13:47:36 Error in expression <ontacted"}, {}, [], 60, 0, true, false, ] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:47:36   Error position: <] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:47:36   Error Missing [
13:47:36 Wrong color format 
13:48:04 Error in expression <ontacted"}, {}, [], 60, 0, true, false, ] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:48:04   Error position: <] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:48:04   Error Missing [
13:48:04 Error in expression <ontacted"}, {}, [], 60, 0, true, false, ] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:48:04   Error position: <] remoteExec ["BIS_fnc_holdActionAdd", 0>
13:48:04   Error Missing [
13:48:04 Wrong color format 
13:48:23 Wrong color format 
13:48:25 Wrong color format 
13:48:27 Wrong color format
#

that it?

still forum
#

Yep that looks like your code

#

Error Missing [ Well..

#

true, false, ] what is that last comma doing there?

modest temple
#

i dunno ๐Ÿ˜„

#

lemme try without

#

well

#

it's not giving me any errors

#

but it's not doing anything

still forum
#

Maybe _PC vs PC ?

modest temple
#

i honestly have no clue which it's supposed to be

#

lol

#

i figured it out

#

it was in a trigger's init but i forgot to make the trigger activate

marble pasture
#

would this be the syntax to check for two items in a vehicle cargo? if (item1 && item2) in (vehicle1) then {do thing}

still forum
#

&& takes two booleans

#

I assume item1 and item2 are not booleans?

winter rose
#

@marble pasture nope, && would require 2 booleans
Try something like sqf if ((item1 in items vehicle1) && (item2 in items vehicle1))

#

woops ๐Ÿ˜„

marble pasture
#

ah! that's whats up. yeah, they're not booleans.

#

thank you!

astral dawn
#

What's the most convenient practice to get something like a C struct?
I do it by using an array and defining the ID of each field through #define like this:

#define MYSTRUCT_ID_SOURCE        0
#define MYSTRUCT_ID_VALUE        1
#define MYSTRUCT_ID_WHATEVER    2
...

but it's not convenient, also I have to redo the enumeration manually if I decide to change something.
Maybe there is a better way?

still forum
#

Do that in TFAR too

#

Could use CBA namespace and then use names, slightly less efficient tho

astral dawn
#

Oh allright... we need meme support now, 'I feel your pain' meme ๐Ÿ˜ฆ

still forum
#

It's not fun if people just add their own values onto that struct

#

And then you want to add new ones too

astral dawn
#

Maybe at least there is some way to make enums through defines?

#

Maybe preprocessor can auto increment somehow...

still forum
#

could use line numbers ๐Ÿ˜„

#

But they are resolved after your #define is resolved. So already too late

astral dawn
#

There was some project which was an arma IDE but they made another preprocessor and named it SQF++ or something like that... can't find it

still forum
#

Yeah remember reading about that on bif

#

got some updates recently

#

sqdev?

astral dawn
still forum
#

Yeah. could be

astral dawn
#

No... i remember that project had some OOP stuff in it

queen cargo
#

@astral dawn There are numerous of those

#

ObjectOrientedScripting is my personal one

#

NouberNou also had one

#

and there was some other ... where i forgot the name

astral dawn
#

code34 has one
I also have one

astral dawn
#

But that TypeSQF has its own preprocessor, so I thought maybe it has some other nice features like C-like enums or structs

#

Hmm so you have your own preprocessor/compiler as well?

queen cargo
#

OOS? yes

astral dawn
#

If I'm about to do reference counting, smart pointers and similar concepts in SQF, probably I have gone too far ๐Ÿค”

still forum
#

reference counting/smart pointers doesn't make much sense as that's already done internally

#

Unless maybe some object that won't be deleted, because the world itself holds a reference to it

astral dawn
#

yes except i must manage creation/deletion of my fake OOP objects

frigid raven
#

How to make a default param value for code?

params [["_array",[]], ["_predicate", {}]];

??

still forum
#

yep

frigid raven
#

thxy

tough abyss
#

Iโ€™m going to try this question again. Does anyone know how to make the attributes of a SL apply to the rest of the squad when a trigger is activated?

#

I thought you could do this โ€œvariablename = group this;โ€ in the init of the SL

#

and the trigger would apply to the rest of the squad

#

Any idea?

digital hollow
#

You can access the group members with {hint str _x; } forEach units group _sl;

#

and then inside the forEach you can do whatever you like.

tough abyss
#

Awesome! Many thanks for the reply

velvet merlin
#

@astral dawn there are enums in RV engine

#
// destruction types
enum
{
  DestructNo,
  DestructBuilding,
  DestructEngine,
  DestructTree,
  DestructWall,
  DestructTent,
  DestructMan,
  DestructDefault,
  DestructWreck
};

enum {StabilizedInAxesNone,StabilizedInAxisX,StabilizedInAxisY,StabilizedInAxesBoth, StabilizedInAxesXYZ};```
astral dawn
#

Is it SQF?

velvet merlin
#

preproc

astral dawn
#

Wait, really ...

tough abyss
#

Hey @velvet merlin, would you happen to know if that OOP for Arma 3 works with Arma 2?

astral dawn
#

@tough abyss Look above, we have discussed all the OOP extentions a few hours ago

#

Soo... I guess all the made OOP extentions should work both for arma 3 and 2

tough abyss
#

I think it would. Itโ€™s still SQF.

#

And, there is Intercept

winter rose
#

YES

#

@edgy dune ๐Ÿ˜„

#

my brain struggled, apologies

#

it's just types yes

#

you hopefully don't have to type in 1,2,3,4,5,6,โ€ฆ ๐Ÿ˜„

#

maybe a BIS fnc that I don't know of, but not natively

tough abyss
#

you can make array 100 elements long with one command but not with ascending numbers

#

nil

rancid pecan
#

hello everyone

#

this error (client .rpt): ```sqf
0:25:50 Error in expression <
case 3: {life_paycheck = life_paycheck + 6500;};
case 4: {life_paycheck = life>
0:25:50 Error position: <+ 6500;};
case 4: {life_paycheck = life>
0:25:50 Error +: Type code, expected Number,Array,String,Not a Number
0:25:50 File life_server\Client\core\functions\fn_initPayChecks.sqf, line 54

#

What a problem ? ๐Ÿ˜ฆ

copper raven
#

iirc they compileFinal those values,so just do (call life_paycheck)

ruby breach
#

@rancid pecan Changes The Player(s) paycheck depending on what rank/level they are in the Police/NHS/Donator. I should hope that last one isn't something you're doing. If you are, you're violating monetization policies

rancid pecan
#

@ruby breach yes i know

#

and ready system

copper raven
rancid pecan
#

@copper raven i don't understand you sorry ๐Ÿ˜ฆ

copper raven
#

iirc,life_paycheck is compileFinal'd

#

you can't just reassign it

#

life_paycheck = (call life_paycheck) + 6500; wouldn't even work

astral dawn
#

@velvet merlin
Are you sure that this thing is supposed to be compilable by SQF?

enum
{
  DestructNo,
  DestructBuilding
};

G_destructNo = DestructNo;
G_destructBuilding = DestructBuilding;
#

It gives me an error when I do this
copytoclipboard str compile preprocessfilelinenumbers "test.sqf";

tough abyss
#

what error?

astral dawn
#
 0:49:16 Error in expression <ject_0\Project_0.Stratis\test.sqf"
enum
{
DestructNo,
DestructBuilding
};

G_des>
 0:49:16   Error position: <{
DestructNo,
DestructBuilding
};

G_des>
 0:49:16   Error Missing ;
 0:49:16 File C:\Users\s-tron\Documents\Arma 3 - Other Profiles\Sparker\missions\Project_0\Project_0.Stratis\test.sqf, line 2
tough abyss
#

Never seen anyone using it in SQF file

#

in config, enum is ignored

astral dawn
tough abyss
#

defines is not sqf file

astral dawn
#

where do I use this then? I thought it was meant to be #included then compilePreprocessed

tough abyss
#

you can include it in config or mission config

languid tundra
#

Pretty sure enum is restricted to configs.

astral dawn
#

Allright, thx

tough abyss
#

@frigid raven tested detected by trigger, it does what it says on the tin, triggers with knowsAbout showing 4. The problem however is with AI as it has eyes on the back of its head

frigid raven
#

Hmm I see - ok thanks for the insights. I will see how I gonna implement the feature. Gonna report back if I found a "nice" way

marble pasture
#

alright this should be my last issue with these damn barrels. I've got this checking to see if a barrel is loaded onto a truck ```
["ace_cargoLoaded", loadtracker] call CBA_fnc_addEventHandler;

loadtracker = {
params ["_item", "_vehicle"];
if (_item in [toxb_test]) then {this}
};

tough abyss
#

Hi I am having trouble with ambient animations, when the unit gets killed it just stays in the animation like a statue. I want the animation to be ended when the unit is killed so it will be actually on the ground like a dead person is. Can anyone help with that?

astral dawn
#

How do you play the animation? IIRC I didn't have this problem

tough abyss
#

[man1, "SIT1", "ASIS"] call BIS_fnc_ambientanim;

#

@astral dawn

astral dawn
#

Hmm can't help you with this, sorry, I just used plain switchMove for my AIs. I guess you'll have to look inside BIS_fnc_ambientanim if noone can help you here ๐Ÿคท

tough abyss
#

How was the switchMove one?

astral dawn
#

well it requires more manual messing around rather than the BIS function

tough abyss
#

Thats fine

astral dawn
#

probably the BIS function disables some the AIs of units with disableAI command

#

Yes looks like the do disable AI
{_unit disableAI _x} forEach ["ANIM","AUTOTARGET","FSM","MOVE","TARGET"];

#

Maybe you can just re-enable some of them after calling BIS_fnc_ambientanim with enableAI, not sure which ones you should enable though

prime horizon
#

hey guys can any one give me all arma weapon list script to put it in my admin menu what i mean like this:

_david = (findDisplay 45856) displayCtrl 7777 lbAdd "---- Weapome List ----";
 
{
_david = (findDisplay 45856) displayCtrl 7777 lbAdd name _x;
(findDisplay 45856) displayCtrl 7777 lbSetData [_david, getPlayerUID _x];
}forEach allPlayers;```
so the script that is down not weapons list its player list so i need a all Weapon script to spawn weapons
surreal vapor
#

Is it possible to parse a saved profile namespace? Outside of Arma?

#

Like if I use saveProfileNamespace to save a string, is it possible for me to extract the string from the Arma3Profile file?

tough abyss
#

Yes, you need to derapify the file first @surreal vapor

#

@prime horizon you can store control in a variable you know

surreal vapor
#

@tough abyss Do I need to use Mikero's Dos Tools for that?

tough abyss
#

Probably

surreal vapor
#

Cool, thanks!

#

Trying to see if there are any free tools that do it too, but maybe I'll just bite the bullet and pay up

velvet merlin
#

@astral dawn as @tough abyss says you can only use enum in config/mission config

tough abyss
#

You can but it is no use as it is just ignored like a comment

robust hollow
#

@surreal vapor you can derap using Arma 3 Tools from steam.

frigid raven
#

@surreal vapor I do not know what you want to achieve but sounds for a better job just storing those variables in extDB3 and read out of that sql database then trying to parse saveProfileNamespace

royal ice
#

Hi guys, I am not sure if anyone has asked this before. But is there any standalone script where, say for instance, you capture enemy vehicles, weapons and ammo and it gets added to a "virtual arsenal" you can grab from?

#

If not, could anyone point me in the right direction on how to make one? I

astral dawn
royal ice
#

Wow. Thank you. I was looking for this but couldn't find it.

astral dawn
#

I am not sure if it has API documented but it should be currently operational

royal ice
#

Yeah I am not sure either, but I believe it has a readme. I'll check it out and let you guys know later it is runs fairly well outside of Antistasi

sturdy cape
#

hey there. to check wether a unit is inside a specific building i use the bouningbox of it.is there a way to use the boundingbox minus like 40cm at the x,y,z borders?

#

so say,"unit doesnt stand directly at the wall"

thorn saffron
#

Is it possible to open the virtual arsenal that uses a specific box inventory, but using a script to open it? I want a script that opens a virtual arsenal box, while the player and the box are on opposite sides of the map.

edgy dune
#

Id look at the add arsenal zeus module, and see its add action,see wat function is called

thorn saffron
#

No add action, I want it run from the code straight up

edgy dune
#

Well i mean the action should have the function to open arsenal inside it so wouldn't knowing how it does so work? Sorry im not at my pc rn,im in class rn actually xd

thorn saffron
#

Ok, I looked through the arenal function and I found this:
["Open",[nil,_box,_unit]] call bis_fnc_arsenal
I think this might be what I'm looking for

#

Yup that was it

velvet hatch
astral tendon
#

Do you guys know how to revome all ace actions?

digital hollow
astral tendon
#

Any exemple?

digital hollow
#

It just amounts to _object setVariable ["ACE_interact_menu_actions", []];, I think.

slim oyster
#

yes

#
object setvariable ["ace_interact_menu_selfActions",[]];```
astral tendon
#
cursorObject setvariable ["ace_interact_menu_actions",[]]; 
cursorObject setvariable ["ace_interact_menu_selfActions",[]];
#

The unit still have the actions

ruby breach
#

Because cursorObject's variable on its local machine didn't change Scratch that, was thinking you mean another player unit had actions on his character object

astral tendon
#

So, what to do?

slim oyster
#

or are you trying to remove the class actions as well?

astral tendon
#

Just a Agent actions

slim oyster
#

Are you trying to remove actions added by ace or a mod, or through a script in your mission?

astral tendon
#

No, the default ace actions like healing

slim oyster
#

Remove all actions from scripts: object setvariable ["ace_interact_menu_actions",[]]; object setvariable ["ace_interact_menu_selfActions",[]];

Remove all actions from class/configs: ace_interact_menu_actnamespace setVariable [(typeof object),[]]; ace_interact_menu_actselfnamespace setVariable [(typeof object),[]];

astral tendon
#

The last one works, but it also remove all action from units that are from the same type, is there a way to only remove that unit actions?

slim oyster
#

The class actions are created to the custom namespace, they aren't specific to the unit

#

Is this for players in MP?

#

or for AI in MP?

edgy dune
astral tendon
#

For AI in MP

edgy dune
#

oh sorry nvm

slim oyster
#

put that code in a !hasinterface block
Nevermind, this isn't going to work for you since actions are created upon menu load for client on object

astral tendon
#

how?

#
ace_interact_menu_actnamespace setVariable [(typeof object),[],true];
ace_interact_menu_actselfnamespace setVariable [(typeof object),[],true];
#

maybe this for mp compatibility?

slim oyster
#

If it is only disabling medical options for AI, isn't there an ace medical CBA setting for that?

#

and no that will remove all actions of that class

slim oyster
#

Not tested, but I think you could overwrite some of the canInteractWith conditions to make them also check for AI/Player state.

astral tendon
#

So, how to espesifie the action I want to remove? like only the medical but I want the player to still have the ability to carry and load the unit in a vehicle

slim oyster
#

Are you sure there isn't a CBA mission setting to disable ACE medical on AI?

astral tendon
#

Never check that.

#

But do you know were I can get all the actions name to remove only especific ones?

digital hollow
#

getVariable

astral tendon
#

?

digital hollow
#

The list of actions is held in the object variable ace_interact_menu_actions. use getVariable to get it.

astral tendon
#
cursorObject getVariable "ace_interact_menu_actions"

returns nothing

digital hollow
#

Can you confirm that cursorObject is returning that it's supposed to?

astral tendon
#

R Alpha 1-3:2

lethal trellis
#

hi, i have a problem with ambient anims. sometimes, but not always, the units move about 3-4 meter when a player joins the dedicated. tried the various versions from the wiki, always the same. at the moment i use this in the init field of the units: if (isServer) then {[[this,"STAND_U2"],BIS_fnc_ambientAnim ] remoteExec ["call",0,true];}; anyone got an idea ?

astral tendon
#

Anyone knows how to use the ace_unconscious event handle? and even a exemple?

tough abyss
#

if (isServer) then
{
_handle = "convoy\convoyInit.sqf";
_handle = [["pos_1","pos_2","pos_3","pos_4"],[c1,c2,c3,c4,c5,c6], 35, 500, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove;
};

#

How do i put multiple scripts into the init.sqf

#

Apolgies in advance new to arma 3 scriptin

robust hollow
#

as in how do u run multiple scripts? one after the other... is your problem with _handle = "convoy\convoyInit.sqf";? cause looking at it, it should probably be execVM "convoy\convoyInit.sqf";

tough abyss
#

@robust hollow thank you

#

if (isServer) then
{
_handle = execVM "convoy\convoyInit.sqf";
_handle = [["pos_1","pos_2","pos_3","pos_4"],[c1,c2,c3,c4,c5,c6], 35, 500, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove;
};

#

I had it like this b4

#

when it comes to multiple scripts do i have it right?

#

just have them under each other after the ;

slim oyster
#

yes like this: _handle = [["pos_1","pos_2","pos_3","pos_4"],[c1,c2,c3,c4,c5,c6], 35, 500, 1, "NORMAL", "CARELESS"] execVM "convoy\convoyInit.sqf"; _handle2 = [["pos_5","pos_6","pos_7","pos_8"],[c1,c2,c3,c4,c5,c6], 35, 500, 1, "NORMAL", "CARELESS"] execVM "convoy\convoyInit.sqf";

tough abyss
#

@slim oyster Appreciated

slim oyster
tough abyss
#

so I have to have them numbered

robust hollow
#

unless you use _handle later on in the script you dont really need to set it, is unnecessary.

slim oyster
#

No, you don't need a handle unless you want to terminate/manipulate it later

tough abyss
#

mhmm

#

basically

#

am tryna run a convoy script

#
// Tested with Development Build 1.66.140687


Thanks to Norrin for the initial scripts and idea which I used as base for my version

To use: 

1. Copy the convoy folder into your mission directory
2. Create a convoy of AI vehicles, not grouped. Make sure each vehicle is named in the editor
3. Add markers on the map that you want the convoy to move through     
4. Call "convoy\convoyInit.sqf" from your init.sqf to initialize the scripts (this must occour before step 5)
5. Add the code (see below) either to your init.sqf (which will start the convoy right away when mission starts) or to a trigger to start the convoy
6. convoy\ConvoyEnd.sqf is called automatically when convoy reaches the final marker. Any further actions which convoy needs to take can be coded in this file by user.
   Check ConvoyEnd.sqf file for further information.

Code:
if (isServer) then 
{
    _handle = [["pos_1","pos_2","pos_3","pos_4"],[v_1,v_2,v_3], 35, 500, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove; 
};


The code parameters in the script-call are:

1. An array of moveTo Markers for the convoy eg. ["pos1","pos2","pos3","pos4"]
2. An array that contains the names of the vehicles in the convoy eg. [c1,c2,c3,c4,c5,c6]. This array should not have any " symbol
3. Speed limit for convoy. I tested it with 35. This value can be time to time less due to speed corrections
4. Enemy search range. Enemies in this range will be considered as danger. Minimum value for this parameter is 300.
5. Convoy ID. It provides the ability to the user to branch the code in ConvoyEnd.sqf based on the given ID in case there are multiple convoys in map
6. Speed mode of convoy. I suggest to use Normal. It should match to speed limit which is given.
7. Behaviour. For a convoy careless is suggested behaviour so it can follow the roads without a problem.



License:  These scripts are not to be altered or used for commercial or military purposes without the author's prior```
#

this is the instruction it gave me

#

I am confused on "4. Call "convoy\convoyInit.sqf" from your init.sqf to initialize the scripts (this must occour before step 5)"

slim oyster
#

that is defining functions for use later when you send the parameters (settings sent to the script/function)

robust hollow
#

call compile preprocessfile "convoy\convoyInit.sqf"
it will start and finish the script before the next one starts. spawn and execvm puts it in a scheduler so they run side by side kind of.

tough abyss
#
{
    call compile preprocessfile "convoy\convoyInit.sqf";
    _handle2 = [["pos_1","pos_2","pos_3","pos_4"],[c1,c2,c3,c4,c5,c6], 35, 500, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove; 
}; ```
#

so should it be like this ^

slim oyster
#

use ``` for multiline blocks

robust hollow
#

yea that should work fine @tough abyss

tough abyss
#

@robust hollow @slim oyster tryin it right now appreciate all help

slim oyster
#

I dont know the particular script/functions, some require all clients & server to have an init called, some only for the server. Since it is an AI script and doesn't mention a headless client I am assuming it should be fine

#
if (isServer) then  {
    _handle2 = [["pos_1","pos_2","pos_3","pos_4"],[c1,c2,c3,c4,c5,c6], 35, 500, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove; 
}; ```

Would be for a init that needs to be called globally, then a spawn for using the function/script
robust hollow
#

there is an example mission off the forum post showing the init only called on the server.

tough abyss
#
"call compile preprocessfile "convoy\convoyInit.sqf";
if (isServer) then  {
    _handle2 = [["pos_1","pos_2","pos_3","pos_4"],[c1,c2,c3,c4,c5,c6], 35, 500, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove; 
}; "```
#

so this is what i should have in the init.sqf

robust hollow
#

no, this is what you should have

if (isServer) then 
{
    call compile preprocessfile "convoy\convoyInit.sqf";
    [["pos_1","pos_2","pos_3","pos_4"],[c1,c2,c3,c4,c5,c6], 35, 500, 1, "NORMAL", "CARELESS"] spawn DEVAS_ConvoyMove; 
}; 
tough abyss
#

Thank you, @robust hollow Do u have any idea whether i should have names of vehicles in the variable name box after clickin on the vic or should i have it somewhere else?

#

Cant get this darn script too fkn run probs cuz am fkn -65000iq

#

@everyone who evez can help

robust hollow
#

idk. why dont you look through the sample mission to see how the dev does it?

tough abyss
#

@robust hollow if you dont mind me askin where does it exist?

robust hollow
#

on the forum post you linked

foggy moon
#

Hey guys, quick question, just wanted to confirm before I abandon it, is there absolutely no way to intercept or disable the default ammo/refuel/repair truck functions only with certain vehicles? I can't really empty the cargo of all default trucks since my replacement system is only for aircraft.

winter rose
#

@foggy moon you could empty or disable simulation the truck while a plane is nearby?

lean aurora
#

Any one can help my error?

foggy moon
#

@winter rose hmm, true, looks like a 1 second nearEntities check might be cheap enough

edgy dune
#

menu looks nice

#

but I kind of dont get when u would use it?

#

I guess im used to having a zeus or a arsenal?

#

oh okay i see,i forget is the engineer role/medic role in vinilla or ace? so something like that, where u need special perms

#

i think its nice, but the lag before the menu comes up?

#

can u select which plane to spawn? also that sound ,that lilttle humm

#

oh okay thats balance stuff I guess, but the menu is nice,id like to learn how to make some but ๐Ÿคท time

#

yea thats nice, if they had this would there be any need to re join?

#

100%?

#

no special case where they would need to rejoin?

lost copper
#

@tough abyss did you save role of player in player namespace? Like:

player setVariable ["var_role", "PILOT", true]
#

I want to create sytem of roles changing for players on my polygon mission

#

And want to equip player from sqf file named:

[player] execVM "equip\<side_variable>\<role_variable>.sqf"
#

Your system looks good, @tough abyss

#

Were i can learn how to create dialogs like that?

#

With that command i don't need to create classes in description.ext?

torpid grail
#

Quick question, when it comes to the client ID. Does the client id change when the player disconnects? So let's say I join and my ID is 7, I disconnect, would the id of 7 be assigned to someone else or would is be empty?

#

So I would get the ID of 7 back?

#

Oh ok thank you.

#

Also I have another question, are there any good antihacks or any good methods to use to make an antihack that are publicly available?

lost copper
#

@tough abyss thx for your answer. Good luck with your work!

torpid grail
#

I'm wanting to get rid of infistar as I don't really trust it much and I feel like something custom would work out better as far as performance and protection goes.

#

Well I know of a method that's pretty common as far as injecting code goes and I'd definetly like to fight against it. Or detect it then kick people for it.

#

Hence the client id question. I want to make a kick function but make it so it can only be remotely executed on yourself. So I wanna check for the owner using remoteExecutedOwner

#

That way someone doesn't just try kicking or banning everyone once they've found the function.

#

Also there's obvious methods like detecting if someone's disabled allow damage or not.

#

I'm just fishing for ideas here haha

#

What are some methods used for detecting cheaters?

lost copper
#

@torpid grail battleye? ๐Ÿ˜…

torpid grail
#

Does that disable is in the mission functions?

#

Like if I had function that used the hint command, would it block the hint command

#

Bruh I'm about to block all the commands then ๐Ÿ˜‚

#

I'll have to mess with it because if that's the case then I'm about to compile a list of every single function Arma 3 uses haha

#

Do I need the targets and args parameters

#

@tough abyss would you like to get in a voice call?

#

Haha damn alright I'll be back later then thanks for your input

slim oyster
#

Does anyone know the execution order of CBA XEH with the server or client prefixes? Does the main init get executed first or do the specific/server & client ones get executed first?

quasi rover
#

@tough abyss To cheat server, the cheater at least have to join the mission server, so server entry log is remained ?

still forum
#

https://discordapp.com/channels/105462288051380224/105462984087728128/534832543992905728 No enums are not preproc. They are config parser.
@astral dawn @velvet merlin
@tough abyss you can make array 100 elements long with one command but not with ascending numbers
Well.
_array set [200,0]
_array = _array apply {_forEachIndex} ? Something like that? does apply have forEachIndex?
Btw https://discordapp.com/channels/105462288051380224/105462984087728128/534840558875836426 who were you talking too?

@astral dawn Are you sure that this thing is supposed to be compilable by SQF? No.
@tough abyss defines is not sqf file It is.

@surreal vapor Trying to see if there are any free tools that do it too, but maybe I'll just bite the bullet and pay up Mikeros tools are free.
Arma 3 Tools can also do it. Armake can also do it.
I think mikeros tools even crash on profileNamespace stuff. Atleast i could only get it to work with BI tools. Don't remember what problem mikeros tools had.

@astral tendon Do you guys know how to revome all ace actions? What are you trying to do? You cannot remove actions that are defined in configs. You might be able to disable interaction completely though.

@slim oyster no ordering. The one that's defined first in config, comes first.

serverInit = ..
clientInit = ...

serverInit comes first. Other way around clientInit would come first

tough abyss
#

Iโ€™d use resize 200 but the use apply is neat ๐Ÿ‘

#

Would have been neat ๐Ÿ˜ฉ

robust hollow
#

does apply have forEachIndex? no

tough abyss
#

It is it is not. commonDefines.hpp is meant to be used in configs

still forum
#

you said defines

#

preprocessor and defines work in SQF scripts too

#

you can use commonDefines.hpp in sqf scripts too... Actually.. You can use 98% of commonDefines.hpp in SQF scripts too. If those enums/class weren't there ^^

astral dawn
#

but it has these enums

#

which make an error in sqf

#

maybe if it's inside an #include block, it gets ignored?

still forum
#

nope. include block just copy pastest stuff

#

What I mean is M242 said "defines is not sqf file" but #define does work in sqf

astral dawn
#

wait, but when I tried something like

enum
{
  DestructNo,
  DestructBuilding,
  DestructEngine,
  ....
};

I got sqf errors

still forum
#

Yes

#

because that's not preprocessor

#

Preprocessor works in SQF just fine, nothing stops you from using it

#

But enums are config. Not preprocessor

tough abyss
#

I meant commonDefines.hpp was lazy to type it all

still forum
#

name is actually CommonDefs.hpp. I wrote it wrong too ๐Ÿ˜„

tough abyss
#

Also some of those hpp files use __EVAL and __EXEC if I remember correctly which also wonโ€™t work with sqf

#

Heh discord got confused

slim oyster
#

@still forum Thanks, best option. As long as I know that I can get a global init before client/server that is perfect.

astral dawn
#

but i got that enum from commondefs.hpp which you said was supposed to be used by sqf

still forum
#

All a giant confusion of people mixing up what's preprocessor and what's not.

lean aurora
#

Any one can help my error?

still forum
peak plover
#

the car script

young current
#

@lean aurora what they are trying to say is that you must ask your question properly and on one channel to get help

winter rose
#

So, what is your script, and what is the error you get @lean aurora ?

queen cargo
#

why is here straw?

tough abyss
#

The car script or anything

radiant egret
#

@queen cargo
And why do you have a mask on ? ๐Ÿ˜‚

still forum
#

german identified

radiant egret
#

ALARM ALARM ... another movie ๐Ÿš’ ๐Ÿ›

vernal mural
#

Do anyone know how to add ACE action to a vehicle accessible from passengers ? I realize I've never done such a thing, and it could be pretty useful

#

(although I know this channel is normally not dedicated to ACE questions, very sorry...)

still forum
#

you add ACE_SelfActions to the vehicle.... ยฏ_(ใƒ„)_/ยฏ

vernal mural
#

Oh I see, I didn't understand the wiki that way... Considering that some actions are accessible from both in and out of the vehicle, I thought it was the "0" type actions displayed inside too. Let's try with "1"

#

Yep, it works. Perfectly clear now, considering that you are adding it to the vehicle's selfActions. So when a player is "in" the vehicle, he kinda "become" the vehicle, replacing his external actions with selfactions from the vehicle. Makes sense. Thanks !

edgy dune
#

out is interaction, in is self interaction ?

vernal mural
#

basically yes, but you are accessing vehicle's self actions with the same key than usual external actions. Hence my confusion

edgy dune
#

yea, I personally went the config way

slim oyster
#

Just like ye olde fleximenu

tough abyss
#
// ยฉ v.2.5 MARCH 2016 - Devastator_cm

private _vcl                 = _this select 0;
private _last_marker         = _this select 1;
private _convoyArray        = _this select 2;
private _c                     = _this select 3;
private _ConvoySearchRange    = _this select 4;
private _vcl_behind         = objNull;
private _vcl_ahead             = objNull;
private _destinationEnd     = getMarkerPos _last_marker;
private _unit                 = objNull;
private _enemySides            = objNull;
private _enemies             = [];
private _enemySides         = (driver _vcl) call BIS_fnc_enemySides;```
#

if (_c < (count _convoyArray) -1) then {_vcl_behind = _convoyArray select (_c + 1)};
if (_c > 0) then {_vcl_ahead = _convoyArray select (_c - 1)};            
while {alive _vcl && !(_vcl getVariable "DEVAS_ConvoyAmbush")} do 
{     
    if (_vcl distance _destinationEnd < 10 * (_c + 1) && _vcl getVariable "DEVAS_ConvoyCurrentMarker" == _last_marker) then {_vcl setVariable ["DEVAS_ConvoyDestination",true, false];};
    _aliveConvoy    = [];
    {
        _unit          = _x;
        _enemies     = (_unit neartargets _ConvoySearchRange) apply {_x select 4} select {side _x in _enemySides AND {count crew _x > 0} AND typeOf _x != "Logic" AND !(_x isKindOf "Air")};
        if (canMove _x && _enemies isEqualTo []) then {_aliveConvoy pushBack _x;};
    } forEach _convoyArray;
    if (count _aliveConvoy < count _convoyArray) exitWith {_vcl setVariable ["DEVAS_ConvoyAmbush",true, false]};
    if (!isNull _vcl_behind) then {
        while {_vcl distance _vcl_behind > 60 && _vcl distance [getmarkerpos(_vcl getVariable "DEVAS_ConvoyCurrentMarker") select 0, getmarkerpos(_vcl getVariable "DEVAS_ConvoyCurrentMarker") select 1, 0] <  _vcl_behind distance [getmarkerpos(_vcl getVariable "DEVAS_ConvoyCurrentMarker") select 0, getmarkerpos(_vcl getVariable "DEVAS_ConvoyCurrentMarker") select 1, 0]} do {    
            _dir = getDir _vcl;```
#
                if (((sin _dir) * (velocity _vcl select 0)) > 3) then {_vcl setVelocity [(velocity _vcl select 0) - (1 * (sin _dir)), (velocity _vcl select 1), velocity _vcl select 2]};
                if (((cos _dir) * (velocity _vcl select 1)) > 3) then {_vcl setVelocity [(velocity _vcl select 0), (velocity _vcl select 1) - (1 * (cos _dir)), velocity _vcl select 2]};
            } else {
                if (((sin _dir) * (velocity _vcl select 0)) > 1) then {_vcl setVelocity [(velocity _vcl select 0) - (2 * (sin _dir)), (velocity _vcl select 1), velocity _vcl select 2]};
                if (((cos _dir) * (velocity _vcl select 1)) > 1) then {_vcl setVelocity [(velocity _vcl select 0), (velocity _vcl select 1) - (2 * (cos _dir)), velocity _vcl select 2]};
            };
            sleep 0.1;
        };
    };
    if (!isNull _vcl_ahead) then    {
        while { (_vcl distance _vcl_ahead < 40) || _vcl distance [getmarkerpos(_vcl getVariable "DEVAS_ConvoyCurrentMarker") select 0, getmarkerpos(_vcl getVariable "DEVAS_ConvoyCurrentMarker") select 1, 0] <  _vcl_ahead distance [getmarkerpos(_vcl getVariable "DEVAS_ConvoyCurrentMarker") select 0, getmarkerpos(_vcl getVariable "DEVAS_ConvoyCurrentMarker") select 1, 0]} do {    
            _dir = getDir _vcl;
            if (((sin _dir) * (velocity _vcl select 0)) > 1) then {_vcl setVelocity [(velocity _vcl select 0) - (2 * (sin _dir)), (velocity _vcl select 1), velocity _vcl select 2]};
            if (((cos _dir) * (velocity _vcl select 1)) > 1) then {_vcl setVelocity [(velocity _vcl select 0), (velocity _vcl select 1) - (2 * (cos _dir)), velocity _vcl select 2]};
            sleep 0.1;
        };
    };
    sleep 0.1;
};
_vcl doMove getPos _vcl;```
radiant egret
#

Maybe use pastebin?

tough abyss
#

truxd

#

Can anyone confirm if this is related to anything that has to do with distance between convoy vehicles

leaden summit
#

So in the past I've used code like this in my description.ext to customized vehicles and their inventory when spawned

class Extended_Init_EventHandlers {
     class     B_T_LSV_01_unarmed_F {
        init = " (_this select 0) call (compile preprocessFileLineNumbers 'vehicleLoadout.sqf')";
     };
};```
The other night I changed the classname to an ammobox and used the script to empty the box, then load it with the gear I wanted.
Problem was some people could see the gear but not actually get it out of the crate, others had no issue. Is this a JIP issue or what's going on? Any ideas?
still forum
#

don't execute global inventory commands globally

#

only execute them once. at best on server

#

you are globally adding/removing items several times in just a few seconds.. arma get's confused

tough abyss
#

@leaden summit oh no this is a convoy script named devas convoy script

#

Basically I wanted to edit a variable in the script files to change the distance between the vics when convoying

#

"Details are in readMe.txt inside the zip. Examples about how to add custom code or introduce a patrol behaviour are inside ConvoyEnd.sqf. Sample mission can be found above."

leaden summit
#

Ahhh ok, so if I'm trying to make custom filled ammo boxes that can be spawned during the mission how would be the best way to do that?

tough abyss
#

No xd

#

am trying to put less distance between the vehicles in the convoy when they are moving from point A to Point B

leaden summit
#

Well the first thing I would do is start playing around with the line that says if (_vcl distance _vcl_behind <= 100) then {

foggy moon
#

@leaden summit changing init = to serverInit = would only call the script on the server

leaden summit
#

Change the 100 to a smaller value and see what that does.

#

Cool thanks Raynor

tough abyss
#

should i give it a go

#

allright leme give it a try

#

i will change it to maybe half that number as a test

leaden summit
#

I'm far from what you would call an expert, I have no real idea what I'm doing but that's where I would start

tough abyss
#

mhmm

#

i can tell

#

i am - 6 5 0 0 0 i q so no worries

slim oyster
#

Hmm, anyone tried using an extension to makefile a description.ext? Trying to parse mission.sqm for current mission through an addon without the users having to make a description.ext manually

tender vector
#

how can I make a task marker appear when further than 6km away?

high marsh
tender vector
#

Thanks can this be changed through scripting?

#

Also that appears to be for unassigned markers I am looking to increase the distance of an active marker

tough abyss
#

@slim oyster what do you mean? Mission does not need description.ext. EXT means extended so that you can extend mission config How do you autogenerate it with what params?

slim oyster
#

Is there another way to parse mission.sqm 3den entity attributes?

#

they are accessible through a description.ext include for the mission.sqm but not in mission without the include of course

astral tendon
#

Do you guys know how to use the ace_unconscious event handle?

peak plover
#

no

#

but here's a code example

#

["ace_unconscious", {
    params [["_unit", objNull],["_state", false]];
    if(_unit != player || {!fp_ragdolling}) exitWith {}; // only ragdoll players and only ragdolling if it active
    if(_state && {vehicle _unit == _unit && {!([_unit] call ace_medical_fnc_isBeingCarried) && {!([_unit] call ace_medical_fnc_isBeingDragged)}}}) then {
        // ragdoll player
        _unit setUnconscious true;
    };
    if(!_state) then {
        // player woke up before ragdolling was finished
        _unit setUnconscious false;
    };
}] call CBA_fnc_addEventHandler;
astral tendon
#

by donig this

#
["ace_unconscious", { 
systemChat "hi";
}] call CBA_fnc_addEventHandler;
#

It fires if any unit get unconcious

#

I dont feel like this is good for perfomace.

foggy moon
#

If you check if(_this select 0 != player) exitWith {} at the top it will be negligible

surreal vapor
#

@robust hollow @frigid raven @Dedmen Thank you guys for the guidance on possible ways to deal with parsing saved data. I'll check out extDB3 and using Arma Tools.

still forum
#

@astral tendon I dont feel like this is good for perfomace. That tells me you don't know how eventhandlers work.

astral tendon
#

Yeah, im not that deep in scripting

compact maple
#

Hey guys, is there a way to block the player when he's doing an animation, so he cant do 360 ? But only can move his head ? ty

surreal vapor
#

@still forum Interesting. I'll give it a try.

#

Thanks!

astral tendon
#

How to create compositions like unit squads?

#

I would like to create a hole squad in one go than have to creat each unit and then group they.

digital hollow
vapid drift
#

I'm sort of having a hard time with the logic here... how would cursorTarget be useable in multiplayer?

still forum
#

I don't understand

#

it's the same in MP as in SP

vapid drift
#

Yeah... it's really screwing me up that you can specify a target to execute it on if that makes sense

still forum
#

What? you can't

vapid drift
#

like it just checks the player... do you just have to run it locally on each player or what?

still forum
#

It returns the cursorTarget of the local player

vapid drift
#

Unless I'm missing something

#

so if you want to check cursorTarget you just have to have each playing running it themselves?

still forum
#

I guess

#

Don't know what you are really trying to do

vapid drift
#

understand how it works

still forum
#

same as player command. Or any other local command

vapid drift
#

Alright, thanks

keen nimbus
#

I've got a question about this: https://github.com/acemod/ACE3/blob/e2ac18a05d5f646bc7cbc043bcc148fde4c0f5dd/addons/arsenal/functions/fnc_handleMouse.sqf

From what I understand, that updates the cameraPosition array based upon mouseButtonState which is itself written by mouse button event handlers. Then in the background there's a mission event handler that moves the actual camera position depending on any changes to cameraPosition

What I don't understand is that in this: https://github.com/acemod/ACE3/blob/e2ac18a05d5f646bc7cbc043bcc148fde4c0f5dd/addons/arsenal/functions/fnc_onArsenalOpen.sqf

The function to handle the mouse is only called once (at the bottom), meaning that although mouseState is getting updated, cameraPosition isn't updating in turn because the function to update it is only called once at Arsenal open.

What am I missing?

keen nimbus
#

Brilliant! Knew I just have been missing something. Thanks, Dedmen ๐Ÿ˜ƒ

umbral oyster
#

wtf?
21:02:45 "Marker_90923,[10854.5,12898.9,0.1]"
21:02:45 "Marker_45214,[10456.8,19097.6,0.1]"
21:02:45 "Marker_73410,array"

#

What is 'array'?

still forum
#

a nil value

#

that should've been an array

#

You probably passed nil to getPos or getMarkerPos

umbral oyster
#

oh god, really, nil, forgot this

frigid raven
#

_list = player nearEntities 20;
radius here is in meters aye?

ruby breach
#

Yes

tough abyss
#

In dollars

winter rose
#

@astral tendon I would like to create a hole squad in one go than have to creat each unit and then group they.
in 3den : press F2 to go into group mode, select in the list, click on the map, ???, profit

astral tendon
#

So, how to do that in game with out zeus?

winter rose
#

in game? via the debug console? BIS_fnc_spawnGroup indeed; I was pointing out the solution in the editor

willow pike
#

does someone know how distance2d is calculated in here ?

winter rose
#

yes

astral dawn
#

probably sqrt(dx^2+dy^2) ??

#

I mean euclidean distance... come on...

astral dawn
willow pike
#

thanks !

#

will take a look

astral dawn
#

It's like... distance between two spots you would see on the map... because you don't take into account the altitude of two objects

willow pike
#

hmm I am getting different values than from the arma engine

astral dawn
#

๐Ÿค” So what exactly are you doing?

willow pike
#
cordsa = [1560, 1670,0]
(3)ย [1560, 1670, 0]
cordsb = [1562, 1676,0] 
(3)ย [1562, 1676, 0]
Math.hypot(cordsa[1]-cordsa[0], cordsb[1]-cordsb[0])
158.4171707865028
#

this is javascript

#

[1562, 1676,0] distance2d [1560, 1670,0]
6.324 meters

astral dawn
#

You should do

Math.hypot(cordsa[0]-cordsb[0], cordsa[1]-cordsb[1])
willow pike
#

oh okay ! Thanks

#

works like a charm !

frigid raven
#

no else after exitWith possible?

robust hollow
#

wouldnt make sense for else to work after exitWith. if you havent exited the script then ur continuing past the if anyway.

ruby breach
#

There is no exitWith-else structure. Sounds like you want ```sqf
if (_someBool) exitWith {_this};
_that

astral dawn
#

exitWith works without else because... SQF ๐Ÿคท

still forum
#

If you think else after exitWith would make sense then you don't know how else works

#

else is a binary command like +
CODE else CODE returns the array [CODE, CODE]

#

And then takes array as argument on right side

foggy moon
#

So I'd like to make a zeus module to set variables on an object - anyone know of a fairly clean way to get a reference to the object the module was dropped on from inside the module attributes dialog?

still forum
#

afaik the module's init script get's the object it was dropped on as parameter

foggy moon
#

it does, but the curatorInfoType display does not

still forum
#

what arguments do you get there

foggy moon
#

just the display

frigid raven
#

is it simple to add voice overs ? am curious but never heard any custom ones in a mod yet

still forum
#

Well you need to write the whole dialogue with subtitles. And I think voiceovers have special format with lipsync stuff

#

Never did it. And don't know anyone who did

foggy moon
#

@frigid raven I did radio VO which is pretty easy, just make an .ogg audio file and set it up it in CfgSounds. I didn't do lip files but it looks like you just run it through WaveToLip.exe in the BI sound tools and place the .lip file in the same folder as the ogg. Then just use the say command.

frigid raven
#

hm sounds not complicated

#

thx for the info

winter rose
#

also, found out after many issues, if you make a logic radio speak (createLogic, etc) give it an identity (any, like "Armstrong" for example) else voices' pitch gets random

frigid raven
#

So I have to chose a pitch template then?

foggy moon
#

only if you're using a logic or something without one, normal units should already have it

frigid raven
#

kk

languid tundra
#

@foggy moon
The way BI is referencing the Zeus module in their dialogs is that they have a helper function called BIS_fnc_initCuratorAttribute.
e.g. RscAttributePunishmentAnimation config has the line below:
onSetFocus = "[_this,'RscAttributePunishmentAnimation','BootcampCommon'] call (uinamespace getvariable 'BIS_fnc_initCuratorAttribute')";
'BootcampCommon' is a class defined in CfgScriptNames, which specifies where Arma should look for the script file. 'RscAttributePunishmentAnimation' is the name of the script file located in that directory. RscAttributePunishmentAnimation.sqf will then be called with the arguments ["onLoad", _params, _logic]. _params select 0 is a reference to the display and _logic is your module. I assume you know how to get your object from _logic.

foggy moon
#

Ah, awesome. I had found most of that structure but didn't notice the script would get the logic argument. So theoretically via addon I should be able to add a class to CfgScriptNames and make it call my script from onSetFocus using the helper function, right?

languid tundra
#

Exactly. We did this in Achilles for adding new attributes to the attribute window, but it should not be different for a module.

foggy moon
#

Perfect. Very much appreciated!

viral ginkgo
#

hi guys, quick question, ive got a function that outputs 2 things - object and a position. Iam then trying to do a select on both and distance between them in the sqf file. this however gives me Error select: Type Object, expected Number. not sure why. anyone any ideas?

0:22:58 Error in expression <nvoystate;

if ([_convoystate] select 0 distance [_convoystate] select 1 < 100) >
0:22:58 Error position: <distance [_convoystate] select 1 < 100) >
0:22:58 Error select: Type Object, expected Number

_convoystate = [];
_convoystate = [_x] call AS_fnc_base_resupply;
if (_convoystate select 0 distance _convoystate select 1 < 100) .....

this is what the function outputs if I copytoClibpoard - [O Alpha 1-1:8,[17436.4,13169.2,0]]

foggy moon
#

try (([_convoystate] select 0) distance ([_convoystate] select 1)) < 100, I'd guess it's order of operations getting confused

viral ginkgo
#

yeah, let me give this a try!

foggy moon
#

Oh, hang on, [_convoystate] select 1 won't ever work, is _convoyState your array?

#

If so drop all the brackets

#

[_convoystate] select 0 will just give you _convoystate

viral ginkgo
#

the brackets are somehow only there in the error from .rpt

#

they are not in my code

#

but it didnt throw any errors so far after trying it with the additional ()

foggy moon
#

that's interesting, well if it works it works

viral ginkgo
#

thanks very much man!

spring vigil
#
if (["KA_proving_ground","PA_arsenal"] apply {isClass(configFile>>"CfgPatches">>_x)} findIf {_x} > -1) then{
endMission "END2";};```

Im attempting to block Personal arsenal and proving grounds.  Its working to Block Proving grounds not for PA

```cpp
class CfgPatches
{
    class A3_Anims_F_Config_Sdr
    {
        units[] = {};
        weapons[] = {};
        requiredVersion = 0.1;
        requiredAddons[] = {"A3_Anims_F"};
    };
    class PA_arsenal
    {
        units[] = {};
        weapons[] = {};
        requiredAddons[] = {};
        author[] = {"Drakeziel"};
    };
};```
still forum
#

what u mean "block" ?

high marsh
#

For some reason, linkItem does none of the following: create item in inventory, assign item to correct slot.
same with assign item after addItem creation. Bug? Doing something wrong? I'm at a loss

#
ex:
player addItem "Rangefinder";
player assignItem "Rangefinder"; //created, not assigned
#
player linkItem "Rangefinder";
//not created, not assigned
#

The interesting part is that in the example for assignItem, the NVG example does work. But wtf is up with the rangefinder?

spring vigil
#

Block as it ends the mission and kicks the player that has the mod to the role selection. I had a comma in the ",PA_arsenal" string.

drowsy axle
#
{
    private _unit = (_forEachIndex select 0);
    private _seat = (_forEachIndex select 1);
    _unit addAction ["Copy Loadout",{
        (_this select 1) setUnitLoadout (getUnitLoadout (_this select 0));
    },nil,3,true,false,"","true",5,false,"",""];
    _anim = selectRandom ["SIT1","SIT","SIT3","SIT_U1","SIT_U2","SIT_U3"];
    [_unit, _anim, "ASIS", _seat] call BIS_fnc_ambientAnim;
} forEach CAP_Loadout;```
#
{
    params ["_unit","_seat"];
    _unit addAction ["Copy Loadout",{
        (_this select 1) setUnitLoadout (getUnitLoadout (_this select 0));
    },nil,3,true,false,"","true",5,false,"",""];
    _anim = selectRandom ["SIT1","SIT","SIT3","SIT_U1","SIT_U2","SIT_U3"];
    [_unit, _anim, "ASIS", _seat] call BIS_fnc_ambientAnim;
} forEach CAP_Loadout;```
#

Neither of the above work. ^

#
CAP_Loadout = [
    [loadout_0,seat_0],
    [loadout_1,seat_1],
    [loadout_2,seat_2],
    [loadout_3,seat_3],
    [loadout_4,seat_4],
    [loadout_5,seat_5],
    [loadout_6,seat_6],
    [loadout_7,seat_7],
    [loadout_8,seat_8]
];
diag_log format["%1",CAP_Loadout];```
still forum
#

(_forEachIndex select 0) That makes no sense. You cannot select from a number.
what exactly about that doesn't work? The action doesn't get added?

drowsy axle
#

It returns that _unit / _seat undefined

still forum
#

Well.. are they?

#

did you check in debug console if each of your entries is defined?

drowsy axle
#

You mean, loadout_x and seat_x?

still forum
#

yep

drowsy axle
#

They're all defined as objects

still forum
#

Did you check in debug console whether they really are?

still forum
#

Are you listening?

#

debug console.

#

in game

#

Maybe add a diag_log at the time you set CAP_Loadout to check

drowsy axle
#

Output: ```sqf
14:13:55 "[[loadout_0,seat_0],[loadout_1,seat_1],[loadout_2,seat_2],[loadout_3,seat_3],[loadout_4,seat_4],[loadout_5,seat_5],[loadout_6,seat_6],[loadout_7,seat_7],[loadout_8,seat_8]]"

#

Changed above CAP_Loadout

still forum
#

Ah duh

#

_this is undefined

#

and params get's values from _this

#

But you need _x

drowsy axle
#

Okay, so _x select 0 etc

still forum
#

no

drowsy axle
#

oh wait lol

#

xD

still forum
brave jungle
#

When I use postInit = 1; on two of my functions, the game will be stuck in an endless loading screen. As soon as I take it off, it loads fine, but the function doesn't run, any help?

still forum
#

you cannot sleep/waitUntil in postInit

#

nor while true

#

or similar

drowsy axle
#

awwwwwwwwwwwwwww thnxs I didn't see that example!

brave jungle
#

Oh really?

#

Damn...

still forum
#

your script needs to exit

brave jungle
#

Would having a new function with postInit that calls these two functions work as a work around??

still forum
#

no

#

the loading screen waits till all postInit scripts are done

#

you can just spawn the content. such that you return right away

brave jungle
#

Oki

rancid pecan
astral dawn
#

Looks like buttons are obstructing each other? Try to set alpha of every button to 0.1 and it will be more clear what is going on

radiant needle
#

Any one know how to use the BIS_fnc_moduleCivilianPresence function?

rancid pecan
#

i don't understand @astral dawn

astral dawn
#

I supposed that your buttons were having wrong coordinates and drawn at the top of other buttons. So I suggested you to make background of your buttons more transparent so that it's easier to troubleshoot this and see what is behind what. @rancid pecan

#

Also you should probably explain your problem better so that others can help you,

lucid sleet
#

hey guys

#

newbie from garry's mod here

#

can i take the invade and annex framework

#

and create my own campaigns and missions

#

instead of running default ones set within invade and annex?

#

it looks like i can turn off their missions

#

but since zeus is built in i'm assuming i can add in my own missions

#

but can i just add within their mission folder

#

and add my own campaigns?

peak plover
#

@tough abyss

#

would know

rancid pecan
#

@astral dawn no draw don't top

austere granite
#

Using the gui editor was a mistake

rancid pecan
#

@austere granite What should I use?

austere granite
#

Text editor of your choice

#

I recommend VS code

rancid pecan
#

i don't know how to use.

astral dawn
#

๐Ÿ˜„ But there is a nice GUI editor actually

#

Did you know about this one @austere granite ?

rancid pecan
#

@astral dawn very thanks

#

i try

austere granite
#

i did but still not a huge fan

#

then again i guess my UI stuff is a little out of the realm of normal behavior and more often than not heavily influenced by scripts

#

I guess if you want a pretty static one that should be quite good akjsually

queen cargo
#

Personally, I hope enscript will make things easier

astral dawn
#

I think it already has a gui editor, right?

austere granite
#

correct

#

haven't looked into enscript usage to actually edit the UI dynamically though

tough abyss
#

Iโ€™m probably gonna hold back and develop the older Armas and let BI fix the bugs etc when Arma 4 finally releases.

tough abyss
#

@still forum well technically you can sleep/waitUntil in postinit, it is just that everything else will get delayed and if condition depends on something that comes after that never comes the game hangs forever

astral tendon
#

Question: If a object with a variable is deleted, does hes variable also gets nill for a JIP player?

queen cargo
#

Was actually talking about bindings

#

Should really Look into enscript...

#

Object oriented way makes it fairly easy to implement bindings myself though if not natively available

astral tendon
#

Because later in a mission on a dedicated server seems that the deleted object also lost hes variable by a isNull check

queen cargo
#

But I still wait for somebody to provide me with the Info required to recreate the vm itself ๐Ÿคทโ€โ™‚๏ธ๐Ÿคทโ€โ™‚๏ธ

tough abyss
#

If the object gets deleted all variables set on it get deleted. When you say later you check variables on deleted object, you canโ€™t, the object is no more, so you cannot query its variables. If however you do objNull getVariable "whatever" the result is nil @astral tendon

astral tendon
#

I mean the variable we give on the editor

#

like isNull MyObject

#

Because it does return true to me in a single player test

winter rose
#

like myCar

deleteVehicle myCar;
isNull myCar; // true
// JIP
isNil "myCar"; // true or false? ```
tough abyss
#

False, not nil

still forum
#

@tough abyss and I think you are gonna argue that people are "technically" not idiots?

tough abyss
#

Well whoever decided to call postinit functions instead of spawning sure thinks highly of humanity

astral tendon
#

That is my question, because I cant do a JIP test

tough abyss
#

@winter rose how is that you understand what people ask and I donโ€™t?

winter rose
#

ยฏ_(ใƒ„)_/ยฏ

tough abyss
#

"Object with variableโ€ FFS! How did you know it is not object with variable set on it but variable which has object assigned to it?

still forum
#

He said I mean the variable we give on the editor

tough abyss
#

That was like miles after

ruby breach
#

But before Lou responded.

tough abyss
#

You say that, but I reckon he new this all along

still forum
#

Lou responded half an hour later ^^

tough abyss
#

Not a very dedicated follower of this channel ๐Ÿ˜

winter rose
#

Hey! I have a life so he said, alone in his apartment

tough abyss
astral dawn
#

Does it have the car script?

winter rose
#

page 42

spring vigil
#

Im trying to assign some a player with the var name z1 to currator from debug using z1 assignCurator myCurator;

#

currator name is Zeus

ruby breach
#

and...?

spring vigil
#

its not working,

robust hollow
#

r u server executing it?

spring vigil
#

yes

robust hollow
#

is the curator already assigned?

spring vigil
#

yes to z1, but he does not have access

#

other option would be to assign the Logged in admin

spring vigil
#

Anyone have a script that would make the logged in admin Zeus?

copper raven
#

there's an option to select it in editor

spring vigil
#

from the Debug, Already in an operation the editor is not an option at this point.

foggy moon
#

Maybe unassign it first?

spring vigil
#

Ive tried it, ```unassignCurator Zeus;
z1 assignCurator Zeus;

copper raven
#

How do you create the logic?

spring vigil
#

Place down in the editor prior to mission . The module for not have a variable name. Itโ€™s name is Zeus and assigned to z1

copper raven
#

And?

#

You can't get into the interface after?

spring vigil
#

Interface is not available. For the player logged in. Iโ€™m wondering if the module is bugged out.

copper raven
#

Try respawning

spring vigil
#

Did , even had him log back in .

#

I can easily fix this in the editor, but currently in operation. Iโ€™m attempting to fix through Debug.

foggy moon
#

Wait it doesn't have a var name? Isn't that what assignCurator needs?

spring vigil
#
z1 assignCurator "ModuleCurator_F";```
still forum
#

No

#

object != string

spring vigil
#

z1 assignCurator myCurator; ive tried this and nothing .

still forum
#

myCurator is a curator module?

spring vigil
#

''z1 assignCurator ModuleCurator_F;''?
i dont understand what curatorObj is for the syntax
usualy i can figure out basic things Im all messed up on this one
ive looked at the fuction you made @still forum and the advice you have given others on the fourm.

copper raven
#
private _module = (createGroup sideLogic) createUnit ["ModuleCurator_F", [0,0,0], [], 0, ""];
z1 assignCurator _module;
diag_log isNull getAssignedCuratorLogic z1;

try that,and check server rpt

spring vigil
#

looking now

#

17:27:01 Setting invalid pitch -0.0000 for L Charlie 2-2:1 REMOTE ?

foggy moon
#

It'll just be a line saying true or false

spring vigil
#

17:26:55 false

foggy moon
#

So it worked

spring vigil
#

worked he has zeus now thanks @copper raven I understand what you did now, thanks for showing me .

slim oyster
#

how does the server mission list display get the mission data for description/mission name? Can other values be fetched?

astral tendon
#
test = cursorObject;
deleteVehicle test;
isNull test; //return false on the first try then true on the second
#

There is a note on the deleteVehicle page saying about that the object becames null on the next frame, can some one add another note saying that is important so commands like isNull that if they are cheking on the same frame without a delay will return false even tough the object was deleted

tough abyss
#

That is what it says in the note already, in its own note box to stand out because it is important

wise frigate
#

Hey guys, I have been breaking my balls for a few hours on this (Such an easy piece of code I don't understand why I can't get it xD)

I wanted to make a small function which would move someone who joined a pilot slot to a specific marker but everyone else to another marker. Here is what i have so far:

_pilots = ["pilot_slot_1","pilot_slot_2","pilot_slot_3"];
if (player in _pilots) then {player setPos(getMarkerPos "spawn_pilot")} else {player setPos(getMarkerPos "spawn_default")};

Pretty sure I must be making a stupid mistake somewhere but if someone could open my eyes to it I would appreciate it!

peak plover
#

ohh nonononoooo

#

player is an object

#

_pilots contains an array of strings

#
private _isPilot = false;
private _player = player;

// check pilot_slot_<0 to 10> for player
for '_i' from 0 to 10 do {
    private _unit = missionNamespace getVariable [('pilot_slot_' + str _i), objNull];
    if (_unit == _player) exitWith {
        _isPilot = true;
    };
};

// set the pos based on _isPilot
player setPos (getMarkerPos (['spawn_default', 'spawn_pilot'] select _isPilot));```
#

I'd do sth like this

wise frigate
#

I see. Thanks will give it a try!

wise frigate
#

@peak plover Works great. Thanks!

half hornet
#

Am I crazy or does HTMLLoad not work with Urls > 255 Characters?

#

I feel crazy

tough abyss
wise frigate
#

@tough abyss Also a good idea, Thanks!

foggy moon
#

Another generic option, assuming no other roles are of the pilot class, is checking their class: if (typeOf player in ["B_Pilot_F"])

gray thistle
#

Little question is a Eventhandler an unscheduled enviroment? -> addEventhandler?

robust hollow
#

should be. you can use canSuspend to double check if you need.

copper raven
#

the event handler script is unscheduled

gray thistle
#

I read up today since i had problems yesterday now i looked again at the enviroments it isn't clearly declared on the arma page but i read related problems. That sleep already paid of from yesterday. Thanks for the information

#

So since everything is timing specific i have now to change the code a lot for better fault handling and bug fixing in the future.

mortal nacelle
#

How would I check if the player is wielding a weapon?

calm bloom
#

OK, solved the problem sorry

tough abyss
#
!weaponLowered player
``` @mortal nacelle
mortal nacelle
#

thank you

digital jacinth
#

Anyone else had a problem that some UI control is weirdly squished, even tho it is configured as a square?
I am currently working on a mod and some people reported a bug which shows the main control squished. i cannot recreate it and so wanted to ask if someone had some similar problem

tough abyss
#

Maybe you configured it wrong and it is dependant on user video settings

digital jacinth
#

thje height and width are configured as such,

w = "pixelW * 128";
h = "pixelH * 128";
#

they are also set in sqf at some point but same rule here as well

#

always pixelX * _value

tough abyss
slim oyster
#
h="128 * (pixelH * pixelGrid * 0.50)";```
#

remember the arma 2 safezone sizes? wew

digital jacinth
#

thanks i'll try that

dusky pier
#

can i #include file from addon?

#

when i try this - getting error - file not found

tough abyss
#

You can, if you give it correct path

dusky pier
#

@tough abyss i need to create prefix file?

#

when i try use addon for that - getting game crash, not found file

#

but path is correct

tough abyss
#

What path you give?

dusky pier
#

#include "\terrano\scripts\macros.sqf"

tough abyss
#

And what is your addon called?

dusky pier
#

terrano

#

path is current

#

on that addon i have pictures and textures. They works fine

tough abyss
#

And the error, it should give the path it is looking at

dusky pier
#

yes, is write current path

#

i think - needed prefix file

tough abyss
#

How do you pack your addon?

small pier
#

Please someone link me a decent tutorial on how to make a Status bar for wasteland, Ripping my hair out here and PC may get thrown out the window

tough abyss
#

Works fine for me without prefix @dusky pier

#

don't include it so it doesn't crash at first, try loadFile it from debug console until you find the correct path

dusky pier
#

work with loadFile

#

sorry, was afk

winter rose
#

shouldn't @ be used in front of an addon path? or only for addons sounds?

tough abyss
#

only sounds

#

The FindSound routine is quite different

mint kraken
#

So on toolboxselectedchanged event I am trying to set a variable to the value it has set it as

#
        _id = _params param [0,4,[4]];
        systemChat str _id;
        RLRP_nemesis_selection = switch case(_id) do {
            case 0: {west};
            case 1: {east};
            case 2: {independent};
            case 3: {civilian};
            default {"EMPTY"};
        };
        systemChat str RLRP_nemesis_selection;

But Its just going as default

#

Used systemchat and it does return a number, then the second systemchat returns the default which is EMPTY So My issue is that the checking is not going quite well

tough abyss
peak plover
#

@mint kraken

mint kraken
#

@peak plover That isnt My issue

#

@tough abyss Already checked Couldnt find anything I was doing wrong

tough abyss
#

Ok then

peak plover
#

looks nothing like yours

#

read the wiki

#

Your answer is in there

winter rose
#

@mint kraken


switch (_CONDITION) do { // not case (condition)
    case 1: { hint "1" };
    case 2: { hint "2" };
    default { hint "default" };
};
peak plover
#

yeah

#

that

winter rose
#

great minds think alike

peak plover
#

great minds read the wiki

mint kraken
#

I didnt see the case there Thanks @winter rose for calling it out

winter rose
#

& @tough abyss & @peak plover ๐Ÿ˜‰

tough abyss
#

@winter rose there it goes again, are you a wizard?

winter rose
#

\o/

mint kraken
#

Well I would thank them but then I would have to thank myself because I Said the same thing to myself โ€Check the wiki the answer might be thereโ€. Which is why This was My last place to ask

tough abyss
#

Next time you should just ask yourself

eager prawn
#

So, pretty basic script, and I've done scripts like this before - but it doesn't work. No errors, but it doesn't play a sound.

Ideas?

this addAction ["Ship Horn", {playSound3D ["sounds\shiphorn.wav", boat1, false, getPosASL boat1, 1, 1, 1000]}];

Testing in singleplayer, boat1 is the name of the ship in which I am using the addAction.

foggy moon
#

Look at Jacmac's example on the playSound3d wiki page, sounds in the mission directory need absolute pathing

winter rose
#

is native wav supported though? (I don't remember)

#

@eager prawn what if you just playSound, does it work?

foggy moon
#

playSound takes a CfgSounds classname

winter rose
#

Ah yes indeed

foggy moon
#

but that would probably be preferable

#

as long as the 3d aspect isn't critical

winter rose
#

@foggy moon I guess it will be for MP useโ€ฆ @eager prawn you could use boat say "cfgSound1" as a workaround

eager prawn
#

can I path it straight from C:/ drive? - as it's only running on one server (doesn't need a defined mission space)

#

and no, say goes over VON

#

I need this to be a ship horn that only travels 1000m

#

the odd thing is that it doesnt tell me the .wav file is missing

#

so it sees it in preprocessing... it just doesnt play it?

winter rose
#

you can remoteExec say

Anyway, I don't know about playSound3D, so I let @foggy moon on the front line ;-)

eager prawn
#

๐Ÿ˜›

#

I'm gonna try doing full path from C:

#

I guess we'll... c

#

๐Ÿ˜‰

foggy moon
#

lol I've fought long and hard with it

eager prawn
#

gah still nothing

winter rose
#

It seems you would need the file on every client too

#

Also, if soundPosition is specified, the passed object is ignored

foggy moon
#

So yeah, Jacmac's note on playSound3d

_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
_soundToPlay = _soundPath + "sounds\some_sound_file.ogg";
playSound3D [_soundToPlay, _sourceObject, false, getPos _sourceObject, 10, 1, 50]; 
eager prawn
#

christ

#

and here I was thinking I could put it all in the boats init

foggy moon
#

yeah, it's messy

#

just throw it in a script and call that

winter rose
#

And seems buggy according to KK's note

foggy moon
eager prawn
#

alright, I'll give that a try tomorrow. Thanks

tough abyss
#

Why SQF is a, uhn, bad thing?

#

Since BI celebrated the end of SQF.

tough abyss
#

Who, what, where?

odd bison
#

Hello guys. I would like to add options to set 3rd person view to be available only in vehicles. Is there any event handler that runs when player switch his view? Or there is only way to use eachFrame event handler?

    if(difficultyOption "thirdPersonView"==1)then{
        if(vehicle player==player)then{
            if(cameraView == "External"||cameraView == "Group")then{
                vehicle player switchCamera "Internal";
};};};}];```
Thank You
young current
#

@eager prawn you could make it a fake weapon and put that in some invisible turret and fire it in command

spring vigil
#
if (["KA_proving_ground",
    "NSS_Admin_Console",
    "MGI_TP_V3","MGI_TG",
    "XEDOM_AdminTool",
    "SSPCM","Revo_DC", 
    "mcc_sandbox",
    "mcc_sandbox_curatorExp",
    "sn_backpack_air",
    "sn_backpack_tt",
    "sn_backpack_sw"
    "SPCONTROLMOD",
    "targetedBUGHANDLER",
    "TPW_HUD"] apply {isClass(configFile>>"CfgPatches">>_x)} findIf {_x} > -1) then{
    ["Admin_Mod", false, 2] call BIS_fnc_endMission;};

//Mods banned off the Server
if(["tf47_launchers",
    "ravage",
    "BloodSplatter",
    "BloodlustLITE_Auto",
    "BloodSplatterLITE"] apply {isClass(configFile>>"CfgPatches">>_x)} findIf {_x} > -1) then{
    ["Restricted_Mods", false, 2] call BIS_fnc_endMission;};


//arsenal Block
if (["PA_arsenal",    
    "VAS_Diag",
    "Gear_Loadout", 
    "KA_VAA",
    "nks_arsenal",
    "Roys_Arsenal"] apply {isClass(configFile>>"CfgPatches">>_x)} findIf {_x} > -1) then{
    ["Arsenal_Mod", false, 2] call BIS_fnc_endMission;};```
#

Iโ€™m probably missing something simple, when testing each works in the debug. When together in the init doesnโ€™t seem to work .

digital jacinth
#

not sure why you need to use apply

if (["tf47_launchers",
    "ravage",
    "BloodSplatter",
    "BloodlustLITE_Auto",
    "BloodSplatterLITE"] findIf {isClass(configFile>>"CfgPatches">>_x)} > -1) then 
spring vigil
#

it was a missing comma after "sn_backpack_sw" as far as apply vs find if im trying to understand that now.

still forum
frigid raven
#

is there any difference between _array select {true} and _array findIf {true} ?

still forum
#

yes

frigid raven
#

regarding performance etc

still forum
#

one selects. The other finds if

frigid raven
#

eh

still forum
#

they are completely different things

#

select copies every element that returns true

#

findIf finds the first element that returns true

#

completely different

frigid raven
#

AH the first that has a true predicate kk

#

only one return value therefore

still forum
frigid raven
#

I can't read

#

jking I can

#

You almost believed me ha

still forum
#

Well then it makes no sense that I answer your stupid questions if you cannot read my answers

frigid raven
#

rude but true

#

Gonna take my stupid questions now and ask them to myself

thorn wraith
#

quick question: will "string1" trigger both blocks or just the first one?

    case "string1";
    case "string2": { hint "string1 or string2" };
    case "string1";
    case "string3": { hint "string1 or string3" };
    default { hint "default" };
};```
languid tundra
#

It does exactly what the hints already tell you^^

#

wait a minute ... why do you have "string1" twice?

thorn wraith
#

that's the question, I'm trying to trigger all applicable code blocks

languid tundra
#

"string1" gets caught by the first case. It will never get to the second one

thorn wraith
#

So I need to drop it through an if tree. OK, thanks

brave jungle
#

Ello you lot, need a hand with something:

Error at:

onEachFrame format [
"
    onEachFrame
    {
        ctrlActivate (findDisplay %8 displayCtrl %9);

        onEachFrame
        {

importing using #include "\A3\Ui_f\hpp\defineResincl.inc"
no.8 is IDD_MULTIPLAYER and no.9 is IDC_MULTI_TAB_DIRECT_CONNECT.

Error:

11:01:32 Error in expression <
    onEachFrame
    {
        ctrlActivate (findDi>
11:01:32   Error position: <onEachFrame
    {
        ctrlActivate (findDi>
11:01:32   Error Generic error in expression
11:01:32 Error in expression <
    onEachFrame
    {
        ctrlActivate (findDi>

Not sure what the problem is? (or is it not located here?)

still forum
#

no.8 is IDC_MULTI_TAB_DIRECT_CONNECT and no.9 is IDD_IP_ADDRESS no they aren't.

#

you are off by one

brave jungle
#

In what I said or the script?

still forum
#

you said

brave jungle
#

Ah

still forum
#

and the script

languid tundra
#

That onEachFrame nesting looks so horrible ๐Ÿ˜„

brave jungle
#

well mb

still forum
#

Like.. what you said and the script don't match

brave jungle
#

not my code

#

Yeah mb

fleet hazel
#

Hi. How to use addActions on the side SERVER.

#

On the server side I create vehicle.
_veh = createVehicle ["FlagPole_F", [8778.79,13252.6,0.00133514], [], 0, "NONE"];
_veh addActions ["Hi", {hint "Hello"}];

dont work(

still forum
fleet hazel
#

@still forum
dont work
_veh = createVehicle ["FlagPole_F", position player, [], 0, "NONE"];
[_veh,["Hi",{hint "Hi"}]] remoteExec ["addAction"];

still forum
#

should

fleet hazel
#

@still forum
not((((

copper raven
#

position player if youโ€™re on dedi, that will not work.

foggy moon
#

What kind of server is this? Dedicated?

tough abyss
#

@copper raven why cross out?

fleet hazel
#

Guys. Why create circular progress bar?

still forum
#

I don't know. Maybe people think it looks fancy?

copper raven
#

@tough abyss Thought he had success in creating the object, just the way he wrote ๐Ÿคท Didn't understand what doesn't work, object creation ,or the addAction

winter rose
#

@fleet hazel sqf // on dedi private _flag = createVehicle ["FlagPole_F", [8778.79,13252.6,0.00133514], [], 0, "NONE"]; [_flag, ["Hi", { hint "Hi!"; }]] remoteExec ["addAction"]; // will add the action to -connected- players. [_flag, ["Hi", { hint "Hi!"; }]] remoteExec ["addAction", 0, true]; // will add the action to every player, even JIP

#

also, do not create on player's position, because the mission can be player-hosted or run on a dedicated server, where player is null

fleet hazel
#

@winter rose Thanks for your help. I will start it at the very beginning of the start of the mission.

#

@winter rose I will use two version you code

winter rose
#

@fleet hazel two versionsโ€ฆ?

fleet hazel
#

@winter rose [_flag, ["Hi", { hint "Hi!"; }]] remoteExec ["addAction", 0, true]; // will add the action to every player, even JIP

winter rose
#

Oh version #2, ok

marble pasture
#

is there a location for the images/videos that are used in the arma loading splash screen? like, when you use -skipintro

tough abyss
#

Hey, haven't done too much research on this topic and I'm not sure where to start. I'm looking to create a script for my unit due to often arsenal-abuse by certain individuals. Especially when players make their own modified version that bypasses our blacklist for mods. Is there a way to create some sort of mission script which would make a text notification in side chat in case someone opens an arsenal or executes a script through a debug console?

novel trellis
#

hi, not sure if im in the right area but a mission maker i know is trying something out, he knows how to get custom sounds into a mission file using cfgsounds and say3d but is there anyway you can call these sounds from a custom modpack rather than adding the files into the mission file to keep the size down for the people that play it. ive tried things as simple as changing the file path which allows the mission to boot with no errors but no sound plays

minor lance
#

Hello!

#

Is there any specific way I can set a dialog to be displayed on top of AAAAAALL the other dialogs?

#

like the very very first layer

nova shuttle
#

@tough abyss As far as I know it's a case of enforcing signatures & use something like ACE's PBO whitelist

tough abyss
#

Wouldn't that result in the "Mission Won" screen for those who don't have whitelsited mods

nova shuttle
#

Negative. You can set it up to either warn or kick them, and if warned it also pops up in global chat

tough abyss
#

Hm interesting, so it will essentially issue a warning if someone is using something other than the whitelisted mods, correct?

nova shuttle
#

Correct

#

In terms of making sure they don't modify other mods to "sneak" mods in, if they're really doing that I'd look at how important they are to the community with an obvious disregard for regulations. BUT that's not the purpose of this channel lol. If you want to stop them smuggling, you need to sign everything and verify signatures

tough abyss
#

Yeah of course, we just like to make sure to have evidence before proceeding with anything in the unit.

#

And we always like to confront them directly with solid evidence, so the warning thing would work perfectly for us.

#

But that ACE feature could very well provide us with what we're looking for.