#arma3_scripting

1 messages ยท Page 273 of 1

jade abyss
#

Yep, Discord sucks atm

little eagle
#

I thought he had some cyrillic in his name

#

But even copy paste doesn't work

#

screw it

jade abyss
#

Nah, i had the Prob with Audiocustoms a few weeks ago too

#

Then a few min later -> Worked

little eagle
#

Estron besitzt Arma 3 Vor 7 Stunden

Ursprรผnglich geschrieben von Capt. Mandrake:
Where are the CBA Devs? Why is there no communication?
because they suck?

#

also screw you

#

you suck. we don't support on random forums like Steam. Deal with it

vital onyx
#

hehe, funny situation

#

commy2: >Estron besitzt Arma 3 Vor 7 Stunden

Ursprรผnglich geschrieben von Capt. Mandrake:
Where are the CBA Devs? Why is there no communication?
because they suck?
[3:29 AM] commy2: also screw you
[3:29 AM] commy2: you suck. we don't support on random forums like Steam. Deal with it

Here we name it by a catch phrase "Toad fucked the viper"

rancid ruin
#

you could always add a line to the workshop description telling people where you do offer support

little eagle
#

Or take it off the workshop ๐Ÿ˜ƒ

#

I hate people that think they are entitled to anything.

tough abyss
#

@little eagle im entitled to you ๐Ÿ˜Ž

stoic sphinx
#

Hey guys, need some ideas.

#

I need an AI to walk through a wall on purpose. But not the player.

#

Any suggestions?

#

disableCollisionWith does not achieve this, as it allows both the player and AI to walk through

lyric ginkgo
#

is the AI local to the player?

stoic sphinx
#

AI is local to server

little eagle
#

AI is local to whatever machine the group leader and group is local to

stoic sphinx
#

AI will be local to the server

little eagle
#

So if you're the group leader, they are on your machine

stoic sphinx
#

For my purposes, the AI will be local to the server and will not be grouped to the player

lyric ginkgo
#

if you run "disableCollisionWith" only on the server, between the AI and the wall, then you should achieve your results. This should be the case regardless of locality. Perhaps you have an execution issue?

little eagle
#

They could also be local to the Zeus that spawned them.

#

Or a headless client

#

You can't just say they're always on the server

#

That's just not true

#

disableCollisionWith is wonky anyways

lyric ginkgo
#

@little eagle It is true if it's spawned by the server and you don't fiddle with setOwner/setGroupOwner

stoic sphinx
#

@lyric ginkgo Reviewing my code...

little eagle
#

Yeah. They're also always local to server when they're local to the server. Your point?

lyric ginkgo
#

You claimed that it's "just not true" that the AI is always local to the server. I was pointing out that there are situations where that is the case.

#

But you are correct in the regards that "disableCollisionWith" can be wonky

little eagle
#

I don't think you understand what you just wrote

stoic sphinx
#

Ok, I've found my problem. "disableCollisionWith" is not working with walls for some reason. However, it will work with wall gates and buildings.

#

"disableCollisionWith" is wonky

little eagle
#

My words

stoic sphinx
#

I'm using this code:

lyric ginkgo
#

Perhaps the wall itself isn't local? What kind of wall is it? How was it spawned?

stoic sphinx
#

{ _x disableCollisionWith player } foreach (nearestTerrainObjects [player,[],10])

#

It's an editor wall, it was already on the map

lyric ginkgo
#

Also commy, I perfectly understand what you wrote. Perhaps you don't understand what I wrote? Or I don't understand what you wrote?

tough abyss
#

Well then you dont perfectly understand him

lyric ginkgo
#

If you're disabling collision between the wall and the AI, why are you using "player"? For testing?

stoic sphinx
#

It's hard to get the AI to move through the wall as they will walk around it, even if it has disablecollision.

#

So ill test with the player first

#

Then work out how to get the AI to walk through the wall

#

in a straight line

lyric ginkgo
#

Yep, the AI part is usually the trickiest :p If you want it to walk through the same wall in the same location and the same way every time, I would use "moveTo" in conjunction with setting AI behavior (specifically disable combat mode)

stoic sphinx
#

My real goal here is to make the AI to climb over the wall using an animation. But they keep moving around it, like any good AI does.

#

I'm breaking the AI on purpose

lyric ginkgo
#

oh. In that case, you'll probably just want to have the AI play the animation and disable movement

stoic sphinx
#

How so?

lost tulip
#

Anyone had any problems with CBA and BattleEye refusing to work together after adding exceptions?

stoic sphinx
#

@Quicksilver Just tested agents, they do not respond to doMove commands. It's unlikely that i'll use them.

#
  • @tough abyss
#

doMove on rabbit agents seems to work

#

Sorry, I meant moveTo, not doMove

#

I used this code:

#

tr = createTrigger ["EmptyDetector", player modelToWorld [0, 10, 0]];
tr setTriggerArea [5, 5, 0, true];
tr setTriggerActivation ["CIV", "PRESENT", true];
rabbits = [];
private "_r";
for "_i" from 1 to 10 do {
_r = createAgent [typeOf player, position tr, [], 0, "NONE"];
_r setVariable ["BIS_fnc_animalBehaviour_disable", true];
rabbits pushBack _r;
};
tr setTriggerStatements [
"if (rabbits isEqualTo thisList) exitWith {
_r = thisList select floor random count thisList;
_r moveTo (_r modelToWorld [2.5 - random 5, 2.5 - random 5, 0]);
};
_esc = rabbits - thisList;
doStop _esc;
{_x moveTo position thisTrigger} forEach _esc;
systemChat str [time, _esc];
false",
"",
""
];

#

//It's from the agent wiki page

#

//The code above is meant to make the agents move. It works for rabbits, but not people

little eagle
#

at the start and end for code blocks

stoic sphinx
#

I guess I can make parkour rabbits

cerulean whale
#

I hate this game lol

#

I had a thing working, changed something and it didn't work

#

so I changed bakc

#

and it's still brojke

#

logic

jade abyss
#

Yeah, i once had the same problem. I did something different, then it worked.

#

๐Ÿคฆ

cerulean whale
#

Logic... I restart the server and it works... even though nothing was changed from when it was broken

#

haha

cedar kindle
#

Afaik CBA doesnt really have an "official" release place outside the BI forums and the WS

github

tough abyss
#

Is there any way to make an RscEdit box multi lined

meager granite
#

should be, one of styles

#

#define ST_MULTI 0x10

#

try this

little eagle
#

@lilac halo CBA on steam is up to date and not broken. No idea what your issue is. Also we don't do support on random forums like the Steam Workshop. We have a github issue tracker.

winter field
#

@lilac halo - This so much ./\ - Basically almost all the big mods have their own bug trackers - If you have issues post them on their trackers. Pretty much every mod in the readme will tell you where these bugtrackers are. For instance CBA/ACE3/TFR/ACRE2 are all on github.

Devs only have so much time and they do want their projects to be bug free. But devs don't have the time to go trawling through steam workshop/twitter/facebook/BI forums/A3 discord etc. for issues and provide the level of support that game developers are paid for. For us it's a hobby. If you have issues take it to the relevant team's offical bug tracker - There's also several mods that also make use of public discord/slacks where you can talk to the devs and other users.

manic sigil
#

I'm running the script found here: http://www.kylania.com/ex/?p=21 . It was designed, as I understand it, for Arma 2 and throws a few errors that I've managed to trim out (Hacksaw methodology of troubleshooting, I know.) and functions fairly well.

#

My only issue is that the missiles have a really bad arc; even if I set the starting point two kilometers above sea level, more often than not the missiles will impact the ground just shy of the laser target point.

#

It's possible to hit targets by lazing behind them, but it's touchy, unreliable, and feels off.

#

The end result I'm looking for is similar to the ARMA 2 campaign section where you call in cruise missiles; I'm trying to recreate Operation Harvest Red as a curated event in A3 with CUP.

tough abyss
#

@meager granite will do, thanks.

tough abyss
#
{
 access = 0;
 type = CT_EDIT;
 style = ST_LEFT+ST_FRAME+ST_MULTI;
 x = 0;
 y = 0;
 h = 0.04;
 w = 0.2;
 colorBackground[] = {0,0,0,0};
 colorText[] = {1,1,1,1};
 colorSelection[] = {1,1,1,0.25};
 font = "TahomaB";
 sizeEx = 0.04;
 lineSpacing = 1;
 autocomplete = "";
 text = "";
 size = 0.2;
 shadow = 0;
};
class Server_notepadDialog
{
    idd = 90006;
    movingEnable = true;
    enableSimulation = true;
    onLoad = "";
    class controls
    {
        class EditBox: Server_RscEdit
        {
    idc=400010;
            x = 0.29375 * safezoneW + safezoneX;
            y = 0.225 * safezoneH + safezoneY;
            w = 0.4125 * safezoneW;
            h = 0.55 * safezoneH;
            text = "";
            sizeEx = 0.05;
        };
    };
};
#

@meager granite I tried what you said but no text appears. Changed the color to gray to make sure the box was there, and it was

meager granite
#

I just checked into what debug console uses and it has ST_MULTI and it works there

#

something else breaks your control then

tough abyss
#

Aight ill mess around see what the hell im doing wrong

#

Found my error

#

:/

tough abyss
#

changed type fromCT_EDIT to 2

#

same for buttons.

#

Except they became 1

meager granite
#

