#arma3_scripting

1 messages · Page 388 of 1

swift glen
#

@still forum thanks I'll try that

south pasture
#

@little eagle @still forum , thanks, but i wanted something not ARMA UI but telnet like console ability

still forum
#

I'm not aware of something like that. Can easilly be done with Intercept or Extensions. But I don't know of something like that that already exists

swift glen
#

@still forum I'm not sure this is working for me, do you have any suggestions on how best to approach this? All i'm after is a test to see if the player playing as Terrorist 1 is currently looking at the object titled IED1

#

As a trigger condition

#

CheckVisibility seems the best solution but doesn't seem to care where the palyer is looking, just that there is an unobstructed line

#

between the two models

quartz coyote
#

Hello my scripting friends !
Doesn't anyone know if there is a way to display the score of a match on a TV screen in-game with a texture or something ?

compact maple
#

Hello, Quick question, when you put a .ogv video on a texture, is there the sound of the video ?

#

Flash-Ranger yea it's possible but with an eternal program

quartz coyote
#

@3rK#4254
I'll try this out thanks

dim terrace
velvet merlin
#

is there still no way to detect new entity created via sqf? or does missionEH EntityRespawned trigger for this?

little eagle
#

There is still no way without mods.

velvet merlin
#

lovely

little eagle
#

Error C2143 syntax error: missing ';' before '}'
It's just like SQF.

barren magnet
#

@here can someone either prove me wrong or confirm that this is and error in the sqf preprocessor? #define arma3iscool configFile diag_log('Your ' + getText( arma3iscool >> 'CfgVehicles' >> 'C_offroad_01_f' >> 'displayName' ) + ' is ready'); // works diag_log('Your "' + getText( arma3iscool >> 'CfgVehicles' >> 'C_offroad_01_f' >> 'displayName' ) + '" is ready'); // does not work

#

The second line results in 2017/11/27, 21:45:05 "Your Offroad is ready" 2017/11/27, 21:45:05 Error in expression <s ready'); diag_log('Your "' + getText( arma3iscool >> 'CfgVehicles' >> 'C_offro> 2017/11/27, 21:45:05 Error position: <arma3iscool >> 'CfgVehicles' >> 'C_offro> 2017/11/27, 21:45:05 Error Undefined variable in expression: arma3iscool 2017/11/27, 21:45:05 File mpmissions\__cur_mp.Altis\init.sqf, line 7

#

I do think that the sqf preprocessor turns on his string sensitive flag on the frist occurance of " in the first single quoted string and turns it off when getting to the " in fron of the < is ready>

little eagle
#

You can't use strings like this.

#

Just do:

diag_log('Your ' + str getText( arma3iscool >> 'CfgVehicles' >> 'C_offroad_01_f' >> 'displayName' ) + ' is ready');
barren magnet
#

I am not 100% certain that you are correct with this because diag_log('Your asdasd "');

#

results in 2017/11/27, 21:52:42 "Your asdasd """

#

which is quite ugly but kinda correct and seems legal to use

little eagle
#

Uhm, okay.

barren magnet
#

I am as confused as you are ...

little eagle
#

Would my proposal work for you?

#

It does add " around the vehicle name.

barren magnet
#

it works, no question but this is not about solving that problem that way, its about finding out if i use illegal syntax which i do not think, or if <@&105622502444711936> have a bug in their game

little eagle
#

Debatable. Just because the behavior is not as one could expect, doesn't mean it is not intended.

barren magnet
#

Nah this sounds like a dev has just not handled this case, especially since the error is located in the preprocessor and not the scripting engine of some kind

#

yep confirmed, its legal to use it this way:

#

diag_log('Your "' + getText( configFile >> 'CfgVehicles' >> 'C_offroad_01_f' >> 'displayName' ) + '" is ready'); // works

#

result is : 2017/11/27, 21:57:39 "Your ""Offroad"" is ready"

#

valid syntax, just the preprocessor messes up

#

Sooo i gonna open a ticket for this, but tbh I think this will never be fixed anyway Q.Q

#

So i need to parse this out on my own

little eagle
#

shrug

barren magnet
#

```diag_log('Your " s"' + getText( arma3iscool >> 'CfgVehicles' >> 'C_offroad_01_f' >> 'displayName' ) + 's " is ready'); // does not work````

#

results in

#
2017/11/27, 22:05:14   Error position: <// does not work>```
#

someone messed up real bad

shell gale
#

pls no tag ( ͠° ͟ʖ ͡°)

jade abyss
#

😂

tough abyss
#

if I call this function 'removeobjects_50' and use SQF { _x remoteExec ["fn_removeobjects_50", 0, true];} forEach [logic_1, logic_2, logic_3]; in the initServer.sqf, would it work for the game logics called logic_1, logic_2, logic_3?

function: SQF { _x hideObjectGlobal true } foreach (nearestTerrainObjects [this,[],50])

swift glen
#

Hey all, I'm making a mission where if the player shoots the wrong enemy unit it's game over (they have to work out which unit is their designated target) how do I do a condition that says if a unit dies that's anyone BUT a specific named unit then it's game over?

inner swallow
#

if it's the correct unit, you trigger the victory ending, for all others it's game over

swift glen
#

I see, I make a generic "Someone has been killed" trigger then hook it up to a second "was that person the target or not?" one?

inner swallow
#

what

#

oh

#

no wait

#

no don't use triggers

#

use event handlers

#

click the links 😄

swift glen
#

Okay I'll take a closer look, sorry

inner swallow
#

^has an example too

subtle ore
#

Why is everyone so fixed on using triggers these days?

inner swallow
#

because for people new to mission making, triggers are the most visible tool.

subtle ore
#

Yeah, but even after they learn how script is more useful and more effective in the longrun they still use triggers 😦

inner swallow
#

Well sure, triggers are there to be used 😄

#

I can't see why you shouldn't use them for simple stuff

#

or as entry points for scripts

subtle ore
#

because my 0.01 ms execution time is what I need. It needs to be a racecar with racing stripes. Not a sedan with flame stickers on the bumper

inner swallow
#

Honestly i'd take an in-engine solution if it's available

#

if you need a 0.01 ms exec time, then that's your particular use case

#

Triggers should be good enough for most people

subtle ore
#

/s

meager heart
cloud thunder
#

Does anyone know if localization is supported with createDiaryRecord?

#

or rather how to integrate into Text part of <execute expression="Code to execute">Text</execute> as in <execute expression="Code to execute">localize "STR_my_string"</execute>

meager granite
#

format ["<execute expression=""Code to execute"">%1</execute>", localize "STR_my_string"]

cloud thunder
#

Nice one, Thank you @meager granite 😎

subtle ore
#

@tough abyss triggers are native, but they are nowhere near full utility. Which is why I say no matter if triggers are native or not, sqf is still going to be hands down better wether or not you have faster execution time.

cloud thunder
#

_triger setTriggerTimeout [10, 10, 10, true]; would evaluate every ten seconds and is sqf.

subtle ore
#

very true. But we're talking just straight up triggers

#

Triggers are garbage

cloud thunder
#

do you mean editor triggers?

#

scripted triggers

#

is that in a foreach MarkerList ?

cloud thunder
#

how do you mitigate performance impact versus changing marker color when the color shouold change. I mean you can either spawn that sctipt for each marker or run code above in a foreach marker array wraped in a loop. How responsive the reaction will be vs how much evaluation at a certain period interval. The more markers in that loop the more load at evaluation so you need to put a sleep in there but loose the resonsiveness.

#

This is why I think the scripted triggers are nice. You can add one for each marker and add them to the scheduler. The argument that triggers are objects that need to be synced is not a huge concern for me. By that logic players are objects so no player support is faster sync. But really, just because players suck and have bigger issues than triggers does not mean its a good or fun mission.

cloud thunder
#

do you know if an object that has been HiddenGlobaly still syncronizes with clients @tough abyss ?

#

I just did a test of making triggers on server then hideobjectglobal true and then hideobject false on server. I still managed to triger the trigger as a client on dedicated. So its still working as intended. If this does dissable syncronization on clients then this is awsome..

cloud thunder
#

Not sure if there would be any significance. Maybe would not sync object to client. I don't know how to test that.

quartz coyote
#

@dim terrace that is only for a video..
I'd like the score to be updated on the screen every to you score a point in-game.
I'll try that @compact maple

dim terrace
#

Ah, it was supposed to be answer for 3rK, got that external tools questions wrong

still forum
#

@barren magnet Have you thought about that your code might not work because arma3iscool doesn't exist... And that you might need to use configFile if you want to access the config?

barren magnet
#

No that's not the case. It does not matter what you out there, it's just that the preprocessor won't parse it. Look at the ticket

compact maple
#

@Flash-Ranger#8874 what do you mean ? This is for external screen, so with a basic external script you can fill an image and export it as a Paa then dymanicaly upload it oneach score change, but its kind of heavy

compact maple
#

Anyone had to add damage with ace functions ? I have tried adddamagetounit function. It doesn't work properly. Wounds doesn't d'switch to yellow or red. How do you proceed ?

little oxide
#

@cloud thunder Just use localilty true when creating trigger, it's the same as hideobjectglobal ect ...

cedar kindle
#

@compact maple works fine, show your code

compact maple
#

@cedar kindle I took the exemple which are in the function

cedar kindle
#

did you replace bob

#

oh nvm wasn’t that function 😂

compact maple
#

Lol

cedar kindle
#

the first function should work fine

#

example *

compact maple
#

This is the function with leg_r right ?

#

