#arma3_scripting

1 messages Β· Page 540 of 1

slender halo
#

yes

elfin inlet
#

Nah, one door of the hangar is initially closed on the Land_Airport_01_hangar_F then i have an addAction that open the door closed AND close the second

patent estuary
#

yea i did this for an unreleased asset,. i had to bind them together with condition/statement in the useraction in config

slender halo
#

it's not on a custom model

patent estuary
#

but it is not configured either,. which leads me to believe it wouldnt work in the fasion you want with BIS_fnc_Door anyways

slender halo
#

yeah, buy looking thourght the config i coticed BIS_fnc_Door

#

but

#

just to clarify, i want to animate the sliding doors of an apex hangar, but when run the function/command to animate the second door, the first one keeps moving but witout its respective geometry LOD part

#

in other words, i can walk throught the first door

#

@elfin inlet first noticed this, i managed to repoduce it on my end

young current
#

Then sounds like the model is broke

slender halo
#

with BIS_fnc_door and animateSource

#

on this apex model and the vanilla dome

elfin inlet
#

i managed to reproduce the same on Land_Dome_Big_F

#

which let me think it's not related to structure itself. But i need to test on more building to be sure

patent estuary
#

ah interesting,. the hangar you mentioned does have the correct selections in the geo lod (door_1/2/3),. unless something funky is happening when that script/function fires

#

for my use i needed them to open both doors at the same time, so went the old school tried and true and just wrote conditional statement bind in the user actions

#

although config for that BI hangar has no useractions for doors 2 & 3 and only function through eden attirbutes

elfin inlet
#

I have the problem only when both doors do not the same animation ( One opening the other closing)

#

To clarify, i have the hangar and i closed the door 2 on the editor.

Then i have an addAction that do this:

     Hang1 animateSource ["Door_3_sound_source", 0];
     Hang1 animateSource ["Door_2_sound_source", 1];

patent estuary
#

iirc I think i had that with my hangar too, so with those statements in pastebin^ i bound them to use the same trigger in model.cfg

#

its funny that BI model is missing the useractions though

#

the initPhase of the doors are 1 (open), did you try Hang1 animateSource ["Door_2_sound_source", 0]; after pre-closing the door in eden ?

#

you could use animationSourcePhase on the door to report its anim phase after each action, then at least you would know what its doing phase wise

young current
#

Those really the only animation sources on the doors?

patent estuary
#

there are controllers for locked, open and another (i just closed arma, woops πŸ˜„ ), for each door

elfin inlet
#

Yeah i did a test without pre-closing the door.

Spawned a hangar, executed : hangar animateSource ["Door_3_sound_source", 0];
Waited for the animation to finish then executed

hangar animateSource ["Door_3_sound_source", 1];
hangar animateSource ["Door_2_sound_source", 0];

#

Problem still here.

slender halo
#

here is a console ready script that reproduce the issue 100% for me ;

[] spawn {
    // first close the right door
    hangar animateSource ["Door_3_sound_source", 0];
    sleep 16;

    // once the right door is completly closed, start to close the left door
    hangar animateSource ["Door_2_sound_source", 0];
    sleep 4;

    // 4 seconds later, we open the right door
    // the geometry LOD of the left door wich is currently closing will stop
    // and remain at its position until the animation of the left door is completely done
    // during that time you can walk through the door and collide with the "stuck" geomety
    // at the position the left door was when you started the second animation
    hangar animateSource ["Door_3_sound_source", 1];
}
elfin inlet
#

Notice that if you don't do the SLEEP between the to commands, the geometry LOD will not move at all even after both animation are finished

patent estuary
#

sounds more like a bug now with animations of the geo lod specifically

#

the animation time for those doors is 15 btw, so your sleep 16; is perfect πŸ˜„

slender halo
#

^^

patent estuary
#

it could be house simulation class is limited running simultaneous animations, or at least if one is running and another fires it becomes discombobulated.

slender halo
#

perhaps it always has been like that, the big and slow doors just make it obvious

patent estuary
#

yeah i did have some wierd stuff happen rigging my own dual hangar doors, put it down to tiredness, may have been the same issue

#

i'd definately report it on the feedback tracker though, at least then if anything it is noted somewhere for BI

elfin inlet
#

Just tested on Land_i_House_Big_01_V2_F. Same bug

slender halo
#

@elfin inlet found an even worse case where geometry/FireGeometry LOD are completely ignored and won't return in position once the animation is complete

#
[] spawn {
    hangar animateSource ["Door_3_sound_source", 0];
    sleep 16;

    hangar animateSource ["Door_2_sound_source", 0];
    hangar animateSource ["Door_3_sound_source", 1];
}

#

you end up with Door_2 visually closed but you can get and shoot through and Door_3 visually open but you hit an invisible wall if you try to pass/shoot

#

and it is reproductible on any building

slender halo
patent estuary
#

πŸ‘

tough abyss
#

When a player join my server, i need to run some basic code, and this includes some heavy nearObjects functions. Since this is the first time nearObjects run onh client, it takes lots of time to conclude, because things on map are not cached, i believe. There is a way to make this firsts nearObjects function don't take that much to conclude?

#

First batey of nearObjects takes 13 seconds to run. If you run it again, than it takes only 45 ms to run 😲

velvet merlin
#

ctrl press state for onMapSingleClick (and the mission EH) would be nice
ctrl+click is now used for map free hand drawning, however onMapSingleClick has return value to block native engine functionality anyway (which applies to shift click too)

tough abyss
#

hey, is it possible to make a mod where a specific vehicle will always spawn with a script in the ini ?

still forum
#

yes, cba

tough abyss
#

would it be easy to do if youre not too experienced with modding? i know how to use the basic arma 3 tools and stuff just kinda lost with scripting

still forum
#

that would be a config

#

CBA Extended eventhandlers

tough abyss
#

nice thanks!

#

do i need to do the whole bulldozer work drive thing do view the config file for the falcon uav ?

still forum
#

no

#

for vanilla stuff you can use the ingame config viewer or a "all in one config"

tough abyss
#

i tried to view it there but i wasnt able to copy the whole thing to a text document, is it possible to do that?

still forum
#

Never tried that.
Guess for that a AIO config would be better

tough abyss
#

hm does this look right?

#

class Extended_PreInit_EventHandlers {
class My_pre_init_event {
init = "this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]";

#

my game crashes when i try using it

#

oh wait might have used the script for events instead of objects

#

ok i basically have no idea what im doing but could it look something like this?
class CfgVehicles {
class BB_T_UAV_03_F{};
};

class Extended_Init_EventHandlers {
class B_T_UAV_03_F {
init = "this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]";
};
};
};

wispy cave
#

Is there a stackable version of inGameUISetEventHandler?

exotic tinsel
#

how do i convert this to allow me to use a string var with html in it, instead of a url

disableSerialization;
            private _display = (findDisplay 46) createDisplay "RscCredits";
            private _group = _display ctrlCreate ["RscControlsGroup", -1];
            private _html = _display ctrlCreate ["RscHTML", -1, _group];

            _group ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];
            _group ctrlCommit 0;

            _html ctrlSetBackgroundColor [0,0,0,0.8];
            _html ctrlSetPosition [0, 0, safeZoneW, safeZoneH * 3];
            _html ctrlCommit 0;
            _html htmlLoad _url;
solemn token
#

I think thats not possible. But you can add a html-file into your mission file and load it.

exotic tinsel
#

@solemn token the issue is im dynamically creating some content and i really like that dialog. is there another way to get a dialog like that one?

solemn token
#

@exotic tinsel

plush oriole
#

it can be local as he-man said which is nice

#

structuredtext is typical and pretty good

#

could even have a uri

#

try this as the url:

