#arma3_scripting

1 messages ยท Page 465 of 1

astral dawn
#

If so, I think you can omit the pos argument of attachTo and it will use their current relative coordinates instead

slate pollen
#

i will give it a shot

astral dawn
slate pollen
#

can i DM you some screenshots of what i have atm

astral dawn
#

Yes sure

#

Ok I think I understand what you are trying to achieve. So you are decorating some vehicles with other objects and want them to remain attached after mission start, right? I tried doing same and here's the code:

_dest = truck_0;  //Replace truck_0 with the base vehicle to attach stuff to
_t = this; 
_t_dir = vectorDir _t; 
_t_up = vectorUp _t;
_t attachto [_dest]; 
_t setVectorDirAndUp[_t_dir, _t_up];

You must place it into the init field of all the objects you want to be attached.
Also name your base vehicle somehow, it was truck_0 in my case.

shrewd lance
austere hawk
#

dwarden is investigating

winter rose
#

fixed

dry zephyr
#

@still forum Thanks and understood SQF -> compile > in memory intermediary assembly code (for future call and spawn). Makes sense given anecdotal rumor on forums or wiki (forget which) that, once compiled, script runs 20X faster on subsequent calls. Also means that SQF VM is really a virtual machine of sorts tapped into a native bridge to the engine code/functions. Makes me wonder if scripting commands (as opposed to scripting functions) are in memory as intermediary assembly code or as native code.

thorn saffron
#

Is it possible use the draw3DIcon in such a way to have the text above the icon without it clipping if you get further away?

verbal otter
#

hello, is possible to detect lost connection on player?

gray thistle
#

handle disconnect saves the unit but is used on the only on the player assigned too and player disconected executes mostly code one time if one of your players leave the game possibly good for Player _insert_your_player_name left the server

#

But now i once again have a question... does somebody know more about the display id of the dynamic group framework?

civic canyon
#

Can the gap and input keys on the death menu be overridden?

tight moat
#

Is there a list of all scripting commands anywhere, preferably in some easy, to parse format and with metadata anywhere?

gray thistle
tight moat
#

Something like that yes, though I would prefer not having to download the HTML page for each command listed there

gray thistle
#

Well... you can brows it in arma 3 itself but i would not recommend it

tight moat
#

If I needed say command and what version it was introduced in, or what the syntax is like

gray thistle
#

well those commands get huge if you want to explore them you have to search something what you want to do example creating a vehicle and get on the command of it

tight moat
#

Specifically I am interested in what kind of "command" they all are, IE
A, a global variable, like "daytime" is
B, a unary function, like "abs" is
C, a binary? function like "min" is

lone glade
#

@tight moat yes there's a command to output that

#

can't remember what it is tho, gimme 5s to find it

tight moat
#

๐Ÿ˜ฎ Thanks

lone glade
tight moat
#

I wonder if stuff like this is documented anywhere

lone glade
#

? what stuff like this?

tight moat
#

Like how SQF works in more details and how the types etc. are handled

#

How the engine parses the scripts and such

lone glade
#

your best guess is the intercept repo on github

tight moat
#

While I know of foxhounds grammar, a "formal" one from BIS would be nice as well

lone glade
#

considering how long it takes for some stuff to be documented I highly doubt they'd do that

tight moat
#

I don't think they just made up the language and went on from there though, but rather were working form some more formal definition when implementing it in the engine

gray thistle
#

well it is somewhat cpp like i heared

#

some scripting even requires cpp

dry zephyr
#

@tight moat see Arma 3 IntelliJ plugin and related projects

tight moat
#

"arma-intellij-plugin" I assume?

dry zephyr
tight moat
#

Thanks

dry zephyr
gray thistle
#

damn cann i add a permanent eventhandler on an ui object even though it is closed i finally found the id of the dynamic group tool of arma 3

little eagle
#

@dry zephyr
Well, C also has & | ^ >> << <= => == !=. I don't think binary commands are as rare as you think.

astral dawn
#

I think C classifies these as operators, not functions

dry zephyr
#

@little eagle @astral dawn Yes, I think you are right about binary operators in C, but my primary question is about function/script calls. The benefit of the SQF approach is that it makes arrays a first-order concept and then doesn't have to come up with hacks like variadic functions to support n number of arguments/parameters. However, I can't think of another language were you can specify the arguments/parameters before the function/script name.

little eagle
#

Functions specifically have their arguments on right hand side inside parenthesis in C, but SQF functions are different from SQF commands.

leaden summit
#

is there an easy way to make a "directional trigger"? Basically I want to be able to tell if a player is coming or going

#

Never mind as soon as I posted that I realized there must be a direction command

kind torrent
#

Hello everybody -- I want to try and make an XP system for Arma. Nothing fancy, but enough to prompt the ability to level up players, or at least have a value that can represent them.

Problem is. I'm .. super new at coding. Is this too much of a task to try?

#

I can't find anything else in the world that even has an XP system that I can learn off of.

austere hawk
#

money, XP, all the same...

young current
#

xp is a value you want to store so you will want to look up how to store data in Arma on runtime and ways to distribute it when something happens

#

money is pretty much identical yes

#

depending how much you know about coding you might want to look up how armas scripting lanquage (SQF) works

kind torrent
#

Hm! Okay.

#

I'll look for a money script and try to learn how it works then! Thank you!

#

Then try to make my own haha

#

Man this is gonna suck. lol

leaden summit
#

Can you remove the SAM turrets from the UAV list? It's a real PITA to scroll through a bunch of SAM's and turrets just to get to the drone you want

austere hawk
#

how many sam turrets are there? 3?

leaden summit
#

Yeah but I have a whole bunch for base defence/carrier defence so there's like 15ish all lumped in with the UAV's

steady marsh
#

Anyone know of a civilian ambient spawner or civilian vehicle spawner?

leaden summit
#

I use Engima's Civilians and Traffic scripts, you should be able to find them fairly easily with a quick google search

naive estuary
#

Iterate through each uav you want to block on each player.

leaden summit
#

Oh wow, I completely missed that, thank you

earnest path
#

Hey guys do you have any idea how can you validate call compile "" . The example is if you have call compile "{true;};" this results in a variable with typeName "CODE" but if you call compile "" than the variable has no value and isNil, isNull, isEqualTo and typeName do not work on it

#

I think it throws Generic error in expression but i am not sure how to catch this and handle it gracefully

dry zephyr
#

@earnest path typeName compile ""; returns "CODE" when run in debug console launched from editor (Tools menu). Do you really need call in front of compile?

little eagle
#

The example is if you have call compile "{true;};" this results in a variable with typeName "CODE"
@earnest path
No, it returns BOOLEAN (true) and not CODE.

#

Arg, ignore what I said. Yeah it's CODE.

#

To check the type, do isEqualType.

#
private _function = call compile "{true;};";
_function isEqualType {} // true
#

But may I ask why call compile and why double code brackets? The compile already replaces the outer quote marks with code brackets. It seems very wonky what you're doing.

velvet merlin
#

@little eagle @still forum can you tell if its possible via sqf to read in the entries in the server list control, filter it and feed it back it? or is engine controlled idc behavior probably too tight there?
(we are looking ways to filter the server list to show only servers for a given mod/for the current active mods)

little eagle
#

I think the server mod list is only shown when you click on the server. Therefore you would have to have your script click on all servers.

#

But I guess you could just name all of them [IronFront] and then filter the listBox like that as well. Iirc it should just be a simple ListBox.

velvet merlin
#

yep only the name based filtering is feasible atm i think

#

i guess you could hide the normal server list listbox, filter its entries, show them in a new listbox, and keep the server list id/mapping to make sure to select the right entry in the hidden list when you click "join"

little eagle
#

Maybe a dll could do something as well.

velvet merlin
#

yes, but whitelisting by BE and all that

little eagle
#

People should just stop using battle eye if it breaks their game. It's simple really.

peak plover
#

So how do I properly debug script speed and performance?I've made a few things and I wanna do a run of optimize

#

unscheduled and dedmen brofiler?

verbal otter
#

i was thinking about handle lost connection with check when connection icon is lighting, is possible?

little eagle
#

You mean the red chain?

#

I haven't seen that chain in ages. They may have got rid of it.

earnest path
#

@little eagle I have a few strings in an array and depending on which one my script calls i have to compile and run the code. So say the string is "script_1" than i do call call compile "NGScripts_script_1" and that runs my script. If for some reason you put a wrong string for calling one of the script i would like to throw an exception and handle it by logging that the script that you are trying to run does not exist however the call compile "" does not yeld anything so i could not validate to throw the exception

verbal otter
#

@little eagle yes

little eagle
#

Rollo, you should use missionNamespacte getVariable instead.

#
private _function = missionNamespace getVariable "NGScripts_script_1";
earnest path
#

AH i see so than i can give the getVariable a default and validate on that default

little eagle
#

You could try ctrlShown on the chain picture control, Chew, but if it internally uses fade and not show, then you won't be able to tell whether it is shown or not with scripts.

earnest path
#

haha I didn't think of that one . Nice one man thank you !

verbal otter
#

@little eagle ok. Understand ty

little eagle
#

call compile is bad almost every time.

earnest path
#

Is it bad due to the ability to inject rouge code or just not performant enough

little eagle
#

Mainly because it leads to hard to read code that isn't even faster or has any other benefits. It's inferior to other solutions and only wide spread because of copy pasting bad code.

earnest path
#

Ok noted i will avoid using it.

#

Thank you for your help!

peak plover
#

Are there any script ways to check desync amount? That's still viewable in the Player list?

little eagle
#

Not aware of any method.

peak plover
#

Hmm

#

Btw if I try to send like a huge string as a publicVar, does it get split up according to server settings and then sent?

#

Also btw Thanks a lot for all the help here everyone has given here. I just realized I'm a lot better at scripting than I was a year or two ago

still forum
#

@dry zephyr that, once compiled, script runs 20X faster on subsequent calls. SQF cannot run uncompiled. It has to be compiled before it can run.
Also means that SQF VM is really a virtual machine of sorts Yeah. I have a open-source remake of the main VM central that takes care of executing the instructions.
Makes me wonder if scripting commands (as opposed to scripting functions) are in memory as intermediary assembly code or as native code. Don't understand what you mean by that.
There is a big hashmap of command->function pointer. When you execute a command the engine resolves the function pointer and executes the native c++ function.
Actually every of the about 7 instructions do that. Every instruction has a vtable with a Execute function in it.
@tight moat What info do you need? I can give you full command dumps with argument types but they don't include the version they were introduced as BI doesn't keep track of that internally.
@little eagle No, it returns BOOLEAN (true) and not CODE.. Nope. call compile "{true;};" Executes {{true;}} which returns code.
@peak plover So how do I properly debug script speed and performance? If possible then debug console. If it's already unscheduled then my profiler. If it's scheduled yeah.. well. Converting it into unscheduled will already make the script faster than scheduled. And if it's scheduled you usually don't care about perf that much.

peak plover
#

I remember someone sayign something like The debug console thing is inaccurate

still forum
#

true. with too high/low numbers it get's inaccurate

peak plover
#

Right

still forum
#

also the debug console thing checks after EVERY execution if the timeout is already over to abort early. which scews the results

#

you can use my profilers codePerf command though

#
profileScript [{code}, arguments for _this, number of runs]

But it doesn't abort if it runs too long. So be careful with "number of runs"

peak plover
#

I'd rather get more accurate results tbh

still forum
#

output is [runtime in microseconds, runtime in microseconds as string, number of runs]
the string one is double precision microseconds.
Whereas the vanilla one is single precision milliseconds output

peak plover
still forum
#

yeah. I'll do it quik

peak plover
#

Thanks

peak plover
#

๐Ÿ‘Œ๐Ÿป thanks

little eagle
#