Did anyone ever experienced that forEach might not define _x if one of iterated values in array is nil?

jade abyss
#

not that i know of.

tender root
#

hey all is there a command/function which returns the ammo of a static weapon stored in a backpack

lyric ginkgo
#

Don't think there is a function, but you can probably check the type of backpack, use it to grab the type of static weapon, and go from there

tender root
#

so there is no way i can get the ammo which just the backpack given ?

#

thinking

lyric ginkgo
#

DerZade, are you trying to grab the type of magazine while the backpack is still on the player? Would you like a consistent solution, or just a specific solution for a certain set of static weapons/magazines?

tender root
#

it has to be a consistent solution

#

so i just need to get the invisible turret for the coresspoinding backpack

#

beacuse a want to be able to set and get the ammo of the turret

lyric ginkgo
#

You might be able to get the classname of the static weapon from the backpack config. Then you can check the config of the static weapon for the weapons/magazines

tender root
#

the problem is that I want to know wether the wepon has been shot yet and how much ammo is left

lyric ginkgo
#

ahhhh... now I see what you mean... I'll let you know if I find the courage to start my game again :p

tender root
#

Thanks in advance ๐Ÿ˜ƒ

lyric ginkgo
#

Thinking the best way to do it is to use a "fired" EH in conjunction with the "WeaponAssembled"/"WeaponDisassembled" EH. The problem is that "WeaponDisassembled" won't fire if the weapon isn't local, so you might have to do some tricky stuff

#

Also, you'll probably want to use setVariable on the static weapon, but if it's a fired EH and the rate of fire is high enough, you might run into performance issues; most importantly network issues if it's on a multiplayer server. So I think the getOut EH would be best. Not sure it will fire if somebody disconnects from the weapon though, so you'll have to use your judgement on that.

#

Save the ammo count using setVariable using Fired or GetOut EH, and use "WeaponDisassembled" to apply the variable to the backpack that holds the weapon. Then you just grab the variable again on "WeaponAssembled", and apply the saved ammo loadout.

#

Just brainstorming here, there might be a better way, but that's just my 2 cents.

tender root
#

That wont work for me because i would have to add it to every static and how should i do that ?

#

to make my problem more clear: This is for a mod called BackpackOnChest which allowes the player to carry a extra backpack on his chest. The backpack itself isn't saved its beeing replaced by a SimpleObject...

#

when a player puts his backpack (static with no ammo) on the chest and then back on his back the static will be full again

leaden summit
#

Is there a way to playsound and have the volume slowly increase over time, without editing the ogg file to do that?

tough abyss
#

Use fadeMusic

leaden summit
#

That only works for music doesn't it? A lot of players have music turned off, and this is for wind sounds

#

I see there's a fadeSound as well, but that does all sounds from the looks of things

tough abyss
#

Yes.

#

Misread sound for music.

#

Guess that happens when you have a couple drinks in your system.

#

You could attach the sound to an invisible object and attach it to the player and then move it gradually from/to the player. Then delete it once the sound is over.

#

Honestly for all that trouble, just fade the ogg file

#

Don't think there is a command for it.

leaden summit
#

Yeah it's a little annoying there's not more fexability to the playsound command. But thanks

leaden summit
#

Next question in multiplayer, if you use player in a script will that apply to every player on the server? Like if in a script running on the server I said player setdamage 1 would that kill everyone?

loud sorrel
#

hey there, i tried for about 2 hours to add an action to an H-barrier (Land_HBarrier_Bbig_F) with addaction in the initfield. it works fine with other items, but it doesnt work with those barriers, any help would be great!

leaden summit
#

Make sure it's not a simple object or has simulation turned off, pretty sure 1 or both of those has an effect

loud sorrel
#

what do you mean with simple object @leaden summit ? give me a second to check the simulationthing

#

oh, i see, thats an attribute that can be set in editor to save performance, got is

#

*it

leaden summit
#

Yeah it removes physx etc

loud sorrel
#

wow, that's it!!! Thanks alot JD!!!

leaden summit
#

No worries, glad I could help. Fell into that trap before myself

loud sorrel
#

finaly i can continue! costed me about 4 hours today ๐Ÿ˜„ sometimes arma is a real bitch for a new missionmaker ๐Ÿ˜„

leaden summit
#

Haha even when you've been doing it for years you can still sit there pulling your hair out wondering why something doesn't work

loud sorrel
#

oh yes, i guess so

#

man, now even aceinteraction works perfektly on it, that was my first plan ๐Ÿ˜„ ๐Ÿ˜„ really, thanks a lot for that hint, i am so glad now ๐Ÿ˜„ ๐Ÿ˜„

leaden summit
#

Cool, glad I could help

tough abyss
#

Nope, it would need to be broadcasted to all the clients. Using remoteExec

#

But if a client is running the script, player applies to the client

leaden summit
#

Right I get it thanks

thorn saffron
#

I'm trying to detect when player is firing a vehicle weapon. Wiki says that fired EH will not trigger when player is in the vehicle though, would CBA help?

worn hatch
#

Hey does anyone know what scripting command it is you use to create a custom inventory UI? or has anyone got a guide

coarse dagger
tough abyss
#

@coarse dagger dialog control

thorn saffron
#

I'm using a firingman EH, how can I get the "caliber" value of the ammo used by the trigger?

#

would this work?
_caliber = getArray (configFile >> "CfgAmmo" >> _ammo >> "caliber");

rotund cypress
#

You dont need to do getArray

#

just do params ["","","",""]

#

and it will be in the order on the wiki

thorn saffron
#

@rotund cypress sorry but I can't find the article that would have it

rotund cypress
#

FiredMan would be params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_vehicle"];

thorn saffron
#

yeah, but I want to get the caliber of the ammo

#

its one of the config elements for ammo

#

class Sh_140mm_APFSDS : Sh_120mm_APFSDS {
airFriction = -4e-005;
typicalSpeed = 1800;
hit = 650;
caliber = 35;
indirectHit = 20;
};

#

I think something like this is more proper, yes?
_caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber");

little eagle
#

there is no caliber in Arma

#

it's just display names

#

and class names I guess

tough abyss
little eagle
#

seems pointless. just get a real text editor

tough abyss
#

it has a feel of VS with the intelisense

#

unlike real editors* (afaik)

little eagle
#

You mean syntax check?

tough abyss
#

ye

dusk sage
#

digging the windows xp theme

#

i'm digging the cpack idea

lime tangle
#

Windows XP theme

#

I'm sold

dusk sage
#

I'm not quite understanding the SQX thing, but looks neat

#

More leaning towards .NET devs though

little eagle
#

Still pretty pointless. SQF syntax is stupidly simple. All proper text editors have syntax highlighting and that's all you need.

dusk sage
#

It's not about being stupidly simple, he's taking on a project that's more than just highlighting, of which there are few

lime tangle
#

And a linter

dusk sage
#

And building around this CPack idea, which is neat

lime tangle
#

It's essentially a linter

dusk sage
#

Indeed

#

Which we have for IJ currently

lime tangle
#

Is there?

dusk sage
#

I think someone was making a VSC one

#

Can't remember

lime tangle
#

There's an IJ linter?

lime tangle
#

Oh daddy

#

This is christmas

dusk sage
#

still active

lime tangle
#

Intellij is such a nice IDE

#

Bit cumbersome sometimes but so featureful

#

It had the advantage of a full Dev team

dusk sage
#

I don't personally use IDEA, but I use CLion and Rider

#

Still built on IJ platform, and they are brilliant

lime tangle
#

Mm. I just started using IDEA for LibGDX

#

I hate Java as much as I hate SQF

thorn saffron
#

I'm checking hit caue and seeing if its more than 12 and more than 35 how can I set uo switch and case conditions?

#

how can I check if _hit is at the same time more than 12 and less or equal to 35?

#

for some reason this does not seem to work for me:
switch (_hit) do {
case (_hit > 35): {
enableCamShake true;
addCamshake [1.3,0.4,15];
};
case (_hit > 12 ) && (_hit <= 35) : {
enableCamShake true;
addCamshake [0.3,0.2,15];
};
case (_hit <= 12): {
enableCamShake true;
addCamshake [0.1,0.1,15];
};
};

lime tangle
#

Not work?

#

Is there an error or is the behaviour not as expected?

lyric ginkgo
#

@thorn saffron switch (true) do { case (_hit >= 35): { enableCamShake true; addCamshake [1.3,0.4,15]; }; case (_hit > 12): { enableCamShake true; addCamshake [0.3,0.2,15]; }; default { enableCamShake true; addCamshake [0.1,0.1,15]; }; };

lime tangle
#

Thanks for being less lazy than me

#

I was going to try and help him work through it but answers tend to work better anyway haha

lyric ginkgo
#

the value in the "case" has to match the value in "switch". Since you're evaluating the value of _hit, you're checking if something is true or false; in this case you're checking if something is true. IE, if _hit is more (or less) than a certain value

#

so the script will evaluate all of the cases (in this situation, two cases). It will then run the code under default if none of those cases match

#

So first, _hit will be evaluated if it is greater than or equal to 35. If not, it will then be checked if it's greater than 12. If not, it will go to the default value.

#

Note that you don't have to do (_hit > 12) && (_hit < 35)

thorn saffron
#

thanks, I will test it out right away

lyric ginkgo
#

