#arma3_scripting

1 messages ยท Page 244 of 1

winged thistle
#

ok, so make them private and we stop colliding.

#

Awesome, thanks guys

dusk sage
#

You're never going to hide any code from somebody who wants and knows how to take it in ARMA

little eagle
#

You have to edit the script that overwrites though

winged thistle
#

I'm quite aware BoGuu

little eagle
#

not the script were the variable was overwritten

winged thistle
#

again, it's not my idea

#

I'm just the developer

dusk sage
#

Just shift stuff server side then, it would have alot more effect than renaming variables

winged thistle
#

If I ever develop anything independently for Arma, it will be 100% stealable

#

I have

#

But this is all client side stuff for displays and the like

#

Not good on the server ๐Ÿ˜›

dusk sage
#

You're trying to 'obfuscate' your dialogs?

winged thistle
#

No

#

I have scripts that change their contents and stuff

#

Trying to obfuscate those

dusk sage
#

You can still put those server sided

little eagle
#

Did you write these originally?

winged thistle
#

My efficiency is pretty great atm, thanks

#

Yes, I did

#

I wrote this whole mission with Benargee's help

#

We're hoping to release soon

little eagle
#

Definitely should start using private

winged thistle
#

will do

#

won't take long to correct

dusk sage
#

You're releasing an 'obfuscated' mission ๐Ÿ˜ซ ?

winged thistle
#

No

#

"We're" releasing an obfuscated mission

#

Independently, I'm all about open source

little eagle
#

I really dislike this obfuscation nonsene :/
Open Source, yay

winged thistle
#

I repeat, I'm not the boss, it isn't my idea

dusk sage
#

stick it all on one line that'll make people not even bother

winged thistle
#

already done

#

obfuscated

dusk sage
#

oh god

winged thistle
#

will use mikero's tools

#

trying to binarize what I can as well

dusk sage
#

Have you not thought of just encrypting the PBO?

winged thistle
#

I would like to but haven't had a lot of luck there

lone glade
#

because you can't.....

winged thistle
#

All the encryption puts the key on the client

dusk sage
#

vs renaming variables and putting code on one line, in any case it'll be better

little eagle
#

Waiting for the day someone uses one time padding.
With one key per function

winged thistle
#

I'm trying to do everything

#

not just a one fix solution

#

@little eagle I actually considered that this morning

#

Then I could obfuscate my keys too

#

Send them from the server

little eagle
#

If you go with otp

winged thistle
#

I know it's not impossible to hack, but I'm trying to make it a huge pain in the ass

little eagle
#

you might as well drop everything else

winged thistle
#

but...

#

I just spent like 16 hours doing it manually...

#

๐Ÿ˜ฆ

little eagle
#

OTP is perfect if you throw away to key

#

I just spent like 16 hours doing it manually...
write a script

lone glade
#

if you want to stop hacking obfuscation isn't going to help.

winged thistle
#

It'll help, but not as much as I want it to

#

Let me just tell the story so I stop getting harrassed.

lone glade
#

no, remoteExec protections and BE do

dusk sage
#

In any way your key(s) are available to anyone

winged thistle
#

Boss wants obfuscation, I explain how it's futile, boss still wants obfuscation, I obfuscate. The end.

little eagle
#

Here is my idea:

  • you put all functions encrypted with one time padding into the mission
  • the server gets an addon with all decryption keys for all functions
  • the server sends those on mission start
  • the client loads the functions from the mission (via loadFile - so no macros / comments)
  • the client applies the correct key for each file and compiles
winged thistle
#

That's what I was planning out this morning lol

little eagle
#

only problem is that one would have to remove all macros

#

because unfortunately the game does loading the file and preprocessing in one step

dusk sage
#

And then you store the decrypted functions?

little eagle
#

only as mission variables

dusk sage
#

So they are readable then

little eagle
#

with tools I guess

winged thistle
#

Everything is readable

dusk sage
#

Well, theoretically no

winged thistle
#

The game still has to interpret the scripts, so people can too

dusk sage
#

If it's stored, then yes

little eagle
#

but you can't use the mission without the server addon with the decryption keys

#

I thought that was the point

winged thistle
#

Yes

dusk sage
#

I was under the impression it's so no one can get ahold of the code

winged thistle
#

And we already have a server addon, so it wouldn't be hard to add

#

People will still have to download part of the mission, but I don't want anyone else hosting it

dusk sage
#

Now it's easier to do

#

๐Ÿ˜„

little eagle
#

I've never done this, but IF you never use macros or preprocessor commands

lone glade
#

if you don't want anyone else to host it it's much easier

little eagle
#

then it should be easy enough

winged thistle
#

What do you guys recommend?

dusk sage
#

I don't think I'm alone in thinking you wanted unobtainable code

#

D:

winged thistle
#

I'm sorry

lone glade
#

I also thought he wanted unobtainable code

winged thistle
#

I thought that was the best way to do it

little eagle
#

No one is gonna copy all scripts from memory with tools to recreate the mission

dusk sage
#

You could use a lot of methods to disallow hosting for others*

winged thistle
#

I'm looking for the perfect method

brazen sparrow
#

^^ good luck ๐Ÿ˜ƒ

dusk sage
#

๐Ÿ’ฉ

#

What confuses me though

#

Is why you'd want this if you plan to release it?

winged thistle
#

That's out of the scope of this channel.

brazen sparrow
#

imo there is no point spending the effort trying to "encrypt" shit, if "they" want it, they will get is somehow

winged thistle
#

And also, it's not my plan, so you'd have to ask the boss.

#

Maca, I agree.

#

For me, all the stuff I have in my server addon should be sufficient to keep anyone from hosting it, but..

#

not my call

#

Back to the point. What, then, is the best way to prevent unauthorized rehosting?

dusk sage
#

Do you plan to release all the relevant files?

winged thistle
#

Everything that they need. Everything else will be on the server.

dusk sage
#

That they need, including server files..?

winged thistle
#

No

dusk sage
#

Very lost

winged thistle
#

They don't need any server files

dusk sage
#

So without the server files, what are they going to host?

winged thistle
#

That's the reason I started down obfuscation and encryption.

still forum
#

sooo... you want to prevent people rehosting files that everyone has access to? I suppose you mean modify and rehost... Whats the use for modifying the client files when not having access to server so not being able to use the modified code

winged thistle
#

I'd like to prevent reverse engineering.

dusk sage
#

They are not going to remake all the server files

still forum
#

remove everything from the client side you dont want to get reverse engineered

little eagle
#

If you release the server addon, then one time padding as I suggested won't help you

#

Because anyone could decrypt that

winged thistle
#

I'd like to ensure that they don't, rather than just assuming. I'm not releasing the server addon.

#

That's all top secret.

#

๐Ÿ˜›

still forum
#

basically people can decrypt everything that arma can still read

little eagle
#

But wouldn't the mission be useless then? Why release it?

winged thistle
#

As I previously stated, Dedmen

#

I'm only wanting to release the client side pbo

still forum
#

yeah.. you cant prevent that... you can make it hard... run it through the obfuscator multiple times ^^

winged thistle
#

Enough for people to play on our server, but not enough for them to rehost.

still forum
#

well.. they would need the server files for rehosting wouldnt they?

winged thistle
#

We're going in circles. Yes. I am aware that they need the server addon.

#

Again, I'd like to prevent them from even reading any of my code or reverse engineering it.

still forum
#

not possible

winged thistle
#

Sure, but next best is to make it as hard as possible.

still forum
#

you could even go as hardcore and push some of your code into an extension to get processed there.. then obfuscate and vmprotect the binary.... but even that can be reverse engineered with enough time

dusk sage
#

So we've gone back to having unobtainable code

still forum
#

as hard as possible... Run it through an obfuscator multiple times.. then pack it with Mikeros paid tools that make the pbo unpackable for most generic unpackers

winged thistle
#

That's already in my plan as I mentioned previously

still forum
#

there is nothing higher than that

winged thistle
#

Cool

#

That's what I was looking for.

still forum
#

^^

winged thistle
#

Thank you. I'll also look into OTP, commy2

lone glade
#

@little eagle should we tell them about mikeros ""obfuscatior"" ?

winged thistle
#

I have it

lone glade
#

tagging @nocturne bluff because he'll surely like it

deft zealot
#

@tough abyss @queen cargo
regarding the isNil generic error here is my code block:

                    private _shiftDirection = if (_offset == 0) then {
                        1
                    } else {
                        _offset / abs _offset // 1 or -1
                    };

                    // Shift
                    private _shiftedLineIndex = _lineIndex;
                    waitUntil {
                        _shiftedLineIndex = _shiftedLineIndex + _shiftDirection;
                        _otherMarkerControl setVariable [QGVAR(lineIndex), _shiftedLineIndex];

                        _otherMarkerControl = _overlapCacheLineIndices param [_shiftedLineIndex, nil];
                        _overlapCacheLineIndices set [_shiftedLineIndex, _otherMarkerControl];
                        isNil "_otherMarkerControl"
                    };
