#arma3_scripting

1 messages · Page 310 of 1

vapid frigate
#

not easily/legally

hollow lantern
simple fiber
#

Or you can create your own arrow I don't think it it especially difficult

#

It seems all the colors and textures are hard coded in the p3d

hollow lantern
#

hmm yeah

simple fiber
#

I think you can find a lot of arrow models for free on the net, it won't be like a car model which are often ripped

#
  • You can then use this model directly in the mission with createSimpleObject and don't require any mod
hollow lantern
#

thats pretty neat I'll try that later on, thanks

rotund cypress
#

Is it any way possible to take the lightbar from a Repair Offroad and attach it to a SUV?

simple fiber
#

@rotund cypress As it is in the model itself, no

#

but

#
I think you can find a lot of arrow models for free on the net, it won't be like a car model which are often ripped(édité)
+ You can then use this model directly in the mission with createSimpleObject and don't require any mod
#

Applicable to a lightbar model

#

But what I say is always 🍿 time so :/

#

:>>>>>>>>>>>>

rotund cypress
#

What I meant was doing it natively without modding

simple fiber
#

Natively no

#

But you can achieve the same result without any mod

#

As I explained

hollow lantern
#

can someone point me in the right direction? I have a script I want to run on specific objects xcam_runway_main in this case. Is there a way to do that? Because I don't want to name every object and don't want to use a marker. My actual approach atm is this: ```sqf
params["_marker", "_size"];

_pos = markerPos _marker ;
{ _x hideObjectGlobal true } forEach (nearestTerrainObjects [_pos,[],_size]);``` but as said I want to get rid of the markers 😄

little eagle
#

Just put the needed positons in the script instead of using markerPos

hollow lantern
#

yeah but need to get them. I was thinking of something like getPos xcam_runway_main or so so I don't need to grab them manually

#

@little eagle In 3DEN I would now need to right-click on every runway with classname "xcam_runway_main" and log the position. Manually. I tought there would be a automatic way where Arma just fetches every position of an object with classname "xcam_runway_main" and returns them maybe into an array?

little eagle
#

Is xcam_runway_main an object? Or a location? Or what is it

hollow lantern
#

a the classname of an object

little eagle
#

entities "xcam_runway_main"

#

^ this would report them I think

hollow lantern
#

nice thanks

#

hhmmm returns an empty array, weird

#

I think its the model hmm okay

little eagle
#

?

jovial ivy
#

What would be the best way to simplify this if any: Server_Fnc_HandleTeamPoints = { params ["_team","_command","_points"]; if(_team = "NATO") then { switch(_command) do { case "Add": {team_nato_points = team_nato_points + _points}; case "Remove": {team_nato_points = team_nato_points - _points}; case "Set": {team_nato_points = _points}; }; } else { switch(_command) do { case "Add": {team_anf_points = team_anf_points + _points}; case "Remove": {team_anf_points = team_anf_points - _points}; case "Set": {team_anf_points = _points}; }; }; };

jovial ivy
#

Oops classic mistake 😛 - And it should be, haven't had the time to test it.

little eagle
#

looks simple enough, but you make _command case sensitive with this, which I wouldn't like.

#
["NATO", "Add", 100] call Server_Fnc_HandleTeamPoints; // works :-)
["NATO", "add", 100] call Server_Fnc_HandleTeamPoints; // doesn't work :-(
jovial ivy
#

I suppose I could simply add a ToLower.

#

_command = toLower _command;😛

mortal bobcat
#

is it possible to move where the player is looking at on the map with scripts?

little eagle
#

Yes, Dylan.

#

You mean cursor, ari?

blazing zodiac
#