wohoo, new computer

peak plover
#

Whoa, how new

still forum
winter rose
#

Pentium III 800Mhz, 128 SDR, GeForce 2?

little eagle
#

Newest generation new, but not high end, because I'm a cheap fucker.

rancid pecan
#

18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 1c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 2c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 3c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 4c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 5c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 6c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 7c not found 18:04:59 Wrong vertex mapping for person collision geometry found in a3\characters_f_epc\civil\c_nikos_aged.p3d. Selection 8c not found

#

what is problem ?

little eagle
#

Bad model by BI. Nothing you can do, except not use the object class with this model.

still forum
#

@rancid pecan It's not #arma3_scripting
what is problem ? It says it right there in the messages. Wrong vertex mapping for person collision geometry

meager heart
#

poor nikos ๐Ÿ˜”

tough abyss
#

How can I kick and ban using an sqf function?

#

I want to interact with the functions with a dialog

dry zephyr
#

How to control the sound of engine via script? Have tricky boat sequence AI cannot handle, so trying unitCapture/unitPlay. Scripted engine on to get basic engine on sound, but doesn't correspond to speed of boat. Vaguely understand sound system processes engine sound through several layers and can see RPM reported from sound controller does not change (always 200 when boat moves under unitPlay, goes to 900 when piloting as player), so the engine sound does not sound revved up.

Ancillary question - we have commands like getSoundController, but what is purpose of those if we cannot script or influence them?

little eagle
#

There is no setter for this.

dry zephyr
#

When units get out of a vehicle at a Get Out waypoint , they seem to run on foot to a default disembarkation point a few meters away (usually forward and left/right of vehicle depending on side exited?) before continuing to their next waypoint. Is it possible to have them walk calmly to this close disembarkation point instead of jumping out, running a few steps to the disembarkation point, then calmly walking to their next waypoint (assumes here that both Get Out and Move waypoints have speed mode set to Limited)?

Looks jerky when they come running out of the vehicle, then start walking normally.

lone glade
#

nope, it's to avoid the next unit disembarking sending the previous one flying

#

same when they embark a vehicle, they line up about 5m away from the position then they proceed

dry zephyr
#

@lone glade Thanks for explanation about avoiding collision.

still forum
#
dedmen_randomOrientation = coroutine.create(
   function ()
     while (true) do
      coroutine.yield(math.random(0,360))
     end
   end);

function dedmen_vehiclePFH()
    SQF.systemChat("dedmenlib setDir");
    _, newOrient = coroutine.resume(dedmen_randomOrientation);
    Dedmen_vehicle:setDir(newOrient);
end

function dedmen_preInit()
    --https://github.com/dedmen/interceptTest/blob/master/interceptTest/main.cpp#L597
    SQF.systemChat("dedmenlib preinit");
    Dedmen_vehicle = SQF.createVehicle("B_Quadbike_01_F", SQF.player.positionASL);

    SQF.events.PFH.dedmenlib = dedmen_vehiclePFH;


    --if CBA.canUseWeapon(SQF.player) then
    --    CBA.addWeapon(SQF.player, "Binocular", false)
    --    CBA.selectWeapon(SQF.player, "Binocular")
    --end
end


--SQF.events.preInit.dedmenlib = dedmen_preInit;
SQF.events.postInit.dedmenlib = dedmen_preInit;

How many people here prefer LUA over SQF?

little eagle
#

Curly brackets > end.

still forum
#

^ same :/

lone glade
#

lua comments trigger me

still forum
#

But the other binding is python and that isn't much better ๐Ÿ˜„

austere granite
#

just gimme muh pyhthon reeee

lone glade
#

python 2.x or 3.x^ ?

austere granite
#

4.y

still forum
#

3 afaik

lone glade
#

thank god

little eagle
#

3

#

3

#

3

austere granite
#

commy3

little eagle
#

YES

#

commy2.1

lone glade
#

commy2.8

little eagle
#

commy

#

...

#

wait for it

#

commy1

#

This is my fifth machine I ever owned.

still forum
#
if (player call CBA_fnc_canUseWeapon) then {
    [player, "Binocular"] call CBA_fnc_addWeapon;
    [player, "Binocular"] call CBA_fnc_selectWeapon;
};

->

if CBA.canUseWeapon(SQF.player) then
    CBA.addWeapon(SQF.player, "Binocular")
    CBA.selectWeapon(SQF.player, "Binocular")
end

Not really sure which one I really prefer

#

Well.. Second is OOP.. Soo...

little eagle
#

CBA_fnc_addWeapon

#

For

#

what

#

purpose

#

???

lone glade
#

testing purposes

little eagle
#

The cba namespace should inherit from the sqf one, meaning I can use usingonce at the top instead.

still forum
#

Can do things like

player setPosASL ((player getPosASL) vectorAdd [0,0,5]);
SQF.player.positionASL = SQF.player.positionASL + {0,0,5};

I looked for usable and very easy to wrap CBA functions.

#

The wrapper in the CBA library is

function CBA.addWeapon(unit, item, verify)
    return SQF.missionNamespace:getVariable("CBA_fnc_addWeapon")(unit, item, verify or false);
end
little eagle
#

What does addWeapon even do?

still forum
#

drops on ground if no space

little eagle
#

Ah, I remember. That's actually pretty neat.

#

Should drop the old one instead though, but I guess that is not something doable in A3, thanks to cargo system api being shit.

still forum
#

I think I should also be able to do
SQF.missionNamespace.CBA_fnc_addWeapon(unit, item, verify);
No need to call a function or pass the var name as string
or
SQF.missionNamespace["My_fnc_func"](1,2,3)
Or variables on objects
SQF.player["myvar"] = 5

little eagle
#

custom fps counter, because fraps is annoying and lol steam

dry zephyr
#

@Dedmen to your question C > SQF > anything else, though I'm led to understand you can't use C for mission building, so SQF for mission building if that is true. Otherwise, it's just more layers for things to go wrong. Everything is limited to the scripting commands anyway.

dry zephyr
#

Is there a standard convention in EDEN for "thing to put down just to have a visual indicator of a named position you can get in script"?

gleaming oyster
#

@little eagle Noice.

little eagle
#

Even if you don't want this. Guess it's educational on how to create a text control with fixed size regardless of ui size settings and monitor aspect ratio.

winter rose
#

with all these commy3, commy 2.8 etc I wonder if you already did aโ€ฆ commy'h'ngout

#

runs far away on holidays

gleaming oyster
#

@winter rose commander gang

winter rose
#

wut? ^^'

gleaming oyster
#

Commander1, Commander2, Commander3

winter rose
#

Oh yeah, I read that :) I just hope they don't catch me before the border

peak plover
#

@still forum javascript arma lol D:

still forum
#

Lua :u

#

I won't do javascript... soon

peak plover
#

yeeh

#

Ohh btw you probably know this good. If I send a very big text through publicVarClient. It will cut it in many packets according to the server settings for network, right?
I mean like if I send a lot of data it will cause desync and shouldn't be done, right?

still forum
#

ye

#

PVAR's are guaranteed packets. They have higher priority than position updates

peak plover
#

So I could write a script that splits the text up into many bits and then sends one per frame

still forum
#

one per frame might still be too fast

peak plover
#

okay, but that would be the way to do it pretty much

#

It's something I might look into to do a database connection for some player stuff

#

So player asks server, server gets stuff from db and sends it via a couple of publcVarClient

meager heart
#

about lua... was using it a bit in "some other game with editor", still have couple examples pinned in "some discord server" ๐Ÿ˜€

function onMissionStart()            
    SaveMenu = {
        title = "Checkpoint",
        items = {
            MenuItem:new("1. Create a checkpoint", Pointer:new("SaveGame")),
            MenuItem:new("2. Cancel", Pointer:new("CancelSave"))
        }
    }
    dialog = Dialog:new("PDA", "pda.bmp", 256, 256, 10, 15)
    Dialog:init(dialog)
    Dialog:addMenu(dialog, "saveMenu", SaveMenu)
end
```that is simple ui thingy with 2 buttons ^
```lua
function onMissionStart() 
    local us = Spawn:CreateUnit("The USMC", "USSet", "USSpawn", "Target") 
    us.onSpawnedReady = Pointer:new("followPlayer") 
    Spawn:SpawnUnit(us) 
end
 
function followPlayer(unit)
    OFP:follow(unit.echelon, "player", "ADDTOEND") 
end
```that is spawn unit, set formation and make him follow player ^
so lua vs sqf... i vote for sqf lol
civic canyon
#

(findDisplay 7300) displaySetEventHandler ["KeyDown","if ((_this select 1) isEqualTo 57 || (_this select 1) isEqualTo 1 || (_this select 1) isEqualTo 28) exitWIth {true}"];

#

help

meager heart
#

(ใคยฐ_ยฐ)ใค fix

(findDisplay 7300) displayAddEventHandler ["KeyDown", {(_this select 1) in [1, 28, 57]}];
civic canyon
#

thx

dry zephyr
#

UsingsetVelocity on a boat causes the camera to shake each time it is set and the player is nearby (but not in) the boat. Turning camera shake off in difficulty settings stops this from happening. Any ideas why setVelocity would have this effect and how it might be stopped without having to completely disable camera shake?

leaden summit
#

If I'm using this

[
    "Draw3D",
    {
        alphaText = linearConversion[5, 50, player distance haloPlane, 1, 0, true];
        drawIcon3D ["", [1,1,1, alphaText], haloPlane modelToWorld[0,0,2], 0, 0, 0, "HALO Jump", 1, 0.05, "PuristaMedium"];
    }    
];```
To put text over items in the game, where's the best place to run that from? At first I put it in the initServer.sqf but of course then it doesn't show up. Am I best to run that from initPlayerLocal.sqf?
leaden summit
#

ok initPlayerLocal.sqf works

peak plover
#
#define MGVAR(NAME,DEF)    missionNamespace getVariable ['NAME',DEF]
#define MSVAR(NAME,VALUE,PUB)    missionNamespace setVariable ['NAME',VALUE,PUB]

private _myCar = MGVAR(ten_myCar,objNull);
MSVAR(ten_myPlayerGun,(currentWeapon player),true);

Does that make sense?

little eagle
#

What do those <> brackets do?

#

Certainly not convert to string. That would be '

inner swallow
#

Looks more like they're just syntax indicators

little eagle
#

Why would you do that and then ask if the syntax works?

inner swallow
#

Like, <var name here> etc

peak plover
#

brackets are qual to quataion amrks

#

ohh nvm

#

thats for inlcude

little eagle
#

Okay.

#

Second issue I have with this.

#

The getVar macro is binary.

peak plover
#

hit me

#

what do you mean

little eagle
#

But the macro itself is unary.

#

Which could lead to precedence errors.

#

It should be wrapped into parenthesis to be safe.

#
#define MGVAR(NAME,DEF) (missionNamespace getVariable ['NAME',DEF])
#

like this ^

peak plover
#

oohh right, makes sense thanks

little eagle
#

Otherwise I don't really think the macro is needed. Itsaves you from typing two commands by having to write one. It's kind of lame.

peak plover
#

What do you mean, looks a lot faster with macro to me

little eagle
#

missionNamespace is typed with 6 keystrokes, getVariable with 5

#

This one has parnthesis you have to place. Maybe that works better with your setup, but still doesn't seem worth it to me.

meager heart
#

also maybe just

#define MGVAR(A)        (missionNamespace getVariable [A, objNull])
#define MSVAR(A,B,C)    (missionNamespace setVariable [A, B, C])

name < that is command ๐Ÿค”

peak plover
#

yeh, I'd personally like ABC as well. just for simplicity sake I used name and such

#

It's a part that is rarely read, so it can have simple abc ๐Ÿ˜„

meager heart
#

ARG < also works

little eagle
#