queen cargo
#

weird ... cannot see the issue ...

#

might be a follow up

queen cargo
#

tried removing some other code from the waitUntil? just in case

#

because i also could not spot the problem from here by now

#

but it is 100% not the isNil

little eagle
#

What was the reported error?

deft zealot
little eagle
#
  • squint *
#

It doesn't even give a line number

zealous solstice
#

nop just this

little eagle
#

Do you still have the RPT?

still forum
#

are you sure about that not having a ; ? BIKI doesnt have it in examples 1-3 but it has it in example 4

little eagle
#

You use ; to seperate statements

zealous solstice
#

is it posible that this is because waitUntil and unscheduled env?

little eagle
#

leaving out the ; is used to indicate it being a return value

#

totally optional

lone glade
#

wait

#

are you using waitUntil in unscheduled ?

little eagle
#

is it posible that this is because waitUntil and unscheduled env?
yes, I think so

lone glade
#

because you can't

little eagle
#

^

zealous solstice
#

`23:10:58 Suspending not allowed in this context
23:10:58 Error in expression <shiftedLineIndex, _otherMarkerControl];
isNil "_otherMarkerControl"
};
} else {

23:10:58 Error position: <isNil "_otherMarkerControl"
};
} else {

23:10:58 Error Generic error in expression
23:10:58 Suspending not allowed in this context
23:10:58 Error in expression <shiftedLineIndex, _otherMarkerControl];`

little eagle
#

omg

still forum
#

wow

lone glade
#

:facepalm:

little eagle
#

lol

zealous solstice
#

you can use a waitUntil as a while loop

little eagle
#

not in unscheduled

zealous solstice
#

with a simple return

little eagle
#

the point of waitUntil is to sleep one frame between cycles

lone glade
#

waitUntil suspends the script, can't do that in unscheduled

little eagle
#

^^^

zealous solstice
#

no we dont sleep

little eagle
#

yes, waitUntil does that

lone glade
#

doesn't matter what you wrap it into, can't use it.

little eagle
#

one frame

zealous solstice
#

lol ok

little eagle
#

read it up on the wiki

zealous solstice
#

sinse when?

little eagle
#

sleep, uiSleep and waitUntil are the scheduled env exlusives

#

1.0

#

Since SQF

queen cargo
#

:facepalm:

#

genius

zealous solstice
#

i remeber that worked befor

lone glade
#

oh and also mikero's "obfuscation" can be removed by hand, with notepad

deft zealot
#

but it works if there is only one cycle

little eagle
#

^ nice

deft zealot
#

๐Ÿ˜„

little eagle
#

Not suprised in the slightest

lone glade
#

@nocturne bluff mentionned it a while ago commy

queen cargo
#

have to admin however ... would never have come up with that conclusion ... congrats @little eagle

still forum
#

notepad doesnt handle null chars well... ^^

little eagle
#

I didn't found that

lone glade
#

when he was raging with swifty ๐Ÿ˜›

little eagle
#

alganthe did, I think

queen cargo
#

then congrats @lone glade?

still forum
#

id say congrats to @zealous solstice for actually providing the important line of the RPT ^^

queen cargo
#

ye ๐Ÿ˜ƒ congrats alganthe

#

as i said ... follow up issue ...

lone glade
#

if only BI decided to stop spamming the ever living fuck out of RPTs

queen cargo
#

would be more happy about some propert out-of-arma SQF emulation tool

lone glade
#

or at least make the errors useful

queen cargo
#

mhhh ... maybe i should write one ... mhhh

#

new project idea arrived

winged thistle
#

I'd be happy just for an awesome IDE with error checking

queen cargo
#

there are plenty currently in developement @winged thistle

still forum
#

@winged thistle search youtube for "Arma Studio 2016"

winged thistle
#

Ooooh

#

๐Ÿ˜„

queen cargo
winged thistle
#

lol working title

queen cargo
#

and in case you need some better UI-Editor, i am currently also solving that lil problem

#

even though ... the crash reports which come in are damn useless as nobody adds the notes about how they got to that crash ...

winged thistle
#

Toss me a link. I'll check it out and not be a noob for you.

queen cargo
opal onyx
#

Anyone know if its possible to use something like setObjectTexture on a gui element?

#

Ive been trying to figure out how to get an animation to display on a gui. All i have come up with so far is 90 .paa's and a headache

little eagle
#

Obviously no

#

ctrlSetText is used to set the image path of picture type controls

still forum
#

could use a video and play that in your ui.. that should work

opal onyx
#

hmmm. Might actually work if i can get it to play smoothly. Will give it a shot

velvet merlin
#

what kind of visualization would you guys recommend for selectionNames+selectionPosition and names of the latest cursorTarget model?

little eagle
#

For debugging?

velvet merlin
#

drawIcon3D is much current plan

#

yep

little eagle
#

drawIcon3D definitely

velvet merlin
#

the thing i am worried is when a model has many named selections the overlapping and overlaying will be a mess

little eagle
#

small font and get close I guess

velvet merlin
#

for the names i thought about having them shown with an offset next to the model connected with lines (and use different color for each selection)

#

but no real idea how to set this up properly to have this working dynamically regardless of the number of selections

little eagle
#

or you make it so you can select one memory point at a time

#

with hotkeys

velvet merlin
#

hm good idea

little eagle
#

definitely draw a dot at the exact position

velvet merlin
#

another idea i had was to show the list of selections as a list on the side of the main interface

little eagle
#

e.g. the red collimator dot

velvet merlin
#

one could connect this list and its order to hotkeys to select/highlight the desired one

little eagle
#

format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen],

velvet merlin
#

thanks

#

proper way is to use BIS_fnc_addStackedEventHandler these days?

little eagle
#

addMissionEventHandler "Draw"

#

or onDraw

#

can't remember

velvet merlin
#

well i want to possible to turn it and and off dynamically

little eagle
#

you have to use that one, because OEF would look jerky with draw commands

#

well i want to possible to turn it and and off dynamically

#

exitWith

#

and only add it if you enable it for the first time

velvet merlin
#

i see. good design. thanks again

little eagle
#

Oh and btw. @queen cargo

queen cargo
#

ye

little eagle
#

the onLoad event handlers work for controls

queen cargo
#

its already in the UI editor ๐Ÿ˜ƒ

little eagle
#

I just changed
onLoad = "_dlgNaviPad = _this select 0; {(_dlgNaviPad displayCtrl _x) ctrlShow false} forEach [2, 9];
to two
onLoad = "(_this select 0) ctrlShow false";

#

now I'm trying to figure out how I can abuse this

queen cargo
#

mhh?

little eagle
#

to emulate onLoad events for displays

queen cargo
#

there is actually no real difference between this one and the dialog ones

little eagle
#

yeah, but this can work without having to overload the configs onLoad

#

displays*

queen cargo
#

ahh
so you think about not rly abusing it bur more to use it as weird extension to the UIs onLoad

little eagle
#

Yeah

#

A dummy control for adding custom config based "onLoad" handles

#

because everything must be an event handler

queen cargo
#

IGUIBack with ctrlShown false

#

should do the trick

little eagle
#

or just a text with w and h 0

queen cargo
#

its the same in the end ... so ... ๐Ÿ˜ƒ

little eagle
#

I'll test what can be drawn with the least amount of calculation time

#

probably an empty picture

queen cargo
#

ST_STATIC should be it

little eagle
#

Is that RscText ?

queen cargo
#

but tbh ... you most likely wont feel any difference

little eagle
#

true

#

CBA currently hijacks BIS_fnc_initDisplay

#

But you can't get the class name of displays

#

And some displays use the same string to identify themselves

queen cargo
#

think there was some hacky way to get the IDD

little eagle
#

well

#

ctrlIDD

queen cargo
#

or using that one ... ^^'

little eagle
#

ctrlIDD has a horrible names

queen cargo
#

using it you could search for the display
would take ages though ...

little eagle
#

there are no controls involved in that command

#

using it you could search for the display
multiple displays can share the same idd

queen cargo
#

but using all informations should get some solid results

little eagle
#

"solid" isn't good enough : /

queen cargo
#

lets say it different: if you check every information available, you will be able to find your display 100% of the time unless the dump dev behind created a dup of a dialog

little eagle
#

All RscUnitInfo have idd 300

#

That's like fifty

#