Is it possible to use macros (#define) in functions that are defined using cfgFunctions and not preProcessFile?

little eagle
#

Yes, CfgFunctions are a framework that is preprocessFileLineNumbers'd internally.

blazing zodiac
#

Oh, nice.

jovial ivy
#

@mortal bobcat You mean like a map teleport? If so there are posts are using onMapSingleClick or something

little eagle
#

True, I count that as an internal framework, but it's still SQF based and not internal internal as in hard coded.

#

Well it kinda is hard coded... But not C++ land.

mortal bobcat
#

i mean like when you click on a link in a briefing and it focuses on a position on the map

blazing zodiac
#

That's what I used for my respawn menu

vapid frigate
mortal bobcat
#

excellent, thank you!

blazing zodiac
#

Anyone know of a way to reliably return the currentMagazines ammo count with currentMagazineDetail? Also why the hell does that command return a string and not an array??

vapid frigate
#

includes the current magazine, but all other mags too

blazing zodiac
#

Oh nice, that works

#

The magazine state solves my issues

#

thanks

vapid frigate
#

np

blazing zodiac
#

Ah, makes sense

#

would just be a whole hell of a lot easier if it returned an array

vapid frigate
#

ugly HUDs though

#

with 6.5mm 30Rnd STANAG Mag(30/30)[id:0]

blazing zodiac
#

right, you would still have to trim it down with splitString to display to 30/30

#

just seems odd to me in general, takes an otherwise useful command and makes it annoying to work with

rancid ruin
#

not sure currentMagazineDetail is the best tool for that job

#

oh you're gonna use magazinesAmmoFull never mind

blazing zodiac
#

The question then becomes, what the hell are you supposed to use it for

vapid frigate
#

i guess it's sort of a unique ID for the mag? (because it has that [id:0] bit at the end). still not sure what you could use it for though

rancid ruin
#

probably mainly for debugging

#

it was added in 0.5

#

and yeah fuck knows why it's a string

blazing zodiac
#

does anyone off the top of their head know if all of the A3 weapons stick to the naming format for mags?

#

shit

#

nevermind

#

they don't, making that command basically useless for getting ammo count

rancid ruin
#
_magazine = currentMagazine player;
_fullCount = getNumber(configFile >> "CfgMagazines" >> _magazine >> "count");
_count = player ammo (currentMuzzle player);
#

that's what i used in an ammo HUD thing

#

was making a little UI which displayed all your ammo, like the old CODs

blazing zodiac
#

Oh, perfect

rancid ruin
#

like having 300 little rectangles in the corner of your screen which change colour as they're fired

#

not sure that code is the best way to do it, mind. but it works

blazing zodiac
#

I actually only need the current ammo count so that last line is all I needed

#

So thank you very much

#

I truly do love this place

rancid ruin
#

no problem

hollow lantern
#

@little eagle I meant that the array thats returned is empty. I have a T-80UK of RHS on the map aswell (Classname: RHS_T80UK). If I enter that instead of the runway classname I get a filled array with data. I also tried it with CUP runways (I actually use them now because the Map is from CUP Terrains anyway)

blazing zodiac
#

I remember seeing a video years ago in ArmA 2 I think with a shooting range and pop up targets and a HUD element of the pop up target that showed where your bullets were impacting. Does anyone remember/have a link to/know how this was accomplished?

open vigil
#

Like a (pip , picture in picture) type element? Or like visible bullet trajectories?

blazing zodiac
#

like a pip type element

halcyon crypt
#

that seems to have some stuff like that

blazing zodiac
#

Oh I didn't think of doing it with a live cam, this one was a 2d image of the target popup with x's for the impact positions

vapid frigate
#

its just a script.. will likely need to be modified (at least the actions on the shelf things)

little eagle
#

@hollow lantern
Xcam_blah is probably not an objects, but something else

blazing zodiac
#

This is exactly what I'm talking about lecks, thanks.

vapid frigate
#

np.. the script is a bit complex because it builds the whole stand and stuff.. but should be able to extract what you want if you don't want that part

hollow lantern
#

@little eagle well I also did it with a cup "road" CUP_A2_RUNWAY_MAIN that is also not working. I guess these roads are not real objects as a vehicle might be

little eagle
#

How do you even find them in the editor?

#

I mean. There are other ways to get the map position of the airports.

hollow lantern
#

search for them? They are available in 3DEN like any other normal object

#

its not a normal airport because I built a runway with these objects

#

so there is none on the map originally

little eagle
#

hmm

#
allMissionObjects "CUP_A2_RUNWAY_MAIN"
#

^ try this one

hollow lantern
#

thanks commy2 that actually worked

little eagle
#

yw

hollow lantern
#

[1c0d2af5600# 428891: runway_main_ep1.p3d,1c0d2af6080# 428890: runway_main_ep1.p3d,1c025756080# 428477: runway_main_ep1.p3d,1c0c6a04100# 428462: runway_main_ep1.p3d,1c0c6a04b80# 428461: runway_main_ep1.p3d,1c0c6a05600# 428460: runway_main_ep1.p3d,1c0c6a06080# 428459: runway_main_ep1.p3d,1c0c6a06b00# 428458: runway_main_ep1.p3d,1c0c6a07580# 428457: runway_main_ep1.p3d,1c0cc40ab00# 428455: runway_main_ep1.p3d,1c0cc40b580# 428454: runway_main_ep1.p3d,1c0bf07c100# 428453: runway_main_ep1.p3d] hmm not sure what exactly I need to select from the array in order to get sqf { _x hideObjectGlobal true } forEach (nearestTerrainObjects [allMissionObjects "CUP_A2_Road_OA_runway_main_ep1",[],_size]); working. BIKI tells me thatI need PositionAGL or Position2D but in the array above I just see id's

little eagle
#
{

} forEach allMissionObjects "CUP_A2_Road_OA_runway_main_ep1";

???

hollow lantern
#

but I don't want to hide the runway I want to hide nearestTerrainObjects near them

#

and normally the command gets a position or object (via variable name) and then removes stuff

#

but I would need to give every runway section a name then

#

which I try to avoid atm

little eagle
#

Which terrain objects?

#

You definitely need two forEach loops then.
hide each terrain object around each airport.

hollow lantern
#

I stated [] which includes everything. But the most common would be "TREE", "SMALL TREE", "BUSH", "HOUSE", "FOREST BORDER", "FOREST TRIANGLE", "FOREST SQUARE", "CROSS", "ROCK", "FENCE", "WALL", "HIDE", "BUSSTOP", "ROAD", "FOREST", "ROCKS", "POWER LINES", "RAILWAY", "SHIPWRECK", "TRAIL

little eagle
#

So many shipwrecks on the runway these days.

#

2 forEach, one inside the other.

hollow lantern
#

ah I get

#

it

#

n1 thanks commy2 ```sqf
{
{ _x hideObjectGlobal true } forEach (nearestTerrainObjects [_x,[],_size]);
} forEach allMissionObjects "CUP_A2_Road_OA_runway_main_ep1";

rugged basalt
#

I would like to ask about publicVariabless

#

are they sent sequentially or in random order?

#

so if i send someVariable and then I send SYNCHRO_DONE

#

can I be sure that if SYNCHRO_DONE is set then someVariable is set too?

turbid thunder
#

@rugged basalt If you have small values you'll not notice any delay with the syncing aka its basically instant

#

Both would be set

cedar kindle
#

it's not guaranteed

#

arrival order that js

#

is

rugged basalt
#

hmm

#

so I need to check isNull for every value?

#

a lot of work

#

@turbid thunder It's a multidimensional array 3*8

turbid thunder
#

@rugged basalt just check if the client has a variable in the array name

rugged basalt
#

yeah but there's also the other array

#

and the other one

#

so 3 in total.

#

what If I would have 10?

#

lol

turbid thunder
#

Pack it all into one big array

rugged basalt
#

that's simple elegant solution

#

thanks for the idea

#

you may wonder why im doing this

turbid thunder
#

Dont spam sync though

rugged basalt
#

it's only synced on init

turbid thunder
#

Then its ok

rugged basalt
#

im working on bomb defuse script

#

code and sequence to defuse the bomb is random. I need that randomized on server then sent to all clients

#

because if I would randomize it on clients then every client would have other combination 😄

cedar kindle
#

init the bomb when server sends code/seq

turbid thunder
#

Randomize it on server only --> publicVariable it

rugged basalt
#

yeah that's what im gonna do

#

yeah, that's why I was asking about publicVariable

turbid thunder
#

isNil becomes obsolete unless you need that array instantly

rugged basalt
#

gonna make something like waituntil {!isNil(SEQUENCE)}

#

in client only code

jade abyss
#

oO

#

Why not just start a function from the Server, instead of using waitUntil?!

turbid thunder
#

Even better

rugged basalt
#

that may be even better idea

jade abyss
#

¯_(ツ)_/¯

#

I know, i am the best

#

😂

turbid thunder
#

Only do smth with the variable when the player is actually interacting with the bomb

jade abyss
#

How is he interacting?

#

By Dialog?

rugged basalt
#

dialog

#

it's already done

jade abyss
#

Yeah, then just countercheck the Var, set by the Server via missionNameSpace setVariable["var",VarEntry,TRUE];
Done

rugged basalt
#

how is this different to publicVariable?

jade abyss
#

So, anything else? Otherwise i am back at watching Dwarf Tossing.

#

tbh... i always forget what the difference was. I prefer SetVar True, instead of PubVar. Easier to write/handle/Target

rugged basalt
#

looks like PubVar uses already set value

jade abyss
#

PubVar = sends to everyone

rugged basalt
#

setvar creates new one

jade abyss
#

setVar = Can be targeted to Obj, nameSapce, can be send to all or not etc

#

SetVar creates a new "what"?

rugged basalt
#

variable*

jade abyss
#

It can, it can also alter existing ones.. but... erm... yeaht, thats just normal^^

rugged basalt
#

okay thanks professor

#

😀

jade abyss
#

"Grandmaster" or "Halfgod in black" is enough

rugged basalt
#

im better

#

because im GODLIKE

#

muhahha

jade abyss
#

Yeah... no

#

😄

rugged basalt
#

it's heavily modified version of cobra4v320 script. Gonna make it publicly available after mission release

tough abyss
#

Does any one know the action for "Activate mine"? I can only find deactivateMine

spice arch
#

So i've been looking through some documentation and I can't find much about displays. It seems like using display 46 is a pretty common thing and I'm trying to find more information on that but the documentation is either not there or really hard to find. Can anyone help me with this?

jade abyss
#

display 46 = MainScreen you see, when you are ingame.

#

The one where you see Ammo, Stamina, GPS etc.

spice arch
#

Yeah so I've seen that around but I'm curious to what the other displays are and if there is any documentation on this?

jade abyss
#

They are in the A3-unpacked Config files

#

"idd"

#

UI_F.pbo for example

dusk sage
#

I don't think anyone has documented them all, there is some small lists scattered at the wiki though

jade abyss
#

(findDisplay 602) = Inventory (another example)

spice arch
#

ah okay, one other question. I notice also that it seems to be common practice to add eventhandlers for keyup keydown to display 46. Is that just common practice or is there a reason for it?

jade abyss
#

You have to search for the desired names for yourself 😉

#

Its one way to get rid of the ActionMenu

#

e.g.: Adding a Function to a button, instead of an addAction (ScrollwheelMenu)

spice arch
#

hm, so am i understanding this correctly, if i add an eventhandler for keyup/down to display 46 it will only function when i am on the main display. For instance if i add an eventhandler to display 602, then it will only function when I'm looking at the inventory?

jade abyss
#

Yep

spice arch
#

ah k ty

jade abyss
#

So basicly... add a KeyDownEH to Display46 (for example Button W will execute a hint msg) -> won't be executed, when Inventory is opened

tough abyss
#

@tough abyss what do you mean by activate mine?

#

hmm intresting

#

Trolls are having fun with it at the A3W stores

little eagle
#

fix it

tough abyss
#

mines are still bitches and just a new thing to consider fucking with them...

#

Yeah had to walk away for a bit. Need to find what the action is

little eagle
#

Is it the vanilla action?

#

Or does Wasteland add it's own system

tough abyss
#

No, I guess its new. AgentRev would have noticed that I think

jade abyss
#

didn't mines active the "Put" EH, when placing?

tough abyss
#

I'll know for sure later tonight when I test the ```systemChat _action

little eagle
#

Well if it's a custom action, I would just add "not in gun store" to the condition instead of doing tricky hacks.

jade abyss
#

yerp

tough abyss
#

No custom actions

little eagle
#

So it is the vanilla action after all

tough abyss
#

I'll know for sure later tonight when I test the systemChat _action

jade abyss
#

I mean, you will use ScrollMenu EH, should be easy to filter/blacklist/whitelist everything except the needed stuff.

little eagle
#

TouchOff
TouchOffMines
SetTimer
StartTimer
Deactivate

jade abyss
#

Must be put then

little eagle
#

PutWeapon

tough abyss
#

Also doing a text search in the code for "Activate mine" came up with nothing. From what Agent said and my guess its a new action. Not sure why they wouldnt use activateMine when deactivateMine has been there

jade abyss
#

wasn't it "place mine"?

tough abyss
#

No It was already on the groundsimulator

jade abyss
#

Ah, kk

tough abyss
#

once you active it you can use the action timmer and touch off

little eagle
#

TakeMine
DeactivateMine

jade abyss
#

But doesn't Mines activate automaticly?

tough abyss
#

DeactivateMine mine worked when I tested it

#

thought they would just make it activateMine.

jade abyss
#

¯_(ツ)_/¯

little eagle
#

TouchOff
TouchOffMines
?

tough abyss
#

If you place them on the ground they dont activate automaticly

jade abyss
#

Thats blowing up, Commy

little eagle
#

Uhm.

tough abyss
#

Yeah I'll try that. Im away from the test box

jade abyss
#

Packing my Prototypethingy here, gonna start Arma after that

little eagle
#

Don't forget
SetTimer
StartTimer
otherwise they can use the timer I think

tough abyss
#

will do. thank you

jade abyss
#

Any specific mine?

#

@tough abyss

#

"UseMagazine"

#

Tested with: Satchel, Apers Mine, Apers Bounding Mine and Claymore.

tough abyss
#

You can bypass it now by just puting it on the ground and "Activate mine" to get the actions placed would give

jade abyss
#

Oh, you mean by dropping it trought the Inventory?

#

Or how?

tough abyss
#

Yeah

jade abyss
#

Oh, i didn't knew thats working

tough abyss
#

It must be new... I think

jade abyss
#

Oh yeah, it works

tough abyss
#

Would have caught that awhile back

jade abyss
#

Only with a single Charge in it.

#

"UseContainerMagazine"

tough abyss
#

mines will do it too

#

huh yeah

jade abyss
#

Nah, if you have 2 charges in it -> No Action (since it doesn't know wich one)

tough abyss
#

wait we need that for people to put things on the ground and trade at the stores, I think

#

nice

jade abyss
#

I mean... if it would be possible to remove SingleItems from a Container/Vehicle, without deleting and refilling everything in it... it would be easier

#

*pokes BIMinions*

tough abyss
#

lol

jade abyss
#

Missing Command since OFP - No adding in sight 😄

jovial ivy
#

player setVelocity [0,0,1e38]; - Theres no limit on this command?

jade abyss
#

There is

#

(no clue, what you mean with Limit, so first answer is: There is.)

jovial ivy
#

I can only imagine going that fast would crash a game atleast.

jade abyss
#

It does crash, yeah. Whats your point?

#

The velocity would be just "too fast".

#

But speed like player setVelocity [0,0,500]; do works.

jovial ivy
#

Just saying it probably isn't the best thing having that even possible. I can understand anti-hack reasons. But imagine a hacker just unleashing this on a server full of people.

jade abyss
#

Some of my former Teammates reported about some strange overall behaviour, when a Planes was flying faster then Speed of Sound (can not confirm).
iirc they mentioned faster Anims etc. no clue anymore. too long ago.

jovial ivy
#

Hmm

jade abyss
#

If a "hacker" is able to execute that command... nah.. i think he prefers to do other stuff, then just letting player crash. That would be boring.

#

I mean... he would kickout the ppl out, he wants the attention.

#

¯_(ツ)_/¯

jovial ivy
#

Indeed

tough abyss
#

The setpos limit in your beconfig might help that but yeah that would be bad. Think A3Wasteland used somthing like that to kick hackers flagged (crashes the client) but it broke a couple Arma updates ago

little eagle
#

Way too complicated

#
_a = {call _a}; isNil _a;
tough abyss
#

huh I'll try that.

jovial ivy
#

How would I pull the ammo count as a integer from: currentMagazineDetail?

little eagle
#

Can't you use a different command?

jovial ivy
#

To get ammo from the current magazine?

jade abyss
#

Currently loaded mag?

indigo snow
#

Check Example 3 on the wiki page for the command

little eagle
#
player ammo currentMuzzle player
#

There is no point in using currentMagazineDetail for this

#

¯_(ツ)_/¯

jade abyss
#

something like this should also work

_AmmoCount_Mag = 
{
    if((_x select 4) IsEqualTo (currentWeapon player) )exitWith
    {
        _x select 1;
    };
}forEach (magazinesAmmoFull player);```
little eagle
#

xD

hollow lantern
#

what exactly does a Grass cutter on the scripting side? Do I really need that object for removing grass or will a setDamage on the grass class also work?

dusk sage
#

grass cutter 😄

little eagle
#

cut grass

#

It does no scripting. It's just a plane that pushes down the grass, but is invisible and can be walked and fired through.

hollow lantern
#

ah

jade abyss
#

More or less just for "cutting the grass". Nothing else. Cleaning up the ground, where needed.

tough abyss
#

@jade abyss @little eagle It was UseContainerMagazine 👍

jade abyss
#

invoice comes later. @torn juniper Would you pls?

#

😄

little eagle
#

UseContainerMagazine

#

Never heard of that

tough abyss
#

💰

jade abyss
#

Same here Commy. Prolly just for Mines.

little eagle
#

It's not in CfgActions. Custom? Or is it new

jade abyss
#

Not even WikiPage oO

#

config.bin/CfgActions.UseContainerMagazine'.

little eagle
#

So it's a new thing in 1.68

jade abyss
#

Can't check atm. Packing Island

#

Can't even find anything on Google

little eagle
#
isClass (configFile >> "CfgActions" >> "UseContainerMagazine")
true
torn juniper
jade abyss
#

Thx

torn juniper
#

anytime

#

haha

jade abyss
little eagle
#
hideOnUse = 1;
priority = 9;
shortcut = "";
show = 1;
showWindow = 1;
text = "Activate mine";
textDefault = "<img image='\A3\ui_f\data\igui\cfg\actions\ico_ON_ca.paa' size='1.8' shadow=2 />";
textSimple = "";
jade abyss
#

Okay, so for Mines Only

little eagle
#

[bin\config.bin/CfgActions/UseContainerMagazine,bin\config.bin/CfgActions/ActivateMine]

#

There are two actions with exactly the same string.

#

ActivateMine and UseContainerMagazine

tough abyss
#

I tried that. Doesnt work... ActivateMine

little eagle
#

Yeah, because BI added another one in 1.68 - UseContainerMagazine

tough abyss
#

maybe they are saving it for later lol

little eagle
#

Who knows for what

jade abyss
#

hmm

#

I got an idea

little eagle
#

oh boy

jade abyss
#

Some stuff like Interaction with Items, without using addAction to stuff etc. blablub

jovial ivy
#
_newPos = [(_position select 0) + floor random(3) , _position select 1, (_position select 2) + floor random(3)];``` would this work to add a random number to x and z? Not entirely sure if it would work(dont have time to test)
jade abyss
#

(dont have time to test) <- ?

#

The time you used, to write that post could have been the time, you copy that in the DebugConsole 😄

jovial ivy
#

As in the ingame debug console? I suppose, but that would require me to launch steam and proceed to launch arma 😛

jade abyss
#

Thats what you usualy have open, when writing code 😉

jovial ivy
#

I guess 😉 - Im just writing a few small bits and pieces i've been too lazy to write.

jade abyss
#

Not a big thing (means it should work)
(_position select 0) + floor random(3)
->
( (_position select 0) + floor (random 3) )

jovial ivy
#

Gotcha.

tough abyss
#

Or you could use getrelpos + random direction + random distance.
Although i do wonder why you want a respawn position that may spawn unit in the air 3 meters 😃
edit: nm you need to past it an object

jade abyss
#

shush!

#

Don't spoil everything 😄

lime gazelle
jade abyss
#

Why? Wanna kill the Server quickly?

#

while{}do <-

#

(don't know why you need something framePrecise on the Server, but okay)

#

diag_TickTime -> Comparing them to other times

#

uisleep

#

diag_TickTime

jovial ivy
#

@tough abyss I remember old issues like that back last summer when I played on your server alot. On defense missions or something where they would last 5x longer then they should have 😛

jade abyss
#
_StartTime = diag_TickTime;
waitUntil{diag_TickTime > (_StartTime + 10); uisleep 0.1;};```
jovial ivy
#

It was invigorating. Shooting AI and getting shot back for 50minutes 😄

#

Probably. Did you add CAS back? Or you leaving that out for longer.

#

Ah. Im debating on buying that bundle. Not entirely sure if its worth it yet.

jade abyss
#

Excuse me?

lime gazelle
#

smh..

#

Is there a best practices discussion anywhere for preventing script exploits?

#

Any. I've noticed a number of mission makers putting in specific lines to prevent script exploits and curious if there is anywhere to research them more to prevent them.

#

as an axample // block script injection exploit inGameUISetEventHandler ["PrevAction", ""]; inGameUISetEventHandler ["Action", ""]; inGameUISetEventHandler ["NextAction", ""];

jade abyss
#

uh, wut?

lime gazelle
#

That is what I am looking for. Information regarding exploits, current exploits to watch for etc.

#

Poor programming issues etc?

jade abyss
#

poor scripting issues mostly

#

like leaving the DebugConsole enabled in the ServerConfig

#

or having no SignatureFilecheck...

#

¯_(ツ)_/¯

lime gazelle
#

Seams like a lot of that would be common sense

jade abyss
#

Thats what you loose pretty quickly.. many many ppl just don't have common sense

#

Or beeing able to connect 2 simple thoughts/hints together

lime gazelle
#

Push button to sell car being spammable is something that I didn't know

#

This is the issue of working on a mod and scripting for two years but in issolation.

jovial ivy
#

Theres still a few major exploits going around with Arma 3 Addons. In fault of signature scanning.

#

Indeed. It's sad but true.

#

Checking actions for an antihack wouldn't be hard I suppose(as in a server script). Removing most action menu type hacks.

jade abyss
#

lol

#

those addActions are Clientside. So must be run on client.

#

```sqf
CODE (starts in the next line)
```

#

sqf -> Next line: Code

#

exactly Nom

lime gazelle
#

Nice!

#

Thank you @jade abyss

jade abyss
#

yepyep

lime gazelle
#

I don't mind it, was just curious if there were any resources for it. I work in a place where I have hours with computer use to browse so I can research

jovial ivy
#

I dont really trust infistar too much. Dont get me wrong its a great AH, but its past scares me(from old exploits as in backdoors)

#

Indeed. As well as their UID's in the code so atleast they allow that 😛

jade abyss
#

Quiksilver - Today at 3:49 AM
well its open source,

Since when?

#

🤦

#

Just because you can edit it, doesn't mean its "Open Source"...

#

🤦

still forum
#

Obfuscated code is not really source code... Even by definition it isn't

blazing zodiac
#

Does anyone have a consistent way to force an ai to move to a position even when it's in combat, only way I've been able to do it is with a combination of disableAI flags, setBehaviour, forceSpeed, and doMove

#

and even then it doesn't work once the AI has engaged for the first time

rancid ruin
#

does disabling FSM on ai help? or would they just not move at all then?

#

ok, wiki note says

FSM: Essentially makes the enemy "dumber". Enemies react slower to enemy fire and the enemy stops using hand signals. Disabling FSM, can give the impression of untrained units as they react slower and are more disorganized than when FSM is enabled. Good for rebel fighters and when enabled better for professional armies.
vapid frigate
#

if people have 3 monitors in arma, are they always the same resolution (or UI size)?

#

so safeZoneX - safeZoneW = safeZoneXAbs in those cases?

rancid ruin
#

check killzone kid's article on safezone, it explains it well and in more detail than someone can do in chat really

vapid frigate
#

it doesn't really say either way, but going to just assume they'd all be the same size

#

if not, they'd probably be used to things looking wrong anyway

rancid ruin
#

hahaha brutal

hollow lantern
#

ArmA 3 on a 75 inch 720p TV looks weird ^^

thin pine
#

Any recommendations for IDEs for ArmA scripting? I'm getting tired of Np++

hollow lantern
#

I use Intelij IDEA Ultimate but most of the guys here use Atom I think

little eagle
#

Sublime Text 3

rancid ruin
#

what's wrong with np++?

#

either that or sublime is the best choice imo...atom, brackets, vs code are quite slow

simple fiber
#

IDEA has a syntax checker and a project manager

#

But sublime is simpler

little eagle
#

I tried opening the AllInOne config with NP++, but it took twice as long as it does with ST3, so I de-installed it.

simple fiber
#
  • Great plugins
#

If you want to replace NP++ you can try ST3

#

It would be the best choice imo

little eagle
#

The best syntax checker is in my head and the only debugger is "Play Mission".

thin pine
#

😄

simple fiber
#

I'd rather winning some time with a syntax checker

#

I guess it depends on what you like

#

🤷

rancid ruin
#

i stick with np++ cos i've used it for years and have learned it's shortcuts etc

#

don't see the point in switching editors all the time, although i tried

little eagle
#

Good attitude

simple fiber
#

^

thin pine
#

Thanks for the suggestions guys. NP++ is good, I'm just checking what's out there with SQF support, keeping an open mind

rancid ruin
#

use atom on my linux machine cos it's the best native editor imo, but is a bit sluggish

simple fiber
#

Stick with what you know unless you feel the need of smth else

little eagle
#

How is the best editor "sluggish"?

simple fiber
#

Slow af

little eagle
#

That disqualifies it imo.

rancid ruin
#

someone made a 1.60 syntax highlighter for np++, i just update that whenever new commands are added

little eagle
#

ST3 syntax highlighting is at 1.68

rancid ruin
#

i mean in terms of features, it does what i want. but it could be faster.

little eagle
#

And it's also used by Github.

rancid ruin
#

ye but i don't know any shortcuts on ST3 😄

#

i kinda like the native windows UI of np++ too, ST doesn't really fit in with other native apps visually

#

same with atom

#

i just called desktop programs apps, brb killing myself

tame portal
#

@little eagle What's the main difference between Poseidon and just using the actual sublimetext?

little eagle
#

No idea. Never used Poseidon.

tame portal
#

So just plain sublimetext with support for SQF

rancid ruin
#

poseidon has a hammer and sickle icon, that's it's main selling point

thin pine
#

I found the lack of tree view file-structure in NP++ disturbing, but I just found out they added that since 6.9. Amazing

little eagle
rancid ruin
#

nice, just realised i haven't updated in 3 years

little eagle
#

poseidon has a hammer and sickle icon, that's it's main selling point
🤦

willow basin
#

Is the Sublime Text Plugin still being updated?

little eagle
#

The one I linked? yes.

#

Jonpas added 1.68 a week ago

rancid ruin
#

just updated np++ and it closed the 100+ files i had opened and reset my theme, nice nice

#

anyone know a good new IDE?

willow basin
thin pine
#

Why did you have 100 files open? 😄

rancid ruin
#

we won two world wars so people can have hundreds of tabs open in their web browsers and text editors bro

keen stream
#

@thin pine I've switched to Atom with the plugin made by the ACE guys. Works like a charm! 😄

blazing zodiac
#

Does anyone know if its possible to attach an object to a characters head so that it rotates when you free look with your heads movement?

thin pine
#

without a per frame handler/loop it is not possible unfortunately

hollow lantern
little eagle
#

bb_tankflip
👍

fallen moss
#

Can a SQF dev message me

hollow lantern
#

yep the BaerMitUmlaut is strong with this one

little eagle
#

initHC.sqf

#

Is this a thing or is this called manually?

hollow lantern
#

its called by the headless client (automaticlly)

#

if you want some scripts to be run on the hc put them there

#

like the initServer.sqf but for the headless client

thin pine
#

You sure it isn't called manually?

hollow lantern
#

yes, maybe our Mission-Framework does this automaticlly, I'm gonna check that

#

but since I never used it without its almost automatic for me

#

but lets see

#

looked up in our framework serverside mod but nope its not called there in any way so I guess its automatic loaded

fallen moss
#

Looking for a SQF Dev to teach me how to script will pay for said time 😃

dusk sage
#

The wiki teaches for free ;)

#

Check your initPlayerLocal? @hollow lantern

hollow lantern
#

this is empty

#

^^

dusk sage
#

I don't think any initHC is called automatically

little eagle
#

Maybe it isn't loaded at all. Placebo file

dusk sage
#

Where did you see it?

little eagle
#

screenshot

fallen moss
#

Can you link me Boguu?

little eagle
fallen moss
#

Where would i be looking in the WIki?

little eagle
#

That depends on what you're looking for I guess.

fallen moss
#

Scripting

#

im having mad trouble trying to teach myself how to script

#

and no one on here is being much help which is fustrating

dusk sage
#

KillZoneKids blog will also help you

little eagle
fallen moss
#

@dusk sage theres not much info on that area

#

and i have a base understanding on io

#

it

dusk sage
#

There is many links at the bottom of that page

fallen moss
#

im more or less looking for custom sfcripting ect

dusk sage
#

What?

fallen moss
#

Like learning how to create custom scripts

fallen moss
#

im looking at that

dusk sage
#

That teaches you language syntax etc. The wiki contains documentation for practically every command

#

And a large amount of BIS functions

fallen moss
#

Yeah im looking mainly looking for SQF for altis life

dusk sage
#

....

#

It's written there

little eagle
#

Altis Life is a mod and you won't find any info about that specifically on the wiki.

dusk sage
#

Altis Life isn't special, it uses the same SQF as everything else

little eagle
#

True, but the wiki is generally about SQF and not about specific missions.

fallen moss
#

Well yeah but i would rather who is experienced just teach me

dusk sage
#

Nobody wants to teach somebody who doesn't want to learn

fallen moss
#

Cause my server cant wait 6 months while i wait

#

while ill learn

#

and also ive spent 1-2 years trying to learn

#

so im trying to learn

dusk sage
#

And you've got nowhere :/?

little eagle
#

2 years is enough to know everything there is to know.

fallen moss
#

I have a basic understanding but custom scripts are the issue

dusk sage
#

You can become proficient in a matter of weeks just reading the wiki

#

Nobody is exempt from that, there isn't that much to know to do your own thing

#

Anything you write in SQF is a 'custom script'

fallen moss
#

well yes but i want to learn how to build my own script

dusk sage
#

Open a text editor

#

Write some SQF in it

#

Put it in your mission

little eagle
#

Essentially.

dusk sage
#

You seem to think there is some secret that people aren't telling you, there isn't unfortunately

little eagle
#

I have all the secrets, but I wouldn't tell BoGuu.

fallen moss
#

Well sorry that i have 5 disabilities and im having trouble understanding a few things

bitter bough
#

Trying to work with dialog boxes, is there something I borked in this?

TAG_fnc_DisplayText =
    {
        _text = ctrlText 1400; //grab the text entered into resource 1400 (our edit box).
        Hint format *“%1”,_text+;
    };

It looks normal to me but I feel I might have borked something.

hollow lantern
#

@little eagle @dusk sage yep, InitPlayerLocal.sqf with

if (isHC && !didJIP) exitWith { [localHC] execVM "initHC.sqf" };
if (!isMultiplayer)  then     { [localHC] execVM "initHC.sqf" };``` thats howwe run the initHC.sqf
dusk sage
#

Called it ;)

hollow lantern
#

yea, manual then

#

¯_(ツ)_/¯

vapid frigate
#

@bitter bough you need a reference to the control before ctrlText

little eagle
#
format *“%1”,_text+;
dusk sage
#

@fallen moss I don't want to be rude to you, and that's unfortunate. But please don't say that and expect a response, were giving you advice whether you choose to accept it or not

little eagle
#

this looks wrong

fallen moss
#

im accepting it but what ever thanks

vapid frigate
#

erro sorry, after it

bitter bough
#

Sorry, somewhat new.
How would I go about referencing it?
I've got like 3 other files working together to get this UI to work xD

fallen moss
#

ill go read all that Wiki ect and KK's blog stuff and see how i go

vapid frigate
#

actually that might work if your IDC is 1400.. but sure how it knows which dialog though

dusk sage
#

That's all you really need to write your own things, yep

rancid ruin
#

what are you having trouble with @gentle marten?

#

oops wrong ghost

bitter bough
#

Alright, so how would I go about specifying which Dialog?

dusk sage
#

He wants to write his own scripts

vapid frigate
#

usually i would use _control = (findDisplay _IDD) displayCtrl _IDC;

rancid ruin
#

i would suggest pulling apart smaller missions. don't rip apart something big and fucked like altis life. look at small scripts and mods, figure out how the author made them. rinse and repeat.

little eagle
#

The problem is not ctrlText, it's the fucked up format

vapid frigate
#

then _text = ctrlText _control .. but as commy2 said, somethings definitely wrong with that format too

rancid ruin
#

also hardly anyone will help you with altis life. anyone already in the life scene will view you as a competitor. anyone not in the life scene will view you as a scrub.

bitter bough
#

@little eagle what is wrong with the format space?

vapid frigate
#

format ["%1",_text];

little eagle
#

^

#
format *“%1”,_text+;

^ this is 100% wrong

dusk sage
#

That is not true no @rancid ruin

bitter bough
#

that explains a bit

#

lemme test that

rancid ruin
#

which bit boguu?

dusk sage
#

also hardly anyone will help you with altis life. anyone already in the life scene will view you as a competitor.

#

But, not today

little eagle
#

Also careful with those quote marks
“ and ”
are not
"

bitter bough
#

wait, there is a diff?

rancid ruin
#

i mean knowledgable life devs, if any exist. rarely do you see life devs helping each other.

little eagle
#

Only " works in scripts. Well and '

#

But not “ and ”

bitter bough
#

Whew alright

little eagle
#

french keyboard?

dusk sage
#

You may not, but they do, yes

#

I think we should get some SQF trigraph support for funny syntax ;)

bitter bough
#

Nah, american. I'm trying to follow a simple tutorial and it's ended horribly

little eagle
#

oneoh just called BoGuu not knowledgeable.
🔥

bitter bough
#

I can use this to execute the box right?
createDialog “myDialog”;

#

or wait

vapid frigate
#

quotes are wrong again, but other than that, yeah

bitter bough
#

is that the "

little eagle
#

No, wrong quote marks

bitter bough
#

issue again

#

fug

little eagle
#

time for a mass replace

bitter bough
#

that's quite confusing

vapid frigate
#

sounds like probly the web site you got the tutorial off

dusk sage
#

Is that some copy paste fu

vapid frigate
#

text editors don't generally type those

little eagle
#

I agree. Those weird sideways quote marks should've never been introduced.

dusk sage
#

Always happens with quotations

rancid ruin
#

hey at least it doesn't include line numbers like some shitty code sections on websites

bitter bough
#

Going in for another test.

#

^^

dusk sage
#

I've seen people copy the + and - from Git diffs

little eagle
#

Reminder that

2 +++ 2

is valid SQF

bitter bough
#

wut

little eagle
#
2 +++ 2
2 ++ (+2)
2 ++ 2
2 + (+2)
2 + 2
4
bitter bough
#

Well good news. No errors, but my box doesn't show up.
getting somewhere

dusk sage
#

'Poo' + + 'bar' will produce PooNaN in JS. Stupid fun fact for the day. Atleast we're not using JS

vapid frigate
#

@bitter bough there's likely a bunch of quotes in your config too

bitter bough
#

I've looked

little eagle
#

Nah, simple script error, because unary + STRING doesn't exist

bitter bough
#

sadly nothing was there that was wrong

rancid ruin
#

at least you can increment something in JS without going var = var + 1

little eagle
#

write a macro

#

burp

dusk sage
#

But we can't add strings and numbers so it's okay

#

😋

bitter bough
#

Not to mention I don't have any configs.
Unless the diag.hpp is a config, then I suppose?

dusk sage
#

It is yes

little eagle
#

The description.ext is a config

#

And the mission.sqm technically too

#

Although rarely edited by hand

bitter bough
#

Huh, I know the .ext isn't wrong. We've used that thing for months

#

possibly years

vapid frigate
#

have you added the #include "diag.hpp"?

bitter bough
#

yeah

dusk sage
#

I used to edit the SQM by hand, but it's alot scarier since eden

#

Keep clear of it

bitter bough
#

#include “myDialog.hpp”

#

wait

vapid frigate
#

can you access the mission SQM config via SQF?

bitter bough
#

.....

vapid frigate
#

lol

bitter bough
#

I'm gonna kill these things

rancid ruin
#

editing sqm is a sure fire way to have a bad time

little eagle
#

getMissionConfigValue, Lecks

bitter bough
#

I control F'd every one

vapid frigate
#

nice, tnx

bitter bough
#

Ugh, I don't like how hard those are to find in N++

#

does the import need a semicolon?
I don't think it does but I could be wrong

dusk sage
#

No

bitter bough
#

alright thought so

rancid ruin
#
kinda over this Arma 3 discord
ill just do everything myself and fuck these big top notch Devs
  • that guy 5 mins ago who wanted to learn scripting
#

well done guys you tilted him

dusk sage
#

Lol

#

We linked him the wiki guides

#

He was looking for a personal tutor

rancid ruin
#

i told him that's a sure fire way to get scammed, but he wasn't having any of it

#

sad people have that outlook 😦

dusk sage
#

Professional developers that have degrees in coding and that have worked on assassin's creed

#

That also know and can teach SQF

#

That's handy

rancid ruin
#

maybe i'm wrong but trying to go from 0 to modifying and customising a full blown complicated mission like Life is totally the wrong way to do shit in my opinion

dusk sage
#

He said he's been learning for 1-2 years. I don't really know what. But if he thinks the wiki lacks information (as he said), then unfortunately IMO, maybe game development isn't the right route

rancid ruin
#

well, the wiki is pretty shit for a newcomer to be fair

dusk sage
#

The introduction to scripting and syntax pages are a good start, and KKs blog furthers that

rancid ruin
#

if you can use google well and have the drive to actually LEARN this shit though, it can be done. that's how we all ended up here right?

vapid frigate
#

yeh there's a lot on there.. but half of it only seems to be accessible via google

dusk sage
#

👍

rancid ruin
#

KK's blog isn't even amazing, it's just a good resource cos he's one of the only people who actually blogged/blogs about SQF

dusk sage
#

For a beginner it's amazing. Some of the info on there, especially about execution environments etc, is invaluable for a beginner to learn

#

Maybe once matured a bit not so much, but gotta start somewhere 😋

#

He teaches it in a very simple way

rancid ruin
#

a lot of stuff he does yeah, but he also does some weird and confusing stuff imo

#

but it's always fun to see how other people solve problems

#

shame he doesn't post more tbh

bitter bough
rancid ruin
#

OnLoadName = "Operation Dune Buggy;

bitter bough
#

hah
look at that.....

rancid ruin
#

here's a quote i know works well if you wanna borrow it

#

"

bitter bough
#

xD

#

I've been staring at line 2 for like 10 minutes

#

that's what confused me

rancid ruin
#

i'm more concerned that your user name is spazz tbh

bitter bough
#

Old nickname
Long story

#

Had the same email with the same name since 2001

rancid ruin
#

i would guess it's complaining about line 2 because the #include are ignored when the file is preprocessed

#

so line 2 minus the includes is accurate

bitter bough
#

Would make sense

#

huh, and now apparently my init.sqf has an issue.
this is such a fun time

rancid ruin
#

well you seem to be Mr. Fucked Up Quotes so i'd check all your strings in init.sqf right away

cedar kindle
#
kinda over this Arma 3 discord
ill just do everything myself and fuck these big top notch Devs
#

lol

bitter bough
#

the only 2 quotes are normal o.o

#
TAG_fnc_DisplayText =
    {
        _control = (findDisplay _IDD) displayCtrl _IDC;
        _text = ctrlText 1400;
        Hint format ["%1",_text];
    };
rancid ruin
#

nope they're different characters

#

here, borrow mine "

bitter bough
#

What?

#

how

#

Literally just retyped this....

rancid ruin
#

what editor are you using?

#

microsoft word?

bitter bough
#

N++

#

people use word to do scripting?

cedar kindle
#

wants to learn but can't even read an introduction tutorial > 🗑

bitter bough
#

^

#

me in a nutshell

rancid ruin
#

i can't think why notepad++ would do that

#

weird

bitter bough
#

lemme fudge around with it a bit

vapid frigate
#

the quotes are right in that one?

bitter bough
#

yeah

rancid ruin
#

both different characters according to my notepad++

bitter bough
#

it's giving me invalid number in expression

vapid frigate
#

oh.. where i wrote _IDD and _IDC

#

u need to actually put the IDD and IDC of the controls

#

and you're not using _control anyway, so can probly just delete that

bitter bough
#

I did

#

same error

vapid frigate
#
    {
        _text = ctrlText 1400;
        Hint format ["%1",_text];
    };```
bitter bough
#

Yeah, getting the same error with that alone

vapid frigate
#

i dunno, i don't think the error is in that code

bitter bough
vapid frigate
#

that's the code where you're calling it

#

looks like your [s have become *s

#

and your ]s have become +s

bitter bough
#

Ugh, this tutorial is becoming more and more of a pain each minute

vapid frigate
#

can you link it?

vapid frigate
#

ah ok it is in word

bitter bough
#

who does this

vapid frigate
#

not sure how [] got messed up though

#

but explains the quotes

bitter bough
#

Alright, so I need to find where the brackets are borked?

vapid frigate
#

yeh, it looks right in the word doc

#

but yeah copying out and it becomes onButtonClick = “*+ call TAG_fnc_DisplayText”;

bitter bough
#

lemme find that

rancid ruin
#

i knew this would come back to microsoft word somehow

vapid frigate
#

yeah you called it

bitter bough
#

this just brings back my question
who uses word for scripting

vapid frigate
#

i guess he used it for a tutorial, not scripting

#

if you printed/typed it, it'd work

rancid ruin
#

i used to think pdf was shit but it was just pdf readers which were shit

#

pdf ftw

vapid frigate
#

ppl usually make pdfs out of word

bitter bough
#

I'm using chrome to read it. so I dunno

vapid frigate
#

so it'd likely have the same problem

rancid ruin
#

just re-write all that shit from scratch imo

#

it will help you learn it for next time too

bitter bough
#

onButtonClick = "[] call TAG_fnc_DisplayText";
is this at least proper?

#

or does the call go inside the brackets?

rancid ruin
#

no that's right

#

inside the brackets are the arguments you send to a function

bitter bough
#

Ohhh.

vapid frigate
#

'call' is the scripting command, [] and TAG_fnc_DisplayName are the args

rancid ruin
#

like you could do

onButtonClick = "['B. Sherb'] call TAG_fnc_someFunction";

to send your name to a function

vapid frigate
#

SQF uses the 'interesting' syntax of ARG1 command ARG2, or command ARG1, or command [ARG1, ARG2...]

#

just to keep life interesting

bitter bough
#

that worked beautifully
thank you all xD

#

So, I could set it to send just about anything to a function?
neat

vapid frigate
#

yeh, and any number of things

#

['B. Sherb'] goes into your function as _this

#

most commonly read with params ["_name"];

#

(_name could be anything you want)

bitter bough
#

It's going to be a long road of dealing with this.
I'm trying to create a semi-ambient system with a shop
though my first few hours make me want to stab things

rancid ruin
#
TAG_fnc_hello = {
params["_name", "_age"];
systemChat format["Hi my name is %1 and I am %2 years old", _name, _age];
};

["B. Sherb", 20] call TAG_fnc_hello;
// in chat: Hi my name is B. Sherb and I am 20 years old
#

untested

#

but yeah, dick around making your own functions, it's fun

bitter bough
#

that would make sense.
That's fairly neat

rancid ruin
#

you can set default values for arguments too

#

it's basically zombo.com, anything is possible

pliant stream
#

does anyone else think that it might be useful to know the sender in serverside public variable event handlers?

dusk sage
#

I've been wanting that for a very long time, as well as for RE

brazen reef
#
gunner_1 disableAI "AUTOTARGET";
gunner_1 disableAI "TARGET";

nig_shoot_sky = {
    _gun = _this select 0;
    _t1 = _this select 1;
    _t = selectRandom _t1;
    gunner _gun setSkill ["aimingAccuracy",0.05];
    waitUntil {
        _gun setVehicleAmmoDef 1;
        sleep 10;
        [_gun,_t] spawn {_gun = _this select 0; _t2 = _this select 1;for "_i" from 0 to 250 do {sleep 0.1;_gun lookAt _t2};};
        sleep 10;
        for "_i" from 1 to 10 do {
            sleep random 1;
            _gun fire (weapons _gun select 0);
            _gun lookAt _t;
        };
        sleep random 10;
        !(alive gunner _gun)
    };
};
[zu_1,[skeet_1,skeet_2,skeet_3,skeet_4,skeet_5]] spawn nig_shoot_sky;```
#

Someone gave me that script.

#

I am just not sure where to...put that?

#

I named the skeets and the gun in init variable.

dusk sage
#

wherever you want to really 😄

#

If you define the function on init, you can run [zu_1,[skeet_1,skeet_2,skeet_3,skeet_4,skeet_5]] spawn nig_shoot_sky; whenever you choose

brazen reef
#

I am obviously doing something wrong tho.

#

To give a thing a variable I use the variablename under init, right?

#

Oh wait, does the script spawn the skeets itself or do I have to do that?

vapid frigate
#

looks like that will just make an ai shoot at 1 random skeet till he dies

brazen reef
#

Yeah.

#

He just...doesn't do that.

vapid frigate
#

u got a guy (gunner_1) in a vehicle (zu_1) ?

#

and something to shoot at named skeet_1, etc

brazen reef
#

Yeah.

#

I switched to another script tho.

#
 [zu_1], 
 [[0, 4500], [7000, 8000], [1000, 500]], 
 20 + random 100, 
 0, 
 {alive zu_1} 
] spawn GKB_fnc_randomAAFire.sqf;```
#

But it tells me that a ; is missing

#

In the last line

bitter bough
#

player addEventHandler (["Fired", {call FUNC(handleFired)}] call CBA_fnc_serverEvent);
Is this physically possible or am I just 200% wrong?

jade abyss
#

Using Macro?

#

+i guess, you have to include that macro all the time (no idea if its even possible)

bitter bough
#

Well, I'm helping my community owner add compatibility to Mars (Zeus Replacement Mod)
And I'm trying to add modules but everything is shortform. which I'm not used to

little eagle
#

that looks fucked up

bitter bough
#

Yeahhhhhh
I got lost

gleaming rivet
#

^ he's very lost

bitter bough
#

QUOTE([ARR_2(QQGVAR(spawnArsenal), _this)] call CBA_fnc_serverEvent);
Original

little eagle
#

That looks right although ugly

gleaming rivet
#

That's from Kingsley

bitter bough
#

^

gleaming rivet
#

Sherb is looking at Mars

little eagle
#

I can't even tell what this 200% line is supposed to do.

brazen reef
#

Do I just put SQF files into the mission folder to make em work, or do I have to do something else?

bitter bough
#

Nothing yet, I'm trying to add a module to Mars from Achilles, which means getting the function from Achilles

little eagle
#

Files have to be preprocessed into a SQF string, then compiled into executable code and then executed via call or spawn or something similar

bitter bough
#

addEventHandler ["Fired", {call FUNC(handleFired)}];
Or is this the better way?

little eagle
#

way to do what?

bitter bough
#

I'm trying to pull a module/function from another mod to use it as a module on another mod
compatibility of sorts

little eagle
#

All I see is a fired eventhandler

brazen reef
#

So...

#

call compileFinal preprocessFileLineNumbers "GKB_fnc_randomAAFire.sqf";

#

This in my init.sqf?

little eagle
#

Just use compile and not compileFinal, but yes

brazen reef
#

Boy making this script sure is work.

#

So then this...

little eagle
#

Sweating from writing one line already?

brazen reef
#

Nah, I am trying to make this script work

little eagle
#

Reminds me of the indent hadouken.

brazen reef
#

Now I don't know where to actually call the script.

#

If I put it into the init of a random unit it just tells me that a ; is missing

little eagle
#

Parameters:
1st Objects in Array AA-units

#

Just init.sqf, not the init box of an object

#

And you need to pass the parameters

brazen reef
#

Ohhhhhhhhhhhh,

#

Yeah parameters I understand,.

#

So I just put it on the bottom of the init.sqf?

#

That makes...sense?

little eagle
#
Example:
[
    [GKB_aa1, GKB_aa2, GKB_aa3],
    [[0, 4500], [7000, 8000], [1000, 500]],
    20 + random 100,
    0.1,
    {alive GKB_radar}
] spawn
#

bottom, to, doesn't matter

#

But apparently you need to use spawn and not call

brazen reef
#

Hm.

#

Clearly I am missing something.

#

Just not sure what.

bitter bough
#

so, say I have the macro _generalMacro = "Achilles_Set_Weather_Module";
Could I somehow toss this into here to make it use the Module?

class GVARMAIN(modules) {
    class ADDON {
        displayName = "Miscellaneous";
        class Arsenal {
            displayName = "Spawn Arsenal";
            tooltipText = "Spawn a virtual arsenal box containing everything";
            action = QUOTE([ARR_2(QQGVAR(spawnArsenal), _this)] call CBA_fnc_serverEvent);
        };
    };
};
little eagle
#

^^ wat?

bitter bough
#

I knew this would be a bit much.....

brazen reef
#

@little eagle Well it is loading now, but Arma tells me that a ; is missing

#

] spawn GKB_fnc_randomAAFire.sqf;

#

Still here

little eagle
#

told you you need to compile preprocess the file

#

don't just copy paste the example

brazen reef
#

But...

#

There is something else in my init.sqf and that works too.

little eagle
#

... and?

pliant stream
#

@dusk sage i actually ended up patching in the PV owner in EHs for A2OA... i can't believe bis haven't done it for a3 themselves

brazen reef
#

Okay, how do I preprocess the file?

pliant stream
#

preprocessFileLineNumbers "my/file/path"

brazen reef
#

This is my init so far

#

It still gives me the error on line 24

#

The part on the top is from our modpack

hollow lantern
#
spawn GKB_fnc_randomAAFire.sqf;``` you should use ```sqf
spawn GKB_fnc_randomAAFire;```
simple fiber
#

You can take a look at the wiki it will answer many questions you know

little eagle
#
compile preprocessFileLineNumbers "GKB_fnc_randomAAFire.sqf";
 
[
    [zu1],
    [[0, 4500], [7000, 8000], [1000, 500]],
    20 + random 100,
    0,
    true
] spawn GKB_fnc_randomAAFire.sqf;

should be

GKB_fnc_randomAAFire = compile preprocessFileLineNumbers "GKB_fnc_randomAAFire.sqf";
 
[
    [zu1],
    [[0, 4500], [7000, 8000], [1000, 500]],
    20 + random 100,
    0,
    true
] spawn GKB_fnc_randomAAFire;
brazen reef
#

@hollow lantern Undefined variable expression

#

Ahhhh...

#

Now it is starting to make sense

little eagle
#

: )

