#arma3_scripting

1 messages ยท Page 344 of 1

peak plover
#

IT can be number right?

#

๐Ÿคฆ

#

I was scrolled down too much

#

I have a function that checks local _target before doing remoteExec

#

I just do a check if typeName _target isEqualTo "SCALAR"

still forum
#

you are still using typeName ?!

#

isEqualType

peak plover
#

๐Ÿ˜ฎ

#

Oh god, thanks

#

it can also be side for remoteExec

#

whoa

#

if !(_target isEqualTypeAny [0,west,(allgroups select 0)]) then {
still forum
#

Neat.. Never had a use for isEqualTypeAny myself yet

peak plover
#

Tsh, allgroups should be grpNull

#

ohh, checking for those is stupid. I can just (_target isEqualType objNull)

#

sick command

#

implemented that shit into like 5 functions

#

brining it up to 2015, one command at a time

still forum
#

ICQ?

#

Commy is broken. Can't even spell params correctly anymore

peak plover
#
_unit = _this select 0;
if !(isNil "_unit") then {
    if !(isNull _unit) then {
        //CODE
    };
};

?

still forum
#

there is &&

#

if (!isNil "_unit" && {!isNull _unit})

peak plover
#

{ } is new?

still forum
#

no

little eagle
#

2012 new

peak plover
#

probably have not seen it much because it's not on wiki...

little eagle
#
params [["_unit", objNull]];

if (!isNull _unit) then {
peak plover
little eagle
peak plover
#

very nice hack

#

I like it

little eagle
#

I like the params version more.

peak plover
#

I also like params

#

valuable

spice kayak
#

So, potentially silly, but does anyone know how the scoring system works? For example, if an enemy unit was using a friendly vehicle, and PlayerA uses an AT to destroy said vehicle with said enemy in it, would they be rewarded a combination of negative and positive points, or would the game recognize the vehicle as being enemy and reward positive score overall?

little eagle
#

If an enemy uses a vehicle, the vehicle is not friendly, it's enemy.

spice kayak
#

Thank you for the clarification. Does it stay marked as enemy even after they dismount?

#

'Marked' might not be the best word, but you get what I mean. Is it still classified as an enemy's vehicle.

little eagle
#

Empty vehicles are neutral.

peak plover
#

Instantly?

spice kayak
#

Yeah, that's what I'm wondering. I'm doing a sort of TvT, but in my attempt to balance it, I'm giving both teams Prowlers, even though one doesn't normally have access to it. I was just hoping that if Blufor destroy's Independent's Prowler, it doesn't affect them badly, because it's their vehicle.

peak plover
#

Add a getout eventhandler that sets a last_used_side variable, then add a onKilled to that vehicle

#

addRating based on what's what...

spice kayak
#

Yeah, I'd never really used addRating, but I might have to look at it now. Thank you.

peak plover
#

Have fun dude

spice kayak
#

Thanks!

rotund cypress
#

''implemented that shit into like 5 functions'' @peak plover when you repeat something that many times you should make a function

#

Follow DRY

little eagle
#

functionception

spice kayak
#

So, despite my mission working fine initially, for some reason whenever I capture a sector, I get two notifications instead of one. I haven't changed anything in that regard, which is rather odd.

little eagle
#

MP?

spice kayak
#

Yes.

#

It's been purely tested in the MP enviroment since it started.

#

I've experienced similar things with notifications in the past, though I'm not sure when it occurs or why.

little eagle
#

Maybe the function that shows the notification shows the notification on every machine.

#

And the function that executes the function that shows the notification is executed on every machine.

still forum
#

And the function that executes the function that executes the function that executes the function that executes the function that executes the function that executes the function that executes the function that executes the function that executes the function that executes the function that executes the function ...

little eagle
#

Then you would have N duplicate notifications where N is the number of connected machines.

#

Dedmen, please go back to disproving ________

spice kayak
#

You might be right. Just odd that it started happening seemingly randomly.

little eagle
#

Note that I'm not saying that the function that shows the notification does show the notification on every machine.

#

But it could be and the same type of error could be the issue, even if it's in another step.

#

You might be right. Just odd that it started happening seemingly randomly.
Maybe it was always the case and you just noticed it for the first time.

spice kayak
#

Nah, it hasn't always been the case. I was showing it to my roommate an hour or so ago, and was paying attention to the notifications and such.

#

I might restart Arma though. It's been open for a while. Maybe something's broken internally.

little eagle
#

git checkout <commit-hash>
git diff master-<commit-hash>

spice kayak
#

Well, sadly that had no effect. Funnily enough, the first testrun after restart had me spawn inside the ceiling of a building. Respawn again, nothing.

#

Restarted whole mission, also didn't happen. Arma is weird.

little eagle
#

Does this use a display/control eventhandler on the mission display (#46) like keyDown?

spice kayak
#

I'm not sure honestly. You're going to hate me, but I just mostly used the Sector Modules for this one. The group wanted something basic that I could show them at a later point.

little eagle
#

The problem with that is, that these modules are essentially black boxes that do something, but you don't know what they do. So if there is an error in one of them, or even a quirk, you have no idea what to look for.

spice kayak
#

Yeah, I understand that. It's a risk I took for some simplicity.

spice kayak
#

Also, is there any way to stop the game from overriding the mission.sqm information? I tried using the in-game attributes to set the Scenario Name, however that doesn't seem to do anything, so I've tried leaving that empty and editing the mission.sqm to have OnLoadName = "titlehere";, but it overrides that whenever I try to save or export.

#

When I do add a name to the in-game 'Title:' section, that doesn't get added to the mission.sqm for some reason. The author part updates in the file, but the title doesn't.

#

Seems like I've gotten it to update everywhere except for the Create a Game lobby, in which it still shows as savedname.malden :(

jovial nebula
#

Does selectPlayer command still have issues with editor placed units?

indigo snow
#

where there issues with it?

jovial nebula
#

I just tried and didn't encounter issues at all

#

But there's clearly stated on the wiki (https://community.bistudio.com/wiki/selectPlayer)
"Also avoid selecting player into editor placed units in multiplayer, as it may, on occasion, lead to some undefined behaviour. If you need to selectPlayer into another unit, consider creatingUnit dynamically."

still forum
#

@jovial nebula Did you try on local multiplayer or dedicated server?

spice kayak
#

Okay, so I've also tried just creating a new, blank mission. Giving it a name, saving it then exporting it. That worked, that now has a name that shows up in the lobby. That narrows the source of the issue down somewhat.

#

Trying to verify the game now just incase.

jovial nebula
#

Local actually

still forum
#

Then it makes sense that you didn't encounter issues

#

the problem is locality. If someone else owns the Unit you wanna switch into -> Problems

little eagle
#

....aaand this is why we should delete outdated comments from the wiki

still forum
#

@little eagle The comment is not wrong nor outdated.

little eagle
#

Not being wrong is insufficient when it comes to 'should be on the wiki'.

still forum
#

Atleast not Also avoid selecting player into editor placed units in multiplayer, as it may, on occasion, lead to some undefined behaviour. If you need to selectPlayer into another unit, consider creatingUnit dynamically. I guess

#

Though that seems a bit missplaced in the description of the command

little eagle
#

I don't believe it anyway. "On occasion undefined behavior". Maybe he made a race condition and that's it.

#

No reason to put that on the wiki then.

#

They could've put it as an example though. Creating a unit locally and then switching to it.

jovial nebula
#

Well weird, I tried on a dedicated server and no problems at all

little eagle
#

You're not the first one to ask what the issue actually is. And all because of the wiki.

jovial nebula
#

D:

little eagle
#

My conclusion: there is no issue.

jovial nebula
#

๐Ÿ˜‚ Let's hope it is actually as you say

little eagle
#

If you find it, put it on the wiki with a better description.

jovial nebula
#

Sure

peak plover
#

use it more than once put it into a function
Isn't that too much?

indigo snow
#

Value more than once, save to variable. Code more than once, consider a function.

peak plover
#

So if I use a command more than once, I should put it into a function?

#

I feel like that's a suggestion not a rule...

indigo snow
#

I wouldnt make a function for every command, no. I start considering when its ~4-6 lines

peak plover
#

Jeez

#

That would mean that I'm underthinking this shit

indigo snow
#

Just consider if you use the same 4-6 lines a lot (say draw a debug marker), if you wanted to change it a bit, rather change 1 fnc than 6 code bits

#

But its hugely subjective

peak plover
#

I do get the reasoning 'tho. Because yeah, it does make it easier. I feel like for this I don't need to do to that 'tho

#

I use getvariblae in multiple places, I don't think it means I should make a function like

fnc_getVariable 
#

Seems reduntant to some extent

indigo snow
#

If you do fancy stuff beside just getting it, maybe, otherwise yea thats retarded

peak plover
#

Now that I think of it

little eagle
#

The correct answer is, 2000 lines of macros and includes and then one function call.

peak plover
#

I did make a few functions for getVariable, but they are specific to certain variables

#

^

#

I'm starting to like macros more and more, now that I tried them out

#

I feel like a lot of code can be replaced by simple macros

indigo snow
#

#define Line1 params["_a"]
Line1
#define Line2 ...

peak plover
#

Params is very different every time 'tho

indigo snow
#

Use macros sparingly and consistently or you wont understand what you wrote some time down the line

peak plover
#

I think this might be wrong, but something like this would be helpful at times...

#define GETVARSETVAR(var,default,global)        missionnamespace getVariable [var,default]; missionNamespace setVariable [var,default,global];
#

That as well cptnnick

#

Could do some kind of a macro that adds a comment or sth about macros if enabled...

#

So it tells you what it is

#

before using the macro

#

Then use like functions viewer to read the function...

#

Would that work?

little eagle
#

functions viewer
๐Ÿคข
just open the file. Arma is a shitty file browser (understandably)

peak plover
#

But that would process macros and add comments...

little eagle
#

No, it wouldn't.

peak plover
#

I still don't get it..

little eagle
#

Double click the file to open.

peak plover
#

macros will not be processed

#

I have to manually do that

vague hull
#

Jeez
That would mean that I'm underthinking this shit

I consider this a lie now

little eagle
#

nigel, take a good look at a function in the functions viewer. It looks exactly the same as when you open it in your favourite text editor. Except that you can actually use a proper text editor and file browser.

peak plover
#

I thought the macros would be resolved in there.. my bad

little eagle
#

It wouldn't be readable anymore when the macros are resolved.

rotund cypress
#

@peak plover keep in mind macros does not make your codebase smaller, as they are preprocessed.

#

I would suggest functions and not macros

#

Since functions are much easier to handle

peak plover
#

It means that if I want to change a function or sth, I change it in once place only

rotund cypress
#

Thats what you use a function for.

#

Function > Good when usage is in more than one place

#

And this does not mean if you are using a command

#

But let's say you want to select a player out of an array, instead of doing this in 6 different files

#

You create a function and pass arguments to it.

#

Then you go by DRY (Do not repeat yourself)

#

And you keep your code base smaller

peak plover
#

Sure

rotund cypress
#

Where as macros will be preprocessed anyways and be replaced with the code in the macro

#

Which will make loading the application, loading all whats in that macro as well. (Arma is in this case the application)

#

Therefor not following DRY

#

A good example of this is BIS_fnc_getUnitByUID, where you wouldn't repeat that loop all over the place, but you would rather stick it in a function and call that

#

One pro of this as well is that if something needs changing, you just have to change it in one place.

storm sierra
#

Hey, I am trying to make my own simple 3DEN script, to make things easier to work with. And I am trying to use set3DENAttribute ["ItemClass", value]; But it's not working, I use the same set function to set Name, and it works just fine, any idea why?

peak plover
#

Yes, good example as wel;๐Ÿ‘

rotund cypress
#

@storm sierra this takes an entity as a parameter.

storm sierra
#

I know, I left that out on purpose, because it's the ItemClass I am having issues with

rotund cypress
#

If you want helpful answer I suggest leaving full code snippets ๐Ÿ˜‰

#

And what is ItemClass?

#

What are you trying to do?

storm sierra
rotund cypress
#

And what is your value?

#

Can you leave full snippet please?

storm sierra
#

I am not getting any script errors, there's just no results when I set the Attribute ItemClass

indigo snow
#

[_T] is never a string

storm sierra
#

I know that, I was testing around,

indigo snow
#

but its selected from _types

rotund cypress
#

Also, use params please

indigo snow
#

which is also arrays

storm sierra
#

I tried setting it to [_T] because _IC was returning ["TargetP_Inf4_F"]

indigo snow
#

yes it returns an array containing the return value

#

have you tried simply executing just the set3denattribute from the debug console?

storm sierra
#

I just tried

collect3DENHistory {
((get3DENSelected "object") select 0) set3DENAttribute ["Name", "TargetP_Inf4_F"];
}; 

Which works fine, it changes the name
But when I try

collect3DENHistory {
((get3DENSelected "object") select 0) set3DENAttribute ["ItemClass", "TargetP_Inf4_F"];
};

Nothing happens

indigo snow
#

does it return the get3denattibute correctly?

tough abyss
#

Oh shit, I just realized why functions are func = {};.

#

You assign code to a variable and then call it.

storm sierra
#

It returns ["TargetP_Inf_F"]

tough abyss
#

That somehow escaped me until now.

little eagle
#

The curly brackets are glorified quote marks.

tough abyss
#

Are they faster, though?

indigo snow
#

aight. its blocked by the engine then, @storm sierra

storm sierra
#

Cool, thanks

tough abyss
#

@little eagle: but if you call a string you need to compile it first.

little eagle
#

And what is the result of compiling a string?

tough abyss
#

Code?

#

I think.

little eagle
#

They just replace the " with {

indigo snow
#

sometimes errors

#

๐Ÿ˜›

tough abyss
#

If you use {} you don't need the compile.

little eagle
#

Yes.

indigo snow
#

but then it isnt a string of course

tough abyss
#

Thus they are better.

indigo snow
#

numbers are better since you dont need to call them anymore

little eagle
#

Can't use format with curly brackets. format always leads to very nice and confusing code.

queen cargo
#

tipp: use formatText instead to avoid getting truncated code strings

little eagle
#

formatText is a worse version of parseText.

queen cargo
#

formatText is the one variant that has no upper limit

#

unlike format, strings can be way more lengthy in there

frail trout
#

guys is there a built in revive system I can use in online sandbox sorts of games? We're doing small private zeus games.

#

awesome thanks

frail trout
#

Would anyone perhaps know why that upon mission completion (custom zeus objectve) and mission restart that the ablity to use Zeus would be disabled, or simply not work.

#

Only a server restart seems to allow me to be Zeus again

golden storm
#

Hello there guys, i have (what i think may be) a simple question, so, im making a mission in which you're a policemen and there's a shootout so you have to ask the civilians around if they saw where the gunmen fled to, i know i can add the "Interrogate" with the "addaction" command, but how do i make it that after that they show a "Hint" text?

#

This is what i tried on the init field: this addAction [Interrogate (hint"I didnt see anything")]; but it doesn't work, on the hint i could change it manually but i don't know how to formulate the action ๐Ÿ˜ฆ

spice kayak
#

wouldn't it be addAction["Interrogate", hint parsetext format ["I don't know anything!";];

#

I mean, you probably wouldn't need parsetext format, but you could potentially make it so they have an array of answers.

#

addaction["Interrogate","Interrogation.sqf"]; then within that sqf, have an array with different replies, get a variable to choose one of them, and then have the hint display the chosen line.

spice kayak
#

I also have an odd / interesting issue. So, when you choose my mission from the scenario list, it shows it's title, and below it, it shows the author. That's correct. On the loading screen, it also shows the correct information. However, once you're in the mission and you spawn in, the text down the bottom right show the wrong information, and nowhere can I find why it's using one thing over another.

#

This is what I'm referring to. I've used the Scenario Name module, which initally only showed the Scenario name, which I didn't mind, but then once I added author information to the description.exe, it started showing the author, which I wouldn't mind if it were correct. http://i.imgur.com/Avt8ThS.png

#

Okay, I can confirm, that for some reason, the Scenario Name Module uses the onLoadName string as the author text.

#

Huh.

#

If I remove onLoadName, the module only shows the scenario name, however my loading screen shows 'Unnamed Mission,' which is not ideal.

rancid ruin
#

just call your mission Unnamed Mission

golden storm
#

@spice kayak Thanks man! ๐Ÿ˜ƒ

spice kayak
#

I don't think I want to leave it as unnamed :P

#

You're welcome, Lorflord!

spice kayak
#

Of course the wikipage for the one bit of information I need is down :(

still forum
#

What bit of information

spice kayak
#

the dynamictext information, for what each of the arguments and such mean.

#

I'm slowly figuring it out by trial and error though :D

still forum
#

A command? Or a UI element or what is that?

spice kayak
#

sorry, the BIS_fnc_dynamicText - though it appears to load now.

fallen notch
#

Hey guys. I am very new to this, so maybe you can give me an answer.

spice kayak
#

Ask away, someone will help!

fallen notch
#

Problem: i want to spawn an Ammobox to a Marker (called "ammo_spawn"). the NPC, that should trigger the spawn will be an AI officer. to open a dialogue i get into its init this AddAction["Create Ammobox"]; i KNOW that i have to set a comma after that to add the funktion to spawn that thing. But my syntax seems to be wrong :S

#

can anyone give me a simple syntax for that?

#

i tried to work with _veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn"] but that doesnt work for me for somehow

#

this AddAction["Create Ammobox",_veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn"]]; <<< that was the syntax i wanted to fill in the NPC-init at the editor

indigo snow
#

The function needs to be between code brackets {}

#

The reason is that it needs to be a single variable

fallen notch
#

how must the code be then?

indigo snow
#

And {} makes a code-type variable

fallen notch
#

you mean that stuff after "createVehicle"?

indigo snow
#

object addaction ["name",{ createVehicle ... }];

#

So just like a string, wrap everything in those curly brackets

fallen notch
#

facepalm omg ok is it that simple?

indigo snow
#

Yes

#

Now i cant comment yet on if your actual code itself also works correctly but thats the syntax

#

It looks ok though

fallen notch
#

this AddAction["Create Ammobox",{_veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn"}]; << like that?

#

i think i missed a "]" somewhere

indigo snow
#

Looks ok, yea.

#

You did

#

After the "ammo_spawn"

fallen notch
#

see ^^

long hatch
#

Just a question about ace_slideshow_fnc_createSlideshow; i want to have multiple Slideshows on one object and use the same controller, but with 3.10.2, the interactions of the Slideshow are mixed up for me and overlap in the Submenu (e.G. when i select 1 subcat the entries of the second slideshow will overlap), i load this slideshow via init.sqf, should this maybe the problem?

indigo snow
#

Why dont you try asking in the ACE3 slack?

#

It shouldnt matter where you call the function from, though

fallen notch
#

@indigo snow no errors so far, ill try that now in mp-mode. hope it does what it should do ๐Ÿ˜„

indigo snow
#

Its all global, should be fine

fallen notch
#

nah gives me an error

indigo snow
#

You might wanna remove the action after spawning the box, though

fallen notch
#

hangon trying to post the picture

indigo snow
#

What error do you get in MP that you dont get in SP?

#

You can open your RPT file, all errors are logged in there

#

Google "arma 3 rpt file"

fallen notch
#

hangon

#

11:11:23 Error in expression <_veh = createVehicle ["rhsusf_ammo_crate",getMa>
11:11:23 Error position: <createVehicle ["rhsusf_ammo_crate",getMa>
11:11:23 Error 2 Elemente angegeben, 5 erwartet

still forum
#

lul ๐Ÿ˜„

fallen notch
#

@still forum what does that mean?

indigo snow
#

You need to add some other values to the array

still forum
#

It means that you have to provide 5 elements in the array. You only have two. Read wiki page

indigo snow
#

I thought they were optional, my bad

long hatch
#

why i am don't ask on ACE3 Slack, beacuse i am not on the ACE3 Slack and i am waiting for the "invite"

fallen notch
#

what do i need else?

still forum
#

You could also use the first syntax for createVehicle instead

#

@long hatch You don't need invite

#

@fallen notch Read wiki page.

fallen notch
#

[type, position, markers, placement, special] <<< that stuff?

still forum
#

Yes

fallen notch
#

ok now i need someone that explains me, what i should fill in there ๐Ÿ˜‘ (like i said i am new to this)

indigo snow
#

"rhsusf_ammo_crate" createVehicle getMarkerPos "ammo_spawn" should work too, to help you along

little eagle
#
[type, position, markers, placement, special]: Array
type: String - vehicle/object className
position: PositionATL (PositionAGL if boat or amphibious), Position2D, or Object - Desired placement position
markers: Array - If the markers array contains any markers, the position is randomly picked from array of given markers plus desired placement position. If any of the markers were given z coordinate with setMarkerPos, the vehicle will also be created 
    at given z coordinate.
placement: Number - The vehicle is placed inside a circle with given position as center and placement as its radius
special: String - "", "NONE", "FLY", "FORM", "CAN_COLLIDE". "CAN_COLLIDE" creates the vehicle exactly where asked, not checking if others objects can cross its 3D model.
still forum
#

"Who can read is clearly in the advantage"

fallen notch
#

oh dedman its not the "reading" you know its the translation from english to german

indigo snow
#

Eh hes new to it. Best to show a few working examples to learn from

fallen notch
#

so i clearly dont have as much advantage

still forum
#

Wanna go through each element seperatly?
type: you have that already
position: you have that already
markers: you don't want that so [] empty array as in example 3
placement: you want it to be on the poistion so 0
special: you don't want that so "" or "NONE"

fallen notch
#

i have to translate from english to german to scripting language

little eagle
#

Skip the German part.

still forum
#

Exactly.

#

SQF is english too.

little eagle
#

doplovani

#

usti hlavne

still forum
#

That's.. not SQF though.

#

๐Ÿ˜„

indigo snow
#

dammage

little eagle
#

xD

fallen notch
#

ok ok wait lemme try to rebuild the code then again

little eagle
#

I thought you were Chinese.

still forum
#

Or American.. Riggs sounds american

indigo snow
#

Just a tip, there should be no differences between SP and MP unless your server doesnt have RHS loaded

#

(With this specific thing)

still forum
#

(In this specific situation)
(on this specific game version)

little eagle
#

The code will run locally, so the box will be created as long as the client has RHS. It will print errors on the server though.

indigo snow
#

(Standard bisclaimer)

fallen notch
#

this AddAction["Create Ammobox",{_veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn,[],0,"none"]}];

#

is it like that?

still forum
#

missing a "

fallen notch
#

"ammo_spawn" corect?

indigo snow
#

Rest looks good tho

still forum
#

yes

#

also you don't need the _veh = part.

little eagle
#

^

indigo snow
#

Might wanna get a text editor with syntax highlighting

still forum
#

That is storing the vehicle into a variable that you never use.

#

@indigo snow Or just

this AddAction["Create Ammobox",{_veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn,[],0,"none"]}];
indigo snow
#

Discord is the new IDE

little eagle
#

I can tell that he's using CBA just from that line : D

fallen notch
#

ya i have notepad++ but really i dont use it it doesnt autocomplete for me :S

still forum
#

I can recommend Atom

fallen notch
#

ya i am using cba ^^

#

"rhsusf_ammo_crate" ^^

#

๐Ÿ˜›

still forum
#

I'm trying but I can't see the CBA reference

little eagle
#

Don't listen, Sublime Text 3 is superior in any way (it's faster).

still forum
#

But not free

indigo snow
#

Addaction returns a value

#

Init boxes no like

still forum
#

Didn't CBA fix that?

indigo snow
#

Hence...

little eagle
#

@still forum Let me teach you my ways.

#

damn nick was faster

#

:<

fallen notch
#

Wooot!

#

the box is there!

indigo snow
#

I can delete it and give you the honors

fallen notch
#

so i always have to get 5 variables

#

๐Ÿ˜„

little eagle
#

I made it work, so... : P

fallen notch
#

now i understand

little eagle
#

WORSHIP ME

indigo snow
#

You always need what the wiki specifies

#

Sometimes theyre optional, not in this case

still forum
#

Now spawn the box another 5 times and watch the physx ๐Ÿ˜„

fallen notch
#

i thought if i dont need the variable i leave it lol

indigo snow
#

Its a negligible loss of time

still forum
#

Aww ._. No physx because createVehicle too "intelligent" :/

indigo snow
#

"Can_collide"

fallen notch
#

thats great guys i needed a spawner syntax like that badly

#

for EVERYthing

little eagle
#

I wish these parameters in createVehicle were optional. I never use them (aside from CAN_COLLIDE sometimes), and I never can remember them either.

fallen notch
#

Spare tires and chains

#

Ammoboxes ^^

#

Containers ๐Ÿ˜›

indigo snow
#

Now make a ui interface for insanity points

fallen notch
#

i was thinking bout that lol

#

the more insane you are the more badass items you get haha

#

(bananas and stuff)

indigo snow
#

Youll have to get ace too, then

#

Banana for good luck

fallen notch
#

no really @little eagle thank you ๐Ÿ˜ƒ

#

you made an old man happy

#

i got ace

#

the idea behind spawning items was: there are no containers with unlimited spareparts

#

and tahts sad

#

*thats

still forum
#

You could make one ๐Ÿ˜„

indigo snow
#

Thats scriptable

#

But this works, too

fallen notch
#

i know it is ^^ now tell me how far would i get? 35 years old and the 5th day on doing this lol

still forum
#

Better use what's already working ^^

indigo snow
#

Also better for frames, ace cargo items actually exist (or was that only with AGM?), saves on the frames

fallen notch
#

i am just at the very basics and the language i was using on "programming" was basic lol

indigo snow
#

You dont need much more for sqf

#

Its all words and sentences

fallen notch
#

maybe you could help me out with something else. I have a container that has the virtual arsenal command when i get closer to it. When i am very close it still has its inventory. how do i deactivate the inventory of that container?

still forum
#

Just the grammar is a bit weird. MyCookie eat now instead of now eat mycookie

#

Are you sure you don't want the Inventory? I love that to throw away misc items. If you don't have the inventory you either have to search the Item in Arsenal to remove it or you just throw it on the ground

fallen notch
#

hmm ya you are right maybe i just clear the inventory then

still forum
#

Everytime my group has an Arsenal on an object without inventory there are tons of items laying on the ground after equipping. If they have an inventory to throw stuff into everything is neat and tidy

fallen notch
#

argh now i have another problem :S when i put that ammobox to the ground it automaticly hase the virtual arsenal on it

#

but when i spawn it via that command i used befor it just has an empty inventory

still forum
#

And what's the problem? you want arsenal or not?

fallen notch
#

how do i get that this addaction ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}];
to that box? ^^

still forum
#

https://community.bistudio.com/wiki/BIS_fnc_arsenal
["AmmoboxInit",[<Your Box variable>,true,{true}]] spawn BIS_fnc_arsenal;
or
<Your Box variable> addaction ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}];
The variable is returned by your createVehicle call

#

so

_myBox = createVehicle..;
_myBox addAction...
fallen notch
#

ok so for my understanding: do i have to place that somewhere to that line with this 5 options?

#

my guessing was that empty []

little eagle
#

in the code block. {code}

still forum
#

Right now in your addAction that spawns your vehicle you have
createVehicle [...] change that to _veh = createVehicle [...]; _veh addAction[<Arsenal action here>]

fallen notch
#

hangon

#

this AddAction["Create Ammobox",{_veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"]; _veh addAction ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}] }]; like that?

still forum
#

```sqf
<code>
```

this AddAction["Create Ammobox",{
  _veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"]; 
  _veh addAction ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}] 
}];
#

looks good.

fallen notch
#

hah!

#

^^

#

works fine! thank you again ๐Ÿ˜„

tame stream
#

Hi all, im trying to create ambient civs in town with EricJ's Taliban units thats spawns via trigger activated.
How im trying to do it is to place them via zues and copy that data to a sqf that id like to call in the triggers on act field...

```This is the sample data of handfull of civs as a test... how would i go about calling this via sqf.

Ive added the data to a town1.sqf and trying to call it via trigger using ... this execVM "scripts\town1.sqf";

what am im doing wrong?
fallen notch
#

so that means i can just put "what it is" and "what it does" in 2 commands in it

still forum
#

@tame stream Not using sqf highlighting. Not using newlines. Not using private

tame stream
#

im sorry i dont follow

still forum
#

I'll help you...

tame stream
#

i've done this before via the zeus method but for the life of me i cant figure out how i did it before

still forum
#
private _newGroup = createGroup civilian;
private _newUnit = _newGroup createUnit ['Afghan_Civilian5', [1505.94,313.088,0.00137329], [], 0, 'CAN_COLLIDE'];
_newUnit setSkill 0.5;
_newUnit setRank 'PRIVATE';
_newUnit setFormDir 296.721;
_newUnit setDir 296.721;
_newUnit setPosWorld [1505.94,313.088,360.481];
_newGroup setFormation 'WEDGE';
_newGroup setCombatMode 'YELLOW';
_newGroup setBehaviour 'SAFE';
_newGroup setSpeedMode 'LIMITED';
private _newWaypoint = _newGroup addWaypoint [[1568.47,221.883,0], 0];
_newWaypoint setWaypointType 'MOVE';
_newWaypoint = _newGroup addWaypoint [[1567.15,301.517,0], 0];
_newWaypoint setWaypointType 'MOVE';
_newWaypoint = _newGroup addWaypoint [[1485.68,311.603,-3.05176e-005], 0];
_newWaypoint setWaypointType 'MOVE';
_newWaypoint = _newGroup addWaypoint [[1489.83,284.029,3.05176e-005], 0];
_newWaypoint setWaypointType 'MOVE';
_newWaypoint = _newGroup addWaypoint [[1538.28,280.469,0.00128174], 0];
_newWaypoint setWaypointType 'CYCLE';

That really is some heap of code..

tame stream
#

oo yeah soz

still forum
#

What is not going like you want it?

tame stream
#

ill do it like that in future

still forum
#

You say something is wrong but you don't say what's wrong

#

That's why I told you everything that came to my mind about that script

tame stream
#

im trying to use that given data to spawn the civs in the town via a trigger...that does not happen and im trying to find out why

still forum
#

So.. The civs don't spawn?

tame stream
#

yup

still forum
#

Script error in RPT maybe?

tame stream
#

lemme check

#

my log are off..activating it and testing to get logs

still forum
#

Disabling logs while coding... Great Idea

tame stream
#

๐Ÿ˜ฌ

#

i did activate logs awhile ago dont know why it still off...fml

#

just mentioning ๐Ÿ˜ƒ

indigo snow
#

@fallen notch the problem is that in MP, people now wont see the Virtual Arsenal action since its local.

#

You need some more magic for everyone to see it

fallen notch
#

@indigo snow what do you mean?

indigo snow
#

Only the person who spawned the crate with the action can access it now

fallen notch
#

you sure?

little eagle
#

Yes.

indigo snow
#

Since addAction has local effects, it only exists on the computer where it was added

fallen notch
#

omg

little eagle
#

Easy fix

fallen notch
#

ok how to do it then?

little eagle
#
object addAction params
->
[object, params] remoteExec ["addAction"]
fallen notch
#

omg ^^

#

ok where do i put THAT in?

little eagle
#

You replace the first line with the last.

#

object and params are placeholders. Replace with what you have.

tame stream
little eagle
#
12:19:13 [XEH]: Car does not support Extended Event Handlers! Addon: @task_force_radio
12:19:13 [XEH]: Tank does not support Extended Event Handlers! Addon: @task_force_radio
12:19:13 [XEH]: Air does not support Extended Event Handlers! Addon: @task_force_radio

Explain yourself, @still forum

fallen notch
#

you mean instead of just addaction i should do remoteExec ?

little eagle
#

remoteExec ["addAction"]
yes

#
12:18:54 Updating base class Offroad_01_military_base_F->Offroad_01_base_F, by task_force_radio_items\config.cpp/CfgVehicles/Offroad_01_armed_base_F/ (original a3\soft_f\offroad_01\config.bin)
12:18:54 Updating base class Car->Car_F, by task_force_radio_items\config.cpp/CfgVehicles/HMMWV_Base/ (original (no unload))

^^

fallen notch
#

this remoteExec["AddAction"]["Create Ammobox",{_veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"]; _veh addAction ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}] }];

little eagle
#

No

fallen notch
#

facepalm

little eagle
#

object addAction params

#

What is "object" in your case?

fallen notch
#

object would be the NPC soldier?

little eagle
#

No, look at your code.

fallen notch
#

rhsusf_ammo_crate?

little eagle
#

object addAction params

#

this AddAction ["Create Ammobox",{_veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"]; _veh addAction ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}] }];

#

What is "object" in your case?

fallen notch
#

i truely have no clue :S

little eagle
#

Focus on "addAction".

#

"object" is to the left of it.

fallen notch
#

"this" would be then the object

little eagle
#

Yes!

fallen notch
#

so the object is the NSC i give the command

little eagle
#

It's a reference to the object's init box you put it in.

#

Now what is "params" in your case?

fallen notch
#

yes

still forum
#
this AddAction ["Create Ammobox",{
  _veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"];
  [_veh, ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}]] remoteExec ["addAction"];
}];
little eagle
#

: /

fallen notch
#

nono lemme look

still forum
#

you want to remoteExec the Arsenal action. Not the box spawning

little eagle
#

True.

#

Don't want to create a box on every machine.

indigo snow
#

Look at what inside the array to the left of remoteExec

#

Youd have an action for every connected client + server, commy :P

little eagle
#

I better go to sleep again.

fallen notch
#

lol

indigo snow
#

But yea dodger look at the arguments for remoteExec, and what they were when it was an addAction

fallen notch
#

so in my words right now i make a box that everyone can see but they didnt see the commands and now they do

#

because remote addaction has done it?

indigo snow
#

Yes. If you create the box, everyone can see it, but if you add an action, only you can.

little eagle
#
//before
_veh addAction ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}];

//after
[_veh, ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}]] remoteExec ["addAction"];
indigo snow
#

Local effects and global effects

fallen notch
#

AH

indigo snow
#

So you need to remoteExec the addaction so it happens on every client

little eagle
#

_veh is the "object", [...] is the "params"

fallen notch
#

so you just say "and by the way Addaction is remotly done"

little eagle
#

remoteExec ["X"]; is "do function X on every machine

indigo snow
#

Id rather say you need to remoteExec it for everyone to see it

little eagle
#

I think this also needs the JIP flag. So people joining later have the action too

fallen notch
#

omg

little eagle
#

remoteExec ["addAction", 0, true];

indigo snow
#

Welcome to MP scripting :D

little eagle
#

I wouldn't have used remoteExec personally ๐Ÿ˜›

fallen notch
#

and for make the whole thing easier i put that in an sqf file and just call taht file lol

still forum
#

You could just use Arsenal ammoboxInit.. And done ^^

indigo snow
#

Obviously youd need a CBA XEH ( :P )

still forum
#

and a PFH and a PEH and a CNS

indigo snow
#

State machine if you want to toggle it on and off

#

Gotta go deeper

fallen notch
#

(btw how can i copy that code with colours in here?

still forum
#

already told you before ^^

little eagle
#

```sqf
<code>
```

fallen notch
#
  _veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"];
  [_veh, ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}]] remoteExec ["addAction"0,true];
}]; ````
little eagle
#

I don't like state machines^^ They're loops too

#

almost

indigo snow
#

No space between ticks and sqf

fallen notch
#
  _veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"];
  [_veh, ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}]] remoteExec ["addAction"0,true];
}];```
#

aaaah^^

indigo snow
#

Wrong space ahah

little eagle
#

shift + enter to newline after the "sqf"

indigo snow
#

You can just enter after three ticks

little eagle
#

UMSCHALTTASTE * EINGABETASTE

fallen notch
#
this AddAction ["Create Ammobox",{
  _veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"];
  [_veh, ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}]] remoteExec ["addAction"0,true];
}];```
#

tadaa ok

little eagle
#

JAWOHL

tame stream
#

@still forum SHIZAAA !!! ๐Ÿ˜ƒ
i figured it out... have to use null=execVM "scripts\town1.sqf"; instead of this execVM "scripts\town1.sqf";

if you are interested this is my method. --> (using Zeus Achilles addon)
-place single player on map with zeus acces
-spawn civs/enemies/structure with waypoint and states of choosing
-in zues use copy SQM command
-copy data to newly created town1.sqf
-use null=execVM "scripts\town1.sqf"; on trigger activated by player

Boom all good, player enter trigger and zeus prebuild item spawn as needed
๐Ÿ˜„

fallen notch
#

(omg i think im going insane, need more coffee)

little eagle
#

i figured it out... have to use null=execVM "scripts\town1.sqf"; instead of this execVM "scripts\town1.sqf";
ยฏ_(ใƒ„)_/ยฏ

tame stream
#

yeah i know ๐Ÿ˜ƒ

#

quick and easy method of spawning missions

fallen notch
#
this AddAction ["Create Ammobox",{ 
  _veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"]; 
  [_veh, ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}] remoteExec ["addAction"]0,true];``` now it says theres a "]" missing :S