#
data:text/plain;charset=utf-8;base64,PGRpdj4gb29ibGUgZm9vYmxlIGhlbGxvIDpEIDwvZGl2Pg==```
exotic tinsel
#

@solemn token i went with this. thank you for pointing me in the right direction.

            disableSerialization;
            private _display = (findDisplay 46) createDisplay "RscCredits";
            private _ctrl = _display ctrlCreate ["RscStructuredText", -1];
            _ctrl ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];
            _ctrl ctrlCommit 0;
            _ctrl ctrlSetBackgroundColor [0,0,0,0.8];
            //_ctrl ctrlSetPosition [0, 0, safeZoneW, safeZoneH * 3];
            _ctrl ctrlCommit 0;
            
            _ctrl ctrlSetStructuredText parseText _Server_Roster_ALL;
spark turret
#

general question about variables:
do variables save absolute values or can i have automatically updating variables?

f.e. _varLIST = [_var1,_var2];

will _varList autoupdate its values if _var1 and _var2 are changed or will it stay the same?

still forum
#

if you can change the variable by reference, it will auto update

#

but you can only do that with arrays

#
_var1 = [];
_var2 = [];

_varList = [_var1, _var2];
//_varList is [[],[]]
_var1 pushBack "test";
//_varList is [["test"],[]]
spark turret
#

"by reference" means with a function like pushback instead of _var1 = ["test"]?

still forum
#

yes

#

= puts a new value into the variable

#

_varLIST = [_var1,_var2];
here _varLIST doesn't know what variables are in the array.
But it knows what values these variables point to.

_var1 = x

basically changes what the variable points to. _varLIST doesn't know about that change and still only stores what it previously pointed to

spark turret
#

okay thank you. will use reference functions then

silk radish
#

hi guys. for the past three hours, i've tried to edit a simple mission where a single artillery piece fires a salvo at a house, nothing else. i don't know shit about scripting and i can't get it to work, i've tried it for over three hours, watched countless youtube videos but it just doesn't work. i'm really desperate, could someone make a mission for me that I could copy paste?

winter rose
#

real artillery piece or "virtual" (a.k.a you don't see it) artillery?

silk radish
#

real artilley piece

surreal peak
#

what have you tried so far? @silk radish

silk radish
#

The commandArtilleryFire script

winter rose
still forum
#

not today

#

when was that added?

silk radish
#

@winter rose i can't get that to work either

#

how am I supposed to know all the ammo types

#

and it won't fire when I try to play

winter rose
#

how am I supposed to know all the ammo types
in-game config viewer, in Eden while playing > Escape > Config Viewer
or using the wiki

hollow thistle
#

Version: 0.50 πŸ€”

#

tf is subgroup

crude needle
winter rose
#

I would guess a sub-group is the part of group, such as 6 & 7 follow 2, 4 & 5 follow 3, 2 & 3 follow 1

vernal mural
#

is there a quick way of preventing a script-spawned unit to be passed to a headless client ? Something like myUnit allowHC false ?

winter rose
#

not setOwner it?

tough abyss
#

I would guess a sub-group is the part of group...
dont think so

vernal mural
#

I wonder why there is no locality information on addMissionEventHandler. How does it work ? Local only ?

winter rose
#

I would say, yes

still forum
#

wat, I've never heard of that command πŸ€”

#

ah really, it does exist. Might look again tomorrow

winter rose
#

…which one? subgroup?

still forum
#

ye

winter rose
#

(I was scared for a moment you didn't know about addMissionEventHandler :DΒ )

still forum
#

yes it local

winter rose
#

@Hippo#0619 for a mortar:sqf myMortar doArtilleryFire [getPosATL player, "8Rnd_82mm_Mo_shells", 3];

#

…oh

gloomy basalt
#

Hi, I am looking for some help explaning a question for me. I've recently started scripting, so far I've made a poor Vehicle spawn script that using the command menu and a automatic loadout script, that also has a manual selection w/ setUnitTrait for medics and engineers. I'm getting script errors in my vehicle service script. if ( _vehicles == ["landVehicle", "Air"] ) then { hintSilent "Repairing..."; sleep 5; _vehicles setDamage 0; hintSilent "Refuelling..."; sleep 5; _vehicles setFuel 1; };
Getting errors on the _vehicles == ["landVehicle", "Air"] bit. can anyone tell me what I'm doing wrong?

still forum
#

== can't compare array

#

isEqualTo can, but string comparison in there is case sensitive

gloomy basalt
#

I'll try that really quick

#

That worked, thank you @still forum

vernal mural
#

Something strange happened : "marker_submarine" setMarkerPos (destroyer getVariable "submarine");

#

this fails with an error like "type object, array expected"

#

but the wiki says that Object is allowed as parameter. Outdated wiki ?

gloomy basalt
#

I think tthe litttle dash after Array means an Object can be inside the array

ruby breach
#

@vernal mural "since Arma 3 v1.93.xxxxx"

#

Current version is 1.92

vernal mural
#

@ruby breach AH. Outdated Cheitan then, not outdated wiki.

spark turret
#

is there an Eventhandler that fires if an ACE gesture is used by a player? Wanna use it to trigger the ACIM civilian interaction script to stop civilians if i perform the ace "freeze" gesture.

#

i could write my own EH but im retarded in terms of performance impact reduction so i would like to avoid that πŸ˜›

#

calling in the expert @still forum

still forum
#

already on it

spark turret
#

thanks

#

there is "animationState ACE_player" which could be use in a chekcing loop

still forum
#

but it's a targetEvent, so it only fires on the unit that executes the gesture

spark turret
#

thats fine. will look into it

#

how do i notice that this specific cba target event has happened/fired? is it like a vanilla eventhandler function that i define somewhere?

still forum
#

Look at the other functions in same category

spark turret
#

peeerfect, thats exactly what i was looking for

spark turret
#

now, i start to understand the CBA eventhandler stuff. it seems there is already an eventhandler by ACE 3 that fires whenever an ace animation is played (which makes sense). it is that one:

//orignial ace eventhandler
[QGVAR(playActionNow), {(_this select 0) playActionNow (_this select 1)}] call CBA_fnc_addEventHandler;

now, first of all that name (which should be a string accoridng to cba ) is not a string. i have no idea what it actually is, some wierd global variable.

hint str QGVAR(playActionNow)

returns an error "missing ;"

i need the name of that eventhandler to be able to read it tho.
if i rip the original ace eventhandler and globally run it with my own script (just to see it it works), it returns an error "missing ]" which is obviously not missing.

//slightly altered ace eventhandler run by me globally from debug console
[QGVAR(playActionNow), {hint ("Eventhandler fired, Gesture"+ str _this)}] call CBA_fnc_addEventHandler;

I strongly assume the problem is the events name.

lofty rain
#

Hi! What command should I use to make AI group to disembark?

spark turret
still forum
#

QGVAR is a macro

#

it expands to "modname_modulename_x"

spark turret
#

aha

still forum
#

in your case "ace_common_playActionNow"

lofty rain
#

@spark turret Thanks!

spark turret
#

@pure raptordmen awesome it works now!! learnign something new from you every day

#

for everyone else:
If you want to run a script if a player performs an ACE gesture, run this globally with your own script stuff added, its an eventhandler that fires every time an ace gesture is performed.

_id = ["ace_common_playActionNow", {hint (str _this + "Eventhandler fired, Gesture");}] call CBA_fnc_addEventHandler;
lavish ocean
#

new #perf_prof_branch 1.92.145888 with fixes, performance improvements (yep script caching is back) and more admin features

sacred fox
#

im curious, have anyone had the issue "not being able to move below 50%hp" with mocap melee mod? im not sure this is the right place to ask, but you never know if someone has and have a clue on what is causing it.

young current
queen cargo
#
private _cases = {
    case 1: {"a"}; 
    systemChat "past case 1";
    case 2: {"b"};
    systemChat "past case 2";
    case 3: {"c"};
    systemChat "past case 3";
    default {"default"};
    systemChat "past default";
};
private _res = switch 2 do {
    [] call { [] call _cases; systemChat "past cases inner" };
    systemChat "past cases call outter";
};
systemChat str _res;```
output?
exotic flax
#

past cases inner
past case 1
past case 2
past case 3
past cases call outter
default

winter rose
#

@queen cargo

  • past case 1
  • past cases inner
  • past cases call outter
  • "b"
#

@exotic flax w8 wut?

queen cargo
#

Urgh

winter rose
#

going to use a public var, systemChat has a limited amount of lines

exotic flax
#

makes sense, since the switch is called within 2 calls... so why would it still have the "case 2"?

#

and to be fair... instead of asking, why not executing it in-game πŸ˜‰

winter rose
#

because @queen cargo doesn't have access to an Arma instance @exotic flax ;-)

["past case 1","past cases inner","past cases call outter","""b"""]```
using ```sqf
X39 = [];

private _cases = {
    case 1: {"a"}; 
    X39 pushBack "past case 1";
    case 2: {"b"};
    X39 pushBack "past case 2";
    case 3: {"c"};
    X39 pushBack "past case 3";
    default {"default"};
    X39 pushBack "past default";
};
private _res = switch 2 do {
    [] call { [] call _cases; X39 pushBack "past cases inner" };
    X39 pushBack "past cases call outter";
};
X39 pushBack str _res;

copyToClipboard str X39;```
queen cargo
#

ye .. crapload of shiat

winter rose
#

@exotic flax did you get the results from Arma?

exotic flax
#

no, it was an educated guess based on programming knowledge

winter rose
#

@exotic flax ah ok! I thought we had a conflict based on different versions of Arma πŸ˜…

#

@queen cargo not what you had?

steady jungle
#

Anyone know if when Remote Executing a file does it make a network traffic difference to a dedicated server if RE'ing an isolated group or everyone? Like does all clients receive the RE regardless of target then the clients determine if that is intended for them? Or does the server only send the packet to those who are listed as targets and no one else receives that RE request? If that makes sense? I'm assuming it only goes to intended targets specified... However, I could see it just carpet bomb everyone and then the client determines if they're the intended target...

queen cargo
#

more like no fucking idea how BI pulled that one off

#

unless they store the result in the switchdata

winter rose
#

@steady jungle by "remote executing a file", do you mean this?sqf [[], "file.sqf"] remoteExecCall ["execVM"];

#

but yeah remoteExec-Call only target the "target machines"

steady jungle
#

Like..

params remoteExec [functionName, 0, JIP]```
VS
```sqf
params remoteExec [functionName, [3,5,6], JIP]```
winter rose
queen cargo
#
private _cases = {
    case 1: {systemChat "inside 1"; "a"}; 
    systemChat "past case 1";
    case 2: {systemChat "inside 2"; "b"};
    systemChat "past case 2";
    case 3: {systemChat "inside 3"; "c"};
    systemChat "past case 3";
    default {systemChat "inside default"; "default"};
    systemChat "past default";
};
private _res = switch 2 do {
    [] call { [] call _cases; systemChat "past cases inner" };
    systemChat "past cases call outter";
};
systemChat str _res;```
#

@winter rose

steady jungle
#

Yeah, I wanted to know if actually saved bandwidth or not

winter rose
#

@steady jungle it does πŸ˜‰

steady jungle
#

Ok, like I said I could see it carpet bombing then the client determining if they're 3,5,6

winter rose
#

nay, clients shouldn't decide

steady jungle
#

Haha, thanks

winter rose
#

@queen cargo converted to

X39 = [];

private _cases = {
    case 1: {X39 pushBack "inside 1"; "a"}; 
    X39 pushBack "past case 1";
    case 2: {X39 pushBack "inside 2"; "b"};
    X39 pushBack "past case 2";
    case 3: {X39 pushBack "inside 3"; "c"};
    X39 pushBack "past case 3";
    default {X39 pushBack "inside default"; "default"};
    X39 pushBack "past default";
};
private _res = switch 2 do {
    [] call { [] call _cases; X39 pushBack "past cases inner" };
    X39 pushBack "past cases call outter";
};
X39 pushBack str _res;


copyToClipboard str X39;```
#

result sqf ["past case 1","past cases inner","past cases call outter","inside 2","""b"""]

#

anything else?

queen cargo
#

noup

#

busy fixing stuff now

#

ty though πŸ˜—

austere hawk
#

is there a performance difference between "sleep" in sqf and fsm's ""sleep"" by constantly checking current time?

still forum
#

constantly checking current time in script is more expensive than checking current time once (or less) per frame in engine yes

austere hawk
#

ok thanks, just as i suspected...

tough abyss
#

One provides some guarantee for timing one is not

#

Sleep only guarantees your script will be suspended for not less than set amount but for how long is undefined

austere hawk
#

ok good to know - luckily timing isnt critical - i'm running more in the "check every couple minutes" - though iirc it was mentioned sleeping very long is bad as well...

#

i'm just looking at some cti/warfare missions and there appear to be several fsm running in loops that dont consist of more than a hand full of states... But executed for one of each town and other stuff

#

wonder if its worth it to put the loop and sleeping in sqf and only call the fsm periodically

tough abyss
#

You may want to consider a trigger, sort of middle solution between sleep and checking time each frame. You get +- 0.5 sec precision if you put time check in condition. Alternatively you can activate trigger with setTimeout, dunno how precise it will be. You can also make a cron type extension to dispatch your timed tasks via ExtensionCallback

#

Also keep in mind that mission time time is flexible and does not keep with the actual time. It can be slowed down and speeded up and even if you do not alter its speed directly it can lag behind under heavy load

austere hawk
#

i see. but i think i'll avoid extensions for now ^^ thats new grounds entirely (as is mission stuff)

plain urchin
#

hey guys, i'm making a mission where you can take on "contracts". each "contract" has a set difficulty (1 through 5 stars). on each mission, i'm spawning a certain amount of units, but currently the amount of spawned units is random. what kind of math should i do to allow the difficulty to influence the amount of units? i don't want it to get too crazy around 5 stars and my math is pretty poor so i'm unsure how to proceed

#

currently, i'm spawning GROUPS of units via a for loop, checkign the amount of houses in the nearby area like this:

_nearHouses = nearestObjects [_position, ["House"], 200, true]; for "_i" from 0 to ((round ((sqrt (count _nearHouses)) * 0.5)) max 2) do { _enemyGroup = [_position, 7, 200, nil, "bandit"] call MISSION_fnc_spawnEnemyUnit_Group;};

#