The setter needs no parenthesis imo, as it has no return value and should never be used like the getter anyway.

kindred briar
#

Would anyone know if theres a way to make the vehicle camo nets and slat armour appear ingame on the go?

#

In other words, is there like an init code I can enter onto a vehicle and make their nets show up

peak plover
#

I think it is also better like when user writes "" himself, because sometimes it might be a reference like _myName

#

@kindred briar Try export from arsenal

#

*Garage

kindred briar
#

Ahh yes forgot about that! I'll have to give it a shot another time but cheers for the ide!

little eagle
#

nigel, you could write:

#
#define MGVAR(A) (missionNamespace getVariable [format ["%1", A], objNull])
#

Maybe that'd help in your case?

peak plover
#

so MGVAR("ten_mission_tickets",100)

#

would format work with that

#

I guess a even better way of doing it would be to have my own automatic prefix added to that

#

with format

#

or just

#

Similar to how like ace adds it's prefix

little eagle
#

You mean the real GVAR?

peak plover
#

Yeh, like that

#

CBA not ace I guess

meager heart
#

btw is there any proper docs for preproc and macroses ? (i mean something usable in arma/sqf)

little eagle
#

Don't get too excited about __EVAL and __EXEC.

meager heart
#

i mean... thanks, but is there anything except that one ^ ๐Ÿ˜€

little eagle
#

It says pretty much everything there is to know though.

meager heart
#

and will try to hold myself about __EVAL... pinky promise ๐Ÿ˜„

little eagle
#

Good. It's shit.

digital jacinth
#

is it possible to have an animated texture with setObjectTextureGlobal?

little eagle
#

"animated texture" ๐Ÿค”

#

Like a gif?

digital jacinth
#

ye, that is the thing. I am not even sure if arma has support for keyframe textures

#

pretty much

little eagle
#

No, paa.

still forum
#

animated textures is coming in probably next arma version. Or.. Animated UV sets.

lone glade
#

swap 24 paa in a row, you got a video now /s

still forum
#

but not via setObjectTexture

little eagle
#

By version you mean 1.84 or A4?

still forum
#

84

digital jacinth
#

prolly a4

#

really

#

that would be interesting

little eagle
#

That's cool, Dedmen.

still forum
#

but afaik also done in model animations. I guess you could use animateSource to then animate textures. If the model has these animations defined

digital jacinth
#

i hope they will add a flat square model which supports this then.

meager heart
#

cough someone did some disco cube, that's like half way there cough

digital jacinth
unborn ether
#

lol

#

here u ask whats the song name

peak plover
#

Is there any way to know if a variable was public or not?

still forum
#

no

peak plover
#

hey @little eagle I'm using the scripted lobby

#

I've got a question about it

#

Ohh nvm

#

So basically a new unit is created when the slot is changed

#

I have an issue where in another script I set variable to unit namespace

#

So when the scripted lobby does selectPlayer

#

It will not have any of my variables

modern snow
#

How do I check if player is near a building? I have tried this: (player distance 'Land_PoliceStation') <= 15

peak plover
#
if !((nearestObjects [player, ["Land_PoliceStation"], 15]) isEqualTo []) then {systemChat 'Policestation nearby'};
#

Sumtin like that maybe

modern snow
#

Why ! after if

inner swallow
#

presumably because isEqualTo []

still forum
#

because you want to know if the player is near a building. Not if no buildings are near. that's why !

modern snow
#

Hmm thanks. I will try.

inner swallow
#

also if this Land_PoliceStation is a placed object with a varname then it should be without the quotes

#

in your original

peak plover
#

Looks like a classname

#

Ohh

#

Scripted lobby also means that all the eventhandlers are removed

#

So if I die, it won't run onKilled events

inner swallow
#

that's what i though, but it's not a vanilla class at least

meager heart
#

we have onPlayerKilled/Respawn.sqf also, nigel

peak plover
#

I used EH for mine

#

But I think it's best if I just run all initPost scripts i have again

#

That way it's all good

#

Cuz some scripts might be side specific etc.

still forum
#

SQF.systemChat(SQF.configFile.CfgVehicles.B_Quadbike_01_F.displayName:asText());
SQF.systemChat((SQF.configFile >> "CfgVehicles" >> "B_Quadbike_01_F" >> "displayName"):asText());
SQF.systemChat(SQF.configFile.CfgVehicles["B_Quadbike_01_F"].displayName:asText());
SQF.systemChat(SQF.configFile["CfgVehicles"]["B_Quadbike_01_F"]["displayName"]:asText());
:3
favourite?

lone glade
#

which is fastest?

#

otherwise i'd say 1

still forum
#

should all be equal. But I'll profile

#

Also have new namespace stuff
SQF.missionNamespace:getVariable("CBA_fnc_currentUnit")();
->
SQF.missionNamespace.CBA_fnc_currentUnit();
SQF.missionNamespace.Myvar = 5

queen cargo
#

the most useful part about this probably will be that LUA is way faster then SQF basic ops

#

but it is lua afterall

#

so that is a nono

still forum
#

1: 0.0124ms
2: 0.0116ms
3: 0.0127ms
4: 0.0124ms
getText (configFile >> 'CfgVehicles' >> 'B_Quadbike_01_F' >> 'displayName') 0.0041ms

๐Ÿ˜„ Not quite there yet

queen cargo
#

mhh?

#

you mean speed of lua vs sqf?

#

should not gain anything at all in regards of calling actual SQF

#

but the complete rest will be faster

#

eg. instead of saving stuff in missionnamespace one could use a simple lua object which should increase the actual access-time by a dozent ms

still forum
#

1+2+3+4+5+6+7+8+9 SQF 0.003ms. LUA: 0.0028ms

queen cargo
#

with or without optimizer?

#

because lua should be faster

#

but lua again is not optimizing stuff

astral dawn
#

With Intercept+Lua will one be able to create a normal thread? I mean not spawn a thread in arma but create a thread in OS

still forum
#

yeah. But you cannot execute SQF commands from threads as SQF isn't threadsafe

queen cargo
#

well .. technically, you can

#

as long as you do it with a command queue

still forum
#

could probably do something with coroutines

astral dawn
#

So I've heard a lot of times things like 'Life/Exile/whatever are overloaded with scripts and thus have low framerate'. What exactly do people mean by this? Do they have a lot of scripts unscheduled or?

dry zephyr
#

Is there a way to smoothly change the direction a boat is pointed in while also setting its velocity? I found I could smoothly change the direction with setDir OR I could smoothly keep the boat accelerated with setVelocity in a straight line. When I do a setDir and then a setVelocity, even though I do the setVelocity AFTER the setdir the boat just spins in place. * Within onEachFrame on server.

astral dawn
#

Maybe you should look into playing a pre-recorded animation instead?

#

I never tried it but i think it's possible

dry zephyr
#

And what's really interesting about that is that in watching some expressions in the debug console, the boat speed is about right (~28), there is non-zero velocity ([7.18655,3.51476,0]), and the engine has revved up. It just doesn't update its position.

#

@astral dawn I tried that and that does work to some extent, but then you can't control the engine noise to match the movement (can't change the RPMs used to change the engine sound for the sound processor) and I've read that the movement can be jerky in multiplayer.

astral dawn
#

I think I've read that for different kinds of objects the engine might skip frames before actually updating the position

#

Like projectiles are updated each frame, empty vehicles and such - not each frame

dry zephyr
#

The jerky playback in multiplayer makes some sense if the prediction algorithms used by client use velocity to create smoother movement client side . Since unitPlay is just a set of positions, I'm guessing the client predicts it won't move because it's velocity is zero, then a server update comes in and it jumps it forward with the next position update that makes it through. Haven't tested this to see how bad it is, though.

astral dawn
#

Maybe make an AI drive the boat?

dry zephyr
#

@astral dawn That makes sense about skipping frames before updating position, but the odd thing in my case is that I can make it rotate in place perfectly smoothly with setDir or move smoothly forward with setVelocity on each frame, but not both.

astral dawn
#

What if you use even frames for setDir and odd for setVelocity then?

dry zephyr
#

The problem with AI in a boat is that they stop at every waypoint on the water and have trouble beaching. There's a velocity boost script that does a pretty good job of beaching, but I thought I could write a better boat driving AI to smoothly bring it into a beach... and I think I could within limits if I could change direction and velocity simultaneously.

#

@astral dawn, hah, I tried that, but...

astral dawn
#

Does it also look bad?

dry zephyr
#

Sorry, was trying that again to make sure I remembered correctly.. it still just spins in place.

astral dawn
#

What do you mean by 'Spins in place'?

dry zephyr
#

The boat sits in the water with engine going and creating wake effect, but instead of moving forward, only the direction changes, so it slowly turns to the right in the same spot.

#

What's really interesting about this is I don't do it within onEachFrame...

lone glade
#

probably what you want

dry zephyr
#

but instead do it with sleeps, it will move forward and turn. However, it's a bit juddery, thus I wanted to bring it into onEachFrame .

astral dawn
#

Well you said that you can make it either move well on each frame or make it rotate well on each frame, but not both. I assume there must be some number of frames you could skip to make it still work.

lone glade
#

use setVelocityTransformation and you're done

astral dawn
#

Quite a cool command ๐Ÿ‘

lone glade
#

soooooo, I got a UI issue, I'm resizing my control, it's resized, but the game completely ignores that it's resized:

17:01:29 "1.812 panel filled [1.18371,-0.30303,0.454545,1.60606]" // original size
17:01:31 "4.115 left sel changed [1.18371,-0.30303,0.454545,1.60606]" 
17:01:31 "4.115 control resized [1.18371,-0.30303,0.454545,1.56061]" // resize
17:01:31 "4.115 panel filled [1.18371,-0.30303,0.454545,1.56061]" // list filled

// doing the exact same thing a second time
17:01:59 "8.635 left sel changed [1.18371,-0.30303,0.454545,1.56061]"
17:01:59 "8.635 control resized [1.18371,-0.30303,0.454545,1.56061]"
17:01:59 "8.635 panel filled [1.18371,-0.30303,0.454545,1.56061]"
unborn ether
#

@lone glade Any code snippet on that?

lone glade
#

those 2 files are the only places where ctrlSetPosition are used, well only the first one technically since the second one only has the macro defs

#

(I fixed it but I find it very weird)

unborn ether
#

so its TOGGLE_RIGHT_PANEL_WEAPON either TOGGLE_RIGHT_PANEL_CONTAINER macro, since yeah, only two of them contain ctrlSetPosition but the thing is there is no actual transformation to do it a second time since coordinates are relatively static:

    _x ctrlSetPosition [\
        safezoneX + safezoneW - 93 * GRID_W,\
        safezoneY + 14 * GRID_H,\
        80 * GRID_W,\
        safezoneH - 28 * GRID_H\
    ];\

    _x ctrlSetPosition [\
        safezoneX + safezoneW - 93 * GRID_W,\
        safezoneY + 14 * GRID_H,\
        80 * GRID_W,\
        safezoneH - 34 * GRID_H\
    ];\
lone glade
#

well, yes

unborn ether
#

It just changes the height basically, but performing that twice will give no result, as there is no offset to transform to.

lone glade
#

in theory

#

in practice the height change is completely ignored the first time

#

and I have 0 idea why, probably a bug with listNbox and some super specific stuff

unborn ether
#

Just curious why would you even use different size each time for that listbox, since theoretically it should be the same size all the time.

lone glade
#

That's what I fixed^

#

and as to why, I have no idea at this point

unborn ether
#

So it was that height diff right?

lone glade
#

I went through so many designs it's probably a remnant of that

#

nope

#

I just disabled the resize for those 2

#

i'll never know why it happens ๐Ÿ˜„

unborn ether
#

๐Ÿ˜ƒ

lone glade
#