But they obviously have different class names

#

this whole idd and idc concept is BS anyway

queen cargo
#

nah ... it is actually just stupid naming

#

idd => id display/dialog
idc => id control

little eagle
#

yeah, but why not use the classnames?

#

they are unique already

#

no need for ids

queen cargo
#

because magic โ˜

little eagle
#

because lack of logic by the original devs

queen cargo
#

might has some historical reason nobody remembers anymore

#

and nobody ever removed it as ppl are used to it

little eagle
#

I guess numbers are faster

queen cargo
#

we will never know

#

dont think so (not like i assume strings are as fast ... but do not think that was the reason)

velvet merlin
#

internal engine logic is connected to idds and idcs AFAIK

#

you can look at the defines in source configs

#

(not saying its a good system but thats where its coming from)

queen cargo
#

thats known thing
still it could be changed

lone glade
#

any idea how I could check if there's water between two points ?

#

or if a unit can move to a waypoint without obstructions ? I see the AI unnasign waypoints after a while standing still, so I guess it's doable but I don't know how.

little eagle
#

any idea how I could check if there's water between two points ?

#

You mean no land brigde between two points?

lone glade
#

I want to check if there's a body of water between two waypoints pretty much

little eagle
#

well, there could be a pond and you could walk around it

lone glade
#

Pretty much I want to check if the infantry can access the waypoint

#

in this case the units can't get there

#

generation is done using selectBestPlaces

little eagle
#

Its no one liner

#

that much I can tell you

lone glade
#

I could check the median distance between the two points and check the water depth but it wouldn't be accurate :/

#

(i'll add headers later ๐Ÿ˜› )

dusk sage
#

You could iterate across the line

lone glade
#

would be a ressource hog tho.

quick summit
#

Can me anyone show how to say the server to read a binarizes PBO, please

zealous solstice
#

Buy a Mic Plug it in your Server and shout it to him?
maybe try in #server_admins

queen cargo
#

just that there is no other way @lone glade
unless you do it the hacky dll way

vital onyx
#

is someone aware in which order functions with postInit = 1 are executed? just in order they defined under CfgFunctions?

winged thistle
#

That seems to be the case in my mission.

vapid frigate
#

yeh, from my experience that seems to be the case too

#

with preinit at least

winged thistle
#

My mission is finally ready for an alpha test!!! Thanks for helping to all that did.

daring badge
#

Does this format look right? ```if(license_civ_rebel) {
case "rebel":
{
_return = [
["U_O_FullGhillie_ard",["cloth",1]],
["U_O_FullGhillie_lsh",["cloth",1]],
["U_O_T_FullGhillie_tna_F",["cloth",1]],
["U_I_GhillieSuit",["cloth",1]],
["U_O_FullGhillie_sard",["cloth",1]]
];

    };
};```
native hemlock
#

No

#

You have a case without a switch statement

daring badge
native hemlock
#

You would put the if inside of the case

daring badge
#

I've tried that and it works, but each case is a seperate category in the GUI menu and I'm trying to create a seperate category for my "Rebels"

native hemlock
#

You're probably better off looking/asking on the Altis life forums as we don't have the full context or related scripts

daring badge
#

Yeah, I was just seeing if there was a quick format issue. Thanks though

lone glade
#

@tough abyss it does actually, use __EVAL

velvet merlin
#

very cool enhanced marker system - mainly to designate hostiles and friendly
https://forums.bistudio.com/topic/192062-easytrack/

Bohemia Interactive Forums

EasyTrack - posted in ARMA 3 - ADDONS & MODS: COMPLETE: EasyTrack
ย 
โ€‹EasyTrack is a mod for Arma 3 that enables you to use a BFT (Blue Force Tracking) and a RFT (Red Force Tracking) system.
ย 
The BFT is used to track position, type and size of allies.
The RFT is used to trackย position, type and size of enemies.
ย 
Downloads
Download the latest version (1.1.3) here.
WITHOUT signatures, at the time of creation of this thread (06/27/2016).
I will work on delivering a versio...

lone glade
#

problem being that the water could be a small pond, or 300m of ocean

lone glade
#

if only there was a command that was returning BOOL if a unit can access an area or not

#

yeah I figured as much

#

I rolled back my system to BIS_fnc_taskPatrol

#

they do patrol jungles, since I spawn them inside it

#

at least selectBestPlaces stop vehicles from spawning inside shacks, or trees, or walls

proven pike
#

yo guys, anybody know why when packing with Mikero's pboManager, It keeps saying UI.hpp is invalid? :/ (sorry if wrong place to ask)

lone glade
#

check the logs in P

proven pike
#

pboProject*

normal citrus
#

Sometimes I have to press T while looking at an object, for it to display an object name and be able to interact with it. Anyone know why this is and how to get around it?

native hemlock
velvet merlin
#

its about the awareness of an objects and its type

#

you can check with knowsAbout the value

#

via other sqf cmd what type the unit can determine

#

(like from anything-vehicle-car-uaz-uaz_mg-hostile)

normal citrus
#

Sorry for the deleyed response. It was a rough shift at work and I went to take a nap. Thank you for the info.

willow basin
#

I'm tired of programming with Python / C++ for today ๐Ÿ˜ฉ I want to go home and continue with arma scripting ๐Ÿ˜ข

queen cargo
#

@willow basin i am a certified health doctor
you experience mental illness and should go to a professional to let him check your sanity

#

Reason: SQF > Python > C++

lone glade
#

those arrows are in the wrong direction

prime valve
#

lol

west horizon
#

lol

high plume
#

Guys, are there any instructions available for"viewing where ai sees you"? Like a big red arrow marking the position where ai thinks you are/sees you.

jovial nebula
#

Does anyone know a way to count how much time is an entity alive,without involving loops?

lone glade
#

onPlayerResapwn onPlayerKilled time comparison

jovial nebula
#

Does this apply to an agent ?(animal)

lone glade
#

you could save the time when the agent is created and give it a killed EH

#

then compare both

jovial nebula
#

Sweet! Thank you once again

west horizon
#

Where can i get some bodys battle eye guid?

#

not their player id

#

their guid

#
  • With Battleye Extended Controls, is there a way to change it so instead of requring somebodys GUID it requires their player id?
prime valve
#

You can convert Steam UID to BattlEye GUID tho

#

There are free online converters tools for that

#
  • operating admin commands on A3 server requires BattleEye, and BattleEye works with.. BattleEye GUID, so it will still need that kind of ID anyway
west horizon
#

cheers

prime valve
#

๐Ÿ‘

west horizon
#

Does anyone know any programs where someone without dedicated box access could use BEC to whitelist someone for my server?

halcyon crypt
#

@high plume there's a mission somewhere on BIF that does exactly this

high plume
#

@halcyon cryptyeah I thought so. The question is how to find it... bif search is apiece if shit.

high plume
#

I'll Prolly Google it

halcyon crypt
#

Saw your vid about the new environment audio values and stuff the other day, promises some great things! ๐Ÿ˜ƒ

high plume
#

laxeman already uses the commands for his enhanced soundscape. ๐Ÿ™‚

#

@halcyon crypt thanks for the link bro.

uncut frigate
#

Is there any way how i can disable the Tactical Ping?

cedar nebula
#

unbind the key

uncut frigate
#

Is there no other way to disable it? Would like to disable it for a whole Server...

cedar nebula
#

no idea then...

uncut frigate
#

Mhn, thats what i thought aswell ๐Ÿ˜„

#

And in BI Wiki i havent found anything about the TP until now :/

cedar nebula
#

maybe it can be disabled through the difficulty settings?

uncut frigate
#

Thats what my scripter thought aswell but until now we found nothing there....

#

And then i found this here on BI Forum ^^

vital onyx
vital onyx
fallen locust
#

instead of call compile blah blah

vital onyx
#

@fallen locust thanks for advise! Definitely cleaner way :)

fallen locust
#

๐Ÿ˜‰

jovial nebula
#

Guys a little information,does anyone know if deleting a vehicle will set its global variables to 'nil' to avoid broadcasting of useless things?

lone glade
#

it will destroy them of course

fallen locust
#

variables on a vehicles are stored in namespace class in a entity itself so in theory as soon as that base entity disapears all the vars are gone...

#

but its arma so who knows

jovial nebula
#

Lol thank you guys!

queen cargo
#

@jovial nebula variable should then be objNull thing
not nil

#

@fallen locust talks about the variables added to that vehicle

#

if you want the variable nilled out, you have to nil it yourself

fallen locust
#

and there is no point in that

#

as difrences in access times are minor

queen cargo
#

indeed

jovial nebula
#

thanks @queen cargo ,from what i read it doesn't affect performances