hollow lantern
#

good

brazen reef
#

Works now.

#

Thanks for the help.

little eagle
still forum
#

😮 I soo need that.. But !isEqualTo also kinda does it

little eagle
#

#define xor isEqualTo !

indigo snow
#

Thats two commands tho. Think of your frames! :D

still forum
#

Yeah.. I do.. That's why I need xor ._. I need all the VBS script commands

little eagle
#
str parseNumber (random 30 toFixed 1)

This is all you need.

still forum
#

I will use that when I have my Dev-env back

little eagle
#

What did you do?

still forum
#

Vacation

static spire
#

if i attach a turret to a car, then call attachedTo on the car, would it return null? or would it return the turret

little eagle
#

It would return null

#

Because the turret is attached to the car.

static spire
#

cheers

little eagle
#

attachedTo TURRET
-> CAR

#

This is how it's supposed to be used.

static spire
#

thanks

little eagle
#

On the other hand

#

attachedObjects CAR

#

-> [TURRET, anything, else, ... ]

static spire
#

and if i did attachedObjects on the turret that would return null?

little eagle
#

yes

#

well

#

[]

#

empty array

static spire
#

cheers

plucky beacon
#

Hows the scripting going.

little eagle
#

not enough macros

plucky beacon
#

I wish I was doing scripting instead of calculus