maybe the height diff is too small... I wonder

#

hm... maybe the resize is slow AF?

#

when resizing more aggresively the list doesn't get filled completely

dry zephyr
#

@astral dawn I tried different frame intervals and it almost works if you do setDir every second frame (and setVelocity every frame), but still get little judders here and there. It might not even be noticable if not running at 120Hz, but AI moving boat is smoother.
@lone glade Thanks, I will look into setVelocityTransformation. The API is intimidating.

royal abyss
#

Can someone send me the scripts of arma 3 life? ๐Ÿ˜‚ Im just kidding pls dont lol

dry zephyr
#

@lone glade Have you ever tried the Bob example? He doesn't seem to climb the stairway of heaven, just falls back to ground and climbs in place.

lone glade
#

I never tried this example, but I know the command works

#

dedmen, bad, bad BAD

royal abyss
#

i have read "Quicksilvers" name on some kind of Invade and annex mission ๐Ÿค”

lone glade
#

i'm tempted to click again....

unborn ether
#

@lone glade ListBox family has an issue with that, if you resize an already filled element, it might not show up all rows properly at the bottom of the list.

lone glade
#

huh, so that's it

modern sand
#

Is there anyway to add text to a structured text control? Instead of replacing it entirely by using ctrlSetStructuredText? Seeming I'm using ctrlText to get the current text from the control, however that only gives me the text string, not including the structured text format.

dry zephyr
#

@lone glade setVelocityTransformation suffers from the same problem as using keyframe animation - it doesn't simulate the boat going through the water and creating wake or revving the motor up

lone glade
#

well, yes, the command ignores the waves and the engine

little eagle
#

@peak plover

I'm using the scripted lobby
Cool. Ever tried it in MP with actual people?

astral dawn
#

Is the _thisScript magic variable defined in absolutely all contexts? I mean, does it exist in all event handlers, init.sqf, and everything else?

lone glade
#