queen cargo
#

it does .... but at an impact rate that is so baerly notable ... that you should not bother

#

unless you have like 1000000 variables

jovial nebula
#

got it

#

Only a few xD

#

Uhm what about a way to convert config entries in multidimensional arrays?

queen cargo
#

mhh?

ruby spoke
#

Can anyone help me understand my problem better? I basically have a list of functions defined within a mod/pbo, and a server running that mod. I want to access the functions through a mission's initServer but it doesn't seem to work. Is there any way I can do this or does it just not work that way?

rancid ruin
#

it does work that way, where and how have you defined the functions?

ruby spoke
#

CfgFunctions in the mod pbo

jade abyss
#

That sounds fishy

ruby spoke
#

??? how so?

vital onyx
#

in editor go to functions viewer

#

are you able to locate those functions there?

fallen skiff
#

question about arma 3 editor -- I notice that if you make a scenario wherein you tell bot helis to fly around to certain waypoints, you cannot set desired altitude, speed, manner of flying, etc. The helis fly at a fixed altitude and a fixed speed. Any way to achieve more control over what you want your heli-bots to do?

vital onyx
#

Does not loiter waipoint work for you? tried with APEX's VTOL - worked pretty fine

fallen skiff
#

i tried loiter once, i don't think it recoginzed altitude I gave it, I will try again. What is 'APex VTOL'?

fallen skiff
#

cool

#

i'm trying it with ah9 pawnee

#

perhaps I'm doing it wrong

#

i'll keep fiddling with it

tough abyss
#

Does allowing custom faces on a server impact performance, or is it handled peer-to-peer?

vital onyx
#

if image is under 100kb it is sent to server, every custom face is synced across players once

#

I would suggest that faces should be distributed in the way similar to squad.xml

tough abyss
#

Would make sense, imo. Could be mildly expensive on a large server, then, if a bunch of people have custom faces. Would be nice if it could be toggled client-side and apply a default face for lower end machines.

But good to know, thank you.

vital onyx
#

Is someone aware if it is possible to list files in folder within SQF?

#

like linux ls command

indigo snow
#

No, sqf doesnt have access to the filesystem like that

torn jungle
#

Heya. I need help. Im using Hoverguy's simploe weapon shop script. and the initial money value is in initPlayerLocal.sqf

_player setVariable["HG_myCash",800];

#

im trying to make it so that when you kill a player, money is added

#

so i added the code he posted that should do this. (i put it also in initPlayerLocal.sqf)

#

[] spawn
{
{
_x addEventHandler
[
"Killed",

#

{
private["_unit","_killer];
_unit = _this select 0;
_killer = _this select 1;

            if((isPlayer _killer) AND {_killer != _unit}) then
#

{
private["_oldCash","_newCash"];
_oldCash = _killer getVariable "HG_myCash";
_newCash = _oldCash + 300;
_killer setVariable ["HG_myCash",_newCash];
};

#

}
];
} forEach allUnits;

};

vital onyx
#

@torn jungle use code block to make your snippets more readbale (triple ` will do the trick), like this

   //my code...
torn jungle
#

oh sorry hold on

jade abyss
#

3x ` MyCode 3x "TheSameSignAsBefore"

torn jungle
#

''' test '''

#

test

#

woops wrong thing :p

torn jungle
#

/*
    Add action to player
*/
[] spawn 
{
    {
        _x addEventHandler 
        [
            "Killed", 
            {
                private["_unit","_killer];
                _unit = _this select 0;
                _killer = _this select 1;
       
                if((isPlayer _killer) AND {_killer != _unit}) then
                {
                    private["_oldCash","_newCash"];
                    _oldCash = _killer getVariable "HG_myCash";
                    _newCash = _oldCash + 300;
                    _killer setVariable ["HG_myCash",_newCash];
                };
           
            }
        ];
    } forEach allUnits;

};```
#

thats the initPlayerLocal.sqf

#

so Hg_myCash is the money variable

#

i want it to increase everytime a player kills someone

#

but its not happeningg

vital onyx
#

for multiplayer?

torn jungle
#

yessir

vital onyx
#

try MPKilled event handler for that

torn jungle
#

but will that also work for killing ai (in mp game)? Because i have no one to test it against currently.

vital onyx
#

for AI you may just assigned Killed EH on server

#

because by default spawned AI belongs to server

torn jungle
#

reading the wiki and it says i have to use addMPEventHandler correct?

vital onyx
#

yes

torn jungle
#

still not working. hmmm why isnt the variable changing?

velvet merlin
#

setVariable is local like this

#

you need to add 3rd param for MP sync

torn jungle
#

3rd param?

#

oh hey kju. Trying to learn stuff :-p

versed willow
#

'ello there, scripting noob present with a problem.
I am trying to grab the UID field from a "HandleDisconnect" event, but for some reason it just refuses to work
here's the code I am trying to get to work
(init.sqf)
EventDisconnect = compile loadfile "EventDisconnect.sqf";
EventDisconnectHandler = addMissionEventHandler ["HandleDisconnect", {_this call EventDisconnect}]
(EventDisconnect.sqf)
_guy = _this select 0;
_guyuid = _this select 2;
"B_Soldier_F" createUnit [getPos _guy, group _guy, "this setVariable [""uid"", _guyuid];"]
am I doing some sort of obvious mistake?

versed willow
#

Mind pointing me a bit further?

#

I believe I got the localities right, according to the wiki this is all serverside

native hemlock
#

Well what about it isn't working?

#

I'm guessing the _uid variable isn't being assigned correctly in the createUnit init because that variable is local to the script and the init parameter is executed in a different scope

versed willow
#

Yeah, fixed that bit already, someone else was pointing it out

#

Fixed it by putting it as a format argument

#

oddly enough _guy still gets recognized though and part of the loadout transferred

#

except for the uniform

#

prolly will end up converting the loadout to a string and giving that to the setunitloadout

velvet merlin
#

dont use createUnit init space

#

just use setVar public or pV+pVEH

versed willow
#

nah, I jsut wrote an array2string routine so I can pass the loadout in the init string

indigo snow
#

it works but its literally one of the worst ways of doing it

#

what are you trying to accomplish as first thing

#

is it just applying a loadout to a unit?

versed willow
#

Yeah I am trying to copy the player onto a new unit and have him spawn there again if he returns

#

but respawn normally if his phantom is killed

#

also, my approach actually works pretty great right now, it copies the loadout flawlessly now

#

_arraytostring =
{
_buf = "";
for "_i" from 0 to (count _this -1) do
{
_pick = _this select _i;
switch (typeName _pick) do
{
case "SCALAR": {_buf = format ["%1%2", _buf, _pick]};
case "STRING": {_buf = format ["%1""%2""", _buf, _pick]};
case "ARRAY": {_buf = format ["%1%2", _buf, _pick call _arraytostring]};
};
if (_i + 1 < count _this) then {_buf = format ["%1,", _buf]};
};
format ["[%1]", _buf];
};

dusk sage
#
_arraytostring =
{ 
    _buf  = ""; 
    for "_i" from 0 to (count _this -1) do 
    { 
        _pick = _this select _i; 
        switch (typeName _pick) do
        { 
            case "SCALAR": {_buf = format ["%1%2", _buf, _pick]}; 
            case "STRING": {_buf = format ["%1""%2""", _buf, _pick]}; 
            case "ARRAY": {_buf = format ["%1%2", _buf, _pick call _arraytostring]}; 
        }; 
        if (_i + 1 < count _this) then {_buf = format ["%1,", _buf]};
    }; 
    format ["[%1]", _buf];
};
#

๐Ÿ‘

native hemlock
#

If only there was a toString command...

#

Granted you could be doing something special with yours but it's hopeless reading code on mobile with discord

little eagle
#

_arraytostring

#

_string = str _array

#

: P

native hemlock
#

Ehh but then you keep the brackets

versed willow
#

@little eagle Oh thx, didnt find this earlier

little eagle
#
_string = str _array;
_string = _string select [1, count _string - 2];
#

no brackets

versed willow
#

so I assumed it didnt exist

#

and wrote my own version

#

this makes shit alot easier obviously

little eagle
#

the no brackets method can be used to convert functions/CODE into strings, which can then be compiled into functions again.
there are people who actually use it to reduce network traffic... this saves 4 byte per function or something like that

#

it's crazy

versed willow
#

is that even worth it?

little eagle
#

in my opinion? sending code over net should never be done

#

so no

#

but some people want to have mods without having the users to install anything

#

and then they also don't want to maintain missions

#

so they make a server only addon that sends around uncompiled code

rancid ruin
#

turns out allVariables uiNamespace is pretty taxing

little eagle
#

are you using the debug console?

#

because the problem in those "watch" fileds is that you have to display a huge string

#

which is the slowest part about this and makes it show yellow / red

rancid ruin
#

just ran hint str allVariables uiNamespace once

little eagle
#

same with hint

rancid ruin
#

i think it returned a rather large string lol

little eagle
#

its the displaying a loooong string part

#

I'm not entirely sure, but allVariables should just read the array directly from a variable in C++ land

rancid ruin
#

i went from about 40 frames per second to about 40 seconds per frame

little eagle
#

so it should be rather fast

#

yeah. that's hint though

native hemlock
#

Is str slower than toString? I have a faint memory of using it on an array with thousands of elements and toString was much faster

zealous solstice
#

toString != str

shadow sapphire
#

Is there a way to create indentions in diary entries?

indigo snow
#

spaces

shadow sapphire
#

Ah, that's lame. I'm not above it, I'll definitely do it, but there's no like <BLOCKQUOTE> tricks or anything?

#

I just put spaces inside of my ""?

indigo snow
#

ye

native hemlock
#

Well yes toString != str, but for arrays I can't see why it would be faster to use str and then assign the string to a variable with the brackets removed.

jade abyss
#

Hu?

#

str(123) = "123"
toString(123) = someGibberisch ๐Ÿ˜„

native hemlock
#

Keyword in my previous phrase "for arrays"

jade abyss
#

I ignore those relevant notes.

little eagle
#

str is most likely faster than toString

native hemlock
#

I'm skeptical but can't disprove you for the time being.

willow basin
deft zealot
#

select is faster

zealous solstice
#

toString [65,97,338] == "Aaล’"
and
str [65,97,338] == "[65,97,338]"

#

so this are 2 complet different commands

deft zealot
#
private _array = allVariables uiNamespace;

private _index = floor random count _array;
private _array2 = toArray format ["%1", _array select _index];
_array set [_index, toString _array2];
sleep 1;

_array = _array apply {str _x};
sleep 1;

private _string = "";
for "_i" from 0 to (count _array - 1) do {
    _string = _string + (_array select _i);
};

hint _string;

if (true) exitWith {};```
willow basin
#

But calling that "toString" might wasn't the best idea ^^

deft zealot
#

thats how i would do it

zealous solstice
#

@deft zealot dont troll here ๐Ÿ˜ƒ

lean tiger
#

I'm pretty sure I'm fighting a locality problem here -- does handleDamage have to be enacted on the locality causing the damage?

#

Or can it be the locality receiving the damage

#

Something of a target range, lets say, I'm 0; -ing out all incoming damage, but reporting what limb is hit, and the goofballs are dying in multiplayer

#

Problem is these guys are spawning randomly by the server, and I'm beginning to fear it might be difficult to ensure everything syncs properly :<

velvet merlin
#

hitPartIndex: Number - Hit part index of the hit point, -1 otherwise.
whats the point of this btw?

velvet merlin
#

i see. thanks

native hemlock
#

My mistake, I was thinking of joinString, not toString

jade abyss
#

= )

opal glacier
#

I'm looking for some help with getting a Blackfish to drop a vehicle mid-air
I'm not sure what scripting it requires as
A action ["Unload vehicle",osprey] does not work

outer plover
#

@opal glacier You can use setVehicleCargo on a specific vehicle in crago. So, if the cargo is called "boat1", you can say "objNull setVehicleCargo boat1;"

opal glacier
#

But how do I get it to unload? I already have the vehicle inside of the blackfish, all I want to do is set a trigger to have it eject the prowler on a parachute. I can manually select 'Unload vehicle' from the drivers seat, but I want it to just do it automatically at a certain point.

outer plover
#

You can put that line into the trigger, or you can put "this setVehicleCargo objNull", I think... that should eject all cargo

opal glacier
#

So, I should set the trigger to say this setVehicleCargo objNull prowler; ? For reference the blackfish is titled "osprey" and the prowler is "prowler"

#

Or do I set that script on the blackfish itself?

outer plover
#

No, setVehicleCargo works like this:
vehicle setVehicleCargo cargo

#

so if the Blackfish is called osprey, and the cargo prowler, you'd say "objNull setVehicleCargo prowler" in the trigger. You don't actually need to know the name of the carrier, just the cargo.

#

You can also do it "generic" like
{objNull setVehicleCargo _x] forach getVehicleCargo osprey;

#

That would eject all cargo from the carrier named "osprey"

#

ah, and } instead of ]