jade abyss
#

*slap*

#

Still not done with your homework?

plucky beacon
#

Ya I'm only 4 weeks away from having it finished

plush cargo
#

I have a function that runs from initServer. It sets up missions based on map locations. Everything working fine but I'm trying to shave some time off the initial load time. If any of you could take a look at tell me what you think, I would be grateful.
https://pastebin.com/PvbZ7PND

little eagle
#

Is this a function?

plush cargo
#

rn it's just initServer

little eagle
#

The whole thing is all of initServer.sqf?

plush cargo
#

yeah

little eagle
#

try this:

#
isNil {

< rest of the file >

};
#

Won't work if you use any sleep or waitUntil, but it doesn't look like you do

plush cargo
#

so all that code inside the brackets? Could you explain what it does?

little eagle
#

yes and it makes sure that the code is executed in unscheduled environment.

#

otherwise the function can only be executed in 3ms packets. that is what the scheduler does and initServer.sqf uses the scheduler by default.

#

If you wrap it in isNil, the whole code will run in one long frame... which is way faster.

plush cargo
#

I see, thank you

blazing zodiac
#

Is there anyway to use #include from a sub directory?

still forum
#

#include "sub\directory\file.hpp"

blazing zodiac
#

Sorry the other way around

#

from a parent directory

