#arma3_scripting

1 messages ยท Page 360 of 1

still forum
#

magic

peak plover
#

@real tartan do NONE instead of FORM

real tartan
#

@peak plover heli did not have gunner position, instead it has turret position

peak plover
#

Goiddem

#

There we go

queen cargo
#

does one know which precedence isEqualTo has?

still forum
#

such a thing is not listed on biki ๐Ÿ˜„

queen cargo
#

thats why i am asking :3

still forum
#

and ofcause my dump is not listing that...

#

That's gonna take a couple minutes

queen cargo
#

if you could provide me with a list of all commands that are not default, that would be cool too

still forum
#

what is default? which number?

#

you're lucky. I'm just working for a export for Intecept ^^

queen cargo
#

idk

#

for my sqf-vm it is 0

#

as 0 is the lowest possible

#

everything else simply is higher then 0 and thus more important

still forum
#

My comment from some time ago says priority is a int from 0-5 so 0 is probably default

#

prio 4

#

which is default btw

queen cargo
#

that is horrible

#

bim 1 ||

#

bim 7 atan2

#

tfw?!

#

7 seems to be max

#

which is / ... (guess that is the config variant)

still forum
#

no

queen cargo
#

ohh ... no wait

still forum
#

^ is 9

queen cargo
#

good thing i already have all implemented. ..

#

that are not default

runic surge
#

50 + round(random 50) should give me a random whole number between 50 and 100, right?

subtle ore
#

Sure.

runic surge
#

then why did it give me 408?

still forum
#

because you did something wrong ๐Ÿ˜„

subtle ore
#

^ ๐Ÿคท

runic surge
#

well yeah

peak plover
#

๐Ÿ™ƒ

runic surge
#

but what the hell could I possibly mess up for something so simple

subtle ore
#

๐Ÿ‘ ๐Ÿ‘„ ๐Ÿ‘

peak plover
#

UGLY!!!

subtle ore
#

@runic surge random takes min median max params

still forum
#

SQF VM says that's correct

simple solstice
#

confirmed^

still forum
#

@subtle ore no it doesn't. There is also a variant that takes that. But that's not what Rylan wants or needs

runic surge
#

wait nvm I have it run the code multiple times and forgot to use a private variable so it just kept adding more for each new value

still forum
#

๐Ÿ˜„

subtle ore
#

@still forum Well yes, i am talking about that variant. Would be easier than just adding 50

#

@runic surge The hell man? ๐Ÿคฆ

simple solstice
#

way to confuse us

#

๐Ÿ˜„

runic surge
#

here is the function if y'all are curious

#

_newValue used to just be _zoneValue

subtle ore
#

Seeing a lot of those BTH functions pop up recently

runic surge
#

also it was an if then statement instead of exitwith and it didn't call the resource object funtion inside it

#

@subtle ore I have a lot of them what can I say

#

making a dynamic type scenario for the first time and I have had a lot of trouble so far lol

subtle ore
#

I have no problem with them. Seems like they are very useful for getting starter

runic surge
#

Is there a downside to having a large amount of functions for a single scenario?

still forum
#

no

runic surge
#

So far I have made 16

still forum
#

higher RAM usage ๐Ÿ˜„

peak plover
#

16 functions?!?! INSNANE!!!!

subtle ore
#

Woah man.

peak plover
#

๐Ÿ˜ต

runic surge
#

for me that is a lot jeez

still forum
#

When I rewrote initFunctions There were over 500 functions with CBA and ACE

peak plover
#

I got 4 functions 8 macros on my old cpu

subtle ore
#

๐Ÿ˜ฑ

still forum
#

though ACE doesn't even show up in initFunctions ๐Ÿ˜„

runic surge
#

If I ever get around to making a mod version of my current project it will likely be a lot higher

peak plover
#

Ace does not use cfgFunctions

#

But why?

#

0.001ms?

still forum
#

because. freedom.

indigo snow
#

Bit more than 0.001ms

peak plover
#

Really?

indigo snow
#

More like 30s loading each mission?

#

Commy is typing...

peak plover
#

Who rly?

still forum
#

CBA's function caching system is easier to expand for debugging and stuffz

subtle ore
#

0.00000001 MS?

little eagle
#

@runic surge

50 + round(random 50)

Will give you a random number between 50 and 100, where
50 has a ~1% chance to appear,
51-99 have a 2% chance to appear and
100 has a ~1% chance to appear.

peak plover
#

So, does this mean I should move all I have out of cfgFunctions

still forum
#

@peak plover no.

#

leave it

queen cargo
#

a case where the sqf-vm could help <3
lovely

still forum
#

If you have no specific reason to use CBA's system instead. then don't

indigo snow
#

CBAs system only really applies to addons

subtle ore
#

X39, you sure love your sqf vm

peak plover
#

Yeah, I don't really see any huge positives, but maybe when I move some functions to a mod

indigo snow
#

Iirc cfgfunctions (re)compiles every mission?

peak plover
#

Should recompile every time you load

little eagle
#

But why?
Debugging. Easier to add stuff as you don't need a config.

subtle ore
#

Recompiles on preview/mission start

peak plover
#

Hmm

#

Good point

indigo snow
#

Youre stuck with that anyway, for mission side fncs

queen cargo
#

@subtle ore thats because you can actually execute SQF without arma inside of it

subtle ore
#

@queen cargo True, not doubting the usefulness.

still forum
#

#Intercept The only real thingy

little eagle
#

Yeah, with CfgFunctions you either recompile everything or nothing. With CBA you can do specific components, so it is way quicker to restart the editor.

still forum
#

compile all functions once at game start and compile them in delicious C++

little eagle
#