little eagle
#

It's one too much.

#

]0

#

]0 isn't right

fallen notch
#

["addAction"0,true];
same error

little eagle
#

...string"0,...
isn't right either

fallen notch
#

ah lol

#

still missing something

#
this AddAction ["Create Ammobox",{
  _veh = createVehicle ["rhsusf_ammo_crate",getMarkerPos "ammo_spawn",[],0,"none"];
  [_veh, ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}] remoteExec ["addAction",0,true];
}]]; ```
still forum
#

Yes

#

[_veh, ["<t color='#FFFF00'>Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal}]
You open 3 [ but only close 2

little eagle
#

And the not indented lines open one [ and one {, but close two ] and one }

fallen notch
#

so i need to get rid of 1 "]" at the end of that line?

little eagle
#

Yes. And then also fix line 3

fallen notch
#

what is wrong in line 3?

little eagle
#

4 opening [ and three closing ]

fallen notch
#

i dont see it ๐Ÿ˜ฆ

still forum
#

You should really read what people tell you

#

Count it one by one then

#

put it into notepad and set text size to 500

little eagle
#

72 should be enough

#

^^

peak plover
#

๐Ÿ˜‚

still forum
#

Last time I used big text thingies was in primary school ๐Ÿ˜„ I don't remember how sizes work n stuff

fallen notch
#

yes Size 72 helped ๐Ÿ˜ƒ

#

had to start to count at line1 ^^

#

and then it stared into my eyes lol

little eagle
#

"And if you gaze long into an abyss, the abyss also gazes into you."

still forum
#

With time your brain will learn to recognize the pattern

fallen notch
#

its like math

little eagle
#

YES

fallen notch
#

i know that but in all that lines and thinking and focussing i missed the whole picture lol

#

13:16:07 Error in expression <(_this select 0) addaction (_this select 1)>
13:16:07 Error position: <addaction (_this select 1)>
13:16:07 Error addaction: Typ Zeichenfolge, erwartet Objekt :/

still forum
#

_this select 0 is a string instead of an object

#

As... The error message already told you

fallen notch
#

aaah seen it ^^

tardy yacht
#

Haven't been on for a couple days so I might've missed some answers. I was trying to make a square in GUI and someone recommended

w = x * safezoneH;
h = x * safezoneH;

But that gives me something that is clearly rectangular.
So how do I make an actual square?

still forum
#

w = x * safezoneW;

peak plover
#

would x work in configs? shouldn't it be safezoneX?

still forum
#

Dude... I don't even

tame stream
#

im trying to do a mobile respawn that needs to be activated by players, as soon as the player activate the MHQ via addaction, only then i want them to have the option to spawn there.

So how can i make a respawn module active via addaction, also needs to deactivate via 2ns addaction

#

any ideas? ive tried hide and disable simulation

peak plover
#

Quick question about github and scripts and comments:

// Exit if target unit does not exist or isNull or is not a man
if (isNil "_unit") exitWith {};
if (isNull "_unit") exitWith {};
if !(_unit isKindOf "CAManBase") exitWith { };

Will github filters pick this up and ban me from github?

still forum
#

Ban for what?

#

wtf

peak plover
#

Because if you are not a man it won't run the script...

still forum
#

Because you are using wrong syntax that will never work? no

#

"Man" in this case means "Human"

#

Not Male

peak plover
#

ok, good, I thought that might be misinterpreted...

#

Wrong syntax where?

still forum
#

isNull check

peak plover
#

Ohh, right 'o

#

Thanks

#


if (isNil "_unit" || {isNull _unit} || {_unit isKindOf "CAManBase"}) exitWith { }
#

better?

still forum
#

indeed

subtle ore
#

Lol.

tough abyss
#

Any ideas on how to effectively extract code (typeName "CODE") from the debug console? Too long to load it and copy it (crashes game). I would prefer not to print it and keep all the extra quotes out of it.

still forum
#

What function?

#

Just extract the PBO that function is coming from. And take the sqf file

tough abyss
#

It's not in a sqf file.

still forum
#

Where then?

tough abyss
#

Generated in-game.

still forum
#

Custom extension or Intercept to write to file

tough abyss
#

Never used it before, will have to check it out.

still forum
#

So if you click onto the function in Function viewer it crashes?

#

Forget that. It's probably not in the function viewer

#

when exactly does it crash?

tough abyss
#

It's not in the function viewer. It is a variable.

#

I put the variable in the watch box, go to CTRL + A or press end and it hangs until I force close it.

still forum
#

freeze is not a crash

#

have you tried copyToClipboard ?

tough abyss
#

Unrecoverable hang...

#

copyToClipboard truncates it.

still forum
#

Are you sure it's unrecoverable? Did you wait for several weeks? Kappa

tough abyss
#

๐Ÿคฆ

still forum
#

How long is the output you get from copyToClipboard

tough abyss
#

I've waited for 10 minutes with no joy

still forum
#

so after how many characters exactly does it truncate

tough abyss
#

I take that back. It didn't truncate it.

still forum
#

So... Everything is fine and you just derped?

tough abyss
#

I derped... Been working on this for maybe 10 hours and I derped at the end.

#

Brain is tired I guess.

vestal mortar
#

guys how do i make it so only someone with the Bounty Hunter licenese can spawn here ["bounty_spawn","Bounty Hunter HQ","\a3\ui_f\data\map\MapControl\watertower_ca.paa"] not everyone else (im hosting a lakeside server ik how to do it for altis life but not so sure about lakeside modded(edited)
pls help

still forum
#

Thank you for copy pasting. I wish you a very nice time here.

vestal mortar
#

what was i surpose to write its the same question?

still forum
#

As this is a Life specific question you should go ask in a Life forum or Discord.

vestal mortar
#

wowo rude

still forum
#

It would not be rude to just leave you be without answers?

tough abyss
#

Just add an if statement before adding the spawn location and just check if they have the license...

vestal mortar
#

ok thx

waxen jacinth
#

can someone help me out and get me the right syntax for some ifs in a row with else at the end, seems i can't get it running: ```C

