#arma3_scripting

1 messages ยท Page 382 of 1

barren magnet
#

If you have multiple expressions like: xyz getvariable "dhshs"; you better do this: diag_log (xyz getvariable "dhshs");

wispy lynx
#

Okay, was trying hint format on _mapRoadDir while waiting, got "scalar" returned when the error popped up?

barren magnet
#

Otherwise you will diag log the very first thing

#

Scalar means some numeric value. How did your code look like ?

wispy lynx
#

I'll try _connectedRoad with diag. I just put this in: hint format ["%1",_mapRoadDir]; and it was returning xxx.xxx numeric values (dir's) as I drove around activating triggers, but when the error popped, it returned "scalar"....

#

Okay, so here is what I'm getting from my .rpt file after adding

diag_log _connectedRoad;

_mapRoadDir = _roads g>
23:51:27 Error position: <_connectedRoad;

_mapRoadDir = _roads g>
23:51:27 Error Undefined variable in expression: _connectedroad
23:51:27 File X:\Users\XXXXX\Documents\Arma 3 - XXXX\missions\Tanoa.Tanoa\Map_Scripts\Map_Vehicles.sqf, line 216
23:51:27 Error in expression < = _roadConnectedTo select 0;

barren magnet
#

Connected road is undefined then

#

Not all roads in arma are connected sadly

#

That's not the error of the hint or diag log

#

But how you handle the rest

#

You need default values and checks for the data

wispy lynx
#

I'm using a setup script to search for "streetlamps", when found, it then finds nearRoads and places a trigger on that road section. When the trigger fires, it runs the vehicle spawn script, which is where I have the vehicle orientation problem. Sounds like I need to add a search that discards roads that are not connected, skips placing a trigger.

#

K, I'm off. Thanks for the help!

meager heart
#

With _roadConnectedTo select 1 you have the same error ?

astral tendon
#

Im gonna make a .sqf with a list of events in my mission to progress with objectives and stuff, were should i put the scripts i made? im bilding a coop mission.

candid jay
#

goodmorning everyone

#

does anyone know why player attachTo _obj basically disallows any movements

#

lol ๐Ÿ˜„ TZ

#

I mean, can't rotate head

#

can't go in 3rd person

#

ok so I do need to use proxies

#

what kind of physx simulations exist beside carx or tankx

#

that's why I'm using proxies

#

but I need a "flying object" so if I use a proxy I need a Car or similar, which is a thingx object and will fall to the ground

#

I have a custom object with a cargo proxy in it

#

I'm thinking that mybe a weapon allows cargo proxies

cunning nebula
#

I mean, can't rotate head <-- not true. you can rotate head and aim to a limited extend but the rest of the body is static

candid jay
#

I just tried...

#

player attachTo [c, [-0.5,0.2,0]];

#

can't move anymore

indigo snow
#

it changed from arma2 to arma3

cunning nebula
#

sure you cant move

#

but you can turn your head

#

and aim within the confines of the floating zone

#

anyway what are you trying to do there ?

#

you mentioned a custom object, cant you add a person turret to it ?

candid jay
#

this what I'm trying to do

#

this is the object in OB

#

it has 2 cargo proxies

#

I need basically for it to "fly" following a track"

#

and allow soldiers to get in as cargo

#

no drivers

#

and no, I can't move my head nor point my gun for some reason

indigo snow
#

I'd configure it as FFV

candid jay
#

what is an FFV?

#

basically the requirements I'd have (if feasible)

#
  1. do not fall (no gravity)
#
  1. allow cargo in it
#
  1. if I could leverage some arma mechanism to sync in MP, good, otherwise I'll deal with local vehicles
indigo snow
#

FFV is the new A3 mechanic where you can fire from inside vehicles

#

e.g. shoot out from the back of a truck

#

it allows looking around and aiming (and shooting)

#

if youre making a custom object id just do that

candid jay
#

ok so what is my starting point

#

another type of proxy?

indigo snow
#

im not entirely at home with vehicle creation, look up the appropriate channel in here

cunning nebula
#

also known as personturret ๐Ÿ˜‰

candid jay
#

I don't want them to get up, just stay seated

indigo snow
#

they can be seated

candid jay
#

kif only attachTo worked simply

cunning nebula
#

you can have them in pretty much any pose for that

indigo snow
#

e.g. RHS has cars you can sit in the passenger seat and shoot out of the open window

cunning nebula
#

take rhibs for example

#

or the backseats in offroads

indigo snow
#

the benches of the littlebirds

candid jay
#

yes

#

all of these are closed models I can't look at

indigo snow
#

its all entirely documented

#

and im decently sure theres FFV samples in the samples toolbox

cunning nebula
#

btw. pretty much all skilifts nowadays have safety bars

indigo snow
#

theres one on the lap

#

thin one, kind of clips the legs

cunning nebula
#

oh, thats really thin

candid jay
#

that's a proof of concept

#

if I can make this work I'll fix the model

quasi thicket
#

can you use an iterator in a forEach loop?

indigo snow
#

... _forEachIndex?

cunning nebula
#

๐Ÿ‘†

quasi thicket
#
_cnt = count arrayName

{
name = "Soldier" + _cnt;
_cnt + 1
} forEach arrayName
indigo snow
#
_cnt = count arrayName
{
    name = format["Soldier%1", _cnt + _forEachIndex];
} forEach arrayName;
cunning nebula
#

why _cnt ?

indigo snow
#

he seems to want an offset

#

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

cunning nebula
#

just _forEachIndex should suffice

indigo snow
#

if the array is length 8, he wants to start at 8 from the example

cunning nebula
#

im not sure that was intentional

quasi thicket
#

welll, thought process was

I need to know the amount of entries in the array (so count)
Then i want each soldier to have a Soldier1 / Soldier2 / Soldier 3, so i reuse count

indigo snow
#

well im sure you can modify the snippet, then

cunning nebula
#

well then (_forEachIndex + 1)

#

since it starts at 0

indigo snow
#

MATLAB proves superior yet again

cunning nebula
#

and you dont need to know the count for that

indigo snow
#

i mean all in all the conclusion is just use _forEachIndex

quasi thicket
#
    name = format["Soldier%1",  _forEachIndex];
} forEach arrayName;```
#

so just that?

indigo snow
#

sure, starts at 0 though

cunning nebula
#

yes but the first one will be Soldier0

quasi thicket
#

ugh

indigo snow
#

adding 1 wastes precious nanoseconds after all

cunning nebula
#

whats the point of these names anyway ?

quasi thicket
#

_forEachIndex +1 will create 1, 3, 5 i guess?

cunning nebula
#

no

quasi thicket
#

oh wait

cunning nebula
#

youre just raising it by one, you dont/cant modify that index

quasi thicket
#

Just for the record, i'm not really a programmer/coder by any mean

cunning nebula
#

dont have to be, it just requires some logical thinking ๐Ÿ˜‰

quasi thicket
#

yeah, that is quite flawed in my head

#

i did a python practice once and just wrote a brute-force to come to the solution

#

Anyway, the question was to edit this script:

#

to replace _markername = "marker" + str(floor(random 500)) + str(floor(random 500));

cunning nebula
#

i see

#
_distance= _mkrX;
if (_mkrY > _mkrX) 
    then {
    _distance=_mkrY;
    };
#

just do this

_distance = _mkrX max _mkrY;
#

same result

#

also

#
    _size = _boundingBox select 1;
    _size resize 1.5;
#

this is very very wrong

#

resize is used to change the number of elements in an array

#

and there is no such thing as a half element

indigo snow
#

1.5 would be between elements, it should refer to the comma

still forum
#

@Arkensor#0120 Scalar means some numeric value Not quite.. Actually means the opposite.
No numberic value. A nil that should've been a number but for some reason isn't.

barren magnet
#

That was kinda what I wanted to say with "some" but your explaination is way more precise XD

still forum
#

You can say that no number.. is some type of number yeah ๐Ÿ˜„

real tartan
#

`while { alive _unit } do
{
_unit reveal _target;
_unit doTarget _target;

waitUntil { _unit is facing target command }; // howTo

_unit fire (currentWeapon _unit);
sleep 30;

};`

#

use intersect ? ๐Ÿ˜„

still forum
#

Did I just read Intercept ๐Ÿ˜ฎ I think I have to get my eyes checked

real tartan
#

should be it? > waitUntil { lineIntersects [ eyePos _unit, aimPos _target] };

#

my point is to waitUntill _unit is aiming to _target and then fire. If I setTarget then unit is firing to ground and not pointing to target

#

maybe:

#

_weaponDir = _unit weaponDirection (currentWeapon _unit); waitUntil { lineIntersects [ _weaponDir, aimPos _target] };

cunning nebula
#

you can also use the weapondirection, multiply it by the distance between the two units, add it to the position of the _unit

#

and check how far that projected point is from the target

#

not really for this case

#

but it allows you to get a number how close the unit aims to the target

#

not sure if kks comment still applies

candid jay
#

how come that enableSimulation false also disables all animations?

#

isn't that supposed to just deal with physx and collisions?

cunning nebula
still forum
#

No. Simulation is supposed to deal with Simulation. As the name says

real tartan
#

is there "skip" / "continue" command for skipping loop in while if condition is met ?

#

while { _i < 20 } do { _i++; if (_i == 15) then { skip stuff }; do stuff };

indigo snow
#

in a while loop you can use exitWith, to exit the current iteration

#

if you want to exit the while loop altogether, you need to nest two exitWith iirc

little oxide
#

How use Registered Functions of Intercept @still forum inside sqf ?

still forum
#

just like normal SQF commands

#

exactly the same

astral tendon
#

Just checking

  if (!alive testguy) then {hint "RIP"};
  if (!alive testguy) exitWith {true};
};```
#

