#arma3_scripting

1 messages Β· Page 10 of 1

sullen sigil
#

roger just checking i dont need to do some fancy stuff

#

ok i added 10 but now im just frozen in midair ;-;

#

i also dont seem to be able to move my camera any further than just up or down

tough abyss
#

Yes because setVelocityTransform is constantly resetting your vectorDir

#

Which locks your horizontal rotation

sullen sigil
#

is there any way to stop it doing that

tough abyss
#

Could have it use vectorDir player for both vectorDir values

#

Then it'll just follow how you're already turned instead of resetting it

sullen sigil
#

cool beans yes thats what i want

#

now as for just getting suspended in midair

tough abyss
#

Show current code

sullen sigil
#
_velocity = (_playerPos vectorFromTo _entityPos) vectorMultiply 10;
_vectorDir = _playerPos vectorFromTo _entityPos;
_sideVector = _vectorDir vectorCrossProduct (vectorUp player);
_vectorUp = _sideVector vectorCrossProduct _vectorDir;
_interval = 0;
_playerPos = _playerPos vectorAdd [0,0,10];
  addMissionEventHandler ["EachFrame", { _thisArgs params ["_playerPos", "_entityPos", "_velocity", "_vectorDir", "_vectorUp", "_interval"];
    player setVelocityTransformation [_playerPos, _entityPos, _velocity, _velocity, (vectorDir player), (vectorDir player), _vectorUp, _vectorUp, _interval];
        _interval = _interval + diag_deltaTime/10;
        if (_interval >= 1) then {
          removeMissionEventHandler ["EachFrame", _thisEventHandler]};
        },
 [_playerPos, _entityPos, _velocity, _vectorDir, _vectorUp]];
#

will sqfbin the whole thing

#

there

tough abyss
#

Also your velocity still doesn't match your interval update

#

You have the velocity at 10m/s with a total interval of 10s yet that'll only be accurate if the start and end positions are 100m apart

granite sky
#

Interval calc isn't persistent there anyway. You need to write it back to _thisArgs, like _thisArgs set [5, _interval]

tough abyss
#

^

granite sky
#

wait, you're not even passing it in :P

tough abyss
#

That above is your main issue

#

Another one is that your condition should be > 1 not >= 1

#

As you want it to be able to reach 1

sullen sigil
#

oh right

#

errrrrr

#

_thisArgs set [5, _interval] will set _interval to 5, right..?

tough abyss
#

No

sullen sigil
#

or am i being stupid

tough abyss
#

5 is the index of _interval in the _thisArgs array

sullen sigil
#

oh right

#

so i want to set that within _thisArgs array?

#

or after params or what

tough abyss
#

That command sets the value of _interval in the _thisArgs array to the current _interval value so it is saved for the next loop

#

You want to do it after you increase the value

sullen sigil
#

gotchu

tough abyss
#

Also like john said you need to actually pass interval to the code again

#

It's not in your arguments array at the end of the command

sullen sigil
#

ah

#
_interval = _interval + diag_deltaTime/10;
_thisArgs set [5, _interval];
    if (_interval > 1) then {
      removeMissionEventHandler ["EachFrame", _thisEventHandler]};
          }, [_playerPos, _entityPos, _velocity, _vectorDir, _vectorUp, _interval]];
#

like this right

tough abyss
#

That should be sufficient

sullen sigil
#

it seems to keep trying to move me after i actually get to the location

#

actually

#

i think im clipping into the roof

#

errrrrrrr

#

oh i'll just move _entityPos down a bit

tough abyss
#

Good idea

sullen sigil
#

think it may be due to my momentum too

#

hmmm

tough abyss
#

If you want to actually stop at the end the end velocity needs to be [0,0,0]

sullen sigil
#

ah

tough abyss
#

But keep in mind that'll have your velocity slowly drop to 0 over the course of the movement

sullen sigil
#

thats fine i want it to get slower as it gets shorter anyways

#

ok now the rope doesnt seem to be destroying

tough abyss
#

What is the code for destroying it?

sullen sigil
#
}, [_playerPos, _entityPos, _velocity, _vectorDir, _vectorUp, _interval]];
systemChat "hello i did a thing";
    waitUntil {_RopeLength = player distance _entityPos; _RopeLength < 3};
    sleep 0.5;
    detach _PoleBoi;
    ropeDestroy _daRope;
    deleteVehicle _PoleBoi;
#

first line there is the end of the EH bit

tough abyss
#

Did you offset entitypos only in the EH or everywhere

#

Seems like an issue with it only being offset in the EH

sullen sigil
#

everywhere

tough abyss
#

Hm