_boing = player getVariable ["boing",0];

if !((vehicle player) isEqualTo player) exitWith {};

if ((_boing < 1) && ("bla" in (magazines player))) then {

publicVariableServer "do_this";

};

if ((_boing > 1) && ("bla" in (magazines player))) then {

publicVariableServer "do_that";

};

else
{
hint "you need bla";
};

#

do i need to work with else { if { else instead?

tough abyss
#
if (boolean) then {
    // Do something
} else {
    // Do something else
};
#

Can't just put a random else there.

peak plover
#

yo ucan use call too

#

and exitwiff

waxen jacinth
#
if (boolean) then {
    // Do something
} else { 
    if (boolean) then {
    // Do something else
};
};```
tough abyss
#
if (boolean) then {
    // Do something
} else {
    if (boolean) then {
        // Further checking
    };
    // Do something else
};
waxen jacinth
#

ah!

#

gotcha, thanks!

indigo snow
#

Shame sqf cant implement elseif

peak plover
#

call {
    if (bool) exitWith {};
    if (bool) exitWith {};
    if (bool) exitWith {};
    {CODE}
};

I just use

queen cargo
#

in fact: else if is technically in other languages nothing but the if else of arma

#

but as other languages support non-pharatesis blocks, it works without that ugly crap we do in arma

#

-->

if(...)
{

}
else
{
    if(...)
    {
    }
    else
    {
    }
}```
is the same as ```c
if(...)
    ...
else if(...)
    ...
else
    ...```
peak plover
#

eachFrame is better than waitUntil for code for UI?
I assume eachFrame runs every frame regardless, but waitUntil will suspend until next frame is available and checks for that.
By this theory eachFrame is less performance consuming and I should use that instead...

queen cargo
#

you barely need the "rendering power" for actual per frame handling

still forum
#

Actually arma doesn't neeeeeed the {} blocks.. It just needs code

_func1 = {};
_func2 = {}

if (something) then
    _func1
else
    _func2
queen cargo
#

simple update of UI can be done in a spawn

#

unless you do heavy rendering stuff, avoid per frame

#

same for non-live updates

peak plover
#

Yes, but in theory using waitUntil will eventually cause more performance usage than eachFrame

still forum
#

"each frame runs every frame regardless"
"waitUntil will suspend until next frame is available"
"Therefore eachFrame is less performance consuming"

wtf?

queen cargo
#

ui interaction does not cares for performance

still forum
#

eachFrame runs every frame. That's correct.
waitUntil goes into sleep state and does nothing..
I don't understand why eachFrame would be cheaper

peak plover
#

It's to update a menu list and check if any texts are in the showtext que

still forum
#

TLDR onEachFrame is NOT cheaper.

queen cargo
#
_updateLoop = args spawn {`your while loop and update stuff`};```
#

do that
be happy with it

#

use waitUntil

#

and stop trying premature optimization

peak plover
#

eachFrame is running 24/7. It's just running empty.
waitUntil would constantly check if it's his time to execute, it does not know if it's the next frame until the diag_tick has changed...

queen cargo
#

especially if it is based around some phrases some users threw around here

still forum
#

Wrong.

#

waitUntil checks once every frame ONLY if the game didn't spent too much time on other SQF scripts that frame

#

eachFrame executes every frame regardless

#

I could swear I have explained that to you a dozen times already

peak plover
#

Yes, but

tough abyss
still forum
#

:3

peak plover
#

if there is too much code in scheduled, it would lag the UI... but then again if it's already that bad and I run the code in eachFrame, it will ALWAYS update the UI

still forum
#

True

peak plover
#

Yeah, I'm overthinkign again, damn it

queen cargo
peak plover
queen cargo
#

#fakenews

peak plover
#

#offtopic_fakenews

queen cargo
#

expected the remix actually to be about that ...

peak plover
#

Either way, now that I'm doing UI elements I have found this new thing out and yah, it is all logical and makes sense now. Thanks

#

Now I understand how they do the non-laggy nametags etc.

still forum
#

The question is. Is you UI in the foreground?

peak plover
#

Yes, but you made me realize that it's not important for me to get this updated on every frame, so waitUntil will do as the impact will be 0.0004 ms per waitUntil that is running in the mission, which currently total around 5

still forum
#

If it is in the foreground it means your Users focus is on your UI. Meaning it being updated smoothly is more important than the background behind the UI being 30+ fps

peak plover
#

stop trying premature optimization

#

Must write this on the wall

#

Fair point

still forum
#

As long as your code is only running while your UI is open. It doesn't really matter if you drag fps down to 10-15 which you probably won't be able to do anyway

peak plover
#

yeah

#

I gotta stop premature optimization, because I keep going back on older functions when I remember something that would improve it by a tiny amount

still forum
#

I do a optimization run every now on then. It's quite fun for me

#

I love optimizing stuffz

peak plover
#

๐Ÿ‘

kindred lichen
#

Hey guys, Is it possible to pack a mod into a mission?

still forum
#

No

kindred lichen
#

I found a mod that lets you walk around ontop of moving vehicles, but It a performance hog, so we don't want to add to mod pack, but I wanted to use it for 1 missions.

still forum
#

That Mods add's a custom Model afaik. So answer stays No

kindred lichen
#

cool, thanks for the answer.

queen cargo
#

my tiny SQF vm gets clearer in its shape every hour โค

peak plover
#

ohh crap
my_var = [[{player call myFnc1}], myFnc2];
publicVariable "my_var";

#

Won't this just send the whole function? as in 100 lines of code...

barren magnet
#
publicVariable "my_var";```
indigo snow
#

It will send myFnc2 entirely yea

barren magnet
#

thats 1 thing

peak plover
#

Thats not gonna work @barren magnet

#

player is not available on server

barren magnet
#

Ahhhh

#

sry, thats your function

indigo snow
#

It will still send myfnc2

barren magnet
#

i though you wanted to have it executed

peak plover
#

It's a function to add code or functions to execute at a certain event

#

bootleg EH

indigo snow
#

Send it as string

barren magnet
#

Thing is why are you doing it that way?

peak plover
#

then compile

indigo snow
#

yea

peak plover
#

Alright, thanks

barren magnet
#

myFnc2 = {hint "arma3";};
publicVariable "myFnc2";

#

or that thing with the string >.>

peak plover
#

call myFnc2

barren magnet
#

yep

#

this functon is globally available using that var name then

#

if you only want it on the server send it via publicVariableServer

peak plover
#

myFnc2 = {hint "arma3";};
myFnc2 = str myFnc2;

publicvariable "myFnc2";

call compile myFnc2;
indigo snow
#

No

#

If you do it like that the str isnt necesary

barren magnet
#

publicvariable "myFnc2";

call compile myFnc2;```
#

arma will handle the serialization for network sending for you

indigo snow
#

Stepping back a bit, nigel what do you want to do? Have the client call a predefined function or share a new function with them

barren magnet
#

yep, thats the better question

peak plover
#

call |#|compile myFnc;
Type code, expected string

indigo snow
#

Well yes but answer the question first please :P

peak plover
#

Events for custom respawn system

barren magnet
#

ahhhh

#

sry

peak plover
#

So I can add scripts / code to the Events

indigo snow
#

Do the clients have the fncs already?

barren magnet
#

publicvariable "myFnc2";

call  myFnc2;```
peak plover
#

Yes, but I also want to be able to add code too

barren magnet
#

no need for the compile anymore

indigo snow
#

So they have myfnc1 and you add myfnc2?

peak plover
#

Yeah

indigo snow
#

Then your original array was correct

peak plover
#
my_var = [[{hint 'lol'}], [myFnc2]];
indigo snow
#

Except for the array brackets around the code brackets around the fnc1 bit

peak plover
#

Yeah

indigo snow
#

Dont need those for it to work

#

(Idk the framework behind it tho)

#

Seems like unnecessary []s

peak plover
#

There we go, makes more sense now

#

[] are used because [{code},_keepAfterUse];

indigo snow
#

[{call fnc1},fnc2]

#

Aight just saying

peak plover
#

aka overthinking the hole way through, baby

#

What if I only want to use it once for some ๐Ÿ˜„

indigo snow
#

^ that wont send fnc1 but will send fnc2 entirely

peak plover
#

Hmm, really?

indigo snow
#

Idk your architecture but im sure you can design a way

#

Yes because it wont evaluate whats inside {}

#

And fnc1 is inside the {}

peak plover
#

I think I might just make it so that it stringifies it when it registers the code and then it compiles before it executes

#

Probably easiest fix

indigo snow
#

Aka commys "{} are glorified strings"

#

You can send a code type variable

peak plover
#

ohh, nice thanks

indigo snow
#

No need to str it first and then compile it later

#

Maybe save that array into a var

#

And look at it in the debug console watch fields

#

Youll see what gets sent

#

It helps to understand whats going on

peak plover
#

[[{call respawn_fnc_deadHudShow}]]

#

If {} are glorified strings, this is alright

#

I'll leave it like this.....

indigo snow
#

Check it in the watch fields and see

peak plover
#
[[{[] spawn respawn_fnc_deadHudClose}],[{call respawn_fnc_timer_onRespawnUnit}]]```
#

This way I can designate which scripts spawn and which call, so I don't have to spawn them when the Event happens

#

Don't have to worry about wrong scripts running besides eachother,

#

Great, thanks ๐Ÿ˜„

#

Yeah, I tried vanilla respawn, missing basic functionality like respawn side, a list of dead players, availiability to respawn players when they are not on the server, etc.
easier to make my own thing than use vanilla

waxen jacinth
#

is it possible in mission.sqm to pinpoint a path for custom markers? C class Item26 { dataType = "Marker"; position[] = {25695.2, 0, 21367.3}; name = "Marker"; text = "Sofia"; type = "path\to\your\marker.paa"; id = 126; atlOffset = 0; };

indigo snow
#

no

#

if you want custom icons, use drawIcon on the map display

waxen jacinth
#

or create an own mod and overwrite cfgmarkers i guess?

indigo snow
#

well yea

#

just add them to cfgMarkers

waxen jacinth
#

well, since we'r talkin about an existing mod - wouldn't it be possible to outsource cfgmarkers?

indigo snow
#

uh im not sure what you mean by that

waxen jacinth
#

got this mod running, cfgmarkers defined there in a *.bin - outsourcing it to add my own custommarkers

indigo snow
#

im not sure what you mean with outsourcing

#

you can create your own mod and add more, sure

waxen jacinth
#

yeh that for sure, hehe but i just wanna outsurce the class cfgmarkers and put it into missionfile

#

so instead of getting the class from the mod, getting out of the missionfile

indigo snow
#

you cant do that

#

missions can only edit the missionconfigfile, not the main configfile

waxen jacinth
#

not even overwriting some classes in configfile thru missionfile?

indigo snow
#

configFile, where cfgMarkers is under, can only be edited by a mod

#

so not by a mission

waxen jacinth
#

dang that

#

but couldn't i check, where the mod is lookin for cfgmarkers and overwrite that path? Like, mod is lookin in cfgmarkers from config, give the mod a new path to look at my cfgmarker file? (mod allow overwriting)

indigo snow
#

im not sure in how many ways i have to say you cant edit cfgMarkers with a mission

#

you cant

#

you need a mod

#

a pbo file containing a (possibly binarised) config.cpp file which adds to the cfgPatches and cfgMarkers is needed to edit cfgMakers

waxen jacinth
#

thanks for the information! ๐Ÿ˜˜

indigo snow
#

i know its a bit sad but theyre really separate

waxen jacinth
#

yeh, indeed it is - just thought there might be a way around it

indigo snow
#

theres drawIcon. you can use that to draw custom images

#

but they wont be markers

waxen jacinth
#

well, how do you define "markers" - with drawIcon i should be able to place an image, right?

#

or is it really drawn?

indigo snow
#

drawn in the sense the engine draws a picture on your screen

#
_mapControl drawIcon ["PATH\TO\ICON", _color, _pos,12,12,0];
waxen jacinth
#

hm...well basically i just look for an option to place an icon (instead of a marker) somewhere at the map - guess that's the way but that need lot of adjustment i guess

#

yeh just looked it up - might be the way

indigo snow
#

the coordinates on the map control correspond with game world coordinates

waxen jacinth
#

thanks, will give it a shot

waxen jacinth
#

@indigo snow since pressing "M" open map is a standard value, how would i achieve to/where to place the drawIcon statement? stucked here

indigo snow
#

you need to put it in an onEachFrame handler and excute that somewhere

#

keep in mind the onEachFrame in the notes is outdated atm

peak plover
#

There's a map opened EH

indigo snow
#

you still need to draw it each from when its opened

peak plover
#

Yeah,

waxen jacinth
#

phew...seems like i'm gonna cast away that idea

#

hmmh, the mod got an option to add clanmarkers saved in the database shown for each clanmember - so i might be able to bring them up for everyone instead of clanmembers only...

#

could be so easy, sad - dang

vernal elbow
#

can anyone help? Im getting an error for this cutText ["<t color='#ffffff' size='10'>3 DAYS LATER</t>", "PLAIN", 0.0001, true, true];

#

it tells me 2 expected, 5 delivered

#

oh sorry "5 elements provided, 2 expected"

queen cargo
#

mhh ... anybody here got an idea how i could sort this correctly?
_arr pushBack ( _arr select count _arr - 1 ) * 2.5
each space separated 'block' being a single token

not directly SQF related, but SQF solutions are accepted too
so ... for simplicity: ["_arr", "pushBack", "(", "_arr", "select", "count", "_arr", "-", "1", ")", "*", "2.5"]
goal is to have a ranking table for each token when it would be executed (ignorable tokens shall be assigned a -1)
for this particular example that would be: [1, 0, -1, 3, 2, 4, 5, 3, 4, -1, 1, 2]

#

obviously that needs to work for everything else (eg. code, array, ...) too

queen cargo
#
_var = 12.5; _var = _var + 3; diag_log _var
-------------------------------------
15.500000
-------------------------------------
To Quit, Press any key.```
ok ... kinda solved it
to some extend

just searching the start and then using recursion to solve the left/right part too
queen cargo
#

anyone here could tell me what typename {} else {} returns?

#

just noticed steam killed my arma installation again ...

barren magnet
#

sure thing

#

```typeName {} else {}````

queen cargo
#

so ... if (true) then [{1}, {2}] should work too?

barren magnet
#

this gives an error

#

this is not parsed by sqf

#

my above code

queen cargo
#

(typeName {}) else {}
thats why

#

could you check if the if (true) then [{1}, {2}] works?

barren magnet
#

yep

queen cargo
#

check

#

ty

barren magnet
#

np

queen cargo
#

so i need arrays first ๐Ÿ™ˆ

tame portal
#

This syntax gives me the creeps

#

If () then []

queen cargo
#

but that basically means else can be used to concat two values into array

indigo snow
#

{} else {} literally turns into [{},{}]

#

just sqf things

tame portal
#

Just SQF things.

queen cargo
#
_arr = 1 else 2;
_arr = [1, 2]```
((the `1 else 2` might not work though..))
#

now the question to be asked is: what is faster ๐Ÿค”

tame portal
#

I'd guess the second

queen cargo
#

probably

#

but that also would mean: remove all your "else" from code!
it eats performance

indigo snow
#

the second of course, its a command less

#

count vs foreach too its a readability thing

#

you might save a second in about 5 years time

queen cargo
#

i will save 5 years in time if i stop with my current project right now

queen cargo
#
[1.000000, 2.000000, 3.000000]
{_test = "foo"}``` stuff starts to shape
queen cargo
thick ridge
#

if you call remoteExecCall twice, is it possible for the functions being called to execute concurrently?

queen cargo
#

no

#

SQF is sequential

#

but you cannot say which one gets executed first

thick ridge
#

ok great

tough abyss
#

@queen cargo thats pretty cool

queen cargo
#

And just took me the whole evening

#

Till now

peak plover
#

๐Ÿ‘Œ

#

Great work !

queen cargo
tardy yacht
#

I tried using absolute values to make square:

w = 0.5;
h = 0.5;

That's still not a square. I don't get it.

queen cargo
#

Those translate to display coordinates

#

They do not correspond to pixels

#

Use safezone "magic" and you will be fine

peak plover
#

FULL length of W = safezoneW;

#

FULL lengt of H = safezoneH;

queen cargo
peak plover
#

Google killzone kid GUI. It's worth a read!

#

he teaches how to make a square aswell

tardy yacht
#

Alright thanks for your answers I'll give both of your suggestions a read!

spice kayak
#

Hey everyone! So I found why the Scenario Name Module (missionnameModule) was drawing my Author text from the onLoadName pool, instead of the author pool.

#
        _author = "";
        if (count allcurators > 0) then {
            _authors = [];
            {
                _curatorPlayer = getassignedcuratorunit _x;
                if (isplayer _curatorPlayer) then {_authors set [count _authors,name _curatorPlayer];};
            } foreach allcurators;
            {
                _prefix = "";
                if (_foreachindex > 0) then {
                    _prefix = if (_foreachindex == count _authors - 1) then {" &amp; "} else {", "};
                };
                _author = _author + _prefix + _x;
            } foreach _authors;
        } else {
            _author = gettext (missionconfigfile >> "onLoadName");
        };```
#

For some reason, the default function is to draw from the onLoadName, which is normally used for the Scenario Name you see on the loading screen.

peak plover
#

What are you doing ? ๐Ÿ˜„

spice kayak
#

Well, I wanted to use the module to have this cool text show up down the bottom right when the mission starts, and it worked really well until I started using the description.ext a little more. When I did, it started saying "[MissionName] by [MissionName]" instead, which I wanted to figure out why :c

peak plover
#

Alrighty

spice kayak
#

But yeah, so I went digging into the module to find out exactly why it's drawing from onLoadName and not Author, which it should be, all things considered. And I found that code I sent above.

peak plover
#

So you want to fix it?

#

Make a new function based on that... fix issue... use that instead

spice kayak
#

Well, I don't know if I can fix a module, though I should probably report it for being borked.

#

Oh, I guess that would work. I was just going to find what they used to display the text, and use that.

#

Just seems a little silly that they draw both the mission name and the author name from the exact same variable :P

peak plover
#

well, turns out they are human after all... ๐ŸฆŽ

spice kayak
#

Aww, now hastebin isn't workring for me :C

thick sage
#

consider this code:

player setVariable ["s", [[]], true];

private _a = player getVariable "s";
(_a select 0) pushBack 1;
hint str (player getVariable "s")

the player variable was changed. Does this mean that the line (_a select 0) pushBack 1; uses network?

peak plover
#

I think it's same as (_a select 0) = (_a select 0) set [(_a select 0),1];
So no...

dusk sage
#

uses network?

Local to the client only

peak plover
#

setVariable [var,value,TRUE]; only sends it out once

#

After that the value gets unsyncronized

spice kayak
#

Created my first issue on the Feedback Tracker :D

#

I actually quite like how it's laid out. It's nice.

thick sage
#

ahh, yeah. forgot about that. Great. Thanks @peak plover and @dusk sage

still forum
#

@tardy yacht Did you try what I told you? You tried to use safeZoneH in width. Which is obviously gonna give wrong results. You need to use Height for Height and Width for Width

tardy yacht
#

If I use the same number in both i.e.:

w = 0.5 * safezoneW;    //1.212121
h = 0.5 * safezoneH;    //0.9090

It gives me a rectangle. If I use:

w = 0.5 * safezoneW;    //1.212121
h = 0.5 * safezoneH;    //1.212121

It's still a rectangle.

still forum
#

Which is the more square rectangle?

#

And by how much is the better one off?

tardy yacht
#

It's off by a lot.

#

I mean, neither of them could make anyone think they're squares.

still forum
#

How about

w = 0.5 * safezoneH;
h = 0.5 * safezoneW;
tardy yacht
#

Oh yeah that might be a square.

#

If it's not it could at least fool people into thinking it is.

still forum
#

Just take a ruler and hold it up to your screen ๐Ÿ˜„

tardy yacht
#

I was thinking of doing that but thought that would be stupid.

#

I'm gonna look pretty dumb doing this

#

Yeah that's a 4 x 4 (cm) square!

#

neat

#

Thank you

still forum
#

safeZoneW get's wider the wider your screen is. And if you measure your screen and just take 0.5*width and 0.5*height ... I lost my thought... Ehh... Congrats...

indigo snow
#

So i havent done much controls, but arent x and w supposed to be absolute pixels?

tardy yacht
#

Even when using absolute values (no * safezoneX) it's still relative to a 4:3 box.

frank marsh
#

What is the most reliable way to detect what hitpoint (of a person) got hit? I'm using a HandleDamage eventhandler and the hitpoint that (seems to) get hit is not always the hitpoint that took most damage.

robust hollow
#

i dont think it wouldnt be too much more accurate that handledamage, just shows all points hit with some more info

tough abyss
#

how would i temp ban someone?

frank marsh
#

Does HitPart work in MP?

tardy yacht
#

@still forum yeah apparently that works only sometimes. I have just tried on an existing thing

w = 0.0575 * safezoneW;
h = ?;

I don't know how to apply the math there. I can't just

w = 0.0575 * safezoneH;
h = 0.0575 * safezoneW;

As this will change my boxes' width.

I can do

w = 0.1 * safezoneW/ safezoneH;
h = 0.1 * safezoneH;

And that'll be a square, but

w = 0.1 * safezoneW;
h = 0.1 * safezoneH / safezoneW;    //Or safezoneW / safezoneH

still gives me a rectangle.

ionic orchid
#

The GUI aspect ratio is 4:3 ...so try

w = 0.5;
h = w * 4 / 3;
#

That should be a square

indigo snow
#

Wont be on all monitors, tho

#

Try checking the new panel controls, theyre square for sure

ionic orchid
#

He can also try pixelW/pixelH

#

But AFAIK the GUI internal aspect ratio is always 4:3

indigo snow
#

Cheers, thanks for the link

tardy yacht
#

I have tried the 4:3 thing, it does work but I'm trying to make it fit all screens with the safezone.

vapid frigate
#

what are you trying to do?

#

make a square in the center of the screen? or in a corner/on a side?

#

topleft = safezonex, safezoney
bottomright = safezonex + safezonew - w, safezoney + safezoneh - h
center = 0.5 - (w * 0.5), 0.5 - (h * 0.5)

still forum
#

@tardy yacht You should be able to calculate the screen ratio using the safezone commands

tardy yacht
#

For height wouldn't it be safezoneH / safezoneW?

#

I don't get why it works for width but not for height.

tame portal
#

@still forum When you add multiple styles together in a control, how does the game know what specific styles were applied if the game only gets the final sum of the styles?

#

Like ST center 2 and uppercase 192

still forum
#

binary

tame portal
#

The game only reads the sum 194 and knows what styles you specified

still forum
#

Yes

#

194 & 192 -> true
192 & 2 -> true
192 & 4 -> false

#

I think it's called "Enum flags" ?

#

192 in binary is 11000000
2 in binary is 00000010
so

  00000010
& 00000010
->00000010
and every number that's not 0 is equal to a boolean true

#

Vertical Center is Up+down.. Which.. does somewhat make sense

tame portal
#

So 194(10) is 11000010(2), which is what the engine reads, right?

still forum
#

yes

#

Problem is.. They can't differentiate ST_UPPERCASE and ST_HUD_BACKGROUND

#

This is like enum flags "BI totally messed up" style

#

No they actually can because they... Gosh is that crappy code...

tame portal
#

Does the engine go through the possible styles then and looks what logical of the binary representation equals the style? As in

11000010
& 00000010 which would be
= 0000010 so it would know that style 2 applies

still forum
#

when checking casing they first & the value with 0xF0 and then check if the value exactly matches ST_UPPERCASE

#

yes

#

somewhat

#

Wait I can give you an example

tame portal
#

Oh gawd this is flawed in my head

still forum
#
    switch (type & 0x03)
    {
    case ST_DOWN:
    case ST_UP:
    case ST_VCENTER:
    }

They are first removing everything besides the first 3 bits. And then check which value matches exactly

#
    switch (type & 0xF0)
    {
    case ST_UPPERCASE:
    case ST_LOWERCASE:
    }
#

It is only a little fucked up... Only a tiny winy bit

tame portal
#

So I have 1100 0010. First remove everything but the first 3 bits

#

So I end up with 1100 0000

#

Nevertheless, is this a common technique?

still forum
#

yes

#

Google for "Enum flags"

tame portal
#

Will look at it now

#

@still forum Ahh makes sense now

#

So each bit represents one flag

still forum
#

๐Ÿ‘

tame portal
#

So all the game basically does it check for each type that exists and see if the corresponding bit is == 1

#

In the style number

#

Make sense

#

*makes

#

Silly me

#

The binary explanation was 100 times better than a decimal

devout niche
#

How would i change if (!((headgear player) to be for facewear? like glasses and stuff

peak plover
#

addGoggles

devout niche
#

if (goggles player) ?

peak plover
#

if (goggles player isEqualTo "Glasses") then {};

devout niche
#

Ah

#

Thanks alot!

brazen sparrow
#

wtf is that name?

digital pulsar
#

makes me wonder who in unicode consortium had a great idea to include oversized characters

devout niche
#

dont know honestly, saw it on maybe the rainbow 6 discord and i just added it to mine lol

halcyon crypt
#

it's quite useful when you want to @ someone

#

๐Ÿ‘Ž

still forum
#

@devout niche lul

halcyon crypt
#

you used the quick list that pops up ๐Ÿ˜›

tame portal
#

@devout niche

#

No

#

You can type in at Neil

#

That works too

halcyon crypt
#

ah it's a fuzzy search nvm then

devout niche
#

lol

tough abyss
#

It is annoying, tempted to block so i don't have to look at it ๐Ÿ˜‰

devout niche
#

ill change my name

tame portal
#

Change your name or your license to use extdb will be revoked

#

๐Ÿ”ซ

devout niche
#

๐Ÿ˜ฎ

#

shit ill cry on altisliferpg ill do it

#

yea... i cant change my name. someone want to change it to just "neil" lol

#

i can't locally change my name for this discord server

halcyon crypt
#

it's not the end of the world ๐Ÿ˜›

brazen sparrow
#

ill revoke you from real life ๐Ÿ˜›

native siren
#

Hello. Does anyone know if there a way to pull information about date/time in real life so I could run scripts based on that?

indigo snow
#

with an extension

tough abyss
#

If you are using extDB2/3 for mariadb/mysql backend it can return localtime/utc time aswell

tame portal
#

When a script uses the total runtime of 3ms in a frame, is it placed at the front or end of the queue in the next frame?

peak plover
#

in scheduled. all that does not run on this frame will be in the front on the next frame