^ what is this variable returning (i'm trying to make a point here, go away ded) @astral dawn

astral dawn
#

'The called or spawned script handle from within itself.'

lone glade
#

okay, what has script handles?

astral dawn
#

spawned scripts for sure have one

lone glade
#

execVM and spawn

#

you got your answer ๐Ÿ˜›

astral dawn
#

Thx, the description sounds strange to me, that's why I asked

#

So will it be scriptNull or just nil in an EH? And what if I remoteExecCall a script?
initServer, initPlayerLocal, initPlayerServer and Init.sqf are launched Scheduled, do they also have _thisScript defined?

lone glade
#

nil and nil

#

none of those have script handles

astral dawn
#

Uh, allright... I was considering constructing a reentrant mutex based on _thisHandle, but if it doesn't exist everywhere I might abandon the idea

lone glade
#

only spawn and execVM have script handles

peak plover
#

No, That's what I wanna do right now

little eagle
#

Cool. You're the first one I am aware of.

#

init.sqf has no script handle that could be terminated with terminate or checked with scriptDone.

nocturne basalt
#

I guys. If I know the ladder object in my mod, can I detect if a player is climbing it?

#

Im attaching a ladder to my vehicle, but also detaching and deleting it when the ladder is retracted. This can lead to undesired results if someone is climbing it while its being retracted

rancid pecan
#

light lightAttachObject [object, position]

#

how can i set position

still forum
#

it says position right there... you put the position that you want exactly where it says.

dry zephyr
#

My self driving boat turned rogue and started killing other boats. Then it came after me.

#

Dangers of allowDamage false and anything can be a waypoint.

rancid pecan
dry zephyr
#

@rancid pecan Take truck position and direction and then use manual distance offset to get position? I think the question would be what you want to do with the position once you found it - attach something? Have someone stand there?

still forum
#

trial and error.

lone glade
#

@nocturne basalt you could check if the ladder is deployed via animationSourcePhase

#

derp*

verbal otter
#

hello, is possible to check player ping with script? Or get data from Rcon for use on script?

astral dawn
#

@rancid pecan you can figure out positions like this: in VR map put some tiny objects like circles/arrows, then take pos. of the car and pos. of these objects (better use posWorld), take their differences and you've got the offset

nocturne basalt
#

@lone glade no I'm thinking I need to force the player off the ladder if climbing it while retracting it

#

somehow

lone glade
#

check for the closest player near the ladder in the ladder anim then force the drop action

#

ez

royal abyss
#

im not completly sure but wasnt zeus able to tell players pings ๐Ÿค”

nocturne basalt
#

@lone glade yeah that could work ty

nocturne basalt
#

got one more question for you guys. How can I reset my turret to its default position? reset to position 0

#

animateSource ["mainTurret",0]
does not work

#

guessing cause its not a user animation

little eagle
#

You can't with scripting. There is no way to overwrite turret rotations with scripting.

nocturne basalt
#

but can I tell the AI to move the turret to 0?

little eagle
#

doWatch

nocturne basalt
#

ty Ill give it a try

little eagle
#
tank1 doWatch (tank1 getPos [10000, 90]);

This will make it look at 90 = east iirc.

nocturne basalt
#

awesome tanks

winter rose
#

Tanks a lot

unborn ether
#

๐Ÿ‘€

thorn saffron
#

How do I run script on players that respawn? I have Extended_InitPost_EventHandlers that looks like this:

class Extended_InitPost_EventHandlers {
    class Man {
        class faster_movement {
            Init = "(_this select 0) setAnimSpeedCoef 1.125;";
        };
    };
};```
Howe'ver I noticed that after respawn the setAnimSpeedCoef  resets back to 1. I want to set it back to 1.125 after respawn.
neon snow
#

How could I determine if vehicle is AA using isKindOf?

gleaming oyster
#

@thorn saffron Hmmm. One can only wonder in both #arma3_scripting and #arma3_config

class Extended_InitPost_EventHandlers {
    class Man {
        class faster_movement {
            Init = "(_this select 0) setAnimSpeedCoef 1.125; (_this select 0) addEventHandler["Respawn",{(_this select 0) setAnimSpeedCoef 1.125;}];";
        };
    };
};
#

I am almost positive there is a cleaner solution though

meager heart
#

afaik just onRespawn = true; (not 100% sure)

astral dawn
#

@neon snow I think there's no reliable way for that. There might be some static manned/unmanned AAs, with rockets/guns/both. A hand-crafted array with classnames is better for that.

neon snow
#

hmm too bad. But thank you ๐Ÿ˜ƒ

astral dawn
#

I think I was trying to check if a vehicle is a mortar some time ago... ended up making an array

dry zephyr
#

Is there way to tell a group after having scripted in some waypoint changes, "Your waypoints have changed, stop heading for your current waypoint that no longer exists and head for your new waypoints?"

winter rose
#

if you delete previous waypoints, they will automatically follow new waypoints

meager heart
#

also setCurrentWaypoint

dry zephyr
#

@winter rose , @meager heart Thanks, knowing that they should immediately start following their new waypoints helped me persevere in figuring out why they weren't doing that (trigger/activation confusion).

limber tangle
#

I am looking to work with playsound3D but struggling with the syntax, say3d worked great but the issue is the addaction would only play the sound for the person who pressed it, i need it to play for everyone here is my current code

this addAction [ "Tornado Warning", {
S1 say3D ["siren", 3000, 1];
S2 say3D ["siren", 3000, 1];
S3 say3D ["siren", 3000, 1];
S4 say3D ["siren", 3000, 1];
S5 say3D ["siren", 3000, 1];
} ]
tulip hare
#

recommend or give copy: a script to make AI more responsive and intelligent? script for zeus without downloading mods, and if download needed, client side? want to pull a fast one on my group..

cobalt vine
meager heart
#
/*
this addAction [ "Tornado Warning", {
S1 say3D ["siren", 3000, 1];
S2 say3D ["siren", 3000, 1];
S3 say3D ["siren", 3000, 1];
S4 say3D ["siren", 3000, 1];
S5 say3D ["siren", 3000, 1];
} ]
*/
action_id = this addAction ["Tornado Warning", {
    {[_x, ["siren", 3000, 1]] remoteExec ["say3D"]} forEach [S1, S2, S3, S4, S5];
}];
#

@limber tangle

limber tangle
#

@meager heart So this should make it so everyone on the server can hear it if they are standing next to the objects "S1, S2, S3, S4, S5"? ๐Ÿ˜ƒ

meager heart
#

yes

limber tangle
#

Thank you!

meager heart
#

btw default max distance for say3D is 100 m, not sure about 3000

tough abyss
#

really new to scripting, trying to learn by putting together samples and trying to make sense of the individual components.

Added an 'addaction' to the init field of a stretcher prop, as following:
https://pastebin.com/U8D6nNE9

Trying to achieve:

  1. add action to stretcher, with a visible first aid icon visible on HUD. Text on actions menu should be red.
  2. the action should only pop when the player is close to the stretcher (within 1 meter). (CURRENTLY NOT WORKING)
  3. this should work in LAN / ethernet.
meager heart
#
0 = this spawn {
    private _stringText = "<t align='left' color='#FF0000'>Heal at Stretcher </t>";
    private _stringImg = "<img image='\a3\ui_f\data\IGUI\Cfg\Actions\heal_ca'/>";
    private _actionText = _stringText + _stringImg;
    private _action = _this addAction [_actionText, {
        params ["_target", "_caller"];
        _caller setDamage 0; 
        hint format ["%1 HEALED!", name _caller];
    }, [], 1, true, true, "", "_this distance _target <= 3"];
};
```into init filed ^ of your object
#

@tough abyss

tough abyss
#

Thanks sldt1ck!

#

the second question I had was to create a container that deletes all of the contents inside at regular intervals (every 300 seconds), in LAN/multiplayer.

#

need sort of a 'trash disposer' for unwanted loot

tough abyss
#

Sorry i'm asking around so much

peak plover
#

Hey commy2, I didn't get my things with scripted lobby to work, because I've mostly ran things in a way that I know I can use postInit and stuff like that. So for scripted lobby, I'll have to rewrite a lot of things/start from scratch

little eagle
#

@thorn saffron Script not config:

// init.sqf
["unit", {
    params ["_new", "_old"];
    _new setAnimSpeedCoef 1.125;
    _old setAnimSpeedCoef 1;
}, true] call CBA_fnc_addPlayerEventHandler;

This way it works even when switching units, and it resets when you switch away from an old unit.

#

I see, nigel. Lobby would be definitely something you start with when creating a mission.

peak plover
#

Yeah. I'll probably try it out for a simpler game mode. It's cool, but yeah, it has to be built from ground with scripted lobby in mind

thorn saffron
#

@little eagle I wanted to everyone have faster movement, player and AI, all the time. It just feels better with slightly faster animations

modern sand
#

Is there is no way to split a string using splitString with a keyword, instead of separate characters? Seeming on the wiki (https://community.bistudio.com/wiki/splitString) it says 'delimiters: String - one or more characters, each used as a separate delimiter.'. Is there any type of way around this, like using a specific syntax? Seeming I'm trying to split a string in half but only at the word "CONTROL".

still forum
#

if you want to split only once you can use a custom script with select and find

modern sand
#

That is very true, idk why I didn't think of that. Thank's I'll play around with it ๐Ÿ˜ƒ

limber tangle
#

Hi guys sorry to bring this back up but the first time round did not seem to fix the issue
the original post mentioned say3D and one of the members sent back a new line of code that was meant to help play the sound for all players on the server, but did not seem to work: here is the original and revised code:

/*
this addAction [ "Tornado Warning", {
S1 say3D ["siren", 3000, 1];
S2 say3D ["siren", 3000, 1];
S3 say3D ["siren", 3000, 1];
S4 say3D ["siren", 3000, 1];
S5 say3D ["siren", 3000, 1];
} ]
*/
action_id = this addAction ["Tornado Warning", {
    {[_x, ["siren", 3000, 1]] remoteExec ["say3D"]} forEach [S1, S2, S3, S4, S5];
}];
still forum
#

how does it not work?
Is the sound only playing for the one that executed the action?

limber tangle
#

yeah only the player to execute the addaction hears the audio not everyone

#

not worried about JIP as everyone should be on the server before the audio plays anyway

still forum
#

the code looks correct to me

limber tangle
#

as a total noob at this am i required to keep in whats between the /* */ ?

still forum
#

no

#

that's just a comment

limber tangle
#

i thought so

#

i saw mentioned playsound3D should be used but i believe it uses a different syntax, could this be the issue or should say3D still work?

still forum
#

say3D should definitely work. with the remoteExec it's executed on every player. And not just the one that executed the action

ruby breach
#

Only thing I can think of is if the objects were created locally by the executing player, and thus aren't AG. Otherwise it looks right.

peak plover
#

extended eventhandlers work the same way for addons and mission config?

still forum
#

ye

peak plover
#

Ohh hot damn

#

I thought for some reason they would not work like the same way.

#

Btw is there any macro decompiler other than loading into arma and saving a function as a variable (like cfgFunctions)

#

Using macros saves all the newlines from text editors or sth

#

Are there perhaps any tools that will run all the macro stuff when making the .pbo ?

lone glade
#

^ wat

#

think of macros as copy and paste

still forum
#

macro decompiler What? You mean preprocessor out of arma?

queen cargo
#

keep in mind, GCC is not compatible fully with ArmA

still forum
#

And that on your screenshot is a preprocessor bug. Happens if you have a #include after a block comment which ACE and CBA do everywhere

lone glade
#

"bug" ๐Ÿ˜„

queen cargo
#

pretty much the whole pre processor of ArmA can be considered a bug ...

#

that thing has more flaws then anything else

lone glade
#

if it doesn't crash it means the prepro worked fine huehuehuehue

#

"oh god an error" proceed to shit itself - arma preprocessor

queen cargo
#

you also can just to string.replace(macro, expression) and it would work

#

does not means it would be a good idea to name it preprocessor

#

for some worse example flaws in the arma PP, try to nest #ifdef

#

if it still behaves as it does back when i tried to do this, you will get an empty file

peak plover
#

Ohh, so include before the comment @still forum ?

still forum
#

ye

peak plover
#

okay thanks

#

didn't know that

#

Also @little eagle I figure the best way to do scripted lobby is to have 1 postInit scripts that run when player joins the game.
And gameInit or sth like that which run when player clicks ok on the lobby and gets in the game

#

I think ace should work fine 'tho

little eagle
#

@thorn saffron I see. I don't like midnights solution, because the respawn eventhandler triggers only locally, but the init globally. It would be wonky for remote respawned objects when they change locality. Unlikely, but you know.

#
class Extended_InitPost_EventHandlers {
    class CaManBase {
        commy_faster_movement = "\
            params ['_unit'];\
            _unit setAnimSpeedCoef 1.125;\
            _unit addEventHandler ['Respawn', {\
                params ['_unit'];\
                [_unit, {_this setAnimSpeedCoef 1.125}] remoteExec ['call'];\
            }];\
        ";
    };
};
peak plover
#

For a quick fix I made it so all my postInit functions get re-run, when player joins a slot from scripted lobby

#

But still, it's better to avoid issues just if I rewrite the postInit stuff into joinGame or sth

half inlet
#

I've got a bit of a tricky challenge and need some advice; I'm trying to detect whether a helicopter (ideally this should work for any helicopter) is resting on the ground - by which I mean the landing wheels (or landing skids) have made contact with the terrain

#

my current approach is to iterate through selectionNames to determine which selections represent the wheels or the skids, in the hope that I could later on do a simple raycast to the ground to determine if the wheel/skid is touching it

still forum
#

(getPosATL helicopter select 2) < 0.2

half inlet
#

however... wheel naming conventions aren't standardised, and skids don't show as selections

#

oh, I've tried the getPosATL method before, the thing is the threshold altitude depends on the model center's position

#

on some helicopters, 0.1-0.2 is fine, whereas others need up to a full meter

still forum
#

okey. There was some other getPos that returned the ground contact point height I think

#

@little eagle you know things

half inlet
#

I was googling for that but the only mention of landContact (which I assume could be useful here) was as a parameter for selectionPosition, which isn't what I need

#

I'll admit this is a rather... tricky issue, which probably doesn't have a solution that covers all situations - but one can hope ๐Ÿ˜›

still forum
#

That would work if you know the name of the selection in the landContact lod

half inlet
#

right, that was my thought, but I didn't get much further than that since I don't know the name of the selection for each helicopter

still forum
#

otherwise you probably could use the bounding box. If the lowest bounding box point is at ground level or below.. then.. on ground

half inlet
#

hmm, that's a good idea

still forum
half inlet
#

I'll see how that holds up

#

I was already doing some stuff with the bounding box to approximate the inertia for each axis of the helicopter, but the results were quite a bit off, so here's hoping this will do

still forum
#

if the bounding box is too big it might have the same issue as getPosATL

half inlet
#

somehow I have a feeling that will be the case for retractable-wheel helicopters

#

since the wheel selections will be moving out of the initial bounding box (unless the model already has the gear lowered)

#

anyway, I'll give this a test, bbl

#

well, it works when the helicopter lands with all wheels touching the ground (or skids aligned to terrain), but if I'm hovering with, let's say the front wheels of a Ghost Hawk on a slight slope, the offset from the model center is enough to throw the altitude off by half a meter

#

even though I'm technically touching the ground

#

while this would probably not be dramatic for most applications, it's unfortunately not good enough for my use case... ๐Ÿ˜•

#

eh, I'll come up with something

meager heart
#

isTouchingGround ๐Ÿค”

still forum
#

๐Ÿค” ๐Ÿคฆ

meager heart
#

๐Ÿคท

half inlet
#

wait no way

#

...okay. ๐Ÿคฆ ๐Ÿ˜‚

astral dawn
#

Also useful when an AI car gets itself flipped over

unborn ether
#

commy breaking in

still forum
#

He's taking his time

little eagle
#

Yep, still thinking. It will be genius.

#

I need some paper.

still forum
#

throws paper

little eagle
#

catches paper

#

Thanks.

still forum
gleaming oyster
#

Paper is simply amazing!

meager heart
#

Use less paper, save the world's forests!

little eagle
#

@half inlet @still forum

oh, I've tried the getPosATL method before, the thing is the threshold altitude depends on the model center's position
This is badly worded. getPosATL reports as z the distance from the terrain at model center and the land contact LOD (not the model center). This would only be an issue with tilted objects...

That would work if you know the name of the selection in the landContact lod
right, that was my thought, but I didn't get much further than that since I don't know the name of the selection for each helicopter
There is no selections in the land contact LOD and there is no command to report points from that LOD. You're thinking of the Memory LOD and memory points. These are not memory points and cannot be retrieved with selectionPosition.

well, it works when the helicopter lands with all wheels touching the ground (or skids aligned to terrain), but if I'm hovering with, let's say the front wheels of a Ghost Hawk on a slight slope, the offset from the model center is enough to throw the altitude off by half a meter
Ah, so the problem is tilted objects specifically.

Can this wait approximately 2 weeks? Because I'd like to try a potential solution I have on a machine that can run Arma, and I will only have access to one in 12 days.

still forum
#

cannot be retrieved with selectionPosition.

Why does wiki list landContact lod as an example for selectionPosition then

little eagle
#

Oh that optional parameter. Just sucks that there are no selections in that LOD to read.

still forum
little eagle
#

Great idea to fix error messages after everything is written.

still forum
#

But atleast we can debug the scripts now. The VS Code debugger plugin is getting close

half inlet
#

@little eagle sure, but I wouldn't worry about it if I were you, as the issue has already been resolved (via the isTouchingGround command, the existence of which I was not aware of ๐Ÿ˜› )

#

that command does return true if even just one wheel is touching the ground, and it also works in slopes, which is precisely what I needed

dry zephyr
#

@half inlet isTouchingGrouhnd has worked for me with a helicopter - I assume you read the notes about how it may not be trustworthy in some cases, like roof landings.

half inlet
#

yeah, I've read those, but I probably won't be using it for roof landings

#

I'm using it to counteract a hardcoded AI behaviour where the helicopter pilot will reset its controls once the helicopter touches ground (even when the pilot is unconscious!), and it seems this also triggers on isTouchingGround

#

so I'm not bothered

dry zephyr
#

Reset its controls?

half inlet
#

I'm working on a very niche feature where I'm trying to override a lot of hardcoded AI behaviours

#

one of them is that when a helicopter pilot passes out (_unit setUnconscious true), his input controls will remain in whatever state they were in the moment he fell unconscious

#

until the helicopter touches ground, at which point the controls revert to 0

#

primarily, this affects the yaw input

dry zephyr
#

Oh, so if he (AI algorithm) has full left pedal on and goes unconscious, the helicopter will keep spinning (receiving full left pedal input) until it hits ground?

half inlet
#

exactly

dry zephyr
#

Is that also the case if you disable sim enableSimulation false on the pilot?

half inlet
#

I've already tackled that by making a yaw trim gauge that allows me to override his input, and achieve near-perfect zero input ๐Ÿ˜›

#

tbf, I don't know, because I don't want to use too many commands on the AI so as to prevent other features/mod interactions from breaking

#

I've already established that none of the disableAI parameters affect the flying AI behaviour, so I've decided to simply override the helicopter's motion entirely

dry zephyr
#

Interesting. Having fought with the boat AI, I am sympathetic to anyone trying to outfox the AI.

half inlet
#

oh, I've already achieved some fantastic results, let me tell you that ๐Ÿ˜„

#

I will definitely be posting a video once everything is fully functional

#

the results should be very immersive from an observer's perspective

dry zephyr
#

Cool. I was disappointed that I could not control the specific impulses. I could take over the whole boat motion with setVelocity, but this had some issues in that it was jerky compared to the smooth movement of the AI (at 120Hz), even done each frame, and had to be done every other frame when changing direction with setDir. I would have much rather had scripting commands where I could say 'steering x to the left/right', 'increasing engine thrust', etc.

#

Basically playing the AI into the boat controls.

#

Sounds like you may have accomplished something like that with the helicopter if you are able to create yaw counteraction.

half inlet
#

two tips: addForce and addTorque

#

that's all I'm using

dry zephyr
#

Also, setVelocity did not wave follow.

#

It would be a real bad day for passengers if the waves were whipped up. ๐Ÿ˜ƒ

half inlet
#

because setVelocity, as the name implies, sets the velocity, and thus completely overrides any external forces that may apply on it

dry zephyr
#

Oooh. I'll have to take a look at those. I searched all kinds of keywords like thrust, rpm, engine, etc.

half inlet
#

you should instead use forces and torque, that way you're playing on the same level as all other external forces that apply on your boat

dry zephyr
#

Yes, totally understand. Thanks for the tip!

half inlet
#

they're fairly new (ish), I would have used them sooner but I only came across them a couple months ago myself

dry zephyr
#

I basically concluded that after I did everything with setVelocity, I had recreated the Keyframe Animation modules in EDEN. ๐Ÿ˜ฆ

half inlet
#

also, for someone like me who's coming from sandbox environments like Garry's Mod, these two commands open ArmA up to an entire world of possibilities ๐Ÿ˜›

#

might be the same for you

#

last month I whipped up a script that reduced the gravity of the car I was driving, allowing me to ramp off of cliffs and get some serious air

little eagle
#

๐Ÿค” ๐Ÿค” ๐Ÿค”

half inlet
#

and right now I just realised I now have all the pieces I need to turn a car into, say, a glider

#

or a helicopter

#

hah, yeahhh the image is rather misleading

dry zephyr
#

The only difference, though, was that Keyframe Animation did not trigger wake or engine noise and revving. Whereas setting velocity did. Which is somewhat interesting because that means setVelocity and Keyframe Animation use different mechanisms to actually move the object frame to frame. Also unitPlay/unitCapture worked fairly well (only single player and localhost multiplayer testing), and created wake, but didn't rev up the engine (could turn on for engine noise, but didn't follow effective speed). So that is yet a different interaction with the physics/effects/sound engine!

half inlet
#

the way I'm seeing it is you gotta take a vector, fill in the X, Y and Z with what torque you want to be applied on each axis of your object, vectorModelToWorld that because addTorque takes world coordinates, and bam

#

suddenly you can control your object's angular velocity

dry zephyr
#

Agree that addForce and addTorque are going to open up new possibilities for me.

half inlet
#

if you then need to get the angular velocity, you gotta deduce it from its vectorUp and vectorDir, along with some vector maths

little eagle
#

How is the image misleading and not just wrong? That circle says "counter clockwise", but it's clearly clockwise.

austere hawk
#

left hand rotational system...

half inlet
#

tbf, I only glanced at it for a few seconds, before realising I'm better off doing a lot of trial and error to figure it out

austere hawk
#

it's not the "norm", but nothing is stopping anyone from defining it this way

dry zephyr
#

Oh, wow... this is allowing us to tap directly into Physx, at least in limited form - regards the NVIDIA docs link.

#

Have experience of that from Unreal.

little eagle
#

X3KJ, please explain how that changes the directions clocks turn.

half inlet
#

the one thing I really need next is to get an object's inertia as a vector

#

maybe also a angularVelocity or velocityAng command

#

but even without that I can already do a lot

austere hawk
#

oh thats what you mean... well yeah that does not make much sense

little eagle
#

Should I trust the arrows (left hand rotation) or the labeling as ccw (right hand rotation)?

austere hawk
#

i would trust ingame testing

dry zephyr
#

Well, it's impossible to say looking at it from the horizontal. If you looked up from the bottom it would be counter clockwise. If the top, clockwise.

little eagle
#

It's a bad doc then.

austere hawk
#

a faulty one at least

#

the image makes 'sense', if you assume that you look from COM along the vector. It just shows that "clockwise" has no place in 3 dimensional space

dry zephyr
#

@half inlet I don't see any likely suspects for angular velocity. Guess it depends on what you are getting velocity of and relative to what. The inertia piece is interesting because you reminded me that Arma prominently advertises Physx and I wonder if the inertia is being calculated against air/water resistance for slowing things down rather than a custom inertia fade off. I note there is also a setMass, which combined with addForce and addTorque could enable differences in the behavior of an object's response to forces (applied or environmental).

half inlet
#

inertia is a property of the object, which would help me determine how much torque I need to apply a desired amount of angular acceleration

little eagle
#

the image makes 'sense', if you assume that you look from COM along the vector. It just shows that "clockwise" has no place in 3 dimensional space
But it does. There's the right hand rule for this. It's just that the arrows on the pic don't match ccw rotation with right hand rule, and neither do they with left hand rule.

half inlet
#

basically it gives you an idea of how big the object is, and how the mass is spread out across it

dry zephyr
#

It doesn't look like the engine allows us to reach as deep as the collision model though as the disableCollisionWith specifies it is about vehicle collision and specifically not access into the Physx collision model, but that's OK given that we don't need exotic collision rules in something trying to simulate reality.

#

I see that center of mass can be adjusted programmatically as well,.

#

Understood on inertia - torque -angular acceleration. Well, look forward to whatever you are coming up with.

austere hawk
#

@little eagle just as there are right hand rule systems there are left hand rule systems

little eagle
#

I know, but then it still isn't ccw rotation.

#

Try it.

#

Use left hand.

#

Arrows match.

#

Still cw, not ccw

half inlet
#

I see what you mean, you're right

#

the arrow directions make it look like a left-hand system, but then the text saying "counter-clockwise rotation" would be wrong

little eagle
#

Yes.

#

Thanks.

#

ffs

#

aaaaaaa

half inlet
#

kinda sounds like a #firstworldproblems deal to me ๐Ÿ˜„

little eagle
#

It's one of those problems that made the first world as good a place to live in it is in the first place though.

austere hawk
#

no it works if you look from underneath

half inlet
#

I'd agree, but I'm afraid our local channel police is about to step in and whack us on the fingers with a virtual ruler before telling us to head over to #offtopic_politics

austere hawk
#

which is what i said, look from COM towards the tip (bottom)

half inlet
#

so I'll see myself out

little eagle
#

no it works if you look from underneath
"We only left hand thread screws, boss!"
"No problem. Screw them in from the bottom"
๐Ÿค”

half inlet
#

even if that worked it'd still be wrong

#

see, the thing about this image is that the perspective we're given implies we're looking at a cube from slightly above, as if it was resting on a flat surface infront of us

#

at least that's what we can deduce from the dotted lines

#

with this in mind, the circle is located in a horizontal plane, while the arrow is pointing upwards ("towards the sky")

lone glade
#

what's wrong with you people?

half inlet
#

if we now look down on the circle from a vertical point of view (though we are already looking at it from slightly above, but at an angle) we'd see that the circle's arrow is in fact pointing clockwise

lone glade
#

that graph is clear guys

half inlet
#

I dunno, I'm probably overexplaining at this point

little eagle
#

ikr, alganthe

#

It's clearly bs.

lone glade
#

well, yes

half inlet
#

^

lone glade
#

but it's clear nonetheless

half inlet
#

clearly wrong ๐Ÿ˜‚

little eagle
#

ctrl + a

lone glade
#

whoever made it doesn't know what a clock is

little eagle
#

shift + delete

lone glade
#

but it's still clear :kappa:

little eagle
#

Bohemian clocks turn backwards.

half inlet
#

the author's lack of understanding on clocks is very clear, yes

dry zephyr
#

I don't understand why you are so confused @little eagle because, given your Sisyphus icon, you should be used to looking up hill, not down, in which case it makes perfect sense.

#

I'll show myself out.

half inlet
#

aaaaaaand I'm out of here aswell before the storm hits

icy light
#

can an array be set as listbox data? lbSetData [100, _index, _MYARRAY] ? or will it only store a string?

little eagle
#

No, lbData is a string, lbValue is a number.

#

What does the array consist of?

icy light
#

well it was going to be an array of strings

small iron
#

Would there be a way to export data regarding ongoing server events? Ex. A text file is made every 4-12 hours with who shot who, who damaged who, or who killed who.

peak plover
#

Yeah that's possible

small iron
#

@peak plover Is there a function that returns an event?

#

one of those events

peak plover
#

@little eagle I got a mission with the scripted lobby up andrunning

small iron
#

Thank you

#

So much

peak plover
#

Seems to be working fine in multiplayer

#

no problemo

meager heart
#

got it working with respawn templates ?

dry zephyr
#

Is there a way to turn on a vehicle damage light in the upper left HUD (like ENG to red) without also getting the cracked windshield that occurs? Setting hitpoint damage of engine to 1 in M-900 results in cracked windshield, but just want light on, not the cracked windshield effect.

frank mesa
#

Anyone in here looking for paid work? Not sure if this is the right channel, but send me a friend request, I have a full design document if interested

little eagle
#

I got a mission with the scripted lobby up andrunning
๐Ÿ‘

naive estuary
#

Scripted lobby?

unborn ether
still forum
frank mesa
#

Cheers mate just found it

astral tendon
#

Can some one give me some suport about ACE?

tough abyss
#

Going have to be a little bit more specific that than!!!

astral tendon
#

Its broad but seens like ACE disable/remove some of my missions event handles, i would like to know what are they and how I can stop it from happen

still forum
#

They don't.

#

ACE can't change engine eventhandlers

astral tendon
#

User placed event handles

still forum
#

What is a "User placed event handle"?

astral tendon
#

addEventHandler

tough abyss
astral tendon
#

for exemple

_this addEventHandler  ["HandleDamage",{
            _returnDamage = (_this select 2);
            if ((_this select 4) in ["B_45ACP_Ball","CSW_Taser_Ammo"] AND currentMuzzle (_this select 3) in ["hgun_Pistol_heavy_01_F","CSW_M26C"]) then
            {
                _returnDamage = 0;
                if((_this select 3) distance (_this select 0) <= 10 AND !(captive (_this select 0)) AND  Alive (_this select 0) AND isnil {(_this select 0) getVariable "Tased"}) then {null = [(_this select 0)] execVM "TaserEffect.sqf"};
                if((_this select 3) distance (_this select 0) >= 10 OR captive (_this select 0)) then {(_this select 0) setskill ["courage", ((_this select 0) skill "courage")+(_this select 2)]};
            };
            if ((_this select 4) in ["","GrenadeHand","mini_Grenade","rhs_ammo_mk3a2","rhs_ammo_m84"]) then
            {
                _returnDamage = 0;
                if ((_this select 2) >= 7 AND !(captive (_this select 0)) AND side (_this select 0) != west) then{
                [(_this select 0)] spawn {
                (_this select 0) call VoiceBanged;
                (_this select 0) setUnconscious true;
                sleep 2;
                (_this select 0) setUnconscious false;
                sleep 4;
                if ((animationState (_this select 0)) in ["unconsciousfacedown","unconsciousrevivedefault","unconsciousfaceright","unconsciousfaceleft","unconsciousfaceup"]) then {
                [(_this select 0), "AinjPpneMstpSnonWnonDnon_rolltofront"] remoteExec ["switchmove", 0];
                sleep 1;
                [(_this select 0), "amovppnemstpsnonwnondnon"] remoteExec ["switchmove", 0]};
                };
                };
            };
            _returnDamage;
}];
#

this event handle is supouse to remove the granade damage and make the unit Unconscious, it works in vanila but not in ACE

#

also that pistol damage

#

that event handle is added when the unit is created

still forum
#

They don't remove it. The medical system overwrites your HandleDamage

#

only HandleDamage.

astral tendon
#

when that is added?

tough abyss
#

They both run and ACE applies its damage. If you want your own medical system then remove ACEs.

astral tendon
#

Yes, that what i am asking for people playing my missions, but they still insist

still forum
#

When ACE medical was added? January 2015. And even then it was only a port of CSE medical

#

for reference. ACE in general was created 8 days before medical was added

tough abyss
#

addons/medical/functions/fnc_handleInit.sqf line 20 shows them adding the HandleDamage event handler

#

In the past one way we dealt with specific issues we had with medical was just to open the PBO and edit the one or two files we had issues with and maintained patches that way. Saved us having to set up an ACE branch and build. PBO Manager can do the extract and reinsertion of the files.

astral tendon
#

Maybe add a delay i can override ACE medical?

still forum
#

yeah. If you execute your code one frame later that could work

#

But.. If you are trying to prevent the unit from being killed. Then that code won't help much if it's executed after the unit is already dead

astral tendon
#

what?

tough abyss
#

ACE will happily kill your unit in its handleDamage event handler so the only way to stop that happening is not use it all. You likely need to do substantial changes to the handleDamage of ACE/medical if you wish to use its other features while maintaining your own damage routines.

astral tendon
#

It is to prevent the unit from take damage from the granade

tough abyss
#

Both event handlers are going to run, yours stops grenade damage happening, ACE applies it. ACE kills your unit. Only really two options - don't use ACE medical or modify ACE medical so it doesn't do damage in the same way your mod doesn't. Variety of ways to do the later.

astral tendon
#

so how i can just remove that ACE event handle?

still forum
#

How do HandleDamage eventhandlers take effect? Does only the damage value of the last eventhandler apply and all prior ones are ignored? If so. Just add your EH last.

astral tendon
#

Now i tested, adding a 3 second delay does add my event handle and its effect, but ACE still enable its damage

#

How i can then remove the defaul ACE EHs?

still forum
#

You can't remove the EH after it was added

tough abyss
#

] BrightCandle: addons/medical/functions/fnc_handleInit.sqf line 20 shows them adding the HandleDamage event handler