ACE too big : (

simple solstice
#

few functions compared to a 4k texture

#

is nothing

#

in terms of memory usage

still forum
#

4k? pfft... 4k per face!

simple solstice
#

4k texture, 4k normal, 4k mask

#

๐Ÿ˜„

still forum
#

I wonder if Arma could handle a weapon with like.. a dozen 4k textures ๐Ÿ˜„

noble pond
#

#1fps

simple solstice
#

BUT MUH 16K SCREENSHOTS

#

dont need fps

still forum
#

Awww.. Nvidia Ansel....

simple solstice
#

when you can take pictures

still forum
#

Imagine

simple solstice
#

and exit the game

#

@still forum you have it..

#

splendid camera

#

๐Ÿ˜„

subtle ore
#

Ansel + Arma = pointless

simple solstice
#

360* pictures?

runic surge
#

what is Ansel?

#

360 screenshot thingy?

runic surge
#

Oh yeah

subtle ore
#

Originally, i thought it was just a maneuverable camera in gamespacr

runic surge
#

I have seen vids on that

#

could I do this: TeamObjects = []; TeamObject pushBack BTH_RTS_TEAM_BLU_flag = "Flag_Blue_F" createVehicle (getMarkerPos "respawn_west");

#

or would that just add the entire command into the array

little eagle
#

No.

indigo snow
#

TeamObject pushBack BTH_RTS_TEAM_BLU_flag = you can't have commands / interpretation on the left side of the = assignment operator

runic surge
#

alright I will just do it manually then

still forum
#

that would assign the return value from the assignment operation to your array which... no...

#

no no no no no.

#

I have never tried that.. I don't even know what would happen... Your Arma might even crash

little eagle
#

It probably errors in the same way

_a = call { _b = 1 };

errors.

oblique bluff
#

Xd

frail zephyr
#

If I have GC on, is there a way to prevent a subset of units' bodies to not be collected? Have a small pile of bodies I want to make sure is present by the time the player gets there.

#

I could just make a trigger and spawn them when they're close enough I guess...

peak plover
#

Or make your own GC

storm sierra
#

So I am trying to run this eventHandler (Take)

player addEventHandler ["Take", {hint str (_this select 1);}]

But it only returns "dummyweapon.p3d", which is wierd, because I am taking the item out of a crate, just curious if someone knows why it doesn't want to return the Crate that I took the item from

#

It only (so far) returns the correct crate, if I am taking a scope. But if I take ammo or a gun from the crate it returns dummyweapon.p3d :l

tough abyss
#

is there any option to control an object (e.g. a waterbottle) just like controlling a seagull

young current
#

no

#

this is not garrysmod ๐Ÿ˜›

peak plover
#

You can attachto

young current
#

that could work

peak plover
#

arma 2 had a prop hunt

#

google for a bit and you might find some inspiration

tough abyss
#

so there is no way to change the hitbox from player to object?

peak plover
#

eventhandlers

#

yes

tough abyss
#

other question; do you know why some objects are lagging af if you attach them to the player?

peak plover
#

hmm

#

Attachto might not update fast enough?

#

what fps are you running at?

tough abyss
#

so if i attach a waterbottle i haven't got any fps issues but if i attach a picnic table for example i have constantly 1-3fps

#

additional info: player is wearing a ghillie suit and is invisible

runic surge
#

prop hunt for arma?

tough abyss
#

probably ๐Ÿ˜‰

runic surge
#

why the ghillie suit?

#

if it's to avoid AI detection you could just use unit setUnitTrait ["camouflageCoef", 0];

tough abyss
#

hiding would disable the collision, the ghillie can be textured so its invisible and keep the collision

runic surge
#

ah I see

#

you could do that with an .rvmat but only on vr entities I think

tough abyss
#

the hiding thing is already done, but the attaching-fps prob still exists, thats the more important issue^^

runic surge
#

you could just have a toggle action that hides the player and disables simulation and puts the object at their feet

#

of course you wouldn't be able to move as the object

#

so that isn't an ideal solution

#

or just have the object attach and detach every few seconds

#

that way when the player moves it updates every time it attaches

tough abyss
#

i dunno if it's a quite good and efficient workaround; do you have a clue why this fps drop issue is only present on certain objects?

polar folio
#

can someone explain how text size inside structured text coresponds to the size of the control it's applied to?..if at all. trying to make text scale properly along with a ctrl of type RscStructuredText

peak plover
#

u r using scripting commands to change the size?

polar folio
#

yea trying to

#

i need the text to be like 0.3 of the height of the control

peak plover
#

Does <t size='1' not work?

polar folio
#

yea but my buddy has the text cut off on his screen while it looks great on mine. i need it to scale well with different resolutions

peak plover
#

oooh snap

#

There's a little sumtin' sumtin

robust hollow
#

i do it a really weird way but it does work flawlessly, give me a sec

polar folio
#

i swear i had it working at some point but i can't find the code so i have no example to understand it. so much appreciated

robust hollow
#

2-(1.81818*(getResolution select 5))

peak plover
#
            private _h = ctrlTextHeight _controlSideText;
            _pos set [3, (_h + (safezoneH/150))];
            _controlSide ctrlSetPosition _pos;
robust hollow
#

that makes it size 1 on normal ui size

peak plover
#

but

#

works

robust hollow
#

i think thats for normal text ctrls

peak plover
#

Yeah

#

I just use ```sqf
private _GUI_GRID_H = (safezoneH / 25);

polar folio
#

hmm. i'll that. looks weird indeed though ๐Ÿ˜„

#

i'd like to have it by percentage of the control its applied to. would be really useful

robust hollow
#

like i say, the one i posted is kind of silly but it does work on every ui size. i was doing it another way but found the text still getting cut off eveyr now and then on bigger ui sizes.

peak plover
#

I don't know how to change text size, but I know the control size stuffs

#

This is a button

#

That's always the same siz

#

No matter what screen/res/aspect

robust hollow
#

i believe its different for structured text cause u can modify it in the text itself

polar folio
#

nigel. this is about the size parameter inside structured text. i think it works a bit different there. i already scale my controls adapting to safezone and stuff. is why i need the text to follow

robust hollow
#

so like the one i posted is 1 on small size uis, and 0.727274 on normal uis but they look the same

peak plover
#

Are you able to define your own rscText?

polar folio
#

nah. i do all my UIs with ctrlCreate whenever i can. i like to avoid configs

#

i'll play around some more. i just forgot the ratio. pretty sure i asked this before

peak plover
#

I've got no clue how to change text size without classes

#

esp. for structured text

robust hollow
#

<t size='1' >

peak plover
#

<t size='safezoneH/2' > Maybe?

#

That'd be around 1

robust hollow
#

that depends on the size of ur monitor tho?

peak plover
#

Yeah

robust hollow
#

u need one to reflect the UI size ur using

peak plover
#

Well if I want to make a control that's 0.25% of the screen I do safezoneH/4

#

which is 0.454545

#

on my display

polar folio
#

hm. i'm thinking it might actually be the config that is the missing link

#

do you think there is a size value there and the size one inside the structured text just is a coef for that

#

?

robust hollow
#

no

#

can confirm, the size attribute is the actual size.

peak plover
#
class RscStructuredText
{
    x=0;
    y=0;
    h=0.035;
    w=0.1;
    text="";
    size="(            (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
    colorText[]={1,1,1,1};
    shadow=1;
    class Attributes
    {
        font="RobotoCondensed";
        color="#ffffff";
        colorLink="#D09B43";
        align="left";
        shadow=1;
    };
};
#

ui_f.pbo

#

It would make sense that the text scales

robust hollow
#

yea but if u want to set the size in the text itself 0.04 is insanley small. depends how you want to do it i guess.

peak plover
#

I think sizeEx is not needed for structured text

robust hollow
#
class ctrlStructuredText: ctrlDefaultText
{
    type=13;
    colorBackground[]={0,0,0,0};
    size="4.32 * (1 / (getResolution select 3)) * pixelGrid * 0.5";
    text="";
    class Attributes
    {
        align="left";
        color="#ffffff";
        colorLink="";
        size=1;
        font="RobotoCondensedLight";
    };
    onCanDestroy="";
    onDestroy="";
};```
maybe one is a coef for the other?
peak plover
#

Probably

#

attributes size should be the text one

abstract shuttle
#

Hey guys ๐Ÿ˜ƒ Sorry for interrupting, but does anybody know how to disable shadows of playermodels but not of any other objects? ๐Ÿค”

peak plover
#

Pretty sure it's another model

abstract shuttle
#

Thank though... I'll try to ask it there ๐Ÿ˜„

runic surge
#

You would have to edit the actual model I think

runic surge
#

Can I define a local function in a script that is only used within that script like:

_fnc_Local_Function = {
    _var doThing _var2;
};

Without having those variables defined? I want to set the function to be usable in an addAction so I don't have to copy and paste the same chunk of code for every command that needs it

robust hollow
#

if _var and _var2 are defined before u call _fnc_Local_Function i dont see why it wouldnt work.

#

this is what i mean:

_chat = {systemchat _msg};
_msg = 'Hi';
call _chat;```
runic surge
#

ok thanks

sick drum
#

So next week I'm going to make my first real multiplayer map, With one side having to take over one fob And the other side having to take there's Anything I should know?

copper raven
#

you should be more specific about it, just google first, if you dont find anything there then come here if you are REALLY stuck somewhere and need help.

queen cargo
#

Valid question

#

Stud he might need to know is that unless he understood locality he probably will craft a broken mission

#

And even if he does, his first is going to be a catastrophe

indigo snow
#

The real lesson is that players never do what youll expect them to

tough abyss
#

@indigo snow Defensive Programming.

#

Incremental development is all he needs to really know.

peak plover
#

@indigo snow You get it :D.

#

@sick drum Don't expect everything to work, expect some effort and test everything.

waxen tide
#

my last experience with this was: making a feature work in SP: 8 hours. Making it work in MP: 4 days. Work out every single kink including join in progress etc: 1 week

lavish hamlet
#

i need a to add a addaction to dead and incapacitated players, is the best way to add the action using cursortarget or can i instead add the action to the dead/incapacitated player ? if that makes sense.

tough abyss
#

@waxen tide Get a programming book on network architectures

#

You'd be able to cut that in half or more.

quasi hare
#

just spent the better part of three hours trying to find why a script was halting halfway though only to realize i missed a close bracket at the end of my switch. its deffinetly time to sleep

tough abyss
#

A lot of A3 is RPC's

#

Remote Procedure Calls

peak plover
#

Should start by using a framework, maybe F3

#

zenophon's coop fw

#

Frameworks do a lot of stuff like jip and respawns, so you can focus on your mission, rather than the basics

tough abyss
#

Yeah but knowing how the nittygritty works helps.

waxen tide
#

@tough abyss i don't see how that would help. it is more about learning about armas locality, jip handling and things like that.

tough abyss
#

I think of locality in terms of networking models.

#

Multicasts, Unicasts, Broadcasts.

waxen tide
#

@quasi hare get an editor with syntax highlightning, bracket highlightning and a linter. sublime 3, visual studio code or githubs atom can deliver that. oh and autocomplete.

#

i think learning more about networks would confuse me further honestly.

peak plover
#

Yeah, networking is just something you gotta learn

waxen tide
#

i disagree, networking is the thing you leave to ugly gobblins in the basement.

tough abyss
#

Multicasting is basically exactly like sending a remoteExec to a select set of clients

#

Server sends multicast -> clients recieve multicast

#

Clients send -> Unicast to server

#

Unicast is simply a message with 1 recipient

#

Multicast is a message intended for multiple

#

Broadcast is a message intended for ALL

#

within that network

#

so in case of arma 3 remoteExec [0,my_fnc_code,false];

#

Well thats a broadcast to all clients and server

#

Locality is even broken down into the Client <-> Server model.

#

It's just nested layers of it.

#

E.g

#

Side - the function will be executed only on clients where the player is on the specified side

#

Again this is a 'multicast' thats all there is it's simply a message who's destination is intended for multiple recievers @waxen tide

#

In this case if I passed west, then the multicast would be recieved by all blufor clients.

peak plover
#

remoteExec [0,my_fnc_code,false]; wrong?

tough abyss
#

Sorry I forgot to put it in qoutes..

#
[parameters] remoteExec [0,"my_func_code",false];
peak plover
#

[_params] remoteExec ["my_fnc_code"]; for all

tough abyss
#

Oh it changed again?

jade abyss
#

It was always like that

tough abyss
#

?

#

** Only 0 and 2 are special. When 0, the function or command will be executed globally, i.e. on the server and every connected client, including the one where remoteExec was originated. When 2, it will be executed only on the server.**

peak plover
#

remoteExec ["fnc",_target,_jip];

jade abyss
#
[_params] remoteExec ["{systemchat 'bla'}"];``` also works

e.g.
```sqf
["blaaa"] remoteExec ["{systemchat _this}"];```
= "blaaa"
peak plover
#

hmmm

tough abyss
#

so 0 and 2 are valid

#

According to the wiki...

little eagle
#

The 0 does nothing. Might as well use Dscha's version instead.

peak plover
#

You can use a object too. or a side

little eagle
#

group

tough abyss
#

Group would be a type of multicast as well

#

Object a unicast.

#

@waxen tide How come it took you several weeks to get it working?

#

Incremental develop as I said, start small

#

Decide what features do I want.

#

Then implement the "top priority ones"

#

to get a basic functionality.

#

Then you can add on the extras later, going in with a good design from the beginning will help a lot in terms of maintenance and expansion in future.

late gull
#

y0 guys, can i get a help here to know why is that happening

waxen tide
#

@tough abyss i think you missunderstood me greatly

simple solstice
#

@late gull what are you trying to achieve?

late gull
#

@simple solstice they are cas support, i want they stat waiting for support reequest, but they move like dumbs

grand sleet
#

How do I change the OnButtonClick event handler via script command

#

I've tried using ctrlSetEventHandler but it returned missing ;

rancid ruin
#

paste the code you tried here and someone may spot an error

grand sleet
#
_display = (findDisplay 26500);
_ctrl = _display displayCtrl 2402;
_ctrl ctrlSetText decisionButton1Text;
_ctrl [[ctrlSetEventHandler]] ["MouseButtonClick", ""];
rancid ruin
#

your last line is fucked

#

controlName ctrlSetEventHandler [handlerName, function]

#

_ctrl ctrlSetEventHandler ["MouseButtonClick", ""] maybe

#

although the wiki example looks fucked too....it's been a while since I've done any SQF but i can't remember it being this bad

noble pond
#

lol how come it has the wiki formatting on it?

#

that is fucked

#

[[blah]] is what is used to link different pages

#

where blah would be a seperate page

#

example has been unfuckified @grand sleet

#

somebody edited it and didn't get that you can't link stuff tat is being used inside a code box

#

:/

rancid ruin
#

I wasn't going mad then? excellent

noble pond
rancid ruin
#

you're one of the people with wiki editing powers?

noble pond
#

yes

rancid ruin
#

one of the few

noble pond
#

lol there is many

#

got mine when it was wide open

#

you can still get one

rancid ruin
#

is there? i thought people in here complained about not enough contributors

noble pond
#

lol well they are all too lazy to ask for an account

#

i'm not sure exactly who to talk to about getting a wiki account

#

guess i don' get permission to @ anyone xd

#

not biminnions at least

rancid ruin
#

ah, well good job fixing that example ๐Ÿ‘๐Ÿฟ

noble pond
#

dwarden would be a good start i guess

little oxide
#

Hey guys, it's possible to know if my object it's object terrain or a spawned object ?

noble pond
#

kinda crappy

#

need to do comparison work

#

not sure if there is a speific one to check if it is a terrain object or not

simple solstice
#

@late gull well if you set their formation they are going to change positions

#

I don't think all these set at the beginning are necessary

late gull
#

@simple solstice i use them just for test, it hapens the same without them

little eagle
little oxide
#

Thanks @little eagle

simple solstice
late gull
#

well, this will not work, because when u request the support they do the same

#

they crash to buildings

simple solstice
#

can't help you, don't know much about AI :(

late gull
#

yeh, thanks anyway, seems they are just idiots xD

simple solstice
#

maybe try this instead of vehicle?

late gull
#

it does not matter, it happens when they go in action

astral tendon
#

guys please, im about to lose my mind

#

the stupid AI wont follow the convoy that its supose to do

#

its randonly decide to go to e diferent place and then follow the actual waypoint

#

is there any fix to this or at least a work around?

halcyon crypt
#

are they in convoy mode?

astral tendon
#

is there a mode to this?

halcyon crypt
#

the waypoints need to have a specific configuration for them to be in convoy mode

astral tendon
#

what configuration?

halcyon crypt
#

can't remember

#

let me find it ๐Ÿ˜ƒ

frail zephyr
#

Column/Safe or Careless behaviour

#

Think that's all you need

astral tendon
#

no its not

frail zephyr
#

You can probably also ise aware

#

It worked for me

#

Just last night

young current
#

custom map? complex road network?

frail zephyr
#

If that's not working you have other issues

astral tendon
#

the frist waypoint is literay 10 meters in front of they

halcyon crypt
#

yeah behavior should be set to careless and formation to column

astral tendon
#

they are already in careless and colum

frail zephyr
#

Id avoid careless unless absolutely sure you dont want them to ever break and attack.

astral tendon
#

the tird car decide to go to a completly diferent road and go into a diferent place

frail zephyr
#

Are they all grouped?

astral tendon
#

and then the number 4 car follow him on the mistake

#

yes same group

#

same stats

#

they are literay copy and paste of the frist car

frail zephyr
#

Sounds like an AI pathing issue more than anything. Like its trying but cant find a path. Trying using a different road segment?

astral tendon
#

i can put they in file in the road and they do follow

#

but ahead in the mission the 4ยฐ fucks up and go to a diferent place

#

taking the other 2 trucks with him

copper raven
#

is it a modded map? or the one from BI? altis,stratis,tanoa,malden?

astral tendon
#

Takistan

copper raven
#

that might be the problem of its pathways, iam not sure tho

#

try the setup youre using on altis for example, see if it works

astral tendon
#

there is no way to do that

subtle ore
#

Of course there is

#

Merge scenarios togehter

#

Since it doesn't look like you have much in script

astral tendon
#

I have allot in the mission it self

#

And i mean ALOT

subtle ore
#

@astral tendon thats all in the mission sqm. I was talking about sqf in the mission root

#

So it would be easy to merge this to a new altis file

astral tendon
#

doFollow seens to fix that

#

i just need to test it more

sick drum
#

Guys i need help i put an virtual arsenal in one of my scenarios How do I expand it to support every mod That you may have while playing my scenario?

astral tendon
#

well, to fix my problem i had to do it by brutal force

#

i made a trigger loop to repeat every one second this code

#

car2 commandFollow car1;
car3 commandFollow car2;
car4 commandFollow car3;
onu1 commandFollow car4;
onu2 commandFollow onu1;

#

now they do follow a line and dont fuck up

#

they drive strange but i can survive with that.

little oxide
#

I have a only a .p3d name, and i want to know if it's possible to know the path of it, to create a simple object with it ?

tough abyss
#

getModelInfo cursorObject

frail zephyr
#

@sick drum does the "AllowAll" condition on the VIrtual Ammo Box do it? ["AmmoboxInit",[this,true]] spawn BIS_fnc_arsenal;

little oxide
#

I cant use getmodelinfo, because my object are not created, i want to import object from TB, and some objects doesn't have classname, so i want to know if it's possible to find the path, and create the object with createsimpleobject command

sick drum
#

@frail zephyr Let me try it

little oxide
#

@tough abyss

frail zephyr
#

I'm not 100% sure it will, just looking at the fnc while at work

tough abyss
#

TB will have the path to the p3d in the object library. (pretty sure about that, don't have enough free ram atm to start TB to check )

frail zephyr
#

@sick drum There is also BIS_fnc_addVirtualItemCargo for adding items to a virtual container if you want to add a subset.

#

BIS_fnc_addVirtualBackpackCargo BIS_fnc_addVirtualItemCargo BIS_fnc_addVirtualMagazineCargo BIS_fnc_addVirtualWeaponCargo

Along with remove variants.

sick drum
#

@frail zephyr Hey thank you it worked

frail zephyr
#

Awesome! Great to hear that.

#

Glad I was able to help, was just guessing from work haha

unique pollen
#

im trying to fix up my Evolution mission- any reccomendations about what script/suite to use to manage spawning enemies and filling the city?

#

@ me if you got ideas ๐Ÿ˜„

copper raven
#

you want to spawn them in houses? @unique pollen

unique pollen
#

maybe

#

i want them to spawn away from players in a marker/city

#

until the radio tower is blown, then stop

runic surge
#
_soldierType = typeOf _soldier;
infantryarray = [["unit_classname", 30], ["unit_classname1", 45],];
_findUnitData = infantryarray find _soldierType;

So obviously this won't work, but I am trying to find a way to get the index in the infantryarray by finding the classname in one of the subarrays contained in the infantryarray

#

Is there a way I could do this?

little oxide
#

something

copper raven
#
private _index=-1;
{
    if ((_x find _soldierType) != -1) exitWith {_index=_forEachIndex};
}forEach infantryarray;

or

private _index=-1;
{
    if ((_x select 0) == _soldierType) exitWith {_index=_forEachIndex};
}forEach infantryarray;
still forum
#

uhm

#

first one won't work

runic surge
#

the first one doesn't make sense

still forum
#

it's the same thing as @runic surge posted... Just instead doing the same thing over and over again and expecting a different result ๐Ÿ˜„

runic surge
#

definition of insanity and such

copper raven
#

well i guess iam braindead xD

little oxide
#

@runic surge _soldierType = typeOf _soldier; _findUnitData = ((infantryarray select {_x find _soldierType > -1}) select 0);

runic surge
#

I don't understand how that works what the hell

copper raven
#

omg my bad

#

i edited it

runic surge
#

it doesn't work

little oxide
#

What doesn't work

runic surge
#

_findUnitData still returns -1

#

Error: Zero Divisor

little oxide
#

That doesn't make sense

#
_findUnitData = (infantryarray select {_x find _soldierType > -1});
if (_findUnitData isEqualTo []) then {
  hint "Awww don't found soldier type";
} else {
  hint str (_findUnitData select 0);
};
runic surge
#

{_x find soldierType > -1} What does this do

#

I don't get it

little oxide
#

checking all array inside infantryarray with _x variable, and try to find soldiertype, if found it this will be output an index > -1

#

And select output all array with this soldiertype classname

tough abyss
#

Remember find is case sensitive

runic surge
#

If I am trying to find "unit_classname" with this, shouldn't _findUnitData return 0, which is ["unitclassname", 30] in the main array?

copper raven
#

try

hint str(_findUnitData);
#

all doe i think its a classname thats returned

runic surge
#

no it actually does return the correct subarray

#

I commented out the other bits of code I have and the hint is correct

#

not sure where the error is coming from

#

wait one

frail zephyr
#

Can anyone tell me if modelToWorld takes into account the rotation of the object? Otherwise I need to rotate my offset vector before calling it.

little oxide
#

No @frail zephyr

frail zephyr
#

Rotate manually, got it

runic surge
#

@little oxide I have no idea where the error was, everything is working as expected now

little oxide
#

But set direction beofre pos @frail zephyr

#

setpos *

runic surge
#

thanks for the help

#

much appreciated

frail zephyr
#

Yep, or else it will be at old coords

runic surge
#

Might be a dumb question, but can I pass a local variable into an eventhandler?

frail zephyr
#

Yep, pass it in in the function call along with the this/thisEventHandler params.

#

Err wait

copper raven
#
fn_spawnUnits={ 
    params ["_marker","_radius","_hprobability","_object","_interval","_sprobability"]; 
    _houses=nearestObjects [getMarkerPos _marker,["House","Building"],_radius]; 
    while {alive _object} do { 
        { 
            _posArr=[_x] call BIS_fnc_buildingPositions; 
            if (_hprobability > random 100) then {
                if (count _posArr ==0) exitWith {}; 
                for "_i" from 0 to (count _posArr)-1 do  
                {
                    if (_sprobability > random 100) then { 
                        _pos=(_posArr select _i); 
                        _pos=[_pos select 0,_pos select 1,(_pos select 2)+0.1]; 
                        _unit=createGroup east createUnit ["O_soldier_F",_pos,[],0,"NONE"]; 
                    };
                }; 
            };
        }forEach _houses; 
        sleep _interval; 
    }; 
}; 
/* 
example:
    ["myMarker",radius,house probability,object (radio tower),interval,soldier probablity] spawn fn_spawnUnits;

    ["mkr",350,2,myRadioTower,2,1] spawn fn_spawnUnits;
*/

something like that, change it how you want it to be, @unique pollen

frail zephyr
#

Hold on.. local to the EH or to the thing making the EH?

runic surge
#

local variable defined outside of the EH, passed into the EH itself

distant egret
#

@runic surge You can with BIS_fnc_addStackedEventHandler, but that only supports a few EventHandlers

frail zephyr
#

Could you use setVariable on the unit?

#

Its hacky

distant egret
#

But the CBA Function CBA_fnc_addBISEventHandler can take all types.

#

if you use CBA

little oxide
#

pls @copper raven use _x buildingPos -1 insted of [_x] call BIS_fnc_buildingPositions;

frail zephyr
#

Why's that?

subtle ore
#

the regular ol engine solution works too for buildingPositions

runic surge
#

So I'm not using CBA, BIS_fnc_addStackedEventHandler won't work, and for some reason there isn't a way to pass variables into and event handler. Is there anything at all I can do?

distant egret
#

@runic surge use setvariable

#

And getVariable in the eventhandler

#

Used that for a long time until I used the CBA one.

copper raven
#
player setVariable ["evh_args",[arg1,arg2]];
player addEventHandler ["killed",{_args=player getVariable ["evh_args",[]]}];
runic surge
#

wouldn't that require evh_args to be a global variable though?

copper raven
#

wat

indigo snow
#

No its an object variable

#

They only exist if you OBJECT getVariable them

#

Global variables live in missionNamespace

runic surge
#

I figured it out

#

thanks for helping me out lol

frail zephyr
#

@subtle ore totally didn't see the -1 param, that is so much better than a func call.

subtle ore
#

Yep

#

How can i return the userlist number of a player?

little eagle
#

"userlist"

#

๐Ÿค”

runic surge
#

case sensitive find command + classnames + inconsitent casing for classnames = fuck

compact maple
#

oh my bad did you mean all the identities a player used ?

little eagle
#

Pretty sure Midnight knows about allPlayers.

austere granite
#

@runic surge basically just toLower whenever you do stuff like that. There's some weird stuff with the classnames

#

_array apply { toLower _x} for ezmode

runic surge
#

What if I like upper better

#

I would have to do the same thing to the classname when it is used in the code later on, right?

little eagle
#

Yes.

#

What if I like upper better
YOU'RE WEIRD THEN

runic surge
#

fUCK_YOU.exe

little eagle
#

You fucked up.

peak plover
#

๐Ÿ™ƒ

runic surge
#

you fucked UPPERCASE

little eagle
#

That's so bad I laughed after 3 seconds.

runic surge
#

@Adanteh#0761 {toLower _x} forEach _array

#

pretty sure it should be that

#

other one doesn't work

#

wait nvm it uses subarrays that is why

gray thistle
#

If somebody would help me out it would be great and i would be thankful since i need that number as an comparison

little eagle
#

toFixed

tough abyss
#

Float inaccuracy
Use a string instead of a number over 6/7 digits in length

little eagle
tough abyss
#

Still has float inaccuracy unless you change how floats work ;)
Better off to use a string for a unique identifier

gray thistle
#

Torndeco this is intresting to know do you have an article about it also i will read into tofixed

little eagle
#

No. He get's the number from the engine. So it will be as accurate as it will be after compiling the string.

gray thistle
#

commy2 i work with extDB3 i think torndeco could also help with that point

tough abyss
#

Depends were his vehicle id is coming from. Floats are inaccurate after a certain point. Tofixed won't help with that.

little eagle
#

Well I didn't consider extension.

gray thistle
#

The vehID is comming from the Database

tough abyss
#

Serga just fetch the id from the databsae as a string, instead of a number

little eagle
#

But everything that stays in the game will keep the same binary representation (when compiled and stringified with toFixed).

gray thistle
#

Isn't a int faster? shrugs thats why i try to use int but if there is no way around it i have to consider that

little eagle
#

The game has only floats in SQF.

tough abyss
#

Floats are inaccurate
If its for a database id don't use toFixed
It will end up adding random decimal points if you add to much length to it.

#

Just use a string. If its extDB3, SQL_CUSTOM has option to return the insertID as a string (with newer versions)

gray thistle
#

Sure i will try that that throws me a bit back but should be possible

tough abyss
#

It will be simple enough you just store the id as a string in arma. It won't effect the database queries (you can still store it as a number in the database)

gray thistle
#

yes sure but finnaly this question is answerd

tough abyss
#

Had todo the same in Exile server recently, to many auto_increment ids for players characters

gray thistle
#

Ouh gawd ๐Ÿ˜„

spring stone
#

Hey, just a quick question: I want to get the classname of all weapons, items, magazines and what so ever in an ammo box. How can I do that? (I want to put all thinks in an Ammobox in the editor that I later want to use in an arsenal. ^^)

peak plover
#

allitems/

little eagle
#
weaponCargo
magazineCargo
itemCargo
backpackCargo

???

spring stone
#

Wow...I feel really dumb atm. Sorry >.<

#

And thanks

little eagle
#

This self awareness puts you above half of humanity already.

gray thistle
#

Sad but true and also thanks again commy2 i think i did not thank you before...

spring stone
#

Well, not the first time that I'm a bit slow today. Its just not my day. xD

gray thistle
#

Same here...

#

I did just learn that i can't return nil XD to another script

vague hull
#

you can

gray thistle
#

how it just throws out errors if it wants the return value

vague hull
#

where does it throw the error?

little eagle
#
_a = call {nil};

There. Returned nil.

vague hull
#

^

gray thistle
#
_return = if !(isnil "_returnarray") then {_returnarray1 = _returnarray select 1; _returnarray1} else {nil};
_return;
#
 0:03:51 Error in expression <ay select 1; _returnarray1} else {nil};
_return;>
 0:03:51   Error position: <_return;>
 0:03:51   Error Nicht definierte Variable in Ausdruck: _return
 0:03:51 File C:\Users\Lars Schill (Serga)\Documents\Arma 3 - Other Profiles\Serga\missions\Datenbank Projekt\Roleplay_Tannoa_Database_Dev.Tanoa\ExtDB3\read\fn_vehicleIDcheck.sqf, line 8
vague hull
#

I really dont even wanna know what this is for

little eagle
#

The problem here is that you're operating in scheduled environment and you're using an undefined variable, _return

gray thistle
#

That's what i meant by learning ๐Ÿ˜„

little eagle
#

So the last line is the problem. Not returning nil with the if statement.

vague hull
#

btw you can just:

if !(isnil "_returnarray") then {_returnarray1 = _returnarray select 1; _returnarray1} else {nil}
#

and leave out the _return thingy

little eagle
#

Replace the whole thing with, hold onto your butts:

#
if !(isnil "_returnarray") then {_returnarray select 1}
gray thistle
#

about the optimisation i often have a learn process and then an optimizing prozess. This is the learning one. I often throw working code over and write it new ^^

#

also i know the last line gives (which therefore was limited in my brains to a variable) out the return value

little eagle
#

But what you have is unnecessarily complicated and would take me more time to write down and think through than what I have.

gray thistle
#

Sure it is thats why i do such a bad run and then rewrite it to something smaller better.

#

Also in the begining i overthink to much about it :/

little eagle
#

I guess it's just a difference in practice.

gray thistle
#

(True)

#

Also this is my first project soooo

#

It's clear that it sucks ^^

little eagle
#

First I though that with enough practice there would come a point were I could write stuff that wasn't terrible. But now I realize that everything will look bad when you wait long enough and look back at it.

gray thistle
#

Exactly

long hatch
#

Where should i run this code the best way BIS_fnc_addRespawnPosition and BIS_fnc_addRespawnInventory? init.sqf or initPlayerLocal.sqf or another sqf?

gray thistle
#

I have something similiar in the InitPlayerServer.sqf

little eagle
#

You'd think the description of the function would tell you.

gray thistle
#

I think he wants to set a standart Respawnlocation if killed and add a loadout to it

#

The Question here is is it only the player oder all players(ServerGlobal)

little eagle
#

I looked at the function and it has global effects.

#

So if you use it with SIDE or missionNamespace, do it only on the server.

#

If you do it with the player object, do it only on clients with interface.

gray thistle
#

Yup

little eagle
#

Relevant part (similar for both functions):

//--- Commit
switch (typename _target) do {
    case (typename missionnamespace);
    case (typename sideunknown): {
        _target setvariable [_varName,_inventories];
        publicvariable _varName;
    };
    case (typename grpnull);
    case (typename objnull): {
        _target setvariable [_varName,_inventories,true];
    };
};

The rest before that is just (clumsily) moving around local variables and params.

gray thistle
#

Hm intresting this Respawn Menu could be a great addition to my gamemode i am writting atm.

abstract shuttle
#

Does anyone know a solution to adjust / change the position of the third person player-camera? ๐Ÿ˜ƒ

little eagle
#

There is none.

abstract shuttle
#

Unlucky ๐Ÿ˜„ But thanks for the answer...

subtle ore
#

@little eagle "userlist" you can run #userList ingame to return their individual number. seems like serverCommand breaks when a nickname is inserted for executions like ban and kick

runic surge
#

publicVariable str _x; Would this work?

#

_x being a regular variable

robust hollow
#

as in like this?

        publicVariable str _a; // publicVariable '5';```
runic surge
#
{
    _x allowDamage false;
    _x setDamage 0;
    publicVariable str _x;
} forEach BTH_RTS_TeamObjects;

Just to update all of the objects in the array. In this case, not sure it is necessary, but scripts later on use the object positions and they are created after clients stop executing init.sqf

robust hollow
#

no that wouldnt work

runic surge
#

Why not?

robust hollow
#

because _x is an object, so str _x would be "27dca159080# 620063: c_poloshirt.p3d" for example.
perhaps i havent understood the way u plan on making it work.

runic surge
#

So I need to convert the variable names to strings first?

#

But, like I said, I'm not even sure this is necessary

robust hollow
#

what are you trying to achieve?

runic surge
#

I'm just trying to figure out when I should use publicVariable

#

If I don't stop the client init.sqf with if (!isServer) exitWith {}; then all the objects are created twice (when testing with two players)

#

so I am just experimenting

robust hollow
#

yea but why do you need to publicvariable the objects?

runic surge
#

their variable names are used in scripts executed locally by players later on (for example, to move one of the objects)

#

And when I tested earlier, the script executed fine, but the objects didn't visually appear to move

#

I would need to update the variable after that script too, I believe

warm gorge
#

Is UID spoofing a thing on Arma still?

tough abyss
#

pls help if can, simple question. whats better in a host-multiple clients situation: (not dedicated):

publicExec ["true", {
    sign setObjectTexture ["swap_sign","billboard3.jpg"];
}];

or
==called only on host===
sign setObjectTextureGlobal ["swap_sign","billboard3.jpg"];

#

was hoping i could have the jpg only exist on host, and it pushes it over to clients

warm gorge
#

No reason not to just use setObjectTextureGlobal

tough abyss
#

mmm thats what i thought, except its being weird one sec testing it

runic surge
#

Pretty sure publicExec isn't a real command

tough abyss
#

wont lie, it is in VBS which is what im using :P

#

so the issue with setobjecttextureglobal isnt working for me and im just going to blame VBS. ill put the textures on each machine locally. seems faster anyway. thanks

queen cargo
#

@tough abyss most likely it is the usual thing
you sure you execute the setObjectTextureGlobal command from where the sign is local?

tough abyss
#

yes

queen cargo
#

as the bs wiki has no further notes, check out the bi wiki

_block = createVehicle ["Land_VR_Block_02_F", player getPos [20, getDir player], [], 0, "CAN_COLLIDE"];
_block setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"];
_block setObjectTextureGlobal [0, "#(rgb,8,8,3)color(1,0,0,1)"];```
#

try that first maybe

sick drum
#

Hey guys what do I do when you enter an area and on the bottom right hand side it says the name of the base, How do I put that there?

queen cargo
#

in theory, setObjectTextureGlobal is the better variant performancewise as it wont broadcast the sqf over net

#

but rather diectly do it (less trafic) but ... that does not rly matters for your scenario most likely

tough abyss
#

thanks X39, i didnt understand the material thing. it always has been working in local testing (and in one case it happened so the host failed the texture but the clients got it =/ )

sick drum
#

Example In Hunter six you can drive into an fob and it tells you what the name is, I want that

tough abyss
#

wouldnt it just be a persistent trigger, calling a cutRsc text to the screen?

queen cargo
#

@sick drum triggers and a BIS fnc i forgot the name of

#

the triggers can be auto-generated unless you only want certain areas and not all locations

sick drum
#

hmm Well something to begin on

tough abyss
#

x39 with the quick wins

#

how long you been devving for

queen cargo
#

arma3? since beta (as no medic system was around but the scripted BTC-Revive)

#

in general? for way too long

#

though ... same can be said for arma 3

#

i am mostly out of the actual scripting ... and started concentrating towards the tool scene

#

as you probably already know ๐Ÿ˜›

tough abyss
#

do you define your functions in config.cpp, or description.ext, or preProcess them in init.sqf and call the global handle for them, or....

#

im wondering whats the best overall way

queen cargo
#

i know ace does not uses cfgFunctions due to "performance" bla ...
i personally always used cfgFunctions

subtle ore
#

I thought there was discussion over that magical 0.0001 ms performance increase with their lovely cba alternatives to CfgFunctions ๐Ÿค”

queen cargo
#

there is actually a real impact by using cfgFunctions

tough abyss
#

for me in this age of speed, i think human readable is always better in general

queen cargo
#

but the impact is not rly noticable in reality

subtle ore
#

Certainly not worth throwing in a depdenency

queen cargo
#

no

subtle ore
#

Does it create a dependency or not?

queen cargo
#

as they use CBA function caching thingy

#

yes

#

but they also could do it without

subtle ore
#

Yeah but what's the point if there is no real noticeable difference?

queen cargo
#

there are other parts which rely more on CBA

#

in ace

#

preferences

#

probably

#

most things come down to preferences in the end

#

thats why there is the macro meme in this channel

#

the magic 0.00001ms

subtle ore
#

Ha, surely.

queen cargo
#

etc.

tough abyss
#

Bis_Funcs are so much better than VBS stuff

#

surprising how little VBS actually has

#

im ean it has some cool stuff like a fileAcces plugin

#

but it cant even draw lines in 3d environment

queen cargo
#

BIS_fnc_ is mostly just community made stuff

#

besides, you could just take it into VBS and it would probably work out of the box

#

difference between VBS and arma are neglectable anyways

tough abyss
#

im not so sure about that

#

vbs lacks stuff a3 has cause completely diff rendering engine

#

well not completely diff

#

a generation diff

queen cargo
#

this for examle is in my link list for GUI references in arma

#

and in case one asks himself why, because it is WAY better then the arma variant

tough abyss
#

yeah, that stuff is the same as A2 so thats fine

queen cargo
#

the differences in arma and VBS are commands available in one system are not in the other and vice versa

tough abyss
#

yeah

#

i wish for drawLine3D

queen cargo
#

no need to
you can mimic that

tough abyss
#

ive been told by support that its impossible

#

they said "its only possible with fusion api" to which i responded, i thought fusion was just a layer to sqf and anything in fusion is possible in script

#

the reply again was "in most cases yes but not this one"

#

thats verbatim

#

if you can tell me how to mimic it boy would i be happy

queen cargo
#

no idea of VBS so cannot rly help you

astral tendon
#

how do i set 2 task at once?

queen cargo
#

mhh? @astral tendon

tough abyss
#

well there you go, maybe it cant be mimicked

astral tendon
#

i wanna set a optional task to the main task

#

but i cant set 2 tasks to be activated

runic surge
#

Just make a second optional task

tough abyss
#

wouldnt you just set the task but in brackets write (optional) and not have win conditions in it

astral tendon
#

how i do it?

runic surge
#

You make another task with different completion conditions

#

that isn't required to win the mission

queen cargo
#

he wants to have two tasks being the main task at once

runic surge
#

that doesn't make sense

queen cargo
#

not for the native system

#

but there is also the scripted one

#

that is also used in the campaign

#

etc.

astral tendon
#

were i trow that (optional) thing?

queen cargo
#

anyways ... saying gn8 now guys
my bed is calling

astral tendon
#

that does not give any info about optional tasks

subtle ore
#

@astral tendon you do realize you don't really have to do any of those tasks, there is no such thing as an optional task. They're all tasks. Literally add "Optional" at the end of your task name

astral tendon
#

but they will receive the notification?

subtle ore
#

Yes.....?

#

You can set tasks for specific sides

#

read up on that tasks overhaul page please

tough abyss
#

@astral tendon whats the actual issue

#

you make multiple main tasks right?

#

and one of them you just label it "(optional)" at the end of the task name?

#
task2 = player createSimpleTask ["taskName2(optional)"];```
#

am i missing something?

#

Hey friends. I'm trying to dig in to a fairly lengthy medical script from the VETERAN mod so that I can get a similar feature to ACE's "Prevent instant death". Basically, a player will never instantly go to the death screen. They will go down with a certain amount of damage if they get shot in the head or something (keep them under the threshold for death but let them bleed out).

#

Does anyone with better sqf knowledge than me see any easy if statements or something I can throw into that script to keep it from killing folks on a lethal blow?

#

I've tried adding some damages up and then applying a reduced number, but the best I could do was cause every unit to be invincible. But ultimately I'd like to extend that portion of that mod so that I don't have to alter the core.

#

Thanks in advance if anyone is bored and wants to help take this up.

#

CreateSimpleTask is not network propergated.

#

@astral tendon

#

So you will have to write a networking system for it.

astral tendon
#

i figured out

runic surge
#

I can only see the action from the host player

#

the object is created only on the server but shouldn't using allPlayers add the action the the objects for everyone?

robust hollow
#

addaction is local, so no. ud need to remote execute the addaction with JIP for players to see it.

tough abyss
#

is that init.sqf?

#

whats the _this refer to in that context @runic surge

#

is it the result of allPlayers foreach?

#

shouldnt you use _x with forEach

robust hollow
#

no hes adding the action to the object. but he wants each player to see the action. the way he is doing it the server will have one action per player.

tough abyss
#

ah yep, seen

runic surge
#

But it doesn't work as expected

tough abyss
#

i dunno, i feel like its just running it on the server multiple times

#

its not doing anything to the players

#

its just running it locally based on the amount of players

robust hollow
#

yea thats exactly what its doing

#
[_resObj,[
    BTH_RTS_str_CollectResources,
    {
        deleteVehicle (_this select 0);
        sleep 0.05;
        private _teamSide = ([west, east, resistance] find side (_this select 1));
        private _teamBank = ["BTH_RTS_TEAM_BLU_bank", "BTH_RTS_TEAM_RED_bank", "BTH_RTS_TEAM_GRN_bank"] select _teamSide;
        [_teamBank, _amount, true] call BTH_fnc_ManageBank_RTS;
    },
    _amount, 10, true, true, "", "", 8
]] remoteexec ['addAction',[0,-2] select isDedicated,true];```
i think you need something like this instead Rylan
tough abyss
#

is it cause the _resObj is private?

robust hollow
#

addaction adds an action on the target for the client its executed on. the foreach is run on the server so only the server would see the add action (if the server is hosted).

runic surge
#

I'm testing it through LAN

tough abyss
#

2 things you need to know about locality

#

Is the effect G global

#

or is the Effect L local

#

and Are the args Local

#

_local

#

or global

#

globalVar

#

Thats all you need to know Rylan.

#

Args : Global

#

Effect: Local

#

So if you want the function to be accessible to every client

#

you have to make it accessible to every client

#

init.sqf

#

initPlayerLocal.sqf

#

@runic surge Is this running on the server or client?

#

if (_rndDir) then {
    private _newDir = random 360;
    _resObj setDir _newDir;
};
robust hollow
#

its rylans code not ryans

tough abyss
#

Random numbers shouldn't be trusted with the client unless that is something needed like storing a random value on a client

robust hollow
#

the object is created only on the server
that script creates the object so that script is run on the server id assume. which is why the addaction isnt working.

tough abyss
#

Yeah server doesn't have a GUI

#

If you wanted to go from the initServer.sqf to the client you'd simply send it to clients on JIP

robust hollow
#

yea i know this. is what i suggested with the reomteexec.

tough abyss
#

if its a setup thing why not just put the code in init.sqf so it executes locally on everyone who joins

#

Becauses thats not necessary

#

initPlayerLocal.sqf

#

would be better.

#

yup yup

#

so either way, we've solved it @runic surge ???

#

I've seen how you can require an addon and override it's cfg. If I end up figuring out how to alter the script I posted above, is there a way to override a script in another mod? Or does that only work for classes/cfg in non sqf?

#

Or extend an event handler even?

tough abyss
tough abyss
#

Super cool man

astral tendon
#

{deleteVehicle _x} forEach thisList;

#

this is supouse to delete everyting inside of a trigger once activated, what i did wrong?

indigo snow
#

it only deletes the objects in thisList, which only contains objects that satisfy what the trigger is looking for

#

e.g. a Blufor Present trigger, thisList will only contain blufor units

astral tendon
#

i see

#

i was trying to test it with a radio command

#

but, some things are not deleted

#

like props

indigo snow
#

I'd use nearObjects and just find everything within the radius of the trigger that way

astral tendon
#

{deleteVehicle _x} forEach nearObjects;

#

?

robust hollow
#
position nearObjects [typeName, radius]```
#

you would probs want the first one

indigo snow
#

with position: Position, Position2D or Object (and triggers count as objects)

astral tendon
#

{deleteVehicle _x} forEach clear nearObjects 100;

#

generic error

#

clear is the name of the trigger

indigo snow
#

needs some brackets im pretty sure

#

forEach (clear nearObjects 100)

astral tendon
#

nice, now it worked

#

this will help save performacy

#

this trigger will be activated by another trigger far away

indigo snow
#

then you dont even need a trigger! you could use a marker for example, since you only really want to position to feed into nearObjects

#

for example: forEach (getMarkerPos "clearMarker" nearObjects 100)

#

you could execute that from the other trigger

astral tendon
#

btw, that radius follow a circle or a square form?

robust hollow
#

circle

#

its a radius...

astral tendon
#

good to know, i was about to screwup

still forum
#

Man these extDB problems with floats vs ints.... How nice that #Intercept can just use int's :D
@runic surge It will work.. if each object has a assigned variable from 3DEN. But... Don't rely on that. The thingy from like 5 hours ago. about publicVariable str _x
@subtle ore The CBA function compilation vs CfgFunctions one has no runtime difference. But your Mission loads faster with the CBA way like.. several seconds.
Also you can use the CBA way without a CBA dependency.

astral tendon
#

i cant put a set task to multiple tasks? just one at time?

tough abyss
#

How hard is it A3 to attach a parachute...

#

Where the object isn't moving an abnormal speed.

#

targObj = cursorTarget;
targ = getPos(cursorTarget);
para = createVehicle ["B_Parachute_02_F",[0,0,1000],[],0,"FLY"]; 
 para attachTo [targObj,[0,0,-2]]; 
 cursorTarget setPos [targ select 0,targ select 1, (targ select 2) + 300];
 targObj setVelocity [0,0,0];
little eagle
#

Attach the crate to the parachute and not the other way around.

tough abyss
#

It's an offroad.

little eagle
#

So? Same diff.

tough abyss
#

Okay. Makes sense.

#

Sort of... parachute spawns vehicle is attached to it.

#

Vehicle floats down with parachute.

little eagle
#

The parachute is what floats down really.

tough abyss
#

Yeah but it's definitely logically inverse you'd think para chute attaches to vehicle no matter what...

little eagle
#

irl there is no difference. Programming wise this one makes more sense.

tough abyss
#

This is one of the reasons I quit A3 scripting.

#

The bizzaire nuances.

still forum
#

It's not bizzare.. attachTo welds an object onto another.. Meaning the object you attach looses all it's simulation and just clings to the other object

#

It's the same in Garrys Mod for example.

little eagle
#

You're just thinking about it wrong all your life and Arma #logic is enlightening you.

still forum
#

And if you make parachute ignore all it's properties and just do what the offroad does... Then ofcause it's gonna fall like a brick

little eagle
#

Yeah, programming wise it makes total sense.

tough abyss
#

I would think the offroad is interacting with the physics and when you give it something that resists physics it would also inherit the characteristics of the object that it was attached to.

still forum
#

yes.. it does do that

#

if you attach it to the parachute... It glides down like you expect

tough abyss
#

Yeah I found the entry in the wiki about that little physics detail

still forum
#

That has nothing to do with this...

#

I just looked at the page and it's really missing that detail that the object you attach looses it's physical properties and just welds onto the object you attached to

#

Someone should add that

tough abyss
#

Scripting this really isn't worth the time or the effort.

little eagle
#

No idea what you complain about. Irl there is no way to say which thing is attached to which. And programming wise this makes way more sense. You'd just complain either way.

#

There is no need to disable the simulation for para-dropping something.

tough abyss
#

I know that.

#

But this is a milsim game you'd think they'd add attach points on vehicles by default.

#

How many times does the military drop hardware into the field?

#

Often?

little eagle
#

I'd rather have it like it is now. Many functions and moving parts you can put together and abuse creatively. Better than something premade. If you need a premade parachute script, google it. There're probably a few out there. And if there aren't, make one.

tough abyss
#

^

still forum
#

yup

#

That's easier to understand

#

Should add to wiki

tough abyss
#

Makes plenty of sense.

#

Still just isn't worth it I'll stick to spending time on learning real languages.

halcyon crypt
#

how do I turn off this shitty discord channel categorization crap? ๐Ÿ˜

still forum
#

That doesn't have much to do with the SQF language itself.. You'd have the same effect using C++/Lua/Python.

tough abyss
#

No but has everything due to a mismatch hodge podge of information. Wiki's have that issue.

little eagle
#

At least we now have a voice chat of our own.

#

The wiki can be edited. Now that KK is gone, it probably won't get reverted.

tough abyss
#

KK's gone?

#

How come?

little eagle
#

Ask him not me?

tough abyss
#

@still forum The wiki is to blame. Atleast with C++ / Python / Lua there is standard books, manuals, etc

still forum
#

I won't hold off from reverting bad changes tho @little eagle ;D

#

Then fix the Wiki.

tough abyss
#

Not my responsbility....

still forum
#

The Wiki is community made. If you complain then fix it.

little eagle
#

Are you saying any of my changes would be bad?

still forum
#

As nobody else fixed that.. No one cared till now.

#

Nooo ๐Ÿ˜„

tough abyss
#

No a lot of changes are just bleh wrong.

little eagle
#

Not my responsbility....
Pff.

still forum
#

Just don't let people believe there is no moderation

tough abyss
#

You are far more qualified to write the manual than me.

still forum
#

@tough abyss Fix them

#

Then stop complaining if you don't want to do anything

#

It's like not voting and then complaining about who won the vote

tough abyss
#

Man the Fedora community is more helpful than that... attitude...

little eagle
#

Stop with the ellipses.

halcyon crypt
#

that's because the Fedora community is full of hippies while the Arma community is full of people being frustrated for years ๐Ÿ˜

little eagle
#

How much more helpful can you get? We already pointed out what's wrong, how to fix it and why it is the way it is, and why it's better that way.

halcyon crypt
#

I was just teasing

still forum
#

๐ŸŒฎ

waxen tide
#

hey hey whats that taco hate?

cedar kindle
#

don't hate on teh taco~

deft owl
#

hey, cant finde a tutorial for a button on a map to toggel a module. did somebody now a good tutorial? thank you anyway for having this good community

waxen tide
deft owl
#

cool thank you for the fast help

#

but it just looks like its not a way where you can set a status

#

like on or off

#

its liked to the mouse, hovering above it or nor

#

so that means when the mouse dont hover above the icon its off

vale lintel
#

G'day lads. I have a quick question. I am trying to get a trigger to activate as soon as at least 2 out of 3 vehicles enter the area. I got it working for 1 vehicle but I cant seem to get it running for multiple ones. Can anyone tell me what exactly I need to change?

this and [(conv1 && conv2) || (conv1 && conv3) || (conv2 && conv3)] in thisList;

weak obsidian
#

Just put the vehicles into an array, the count thislist compared to the array if =>2 as condition

vale lintel
#

alright thanks

weak obsidian
#

So ArrConv = [conv1,conv2,conv3], then count (thislist arrayIntersect ArrConv) => 2 something like that

inner swallow
#

Lukio's way is the best to go about it, but just to correct your code

[conv1, conv2] in thisList || [conv2, conv3] in thisList || [conv1,conv3] in thisList``` would be the way of writing what you've written
#

(afaik)

#

but the count method is superior

vale lintel
#

Ah alright thanks. Guess I am kinda stuck with thinking in Java >w>

#

Its so different

inner swallow
#

yeah

#

consult the wiki for count

#

and thisList

#

(basically whatever you need)

waxen tide
#

@deft owl if you click while being over the icon, that click is registered and triggers

winter rose
#

@vale lintel

({ _x in thislist } count [conv1, conv2, conv3]) == 2
slender halo
#

Variable '_this' does not support serialization. Call 'disableSerialization' in the current script (maybe '') if you need to use it.

#

but my function is like

#
disableSerialization;

// controls stuff

[] spawn {
    disableSerialization;

    // controls stuff
};
#

๐Ÿ˜ฆ

little eagle
#
count ([conv1, conv2, conv3] arrayIntersect thisList) >= 2
#

Every other answer shows your talentlessness.

#

@slender halo
Put the control or display you pass inside an array. You can't pass it directly without array.

slender halo
#

oh, got it

little eagle
#

Because that would mean that _this is a control or display before you can disableSerialization and the game hates that, because it thinks it's smarter than you which it clearly isn't.

slender halo
#

๐Ÿ‘

subtle ore
#

๐Ÿ˜‚ was reading a forceWeatherChange docs note detailing that "Don't let the engine takw away your ability to change weather, manually set it and take it back"

little eagle
#
count ([conv1, conv2, conv3] inAreaArray thisTrigger) >= 2
subtle ore
#

๐Ÿ‘€

inner swallow
#

what about

count ([conv1, conv2, conv3] in thisList) >= 2```
#

?

#

or no, never mind

little eagle
#

That will always be false.

#

Because there are no arrays in thisList. Only objects.

weak obsidian
#

is there an advantage to using inAreaArray / thisTrigger ?

little eagle
#

It's no loop.

weak obsidian
#

Ok - not sure I understand, but ok.

little eagle
#

The less stuff you do in SQF the better. Don't you agree? This moves as much as possible into C++ land.

weak obsidian
#

I have no idea of c++ land, never been there tbh, wasn't aware that arrayIntersect loops either so TIL

little eagle
#

arrayIntersect doesn't loop. CODE count does.

#

CODE count: 5 commands, 6 variables, 4 scopes
inAreaArray / arrayIntersect: 3 commands, 4 variables, 1 scope

#

3 commands actually

#

You cut the computations by about 40-50% and delegate it all to the internal engine without SQF.

weak obsidian
#

Ok I can see that regarding the scopes, never noticed it being an issue though

#

Well - not in the situations I use count ๐Ÿ˜ƒ

little eagle
#
{_x in thislist} count [conv1, conv2, conv3] >= 2

[conv1, conv2, conv3] // make array with 3 vars
CODE count ARRAY // walk through 3 element array and report
{_x in thislist} // check if _x in thisList, 2 vars
{_x in thislist} // check if _x in thisList, 2 vars
{_x in thislist} // check if _x in thisList, 2 vars
NUMBER >= 2 // check if float >= 2
count ([conv1, conv2, conv3] inAreaArray thisTrigger) >= 2

[conv1, conv2, conv3] // make array with 3 vars
ARRAY inAreaArray ARRAY // create new array from two arrays
count ARRAY // read array size
NUMBER >= 2 // check if float >= 2
#

And the count step is cheaper in B) too.