this waitUntil will terminate once the test guy die right? or the code still runing somehow?

little oxide
#

he will

#

but your code are weird

still forum
#

uhm....

#

yes.. weird is the right word.

little oxide
#
  if (!alive testguy) exitWith {hint "RIP"; true};
}; ```
#

a little bit more correct ๐Ÿ˜ƒ

still forum
#

You can choose the 100% waitUntil will exit.. Or the "Maybe I dunno.. It probably does I guess.. sometimes.."

astral tendon
#

@little oxide thanks

lone glade
#

why adding an if inside there, to be extra super sure?

astral tendon
#

i did that because i am going to use this kinda of thing to check many others

little oxide
#

or just use something like

#
hint "RIP";```
#

it will be more readable

astral tendon
#

but wait, that means once that waitUntil is meet all codes bellow will execute?

#

because this is inside of a .sqf

little oxide
#

yeah

#

your first stuff too

#

your exitwith stuff, will just go out of the waituntil, he will finish the script

astral tendon
#

i tink i cant use that

#

becasue i will use this same .sqf file to put other events to check

still forum
#

Yes.. waitUntil.. waits.. Until... and then continues. Just like Sleep does.
What did you think it does?

astral tendon
#

Execute only the code i put inside of the scope, not everyting bellow it.

still forum
#

๐Ÿ˜ฎ okey... Well now you know better

queen cargo
#

@astral tendon wait until is a sort of loop that loops until its condition is met
Afterwards, code just executes normal

astral tendon
#

Yes, i see the problem. i am going to need to use other thing. because that also holds any code bellow it.

still forum
#
[] spawn {
waitUntil ...
}
cunning nebula
#

why do people even try to put everything in a single file ?

still forum
#

โ˜ ๐Ÿ‘†

astral tendon
#

that works thanks.

peak plover
#

Yeah, a lot more organized with multiple files

real tartan
#

if more than 20 lines of complexity, then put it to separate file

still forum
#

Tell that BI ๐Ÿ˜„

astral tendon
#

player distance intel <=34

#

i can check the distance of a object that have a varible but how about check the side of it?

#

i wanna check if there is opfour around the intel

#

that also means it can be allot of enemys around that

lone glade
#

trigger

#

also, objects don't have sides (well they do, side empty but that's another topic)

candid jay
#

is it normal that onEachFrame runs even when the game is in pause mode?

#

that's kind of weird

#

you can have stuff move around while pausing, and it has physx disabled which is really weird

still forum
#

onEachFrame.. runs ... onEachFrame...

#

so... yes.. That's normal

candid jay
#

well

#

even the clutter stops being animated in pause menu in SP

#

so I wouldn't definitely have expected that

still forum
#

except you run with -noPause

#

If you try to create a vehicle or location while the world doesn't exist.. The game crashes.

#

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

candid jay
#

well that is understandable though ๐Ÿ˜„

#

Ok I managed to make my cablecar guys, believe it or not

#

really happy about it

#

so that it will be automatically sync'ed

astral tendon
#

{alive _x} count units
How do i run that in a array?

#

like {alive _x} count units [group1, group2, group3]

subtle ore
#

Just add them together...

#

You really need to study how variables and operators work

#

Control structures as well

astral tendon
#

i did in other way around