opal glacier
#

for each instead of forach as well?

outer plover
#

{objNull setVehicleCargo _x} foreach getVehicleCargo osprey;

#

Fixed ๐Ÿ˜ Sorry, haven't eaten yet ๐Ÿ˜„

opal glacier
#

haha, i know the feels, lemme give this a shot real quick

#

HAH! Success! Thank you so much!

#

I just started building missions 2 days ago and it's a pretty steep learning curve. I'm on my 3rd mission now and I'm trying to challenge myself by making each one more difficult to build

outer plover
#

Heh, yeah, scripting can be scary if you don't have experience with it

opal glacier
#

It's very exciting to learn though, idk, maybe its just the sense of pride seeing all these systems working together and knowing you made it happen.

#

Now, is there a way to remove the player's ability to jettison the vehicle to prevent a premature ejaculation

#

Also, how do I get the Blackfish to open its cargo ramp??

vital onyx
opal glacier
#

Hmmm, so how do i figure out what BIS titled the blackfish's cargo ramp?

#

Because according to that I need something like "cargo ramp animateSource ["Door_1_source",1]; //Open"

#

""osprey = this; osprey animateSource ["Door_1_source", 1, true];"" does not work :/

vital onyx
#

Check Blackfish config

#

under AnimationSource class

opal glacier
#

user

#

sorry, wrong chat, ill check that

#

ehhh where would I find that? I cant seem to find much information on the blackfish on that site

velvet merlin
opal glacier
#

Oh sweet tits, Thanks!

#

So how do I find the names for the blackfish cargo door n such?

#

Damn, this is really kicking my ass, I'm trying another script with no luck, here:

#

osprey = this; osprey animateSource ["Door_rear_source", 1, true];

zealous solstice
#
  1. issue is that you with this script only can use one osprey at the same time
vital onyx
#

