#arma3_scripting

1 messages ยท Page 395 of 1

little eagle
#

Small battery as logo.

subtle ore
#

๐Ÿ˜„

still forum
#

Enfusion has VR support. Was that already known?

subtle ore
#

I thought that was enforce?

lone glade
#

enfusion = enforce + RV3.5 smashed together

subtle ore
#

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

#

Oh god

#

that means multi platform

#

that means consoles

still forum
#

Just saw VR support in a piece of sourcecode they showed in a video

subtle ore
#

everybody run

lone glade
#

member flashpoint?

subtle ore
#

I dont care

#

we're done for if we have console kiddies hopping in

lone glade
#

I can't wait for our gameplay elements to be dumbed down so they can fit on console

still forum
#

Project is called "GameTemplate2015-PS4"

subtle ore
#

๐Ÿ–•

little eagle
#

RV will never run on a console.

still forum
#

XBOX360 incoming

lone glade
#

enfusion won't either, console cpus are so goddamn weak it's a lost cause

still forum
#

Well... There is source code for some Enfusion project on PS4....

lone glade
#

"dev comment: my phone has a better cpu than this, forget it"

still forum
#

Arma on phone!

jade abyss
#

like Skyrim

#

๐Ÿค”

peak plover
#

pUBG on Xbox looks bad ATM, if anything it will run worse than that

lone glade
#

you don't like 15fps ?

little eagle
#

I operate under a different definition of "confirmed".

lone glade
#

the game runs so badly it's under the number of images per second to be considered a video stream

#

it's a fast powerpoint presentation ๐Ÿ˜„

little eagle
#

Autoscroll.

#

I believe it when I see it.

peak plover
#

Earth confirmed flat, moon confirmed fake

novel stone
#

@peak plover illuminati confirmed.

rotund cypress
#

Earth flat guys, no news

#

I go straight, not down.

tough abyss
#

when i look up i see a flat sky and circles only

#

never have i seen a spherical moon or sun

#

so yes earth and everything else is flat

peak plover
subtle ore
#

@SimZor#5644 Journey To The Center Of Earth is fake news then?

#

@tough abyss Moon landing fake?

#

@peak plover What's the point of moon cycles in arma 3 if the moon is actually just a piece of paper glued to the earth globe in which is actually a simulation by higher beings?

river meteor
#

"if (true) then { exitWith{}; }; //some other code" will some other code get ran in this instance?

still forum
#

no

peak plover
#

Alternate universe / fan fiction @subtle ore

still forum
#

Because you have a syntax error and your code won't even compile

#

So nothing of that code will run

subtle ore
#

@peak plover ๐Ÿ™€

peak plover
#

U can use call { }

river meteor
#

Alright, well assuming it's pseudo code, will it run the next lines? Trying to understand how exitWith works since it seems to suggest that it will only exit the current scope and that would include the if scope I assume. Also trying to figure out how to do a middle of the script return

still forum
#

Still invalid question.

#

if (true) exitWith {}; //some other code
no it won't run. Because exitWith exits.

tulip otter
#

TRying to get the "Target Human" to not be destroyed when shot multiple times. But the wasy way to set allow damage false, do not work, thenthe stats on the Scoreboard on the target wont work. any one have a workaround or an idea?

subtle ore
#

@tulip otter what scoreboard?

tulip otter
#

on the target human there is a scoreboard when you go next to it, with range and how amny times a player have hit that target

#

Just pointless when it dies after 10 shots..

#

And it allow damage is false, then no hits is registered on the scoreboard

#

while {alive S61} do { if (damage S61 > 0) then {S61 setDamage 0;} }

#

trying this, but it do not work.. gone blind on what the error is... S61 is the variable for the target

peak plover
#

That's bad

#

Use an eventhandlers instead

subtle ore
#
randomDude addEventHandler["Hit",
{
    hintSilent "Doh!";
}];
tulip otter
#

Been out of this for a while ๐Ÿ˜ƒ il try that instead

real tartan
#

How to set document for more sides ? _document setVariable ["recipients", west, true];

subtle ore
#

@real tartan What? Document? What do you mean?

tulip otter
#

@subtle ore Thank you, it works like a charm!

subtle ore
#

@tulip otter yep no problem

real tartan
#

@subtle ore when you set Intel recepients for RscAttributeDiaryRecord

subtle ore
#

@real tartan Do you mean:

_document setVariable["recipients",[west,east],true];
real tartan
#

using bis_fnc_setServerVariable

subtle ore
#

Why?

rotund cypress
#

That is most likely just a deprecated function @M1ke_SK#7333

subtle ore
#

Well it was there after alpha

#

as it seems to have been exported from 1.00

plucky willow
#

if I have a locally executed script, can i add in a section that only executes on the server?

little eagle
#

Yes, but the section will never be executed, unless the script is executed on the server machine.

astral tendon
#

How does the savegame works? in my mission, the last save have a problem that it seems to re-do the script i done, the savegame is the end of the waituntil, so its suppose to save once that part of the script ended so its steps on another waituntil

thorn saffron
#

How can I automatically place a module when startting/loading any mission? I have CBA, and AFAIK there is a way to use some XEH to do that

rocky marsh
#

how would i go about making a crate disappear after its empty?

tough abyss
#

Hideobject or deleteVehicle

#

You need to count the contents of the crate and then do that

peak plover
#

@thorn saffron when startting/loading any mission?

#

Is this a mod?

thorn saffron
#

@peak plover Yes, sunday revive. I can make it affect my squad with just a command, but I do need a module placed on the map

#

its mostly for missions that I ca'nt be bothered to unpack and add the module by hand

subtle ore
#

@thorn saffron Each of the modules have functions that are executed by the module

#

go to the config viewer and find the modules there

south pasture
#

Hi,
is there the way to alter mission parameters for a mission played as SP scenario. I know that parameters can be altered via UI for hosted game and DS, but for SP the default values seem to be unalterable. Or maybe i'm missing something in SP ui

thorn saffron
#

@south pasture Install MCC and use Zeus maybe?

subtle ore
#

Don't recommend MCC

#

Zeus is appropriate

#

but MCC is awfu

thorn saffron
#

MCC allows to use ZEUS in any mission

lone glade
#

MCC is written like shit

#

and don't tell me "oh but he worked hard on it", it's the worst code i've ever seen

south pasture
#

So to make mission SP configurable is not that trivial task. frack it then

thorn saffron
#

One thin I SORELY lack in Arma 3 is ANY mod that has a full shopping + money for kills module system you can just plug and play into missions. MCC only really lacks the item shop as it has the vehicles and units shops

lone glade
#

@south pasture you'd have to show a dialog when the player starts the mission

#

what kind of settings are we talking about btw?

south pasture
#

Nah, the dialog for all diff ACE params and some of mine

lone glade
#

oh, those, well they're getting removed for CBA settings

south pasture
#

@lone glade I mean the params defined in description.ext

class Params {
    class EnableCampaignReset {
        title = "ability to start a fresh campaign";
            values[] = {0,1};
            texts[] = {"Off","On"};
            default = 0;
            typeName = "BOOL";
            force = 1;
    };
...

you can affect those from hosted/DS start ui, but SP ui just uses defaults

lone glade
#

yeah, that's normal, you need to make a custom dialog to change those in SP

south pasture
#

๐Ÿ˜–

#

thanks

south pasture
#

Not related to scripting (but hope to get the answer quicker then on themed channel)
what is the BI forum markup for mentioning someone? Is there anything like @user for the forum posts. Thanks

peak plover
south pasture
#

sorry

peak plover
#

It's ok, this is pretty much #offtopic_everything 90% of the time

tulip cloud
#

The Dynamic Groups interface is tied to TeamSwitch action, and it's default keybind is U.

I tried invoking the TeamSwitch action and it didn't pull up the Dynamic Group Interface. Anyone know what function I can use to invoke it without using U?

astral tendon
#

question

#
 if (trucktodeka distance placa <= 30 ) exitWith {
 saveGame;
 sleep 1;
 dubmines setDamage 1;
 Track18Loop = addMusicEventHandler ["MusicStop", {"Track08" remoteExec ["playmusic"];}];"Track08" remoteExec ["playmusic"];
{terminate _x} foreach MedicScript;
terminate Medevac;
{deleteVehicle _x} forEach synchronizedObjects selectRandom [mine_set_1,mine_set_2,mine_set_3,mine_set_4];
{ deleteVehicle _x } forEach ( nearestObjects [ getPos Area_Brava , [], 400 ]);
truckDriver disableAi "move";
sleep 2;
{deleteVehicle _x} forEach crew MedEvacHeli;
deleteVehicle MedEvacHeli;
moveOut team_2;
unassignVehicle team_2;
team_2 setBehaviour "CARELESS";
{moveOut _x} forEach units playersslots;
{_x allowDamage true} forEach units playersslots;
team_2 move getpos PlacaDoBot;
sleep 4;
"maker_mines" setMarkerAlpha 1;
 truckDriver enableAi "move";
 sleep 10;
 "join_victor2" setMarkerAlpha 1;
 pilotgolf3 enableAI "move";
 true};
 }; 
 
 waitUntil {
 if (!(team_2 in trucktodeka) AND player distance placa <= 25 OR isMultiplayer) exitWith {
 team_2 setBehaviour "AWARE";
 [team_2] joinSilent team2Grp;
 sleep 3;
 team_2 move getpos PlacaDoBot;
true}; 
}; 
#