each argument in that function is (center to spawn group at, amount of units in group, radius to spawn units at, the group's patrol radius (setting it to nil makes them not patrol), and unit type but most of these arguments don't really matter here in this context

austere hawk
#

wouldnt it be more logical to just say how many units (min max) you want for each respective level and then distribute them in random locations?

plain urchin
#

that's not a bad idea lmao i don't know why i didn't think of that

#

i just wanted to try and make it completely random idk

young current
#

its still random even if you decide a max amount for each level

#

and then randomize it

austere hawk
#

complete random is bad - controlled random is what you want in gameplay

young current
#

minimun of 10 + random 20

#

for example

plain urchin
#

yeah that makes sense

#

appreciated fellas

frigid raven
#

Sb. knows the command to deactivate a listbox ui control?

plain urchin
#

ctrlEnable

frigid raven
#

thx

plain urchin
#

πŸ‘

frigid raven
#

but does not work with listboxes it seems

cosmic lichen
#

@frigid raven it does

plain urchin
#

@frigid raven check the wiki for syntax and make sure you're using it correctly

heavy lichen
#

hi im looking for someone to teach sqf im a game developer and wanted to add another language to my belt

winter rose
heavy lichen
#

thank you

cosmic lichen
#

@winter rose Don't we have a Arma 3 related "getting started" page for scripting?

winter rose
#

we do!

frigid raven
#

is there something like {} forEach 5 where it iterates 5 times. range or somethinh?

winter rose
#

@frigid raven for yes

#
for "_i" from 1 to 5 do { systemChat str _i; };```
frigid raven
#

thx bud

gloomy basalt
#

I got a question, is there a way to reference all vehicles class names? Let's say for a spawn script and instead of manually writing all class names, I would use something like LandVehicles to get all ground vehicles?

winter rose
gloomy basalt
#

Ahh thanks, didn't think of that

winter rose
gloomy basalt
#

Awesome thanks, I think that would work with the idea I had in mind

gloomy basalt
#

@winter rose you wouldn't know if there was a way to get faction specific vehicles from that config would you?

winter rose
#

you would need to get the config "faction" value of the class

gloomy basalt
#

Alright, thanks again

winter rose
#

πŸ‘

exotic tinsel
#

How do i hide the list of players in a squad for squad leaders? the thing that runs across the bottom.

winter rose
#

@exotic tinsel I would try showHUD, or findDisplay 46 and find the subdisplay

#

Yup, showHUD 7th array item

exotic tinsel
#

@winter rose thank you so much mate

rare nebula
#

Anyone have any ideas on how to modify damage taken by AI while using ACE? In vanilla A3 I used to use "this addEventHandler ["HandleDamage",{damage (_this select 0)+((_this select 2)/15)}];" and it got the job done but it doesn't seem to work with ACE. Anyone know of a workaround?

plain urchin
#

i googled this and wasn't sure, but is it possible to add Structured Text to a listbox?

brave jungle
#

Could getMissionConfigValue https://community.bistudio.com/wiki/getMissionConfigValue be used to setup a virtual description.ext via default values? I've got a mission template tool but it currently requires players to have a description.ext to make virtual zeus work properly, i'm thinking I'd be able to just default the values and set it up for them?

winter rose
#

@brave jungle it's not a setMissionConfigValue so nope

#

(unless it is your custom Zeus, but I would need more details about your setup)

brave jungle
#

This is the function for the template tool

#

I wanna use the virtual entities as Zeus

#

and the tool to set everything up properly

#

however for them to work correctly, you need this in the description.ext:

respawnTemplates[] = {"MenuPosition","Tickets", "Spectator"};
respawnTemplatesVirtual[] = {};
winter rose
#

well you need to write the description.ext properly yes

#

Zeus cannot guess which data you want in your file, just write a proper description.ext

brave jungle
#

Well the whole aim of that tool is to not have mission makers use a description.ext πŸ˜„ They're alot of them don't know how to xD
Are there not variables I can set that deal with it?

#

I'm sure those attributes only guide scripts anyway

winter rose
#

engine-side scripts like respawns but yeah

hollow thistle
#

respawn templates are not engine side, they are normal functions/scripts.

#

the whole respawn is 'just" setPlayerRespawnTime 0 and move him somewhere (big simplification)

brave jungle
#

hmm

#

Not really sure what to do then

hollow thistle
#

respawn tempaltes can also be set in mission attributes

#

so it should be accesible via eden attribute commands

brave jungle
#

Not for Virtual Units

#

Only for normal respawn templates

winter rose
#

also doesn't it need a respawn= value?

#

again, settable via Eden attributes

brave jungle
#

Yeah

#

The tool is setting that atm

#

alongside the normal attributes

winter rose
#

sorry if I misguided you btw; I didn't grasp the full concept

crude needle
#
If (count _moveMkrArr > 0) then {
     {
          _movePoint = [_x,_grp] spawn fn_Move;
     } forEach _moveMkrArr;
};

Can anyone explain why _x is undefined in this case?

still forum
#

_moveMkrArr might contain undefined values

crude needle
#

That was it. Appreciate it.

velvet merlin
#

how does one create five lists via ctrlCreate to cover 20% width to work with any screen size and scaled font size - whats the best/most simple approach for it?

#

or how to display text in multiple lines/entries in five columns dynamically best (no interaction - just display)

analog inlet
#

is there a way to detect if someone is loosing connection? people are using it to abuse shops, etc.

velvet merlin
#

@analog inlet you could try to send a constant ping (pV "dummy") and if its not getting received you disable userinput/lock menus

analog inlet
#

forgive me, what is pV "dummy"

plain urchin
#

if the player needs to demine an area of mines, and if i have an array of mines called MissionSpawnedObjectsArray, and i want to do a waitUntil check to see when all the mines have been destroyed/demined, how should i do that? because when you explode/demine a mine, the entry in the array turns to objNull

#

i had something like this: waitUntil { sleep 10; (count (MissionSpawnedObjectsArray select {_x isEqualTo [objNull]} isEqualTo count MissionSpawnedObjectsArray )) }; but this causes an error and i know it's wrong, but idk what the correct condition would be

plain urchin
#

never mind i figured it out, waitUntil { sleep 10; {mineActive _x} count MissionSpawnedObjectsArray == 0};

exotic tinsel
#

im trying to add a condition to an addaction to only show when looking at a closed door. the action is on the player. im having trouble finding an example online. i have found plenty for adding the action to a door but not on a player. Can someone point me in the right direction?

mighty rain
#

@plain urchin you should look into triggers instead of waituntil, for performance improvements

#

@exotic tinsel you want the action to be available to every door in the mission ? basically you take a door example, replace all references to the door with player, then in the condition you check for cursorTarget being a closed door within distance. Should do the trick but will have a performance cost. If only a limited set of doors, you should get every door and repeat a classic example in a loop.

exotic tinsel
#

@mighty rain im not sure i understand. please explain further regarding this part of your reply "basically you take a door example"

mighty rain
#

You wrote you found a lot of example adding the addaction to the door. It is the intended way of using addactions (add action to objects which players shall interact with). If you only want some doors in you mission to have the action available, you addaction to them in a loop (similar to examples you found).

#

If you want the action to be available to any door for a given player, you can do it opposite way but that's not the intended way of using addactions add will hit the performance

winter rose
#

@mighty rain trigger < waitUntil + sleep

mighty rain
#

My world collapsed. BI has been doing something very wrong then ...

winter rose
#

Triggers check every 0.5s (hardcoded) ; with waitUntil + sleep you can check every 10s if you want

still forum
#

triggers also have overhead, because they try to grab all the units in trigger area and such

exotic tinsel
#

is there a better way to reveal friendly units on the map out side of view distance that doesn't require changing profile or using reveal command? im using this and its not producing the results i was hoping for.

while {true} do {
    
        { if (side _x isEqualTo west) then 
            {                
                player reveal [vehicle _x, 4];
            };
        } forEach allUnits;    
        sleep 0.3;    
};
plain current
#

if objectparent statement is not needed

#

vehicle _x will return just the player if the player is not in a vehicle

#

idk why you doing _x isKindOf 'man' because allUnits should only return men

#
while {true} do {
    
    {
        if (side _x isEqualTo west) then  {
            player reveal [vehicle _x, 4];
        };
    } forEach allUnits;    
    uiSleep 0.3;    
};
exotic tinsel
#

it was a copy paste job from a post i found.

plain current
#

also idk why you loop it every 0.3 seconds and instead of creating a new thread, i'd suggest using bis_fnc_loop

exotic tinsel
#

it doesnt solve the fact that reveal doesnt produce results im looking for. id like to see the units direction with out the flashing on the map. like when your in front of them and you see them move on the map flawlessly.

plain current
#

Oh, i'd just use the draw EH on the map

#

And draw the units like you would with a map esp

exotic tinsel
#

links?

#

im new to messing with the map via script

marble basalt
#

hey was wondering if anyone would know how to get an object to play a sound when hit by a projectile, having issues figuring out how

plain current
exotic tinsel
#

@plain current i will test now

#

@marble basalt if you have the sounds added properly to your mission then i would create an event handler for hit on the object and check if the projectile type is correct for playing sound.

plain current
#

@marble basalt you could give this a go

player addEventHandler ["Dammaged", {
    params ["_unit", "_selection", "_damage", "_hitIndex", "_hitPoint", "_shooter", "_projectile"];

    if (!isNull _projectile && !isNull _shooter) then {
        playSound3D ['roblox\oof.wav', player];
    };
}];
exotic tinsel
#

@plain current works good. ill tweak it for proper icons. thanks mate.

plain current
#

np mate

marble basalt
#

didnt seem to work im trying to set up a target that plays the firing drill sound when hit and yes i changed the name of the .wav

exotic tinsel
#

@plain current improved, what do you think?

findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw", "
    
    {
        private _sideColor = [side _x] call BIS_fnc_sideColor;
        private _vehicle = vehicle _x;
        if (player knowsAbout _vehicle < 3) then
        {            
            _this select 0 drawIcon [getText (configFile/'CfgVehicles'/typeOf _vehicle/'Icon'), _sideColor, getPosASLVisual _x, 24.0, 24.0, getDirVisual _x, '', 0, 0.04, 'TahomaB', 'right'];
        };        
    } foreach (allUnits select {side _x isEqualTo west});
"];
dull drum
#

Hi guys. Does anyone know how the RyanZombies actually attack? I can't get any info wih HandleDamage and Hit Event Handlers, the logs are just empty or filled with data from general shootouts between normal people as in: "HandleDamage: bf2 / head / bf1 / B_65x39_Caseless / 1.20173 / head curent damage is 0 diag health is 100" and "onHit: bf2 / bf1 / 1.01 / bf1"

#

I bet they set damage directly through player setdamage _n 😦

plain current
#

@exotic tinsel you could move the knowsAbout check into the select, but it doesn't really matter

exotic tinsel
#

@plain current so, how would i go about adding same to the gps?

plain current
#

You need to get the display and the control of the gps map

dull drum
#

How can I assign new class for a vehicle from Description.ext? If it's possible.

ivory lake
#

cant

dull drum
#

D'oh. Thanks.

exotic tinsel
#

@plain current on it. thx

dull drum
#

I'm trying to tweak a mod's .sqf file. Done, saved, restarted Arma. But still code is not changed (according to the ingame functions browser that doesn't show my code and diag logs outage). I bet I mess with wrong folder (!Workshop/@Modname) or it needs to be somehow repaked. Any advices on that? Thanks!

still forum
#

Yes you need to pack it back into the pbo if you want to edit the file in the pbo

dull drum
#

Oh, .pbo. I think I'm starting to understand lol

#

Thanks @still forum!

lofty rain
#

Hi guys! I've placed a house in the editor. Gave it few empty markers and synced those for a random location... Is there a way to detect nearest road and rotate my house at the same time? So I could place house the way that front door is pointing towards nearest road.

winter rose
dull drum
#

Houston, I got a strange problem.
player addEventListener ["HandleDamage", {0}] - no damage, can shoot myself with a rocket launcher and be healthy.
player addEventListener ["HandleDamage", {(_this select 0) setDamage 0;}] - close shots are tolerated, while 1 shot straight under legs == instakill.
What am I doing / understanding wrong?

winter rose
#

@dull drum the returned value is the "full damage" you should get. on the second example you are not overriding the damage system, you are just doing a setDamage when you get shot. the thing is you get damaged then healed, if it's an insta-kill, you're dead

#

also, addEventHandler* ^^

dull drum
#

Sry about that, got a mesup of coding languages in my head

winter rose
#

Javascript Hell πŸ˜›

dull drum
#

ja-ja
In code it's ok. But, how should I completely remove the damage still having EH available for my simpler Health model magic?

#

Put my custom logic to another EH? Like literally
player addEventHandler ["HandleDamage", {0}]; player addEventHandler ["HandleDamage", {// mystical stupid coding}]
?

#

Yeah, it actually did the job done. Still feel awkward about this.

ruby breach
#

how should I completely remove the damage still having EH available for my simpler Health model magic ```sqf
player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
_newDamage = "my simpler health model magic calculation of damage to be taken";
_newDamage
}];