still forum
#

#include "..\directory\file.hpp" also like the wiki says

blazing zodiac
#

yes but those don't actually work

#

they hard crash the game

still forum
#

If you enter the correct path then they will work

blazing zodiac
#

have you tested it?

still forum
#

or use pboprefix and use the full path

blazing zodiac
#

I also saw killzonekid claiming that was incorrect somewhere while looking

#

nevermind I didn't notice the one added in 1.49, I'll try that one out

still forum
#

What? Which other one is there?

dusk sage
#

They definitely work

blazing zodiac
#

the one you posted above, the ..\ one

#

sorry about that guys, brainfart

still forum
#

but thats the same? Just a different path. And you have to change that anyway

dusk sage
#

the one you posted above, the ..\ one
100% works 😃

blazing zodiac
#

yea thats the one I needed BoGuu

#

the forum posts I was reading about it with KK were from pre 1.49

still forum
#

Wiki is generally a better information source than old forum posts 😉 I suggest always starting at the wiki

blazing zodiac
#

I agree but looking at it last night at 7 in the morning I missed the one added in 1.49

brazen sparrow
#

do anyone know how to restart (press esc -> Restart) a mission in the editor via sqf?

jovial ivy
#

"serverPassword" serverCommand "#restart"; I would be careful using this, as SQF files can be accessed.