the sleeps in the waituntil also counts as a delay for the other waituntil bellow?

tough abyss
#

Did the pasting in ruin the formatting or does it actually look like that? Because I am struggling to tell where the scopes are.

peak plover
#
Result:
13.5541 ms

Cycles:
74/10000

Code:
private _last = 0;
for "_i" from 0 to 10000 do {
if (diag_tickTime - _last > 100) then {_x = 1;};
_last = diag_tickTime;
};

vs

Result:
12.7848 ms

Cycles:
79/10000

Code:
private _last = 0;
for "_i" from 0 to 10000 do {
if (time - _last > 0.1) then {_x = 1;};
_last = time;
};
astral tendon
#

for some reason notepad++ does not like spaces

peak plover
#

Might be able to switch indentation in some submenu on top bar in text editors

astral tendon
#

were is it?

peak plover
#
waitUntil {
    if (trucktodeka distance placa <= 30 ) exitWith {
        saveGame;
        sleep 1;
        dubmines setDamage 1;
        Track18Loop = addMusicEventHandler ["MusicStop", {"Track08" remoteExec ["playmusic"];}];"Track08" remoteExec ["playmusic"];
        {terminate _x} foreach MedicScript;
        terminate Medevac;
        {deleteVehicle _x} forEach synchronizedObjects selectRandom [mine_set_1,mine_set_2,mine_set_3,mine_set_4];
        { deleteVehicle _x } forEach ( nearestObjects [ getPos Area_Brava , [], 400 ]);
        truckDriver disableAi "move";
        sleep 2;
        {deleteVehicle _x} forEach crew MedEvacHeli;
        deleteVehicle MedEvacHeli;
        moveOut team_2;
        unassignVehicle team_2;
        team_2 setBehaviour "CARELESS";
        {moveOut _x} forEach units playersslots;
        {_x allowDamage true} forEach units playersslots;
        team_2 move getpos PlacaDoBot;
        sleep 4;
        "maker_mines" setMarkerAlpha 1;
        truckDriver enableAi "move";
        sleep 10;
        "join_victor2" setMarkerAlpha 1;
        pilotgolf3 enableAI "move";
        true
    };
}; 

waitUntil {
    if (!(team_2 in trucktodeka) AND player distance placa <= 25 OR isMultiplayer) exitWith {
        team_2 setBehaviour "AWARE";
        [team_2] joinSilent team2Grp;
        sleep 3;
        team_2 move getpos PlacaDoBot;
        true
    }; 
}; 
#

poseidon misc tools

#

the sleeps in the waituntil also counts as a delay for the other waituntil bellow?
Yea they also count

#

once trucktodeka distance placea <= 30 it will run through the code and won't get to the 2nd waituntil before all the sleeps and other stuff is over

astral tendon
#

Spawn the code inside does make it jump right to the next one?

#

but i guess spawn codes is not that healty right?

peak plover
#

Once spawned code finishes it deletes the 'thread' it was running on

#

diag_activeScripts;

astral tendon
#

so i will better of not spawning all codes at same time but one at time intead?

#

because when i was making my mission, i use spawn in all cases, the result was some lost in FPS

#

then i swap all of it to waituntil only

peak plover
#

waitUnitl is cool, it only checks the conditions once every frame

#

You would probably get more gain from using something other than distance and 1 spawn in that code

#

compared to the current one

#

inArea or distanceSqr

astral tendon
#

you mean in FPS?

peak plover
#

Probably no noticable FPS improvement

#

In code execution time

astral tendon
#

also, i still did not find that tab on the Notepad ++

peak plover
#
Result:
19.7647 ms

Cycles:
51/10000

Code:
for "_i" from 0 to 10000 do {
if (player distance [0,0,0] > 100) then {_x = 1;};
};

vs

Result:
18.9434 ms

Cycles:
53/10000

Code:
for "_i" from 0 to 10000 do {
if (player inArea [[0,0,0],100,100,0,false]) then {_x = 1;};
};
#

That tab is only in sublime

#

poseidon

#

It's nagware 'tho so notepad++ might be better if you don't like nagging

astral tendon
#

oh well, nevermind.

peak plover
#

I'd use spawn in that script you posted anyway

#

Just for the 2nd part

#

Well

#

either for the first part in if

#

or that

#

just having 1 is not that abd

#

bad

#

Anyway anyone here been replicating the dynamic simulation system with differente sized squares using scripts?

astral tendon
#

i am doing it

#

i dont trust dynamic simulation

#
 { _x enableSimulation false} forEach nearestObjects [Area_Deka, ["man"], 100];
 sleep 1; ```
#

to activate

 { _x enableSimulation true} forEach nearestObjects [Area_Deka, ["man"], 100];```
#

of course, that does not include vehicles

peak plover
#

Hmm yes, Im loking for the deets behind the squre system

still forum
#

@peak plover putting a loop inside a scritp you wanna profile reduces the profiling precision by alot. Code profiling already has it's own loop

rotund cypress
#

Hey guys, when using BIS_fnc_addScriptedEventHandler, if I call that multiple times; it will be accurate and handle the event calls in order right?

still forum
#

afaik yes

rotund cypress
#

๐Ÿ‘Œ

#

Would be nice if they could add a command for it

#

Like addPublicVariableEventhandler

#

but instead just addNamespaceEventHandler or even addScriptedEventHandler

still forum
#

uh.. why?

rotund cypress
#

Why not?

still forum
#

you mean.. addMissionEventHandler and the other eventhandler commands?

#

But being able to pass arguments along to them?

rotund cypress
#

Well, make your own event

#

And then call that event

still forum
#

Ahh So... CBA eventhandlers?

little eagle
#

He means cba custom events, but as sqf commands, not sqf functions.

still forum
#

Well.... Gimme 5 minutes.. XD

little eagle
#

Would save one call and one forEach overhead.

#

And a params.

rotund cypress
#

I am not talking about CBA custom events, I am talking about BIS_fnc_addScriptedEventHandler

#

It might be the same thing though

still forum
#

That is essentially the same just worse

rotund cypress
#

What is the difference?

little eagle
#

The usage is the same, but it does less with more overhead.

rotund cypress
#

Ah

little eagle
#

And you can only pass arrays as args now or something like that. They might have reversed that though.

still forum
little eagle
#

That's why they should fix that issue first before making custom events a (set of) command(s).

#

VBS has some of them. Even handles remote machines. That was the original inspiration for the custom events.

#

whereLocalEvent etc. or weird names like that.

still forum
#

Intercept is the future ๐Ÿ˜„ targetEvent with getting an answer back drool

rotund cypress
#

But @little eagle do you know 100% if I call the scripted eventhandler once it will execute that. If I call it twice, roughly the same time it will be queued and handle first one first, then go on to the next one?

little eagle
#

Yes? How else would it work?

rotund cypress
#

Just making sure

still forum
#

Randomly shuffle the array for no reason

rotund cypress
#

You never know with BI

little eagle
#

It's like function calls over an array of functions.

#

Where you have api to append the array.

rotund cypress
#

yeah

little eagle
#

It only really gets interesting once you can call events on remote machines.

#

Otherwise the only usage is for stuff like the arsenal which might throw some events that are hard to time.

rotund cypress
#

Well, event handling can be crucial sometimes. Especially to resolve issues with the first one executing not being the first one who finishes it

#

Like two guys changing an array on remote at once

little eagle
#

Sounds like a bad design decision.

craggy dune
#

Hey there, we are trying to use player setIdentity _face; in Multiplayer to change a Face during spawning. It works locally, but all other players see the standard face. Is there a way to get this to work in Multiplayer?

rotund cypress
#

remoteExec it @craggy dune

craggy dune
#

@rotund cypress will try

rotund cypress
#

[solider_1, ["WhiteHead_02"]] remoteExecCall ["setFace", 0]; that should work @craggy dune

craggy dune
#

thanks will try after dinner @rotund cypress