still forum
#

You have to prevent the init EH from being added which.... You can't.

tough abyss
#

So change the init so handleDamage never gets added?

still forum
#

Without modifying the ACE medical pbo

tough abyss
#

Or don't run ACE medical, options haven't changed in the past 10 minutes ๐Ÿ˜•

still forum
#

I already asked them to give EH's handles even though they don't need them internally. But they didn't want because they don't want people to mess with it. And I understand that.

tough abyss
still forum
#

Yeah ^ Exactly what I asked about

tough abyss
#

Make your mod dependent on ACE and you should get initialised later and thus later in the handler list and executed last?

still forum
#

adding the "init" eh in init/postInit instead of preInit like ACE does should be enough

hollow thistle
#

So we are thinking about using "floating" camera for Liberation build system (instead of current system where item is placed in front of player) . Would it be feasible to integrate Zeus into our resource system or would it be better to write it from scratch?

astral tendon
#

so what i can do?

astral tendon
#

Well, I had to do that with brutal forรงe

sleep 3;
_this removeAllEventHandlers "killed";
_this removeAllEventHandlers "Hit";
_this removeAllEventHandlers "HitPart";
_this removeAllEventHandlers "HandleDamage";
_this removeAllEventHandlers "Dammaged";
_this removeAllEventHandlers "Explosion";
_this removeAllEventHandlers "MPHit";
#