does anyone has a marco cheat sheet? I am aware of simple stuff from BiKi - but interested in more complex macro with explanations (like I've seen for example in CBA)

velvet merlin
#

dont

#

simple as that

little eagle
hallow spear
#

when remoteExec says the return value can be "anything", does it mean something like this would ever work? _Knownvariables={_vars=allvariables player;_vars;} remoteExec ["bis_fnc_call", owner _player];

#

how can I share global variables from a client to the server? is using the 'true' statement with the setvariable command necassary?

little eagle
#
  1. owner only works on the server machine
#

A dedicated server has no player though

#
  1. remoteExec only has a return value if the third right side parameter (jip id) is used. it returns a jip id STRING
#
  1. remoteExec does not send back the return value to the machine were you executed it
#

I think this is what you want:

[player, {
    params ["_origCaller"]

    _allVariables = allVariables player;

    [_allVariables, {
        params ["_allVariables"];
        {
            systemChat _x;
            diag_log _x;
        } forEach _allVariables;
    }] remoteExec ["call", _origCaller];
}] remoteExec ["call", _player];
#

Or do you have to have "allVariables" from that remote player as return value in your function? That can be done too, but it's a tiny bit more complicated and requires your function to be executed in suspendable environment

hallow spear
#

ya, im trying to get the list of variables from a client player, and check them against a master list to see which ones the client has and what there values are. its helpful to see how you remoteExec in the remoteExec

#

thanks

little eagle
#

Don't do stuff like that if you have many players though

#

CODE is send as string and those get huge quickly

hallow spear
#

is it better to create functions and have those remoteExec?

little eagle
#

yes. then only the functions name has to be send

#

the same principle can be used though. Just that "call" get's replaced by the functions name

#

you have to make sure that the functions are defined on every machine though

hallow spear
#

awesome, i can see what i need to do now. ty

velvet merlin
#

anyone has experience with cam scripting in A3?
i am trying some stuff, but it seems BI broke various parts of it

celest rivet
#

Has anyone been able to make buildings indestructible? It worked in ArmA 2 yet not in ArmA 3. We've tried multiple ways and this is our most recent way;
test = nearestTerrainObjects [[0,0,0], [], 9999];
{
_x allowDamage false;
_x addEventHandler ["HandleDamage", {0}];
} forEach test;
....please help

native hemlock
#

On what map? Because 9999 wouldn't be enough to get every object, but that's kind of a crappy way to do it

#

Your current method in theory would cause every terrain object on the map to be indestructible. I would also think that just the allowDamage false should work without the HandleDamage event handler

celest rivet
#

It's plenty on Stratis which is only ~6,649 from our current position/location. What would be a non-crap way? And that's correct. We want any terrain objects to be indestructible. Really just buildings and walls (but ofc BIS doesn't allow walls :()

native hemlock
#

So does your current method work for any objects? I'm curious which of those type names walls fall under for nearestTerrainObjects

celest rivet
#

No it does not work for buildings

#

reading..

#

ya

native hemlock
#

I didn't know that until now, but that was from 2013 so maybe there is a way

celest rivet
#

read that previously and the point in my first message/question was that we've tried both but I could've been more clear

#

neither worked though was what I meant ๐Ÿ˜ฆ

#

The Feebback tracker site was down for the past 6 months or whatever so we were unable to effectively report/complain/request fixes if that is STILL BROKEN since 2013?!

native hemlock
#

Have you been testing this in both MP and single player (editor)?

celest rivet
#

Only MP as it's all that matters

native hemlock
#

Is every client executing that or only the server?

celest rivet
#

onlocal

#

so every client and server

winged thistle
#

As of right now, I'm just trying to get it to work from the debug console with a global exec

#

Implementation will come later

native hemlock
#

I'm assuming you two are working together. So you are global executing the whole block of code Reason posted? Which included assigning the test variable for nearestTerrainObjects

winged thistle
#

Yes

#

Just trying to get it to work on buildings within range

#

then I'll focus on tweaking my array

#

The focus here is the handle damage bit

native hemlock
#

And how are you damaging the building?

winged thistle
#

Charges

celest rivet
#

explosive charges placed and not through script

native hemlock
#

Yeah you guys seem to know what you are doing and have all of the gimmicky things covered so I'm leaning towards it not being possible

winged thistle
#

Welp

#

We tried

#

Thanks for your help!

native hemlock
#

I'm very doubtful of this working but you could try returning false instead of 0 for the HandleDamage event handler.

#

Hopefully someone else will come along and be able to offer more insight

dusk sage
#

I don't think false or 0 makes a difference for the HandleDamage EVH

#

From past testing

native hemlock
#

Yeah you're probably right

halcyon crypt
#

I guess it's faster to ask here than booting up A3 ^^

#

does if (<some condition>) exitWith { /* some code */ } else { /* some code */ }; work?

jade abyss
#

Test it?

halcyon crypt
#

okaaayyy

jade abyss
#

if (true) exitWith {hint "Yes"} else {hint "Nope"}; <-- ??

#

5s thing and you can answer that yourself ๐Ÿ˜‰

halcyon crypt
#

if (false) exitWith { diag_log "1" } else { diag_log "2" }; => error in expression

#

guess not ๐Ÿ˜ฆ

native hemlock
#

Yeah you can't use else with exitWith

#

As you now know ๐Ÿ˜ƒ

deft zealot
#

cause it doesnt make sense at all

halcyon crypt
#

it made sense to me when I wrote the code that uses it.. โ˜€

deft zealot
#

its like if (true) then {<some code>};

halcyon crypt
#

well I need the exitWith to break from the current scope

#

but

deft zealot
#

and you need the else for what reason?

native hemlock
#

You don't need else because that code would only execute if it didn't exit

halcyon crypt
#
    /* some code */
};

/* some code that would be in the "else" */```

works ๐Ÿ˜ƒ
#

kinda weird thinking on my end ๐Ÿ‘

deft zealot
#

glad you got it ๐Ÿ˜ƒ

halcyon crypt
#

would love to have the break and continue keywords though.. ^^

#

any way to detect if we're in scheduled or unscheduled space?

#

like if (<unscheduled>) exitWith { diag_log "This needs to run in scheduled space" };

versed willow
#

Yo, it's me again, just got a few question about namespaces and how persistent they are

#

I am trying to save a players inventory when he is disonnecting, so I found you can save stuff into namespaces

#

are they behaving differently in client and server contexts?

#

and if so, how do I make sure that I stay on the server?

#

I tried saving into missionNamespace, as I read that's where all the other global stuff gets saved

#

looks something like this:
(EventDisconnect.sqf)

_guyuid  = _this select 2;
if (_guy in safeUnits) then {
    missionNamespace setVariable [_guyuid, [getUnitLoadout _guy,_guy getVariable "face", _guy getVariable "speaker"]];
}```
#

okay I think I almost got the problem

#

apparently my loadoutscript is executed locally on the client

#

any way I can pull my required info from there?

#

Possibly without making it public?

jade abyss
#

profilenamespace

versed willow
#

that's saving it on the client tho innit?

dusk sage
#

Yes

vocal mantle
velvet merlin
#

@versed willow profilenamespace on the server; better use a DB though

steep matrix
#

is there a way ingame to determine via sqf what RES LOD is shown for a given model?

little eagle
#

no

vital onyx
#

Guys, can you please remind how to refer to a current MP mission's file from addon's functions? I need to read params from current mission's description.ext, thanks!

indigo snow
#

missionConfigFile

#

or the one new command

#

getMissionConfigValue

vital onyx
#

great! thanks a lot @indigo snow

#

but if a want to read a specific sqf file from mission?

#

found - \mpmissions__CUR_MP.Stratis*

#

Killzone Kid's articles are awesome

indigo snow
#

you can access files in the current mission natively though

#

\scripts\myscript.sqf would be a file called myscript.sqf in the scripts folder inside your mission folder

#

only some commands have issues with this

fluid garden
#

so every time i need to use this command?

indigo snow
#

yes

fluid garden
#

is there a way

#

like i can change my default uniform to the new i made

indigo snow
#

it would require some more advanced scripting

fluid garden
#

okay. I have made the paa file. So now where should I place that file

#

and where should I use this script

#

??

indigo snow
#

im sorry, i dont have time to teach someone entirely new to scripting

fluid garden
#

ohh

indigo snow
#

read up some tutorials, the wiki and read up

fluid garden
#

ok bro

#

thanks for helping me this much

vital onyx
#

@indigo snow in case of execVM called from mission's script yes, but I need to access it from addon's function

indigo snow
#

That sounds dangerous - it would cause errors if the user played a mission without that file present

vital onyx
#

if you are a server admin and mission author at the same time - then it is fine

indigo snow
#

why are you execVM ing a mission side script from the addon then?

#

triggering a mission side EH seems safer regardless

#

the addon is the one executing

#

the file is present in the mission

#

it should work, its just an unwieldy way to go about it i guess

vital onyx
#

one of the idea why one may need it: HC is storing complex AI behaviour logic and fsm in addon to reduce mission size, and params for that execution should be stored in mission

#

and missionConfigFile is not always best place for it (for example when we talk about rather large arrays)

#

anyway probably will find a better approach

#

but need it for prototyping

ruby spoke
#

hey sorry to interrupt but I'd like to know what are the main uses and benefits of fsm's?

vital onyx
#

complex logic

#

more handy than tons of if-then-else contructs

ruby spoke
#

are there any good tutorials or guides online I could read up on arma related fsm?

#

oh nvm there's a wiki page lol

vital onyx
ruby spoke
#

okay thanks a lot ๐Ÿ˜ƒ

#

I'm assuming the main benefit is neat coding?

indigo snow
#

The main benefit is actually that it lives in its own scheduler

#

FSMs run in a different portion of the frame than SQF scripts

ruby spoke
#

Ohhh I see, that's interesting

#

btw does anyone know what happened to the extDB2 wiki?

vital onyx
#

it is allright

#

it is ExtDB3 now

ruby spoke
#

oh wat

vital onyx
ruby spoke
#

:0 why wasn't I aware of this hahaha

vital onyx
#

subscribe to torndeco's topic on BI forums ;-)

warm lintel
#

Could someone please tell me why I can't get this simplistic trigger to work (other than the obvious reason of my being thicker than the proverbial 2 short planks)? I've got 9 units in a 200m trigger, 8 of whom have a waypoint to move out. What I need is to detect when the unit count drops below 5 and perform an action when that happens. The specific numbers aren't really relevant, its just for testing & trying to understand how this works.

Trigger1
OPFOR PRESENT

Cond: This

On Act: opcounter = ({side _x == OPFOR}count thislist); hint format ["%1! %1 OPFOR! AHH AHH AHHH!",opcounter];

Trigger2
No activation

Cond: this

On Act: if (opcounter <= 5) then { hint format ["New count is %1", opcounter]};

I've tried with repeatable on & off with both triggers but nothing seems to update, I can read the counter with a hint from the debug console but it's stuck where it started. Any ideas what the hell I'm doing wrong? If you make a variable in a trigger, can you not use it outside of that trigger?

distant egret
#

Try using East I don't think opfor works.

#

Scrap that it works :)