kindred lichen
#

is there a script to make a unit zeus?

#

like
unit makeZeus; That I could run in mission?

winter dune
#

If I want to create a list, and then update it, should I spawn or call a function?

#

I didn't really understand how and when should be using spawn or call when playing with dialogs

little eagle
#

@kindred lichen

// on server
private _curator = createGroup sideLogic createUnit ["ModuleCurator_F", [0,0,0], [], 0, "NONE"];
_unit assignCurator _curator;
kindred lichen
#

oh, awesome thanks

little eagle
#

@winter dune Everything about ui should go into unscheduled scripts and therefore not use spawn.

#

Captain, this has to run on the server. assignCurator will fail on a client.

kindred lichen
#

do the 0s mean that it's like everything unlocked?

little eagle
#

[0,0,0] is the position, and 0 is the radius around the positon.

#

It's just what createUnit expects. Where the logic is created doesn't matter.

#

It's a logic and takes no space.

#

I also made the flag at the end "NONE" now instead of "". Because the game now complains otherwise.

winter dune
#

@little eagle for example, I created a dialog and in the onLoad EVH of the dialog, I spawned my function, inside that function, I spawned the function which updates the list, is there a way to make it all unscheduled?

still forum
#

put your code inside isNil

velvet merlin
#

how do a build this as a string nicely in Arma

'hiddenSelectionsTextures[] = {"element1","element2"};'
if i have the elements in an array
_array = ["element1","element2"];

little eagle
#

joinString?

still forum
#

_start = 'hiddenSelectionsTextures[] = {"' + (_array joinString '","')+'"};'

little eagle
#

That has two =.

#

Oh, nvm.

inner swallow
#

extra " at the end?

#

or missing '?

still forum
#

I am quite confident that is correct.. My brain doesn't see any error

#

OH

#

I initially wrote it as "<code>" and then left <code>"

#

Missing ; tho

hushed quail
#

Does anyone know what the init code to change the double billboards from Malden35?

velvet merlin
#

thanks guys

craggy dune
#

any idea, log says: " Scripting command 'setface' is not allowed to be remotely executed" ,we tried F(BIS_fnc_setFace,ANYONE) and F(setFace,ANYONE) no changes.

little eagle
craggy dune
#

@little eagle yeah, the second part is what we tried in CfGREmoteExec to not block it anymore

little eagle
#

If you do it right it will no longer say "not allowed to be ..."

craggy dune
#

yeah, i was hoping for a little more constructive feedback like: Yeah function needs to be called XY in order to work . . . but thanks

rotund cypress
#

Its just setFace

#

The command is setFace

#

Only thing that needs whitelisting.

little eagle
#

Dunno what else to tell you. setFace has to be white listed. The wiki explains it all.

craggy dune
#

F(setFace,ANYONE) this is what we tried as whitelisting (like with all the other functions) it is not working

rotund cypress
#

Dont bother with BIS_fnc_setFace btw

little eagle
#

^

#

F(setFace,ANYONE)

tough abyss
#

You are aware thats a macro, and snippet of your cfgremoteexe config. For all we know you made a typo in there

little eagle
#

Is that BE?

#

F(setFace,ANYONE) I mean.

rotund cypress
#

Shitty altis life macro

little eagle
#

Ah, I see.

#

Check the ingame config browser to see if the config is right.

#

Nothing else we can tell you.

#

Who names a macro F. ๐Ÿคฆ

rotund cypress
#

^^

little eagle
#

Can't even google that. At least make it something google can work with.

rotund cypress
#

That is a valid point actually, and a good argument.

#

I can go check myself in config browser but would save me some hazzle

little eagle
#

CfgMods should have the paths.

tough abyss
rotund cypress
#

Yeah, what I was gonna check, but didn't want to start up the game xD

little eagle
#

artwork = "\A3\Data_F_Kart\Logos\arma3_karts_artwork.jpg";
picture = "\A3\Data_F_Kart\Logos\arma3_karts_icon_ca.paa";
logo = "\A3\Data_F_Kart\Logos\arma3_karts_logo_ca.paa";
logoOver = "\A3\Data_F_Kart\Logos\arma3_karts_logoOver_ca.paa";
logoSmall = "\A3\Data_F_Kart\Logos\arma3_karts_logo_small_ca.paa";
logoTitle = "\A3\Data_F_Kart\Logos\arma3_kart_logoTitle_ca.paa";
overviewPicture = "\A3\Data_F_Kart\Images\karts_overviewPicture_co.paa";

rotund cypress
#

That is in CfgMods yes?

little eagle
#

So it's different for each dlc.

#

Yep.

rotund cypress
#

I cannot see Malden though

rancid pecan
#

heloo
22:20:45 Wrong color format 22:20:45 Wrong color format 22:20:45 Wrong color format 22:20:45 Wrong color format 22:20:45 Wrong color format 22:20:45 Wrong color format
local .rpt log
help please
what problem ?

rotund cypress
#

Literally it means wrong color format

#

Probably structured text

#

@little eagle I cannot find Malden in the CfgMods

rancid pecan
#

thank you @rotund cypress well how i fix ?

rotund cypress
#

Use the correct color format

#

I.e. correct HEX

little eagle
#

Idk where that button is either. Probably a similar path.

rotund cypress
#

Ill try CfgWorlds

#

Obviously its ARGO ๐Ÿ˜‚

#

Ok I found it

rancid pecan
#

okey

#

well

#

Duplicate HitPoint name 'HitTurret' in 'B_Heli_Light_01_F' this what problem ?

rotund cypress
#

Default arma error

#

Ignore.

rancid pecan
#

okey

#

well

#

this ? 22:38:15 O_T_LSV_02_unarmed_F: unarmed_main_turret_hide - unknown animation source turrethide
22:38:15 O_T_LSV_02_unarmed_F: unarmed_doors_hide - unknown animation source doorshide
22:38:15 O_T_LSV_02_unarmed_F: mainturret - unknown animation source mainturret
22:38:15 O_T_LSV_02_unarmed_F: maingun - unknown animation source maingun

winter dune
#
for "_i" from 0 to 1 do {
    for "_j" from 0 to 1 do {
    };
};
#

is there a way to make only a single for loop?

#

the snippet above it's just an example, but the main code has to calcolate some values inside an array

#

Can I obtain more performance by doing 2 differents loops?

craggy dune
#

okay, i am giving up. Scripting command 'setface' is not allowed to be remotely executed is shown, when we try to execute it with F(setFace,ANYONE) if we use F(BIS_fnc_setFace,ANYONE) there is nothing in the Log, but it is still not working for the Rest

#

only local player is shown the changes. The other users on the server are not seing the changes

#

We try to execute: ["cop_2", "Fem_2"] remoteExecCall ["BIS_fnc_setFace", 0, true];

indigo snow
#

are you sure that function is supposed to take two strings?

craggy dune
#

first one is "WHO" second is "WHAT"

#

at least that is how we understood how it is supposed to be working . . .

indigo snow
#

sure but are they both supposed to be strings?

#

Id assume the who would need to be type OBJECT

#

not STRING

craggy dune
#

good question . . .

#

we tried _unit as well, no changes

indigo snow
#

id investigate that first...

edgy dune
#

would this give me a list of all vics that are civillian factions?

#
(vehicles select { side _x == civ })
```\
#

rip nvm

#

it has to be

#
(vehicles select { side _x == civilian })
craggy dune
#

in case anyone is interested: setFace is a command and not a function . . . changed this in now it is working

edgy dune
#

if I wanted to increment a variable

#

would

#

this work

#
varialbe++;
indigo snow
#

no

river meteor
#

Is there a way to have a unique instance of an item in a player's inventory? So that I could create two AK-47's, but they would each have a unique id or something of the sort so that I could tell them apart in a script?

subtle ore
#
variable = 2;
variable =  variable + 1;
``` @edgy dune
indigo snow
#

@river meteor Theres a partial workaround with magazines only, partially emptied magazines get unique IDs

river meteor
#

trying to avoid having to do a virtual inventory to assign properties to specific items. Sounds like I'll have to do it anyway

indigo snow
#

yes

still forum
#

Yes.. TFAR and ACRE and ACE do such a thing... We just make unique items. Like. Dogtag_1 and Dogtag_2 up to 1000 and then have that ID be unqiue

river meteor
#

how do you create a unique item? Is there an sqf command? @still forum

still forum
#

yes. addItem

#

to create them ingame

#

Ofcause have to define them in config first

#

I don't think that's an option for you

river meteor
#

Why do you say it's not an option?

peak plover
#

Have there been any breakthroughs in getting all objhects placed?

#

is allMissionObjects still fastetst?

subtle ore
#