#

Overrides whatever damage would have been taken, replaces with whatever you want the damage to be from 0 to 1

#

Bear in mind, that will run for each part of the body that takes damage

#

Also relevant, as of the last time I toyed with handleDamage, insta-kills are treated as >1 damage to "" hitPart

dull drum
#

yeah, I've already passed the shitgate of "", it was so much fun!

#

_newDamage, you... you just leave it here without any ; or function calls?

ruby breach
#

It's the return value

#

Whatever the return value in handleDamage is, will be applied as though it came from the damage source

#

It should be a number, and not a string, obviously. Having a semicolon or not shouldn't make a difference, but I'm fairly sure that it's just good practice to exclude it from return values

dull drum
#

I just amused of notation.

#

Thank you so much, @winter rose and @ruby breach !

winter rose
#

@ruby breach the "no semicolon for a return statement" is incorrect or has been for a long time now, at least Arma 1 if ever

ruby breach
#

Ahh. Good to know!

dull drum
#

Now I can have my semicolon! (while it still works without it though)

still forum
#

ACE/CBA standard is to leave semicolon away, as it's not needed and is used to signify a return value

winter rose
#

booo to them

tough abyss
#

Everyone knows that each simicolon gives you 0.0002ms speed boost, you just make your return slower for nothing!

exotic tinsel
#

having issue with the error no unit bug. our server requires players to go back to lobby to change role or squad. what am in doing wrong that allows this to keep happening. is there something i need to do on player disconnect to ensure all is well when they come back?

#

its breaking all my foreach for lists of players

spark turret
#

Hello, trying to get an AI to throw smoek, doesnt work. so far i ve tried:
_ unit forceWeaponFire ["SmokeShellMuzzle","SmokeShellMuzzle"];
[_unit, "SmokeShellMuzzle"] call BIS_fnc_fire;

#

any suggestions? the AI has a smoke grenade

scratch that, seems like the grenade from bw mod isnt recognized as smoke

coarse olive
#

Question, I need to add an action to an object to open a door that is locked, meaning that computer needs to be spliced to open the door

#

Figured I can do the enableSimulation deal for the door so it is no longer locked, then open said door

astral tendon
#

When was the "B_Patrol_Soldier_Pistol_F" added? it broke the check for the 4-five pistol that was "hgun_Pistol_heavy_01_F"

high marsh
#

Lol, like with any of those named classes it just has the preset loadout for that unit. I really doubt it changed any config name of the heavy pistol 1 class.

astral tendon
#

Its a diferent weapon, currentMuzzle checks that.

dull drum
#

Hi guys! How can one avoid being kicked by Steam when debugging a dedicated multiplayer with two test players with the same Steam account?

tough abyss
#

make sure doubleIdDetected is commented out

still forum
#

There is a localhost only setting/startparameter thing

#

Can't find it on the parameter wiki page πŸ€”

tough abyss
#

also add
loopback = true;

dull drum
#

I'll try all of that, thanks guys!

cosmic lichen
#

Is there a way to detect a line break with splitString?

#

Seems like linbreaks are ignored and leave an empty space.

still forum
#

what "empty space"?

#

depending on how you log it, linebreaks might simply not be displayed

#

for example debug console output shows line breaks as spaces

winter rose
#

hint it out

cosmic lichen
#

?

winter rose
#

(to be sure about the linebreak, as opposed to what Dedmen said)

cosmic lichen
#

It's a linebreak

tough abyss
#

You don’t detect with splitString

still forum
#

I guess noone here really understood the question ^^

winter rose
#

would \n not work?

tough abyss
#

If you want to split string on line breaks can try "\r\n"

#

Or toString [10,13]

#

Or endl

cosmic lichen
#

Gonna try that

#

Doesn't seem to work.

#

Just to make sure you get the issue. I am logging classes to the clipboard by _text = _text + tostring [13,10]+ tostring [13,10];

#

But now, when I want to covert it into an array with splitString ",; " it leaves an space infront of each classname " B_someClassName"

#

And before you ask, the logging function was not written by me, and I cannot modifiy it.

tough abyss
#

Why did you not add any if it to splitString?

cosmic lichen
#

Sorry

#

splitString (",; " + str endl)

#

That seems to work.

tough abyss
#

Are you sure they are spaces in front not line breaks?

cosmic lichen
#

I did it wrong the first time.

tough abyss
#

endl is string

spark turret
#

hello, looking for new methods to check arrays.
i have an array with multiple positions that each look kind of like that: ["MarkerAlpha1-5-6",[14300,1300,0],["AT","MG","MG"],8]

i want to check the if a certain position f.e. [14300,1300,0] is in the main array but

_value in _array

doesnt work as it seems to not be able to check in mulit level arrays
and

_array find _value

has the same problem, only compares exact values, not multi level array capable.
Any other way than to do a

{_value in _x select position }foreach _big array

?

cosmic lichen
#

ahyes

tough abyss
#

You add str string?

cosmic lichen
#

splitString (",; " + endl)

tough abyss
#

So it works?

cosmic lichen
#

yes

tough abyss
#

Have some β˜•

cosmic lichen
#

It's funny that the default log function in Eden editor will actually break the default attribute controls.

#

Thanks for you help πŸ˜ƒ

still forum
#

@spark turret findIf

spark turret
#

will check it out, thanks dedmen

dull drum
#

What is the best convenient way to execute functions to a number of players from server?
I've tried to use array of Variable Names from editor (example works just fine but looks clumsy)

_allPlayers = [bf1, bf2, bf3, bf4, opf1]; 
{
    
    _x remoteExec ["handleDamageFnc", 0, true];
    _x addMPEventHandler ["MPRespawn", {(_this select 0) remoteExec ["handleDamageFnc", 0, true]}];
    

} forEach _allPlayers;```

Tried playableUnits (doesn't work)
```java
_allPlayers  =  playableUnits; 