brazen reef
#

Is there an easy way to stop people from picking up weapons from downed enemies?

still forum
#

delete them on killed eventhandler

#

Or you could add an eventhandler to the Inventory and always close it when player tries to access a downed enemies inventory... But.. Hard stuff

brazen reef
#

I found a script.

#
_deadlist = [];
{ if !(isPlayer _x) then {_deadlist = _deadlist + [_x]} } forEach allDead;
~5.0
{_x removeallweapons; removebackpack _x} forEach _deadlist;
goto "start";```
dusk sage
#

Oh lord

#

Might want to update that

still forum
#

yeah.. that.. kinda removes.. the weapons....

dusk sage
#

And not SQF

#

😄

brazen reef
#

Well all members of my unit are twats so they deserve it.

dusk sage
#

Just delete weapons on killed EVH, like Dedmen suggested

still forum
brazen reef
#

Does that go to init.sqf?

still forum
#

As I said Serverside. so... InitServer.sqf or in init.sqf with isServer check

brazen reef
#
    addMissionEventHandler ["EntityKilled",{
           params ["_killedUnit"];
            _killedUnit removeAllWeapons;
    }];
};```
little eagle
#

removeAllWeapons _killedUnit

#

not the other way around

still forum
#

I just copied it from the code above ^^

brazen reef
#