allMissionObjects is pretty demanding / slow

peak plover
#

Alternatives to grab ALL buildings on map?

subtle ore
#

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

peak plover
#

I've gota plan

subtle ore
#

shoot

still forum
#

@river meteor Becazse you can only do that with a mod

#

@subtle ore nearEntities of type building?

#

If you want to go through all objects anyway the iterating is gonna be alot slower than the call to get the objects

subtle ore
#

That's what I was thinking, but I was afraid of being shot at by none other than the SQF god himself

still forum
#

You mean Arma? Arma always shoots you

#

Often in the foot

subtle ore
#

intercept god

#

the arma gods tend to shoot me even when I'm dormant

peak plover
#

initPost cba EH

#

Just add it to an array there

#

That way

#

I won't have to search for buildings

#

I will already know them

#

Saving me precious MS

#

Then later on I can use that ms to buy my self something nice, maybe 50 more ai?

#

Umm, does cba initPost run on everything? including like ammo and bombs and stuff?

subtle ore
#

HA

#

Hey Nigel I'll give you 0.1~ ms in return for 10 AI

peak plover
#

hmmm

#

throw in an extra 5 nanoseconds and I'll give the ai weapons some attachments

subtle ore
#

Done.

peak plover
#

deal

still forum
#

@peak plover Everything you add it to

peak plover
#

I guess "All" includes logics and triggers

#

AllVehicles and building

#

seem safe bets

still forum
#

all objects

peak plover
#

I am a fucking genius

#

๐Ÿ’ก

jade abyss
peak plover
#

gimme an hour

jade abyss
#

What are you trying to do?

peak plover
#

fix arma

jade abyss
#

What of it? There is alot

peak plover
#

Either this is placebo out of the ass or Me and 2 guys have witnessed > 60 FPS with 200 ai fighting and over 3k objects placed in zeus

jade abyss
#

that means what?

peak plover
#

Well normally in that situation it would be 20-30 fps?

jade abyss
#

+having that FPS + AI is possible, easily

peak plover
#

I gotta escalate this and test more

jade abyss
#

It depends also heavily on, if they are in a group or not (iirc in a group they drained more FPS)

#

Or it was the opposite, too long ago^^

peak plover
#

Every group = extra brain

#

I think

jade abyss
#

I can't remember anymore, i just know one of it was an FPS-Killer

#

And i can imagine it's the grouped one

peak plover
#

well, Can't have too many groups anyway, because 288 limit

jade abyss
#

Wasn't that raised/didn't matter for (with Script) created groups ๐Ÿค”

peak plover
#

144 before apex

jade abyss
#

@still forum

still forum
#

Was raised ffrom 144 to 288. Also you are always in a group

#

200 units without group == 200 groups with 1 unit

#

afaik

peak plover
#

Tru

jade abyss
#

Could you run a test with more than 288 Groups (created by script?)

peak plover
#

Yes

jade abyss
#

Not sure if i mix that with something else ๐Ÿค”

peak plover
#

They don't work well

#

They spawned and did like nothing I think

#

back in 144

jade abyss
#

"They don't work well" is not an answer^^

peak plover
#

I couldn't give them waypoints I think, was long ago

jade abyss
#

Thats why, just run a test where you create 300 with their own group

peak plover
#

lemme check

#

and domove maybe

peak plover
#

I didn't even know about taht back then

#

ohh noes

meager heart
#

But that was beta

jade abyss
#

Yep

meager heart
#

420 total

peak plover
#

it's not a beta anymore

meager heart
#

true

jade abyss
#

Thats why i mentioned: I think that limit was just for Editor-Created Groups

meager heart
#

300+ no fps

jade abyss
#

(for whatever reasons)

#

Yeah, of course^^ During Beta Performance was shitty af (worse than now ๐Ÿ˜› )

peak plover
#

I might have crashed my game spawning 300 units in unscheduled

meager heart
#

I have test mission can check it btw on dedicated

peak plover
#

Lol I see 1 frame every 10 seconds

#

true powerpoint experience

jade abyss
#

Sucks to be you ๐Ÿ˜„

peak plover
#

Last time I listen to your demands ๐Ÿ˜ก

jade abyss
#

"demands" ๐Ÿ˜‚

#

Not my fault, when you Server sucks ๐Ÿ˜‚

peak plover
#

ran it on pc ๐Ÿ˜ฆ

jade abyss
#

Here, get that emote/reaction

peak plover
#

server is worse

#

Well

#

join stops working

#

Anticlimatic

jade abyss
#

dafork?

#

Did you execed that in the watch line? lol

peak plover
#

Don't matter where I exec it

jade abyss
#

๐Ÿ˜‚

peak plover
#

Wanna spawn 600 units? createUnit in watch field ๐Ÿ˜‰

jade abyss
#

wait, lemme see if i can find old notes

meager heart
jade abyss
#

643 Groups?

peak plover
#

unids

meager heart
#

Yep with 1 unit in it

peak plover
#

Wait what

#

How did you do that/

meager heart
#

lol

peak plover
#

That server fps

jade abyss
#
[_Unit] joinSilent (creategroup West);```
I guess like that
#

in a for loop

meager heart
#
if (!isServer) exitWith {};

waitUntil {!isNil "START_TEST"};

_lUnits = [
    "C_Orestes",
    "C_man_w_worker_F",
    "C_man_polo_2_F_euro",
    "C_man_polo_6_F_asia",
    "C_man_p_fugitive_F_afro"
];

while {!isNil "START_TEST"} do 
{
    sleep 0.025;
    _dGrp = objNull;
    _dGrp = [[0,0,0], civilian, _lUnits] call BIS_fnc_spawnGroup;
    {
        _pos = [getMarkerPos "spawnTest", 50, 0] call BIS_fnc_relPos;
        _x setPos [_pos select 0,_pos select 1, 0];
    } forEach (units _dGrp);
    [_dGrp,getPos leader _dGrp,10 + ceil random 25] spawn TEST_fnc_taskPatrol;
    _text = format ["ะบะพะปะธั‡ะตัั‚ะฒะพ ัŽะฝะธั‚ะพะฒ: %1 ั‡ะตะป.",(count allUnits) - (count playableUnits)];
    _text remoteExec ["hintSilent"];
};

if (isNil "START_TEST") exitWith {[] spawn TEST_fnc_spawnUnits;};
jade abyss
#

What says

hint str count allGroups;``` ?
peak plover
#

bis fnc spawngroup

#

lol

meager heart
#

wait then

#

well there is spawn group no ?

#

need hint with count allGroups ?

jade abyss
#

Yep

#

Just for the sake of Info^^

meager heart
#

lemme... lemme brb ๐Ÿ˜„

jade abyss
#

Take your time

peak plover
#

selecting 1k objects in the editor lags so hard

jade abyss
#

with the overlay, yeah

peak plover
#

How much ai fighting is reasonable to test on altis ?

#

600 vs 600 ?

jade abyss
#

I did my tests with ~200 vs 200 in VR to simulate some load, when testing scripts (all with allowDamage false and unlimited Ammo)

peak plover
#

how do you unilmited ammo on ai?

jade abyss
#

reload script that adds a magazine

peak plover
#

;/

jade abyss
#

*EH

#

Can't find it anymore, must have gone down the "lokus" ๐Ÿ˜„

meager heart
#

Slide show

#

400+ ai if just don't look at that direction is fine

#

300+ playable

#

200-250 ok

#

100-150 good fps

#

And server is always 45+

peak plover
#

mad gains

#

All units goes down because they fighting

#

Not placebo

tulip cloud
#

@peak plover thanks I was able to find a few other variables in that function that I could leverage.

meager heart
#

@peak plover >how do you unilmited ammo on ai?

_unit addEventHandler ["Fired",
{
    private _unit = _this select 0; 
    private _weapon = _this select 1;
    private _magazine = _this select 5;

    if (_weapon == "Throw") then 
    {
        _unit addMagazine _magazine;
    } 
    else 
    {
        _unit setVehicleAmmo 1;
    };
}];
peak plover
#

๐Ÿ‘Œ๐Ÿฟ

jade abyss
#

iirc i did that with a reload or put EH, so it adds the Magazine that it drops right away

#

(So the AI still has to reload)

peak plover
#

Hmm

edgy dune
#

like say I want a car to go through a tank, just as example

little eagle
#

Rename yourself right now.

peak plover
#

How does one check if player camera is on his head?

#

Not any kind of spectator

still forum
#

eyePos very close to cameraPosition

#

positionCameraToWorld or something like that

peak plover
#

eyepos

#

I don't get it

#

cameraposition does not work

little eagle
#

cameraOn == player

#

@peak plover ^