Tried BIS_fnc_listPlayers(doesn't work either)

_allPlayers  =  call BIS_fnc_listPlayers; 
#

Everything was executed from server.

still forum
#

remoteExec can take an array as target

#

what is "a number of players" ?

dull drum
#

All playable units.

still forum
#

well playableUnits should do that

#

it will also return non-human occupied AIs

dull drum
#

remoteExec can take an array as target
It's like forEach is not needed?

still forum
#

yes

#

not sure why you are using MPRespawn

#

MPRespawn fires globally

dull drum
#

To reset variables and handlers if unit was killed

still forum
#

you'll get dozens of remoteExec calls which all fire their code globally...

#

Yeah but why the MP variant?

#

Don't see any reason

#

just add a normal eventhandler, locally

dull drum
#

Well, I wanted all the crucial logic to run server side. This code controls the damage model, so I didn't want to give it to players.

#

Probably I just didn't get well with Biki on MPRespawn πŸ˜ƒ

still forum
#

You can have serverside respawn handleres too afaik

#

with MP eventhandlers you aren't running the logic serverside, you are running the logic everywhere

dull drum
#

I need a deeper understanding of the client-server things. I hope it will come in time with all the traps I continue to step into πŸ˜ƒ

#

Is it possible to override a mod's function with my code if I don't want to change other modders source code?

still forum
#

depends on the mod

#

the answer is generally "yes"

#

though with vastly varying difficulty

dull drum
#

It's zombies & demons, as far as I want zombies to participate in my damage model

#

I can see Ryan's functions through the viewer. I did modify the mod's code and it works just fine, but I want to have this part standalone from his .pbo

still forum
#

you can probably overwrite his CfgFunctions entry (if he's using that) and use that to redirect to your pbo

dull drum
#

Oh.

hollow thistle
#

if you see his functions in function viewer then as Dedmen said you can overwrite his config and change the path to compile your function instead.

ivory jetty
#

Quick question for you all, I'm having a brain fart - I'm using onPlayerKilled.sqf to check if every player on one side for a PvP scenario is dead. What's the best way to go about doing so?

winter rose
#

something like sqf allPlayers select { side _x == blufor && alive _x } isEqualTo []

#

if it's only PvP though

#

AI not included in this ^.

ivory jetty
#

It is, I've already discovered there's no way to track AI deaths reliably for a small-scale PvP op

winter rose
#

allUnits?

ivory jetty
#

Yeah, but then I need to figure out respawning them, and setting up behaviour... it's a lot of faff.

#

I assume in this case isEqualTo [] means 'equal to null'?

winter rose
#

means equal to empty array

#

allPlayers is an array, select applies a filter, isEqualTo [] says "is it empty"

ivory jetty
#

Ta

wispy cave
#

I'm running this on a headless client:

{_x addCuratorEditableObjects [mainAOUnits, true];} forEach allCurators;```
And for some reason the units aren't being added to zeus
winter rose
#

@wispy cave Server Only command.

wispy cave
#

oh yea, crap

ivory jetty
#

So the script I'm writing is a soft reset, which will be called at the end of every round (5 rounds to a game). Is it best to write it as a new script, or a function?

winter rose
#

both are ok; if you read a script make sure you load it in memory… as a function

ivory jetty
#

How would I do that?

winter rose
#

either sqf _fnc = compile preprocessFileLineNumbers "myScript.sqf"; or declaring it in CfgFunctions

ivory jetty
#

CfgFunction can be declared in description.ext, right?

ivory jetty
#

Ah, excellent. Thanks.

terse torrent
winter rose
#

not fully reliably as noted, but I would say fairly reliably

terse torrent
#

Alright, cheers. ❀

half monolith
#

hey. we are trying to solve what seems like a simple problem. i am using a respawn dialog with custom roles, and these roles are reflected in the arsenal with a save/load for each role.
the problem we are trying to tackle now, is adding the saved roles, to the respawn loadouts list in the respawn dialog. which is also working, the problem is, they are added upon click the actual role, and when click the role a second time, it adds the arsenal loadouts, again, and again.
i have nailed it down to doing a check in
BIS_RscRespawnControls_invMetadata to see if the loadout has already been added..

if !(_nameLoadout  in (uiNamespace getVariable ["BIS_RscRespawnControls_invMetadata",[]])) then
{
            
            
            systemchat str (BIS_fnc_saveInventory_data select _i);
            
            
            _pic= 'A3\ui_f\data\Map\VehicleIcons\iconParachute_ca.paa';
            _metadata = [[_RoleText,format['missionNamespace:%1', _nameLoadout], _pic],[format['missionNamespace:%1', _nameLoadout], _nameLoadout,[missionNamespace,_nameLoadout]]];
            
            
            ["set",_metadata] call BIS_fnc_showRespawnMenuInventoryMetadata;        
            };

but it doesnt seem to be doing the trick. i do have a short video showing the "problem" im not sure i can post it here though

spark turret
#

really basic question, how can i execute a script on every client ? so far ive always used init.sqf and then sorted by if !(isserver) exitwith etc.

#

remoteexec comes to mind, but dont know if applicable for scripts

half monolith
#

initPlayerLocal.sqf?

spark turret
#

i need to run in during the mission from a script running only on the server.

cold pebble
#

Yes, remoteExec with the target being -2

spark turret
#

and how would the remoteExec lΓΆook?

_unit execVM "IRON\Script.sqf"; 
//will become
[_unit, "IRON\script.sqf] remoteexec ["execVM", -2]

?

terse torrent
#

[_unit, "IRON\script.sqf"] remoteExec ["execVM", -2];
Only missed a ". Should work other than that.

spark turret
#

okay thanks will test

#

but i have to say, that looks to easy to work as intended πŸ˜„

terse torrent
#

🀞

torpid grail
#

The Deleted event isn't supposed to fire when a unit gets inside a vehicle right?

winter rose
#

unfortunately, it does @torpid grail

torpid grail
#

Fuck, I need to figure out a way to work around that then

#

But thank you

tough abyss
#

You have repro?

#

Or ticket link?

torpid grail
#

There doesn't seem to be a ticket for that yet, at least not one that I could find

#

And I can reproduce it reliably with the code I have right now. With the event handler added to me on the server and a HC, every time I enter the vehicle the deleted event fires

#

It also seems to trigger for AI, I just haven't checked if they are owned by the server or the HC

torpid grail
#

With this you can reproduce it:

{
   _x addEventHandler ["Deleted", {
      params ["_entity"];
      (format ["Entity deleted: %1", _entity]) remoteExec ["systemChat", 0];
    }
  ];
} forEach (allUnits + vehicles);

Steps:

  • Spawn in a dedicated server and run that on the server.
  • Spawn a car or whatever and get in it.
  • You'll see the message saying you were deleted appear after you get in the car.
still forum
#

I also had that with spawning units via zeus. They would spawn->ire delete EH->stay in world.
Really caused trouble in ace, we ended up just waiting a frame and checking if it's really gone now

spark turret
#

what would be the best function to get static objects/houses in a marker? i have use:

_houses = nearestObjects[getMarkerPos "marker_0",["House"],100];

but that uses a radius, i wanna use inAreaArray f.e.

 vehicles inAreaArray "mymarker" select {_x isKindOf "StaticWeapon"} ```
problem: i cant seem to find a function returning objects, like the
```sqf
vehicles allUnits```
etc functions but for static objects
limber rune
#

Hey can anyone help me I made a vehicle and I can get out of the vehicle but can't get in?

spark turret
#

might wanna check config editing ?

limber rune
#

ok

frigid raven
#

Running a mod on a server for the first time this appears:

 Item str_coopr_task_recon_title listed twice

is this something to take care of? It's the stringtable.xml loaded twice by client and server right?

winter rose
#

no it's the key str_* that is translated twice in the same file

#

@frigid raven

frigid raven
#

ah ok thanks

rancid ruin
#

is there any way to see if an object is in sunlight or shade?

winter rose
#

nope, beside calculating shadow of other objects around with sun position but that would be hell of a pain

rancid ruin
#

is there a way to get the sun's position with a script?

winter rose
#

I thought there was, but it seems not.

rancid ruin
#

i was just thinking about making a little script for solar panels

#

but i guess there's no way to do it easily

#

or maybe even do it at all

exotic flax
#

And perhaps there are some functions to get the forecast, and make a calculation yourself

tough abyss
#

@torpid grail @still forum @winter rose noted thanks

winter rose
#

^ this command is only for sun to moon transition, 8am or 5pm will be 1 @exotic flax

exotic flax
#

Well, at least you'll know it's not night 🀣
And functions like overcast can be used to make a decent script

winter rose
#

I don't know why, but I was convinced a command to get the current astral object (sun or moon) position was added back in A1 πŸ€”

exotic flax
winter rose
#

maybe something for @still forum to introduce ^^

cosmic lichen
#

I believe there was a script published which does exactly that. Did you google that?

exotic flax
#

that link contains the script πŸ˜‰ which is in C++

cosmic lichen
#

Nope, I meant an sqf solution.

#

Might be wrong though.

astral tendon
#

Im trying to create a vehicle spawner area, how can I check if the place is clear of objects and players before allow to spawn a vehicle?

still forum
#

w have sunOrMoon which once returned their position, but was recently changed to just flip between 0 and 1 -.-
Before that it returned 1 at noon and then gradually reduced -.-

muted ember
#

How would I pass a selected object on to the rest of a function?

For context, let’s say I have an array of objects: _stuff = [t1, t2, t3];

Which is followed by: _stuff spawn fn_delete;

Current fn_delete:

{
If ((count _this > 1)) then 
{ 
deleteVehicle (_this deleteAt floor random count _this);
uiSleep 5;
_this spawn fn_delete;
};};```

My goal instead of just randomly deleteVehicle’ing the object, I’d like it to first select one of the objects (figured BIS_fnc_selectRandom or something like it in the function), pass the selection on to then attachTo an arrow to that object, and finally after a delay delete both object and arrow. Then repeat the process until 1 is left.
still forum
#

_vehicle = selectRandom _this

then createSimpleObject or createVehicle the arrow, attach it, sleep, delete, next.

cosmic lichen
#

How can I add to links to a structured text control ? Can either be <a href='https://community.bistudio.com/wiki/BIS_fnc_textTiles'>BIS_fnc_textTiles</a>, or <a href'https://community.bistudio.com/wiki/BIS_fnc_textTiles'>BIS_fnc_EXP_camp_SITREP</a>. Doesn't seem to work. The first link is showing fine, the second not.

still forum
#

the second one is clearly missing the = after the href

#

and also the link doesn't point to what the name says

cosmic lichen
#

🀦 Need a coffee. Thanks

muted ember
#

Thanks, @still forum! I think I got it working, however a question extension to your solution. Does selectRandom exclude deleted objects of an array? Or how would I selectRandom from only remaining objects?

still forum
#

selectRandom selects a random object of the array

#

if there are deleted vehicles in there will be objNull in there, which selectRandom will also select

#

you need to remove the object from the array too

muted ember
#

Okay, that makes sense. I’ll have to devise a solution for that later. Appreciate the knowledge passing.

wispy cave
#

If I set the owner of an unit created by a zeus to a headless client will this HC then do all the calculations for this unit?

still forum
#

yes

wispy cave
#

tnx

tough abyss
#

groupOwner or just owner?

wispy cave
#

By _obj setOwner (owner HC1) in an CuratorObjectPlaced EH

tough abyss
#

check your rpt it should complain about not using setgroupowner

wispy cave
#

I haven't done it yet so it's not going to yet πŸ˜ƒ

still forum
#

calculations are done where unit is local. Unit is local on it's "owner"

winter rose
#

How does one open the debug console in Eden Editor with CBA? as the key got changed

#

ah, Ctrl+D.

tough abyss
#

It is not `?

winter rose
#

not with CBA

tough abyss
#

Do you already know how to make GUI without pixel grid system?

unborn ether
#

2019 - people fully bypassing BE for 15$

#

πŸ‘ wonderful.

tough abyss
#

It is $15 + the cost of new game

#

Earlier or later BE will catch with exploit, then ban wave then new exploit etc etc

queen junco
#

Hey, I am currently trying to create an Arma faction as a mod. So basically just readjusting loadouts. I am not that used to scripting though and I am not sure were to put the CfgPatches and the Full Faction script I extracted from the Orbat creator. Could anyone help me out`

still forum
tough abyss
#

Good point. Livonia will be another one

rancid pecan
#

this civ,cop,med ? and sec or min or hours ?

tough abyss
#

who knows

young current
#

@rancid pecan your question makes no sense. Try again.

velvet merlin
#

whats was the way to turn a variable name into a string again? this format call compile hackery?

astral tendon
#

Question: why bother make a function for a script if you can just writhe the hole thing in one file and call/spawn it since functions have some extras steps like define it and make .hpp files.

tough abyss
#

@velvet merlin variable name is string, you have to be more specific what you wanna do

velvet merlin
#

want to i++ a GV

tough abyss
#

Because A. You don’t have to compile it every time you wanna call it B. Function variable is final and cannot be overwritten C. It is available everywhere and everywhen

velvet merlin
#

missionNamespace setVariable [str _index,_index];

tough abyss
#

Which namespace it belongs to?

velvet merlin
#

this obviously doesnt work - a function should dynamically count up a GV passed to it

astral tendon
#

compile it every time?

tough abyss
#

Why it doesn’t work? Looks legit variable 10 will be 10

#

Yes, you cannot call or spawn text file you can call or spawn code therefore you need to compile the text @astral tendon

ivory lake
#

yeah there's absolutely no advantage to using execVm etc, except if you just want to run something once and never again

#

inwhich case it's 'easier' for you to setup

astral tendon
#

Like

sayHi = {systemchat "hi"};
call sayHi;

To make something like this as a function is time consuming, so why just not use that?

tough abyss
#

This is not what you asked, there is no file here, you define function in code. You still have 2 problems, security and availability

astral tendon
#

Lets say if I drop that at initplayer.sqf and make a action to use the call sayHi, why should I worrie about security and availability since is intended to local players?

tough abyss
#

Because someone can just pubvar malicious code and overwrite your unprotected variable and when you use your action someone else’s code will run

astral tendon
#

How they can even do that? and what if I need to change that variable later in mission?

tough abyss
#

I told you how, pubvar new value for this variable. You might not even be able to change it later if they finalise it, which I am more than sure they would

astral tendon
#

What about performance?

tough abyss
#

What about it?

astral tendon
#

Is it better make it a function or just as a simple scriptΒ°

cosmic lichen
#

function

tough abyss
#

I don’t know what simple script is, function could also be simple script. If you are planning to use own file and compile it every time you call it like you said originally, with script caching now removed probably for good you will be adding extra times to your execution.

cosmic lichen
#

I'd avoid execVM except for quick testing.

tough abyss
#

Functions added via function library have small overhead added by default, which you can opt out of when you define them in config

astral tendon
#

simple script is make it all in one file while function requires a extra step, I need to define in description.ext, make a .hpp file, then make a file for that script.

tough abyss
#

Functions are for when you want reusable code, hence it makes sense to invest in building own library of subroutines. You probably don’t even need a function by the looks of it

astral tendon
#

why not just call it normally as I already defined the variable with the code in it?

velvet merlin
#

how can one wreck init_functions with cfgFunctions definitions?

Error in expression <",_x] call bis_fnc_logFormat;
_function = [] call (uinamespace getvariable _x);
>
  Error position: <= [] call (uinamespace getvariable _x);
  Error Generic error in expression
File A3\functions_f\initFunctions.sqf, line 499```
tough abyss
#

Why even bother defining variable if you can just call code directly

astral tendon
#

Lets say its a pack with allot of codes in it?

cosmic lichen
#

If it's alot of code, split it into different functions and use the functions library. Makes finding errors much easier later on.

#

But honestly, without an example what "alot of code" is to you, it's kinda hard to judge

tough abyss
#

You can call a lot of code directly

astral tendon
#

Thats the thing, im used to make codes in single file instead of make functions of it since it requires extra steps for the same result.

tough abyss
#

Anyway I gave you all the good reasons for using function library already. Take it or leave it I couldn’t careless

astral tendon
#

Sure, thanks for the help.

tough abyss
#

@velvet merlin preinit?

velvet merlin
#

i am using preStart and preInit (was necessary to get it working in the main menu)

#

for some reason its breaking though if i am changing some things - cant tell the relation yet

tough abyss
#

Have you altered initFunctions in any way?

#

Why result of calling a function is assigned to _function?

#

Is this a vanilla code? Looks suspect

velvet merlin
tough abyss
#

I suggest you use headerType -1 only for functions you need to call each frame, otherwise you remove useful debug information

#

Why not add all those functions to library they will be defined even before preinit

velvet merlin
#

the functions werent the prob, but to execute something to run in the main menu

still forum
#

@velvet merlin there is no way to get the variable name from a variable. Because a variable value might have tens of thousands of different names, the magical game engine that reads your mind doesn't know what to choose.
At the point where a variable enters a script command, the command doesn't know the variable name, which is why you need to pass a string to params and such.

And you cannot pass a variable to a script even. You pass it's VALUE, but not the variable itself

velvet merlin
#

ty

#

Kerc also suggested to pass as string and then use getVar on missionNamespace

#

wasnt quite sure as someone recently said in sqf land all is by reference in some sense

still forum
#

yep it is

#

and yeah passing as string is the correct way

#

You could do it if we had a "increment" script command, but I already talked about the terrible outcome that would cause.. would essentially break everything

tough abyss
#

there is no way to get the variable name from a variable.
Thought kju asked how to turn variable name into string

still forum
#

yeah I assume he meant how to turn varName into "varName" which you can't really

#

maybe that would be a useful script command for some πŸ€” though... No.. you write the name down in the script manually anyway πŸ€”

#

Might be useful for people who don't know that quotation marks exist

tough abyss
#

variableVarName

#

Though I dont see any use for it

#

bad design requires weird commands

still forum
#

It's just so that people who can't think beyond 2 corners can type variableVarName myVar instead of "myVar"
Just like the people who write call compile "myVar" instead of getVariable

tough abyss
#

My favourite is if (true) exitWith {} at the end of the script

#

this shold be a command

#

nowLetsWasteSomeShit

#

optional number param to define how many iterations you want

#

nowLetsWasteSomeShit 10;

ivory lake
#

scriptOptimizer 10;

tough abyss
#

Un-Optimiser?

#

In Arma 3 _var = 10/0; gives an error or is just infinite?

still forum
#

error

tough abyss
#

thanks

tough abyss
#

This code is giving an zero division error in _forCount mod _stepOpenBRPVP_createWallAround = { _angleStep = 360/_wallCount; _stepOpen = _wallCount/2; _forCount = 0; _ignore = 0; for "_a" from 0 to (360+_angleStep/2) step _angleStep do { if !(**_forCount mod _stepOpen** < _opensSize) then { (...)this means _stepOpen is zero... and if _stepOpen is zero then _wallCount in _stepOpen = _wallCount/2; should be zero. And if _wallCount is zero the line _angleStep = 360/_wallCount;must have give the error first, but it did not.

#

@still forum above, the line _angleStep = 360/_wallCount; is not suposed to give an error?

still forum
#

"this means" "and if" "then" "and maybe" "or this"
Add logging. And CHECK.

tough abyss
#

@still forum the problem is the error happens one time a week.

#

no problem

#

i will add logs and wait

#

the code is more complex

#

i just simplified it

#

and when the problem happens, log increase and eat all HD

#

but it did not
how do you know?

#

Do you have rpt?

#

@tough abyss yes i have the RPT

#

this is the error:

#
if !(_forCount mod _stepOpen < _opensSize) then {
_posP>
 0:00:49   Error position: <mod _stepOpen < _opensSize) then {
_posP>
 0:00:49   Error Zero divisor
 0:00:49 File mpmissions\__cur_mp.altis\server_code\servidor_funcoes.sqf, line 294
#

and before that?

#

i have just this error

#

repeated over and over

#

until the rpt reachs 22 GB and crash the server

#

it must have errored before it started repeating

#

and obviously it will repeat over and over if step is 0

#

it is infinite loop

#

yes

lost copper
tough abyss
#

then look at the very top of the file

#

where it first happened

#

i got the first error

#

how do you make step infinite?

astral tendon
#

Were are the saves for the GUI editor?

tough abyss
#

_angleStep is 360/_wallCount; it can't be zero.

astral tendon
#

I don't know the name I saved for some

lost copper
#

@tough abyss make all values in this functions visible for you. Add _wallCount, _angleStep, _stepOpen and so on in RPT by diag_log command. So you can see what value is wrong and broke your script

tough abyss
#

@lost copper @tough abyss thanks. I will add logs and wait for the error again.

#

It not happens allways.

lost copper
#

That's a normal. Sometimes one of your value is out of range.

tough abyss
#

_angleStep is 360/_wallCount; it can't be zero.
It can and it is

#

What is a possible value of _wallCount to make _angleStep zero?

#

0

#

This should give an error then, and there is no error related to that.

#

I am pretty sure there is error you just cant see it

#

_var = 360/0 makes _var equal to 0?

winter rose
#

nope, it throws an error @tough abyss

tough abyss
#

so....

winter rose
#

only if you have -ShowScriptErrors flag of course

tough abyss
#

in the command line?

#

_var = 360/0 makes _var equal to 0?

yes it returns 0

winter rose
#

Dang!

tough abyss
#

I found the problem

#

Thanks for the help

winter rose
#

error + zero yes

#

More like a warning then ; unless it stops the script afterwards…

cold pebble
#

If I wanted to create a camera which people can place, and then use to look around with (kinda like Valkyrie camera from R6 Siege), would I be best using camSetDir with bound keys, or is there a nicer way to do it?

winter rose
#

camCommand "on" maybe @cold pebble

cold pebble
#

manual on you thinking?

winter rose
#

it would allow it to be moved around with WASD though; think about it too (like loop-placing it maybe)

#

else I don't like maths enough to tell you how to play with camPrepareDir/camPrepareBank etc.

cold pebble
#

hmm, i'm just wanting it to be able to turn with WASD, rather then move

#

or

#

turn with mouse would make more sense lol

winter rose
#

this ^ would happen yes

cold pebble
#

Looking at the note on the page

_camera = "CamCurator" camCreate [0,0,0];
_camera camCommand "maxPitch 89";
_camera camCommand "minPitch -89";
_camera camCommand "speedDefault 0.1";
_camera camCommand "speedMax 2";
_camera camCommand "ceilingHeight 5000";
_camera camCommand "atl off";
_camera camCommand "surfaceSpeed off";
winter rose
#

If you loop-place it it's a "not clean" yet valid solution

cold pebble
#

Maybe I can use this, but make speedDefault and speedMax 0?

winter rose
#

Ah, yes!

#

Good finding, I didn't know about this one

cold pebble
#

And hope no BIS Wizardry ruins my plan πŸ˜›

#

I'll give it a go with that when I can

winter rose
#

Let me know the outcome plz!

cold pebble
#

Cheers for direction to camCommand, would've probably missed it

#

Changing speed values to 0 stopped it from moving, but no rotation currently, trying to sort that

#

Was using

private _camera = "CamCurator" camCreate ((getPosATL player) vectorAdd [0,0,5]);
_camera cameraEffect ["internal","back"];
_camera camCommand "maxPitch 89";
_camera camCommand "minPitch -89";
_camera camCommand "speedDefault 0";
_camera camCommand "speedMax 0";
cold pebble
#
private _camera = "CamCurator" camCreate ((getPosATL player) vectorAdd [0,0,10]);
_camera cameraEffect ["internal","back"];
_camera camCommand "speedDefault 0";
_camera camCommand "speedMax 0";

This produces what I want @winter rose

winter rose
#

Thank you for the feedback!

#

"funny" how min/maxPitch are effing it up

spice axle
#

what happens if a checked value returns true in two cases of a switch structure?

winter rose
#

@spice axle only the first encountered one is used

cold pebble
#

That’s the wizardry I was worried about Lou πŸ˜‚

winter rose
#

Β―_(ツ)_/Β―

tough abyss
#

Hi Bob!

astral tendon
#

why is createSimpleObject giving me error about 3 elements provided since wiki cleary says that I can put 3?

spark turret
#

need an expert opinion on locally created particales. Im using a heavily modified version of goon dust script which creates a dust cloud ring locally on every client 800m radius around each player, restricting their view on distant stuff. i modified it to create 3 rings in 400,800 and 1200 m so if you re on a mountain cant look above the edge of your ring. Problem is, if you zoom in with right click or scopes the alpha of the particle seems to be 90% ignored. Any way to fix that (besides diable zooming)? kinda pointless to have a sandstorm you can zoom through. Pictures for comparison:

spice axle
#

is there a better way for a 50/50 random then

switch (floor random 1) do {
    case (0): {
        //code
    };
    case (1): {
         //code
    };
};
astral tendon
#
String = str ["stuff",1];
String; //returns  "[""stuff"",1]"

why is "stuff" doubled stringed?

winter rose
#

@astral tendon to escape the quotes
if you hint it, it will display just fine

#

@spice axle sqf if (selectRandom [true, false]) then // or if (random 100 > 50) then // or if ([true, false] select random 1]) then

astral tendon
#

Im trying to use select and the double string keeps

winter rose
#

@astral tendon show usage plz

spice axle
#

why is "stuff" doubled stringed?
because that is how str of a string works. String in a string have to be double quoted

#

Lou thanks

astral tendon
#
{
    _displayName = getText (configFile >>  "CfgVehicles" >> _x >> "displayName");
    _vehicleClass = _x;
    _price = (((_VehiclePrices select {(_x select 0) == _vehicleClass}) select 0) select 1);
    _priceTXT = str (((_VehiclePrices select {(_x select 0) == _vehicleClass}) select 0) select 1);
    _indexLB = _VehicleSelectionMenu lbAdd (_displayName+" ("+_priceTXT)+")";
    _data = str ([_vehicleClass,_price]);
    _VehicleSelectionMenu lbSetData [_indexLB, _data];
} foreach _VehicleList;
RTG_vehicleBuy_VehicleSelected = ((lbData [1500, (lbCurSel 1500)]) select 0);
RTG_vehicleBuy_VehicleSelected ; //will retrun ""LIB_UK_Willys_MB_M1919""
astral tendon
#

Any ideas?

ivory lake
#

cuz the classname is already a string

#

and you put str infront of it

astral tendon
#

Yes and I need that string.

tough abyss
#

This code run on clients and may be not logical in some aspect, but it represent the problem i'm havingsqf player addEventHandler ["Respawn",{ params ["_unit","_corpse"]; _unit spawn { [_this,true] remoteExecCall ["hideObjectGlobal",2]; }; }];when the player respawn, i hide the new player object (_unit), but sometimes the old player object, the corpse (_corpse) also get hidden. This is a strange behavior. Any way to fix that?

#

May be the server still don't have the corpse object when the hideObjectGlobal arrives on it so when it creates the corpse it is from a hidden _unit?

plain current
#

since u already have a spawn in there, just uisleep a second or so and see if that fixes it

velvet merlin
#

whats the most simple way to show some information persistent in the main interface these days?

#

are there some functions from BI, or do you have to ctrlCreate it yourself?

still forum
#

@astral tendon lbData returns a string, you are doing select 0 on a string. It looks like you're thinking it will be an array but it isn't.
parseSimpleArray will turn it into an array

plain current
#

@velvet merlin what do you mean show some information persistent in the main interface?

velvet merlin
#

think of user action menu duplication that doesnt disappear

#

seems ctrlSetPosition needs safezone or pixel grid system, right?

cosmic lichen
#

ctrlSetPosition needs an array with numbers, whether or not it's a pixel precise position or a safezone depends on the situation.

velvet merlin
#

what situation?

cosmic lichen
#

Pixel precision makes only sense if you want multiple controls to be aligned perfectly. Like in Eden editor.

#

On the other hand, safezone should always be used to guarantee that the control doesn't leave the screen space.

#

You are talking about the main menu right? I believe that uses GUI_GRID macros.

velvet merlin
#

so far i used the A2 style safezone with percentage design, and getResolution to scale the texts

cosmic lichen
#

Which should be fine in most cases.

velvet merlin
#

but ive done my dialogs statically and not scripted (for the most part)

#

for ease of creation, ie some test/demo missions, i am looking into ctrlCreate and fully scripting them, but seems not convenient to work with

#

so probably gonna use advanced hints and FM instead

cosmic lichen
#

I also usually don't script my dialogs, too.

plain current
#

Just use the gui editor

#

I very rarely touch the safezones/grid positions in the .hpp files, no point, just use the gui editor

cosmic lichen
#

When wo rking with safezones only, it's quite nice, that's true.

plain current
#

I use "static"/"hpp" dialogs instead of ctrlCreate, cuz of security. I've dabbed ctrlCreate into cfgDisabledCommands and scripts.txt filters, stops some hack menus

#

Also stops most people from putting porn on streamers' screens

tough abyss
#

You are running you servers without BattlEye? Putting porn will require remote execution, if they can do that you are already screwed

plain current
#

@tough abyss well yes but actually no

#

@tough abyss you just need to run infi "anti-hack"

tough abyss
#

Lmao πŸ˜‚ good luck with that my naive friend, and please don’t tag me with every reply

plain current
#

@tough abyss Sure, stay in ur bubble, and DO NOT have a look at infi's allowedHTMLLoadURIs or your little bubble might burst XD!

tough abyss
#

That’s a server option. Now I have to block you, congrats

plain current
#

Oh no!

winter rose
#

@tough abyss @plain current be nice to each others
anyway this is not a server admin channel (#server_admins is)
and I am not sure but infistar may not need BE to be disabled, so why not use both.

On this, back to scripting!

plain current
#

@winter rose you can run infi and battleye, it's just infi writes scripts/confs that are slightly sloppy and allow you to remote exec and dab any images on every players screens. Sserver/scripting security related topics supposed to be on #server_admins ?

winter rose
plain current
#

10-4 on that, a server/mp security channel would be useful

winter rose
#

Make no mistake though, I am not a moderator. Just a long-time user of this Discord, who wishes everything goes well

cosmic lichen
#

Is there a way to add structured text to a control button via scripting so it opens a website?

#

_ctrlBiki ctrlSetStructuredText parseText format ["<a href='https://community.bistudio.com/wiki/%1'>Show on Biki</a>",_fncName]; Is what I tried.

#

The text is set, but nothing happens when I click the button. It works with a structured text control though.

spark turret
#

is there a way to get what exactly an AI knows about an enemy unit besides the abstract "knowsAbout" value?
using targetsquery atm but that tends to be performance heavy and a bit wierd sometimes.
any function like "_unit knowsAboutInformation _target" //returns [nameoftarget, assumedPos, weapons, side, vector, danger]?

dull drum
#

Hi guys, is there any way to check if the Curator interface is on? Something like a specific display number or something?

ivory lake
#

Is there a way to check if a player has the action menu open? not afraid of hacky solutions

ornate sky
#

what's a good way to "wait until OBJ is fully initialized"

tough abyss
#

@plain current thanks for the idea.

plain current
#

@ornate sky i'm not sure but you could just sleep a second or try something like waitUntil {netId _object != '0:0'} or waitUntil {!isNull objectFromNetId (netId _object)}

#

I haven't tested those and I don't know if they work, but i'd assume a netid gets assigned after the object is available on the network? no clue tbh

ornate sky
#

I don't know is there's a isInit or something

plain current
#

doesn't look like there is

ornate sky
#

So far I was using the if isServer then setobjecttexture

#

remoteExec on every machine

#

So I'm looking for a more elegant way

#

Of using loose mission specific textures

plain current
#

create the vehicle on the server and setobjecttextureglobal on the server?

#

are you using the init eventhandler?

ornate sky
#

I need it for preplaced units

#

Might attach a init eh, not a bad idea

plain current
#

no no

#

it specifically says on wiki

#

setobjecttextureglobal might fail if ran from the init eh

#

If setObjectTextureGlobal is executed from init of a vehicle, it may be too soon and fail to broadcast to other vehicle instances on network and become JIP compatible. The workaround is to delay setting the texture until after the vehicle is fully initialised

tough abyss
#

@ornate sky do it on the next frame

ornate sky
#

Yes, that's the reason for my asking how to wait for full init

plain current
#

what it says on the wiki is you need to only worry about it if your callingsetObjectTextureGlobal from the init eh

ornate sky
#

@tough abyss what can I use for that? Preferably in init field

#

Yea @plain current i thought you were refering to something else

tough abyss
#

Spawn

ornate sky
#

I'll give it a try

plain current
#

How many objects are you looking to do this on and what are those objects?

ornate sky
#

So far I've been using remoteExec of local command

#

I have groups of units that need to use my custom texture that's in the mission folder

#

Packing into a mod is not an option, they need to be throw away

#

I already have it working, I'm just trying to see if I can use setObjectTextureGlobal in init for this

#

Instead of remoteExec of setobjecttexture

plain current
#

sure, just put the setObjectTextureGlobal into a function and spawn it or something, tho i've never had an issue with setObjectTextureGlobal in init tbh and i've got 117 of those in my mission

tough abyss
#

I already have it working, I'm just trying to see if I can use setObjectTextureGlobal in init for this
yes you can just use setObjectTexture then you dont have to worry about that note on WIKI

ornate sky
#

I know, just looking for a nicer, shorter script

#

Thanks for the help, I'll try spawn

#

Spawn seems to be the way to go on a dedi server

plain current
#

I've got 117 of these in my mission.sqm and i've never had issues with +100 players on a JIP mission

class CustomAttributes
{
    class Attribute0
    {
        property="ObjectTextureCustom0";
        expression="_this setObjectTextureGlobal [0,_value]";
        class Value
        {
            class data
            {
                class type
                {
                    type[]=
                    {
                        "STRING"
                    };
                };
                value="Core\sign.paa";
            };
        };
    };
};
#

idk what the wiki is on about but i've never personally had a problem on any servers

ornate sky
#

Hmm, I had

plain current
#

Could be because you're loading the texture from the mission? Mine is in a mod

ornate sky
#

Probably

plain current
#

You could just do _this spawn {_this setObjectTextureGlobal [0,'sometexture.paa']}; and the scheduler should execute it on the next frame

ornate sky
#

This might do redundant commands because init happens on every machine

#

If I understand correctly

#

Anyway, I think I got it covered now

slim oyster
#

Has anyone made an 3den attribute listbox that populates from an allmissionobjects select method?

eager mesa
#

I have an event handler that is added to a vehicle. That EH is fired when the vehicle is damaged, and a function is called when the vehicle's damage is 1. Once the function is called the EH should be destroyed to prevent it being repeated. The problem is, the function is called 15 times.

_vehicle = vehicle player;
 RR_airCombatEHIndex = (vehicle player) addEventHandler ["Dammaged", {  
   if (!((_this select 2) < 1)) then {  
  [_vehicle] call RR_fnc_airCombatVehicleReturn;  
   _vehicle removeEventHandler ["Dammaged",RR_airCombatEHIndex]; 
   };  
 }]; 
#

So the issue is with the removeEventHandler command, however I can't figure out why

ruby breach
#

Likely the result of the EVH firing multiple times for multiple hitParts (my first guess anyway)

eager mesa
#

I'm crashing a jet into the ground

#

_vehicle being the jet

#

Fixed it

#

I declared _vehicle inside the scope as (_this select 0), which is the unit, and it seemed to work

ruby breach
#
(vehicle player) addEventHandler ["Dammaged", {  
  params ["_unit", "_selection", "_damage", "_hitIndex", "_hitPoint", "_shooter", "_projectile"];
diag_log format["Unit: %1 - Selection: %2 - HitIndex: %3 - HitPoint: %4 - Damage: %5",_unit,_selection,_hitIndex,_hitPoint,_damage];
  [_unit] call RR_fnc_airCombatVehicleReturn;  
   _unit removeEventHandler ["Dammaged",RR_airCombatEHIndex]; 
   };  
 }];``` try that and see what it logs. Also doubt that your `_vehicle` variable exists in the scope of the EH
eager mesa
#

cheers for the help anyway

spark turret
#

also what kind of function are you calling? "RR_fnc_airCombatVehicleReturn"?

#

@eager mesa are you aware that EH need to be added to every client locally otherwise they wont fire?

eager mesa
#

it's added to a vehicle when they enter a trigger

#

the function is then called on the player, does various checks before remoteExecing another function on a headless client

plain current
#

May i ask why so many people are running headless clients?

winter rose
#

to free some server resources? that's what they are for

cosmic lichen
#

@slim oyster Has anyone made an 3den attribute listbox that populates from an allmissionobjects select method? What's the issue?

gloomy basalt
#

I have a question, if I were to have a vehicle spawn on a helipad, how would I go about doing so? I've tried getPos "VARIABLENAMEOFTHEHELIPAD"; but that didn't work

cosmic lichen
#

Is the helipad an editor placed object or map object?

gloomy basalt
#

Editor placed

#

Hence why I tried the variable name of the helipad

cosmic lichen
#

Try it without quotes " "

gloomy basalt
#

Did, didn't seem to work much either

cosmic lichen
#

Are you trying that inside Eden Editor?

gloomy basalt
#

No, the helipad has the variable name "helipad", everything else is in the SQF file

cosmic lichen
#

That didn't answer my question. Are you executing that script during preview or from within Eden interface?

#

Because variable names do not exist in Eden Editor

gloomy basalt
#

Multiplayer previeww

cosmic lichen
#

I see.

#

Checked the variable name?

#

Anything in the log file?

gloomy basalt
#

It tells me it's expecting an object

tough abyss
#

so unsafeCVL=0; also seems to block creation of "#lightpoint" objects?
It has not been removed???

cosmic lichen
#

@gloomy basalt It does. Seems you variable name is incorrect.

gloomy basalt
#

Yeah, I fixed that, now the getpos works. But when I try to createVehicle on that position, it doesn't show. No errors

tough abyss
#

How are you creating vehicle

cosmic lichen
#

πŸ‘†

gloomy basalt
#

?

cosmic lichen
#

Last parameter has to be "NONE" or anything else I believe

#

"" is not valid

tough abyss
#

Never seen anyone use β€œβ€ for placement

cosmic lichen
#

Weird it fails silently

gloomy basalt
#

0 is the placement

#

"" is the special

tough abyss
#

Why don’t you check wiki?

#

Seriously? You gonna argue semantics?

cosmic lichen
#

special: String - "NONE", "FLY", "FORM", "CAN_COLLIDE". "CAN_COLLIDE" creates the vehicle exactly where asked, not checking if others objects can cross its 3D model.

#

There is no " " in there πŸ˜ƒ

gloomy basalt
#

createVehicle ["B_Heli_Transport_01_F", _position, [], 0, "NONE"];

This does't spawn it either

tough abyss
#

It is still a placement param and since it looks like you seen wiki you should know what are acceptable values and not just put anything you want there

#

Then your position is invalid or not where you think it is. The only way to find out is check what create vehicle returns

cosmic lichen
#

"B_Heli_Transport_01_F" createVehicle _position

#

that's faster anyway.

#

if " " is used as placement parameter it seems to automatically revert back to CAN_COLLIDE

#

The whole parameter is actually optional as it seems.

tough abyss
#

It is enum and there should be enum error if value does not exist, however the command is ancient so anything could happen

cosmic lichen
#

I thought so too, expected the same behaviour as with unit disableAI "TEST"

#

Maybe worth a report?

tough abyss
#

I need to have a look first, if some default value is assigned then it is a different story and has to be documented so you can make a note on wiki channel so I don’t forget to check it tomo

cosmic lichen
#

I already checked it and updated the description πŸ˜ƒ

tough abyss
#

Ok

exotic flax
#

Q: I would like to place multiple objects at the same height, but at uneven terrain.
Currently I use something like this:

_tempHeight = _aslHeight - 8.5; // modify height
_newPos = ASLToATL [(_markerPos select 0), (_markerPos select 1), _tempHeight ]; // create new position with updated height, and place back to ATL (relative to terrain)

However sometimes the height is not the same, and/or the position (x,y) has a small offset.

Is there something I'm doing wrong, or is there some engine quirck I'm not taking in account?

tough abyss
#

Well your _height is undefined so no idea how this even works

exotic flax
#

that was a typo in the example (since my script is a bit too long to post here)

#

but edited the example

winter rose
#

@exotic flax all the same ASL altitude regardless of the terrain or all the same above the ground?

exotic flax
#

the same ASL altitude

#

I'm placing runway navigation lights (Land_NavigLight), which should all be placed at the same level (regardless of terrain)

winter rose
#

get one ASL altitude (getTerrainHeightASL _markerPos),- 8.5, setPosASL objects, profit?

#

no need to go back to ATL

exotic flax
#

Using setPosASL seems to fix the height issue, but it still has x,y offsets at certain locations. However this seems to be a different issue, and related to getPos (with [distance, heading] to get new relative position)

winter rose
#

@exotic flax if it's a runway, it is possibly oriented N or E so you could maybe simply edit x/y.
If not, you can set the direction of some object and use getRelPos on it

exotic flax
#

Well, the runway I'm currently testing it on has a weird direction (Z = 39.936), and has some small hills on one side of the runway.
I also use some code to calculate the position of each object, which is all relative to the center of the initial marker and it's direction.
This marker is placed over the runway (until I manage to get a better method to get the location, size and direction of a runway).

I guess I'll have to figure out a way to "quickly" calculate the relative position without using getPos/getRelPos, because those seem to return some unwanted results when the height is changing.

#

because getPos/getRelPos work perfectly when both the current and new position have an equal Z value, but seem to create an offset on the X and Y axis when Z changes

tough abyss
#

I'm trying to attach a dead body to a living player, but the dead body don't get attached. This is normal behaviour?

#

I found the solution, i just run this code before: _body setPosASL getPosASL _body;

#

And then attach works.

dull drum
#

Hi guys. Is it a good way of knowing the id or name of the object that was just spawned by Curator or selected (mouse click) by Curator?

dull drum
#

Oh, wow! Thanks, I never had an idea to look into handlers

knotty arrow
#

createsimpleobject its broken?

#

y do that : createSimpleObject ["a3\misc_f\helpers\sign_arrow_large_f.p3d", _x,true]; And say that it expect 2 elements and i provide 3

tough abyss
#

What version of Arma you have?

knotty arrow
#

last?

tough abyss
#

What number?

knotty arrow
#

is that?

#

3948080?

#

how can i check it?

tough abyss
#

hint str productVersion

knotty arrow
#

["Arma 3","Arma3",192,145639,"Stable",true,"Windows","x86"]

tough abyss
#

1.92 but 3 rd param is available since 1.95

knotty arrow
#

i have the last version on steam

#

thanks

#

i can't create a localobejct with can_collide

cosmic lichen
#

1.95 is the development build. You can't access it via steam. Only through game updater.

still forum
#

you can access it via steam

#

just need to switch branch

cosmic lichen
#

Didn't know that, is that new?

hollow thistle
#

No

tough abyss
#

lmao

hollow thistle
cosmic lichen
#

I am sure that wasn't possible during alpha, and I've never checked that again afterwards πŸ˜„

tough abyss
#

it was possible since I can remember

still forum
#

steam branch came first

#

game updater later

cosmic lichen
#

Well, good to know.

#

No more fiddling with game updater.

rancid pecan
#

hi i created nuw gui (player menu design) with arma 3 gui editΓΆr bu i have a problem
my screen size 1920x1080 but different players screen 1280x720 1160x513 etc. etc.

my problem player menu Under 1920 pixels appearance is distorted

i have worked with "safezone"

knotty arrow
#

how can i check where its this error ? No entry 'bin\config.bin/CfgVehicles/Default.scope'

still forum
#

can't

knotty arrow
#

perfect, just removing addons and check where its it right?

still forum
#

disable mods/pbo's one by one, till it goes away

knotty arrow
#

haha

#

thanks

young current
#

Its a config that has a class default inside cfgVehicles.

frozen fox
#

So the editor is like a fully working development tool? Doesn't that mean someone could actually remake all the DLC missions and send it to steam workshop for others to play for free?

still forum
#

theoretically yes

#

BI also builds the campaigns in the editor

tough abyss
#

What do you mean for free? It will still be subject to owning DLC

still forum
#

not if you rebuild everything

#

oh well

#

besides the DLC missions which require DLC terrains

frozen fox
#

You can't make your own terrain?

tough abyss
#

you can just not in Eden

#

and if you make one with terrain editor you will need to distribute it as a mod for others to download first before they can use it

ornate sky
#

what text function did the vanilla campaign (East Wind) use? Is it BIS_fnc_typeText2?

tough abyss
#

depbo it and see

ornate sky
#

I like BIS_fnc_typeText2, but I'm not sure how to make it resolution friendly

#

I can set text offset, but it only works on 1920x1080

#

it's messed up if someone uses a 4:3 res

#

which is rare I guess

frozen fox
#

Well if you'd make custom models like the jets or tanks, you'd have to do the same @tough abyss

#

So no difference overall

astral tendon
#

What is the function for the "Edit vehicle appearance" in the editor?

still forum
#

BIS_fnc_garage

astral tendon
#

its a diferent screen

high marsh
astral tendon
#

I meam, I just want the modification screen from the editor, not the garage

high marsh
#

it's the same exact thing

astral tendon
quartz coyote
#
_hndlWet = ppEffectCreate ["WetDistortion", 400];
_hndlWet ppEffectAdjust [1, 0, 1, 4.10, 3.70, 2.50, 1.85, 0.0054, 0.0041, 0.05, 0.0070, 1, 1, 1, 1];
_hndlClrCorr = ppEffectCreate ["ColorCorrections", 1500];
_hndlClrCorr ppEffectAdjust [0.1,1,0,[0, 0, 0, 0],[1, 1, 1, 0],[0.299, 0.587, 0.114, 0],[-1, -1, 0, 0, 0, 0, 0]];
[_hndlWet, _hndlClrCorr] ppEffectEnable false;
[_hndlWet, _hndlClrCorr] ppEffectCommit 0;

[_hndlWet, _hndlClrCorr] ppEffectEnable true;
[_hndlWet, _hndlClrCorr] ppEffectCommit 0;```
high marsh
#

It is the same exact thing, the only thing you're missing is using the vehicle as the target. No idea how that works, but it's literally the same exact thing.

astral tendon
#

That looks like a totaly diferent function.

high marsh
#

Same exact function

#

@quartz coyote ^ I can see it

astral tendon
#

Its a mode then?

high marsh
#

Maybe, look at the biki link.

quartz coyote
#

Yup well it's not for me ...
I execute them in a function would that impact em ?

high marsh
#

Doubt it, unless your function doesn't exist

quartz coyote
high marsh
#

I just executed it locally in the debug console

quartz coyote
#

I actually have this

[_hndlWet, _hndlClrCorr] ppEffectEnable true;
[_hndlWet, _hndlClrCorr] ppEffectCommit 0;
private _size = 1.5 * (getResolution select 5);
[format["<t color='#800000' font='PuristaBold' shadow='2' size = '%1'>Bug exploit will get you banned</t>",_size],-1,0.885 * safezoneH + safezoneY,9999,0,0,3001] spawn BIS_fnc_dynamicText;```
high marsh
#

That's your entire script?

quartz coyote
#

no

high marsh
#

post it all

#

or the relevant bits

quartz coyote
#

issue:
Text is displayed
but not the effects

ruby breach
#

_bool = _bool or (_int == 0); πŸ€”

#

Actually, that may work without throwing an error. Just looks...... weird.

quartz coyote
#

_int is a number

#

not a bool

high marsh
#

{ }

quartz coyote
#

so it's a quick fix

#

@high marsh ?

#

I mean everything is working and supposed to work

#

but for some reason, by postprocess effects don't display

#

Could it be because they are not seen by the onEachFrame ?

#

would I need to add them as arguments of a stacked EH

#

i'll try that

ruby breach
#

Ahh, I was overthinking it. Simple: Private variables defined outside of onEachFrame scope are not inherited:

quartz coyote
#

Boom

#

I was right

#

ok

#

i'll test

#

or simple turn them in not private lol

#

hehe