I'm not at home so I don't have my code

cedar kindle
#

aye

#

where are you running it

compact maple
#

In a function called by a trigger

#

So I get my player with bis select 0

#

The ppeffect I created work with the _player but not the ace func :[

thorn pine
#
{
    _array set [_forEachIndex, objNull];
} forEach _array;
...

@little eagle 1, 3 bad code. _forEachIndex represents NOT the index of the current array element! https://community.bistudio.com/wiki/forEach Notes Killzone Kid. 2 is work.

still forum
#

Which is exactly why commy does it like he does it... @thorn pine Not modifying the array at all so the _forEachIndex stays correct

#

But... If you look closely... KK's example code shows that _forEachIndex does actually reflect the index of the current array element.

#
["1",0,["1","2","3","4","5","6","7","8","9"]] // index 0 is "1"
["3",1,["2","3","4","5","6","7","8","9"]]  // index 1 is "3"
["5",2,["2","4","5","6","7","8","9"]] // index 2 is "5"
["7",3,["2","4","6","7","8","9"]] // index 3 is "7"
["9",4,["2","4","6","8","9"]] // index 4 is "9"

So you and KK are wrong @thorn pine It actually does represent exactly the index of the current element.

#

Someone should delete that wrong comment and instead write that the _forEachIndex won't move back if you delete the current element.
But I'd say that's common sense if you are a programmer

peak plover
#

Doesnt foreach make a copy of the array in some way?

still forum
#

no

peak plover
#

So if I delete the next element in every iteration it will come up empty? or will it come up with the element after the next one?

still forum
#

forEach is equal to

_index = 0;
while {_index < count _array} do {
_forEachIndex = _index;
(_array select _index) call code;
_index = _index + 1;
}
#

If you delete the element so that every element moves back one place like
[1,2,3,4]
at 2 delete the next element. Array will be [1,2,4] so your next element will be 4

#

If you set the elements to nil then your next element will be nil

peak plover
#
_array =  [1,2,3,4,5,6];
{
    _array deleteAt (_forEachIndex+1);
}forEach _array;
still forum
#

would execute 1,3,5

peak plover
#

Okay, makes sense actualyl

still forum
#

I'll remove that bullshit comment and write something correct instead.

thorn pine
#

I thought that foreach copies an array

still forum
#

@thorn pine Read the topmost comment

thorn pine
#

If you want to copy an array, you need to use Unary plus

#

I read it, I'm sorry.

peak plover
#

😦

still forum
#

Not really your fault. There are many bad bullshit comments on biki. Someone just needs to clean them up

candid jay
#

what is the easiest way to extract pitch and bank from vectorUp?

#

I recall a function from XCam but can't find it...

thorn pine
candid jay
#

no, from a vector

queen cargo
#

Better would be to explain foreach index using the for command

thorn pine
#

@candid jay see the configuration of this command. This will give an answer.

still forum
#

Fixed the comment

#

@queen cargo while is a lot easier to understand though. And it's what is actually happening in engine.

thorn pine
#

@still forum This is what always happens at the machine level, only through ~ todo.

still forum
#

Yes... That's what I thought about when I said "actually happening in engine"

thorn pine
#

Question. With endless cycles and delays. After sleep worked, a3 the command throws in the end of queue or on another?

candid jay
#

@thorn pine "for some reason, the results of this are not fully accurate"...

still forum
#

I have no Idea what you are saying at all

#

Do you mean the command a3 which doesn't exist or the command throws which also doesn't exist but might be a typo of throw.
And what queue? and what another? what is the other thing?

#

Also endless delays don't make sense...

thorn pine
#

queue = scheduler

time = diag_tickTime + 1;
waitUntil {diag_tickTime  >= time};
spawn {fnc};

or

time = diag_tickTime + 1;
waitUntil {diag_tickTime  >= time};
~call~ {fnc}; // as spawn, just ahead of the queue
#

how uisleep works?

still forum
#

You mean if a newly spawned script get's put at the start or end of the queue?

thorn pine
#

It is possible and so to speak. I'm interested in how sleep works

queen cargo
#

waituntil blocks the script until condition is met

#

neither spawn nor call will be executed until wait until is completed

still forum
#

I don't know at all what you mean with what's possible. The code you wrote doesn't work because time is a command.. So the code like that won't work.
Otherwise if you replace time with a real variable and remove the ~ Then your code works..
Still don't understand what you mean

thorn pine
#

@queen cargo I want to know how this happens at the engine level.

queen cargo
#

check out sqf-vm

#

has closest resemble in public code

thorn pine
#

@queen cargo thx

queen cargo
#

just to note: the actual ingame vm works different

#

but you will get an idea

still forum
#

How what happens @thorn pine ? How the waitUntil works or how spawn/call work or how diag_tickTime works or what?

thorn pine
#

no-no-no how uisleep works?

still forum
#

Ahhh...
Yeah.. uiSleep is kinda like waitUntil on diag_tickTime then.

#

When you sleep your scriptVM is pushed to the end of the script queue. And next time it arrives at the front and is executed again the game checks if the time is over. If yes it continues executing. If not then it pushes it back to the end of the queue again

#

If your sleep runs out while the script is in the middle of the queue it still won't execute till it reaches the front again.
Which is why 99% of the time Sleep and uiSleep actually do sleep longer than what you tell them to

thorn pine
#

Thank you @still forum

little eagle
#

How's what I wrote bad code. 🤔

#

I mean, it is generally, but those 3 examples from yesterday.

#

Also I'm 99% sure setTriggerTimeout refers to the timeout after the condition evaluated true, not the frequency of checks which is always 0.5s.

inner swallow
#

yeah, that's what i thought too

still forum
#

It's not.

#

He just believed some bullshit comment on biki

#

Yeah you can't manipulate check frequency.

inner swallow
#

timeout just means "condition should be true for this long for the trigger to activate", afaik

meager granite
#

You sort of can, if you create trigger with createVehicle, it does condition check on each frame

subtle ore
#

Why use create vehicle for the trigger though?

meager granite
#

To do condition check on each frame of course

#

But nowdays you have stacked EachFrame and there is no need to use this hack anymore really

#

Unless you're scripting for OA where it is still useful.

#

OG onEachFrame before the command

#

Wish it was discovered earlier though, so in theory we could've had onEachFrame back in A2 or even earlier.

subtle ore
#

Why would this be practical though?

meager granite
#

Its onEachFrame

#

Which was only added in 1.63 OA (~2012, right before A3)

#

Before that you only had Draw UIEH which is only valid for clients as server doesn't have UI

subtle ore
#

Hmm. I guess if that is your only method of doing so that works.

meager granite
#

Its no longer needed but could've been useful many years ago if was discovered earlier.

subtle ore
#

Right, for those who still play A2 i guess. For whatever reason.

meager granite
#

Still useful in OA nowdays as you don't have stackable EachFrame there, having createVehicle'd triggers works as stackable on each frame

#

(I'm in OA right now)

subtle ore
#

I see. What's different in the creation of the trigger though?

meager granite
#

Don't ask, it all has purpose

subtle ore
#

Between the command and createVehicle

meager granite
#

It gets simulated more often compared to createTrigger thus condition check gets called each frame instead of each 0.5s

subtle ore
#

Lol. Very colorful purpose

#

Ah, very nice.

quartz coyote
#

@compact maple yes that's it. I have screens in game. When you score a point in-game the screen in the mission is updated. It is kinda heavy in paa that's why I was asking if their was an other way to do it

compact maple
#

@quartz coyote okay, i cant help on this one sorry ^^'

subtle ore
#

@tough abyss Sa Matra isnt the only OA editor at the moment
<----

#

Come join the party Quik, 👁 👄 👁

#

🙄

tough abyss
#
NO ACE3 BRIEFING SLIDESHOW:
//in init of controller (in this case a laptop)
this addAction ["Briefing 1","briefing1.sqf"];this addAction ["<t color='#ff0000' size='7'>CLOSE ALL(Cannot be Undone)</t>","closeall.sqf"];

//in briefing1.sqf
laptop1 addAction ["Slide 1","briefingslide1.sqf"];  //adds actions needed for slide sqf files. Copy, paste and plug in as many times as needed.
laptop1 addAction ["Slide 2","briefingslide2.sqf"];  

//in each slide.sqf
screen1 setObjectTexture [0, "images\userimage.jpg"];  //image file path relative to mission directory
laptop1 setObjectTexture [0, "images\userimage.jpg"];  //create one entry for each screen that will have displayed image

//in closeall.sqf
laptop1 removeAllActions 1;

//I'm still working out a way to close the briefing actions without completely removing them. If you can help please contact me :)```
subtle ore
#

Can you format this correctly please?

#

Easier on the eyes

tough abyss
#

@subtle ore like this?

subtle ore
#

@tough abyss No, not necessarily. but what exactly is the problem?

#

Setting a blank texture or a blank string will reset the texture on that face

tough abyss
#

I meant in the scoll menu

#

I want to have the "CLOSE ALL" option hide all the slides

subtle ore
#

Removing them withought removing them? That doesn't make any sense. If anything make a condition

#

Make a boolean to check if an action has been used or not. Condition it, if they are all true, add the close all action

tough abyss
#

Okay I will try that

frank ruin
#

if I get value is any

#

How would I check that.

#

So if it's any I can put a default value?

#

Isnil or isnull gone be any go to for this?

little eagle
#

isNil

#

createSoundSource - if you make an addon.

#

...

#

Maybe say3D.

little oxide
#

createsoundsource doesn't work with mission config file ?

little eagle
#

Creates a sound source of the given type (type is the name of the subclass of CfgVehicles which is pointing to the sound defined in CfgSFX).

little oxide
#

that's i wanted to quotes lol

little eagle
#

CfgVehicles in mission config?!

little oxide
#

example show that

little eagle
#

inb4 this can be exploited to get eventhandlers to objects.

little oxide
#

define cfgvehicles inside the description.ext

little eagle
#
class CfgVehicles {
    class All {
        class EventHandlers {
            init = "systemChat str [_this]";
        };
    };
};

Something like this?

#

Then I'd go with createSoundSource for your thingy. You most likely want it to loop and that's the best thing to implement that.

little oxide
#

ez to stop the sound too

little eagle
#

Yep, it's clunky to set up, but nice to script with.

#

The configs.

#

Two of them even.

#

🙏

#

It was extremely unlikely.

little oxide
#

yeah, i think cfgvehicles only work with createsoundsource

#

the command was designed to support this feature

little eagle
#

Repurposed.

tulip cloud
#

What characters are allowed for creating function classses?

class myFunction
class my_Function
class my-Function
etc...

Is there some place where I can find the full list of characters?

tame portal
#

@tough abyss Imagine being able to put mods into your missionfile

#

Starts downloading 20GB missionfile

little oxide
#

Lol

little eagle
#

@tulip cloud a-z, A-Z and even 0-9.

#
  • Probably isn't allowed to be used at all. That's a minus for SQF.
tulip cloud
#

got it so all special characters are offlimits

halcyon crypt
#

C's alphanumeric characters and underscores are probably a safe bet

little eagle
#

People would rather download 20 GB over and over again than to download them before picking a server.

queen cargo
#

why everybody thinks that way?
you guys know garrysmod? just let ppl download the mods upfront instead (but ingame and from the actual server)

#

and that is just a basic source engine feature

#

that is what more or less is lacking in arma

#

for proper modded servers

#

but that is limited by engine

#

((more or less))

tame portal
#

I mean Gmod is doing it fine..

#

Whatever is on the workshop is downloaded from the workshop once

#

and everything else custom is downloaded from the server

#

I mean it might take some time sometimes but it sure as hell is more comfortable in most cases

queen cargo
#

workshop was not always existing btw.

tame portal
#

Well it definitely is doing that now 😛

queen cargo
#

reason for things taking so long is because most servers do not utilize separate file host

#

which is why that download also affects game server performance (bad ping)

halcyon crypt
#

T works for "spotting" anything 😃

#

enemy units as well

#

when you're spotting them with the binoculars for example

drifting barn
#

in constrast to what?

drifting barn
#

I didnt mention anything about unit roles; pressing T is manual mine detection

#

the code I added is just to make it like it used to be, fully automated

edgy dune
#

would enableEngineArtillery true; give any vic the arty computer?

tough abyss
#

I don’t think so...

inner swallow
#

no, but ```sqf
enableEngineArtillery false;

would probably take it away
#

actually no, i think it's irrelevant to the computer

#

i mean, mostly

#

from the biki description it sounds kinda redundant in A3, though. Never had to use it to allow indirect fire.

red anvil
#

Guys, im trying to make this old script work..but no success. its a script to make a plane/helicopter full stop in a few secs using the action menu when you are in the driver seat.
im executing it from the cfgvehicles->useractions

class UserActions
        {
            class RepulsorStop
            {
                displayName = "[Repulsor Full Stop]";
                displayNameDefault = "[Repulsor Full Stop]";
                textToolTip = "[Repulsor Full Stop]";                
                position = "pilotview";                
                priority = 99999999999;
                radius = 10;
                onlyForPlayer = 0;
                shortcut = "";
                hideonuse = 1;
                condition = "(player == driver this) AND (alive this) AND (speed this >10)";
                statement = "this execVM ""\uwing\initrepulsorstop.sqf""";
            };        
        };

This is the sqf

_vcl = _this;
sleep 0.01;
while {speed _vcl < 5} do {
sleep 0.01;
_factor = -0.04;
if (speed _vcl >= 100) then {_factor = -0.08};
if (speed _vcl < 5 ) exitWith {};
_vcl setVelocity [(_factor*(sin getDir _vcl))+(velocity _vcl select 0),(_factor*(cos getDir _vcl))+(velocity _vcl select 1),(velocity _vcl select 2)];
};
#

I activate it, no errors popup but the plane/heli doesnt stop or reduce its speed

#

any help?

red anvil
#

Thank you man, will try it asap

meager granite
#

@tough abyss Still players on our OA servers, it is still fun compared to A3 too (and much more FPS)

#

Though it is indeed a form of self-flagellation, this turret bug drives me insane, turns out it happens in any setup, you can repro it in simplest mission possible, just two player units and created vehicle and you can break the turret by rejoining.

meager granite
#

Yeah, Wasteland Utes one

lean tiger
#

I'm having the most obscene time trying to force 3D position on a vehicle exactly

#

vehicle/object

meager granite
#

getPosWorld setPosWorld

lean tiger
#

did find those, appears I'll need to recalculate my coordinate system however

#

appreciate it 😃

#

yeah, need to resample it all, but thank you for the confirmation -- the digrams are hard to read at 3am ^^

#

@meager granite

velvet merlin
#

how does one stop AI planes from taking off these days?
disableAI "move" on driver and vehicle doesnt work - only setFuel 0, but i like to avoid that

inner swallow
#

The only way i've found is to start with the pilot outside the plane, with a HOLD waypoint.

#

Make him GET IN when you want the plane to move

velvet merlin
#

damn 😐

inner swallow
#

yeah it's not ideal :/

edgy dune
#

@red anvil wat about the z direction?

#

also

#

so lets say

#

I have added the 155mm howitzer to a tank,for science reason ofc. Is there anyway to add the arty computer to said tank?

austere granite
#

i much more enjoyed wasteland utes than the A3 versions, so understandable it has players

meager granite
#

A3 Wasteland is very problematic due to easy inventory duping and related inventory problems

dim terrace
edgy dune
#

can u give tanks the arty computer?

compact maple
#

hi guys, is there a way i can screenshot every clothes in the arsenal ?

edgy dune
#

f12?

compact maple
#

I mean, if i got 300 uniforms

#

i dont want to press F12 300 times

#

if there is a script that get every possible uniform, it could be nice

winter dune
#

maybe this can help you

#

hmm, but you can't screenshot the uniforms, so won't help you xD

south pasture
#

Hi, is there the way to remove fallen trees from the game world (supposedly might save some traffic)?

meager granite
#

hideObjectGlobal it on server

inner swallow
#

"set airplane throttle in a loop" wow, so hacky 😄

velvet merlin
#

@dim terrace thanks master 🙇

little eagle
#
        class Insect: Bird //inherits 19 parameters from bin\config.bin/CfgNonAIVehicles/Bird, sources - []
worthy spade
#

Can I overwrite a BIS function with my own from a scenario folder?

#

Perhaps with CfgFunctions? I haven't found an apparent way yet.

still forum
#

It shouldn't be allowed.. But I think you can. But you have to overwrite the BIS functions config. Which is in game config not description.ext config

little eagle
#

Can't you disable the functions cache for the mission or something? That'd mean the mission takes longer to load though.

elfin bronze
#

How to check if player is in a marker (a rectangle) ? I try this but it's not correct : ** player inArea [getMarkerPos "marker_1",getMarkerdisSize "marker_1" select 0,getMarkerSize "marker_1" select 1,0,true] **

little eagle
#
player inArea "marker_1"
elfin bronze
#

OMG -_- Thank !

little eagle
#

It's nice isn't it !?

elfin bronze
#

Yeah and more simple !

jade abyss
#

and the Marker can have any shape you want

#

So not restricted to a circle only

still forum
#

Any supported shape... Polygon markers would be awsm

jade abyss
#

e.g. L-Form?

little eagle
#

Dick shape.

jade abyss
#

DickButt

barren magnet
#

not a marker but a polygon

jade abyss
#

@barren magnet
\*poof*
*poof*

little eagle
#
  • *poof* *
#

: (

jade abyss
#

*lol* *noob*

little eagle
#

I wanted to write *poof*, but cursive.

#

*poof*

#

yey

jade abyss
#

😄

tame portal
#

poofing intensifies

plucky beacon
#

but a circle isn't a polygon

jade abyss
#

🤦

little eagle
#

Obligatory: a circle is a polygon with infinitely many edges.

plucky beacon
#

a polygon is a plane figure that is bounded by a finite chain of straight line segments closing in a loop to form a closed polygonal

#

🤔

#

it says right here it is finite though

little eagle
#

Oh, it' written down somewhere!? It must be true then. (jk)

serene robin
#

Hey i have a question about a script im trying to create

jade abyss
#

Answer is: No

little eagle
#

Yes!

lucid junco
jade abyss
#

(why do ppl ask a Question to ask a question or just make pointless statements instead of asking it directly)

serene robin
#

Im trying to write a script for the new rugged screens that were added in. I have 2 scripts as UserActions in the config, and im trying to get images on the screens through the script. I have tried changing the hiddenselectionstextures and that did not work.

#

Or basically just have it so that the screens spawn with the images on them when you place them down

serene robin
#

Any suggestions?

blissful depot
#

say, does anyone know if its possible somehow to use a player's PID in a script in dedicated? Like "76561197968970197" setdamage 0 or something

#

can I use their PIDs to run scripts on them?

jade abyss
#

Not that i know of

meager granite
#
_player = {if(getPlayerUID _x == "123123123") exitWith {_x}} forEach allPlayers;
if(!isNil"_player") then {
    _player setDamage 0;
};
#

@blissful depot

blissful depot
#

neato thanks @meager granite !

jade abyss
#

hm, i expected that was an obvious one and not meant ¯_(ツ)_/¯

#

Could also be reduced to:

{if(getPlayerUID _x == "123123123") exitWith {_x setDamage 0;}} count allPlayers;```
meager granite
#

I wish there was proper server-side clients list though, with as much info as possible

jade abyss
#

Yep

meager granite
#

So you can work with clients even if they don't have player unit.

jade abyss
#

Can't you do that with the OwnerID?

#

e.g. setVariable/RemoteExec with the OID as Target (iirc that was possible)

meager granite
#

Yes, but you have to form and maintain your own clients list through PlayerConnected\Disconnected event handlers

jade abyss
#

Yep

blissful depot
#

I can get it from the SQL database in my case

jade abyss
#

Nah, we are talking about something completely different

blissful depot
#

oh ok

jade abyss
#

also: What if the DB doesn't exist 😉

meager granite
#

owner is momentary thing, changes each time you go from lobby into the game

blissful depot
#

I wish I was clever when it comes to scripting 😃

meager granite
#

Actually, does it? Do you have to fully disconnect to get new owner assigned? 🤔

#

Probably not

jade abyss
#

Guess so

#

I guess it works like that:
you Disco to Lobby, had OID 1, another one connects while you are still in lobby -> He gets OwnerID 1 -> You connect in and get .. idk... OID 4

#

I doubt that it saves that stuff

meager granite
#

Not as in simply going back to lobby and into the game should be enough to get new owner id

jade abyss
#

No clue. Either it creates a new one (+1 after the latest one) or uses the lowest free one. (i tend to the "lowest") ¯_(ツ)_/¯
Never tested/watched it, since: Never needed^^

meager granite
#

Just tested it, to get new owner you need to fully disconnect from the game, going back to lobby gets you same owner id

jade abyss
#

Even when another person logs in before you rejoined?

meager granite
#

Don't think it should matter

jade abyss
#

or uses the lowest free one. <- thats why

meager granite
#

You're still on server and your owner id still persists (but owns no vehicles, etc.)

#

No, I don't think it ever uses free owner ids, just increments for each server-joined client

jade abyss
#

hmmm, so that stuff must be stored somewhere

#

increments Ah, that was the word i was searching before 😄

meager granite
#

Yeah that's why I said it would be great to have server clients list, so you can have info on players that are in lobby (PlayerConnected calls when you join the game from lobby)

jade abyss
#

"It's somewhere hidden in the Matrix"

plucky willow
#

_rpgVel = velocity _rpgRound;
_rpgDir = (_rpgRound getRelDir _randomTrench);
_speed = 295;
_randomUpX = 0;
_randomUpY = 0;
if (_useLoc == rpgspawn1) then {
_randomUpX = ((random [-0.5,0,0.5]));
_randomUpY = ((random [-0.5,0,0.5]));
};
if (_useLoc == rpgspawn2) then {
_randomUpX = ((random [0,0.3,0]));
_randomUpY = ((random [0,0.3,0]));
} else {
_randomUpX = ((random 2) -1);
_randomUpY = ((random 2) -1);
};

_rpgRound setDir _rpgDir;
_rpgRound setVelocity [
    (_rpgVel select 0) + (sin _rpgDir * _speed),
    (_rpgVel select 1) + (cos _rpgDir * _speed),
    (_rpgVel select 2)
];
_rpgRound setVectorUp [_randomUpX,_randomUpY,1];
#

im having some issues with the vectorup random numbers

#

most of the time they are consistent and work well, but sometimes they just fire straight at the ground underneath where it spawned

#

i cant figure out why

#

oh, this script fires rpg rounds randomly

meager granite
#

rpgspawn1 will always use that (random 2) - 1 block

#

This is the reason, you're setting really weird up vector, for example it can be [1,1,1] which is -45 degrees elevation

#

So it will fly straight into the ground

#

Spawn some arrow helper and set its vector up to these values to see how it looks

plucky willow
#

welp im an idiot, yeah that fixed it, cone is much narrower after replacing the else statement

#

thanks, ive been staring at my text editor too long to think properly

meager granite
#

If _randomUpX and randomUpY happen to be 0.5 and 0.5 or very close, this will still send RPG into the ground but it should be uncommon

plucky willow
#

yeah im testing right now, firing them every half second and seeing the distribution

meager granite
#

Test with worst possible cases (_randomUpX = 0.5; randomUpY = 0.5) to see how it looks and if it suits your goal

plucky willow
#

the 0.3 seems to be the upper limit, higher and the rpgs detonate in the air

#

might have some fun with those airbursts though

#

_incomingSound = "rhsafrf\addons\rhs_sounds\rpg\rpg_1.ogg";
playSound3D[_incomingSound,getPos(_useLoc)];

#

this sound file doesnt play though

#

oh i see why

#

the getpos isnt necessary

little eagle
#

That looks just all around wrong. What is this trying to do?

#

setVectorDirAndUp takes two arrays, but _randomUpX = ((random 2) -1); implies they are numbers. Syntax error, the line is ignored.

#

As well as everything after that,

plucky willow
#

its just setVectorUp

#

the direction is already retrieved via getRelDir

#

i can send you the whole script if youd like, just pm me

#

it works

inner swallow
#

Doesn't playSound3D need an absolute path to the file?

#

Or have they changed that now?

little eagle
#

Can you explain what it does, AxleVice?

meager granite
#

He's spawning RPG round that flies into general direction that supposed to miss

austere granite
#

Is there a way to force a cutRsc to always be topmost (Above dialogs)

little eagle
#

That's just some simple vector math then:

private _fnc_fireMissile = { 
    params ["_origin", "_target"]; 
 
    private _tdir = _origin vectorFromTo _target; 
    private _tlat = _tdir vectorCrossProduct [0,0,1]; 
 
    private _speed = 295; 
    private _missBy = 20 * selectRandom [1, -1]; 
    private _aimedAt = _target vectorAdd (_tlat vectorMultiply _missBy); 
 
    private _vdir = _origin vectorFromTo _aimedAt; 
    private _vlat = _vdir vectorCrossProduct [0,0,1]; 
    private _vup = _vlat vectorCrossProduct _vdir; 
    private _vel = _vdir vectorMultiply _speed; 
 
    private _rocket = "???" createVehicle _origin; 
    _rocket setVectorDirAndUp [_vdir, _vup]; 
    _rocket setVelocity _vel; 
};

[getPosWorld e, getPosWorld p] call _fnc_fireMissile;

This should work. I don't have the game atm and can't remember any rocket classnames.

vivid locust
#

When you want to exec a script and wait for it to finish how do you do that?

_handle = execVM "test\test.sqf";
waitUntil {scriptDone _handle};

That's how I would exec the script that needs to be done before the code continues but what do you write in the script to trigger the scriptDone?

meager granite
#

Script's top most scope has to end or script thread should be terminated with terminate command (from anywhere)

vivid locust
#

So the scriptDone just checks for the very first scope to end?

austere granite
#

yes

vivid locust
#

Thank you

little eagle
#

In your example, just use

call compile preprocessFileLineNumbers

instead of execVM.

vivid locust
#

Okay, thanks for the hint

south pasture
#

How to track headless client disconnect?

meager granite
#

And the right one. You will need to make server know which owner id headless client has though

#

When headless loads, make it send its own owner to server

south pasture
#

But that part confused me - player unit (there is none for HC)
unit: Object - unit formerly occupied by player

meager granite
#

PlayerDisconnected will also work

#
  1. Send headless client's clieanOwner to server, when disconnected event happens, check if its HC's owner
south pasture
#

clientOwner executed on server(handler happens there) gives 2.

#

Looks like onPlayerDisconnected command is the way, it has _owner of leaving client

#

Aha, there is PlayerDisconnected mission event - that should do

serene robin
#

Im trying to add an image to one of the rugged screens through a useraction with a script. Any suggestions?

blissful wind
#

select 0 setObjectTexture "mytexture"

#

that´s one way to do it

#

you can change it bac kstill it would be a longer code to run inside those brackets tho

tame portal
#

@south pasture Samatra meant that you do clientOwner on the headless client when it joins and send the ID to the server

#

clientOwner will return 2 on the server because the server is always 2

serene robin
#

@blissful wind would that be a scripted function that could run off of a useraction?

blissful wind
#

im sorry may have read it wrong i though you meant something like addAction

serene robin
#

Basically, i have an object that i made in a config.cpp that i have 2 useractions on. I was wanting to put another action on called "Turn On" that would populate an image onto the screen and then have th other options open for players to use. Does that make sense? Sometimes i am bad at explaining things, sorry

blissful wind
#

I´ll DM you

serene robin
#

thanks

tender fossil
#

Is it possible to reduce the update/sync interval of distant units locally in multiplayer?

still forum
#

no

tender fossil
#

@still forum Thanks for answer!

still forum
#

no

meager granite
#

Empty string in special parameter in createVehicle throws enum error now

#

Who's idea it was? How many missions spam errors now?

tough abyss
#

Rpt error or popup error?

little eagle
tough abyss
#

:/

meager granite
#

Yep, have this as well

little eagle
#

loadCoef is the weirdest one, because it's actually correct.

meager granite
#

Its not even enum as it supposed to support custom values

#

unit setUnitTrait [skill_name, value, isCustom]

little eagle
#

Yeah, and this isn't even a custom one. No idea why this pops up.

still forum
#

A ton of people already told BI about invalid enum errors.. None of them were fixed and now it's pushed to release -.-

meager granite
#

🤔 🔫

#

Is there a ticket?

still forum
#

Isn't that awesome? reported almost 2 months ago on dev branch. issue marked as reviewed and nothing happened.

little eagle
#

What was the point again of using createVehicle with ""?

tough abyss
#

Less typing

little eagle
#

So it's supposed to fail and give objNull.

meager granite
#

It been using default placement option of NONE for eternity now

little eagle
#

Ah, I thought it was the classname.

#

That makes sense.

meager granite
#

createVehicle ["whatever", getPos player, [], 0, ""]

little eagle
#

Yeah, makes sense that they do the enum check for that one. But maybe they should've just white listed "" too.

meager granite
#

Looks like only audibleCoef, camouflageCoef and loadCoef throw enum errors

#

Along with custom traits of course

#

Yet command works fine

minor canyon
#

Guys can you help?

" call BIS_fnc_timeline_getSimulatedCurves);
}
forEach (allMissionObjects "Timeline_F");"

how to add it to scripts.txt to prevent kicks?

subtle ore
#

Kaboom, dont triple post nezt time please

meager granite
#

oh he didn't even post in BE channel

#

Thought to move answer there

#

or server admins

tough abyss
#

What the fuck are these new enum errors?

still forum
#

@tough abyss Scroll up to the feedback tracker links

tough abyss
#

@still forum - is it a bug on my side or...?

subtle ore
#

@meager granite Yeah that's a little concerning. but it was in asking questions, and general chat. And finally here

tough abyss
#

Cause I don't see anything wrong with this. In fact, it works as well as it did before the update, minus the enum error ```SQF
#include "script_component.hpp"

private "_curator";

// Create curator module, needed to assign curator
_curator = (createGroup sideLogic) createUnit ["ModuleCurator_F", [0, 0, 0] , [], 0, ""];
player assignCurator _curator;

// Make all entites editable by all curators
{
_x addCuratorEditableObjects [entities "", true];
} forEach allCurators;

hint "Zeus has been created, all entities are editable.";

brazen sparrow
still forum
#

It's not a bug

#

well.. kinda

#

the "" argument for createUnit is invalid

#

check wiki

#

But it actually doesn't break anything. It should be a warning not an error

#

What you linked is a different error that's actually completly invalid and should be ignored

tough abyss
#

Ah, ok. I should probably change "" to "NONE" anyway.

subtle ore
#

Wait what? Wtf? Seriously?

#

?

tame portal
#

🤔

subtle ore
#

😎

#

@tough abyss Yes, that is what i was responding to

#

Maybe they have plans to fix them

tame portal
#

Maybe diag_log should get it's own log file..

little eagle
#

It's fine as long as I'm not the only one affected by the bugs.

tame portal
#

@little eagle We can change that

little eagle
#

Can you? I already fixed all my bugs from the update.

subtle ore
#

No Commy, your cba addiction is just you
🚶 💨

little eagle
#

Well nothing in ACE from me uses the enum thingies and neither does BWA3.

subtle ore
#

Heh

tame portal
#

How do you actually use enums

little eagle
#

There're those fucked up models I posted in #general_chat_arma , but models are not what I do, so meh.

tame portal
#

Or is it just different string contents

little eagle
#

No responsibility.

#

Just strings some commands take.

tame portal
#

Wew

#

I thought theres something new in SQF world now 😄

little eagle
#

Just use macros if you want an enumerator.

tame portal
#

I can see my SSD getting full because of RPT errors

#

application that cycles through rpt all the time and logs everything thats actually not there randomly to a different file

hard marsh
#

Anyone know a bomb script, I'm trying to make a hyper realistic warfare scenario and have buildings explode. I can't seem to figure out a code for it, can anyone help?

plucky beacon
#

hyper realism 😅

#

sounds like you want something very specific

hard marsh
#

Yeah

#

Opfor goes into a town controlled by NATO and I'm trying to achieve controlled explosions in order to make a small film

#

@plucky beacon

plucky beacon
#

🤔 Opfor goes into enemy territory for a film of explosions?

#

seems rather ellaborate

#

What does this mean for the script though.

little eagle
#

Are you asking about how you can blow something up with a script?

hard marsh
#

Yeah I'm new to arma

plucky beacon
#

Could always create a bomb on a marker

plucky willow
#

check out the RHS nuke, you can customize the explosion

#

if youre adamant about scripting it in youll need to be a bit more specific

hard marsh
#

Is or on Steam?

#

It*

plucky willow
#

yes its on steam

hard marsh
#

Okay I'll check that out

plucky willow
#

i cant recall which RHS pack its in but its either US or Russia

little eagle
#
private _target = cursorObject;
private _bomb = "SatchelCharge_Remote_Ammo_Scripted" createVehicle ASLToAGL getPosWorld _target;
_bomb setDamage 1;

???

hard marsh
#

thanks @little eagle

#

@little eagle So will this blow up a vehicle or a building or what?

plucky beacon
#

it'll blow up a satchel charge an whatever your cursor is looking at

hard marsh
#

So how do I trigger the explosion?

plucky beacon
#

it does it immediately

hard marsh
#

Is there any way I could set a time limit for it or a countdown?

plucky beacon
#

you could make a trigger, or just add a sleep to it. but you can't do that through the console because functions are always woke

little eagle
#

The question was how to blow something up. Well this blows up _target.

hard marsh
#

🅱oke

#

okay, so do OI have to set a speic init name to a target?

#

Specific*

plucky willow
#

yes you can change the target to be a specific object

hard marsh
#

okay, thanks

plucky beacon
#

private _target = YoHouse

little eagle
#

player

plucky willow
#

how do you paste code into discord like that?

hard marsh
#

Alright thanks you guys.

little eagle
#

```sqf
<<< code here
```

plucky beacon
#
waituntil {player == player};
private _target = player;
private _bomb = "SatchelCharge_Remote_Ammo_Scripted" createVehicle ASLToAGL getPosWorld _target;
_bomb setDamage 1;
little eagle
#

Short mission.

hard marsh
#
<<<I'm woke
plucky willow
#
    _rNum = floor(random 12);
#

okay thats nice

hard marsh
#

Oh no arma is being retarded

plucky beacon
#

on the contrary, you just haven't fixed it yet

hard marsh
#

No, I mean "Launching the game has failed, do you want to run Arma 3 without Battle Eye? "

plucky beacon
#

🤷

little eagle
#

Fireworks:

 
0 spawn { 
    for "_i" from 0 to 30 do { 
        sleep random 2; 
 
        private _pos = player getPos [10 + random 50, random 360]; 
        _pos = _pos vectorAdd [0,0,30]; 
          
        private _bomb = "SatchelCharge_Remote_Ammo_Scripted" createVehicle ASLToAGL _pos;  
        _bomb setDamage 1; 
    }; 
};
#

Boring without the ACE frags.

hard marsh
#

Can I send someone a screenshot of the code that's not working?

plucky willow
#

where are you placing the code?

plucky willow
#

looks like steve gave up ☹

plucky beacon
#

🎺

#

or he's trying to fix it

plucky willow
#

if i pass a parameter to a function like this: ["myParam","myParam2"] spawn my_function;

#

and i try to use that parameter but it requires quotes

#

do i need to put _myParam in quotes or can i exclude it?

little eagle
#
[_arg1, _arg2] call {
    params ["_arg1", "_arg2"];

};
compact maple
#

Hello guys, i need some help, i got this array : [[2,60,2]]
i want to use it to make som calculations, how can i transform the elements of this array in string ?

little eagle
#
str _array
plucky willow
#

@little eagle im talking about using _arg1

#

let me paste an example

compact maple
#

@little eagle Then i will be able to select in it ?

little eagle
#

Select what?

plucky willow
#

"_arg1" createvehicle getPos _arg2;

compact maple
#

select an element

plucky willow
#

whatever _arg1 is needs to be in quotes

little eagle
#

No, it doesn't.

plucky willow
#

so i can exclude the quotes

little eagle
#

Only for params command it needs to be.

plucky willow
#

i see, thanks

little eagle
#

Afterwards it's a normal local variable.

#

@compact maple
To select an element, you use select:

[[1,2,3]] select 0 select 2 // 3
#

Since you have a nested array, you need to use select twice.

#

The first (and only) element of the outer array is itself an array.

#

Which has 3 elements.

compact maple
#

Yes i know that, thanks, i was trying to hint an element of that array

#

just to debug

#

i did something wrong

#

but how would you do to hint an element of this array ?

little eagle
#

hint needs a STRING, so if your element is a number or something other, you need to use hint str _blah.

compact maple
#

okay thanks so i cant hint one e;ement right ?

little eagle
#

Sure you can.

#
hint str ([[0,1,2]] select 0 select 2);
compact maple
#

Got it

#

Thanks you 😃

halcyon crypt
little eagle
#

I think they should just white list "" instead.

#

Lots of valid enums are detected as errors wrongly atm.

halcyon crypt
#

🤦

plucky willow
#

i have a do while loop and it seems to only run once every 5 seconds or so

#

anyone know how to make it run more often?

#

nvm im an idiot

meager heart
#

Good time of day everyone, i am having some trouble with localizations on dedicated server

private _script = [] spawn 
{
    private _islocalized = missionNamespace getVariable ["var_localized",""];
    if (_islocalized == "") then  
    {
        var_text_name =    localize "STR_sector_name"; 
        missionNamespace setVariable ["var_localized",var_text_name,true];
    };
};
waitUntil {scriptDone _script};

if (isServer) then 
{
    private _text = missionNamespace getVariable ["var_localized",""];
    s_module_sector setVariable ["name", _text, true];
};

//--- TEST
var_test = missionNamespace getVariable ["var_localized",""];
str var_test remoteExec ["systemChat",allPlayers]; 
//--- Return correct localization, but on map sector name is random

so the result is random every time
what is wrong ?

#

On local host its working

queen cargo
#

Random?

#

What exactly are you trying to archive?

meager heart
#

Trying to make sectors names on map localized for players, by default it will be localized server side, so if server language is english then names will be on english

#

Random?
with this code above it worked, but localization is random every start, so you have all available languages but not that your client is

#

is it make sense ?

jovial ivy
#

Is there a better way to store a players items to use later then doing this? //Kit Layout: ["Kit Name", "Kit ID", [[0, "Uniform", ["Items"]], [1, "Backpack", ["Items"]], [2, "Vest", ["Items"]], [3, "Helmet"], [4, "Glasses"], [5, "ExtraItem,ExtraItem2"], [6, "Primary", ["Info"]], [7, "Secondary", ["Info"]], [8, "Launcher", ["Info"]], ["9", "Other Items", ["Info"]]]]

#

Ignore the numbers behind some of that, thats just so I can organize some data a bit better.

meager heart
#

@jovial ivy var_loadout = getUnitLoadout ?

jovial ivy
#

Pshh I knew that 😛 - Thanks

plucky willow
#

should the init.sqf only be run on the server?

meager heart
#

init.sqf runs on client and server same time

queen cargo
#

@meager heart you localize normally using the local client and not server-side
And still no idea what you mean with random

meager heart
#

@queen cargo sorry my english is horrible.... lets say you have client with english language, server is started on zulu, then you have sector name on zulu but not english

queen cargo
#

Yup

#

As I said

#

You localize client-side not server-side

#

Server-side it will be local to the servers localization

meager heart
#

and i'm trying to make it localized client side

#

player will see name on his language

#

not server side

#

or there is some bug atm, dont know

queen cargo
#

Uhm... Use that code on each client instead of pubvar it from the server?

meager heart
#

That what i did

#

[] remoteExec ["TAG_fnc_localize",0,true]; //--- initServer.sqf

#

The function is above

#

seems it working like it should when i call it from the client init not the server...

#

@queen cargo thanks

tough abyss
#

I don't know if theres something wrong, but it seems that when im removing the MPHit eventHandler im getting an enum error. This is occuring now but not before. Is this because 1.78 added that error handling?

spice crypt
#

@tough abyss nope. i used -> _blackWasp = createVehicle ["B_Plane_Fighter_01_F", getPos player, [], random 360, "CAN_COLLIDE"]; no config errors.

#

anyone getting 'getUnitTrait' errors in the way of 'Unknown enum value:' since the 1.78 update?

#

:/

#

damn. is there a known work-around for getUnitTrait?

#

so it works as it should, just throws error code?

#

ok. thx.

plucky willow
#
_myArray = ["true"];
_myOtherArray = ["foo","bar"];
_my2dArray = _myArray + _myOtherArray;

//Result? ["true",["foo","bar"]]
#

is that correct?

#

if not how would i achieve that

spice crypt
#

try -> _myArray + [_myOtherArray]; to get it nested.

plucky willow
#

okay, im not quite able to test it yet

spice crypt
#

["true"] + ["foo","bar"] == ["true","foo","bar"]
and
["true"] + [["foo","bar"]] == ["true",["foo","bar"]]

#

just tested it in debug console.

plucky willow
#

so like this:

#
_myArray = ["true"];
_myOtherArray = ["foo","bar"];
_my2dArray = [_myArray] + [[_myOtherArray]];

//Result: ["true",["foo","bar"]]
spice crypt
#

no. just as...

_myArray = ["true"];
_myOtherArray = ["foo","bar"];
_my2dArray = _myArray + [_myOtherArray]; // <- single wrapped [] as you already have the variable _myOtherArray set as an array.

//Result: ["true",["foo","bar"]]
plucky willow
#

ah i see

#

thanks a bunch

spice crypt
#

np

#

i updated the code, you dont need _myArray wrapped twice either.

plucky willow
#

why is the bistudio wiki so damn slow today

spice crypt
#

its been up and down like a yoyo for the past few weeks. i tried it earlier as with the forums... both down.

still forum
#

@halcyon crypt I agree with commy that they should just fix "" Thousands of people copied that example and are now doomed because of some crappy decision BI made.. Fixing the example won't help them

meager heart
#

@plucky willow


//--- 0.0022 ms
_myArray = ["true"];   
_myOtherArray = ["foo","bar"];   
_my2dArray append [_myArray,_myOtherArray]; 
hintSilent str _my2dArray;
//-----------------------------------------
//--- 0.0067 ms
_myArray = ["true"];   
_myOtherArray = ["foo","bar"];   
_my2dArray = _myArray + [_myOtherArray];  
hintSilent str _my2dArray;

https://community.bistudio.com/wiki/append

plucky willow
#

i dunno what im doing wrong

#
_myArray = [[true,false],["somestring",1],["somestring",1]];

if ((_myArray select 0) select 0) then { //should be true
    _countArray = count _myArray; //should be 3
    for "_i" from 1 to (_countArray ) do {
        _x //call some BIS function;
    };
};
#

Error select: Type Bool, expected Array,String,Config entry

#

Error in expression

#

why does it expect an array

#

i want it to be a boolean expression

copper raven
#
if(((_myArray select 0) select 0))then{}

Try

meager heart
#

No errors here

#
0 = [] spawn 
{
    _myArray = [[true,false],["somestring",1],["somestring",1]];

    if ((_myArray select 0) select 0) then 
    { 
        _countArray = count _myArray; 
        for "_i" from 1 to _countArray do 
        {
            hint str _countArray;
        };
    };
};
#

hint is "3"

plucky willow
#

extra parens didnt work

#

it says the error is on this line : if (((_myArray select 0) select 0)) then {

#

maybe i should just put the actual script in

#

but im embarassed to

jade abyss
#

No:

 _countArray = count _myArray; 
        for "_i" from 1 to _countArray do 
        {
            hint str _countArray;
        };```
#

Yes:

{

}forEach _myArray;```
meager heart
#

👀

jade abyss
#

+Why do you hint the same Variable constantly?

plucky willow
#

cant do foreach since i need to skip the first entry

#

which is why its set up that way

jade abyss
#

Still makes no sense

plucky willow
#

but i think i figured out the problem

#

i created _myarray by concatenating arrays together

#

but thats apparently incorrect

jade abyss
#

That whole thing doesn't make much sense, tbh

#

The Mainproblem is:

for "_i" from 1 to (_countArray ) do {
        _x //call some BIS function;
    };```
Whats _x? You don't cycle through the Array with `for`. You simply just execute that code N times
meager granite
#
    {
        if(_forEachIndex > 0) then {
            // Whatever
        };
    } forEach _myArray;
jade abyss
#

Thats what forEach is for
+you can also do a (in the forEach Loop):

if(_forEachIndex != 0)then{YourCode}```
#

Yep, Sa

plucky willow
#

heres the whole thing

#
_magazines = [true];
_magazineArray = [];
_magazineArray = _magazines + [_556] + [_556nt] + [_9x19jhp] + [_smokeR] + [_he2] + [_556saw1];
if (((_magazineArray select 0) select 0)) then {
    _countMags = count _magazineArray;
    for "_i" from 1 to _countMags do {
        _unit addmagazines [((_magazineArray select _i) select 0), ((_magazineArray select _i) select 1)];
    };
};
jade abyss
#

is _556 and the other Vars known known?

plucky willow
#

yes lemme grab them

jade abyss
#

+damn, no

#

Use forEach

plucky willow
#
_556 = ["rhs_mag_30Rnd_556x45_M855A1_Stanag_Tracer_Red",11];
_556nt = ["rhs_mag_30Rnd_556x45_M855A1_Stanag_No_Tracer",4];
_he2 = ["HandGrenade",2];
_9x19jhp = ["rhsusf_mag_15Rnd_9x19_JHP",2];
_smokeR = ["SmokeShellRed",2];
#

yeah i will make that change later

jade abyss
#

You should do it now, the thing above is just wrong

#

The Code inside the for loop can stay the same (except using _forEachIndex instead of _i)

plucky willow
#

getting the same error

jade abyss
#

Also:

_magazineArray = _magazines + [_556] + [_556nt] + [_9x19jhp] + [_smokeR] + [_he2] + [_556saw1];```
Bad thing to do
```sqf
_magazineArray = _magazines pushback [_556,_556nt,_9x19jhp] etc.```
plucky willow
#

ill give that a try

jade abyss
#

All in all:
Work with systemchat str _Var to figure out your Problems (e.g. has _magazineArray the correct look? Is it what you want to look like?)

plucky willow
#

i want to do something along the lines of

#

_array select forEachIndex

#

but thats not working

#

whats the proper way to do that

jade abyss
#

_forEachIndex

still forum
#

If you have _forEachIndex then _x == _array select _forEachIndex so just use _x

jade abyss
#

Unless you select from another Array

plucky willow
#

alright i swapped all those over but im getting the exact same error i got when i first posted here

jade abyss
#

Wich is?

plucky willow
#

Error select: Type Bool, expected Array,String,Config entry
Error in expression

jade abyss
#

+have you checked if the array is correct (systemchat str _array)

plucky willow
#

does systemchat str _array go in the debugger or in the script itself

jade abyss
#

after the array gets created?

#

Maybe an idea?

#

inside the loop you can also add a systemchat str _x to see what is currently used

plucky willow
#

where does it output?

jade abyss
#

dude, it's a basic command. One you should know. Who made that script you quote in here?

plucky willow
#

i wrote the script an hour ago

jade abyss
#

@still forum Is the wiki working for you?

plucky willow
#

the wiki has been shit the whole day, cant get any pages to load which is why im asking here so much

meager granite
#

Wiki is slow as hell

jade abyss
#

anyway @plucky willow Fav the Page from above and check for commands in there. Systemchat for example is (besides diag_log) one of the most usefull commands for debugging/error-searching

#

"today"

#

systemchat str _this 😄

plucky willow
#

_myArray select _forEachIndex

#

this is the line thats not working

jade abyss
#

Dedmen already gave you an answer to it. Checkout (when it's back online) the examples of forEach or at least read what we wrote above

#

Anyway, as long as you don't even check if the array is correct or not, we can (and will) won't help any further

#

Since it's just guessing out in the blue

#

¯_(ツ)_/¯

plucky willow
#

_magazineArray = _magazines pushBack [_556,_9x19jhp,_smokeR,_he2,_556saw1];

#

after this

#

_magazineArray = 2

#

why would it equal 2?

#

so should i use append instead?

jade abyss
#

pushback returns anything?

#

oO

#

Hmm... okay oO Must have missed that

#

why 0?

#

Just do:
Code1;
_array pushback [bla];
Code2;

#

without the null ref

still forum
#

@jade abyss No wiki is offline. But me knows everything anyway :U Man I take long to answer...
@tough abyss BIS functions are rarely updated on Biki.. There is a export script but it can only be imported by Admins. And I don't have time :U

jade abyss
#

Yep, slowbutt 😄

#

Uhm, what?

#

No

robust hollow
#

it needs to return a bool?

jade abyss
#

nonononono

still forum
#

Count wants bool or nil

jade abyss
#

That above should work... hm...

still forum
#

previously pushBack returned Nil I'd guess

#

If it now returns something that's not bool or nil it will error with count

jade abyss
#

Since when does count need something? oO

hard marsh
#

Anyone know how to request reinforcements on editor?

still forum
#

always.. sadly

jade abyss
#

hmmmmmm

still forum
#

We need a better forEach so we don't have to use count.. How good that we have that already :3

jade abyss
#

aw cmon... stupid wiki... was up for 10s

#

🤦 Arma

hard marsh
#

So I have SWAT rushing into a building to take out a single unarmed man and I need reinforcements to make it a lot cooler

jade abyss
#
  • @hard marsh No clue what you are talking about
still forum
#

But count is still very slow.
count myTestArray 10000
{_x} forEach myTestArray; 16.94ms
{_x} count myTestArray; 10.75ms
myTestArray iForEach2 {_x}; 9.27ms
See! count bad

jade abyss
#

Still faster than forEach, if you don't need the Index

still forum
#

Actually no @jade abyss

dusk sage
#

The intercept version is only 1.5ms faster?

still forum
#

{_x; true} count myTestArray; 18.64ms

jade abyss
#
{_x} forEach myTestArray; 16.94ms
{_x} count myTestArray; 10.75ms```
#

So what is true? ^^

still forum
#

Remember you need to return bool or Nil.

jade abyss
#

yo mama needs a nil

still forum
#

Otherwise error. And if you don't already return a nil you need to call a command to give that to you which makes it even slower than forEach

jade abyss
#

+i can't remember using bool or nil in a count loop..... hmmmmm

dusk sage
#

Where's your implementation of iForEach2 @still forum ?

still forum
#

sec

#

I'm injecting a custom script instruction. Because _x = value is too slow. Because BI fucked up again

plucky willow
#

well after replacing pushBack my script now works

#

thanks everyone

still forum
#

You could over 2x speedup assignments to local variables with just one line of code in the engine. But... BI.

jade abyss
#

write your own game 🤓

still forum
#

Or 2x speedup all variable assignments even global ones. By just doing a check at compiletime instead of runtime

#

You mean because it uses CBA?

#

one sec

tight marten
#

is a knowledge of python valuable in anyway to scripting for arma 3 or just C++

still forum
#

The basics can work without CBA. But alot of eventhandlers won't work

jade abyss
#

@tight marten none of it

tight marten
#

😦

jade abyss
#

sqf is a mix of several languages

still forum
#

Though I don't use any of these eventhandlers besides pre/post init. Which I could move to non-cba...

jade abyss
#

I think thats the easiest way to describe sqf^^

tight marten
#

fair enough

jade abyss
#

Java, C# and some other stuff mixed together in a blender

tight marten
#

lol

still forum
#

You wouldn't really see anything of the server using Intercept though

jade abyss
#

I doubt anyone will notice a big diff

still forum
#

Likely not at all.

jade abyss
#

Yep

#

Same with doing optimizations on the code -> You barely see/notice it as Player

still forum
#

depends

jade abyss
#

0.1ms vs 0.05ms -> Client won't notice

still forum
#

depends

#

if you do that 100000 times a frame... They will

jade abyss
#

I am not talking about an overhaul of everything, where you squeeze every little ms out of a codepart

meager granite
#

100000 times 0.05 ms a frame is 5 seconds per frame 🤔

jade abyss
#

^^

#

+If you need to do a code that runs 0.1ms each frame... erm... you did something wrong^^

meager granite
#

Client doesn't notice that his game is still running and not totally froze

#

Kappa

jade abyss
#

LIFE! HE SAID LIFE! HANG HIM!

#

@tough abyss

#

Depends on Resolution

#

😄

still forum
#

I might be able to disable the part of CBA that enforces it on clientside with an optional addon. So you still run CBA and Intercept on Server but the client won't be forced to have it

jade abyss
little eagle
#

Nice windows style.

jade abyss
#

long long time ago, when an Arma Patch broke half of the stuff again^^

#

OldSchool-Windumb @little eagle

meager granite
#

@tough abyss People been suggesting to have one such turret at each base

full kindle
#

windows 3.1 bitch 😉

jade abyss
#

Win98se

little eagle
#

Fits SQF.

jade abyss
#

Or let the ppl drive the Truck from the base to it, be there, wait 10s, Turret is refilled 😉

#

thats life ¯_(ツ)_/¯

plucky beacon
#

Beep boop time to die

thorn saffron
#

Is it possible to edit extCameraPosition for a class CAManBase during the game? I want to try adding shoulder switching to a customized third person camera (and no, attached drone does not work in a way I would like this whole thing to function)

still forum
#

No you can't edit config entries while the game is running

thorn saffron
#

any idea how to have a customizable 3rd person camera that wuld function with all the crosshairs and stuff? I was told you can create cameras and such

jaunty zephyr
#

you can create cameras, but custom controls are a PITA

#

there's two types of camera that I'm aware of : camCurator - used in the Endgame Spectator - and the legacy camera that has fewer features but can do smooth movements

#

for your case - adding HUD elements to 3rd person view - it's probably easier to draw them onto normal 3rd person screen

thorn saffron
#

I just want to change the point of view in third person, but in a way that would allow for shoulder switching

#

with extCameraPosition you are forced into only one setting (shoulder)

tough abyss
#

Hello, I'm trying to create ACE interaction actions.
I created one named "animations" and I'm trying to add another one as its children.

animations = ['Animations','Animations','',{''},{true}] call ace_interact_menu_fnc_createAction;
stand1 = ['Stand 1','Stand 1','',{_player switchMove 'relax_11'; _player playMove 'relax_11';},{true}] call ace_interact_menu_fnc_createAction;
[player, 1, ["ACE_SelfActions"], animations] call ace_interact_menu_fnc_addActionToObject;
[player, 1, ["animations"], stand1] call ace_interact_menu_fnc_addActionToObject;

Problem is that the children doesn't show up.

little eagle
#

You created a Animations node under the ACE_SelfActions node. You need to change ["animations"] to ["ACE_SelfActions", "Animations"]. @tough abyss

#

That's why this argument an array in the first place.

jovial nebula
#

Should remoteExecCall command throw any exceptions? As I was able to find any syntax errors only using remoteExec

still forum
#

If you do everything correctly then it won't.

jovial nebula
#

I mean,if the script gets executed remoteExecCall nothing pops up

#

Instead, if I execute the same script using remoteExec,then a bunch of errors appears

ionic orchid
#

has anyone had a problem with Work Drive not finding settings.ini ? It won't let me mount or extract game files because of it

little eagle
#

@jovial nebula Both will complain about syntax errors. But on scheduled scripts complain about using undefined variables, storing displays and controls in local variables without disabling serialization and some other things I'm forgetting.

tender fossil
#

Why do you need to disable serialization if you store a display or control in local variable?

still forum
#

Because display or controls can't be serialized

#

And all scheduled scripts and variables need to be serialized if you save the game

tender fossil
#

@still forum Obviously, but I was rather referring to why do you have to disable serialization only if you store it in local variable

still forum
#

Should be the same with global variables

#

but you can't disable serialization for them

#

So the answer is probably: Because that's the only place where you can disable serialization

little eagle
#

There is no real reason why. Just that with every assignment you make, the game checks if the value is a control or display. Global variables everywhere and local variables in scheduled scripts.
The error message (you have to confirm it) says to use disableSerialization even for global variables and even if the current script has it disabled. The message is just wrong.
The trick is to store the controls and displays in arrays.

tame portal
#

Does saving the game also touch UINamespace?

little eagle
#

No.

#

Only the mission namespace is serialized.

tame portal
#

"store the controls and displays in array" lol

little eagle
#

Yes, I have an example...

tame portal
#

Are they saved and loaded up correctly then aswell?

little eagle
#
// initCounter.sqf
params ["_display"];

private _control = _display ctrlCreate ["RscText", -1];

_control ctrlSetText "splendid";
_control ctrlSetTextColor [0.1,1.0,0.1,1.0];

_control ctrlSetPosition [
    safezoneX + safezoneW - 0.2,
    safezoneY + 0.0 * safezoneH,
    safezoneW * 0.1,
    safezoneH * 0.3
];
_control ctrlCommit 0;

MyMission_Counter = [_control];


//To change the text:
(MyMission_Counter select 0) ctrlSetText "hello world";
#

This is a script to make a (kill, money, score) counter control for the mission.

#

And for simplicity I store it inside an array.

#

uiNamespace is too cumbersome.

still forum
#

as displays can't be serialized I'd guess the array just contains nil's after loading

little eagle
#

controlNull for savegames, but most missions (and mods with scripts) break anyway for savegames.

#

And your display init script could also just overwrite the array with the new control.

#

So it's perfectly fine.

still forum
#

Yeah.. None of my code cares about savegames.. Would probably all go up in flames

little eagle
#

This one works as long as you recreate the control on savegame load. You have to do that anyway regardless of the serialization thing and my array trick.

#

The whole error message is just pointless, annoying and super confusing for beginners and anyone else actually.

#

Thankfully you don't have to deal with it when avoiding the >scheudler

#

Aside from globals of course.

still forum
#

I just tell the engine that my types can serialize even if they can't just to make it shut up

little eagle
#

It's one of the first things I'd nuke when I had access to this games source.

still forum
#

Intercept can. Not thaaat easy tho

gaunt root
#

With infistar it gives you a k/d scoreboard the whole server can see and then just add a status bar to show money an all that

#

That’s what did

little eagle
#

Thanks for the advice I guess.

storm sierra
#

Hey guys, so I need help with the RHS_USAF C130J
I got a mission that I am making, where you get flown out with the C130J and it returns itself back to base (using bis_fnc_unitplay).
But the problem is that I don't know how to raise the gears. And the C130 also has lights in the rear (red & green) that indicate when it's good to jump, but idk how to control those.
So just curious if anyone here knows how to at least get the gears up & down (without pilot)

little eagle
#

planeOne action ["LandGear", planeOne];

#

planeOne action ["LandGearUp", planeOne];

#

No idea about the lights.

storm sierra
#

Oh nice, that was perfect, thanks (landing gears)
Aww, damn, I'll give the RHS guys a poke then. (lights)

little eagle
#

How does the player turn those on?

storm sierra
#

Using a "Open Control Panel"

still forum
#

It's scripted

little eagle
#

What?

storm sierra
#

I found this ```
if(_v animationSourcePhase _a < 1)then{
_v animateSource [_a,1];
ctrlSetText [_r,"Green"];
(_r call _fCtrl) ctrlSetTextColor Green;
}else{
_v animateSource [_a,0];
ctrlSetText [_r,"Red"];
(_r call _fCtrl) ctrlSetTextColor Red;
};

#

But It's not exactly telling me what _a is

still forum
#

do you have the rest of that script?

storm sierra
#

the whole function?

little eagle
#

Or at least the name.

#

Yes.

storm sierra
#

RHS_fnc_c139j_setOption

little eagle
#

Is this light turned on by a scroll menu action normally?

storm sierra
#

Heh, I can't post the whole thing in, wasn't allowed by the discord bot xD

#

No, only via the control menu (popup menu)

little eagle
#

Not familiar with that.

still forum
#

I really like their naming sheme.. _a and _v and _r. Very descriptive. Very compact. And more compact means it's more readable

storm sierra
#

the function "before" it is RHS_fnc_c130j_openMenu

little eagle
#

More compact names mean you can read more of them in a shorter amount of time.

still forum
#

Wait ctrlSetTextColor Green; Are they literally setting a global Variable named Green ?

little eagle
#

Maximum "readability".

#

I HOPE this is a macro, dedmen.

storm sierra
#
#define Green [0.1,1,0.15,1]
#define Red [0.76,0.05,0,1]
#define Orange [0.99,0.6,0.04,1]
#

It is

little eagle
#

Lower case macros. 🤢

still forum
#

Phew... Could have ended badly

storm sierra
#

I think I found it tho
planeOne animateSource ["jumplight", 0]; // red
planeOne animateSource ["jumplight", 1]; // Green

little eagle
#

Could be. Try it.

#

Looks promising.

storm sierra
#

under RHS_fnc_c130j_openMenu | it said if(_v animationSourcePhase 'jumplight' == 1)then{

#

Yeah, tried it, that's the one :D
thanks for the help tho guys \o

little eagle
#

Nice 👍

austere granite
#

Lower case macros

#

this tbh

#

MACROS are uppercase or they aren't real macros

plucky beacon
#

Miss me with those fake macros

little eagle
#

Apparently even set3DENMissionAttributes is affected by this enum "feature".

plucky beacon
#

Enum?

queen cargo
#

do not get distracted @plucky beacon
just a bug

plucky beacon
#

furiously googling enum

queen cargo
#
enum
{
    a,
    b,
    c
}```
#

example

#

how it would look like

#

application is: a set range of options

#

instead of using eg. strings

#

benefit: speed

#

but that is not in SQF

plucky beacon
#

ooooh

#

I see, I looked it up

little eagle
#

They aren't enums in SQF, but that's what they call them in this bug.

#

Ahem feature.

compact maple
#

hey guys, is there any update for the cba_a3 ? 1.78 broke it :[

little eagle
#

Just ignore the error message. Every other mod has it. Still works.

plucky beacon
#

I should actually look at the change log, I never checked it

#

Added: HoldKey Function (executes a user-defined code when a key has been held down for a specified period of time)
Don't we already have holdAction?

tough abyss
#

Anyone have good Knowledge of .fsm Scripting that i could pick their brain.....i would like to execute a .sqf and my code Fu is weak.

plucky beacon
#

Eh you might as well ask here if it's related to scripts, that poor #arma3_ai doesn't get much traffic.

tough abyss
#

You can just call sqf functions in fsms etc or run a file like normal

#

the issue i am having is wrapping my head around the syntax. especially since i know the .sqf works and the fsm works but the exec of the .sqf does not.

#

You messed up then, its no different unless you are editing the fsm manually in a text editor

#

guess i should find a fsm plugin for notepad++ then.

#

Just use the fsm editor and you can write complex code in editor & copy/paste it in. Or save the complex code as a function and call it from fsm

#

If you are editing manually you, you basically one of the main advantages to fsms

tough abyss
#

thanks @tough abyss i was able to get the code to load into the FSM editor and it appears to be in proper syntax. but i am back to the drawing board as to why it is not working 😫

little eagle
#

Do yourself a favor and don't use that FSM crap. Especially when you're new to SQF.

tough abyss
#

Sadly i gotta use whats available until my group gets a better coder than me 😃 plus the SQF is for aesthetics anyway. so i am moving on to the next item on my fix list..

south pasture
still forum
#

Probably automatically adding scriptName

winter dune
#
                pl>
188:15   Error Foreign error: Unknown enum value: "Damaged" ``` got this error in my rpt when playing on my server, but my server does not have this code inside it, wtf?
#

I never use this event handler

#

but got this error on my screen

tough abyss
#

What addons are you running?

winter dune
#

none

tough abyss
#

Would double check, should be in your mission or maybe in arma3 code etc...
Its complaining because it should be removeAllEventhandlers 'Dammaged';

winter dune
#

yep, gonna test it as soon as possible

#

ok, it's infistar

#

when I select godmode, this error appears on my screen

queen cargo
#

@south pasture they are 🌈 MAGIC 🦄

little eagle
#

You made the mistake to write Damage correctly, when the eventhandler only works as "Dammaged".

winter dune
#

strange because we never had problems xD

gaunt root
#

@winter dune if god mode is giving you a error that means the safe zones will do the same if you have them with infistar the security level is 5 change to 1 that error should go away

#

Also infistar has a discord

#

They will help with all your needs

still forum
#

I don't see how infistar could fix anything while they are doing everything correctly and Arma is the one messing up

tough abyss
#

oh this chat reminds me i need to look into code to exclude AI from my Safe Zones. so useful!

gaunt root
#

With infistar you don’t really need battleye but if you have battleye there will be restrictions

tame portal
#

@gaunt root Oh I wouldn't say that :P

gaunt root
#

Well you don’t just need to save your DB all the time

old basin
#

is allGroups populated in the same order on all clients in a MP setting?

edgy dune
#

wat are the parameters for the dammaged EH, ik its on the wiki but im unclear as to which version its using

still forum
#

what "version" ?

edgy dune
#

i keep getting an error that says that its expecting only 2 parameters,but the wiki shows like 7

tough abyss
#

add a diag_log str _this; and see what the you are getting back

edgy dune
#

aye

still forum
#

You don't get a message "expecting 2.. but got..." from the eventhandler itself

#

that's caused by your code inside the EH

edgy dune
#

hmmm k lemme see about that then

little eagle
#

Just paste the error.