Works.

#

Thank you.

rancid ruin
#

why is your name gay this gay earth?

#

that's so edgy i think i cut myself on it

open vigil
#

It's not that Emo.

forest jasper
#

icon on gui that spining how it made

still forum
turbid thunder
#

@tough abyss if getposASL is below 0

#

With getposATL having a height of 0

#

Basically you getposATL your current position, change the height coordinate to 0 and use the command to convert ATL to ASL anf check if the height is < 0

vapid frigate
#

would make it so you can check the start + end, and then the line between at sea level

thin pine
#

icon on gui that spining how it made > how it do?

vapid frigate
#

@tough abyss theoretically if there's no intercept between the 2 points at sea level

#

then either whole line is above sea level or below it

#

but depends if it just intercepts the terrain surface or counts everything underground as 'intercepted'

#

sorry i meant 'above ground level or below it'

#

sorry doesn't work.. just tested terrainIntersectASL [[(getpos veh1) select 0, (getpos veh1) select 1, 0],[(getpos veh2) select 0, (getpos veh2) select 1, 0]]

#

true when the vehicles are next to eachother on land

#

oops had all select 0.. will test again

#

yeah same.. doesn't work

split coral
#

it's the same with all intersect commands

hollow lantern
#
count (thisList unitsBelowHeight 2) > 0;``` Not sure about your initial question
#

but maybe that could be something

#

would activate a trigger or script only for Land Units

turbid thunder
#

@hollow lantern initial question: Checking if smth is on water

#

Or better said if surface of position is water

#

@tough abyss so like, you have two different positions and you want to check if there is water between tge way from pos a to pos b?

#

Some sort of line intersect terrain at sealevel might work

#

Like if it never intersects with the terrain then it means that the terrain never got deep enough for water to appear

#

Atleast in theory

#

I dont know if it counts as intersect if it leaves the terrain or if it is checked with a starting pos directly inside it

#

Whats it for though?

blazing zodiac
#

Does anyone know if there's a fix for flyInHeightASL not working with loiter type waypoints?

#

I know I reported the issue originally to Dwarden a while back and they fixed it but the next update it was broken again

#

yea

#

Just broken for loiter type waypoints

#

Making UAVs incredibly frustrating

turbid thunder
#

The loiter waypoint has a custom setting in the waypoints menu for height and loiter direction and distance

blazing zodiac
#

I know, that also doesn't work

#

it was added in the update I reported the issue

#

And worked for exactly one update

#

And then was broken again...

#

Bad merge is my guess

#

17-06-2016
Tweaked: The flyingHeightASL command now works also for loitering airplanes

#

That was from the dev branch after I reported it

#

So whatever version that was

turbid thunder
#

@tough abyss what if there is a land route but just not a direct one? :D

little eagle
#

Wasn't there something about rsc table new control type in 1.68 or did I dream this?

vapid frigate
#

i've seen something about that

#

unless we both dreamed it.. can't find it

little eagle
#

What I'd need is a listbox, but with the list items being control groups.

austere granite
#

that exists now? Pls tell me yes