This is because when _hit is 35 or greater, it is handled by the first case block. Therefore, checking if _hit is less than 35 is redundant at that point, because if it wasn't, it would already be handled.

thorn saffron
#

hmm for some reason it does not function for me, no errors though

#

Im editing the LAxeman's recoil script in order to add camera shake to vehicles

#

I got it working, but I wanted to have different amount of shake depending on how big the gun is, the easiest way was to look up the hit value of ammo

#

odd it stopped functioning, maybe your code was correct after all and I just messed up soemthing else

#

@lyric ginkgo got it working now, thank you very much for the help

vague hull
#

I find this so pretty:
_objects = objects which need to be around
_near = (player nearObjects 10) apply {typeOf _x};
_isOk = (count (_near arrayIntersect _objects)) isEqualTo (count _objects);

meager granite
#

count _objects == count nearestobjects [player, _objects, 10]

#

assuming _objects is list of class names

#

and assuming you can't have more than 2 objects nearby in the mission

vague hull
#

there could be duplicates in the right side of that one

#

this was actually my first aproach then needed to rethink, because players are able to create those objects so nothings safe ^^

leaden summit
#

If you add a long sleep command to a script, is that impacting performance while it's sleeping?

#

with reference to being part of a loop. Like if I want to call a script randomly every 45-90mins what's the way that will effect performance least?

dusk sage
#

Well if you're keeping that pseudo-thread open for a long period of time, this will affect the others

#

But will it 'impact', no, as long as you're not running 100's

leaden summit
#

Ok cool so if I create a loop that fires then sleeps for say 2700 second before looping again, that's not really going to be noticed?

#

If not is there any issue with placing that loop in the init.sqf?

dusk sage
#

You can place it wherever you want, it will have the same affect, seeing as you'll have to spawn it

#

You won't notice any difference, no

leaden summit
#

Cool, thank you

steady jungle
#

(Addactions) Does anyone know if you can without a mod disable/remove/modify exsisting A3 addActions? The specific one I'm looking to remove is "Set up Kart". Looking to either remove it or make it so when that addAction is selected that a script of my own would get ran instead.. I'm assuming the answer is no. However, would appreciate input..

meager granite
#

Its general Set Up * action that turns over upside down vehicle

#

@steady jungle Your best bet would be blocking it in inGameUISetEventHandler

vapid frigate
#

i don't think you can remove a built in 'action' without modifying the config (which you can't do without a mod)

little eagle
#

They won't be playable with slow PCs