#

Why do you use if statements on your on act?

#

You can put that in the condition.

warm lintel
#

I wasnt able to get them to work in the condition, it kept complaining it expected an array but I gave it a boolean (or maybe the other way around). Is the usage in the condition just if (opcounter <= 5) & the rest of the onact/ondeact funtioning as the 'then/else'? That'll be cool if so but it doesn't sound like it'll help the no updating counter thing

distant egret
#

condition = like a waitUntil
On Act = do this when condition has been met
On Deact = Do this when condition is not met anymore

#

So if opfor enters a trigger the on Act will wait until the condition is met with what you put in.

#

if it activated, and after a while the condition is not met anymore it will do the on deact code.

warm lintel
#

So if I wanted to do something like checking enemy numbers in a town & getting them to retreat when they're down to say 10 men, I'd set up the enemynumber counter to get their full number in one trigger (would setting it to repeat & have a countdown of 1s keep the info current?) then in the other trigger I'd be best off having the condition 'while enemynumber >10', the onact as something like setting them to combatmode red & the deact setting them to combatmode blue, speed full & assigning a retreat waypoint?

distant egret
#

You can do it with 2 triggers, both on the same place same size, first one checks if the enemy is there, when they are there, a global variable will be set like 'enemiesHere = true;'. In the 2nd trigger in the condition use 'enemiesHere && (({side _x == east} count thisList) < 10)'. and then use on act some code for them to retreat.

#

So if the enemies go in the trigger zone slow, it wont trigger the retreat to straight away.
This is what you mean if it understand you correctly.

warm lintel
#

Its plenty enough for me to have another go with in the morning. Cheers mate

fluid garden
#

can someone please help me out

indigo snow
#

what is your specific question?

fluid garden
#

I have made retexture file

#

paa format

#

I want to use it ingame

#

but I am unable to

#

can you please help me over tv

indigo snow
#

why are you unable to?

fluid garden
#

I am placing it in a new folder MyAddons

#

and then using this command

indigo snow
#

are you making it an addon?

fluid garden
#

player setObjectTextureGlobal [0, "\MyAddon\blue.paa"];

indigo snow
#

where is this folder?

fluid garden
#

I made this folder inside the arma 3 folder

indigo snow
#

if youre using it in a mission, it needs to be in the mission folder

fluid garden
#

okay

#

and what command I should use

#

??

indigo snow
#

setObjectTextureGlobal

fluid garden
#

I have used this command

#

but nothing happened

#

I used

indigo snow
#

was the file in the mission folder at the time?

fluid garden
#

this setObjectTextureGlobal();

#

yes the file was there

little eagle
#

Command doesn't work for soldiers. texture depends on the uniform alone

fluid garden
#

ohhk

indigo snow
#

(uniformContainer player)

fluid garden
#

so how to change it

#

in a tanoa life server

#

i will use it

little eagle
#

make a custom uniform. will require a mod

fluid garden
#

ohhk

#

can't i just re texture it??

little eagle
#

@cptnick the uniform container does store the items, but has itself no model

fluid garden
#

maybe can i re texture a default uniform

indigo snow
#

Ah so thats the trick

little eagle
#

You can retexture it, but only by making a custom uniform via addon config

fluid garden
#

okay can you let me know how to do that

#

I know all about making paa and pbo

#

but i don't know about configs

little eagle
#

First of all, these configs cannot be done via mission

#

is that a problem?

#

@indigo snow Just do typeOf uniformContainer player You will notice something if you ever wrote a config

fluid garden
#

I will use it in a tanoa life server

little eagle
#

Yeah. Those run vanilla usually or am I wrong?

fluid garden
#

I don't know much

little eagle
#

No mods the user has to install

#

I don't know how life works either

#

"life"

fluid garden
#

ok

#

do someone else know

#

??

little eagle
#

But I do know how to write a uniforms config

fluid garden
#

okay

#

please help me out in that

indigo snow
#

man commy im pretty sure if you setObjectTextureGlobal on a unit it textures their uniform

#

player setObjectTextureGlobal [0,"#(rgb,8,8,3)color(0,0,1,1)"]

little eagle
#

what if the soldier drops the uniform?

indigo snow
#

Yea youll need a ton of extra scripting

#

I read a thing by KK where he did it

#

Some inventory EHs and saving to the uniform containers iirc

little eagle
#

won't help you when addUniform is used

#
    class U_B_CombatUniform_mcam;
    class My_Custom_CombatUniform: U_B_CombatUniform_mcam {
        hiddenSelectionsTextures[] = {<PATH TO CUSTOM TEXTURE>};
    };
#

^ config

fluid garden
#

where do i need to put this config??

little eagle
#

into an addon in CfgWeapons

fluid garden
#

then where will i find this uniform

#

??

indigo snow
#

addUniform would be the exception, but then again, im assuming that will be an in mission script you can control unyway

#

seems a little too advanced for this dude tho

little eagle
#

then where will i find this uniform
player addUniform "My_Custom_CombatUniform"

#

probably also the arsenal

fluid garden
#

okay

#

bro can you help me over TV??

little eagle
#

Yeah. I'm pretty sure you don't want an addon if you are running "life"

#

no, no time for that, sry

native hemlock
#

Retextures can be included in mission files and just used with setObjectTexture or setObjectTextureGlobal

little eagle
#

what if the soldier drops the uniform?

indigo snow
#

check the EH on the wiki for setObjectTextureGlobal

#

it gets saved to the uniformContainer belonging to that uniform

#

However i would say this probably quickly becomes a scripting nightmare on a Life server

native hemlock
#

If they dropped it I believe they would lose it so you'd have to use one of the various inventory event handlers to reapply it

tough abyss
#

I'm testing out the Arma 2 editor and i'm stuck on spawning people on trigger, the trigger works but the spawning in doesn't here's my code:
GroupSquad1 = [getMarkerPos "Spawn", east, ["TK_INS_Soldier_TL_EP1","TK_INS_Soldier_3_EP1","TK_INS_Soldier_4_EP1","TK_INS_Soldier_AAT_EP1","TK_INS_Soldier_MG_EP1","TK_INS_Soldier_AR_EP1","TK_Soldier_Medic_EP1","TK_Soldier_EP1","TK_Soldier_AA_EP1","TK_INS_Soldier_TL_EP1","TK_INS_Warlord_EP1","TK_INS_Soldier_MG_EP1"]] call BIS_fnc_spawnGroup;

little eagle
#

If they dropped it I believe they would lose it so you'd have to use one of the various inventory event handlers to reapply it
ok. what if addUniform is used

native hemlock
#

I'd imagine there should be more information on the Altis life forums with guides as well

#

Then you set the texture on the next line of code

little eagle
#

so edit every line where addUniform comes into play?

#

What if you don't have access to that part. If it's from a third party

#

it's a huge mess

native hemlock
#

If it includes your retextures uniform then sure

#

Yes it is

little eagle
#

also

#

You can store the texture on weapon holders

native hemlock
#

Hence why it would be better as an addon like you suggested, but some people are trying to work around only including things in a mission file

little eagle
#

but what if you put multiple uniforms into the same weapon holder?

#

What if two guys access the same weapon holder at the same time. This whole thing is a gigantic mess.

#

I mean there are people who don't care about such things, because they don't happen regularly

#

But I don't think this hacky work around is any good

little eagle
#

@fluid garden

This is the best I can come up with:

init.sqf

My_fnc_addCustomUniform = {
    params [["_unit", objNull, [objNull]], ["_uniform", "", [""]], ["_texture", "", [""]]];

    _unit addUniform _uniform;

    if (_texture != "") then {
        _unit setObjectTextureGlobal [0, _texture];
        (uniformContainer _unit) setVariable ["custom_texture", _texture, true];
    };
};

0 spawn {
    waitUntil {!isNull player};

    player addEventHandler ["Take", {
        params ["_unit"];

        private _texture = (uniformContainer _unit) getVariable ["custom_texture", ""];

        if (_texture != "") then {
            _unit setObjectTextureGlobal [0, _texture];
        };
    }];
};

And then, whenever you would use addUniform, you use this instead:
[player, "U_B_CombatUniform_mcam", "#(rgb,8,8,3)color(1,0,0,1)"] call My_fnc_addCustomUniform;

#