weak obsidian
#

Interesting, I guess from now on I'll take this into consideration, thanks

little eagle
#

If it's one trigger, it won't matter much. But you get big things by putting smaller together...
And there is no rational reason for the bias that exists for the count loop. It's only favored, because it's older and it seems that everyone "learns" from someone else's work (read: copy paste).
It would be a shame if inArea(Array) remains unused. They made those commands to be used.

weak obsidian
#

Yeah well we all started off with studying old man murray's guide at one point, sometimes you just use the stuff you are familiar with. ๐Ÿ˜ƒ

#

maybe not all, but surely many

little eagle
#

I read the wiki. Biggest mistake maybe ยฏ_(ใƒ„)_/ยฏ

#

At first you're overwhelmed by it, then you slowly begin to make sense of it all and finally you see that the wiki is wrong about at least half the things written there.

rancid ruin
#

why not correct it?

little eagle
#

I never said that.

#

Now that no one reverts it, you might even get somewhere with it.

#

๐Ÿค”

#

Wat?

subtle ore
#

Pretty sure in summary: research, multiple sources, solution found

drowsy axle
#

I read the biwiki to help me find a command. I then a search the forums, to find my solution / example. (Thanks @subtle ore)

#

I had a fart in the brain

little eagle
#

I've yet to find a single useful thread about scripting on the forums.