peak plover
#

Im a spectator

#

CameraOn == player //true

little eagle
#

cameraOn isKindOf "CAManBase"

peak plover
#

true

little eagle
#

What spectator is that?

peak plover
#

vanilla

#
  • splendid camera
#

both

#

would it work differently on multipalywer?

little eagle
#

Doubt it.

peak plover
#

ohh god

#
(positionCameraToWorld [0,0,0] distance player)>2
#

worksโ„ข

little eagle
#

That would also be true for 3rd person view.

#

But it might work in the scope of a mission.

#

Where 3rd person is disabled.

still forum
#

I told you exactly the same. Just diff to eyepos

little eagle
#

eyePos should be more accurate. With going prone and all.

#

eyePos is ASL though and posCam2World and distance is AGL.

peak plover
#

didn't get eyepos to work correct

#

positionCameraToWorld [0,0,0] still don't get what 000 means

little eagle
#

Center of the camera.

peak plover
#

hazza

little eagle
#

Exactly where the center of the screen is.

#

0,0,1 is one meter from the screen in view direction.

#

Don't think any other co-ordinates are useful ever.

peak plover
#

Okay thanks

warm gorge
#

Is there an event handler for dissasembling UAV's?

little eagle
#

WeaponDisassembled?

warm gorge
#

Wasnt sure if that would work, ill give it a go. Cheers

quartz coyote
#

Hello all,
I'm looking for a way to display the name of the player that has the best score on the screen of all players.
I already get the HUD part, but can't find an EASY way on scripting the "get the score of all players and pic the highest then display his name"

#

To be honest, i'm really struggling with Arrays and how to create then use one ...

river meteor
#

@quartz coyote You could use getPlayerScores command to get a specific player's score, put that in a loop for all players and keep a variable to track the player with the highest score. In the loop if the player you are currently on has a higher score than your max score player, update the max score player to that new player. At the end of your loop you will have found the highest score player

quartz coyote
#

right I had guessed that but my problem is I can't get round to scripting that "keep a var to track the player with the highest score"

#

I just don't understand how to script it

peak plover
#

How do I make a float increase slower the hieger it is?

quartz coyote
#

wut ?

river meteor
#

Not sure what you mean by that @peak plover.

peak plover
#

input = 1 output is 2

little eagle
#
  • 1
peak plover
#

when input gets bigger than 1 I want it to stop increasing slower

river meteor
#

so you want a log function?

peak plover
#

input 2 output 1.125

#

What's that

little eagle
#

Logarithm.

peak plover
#

I want a curve, yah

little eagle
#

log_10:

1 -> 0
10 -> 1
100 -> 2
...

Would that work?

peak plover
#

oh my god

#

yes

little eagle
#

The command is log.

peak plover
#

I can just do min becaues I can't do less than 1 output

#

oo

#

Thanks

little eagle
#

lol yw

meager heart
little eagle
#
private _temp = allPlayers apply {[getPlayerScores _x select 5, _x]};
_temp sort false;
_temp select 0 select 1
#

That should report the player with the highest score. If two or more have the highest score, the alphanumeric last one will be reported.

#

Actually I think it's the one who appears first in the allPlayers array.

meager heart
#

there is an example sqf _arr = [5.21725,1.30859,4,5.03028,1]; _arr sort true; hint str _arr; //[1,1.30859,4,5.03028,5.21725]... sort false; will sort highest first

little eagle
#

I assume the one with the highest score is the first place.

peak plover
#

is log a fast command?

#

I wanna eachframe

quartz coyote
#

@little eagle @meager heart great thx !

little eagle
#

In the context of Arma it is as fast as you can get^^

peak plover
#

Damn nice

#

I will use this in every script now

quartz coyote
#

@little eagle This give's me a Zero Divisor ...

private _temp = allPlayers apply {[getPlayerScores _x select 5, _x]};
    _temp sort false;
    _temp select 0 select 1;
little eagle
#

Line?

peak plover
#

more ()

#

_x select 5 === zero devisor

little eagle
#

Flash, what is getPlayerScores player if you enter it into the debug console?

quartz coyote
#

[]

#

but i'm in singleplayer

#

[0,0,0,0,0,0]

#

in MP

little eagle
#

Instead of

#

getPlayerScores _x select 5

#

write

#

getPlayerScores _x param [5, 0]

#

Same thing, but doesn't error if the array doesn't have 5 elements and reports 0 instead of nil.

quartz coyote
#

ok i have no error

little eagle
#

No parenthesis needed, nigel. Just PARAM.

peak plover
#

hazaa

rancid pecan
#

hello

#