Now my EH are working.

digital jacinth
#

have you tried running tha on next frame instead of a 3 second delay?

astral tendon
#

Just what it to be safe

#

nothing happens after 3 seconds anyway

brave jungle
#

Hi there, is there a way to remove specific items from Zeus that won't remove an entire add-on? I need to remove the exec module from the Achilles mod but not really sure how to.
I do know about removeCuratorAddon but it removes all the modules

digital jacinth
brave jungle
#

I'll take a look

little eagle
#

Freiheit

dry zephyr
#

I think I understand that models consist of object geometry (.p3d), textures (.paa), and materials (.rvmat). There are two stories as to how damage appears (like cracked windshield on helicopter after being fired at). One is that there are three materials (_base, _damaged, _destroyed) and one is selected based on damage value of something (not clear here on why windshield cracks when engine is destroyed, for example). The other theory from @austere hawk is that there are detail maps (*_dt.paa) that are overlaid over the main texture.

My question regards scripting is is there any way to get access and control the textures and materials through SQF? getObjectTextures and getObjectMaterials seem to return only one texture (the skin texture) and no material as when called on an object like a helicopter. Is there a way to drill down into sub-components of the model and modify textures and materials of individual parts of a vehicle from script?

little eagle
#

getObjectTextures and getObjectMaterials seem to return only one texture (the skin texture)
xMaterial reports the material, not a texture. Though the material technically contains textures I guess, e.g. the detail map.

My question regards scripting is is there any way to get access and control the textures and materials through SQF?
You can read the Wounds or Damage class from config and together with the damage of the selection, you can deduct which material is supposed to be shown at the moment. But no direct way.

Is there a way to drill down into sub-components of the model and modify textures and materials of individual parts of a vehicle from script?
No, there isn't, except from setHit(PointDamage). Give up now, tried before many many times.

dry zephyr
#

@comm2 thanks - sorry, I meant getObjectTextures returns a texture (like ["a3\air_f\heli_light_01\data\skins\heli_light_01_ext_sheriff_co.paa"]), `getObjectMaterial just returns an array with empty string ("").
But I hear what you are saying. My annoyance is that setting certain things like avionics or engine damage up close to 1 results in the windshield looking cracked. It feels like it should be possible to have a broken engine, but clear windshield.

little eagle
#

NORMAL, DAMAGED, REALLY_DAMAGED
Always N*3 groups.

#

My annoyance is that setting certain things like avionics or engine damage up close to 1 results in the windshield looking cracked. It feels like it should be possible to have a broken engine, but clear windshield.
That sounds weird. Sure the glass isn't damaged as well?

dry zephyr
#

Yes. Try this on, say, an M-900 helicopter global var "heli":
heli setHitPointDamage ["hitengine", 1, false]; diag_log getAllHitPointsDamage heli;

#

The whole helicopter then looks like it was put through a blender, but the only damage showing in the hit points list is the engine at 1, everything else 0.

little eagle
#

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

#

Try without that "false" flag maybe.

dry zephyr
#

Even with true or just: heli setHitPointDamage ["hitengine", 1];

little eagle
#
heli setHitPointDamage ["HitEngine1", 1];
heli setHitPointDamage ["HitEngine2", 1];
heli setHitPointDamage ["HitEngine3", 1];
heli setHitPointDamage ["HitEngine4", 1];

And this?

dry zephyr
#

Well, that is interesting, because it sets the of the first 3 (the M-900 doesn't have a "HitEngine4" hitpoint) to 1 in the getAllHitPointsDamage list... and the helicopter shows no damage... but the engine is still functional and can be turned on (the gauges don't show ENG as red either).

little eagle
#

Then I'm out of ideas.

#

Well.

#

Do you know which HitGlassN controls the windscreen?

#
heli setHitPointDamage ["HitEngine", 1];
heli setHitPointDamage ["HitGlass1", 1];
heli setHitPointDamage ["HitGlass1", 0];

Just not sure "HitGlass1" is the right one.

peak plover
#

๐Ÿค”

dry zephyr
#

@little eagle "HitGlass1" and "HitGlass2" control the left and right hand side of the winshield. Setting either to 1 gets the effect on just that part. However, they stay 0 when "HItEngine" is set to 1, but they are still cracked. In fact, the whole helicopter goes into full damage appearance- body, rotor, etc. Even though everything but the engine hitpoint is at 0 damage.

astral tendon
peak plover
#

I use safeZoneX + safeZoneW

#

I think it's always full screen from safezone x to safezonex+safezonew

astral tendon
#

any exemple?

peak plover
#

This menu is always the same proportion of my screen

#

No matter if I use small or large

#

It will always take up for ex. 30% of the screen

astral tendon
#

I mean, the script

peak plover
#

      x = GUI_GRID_X + (20 * GUI_GRID_W);
      y = GUI_GRID_Y + (2 * GUI_GRID_H);
      w = 19  * GUI_GRID_W;
      h = 21  * GUI_GRID_H;

#

GUI_GRID_X = safezoneX;
GUI_GRID_W = (safezoneX + safezoneW)/40;

#

so x is always in the middle of the screen

#

As you can see from the image

astral tendon
#
    _timeToMinutes = [_timer, "MM:SS"] call BIS_fnc_secondsToString; 
    _TimeLeft = format ["<t color='#ff0000' size = '.8' font='PuristaBold'>Hostages Will Be killed in:<br /><t font='LCD14'>%1</t>",_timeToMinutes];
    [_TimeLeft,-0.99,-0.1,2,0,0,789] remoteExec ["BIS_fnc_dynamicText",[0,-2]select isDedicated, true];
#

how should i fit it?

civic canyon
#

I've been trying to find a script for me to allow cops to keep their gear after they die

peak plover
#

@astral tendon You can create your own display and control or resource and do it

astral tendon
#
[_TimeLeft,(safeZoneX-0.2),(safeZoneY+0.4),2,0,0,789] remoteExec ["BIS_fnc_dynamicText",[0,-2]select isDedicated, true];

I come up with this

gleaming oyster
#

display and control or resource and do it

astral tendon
#

No idea what that is.

peak plover
#

if you do -0.2 and +0.4

#

That won't work

#

Because depending on the screen the size is different

#

You have to calculate the size of the screen and get it inside of that

dry zephyr
#

Since you guys are talking about positioning displays on screen, is there a way to do positioning such that a display or control would always align with the vehicle info cluster in the upper right that shows HULL, ENG, etc.? For example, if you wanted to add another indicator there that would look like it is part of that vehicle info cluster?

peak plover
#

@dry zephyr check into UI_F pbo

#

I remember I resized the pip window before that was possible

#

But you need to do some tricky shit, and only if the ui element is defined there

#

If you can find the ui element in the game files, you can modify it, but I don't know exactly how. But that's a start

dry zephyr
#

@peak plover - thanks, I was thinking of doing it via script, but you are right - people could have that turned off and if you started adding icons by overlaying with a display or control, it could look funny

austere hawk
#

@dry zephyr why is the "other theory" my theory ? Detail maps are overlaid over diffuse map yes, thats no theory. How do you define detail maps? By rvmat... which is where the 3 rvmats come into play (they can do more than just adding detail maps...)

dry zephyr
#

post above describe a system of three materials with different ending names like _base _damaged _destroyed.

austere hawk
#

there is no "other information". It all refers to the same system. I just didnt go at length to explain everything in that post

dry zephyr
#

I guess my confusion is that a a *_dt.paa would be a fixed texture, not a material. If the damage appearance is based on choosing between three different materials specified for a part of the model based on the hit point damage value, what is the role of the detail map?

austere hawk
#

you can apply a dt map with an rvmat. There is no other way to do it

dry zephyr
#

Ah, ok, think I understand now...

#

You are saying that it chooses one of the .rvmat materials - that .rvmat may choose to use a texture as part of its material calculations.

#

In which case, it could use one of the *_dt.paa textures in its internal config/logic.

austere hawk
#

if you look at a regular rvmat for a standard model with supershader (e.g. vehicle or handweapon) you see that rvmat has several stages. _SMDI (specular/gloss), NOHQ (normal), AS (ambient occlusion map) beeing primary one. But also option for DT and MC map (detail and macro). You swap material, so you can change any of those textures for a different one, or change it's appearance.

dry zephyr
#

@austere hawk thanks, understood. Just wish I could change materials on the fly with scripting commands.

peak plover
#

huuuh? D:

#

Das weird

little eagle
#

@dry zephyr Then there's nothing you can do about this.

#

@peak plover WORKING AS INTENDED*

digital jacinth
#

yo server is a player too ๐Ÿ˜‰

dry zephyr
#

@little eagle, actually I found you can change the textures (and materials?) with scripting commands BUT it depends on the how the model is created. Specifically, if the model was created with hidden selections, you can change the texture (and material?) with setObjectTexture. For example, this changes the color of the everything on the exterior except the rotors and windows, and exhaust vent to red on an M-900:
heli setObjectTexture [0, "#(rgb,8,8,3)color(1,0,0,1)"];

#

Unfortunately, that is the only exposed hidden selection I've found on the M-900. However, a model better designed for scripting changes could I suppose allow changes of just about anything.

#

What's interesting is that damage effects still overlay the texture after you change it (like bullet holes still show after changing the helicopter to red). I'm guessing that is a material being applied over the texture and we might be able to change that with setObjectMaterial with an .rvmat file handy as that function wants a file path to an .rvmat file.

#

As for the rotors, windows, exhaust vent, I'm guessing those are defined internally as part of the model, have their own textures and materials listed for base/damaged/destroyed, and aren't exposed as hidden selections, so we have no way to change them from scripting.

young current
#

@dry zephyr setObjectMaterial works properly only with materials that are predefined on the particular .p3d so it does not work well with just any custom rvmat.

#

also yes to what you wrote about parts that do not have hiddenselections

little eagle
#

I told you to give up hours ago.

#

You could've watched a movie instead. Or gone out for dinner. Played a game, listened to music.

#

But nooo, you had to try.

dry zephyr
#

@young current understood - I'm guesing some materials might work ok because they don't have maps or anything conforming to the model (really simple ones), but in general, if the material isn't designed for the model or part of the model, it's going to look awful.

young current
#

yes I would advice against such actions

#

color you can already change with just textures

#

I dont really see why you would even want to touch the actual material

dry zephyr
#

@little eagle if I had given up, I wouldn't have learned that changing model appearance from scripting is in fact possible, just within certain limitations, particularly with included models from BI that you can't get access to to make modifications to the hidden selection list, but with a community model or your own model, you could actually do a fair amount from scripting. I'd like more hidden selections on the included model like the M-900, but I think it's a fair balance since Arma isn't a general purpose game engine.

little eagle
#

There is no reason not to be able to change all textures on the fly except lazy programming.

thorn saffron
#

Is there a way to start Zeus in a mission where there is no curator module palced?

still forum
#

yes.

#

You can place the module mid-mission

peak plover
#

Ah that's ment to be there?

#

Where do you get them @little eagle

little eagle
#

No, it's not. Obviously.

astral tendon
#
_test = "stuff";
{systemChat _test} remoteExec ["call",0];

How to send a local variable to the remoteExec?

little eagle
#
private _test = "stuff";

[[_test], {
    params ["_test"];
    systemChat _test;
}] remoteExec ["call"];
astral tendon
#

thanks

#

though, why the private?

still forum
#

because it's safer, faster and doesn't hurt

little eagle
#

Why not private?

queen cargo
#

Why not zoidberg?

#

(\/) (ยฐ,,,ยฐ) (\/)

little eagle
#

Is this supposed to be funny? Should I laugh?

astral tendon
#

Laughs in portuguese-BR

peak plover
#

Hilarious

civic canyon
#

How can I improve the distance of the police siren

meager heart
#

custom air horn kit with high psi pressure switch and bigger air tank... should work

civic canyon
#

what ?

meager heart
#

your question is the same as "how i can make this better" ? i mean... people should somehow guess what you doing there and what is your problem

dry zephyr
#

@little eagle Your point on not being able to change all textures on a model is lazy programming because all you really have to do to enable changing textures and materials on the fly is add a hidden sections block to your model class for named sections you must have created to apply different textures to certain parts of the model?

icy light
#

So if you call "backpackItems player" and there are other backpacks in the backpack it returns empty. Anyone know a fix for this?

peak plover
#

try everyContainer player

#

@icy light

icy light
#

ok ty

kind torrent
#

Hello, so, I have the following to revive all players using Arma revive system:
{ ["#rev", 1, _x] remoteExecCall ["BIS_fnc_reviveOnState", _x]; } forEach allPlayers;

However, and I've been toiling at this .. what do I do so it only revives a single player, likely the target player? I do have Target Debug. I've tried mangling it but .. it gets mangled.

still forum
#

you tried mangling it and it get's mangled?... Isn't mangling a bad thing? Why are you doing that?

#

For targetDebug you would ["#rev", 1, player] call BIS_fnc_reviveOnState via the Target Debug button (That's CBA btw)

kind torrent
#

Haha, when I meant mangling, I meant messing with the settings - I don't understand ALL of the settings.

#

Because I'm VERRRYYY new to coding.

#

Thank you very much for the help! I see that _x was a problem and the execcall was just unnecessary.

still forum
#

remoteExec does what it says. Execute something remotely.
But target debug automatically executes the script remotely already

kind torrent
#

Ahah! See, I didn't even know that! haha

foggy cape
#

Hey, Does anyone know of a script that can notify other players when your in range of them for PvP?

half inlet
#

hmm, reading through the last couple posts here in #arma3_scripting I just realised you can put backpacks into backpacks, or uniforms into uniforms... or vests into vests... or anything into any other thing, really

#

what's more amazing is that containers are objects, and can still be accessed while they're inside another container

still forum
#

containers are vehicles. specifically

#

like cars. but without wheels

half inlet
#

so I just realised it would be theoretically possible to move every item in an inventory into its own dummy container, allowing you to access each item individually - something I've been looking to achieve for over a year

#

ignoring the fact that you'd break a lot of things in the process (primarily engine-side interactions like first aid kits, magazines, grenades, etc.), this could turn out really useful for full conversion mods that want to make their own HUD and inventory system

#

dang, the implications of this are... considerable, imo

worldly locust
#

So we have an excel spreadsheet which we plug in some numbers and it returns a set of values based on some lookup tables essentially. Talking at most a couple of thousand rows of values.

For immersion reasons I'd like to add this into game as a dialog/tablet style interaction. A) is this viable from a "not killing performance" PoV and b) something that anyone can advise a better way of accomplishing?

compact maple
#

it can be done, but you will have to create the function for every "input" you need

#

i dont know if this would be a performance killer, as its only a dialog...

worldly locust
#

I'm imagining that the lookup tables will need to be read into the memory, as arrays. And then looped through in sequence to find the one we are looking for.

peak epoch
obtuse cosmos
#

@peak epoch I looked at it once when it first came out, but gave up and went back to the manual RscControlsGroup approach.

#

What is your lastIDC set to?

peak epoch
#

i think i was using the wiki example, firstIDC = 42000; lastIDC = 44999;

obtuse cosmos
#

That is a lot of columns

#

Not sure if that has to be precise or not... Can you have higher IDC for more columns but have amount that isn't ^^

half inlet
#

@worldly locust if you're iterating through a lookup table, you're doing something wrong ๐Ÿ˜›

#

I've no clue what you're going to use your lookup table for, but if you want to be able to fetch some data via a key in ArmA, why not do so via a config entry?

#
class SomeLookUpTable {
    thing1 = 0.1337;
    thing2 = 42;
    thing3 = "hello world";
    // etc...
};```
still forum
#