sullen sigil
#
 _entityPos = _entityPos vectorDiff [0,0,1];
                                    addMissionEventHandler ["EachFrame", {```
tough abyss
#

Wat

sullen sigil
#

thats where its offset

#

line above the EH

#

oh hold on

#

its not actually calculating vectors and stuff for the new values

#

i need to move this above the calculations i think

#

that doesnt fix it but it solves it looking a bit odd

tough abyss
#

Something is causing the player's distance from entityPos to NOT go below 3

sullen sigil
#

i'll turn it up to like 5 and see if that works

granite sky
#

That vectorDiff usage seems... wrong

tough abyss
#

It does doesn't it

#

But technically correct

sullen sigil
#

does it need to be -1

granite sky
#

I'm guessing that you want to move the entityPos 1m towards the player?

sullen sigil
#

1m downwards

#

so the player isnt moving towards a ceiling and getting stuck in it

tough abyss
#

I mean it's vec1 - vec2 so it's not wrong

granite sky
#

maybe not far enough though.

sullen sigil
#

it seems to be stopping my movement prematurely

#

i think

#

i took out the change for entitypos and didnt go into the roof

#

..which is where entitypos should be

#

maybe if i use _poleboi instead of player

#

nope

#

it seems to not be destroying when the final velocity is set to [0,0,0]

tough abyss
#

How about just put the destroy code in the condition in the EH

sullen sigil
#

setting it back to _velocity seems to work fine

#

especially as im no longer getting suck in the ceiling

tough abyss
#

I mean hey if it works how you want

sullen sigil
#

the player movement looks a little worse than i'd want but its nbd

#

so the interval thing should be fine in mp right

tough abyss
#

Your main concern for mp should be making your velocity match the actual interval you've set

#

So really your velocity should be the difference between the start and end points divided by the interval you're using

#

In this case 10 seconds

sullen sigil
#

ah right gotchu

#

no wait i dont gotchu

#

its set to multiply by 10 to get 10ms

#

do i just divide by 10 again?

tough abyss
#

No

#

Do

#

_velocity = (endPos vectorDiff startPos) vectorMultiply 1/10;

sullen sigil
#

roger doger

dire plaza
#

Hi. Trying to use DrawIcon3D. Here's what i got so far:
onEachFrame { drawIcon3D ["BombStrike.paa", [0.9,0,0,1], dir, 1, 1, 0, "Supplies inbound!", 0]; };
-BombStrike is a file in mission folder
-dir is a variable set by screenToWorld
-Intended for MP
Errors:

  1. BombStrike.paa not found
  2. How do i remove the drawIcon3D?
#

Please help.

winter rose
#

don't you also have an issue that there is no position provided (after the colour)?

#

oh
dir is a the position πŸ˜‘

dire plaza
#

...is it in mission's root
One sec let me check

winter rose
#

the naming is bad, just sayin' πŸ˜›

dire plaza
winter rose
#

dir

#

it implies a direction, not a position

dire plaza
#

I see... Looks like i accidentally removed the .paa from the folder. i added it back and tested it and it didn't work with the error "Could not load texture"

dire plaza
#

Worked, thank you;
the .paa still couldn't load for one reason or another. It's converted from a simple picture with background removed with the powers of 2 in place (256) fixed by using a basegame icon.

sullen sigil
#

always run your scripts scheduled my mellows

tough abyss
#

Except when you shouldn't πŸ˜‰

winter rose
sullen sigil
#

i am now having to reinstall my drivers 😎

#

right before i fucking kill my drivers again has anyone got any bright ideas on how to make the rope connecting the player and origin to appear taut

#

cutting its length down on each frame was NOT the move.

#

arma is also complaining about a circular reference for something with hashmap and memory leaks when (accidentally) saving the mission file -- i assume thats just due to the oneachframe eh and can be ignored?

#

oh nvm that only comes up when i accidentally exec twice

#

waitUntil {((getPos player) select 3) < 0.05 || sleep 5};
is this a valid way of waiting until the player is touching a floor or 5 seconds have passed?

winter rose
#

not at all

winter rose
sullen sigil
#

ah

#

thanks i knew i got the point across i just didnt know how to do it πŸ˜„

winter rose
#

your select 3 is wrong (select 2)
and || sleep 5 does not return a boolean

sullen sigil
#

isTouchingGround didnt come up when i searched the wiki thonk

winter rose
#

Β―\_(ツ)_/Β―

granite sky
#

wiki search is... not good.

sullen sigil
#

yeah it seems to be that way

#

hm

#

it doesnt seem to actually do anything

#

like it never completes

winter rose
#

does it happen to be… unscheduled?

sullen sigil
#

i think this is outside of the scheduling bit probably πŸ˜…

#

is there any issue with just

#

scheduling my entire script

granite sky
#

(in which case you should really turn on script errors)

sullen sigil
#

i have them turned on

#

can i just schedule the entire thing

#

would save me a lot of pain

winter rose
#

I don't know your script so perhaps

sullen sigil
#

actually no this should be scheduled

#

i think

winter rose
#

you cannot wait in unscheduled

sullen sigil
#

thats the entire script

#

but

#
sleep 0.5;
ropeDestroy _daRope;
detach _PoleBoi;
deleteVehicle _PoleBoi;
private _time = time + 5;
waitUntil {sleep 0.1; isTouchingGround player || time >= _time };
player allowDamage true;
systemChat str (isDamageAllowed player);```
winter rose
#

if (_magazine isEqualTo "KJW_Grapple") then {
replace with
if (_magazine isNotEqualTo "KJW_Grapple") exitWith {};
and save a scope

sullen sigil
#

i set the sleep at the top for 5 seconds and it worked

winter rose
#

line 17, your indent is off by 1

#

line 20 and 21, too

sullen sigil
#

which way

#

im writing this all from ADT debug console so

winter rose
#

don't

#

how is it comfortable
how do you see all your code

so make an sqf file and edit it with VSCode, run it with execVM
this way you can remove/readd and it gets your updated code without restarting your mission

sullen sigil
#

i cant read any smaller πŸ˜„

open fractal
#

I second VSCode

sullen sigil
#

I use atom atm

#

Probably will change to VSCode soon but im lazy

winter rose
#

don't

open fractal
#

I'd recommend defining functions for your handlers instead of making a big nested thing like that

winter rose
#

be ultra active for your own comfort
be lazy for your code (write the smartest)

sullen sigil
winter rose
#

while I can get the lol part, I also have to say it is painful for people helping you as well

sullen sigil
#

i still dont know what i did wrong initially

winter rose
#

"excuse me, how can I prevent my wallpaper from falling, I add glue but it doesn't stick - also, how can I reduce the tapwater's temperature?"
"your house is on fire, just get out of here!"

sullen sigil
#

my main issue is i dont actually know when i would use functions in this instance or why its better than doing this

winter rose
#

1/ make an SQF file and/or a function
2/ use a proper editor
3/ set your game windowed

if just an sqf file used with execVM:
4/ temporarily setup your code to remove/readd the event handler on each execution, this way you can refresh easily

#

why its better than doing this
google Hadouken code style, you will see

sullen sigil
#

i get street fighter

winter rose
#

exactly

sullen sigil
#

is it bad i see nothing wrong with that

hallow mortar
#

It's functional (probably) but difficult to read or modify

winter rose
#

no, but with experience you will
we provide you a shortcut with our advice πŸ™‚

sullen sigil
#

the thing is i usually create things in like one or two days so i never really forget things

winter rose
#

code as if the next person to inherit your code knows where you live and has a really big knife

sullen sigil
#

its simple enough isnt it

#

i prefer this over having to open like 5 windows for my functions πŸ˜…

winter rose
#

"oh, there is an issue in this aspect"
"okay, where does adding the event start, where does it stop… oh wait, this part is scheduled, ah but no my indent is wrong so it's still part of the EH"

#

nay

#

how does one eat an elephant?
piece by piece πŸ˜‰

sullen sigil
#

i was taught intendation was just for appearance thonk

open fractal
#

it'll automatically indent sqf

sullen sigil
#

yeah but that doesnt actually teach me anything innit

ocean folio
#

if you use VSCode with the SQF extension you can format with right click

winter rose
open fractal
#

you can look side by side and decide which looks better

#

and then implement that indentation style in the future

hallow mortar
#

Indentation is purely for appearance, but if you have to use too much of it, you risk losing track of what level you're at and consequently where your }; should be, which is bad

sullen sigil
#

i think installing VSCode is probably the move

sullen sigil
#

ADT debug console is little more than atom with a quick click thingy

ocean folio
#

the thing for VSCode that did it for me was that I can have Ace and CBA functions

sullen sigil
#

oh word??

winter rose
ocean folio
#

lmfaooooo

sullen sigil
tough abyss
#

I just use notepad++ syntax highlighting and having a biki tab constantly open for reference

#

The true programming experience

sullen sigil
#

i had like 20 biki tabs open this morning trying to figure everything out πŸ˜…

ocean folio
#

I never understood the devotion to notepad++

tough abyss
#

It's simple and not bloated

winter rose
#

it was excellent at one point; now I feel like it is lagging behind

open fractal
#

notepad++ doesn't phone home to microsoft

winter rose
#

still excellent for "simple" text edit with plenty of neat features, and xtra fast

ocean folio
tough abyss
#

Fuck it maybe I should start writing my addons with HxD

#

Have it installed already

ocean folio
#

0_0

#

that is a terrifying concept lol

sullen sigil
#

write them with google slides

open fractal
#

all my homies make arma addons in scratch

tough abyss
#

I do all of my sqf debugging with outlook vbs scripts

ocean folio
#

catch me writing sqf functions in excel macros

sullen sigil
#

@winter rose its quite obvious you wrote this page

winter rose
tough abyss
#

Arma 4 will only support a PnP abacus for math functions

ocean folio
#

hol up pause

#

there's a Vim plugin for SQF?

tough abyss
#

Good luck getting out of it

ocean folio
#

thats wild

winter rose
ocean folio
#

should be

tough abyss
#

Think there's also +wq or something like that

#

Haven't touched vim in forever though

ocean folio
#

there are a lot of ways to get out of vim

winter rose
#

"Vim random text generator: get a N++ user on your PC and get him to try and quit Vim"

sullen sigil
#

i will now be writing my code all on the same line

tough abyss
#

Shoutout to my early programming days spent writing batch code in notepad

#

No syntax highlighting and a blinding white background

#

Just as god intended

ocean folio
#

yup, I remember doing that in high school

sullen sigil
#

i used to do retextures in ms paint

ocean folio
#

we always wrote batch files at school because for some reason we could execute them when everything else was locked down

sullen sigil
#

ok back to the original point i can get indentation i just dont understand why id make functions when im only really running most of this once

winter rose
#

SOLID concept: Single responsibility

#

one big chunk of code, it's tough
multiple small ones, well defined, you know where to debug

tough abyss
#

Because the point of functions isn't JUST to make something easier to repeat

#

^^

sullen sigil
#

i can get sticking the EH into a function too but beyond that its mostly just variables and shit

ocean folio
#

you can still have single responsibility in a full sqf file though? There's nothing stopping you from writing little sqf's with one job. Unless its just best practice to do so

sullen sigil
#

hang on the bit lou sent me seems to be working after doing the indentation thonk

ocean folio
#

I underutilize functions in sqf though. I really should use them more, even just so I get comfortable with them

sullen sigil
#

i cant even manage to get a function compiled into an addon πŸ’€

winter rose
#

not sure I can πŸ˜„

ocean folio
#

from my one time compiling an addon, you need a fair bit more than just the function to do that

sullen sigil
#

i literally copy pasted the wiki example and substituted my bits in and it didnt work πŸ˜‚

#

and i feel a lot more people would be complaining it if was the wiki example which was wrong so

ocean folio
#

did you try copy pasting it and not substituting your bits?

#

that's how I learned

sullen sigil
#

yup

#

still didnt work 🀷

#

i managed to get it working within a mission file though so

#

god knows

#

anyways does anyone know how to make a rope not break when its too short

ocean folio
#

I guess you would have to know what you want it to do instead of break

#

just reading the page on the wiki for when a rope breaks

const float maxRopeStretchLength = (desiredLength * maxRelLength) + maxExtraLength;
if (currentLength > maxRopeStretchLength) { /* breaks */ };
#

you might be able to make a check for the rope about to break, then have some kind of handling for it

#

but I wouldnt exactly know how to do that either. I've never messed with ropes before

winter rose
#

drawLine3D

sullen sigil
#

Aha searching maxropestretchlength brings up the page I was looking for

#

There's 2 pages named ropes on the wiki πŸ˜…

sullen sigil
#

from the look of it you can only do colours

hallow mortar
#

No, it's a "virtual" line, like the bounding boxes when you select something in the Editor. Ropes are real models.

sullen sigil
#

yeah i figured as such

ocean folio
#

I think drawLine3D might be useful for detecting if a rope will break. Though..... I dont know if there's a way to get the distance of it

sullen sigil
#

its just a cosmetic thing so wont bother with anything super complex just for making the rope appear taut while it pulls in the player

#

well

#

"pulls"

ocean folio
#

pretty sure you can properly pull a player with a rope if they are in ragdoll

sullen sigil
#

this is the second version of the script im doing ive got it working fine

#

im just on cosmetic bits now

#

one second i'll get a screenshot of what i mean

#

looks pretty crap for something which is meant to be pulling the player

ocean folio
#

if you want the rope to be taught, you could always just shorten the rope based on the distance between the player and the source

sullen sigil
#

i tried that and it broke my drivers

ocean folio
#

broke your.... drivers?

sullen sigil
#

to be fair i was running ropeCut on an oneachframe handler

#

but yea drivers went poof

ocean folio
#

wtf lmao

sullen sigil
#

my thoughts exactly πŸ˜ƒ

#

i could try get ropeunwind working to sync with the players speed but the players speed isnt meant to be constant so it looks more natural

ocean folio
#

nah nah, ropeunwind on a per frame event handler that shortens it to the distance between the player and the target. You can set the speed so it happens almost instantly

sullen sigil
#

nope, 20ms is the maximum

#

i was using ropecut so that it did it almost instantly

ocean folio
#

is the player going faster than 20 meters per second?

sullen sigil
#

yup

#

but the rope also stretches so it feels less than 20ms

ocean folio
#

holy fresh hell lmao thats faster than I was thinking

sullen sigil
#

yeah its an ascension cable

#

so somewhat fast

brazen lagoon
#

im trying to use cutText ["", "BLACK FADED", 0.001]; to have a black screen while i do some setup in onPlayerRespawn, but if you move a player out of a vehicle it breaks that. i tried putting another cutText call in right after the moveout command but it doesn't work. Any suggestions?

#

i just want a black screen that's persistent even if you get out of a vehicle

#

trying out BIS_fnc_blackIn rn

torn elm
sullen sigil
#

relative on ropeUnwind seems to be broken... πŸ€”

#

unless im misunderstanding the wiki

#

which is quite possible

#

i think i am though its unclear so i cant be sure

#

yes i think i am

winter rose
#

therefore*

sullen sigil
#

i thought it meant resize as in just set the length to that

#

english being unclear

winter rose
#

true = "add/remove given length from existing rope"
false = "set rope's length"

#

examples are I hope clear enough

sullen sigil
#

yeah i get it now its just a fault of the english language being unclear as a whole

winter rose
#

can't fix that πŸ˜„

sullen sigil
#

yeah i know i dont have any suggestions on how to make it clearer either πŸ˜…

#

i think im done now its just messing with offsets

tropic mirage
sullen sigil
tropic mirage
#

If I ever break a script to the point my drivers decide to retire, then I know my days with SQF are over

sullen sigil
#

i think it was probably as a result of it trying to do two things at once to the rope when it was trying to destroy it or smth

#

correct indentation seems to have fixed its scheduling for some reason so idk

#

just fooling with offsets and mp testing now

#

and detecting when it hits a unit

#

feels much nicer than the last version but thats probably because it uses maths which i dont understand properly πŸ’€

tough abyss
#

Tl;dr the way it works is this

#

you give it a starting and ending value for position and rotation vectors

#

It computes the difference between the ending value and beginning value

#

Then adds a fraction of that difference to the starting value (based on the interval) to make the starting value smoothly transition to the ending value

#

Which all in all is referred to as linear interpolation aka lerp for short

ember wing
#

Is there a way to make Lambs a script for a mission instead of making it mod to download? Reason I ask is because I have VCOM AI as a script so it runs with my mission. ANY ideas?

tough abyss
#

I mean yeah

sullen sigil
#

i understand this a bit more now

tough abyss
#

@ember wing Most of it should work fine without needing to change much so long as you copy all of the files over, main thing would be needing to fix any paths that refer to the mod's pathing

#

Which would mainly be in CfgFunctions if I had to guess

#

@sullen sigil glad it makes more sense

sullen sigil
#

idk where youre from so this may not make any sense to you but i did alevel maths and thats the absolute extent of my maths knowledge

tough abyss
#

Sounds like a europe thing and I am not a Europe person

sullen sigil
#

if youre american then its similar to AP but a bit more complicated content

#

idk what it is in other continents

ember wing
sullen sigil
#

either way i only lightly touched on vectors in three dimensions

tough abyss
#

Vectors go from hilariously simple to mind meltingly complicated fairly quickly depending on what level of math you're working with

#

For the most part arma doesn't require any of the insanely difficult stuff though

#

The peak of arma's math difficulty is probably matrices

#

Which aren't even really that complicated for the few uses you'll ever have for them

winter rose
#

I survived so far without knowing what a matrix is

#

I am a happy ignorant
OFP:R made me understand sin & cos πŸ˜„ not school

tough abyss
#

They let you do some vector operations quicker but you never really need them in arma from what I've seen

#

Only thing I've ever used them for is adding quaternions

#

Because doing those without matrices is horrible

drifting portal
#

I want to set the skill of AI based on how many people are on the server
which one is better to use in this case?
PlayerConnected or OnUserConnected event handler?

#

also is the best way to count the players on the server in this case it to use count allplayers ?

winter rose
#

(and yes, I know, allPlayers also listing headless clients)

drifting portal
#

Returns a list of currently played units

#

hmm

#

is there a way to return the number when the player haven't chosen a character from the lobby yet?

#

count allUsers?

winter rose
#

I did forget about these - thanks!

fierce loom
#

Is there some way to increase the capacity of a box in the editor?

#

something simple like "setObjectCapacity" in the init field would be my first guess but I don't know the actual syntax

winter rose
drifting portal
copper raven
drifting portal
#

yeah that's true but my question is isn't it more direct to use allUsers to achieve finding how many players are on the server, with occupied or with no occupied slots?

copper raven
#

if you want to slow down your code, you can go for it πŸ˜„

drifting portal
#

oh so its slow?

#

alright thanks for telling me

sullen sigil
#

the most complicated it got was having to write them stacked on one another

#

i think i could attach the rope to the muzzle this time around though with the matrices function πŸ€”

winter rose
#

what the heck is that πŸ˜‚
first time I see this!

sullen sigil
#

discovering the forbidden error messages

winter rose
#

maybe "zomg too much code in isNil", unsure

sullen sigil
#

there is literally nothing on google for error gif pre stack size violation

#

its not even written on a stackexchange or anything

#

wtf have you done

winter rose
#

…scripting (sorry!)

sullen sigil
#

not haram

open fractal
#

memory allocation flag?

winter rose
sullen sigil
#

scripting is good πŸ˜ƒ

sullen sigil
#

...except for when i try do it

#

then its not halal

gritty parrot
#

Requires cba_a3

atomic flint
#

Hey I'm trying to make the base game taru bench able to be sat on like the transport variant, is there a certain code or something to be used?

winter rose
#

almost (because I am a feature creep) finished my choice dialog

tough abyss
#

Now what about an illusion of choice dialog

winter rose
#

ez, provide the same code in the exec arguments 😎
I'm quite happy with this one - the image ratio is automatically done, can be forced, the text is optional, yeah, so far it's pretty cool!

tough abyss
#

Pretty neat nice job

manic sigil
#

Damnit... I'm testing my local mod-mounted project, and every time I load in Mike Force with it running, the mission immediately 'Mission Failed' T_T

manic sigil
#

Okay, so it is my mod.

ocean folio
#

does anyone know of a way to get the dynamic loadout presets for an aircraft?

warm hedge
#

Do you mean what you can set in Eden Editor?

#

Located in configFile >> "CfgVehicles" >> typeOf plane >> "Components" >> "TransportPylonsComponent" >> "Presets"

ocean folio
#

that.... would be exactly what I was looking for πŸ˜†

#

thank you!

drifting portal
#

is there a good way to move 3den camera below the terrain?
Tried this but it didn't work:

_pos = getpos get3DENCamera;
_pos set [2,-10];
move3DENCamera [_pos, false];
#

it lifts me back to the ground

warm hedge
#

You can't, Engine limitation

drifting portal
#

with a bunch of objects around the character, and have the "studio" not be discovered by players

#

because there is a CAS player in the mission

hallow mortar
#

Just put it out of bounds at the other end of the map. CAS won't pay too much attention to the ground outside the AO and especially outside the map.

drifting portal
#

you can collide with them

#

but they are hidden

#

around -2000m they start doing weird stuff (phasing in and out of existence or straight up disappearing but the collision remains)

#

is this an engine limitation?

#

probably has to do with maximum bounds the map maker set or something?

#

to explain what I mean

#

it is as if the building is only visible when the camera doesn't cross a certain barrier

#

regardless the in game preview (as a player) will have the building hidden with collision on (isHidden returns false)

proven charm
manic sigil
#

Alright, I've got all my functions lined up, packed into a PBO, and all of them tied into an executing function... now how do I have that function execute on a server?

It's currently preInit = 1'd, but I've had to manually call the function to get things kicked off. The article for addon making also mentions event handlers; am I correct in thinking it would be something like:

addMissionEventHandler ["PreloadFinished", {
call srd_fnc_MFAIOexecute;
}];
proven charm
manic sigil
#

Addon

proven charm
#

ok

manic sigil
#

If I'm reading right, postInit = 1 should just call the function, once the mission begins, but I find I have to manually call it to have it activate ._.

proven charm
#

can you show the source code of the file/function?

proven charm
#

hmm are you sure it doesn't run? because systemChat may not work at beginning of the mission. to debug things like this is better to use diag_log

manic sigil
#

Yeah, the functions it calls on have their own systemChats, which run when I boot up arma. And it doesn't spawn in the truck or helipads that it's supposed to.

#

But those functions are compiled, and if I call this function, it all kicks off fine.

proven charm
#

ok, then I'm not sure whats wrong

#

make sure your variables are defined such as MarkerUpdateCheck

manic sigil
#

Yeah, missed that one, but it hasn't caused a problem so far - just a backdoor 'oh shit this isn't working, gotta shut it down'. When called, it all runs properly.

proven charm
#

ok

manic sigil
#

... didn't I, though? Right before it, missionNameSpace setVariable?

proven charm
#

not 100% sure though since this is addon and missionNameSpace is for running mission

manic sigil
#

Yeah, didnt work out.

cyan dust
#

Is there a command not to forceWalk player when unit load exceeds max?

proven charm
#

try enableFatigue or enableStamina

cyan dust
proven charm
#

maybe player setUnitTrait ["loadCoef", 0];

#

@cyan dust

cyan dust
frank mango
hallow mortar
manic sigil
#

I think preStart = 1; did the trick for me, but doing more testing to be sure.

drifting portal
#

setRandomLip doesn't work for agents?

little raptor
#

(unless you had disableAI "ANIM")

drifting portal
#

sorry for ping by mistake

dreamy kestrel
#

I don't recall exactly, is there a way to tell if a POSITION is within the bounding box of an object, building, container, etc?
I see there is BIS_fnc_isInsideArea, which gets us lateral containment. But what about the vertical?

winter rose
#

well, that wouldn't work with angled vehicles.

dreamy kestrel
#

perhaps getting direction from the object, and with the isRectangle c variant.

#

other than that maybe inPolygon, though I'm not sure what the polygon would be on a house or container model bounding box; the corners perhaps?.

little raptor
#

then simply check each coordinate component against bb one's

#
#define INRANGE(x, min, max) (x >= min && x <= max)

INRANGE(_pos#0, _bb#0#0, _bb#1#0) && ...
dreamy kestrel
#

how do you mean each coordinate? and does that account for rotation, azimuth?

winter rose
dreamy kestrel
# little raptor yes

I am a bit confused that it would account for rotation. Isn't the bounding box just that, the box it would take to contain the model? apart from rotation, etc.

little raptor
#

confused that it would account for rotation
you're doing worldToModel

#

everything is in the model coord

#

including the box

dreamy kestrel
winter rose
#

need to determine if a unit is contained within an object
that's what you are trying to do; but what is the use case?

dreamy kestrel
#

so the driving condition is 'container contains unit'

winter rose
#

ah, OK! and thanks (I didn't get it as you meant at first)

winter rose
dreamy kestrel
# little raptor everything is in the model coord

huh okay; actually, that raises another question. we are compiling a hashmap of object bounding boxes, mainly for use with a safe radius. but there are instances such as this one that we may actually want an 'actual' bounding box, for cases like this.

little raptor
winter rose
#

yes, then inArea works fine

little raptor
#

wat? there are only 2 values

#

it's a 1D range

winter rose
#

X, Y and Z no?

dreamy kestrel
little raptor
#

you could do that via inArea but it's 10x more complex

winter rose
#

so _relativePosition inArea _areaDefinedByBBoxDimensions ?

little raptor
#

oh you mean inArea 3D?

winter rose
#

yes

little raptor
#

right I forgot that existed notlikemeow

winter rose
#

who knows if there are multiple containers etc

dreamy kestrel
#

we'll cross that bridge later 🀣 βœ–οΈ

#

perhaps one container per unit group, but anywho...

#

so inArea with Z comprehension would work then. without needing to πŸ’ around with world or model coordinates?

little raptor
#
private _bbCenter = _bb#0 vectorAdd _bb#1 vectorMultiply 0.5;
private _bbSize = _bb#1 vectorDiff _bb#0 vectorMultiply 0.5;

(_obj worldToModel ASLtoAGL _pos) inArea ([_bbCenter, _bbSize#0, _bbSize#1, 0, true, _bbSize#2])
little raptor
dreamy kestrel
#

no worries, I'll pursue the inArea approach and experiment a little. thanks both of you.

lapis ivy
#

Hello. I use the trigger along the river, creating the sound of the river, since it is missing. I need it to work in multiplayer.

if !(player inArea _this) exitwith{};
while {player inArea_this}do
{
      playSound "River";
      sleep 90;
};
};```

The problem is that when I leave the trigger, the sound continues to play.
#

If I add this sound through the sound effects tab in the trigger, then the sound works for all players, even those who are not near or in the river and should not hear it.

winter rose
#

or createVehicle a CfgSFX

lapis ivy
winter rose
little raptor
winter rose
#

that's a bit harsh πŸ˜„

dreamy kestrel
winter rose
lapis ivy
winter rose
# lapis ivy That's right, I need 2d

what exactly do you want to do:
a 2D sound will be playing however you are turned from the river, absolutely not related to its position - no left/right ear channel changes

lapis ivy
#

I don't know how to turn off the sound when I leave the trigger.

little raptor
dreamy kestrel
lapis ivy
dreamy kestrel
winter rose
#

you could do calculations to have only one CfgSFX sound source that is placed regularly on the point in the river the closest to the player

#

buuut that's tricky ^^

dreamy kestrel
#

not having the audio file to gauge, bit difficult to meaningfully feedback. but it sounds interesting.

dreamy kestrel
#

🏁 🏁 πŸ”

drifting portal
winter rose
#

try PiP while you are close to it

drifting portal
open fractal
#

Is there a reliable way to make all doors of a building open and stay open for every player?

#

I tried the Edit Terrain Object module but doors stay closed for clients

sharp grotto
#
[_building, 'Door_1_rot'] call BIS_fnc_DoorNoHandleOpen;
[_building, 'Door_2_rot'] call BIS_fnc_DoorNoHandleOpen;
[_building, 'Door_3_rot'] call BIS_fnc_DoorNoHandleOpen;
//etc
open fractal
#

is this reliable for terrain objects in MP?

sharp grotto
#

yes, iam not aware of any problems

open fractal
#

you've used it in MP and have not had any problems?

sharp grotto
open fractal
#

I'll give it a shot thanks

sharp grotto
# open fractal I'll give it a shot thanks

You can also disable the doors actions by doing this

_building setVariable ["bis_disabled_Door_1",1,true];
_building setVariable ["bis_disabled_Door_2",1,true];
//etc
versed belfry
warm hedge
#

No

versed belfry
#

Oh, ah welp gonna have to work with that :(

#

Thanks for the quick answer tho

warm hedge
#

If hideObject doesn't fit into, there's nothing

versed belfry
#

Yea sadly with hideObject you can't lock on the vehicle.

#

I'm trying to use a hidden plane to attach a cruise missile object to it and give the players the ability to shoot down the "cruise missile".

smoky verge
#

is there any way to edit the end mission statistic window?
the one that says "your kills" "casualties" etc

#

or rather, add onto the existing categories

smoky verge
#

checked that, only seem to edit the initial screen

warm hedge
#

The screen that can be shown ingame not in debriefing am I right?

smoky verge
#

I guess one way to add the stuff I need is to manually create the casualties/kills

warm hedge
#

What's your goal?

smoky verge
#

I need 2500000 civilians added to the casualties list
just as a single line I don't want 2500000 individual names
and before you ask its not for a stupid overused joke
what if I named a blufor unit "2500000 civilians" and killed it
it should pop up right?

manic sigil
#

If it's type was 2500000 civilians, yeah

#

Or would that be Kind?

smoky verge
#

I did see first names in the list, so I assumed identity would work

#

mhm I can only see the type in the list I have no idea how to show names like in the link

dreamy kestrel
#

Back to my inArea question... re: bounding boxes... when we're talking angle, rotation angle, is that literally what getDir _target reports?

Also with regard to "Cargo_base_F" classes, I believe the editor (directional?) orientation is breadth-wise, if that makes sense, correct?

Just trying to orient bounding box XYZ elements appropriately re: a, b, angle, and c vectors, if that makes sense.

https://community.bistudio.com/wiki/inArea
https://community.bistudio.com/wiki/boundingBoxReal

I can probably make some best guess estimates, but if someone happened to know...

Thanks...

dreamy kestrel
# dreamy kestrel Back to my `inArea` question... re: bounding boxes... when we're talking `angle`...

If I read the docs correctly, a is X, b is Y, c is optionally Z, rotation only, strictly speaking, not speaking of azimuth, i.e. when you rotations along XYZ axes. so hence the more detailed analysis involving world model coordinates, I imagine.

The container models themselves, the "width" axis in particular is also a bit tricky, I think; cause there is some buffer in the model allowing for opening of doors, so I want to reduce that width accordingly.

Bit difficult to see the model bounding box in the editor. But to give the sense of the bounding box. Best guess, 80% 90% of the model width of box is the actual model, not counting opening doors. Totally experimental.

https://pasteboard.co/O7wFyrILAD5Y.png

winter rose
#

my best guess is, if it is a one-object thing use manually-provided measurements

dreamy kestrel
#

Yep, from some preliminary assessments, medium container re: player positions...

[medium distance player, getpos player, getpos medium, boundingboxreal medium]

Yields,

[4.50015,[14568.4,16119.3,0.00144386],[14571.8,16121.9,-3.43323e-005],[[-4.67598,-1.24,-1.32431],[4.67598,1.24,1.32431],5.00877]]

These are the raw, 'precise' numbers real gives us. Which includes some buffer for doors opening.

#

But I think with that, I can better work with this and make some educated guesses.

fierce solar
#

how to disable collision of an object with every player

warm hedge
#

You can't

#

An object can't disable its collision with more than one object

little raptor
warm hedge
#

Hm, good to know. I must be misremembered then

smoky rune
#

is there any way to localize role description in the lobby screen?

smoky rune
#

yeah, I know about stringtable and already actively use it, but how to pass string key to role description in 3DEN Editor?

exotic flax
#

You can set a custom role description in Eden (Edit Object -> Object Control -> Role Description), however to localize it you will need to modify the mission file and replace the string with Stringtable variables.

smoky rune
exotic flax
#

although it might work when setting the Stringtable string directly in Eden, never had to use it though

smoky rune
#

I tried to put $STR_ROLE_NAME/localize "STR_ROLE_NAME" there, it still treats it as ordinary string

smoky rune
#

brb

exotic flax
#

if I recall correctly it should be

// object in mission.sqm
description = $STR_ROLE_NAME;

while adding it in Eden will always add quotes around it

winter rose
#

if it works without, it is the engine trying to be nice and understanding

#

you can actually try in a CfgSounds, name = My Sound;

#

(perhaps not spaced, but underscored - to be checked)

exotic flax
#

hmmm... KP-Liberation uses "@STR_ROLE_NAME" (ampersand instead of dollar sign) πŸ€”

#

although I guess they use some weird replace stuff

smoky rune
#

Yeah, putting @ before string key works
Once again - thanks

exotic flax
hallow mortar
exotic flax
#

decription.ext is a config file, mission .sqm is not πŸ˜‰

#

at least not the same as regular config files

hallow mortar
#

CfgSounds (which is description.ext) was mentioned so I assumed there must be some degree of relevance

proven charm
#

when creating JIP calls is it called on client after client's init.sqf or some other point?

#

like: remoteexec ["jipTestFn", west, true]; When does jipTestFn get called on JIP client?

willow hound
proven charm
#

so init.sqf is not the right place to define the jipTestFn function?

willow hound
#

init.sqf is not the right place to define any function krtecek

proven charm
#

well that's what I use anyway πŸ™‚

willow hound
#

But yes, the table says that in multiplayer, init.sqf runs after persistent functions are called, so you should not be able to persist a function call to a function you defined in init.sqf.

proven charm
#

ok

#

yeah init.sqf does not seem to work if there's any delay

#

so I have this for the JIP functions: sqf class CfgFunctions { class Teeeest { class InitFns { class JipTest { file = "jipFns.sqf"; preinit = 1; }; }; }; }; i guess that's the only way?

hallow mortar
#

You should define all your functions in CfgFunctions rather than init.sqf anyway

proven charm
#

I have so many functions it would take years to put them all there πŸ™‚

hallow mortar
#

Arguably even more of a reason to do it

#

It's not difficult to do, just cut & paste each one to a new file and add 1 new line to cfgFunctions per function. Should take 15 seconds per function at most.

proven charm
#

i appreciate the feedback but seriously I have so many functions that Im choosing the lazy way and just create the all via init.sqf . Everything is organized in files though which are execVM'ed

hallow mortar
#

If you've already got them all in separate files then this isn't the lazy way, it's exactly as much work as cfgFunctions, but worse performance and less remoteExec-ability

proven charm
#

I mean lot of functions in one file

hallow mortar
#

Look, I can't make you do anything you don't want to, but please understand that you're deliberately choosing to make things worse in the long term in order to save a few seconds now. If you truly have so many functions that it'll take more than 10 minutes to convert them all, it's very likely that the performance difference will be noticeable.

proven charm
#

i appreciate the fact that you are trying to help me but you really can't guess how many functions I have πŸ˜„

#

btw i guess there's no way to run some function files in CfgFunctions in client and some in server? or do I just do that inside the file? (hasInterface etc)

little raptor
#

do I just do that inside the file? (hasInterface etc)
yes

south swan
#

or move server-only functions to servermod, i guess

little raptor
#

and it was worth it blobdoggoshruggoogly

#

it saves you a lot of time in the future because whenever you want to add a function you just add a single class fnNmae and create a fn_fnName.sqf file and you're good to go

#

plus it makes mod <-> mission transition easy for me (I make my mods in missions)

proven charm
#

ok thx for all the help guys πŸ™‚

little raptor
#

sounds like a "I won't do it anyway" 🀣

proven charm
#

lol

#

makes me wanna count how many functions there are to reason this further

south swan
#

the one thing i wish was possible with CfgFunctions is to have like 1-2 more levels of nesting

little raptor
#

why? thonk

south swan
#

to have stuff a bit more structured, i guess. For, say, a "Vehicle respawn system" to contain a "Mission maker interface" , "Server respawn logic" and "Abandon detection" sub-systems πŸ€·β€β™‚οΈ

pseudo ridge
little raptor
pseudo ridge
#

Ah! Thanks!

little raptor
#

it probably goes the same for chromatic aberration and film grain

pseudo ridge
#

πŸ™Œ

stable dune
pseudo ridge
#

@little raptor when i change Pip quality (Low, Standart, High, Very High, Ultra) the Pip Effects i have set are lost. This is normal?

#

This don't happens with vanilla Arma 3 Pip's like the ones on vehicles.

little raptor
#

idk blobdoggoshruggoogly

tender fossil
#

Wouldn't it be possible to make a cheap implicit type system by creating a plugin in e.g. Visual Studio Code and forcing the variable types by the editor itself with naming conventions or do I have some critical error in my logic here?

little raptor
#

what do naming conventions have to do with types?

tender fossil
#

I began to think about it because my SQF mastermind friend developed relatively complex stuff back in the days by creating an implicit type system with naming conventions. But why not take it to the next level and write an editor plugin for it to both automate it (easing unnecessary cognitive load) and eliminate occasional errors caused by the manual method?

tender fossil
#

The naming conventions would just mostly signal the variable type

#

So in a twisted way I think that the very core of the concept would be the same than with TypeScript, just the means to get there would be different

umbral patio
#

`private _vehicle = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
player reveal _vehicle;

hint "Votre vehicule est pret !";
life_draw_vehicle_icon = {
private _vehicle = _this select 0;
if (isNil "_vehicle" || {
isNull _vehicle
}) exitWith {};
if ((vehicle player) isEqualTo _vehicle) exitWith {};
private _distance = round(player distance _vehicle);
private _text = format["%1m.", _distance];
private _pos = getPosATLVisual _vehicle;
private _vehicleInfo = [typeOf _vehicle] call life_fnc_fetchVehInfo;
private _icon = _vehicleInfo select 2;
drawIcon3D[_icon, [1, 1, 1, 1], _pos, 1, 1, 0, _text, 2, 0.05, "PuristaMedium", "center", true];
};

private ehID = format["LIFE_ID_VEHSPAWN%1", (round random 999999)];
[_ehID, "onEachFrame", "life_draw_vehicle_icon", [_vehicle]] call BIS_fnc_addStackedEventHandler;
sleep 30;
[_ehID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
`

#

where is my error ???

granite sky
#

Paste the error.

#

"life_draw_vehicle_icon" looks like an error to me.

#

should be just life_draw_vehicle_icon without the quotes. Function takes either code or stringified code.

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
granite sky
#

Also BIS_fnc_param and BIS_fnc_addStackedEventHandler are obsolete in A3 and should be replaced with the engine commands.

hallow mortar
#

params and addMissionEventHandler

umbral patio
#

Error in expression <]] call BIS_fnc_addStackedEventHandler; sleep 30; [_ehID, "onEachFrame"] call BI> 16:42:03 Error position: <sleep 30; [_ehID, "onEachFrame"] call BI> 16:42:03 Error Suspending not allowed in this context

#

my erorrs

granite sky
#

You need to run that code in scheduled context. Spawn or remoteExec.

umbral patio
#

F(life_fnc_unimpoundCallback,ANYONE) ?

#

or client ?

granite sky
#

I don't know your macros.

umbral patio
#

#define ANYONE 0
#define CLIENT 1
#define SERVER 2

#

[_vehicle] remoteExecCall ["life_fnc_unimpoundCallback",_unit];

granite sky
#

remoteExecCall is unscheduled context. You need to use remoteExec, or add a spawn inside the function.

umbral patio
#

so like [_vehicle] remoteExec ["life_fnc_unimpoundCallback",_unit];

granite sky
#

Yes.

umbral patio
#

Works fine thanks !

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
drifting portal
#

Really weird

sullen sigil
#

Right I'm unsure if this should explicitly be in here as I think it's to do with maths, but with setVelocityTransformation, is there any way to stop the player from spinning around vertically etc when moving the camera? I'm currently using vectorDir player for both results but I think I want only one element of the player's vectorDir for this?

basically i want the player to turn like theyre on the ground with setveltransf

#

Trying to avoid this level of weirdness

granite sky
#

Something like this maybe:

_pdir = vectorDir player;
_pdir set [2, 0];
_pdir = vectorNormalized _pdir;
#

Might want some tolerance on the z rather than a hard zero.

sullen sigil
#

roger i'll give that one a shot ty

#

not quite what im looking for i dont think but im not entirely sure what i need to change

#

let me experiment a bit

#

ya i dont think this is what im looking for because i still want the player to be able to move around just not move their entire body if that makes sense

#

like theyre on the ground or falling

real tartan
#

looking for function to do SUM of values in array

granite sky
#

There's no fast method. You just have to do something like

private _total = 0;
{ _total = _total + _x } forEach _array;
copper raven
#

_array accumulate [0, { _accumulator + _x }] when meowcamera

granite sky
#

It's still running SQF per element, unless they add specific expression optimisations. Which they could, I guess.

copper raven
#

there is a very small case pool for having a specific command like that, so it having to run sqf is most optimal i think

sullen sigil
#

the maths for this is beyond my ability

tough abyss
#

@sullen sigil What's the vectorUp setting?

sullen sigil
#
_vectorDir = _playerPos vectorFromTo _entityPos;
_sideVector = _vectorDir vectorCrossProduct(vectorUp player);
_vectorUp = _sideVector vectorCrossProduct _vectorDir;```
spare vector
#

Does anyone have a script to add inventory items to random civilians...

tough abyss
#

And SVT is just using that?

sullen sigil
#

yup

#
player setVelocityTransformation[_playerPos, _entityPos, _velocity, _velocity, _playerDir, _playerDir, _vectorUp, _vectorUp, _interval];```
tough abyss
#

Mm

#

And that vectorUp is only calculated at the start right

sullen sigil
#

affirm

#

before the mission EH

#

should I stick it within the mission EH

real tartan
tough abyss
#

Hm

spare vector
#

doing military patrol... interrogate ... arrest action...
so looking to randomly give contraban items to civilians spawned with COS

tough abyss
#

@sullen sigil Yeah alright watched your video... problem is that your vectorUp points away from the rope (hence why you are angled like you are) which was intentional

#

However as a result

#

Your vectorDir movement (which is unlocked) is to the sides perpendicular to that so you rotate weirdly like that

#

There's not a great way to fix it other than either being oriented differently or just not allowing rotation

sullen sigil
#

I think I understand what you're saying there?

Is there any way to stop X and Y rotation and only allow Z? Sort of makes sense within the use of the tool

real tartan
# spare vector random items from a list ...
private _items = ["Chemlight_green", "Chemlight_blue"];
{
    _x addItem ( selectRandom _items );
} 
forEach ( allUnits select { side _x isEqualTo civilian } );

depends on type of item, change addItem to addMagazine

spare vector
tough abyss
#

@sullen sigil Yes, we can project the vector onto the plane of your movement, though I need to recall how to do so

#

One moment

sullen sigil
#

you're a legend btw thanks so much for the help πŸ˜…

tough abyss
#

No problem lol

#

Alright found it

#

As long as you're using a normalized vector (which you are) this should be sufficient

#

_vectorDir = _sideVector vectorCrossProduct (_playerDir vectorCrossProduct _sideVector);

#

Set that outside of the EH with _playerDir as vectorDir player

sullen sigil
#

legendary, i'll give that a punt now -- thanks for the help dude

#

Yup, that works perfectly, thanks man

drifting portal
#

how to do I approximate a number?
e.g: 3.25 = 3.3

south swan
#

for printing or for further math usage?

drifting portal
#

for printing

#

for example I don't want 3.3123km, 3.3km is enough

hallow mortar
#

toFixed

drifting portal
#

Nicely done πŸ‘

tough abyss
#

@sullen sigil No problem, glad it worked out

sullen sigil
#

Yeah thanks dude πŸ˜„

cobalt path
#

I have a script that teleports you where you are aiming, is there a way to limit the teleportation distance to lets say 10m?

player addAction ["<t color='#000000'>Dash</t>",
{

params ["_target", "_caller", "_actionId", "_arguments"];

player setPos screenToWorld [0.5, 0.5];
player setPosASL [getPos player select 0, getPos player select 1,10000];
player setPosASL [getPos player select 0, getPos player select 1, (getPosASL player select 2)-(getPos player select 2)];

playSound3D ["A3\Sounds_F_Vehicles\air\noises\SL_rope_break_int.wss", _target, false, getPosASL _target, 5, 1.5, 0];

}];
tough abyss
#

Yes it's easy

#

though why are you doing

player setPos screenToWorld [0.5, 0.5];
player setPosASL [getPos player select 0, getPos player select 1,10000];
player setPosASL [getPos player select 0, getPos player select 1, (getPosASL player select 2)-(getPos player select 2)];

instead of just

player setPosASL (AGLToASL screenToWorld [0.5, 0.5]);
#

should do exactly the same thing

#

as for limiting the distance, you could do it like so:

#
player addAction ["<t color='#000000'>Dash</t>",
{

params ["_target", "_caller", "_actionId", "_arguments"];
private _playerPos = getPosASL player;
private _teleportPos = AGLToASL screenToWorld [0.5, 0.5];
if (_playerPos distance _teleportPos > 10) exitWith {};
player setPosASL _teleportPos;
playSound3D ["A3\Sounds_F_Vehicles\air\noises\SL_rope_break_int.wss", _target, false, getPosASL _target, 5, 1.5, 0];
}];
little raptor
#

if it's a "dash" you shouldn't use screenToWorld to begin with

cobalt path
tough abyss
#

Are you pointing at a position less than 10m away?

cobalt path
tough abyss
#

Yes one moment

#
player addAction ["<t color='#000000'>Dash</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
private _playerPos = getPosASL player;
private _teleportPos = AGLToASL screenToWorld [0.5, 0.5];
private _teleportDir = _playerPos vectorFromTo _teleportPos;
if (_playerPos distance _teleportPos > 10) then {
  _teleportPos = _playerPos vectorAdd (_teleportDir vectorMultiply 10);
};
player setPosASL _teleportPos;
playSound3D ["A3\Sounds_F_Vehicles\air\noises\SL_rope_break_int.wss", _target, false, getPosASL _target, 5, 1.5, 0];
}];
#

one way to do it

dusky pier
#

Good evening! Is it possible to get player's uid in main menu?
I have custom mod, but for some developer funcs access - i need to sort it somehow

copper raven
#

i don't think so, i guess you can hack the ui though, pretty sure you can get the uid from the profiles options

spare vector
#

Does anyone know of find the signal type of script? .. where your guys have to locate a transmission via signal strength or something

lapis ivy
#

Spectator problem. When a player dies and is resurrected, it happens that in spectator mode it shows his corpse, and not the resurrected player. There is a solution? I am using ACE.

tough abyss
#

is this place for editing addon scripts?

opal zephyr
#

any kind or arma script (sqf)

tough abyss
opal zephyr
#

What are you trying to do with cinecam?

tough abyss
#

there's a feature which prevents you from zooming in

opal zephyr
#

Are you actually doing that through an sqf file though?

tough abyss
#

pbo :/

opal zephyr
#

Do you have permission to be editing the mod? It doesnt look like a license is mentioned on its steam page

tough abyss
#

the second feature is where you press right click hold or not it just forces you in first person ads

tough abyss
#

however he is banned

#

so there's no way to reaching him out

opal zephyr
#

He's banned in this discord?

tough abyss
#

nope in steam

#

idk if he uses this discord

#

Xorberax

opal zephyr
#

It looks like their profile is just private, their vac ban has nothing to do with you being able to reach them. You could try commenting on the page to see if they respond

tough abyss
#

can't comment got a community ban

opal zephyr
#

idk what to tell you πŸ€·β€β™‚οΈ

tough abyss
#

he hasn't been working on the mod for 2 years either

#

then again this is just a custom version for me not something I will release

#

its for a video

opal zephyr
#

Check out the license page for arma and see if a default license is applied if none is specified. You might be able to edit it without redistributing it

tough abyss
#

where do I see the license page

opal zephyr
tough abyss
#

I guess this is his license?
CineCam | Cinematic Third-Person Camera Replacement
https://forums.bohemia.net/forums/topic/220040-wip-cinecam-cinematic-third-person-camera-replacement/
Copyright (C) 2018 Zooloo75
REQUIRES: COMMUNITY BASE ADDONS

#

the code was originally made by Zooloo tho

#

nvm its the same guy

opal zephyr
tough abyss
#

looks like I don't have to comply with them

#

but my intentions aren't breaking any eula either

opal zephyr
#

What makes you not have to comply with it...?

tough abyss
opal zephyr
#

Ok then, what are you having trouble with script wise?

tough abyss
#

Im having issues understanding which code does what Im struggling to find the very code that is responsible for preventive third person aim and preventive camera zoom in

#

when I press right click it instantly goes to first person ADS no matter how I press it. hold or non hold it instantly goes to ADS First person

#

the mod also disables some of arma 3 vanilla zoom in features

#

which belongs to view

opal zephyr
#

Does the mod have a section in controls? It may be possible to just fix through that

tough abyss
hallow mortar
opal zephyr
#

I mean in game controls, not in the code

tough abyss
#

to a something else in logitech

#

but it doesn't work as intended

#

I found a decent workaround to that bit but even if it works it still is janky while the camera zoom in vanilla being disabled haven't really found any work around on that part

#

or prevented somewhat that one is also a issue

#

there's no configurable option to turn this on or off unfortunately which is why im requesting for help

opal zephyr
#

NoUserName, there really isnt a lot we can do to help without an actual code example

tough abyss
opal zephyr
#

If you have a specific block you want help with. I don't have the time to sort through thousands of lines of code looking for a solution to a unspecific problem

tough abyss
#

Im just gonna assume

#

considering the offset settings that are configurable is obvious enough if I don't include them the text won't be as long as anticipated

drifting portal
tough abyss
drifting portal
#

That's a large block of code

tough abyss
#

yeah

drifting portal
tough abyss
#

what does it do?

#

allow you to copy the text and turn it into a compressed folder?

drifting portal
#

It's a website where you can paste the code and it will have sqf syntax highlights

#

Plus makes it easier to read than a discord chat

#

That's what most people here use when sending large chunks of code

tough abyss
#

how do I make him read through the website tho I can't really post images

drifting portal
granite sky
#

(it makes a link for you and you paste that here)

tough abyss
#

oh I see

#

thanks

opal zephyr
#

ya that sqfbin is empty

tough abyss
#

idk why discord doesn't directly respond

opal zephyr
#

nah, it just takes me to the default page. Anyway, it looks like they are adding keybinds with cba, what are the ingame binds that you see?

tough abyss
#

idk if it could be this one that is responsible for thirdperson switching to first person when press right click if (vehicle ThirdPerson_FocusedUnit != ThirdPerson_FocusedUnit) then {
switchCamera ThirdPerson_FocusedUnit;
} else {
if (ThirdPerson_IsInFirstPerson) then {
if (ThirdPerson_IsAimingDownSightsFromThirdPerson) then {
ThirdPerson_FocusedUnit switchCamera "gunner";
} else {
switchCamera ThirdPerson_FocusedUnit;
}
} else {
switchCamera ThirdPerson_Camera;
};
};

tough abyss
#

Ok so I solved that part with the right click

#

now its all left is the preventive zoom in

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
stable dune
#

Good morning,
Is there guide / wiki page to add to my script ability to change options via addonn menu?
I mean in editor

Options - configure addOn options -

Override.
Server [x] client [x] mission [x]

Cannot send picture here , so if my question is not clear , let me know, so I will explain again 😁

open fractal
#

refer to their docs

stable dune
#

Thanks , i will look from there

tough abyss
#

CBA_fnc_addSetting to be exact

stable dune
#

Nice, this helps me alot

tough abyss
#

glad I could help

frank mango
#

Can i rotate a spawned object?
Specifically I have a small script which spawns a missile but the missile is spawned at 90 degrees. Can it get it to spawn facing upwards?, if so how?

tough abyss
#

Yes, you can, by changing its vectorDir and vectorUp

#

i.e. doing something like

#
missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];

should make it face upwards

ocean folio
#

is there any particular inefficiency in loading data from a config file?

#

I guess that's a bad question lmao

#

would it be faster to load data from memory than from a config file? I dont know if those get stored in memory like variables

#

I assume it would be better to load the data from the config once and store it in a variable to call on later, than load the data from the config file once every time you need it.

tender fossil
#

Does SQF have commands that have context sensitive output data types?

tough abyss
tough abyss
#

At least, everything I've ever seen seems to imply such. Don't believe it does any further disk reads seeing as configs are basically ROM as far as the game is concerned.

ocean folio
#

well that saves me a little bit of work πŸ˜„

#

instead of loading data and saving it all in vehicle namespaces lol

tough abyss
#

I would recommend a caching system if you're frequently needing to read the same data

#

otherwise don't worry about it

ocean folio
#

how frequently is frequently?

#

if someone wanted to, I suppose they could spam the scroll wheel action, but its only once per

tough abyss
#

For that sort of thing I wouldn't worry about it

#

this would be moreso if you're looping something that could be re-accessing the same info

ocean folio
#

neat

#

thanks!

tough abyss
#

no problem

tender fossil
tough abyss
#

Depends what kind of caching you need but in most cases I'd go with a hashmap

tender fossil
tough abyss
#

I mean, you can make commands that do that, yeah

ocean folio
tough abyss
#

SQF is loosely typed so

#

functions can return and take any type unless you explicitly forbid it

tender fossil
tough abyss
#

I'm sure the engine itself does some caching in the background

#

I'm unsure of the details of any such caching, though

tender fossil
tough abyss
#

Ah

#

as far as the commands go, IIRC almost all of them if not all of them have expected argument/return types

#

not so much dynamic

#

but some can have some variance depending on the type of params, yeah

tender fossil
#

Because if we pretend for a moment that I wrote a TypeSQF to SQF transpiler, context sensitive command outputs (they exist in SQF according to a friend who knows quite a lot about it, but he didn't specify it further) cause some headache but I guess it'd still be doable

tough abyss
#

I mean they exist to an extent

#

I guess what I'd say is this

tender fossil
#

Well, in some way they have to be deterministic, so I think it would be doable (as long as the functionality of the command isn't a black box)

#

Thanks for the examples btw!

tough abyss
#

i.e. at the beginning of a function I could have

#
params ["_arr", [], [[]]];
#

which forces _arr to be an array, otherwise an error will throw

#

or if an argument can be one of many types I'd use typeName conditionals to alter the behavior based on the type

#

that's pretty much the extent to which SQF does type-based behavior

tender fossil
#

Yes, and that's why I'm playing with the idea of TypeSQF with transpiler

tough abyss
#

Well I certainly think there could be some benefit from such a thing

#

I myself am not a big fan of loose typing, though to some extent it makes things easier

tender fossil
#

SQF taught me to have a deep hatred towards loose/dynamic typing πŸ˜…

#

I basically refuse to work with even JavaScript now KEKW

tough abyss
#

Fair enough lol

#

I'd think JS would make you hate it more than SQF

tender fossil
#

But at least the length of feedback loop is more tolerable with JS than with SQF... Thinks about the countless times when I had to spend minutes to notice a simple type error in my code

#

But I'm a weird programmer anyways... I like writing documentation and I love writing human readable code (when possible), I prefer (decent/good) UIs as the main method of interacting with program with command line as fallback method for more accurate control and such... KEKW

#

Hmm, after checking typeName and params the logic behind them is clear when it comes to types. As a follow-up question: are there any SQF commands with context sensitive output data types that work like a black box from the modder's/scripter's perspective?

tough abyss
#

I mean basically all of the commands are a black box to an extent since you can't easily see their internals

#

though the BIKI documents all of the expected input/output types

#

so not really a black box

tender fossil
tender fossil
tough abyss
#

No worries

#

tl;dr if a command has any sort of noteworthy type-based behavior it'll be noted on the BIKI (hopefully)

#

otherwise there's not much other way to know

open hollow
#

i made script to save and load map markers, but when i create them i cant delete it ( mp) how can solve this ?

#

i used the last parameter but it dont seem to work ( im testing it on editor MP)

createMarker [str [getPlayerUID player ,_foreachindex], _x select 0, 1, player ];
#

solved: need to add "_USER_DEFINED" in the marker name

copper raven
tender fossil
tough abyss
#

No problem

tough abyss
ocean folio
#

I’m guessing _asset is a specific unit

#

Not the group that it belongs to

#

Ah

#

Lemme google real quick to find the line I’m looking for

#

I think it’s group _asset which should return the group that _asset belongs to

#

But I gotta check

#

Yeah that’s it

#

In your setgroupOwner

warm hedge
#

A createVehicle'd thing won't belong to a group

#

What is _className you want to spawn?

ocean folio
#

Listen to this guy he knows more than me lol

#

Oh, if it’s a vehicle it shouldn’t belong to a group afaik

warm hedge
#

createVehicle'd object won't have an AI. Even if it is B_Soldier_F

#

In the first place, what exactly you wanted to do?

ocean folio
warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
warm hedge
#

Where is the _asset? πŸ€”

#

Also if you want to post entirely use sqfbin

#

And

In the first place, what exactly you wanted to do?

#

Also if you want to post entirely use sqfbin

frank mango
warm hedge
#

In the first place, what exactly you wanted to do?
Please answer this

#

Then relaunch Discord? πŸ€”

#

And what is the relevance with setGroupOwner?

#

What mapmarker?

ocean folio
#

If you want the map marker to be the colour of the player’s side, I think you are over complicating this tremendously

winter rose
#
marker setMarkerColorLocal format ["Color%1", side player];
```this?
ocean folio
#

That’s exactly what I was trying to get. Waiting for my PC to load to rip it out of one of my scripts

winter rose
ocean folio
#

If it was me, right after the vehicle spawns I would CreateMarker using the position of the vehicle (which I believe you had stored in _asset)

#

Then what Lou posted to set the colour of it

#

If I understood correctly what you were trying to do, setting the colour of the map marker, correct?

#

I wonder if it’s a scope thing

#

That is generally how code works lol

#

Context is important

#

But I see what it’s trying to do

#

So, what is the intended sequence of events for the player?

#

Scroll wheel action > open’s menu > select vehicle type from list > spawn vehicle?

ocean folio
#

so that line that was erroring

#

_asset setGroupOwner (owner player);

#

do you know what that's supposed to do?

#

I would see what happens if you remove it

#

so it just slaps a parachute on your position?

#

alive _asset

#

I mean, the else is a bit excessive

#
if (!alive _asset) {
give back money
};
#

just invert it using !

manic sigil
#

First step of my project has come together, if still needing some polishing, but its on to new additions.

Im trying to include a method of adjusting created building objects, particularly, the SOGPF Mike Force FOB buildings, so you can more fine-tune their position.

The idea being one player electing to take a supervisory role, and have a couple Fired EHs attached to them, such that if they have the SOGPF shovel equipped, they can addAction select between push, pull, lift, and lower, as well as a value to adjust by, and beat the object into place.

I can understand vectorAdd, and get the target to move in the cardinal directions, but the thing Im having trouble with is the idea of 'move object to a new position equal to its own position, plus/minus the adjustment value, in a direction the eventHandle'd player is looking,' which would narrow the necessary inputs some.

hallow mortar
#

It should be that you can use vectorDir to find the direction the player is looking, vectorMultiply that value to produce the adjustment interval, and then vectorAdd that to the object position to apply it

cursive tundra
#

Hey, if i use an addAction on say a vehicle, is there some way to "get" the player that is perfoming the addAction? I need to feed the position of the player perfoming the addAction into a separate script, but im not sure whats the best way to do that

hallow mortar
winter rose
#

@cursive tundra ↑

ocean folio
#

kind of a general question, but anyone have a good method of visualizing your data structures?

#

having trouble wrapping my head around the layers of data I'm trying to store

winter rose
#

as in… what?

ocean folio
#

Just trying to think about how my data stores

#

oh wow that embedded, wasnt expecting that lmao

#

drawing it out like that kinda worked. I was just curious if anyone had a way of doing it that they found really easy to understand

winter rose
#

nay πŸ˜„

ocean folio
#

lol guess I just gotta trust my hands to write the code that needs writing

proven charm
#

there's saying well designed code is 90% complete

winter rose
#

I cannot emphasise that more
write your logic in human language, translating it into code is 5% of the work

ocean folio
#

if you store a hash map using setVariable, does it get stored/retrieved as an array?

#

nvm, its my default value which is the array πŸ˜†

little raptor
#

btw for those who always hated doing systemChat, hint etc., the latest update of Advanced Developer Tools adds an in-game debugger!

winter rose
#

don't crosspost just kidding, do it, it's well deserved 🀯

frank mango
copper raven
#

setAccTime?

hallow mortar
little raptor
#

yes

#

setAccTime 0 meowsweats

copper raven
#

cool πŸ˜„

#

i can see that being very useful

little raptor
#

in unschd env the breakpoint hits in the next frame but doesn't pause the script (the breakpoints just keep accumulating until next frame)

#

in schd it pauses the script using waitUntil

copper raven
#

very nice πŸ‘

frank mango
tender fossil
winter rose
#

oh didn't know he was constipated now

open fractal
#

quite rude to release it right after I finished working on a project honestly

ocean folio