if ((_container getVariable ["trunk_in_use",false]) && !(getPlayerUID _unit = getPlayerUID player)) exitWith { where i make error ?

chrome mason
#

Does Diag_Log just log to clients or Server rpt too?

little eagle
#

Local rpt

#

Client or server.

#

@rancid pecan
== is for comparing, = is for assignemnt.

quartz coyote
#

@little eagle what does _temp select 0 select 1; do ?

#

ok found out on my own !

peak plover
#

[[nested]]

chrome mason
#

So a client side script will log local and a server side script will log server side... Got it.

#

Ty

little eagle
#

Yep. And a script that runs everywhere will log everywhere.

quartz coyote
#

@little eagle Right now i'm having problems to display it on screen ....

if (!isServer) exitWith {};

CutRsc["dm_hud", "PLAIN"];

DisableSerialization;

while {!DMGameOver} do
{
    private _Array = (if (isMultiplayer) then {playableUnits} else {switchableUnits}) apply {[getPlayerScores _x param [5, 0], _x]};
    _Array sort false;
    _PlayerName = name (_Array select 0 select 1);
    ((UiNamespace GetVariable "dm_hud") DisplayCtrl 23501) CtrlSetText (Format ["Leader : %1",_PlayerName]);
    ((UiNamespace GetVariable "dm_hud") DisplayCtrl 23501) ctrlSetPosition [safeZoneX + safeZoneW - 1, safeZoneY + safeZoneH - 0.06];
    sleep 1;
};```
#
class RscTitles
{
    titles[] = {};
    class dm_hud
       {
        idd = 1000;
        movingEnable = 0;
          fadein = 0;
        duration = 9999999;
          fadeout = 0;
        name = "dm_hud";
        onLoad = "uiNamespace setVariable ['dm_hud', _this select 0]";
        controlsBackground[] = {};
        objects[] = {};
        class controls
        {
            class hud1
            {
                type = 0;
                idc = 23501;
                style = 1;
                x = -2;
                y = -2;
                w = 1;
                h = 0.025;
                sizeEx = 0.025;
                size = 1;
                font = "EtelkaMonospacePro";
                colorBackground[] = {0, 0, 0, 0};
                colorText[] = {0.6, 0.6, 0.6, 1};
                shadow = true;
                text = "";
            };
        };
     };
};
little eagle
#

I don't see the display being created anywhere.

quartz coyote
#

Sorry edited first script

#

I tested with a normal bis_fnc_dynamicText and it works, but not with my CutRsc

little eagle
#

Testing in SP?

quartz coyote
#

SP and MP

#

both don't work

#

but with bis_fnc_dynamicText it works in SP and MP

little eagle
#

if (!hasInterface) exitWith {};
as first line would fix SP.

#

Instead of !isServer.

quartz coyote
#

but SP is some kindof Server so this isn't the problem

little eagle
#

You have to execute cutRsc on every machine, and in MP you just quit on the clients.

#

And the dedicated server, the only machine where it would be shown, doesn't see it obviously.

#

Ah, I see another problem.

#

x and y are -2, so it's off screen.

#

Then you put it on screen with ctrlSetPositon.

#

But ctrlSetPosition only moves the control slowly, where the speed is defined with ctrlCommit.

#

ctrlCommit 0 for "instantaneous" for example.

#

But I don't see ctrlCommit anywhere in your code.

quartz coyote
#

I see

#

that is probably the problem

little eagle
#

You should only move it on screen once, and not in the loop.

#

It never changes position anyway.

#

Also, since this is the future:

quartz coyote
#

That was the problem !
((UiNamespace GetVariable "dm_hud") DisplayCtrl 23501) ctrlCommit 0;

#

added that in

#

and it works

#

SP && MP

little eagle
#
    class dm_hud {
        //onLoad = "uiNamespace setVariable ['dm_hud', _this select 0]"; <-- remove this
        class controls {
            class hud1 {
                onLoad = "uiNamespace setVariable ['dm_hud', _this select 0]"; // <-- add this
#

Then you can use:

(uiNamespace getVariable "dm_hud")

instead of:

((UiNamespace GetVariable "dm_hud") DisplayCtrl 23501)
quartz coyote
#

Okay nice thx

#

So I transformed it like this :

#
class RscTitles
{
    titles[] = {};
    class dm_hud
       {
        idd = 1000;
        movingEnable = 0;
          fadein = 0;
        duration = 9999999;
          fadeout = 0;
        name = "dm_hud";
        controlsBackground[] = {};
        objects[] = {};
        class controls
        {
            class hud1
            {
                onLoad = "uiNamespace setVariable ['dm_hud', _this select 0]";
                type = 0;
                idc = 23501;
                style = 1;
                x = safeZoneX + safeZoneW - 1;
                y = safeZoneY + safeZoneH - 0.06;
                w = 1;
                h = 0.025;
                sizeEx = 0.025;
                size = 1;
                font = "EtelkaMonospacePro";
                colorBackground[] = {0, 0, 0, 0};
                colorText[] = {0.6, 0.6, 0.6, 1};
                shadow = true;
                text = "";
            };
        };
     };
};
#
if (!hasInterface) exitWith {};

CutRsc["dm_hud", "PLAIN"];

DisableSerialization;

while {!DMGameOver} do
{
    private _Array = (if (isMultiplayer) then {playableUnits} else {switchableUnits}) apply {[getPlayerScores _x param [5, 0], _x]};
    _Array sort false;
    _PlayerName = name (_Array select 0 select 1);
    (UiNamespace GetVariable "dm_hud") CtrlSetText (Format ["Leader : %1",_PlayerName]);
    sleep 1;
};
#

Correct ?

little eagle
#

lgtm

quartz coyote
#

it's working perfectly

little eagle
#

shadow = true;
should be
shadow = 1;

quartz coyote
#

thx very much !

#

okay

little eagle
#

Either that or remove it altogether. Because atm it's just a bugged entry that does nothing.

#

Depends on whether you want the shadow text or not.

#

These:
controlsBackground[] = {};
objects[] = {};
can be removed as they do nothing when empty.
And:
movingEnable = 0;
doesn't work for RscTitles obviously, so might as well get rid of that too. ยฏ_(ใƒ„)_/ยฏ

#

If you cut down all the superfluous stuff, you might even be able to find something in future.

quartz coyote
#

Nice thank you !

#

So now i'm going to try and RemoteExec the CutRsc

little eagle
#

Probably better off putting it into a separate script and use remoteExec on that function.

quartz coyote
#

Does it really make a difference ? because i'm trying to keep the number of separate scripts small

little eagle
#

Why?

quartz coyote
#

make it more simple to edit

little eagle
#

Then you should make the script you're currently on just execute everywhere.

quartz coyote
#

ah right

little eagle
#

I don't see any need for remoteExec here. This should work best as a local script.

#

Running on every machine with hasInterface.

quartz coyote
#

my remote exec isn't working

#

remoteExec ["dm_fnc_DisplayScore"];

#

most have forgot something

little eagle
#

Maybe dm_fnc_DisplayScore is undefined.

quartz coyote
#

it is I put it in my cfgFunction in Description.ext

#

just check everythinh

#

It's like it it remoteexecing it but script is just not working on Clients ...

little eagle
#

When is it executed?

#

The remoteExec.

quartz coyote
#

in initServer

little eagle
#

Maybe the client hasn't created the mission display yet and therefore cutRsc fails silently.

quartz coyote
#

yes

#

weared ... it has something to do with MP... in SP it's working perfectly

austere granite
#

do the clients actually have the function available?

#

: remoteExec ["dm_fnc_DisplayScore"]; only works if the client knows what function that is

#

if you only define the function on the server it wont work

#

nvm

#

cant read

quartz coyote
#

no worries ๐Ÿ˜„

austere granite
#

for the client probably put a waitUntil {!isNull (findDispay 46)}

quartz coyote
#

what does that do ?

austere granite
#

: Maybe the client hasn't created the mission display yet and therefore cutRsc fails silently.

#

wait till the mission display is created

quartz coyote
#

ok

#

LOOOL
Just put a Sleep 0.02; in my script before the CutRsc (I'd seen that in some other system) and it now works

#

Thanks Arma 3......

little eagle
#

Use the waitUntil, or it might fail for JIP clients.

#

Those have simulation and therefore time running before they confirm the briefing etc, so the sleep time will pass before they have their mission display.

#

And yes, scheduled scripts, cutRsc etc. All mission scripting. It's all race conditions like this and hot garbage.

quartz coyote
#

Okay well finaly finish ! Thanks some much for your help !

#

waitUntil {!isNull (findDispay 46)};
This gives me an generic error in expression

cedar kindle
#

display not dispay

#

id recommend using an editor with syntax highlight for sqf and youโ€™d see those errors easily

quartz coyote
#

ok right ^^ Nvm I can't read eather
I have Poseidon Tools but I washaving problem being intelligent xD

ripe imp
#

Hi folks! Trying to get back into missing making here, and just trying to get used to the new editor/scripting (i have arma 2 experience with minimal sqs/sqf) and I'm already stumped by something that I hope you guys can help with: what is the bis fnc (or other method?) to order a unit to enter a vehicle?

little eagle
#

moveInAny
moveInCargo
moveInCommander
moveInDriver
moveInGunner
moveInTurret

ripe imp
#

also, what's the standard way to "bprint" or whatever it was, perhaps hint, or something that can be continuously updated?

little eagle
#

systemChat str _any

ripe imp
#

thank you kindly!

little eagle
#

diag_log text str _any;
for RPT log.

#

Well, or just
diag_log _any;
I guess.

ripe imp
#

I feel like errors are being suppressed during run time, is there somewhere I can check that?

little eagle
#

-showScriptErrors has to be set as flag, and -noLogs has to be unset as a flag.

ripe imp
#

what about drawing a marker over a unit on your map? markerCreate ?

cedar kindle
candid jay
#

So.. TIL the hard way that:

[] remoteExec ["tag_fnc_myFun1", 0, _unit];
[] remoteExec ["tag_fnc_myFun2", 0, _unit];
[] remoteExec ["tag_fnc_myFun3", 0, _unit];

only tag_fnc_myFun3 will be called for JIP

little eagle
#

Yes, that's the point?

candid jay
#

Well no

#

If it's a STRING ID, yes, but if it's an object then I expected that it would simply ensure that if the object is deleted, then the remoteExec call is removed from the JIP queue

#

Instead, the object is also treated as an unique ID.

#

and if you read the docs, the mention of a unique ID is clearly related to the arg being a STRING but no mention of the arg being an unique identifier if it's an object passed in there.

little eagle
#

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

candid jay
#

yeah right

#

as said: the hard way, Things Broke(TM)

little eagle
#

I never had the need to use something like that. I'd rather keep my own arrays.

candid jay
#

ok

#

well it's there and I find it pretty useful, instead of having EH on deleted

#

just this little quirk

cedar kindle
#

idk what you'd expect tbh

#

just use the "Number:Number" variant

rocky marsh
#

I wonder if you guys could help me, im getting these errors spamming my logs, but i cant find out where its coming from :/ Error position: <> 22:15:31 Error Local variable in global space 22:15:31 Error in expression <>

deep quiver
#

getUnitLoadout, setUnitLoadout. Is there anything similar for ammo boxes / vehicles?

tough abyss
#

no

deep quiver
#

๐Ÿ˜”

peak plover
#

Can I get head direction somehow?

subtle ore
#

@rocky marsh i an going to guess you are using unit inits?

#

You can't have local variables in there

plucky willow
#

I'm trying to get a player to execute a script when he enters a trigger area, but i only want that script executed locally

#

and only for that player

peak plover
#

inArea

subtle ore
#

if(local player) {//inArea};

#

Oh and triggers are evil

plucky willow
#

is there a better way than triggers to detect if a player is in an area?

subtle ore
#

Yes? InArea with markers whilst being executed on the player

plucky willow
#

how do i get each player to execute a local script?

peak plover
#

postInit in function library

severe solstice
#
_nObject = nearestObject [(getPosATL _playerObject), _spawnObject];

i try to find an object which is over 50m. but nearestObject is caped to 50. any idears. let us say 150m.

plucky willow
#

so i have a function in init.sqf, put the postInit = 1, then that will execute that function locally?

edgy dune
#

so question

#

ive been trying to add a addAction to all empty vheicles

#

like so

#
{

_x  addAction ["addActionThing",
{
//code
},[1],0,false,true,""," driver  _target == _x"];


}forEach (vehicles select { side _x == civilian });


#

my question is

#

is it possible to addAction with a forloop and if so wat did I do wrong

#

if I do

#
_this  addAction ["addActionThing",
{
//code
},[1],0,false,true,""," driver  _target == _x"];
#

it works but id really like to have it on a forloop and do it for all empty vics

indigo snow
#

nothing about a forEach loop would stop addAction from working

river meteor
#

How do I get rid of the border on a CT_LISTBOX?

edgy dune
#

aye cool thx cptnnick

little eagle
#

@river meteor Maybe: style = LB_MULTI + ST_NO_RECT;
That's how it works for RscEdit.

edgy dune
#

so for some reason a foreach loop doesnt allow me to add addAction to vehciles

#

heres the code

#
{

_x  addAction ["Add Action Name",
{
hint "Action Done";
},[1],0,false,true,""," driver  _target == _x"];
[west, "HQ"] sideChat format["Action Added"];

}forEach (vehicles select { side _x == civilian });



#

any ideas why?

queen cargo
#

vehicles select { side _x == civilian } what does this return

#

also where are you running that

#

addAction has only local effects

edgy dune
#

the code u asked about returns a list of all empty vheicles

#

empty vics are unde rthe civ faction

queen cargo
#

lemme repeat

#

check what it contains

#

explicit

#

also:

#
addAction has only local effects```
little eagle
#

Does it print that sideChat thing?

edgy dune
#

it does pirnt the sidechat thing

#

also i run it on a block

#

like a vr block,anything with init code executiong block

little eagle
#

" driver _target == _x"

queen cargo
#

driver _target == _x

little eagle
#

_x is undefined

#

Should be:
"_this == driver _target"

queen cargo
#

^+1

edgy dune
#

lemme try that

little eagle
#

It will work. Don't even need to try.

edgy dune
#

wouldnt the _x be defined in the foreach loop though?

little eagle
#

No.

#

The condition is a different script instance.

#

No local variables carry over.

edgy dune
#

i c

little eagle
#

Even if it did work, it's logically wrong.

#

The car can't be it's driver.

#

Well, in Arma you don't have self driving cars, because >2035.

south rivet
#

@little eagle I use your zeus script to give predefined players zeus, but for some reason those modules don't allow me to check the attributes of objects. It works with a normal editor module. Do you know what might cause this problem?

little eagle
#

"check the attributes of objects"

#

?

south rivet
#

When you double click a player for example, it would show stuff like rank and other stuff.

edgy dune
#

thx commy

little eagle
#

I don't remember, is it the createUnit thing?

south rivet
#

yea

little eagle
#

Does it not show it for any object or just preplaced ones.

south rivet
#

I remember it working a while ago, but it seems like it broke recently.

#

Any object

little eagle
#

No idea.

south rivet
#

Hmm, guess I will need to continue testing then

agile pumice
#

anyone see an error here?: _flag = nearestObjects [this, ["Flag_Blue_F"], 10]; _flag addAction ["Spawn Track",{createVehicle ["ACE_Track", position (_this select 0), [], 5, "NONE"]},nil,1.5,true,true,"","true",5,false,""]; _flag addAction ["Spawn Wheel",{createVehicle ["ACE_Wheel", position (_this select 0), [], 5, "NONE"]},nil,1.5,true,true,"","true",5,false,""]; _flag addAction ["Spawn Jerrycan",{createVehicle ["Land_CanisterFuel_F", position (_this select 0), [], 5, "NONE"]},nil,1.5,true,true,"","true",5,false,""];

little eagle
#

_flag is ARRAY, addAction needs OBJECT

agile pumice
#

you're correct

little eagle
#

What do I win?

agile pumice
#

my bad

#

ummm

#

season's greetings?

#
_flag = _flag param [0, objNull];``` ๐Ÿ˜‰
little eagle
#

Might as well use:
_flag = nearestObject [this, ["Flag_Blue_F"]];

agile pumice
#

I suppose

little eagle
#

Wait

#

_flag = nearestObject [this, "Flag_Blue_F"];

#

nearestObject doesn't have the array version according to the wiki.

agile pumice
#

roger

gray hemlock
#

Any ideas on identifying if ArmA is the primary program? Ie player is not tabbed out? Would need to be able to identify if a player has tabbed out and when tabbed back in.

cedar kindle
#

don't think so. only with an extension

#

for what purpose? might be another solution

#

you can detect the alt tab but i don't think you can figure out the state

little eagle
#
addMissionEventHandler ["Draw3d", {
    commy_lastDrawFrame = diag_frameNo;
}];
addMissionEventHandler ["EachFrame", {
    commy_lastSimulFrame = diag_frameNo;
}];

abs (commy_lastDrawFrame - commy_lastSimulFrame) > 1

Something like this maybe?

still forum
#

TFAR 1.0 can do that ^^. Atleast tell you if the executable owning the current foreground window has "arma" in it's path

final vessel
#

Okay... can anyone (cc: @still forum ) explain why call compile is 4.2x FASTER than parseSimpleArray, even though the wiki states:
the command is on average 3x faster than similar call compile string array method.

parseSimpleArray "[100 floating point numbers]"; - 0.0345ms
call compile "[100 floating point numbers]"; - 0.0082ms

#

Test for yourself:

parseSimpleArray "[1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1]";

call compile "[1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1,1.1,2.1,3.1,4.1,5.1,6.1,7.1,8.1,9.1,10.1]";
cedar kindle
#

what's the result if you mix a couple of strings in there?

twin shadow
#

Hello everyone. Im kinda new to scripting and ive been looking into something specific so im trying my luck here. I want to make an ingame cinematic intro for an MP mission. Exemple: screen starts black then slowly transfer into first person. I want the player unit to be controlled by AI to follow a path and keep the player access to head movement. Exemple. Player dismount from a truck and start walking toward a plane the climb on it without the player input. Then later on he get parachuted from the plane then at that point regain control of his body. Ive been looking all over internet and cant find anything about it.

tough abyss
#

Depends on your string i.e "[1,[[[""2""]]],true,[4,""five"",false]]" is slightly faster with parseSimpleArray than with call compile for me

final vessel
#

@cedar kindle 0.0090ms vs 0.0178 for 100 strings

little eagle
#

Almost as if the only uses for parseSimpleArray are not the intended ones.

austere granite
#

๐Ÿ˜„

#

you wanna make an extension with only short returns (And you know they are always going to be short no matter what?!): We have a command just 4u

final vessel
#

Okay, so it looks like (judging by my test cases linked in my Scratchpad), parseSimpleArray is faster with booleans and nested arrays but slower with everything else, namely: strings, floats, ints.

tough abyss
#

Engine commands are prob checking variables types in different orders

#

But its interesting to know, if you really wanna optimize

final vessel
#

Actually, I do ๐Ÿ˜„

#

So now I will have to know what I am going to return and then depending on that I'll have to call either the first or the second function? That's ridiculous ๐Ÿ˜ฆ

still forum
#

booleans are slower because they are actually command calls in "call compile" but just parsed in parseSimpleArray

final vessel
#

Okay, I did a last check on 100 pairs of int values ([1,2],[1,2],[1,2],...).
0.06ms vs 0.03ms. Call compile wins again.

still forum
#

I don't know what else is a command call...

final vessel
#

So, basically, if you want to pass in lots of bools or LOTS of nested arrays, you should use parseSimpleArray. But as soon as you put anything in those arrays, stay with call compile, trolololo... ๐Ÿ˜„

still forum
#

arrays are actually built at runtime.
[1,2,3,4,5]
is
push 1
push 2
push 3
push 4
push 5
build array of five elements from stack and push the array to stack

#

Would ofc be aaaaawesome if it could build the whole array at compiletime.. but....

#

strings, floats, ints. There are no ints

tame portal
#

@still forum Does the DayZ scripting language look more lower C or higher Cish to you?

still forum
#

high

austere granite
#

you're high

tame portal
#

how can a boat float if water is just an illusion

still forum
#

boaty mc float float

jade abyss
#

ever heard of hoverboat, duuuhhhh @tame portal

south rivet
#

Isn't the script language in the new engine supposed to be more like c#?

tame portal
#

boaty mc boat face

jade abyss
#

Thats already used

south rivet
#

Yea, but I heard that it is a lot like C#, which is kinda what the current one already is

jade abyss
south rivet
#

Not totally, but definitely has some of the traits

#

But I read somewhere that it would be like C#, but doesn't look as they explained it

austere granite
#

You don't look like c# to me @jade abyss

south rivet
#

But, as long as the multicore utilisation is better than in rv4, I'm happy

tame portal
#

I mean for example it uses

#

the

#

"extends" keyword

jade abyss
#

Yeah, i look like an Imperial Dschar-Destroyer

#

@austere granite

austere granite
#

did you fail your mention?

#

HAHAHAHAAHAH

jade abyss
#

Discord did, you smartass

tame portal
#

it looks so not c++ to me

#

because im used to seeing a thousand & and * and whatnot in C++ code

#

and ::

jade abyss
#

it looks like something

tame portal
#

->

jade abyss
#

:: was used in there, iirc

#

References ActionBase::ApplyModifiers(), ModifiersManager::DetachByType(), PlayerBase::m_ModifiersManager, and MDF_BLEEDING.

#

example

south rivet
#

I do have to say though, except for this (*(void (**)(void))(*(_DWORD *)a2 + 680))(); You could translate the object getDamage to c# with maybe one or two changes

jade abyss
#

ItemBase::GetQuantity2(). etc

#

OH GOD! I HOPE IT'S NOT LIKE SQF

south rivet
#

You gotta say this look quite a bit like a C# method

{
  double result; // st7@2
  float v3; // [sp+4h] [bp+4h]@2

  (*(void (**)(void))(*(_DWORD *)a2 + 680))();
  if ( a1 >= 1.0 )
  {
    result = 1.0;
  }
  else
  {
    v3 = a1;
    result = v3;
  }
  return result;
}```
austere granite
#

pls lua

south rivet
#

But it would be almost the same in c++

tame portal
#

@south rivet the fuck is that

south rivet
tame portal
#

uhhh

#

they have a class called

#

JsonObject

jade abyss
#

So it's another mix of several languages

south rivet
#

It seems so, wooohooooo

tame portal
#
class DayZGame extends CGame
austere granite
#

that can only turn out great

tame portal
#

better than plain C++ imo

#

cant be bothered to learn that

#

i would be making memory leaks left and right

still forum
#

If you do c++ right you never have memory leaks

tame portal
#

yes

#

but i would do it wrong

#

every single time

#

make pointers of pointers of pointers of pointers of pointers

still forum
#

Just never use new/delete that's it.

jade abyss
#
usage:

Param paramA = new Param1<int>(55);
Param paramB = new Param1<string>("Hello");```
Wut?
still forum
#

And ofcause no C like malloc

tame portal
#

mallocing of more memory intensifies

jade abyss
#

Param param = new Param2<float, string>(3.14, "Pi");
hmm

tame portal
#

yeah

jade abyss
#

this is actualy... okay

tame portal
#

looks like a classic high level language class to me to be honest

#

this is how java and c# and others do it

#

PluginDeveloper.c

#
    void OnInit()
    {
        super.OnInit();
        
        m_SqfDebugWatchers = new array<SqfDebugWatcher>;
        m_GodModeEnabled = false;
        
        DeveloperFreeCamera.OnInit();
        
        for ( int i = 1; i <= MIN_SQF_DEBUG_WATCHERS_COUNT; i++ )
        {
            m_SqfDebugWatchers.Insert( new SqfDebugWatcher(i, "") );
        }
    }
#

the only thing odd here is

#
new array<SqfDebugWatcher>;
south rivet
#

sqf is mentioned

tame portal
#

in my world it would need () aswell

#

@south rivet it has a SQF interpreter still afaik

#

so it can run both

jade abyss
#
[Client] This function is called by engine to get list of scripted actions

Parameters
ctx    action menu context
player    which is asking for actions
usage :

void OnGetActions(ActionMenuContext ctx, Man player)
{
    super.OnGetActions(ctx, player);
    if (IsActionCopyAvalible())
    {
    autoptr Param4<string, int, EntityAI, EntityAI> p = new Param4<string, int, EntityAI, EntityAI>("ahoj", 5, this, player);
    ctx.AddAction("Copy", ACTION_ID_COPY, p, 1000, true, true);
    }
}```
thats... ohmy
south rivet
#

Yea, new definitions always require () in c#. And I always program in c#, so this will take getting used to

tame portal
#

autoptr

#

lul

#

@south rivet Me too

#

Thank you for existing

#

this is literally C#/Java code with some slight differences

#

finally, the game itself is an object

#

GetGame()

south rivet
#

I was forced by the university for the first 1.5 years, then we got some haskell and python thrown in. But c# is still the main language used. Have never touched c++ eventhough I study game technology

tame portal
#

DeveloperTeleport.c

#
    // Set Player Position (MP support)
    static void SetPlayerPosition(PlayerBase player, vector position)
    {
        if ( GetGame().IsServer() )
        {
            player.SetPosition(position);
        }
        else
        {
            autoptr Param3<float, float, float> params = new Param3<float, float, float>(position[0], position[1], position[2]);
            player.RPCSingleParam(DEV_RPC_TELEPORT, params);
        }
    }
#

weird approach

jade abyss
#

hm

tame portal
#

instead of defining the need of 3 floats in the header signature of RPCSingleParam

jade abyss
#

wait, so it's C++ and ?

still forum
#

mostly c++

tame portal
#

looks mostly not c++ to me lul

#

could be wrong though, havent looked around much

#

i like the UIs are defined in XMLs now

jade abyss
#

oidnsgdisngigsdfs

tame portal
#
m_edit_box = layoutRoot.FindAnyWidget("InputEditBoxWidget");
peak plover
#

what

tame portal
#

this is how you get a widget on the screen

#

for example

#

the message

#

that says

austere granite
#

but i just got good at UIs in SQF

#

it only took me 4 years

tame portal
#

"This is early access fuck off if you cant be bothered"

#

looks like this in XML

jade abyss
#

๐Ÿ˜‚

tame portal
austere granite
#

i guess that makes it easy to write xternal tools to create UIs with

jade abyss
#

Yep

tame portal
#

you can then create such widget on the screen like this

#
layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/day_z_chat_input.layout");```
jade abyss
#

Something usefull to do for Dedmouse

tame portal
#

this looks like a GREAT approach for "plugin & play" stuff

#

cant wait to make more cash again [ฬฒฬ…$ฬฒฬ…(ฬฒฬ… อกยฐ อœส– อกยฐฬฒฬ…)ฬฒฬ…$ฬฒฬ…]

#

lul

jade abyss
#

derp

tame portal
#

you know im pulling the money out of kids left and right

#

hue.

jade abyss
#

as long as they are LIFE'r

tame portal
#

you know what im gonna do

#

make a life mod

#

THEN sell stuff for it

#

$$$$$$$$$$$$$$

jade abyss
#

Otherwise: I know where you "life" ๐Ÿ˜„

#

DayZ-Life

#

๐Ÿ˜‚

tame portal
#

the good thing again is: its plain text so feel free to sell it

jade abyss
#

still a derp ๐Ÿ˜„

tame portal
#

i know people hate me for this โค

austere granite
#

i do

#

dscha can you put a thumbs down

#

thank you

tame portal
#

@austere granite But why ๐Ÿ˜ข

jade abyss
#

added @austere granite

#

stupid discord

austere granite
#

CANT TOUCH THIS

#

NANANANA

jade abyss
#

Just did

#

@austere granite

#

There are several ways, muhahahaha

tame portal
#

@austere granite please explain yourself

#

ฬฟฬฟ ฬฟฬฟ ฬฟฬฟ ฬฟ'ฬฟ'\ฬตอ‡ฬฟ\

#

๐Ÿ”ซ

austere granite
#

nothing

still forum
#

throws stones

jade abyss
#

Oh, Dedwomen throwing stuff around again

tame portal
#

i dont like rocks being thrown at me

still forum
#

Stones. Not rocks

jade abyss
#

Huge difference

#

(not)

peak plover
#

Anyone @here involved in any form of the Third Party DLC?

still forum
#

Yes.

#

I read the forum thread about it

austere granite
#

so dedmen does cba keybinding support full joystick mode now?

jade abyss
#

I think he was asking if you are in any project

still forum
#

No. Commy didn't implement it yet

peak plover
#

red the bread, pretty much involved

austere granite
#

k thanks

peak plover
#

I ment if anyone is in a project yeah

still forum
#

Intercept-CBA causes CBA events for joystick keypresses. You could add EHs manually ยฏ_(ใƒ„)_/ยฏ

jade abyss
#

You must excuse Dedmam, she gets old.

austere granite
#

i don't actually care about keypresses, axis only

#

and i trust you to do proper handling of analog stuff

peak plover
#

I know there's gotta be someone doing a project

jade abyss
#

why asking?

austere granite
#

i am

tame portal
#

Im interested who is working on what

peak plover
#

Well interesting stuff

#

Adanteh doing frontline for that?

tame portal
#

๐Ÿ”ซ You better speak up

austere granite
#

nah, was just annoying you nigel

peak plover
#

Ohh no

#

you done pissd me off good this time

still forum
#

I don't have EH's for analog yet I think

peak plover
#

Make those into the future DLC

still forum
tame portal
#

So who's working on a paid DLC at the moment?