Why are you iterating through a lookup table? You should be using a lookup table! :D
What?

queen cargo
#

@half inlet because such a thing is horribly slow
you could cache all that into eg. a location at mission start and use get-/setVariable on it

half inlet
#

wasn't aware parsing configs is much slower than parsing variables from a namespace, but sure, that works too

queen cargo
#

not parsing

half inlet
#

I was just answering to his last message: I'm imagining that the lookup tables will need to be read into the memory, as arrays. And then looped through in sequence to find the one we are looking for.

queen cargo
#

using the commands

half inlet
#

the "looped through in a sequence" part had me confused, since he's trying to go for a lookup table (in which case you don't need to loop through anything)

queen cargo
#

there are moments you may want to loop through a map though ..
when you want to output all pairs for example

still forum
#

considering he want's to show a excel table ingame.. That's probably what he's trying to do

queen cargo
#

excel but in arma? that will go horribly wrong probably
though ... depends on the stlying
should actually be possible Oo

half inlet
#

well, in that case setVariable is probably the best solution

still forum
#

only displaying a table @queen cargo

#

not editing or anything

queen cargo
#

still, excel could be done in ArmA

#
  • editing
#

even functions could be done in arma

#

though ... i would just go straigth onto =SQFEXPRESSION

worldly locust
#

Sorry. I was unhelpfully vague.

#

I have 3 sheets of lookup tables. Based on user input we have to perform calculations to determine which row is correct on each table. It's not as simple as find x in the table.

half inlet
#

can you give us an example of said calculations and what your data looks like?

worldly locust
#

Around 12 columns. Integers and decimals. It's a mortar calculator

#

From that it does a 9 step formula to get to a "this is the charge, elevation and bearing you need"

#

Obviously user has to enter in mortar position, target position, wind speed, direction etc.

dry zephyr
#

@worldly locust Given that unitCapture/unitPlay is a thing (generates a lot of data), I think you'd be fine. You need an array of arrays [[row1a, row1b],[row2a,row2b]] Export from excel in CSV with quoted values, run it through something to add [ and ] at beginning and end of each line plus add [ and ] at start and end of file. Copy this into init.sqf in new mission for testing and assign it to a global variable. Then write your functions to take input and search through this array for the info you need to do the calcs. Present the results.
Optimize where it appears, privatize, and potentially compile into function(s) later.

worldly locust
#

Cheers. That's kind of what I expected. Will have a play about.

dry zephyr
#

@worldly locust If you are willing to share the pattern (not the data or your custom calcs), let me know how it turns out as that could be a handy snippet to have around.

worldly locust
#

Once I figure it out sure.

little eagle
#

It's

#

called

#

Arma

#

not

#

ArmA

#

ffs

small iron
#

ArmA = Armed Assault

#

๐Ÿค”

little eagle
#

Wrong.

#

Arma 3

#

Arma 3

lone glade
#

Armed reds marching again 3.

#

commy is playing the commie version of A3 ๐Ÿ˜„

little eagle
#

ARMA 3 or Arma 3 (never "ArmA")

#

Check literally all official material.

#

Nowhere does it say "ArmA", except maybe on fanpages that are, surprise, wrong.

lone glade
#

the launcher^

worldly locust
#

Someone explain to me what this has to do with scripting. Or indeed anything at all.

lone glade
#

start the launcher and check the bottom of the dashboard page

#

they've infiltrated us commy

little eagle
#

Reddog, in and find are case sensitive, obviously.

lone glade
#

letter casing is my personal hellhole

still forum
#

@small iron ArmA 1 was called that. Since then it changed. So unless you're talking actually about ArmA. It's wrong. And talk about ArmA belongs to #end_of_life_arma

small iron
#

I c

rancid pecan
#

``player addEventHandler ["InventoryOpened", {

params ["_container","_unit","_containerr"];
_unit = _this select 0;
_container = _this select 1;
hint format ["%1",_container];
}];``

#

but

#

``player addEventHandler ["InventoryOpened", {

params ["_container","_unit","_containerr"];
_unit = _this select 0;
_container = _this select 1;
_containerr = _container select 0;
hint format ["%1",_containerr];
}];``

#

don't working

#

where is problem ?

still forum
#

What is supposed to be happening that's not working?

#

Wait.. You pasted the same code twice. One.. Wait.. Wtf are you doing

#

why are you trying to read the parameters twice

#

And what is _container select 0 supposed to do? select doesn't work on objects

#

Please quote code correctly
```sqf
<code here>
```

#
player addEventHandler ["InventoryOpened", {
    params ["_container","_unit","_containerr"];
    hint format ["%1",_containerr];
}];

Are you trying to do that? Or what are you trying to do? I can't read your mind

#

Also why format even?

#
player addEventHandler ["InventoryOpened", {
    params ["_container","_unit","_containerr"];
    hint str _containerr;
}];
slim oyster
#

Is it possible to change visibility of items in 3den menu while in the editor? aka bypassing config scope entry?

#

specifically modules\cfgvehicles

meager heart
#

๐Ÿค”

still forum
#

No

half laurel
#

hi, please can someone spot the syntax error?

#
    [EB_supportradio, [("<t color='#bbccbc'>" + "Daylight Lumes" + "</t>"), {"actions\fnc_call_lumes.sqf",0,20,true,true,"","true",2}]] remoteExec ["addAction"];
#

the first 0 is the param i wish to send to the script

#

adding this to the object in editor works fine.

#
ac1 = this addaction [("<t color='#bbccbc'>" + "Daylight Lumes" + "</t>"), "actions\fnc_call_lumes.sqf",0,20,true,true,"","true",2]
still forum
#

Can't see anything wrong

half laurel
#

not used remote Exec much before

still forum
#

parameters to remoteExec are correct

#

Maybe addAction is just not remoteExec whitelisted?

half laurel
#

might the yarrive differently? i.e. not _this select 3?

still forum
#

server/client RPT should be telling you if that's the case

#

according to wiki it's parameter 3

#

The action is added?

half laurel
#

this select 3 works with the second case above

still forum
#

but for the remoteExec. Does the action actually appear?

half laurel
#

yes, i see the action but nothing happens when selecting it

still forum
#

hi, please can someone spot the syntax error?
That means there is no syntax error

#

If it were. The action wouldn't be added