drawbacks:

  • Take event handler does not work after team switch and does not work with zeus remote controlled units (I don't think those happen with "life" though)
#
  • You have to replace every addUniform with this one.
dusk sage
#

Life works around applying textures to the players uniform based on the players status/variables

#

So it's not specific to the uniform itself, as it could differ from player to player, based on their 'rank', for example

fluid garden
#

okay

#

thanks a lot guys

dusk sage
#

My internet cut out before I finished. I was saying that a 'fn_playerSkins' function is called to reapply textures, in pretty much any event where uniform would change

fluid garden
#

so what you sugest me bro

#

how should i make the retexturing

dusk sage
#

I suggest you look at the other examples in the file and work from them

fluid garden
#

okay

#

thanks bro

patent oar
#

can anyone tell me why 'getText(configFile >> "CfgVehicles" >> (typeOf cursorTarget) >> "vehicleClass");' returns "container" but when im standing next too the cursorTarget (a container) 'nearestObjects[getPos player,["Container"],10];' returns '[]'

indigo snow
#

nearestObject looks for typeOf not vehicleClass

#

(typeOf cursorTarget)

dusk sage
#

You could use inheritsFrom in conjuction with nearestObjects, also

runic schooner
#

Des francais ? :<

#

my EN is so bad but i try, i need help

#

if (not isDedicated) then {
[] spawn {
waitUntil { alive player };
player addEventHandler ["KILLED", {
[] spawn
{
private ["_leader", "_spawnPos"];
waitUntil { alive player };
_leader = leader player;
if ((alive _leader) and (player != _leader)) then {
// Move the player just behind the leader, but ensure they arrive on the ground.
_spawnPos = (vehicle _leader) modelToWorld [0, -5, 0];
_spawnPos set [2, 0]; // Ensure respawn on the ground.
player setPos _spawnPos;

#

This script for spawn a player on LeaderSquad is work, but i need change this script for : no respawn if leader is dead.

#

someone can help me ?

#

ty !

#

( Actually, if leader die, he spawn on BASE or on BODY )

deft zealot
runic schooner
#

i don't script, i don't know what i can do with that ๐Ÿ˜ฆ

#

but thx for your help ;o)

vital onyx
#

question: we have a static weapon (mortar, titan, hmg) - when we disassemble it - how the remaining ammo is stored? is there any getter for remaining ammo on disassembled static weapon?

patent oar
#

thx ๐Ÿ˜ƒ

opal glacier
#

I believe the remaining ammo is automatically attributed to the weapon itself. IE the backpack with the gun. not the bi/tripod

vital onyx
#

yep, but is there a way to get it from backpack?

agile pumice
#

dialog related question, is it not possible to "overlay" dialogs? I'm trying to create 2 dialogs on top of each other, the first with a background and the second without, but I can only see the second one (without the background)

marsh lodge
#

I do not know much about creating dialogs, but based off of minimal reading, I would make sure they are on different layers

vital onyx
#

there can be only one dialog at the same time

#

if you want to simlate one dialog atop of another - you may try luck with rsctitles

vital onyx
#

just discovered that camera streaming to texture, does not render billboard and VR objects

vital onyx
velvet merlin
#

@vital onyx how can you be bored? ๐Ÿ˜› (serious question)

queen cargo
#

how was that realized?

#

@vital onyx any info?

shrewd lichen
#

You were really bored

#

I guess script changed images on display

#

So yeah, really bored ๐Ÿ˜„

barren magnet
#

#Its a video texture

split coral
barren magnet
#

That intel inside made it work !

shrewd lichen
#

loool

#

im so jelous

#

I never get fun with scripts

#

usualy i'm just trying to fix something cause "ARHG ITS STILL NOT WORKING AND ITS 2 AM"

#

๐Ÿ˜›

split coral
#

My scripting is usually not very goal oriented, just messing around in the editor aimlessly. So the 2am debugging is actually the fun part for me.
If I were really trying to produce something proper stuff, I'd probably rage quit way before.
It's the journey...

shrewd lichen
#

Love it though, right? ๐Ÿ˜‰

split coral
#

that's all I do nowadays.

#

Because, apparently, i don't have the time to actually play the game. But still manage to find about ten hours a week to play scripter. ๐Ÿ˜„

shrewd lichen
#

I got kinda rusty

#

Didn't make much missions since ARMA2

full kindle
#

@split coral thats clever and accurate - only thing was missing and that is VR - HTC Vive in there

split coral
#

Thanks, RH

vital onyx
#

@barren magnet not a video texture, simple rtt

#

@queen cargo that's the puzzle from me ;)

#

@queen cargo in general - script only

#

@velvet merlin when you have to make some basics for your missions, which you expected game developer should do.

#

@shrewd lichen nope, every letter is indivudual, this is kind of wip

shrewd lichen
#

Nicely done then

night void
#

Hey guys, how i can make soldiers walk on walls?

#

likes he have sticky shoes/boots

queen cargo
#

by doing magic @night void

night void
#

@queen cargo how it magic looks?

vital onyx
#

has someone tried changing textures for objects created with CreateSimpleObject?

#

with SetObjectTexture

zealous solstice
#

i think that dont work

#

because the sources from setObjectTexture is in the config under hiddenselections

vital onyx
#

from biki

#

Description:
Create object with given shape defined as path to .p3d model. Supported LODs include Geometry, Fire Geometry, Roadway, View Geometry and ShadowVolume. Supported features include collision, texturing, animation, penetration, AI spotting occlusion, and surface specific sounds (like footsteps). Unsupported features include PhysX, damage, AI pathfinding (causes walking through walls), and built in lights.

#

so textures are supported only defined and stored in model itself?

rancid ruin
#

you texture the hidden selection of the object, not the object itself

#

but not every model has texturable hidden selections

#

how could i generate a string containing all latin characters, numbers, and all cyrillic characters?

little eagle
#

by typing them

#

or copy them from somewhere

rancid ruin
#

sounds like hard work

little eagle
#

Well, Arma has no function for something like that afaik if that was your question

elfin bronze
#

I am using an sql query which is resulting a text field but not recognized by extdb2 as a text field.. therefor the result is something like [5,0,123456,my text here] and of course arma give me an error "my" is not a variable. An idea how to make sure extdb knows it's a text field? (it's a select with UNION etc), thank !

tough abyss
#

Anyone figure out if it's possible to dig into dev branch files to examine the co-op campaign missions, export emblems, ect?

native hemlock
#

@elfin bronze is that your returned array?

elfin bronze
#

yes

native hemlock
#

And you want the last index to be a string? Just do something like "str (_this select 3)"

elfin bronze
#

@native hemlock nah it's bugging before this... extdb probably tries a compile so it's getting an undefined variable on that string before it's not a quoted string

native hemlock
#

Well does it have quotes in the SQL database? There is some specific things needed for escaping quotes with extDB

elfin bronze
#

no there is no quote on the DB (using this DB with other apps/web interface, etc) but it's working good with varchar and string but here it's a string with a UNION so it's not knowing it's a string anymore.. anyway to tell him "that field is to be threated as a string"

native hemlock
#

I'm not sure then, when I messed around with extDB2 I never did any unions. Torndeco is still active but has released a new version (extDB3) so it might be worth trying that and contacting him

elfin bronze
#

He's not responding

native hemlock
#

lol well I didn't necessarily mean right now

elfin bronze
#

I sented a message last Sunday

tame portal
#

Okay

#

What exactly is happening here

#

I fetch a variable from a vehicle

#
_originalData = (vehicle player) getVariable ["mav_tuning",[]];
#

then some lines below edit the original data array

#
    _toEdit = _originalData select 0;
    _toEdit set [_poolIndex, if ((_toEdit select _poolIndex) == 0) then {1} else {0}];
    _originalData set [0, _toEdit];
#

and the variable on the vehicle changes

#

although I never do setVariable to overwrite its value

dusk sage
#

If this is true ^ @tame portal

You've just solved me a big headache

tame portal
#

It is...

#

I dont know why its doing that

dusk sage
queen cargo
#

@tame portal @dusk sage arrays are mutable objects in SQF
the changes also are not broadcasted over the network

see following exampl

_arr = [];
_arr2 = _arr;
_arr2 pushBack 1;
hint str _arr; //will be [1]

as the vehicle is just another namespace, it behaves the same

#

if you want a copy of given array, just add a +

#
_arr = [];
_arr2 = +_arr; (creates a copy of the array)
_arr2 pushBack 1;
hint str _arr; //will be []
tame portal
#

I actually did not know that

#

I assumed given that it always creates copy it would also do the same with arrays

queen cargo
#

doing so, SQF would be slow as fuck when working with arrays

dusk sage
#

But in the case of getVariable, on an object, as in the example above, it would seem the changes are broadcast

queen cargo
#

thast should not be possible actually @dusk sage but could be

#

though ... it is heavily unlikely

dusk sage
#

I used a vehicle init to set the variable

#

And checked it

#

Also works in MP