#
    class Kart_01_Base_F: Car_F {
        class UserActions {
            class PressXToFlipTheThing {
                displayNameDefault = "Set up the Kart";
                displayName = "Set up the Kart";
                position = "";
                radius = 2.7;
                onlyForPlayer = 1;
                condition = "alive this AND not canmove this AND count crew this == 0";
                statement = "this setpos [getpos this select 0,getpos this select 1,(getpos this select 2)+2]";
            };
        };
#

"Set up the Kart" is a config based action and not done via addAction

#

It can therefore not be removed with removeAction, but as Sa-Matra said, you can block it with inGameUiSetEventHandler as long as it's just a mission and no mod you use ruins it by overwriting it.

#

Also, fuck them for mixing setPos and getPos. You can sink the kart into those walkable harbour port pieces because they doesn't understand their own position madness.

warped fractal
#

How can I make a trigger that checks for 30-40% of playable units are within the trigger itself then activates once that amount is within the area. I'm trying to make an RTB objective that triggers the end mission

#

I've tried
{_x in thisList} count (playableUnits + switchableUnits) > 3

#

but that only looks for if more than 3 exact people are within the area, but i want a percentage

indigo snow
#

just divide by the total number of (playable) units

#

(or multiply the other side)

#
{_x in thisList} count (playableUnits + switchableUnits) > (1/3)*count (playableUnits + switchableUnits)

would be 33%

warped fractal
#

Ay it works, thank you

meager granite
#

I so wish count, apply and select had _*Index variables in them

#

_countIndex, applyIndex, selectIndex

#

or _forEachIndex as in forEach for unification

little eagle
#
private _i = -1;
some_array apply {
    _i = _i + 1;
    <blah>
};

I guess

#

If you add this _forEachIndex you might break old code

#

apply inside forEach loop which uses it

meager granite
#

the point is to have index counter handled by the engine for performance

#

Also, how come there is no += or -= command, I would work just fine with current scripting engine

#

@little eagle Which old code? I don't think much people used to count their own _forEachIndex inside count code structures

little eagle
#

nah wait

meager granite
#

Oh you mean _forEachIndex on higher scopes

little eagle
#

yea

meager granite
#

Yeah, I guess

#

Well, should be iterator-specific variable name then

little eagle
#

you always have that risk when adding magical locals though. Someone might use _countIndex as variable name already

meager granite
#

Chance is extremely slim that this happens

#

And there were much worse backwards compatibility breaks already, nobody will die because of it

#

_i += 1;

#

Now this would be great, single command instead of two

#

We already have this sort for arrays in form of append, why not let have it for number and strings

little eagle
#

it's another assignment operator

#

which would be another keyword internally

#

not that that should stop anyone

#

It's a bit different internally from append

meager granite
#

Well += is not assignment but binary operator

little eagle
#

Nah.

meager granite
#

Anyway, we can only dream

little eagle
#

You have to reassign a value to _i

#

numbers are not pointers like arrays

#

I could do it in ~ 30 minutes

meager granite
#

Assignment is special construct in SQF, there is only two assignments right now: = and private =

little eagle
#

But BI takes no PRs

#

Yeah, and this would be the third variant

meager granite
#

You can call pretty much any command "assignment" of something then

little eagle
#

nope

meager granite
#

I was talking in sqf terms

little eagle
#

still no

meager granite
#

assignment has special handling of variables unlike other commands

little eagle
#

I guess

meager granite
#

+= will do nothing regarding to defining variables in current scope so its not really an assignment

little eagle
#

it is

#

_i += 1;
assigns a new value to _i

meager granite
#

No its not, by this logic append or resize is assignment too

little eagle
#

nope

#

arrays are pointers

#

so you can manipulate them with commands

#

that is not the case for numbers

#

you need to assign a new number to the variable

#

one that is incremented by N

#

with base of the old value of the variable

meager granite
#

replace number with array in your sentences and it will make just as much sense

little eagle
#

But arrays are different from numbers in SQF

meager granite
#

I'm not talking about variable types but of sqf constructs

#

+= just like append is not an assignment, it is binary command

little eagle
#

Same thing. They are different internally

#

Doesn't work with numbers, just arrays

#

I mean

#

you could do anything with the parser

#

but it would be fundamentally different from anything that is SQF now

#

append manipulates an array

#

but you can't do that with numbers, they are not passed by pointer

meager granite
#

pointers have nothing to do with this, practically speaking any sqf variable has pointer to some real game construct be it number or array or entity

little eagle
#

yes they do

#
  • _array copes the array
#
  • _number does nothing like that
#

that is why append is different from +

#

after you use append you manipulated the array

#

_i += 1;
would work just like an assignment operator

#

although there are multiple ways to implement this

#

all assignment operators are keywords

#

it's really just = with sometimes private atm

meager granite
#

You don't get what sqf assignment is, it has nothing to do with pointers or rules how variables are handled, if it will be implemented it will be as usual binary command

little eagle
#

one that assigns a new value to the variable on the right hand side

#

there is nothing like that in SQF atm

#

so it would be something entirely new

meager granite
#

This way you can say that setDamage is assignment since it assigns something somewhere

little eagle
#

nah, you don't change any values of variables with that command

#

you manipulate the ingame world

#

no SQF variable is changed with setDamage

meager granite
#

private is not assignment, it is unary command, private = is assignment

little eagle
#

I never said that

#

I said = and that sometimes works with private

#

Weather that counts as one or two assignment operators does not interest me

#

you could argue for either

meager granite
#

When game processes _i + 1 it doesn't actually send value of _i into whatever code handles + command, it sends same pointer to _i variable just like any command that operates arrays

little eagle
#

so it assigns a new value to _i then

#

numbers are not pointers in SQF

meager granite
#

<Number> + <Number> command in particular just takes values it could have as well handled it as arrays and modified _i if developers wanted

little eagle
#

and returns the sum

meager granite
#

the point is that we're talking about different "assignments" here, you about assignment meaning in general, I talk about sqf assignment

little eagle
#

you can assign that with = then

#

no, I'm too

#

name another command that manipulates Numbers by pointer

#

there is none

#

in SQF that only every happens to arrays

#

so you make something fundamentally new

#

if you say *= wouldn't be a assignment operator

#

Which would be the fastest way to implement it

meager granite
#

Your argument against classifying append as assignment was that arrays are handled as pointers while in fact everything is handled as pointers, its just up to command to modify original variable or not.

little eagle
#

SQF only has arrays as pointers

#

internals don't matter

meager granite
#

Your description makes append an assignment which is not

little eagle
#

you can change the interals without chaning what SQF is

#

append is not an assignment

#

_array#1300 append _another_array

#

_array#1300 is still array no 1300 afterwards

meager granite
#

The main difference between assignment and command is that assignment handles variable declaration, if its local variable it walks up the scope to see if there is variable or creates new one in current scope if there is none

#

If you classify += as assignment then you could do

_a += 5;

which would be identical to

_a = 5;
#

Assuming no _a is defined in this or higher scopes

#

While in fact _a += 5 should not be treated as assignment and throw undefined variable error

#

If you still call it assignment then you might as well call setDamage assignment or anything else

tame portal
#

I agree with @little eagle

little eagle
#

I think everything has been said. It's a philosophical debate, so it's entirely pointless anyway. In the ends it's all just zeroes and ones.

tame portal
#

I was quite surprised when I found out that arrays are treated as pointers in SQF

#

It gave me a headache first before I realised I had the same pointer in all my array variables lol

meager granite
#

This is just how SQF works, = and recently introduced private = are assignments and everything else is commands, the point of assignment is to declare variables, everything else just operates existing variables, be it by copying or modifying variable value.

#

Well, you can sort of call <namespace> setVariable assignment but it deals with globals only

#

Yes you probably could make += assignment but then it would make it work like in example above which breaks sqf rules of variable declaration before usage.

waxen dagger
#

guys, i'm having some weird bug with remoteExec.

btc_combatSupportObject allowDamage false;
btc_combatSupportObject setDir 62;
[btc_combatSupportObject] remoteExec ["btc_fnc_cs_addAction", 0, true];```
This code runs on the server
#

everything works in SP (ofc ๐Ÿ˜› ) but not on the dedi

#

btc_fnc_cs_addAction = (_this select 0) addAction ["<t color='#ff1111'>Request vehicles</t>", "0 spawn btc_fnc_cs_handle;"];

rotund cypress
#

Is there a difficulty option to enable tactical ping on servers?

hollow vigil
#

Does anyone know how to block the single player cheats from being used on a mulitplayer server? We're currently experiencing a lot of players using the "ENDMISSION" cheat command.

The only documentation I was able to find on it is the following (which is pretty much useless): https://community.bistudio.com/wiki/ArmA:_Cheats#ENDMISSION

lime tangle
#

Lol

#

Hi Lako

tough abyss
#

@hollow vigil Tested it on my server, seems client sided.

#

just disconnected me from my game

lime tangle
#

It's a built-in feature to arma cloud

#

But you might be able to override it like you used to be able to to override alt-f4

hollow vigil
#

Ye, just heard that it's possible to disable it though, most likely ghetto method but hey it's something

lime tangle
#

I'll see if I have my script to block alt-f4 somewhere

#

It's a bugger I'm on holiday so I only have my laptop. I'll search my repos from arma 2

tough abyss
#

i thought you meant it ended the server mission. I get what you mean now as it can be exploited

hollow vigil
#

@tough abyss The issue with it is that people use it to softlog, we have a combat timer that prevents people from logging out mid-combat but this way they just bypass it straight up and they're just able to respawn in shortly after. Normally they would have to alt+f4 and rejoin which leaves plenty of traces, this way is fast and efficient for them.

lime tangle
#

Mmm

#

I can't believe no one has handled this before

#

Or that there isn't a disable for it somewhere

#

Have to write something hacky as usual for arma

tough abyss
#

@hollow vigil yeah thats wwhat i figured

lime tangle
#

Right in this arma 2 script I wrote I'm just hijacking the key press event handler

hollow vigil
#

We're logging people doing it and handing out bans if they use it to gain an advantage, but there's hundreds of players using it and at this point we rather just block it completely.

steel mantle
#

do infistar logs that kind of stuff?

#

when you do the Shift - ENDMISSION

hollow vigil
#

We're aren't using infistar, so I honestly don't know.

lime tangle
#

It looks like a pain to block asofar because it doesn't use any unique keys

#

So you can't just block minus on the keypad as people have to use this for other shit

#

So you may well have to record the combos which is shit for optimisation as its recording all keys pressed in a row

#

There may be a more elegant solution but intercepting the key presses is all it seems that arma is going to let us do

steel mantle
#

is it possible to log it if we create a script that detects the keys you press like hold down Shift and minus key?

lime tangle
#

Yeah

hollow vigil
#

I can show you what we did for the endMission

lime tangle
#

Also you can detect the mission ending

hollow vigil
#

as its the only cheat command that really concerns us

lime tangle
#

Is this eating up all your runescape time Lako haha

hollow vigil
#

Nah, multitasking is the key

lime tangle
#

Haha. Grinding on one screeb

#

Arma discord on another

#

I might be able to get old school runescape running on Linux if I faff about

#

Also Lako you might want to block crash as well if it comes to it

hollow vigil
#

Disabling the cheats altogether wouldn't be bad, one we got the most concerns with though is endmission

lime tangle
#

Yeah. It's odd that Bohemia would include such a feature and not have a disable for it in mission.sqm or something. But then again what can you expect from Bohemia.

hollow vigil
#

If anyone were interested in the loggin then it's possible to log it with the following:

addMissionEventHandler ["Ended", {
if (_this == "ENDDEFAULT") then {

};
}];

steel mantle
#

yes sure lakotiz ๐Ÿ˜ƒ what did you do with endmission on your server?

#

okay ty ๐Ÿ˜ƒ

lime tangle
#

Nice

#

Lako maybe check their level and set it to 0 if it's over 1 as a meme

#

Then wait for the bug reports to roll in

#

And laugh as they pretend they did nothing

rotund cypress
#

What do you maen by that @lime tangle

hollow vigil
#

Removing 10% of their bank balance per time is better

lime tangle
#

Yeah

rotund cypress
#

Oh lol

lime tangle
#

Just wait for the bug reports

hollow vigil
#

"Appears you skipped the syncing when you logged out and some of your data was lost"

lime tangle
#

Lol

rotund cypress
#

Checks their bank account: oh god dammit

lime tangle
#

Delete some vehicles for good effevt

#

'Crushed by magic'

hollow vigil
#

Anyways I'm heading off Discord, I'll check in again tomorrow to see if there has been any progresion on this issue, take care.

lime tangle
#

Haha. If someone says anything interesting I'll message you on the forums

thin pine
#

Quick question. AllowDamage set to false. Does the HandleDamage EH still trigger? Unable to hop on Arma 3 and test right now.

rotund cypress
#

Should do yes

round scroll
#

is there a way to detect if one is in arsenal or zeus? The rug_dsai voices from Unsung can be heard in both, would be nice to mute them easily in those two modes

lime tangle
#

I believed that was only triggered on one of the cheats @tough abyss

rotund cypress
#

Hi guys, how can I get a bool from a missionConfigFile?

#

Like getNumber or getText but I want to get true or false

tough abyss
#

Can't.

rotund cypress
#

getNumber should work i was told

indigo snow
#

there is no true/false value on config

#

so people mostly use 0/1 for true/false

tough abyss
#

There is something you could do.

#

#define a macros include and assign the value of 1 to true or false

rotund cypress
#

I thought that aswell

tough abyss
#
#define 1 true
#define 0 false
rotund cypress
#

^ yeah

tough abyss
#

Problem is.

#

Where-ever it seees 1 or 0

#

it will assume true or false

#

Smarter Idea would be to simply use a #define Macro(passvalue)

rotund cypress
#

You mean in the HPP file to put what you wrote above

#

Right?

#

ANd then define all values in the hpp file 1 or 0

indigo snow
#

I dont think that does what you think it does

tough abyss
#

#define getCondition(NUMBER) if (Number == 1) then {true;} else {false};

indigo snow
#

thats just a function. (dont put the semicolon at the end when defining a macro)

tough abyss
#

But the point is

#

if he was to use

#define 1 true
#define 0 false
``` the preprocessor would recognise every number as true or false
indigo snow
#

pretty sure only those in the file, but that one would be bad regardless

tough abyss
#

and replace numbers for booleans

#

Macro is probably the safest bet.

#

Only problem is the PreProcessor runs at compile time.

indigo snow
#
#define 1 true
diag_log str A:
#

if A was defined 1 in another file, it would log 1, not true

tough abyss
#

Ah flip it around

#

#define true 1

#

Still the point is the PreProcessor would do bad things.

indigo snow
#

yea you just wanna use the 0/1

tough abyss
#

easier to just write a function to convert it.

#
params [
    ["_getBoolean",0]
];
_getBoolean = if (_number == 1) then {true} else {false};
#

That'll do what you want SimZor.

#

Or better yet.

indigo snow
#

[false,true] select ((0 max _num) min 1)

tough abyss
#

^

indigo snow
#

long story short you just use 0/1 and convert that to your needs ๐Ÿ˜›

#

just watch out with #defines because they might not do what you expect them too if you dont really understand them

#

i seem to remember mikero's stuff even rejecting #define true 1 and its complement

rotund cypress
#

[false,true] select ((0 max _num) min 1)

#

So that in the SQF file

#

At the top

#

And it will get the false

#

or true

tough abyss
#

max will take the value thats the greater of the number

#

closer to infinity

#

min will take the number closer to one and infinity

#

So what max does is

#

if 1 max 0

#

it will pick 1

#

if 0 max 1 it will still pick 1

#

0 min 1

#

will pick 0

#

So how does this work?

rotund cypress
#

I do not understand

#

๐Ÿ˜ฆ

dusk sage
#

Just use bool -> scalar

#

Just be consistent

tender fossil
#

Question that has bothered me for a long time: why are eventhandlers much less resource intensive to use than eg. manual condition checking (just lower level...?) Is there general documentation how they're implemented / how they work eg. in low level?

dusk sage
#

I may be the only one, but I don't quite understand your question

#

than eg. manual condition checking (just lower level...?)?

#

As for event handlers (generally speaking), they fire when something occurs, so no condition checking (consistently) per say

vernal rune
#

Having trouble with ctrlSetEventHandler using the onMouseEnter and onMouseExit parameters they dont seem to be working... anyone managed to get them working before?

little eagle
#

@indigo snow
[false,true] select ((0 max _num) min 1)

#

why not?
_num > 0

#

Not you specifically, but I'm amazed that people are so bad at simple logic sometimes.

#

You'd think someone participating in the conversation would've pointed that out : |

dusk sage
#

Well what have you got? 'Not working' doesn't help us much ๐Ÿ˜› @vernal rune

vernal rune
#

Well it's just not calling to the evh

#

ive tried loads of different ways

dusk sage
#

Post the code

vernal rune
#

it will probs just me bing dumb

#

_x ctrlAddEventHandler ["onMouseEnter", "ctrlSetText [100101, ""img\BLRP_interactionWheel_1.paa""]"];

dusk sage
#

You forgot the number one rule

#

on

vernal rune
#

no but on the wiki it says it doesnt have a variation for mouse enter and exit

rotund cypress
#

x ctrlAddEventHandler?

vernal rune
#

_x

dusk sage
#

a variation?

#

You don't include the 'on'

#

MouseEnter

vernal rune
#

i've tried that anyways tho

#

still dont work

rotund cypress
#

So you're adding the EVH to _x ?

vernal rune
#

yeah its in a for loop trust me its not that

little eagle
#

show the whole thing

vernal rune
#

No it doesnt need to be shown

little eagle
#

yes it has to : P

rotund cypress
#

How are you expecting help then?

vernal rune
#
{
    _x ctrlSetEventHandler ["MouseEnter", "ctrlSetText [100101, ""img\BLRP_interactionWheel_1.paa""]"];
    _x ctrlSetEventHandler ["MouseExit", "ctrlSetText [100101, ""img\BLRP_interactionWheel_Blank.paa""]"];
    _index = _index + 1;
} forEach _segments;```
#

There ya go

dusk sage
#

What is _segments

vernal rune
#

nothing more than that

#

its geting linked to the individual ctrls

rotund cypress
#

well if _segments is not defined obviously its not gonna work

vernal rune
#

it is

rotund cypress
#

Show it

vernal rune
#

but im not showing where its defined

#

no

dusk sage
#

I can imagine what it is, it'd just be nice to see it

vernal rune
#

i dont need to

little eagle
#

wew

dusk sage
#

So we can work it out

#

Instead of pulling loose threads

vernal rune
#

_segments = [_segment1,_segment2,_segment3,_segment4,_segment5,_segment6,_segment7,_segment8,_segment9,_segment10];

dusk sage
#

oh joy

little eagle
#

try the binary version of ctrlSetText

vernal rune
#

_segment1 = _interactionMenu displayCtrl 100102;

dusk sage
#

๐Ÿ‘Œ

rotund cypress
#

Shit I just got an idea

#

Thanks @vernal rune

dusk sage
#

Is it an interaction menu that has an on hover effect?

vernal rune
#

Yes

dusk sage
#

Well I know this is, was talking to SimZor ๐Ÿ˜›

rotund cypress
#

No @dusk sage

#

Adding interact buttons

#

Instead of hiding them

dusk sage
#

You can try the binary version like commy said, but the first thing I'd do is add a hint in there

#

So you know whether it's firing or not

rotund cypress
#

Just showing what is available

vernal rune
#

already done it with system chat

dusk sage
#

And the result?

vernal rune
#

the ctrls are being assigned

dusk sage
#

I'm talking about inside the EVH

vernal rune
#

yeah i tried linking it to a function earlier and doing it there and it wasn't calling it

little eagle
#
_x ctrlSetEventHandler ["MouseEnter", {
    systemChat str _this;        
}];
dusk sage
#

Needs to be a string

vernal rune
#

has to be a string

little eagle
#

why?

vernal rune
#
    systemChat str _this;        
"];```
dusk sage
#

Run it and check Ducky

vernal rune
#

no it does i tried earlier

dusk sage
#

it does what?

#

It fires?

vernal rune
#

it's hwo the ctrlSetEventHandler works

little eagle
#

why make it a string. sounds unnecessarily clunky

vernal rune
#

no

little eagle
#

oh

#

just use add then

dusk sage
#

@little eagle Unless things have changed that's just how it is

#

arma

vernal rune
#
Syntax:
    controlName ctrlSetEventHandler [handlerName, function] 
Parameters:
    controlName: Control 
    [handlerName, function]: Array
    handlerName: String
    function: String
Return Value:
    Nothing 
little eagle
#

yeah, just use the add version

dusk sage
#

Run

_x ctrlSetEventHandler ["MouseEnter", "
    systemChat str _this;        
"];
#

and report back

vernal rune
#

Didnt fire

#

ill try the add version now

little eagle
#

I think mouseenter just doesn't work for every control type

vernal rune
#

oh shit yeah maybe

little eagle
#

or

vernal rune
#

im using pictures and making them invisibe

#

that may be why

little eagle
#

you need to make sure the control is in the foreground

vernal rune
#

it is

little eagle
#

then put a control over it that works with it and make it transparent

steady jungle
#

@little eagle @meager granite Thanks for your input! Never thought of that. Very much appreciated.

vernal rune
#

Right so i just tried using a button and it didnt work...

#

K i got it working

dusk sage
#

D:

vernal rune
#

CHeers @little eagle and @dusk sage

dusk sage
#

๐Ÿ‘

little eagle
#

Thanks for your input! Never thought of that. Very much appreciated.
NP, but I haven't done anything yet.
CHeers
YW

modern sand
#

Hey Guys I'm new to scripting and I am having trouble with trying to check if a player is in the driver seat.

#

This is what I got

#
_bus = "C_Offroad_01_F"
waitUntil {typeof (vehicle player) == _bus};
hint format ["%1 | You have re-entered your bus and now can continue the route.", _inBus];
#

How would I make it so the player only gets a hint after he is in the car and in the driver seat?

#

I have tried driver _bus = player, but still it wont work.

#

like I put it in an if statement before the hint like this

#
_bus = "C_Offroad_01_F"
waitUntil {typeof (vehicle player) == _bus};
if (driver _bus = player) then {
hint format ["%1 | You have re-entered your bus and now can continue the route.", _inBus];
};
#

and _inBus is defined

modern sand
#

EDIT: Nevermind I have found the solution by trying other stuff, I simply replaced

#
if (driver _bus = player) then {};
#

To

#
waitUntil {(typeof (vehicle player) == _bus && driver _veh == player)};
waxen dagger
#

guys, i'm having some weird bug with remoteExec.

btc_combatSupportObject allowDamage false;
btc_combatSupportObject setDir 62;
[btc_combatSupportObject] remoteExec ["btc_fnc_cs_addAction", 0, true];

This code runs on the server
everything works in SP (ofc ๐Ÿ˜› ) but not on the dedi
btc_fnc_cs_addAction =
(_this select 0) addAction ["<t color='#ff1111'>Request vehicles</t>", "0 spawn btc_fnc_cs_handle;"];

#

actually no, but if i run the command from the console in game, it works

#

is it mandatory?

#

i've already checked it, it's clean

#

no sign of it

#

but i'll add the cfgRemoteExec and check again

#

nope, but it will pass the object itself no?

#

it kinda sucks tho

#

my next option is to check if that type of object exist and add the action directly to the client but meh

#

it's a while i'm missing from the mission editor, do i need to re-apply addActions on player's respawn?

#

I remember that they changed something about addAction from A2 to A3, but i can't remember if it is the action on respawn or the action related to the vehicle

waxen dagger
#

Moving the remoteExec & object creation to the post init fixed it

tough abyss
#

My mission framework is coming along nicely.

#

I can now end missions.

#

And attach custom code to it.

#

Still got BI's task framework revamp to configure.

#

Need to make the long winded text blocks it uses into smaller commands

#

Stringtable.xml should allow me to do that.

vital onyx
#

RemoteExec from server does not require whitelisting.

tender root
#

Hey I asked this question already a couple of days ago, but no one really had a solution, so why not try again, maybe there is someone who already tried to achive the same online :)
I want to get the remaining ammo of a static weapon, by only passing the backpack the weapon is stored in, as an argument. I already found out last time that the static exists as a hidden object although it is packed in the rucksack and it is attached somehow to the backpack. (attachedObjects / attachedTo doesn't work)
The only thing I'm missing is the correlation between the backpack and the static itself. Maybe it is stored in the objectnamspace of the rucksack or it's connected in another way.
Anyone any ideas? Thanks in advance ๐Ÿ˜›

#

PS: This solution has to work for every static not just predefined ones in a mission (it's for an addon). The final goal is to beeing able to set and get the ammo of an static (by only having the backpack it's stored in), maybe there are solutions with another approach.

tough abyss
#

at certain mods Zombie distance/loudness vs distance sounds seem bugged... is this an arma bug or is it a script bug?

#

thats an addon bug

#

so, the same that happened to DayZ standalone was just coincedence?

#

@tough abyss DOnt know about Dayz

#

I know that stock arma does not have zombies

#

well replace "zombies" with "AI" i guess

#

but ill take your word on it that its just a addon bug

#

thanks ๐Ÿ˜ƒ

rotund cypress
#

Anyone that has problems with endMission SP cheat, try this to disable the key, seemed to work fine for me (findDisplay 46) displayAddEventHandler [ "KeyDown", "_key = _this select 1; _shift = _this select 2; if (_key == 74) then { if ( _shift ) then { hint 'ArmA Cheat Blocked'; true }; };"];

rotund cypress
#

Scratch it

#

Does not work

#

I need to add some more shit to it

noble juniper
#

id suggest using BE filters ?

rotund cypress
#

It wont block the command

rotund cypress
#

Okey, so I finally got it working TFFT

#

Stick that in a function

#

Call the function on init or something

#

Woila

#

Everyone who wanna disable endMission cheat in MP

noble juniper
#

you know that you just diasbled the usage of that key ?

#

changing it, defeats your countermeasure

#

oh, jea, its about that damn cheat endmission .. oh jea ... fuc kme ..

#

@rotund cypress Sorry, its late for me ... nice work though

tough abyss
#

createGearDialog [_vehicle, "RscDisplayGear"]; isn't working properly (as seen on wiki) any other way to check a vehicles gear?

unique inlet
#

I am having real hard time working VGS for my group

#

The current script im using is

#

disableSerialization;
uiNamespace setVariable [ "current_garage", ( _this select 0 ) ];
_fullVersion = missionNamespace getVariable [ "BIS_fnc_arsenal_fullGarage", false ];
if !( isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) ) exitwith { "Garage Viewer is already running" call bis_fnc_logFormat; };
{ deleteVehicle _x; } forEach nearestObjects [ getMarkerPos ( _this select 0 ), [ "AllVehicles" ], 10 ];
_veh = createVehicle [ "Land_HelipadEmpty_F", getMarkerPos ( _this select 0 ), [], 0, "CAN_COLLIDE" ];
uiNamespace setVariable [ "garage_pad", _veh ];
missionNamespace setVariable [ "BIS_fnc_arsenal_fullGarage", [ true, 0, false, [ false ] ] call bis_fnc_param ];
with missionNamespace do { BIS_fnc_garage_center = [ true, 1, _veh, [ objNull ] ] call bis_fnc_param; };
with uiNamespace do {
_displayMission = [] call ( uiNamespace getVariable "bis_fnc_displayMission" );
if !( isNull findDisplay 312 ) then { _displayMission = findDisplay 312; };
_displayMission createDisplay "RscDisplayGarage";
uiNamespace setVariable [ "running_garage", true ];
waitUntil { sleep 0.25; isNull ( uiNamespace getVariable [ "BIS_fnc_arsenal_cam", objNull ] ) };
_marker = uiNamespace getVariable "current_garage";
_pad = uiNamespace getVariable "garage_pad";
deleteVehicle _pad;

#

oops

#

its to long

#

sorry

#

is this

#

however my group members are experiencing some troubles such as

#
  1. Not able to see the change in textures
#
  1. Some times only the creator can see the texture of vehicles so others see invisble floating helicopters
#

Help would be much appreciated

tough abyss
#

Sounds like something i would go to and talk to the creator of the script about

unique inlet
#

unfortunately i think the forum(?) is dead or quiet

tough abyss
#

ExAD vitrual garage?

unique inlet
#

wow whats this?

#

Cool but isnt this for exile?

tough abyss
#

well i asummed that was the virtual garage you are talkign about.

#

Yes thats for exile

meager granite
#

Any idea how to prevent particles from going semi-transparent and then invisible?

tough abyss
#

[["launch_RPG32_F","","","","",[],""],[['arifle_MX_ACO_pointer_F','','acc_pointer_IR','optic_Aco',['30Rnd_65x39_caseless_mag',29]]] anyone have any method to createVehicle so that i can spawn all those items?

#

^ returned from weaponsItemsCargo if that helps

tender root
#

@tough abyss Try addWeaponCargo, addItemCargo and addMagaznieCargo

vernal rune
#

@unique inlet change setObjectTexture to setObjectTextureGlobal

tough abyss
#

What is used mostly by you guys as IDE ?

jade abyss
#

IDE?

jagged blaze
#

i think he means IED ๐Ÿ˜„

jade abyss
#

I am not sure, there are many ppl out there that use "strange" shortages for words and think, everyone knows/can guess them ๐Ÿ˜„

tough abyss
#

sorry... the editor you use to type the scripts in

jade abyss
#

You see @jagged blaze

jagged blaze
#

๐Ÿ˜„

tough abyss
#

๐Ÿ˜›

jade abyss
#

Notepadd++ with A3-Language

#

Some use Atom

#

I also saw some sick/psycho freaks using VisualStudio

unique inlet
#

Thanks @vernal rune i will try it out

tough abyss
#

ohw VisualStudio works with Arma3 scripting?

jade abyss
#

No clue

#

I just seen some using it

tough abyss
#

Notepadd++ with A3-Language <-> is this only highlighting stuff or will it give intellisense throughout the project?

jade abyss
#

Yes.

tough abyss
#

yes on which part? ๐Ÿ˜›

jade abyss
#

No.

#

(just Syntax, no sense)

tough abyss
#

ok ๐Ÿ˜‰

unique inlet
#

Second question of the day
The effect i am trying to make is

tough abyss
#

@jade abyss So... right... i have played some arma mods, but thats about all the experience i have with arma... i know how to code... where do i start? Are there any video tutorials that explain how to use the editors in combination with the coding?

#

anything you can recommend?

#

sorry JT, didnt mean to interupt you

jade abyss
#

Learning by Doing + Biki

tough abyss
#

right

unique inlet
#

Second question of the day
The effect i am trying to make is

A. All units on map
B. All units spawned (Zeus + MCC)

  1. Apply skill on A and B
  2. Keep checking it and when AI increases reset skill every 30 second
unique inlet
#

NP xD @tough abyss

indigo snow
tough abyss
#

@jade abyss tnx

vernal rune
#

Sublime Text 3 with sqf syntax highlighter

jade abyss
#

Yeah right, Sublime.

tough abyss
vernal rune
#

Also look at the pmc wiki for learning to code especially their arma 2 syntax guide

#

@unique inlet your script is very broken

#

If you direct message it to me ill fix it when i get home

#

One downside to sublime is theres no duplicate line function as far as i know

#

Like Ctrl + D in notepad ++

tough abyss
#

@vernal rune yah.. just watched a couple of online tutorials... and i think i have more questions now then before i started ๐Ÿ˜ƒ

#

and i guess ill just stick to arma3 stuff

vital onyx
#

ViM + SQF syntax highlighter makes things perfect

dusk sage
#

gah

#

vim

loud python
#

I don't like vim

#

I once accidentally opened a file in vim

#

spent 10 minutes finding out how to close it again

tough abyss
#

@tender root issue is that u want to spawn the items in front of player. So I would need to figure out how to cycle through the array

tough abyss
#

how does the arma engine run, is there a Main ? or is it component based like Unity3D ?

vernal rune
#

@tough abyss send a dm with any questions im happy to help

#

Ill be home soon

tough abyss
#

That is very kind of you ๐Ÿ˜ƒ

tender root
#

@tough abyss correct me if I'm wrong:
You want to spawn these Items in front of the player just like loot right ?

tough abyss
#

Yep

#

@tender root

young current
tough abyss
#

Thanks, bookmarked it ๐Ÿ˜ƒ

tender root
#

@tough abyss You need to spawn a GroundWeaponHolder and add the Items to the inventory

little eagle
#
My CBA_A3 isn't loading.
When I start my game with CBA_A3 I don't get the cars, weapons, ect. It seems like the mod isn't even running but it's enabled. I'm not sure why it's not loading. Any suggestions?
#

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

#

the convo below is top too

tough abyss
#

@tender root solved

#

Can anyone explain to me how i would go about adding addAction to all clients on a server? player addAction ["Do Stuff", {[[],execVM "stuff.sqf",false,false] call BIS_fnc_MP;}]

#

Or if i put it in my mission file it wont matter?

open vigil
#

Commy, ever think of pulling the SW version of CBA? It would prevent many of the complaints from idiots.

polar folio
#

uhm pls no?

i use the arma 3 launcher and the workshop whenever i can because it's the most convenient of all ways overall imho. why punish people like me for retarded comments?!

jade abyss
#

@open vigil tbh, let them complain/cry/bitching ๐Ÿ˜„ More fun to read it

dusk sage
#

@tough abyss You could put it in init (or SQM), or use something like remoteExec

tough abyss
#

@little eagle -_-

#

People are twits I swear.

#

@CBA_A3 is an API.

vernal rune
#

@tough abyss {_x addAction ["Do Stuff", {[[],execVM "stuff.sqf",false,false]} forEach playableUnits; //For All Clients On Server or if you wanted to do it for every person that joins put player addAction ["Do Stuff", {[[],execVM "stuff.sqf",false,false] in a file in your mission directory called initPlayerLocal.sqf

vague hull
#

I think I have just passed a local variable by reference to another function o.O

#

I still dont know how its possible but ok

#

damn privates

broken mural
#

Is there a way to return if unit has eventhandlers set? im trying to verify my addeventhandler..

Complicated, but basically Im enforcing no damage from specific side. The other side can kill the units just fine, but when I have the next group spawn (note; they are already spawned, just hidden with allowdamage false set.) with the addEventHandler handledamage that same team cant kill the group.

#

Oh, figured it out. I was setting allowdamage false on the invis group's spawn, but this is in multiplayer. Also switched eventhandlers to MP. All is working now ๐Ÿ˜ƒ

tough abyss
#

@vernal rune put it in initplayerlocal seems not to work

#
_vehicle = cursorTarget;
if(!alive _vehicle && (_vehicle isKindOf "LandVehicle" || _vehicle isKindOf "Air" || _vehicle isKindOf "Ship") && (_vehicle distance player) < 7 && alive player) then { true };
'];```
#

Thing is it works in editor

#

Not when on a server though

tough abyss
#

in mission.sqm, what is this version=52; or version = 12; lines?

fierce lantern
#

anyone know how to add optics to a respawn load out through description.ext?

rancid ruin
#

@tough abyss i think that might just be how many times you've saved the mission

split coral
#

It's the editor version. 12 = the old 2d editor, 52 = the current 3den

#

Jesus. There's 340 SQMs in my editor folder...

#

I may have a problem.

#

nah

vernal rune
#

@tough abyss put in init.sqf should still work

rotund cypress
#

If I wanna set a player to prone, how would I go about doing that? I tried _soldier setUnitPosWeak "DOWN"; and setUnitPos but didnt work

digital pulsar
#

U can play an animation, I dont think there is any elegant solution

#

Setunitpos is for AI

tough abyss
#

this is part of a mod script... now i am new to arma scripting, but i cant believe that is correct

indigo snow
#

it turns it into a string, which can be useful in certain situations

#

it all depends on how _repairAllScript gets used

tough abyss
#

@indigo snow so this becomes something like an anonymous function ?

digital pulsar
#

Nah its a string

tough abyss
#

so... you can convert a string into code ?

digital pulsar
#

Unsure, i never had a reason to do it

tough abyss
#

it seems so unlikely

digital pulsar
#

Maybe it gets loaded to some sort of config file or manual

#

Whats the context of that variablr

tough abyss
#

no its part of an normal sqf script

#

[("repAllBut" call _getControl),[6.7*_pW,17.7*_pH,6*_pW,1*_pH],_repairAllScript,(XM8_repairMate_stringtable select 10),((_gearData select 2) and (_gearData select 3))] call _setButtonControl;

#

this is the only line in that script that uses it

digital pulsar
#

Gotta check what is _setbuttoncontrol

tough abyss
#

_setButtonControl = { params ["_ctrl","_pos","_action","_text","_enable"]; _ctrl ctrlSetPosition _pos; _ctrl ctrlSetText _text; _ctrl ctrlSetEventHandler ["MouseButtonUp",_action]; _ctrl ctrlEnable _enable; _ctrl ctrlCommit 0; };

#

ctrl ctrlSetText _text; ?

digital pulsar
#

Thats action by the look of things

tough abyss
#

right

digital pulsar
#

See if ctrlseteventhandler accepts string as second parameter

#

Mb it just interprets that as code

tough abyss
#

๐Ÿ˜•

indigo snow
#

yup thats it basically

tough abyss
#

so, string into code?

digital pulsar
#

Yep biki confirms

indigo snow
#

main examples would be configs, which can only be of the type string, number or array

#

so any code in a config must be inside a string

tough abyss
#

but this does not appear to be a config file

indigo snow
#

its GUI (control/dialog), which also exist as configs

#

another example is waypoint activation or trigger activation if you set them by script

#

its stuff from like the OFP days when the code type didnt really exist yet and everything was strings

tough abyss
#

insane

digital pulsar
#

I think its just convenience for ppl who want to load code from external source like config or sth

tough abyss
#

so let me reverse this question...if you would remove the qoutes, would the code become invalid?

indigo snow
#

yes

#

spawn returns the handle, the local variable becomes the handle

digital pulsar
#

Type mismatch

indigo snow
#

type SCRIPT, expected STRING or something like that

tough abyss
#

ok, well, thanks for clearing that up ๐Ÿ˜ƒ

digital pulsar
#

:-)

indigo snow
#

the way i normally go around it is to use "call MYFUNCTION" and then use normal functions but its a style thing i guess

tough abyss
#

well, as i said i am pretty new to sqf, was just browsing some mod code then ii stumbled onto that

tough abyss
#

@vernal rune turns out it was priorities that screwed it up

#

Fixed now thanks

vernal rune
#

@rotund cypress _soldier switchMove "AidlPpneMstpSnonWnonDnon_AI"; I believe this animation should work

tough abyss
#

^ thats instant.

tough abyss
#

@rancid ruin @Greenfist#3021 thanks a lot. But can i use version = 52; in nowadays dedicated servers? I noticed some regular updated mods still using version = 12; on their mission files.

meager granite
#

This version means nothing to you, it just how game reads mission.sqm and that' it

#

And differences are all hardcoded and probably wouldn't give you any benefit even if you knew them

split coral
#

Yeah, I guess some people are just sticking with the old 2d editor

meager granite
#

Arma 2 has version of 11, A3 has 12, there was single version change in mission.sqm format over this many years

lilac halo
#

is their a way to buff AI units on a server but just for one side so the other has a disavantige?

digital pulsar
#

setSkill command

warped fractal
#

Anyone know why I can't get this to work?
{_x addbackpack "Steerable_Parachute_F"} forEach thislist;

I'm trying to get a trigger to give all AI units within the trigger a parachute when they enter the area, but nothing happens

native hemlock
#

I believe Steerable_Parachute_F is the name of the vehicle the player enters when a parachute is deployed, the name of the backpack would be B_Parachute

warped fractal
#

God damn you're right, thanks

#

I feel stupid now

native hemlock
#

We all have those moments. From everything I've seen all of the vanilla A3 backpacks begin with B_, similarly, all the uniforms begin with U_, so that jumped out at me

rotund cypress
#

@vernal rune I used playMoveNow

#

I just wanted something simpler

vernal rune
#

fair enough

rotund cypress
#

Not having to go through animationsviewer

#

I didnt want to lol

#

But I had to

#

I just looked for a simpler command that just had like stand, kneel stuff like that

tough abyss
#

Is

_array set [count _someArray,_value];
_array pushBack _value;

Are they equivlent @native hemlock

native hemlock
#

No, they would be the same if it was

_array set [count _array, _value];
_array pushBack _value;
tough abyss
#

Thats exactly what I said..

#

Ah so it is.

native hemlock
#

It's not what you said though, but it's probably what you meant

#

_array is not the same as _someArray

tough abyss
#

Ohh right

#

_vehsLand set [count _vehsLand,_veh];

#

is equal to __vehsLand pushBack _veh;

#

?

native hemlock
#

Yes

tough abyss
#

k

#

When you getVariable

#

and a variable is already mission space

#

can you actually getVariable of that variable?

#

say global = 1;

#

I can use
MissionNameSpace getVariable ["global",1];

#

?

native hemlock
#

Yes, and that's pretty easy to test yourself

#
someVar = 5;
systemChat str (missionNamespace getVariable "someVar"); //5
missionNamespace setVariable ["someVar", 123];
systemChat str someVar; //123
tough abyss
#

Sorry -_-

#

Asking stupid questions I could test myself..

tough abyss
#

How can i create in SQF this "Logic" on the link above (item0 of class entities) and set its type as on line 14?

#

I see also that many vars are set in the "Logic", but this is the easy part (_logic setVariable ...)

tough abyss
#

I got it, "RyanZM_ModuleSpawn" is a custom game logic.

thin pine
#

Hi

tough abyss
#

Hi

thin pine
#

You're using the modules I hope?

tough abyss
#

i want to create zombie spawner on fly

thin pine
#

We deprecated the game logics months ago

#

Ah

tough abyss
#

not create then in the mission file

#

but create the zombie spawner using SQF

#

I believe ai figured it out

thin pine
#

Yer I gotcha

tough abyss
#

Just need to create a unit of side SideLogic with the classname "RyanZM_ModuleSpawn" and set the vars on it.

thin pine
#

I've never spawned a module through sqf before but what you could also do is open up the pbo and look at the spawner function file. You could call that function directly I think, just need to get the parameters straight

#

You could call the moduleSpawn fnc actually on that sidelogic with the vars set. I imagine that could work

tough abyss
#

All the parameters are taken from the gamelogic ("RyanZM_ModuleSpawn") vars.

#

But the game logic have other functions in this case like to trigger the zombie spawn, i believe.

thin pine
#

Gamelogic != module just to get that straight

tough abyss
#

Ah ok.

#

Its a module, but its build over a game logic, dont?

#

Since the mission.sqm categorize it as a logic.

thin pine
#

Anyway the module calls a function right. I think it's called moduleSpawn ( excluding the prefixes ). You could call that function yourself i bet as long as youre using an object that has the same vars set as the module normally would

#

It sucks im on mobile rn otherwise i coulda taken a look at the source code

tough abyss
#
    class Item0
    {
        dataType="Logic";
        class PositionInfo
        {
            position[]={14373.422,17.799667,15911.327};
            angles[]={6.2818413,0,0.0013439035};
        };
        id=2;
        type="RyanZM_ModuleSpawn";
        class CustomAttributes
        {```
#

The rest are just variables set in it.

#

Like _module setVariable ...

#

or _logic setVariable ...

thin pine
#

Yeah. I dont know if you could spawn a module by its class name tho

#

You should test

#

Ill be able to get on pc tomorrow and ill help you out if needed

tough abyss
#
    class Logic;    // External class reference
    
    class Module_F : Logic {
        class ModuleDescription;    // External class reference
    };
    
    class RyanZM_ModuleSpawn : Module_F {
        author = "Ryan";
        scope = public;
        mapSize = 2;
        displayName = "Spawner";
        icon = "\Ryanzombies\icon.paa";
        category = "Ryanzombiesfactionmodule";
        function = "RyanZM_fnc_rzfunctionspawn";
        isGlobal = 1;
        
        class Arguments {```
#

This is the definition of the module.

#

A logic turn into Module_F

#

And Module_F turn into RyanZM_ModuleSpawn

#

Its a Vehicle

#

@thin pine

thin pine
#

Rzfunctionspawn

#

Take a look at that

tough abyss
#

Thanks.

#

@thin pine i can create then with CreateUnit and thats all.

#

Like any other unit

#

\o/

#

I will just fill my AI_ClassNames = [...]; array with zombies classes and see what happens.

jade abyss
#

@tough abyss
This also works:

MyVarName = 1;

_VarName = "MyVarName";
systemchat str (missionNameSpace getVariable _VarName);

missionNameSpace setVariable [_VarName, 2];
systemchat str (missionNameSpace getVariable _VarName);

missionNameSpace setVariable [ format["%1%2","My","VarName"] , 3];
systemchat str (missionNameSpace getVariable _VarName);
tough abyss
#

been getting this error for quiet some time on my server

#

absolutley no clue why

#

I can't put a finger on what i changed when the error happened and never did manage to figure out what was triggering it

meager granite
#

Turret config lacks value that engine needs

tough abyss
#

So what could i possibly do to fix that?
Search for turret config and add the value?

meager granite
#

You can create patch that adds missing values

#

CoPilotTurret is not vanilla subclass of Plane, I guess some addon added incomplete turret

#

Or Arma 3 update moved base class for CoPilotTurret that your addon uses elsewhere resulting in missing values

#

I don't know your addon setup to suggest what exactly to do and seeing that its Exile I don't think you will be able to change addons since people probably download them from workshop or somewhere else, not you

little eagle
#

@open vigil

ever think of pulling the SW version of CBA? It would prevent many of the complaints from idiots.
I'm not the one to decide. Removing it seems mean, but I would've never put it, or ACE for that matter, on there in the first place.

jade abyss
#

Now imagine the butthurt in here. "How do i install CBA?"

#

Will be worse then the Pre-SW times.

tough abyss
#

thought so, thanks @meager granite

open vigil
#

Would be nice to moderate those idiotic comments somehow.

meager granite
#
    private _cfg = configFile >> "CfgMagazines" >> "something";

    getNumber(_cfg >> "tracersEvery") > 0 &&
    (
        getNumber(_cfg >> "count") <= getNumber(_cfg >> "lastRoundsTracer") ||
        getNumber(configFile >> "CfgAmmo" >> getText(_cfg >> "ammo") >> "nvgonly") == 0
    )
#

Way to determine if magazine has all tracer rounds

chilly surge
#

Good Morning.
So i was wondering if there is a script, so normal infantry units who only have a RPG, fire them at infantry. Normally that just run away when they don't have a normal weapon. But they have a rocket launcher, so why don't use that?

meager granite
#

Probably can be defined in config if AI should use RPGs on infantry

#

Yeah, there is CfgAmmo entry allowAgainstInfantry

#

And only RPG-42 HE grenade has is set to 1

chilly surge
#

Okay, thanks for the help

hasty pond
#

In extDB3 if you want to strip " chars can you just add it to the strip chars entry like this Strip Chars = ";[]"" I feel like that's not gonna work that well...

tacit grove
#

Would someone be able to explain this to me? I think this is along the lines of what's got a couple things in my mission broken in a HOSTED server but it's a bit out of my knowledge to full understand what's going on. (!isServer && (player != player)) then { waitUntil {player == player}; waitUntil {time > 10}; };

hasty pond
#

@tacit grove Breakdown: If the script executor isn't server (player hosted server) and player isn't player (on dedicated server player is always null) then we wait until player is player (on a dedicated server null == null) then we wait until the mission has been going on for 10 seconds. Someone correct me if I'm wrong.

tacit grove
#

Is "player" only the host then? or does player encompass all people in the server

hasty pond
#

If this is in your init, it will run on each player and then when ran by the player the player is that player that it is runnin on currently.

#

What you are doing here is catering to JIP players bein null during their initialization.

tacit grove
#

Gotchya. yea that's where I first found that piece of code. Somewhere within a HALO jump script something is broken to where only I, as the host, am given back my backpack after the backpacks are on player's chests so there can be a parachute. Once you land everyone is supposed to get their packs back but only works for me. Which is why I started digging into "player"

#

Makes testing missions hard now that I learned just becaue it works with me in MP doesn't mean it works :p

hasty pond
#

Yeap

torn jungle
#

Having a bit of confusion with how to add an "event handler" for when any player throws a grenade. I want to use "AnimChanged" and make it detect if the animmation "AwopPercMstpSgthWrflDnon_End1" is played, then it will spit out a servermessage saying "Thisplayername has thrown a grenade".\

indigo snow
#

Couldn't you just use the fired EH?

#

the weapon would be "Throw"

torn jungle
#

Alright, im am not very familiar with creating Event handlers especially with its paramters so i based this one off something else someone made.

#

if (isPlayer _unit && {_weapon == "Throw"}) then {private _message = format ["%1 threw something", name _unit];_message  remoteExec ["systemChat"];};```
#

i will put that in say throw.sqf and put this in the init.sqf:

#

this addEventHandler ["Fired", {execVM, "throw.sqf"}]

rotund cypress
#

if i remoteexec a function like this [] remoteExec [ "fncs_fnc_myfunc", allPlayers ];

#

And then do that multiple times, will it stack?

#

say I had a while loop in that script

#

Will it start over or just stack?

indigo snow
#

scripts never start over

muted oyster
#

Anyone available who can help me with popup targets ? My script shows some weird behaviour. Private message me please ๐Ÿ˜ƒ

open vigil
#

Solutions should be public as to help others who may have a similar problem.

meager granite
#

Anyone experienced a bug where remote players appear with no unform in underwear?

#

And in which mission

tough abyss
#

@rotund cypress That looks dangerous.

tacit grove
#

What in the world does "pass tank object reference to the script." mean? Using a script from killzonekid but have no idea what the last bit of instructions mean haha

tough abyss
#

@tacit grove i would think it would be to pass an argument to it so like tankObject call script;

tacit grove
#

i know nothing about coding beyond finding already made scripts, following instructions of what to copy and where to paste it. That's why i'm struggling to understand what I need to do because the instructions themselves are gibberish to me lol

manic sigil
#

@tacit grove The first question is, what are you trying to achieve with this? Answering that can give a lot of comtext to what the problem may be.

tacit grove
#

First objective in the mission is to clear out a little town. Once clear 2 groups meet up in a specific spot. Once blufor is present a trigger activates to complete the grouping task, merge the 2 groups, as well as activate 2 drop cargo waypoints for choppers carrying prowlers. If another player besides me is in the server the choppers don't cut ropes. So I started researching other routes to get prowler supply drops. Found that script for the tanks and was going to just replace all the _tank parts and the tank class name with that of the prowler.

meager granite
#

@tough abyss Seem to only happen to player, any more details about it?

#

@tacit grove They go whenever you need something paradropped

#

addAction, init, trigger, whatever

manic sigil
#

^ as stated, the _prowler portion will go in the activation portion for whatever trigger you have for the drop.

tacit grove
#

Awesome that's defnitely what I needed to know thank you! is it going to be _prowler or would it be _cars? I think it's listed under cars in the editor

meager granite
#

variable name means nothing

#

just change class name and set proper coordinate

#

Change [someX,someY,150] to getMarkerPos "somemarker"

#

Also a lot depends on where you call these 4 lines from, there is a thing called multiplayer locality

#

Also this code seem to be designed for server to setup paradrop stuff so these lines have to be executed on server

#

All that huge code listing should be in init.sqf though

tacit grove
#

Yea i got that big portion in the init.sqf. And i've defnitely ran into my share of issues because of mp locality. The plan is to just have someone host the mission themselves and not run a dedicated server

jade abyss
#

doesnt change the locality effect

meager granite
#

Just in case wrap these 4 lines into

    if(isServer) then {
        4 lines here
    };
#

To avoid stuff spawning muliple times

jade abyss
#

in your case, the hoster would be the server.

#

โ˜

tacit grove
#

awesome I'll give that all a try and see what happens. Big thanks guys

meager granite
#

Any more info regarding missing uniform bug?

tacit grove
#

for this: getMarkerPos "somemarker" does that go in brackets like before or just flat out just that on it's own line andto match a marker name obviously

#

ignore that actually haha. just made sense

meager granite
#

you need to remove array and have getMarkerPos command instead

#

From my exprience only remote players appear naked, never local

#

Never seen the issue with AI as neither of my missions have AI grouped to players, only to server-owned groups

#

I doubt it has to do with textures

#

Also what is interesting, sometimes units have their base uniforms instead of naked ones

#

For example I use C_Man_1 civilian in shorts and striped shirt uniform

#

And rarely players bug out into that default civilian uniform

#

Well we probably can have some kind of crutch to help it at least

#

Or messages arrive out of order somehow

#

There is also a bug where clearItemCargoGlobal very rarely doesn't clear cargo for some players