#arma3_scripting

1 messages ยท Page 499 of 1

keen bough
#

cant i just run a script that calls the ressources from the players like with foreach?

#

so i could add them together in a controlled environment and nothing would interfere, even when 2 or more players working on ressources. Right?

still forum
#

yeah.. probably

#

but That would be harder and less efficient than just telling the server that "x resources have been mined" and letting the server take care of the rest

keen bough
#

hmmm, now i have to ask. How? I still miss the experience to know the commands. Maybe i oversee a solution thats right in front of my eyes

#

oh wait! I think i have an idea!

#

remoteExec! I can send my variable to another script, that processes the information and updates the global ressources. Even when another player does it, it would just be added up behind the currently running remoteexec and uses the new data, right?

compact maple
#

(what are you trying to do ?)

keen bough
#

an active ressource-mining script that as many player can use as there are online.

#

mercs dont only make money through missions. They can, if they want, also go work on a more or less 'legal' job

#

a missions fun to play, a persistent one, relies on many things. If you can only do the same three things, the mission gets boring too quickly.

#

thats why we stopped with antistasi. Alone the black-market script i plan will be a whole lot of an adventure.

queen cargo
still forum
#

I can send my variable to another script, that processes the information and updates the global ressources exactly what I've been trying to tell you the whole time

keen bough
#

I need some time to understand stuff ^^

earnest ore
#

Client: I mined resources!
remoteExec ["fnc_updateResources", 2]
Server: I'll get right on that.

some_function_to_validate_gained_resource; // if applicable
_addedResources = Do calculation;
_total = _addedResources + currentGlobalResources;
do_your_setvariable;
#

Server is god, everyone else is peons.

keen bough
#

the server is only a demi-god, because i tell the server what and when to do ๐Ÿ˜„

agile anchor
#

hi i'm trying to add an animation on a waypoint with the unit reacting if it gets attacked and then returning to waypoint(s) (if he doesn't die) so on the waypoint i have nul = [this] execVM "1stWP.sqf";

#