#
[] spawn {
waitUntil {
 if ({alive _x} count units WareHouseGuys_1 ==0 AND {alive _x} count units WareHouseGuys_2 ==0 AND {alive _x} count units WareHouseGuys_3 ==0) exitWith {hint "All Clear"; systemChat "yup, they are dead"; true};
  }; 
};```
#

Yes, its urgly but as long it works...

candid jay
#

I can't seem to have the addPublicVariableEventHandler fired on change of a variable

#

I have

"testvar" addPublicVariableEventHandler {
    hint format [
        "%1 has been updated to: %2",
        _this select 0,
        _this select 1
    ]
};
#

and

testvar= [1,2,3];
publicVariable "testvar";
meager granite
#

Same client?

#

It is, depending on what you do might be useful as well

#

Yes, exactly.

#

In your case fullCrew might be better then, since engine forms the array, bit faster

wispy lynx
#

@tough abyss Yeah, found out about the forest path problem with Tanoa while testing today. Also found that airport tarmacs are and issue, as well as the small bridge between Georgetown and Saint-Julien (Georgetown side land connection not connected), and both ends of long bridge connections between Balavu Island and Katkoula Island are not connected. Thanks for the _filteredRoads, I'll play around with that and see what I can do with it.

#

They are not connected to anything. When I run the following and place markers, it shows all airport tarmacs as not being connected. _thisMapCenter = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
_roadList = _thisMapCenter nearRoads 30000;
{_roadConnectedTo = roadsConnectedTo _x;
if (count _roadConnectedTo > 0) then {
_roadList = _roadList - [_x];
};
} forEach _roadList;

#

have a screen shot, but can't upload to this channel.

#

oh, wait, just found the screenshots_arma, will drop there...

cold quartz
#

You'll sometimes find connected roads in the same locations as the individual tarmac roads too.

#

Like, 2 sets of roads with different purposes in the airports. Not sure why but it's pretty common.

rancid ruin
#

@a_shrubbery#4915 "centerPosition" isn't what it advertises itself as btw

#

you should use worldSize/2 if you want the center of the map

#

"centerPosition" is just a position that can be set anywhere depending on how the terrain maker was feeling that day

candid jay
#

what is a reasonable interval for the use of publicvariable?

lone glade
#

don't use it and use the third param of setVar

candid jay
#

any reasons?

#

the good things abount publicVariable is that you can have a listener addPublicVariableEventHandler

#

with setVariable you need a custom loop to see whether a variable has changed.

still forum
#

no

#

you can use the same listener for setVariable

#

a reasonable interval is "not dozens of times every frame"

candid jay
#

lol

#

i was thinking 2 or 4 times a second

cunning nebula
#

i'd say what's reasonable depends on what youre doing

#

what variable would you need to broadcast so often and why ?

#

is it something all players constantly see and need to be updated on ?

candid jay
#

i am setting the position of local objects oneachframe.

#

i then broadcast the "official" position computed on server to ensure everyone is sync'ed

#

obviously can't use setpos on global objects oneachframe

#

so that's how i am dealing with it

cunning nebula
#

hmm

#

what kind of objects ?

#

and you can do that on global objects, but its best to do that where the object is local

candid jay
#

i'm having a custom vehicle, a cablecar chair

#

there are 30 of them going around in maps

#

so they need to follow a very precise track path

#

everything works

cunning nebula
#

oooh that

#

i guess i would only broadcast an integer that specifies the position along the track

#

might even be worth a try to use servertime for that

#

anyway.... if all the cablecars are local objects

#

i think you'd run into a problem when people get into them

#

as in becoming invisible for everyone else

candid jay
#

will see soon

#

no I'm not using velocitytransformation

#

I could have...

#

do you happen to know whether createVehicleLocal does create a vehicle on a dedicated server?

#

I wouldn't know how to use servertime for that though

cunning nebula
#

basically, determine how long a cablecar needs to complete the track

#

and then divide (mod) the servertime by that

#
_i = (serverTime mod _tracktime) / _tracktime;
#

that should give you a value between 0-1 that indicates the position along the track

#

and yes createVehicleLocal can create a vehicle on the server

#

but then it is only on the server

candid jay
#

yes that's what I'm doing

#

and without creating vehicles

#

but no servertime

#

i send position info every x seconds

#

because it's not 1 track, it's a series of them

#

anyway thanks for the suggestion, definitely one of the things I considered too

cedar kindle
#

isnโ€™t servertime a completely broken command

candid jay
#

I was told to use CBA_ equivalent

cunning nebula
#

is it still ?

candid jay
#

(which I don't remember)

cedar kindle
#

CBA_missionTime yea

candid jay
#

yes that one

cedar kindle
#

the diff is very low from my tests

candid jay
#

good question, is it still?

#

(broken, that is)

cedar kindle
#

if you have cba available Iโ€™d use that

candid jay
#

it's a terrain

cedar kindle
#

oh

candid jay
#

I'd rather not have such a dependency but... maybe

still forum
#

serverTime is only slightly "broken" Just read the wiki page.

candid jay
#

ok ๐Ÿ˜ƒ

#

does anyone know if unitcapture / unitplay work well in MP with units on cargo?

cunning nebula
#

should be ok as long as you run it where the vehicle is local

candid jay
#

damn, back to square 1

#

btw this is how it looks now

#

all works good in SP and in MP

#

EXCEPT the issue i'm trying to solve

#

which is: each player can enter as cargo

#

BUT obviously the other players enter their own vehicle which are all locals

#

so you seem them floating next to the vehicle

#

the other option is to make a real floating vehicle (mass = 0)

#

then make it global and should sync

#

however... what happens if you have 60 of these vehicles around? I'd be concerned about FPS

#

(in a line I'll need around 60 chairs)

lone glade
#

it's only been 7 years

#

aaah, maybe next year

#

or arma 4 ๐Ÿ˜„

still forum
#

Nope

#

only synced "onPlayerConnected"

distant egret
#

Is there anyway to have a unit from a group look into a direction that works 100% of the time.
currently trying with_unit setFormDir 45; _unit setDir 45;
But some units of the group are just looking a bit off. But while I give everyone it's own group its perfect.

subtle ore
#

Why do you want it down to that precision though?

#

Even so, visually that wouldn't make a real difference

#

So they immediately turn to form direction?

distant egret
#

Well the thing is they are not all looking the same direction they are trying to look to the right direction. But it's off by some degrees.

subtle ore
#

By how much?

distant egret
#

But yea trying to make sure they look out of the window. But some of them have their back to the window.

#

@subtle ore yea it's random.

#

What I'm seeing is that they all look different directions.

#

but some of them are just way off.

#

Well I've cancelled their formation movement with doStop but their directions are still off.

#

and doWatch needs position, I guess I could use a relPos.

#

and do 100 meters.

subtle ore
#

Okay. Well, do you know the actual direction difference?

#

Or is it random?

distant egret
#

Random

subtle ore
#

@tough abyss Center of building? How would you do that?

#

BuildingPos is for entrances

#

Isnt it?

distant egret
#

Well I'm giving them the right direction but even if I give them new directions with debug console they just ignore that and go back to whatever they had first.

#

They get set to that direction but then turn back.

#

which is the formation direction I'm guessing.

#

lol thanks but I've made that already XD

#

was about to test.

#

@tough abyss used that before but I'm planning on using it to fill a whole town.

#

And if I give everyone it's own group it will go over the limit.

#

๐Ÿ˜›

#

k the doWatch thingy worked.

#

Jup

#

well they shot at me (turned around)

#

I don't care if they don't go back to the position afterwards but I'll try and see if that happens.

#

ah no I'm only putting a squad in each building.

#

Not filling all buildings, only the selected types ones.

#

In the end they all die so it doesn't matter ๐Ÿ˜›

lone glade
#

the thing is that once they're allowed to path again, your framerate just dies

cunning nebula
#

@distant egret dont underestimate the performance impact a lot of groups have

#

it can be quite significant

lone glade
#

groups are fine, it's the AI and their pathing that take the cake

distant egret
#

I made this change to move away from single units groups. So I can populate more of these buildings. So in the end it's a gain.

lone glade
#

it's much worse the more units you have

cunning nebula
#

its not just the pathing imho

lone glade
#

I managed to crash the game trying to regroup 100 units

#

well, 96 to be more exact

cunning nebula
#

basically : boring = good fps

lone glade
#

they can't configure their server.cfg, those are lagfest in every video i've seen

#

or they're running on potato servers

#

tomorrow is the CUP join op btw

cunning nebula
#

potato servers for virtual potato farmers... sounds about right

lone glade
#

it's sickening

cunning nebula
#

hmm

lone glade
#

well, good for them, at least it's not the horrors i've seen, also yeah, that's what the 12 year olds get off of, all that "code mumbo jumbo"

cunning nebula
#

๐Ÿคฆ

still forum
#

In the meantime... ACE:
Hey! I mad a fix that increases fps by about 5!
A: good work
B: great
C: cool.

cunning nebula
#

also.... eventhandlers !!

still forum
#

throws poo poo at @tough abyss

cedar kindle
#

event handlers!

tough abyss
#

Does anyone know if it's possible to move the text's position in BIS_fnc_typeText2?

still forum
#

Just pre/append some whitespace?

tough abyss
#

Good idea.

#

How do I add an empty line to structured text? ["", "<br/>"] doesn't cut it.

jade abyss
#

@candid jay Try Line 33 - sqf _veh = player;

#

+did it worked with a Plane?

candid jay
#

it's not working with a crane.

#

if I remove lines 41 & 42 at least it does not disappear instantly, but it starts rolling on its own endlessly

#

bouncing

#

nevermind.

jade abyss
#

uhm, removing? oO

#

F5 the pastebin page

candid jay
#

I DID

#

IT DOES NOT WORK

#

๐Ÿ˜ƒ

#

I even have a mission file pasted for you, ok I'm sure you have better things to do

#

believe it or not, not really new to scripting

#

thank you for your help anyways.

astral tendon
#

is there a way to detect if the waypoint is activated?

queen cargo
#

anybody in here interested in some fun sqf-project?
only requires sqf skills and a basic understanding of REST and some magic commands not yet existing in my sqf-vm ๐Ÿ˜ˆ ๐Ÿ˜ˆ ๐Ÿ˜ˆ

#

But behold, those who join might get crazy and doom their sanity

#

It is kind of a contract with the devil

tough abyss
#

You seem to be starting projects every other day...

queen cargo
#

Not really starting that project
Just some random idea floating around in my head involving networking, the sqf-vm project, a JSON parser in sqf that needs to be written and the discord bot

tough abyss
#

ArmA 3's engine is poo poo... SQF itself I still stand by being a large part of the problem.

#

EH's are executed on 1 core.

#

called unscheduled code runs on 1 core

#

virtual machine (scripts) run on 1 core.

cerulean whale
#

Is there a way to tell if a player is looking at another object?

tough abyss
#

2 ways actually.

#

cursorTarget

cerulean whale
#

I thought I could use something like lineIntersects with the eyePos but that doesn't seem to work

tough abyss
#

What does lineIntersects return?

cerulean whale
#

(lineIntersects [eyePos player, eyePos _x, player, _x])

#

Essentially

#

if they are ont he other side of the wall

#

false

#

if they aren't, true

#

and I thought this woulda pply to playermodels

#

but it doesn't seem too

#

How would you do it?

#

@tough abyss

tough abyss
#

Returns a bool

cerulean whale
#

yeah

#

still doesn't work with playermodels though..

#

how would you tell if a player is looking at something?

tough abyss
#

Gun or player?

cerulean whale
#

player

#

I need to tell if they're looking at a certain player

#

(Just in visible eyesight)

plucky willow
#

run all the time or just once?

tough abyss
#

cursorTarget ?

cerulean whale
#

no like

#

if they are in the screen

#

I would use cursorObject to tell if they were where I was looking

tough abyss
#

What is the object they are looking at?

cerulean whale
#

player

#

I want a way for teams to be able to tell each other apart

tough abyss
#

So you want to know if a player is looking at a player?

cerulean whale
#

by creating an image with a rscTitle using worldToScreen

#

I want to know if a player can see another player anywhere on screen

#

to sort between nearestObjects and what is actually in front of them

#

otherwise the text doesn't hide when you look away and it cloggs the screen

tough abyss
#

So this will be running all the time?

#

You want to find a players position in the screen convert it from screen space to world space

#

Then place an "icon" or something on that player?

cerulean whale
#

world to screen

#

but yeah

tough abyss
#

DrawIcon3D ?

cerulean whale
#

ugh

#

I have the text

#

that's not what I'm aslking

#

the script is working

#

I wrote it

tough abyss
#

Not detailed enough.

cerulean whale
#

but I can't differentiate between the people behindme and those in front

plucky willow
#

i understand what youre describing

cerulean whale
#

this is what I've been saying for the last 5 minutes lol

plucky willow
#

but i dont think its feasible

tough abyss
#

^

cerulean whale
#

I have seen people who have done it

tough abyss
#

Who?

cerulean whale
#

because they have had like names above heads

#

and when you look away they disappear

plucky willow
#

you want it to be only LOS though

#

not on screen>

#

?

#

on screen is much easier

cerulean whale
#

I've sorted LOS, but I need to sort on screen

#

If they walk away they will disappear

#

but not if I look away from them

tough abyss
#

Check direction and distance

#

done.

#

180* and distance < maximum

plucky willow
#

also dont let the server be the one executing the LOS script youre using

cerulean whale
#

so you're saying relative direction right?

tough abyss
#

Yes relative direction you can even use getDir with x,y

#

to determine from x -> y

#

As I said your "specifications" are vague and not sufficiently detailed.

#

Break the problem down more.

cerulean whale
#

They're pretty descriptive

#

...

#

I've explained it about 10 times

#

but w/e

#

I'll just figure it out

cerulean whale
#

What is hard to get about this exactly

#

How to differentiate whether an object within 5 metres is on the screen or off the screen

#

pretty descriptive

#

If you know english

tough abyss
#

Distance is easy.

cerulean whale
#

๐Ÿคฆ

#

Can you read lol?

#

Of course distance is easy

#

5m is an exampel

#

Read the second half of the sentence

tough abyss
#

Can't be bothered work it out yourself.

cerulean whale
#

Sure, I just thought some people might have ideas seeing as it's been done before and it would save me time

#

Got it

tough abyss
#

Haven't done arma 3 scripting in a while. The benefits vs cost were minimal.

cedar kindle
cerulean whale
#

dw I sorted it

hollow lantern
#

I guess there is no way via scripting to reduce the loading time of a vehicle weapon?

candid jay
#

clean organization & autocompile

hollow lantern
#

oh lol gonna try that

#

thanks

cerulean whale
#

Hey, is there a way to turn a players saturation up via script or mod config? I think the game looks way nicer with saturation so want to push it to my mods as a preset

queen cargo
#

@tough abyss pretty much all script languages run single core

Also... Sqf-vm has not much to do with arma besides the languages it is sharing

tame portal
#

@hasty violet No

#

Well, if you run the code defining it, it will redefine it with the same code

queen cargo
#

Uhm.. Nothing changed

#

Loadfile and other commands are just for loading a file

tame portal
#

I thought by inline you mean ABC = { hint "hello"; };

queen cargo
#

Compile and compilefinal are to create code out of it

#

The moment you got a code element you... Well.. Got runnable code

tame portal
#

It's going to compile/define whenever you run compile or something like that. After that the stuff is in memory (if you saved it in for example a global variable)

queen cargo
#

In case you are a curious how it more or less is working, sqf-vm project of mine mimics Armas language and has some similarities

compact maple
#

Hello guys, i want to display in a listbox the list of all the players but not the player that open the menu.
should i proceed like this ?

} forEach allPlayers - entities player;

cedar kindle
#

allPlayers - [player]

tough abyss
#

@still forum - I found out that one can actually change the text's position with a 2nd and 3rd arguments, only it's not documated anywhere. ```SQF
[
[
[_missionName, "align = 'right' shadow = '1' size = '0.7' font='PuristaBold'", "#0086f4"],
["", "<br/>"],
[_date, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaLight'"],
[_time, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaMedium'"],
["", "<br/>"],
[_neareastLocation, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaLight'"]
], -1, 1.5
] spawn BIS_fnc_typeText2;

#

Would anyone mind adding that to the biki?

lone glade
#

you can now

#

it uses BIS accounts since the maintenance

tough abyss
#

๐Ÿ‘

meager heart
#

@tough abyss Not only position, there is couple more

//--- all params
private _data             = param [0, [], [[]]];
private _posX             = param [1, 0, [123]];
private _posY             = param [2, 0, [123]];
private _alignBottom    = param [3, true, [false]];
private _rootFormat     = param [4, "<t >%1</t>", [""]];
private _abortParams     = param [5, [], [[]]];
private _abortCond         = param [6, {false}, [{}]];
private _playSounds     = param [7, true, [true]];
tough abyss
#

Interesting ๐Ÿค”

woeful mirage
#

Has BI a keydown eventhandler list?
I mean, when the player press your key "weapon hold lower" (standart is 2x ctrl left) can i use a code for that? when he doing the "action" ?

lone glade
#

actionKeys afaik

#

but it's kinda broken due to key combos

#

see commy's comment on that page for more explanations on how it's broken.

cursive owl
#

good day, can any one help me, i need a script that can make the fatigue and stamina more than the normal vanilla stamina, so i can run longer, but not turned off ?

copper raven
cursive owl
#

hi so will this make me run longer ๐Ÿ˜ƒ ?

#

but still have the stemina

#

do i add this in initplayerlocal

copper raven
#
private _stamAdd=11;
private _stamInt=4;
while {true} do {
    if (speed player >0) then {
        _cStamina=getStamina player;
        player setStamina (_cstamina + (_cstamina/_stamAdd));
    };
    sleep _stamInt;
};

this is probably terrible example, ive never messed with stamina, but it should do.

cursive owl
#

hi thanks, wher do i add this ?

copper raven
#

initplayerlocal

cursive owl
#

ok let me try

#

that works realy grate thanks. do i ned to add this to the onPlayerRespawn

#

also

copper raven
#

nope

cursive owl
#

ok

#

@copper raven you stil here, what about if i want to setCustomAimCoef and setUnitRecoil Coefficient how can i set that up for players dont have that sway on the gun but still have it

#

sorry my english ๐Ÿ˜ƒ

copper raven
#

you dont want players to have weapon sway?

cursive owl
#

yes, but not like the vanila one, its alot of sway

#

now that i can run longer the sway was really bad when you lose your breath

copper raven
#

so you want to decrease sway when player is about to run out of breath?

cursive owl
#

yes somthing like that, more stady aim

#

so the xcope dont keep jumping around like it do now

#

scop

tender vector
#

I am trying to create an addon that has a GUI component I am following the guide at https://community.bistudio.com/wiki/Dialog_Control#Dialogs

I have the Example 1 code in my description.ext file and through a script I am calling

waitUntil { !dialog };```

however I am geting the error `Resource MyHelloWorldDialog not found `
Can anyone help me?
devout moss
#

Hi, how would I call a certain script for only players that JIP?

#

I'm looking at the onPlayerConnected function and I'm not sure if that runs for everyone as soon as they connect or whether it's just JIP players

lone glade
#

I can't remember if it's AL or AG, but better be safe and check only on the local machine

devout moss
#

Hmm , how would I normally use that function? I rely a lot on examples unfortunately

still forum
#

if (didJIP) then ...

devout moss
#

Oh, that's easy then

tender vector
#
if(_jip){
// Code here for jip maybe?
};};```
devout moss
#

Hmm

#

What would be the difference between that one and

#

if (didJIP) exitWith
{
[] execVM "jip.sqf";
}

tender vector
#

I don't know try them both i guess

devout moss
#

Might as well ๐Ÿ˜„

#

if (didJIP) exitWith
{
[] execVM "jip.sqf";
}
seems to work fine

cursive owl
#

still ned some help on my sway problem ? any one ๐Ÿ˜ƒ

devout moss
#

No experience with that, sorry

cursive owl
#

no i gat it from @copper raven thanks man

jolly bridge
#

how can i add a simple script in my mission to make the suicide belt to blow up? with an alluah akbar sound to it ?

and if there is any scripts that can do this let me know thx.

noble pond
#

why don't you look up how to do it yourself? @[CK]TimRambo#5535

#

spawning an artillery shell on yourself and playing a sound is easy to do in rv

jolly bridge
young current
#

and made with good taste.

devout moss
#

and no insignias pop up, even when testing in single player nor multiplayer

#

I just throw this into the unit's init right? [this,"111thID"] call BIS_fnc_setUnitInsignia;

copper raven
#

try [player,"111thID"] call BIS_fnc_setUnitInsignia; in debug console

devout moss
#

Output is false......?

copper raven
#

probably incompatible uniform

#

try a different one

devout moss
#

That does appear to be the case

#

Just tried to run it on an APC and still gives the same output

#

[apc1,"111thID"] call BIS_fnc_setUnitInsignia;

lone glade
#

only applies to uniforms

devout moss
#

Can't do it on vehicles?

lone glade
#

no, that's the unit squad xml logo

devout moss
#

Damn, so this isn't a means to override the squad xml logo?

lone glade
#

technically you can replace it by something else or add it yourself, but it's a PITA

#

(on vehicles)

devout moss
#

Hmm

#

How pita are we talking about?

jade abyss
#

On a Scale from 1 to 10 it's a "Banana".

devout moss
#

๐Ÿค”

hollow lantern
#

via scripting I mean

subtle ore
#

you could override the key for reload

#

and then sleep

#

then force the user to reload

hollow lantern
#

force user to reload? I just want to acomplish that a weapon that takes 6 seconds between fired again (cause of realod) just needs 1

#

for e.g.

subtle ore
#

action

hollow lantern
#

why would a user be involved in this?

#

I don't get your point

subtle ore
#

it'd be weird

#

but I can't really think of anything via script

subtle ore
#

@tough abyss >via scripting I mean

hollow lantern
#

@tough abyss no. It doesn't have anything to do with characters. I said vehicle weapons

#

I just want a vehicle weapon to be faster reloaded than normal

#

either by AI or by player

cerulean whale
#

Is there a way to cancel a sound in the middle of say3D? I want to cut it halfway through if the sound is turned off instead of finishing the sound it is on

meager granite
#

Make some local entity say it and then delete the entity?

cerulean whale
#

I came up with something. One other question, why does serverTime have a different value on player and server?

agile pumice
#

how can I check if a cargo index is free before using moveinCargo?

still forum
#

@cerulean whale Read the wiki page for serverTime. It's weird.

cerulean whale
#

Yeah I just did before you sent that @still forum Makes more sense

#

Umm, one question, I'm using createSoundSource to stop me from having to spawn everything @meager granite but if I wanted to locate all nearby soundsources using nearestObjects what would I do? ```
nearestObjects[player, [""], 10];

#

Cheers

#

I tried typeOf _sound; which returns "#dynamicsound" but when I try ```
nearestObjects[player, ["#dynamicsound"], 10];

#

Any ideas/

#

?

little eagle
#

nearestObjects doesn't search trough all entity lists.

#

Dunno which command uses which lists. And those lists have no official name. Might want to try to use allMissionObjects and some kind of sorting technique with apply [_x, _x distance _origin] and sort.

ionic orchid
#

has anyone made an offline archive of the wiki? I'll be w/o internet for a few weeks and could do with one

obtuse cosmos
tame portal
#

@obtuse cosmos Place the controls inside a control group

#

Or if you want to be really sneaky:

#

Put a controlgroup onto your background

#

then put another controlgroup into that controlgroup

#

and then put your controls in that uppermost control group

#

this way you can move the uppermost control group to the left, it will cut off where the lower control group ends and you will only need to move one control (being the upper control group)

obtuse cosmos
#

Alright, thanks @tame portal

#

Can't do the controls on background with controls group, already got one for the tiles effect - unless you can have more than one?

tame portal
#

You can create as many as you want as far as I know

obtuse cosmos
#

Inside: class controlsBackground {};

#

?

#

rgr

#

I've done it inside the controls for now with RscControlsGroupNoScrollbars - will try this first

meager granite
#

The issue with entire thing is that map doesn't get cut off by controls group

#

Even more, iirc it always uses screen coordinates instead of relative group ones

obtuse cosmos
#

FUCKING ARMA! FML! FFS! UNINSTALLING THE GAME! RAGEQUIT!

#

xD

#

didn't work

#

!!!

meager granite
obtuse cosmos
#

@meager granite There isn't relative pos

#

I have to pos it all from left 0

#

UGH

meager granite
#

What I mean is that if you'll have it inside controls group, map will not be positioned relative to group unlike all other controls

obtuse cosmos
#

hm

meager granite
#

Anyway, try yourself and you'll see what I mean

#

But in general although you can display controls over map, it can't be cut off inside controls group

obtuse cosmos
#

I saw

#

also, the map is fucked up

#
  1. Some invisible padding
#
  1. When I move it to the left, it goes down to the left side as well
#

nvm

#

idk

#

I only changed code to: ```
((_display displayCtrl 900) controlsGroupCtrl _x)

#

It has same h values too

#

Fixed the transition with it going left and down, forgot to change one part, my bad, the issue shown on pic though, idk why that is

obtuse cosmos
#

๐Ÿ™

proven crystal
#

so how to i select a random entry from the config so that i get one of he possible infantry groups of a faction for example?

#

just like this?
_randomgroup = selectrandom[configfile >> "CfgGroups" >> "East" >> "CUP_O_Tban" >> "Infantry"];

simple solstice
#

to get the array

half relic
#

@still forum Perhaps a dumb question, is there something preventing LR channels being synced when respawning, when it works for our SR? This is about TFAR, in case it isn't obvious.

proven crystal
#

thanks

still forum
#

define "synced" ? and "works for SR" ?

half relic
#

Let me get the actual code, give me a few minutes So I'm not just talking out of my ass

#

Perhaps a better question to ask, will SR and LR be synced to side automatically in the 1.0 update?

still forum
#

Most likely TFAR being shitty. Probably not.

#

Just released a new version a couple minutes ago that probably fixes that

half relic
#

Where?

#

And in regards to probably not, are you referring to the synchronization to side automatically?

still forum
#

frequency syncing is just broken... It doesn't even work at all when you Respawn I think.

#

Where TFAR versions are always released. Github.

half relic
#

Figures.

#

Thanks for your time.

proven crystal
#

can i do it like this?


_randomgroup = selectrandom getArray (configfile >> "CfgGroups" >> "East" >> _faction >> "Infantry");```
#

with variables in the path?

still forum
#

yes

lone glade
#

wtf

15:13:11 [ACE] (arsenal) TRACE: 191575 mass:  _class=AN/PRC-343,  _mass=8,  _maxLoad=8,  typeName _mass=SCALAR,  typeName _maxLoad=SCALAR, _mass == _maxLoad=false z\ace\addons\arsenal\functions\fnc_updateRightPanel.sqf:35
tough abyss
#

What's the proper way of using remoteExec and hint format ["%1", player]?

simple solstice
#

@tough abyss the easiest way to do this would be to create a function

#

but you can just do

#

[str player] remoteExec ["hint",?]

#

but that would send the str from the remote executer

tough abyss
#

Good thinking, thanks @simple solstice!

lone glade
#

fixed:
code

TRACE_6("typename tests", typeName _maxLoad, typeName (progressPosition _loadIndicatorBarCtrl), _maxLoad, _maxLoad == 40, (progressPosition _loadIndicatorBarCtrl), (progressPosition _loadIndicatorBarCtrl) == 0.8);

_maxLoad = _maxLoad * (1 - (progressPosition _loadIndicatorBarCtrl));

TRACE_3("after multiplication", typeName _maxLoad, _maxLoad, _maxLoad == 8);

_maxLoad = parseNumber (_maxLoad toFixed 2); // Required to avoid an issue where even though the typename returns "SCALAR" it doesn't act as one.

TRACE_3("after fix", typeName _maxLoad, _maxLoad, _maxLoad == 8);

debug log

15:56:04 [ACE] (arsenal) TRACE: 29680 typename tests:  typeName _maxLoad=SCALAR,  typeName (progressPosition _loadIndicatorBarCtrl)=SCALAR,  _maxLoad=40,  _maxLoad == 40=true,  (progressPosition _loadIndicatorBarCtrl)=0.8,  (progressPosition _loadIndicatorBarCtrl) == 0.8=true z\ace\addons\arsenal\functions\fnc_updateRightPanel.sqf:26

15:56:04 [ACE] (arsenal) TRACE: 29680 after multiplication:  typeName _maxLoad=SCALAR,  _maxLoad=8,  _maxLoad == 8=false z\ace\addons\arsenal\functions\fnc_updateRightPanel.sqf:28

15:56:04 [ACE] (arsenal) TRACE: 29680 after fix:  typeName _maxLoad=SCALAR,  _maxLoad=8,  _maxLoad == 8=true z\ace\addons\arsenal\functions\fnc_updateRightPanel.sqf:30
proven crystal
#

_randomgroup = selectrandom getArray (configfile >> "CfgGroups" >> _side >> _faction >> _type);

#

keeps returning me null, but i see that _side is "West", _faction is correct and _type is infantry

lone glade
#

because there's no arrays there

proven crystal
#

or East, CUP_O_TK_MILITIA, Infantry

lone glade
#

it's only subclasses under there

proven crystal
#

oh... so what do i need to do to get an array with the group types from the factions?

lone glade
#

("true" configClasses (configfile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry")) apply {configName _x} as an example

#

it will return
["BUS_InfSquad","BUS_InfSquad_Weapons","BUS_InfTeam","BUS_InfTeam_AT","BUS_InfTeam_AA","BUS_InfSentry","BUS_ReconTeam","BUS_ReconPatrol","BUS_ReconSentry","BUS_SniperTeam","BUS_InfAssault","BUS_ReconSquad"]

proven crystal
#

ah cool. thanks!

proven crystal
#

i guess i still nee dthe "getarray" bit?

lone glade
#

no you don't

#

just replace "West" "BLU_F" and "Infantry" by your local vars

#
("true" configClasses (configfile >> "CfgGroups" >> _side  >> _faction >> _type)) apply {configName _x}

with:
_side = "West"
_faction = "BLU_F"
_type = "Infantry"
will return the same array that I posted above

#

configClasses returns all the subClasses that have the condition return true, in this case all of them since the condition is "true"

Apply changes an array, in this case the array that configClasses returns, we're replacing each index (which are config path at this point) by their config name

tender vector
#

Using the Binarize option to create my .pbo seems not to include my \functions folder so I get a lot of Script addon\functions\fn_function.sqf not found errors

#

Building without the binarise option and it will work fine

cosmic kettle
#

check the exceptions iirc

tender vector
#

do you mean Exculusion pattern list filename? if so that is using default

lone glade
#

no, the binarize log

#

errors should be printed there, you can have syntax error that trip binarize but not anything else

proven crystal
#

ah i got it. was lacking an extra set of brackets. thanks alganthe

astral tendon
#

is there a way to make mines not explode when in contact with a civilian? or a especific team or unit?

lone glade
#

nope

astral tendon
#

or at least a script to desarm mines?

cosmic kettle
#

enableSimulation false?

astral tendon
#

maybe

cosmic kettle
#

you could disable them for specific sides then.

astral tendon
#

that does not really work in the way i want

#

the mine still triggers but does not explode

cosmic kettle
#

I'm not really familiar with them, but I'm sure you can find a way.

astral tendon
#

other way around is to make the unit invunerable and across the mine field, but that will be akward

cosmic kettle
#

now why are there mines then? just out of interest

astral tendon
#

the objective is to cross the mine field with a mine detector and get on the other side, and then the IA must follow you

#

but you know how reliable IA is.

cosmic kettle
#

yeah i see...

#

from biwiki:

Vanilla AI already avoids vanilla mines placed by their own side.

Make sure to eitherย revealย the mines to your preferred side or place the respective mines from the correct side.

ย 

Cheers
astral tendon
#

well, then it would defeat the porpuse of the mine detector

#

the player must find the way into the mine field

#

Then the IA must across

lone glade
#

ahahahahah, good luck

#

AI will probably go around the minefield if you reveal them

astral tendon
#

well, i will just delet the mine field once the player across, seens the only way.

cosmic kettle
#

also from BIForum:

this enableSimulation false;

null = this spawn {

ย ย  ย private _position = getpos _this;

ย ย  ย private _explosion = "R_60mm_HE";

ย ย  ย waitUntil {sleep .5; triggerActivated mytrigger};

ย ย  ย private _bomb = createVehicle [_explosion, _position,[], 0, "CAN_COLLIDE"];

deleteVehicle _this;

};
digital pulsar
#

what's a reliable way of checking how much time passed since mission start

subtle ore
#

diag_tickTime

digital pulsar
#

biki is scarying me that time can desync under heavy load

subtle ore
digital pulsar
#

This command will return time since last client restart as float. However because of Number format used in Arma, the more time has past since restart the less precise the returned value will be. is this something to worry about in a 3h period?

subtle ore
#

No

#

if it were more like a day maybe

still forum
#

@subtle ore diag_tickTime is time since game start.

#

not "since mission start" as requested

subtle ore
#

Sorry blanked me for some reason

digital pulsar
#

if its reliable then it doesnt matter since when

#

can always subtract

subtle ore
#

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

tough abyss
#

Any clues as to why I'm getting the following error 20:49:56 Error in expression <nt = 'PuristaMedium'"], ["", "<br/>"], [_locationText, "align = 'right' shadow => 20:49:56 Error position: <_locationText, "align = 'right' shadow => 20:49:56 Error Undefined variable in expression: _locationtext 20:49:56 File x\nev\addons\debug_menu\functions\fnc_missionInfo.sqf, line 41 with the following code? ```SQF
// Get current location text
_neareastLocations = nearestLocations [getPos player, ["NameCity", "NameCityCapital", "NameLocal", "NameMarine", "NameVillage"], 10000];
if (_neareastLocations isEqualTo []) then {
_locationText = "In the middle of nowhere";
} else {
_locationText = format ["NEAR %1", toUpper text (_neareastLocations select 0)];
};

// Output
[
[
[_missionName, "align = 'right' shadow = '1' size = '0.7' font='PuristaBold'", "#0086f4"],
["", "<br/>"],
[_date, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaLight'"],
[_time, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaMedium'"],
["", "<br/>"],
[_locationText, "align = 'right' shadow = '1' size = '0.7' font = 'PuristaLight'"]
], -1, 1.5
] spawn BIS_fnc_typeText2;

subtle ore
#

@tough abyss whats is -1 and 1.5 for?

tough abyss
#

To changet he location of the text.

still forum
#

Because _locationText is undefined.

#

What kind of question is that?

tough abyss
#

@subtle ore - Only 1 out of 7 arguments of BIS_fnc_typeText2 are documented.

subtle ore
#

I see.

still forum
#

That's why you should use private

private _neareastLocations = nearestLocations [getPos player, ["NameCity", "NameCityCapital", "NameLocal", "NameMarine", "NameVillage"], 10000];
if (_neareastLocations isEqualTo []) then {
    private _locationText = "In the middle of nowhere";
} else {
    private _locationText = format ["NEAR %1", toUpper text (_neareastLocations select 0)];
};

See your problem now?

tough abyss
#

Nope ๐Ÿ˜•

subtle ore
#

you don't?

tough abyss
#

I'm failing to understand how private changes anything here.

subtle ore
#

_locationText is defined inside of if(_nearestLocations isEqualTo []) then { };

still forum
#

It is defined inside the if scope.
If you leave that scope it's undefined.

subtle ore
#

^

tough abyss
#

If I have a private would that mean that _locationText will not "escape" the if scope?

subtle ore
#

Sure

tough abyss
#

That's the opposite of my intent.

subtle ore
#

What?

#

it's still local...

tough abyss
#

I need it to "leak" into the main scope.

#

Otherwise it stays undefined.

subtle ore
#

Sets a variable to the innermost scope

lone glade
#
private _bob = "bob";

if (BOOL) then {
    _bob = "bill"
};

in this case _bob is now bill

tough abyss
#

Should I be declaring my vars before the if block?

lone glade
#

yes

subtle ore
#

Well I mean, you can

lone glade
#

private only work on new scopes within the current scope, it doesn't define it for the previous scope for very obvious reasons

subtle ore
#
if (_neareastLocations isEqualTo []) then {
    private _locationText = "In the middle of nowhere";
}

is in a new scope

#

feel like I need to wash my hands after

if(true) then {

};
tough abyss
#

Declaring before if block worked. Thanks folks ๐Ÿ˜ƒ

subtle ore
#

yeah, but why?

tough abyss
#

Asking the important questions.

#

Because... _locationText was "tied" to the main scope with private, and didn't only change in side the if block... I think... maybe...

#

Some times it takes me a while to understand what I'm writing.

subtle ore
#

But why is that important?

tough abyss
#

Because _locationText needs to exist in the main scope in order to be used there?

#

I'm trying really hard here ๐Ÿ˜ฆ

#

Because otherwise it's present in the if?

lone glade
#

because otherwise it's only present in the then or else blocks

tough abyss
#
Because _locationText needs to exist in the main scope in order to be used there?
``` @lone glade - pretty much?
lone glade
#

yep

winter dune
#

is there a way to place a dialog in a specific spot even if the player has different Interface Sizes?

#

I've created a dialog with safezones and so on, but changing the Interface Sizes, my dialog position seems changing

lone glade
#

yes, use the pixelGrid system with pixelGridNoUIRescale

still forum
#

How about

private _locationText = if (_neareastLocations isEqualTo []) then {
     "In the middle of nowhere";
} else {
     format ["NEAR %1", toUpper text (_neareastLocations select 0)];
};

? @tough abyss

lone glade
#

hell, there's a better way even

#
private _locationText = [format ["NEAR %1", toUpper text (_neareastLocations select 0)] , "In the middle of nowhere"] select (_neareastLocations isEqualTo []);
winter dune
#

@lone glade thanks bro, tomorrow I'll give it a try

#

so it has to be like this? h = ICONH * safezoneH * pixelGridNoUIRescale;

lone glade
#

pixelGrid commands have to be used with pixelW and pixelH

winter dune
#

ah ok

lone glade
#

you can use safezones on top of that, for example:
safezoneH + (1 * pixelH * pixelGridNoUIRescale)

winter dune
#

and this pixelGrid has to be applied everywhere?

#

or only where there are texts

lone glade
#

no, it's a system for positioning the controls / dialogs

#

you can (and should) use it with safezones

#

it's pixel precise, which is very nice.

winter dune
#

ok, so safezones and pixelGrids should be use together to have an UI based on all the players resolutions, right?

lone glade
winter dune
#

thanks

tough abyss
#

Thanks @still forum, I'll be sure to try it tomorrow!

native siren
#

Hello. I've created this simple script to lock gate for anyone apart from west side. And it works perfectly on my local test server. But if I put it on my live one nobody can open the gate. Can anyone tell me why? Thanks.

#

if!(playerSide == west) then {this setVariable ['BIS_Disabled_Door_1',1,true]};

#

I'm putting this code inside gates init on eden editor.

little oxide
#

delete the true at the end of your setvariable @native siren

native siren
#

@little oxide Thank you it worked ๐Ÿ˜ƒ

meager granite
#

Trying to make unit rotate turret 45 degrees left from vehicle orientation while maintaining 0 turret elevation, using lookAt but can't figure out how to calculate Z to look at. Any ideas?

lone glade
#

eyepos maybe?

meager granite
#

Hm

#

Nope, using Z from eyePos doesn't work, elevation ends up being different for different vehicles

#

I also tried using memoryPointGunnerOptics memory point from the turret, no luck either, various elevation depending on the vehicle

#

45 degrees doesn't need to be precise really, I just need perfect 0 elevation

meager granite
#

Tried using lookAt entity instead of position, same thing

#

Well, looking at very distant point (modelToWorld [-1000,1000,0]) leaves elevation almost at 0 due to distance, still not a perfect solution though.

agile pumice
lone glade
#

yes, altho you're missing a bracket on the third line and need to privatize that var

agile pumice
#

ah yes

#

privateize which var

lone glade
#

_chicken

meager granite
#

Second addEventHandler array element lacks curly brackets

agile pumice
#

ah yes, that too

tulip cloud
#

Can an object be created on a local machine in multiplayer game but not sent to all clients?

robust hollow
agile pumice
#

my chickens wont attach ๐Ÿ˜ฆ

robust hollow
#

ur params is one early for _projectile

#

you are missing mode
params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];

agile pumice
#

ah, missed mode

#

thanks

tulip cloud
#

@robust hollow thanks. If I use deleteVehicle on the local vehicle. Will I be running into any problems with the netId being persistent?

robust hollow
#

the netid of local objects in mp is always "0:0".

#

local objects as in created with createvehiclelocal

tulip cloud
#

so that means no matter how many are created it won't be a problem. Correct?

robust hollow
#

you can create as many objects as you like with createvehiclelocal, you just cant refer to them by the netid because they dont have one.

tough abyss
#

Thanks @alganthe#8904.

tulip cloud
#
myString = str (10) + str (10)

My output is "10""10" Why isn't it "1010"?

#

switched to

myString = format["%1%2",10,10];
little eagle
#

str 10 + str 10
is
"1010"
If not then you made a mistake.

thorny monolith
astral tendon
#

what is the reverse of "in"? like "!in"

lone glade
#

!("STRING" in ARRAY)

astral tendon
#

thanks

lone glade
#

is there no way to add a magazine without triggering the reload timer or shorten it for units <--- (important)

#

I tried addWeapon and all the addXXItem for primary secondary and handgun as well as try to reduce the reload timer to 0 using setWeaponReloadingTime

#

but apparently it detects the muzzle but fails to change the reload timer :/

#

the only way to avoid that is adding the mag in one of the player's containers before using addWeapon buuuut it doesn't work for bigger mags (not enough space)

cedar kindle
#

bigger mags ?

#

oh

lone glade
#

like rockets and belts

cedar kindle
#

add a fake backpack and remove it afterwards

lone glade
#

way too fucky and if the player has a backpack it won't help either

#

altho seeing your rocket slide off the tube is fun:
https://imgur.com/xVJqMzh
it's kinda annoying that you have to wait for the "reload timer" which is longer than the fucking animation

cedar kindle
#

oh itโ€™s for when selecting a new item?

lone glade
#

yep

cedar kindle
#

how does it work currently ?

#

in vanilla

lone glade
#

in vanilla you don't get the weapon loaded if there's not enough space in your containers

#

you also can't switch mags on the fly

tender vector
lone glade
#

not that I think of

#

I wonder if the GLs also slide off... (they don't ๐Ÿ˜ฆ )

cedar kindle
#

afaik the only way is adding it before the weapon and thatโ€™ll require the fuckery

lone glade
#

eh, i'll keep it like this, it's better than having to add the rocket to your backpack, exit arsenal, load it and reenter arsenal

astral tendon
#

```This addaction ["Secure intel",{deleteVehicle intel}];````

#

this object got its simulation disabled, does it still work on a coop when a second player use the action?

lone glade
#

bunch of issues here, "intel" is a pretty bad name, at least use a tag.
I suppose you placed this code in an initBox? if so, is it on the player or object?

astral tendon
#

object

#

and why is a bad name?

lone glade
#

because it's super generic, something, somewhere in missionNamespace might use that varName

astral tendon
#

did not got any error about that during tests

#

but what about the simulation?

subtle ore
#

you don't have to get errors for it to be a bad variable name

astral tendon
#

Nevermind.

subtle ore
#

you should probably test things yourself before asking other people

astral tendon
#

especially when you are around.

still forum
#

Some people are dumb

subtle ore
#

๐Ÿ˜ฑ

#

the word is out

#

everybody RUN

still forum
#

Everyone is dumb unless proven otherwise

subtle ore
#

Prove it Dedmen, 1v1 me bro

still forum
#

Maybe he did that because he found that you can't compare a boolean to true

#

And failed to realize that comparing to true doesn't make any sense

#

I see a lot of people doing that

#

Working on something for a long time.. Means your code is most likely shit

#

Because there were a lot of new things in the last 6 years

#

if you are still stuck with what we had 6 years ago your code is gonna be a useless pile of garbage

thorn saffron
#

Hey folks, I've been digging through MCC in order to find a way to create an item shop with would use same mechanics and resources as MCC does. MCC already has the Vault feature with handles buying and selling guns using Valor. The only thing that really needs to be done is to make it possible to add items to the vault in the editor.
What I discovered is that MCC is running a script with adds an item highlighted in the shop menu, to the vault. What I would like to do is have a script that reads the content of an ammo box at the start of the mission, creates an array of all the items, and then runs that MCC script on each of them to add them to the vault.
In theory this should add the items from a box to the shop/vault and MCC mechanics would take over from there.
Would be nice if you could set up couple of boxes, not sure how to tell the script to use them yet, sychronisation? Or maybe every box with specific phrase (MCC_shop_inventory_[number])

still forum
#

if(DAC_Basic_Value > 0) then {exit}; Like.. WTF is that supposed to be?

lone glade
#

hahahahah digging through MCC

still forum
#

exit is a >10 year old SQS only thing. And he is using it in a SQF script

#

if he want's to exit he has to use exitWith which probably didn't exist back then

lone glade
#

or breakOut

still forum
#

That code is broken.
He want's to exit if DAC_Basic_Value > 0 But what he does is nothing and just continue running.

#

So don't tell me he knows what he is doing

#

He might have known what he has done in his SQS script 5 years ago.

lone glade
#

or he didn't want to update DAC, simple as that

still forum
#

But 5 years later. And in SQF. It's just bullshit

#

If that is a SQS script the format thing might make sense. But afaik waitUntil is a SQF thing isn't it?

lone glade
#

yes it is

#

start from scratch

still forum
#

Some people also think MCC is amazing.

lone glade
#

no point in rewriting it

#

no, it's actually much easier

still forum
#

Some people think the BI Arsenal is amazing.

little eagle
#

Depends on what you mean by "amazing" I guess.

lone glade
#

at least he private his vars

still forum
#

I won't even start talking about that "code"..

little eagle
#

Why do people capitalize "true" and "false", but nothing else? Where does this come from?

lone glade
#

not using 0 and 1, pffff

#

huehuehuehue

little eagle
#

?

lone glade
#

#define 0 false
#define 1 true

still forum
#

using 0 and 1 as numbers would actually be more efficient

little eagle
#

That is a stupid idea alganthe, and you know it.

still forum
#

yes

#

but better than just overwriting other peoples vars without asking them

lone glade
#

time to have the scope talk again

little eagle
#

I wonder what ancient magic is behind this one: waituntil {((getdir DAC_StartDummy) > 170)};

still forum
#

when you call a function it creates a new scope

#

yess...

#

no.

#

No.

lone glade
#

and that's exactly why you privatize ALL local vars

little eagle
#

People not using private are dumb.

lone glade
#

because finding those issues is ulcer inducing

subtle ore
#

_this

still forum
#

I right now can't think of any programming/scripting language where local variables don't carry over to lower scopes

lone glade
#

magic vars don't need it

little eagle
#

๐Ÿ– : what was the fart emoji again?

still forum
#

Besided if you "call" a real function.

subtle ore
#

๐Ÿ’จ

little eagle
#

๐Ÿ– ๐Ÿ’จ

lone glade
#

does that include emojis?

still forum
#

Just use emojii names

#

sqf is UTF-8

little eagle
#

Alganthe, I want to inform you that you used the plural incorrectly.

still forum
#

You'll have plenty space if you just use 2 "characters"

lone glade
#

wait, the plural of emoji is emoji?

#

what's the singular form?

little eagle
#

xD

lone glade
#

wrong

sullen dune
#

AI spawning/patrolling/garrisoning and spawning camps that also spawn camps, also had some other features like arty but those have been broken since arma 2

lone glade
#

"working fine" you said

#

yeah, they get stuck non stop T.T

sullen dune
#

#1 dad

nocturne iron
#

oh god that xkcd sums up my development style w

candid jay
#

I need to disableSimulation on a vehicle that is without cargo, so I wrote:

    _chair enableSimulation false;
    
    _chair addEventHandler ["GetIn", {
        params ["_chair"];
        _chair enableSimulation true;
        systemchat "ENABLED!";
    }];
    
    _chair addEventHandler ["GetOut", {
        params ["_chair"];
        if ((count (crew _chair)) == 0) then {
            _chair enableSimulation false;
            systemchat "DISABLED!";
        };
    }];
#

so when I get in, "ENABLED!" is showed. When I get out, "DISABLED!" is too. If I re-enter though, the GetIn is not fired anymore. Any ideas?

agile pumice
#

my gift to you all

#

@candid jay have you tried getinman and getoutman?

candid jay
#

no but why would that work instead

agile pumice
#

im just throwing out suggestions, I dunno

#

lol

simple solstice
#

@candid jay locality changes

candid jay
#

_chair is a global object created on server

#

maybe I could try enableSimulationGlobal instead

simple solstice
#

when you get into a vehicle

candid jay
#

except that I've shut down the pc for tonight

#

into the vehicle as cargo though.

#

not as driver

simple solstice
#

oh

candid jay
#

thank you for the suggestion

#

too tired tonight ๐Ÿ˜ƒ

simple solstice
#

well you could try using getinman

#

assign it to the player

#

and check whether the entered vehicle is _chair

#

if so do what you want

little eagle
#

Comment out the enableSimulation lines (both) to see if that interferes with it.

candid jay
#

it doesn't

#

maybe the issue is somewhere else. will dig tomorrow. thank you

little eagle
#

Maybe some bad script interfering with this one by using removeEventHandler with the wrong id or even removeAllEventHandlers.

candid jay
#

maybe it is a locality thing.

#

apparently locality changes even if only cargo gets in

#

โ€œUnits or players entering or exiting a vehicleโ€

#

but then I donโ€™t get why GetOut is called.

icy raft
#

Enjoy!

tough abyss
#

DAC....

#

DAC makes a servers FPS tank.

#

DAC was integrated into I&A for a long time.

#

@icy raft Do you need that many spawns?

#

3 spawns nested inside each other?

icy raft
#

Don't need the thirtd

#

Typo, came from before surrounding it in the main spawn ๐Ÿ˜…

lone glade
#

I&A code makes I&A code worse

icy raft
#

Made the script in 20 min so yeah