subtle ore
#

Your horse have taller hooves on today Commy? May need go give your back a rest ๐Ÿ˜‰

drowsy axle
#

Has very good documentation.

little eagle
#

Dunno what that has to do with today. It's not like I'll find a useful thread tomorrow there either ๐Ÿค”

subtle ore
#

Anymore today sure.

#

Older threads may be of more use

little eagle
#

What makes you think that?

#

I've seen what the ones before me fabricated and it may not be worse, but it's definitely not better than what we have now.

subtle ore
#

That's not what i am saying

#

What i am saying is that the older the threas

#

The more replies

#

More solutions

#

Many of times, a hot thread will detail more than one way of doing something in their own unique ways

rancid ruin
#

I've yet to find a single useful thread about scripting on the forums.
that's a bit much

#

you might not find it useful but there are useful threads there

little eagle
#

Sure, but how would I know if they're not useful to me?

subtle ore
#

I am telling you. Commy has stilts for hooves on his horse.

little eagle
#

Should I better pretend I was a nice person?

waxen tide
#

ehh humans have a horrible API, with literally zero documentation.

#

also you helped me a lot with scripts commy2, so you're a nice person in my book.

subtle ore
#

Commy, i believe that no matter how low in hell your heart is. That as a shell, you're really just being stubborn

rancid ruin
#

why is anyone trying to make it personal lol

#

grow up

subtle ore
#

@rancid ruin ๐Ÿ˜‚

peak plover
#

#passionate_scripting

little eagle
#

Just trying to spice things up.

subtle ore
#

Wooohoo ๐ŸŒฎ

rancid ruin
#

by the way the way i script is actually the best way

little eagle
#

Agreed.

peak plover
#

Which is?

rancid ruin
#

i don't find anything useful in anything anyone has ever said

#

not gonna tell you nige

#

you'll have to find out yourself