and in the sqf S1 playMove "Acts_Executioner_Squat"; sleep 10.033; S1 switchMove ""; 0 = this spawn {waitUntil {behaviour _this == "combat"}; S1 switchMove "";

#

it kind of works but is a bit messy and sometimes misses a waypoint out (after if in combat)

#

waypoint 2 and 3 are same code just different animations with different duration values related to animation

proven crystal
#

do you have to remote execute the setvariable command at all when you set the variable public anyway?

still forum
#

no

proven crystal
#

i think thtas whats supposed to happen here though

still forum
#

that just causes every player to set the variable public

proven crystal
#

[(("storedRawRessource", storedRawRessources, true), missionNamespace)] remoteExec ["setVariable"];

#

or not?

still forum
#

That line is bullshit

#

Yes. that's what it would do if it didn't have multiple syntax errors

proven crystal
#

good good

#

yea im just following half the discussion here.

still forum
#

That would send the variable to every client. And every client would send it off again.
So every client will receive <number of players>+1 variable updates. With the same value for the same variable.
Essentially a network traffic killer

proven crystal
#

but im trying to listen in, the stuff still confuses me sometimes

#

how can i necely simulate artillery?

#

at the moment i am at explosions, but i spawn them at locations and make them explode

#

how do i get it to actually drop shells from above that explode on impact?

#

spawn and set velocity?

#

just throw shit at them?

still forum
#

Yes. That's what I would do

proven crystal
#

it sounds fun too

#

will they explode reliably or bounce off sometimes?

still forum
#

That's also what zeus module does with it's fire support modules

proven crystal
#

unexploded ordonance would be interesting to play with

still forum
#

spawns the shell in sky. SetVelocity towards ground

proven crystal
#

hmm nice

still forum
#

I think they are subject to the same "unexploded ordenance" stuff as any other ordenance

proven crystal
#

so essentially they explode if the damage is 1

#

?

still forum
#

dunno.. Think so

proven crystal
#

means if they are too slow, they wont exlode?

#

hmmmmmm

#

so with some "kill" eventhandler i could even get the impact coordinate i suppose

#

could make a script that slowly targets in on an area by slowly changing velocity or so

#

or just the origin or whatever

still forum
#

don't know if kill fires for ammo

proven crystal
#

its a vehicle id assume... maybe hit and stuff still works tho

#

but id prefer to trigger by damage not just when it is hit....

keen bough
#

["here/itis.sqf"] remoteExec ["execVM", 2,]; How can i send a variable i would need to use in the 'itis.sqf' with the remoteExec as well?
["here/itis.sqf", _myvariable] remoteExec ["execVM", 2];?

proven crystal
#

you would make your life easier if you make a function out of your sqf, believe me

#

i have discovered that magic not so long ago

keen bough
#

Hmm, maybe i learn that someday. But for today i want to learn first how i can do it "dirty" ^^ later i can make it cleaner and cleaner :3

proven crystal
#

i think there even is a thing that remoteexec does not execute sqfs?

keen bough
#

it does execute sqfs ^^

proven crystal
#

[[_object],
{
private _object =_this select 0;
......code.....
}
] remoteexec ["spawn", _object];

#

this is how it works for me with small codes

keen bough
#

now i am confused

proven crystal
#

with some function it would be

#

[[_object],
"my_function"
] remoteexec ["spawn", _object];

#

the _object in the end is because that makes it run where the object is local

#

if you want server, use 2

#

in my case units might be on headless clients too, so i rather do this

#
my_function = {
                private _object =_this select 0;
                ......code.....
            };
keen bough
#

i am horrible confused O_O

proven crystal
#

gives you a function

#

it wont be the last time

keen bough
#

but... i just want to pass a variable to another script? Is thats the way how i must do it?

proven crystal
#

that depends. how did you end up with questions about remoteexec?

#

because thats for passing variables between clients and server

keen bough
#

["script.sqf", _myvariable] remoteExec ["execVM", 2];
Thats send from script 1 (on a local machine) which is the mining-stuff. And in script 2, which works on the server only, adds the mined ressource to the global pool.

still forum
#

wat

#

you can remove exec functions

#

no need for spawn.

keen bough
#

even more confused now. Can i write a whole "script" into the remoteExec stuff?

still forum
#

you could. But if you do that. You also send the script over every time

proven crystal
#

yea but it looks shit ^^

still forum
#

wat?

#

[_object] remoteexec ["my_function", _object];

keen bough
#

i dont care how it looks. First i have to learn, use it multiple times, then i learn new advanced methods.

still forum
#

For now you can use the execVM thingy you posted

#

but you mixed up the arguments again

proven crystal
#

yea that too

still forum
#

left param on the left, right param on the right

keen bough
#

I just want to know how i can pass a variable via the remoteexec as well.

proven crystal
#

but im wondering if its adding stuff to a global pool

#

couldnt he just do it with publicvariable

#

?

still forum
#

[_myvariable, "script.sqf"] remoteExec ["execVM", 2];

#

No he can't

#

We talked already talked about that

proven crystal
#

damn

keen bough
#

ah, so everything i want to pass over is first

still forum
#

that's the reason why we are talking about remoteExec now

#

No

keen bough
#

no?

still forum
#

Everything you want to pass over is the whole line

#

the array at the start are the arguments

keen bough
#

[_myvar1, _myvar2, "myscript.sqf"] remoteExec?

still forum
#

no

#

[arg1, arg2] remoteExec ["command"]
->
arg1 command arg2

proven crystal
#

ah alright i looked it up.

keen bough
#

but you wrote [_myvariable, "script.sqf"] isnt that now for passing the variable?

proven crystal
#

problem with parallel users i guess?

still forum
#

Yes it is (to both of you)

proven crystal
#

ok understood

keen bough
#

So it would look like this:
[_minedRessource, "serverMathematics.sqf"] remoteExec ["execVM", 2] and in serverMathematics.sqf i can say like "globalRessource = globalRessource + _minedRessource;" right?

still forum
#

yes

#

no

#

parameters are passed via _this
_mindedRessource variable will be undefined

keen bough
#

oh right! forgot

#

global = global + _this;

#

Can i send an whole array of information over? Like
[[1, 2, 3,4], "stuff.sqf"] remoteExec ["execVM"]?

proven crystal
#

private _minedresource = _this selct 0;

#

you need to begin with that so that the thing knows what you are talking about

#

in the sqf i mean

keen bough
#

@proven crystal so _this is not the actual value but an array where i have to select the only existing position?

proven crystal
#

you can pass an array, no problem

#

if your first parameter there is an array, then in the script _this select 0 will return that array

keen bough
#

So currently it would look like this:

[_minedRessource, "serverMathematics.sqf"] remoteExec ["execVM", 2] 

and in serverMathematics.sqf i can say like

"_minedRessource = _this select 0;"
"globalRessource = globalRessource + _minedRessource;"
proven crystal
#

yes that should work

keen bough
#

sweet ^^

proven crystal
#

in front of private variables, use "private

keen bough
#

Is it necessary?

proven crystal
#

private _minedResource = .....

#

do it once at the time that you introduce that variable

#

otherwise sooner or later there will be bugs

#

and on the use of functions

#

its useful

#

so do it ^^

#

and figure it out early because otherwise youll end up working over massive amounts of hard to read scrips as i did

keen bough
#

I know that functions are good. But for now i have to understand basics and make a whole lot of a big mission without functions first. Understand everything and later, with the main-mission i will have the knowledge of everything that is possible without functions, and write proper functions ^^ does that make sense? ๐Ÿ˜„

#

my scripts are extremely detailed documented :3

#

If i die one day and have a big mission, people can learn from it easily - because i will adapt those mission(s) to new arma versions as well :3

proven crystal
#

alright. enjoy

#

ill go back to explosions

keen bough
#

explosions? I am curious now ๐Ÿ˜„

proven crystal
#

so much enjoy since i found out how to play with achilles modules

keen bough
#

Well, explosions are noob stuff. Make Tanks fly! Then we can talk ๐Ÿ˜„

proven crystal
#

i can do that ^^

#

my module is called WIngardium Leviosa!

#

but lets say its not a comfortable ride

keen bough
#

hahaha ^^ very well. XD But can only be used by a playername 'Hawwy Potter' ๐Ÿ˜›

proven crystal
#

its meant to mess with players that dont behave at briefling

keen bough
#

oooh sweet

proven crystal
#

essentiall it accelerates you in some direction....

keen bough
#

My mercs are awesome. Everytime i say something like "Briefing" they form a line in front of me :3 And accelrating is neat

#

I normal say something like "This is front" ๐Ÿ˜„ behaved players are best :3

proven crystal
#

yeah i suppose the guys have good discipline, i dont think it will be used often.... but as i found out how it works, i wanted to accelerate stuff ^^

keen bough
#

hahaha, hey, you can use it to make a futuristic weapon ๐Ÿ˜ƒ a 'blow gun' or some sort of.

proven crystal
#

well as i have just learned, its a good way to go about artillery scripts

#

so ill find use for a more controlled version of this

keen bough
#

dont remind me of that, i have to make virtual artillery as well... blergh.

proven crystal
#

i might have mine done by next week if you are interested

keen bough
#

always interested into learning stuff for arma scripting ๐Ÿ˜ƒ Ultimatively i write every single line of code by myself. But examples are a nice way to learn for me

proven crystal
#

also i will finally be able to toss grenades from sabres ultralight plane!

keen bough
#

i want to throw grenades that have a mini_chute on them ^^ like huntIRs but thrown by people. Does not make any sens, but's fun to watch ^^

#

oh... wait... no!

#

fucking genius!

#

throwable balls that can look around!

proven crystal
#

overhead cluster explosions are not a bad idea. but i dont know about the chutes

#

a good question though where that minichute can be found. might have use for it

#

balls that look around could be possible but i never played with the camera things or UAV controls

keen bough
#

hmmm, you could look up the huntIR grenade in ace, they have a mini-chute on them

proven crystal
#

or the huntIR interface

#

but i think there is a relatively quick way to take another objects perspective

keen bough
#

yeah, that will be ballas to make. But imagine the possibillities of men-thrown grenades to watch near surroundings. High Tech to safe soldiers lifes :3

proven crystal
#

dont know if it only works for units and no idea if you can look around when its an inate object or if you are tied to the units eyeballs

keen bough
#

i would do the camera style of the huntir but 360ยฐ

proven crystal
#

when i have my main bits done for the general battles, i might look into that

keen bough
#

awesome ^^

still forum
#

@proven crystal private _minedresource = _this selct 0;
It is generally better to use params especially easier for beginners

#

so _this is not the actual value no. _this is the value you pass. If you pass an array, then _this will be an array

keen bough
#

but _miningwork is a value, do i still have to select it in the new script with _this select 0?

ruby breach
#

See my example from yesterday showing how _this/param/params works

#

If you call/spawn a new script, yes

keen bough
#

alright, good to know

still forum
#

There is not really a reason to pass an array with a single value. Might just aswell just pass the value instead

keen bough
#

if i write a line of code more, that would be okay for me for now :3

still forum
#

yes that should work that only works if _minedRessource is an array. Which is not visible in that snippet.

keen bough
#

_minedRessource is a value of 4 only.

still forum
#

Okey I arrived at the bottom of the history

#

yeah then it won't work despite Fetzen saying that.
_this select 0 doesn't work if _this is a number

#

just use _this directly then. Or use params

keen bough
#

alrighty

proven crystal
#

here is that example that gnashes meant

#
1 call {_this select 0}; //error type Scalar expected Array
1 call {_this}; //returns 1
[1] call {_this select 0}; //returns 1
[1] call {_this}; //returns [1]
1 call {_var = param[0]}; //returns 1
[1] call {_var = param[0]}; //returns 1
1 call [params["_var"]}; //returns 1
[1] call [params["_var"]}; //returns 1
#

why do the last 2 both return 1?

#

same for th e2 before that

#

if there is only one argument it doesnt matter?

#

i guess my question is
[1,2] call [params["_var"]};

#

then _var = 1?

still forum
#

yes

proven crystal
#

a ok i think i got it then

#

and why exactly will that be better?

#

somewhere on the internet it says its more a matter of preference and performance would only be different at huge amounts of script running...

still forum
#

somewhere on the internet it says the earth is flat

proven crystal
#

ive seen that too!

still forum
#

it's better because it's shorter and easy to make out.
And if you have multiple parameters, at about 2-3 it is also faster than tons of _this selects

keen bough
#

the world is a 20 sided die.

proven crystal
#

hmm... i kinda prefferred the use of private for readability... but i guess ill just try it out then

#

or do i still need it?
private _var = param[0]; ?

#

i guess not

#

what happens if i do?

still forum
#

if you use param you still need it

#

params has it integrated

proven crystal
#

okdokie

#

you wouldnt happen to know or be able to test how much of a difference there is between param[0] and _this select 0? just for curiosity

#

ah i guess ic an do that in the debug console

peak plover
#

minimal

#

param does more than select

#

You probably won't need the performance gain from it

ruby breach
#

Params is slower than select but faster than old BIS_fnc_param calls

#

But the difference between params and select is suuuuuper negligible, and params is just a better method all around

minor lance
#

Hello!

peak plover
#

select > param > params

#

I think someone tested it once

minor lance
#

I use _asd = param [0, "Default", ["STRING"]];

#

Any one knows why if I create a rope, my friend doesnt see it until he creates a rope first? After that, he see my ropes

queen cargo
#

simple thing: use params for input args and be done with it
avoid param and select and generally spoken, using _this in any way

#

unless one knows what he is doing, if you need to think about this you do not, using anything but params is stupid

proven crystal
#

how do i point a rocket at a corrdinate? or generally change the azimuth i suppose?

#

is there an equivalent of getDir and setDir for 3D?

minor lance
#

@proven crystal

#

Anyone about thhe ropes thing?

winter rose
#

@minor lance I believe (unsure though) that it depends if the from/to is local or not, to the server or not (a locality sync issue)

ruby breach
#

^ would be my guess. Spawn 2 vehicles from the server, don't get in them, try connecting a rope and see what happens

proven crystal
#

ah right thats what i was looking for

minor lance
#

@winter rose The thing is,, if he creates a rope (locally),, the next time I create a rope, he sees it

compact maple
#

rope is funny lmao

#

I spend hours playing with that command

ebon sparrow
#

I have a problem with the cloak function.

pure blade
#

cloak function?

ebon sparrow
#

yes

#

My disappearance is not good

#

When using the cloak function, it works, but the algorithm does not disappear.

still forum
#

๐Ÿค”

ebon sparrow
#

Please help me

#

I use Apex Farmwork server.

pure blade
#

sorry, but i can't help you, you need to explain your problem exactly and what is a cloak function? do you mean clock?

ebon sparrow
#

This is an example I tried to do.

#

It's just the waves.

pure blade
#

so you want to hide your player object?

ebon sparrow
#

Yes that is what I want.

#

But it does not work.

pure blade
ebon sparrow
#

I have worn it all.

#

files ini.sqf and fn_cloak.sqf

pure blade
#

and you run hideObjectGlobal on the serverside?

ebon sparrow
#

_cloakunit hideObjectGlobal _bool;

pure blade
#

yeah but do you run the script on serverside?

ebon sparrow
#

No

pure blade
#

that's your problem

#

hideObjectGlobal can be only executed on serverside

ebon sparrow
#

I do not think I'll do it, I use a server ready to use Apex Framework.

pure blade
#

ok ๐Ÿ˜ƒ , but if you want to hide your object for other players you need this command, or you run hideObject with remoteExec

ruby breach
#
[_cloakunit , _bool] remoteExecCall ["hideObjectGlobal",2];
ebon sparrow
#

The format is: Uniform nano suit

#

@ruby breach Is this message on the server side?

ruby breach
#

client

ebon sparrow
#

I do not understand your meaning.

ruby breach
#

Then I'm afraid I can't be of any help to you.

ebon sparrow
#

I can not understand some words I try to learn.

ebon sparrow
#

Ok, I'll solve it in the ini.sqf file.

proven crystal
#

what could be the reason that G_40mm_Smoke gets stuck at a position where i spawn it, hanging in the air, and SmokeShell falls as it should?

#

not that it makes any difference which i use here, but id like to know

#

both are ammo

pure blade
#

SmokeShell is a grenade or not?

still forum
#

Both are ammo? 100% sure?

#

Maybe there is a CfgVehicles entry with same name?

proven crystal
#

as ammo

#

have the same thing with flares, whats an actual flare round then that would fall?

#

F_40mm_White doesnt

#

btw the ammo doesnt need to be accelerated, just rockets should be pointed in the right direction ^^^

#

everything explodes just fine on impact no matter the hight

#

its actually a bit sad. i liked the idea of random unexploded ordonance. but maybe ill just stick to minefields for the time being

ebon sparrow
#
{
    class RscProgress```

Can I use this translator more than once?
minor lance
#

?

minor lance
#

Is there any horizontal listbox?

proven crystal
#

so if it is of interest to anyone, the 40mm smokes and flares start falling once you give them a little velocity

#

no matter what direction, apparently they remain stuck otherwise

#

smack em and they will fall

waxen tide
#

Since Dedmen was so space-focussed:
https://imgur.com/V3W54NV - scantime for 1600kmยฒ map is ~4 hrs with 240 cities scanned, 24.000 houses safed in db, 85.000 building positions evaluated for cover, and 352 roadblock spots found on the road network. 7.1MB of sql data.
https://imgur.com/0l8Ilu5 - exported to a sql file, it's 5.2MB vs the 4.8 MB of array i exported with copytoclipboard before.
This does not include the 4 million random empty safe positions, that's running right now. Just finished debugging the above tho and had the first complete run without hickups. (yay milestone)

waxen tide
#

waits

ebon sparrow
#

Hello

#
        SystemChat "Cloak Active";
        _Unit setCaptive true;
#

I run it on the server but it still does not work.

noble pond
#

all the chat commands are local only

#

@ebon sparrow

#

chances are if you test the value of captive command on said unit it will return true, assuming _unit was defined in the first place

#

you simply don't see the systemChat because its running on the server only and client doesn't get told to put it into the chat

velvet merlin
#

is it possible to script completely as dialog nowadays?

meager granite
#

Pretty much

#

There are some limitations but it is very much possible

dusky pier
#

@velvet merlin what dialog needed? ๐Ÿ˜ƒ

dim terrace
#

@velvet merlin do you have that table? It should be possible to convert all those formulas

dusky pier
velvet merlin
#

@dim terrace was not shared yet. however the idea is to add some features ontop of the xls import

#

or what formulas do you speak of? does the sheet have some internal formulas for computations across fields/phases?

#

@dusky pier implementing it as a table seems a bad idea to me. way too restrictive

#

@meager granite can you name some limitations you think of or somewhere to read more about it?

compact maple
#

@velvet merlin what are theses values you posted ?

velvet merlin
#

this is terrain lighting setup

compact maple
#

thank you

#

I remember that update lol

meager granite
#

The limitation is that you need to use controls already existing with ctrlCreate command. But if you need some control configured specifically you can define it yourself in addon/mission and then create with ctrlCreate.

#

@velvet merlin

velvet merlin
#

so need to create dummy classes essentially

#

tx

meager granite
#

No, the opposite, dummy classes are already there

#

But there are lots of properties that are not changable through scripting commands and there might not be basic control class with needed properties

#

In this case you might need to create control config to later create it with the script

velvet merlin
#

well dummies with the desired functionality i meant

meager granite
#

Yes

#

Unless you're doing something sophisticated, all dummy classes are already there

velvet merlin
#

alright. lets see how this goes

waxen tide
compact maple
#

what are you doing jcd ?

#

seems interesting

waxen tide
#

I'm scanning the map with a bunch of scripts and safe the data in an SQL database so i can spawn randomized missions with high flexibility.

#

this way i can define a requirement list for each mission and compare that to all the locations on the map i pre-generated, and get a list of suitable locations for each missions. also it cuts down on mission spawn time by like 3-5 minutes and allows some crazy stuff that would take like an hour to check but that now is just an SQL query.

queen cargo
#

160MB?
what on earth are you saving?

short trout
#

i guess he saves data about sectors to use it as cache instead of running stuff like isFlatEmpty and nearestObjects

still forum
#

all suitable positions he is saving

queen cargo
#

still
to get that to 160MB you have to do either a hell lot of duplicates or use the wrong data types

#

which might not sound bad but the moment you realize that less data means higher speed, you may find the problem

short trout
#

lol, but it's was discussed here for a week and now you like -- "you doing it wrong". So where had you been all this time? :3

queen cargo
#

and have seen the discussion partially

#

was not here whilst the "design" happened

waxen tide
#

@queen cargo 3.6 million positions.

queen cargo
#

46byte per position

waxen tide
#

I mean you can look at it from different perspectives: 1. execution time of the scripts creating it 2. memory required to save it ....

#

My priorities is: execution performance during mission run (currently excellent) and development time (quite short for my standards atm)

#

so i'm really happy ๐Ÿ˜›

queen cargo
#

3.6 million positions then sounds like too many

waxen tide
#

why?

queen cargo
#

40kmx40km => 1600kmยฒ => 1600000mยฒ => 1pos per 1mยฒ

waxen tide
#

i have currently 3 usecases in mind

#
  1. i want to spawn something really big, i can't be picky about the exact location -> i grab all the really big locations from db -> i get like 100 -> i do random -> i have my location
#
  1. i want to spawn something medium sized, i want it roughly in the AO area -> i grab a sector (1x1km) or multiple sectors (2x2km, 3x3km) and grab all positions -> i get like 1000 -> i grab a few random -> i have my locations
#
  1. i want to spawn something quite small -> i can spawn it almost anywhere -> i grab a subsector (100x100m) -> i grab all locations -> i get like 100 -> i pick one random
#

i was pondering if it makes sense to just do the small ones during runtime and blah, but this way it's all following the same pattern and i have a high degree of flexibility and ... idk i don't see the downside atm.

#

also your math must be a bit off, i check in a 10m grid. The map has 1681000000mยฒ so that's 16mio positions i check, and 3.6mio i safe.

still forum
#

Have you considered using mysql spatial datatypes? They should make the i grab a sector (1x1km) or multiple sectors (2x2km, 3x3km) part really easy

waxen tide
#

nope. didn't even look into it.

#

i did the sector stuff in SQF before i even touched SQL

#

it's trivially simple

#

it's 4 for loops cascaded. you take the map size, divide it by 1000, round it up, and that's your main sector row length AND row count. so your for-loop-number for two cascaded for loops. copy the same stuff for subsectors but with fixed amount of 10 each since subsectors are always the same in relation to main sector.

#

oh and at the end of each loop iteration you simply do like coordinates + (1000 * _i)

#

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

#

genius, i know. GENIUS.

#

the most work was actually re-implementing BIS_fnc_findsafepos

#

it aborts early as soon as a check fails to shorten the time needed

compact maple
#

@waxen tide uuh this is good

dusky pier
#

@velvet merlin that values in table - possible to get by script?

velvet merlin
#

@dusky pier why use the table - for what benefit?

dusky pier
#

@velvet merlin
in the table - it is convenient to get as many values โ€‹โ€‹as you need. The script is easy to set the number of rows and columns. You can also use any controls inside the table.

velvet merlin
#

well one can do that also easily by scripting that yourself, no?

#

the only real benefit i can see so far is scrollbars if the window size wouldnt fit

dusky pier
#

the easiest way is to do it through the listbox. the easiest way is to do it through the listbox, but if there is a lot of information, it will look like porridge.

#

it is quite possible to make any dialog exclusively through the sqf script. No hpp. But then some visual settings for the elements will not be available.

frigid raven
#

is there something like tag_fnc_isACE3 besides using if (isClass (configfile >> "CfgPatches" >> "ace_common"))

#

I could extract it to an own func but why reinvent the wheel eh?

still forum
#

what you mean?

#

You mean how to check if ACE is there?

proven crystal
#

if it is to check whether a script has been initialised or your own mod is in use you can just use a variable

#

which brings me to a quastion that i have regarding initialization order

#

i guess the objects initboxes are done before the init.sqf or init.server.sqf and that means i can never call functions that i specify through scripts? but i could execute the scripts

#

or i could use it to initialize functions even earlier?

#

for whatsoeverreason

still forum
#

"before the init.sqf " are supposed to yes

#

but init.sqf is like the least reliable thing ever

#

"means i can never call functions that i specify through scripts" no. preInit fires before them

#

CfgFunctions get's initialized just before preInit

#

and you should be using CfgFunctions for your mission functions anyway

proven crystal
#

hmhmhm

#

the preinit and postinit parameters there are only necessary if i want to actually call the function in the beginning yes? 0 means they are available but nothing is happening?

still forum
#

They are either enabled or not

#

default is 0

proven crystal
#

enabled meaning they are executed on mission start i suppose?

still forum
#

at pre or post init

waxen tide
#

tbh someone inside BI should write a new command replacing isFlatEmpty,findEmptyPosition and BIS_fnc_findSafePos. They're all weird as fuck.

little oxide
#

PlayerConnected eventhandler, fire when someone connect to lobby or connect ingame ?

robust hollow
#

ingame

neon snow
#

Just started playing with ropes, can I make it indestructible?

#

Becouse now it detached from cargo at some speed

waxen tide
#

๐Ÿค”

#

Say i have a compass angle, like 80 degrees. I want a value that is +90 degrees of that, and -90 degrees of that.

#

that would be 80+90 = 170 degrees, and 80-90 = -10 degrees

#

but -10 isn't on the compass

#

is there an elegant way to do this to ensure always positive numbers?

#

๐Ÿค” if (value < 0) then {value = 360 - value};

#

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

minor moth
#

if value is negative, you'll be adding to 360

#

so if value were to be -10, you'd have 370

#

360 - -10

neon snow
#

exactly, just the other way around

if (value < 0) then {value = value + 360};
minor moth
#

yep

waxen tide
#

t-thanks. I should get a cofe.

winter rose
#

@tough abyss metal bars coming from the ground?

quasi rover
#

It seems like a silly question, but can I view the source code of "edit vehicle appearance" of Eden Editor?

waxen tide
#

@quasi rover \Arma 3\Addons\3den.pbo\fn_3DENEntityMenu.sqf

minor moth
#

you can also view all the stuff in the config viewer inside of eden

quasi rover
#

thx guys.

obtuse cosmos
#

Any takers?

#

๐Ÿ˜„

#

@velvet merlin Expanding upon ctrlCreate: ```sqf
NOTE: Since Arma 3 v1.69.141213 ctrlCreate will also search for control class in mission config, if search in the main config failed. This means one can now define classes in mission config and use them with ctrlCreate

@meager granite raised a good point. Example: One of the ListBox control types (RscListNBox I think) does not offer a scripting command solution to drawSideArrows - only when using .hpp method.
#

There are also a few others sadly. Really annoying.

velvet merlin
#

@obtuse cosmos thanks! what means "hpp method" - do you mean mod/config.cpp vs mission/desc.ext?

obtuse cosmos
#

class way yeah

#

I added a note on the Wiki

#

class blah : RscListNBox {

#

etc - You can use drawSideArrow here only - If I remember anymore, I'll update the Wiki note - I know there are a few more though

#

That isn't to say that you shouldn't use ctrlCreate as there is alternative - Use RscControlsGroup and create your own buttons - a bit extra work but more control I guess) @velvet merlin

velvet merlin
#

are they are mods or missions with more complex scripted dialogs?

obtuse cosmos
#

Yes, of course, are you asking me to name some?

#

Sometimes I use ctrlCreate for basic dialogs, it isn't just about complex dialogs - at least for me - If I create a server-side addon that runs on every mission for example, I have to use ctrlCreate

velvet merlin
#

well with more complex i means various different types used, or multi stage dialog

obtuse cosmos
#

Further more, sometimes you can ONLY use ctrlCreate - For example: ```sqf
// Snippet
_inventoryDisplay = findDisplay 602;

_uniformLoadText = _inventoryDisplay ctrlCreate ["RscStructuredText", 7111];
_uniformLoadText ctrlSetPosition [(15.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2)) / 2)), (5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2)) / 2))];
_uniformLoadText ctrlCommit 0;

velvet merlin
#

say something akin to fully inventory replacement, or server browser in terms of complexity

obtuse cosmos
#

You can have multi stage dialogs the other way but you would have to use createDisplay to show more than 1 along side

#

^^ that timing haha

velvet merlin
#

๐Ÿ˜ƒ

obtuse cosmos
#

๐Ÿ˜„

#

Are you asking for general knowledge as a whole or are you planning something?

#

If you are planning, might be easier to advise / share more info depending onwhat it is

minor moth
#

they fixed it?

#

hell yes

#

now my loops can actually sync with the server very nice

#

thats good

#

sweet

digital jacinth
#

@tough abyss anyone have ideas on how to make โ€œtrapsโ€? like instead of always mines and explosives

Do you mean like 'nam punji traps or the like? I made some of those and falling rock/tree trunk traps for my groups vietnam campaign. (which helped me figure out stalker anomalies in the end as well)

#

All of them worked on the basis of triggers around them. Punjis had local triggers for every one, so it would sync correctly when someone steps into one. the falling tree trunk one was a server trigger which then spawned a camera that made an animation downwards with the log attached to it. (this was before the animation modules were added and frankly i still have no idea how to use them)

#

I am at work right now so I cannot send you some code examples right away.

still forum
digital jacinth
#

it is a janky solution, but hey it worked

#

especially becaus ethe tree trunk had no phyiscs

still forum
#

Yes. WAY too logical ๐Ÿ˜„

minor moth
#

eastern european game design never fails to amaze

#

xray engine, perfect example

digital jacinth
minor moth
#

does anyone know why BI chose to go client authoritative? that choice confuses me for a game that has a seriously heavy emphasis on MP

velvet merlin
#

the engine was not built with MP in mind

#

was hacked in only last minute

minor moth
#

thats usually what i hear yeah

#

thats what i figured as well

velvet merlin
#

and is not much different since OFP

minor moth
#

they should add that onto the list for arma 4

#

first thing i learned when i started to do server management and software development, never trust the client

#

even if they are trusted

#

"trusted"

#

oh well, game is good either way

still forum
#

Well I guess in a military simulation that will be "played" by trained Soldiers under supervision of military personell... You could trust the client.

minor moth
#

i just wouldve figured after the commercial success of OFP, CWR, arma 2, they wouldve done something about it

#

dope

#

while i love being able to parachute cows, spawn aircraft carriers and control clients its not exactly the best for arma as a whole

obtuse cosmos
#

@kju ArmA itself and SQF feels like a hack most of the time ๐Ÿ˜๐Ÿ˜‚

minor moth
#

yep pretty accurate

#

as someone who fought lua at every turn for like 5 years, SQF is no different really

#

not having continue/break, little stuff like that really makes SQF restrictive, but i suppose thats where the fun is

obtuse cosmos
#

Coming from web dev here

#

Maybe I just expect too much from SQF

#

After all, SQF is only a scripting language and has limits

minor moth
#

modern scripting languages have come really far

#

sqf is not one of them

obtuse cosmos
#

I just wish we had more control and directly to the engine

#

To manipulate stuff

minor moth
#

that just comes down to the API being expanded, i have a fundamental issue with operations

#

like not having continue, thats the big one that comes to mind

vague blaze
#

Hello guys! Do you know how gun shooting in ARMA is working? Is it like a raycast? Or Particles ? Or maybe it's something else? Thank you

minor moth
#

particles?

vague blaze
#

Thanks buddy)

minor moth
#

that wasnt supposed to be an answer lmao

#

i just dont know what you mean by particles, do you mean literal particle systems or?

vague blaze
#

Yes

minor moth
#

uhh no not at all

obtuse cosmos
#

Lol

#

rofl

minor moth
#

i dont even know what to say to that really

obtuse cosmos
#

Ammo

vague blaze
#

I mean for example in unity particle system

obtuse cosmos
#

Stick with Unity or Unreal

#

๐Ÿ˜‚ ๐Ÿ˜…

minor moth
#

if you mean a particle system, in no way do particles actually have to do with bullet behavior.

vague blaze
#

DM me - I will prove that it does

obtuse cosmos
#

Share here?

#

Lol

vague blaze
#

But not sure about performance

#

Yes, but how implemented? Do you know? Is it like procedural raycast?

obtuse cosmos
#

Quicksilver - DM him with proof lmao ๐Ÿ˜… ๐Ÿ˜‚ ๐Ÿ˜

minor moth
#

im dying atm

vague blaze
#

How high speed is handled?

still forum
#

@vague blaze It spawns a bullet. And it flies. And velocity loss get's simulated every frame

obtuse cosmos
#

Lmfao

#

So descriptive @still forum

minor moth
#

nah dedmen wrong, its particles

still forum
#

It's basically a tiny airplane

obtuse cosmos
#

Lmao

minor moth
#

usenrame said its particles

#

hes right

vague blaze
#

Nice scripting chat guys)

obtuse cosmos
#

A fast aeroplane

vague blaze
#

Thanks @minor moth

still forum
#

a very tiny and very fast aeroplane without wings

minor moth
#

no problem buddy

still forum
#

You could even call it.. A bullet.

minor moth
#

alright im gonna go to bed before my lungs give out on me

#

thanks for the hearty laughs

obtuse cosmos
#

Why ask if you claim to know?

#

Why kind of logic is that? Then you say DM me I have a proof

still forum
#

Btw you were talking about SQF stuff.
Enscript is about 1000x faster than SQF :3

minor moth
#

what in the world is enscript

#

oh its dayz's new thing

#

oop, awesome

obtuse cosmos
#

@still forum Excuse me my good sir

#

What if I fire from a rocket launcher?

still forum
#

It's also a vehicle

#

that has it's own engine

obtuse cosmos
#

Then a missile with no wings!

#

:o

still forum
#

You could call it. A tiny aeroplane without wings.

obtuse cosmos
#

We are making news breaking stuff here

#

๐Ÿ˜€ ๐Ÿ˜‚

minor moth
#

yall are killing me, good night

obtuse cosmos
#

Goodnight

#

Morning here lmao

#

07:46

waxen tide
#

@tough abyss

^ regarding the AI "attackTarget" command, note this information is available already in-engine, visible in diagnostics:

How do you show these diagnostics visible in your screenshot?

still forum
#

Arma diag binary

#

diag_enable command

short trout
#

Back to 1985 for A4! Or better 1960! Seriously!
Lol, does AI know how to throw hand grenades over obstacles (except 1 mission from DLC)? Guess no, so A4 should take place in early 1700s

waxen tide
#

thx dedmen

peak plover
#

Ace 3 uses handledamage

#

Anyone ever use hitpart instead?

delicate lotus
#

Hey, what purpose do vehicles with the class names "ArtilleryTargetW", "B_TargetSoldier", "LaserTargetEBase", "NVG_TargetE" have? There are also variants of those for the EAST and INDEPENDENT side. But I like to know what purpose these have, like the "ArtilleryTargetW". Will it make enemy artillery units if they can see this unit target it automatically?

peak plover
#

I'd assume that the price or whatever it was

#

is set high enough for artillery to targe it

delicate lotus
#

Yeah that could be its use. Im going to try to test it a bit.

waxen tide
#

sighs

#

I wish i had like ONE more dedicated person working on this sometimes.

pure blade
#

you can start arma twice ๐Ÿ˜„

waxen tide
#

is it going to write cfg files for me then?

pure blade
#

Oh that's what you mean, i read wrong ๐Ÿ˜„

#

for what are the cfgs?

waxen tide
#

well i now have a database full of map data

#

and i have a script that grabs all eden editor build compositions from the config file where they're defined

#

so now i'm writing a mission cfg file where you define missions with requirements

#

which are then matched to the data in db

#

and available compositions

#

to return a list of possible spawn locations (from db) for such missions

#

๐Ÿค” sadly nobody came up with good required parameters for such mission "blocks" i call them atm.

pure blade
#

a lot of work ๐Ÿ‘ท

waxen tide
#

yeah i'm offended too.

#

this game is 5+ years old, and nobody bothered to make a good mission for it! outright offensive.

astral dawn
#

so you are making something like 'here we can place HQ', 'this is a good place for an outpost', etc? just caching good positions for future reuse?

proven crystal
#

good evening everyone

#

today i wonder how i can let the zeus enter a condition throuch ares module stuff. the module is fine its more about the fact that i have to get an onbjetc variable into a string

#

im trying something like this

#
call compile format ["private _object = %2; waituntil {%1};",_conditionstring,_object];  ```
#

the user should be able to reference _object in the string that is enetered

#

and run something like "0>(allplayers select {(_object distance2d _x )< 50})"

#

so window opens, some stuff is enetered, and then the dude can enter a little string to suspend execution until that conditio is true

ruby breach
#

0>(allplayers select {(_object distance2d _x )< 50}) isn't going to do anything except error though

proven crystal
#

well thats why im here ^^

ruby breach
#

Also, unless you intend to give your Zues access to debug, letting them enter a condition is likely not a great idea

proven crystal
#

well achilles comes with such a module anyway. and its a safe user circle

#

nobody will mess around, who is not supposed to

short trout
#

Use global var and add params code in string

proven crystal
#

i guess until i have great ideas why i else i would suspend this one i could do it as multi selection but the question remains

#

hm ya a global var would be an obtion

#

but in general, how would i get that object into the string, because currently it errors there

#

or is there no other way than a global var for that?

waxen tide
#

@astral dawn I pre-calculate everything and save it because it would take way too long to do it at mission runtime

short trout
#

didn't find. In such cases i use code like:

format[ 
  "with missionNamespace do {
     private _this = call dzn_fnc_DynamicAdvDialog_getValues;
     private _args = %2;
     %1
  }"
  , _expression
  , _args
]

Because object is always stored as reference. So it's basically 2 ways -- use global variable or use function call inside your expression

astral dawn
#

well this idea isn't new... look up tables, caches, etc, they are often used

#

but the overall thing you are trying to achieve is nice, yeah

still forum
#

@proven crystal why condition string? Why not let the user pass a function?

short trout
#

pass a function
Pre-made function for zeus? I think the idea is to create conditions dynamically. But actually - why don't create UI with few selectables and function to process them

still forum
#

No

#

You can write down functions

#

liek you know.. {stuff}

#

"call compile format" is basically always wrong. Whatever you are doing

#

it's wrong.

proven crystal
#

yea it doesnt look good either

short trout
#

"call compile format" is basically always wrong
NO U!

proven crystal
#

well i think if i let them enter full code, its more dangerous as if i were to just allos them to enter whats inside a check

#

although that would still allow entering code i guess

ruby breach
#

You can do whatever you want in a while loop

#

They could nuke the server, and then return false at the end and it would still work

#

Hence why I said it's likely not a good idea

short trout
#

You can attach (true) && in the begining of condition. so any statements that doesn't return bool (like commands) will fail execution

proven crystal
#

oh nice... ill add that

short trout
#

and add some BIS_fnc_inString check for "create" or "delete" keywords

ruby breach
#

They'd still be able to make their "condition" ``"false; {bad code}; false"`

short trout
#

how?

astral dawn
#

@waxen tide if you need to run your code once in 3 hours to make a new mission, and it takes even one minute to calculate something, consider if messing with the SQL server is really worth it

high marsh
#
if("bob" in "bob is amazing") then {

}
#

Might as well use engine command than the function

proven crystal
#

well to just get back to the point, no one will try to mess around

waxen tide
#

@astral dawn You're like 3 weeks too late with starting that discussion

still forum
#

@high marsh engine command is case sensitive

proven crystal
#

my wuestion is more because atm a get this

high marsh
#

toLower?

proven crystal
#

private _object = 14c092bab00# 1781086: helipadempty_f.p3d;

#

which obviously doesnt work

#

so how get that _object variable in there. other options that a global var?

still forum
#

Because as I said. Call compile format is always wrong

proven crystal
#

just to know...

short trout
#

no, call compile format is awesome just-in-time stuff

#

but not for objects of course

still forum
#
private _condition = compile _conditionstring;
waitUntil _condition;

Done.

short trout
#

@proven crystal so how _object object is selected?

still forum
#

literally. That's it

proven crystal
#

oh...

#

ah yes it knows object there already of course

ruby breach
#

@short trout Using the previous code provided, you tried to do something like sqf waitUntil {call compile format["(true && %1)",_condition];}; //seriously, don't use call compile to prevent abuse of the manually entered condition. If I made my condition ```sqf
_condition = "false); {//some malicious code here}; (false"

still forum
#

WTF

#

are you serious?

#

call compile format IN A FUCKING LOOP?

short trout
#

i was talking about call compile whole code, not _condition

ruby breach
#

Example

#

It hurt to type, trust me

#

Was illustrating how you could still execute non-boolean code with his original example (in response to - ) ```
DusinToday at 1:45 PM
You can attach (true) && in the begining of condition. so any statements that doesn't return bool (like commands) will fail execution

short trout
#

ok, whatever

still forum
#

You cannot make code safe. Unless you only allow a specific set of commands and variable names

#

and at that point you already know what you want the user to type into the condition field. So you might aswell just do it by yourself

#

so any statements that doesn't return bool (like commands) will fail execution Correct. They will fail AFTER they executed.
Great job.

short trout
#

Oh my

still forum
#

@ruby breach If I made my condition no

short trout
#

it's real problem to ban people!

still forum
#

(true && false); {//some malicious code here}; (false) doesn't do anything.

#

I guess you meant
{ some malicious code here; false}

ruby breach
#

Yeah, that (I'll be honest, I really didn't proofread my example since it's all bad code anyway)

short trout
#

Anyway, keyword filtering still an option.

proven crystal
#

well i dont really worry about that. achilles has a code execution module inbuilt anyway, which is way more comfortable

#

and im using achilles and the menu framework there anyway

short trout
proven crystal
#

this thing Ares_fnc_showChooseDialog

#

plain and easy

short trout
#

oh, ok, great thing

proven crystal
#
while {condition1} do {
             waitUntil {condition2} ;
};
#

now in a situation where i am waiting for condition 2, will it keep waiting there even if condition 1 changes?

#

suposse then i would add something like if (!condition1) exitWith {}; into and right after the waituntil

#

nonsense... probably just waitfor condition1&&condition2

#

but i like to make things more complicated

short trout
#

will it keep waiting there even if condition 1 changes?
yes if condition is code and not a function call (and function was updated, but even then it will wait for cond2 and then will re-check cond1)

proven crystal
#

so it will wait, but recheck condition1?

#

so if (!condition1) exitWith {}; after the waituntil is nonsense?

short trout
#

at next loop step, like while always do

proven crystal
#

ah right

#

always full turn

short trout
#

If condition is set as code like while { _o1 distance2d _o2 < 2 } do { ... } - you won't be able to update it afaik, only terminate whole script or use if () exitWith {};

If condition is result of the function call like while fnc_MyCondition do {} or while { call fnc_MyCondition } do { ... } - then you can try yo update condition by changing code inside fnc_MyCondition. But it will apply only at next iteration of while loop.

proven crystal
#

ya makes sense. sorry no idea why i was asking. im doing it that way in other scrits. just confused myself again

#

i wdont use waituntil often so i was suddenly wondering ..

short trout
#

As sort of a fantasy it should look like this (but not sure how deep and dark it is):


fnc_MyCondition = { true };
fnc_UpdateMyCondition = { 
    // function to update condition and re-set loop: { %newCodition%} call fnc_UpdateMyCondition ;
    fnc_MyCondition = _this; 
    gvar_ConditionUpdated  = true; 
};


[] spawn {
  gvar_ConditionUpdated = false; // flag that loop condition changed and loop should proceed to the next step

  while fnc_MyCondition do {
      waitUntil { gvar_ConditionUpdated || %customCondition };
      if (gvar_ConditionUpdated) then {
        gvar_ConditionUpdated  = false;
         /* go to next loop step */
      } else {
         /* actual code */
     };
  };
};
edgy dune
#

is there a way to detech if someone has entered/existed a virtual arsenal?

high marsh
#

@edgy dune

_isOpen = uinamespace getvariable "RSCDisplayArsenal"
edgy dune
#

oh, that seems rather easy I guess, thx.

#

ill see if I can get it to work

drifting dragon
#

Hey all, I'm very new to SQF, and this one script has been giving me some serious trouble. I moved the functions addMusic, playMusic, and callResource to a different directory, and despite having no mentions or #includes in other files, I'm still getting the following error.

Script functions\Radio\addMusic.sqf not found.

This is the way the functions are defined in the description.txt:

class CfgFunctions {
    #include "core\def\functions.hpp"
    // add your own functions below
        class PIKE_Radio
    {
        class Radio
        {
            class addMusic {};
            class playTrack {};
            class callResource {};
        };
    };
};

Thanks, if you've got any questions I'll try to clear them up as best I can.

pure blade
#

you must define the path with file = "path";

class CfgFunctions {
    #include "core\def\functions.hpp"
    // add your own functions below
    class PIKE_Radio
    {
        class Radio
        {
            file = "path\to\directory";
            class addMusic {};
            class playTrack {};
            class callResource {};
        };
    };
};
proven crystal
#

if i use revealMine will that actally work to prevent ai to walk into mines that i want ghem to be their own?

high marsh
#

@proven crystal It'll give them knowledge of the mine yes, if you give them a detector it should do the same thing

proven crystal
#

hmm.. is there also a way to prevent mines to blow up if the units that would triger them are of a specific side?

#

i really hate it when they blow themselves up. bad enough in cars

#

and as vcom is running, not much i can do to prevent them from getting waypoints in or across minefields if i were to use one

high marsh
#

disableSimulation to prevent mine trip

proven crystal
#

hmm but then i need to check more or less continuously if players come close

high marsh
#

Yup.

proven crystal
#

why dont these things have an owner like remote detonated onbjects. an ownerside at least

high marsh
#

oh, you need player owned mines?

#

there is a command for that

proven crystal
#

no its to make sure that AI dont get blown up by their own minefields

#

there may be a patch of mines between ai and players. ai tends to advance sooner or later and would be blown up by their own stuff

#

i either want to prevent them entirely from entering that area, which i dont see how i would do it, or prevent the things from blowing up

#

preventing them from getting closer than X meter to known mines would be good

#

i have another thing that is more of a mth riddle to me

#

i want to get rockets oriented towards a target

#

what im still missing is the angle for the altitude

#

i thought this might lead to some result

#
_pos1 = getpos _obj1;
_pos2 = getpos _obj2;

_a = abs ((_pos1 select 2) - (_pos2 select 2));
_b = _pos1 distance2D _pos2;
_c = _pos1 distance _pos2;

_azimuth = acos (((_b^2) + (_c^2) - (_a^2))/ (2*_b*_c));
#

i think my geometry skills are outdated

drifting dragon
#

@pure blade Unfortunately that doesn't seem to have worked. Each function is in its own file, in the directory mentioned.

class CfgFunctions {
    #include "core\def\functions.hpp"
    // add your own functions below
        class PIKE_Radio
    {
        class Radio
        {
            file = "core/fnc/radio";
            class addMusic {};
            class playTrack {};
            class callResource {};
        };
    };
};
knotty arrow
#

anyone know how exile and other mods can use more than waypoints

#

using shift left click?

pure blade
#

are multiple waypoints not a own feature of exile?

knotty arrow
#

If u click meanwhile pushing shift

#

create a marker with the distance from u to this point

#

in exile or other mods can put more than this points

#

and i don't know how to do it

#

do u understand me?

pure blade
#

i understand you, do you create a mod or a mission?

knotty arrow
#

mod or mission

#

don't matter

#

only want the way to do it

pure blade
#

yeah but i think there are no easy ways for vanilla

knotty arrow
#

i am not trying to do in vanilla

#

i have a mod

#

how can i do in mod way

#

thanks in advance@pure blade

pure blade
#

i don't create mods, but for vanilla i would try this with onMapSingleClick eventhandler, createmarker and drawIcon3D

knotty arrow
#

aham

waxen tide
#

I'm still a bit a noob with defining classes and inheritance and such. Maybe someone can comment if the variant with or without subclasses seems to make more sense: https://pastebin.com/N2p46N8V (uhg, that word wrap in github)

#

I think i like the one without subclasses more, less confusing (but more verbose). sensible defaults that allow obmitting unnecessary values seems to help with that.

pure blade
#

i would do this with subclasses, i think it's cleaner because you don't write so much as without subclasses

waxen tide
#

yeah butt

#

i can imagine pretty much overwriting every single possible value in a parent class

#

with something from a subclass

#

which is a mess to later interpret in code i would figure :/

astral dawn
#

classes are great... maybe as you implement the code for each mission type to work they will help you, for instance, if you make common code for all 'crashed_something' missions

#

or are you going to write specific script for every crashed_xxx mission?

#

i don't think it's a mess to interpret in the code, AFAIK when you inherit from something, you grab all its default values

waxen tide
#

most of the code is done.

#

(to spawn the individual blocks a mission can have)

astral dawn
#

yeah but there will be some script to poll the success/failure conditions, maybe you could generalize it

waxen tide
#

idk what i'm going to do in the future

#

everything that's possible with reasonable effort and has been prioritized high enough, probably

#

hence why i want flexibility

#

but also no bloat

#

and nothing overly complicated

#

so i'm trying to figure out the granularity i want right now

drifting dragon
#

That worked, thanks @pure blade

astral dawn
#

how do you calculate convoy waypoints? do you have an optimal path search algorithm?

waxen tide
#

yeah, A*

astral dawn
#

neat

#

does it work good?

pure blade
#

no problem ๐Ÿ˜ƒ @drifting dragon

astral dawn
#

I watched another guy make an A*, and it turned out some road segments are poorly connected in arma map itself

astral dawn
#

oh that's the guy I am talking about

waxen tide
#

yeah well you need to implement some contingencies obviously

#

you can't expect to always get a valid path back

#

but i got it to work for what i'm doing.

#

I do like a dozen A* path searches for each city i spawn roadblocks around for example

astral dawn
#

so you put a roadblock... on a nearest path between two cities? or how do you use A* in that case?

waxen tide
#

(hence why i now safe stuff in an SQL DB, takes forever)

astral dawn
#

have you heared of planned assault?

waxen tide
#

no

astral dawn
#

search of an optimal plan by using hierarchical task networks... also uses A* for the plan... hope someone could use it for dynamic mission generation

waxen tide
#

i plan to use it for convois, ambushing players and such

#

but currently i only have a function to calculate a path for a convoi that makes sense (it gives the AI a waypoint at each intersection) (someone i work with requested that from me for a convoi script, but i think he hasn't really done much with it yet)

#

and ofc the roadblock pre-calculation.

#

roadblocks are pretty static tbh, like 243 evaluated locations, maybe 180 of those get roadblocks (because they're cities) and that results in 352 different roadblock spots. it's hard to find suitable spots with sufficient space on sensible roads with a script in the first place, randomizing them was my plan but i dropped it because i probably spend like 500+ hrs on that roadblock placement script and the reward isn't worth it atm.-

#

back to my old topic: i don't like the look of these subclasses. too convoluted because you have to overwrite parent values :/

minor lance
#

Hello! Is there anyway to get the object created in RSCObject dialog?

#

Also, is there any way to load all proxy from that control object?

waxen tide
#

@astral dawn That stuff is interesting. I've shoved it into my todo list.

#

good AI in arma

#

i mean, how hard can it be.

astral dawn
#

allright, tell me if you succede in that

#

I tried to read more of this tech but such planners are super hard for me

minor lance
#

Anyone know abou t the rscObject?

astral dawn
#

well, you are doing almost same thing, right? finding an optimal plan where to place yur roadblocks for instance. HTN is a way to generalize everything and use A* to find an optimal plan for many many situations

waxen tide
#

eh ... publicly available missions have .. disappointed the people i ususally play with. so i went like "how hard can it be" and looked into scripting. most stuff is still "hard" to me.

#

yeah, kinda. but i've split stuff into 3 parts:

  1. pre-generating (a lot) of data
  2. spawning static mission elements depending on server ressources and player count (i call it static, but it also has patrols and such)
  3. dynamic reinforcements (based on player interaction)
#

1 and 2 were kinda "done", i've just recently moved everything to SQL and have been doing the cleanup for that last few days. 3 is 80% fancy concepts 20% done.

#

planned assault generates one thing offline which then is always the same? kinda? i guess?

#

also i'll try to do something like EOS (enemy occupation system) and spawn a bit of life everywhere on the map, but only a tiny little bit to keep players on their toes (and obviously de-spawn it if no players present)

astral dawn
#

yeah, well the cool thing it can resolve more tactical situations like 'move infantry through forest and tanks through open field vs move everything on the same road' and it can solve pretty complex dependencies like 'before we go on with the plan, we must bring all the troops to the area, and for that we must bring a truck, but truck can't go there, so troops will walk, etc', it can plan very deep

waxen tide
#

nice

#

but you can only like, use their tool, not look at the code, right?

astral dawn
#

yeah... well he shared some pieces of code in the attached pdf documents

waxen tide
#

yeah i've skimmed thru those

#

not an option.

#

gives Quiksilver a dog-treat

#

i've written up a concept that is basically: AI knows nothing. if AI spots and engages player, after time X, AI gives a report to HQ. the more time passes, the more accurate that report to HQ becomes. read: if players kill AI quick, HQ is clueless. additionally: HQ occasionally checks on their units, if there is no reply, search parties will be send out if units are available. when HQ has build a sufficient picture of the enemy, HQ will send availabe supports to engage.

#

that was precisely to avoid what you just said.

#

(so far just a fancy concept page in our wiki)

astral dawn
#

sounds nice

waxen tide
#

what i kinda noticed tho, it's hard to give commands to non-existing AI. so the "spawn stuff" scripts have higher priority on the todo (what i'm currently working on)

#

i've kinda ignored the 9001 AI threads in forums, haven't looked too deeply into ASR, VCOM konkzy's stuff or what's inside the latest I&A. it's all on the todo tho.

quartz blade
#

Has anyone ever thought of making a mod that makes reload the weapon only if the mag is in the tactical gilet? (Like EFT) (Sorry for the bad English)

west venture
#

Tactical gilet?

still forum
#

you can only reload when you are perfectly shaved

#

else the magazines will tangle up in your beard

west venture
#

Do you mean not being able to reload using magazines from your backpack until you move them to your vest/uniform @quartz blade?

#

While I totally agree with that, I've never heard of any mod that does this.

waxen tide
#

I still hope, deep i my heart, that someone at BI wakes up every morning terribly, terribly ashamed by the fact that ArmA doesn't perfectly simulate the magazine-bullet-chamber situation. And we can't even fill magazines bullet by bullet with mixed ammo types! A disgrace.

#

How will i continue my life without rainbow colored tracer in my magazine when i feel like it?

white sky
#

Can you store 2 separate bits of data in lbSetData ?

still forum
#

Sure. Data is a string

#

just put both in the string with a seperator inbetween

#

"databit1|databit2"
And then split it apart again using splitString

tame lion
#

Alternatively, you could store your data in an array and then convert data to a string. Then just do _data = call compile (_ctrl lbData _index);

#

When you need the data

ruby breach
#

Provided it's formatted appropriately for the command, use parseSimpleArray rather than call compile

quartz blade
#

@west venture exactly, that I mean

proven crystal
#

doe !isNull (getAssignedCuratorLogic player) also return true for the adminLogged?

#

where i did not link modules to slots in the editor?

#

or is there anothercommand to check for curator?

peak plover
#

can projectiles not get variables assigned to them?

proven crystal
#

are they not also vehicles like others?

peak plover
#

๐Ÿคท๐Ÿป

#

maybe they are like

#

simple objects

#

Because there are a lot of them, they won't have a namespcae

proven crystal
#

hm

peak plover
#

I'd want to know what gun the projectile came from

#

But I can't assign a variable

#

:*(

slow elbow
#

@peak plover Do you want to know that because you want to be able to identify what gun killed a unit?

#

What is your use case for assigning the variable/EHs

peak plover
#

yes

#

I want to know what gun the damage came from

slow elbow
#

Then you can just use either the HandleDamage EH or the killed EH.

#

Sorry, not killed. Killed only gives the unit that killed the other unit

peak plover
#

No, I need to know the gun for every hit, not just killed

#

but handledamage / hitpart only give me the projectile

#

not weapon

slow elbow
#

hmm.. yeah. Maybe there's a way to get the weapon from projectile

peak plover
#

Do you mean from the config?

#

No

#

multiple weapons can use the same bullet/projectile

slow elbow
#

Well perhaps you can use the source unit that HandleDamage gives you, then detect what weapon that unit is using?

#
_weaponUsed =  currentWeapon _sourceUnit ;
peak plover
#

No

#

That won't work

slow elbow
#

unit addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    _gunUsedToCauseDamage = currentWeapon _source;
}];

Why wouldn't this work?

hoary mural
#

If you switch weapon after shooting?

slow elbow
#

but this is almost instant

#

idk. That's the best i got atm.

peak plover
#

bullets take time to travel

#

Handledamage fires on remote machine from the firer

#

Therefor the delay is big anyway

hoary mural
#

Maybe keep track of last shot weapon per player then use that in handledamage

slow elbow
#

Its a kill feed that outputs victim killer and weapon

peak plover
#

It uses currentweapon in killed eh

slow elbow
#

actually, nvm. It has the same thing i was saying, so it won't work for longer ranges and hang times.

#

haha, too fast for me to type it out

#

I'm fairly sure that KoTH does what you're after correctly, so perhaps ask Sa Matra or Bobby Digital?

peak plover
#

Found a way

peak plover
#

I'll create a namespace and use the str _projectile

#

Last bullet would not work because what if I shoot 1 and it hits someone in the distance

#

Only issue is cleaning it up

#

because it would eat memory on hc/server

sick sorrel
#

when you use forgetTarget , is there a minimum time before the target is picked up again?

still forum
#

Then just do _data = call compile (_ctrl lbData _index); @tame lion NO!
parseSimpleArray!

proven crystal
#

why this not working?

#
[fez_suppression_targets,{
                    { _x addCuratorEditableObjects [_this select 0, true ];  } foreach allCurators;
                }] remoteexec ["call", 2]; ```
#

fez_suppression_targets is an array

#

and they are known to the client

short trout
#

Maybe u need function (like bis_fnc_spawn) instead of call command. it might be restricted for remoteexec

proven crystal
#

i swas informed that BIS_fnc_call and so are kind of old and not needed

still forum
#

Unless you set up your own custom CfgRemoteExec restrictions and blocked call by yourself. It's fine

#

fez_suppression_targets is an array Yes. So _this select 0 what is that?

#

ARRAY select 0? returns an element from the array

#

not just the first element of an array

proven crystal
#

wait i have improved i thgink but still not work

#
{[_x,[fez_suppression_targets, true ]] remoteexec ["addCuratorEditableObjects", 2]; } foreach allCurators;
tame lion
#

@still forum i was not aware of that command parseSimpleArray

proven crystal
#
[fez_suppression_targets,{
    { _x addCuratorEditableObjects [_this, true ];  } foreach allCurators;
}] remoteexec ["call", 2]; 
#

does not work either

still forum
#

add diag_log's

peak plover
#

hey dedmen

#

I made a ๐Ÿ’ฉ

#
health_fnc_onFired = {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

    private _varName = str _projectile;
    health_firedNamespace setVariable [_varName,_unit];
    health_firedNamespace_variables pushBack (_varName);
    health_firedNamespace_variables_count = health_firedNamespace_variables_count + 1;

    // check if the namespace should be cleaned
    if ((missionNamespace getVariable ['health_firedNamespace_nextClean',CBA_Missiontime])> CBA_Missiontime) exitWith {};
    call {

        // set time for next clean
        missionNamespace setVariable ['health_firedNamespace_nextClean',CBA_Missiontime + 5]; // todo bigger delay

        // only clean if more than 200 variables
        if (health_firedNamespace_variables_count < 200) exitWith {};

        // delete amt will be 100 less than the total amount
        private _deleteAmount = health_firedNamespace_variables_count - 100;


        // loop through the first 100 and set them to nil in the firedNamespace
        for '_i' from 0 to _deleteAmount do {
            health_firedNamespace setVariable [health_firedNamespace_variables # _i,nil];
        };

        // remove 101 from the count (0 also counts)
        health_firedNamespace_variables_count = health_firedNamespace_variables_count - _deleteAmount+1;

        // update the variables array and remove the first 100
        health_firedNamespace_variables = health_firedNamespace_variables select [_deleteAmount+1,10000];
    };
};```
#

Dedmen

#

Do you know a better way to know which weapon the projectiel was fired from / assigning varibles to projectiels?

still forum
#

health_firedNamespace_variables pushBack (_varName); Why? You already have allVariables command

#

health_firedNamespace_variables_count Wat? You already have count command to get number of elements in array

#

update the variables array and remove the first 100 But you are not actually removing elements at all

#

See deleteRange

peak plover
#
  1. allvariables won't update when i nil
  2. a variable is faster than count
  3. select [_deleteAmount,10000]
#

that means from ex 100 to 10000

still forum
#

If you need the ordering to stay consistent. Try checking if namespaces keep order

#

allvariables won't update when i nil Wat? Should definitely update.
a variable is faster than count not by much though. count is also just grabbing a variable from the array's internals

#

3. select [_deleteAmount,10000] Okey so.. You think copying up to 9900 elements, is better than just deleting the first 100?

peak plover
#

hmm

#

I'll check out the allvariables

#

Didn't know that about count

#

aah deleterange

#

Thanks

#

I'll check this all out

tame portal
#

Microoptimizations shudders

peak plover
#

not really

#

this runs every time a unit fires

#

it adds up to makro

#

@still forum

#

setvariable nil

#

does not remove it from allvariables

#

๐Ÿ˜ฆ

tame portal
#

The entry should become nil

still forum
#

wtf

tame portal
#

Oh wait no my bad

still forum
#

We tested that a couple weeks ago because someone said variables don't get removed when set to nil. We tested, they were gone, he was wrong.

peak plover
#

I just did setvaraible ['test',1];
setvariable ['test',nil];

nocturne basalt
#

hi guys. Im making a chase script for a vehicle. I want it to drive as close to the target as possible, but it always stops around 5-6m from the target.
Im using this command
_unit doMove getPos _target;

#

can I force it to drive as close as possible? 1m would be perfect

still forum
#

Have you ever seen AI drive?

nocturne basalt
#

yes?

still forum
#

Either they stop 5m away. Or they ram into you and explode

nocturne basalt
#

ramming would be better in my case hehe

#

but it cant be forced in my script somehow?

still forum
#

oh in that case.
Maybe just try telling them doMove to a couple meters infront of the target

nocturne basalt
#

hmm I was thinking about giving the move order to going past the target somehow, but the direction of the target shouldnt matter here

tame portal
#

Didn't they eventually add a command to make vehicles follow a very specific path?

#

If that command worked you could make the vehicle move close and then switch over to manually telling the driver where exactly to drive

nocturne basalt
#

Sweet thanks. Gonna give it a try

plucky schooner
dusky pier
#

@plucky schooner place onLoad = "call mug_getNearbyJets;"; after movingenable=true;

#

onLoad - is display event handler not control

proven crystal
#

i get that i have the true in the end whenever i use setVariable, but do i also have to use publicvariable whenever i change publicvariables otherwise??

#

when i create it on the server as publicvariable and later change it on the client

#

i do this on server

#
if (isnil "fez_HQs") then {
    fez_HQs = [];
    publicvariable "fez_HQs";
};
#

and later on the client

#
fez_HQs pushbackunique _mobileHQ;
#

again do publicvariable "fez_HQs"; after that or not`

still forum
#

When you want to send the variables value away to others. You call publicVariable

dusky pier
#

@proven crystal try send client - server - client

#

i need variable i send that from client:

#
_cnt = count fez_HQs;
fez_HQs pushbackunique _mobileHQ;
if (count fez_HQs > _cnt) then {
    [fez_HQs] remoteExec ["fez_HQs_fnc",2];
};
plucky schooner
dusky pier
#

@plucky schooner try that

#

@proven crystal on server send publicVariable again in fez_HQs_fnc

plucky schooner
#

@dusky pier Im able to the vehicle list around me, but how do I get the value when I select it, and press "Store Jet"?

#
disableSerialization;
private _listBox = (findDisplay 99999) displayCtrl 99998;
private _index = lbCurSel _listBox;
private _data = lbData [99998, _index];
private _value = _listbox lbValue _index;

diag_log _data;

_data returns ""
_value returns 0
_index returns -1

dusky pier
#

@plucky schooner you can use when fill listbox sqf uiNameSpace setVariable ["VEHICLE_S",_vehicles]; and when used storeJet - sqf _index = lbCurSel _listBox; _vehicles = uiNameSpace getVariable ["VEHICLE_S",[]]; _veh = _vehicles # _index;

plucky schooner
#

@dusky pier Managed to get data when pressing Store Jet. Thank you for the help!

dusky pier
#

@plucky schooner no problem ๐Ÿ˜ƒ good luck

silk sparrow
#

Hey guys! I'm trying to find a rearming script for aircrafts, a script which can change aircraft loadouts when an HEMTT ammo is side the aircraft.
Thanks for help!

dusky pier
#

is possible to get car engine RPM with script?

radiant needle
#

How do I make a light source not look like a spot light? Do I change the constant, linear, or quadratic

proven crystal
#

how can i get the string of what users write in the chat?

#

trying to do some stuff with a bomb and a disarm code

pure blade
#

there is no vanilla chat event, but you can create your "own" eventhandler, you must find out the idd and the idc of the chat and the messagebox

still forum
#

@proven crystal CBA has a chat message sent eventhandler

pure blade
#

or so if you play with mods

peak plover
#

aye

radiant needle
#

Anybody know why this is working for units but not for turrets?

null = [(_this select 1)] spawn {
_Unit = _this select 0;
_Unit disableAI "MOVE";
_Unit removeWeapon "Throw";
[_Unit,{_this hideObjectGlobal true;}] remoteExec ["call", 2];
_Unit allowDamage false;
_Unit addeventhandler ["fired", {(_this select 0) setvehicleammo 1;deleteVehicle (_this select 6);}];
for "_i" from 0 to 1 step 0 do {
If (!alive _Unit) exitWith{};
For "_i" from 0 to ((Ceil(Random 50)) + 6) step 1 do {
_Unit forceWeaponFire [weaponState _unit select 1, weaponState _unit select 2];
Sleep 0.1;
};
Sleep (Ceil(Random 15));
};
};

#

Turrets wont fire

still forum
#

theres no way to clear a variable in those namespaces don't say that too loudly

#

no way with vanilla Arma SQF scripts besides deleting the object.
you mean.

peak plover
#

@radiant needle no clue

#

no clue what it does as well

waxen tide
#

can i generate class definitions with fancy preprocessor commands somehow?

#

like, automate repetitive things.

#
class rhssaf_fort_tent_001
{
            #include "rhssaf_fort_tent_001\header.sqe"
            #include "rhssaf_fort_tent_001\composition.sqe"
};
#

Like, get rid of the string that's in there 3x.

still forum
#

macros can do things. But #include inside macro doesn't work I think

waxen tide
#

i need to have these classes defined pre-init, so i can't generate classes with sqf code, can i?`

#

i guess a shell skript to generate such cfg from folder/file structure is easiest

still forum
#

no

waxen tide
#

it's the format EDEN uses to save compositions

#

(select a bunch of objects, right click, save custom composition)

#

i make very liberal use of compositions

#

larrow's script to spawn them is very handy

carmine abyss
#

Is it possible to use a for loop inside of another for loop?

still forum
#

yes

#

why wouldn't it?

#

If you call a function in a for loop. The function doesn't know where it was called from, so why should the second for loop somewhere in the function that you call magically break without any visible reason?

carmine abyss
#

thats a very good point you made

#

so tell me whats up with this script. sqf for [crate1, crate2, crate3] do { for [{_i = 0}, {_i < 5}, {_i = _i + 1}] do { private _ammo556 = _x addItemCargo ["30Rnd_556x45_STANAG",1]; private _smoke = _x addItemCargo ["SmokeGrenade", 1]; private _rndmLoot = selectRandom [_ammo556, _smoke]; [] spawn _rndmLoot; }; };

still forum
#

for [crate1, crate2, crate3] do wat

#

Well... If all crate variables rae of type CODE it should work

#

but you don't use _i anywhere

#

and where does _x come from

#

also you are missing the private's

#

Also addItemCargo returns nothing. What the hell are you trying to store there in that variable?

#

Why are you storing nothing in a variable

#

and then selecting a random nothing out of two nothings

#

and you cannot spawn a nothing

#

your whole code doesn't make ANY sense

#

And I'm 99% sure you'd have noticed all these mistakes by simply reading the wiki pages for the commands that you are missusing here