#arma3_scripting

1 messages · Page 599 of 1

ebon citrus
#

i chose argument

#

and then i jsut pass a known static argument as a string in an array

#

for now testing purposes

params["_name","_unit"];

private _return = -1;
{
    if ((((_unit actionParams _x) select 2) select 0) == _name) exitWith{_return = _x};
}forEach (actionIDs _unit);
_return;```
#

and it works

#

the title changes according to the backpack name, so i cant use that

#

but i dont need to

#

although, this doesnt account for mods yet

#

you could have actions with no arguments

#

need to make a check for that

#
params["_name","_unit"];

private _return = -1;
{
    private _args = (_unit actionParams _x) select 2;
    if (count _args > 0 && _args isEqualType []) then {
        if ((_args select 0) == _name) exitWith {_return = _x};
    };
}forEach (actionIDs _unit);
_return;```
ebon citrus
#

we I need a "Random script generator"

ornate prairie
#

is there a way to detect if music is currently being played? I want to have triggers that will start ambient music periodically but only if action music from another encounter is not still playing

exotic flax
#

afaik not...
although you could try getMusicPlayedTime (returns elapsed time of current music track), or use addMusicEventHandler for a more fancy way to keep track of start/stop

ornate prairie
#

i was looking at getMusicPlayedTime; ill test to see what it returns when no music is playing. If it returns nil I can probably use that.

#

okay i see, using getMusicPlayedTime when no music is playing always returns 0

exotic flax
#

that wouldn't be an issue, since music is always overridden when starting an new track, so if it's 0 and a new one starts, the "old" one never plays anyway

ornate prairie
#

i see what you mean. I don't plan on having a script continously checking if the time is zero; overidding tracks is the opposite of what i want to do.
I have triggers that start combat music when the players enter combat zones, so i'm also gonna have ambient music triggers at the edges of these zones so that when the players leave, ambient music will play - but only if the combat music isnt still playing

exotic flax
#
if (getMusicPlayedTime == 0) {
   playMusic "SomeMusic";
}

This will simply check if something is playing, if not, start something.
If, for some reason, 2 triggers are triggered at the same time, only the one which is later (within a second) will play.

ebon citrus
#

THAT IS SO SILLY!

#

read

#

please

#

there are too many while-loops in this world

ornate prairie
#

interesting, ill look into it

ebon citrus
#

i do this all the time

#

jsut couple it to the musicStop EH

#

when the music stops, start a track

#

i usually have a random list of tracks i paly from

#

more often i wait around for a random ammount of time before i start the next track

#

so that there's a bit of calm

#

i wont share my golden ratio of wait-random though

#

And sorry about that

#

i just have a personal grudge with while-loops

exotic flax
#
while (player knowsAbout "while") do {
   player setDamage 1;
};
ebon citrus
#
[player] spawn {
  params["_unit"]
  while (_unit knowsAbout "while") do {
     _unit setDamage ((getDammage _unit)+0.01);
     sleep 0.1;
  };
};

@exotic flax extra painful and slow

#

needs to be re-executed every time the unit starts to know about "while"

#
[player] spawn {
  params["_unit"];
  while {true} do {
    if (_unit knowsAbout "while") then {
       _unit setDamage ((getDammage _unit)+0.01);
    };
    sleep 0.1;
  };
};```
#

better version

#

and syntax-error fix

ornate prairie
#

okay new issue, i have a task that for some reason auto completes itself as soon as it's assigned? I un-synced all triggers that affect it besides the one that creates the task, yet after a second the task shows up as completed instead of in progress

#

im using the eden task modules to create task and set task states, but for some reason it just instantly completes itself as soon as it's assigned, and yes it isn't being created in the completed state

#

JEEZ i'm dumb. so if you have a task with a parent task, completing the parent automatically complete it's child tasks

ebon citrus
#

logical?

#

i'm sensitive to 3den

#

my skin will wilt and boil if exposed to 3den

oblique arrow
#

ew

ornate prairie
#

oh i didn't realize they were from 3den
surprisingly useful then

#

can i ask why you dislike it?

ebon citrus
#

i dont so much dislike them

#

but if you want to get something done in a reasonable manner, just script it

#

3den is at best a debugging tool for me

#

i try not to use the modules though

#

they spell mostly problems

ebon citrus
#

Well, that's coming from me

#

They spell problems unless you know how to EXACTLY use them

bronze temple
#

Hey y'all I am currently trying to load a loadout export through .sqf via a dialog prompt

#

I am trying to define the _unit as the person currently in the dialog

topaz fiber
#

Morning all...

#

quick thought...

#

i have this in my initPlayerLocal.sqf

#

// Respawn player body clean up
player addEventHandler ["Respawn", {_this spawn fnc_Del_Corpse;}];

// Delete Player's old dead body
fnc_Del_Corpse = {_unit = _this select 1; deleteVehicle _unit;};

#

i think this has been stopping this from working

#

onPlayerKilled.sqf:
player setVariable ["Saved_Loadout",getUnitLoadout player];

onPlayerRespawn.sqf:
player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);

#

i had a thought, and changed the function call to this

// Respawn player body clean up
player addEventHandler ["Respawn", {_this spawn fnc_Del_Corpse;}];

sleep 10;

// Delete Player's old dead body
fnc_Del_Corpse = {_unit = _this select 1; deleteVehicle _unit;};

#

Now it works perfectly..... i assume because the 'old player' is now not instantly deleted giving no time to grab the loadout??

knotty mantle
#

Is there a way to create markers that show pictures when hovering over them like the ones in the tacops campaigns do?

robust hollow
#

@distant wave shouldnt double post.

#

@bronze temple it the script is running on the client (i assume it is) could you just use player?

#

@topaz fiber Yes, presumably the added "Respawn" event is firing and the spawn inside is completing before onPlayerRespawn.sqf has a chance to get the loadout. An alternative would be to set the variable to the missionnamespace instead.

bronze temple
#

I am making it for a server

#

The player variable in the sqf works however will that work in MP?

robust hollow
#

it depends what your dialog does exactly. does the player open it, select a loadout and then it should apply?

bronze temple
#

Essentially what I am doing is trying to let the player select a preset loadout through dialog options

knotty mantle
#

Thanks Connor 👍

robust hollow
#

yea, i think player should work for that purpose.

bronze temple
#

Alright poggers

#

Thanks

#

Sorry another question but can I test if a player has a certain amount of one item in their inventory?

#

Like I want to create a trader that uses bottlecaps in players inventories

robust hollow
#

yea, something like this perhaps _n = {_x == "bottlecap"} count items player;. not sure if items is the right command.

topaz fiber
#

😡 the respawn with gear is still not having any effect on my dedicated server. Using the same scripts as what works on another mission with the same mods. So frustrating. I guess it would be best to test in vanilla and build mods in and keep testing?

#

It’s not like it’s complicated. 🤷🏼‍♂️

frigid lodge
#

Hey everyone, I'm using BIS_fnc_ambientAnim in multiplayer for my mission, but I am having issues with it playing the animation, it only plays it once then stops, is there a way to get it to play all the time like it does in SP?

ebon citrus
#

@topaz fiber that's not how functions work

#

If you want a detailed rundown and guide on how to define and use functions, let me know

#

Im more than happy to help someone get started with them

topaz fiber
#

@ebon citrus very kind of you to offer, will take you up on that for sure
my issue is i try to learn through google and testing and understanding. Its when it does work then doesnt that i get confused lol

ebon citrus
#

It's ok

#

DMs?

topaz fiber
#

np

forest ore
#

I have a setup where a "shop list" is being populated with items from a config file that resides inside a mission PBO. Can this config file situate in the server and is there a way for the players to access it? If yes then what would be the best approach?

ebon citrus
#

yes, player's "can" access it but only their local copy

#

so if you mean that can players copy it? Yes

#

can players make changes to it? Not unless they are running malicious software

#

do the changes matter? only locally

#

so when you say "access" what kind of access do you mean?

forest ore
#

I think read-only access where a "shop list" gets populated from a config file that resided in the server instead of a config file that resides in the mission PBO

ebon citrus
#

sure?

#

why is this necessary?

forest ore
#

Point being that when I start to have 10+ different missions that are basically using the same config file it's becoming tedious to make changes to each of the config files inside the different mission files. I'd think it'd be a lot easier if there was only one config file that multiple missions use and I could only modify this one file when needed

still forum
#

server could load it at init, and transfer it into a variable thats transferred to all players

#

as every player needs it, a simple publicVariable should be sufficient?

ionic orchid
#

that's how I do it

ebon citrus
#

this sounds like solving a leaking pipe with a crowbar, but sure

#

you could do that

#

but this begs the question, why are you editing 10+different missions at the same time 😅

#

not a serious question

#

a rhetoric one

#

but yeah, totally could

#

just be careful when transporting large variables over the network

forest ore
#

hmm, I need to take a look into that I guess Ded.

But I myself was thinking that I could somehow point to the file that resides in the server from the client's side so that the client could just "fetch" the file or rather the contents of the file 🤷🏼‍♀️

ebon citrus
#

since you have to account for JIP

#

nope, that's not a thing

forest ore
#

mhm

still forum
#

Yeah you kinda could.. but that would probably be more work and less efficient

ebon citrus
#

if the file is not inside the mission-file, then it wont get moved anywhere or "fetched"

forest ore
#

da-da

still forum
#

you can remoteExec to server, let it loadFile, remoteExec the contents back

ebon citrus
#

so it's better to define your stuff in the mission-file

forest ore
#

damn 😄

#

Well that's what I wasn't really after when I came here to ask questions 🙂

ebon citrus
#

this sort of "fetching" is sort of difficult aswell

#

because it could open up a security issue

#

that's why you should have everything the client needs in the mission-file if you are not using a mod

still forum
#

well not if you do it right. CfgFunctions serverside, hardcoded filepath.

ebon citrus
#

yes, but "doing it right" is far more work

still forum
#

But again if all clients need the same file, might aswell just publicVariable it from server, much easier

ebon citrus
#

account for JIP

forest ore
#

publicVariable'd file will be available at least during the whole duration of a mission? So it's not single-use so to say?

still forum
#

you set a variable, and the variable won't magically disappear by itself

ebon citrus
#

are public variables JIP-compatible?

tough abyss
#

is there any scripting possibility of making the AI stop turning, even if i'm specifying them not to move at all? This is what i'm currently using but it doesn't seem to work, they just freeze their movement, but not their rotation:
this disableAI "PATH";this setUnitPos "MIDDLE";
ignore the unitpost part

ebon citrus
#

ummm...

#

do you need the AI to jsut be there

#

and do nothing else?

still forum
#

publicVariables are added to the jip queue yes

tough abyss
#

do you need the AI to jsut be there
@ebon citrus yep

#

basically make them stop making rotating every time they hear gunfire

#

because they're actually trying to track the enemy

ebon citrus
#

make them careless?

tough abyss
#

tried that, but i think i found a solution

ebon citrus
#

disable these parts of the ai too

"TARGET" - stop the unit to watch the assigned target / group commander may not assign targets
"AUTOTARGET" - prevent the unit from assigning a target independently and watching unknown objects / no automatic target selection```
#

and instead of "path" disable "MOVE" - disable the AI's movement / do not move

#

as detailed in the ntoes by Katu:

MOVE: disabling this will stop units from turning and moving. Units will still change stance and fire at the enemy if the enemy happens to walk right in front of the barrel. Unit will watch enemies that are in their line of sight, but won't turn their bodies to face the enemy, only their head. Works for grouped units as well. Good for staging units and holding them completely still. Movement can't be controlled by a script either, you have to re-enable movement for that. Unit will still be able to aim within his cone of fire.```
#

@tough abyss

tough abyss
#

oh nice

#

seems easy to modify from here

#

thanks man

forest ore
#

To be able to publicVariable a file from the server I need to have it in the server as a function(?) How does the function need to be declared so that it is found from the server? Do I just declare it inside the mission file in description.ext under CfgFunctions? Then publicVariable it from initServer.sqf for example?

still forum
#

make your own serverside mod pbo with CfgFunctions?

#

if you just do it right from initServer.sqf then you don't need a seperate function

ebon citrus
#

you can define it in mission aswell, but that's excessive

#

oh yeah, this is one thing i wanted to ask

ionic orchid
#

anyone fancy running a short script to create an RscTree to see if you're getting the same bug I am?

ebon citrus
#

and i did

#

are public variables JIP compatible?

still forum
#

and I already answered that

ebon citrus
#

you did? Oh and it's on the biki now Variables broadcast with publicVariable during a mission will be available to JIP clients with the value they held at the time.

#

silly me

#

sorry, i didnt notice your comment due to the ping

#

my bad

still forum
#

Has always been on wiki

ebon citrus
#

not really a reference of time, just a pattern of speech

#

the "now"

unique sundial
#

@ionic orchid post the code

ionic orchid
#

i've just kinda figured out what it is, lemme roll back to the example for you

unique sundial
#

ok

ionic orchid
#
    private _ctrlTree = _disp ctrlCreate ["RscTree", 0];
    _ctrlTree ctrlSetPosition [-0.0117,0.0639,0.1877,0.9268];
    _ctrlTree ctrlCommit 0.0;
    _ctrlTree tvAdd [[], "Category A"];
    _ctrlTree tvAdd [[0], "Text 1"];
    _ctrlTree tvAdd [[0], "Text 2"];
    _ctrlTree tvAdd [[0], "Text 3"];
    _ctrlTree tvAdd [[0], "Text 4"];
    _ctrlTree tvSetTooltip [[0], "Category A"];
    _ctrlTree tvSetTooltip [[0,0], "Text 1"];
    _ctrlTree tvSetTooltip [[0,1], "Text 2"];
    _ctrlTree tvSetTooltip [[0,2], "Text 3"];
    _ctrlTree tvSetTooltip [[0,3], "Text 4"];
    _ctrlTree ctrlCommit 0.0;
    tvExpandAll _ctrlTree;```
#

Try to click between the 'xt' on Text 1 and 2, it should be blocked by something

#

it turns out that it's the scrollbar - if you don't give the RscTree enough elements for it to show it, it doesn't init properly

#

so it just hangs out there, invisible and blocking clicks

unique sundial
#

thanks reproed

ionic orchid
#

cheers

#

in the meantime, my workaround is to fill it with empty entries for force the scrollbar, wait a frame, then clear and add my data

#

not great, but it works

unique sundial
#

you are right about invisible scrollbar that shouldnt be there. Fix incoming

ionic orchid
#

awesome, thanks man

spark rose
#

does anyone know a way to find the most recently completed task?

#

hmm. think i may know. nvm

spark rose
#

i need a way to identify the player (in MP) closest to an object. I've tried ```sqf
position nearEntities [["allPlayers"], 50] select 0];

#

but i'm guessing "allPlayers" or "player" is not a valid entity type

#

I know i can do "man" but need to find player specifically

#

also ignore the last "]", i took it out of a larger code

distant egret
#

Use select isplayer _x with it.

#

(getpos player) nearEntities [["man"], 50] select {isplayer _x}

spark rose
#

oh clever

#

i didn't know i could do that. Thank you very much my friend.

distant egret
#

no worries!

spark rose
#

did they break BIS_fnc_findSafePos recently?

restive leaf
#

Not as far as I know... Use it for several mission systems without reported issues

spark rose
#

going to try a backup and see if its me or them

restive leaf
#

Last change to BIS_fnc_findsafepos was 10/20/2017 😉

spark rose
#

oy... yeah i just tested it with my old code and works fine. It doesn't like something about the variable i'm throwing into it

restive leaf
#

You can always check in functions_f to see whether one of the bis functions was updated btw

spark rose
#

gotcha

#

i think i found the problem. when i use ```sqf
[Zap_lastTask nearEntities [["man"], 50] select {isplayer _x}];

#

to find the nearest player

#

it returns something like

#
[player_1]
#

instead of ```sqf
player_1

#

so when i enter that variable like so ```sqf
_victim = [Zap_lastTask nearEntities [["man"], 50] select {isplayer _x}];
SafePos2 = [_victim, 200, 300, 20, 0, 0.3, 0] call BIS_fnc_findSafePos;

#

not a huge concern since i don't care who it selects, so long as they are within 50m, but the brackets are causing Bis_fnc_findSafePos not to work

#

so the question is how i turn output of [player_1] into player_1

#

maybe i can throw select 0 on top of it

ebon citrus
#

what's up?

spark rose
#

think i got it, just needed another select 0

#

lol still doesn't work, i give up for now

#

for some reason Bis_fnc_findSafePos doesn't like the _victim variable created by ```sqf
_victim = [Zap_lastTask nearEntities [["man"], 50] select {isplayer _x} select 0];

#

i don't know why

ebon citrus
#

what do you mean?

#

@spark rose are you getting errors or weird returns?

spark rose
#

I'm getting errors. Somewhere in line 130 of Bis_fnc_findSafePos

ebon citrus
#

rpt?

spark rose
#

Rpt?

ebon citrus
#

the error message?

spark rose
#

One sec

ebon citrus
#

nearEntities returns an array

#

_victim is an array

spark rose
#

right, which is why i select the first output of the array

ebon citrus
#
_victim = [Zap_lastTask nearEntities [["man"], 50] select {isplayer _x}];
SafePos2 = [_victim select 0, 200, 300, 20, 0, 0.3, 0] call BIS_fnc_findSafePos;

@spark rose

#

try that

spark rose
#

no dice

#

same error

#

now if i try ```sqf
SafePos2 = [getPos _victim, 200, 300, 20, 0, 0.3, 0] call BIS_fnc_findSafePos;

#

i get an error also, saying array, expected object, location

wraith cloud
#
private _victim = ((Zap_lastTask nearEntities ["CAManBase", 50]) select {isPlayer _x}) select 0;
SafePos2 = [_victim, 200, 300, 20, 0, 0.3, 0] call BIS_fnc_findSafePos;
ornate prairie
#

So is using the playMusic command functionally different than playing music through a trigger? If so, what command is the trigger using, or is it some hard coded music player?

#

I was told that musicEventHandlers only work when using the command itself and not the trigger, but it seems slightly unintuitive

ebon citrus
#

dont use triggers

#

😅

#

no, in all seriousness, i dont know how triggers execute music

#

i would have to dig

winter rose
#

I was told that musicEventHandlers only work when using the command itself and not the trigger, but it seems slightly unintuitive
check this information before anything!

ornate prairie
#

When I attempted added a music event handler using triggers it had no effect, so I’m inclined to think that information is right. When I get home I’m definitely testing though.

ebon citrus
#

@ornate prairie works for me

#

@winter rose false. Music EH's do work with music player by triggers

winter rose
#

one less issue!

velvet merlin
#

where is arsenal garage defined? i cant find it 🙈

warm hedge
#

fn_garage.sqf?

velvet merlin
#

yep

warm hedge
#

What do you mean by defined? The location?

velvet merlin
#

yep and the cfgFunctions entry

warm hedge
#

It's just BIS_fnc_garage IIRC. Check it in functions viewer?

#

There he is, in functions_f_mark

velvet merlin
#

hm dont have it on my p drive - weird 😐

#

ty POLPOX 🙇

ornate prairie
#

so addMusicEventHandler has the following text in it's wiki: "Just like addMissionEventHandler, music EH is also attached to the mission." Does this mean the code it executes is global?

warm hedge
#

_this select 0

ornate prairie
#

thank you, you are very helpful

#

< 3

#

hmmm i'm still unsure if the event handler executes code locally
Since play music is a local command, i would assume that the related event handler would be aswell
but if it isnt it would really mess things up

robust hollow
#

so local execute by the sounds of it

ornate prairie
#

thank you
i was making a variable to detect whether music was currently playing, so that ambient music triggers would only play if other music wasn't already playing (i dont want any music to get cut off abruptly). However if it was global, i would have had a problem where one player would change the variable to think that music was playing, before other players triggered the music thus locking them out of getting music played despite only the first player actually hearing anything

i hate multiplayer scripting lol

winter rose
mental wren
#

When we want to store items in a box on init on multiplayer, do we need to use the Global versions of the addItem command?

warm hedge
#

Don't Global something in an object's init section! That's EVIL.

mental wren
#

Oh

#

:(

#

But without Global it doesn't seem to work at all, the box remains empty

#
clearmagazinecargoglobal this;
clearweaponcargoglobal this;
clearitemcargoglobal this;
this addItemCargo ["ACRE_PRC152", 3];
this addItemCargo ["ACRE_PRC343", 4];
this addItemCargo ["ACRE_PRC117F", 1];
this addItemCargo ["ACE_EarPlugs", 6];
this addItemCargo ["ACE_CableTie", 12];
this addItemCargo ["ACE_EntrenchingTool", 3];
this addItemCargo ["ACE_wirecutter", 3];
this addItemCargo ["ACE_Clacker", 1];
this addItemCargo ["ACE_IR_Strobe_Item", 12];
this addItemCargo ["ACE_Flashlight_XL50", 3];
this addItemCargo ["ACE_SpraypaintGreen", 3];
this addItemCargo ["rhsusf_ANPVS_14", 3];
this addMagazineCargo ["DemoCharge_Remote_Mag", 3];
this addMagazineCargo ["SatchelCharge_Remote_Mag", 3];
warm hedge
#

Init section will run for every each players. Even JIP IIRC. So, if you global something inside the section... you know. That's a mess

mental wren
#

oh frick

#

so that's why it's empty I assume?

#

Because of the clear global?

warm hedge
#

You cleared globally but adding locally

mental wren
#

because we launch the server, and then players join with in progress

#

which retriggers the clear but not the add cargos

#

So the clears just need to be non-global I assume?

warm hedge
#

Suggest to use init.sqf with isServer or initServer.sqf or such and use global variant

mental wren
#

Okay, so on initServer.sqf, do the isServer check, and use global variants would be good?

warm hedge
#

initServer.sqf only runs on server computer so don't need to isServer

mental wren
#

If I then pick an item from the box, and a new player joins, wouldn't that reset the contents of the box as if the item was never taken?

warm hedge
#

I'm not a multiplayer lord but this should do the trick

mental wren
#

Alright, massive thanks. We'll do some testing with it

warm hedge
#

Don't forget to name the box to use in initServer.sqf

mental wren
#

yeah because this isn't a thing haha

#

we got that far :D, just the local/global functions are a bit funky

warm hedge
#

Indeed 😉

#

I recall my mess before that I put createVehicle into init.sqf without isServer so everything's done 😄

winter rose
#

Can be helpful 😉

mental wren
#

yeah I had a look at that

ebon citrus
#

Multiplayer scripting is a mythical beast

#

Understanding it takes great patience

#

Accomplishing simple matters in the language of multiplayer scripting can take days, if you are kot careful

#

Been there, done that. Everyone learns it the hard way

winter rose
#

if there is any way to improve the wiki on an aspect that is not (well) covered, let me know salute

ebon citrus
#

Lou is our ambassador to the biki

winter rose
oblique arrow
#

Hey I think I asked this before but I cant remember the answer and cant find the question, what was that fancy text showing stuff like "FOB Alpha" called again?

warm hedge
#

Uh, example?

ebon citrus
#

uhhh

#

sec

ebon citrus
#

sure...

winter rose
#

penta-ninja'd!! 😄

oblique arrow
#

rooHappy Thank you peeps!

ebon citrus
#

god damn ninjas

#

but yeah

#

read the notes carefully

oblique arrow
#

Yeah its a mega-ninja

ebon citrus
#

they work differently

oblique arrow
#

Oki I'll be sure to read them

ebon citrus
#

and some are really quirky

#

i like to use dynamicText and typeText2 for credits

oblique arrow
#

Hm okay

compact maple
#

Hi, is it possible to get the position of a HitPointDamage on a body ?

ebon citrus
#

hitpart?

compact maple
#

Yes

ebon citrus
#

yes, it's called hitpart

#

remember to read the notes and the explanation carefully

compact maple
#

Oh thank you

ebon citrus
#

this eventhandler is very picky with locality if you use it in multiplayer

compact maple
#

Can I avoid using this EH if I already know the _hitPartIndex ? like searching for the center position

#

my goal is to create a drawline3d, starting from the shooter position, to the body part which is injure

#

I am using the HandleDamage event handler

ebon citrus
#

why not use tracers?

compact maple
#

Hm, because I want a static line

#

I am not sure what traceBullets do

warm hedge
#

It's something that shows you the bullets in Virtual Arsenal

ebon citrus
#

tracerBullets IS a static line

compact maple
#

Oh okay I see, it triggers when you shoot, in fact this is what I need, but I want to see these line on a shot that happened before

#

If A shoot B
I am C, and I want to see the bullet tracer of A

ebon citrus
#

you can

#

@compact maple read the documentation

#

the first parameter of the array passed to the function is the unit the lines will be drawn for

#

so you would just call the function like so :

[A] spawn BIS_fnc_traceBullets;```
compact maple
#

But how does the function know where the bullet should land?

#

The parameter is only for a guy who want to see his friend's bullet right?

winter rose
#

the function doesn't "know" anything, it just traces the trajectory of fired bullets

compact maple
#

thats what I tought, so it can't do what I need, thats why I used drawline3d

winter rose
#

sure, but you only get at where the weapon's barrel is aiming, not the real hit

#

is it possible to get the position of a HitPointDamage on a body ?
I still don't get what you are trying to get; a hit selection is more than just one point, it can be e.g a whole leg

#

if you want where the bullet has hit, see the HitPart EH

compact maple
#

The relative position of where the bullets landed in the body so I want translate it to a world pos

#

But yes I think I will look into hitpart eh

ebon citrus
#

is there a way to cancel a reload. 'cancelAction' doesnt seem to work

winter rose
#

worldToModel something @compact maple

ebon citrus
#

reload of a unit, mind you

compact maple
#

y I know 😄

winter rose
#

@ebon citrus not that I know of - the "cancel action" was to cancel the "get in vehicle" animation in A2, but it still played the full animation

ebon citrus
#

i see

#

i mean, you could bork the animation too

#

playmovenow

winter rose
#

switchAction maybe, + a remove/add weapon

ebon citrus
#

maybe i can swap the player's weapon real quick XD

#

yeah, i want the reload animation to paly though

#

i just want to override the action to make sure any magazines from the backpack are not loaded

#

if there is a smarter way, let me know

#

like something i could add to the backpack config

winter rose
#

how does picking a backpack trigger a reload?

ebon citrus
#

no no no

#

i explained it wrong

#

i meant that when you reload, the unit CAN reload magazines from a backpack of the unit

#

i want to avoid this

#

as in arma 2, you couldn't reload magazines from a backpack

winter rose
#

oh, I see

compact maple
#

you want the unit to use only the magazines from his vest or smth ?

ebon citrus
#

precisely

winter rose
#

as in arma 2, you couldn't reload magazines from a backpack
I thought they wanted to have this behaviour, but didn't do it 🤔

ebon citrus
#

i want to NOT have this behaviour

#

😅

winter rose
#

yeah I get you
but I mean I think that it doesn't work like that, even in A2

ebon citrus
#

?

#

are you sure?

#

i can vividly recall having to pull magazines from my backpack into my inventory

winter rose
#

I think you can/could reload magazines from backpack already yes
and that they considered to remove that behaviour, but it was not much more than wishful thought

I tell you what, I am firing A2OA to check

#

the things you make me do…

ebon citrus
#

couldve been added in a later update

#

you dont need to

#

i have OA warming up already

compact maple
#

the guy is right

ebon citrus
#

this is arma 3

#

im talking about arma 2

#

this comment is gold:
Because ArmA is a game of INFANTRY combat an not INVENTORY combat!

compact maple
#

I know

#

I meant

#

the guy is right, it shouldnt work that way

ebon citrus
#

also, Arma*

#

idk, man

#

i can pull a mag from my backpack over my shoulder

winter rose
#

…I don't even know how to use backpacks in Arma 2 😅

ebon citrus
#

i had to get intimate with them recently

#

because i had to program the backpack behaviour into arma 3

#

the backpack behaviour of arma 2, that is

winter rose
#

oooh the "Open bag" button! -.-'

#

buuut the magazines end on the ground
aaanyway

#

@ebon citrus you are correct, can't reload from backpack

#

(in A2OA)

slender schooner
#

here i am again, with another issue
sooo, i m currently writing a small bansystem for altis life.
The system itself is supposed to be working, but i get a "missing ;" error on it

switch (playerSide) do {
    case west: {
        if((_this select 12) == 1){
            failMission "zb_banned";
        };
    };

    case civilian: {
        if((_this select 15) == 1){
            failMission "zb_banned";
        };
    };

    case independent: {
        if((_this select 11) == 1){
            failMission "zb_banned";
        };
    };
};

↑ this is the part that spits out the error
appearently its the first case
https://cdn.discordapp.com/attachments/478246836952629259/726859644106178560/unknown.png

#

any ideas on why this happens?

winter rose
#

if-then

slender schooner
#

. . .

winter rose
#

…I know

slender schooner
#

right....i was intending to do a exitwith there, but then decided not to....

#

many thanks for the help

ebon citrus
#

somebody else is as blind as i am

#

😅

winter rose
#

to be honest, I didn't notice it until I opened the error message picture

ebon citrus
#

what's the locality of failMission

winter rose
#

I would say local, to be tested

#

endMission being local iirc

ebon citrus
#

if run on server, will it fail all players?

#

yeah, that's what im worried about

#

4non's code, if run on the server, might end kick ALL players

winter rose
#

it would end the mission for everyone I believe

ebon citrus
#

assuming you want "ban system"s to run server-side, this is what i assume will happen

#

so you'd have to remoteexec that failmission

oblique arrow
#

I wonder if you could somehow bug out arma enough to only show the end screen for certain players heh

winter rose
#

well @ebon citrus it uses playerSide, so I suppose it is run client-side

ebon citrus
#

yeah

#

not a good one

#

client-side ban system 😅

winter rose
#

@oblique arrow you can
use endMission locally, the player gets his mission closed while the others keep playing

ebon citrus
#

"you are banned"
"no i'm not"
"ok, cool, welcome in"

oblique arrow
winter rose
slender schooner
#

well, i wanted to make it a function that automatically makes you disconnect when the value is set to 1 in the database

#

but, i guess i could aslo look into switching this with the kick

winter rose
#

ban lists are for that, no real need to have a ban system mission-side unless you want them to see a very custom reason

ebon citrus
#

run it on the server and switch endmission with kick

#

i believe they want to ban from specific roles

#

(police, civ, medical)

#

as the l*fe folk do

winter rose
#

oh
then, do as you please

slender schooner
#

basically yea

winter rose
#

(ban != kick though)

slender schooner
#

yea i know

ebon citrus
#

you can check the player's side server-side

#

check the database value

slender schooner
#

i want to stay away from the be bans as far as possible

ebon citrus
#

and if true, kick

slender schooner
#

i want to be able to manage all that via webinterface later

ebon citrus
#

also , use true instead of 1

slender schooner
#

well, i save it as 0 and 1 in the database

ebon citrus
#

yep

#

sql supports booleans, does it?

oblique arrow
#

i want to stay away from the be bans as far as possible
Server admins cant do BE bans anyways afaik, if they can that sounds like a bug

winter rose
#

this reminds me of a recent conversation 😄

slender schooner
#

euh, yes

ebon citrus
#

yes, Lou

slender schooner
#

what i mean with be bans is, rcon bans

ebon citrus
#

i just mean that if you get a return of "true/false"

#

you can use that variable in an if-check

slender schooner
#

i know

ebon citrus
#

without having to do comparisons

#

this is being immensely anal

slender schooner
#

but this is for my eyes, to keep the code more clear

ebon citrus
#

pick your poison 🤷‍♂️

slender schooner
#

some people say i m a madman

winter rose
#

while Dedmen may disagree, I sometimes like to have a boolean == boolean. a list of booleans for example

slender schooner
#

but this keeps the code more, easily understandable on one glance, plus, i could later edit it, to other values aswell

winter rose
#

by the way, if such comparison could be added to Arma… just sayin' 👀 😁

slender schooner
#

like, saying, you have ban 5, meaning, banned from x and y

ebon citrus
#

@winter rose isn't it in Enforce already?

#

true == 1; //true?

winter rose
#

I meant more like false == true

but I don't know EnScript yet 🤷‍♂️

ebon citrus
#

i'll cross that bridge when A4 comes out

#

i dont do risk-investment

winter rose
#

haha
well, a bit of the same - until I have an eventual alpha or beta to toy with, I am not yet going there

ebon citrus
#

wait

#

ints and floats are separated

#

this could be it!

#

this one's going to be real hard to get used to foreach(auto k, auto a: mapa) // prints: 'mapa[jan] = 1', 'mapa[feb] = 2', 'mapa[mar] = 3' { Print("mapa[" + k + "] = " + a); }

#

foreach at the start

winter rose
#

no no, I will deal with it all right 😄

ebon citrus
#

yeah, but this is pretty much c# syntax

winter rose
#

exactly

ebon citrus
#

i could get used to this

winter rose
#

Java is for (String stuff : stringArray)

ebon citrus
#

no no no no

#

dont speak the dark tongue here

#

😅

silver mauve
#

how would i go about getting ai to leave a vehicle after being dropped off, then start a patrol whilst the vehicle drives away?

winter rose
#

and JS, I don't remember exactly (there is a foreach but that creates a new scope so I avoid it - the other one)

ebon citrus
#

waypoints @silver mauve

#

i sort of like python syntax

silver mauve
#

I am aware of that but will the ai dismount the vehicle before they arrive and try to do there waypoints?

ebon citrus
#

``for element in array`

#

yes, the ai will dismount the vehicle

austere silo
#

what is wrong here? if ( time < _timeCalcPos ) then { _timeCalcPos = time + 120; _c = count units _unit; _i = (units _unit) find _unit; _iDir == 0 then _dir = (_i*360/_c); _iDir != 0 then _dir = [(_iDir - 1)*45 - 60 + _i*120/_c]; _posMove = [(_pos select 0) + _dist*(sin _dir), (_pos select 1) + _dist*(cos _dir)]; waitUntil {sleep 5 ; scriptDone _handle}; };

ebon citrus
#

if you have configured the waypoint right

#

@austere silo what IS wrong here?

austere silo
#

it keep telling me missing ;

exotic flax
#
Array.forEach((item, index) => {});
ebon citrus
#

what does it say?

austere silo
#

missing ;

#

i took it from an old dvd sqs and put it in the sqf

ebon citrus
#
 _iDir == 0 then _dir = (_i*360/_c);
                _iDir != 0 then _dir = [(_iDir - 1)*45 - 60 + _i*120/_c]```
#

this

austere silo
#

instead of then

#

or whatyamean

ebon citrus
#

unless im missing something

austere silo
#

so the whole thing is wrong?

winter rose
#

I said "the other one" @exotic flax 😄

ebon citrus
#

is that meant to be an alternate syntax for if-statement?

austere silo
#

syntax

ebon citrus
#
if (_iDir == 0) then {_dir = (_i*360/_c)};```
austere silo
#

it should order the AI to go to spec. direction

ebon citrus
#

if im not entirely mistaken

austere silo
#

ill try it out nica. thx 4 help

ebon citrus
#

change the other one too

austere silo
#

k

ebon citrus
#

this one _iDir != 0 then _dir = [(_iDir - 1)*45 - 60 + _i*120/_c];

winter rose
#

(and check that _c is not 0)

ebon citrus
#

Lou, is there some hidden syntax?

#

can you make an if-statement without if?

#

also, if _dir is not privated in an outside scope, then it wont exist outside the if-statement

#

Any _local variables you declare within the body of an if/then statement (ie between the curly braces) are local to that 'if' statement, and are destroyed at the end of the statement. If you know you want to use the variable outside the 'if' statement, make sure your declare it before the 'if' statement.```
slender schooner
#

eventhandlers, do they have a(n) (notable) impact on client performance?

winter rose
#

Lou, is there some hidden syntax?
can you make an if-statement without if?
wait, what?

ebon citrus
#

_iDir != 0 then _dir = [(_iDir - 1)*45 - 60 + _i*120/_c];

#

this looks really wrong to me

winter rose
#

an if-statement needs… an if

only the array select boolean can do otherwise

ebon citrus
#

and then the missing curly brackets

#

thus the code is not actually being executed

#

well, it's being errored

winter rose
#

yep - always code with show script errors

ebon citrus
#

i paly with show script errors

#

so that i can complain to people about their mistakes

winter rose
#

we don't even have ternary in SQF

// WRONG
_iDir != 0 then _dir = [(_iDir - 1)*45 - 60 + _i*120/_c];

// RIGHT
if (_iDir != 0 && _c != 0) then { _dir = (_iDir - 1)*45 - 60 + _i*120/_c; };
#

i play with show script errors
of course, who would remove that flag 😄

austere silo
#

its an old crcti script from DVD (der verrückte Doktor) crcti. back in the day he made the best cti´s.

ebon citrus
#

sqs?

#

what syntax is that

#

because it's not sqf

austere silo
#

yea part is sqs

winter rose
#

ah yes: sqs was

// sqs
? alive player : hint "alive"
? not alive player : hint "dead"

// sqf
if (alive player) then {
  hint "alive";
} else {
  hint "dead";
};
ebon citrus
#

🤮

slender schooner
#

this looks very ugly for me

winter rose
#

fixed* - it's even worse than what originally posted

ebon citrus
slender schooner
winter rose
#

? is if and : is then
no else 😄

ebon citrus
#

who came up with sqf?

#

give them a price

winter rose
#

Arma 1 iirc

ebon citrus
#

for saving my patience

#

sqs looks like it would give me eye-cancer

#

ah, Arma 1

slender schooner
#

to be honest, i like sqf for what cool stuff you can do, but what annoys me a lot, is the incompetence of the error reporter

austere silo
#

and OFP

winter rose
ebon citrus
#

the error reporter is far better than many

slender schooner
#

TheRE iS a MisSInG ; sOmEWheRe

astral dawn
#

to be honest, i like sqf for what cool stuff you can do, but what annoys me a lot, is the incompetence of the error reporter
use arma debug engine to see local variables and call stack on script errors

ebon citrus
#

VS c++ compiler errors are like hieroglyphs

slender schooner
#

while the problem was a missing "then"

winter rose
#

@austere silo
AFAIR sqf got introduced in Arma 1, and if/else in OFP:R 1.85?

#

I may be wrong about SQF, I still wonder

austere silo
#

well iam a really noob in scripting but DVD made it like this back in the day

ebon citrus
#

A line beginning with a semicolon (;) is considered a comment and ignored by the game engine.

NOOOOOOOOO!

#

how did anyone use this ever?

austere silo
#

lol

ebon citrus
#

i have a hard time leaving the ; out when i write Python

#

now imagine using it for comments

winter rose
#

@ebon citrus

; that is a comment, yep
? alive player : hint "harr harr!! you fell into my trap"

@ not alive player
~3
hint "you dead"
ebon citrus
#

😅

austere silo
#

Montana is the man

slender schooner
#

i allways comment with //

winter rose
#

dang, I got SQS flashbacks

slender schooner
#

or /**/

ebon citrus
#

#, /**/, ''', """, // and ///

winter rose
#

SQS = one line = one statement

loops? HAHA

#loop1
hint "you are alive"
? alive player : goto "loop1"

hint "you are dead"
ebon citrus
#

i can feel getting sqf flashbacks in the future

#

when everyone will be writing in Enscript

winter rose
#

don't vomit on your keyboard plz

slender schooner
ebon citrus
#

back in my day, we had one scheduler, and we had to share that scheduler with all mod

winter rose
#

@slender schooner in SQS, it is 😉

slender schooner
#

oh

#

so i missed that part

#

.-.

winter rose
#

no semicolon either

ebon citrus
#

nothing of value missed

winter rose
#

so your parser may be scared 😄

ebon citrus
#

if you live your entire life ignorant of sqs, you didnt miss anything

slender schooner
#

and, this with the goto reminds me a lot of batch

winter rose
#

if/then/else introduced in OFP:R v1.85 had to be one-lined 🦇

ebon citrus
winter rose
#

…yyyep.

slender schooner
#

wait a second there buddy

ebon citrus
#

now that's a lot of damage

#

finally a use for my extra-wide monitor

slender schooner
#

so you basically had a whole function that was an if, and had to be in ONE SINGLE LINE?

ebon citrus
#

imagine making nested if's

winter rose
#

mind you, average resolution was 1024×768 back then

slender schooner
#

brb, gotto go buy some 24k wide monitors

ebon citrus
#

making a simple nested if would be equal to the fellowship of the ring

winter rose
#

@slender schooner
either one line or split in multiple sqs, or using goto

slender schooner
#

ouch....

winter rose
#

Show some respect to your elders that had to make fancy missions back then!!1! 👴 😂 😅

slender schooner
#

poor people that were actually using it while scripting....

ebon citrus
#

imagine in the future, people will write code with 3d-ladder/blueprints style code in AR and we will be explaining them that back in our day, we wrote code in letters on a 2d monitor that couldn't display ALL THE CODE at once

#

oh, hi lmao. how may we help you today?

slender schooner
#

to be honest, coding will probably stay like this

austere silo
#

its working!!! Thx a lot Nica and Montana

ebon citrus
#

probably not

slender schooner
#

i mean, there is no more efficient way than writing it

ebon citrus
#

it wont be gone

unkempt sorrel
#

my brain is melting, idk why attachTo makes ai pretty much unusable 😦

slender schooner
#

well

ebon citrus
#

but the current coding in the future is like punchcards are for us

slender schooner
#

the basically have an object attached to their body

ebon citrus
#

what are you tryign to do LMAO?

austere silo
#

how old are yall?

slender schooner
#

so they maybe see themselves trapped in an object?

ebon citrus
#

old enough to have seen 911 on the telly

austere silo
#

lol

slender schooner
#

i will NEVER provide such intimate information about myself

ebon citrus
#

@unkempt sorrel what are you doing?

austere silo
#

also COPS?

slender schooner
#

this addEventHandler ["GetInMan", {

ebon citrus
winter rose
#

…harr harr

ebon citrus
#

arma 3 objectifies men

#

typeName player

winter rose
#

we wanted to objectify women, but there aren't any 😢

slender schooner
#

OOF

ebon citrus
#

i know

winter rose
#

it's a Greek island for a reason

ebon citrus
#

i downloaded a women's mod, but isKindOf "Man" revealed the truth

austere silo
#

lol

winter rose
ebon citrus
#

😆

austere silo
#

lmao

slender schooner
#

as my question went under before If i use eventhandlers on players, does this have any real influence of the performance of said players?

ebon citrus
#

not much

#

depends on how often it's firing

winter rose
#

depends mostly on what you set in the EH code

slender schooner
#

like, for example, the firednear eventhandler, does this affect them?

ebon citrus
#

and how much code

#

and what it's doing

slender schooner
#

but the handler itself is no problem?

winter rose
#

nope

slender schooner
#

i see

ebon citrus
#

it's like...

winter rose
#

you could add a 100, it shouldn't be a big deal

slender schooner
#

the problem is, i look at such things as while true loops

ebon citrus
#

0.000000000000000000000000000000001% of the performance demand of the common l*fe script

winter rose
#

accurate

slender schooner
#

i mean, its basically what it does, no?

ebon citrus
#

eventhandlers are not loops

#

they are triggers

slender schooner
#

yea, but how does it trigger?

ebon citrus
#

when the event occurs, the eventhandler is called

#

engine-logic

slender schooner
#

it has to check constantly if something happened or not, no?

ebon citrus
#

no matter if you define any EH's or not, the engine will go there

#

so adding one that is empty doesnt change anything

#

when the game iterates through its tasks, it will raise a flag on certain conditions

#

kind-of

#

it will do this no matter if there are EH's or not

winter rose
#

no loopås needed 😉

ebon citrus
#

i dont have the specifics

slender schooner
#

i see

#

guess this is too high for me for now

#

but i ll keep that in mind

ebon citrus
#

but having done software and recently game-development

#

i can say nobody would loop a check for these things

#

as the engine needs to handle the matter anyways

#

and if it does, it just raises a flag

#

what you need to know, is no

#

EH's dont matter

winter rose
#

an -event- -handler-
is basically a subscription to an event. you say:

  • hey engine: whenever someone "FiredMan", run this script
  • ok buddy
ebon citrus
#

adding more EH's dont matter

#

what you have in those EH's, matters

winter rose
#

especially since they are unscheduled

#

(you can schedule them by spawning)

ebon citrus
#

so the game stops to execute the code before it moves on

#

bascially

#

if you need a return: call. otherwise: spawn

#

especially if the task is time intensive

slender schooner
ebon citrus
#

and never while-loop

slender schooner
#

while loops are cool

ebon citrus
#

all while-loops are simps

slender schooner
ebon citrus
#

now, this begs the question

#

@winter rose are trigger activation fields a "waituntil" or a while?

#

or some other method

winter rose
#

it's an if run every 0.5s iirc

ebon citrus
#

so more triggers: more time spent evaluating

winter rose
#

unscheduled too

ebon citrus
#

unscheduled is tight

#

basically:
call: "when your mom calls you with your full name"
spawn: "when your mom goes out shopping and leaves a list of tasks on the table"
trigger: "when your dad keeps asking you to come and look at something"

unkempt sorrel
#

@ebon citrus im attaching an ai to a plane, but the problem is he doesn't like to use his laser when attached, but with setPos it uses it, but is super unreliable

ebon citrus
#

is this that UAV thing again?

unkempt sorrel
#

yeah i eventually got it to work, hideobject works with the ir laser, only problem now is just transporting the ai

ebon citrus
#

i believe the laser gets hidden at some distance

unkempt sorrel
#

yeah but, its like 2km so its not that bad if i fly 1.5k

ebon citrus
#

🤷‍♂️

#

nobody has tested

#

let Lou know about your experiments

#

if there is anything to update

#

or if you find a bug

unkempt sorrel
#

yes sir :D

#

i think i found my answer

ebon citrus
#

what?

jolly jewel
#

Is anyone here good with relative positions?

winter rose
#

kinda

ebon citrus
jolly jewel
#

I'm trying to spawn objects relative to a house but inbetween getting the coordinates and spawning things in, things end up offset

ebon citrus
#

it does all the complicated math for you

jolly jewel
#

Specifically when the objects are rotated along the Y and Z axis

ebon citrus
#

?

#

example?

#

you could use attachTo

#

to the house-object

#

and use the offset

jolly jewel
#

I don't think I can post pictures here

ebon citrus
#

you can

#

post it on imgur

#

and link it

winter rose
#
_theHouse modelToWorldWorld [-5, 1, 0.25]; // don't laugh at the name
jolly jewel
#

Ok here's how it looks when grabbing the objects

ebon citrus
#

that aswell

jolly jewel
#

This is how it looks when I try to spawn them in

ebon citrus
#

yes?

#

script?

#

they are spawned in

#

i can see that

winter rose
#

how are they grabbed, and how are they spawned?

ebon citrus
#

but HOW are you spawning them in?

#

and how do you expect them to be?

jolly jewel
#
_house worldToModel getPosATL _x;
[_x, _house] call BIS_fnc_vectorDirAndUpRelative;
#

This is how I get the relative position and dirAndUp

ebon citrus
#

what is _x

#

also, remember that getposatl is relative to terrain

jolly jewel
#
_obj setVectorDirAndUp [_house vectorModelToWorld _dir, _house vectorModelToWorld _up];
  _absPos = _house modelToWorld _pos;
  _objPos = (_absPos vectorDiff (_house vectorModelToWorld (_up vectorMultiply (vectorMagnitude (boundingCenter _obj)))));
  _objPos set [2, _absPos#2];
  _obj setPosATL _objPos;```
#

That's the code for placing the objects

#

_x is each object in the house

ebon citrus
#

[_x, _house] call BIS_fnc_vectorDirAndUpRelative; this does nothing

#

_house worldToModel getPosATL _x; this does nothing

jolly jewel
#

As for what I expect, I expect the second picture to look like the first, but it's offset

#

I just took that out of the larger script, it's what I use to get and save the position and rotation

ebon citrus
#

when you take stuff out of script, you need to explain it

#

i would really appreciate to see the whole sequence

#

but i can see that you dont want to share that

jolly jewel
#

Well I said that's how I get the position and rotation

#

I just write it down and paste it into another script for debugging, so the whole script isn't relevant

ebon citrus
#

position: Array - world position, format PositionAGL or Position2D

jolly jewel
ebon citrus
#

yeah, sec

#

i do not have the time nor the mental capacity to debug your entire srouce-code for you

#

sorry

jolly jewel
#

I never asked you to

ebon citrus
#

youre giving too little information for me to be of help

#

maybe Lou will be able to help you

jolly jewel
#

I posted the information that I thought was relevant

ebon citrus
#

for me atleast, you need to make it a little bit easier to digest

#

what i see is a lot of irrelevant code that does nothing and an issue that is not properly explained/the steps to reproduce

#

but that is just me

#

someone with more experience might be able to look at your code and know immediately

drifting copper
#

Anyone familiar with the current LFC script?

I keep getting undefined description error in _x in the one .sqf

ebon citrus
#

lfc?

#

liverpool football club?

winter rose
#

@drifting copper ^

drifting copper
#

Yeah that one

ebon citrus
#

i dont think one .sqf is included in that script

Anyone familiar with the current LFC script?

I keep getting undefined description error in _x in the one .sqf
@drifting copper

drifting copper
#

Sorry that is my bad in describing the issue. error is in feedInit.sqf

ebon citrus
#

which line?

#

@drifting copper

#

@winter rose why do people do this: format ["%1",_x]

winter rose
#

in case _x is an object, maybe

ebon citrus
#

str()?

#

str(_x)

still forum
#

str _x

winter rose
#

str _x
also, some people coming from other languages think format ["%1", _x] is the way to display strings

ebon citrus
#

i see

#

it's weird

#

some people write really elaborate scripts

still forum
#

people just don't look at the stuff enough before starting to write code.
You see format MUCH less often than str, and they see format can turn stuff into string, so thats what they use

ebon citrus
#

but dont know str

#

i mean str is pretty much a common method in most languages

#

or something similar

#

anyways, which line?

drifting copper
#

That all just went over my head ^

#

It is complaining about line 1 and 5

ebon citrus
#

not possible

drifting copper
#

I also can not seem to get the eventHandler to view the screens. Such a nice script that I had in a mission before

ebon citrus
#

can you show the error-message?

drifting copper
ebon citrus
#

@drifting copper the errors is in secure.sqf

#

undefined variable base

silver mauve
#

how do i attatch an ir strobe to ai so i dont friendly fire them in the a-10?

ebon citrus
#

attachTo

#

or use Ace framework

silver mauve
#

i'm using ace but how would i make it so they have an attatched ir strobe?

drifting copper
#

Are you attaching in editor or Zeus?

silver mauve
#

editor

drifting copper
silver mauve
#

i have that

ebon citrus
#

@drifting copper did you see the reason of your error?

#

undefined variable base

drifting copper
#

I do not know what it means sadly

winter rose
#

it means that base is not defined anywhere and therefore cannot be used

ebon citrus
#

it's a good read for people starting out with arma 3 sqf

silver mauve
#

How do i make it so when the AI is caught in an ambush they dismount and return fire

#

Because they just stay in the vehicles and dont get out

winter rose
#

mods? @silver mauve

delicate maple
#

Anyone knows which eventHandler is fired when Zeus gets into a Unit via remote control?

winter rose
#

yes

#

the wiki

#

(trying to find it)

delicate maple
#

tryed to find kexwords UAV, remote, control, curator ... not really anything matching ..

#

maybe mission handlers ...

#

"PlayerViewChanged"

#

thx

winter rose
#

sorry, didn't help ¯_(ツ)_/¯

delicate maple
#

did not work. That weird because i thought Zeus remote control is also just an UAV of some form.

ebon citrus
#

@delicate maple attach a user interface EH to display 312(curator display)

#

onLoad should suffice

winter rose
ebon citrus
#

i dont think that works, lou

#

would have to test

#

but you can always attach an EH to the curator display and check when it loads

winter rose
#

yep - I am not Zeus-experienced

ebon citrus
#

and then do soemthing

#

me neither

#

i've many times had intentions of re-writing a zeus-module

#

like, the entire zeus-module

#

it has some flaws

winter rose
jolly jewel
#

If anyone has some experience with relative positions and orientations, please contact me, because I think at this point my problem is with some technicality of vectorDirAndUp or positions above ground that I'm missing

winter rose
#

meep meep
I think I have something ready for you

#

if I find it through my files, I get it here

ebon citrus
#

what did you do @winter rose

#

to event handlers wiki-page?

#

the main-categories?

winter rose
#

the mini menu yes

ebon citrus
#

it's new, i hate it

winter rose
#

hahaha

#

fair enough, but get used to it cause you can't edit it :p

ebon citrus
#

it takes me 0.01s longer to sort through the page

#

😠

#

yeah, sure

#

im going to download the entire biki

#

and make my own biki

winter rose
#

been there, done that

ebon citrus
#

with cardgames and professionals

#

and that wont go down like 3 times a week

#

😅

exotic flax
#

@delicate maple when looking at ZEN (a well known Zeus mod) isn't there a EH or script which gets called when accessing a remote unit. However, they have their own EH's around Zeus and Remote units.

winter rose
exotic flax
#

still cleaning up the mess Lou made with the wiki exports :P

ebon citrus
#

btw, what's the license for the biki content?

exotic flax
ebon citrus
#

COMREF is my new bae

#

anyways, how often does comref update it's wiki?

winter rose
#

as often as I want

#

which is, so far, not needed until next patch

#

@exotic flax don't be sore, it's ok, you will win the next one I promise 😛

#

the day I get bored of doing it, I'll give the source to other peeps - unless I abruptly die, we're safe 😉

jovial steeple
#

this setObjectTexture [20, "vtx_UH60/Data/Exterior/Markings/Num_3_ca.paa"];

If I use the above should it handle the start of the filepath automatically or do I need to work out the start and enter it myself?

Answer= If there is no drive letter it starts in the mission folder.

slender schooner
#

i have been warned for sharing a link to a screenshot of my error message?

#

._.

ebon citrus
#

describe your links

slender schooner
#

on that link, you would have gotten to a screenshot sharing page where my error message screenshot was hosted

ebon citrus
#

object the warning?

still forum
#

on that link, you would have gotten to a screenshot sharing page where my error message screenshot was hosted
wasn't written down next to the link when you posted it.
7. When posting a link, please include a description/context to what is content,
place it within the appropriate channel else it might be deleted.
also wouldn't have changed anything on the crossposting.
Also this is #arma3_scripting, config errors are offtopic here, and if you just want to crosspost to here to complain that your code has config errors, that can also be classified as spam per #rules
so.. just don't do all that please.

faint obsidian
#

is there a way to make cars glow like vr suits do? i have a race track made with VR blocks and i'd really like to keep up the tron aesthetic

robust hollow
#

make an .rvmat with the values you need and apply it with setObjectMaterial

#

the glowing would be a full layer thing though, more like vr entities rather than vr suits where only specific areas glow

half hornet
#

anyone know how to play an animation like Acts_hubTalk_salute1

#

works with switchMove without a smooth transition obv but i was wondering how i'd go about making it a smooth transition between anims

warm hedge
#

playMoveNow

copper needle
#

How do I check if a certain string is in an array

half hornet
#

(“string” in _Array)

ebon citrus
#

Is there a script to trigger a reload animation without the reload occuring?

high marsh
#
if("Blah" in ["Blah","Bleeeh","Bl"]) then {

};

@copper needle

copper needle
#

Much appreciated

ebon citrus
#

i did it!

#

@winter rose i managed to do it

#

i took my car...

#

and i... and i drove circles around arma 3

#

i drove donuts on it's lawn

#

crashed right through it's window

#

i backed out of that stuff and drove away

#

and i claim no legal liability

#

but i can now reload a weapon ONLY from inventories of my choosing

#

is there a way to get a mod-prefix in script?

#

never mind

#

is there a script function to get all magazines that fit a weapon?

#

never mind, i made my own function with card-games and street performers

high marsh
#

magazinewells

ebon citrus
#

magazines*

#

literally:
configfile >> "CfgWeapons" >> [config-name] >> "magazines"

warm hedge
#

No. magazineWells is newer tech for magazine selection

ebon citrus
#

ok...

#

but theyre all listed in "magazines"

#

or is this some legacy thing?

#

modders left these in because...

#

it was trouble to remove them?

#

magazinewells is a good idea

ebon citrus
#

no more reloading from backpack and those god-awful animations are back

#

have at ye arma

#

this seems more akin to loading a recoilless musket than an rpg XD

winter rose
#

modders left these in because...
backward compatibility @ebon citrus

so a mod referring to this would not break after magazine wells introduction

#

(and noice on the "don't reload from backpack" thing 👍)

slate cypress
#

about player:
a player's unit is always local to the (human) player's machine
a dedicated server doesn't have a player unit (isNull player returns true)
to know if a certain unit is a player, use isPlayer

#

Does this mean if I execute a command on the console using player but then press server exec, it will see player as null?

robust hollow
#

as objNull presumably

winter rose
#

player simply returns objNull on a dedicated server as no "player" unit is selected there (unless someone toyed with selectPlayer server-side)

#

@slate cypress ^

if you want a current, local player reference to be used on the server, see remoteExec

[player, 0.5] remoteExec ["setDamage", 2];
slate cypress
#

What about global exec? I heard that it runs code on every client individually.

#

Does this mean player will be something different on every client or will it be the same as the person who ran the code?

exotic flax
#

already working on trying to understand it myself and then writing it down to be used on the wiki

slate cypress
#

Thanks

winter rose
#

but if I can make it clearer, yes, tell me

you are (only?) the second person to report an issue reading this specific part, so I suppose it can be better

exotic flax
#

IMHO the difference between local/global arguments and effects (and execution, like addCuratorAddons) is often not understood and could be explained better with some examples (like using remoteExec or using EH's similar to CBA using 'eventNamespace')

#

Especially because it also requires to know WHERE a script is executed (player, server, HC, etc.)

winter rose
exotic flax
#

wow... I've been on that page a thousands times... and never noticed it thonk

winter rose
#

💥🔨

#

we work hard and senpai won't notice us 😭

exotic flax
#

and I'm reading a lot of stuff on the wiki, compared to most people in this channel 😛

winter rose
#

…I cannot argue with that 😄

bright stirrup
#

will surfaceTexture be added to public release?

compact maple
#

Hi, is there a quick way to add altitude to a ATL position ?

warm hedge
#

@bright stirrup Most likely yes
@compact maple getPosATL player vectorAdd [0,0,10]

compact maple
#

Thank youuuuuuuu

jolly jewel
#

I'm starting to be very sure that there is a bug with relative positions and orientations

#
relDirAndUp = ([axe_1, house1, false] call BIS_fnc_vectorDirAndUpRelative);
relPos = (house1 worldToModel getPosWorld axe_1);
axe_2 setVectorDirAndUp [(house2 vectorModelToWorld relDirAndUp#0), (house2 vectorModelToWorld relDirAndUp#1)];
axe_2 setPosWorld (house2 modelToWorld relPos);```
#

Given two houses, house1 and house2, of the same type and an object axe_1 that is rotated around the X and/or Y axis, an object of the same type, axe_2 will almost but not exactly get the same relative position to house2 as axe_1 has to house1

winter rose
#

how do you set their pos btw?

jolly jewel
#

I have a mission, but I can't upload it

winter rose
#

the command used

jolly jewel
#

I have placed it in eden

winter rose
#

no, I mean, how do you spawn and place the new ones

jolly jewel
#

They're both spawned in eden

#

And named

#

And the one named axe_1 is rotated

#

Here's a link to a mission with the objects and code for the bug to occur

#

Well I suppose the right thing to do is to submit a ticket to the feedback tracker

winter rose
#

wait until you are really sure there is an issue with commands, and not simply a code error

jolly jewel
#

What do you mean?

winter rose
#

well, if you say "the command doesn't work as expected" and it comes from a user error, it doesn't help anyone

jolly jewel
#

Well I've been sitting with this for a while and I don't see how this could be a user error

exotic flax
#

tbf.. I've also noticed some issues with PositionASL, where the results aren't always perfect...

jolly jewel
#

I will concede that I don't know exactly where in that chain of commands that it goes wrong, I suppose I'll see if I can isolate it

exotic flax
#

as far as I can tell it's because it still takes in account the terrain (height, slope, etc.) when placing objects, especially when used in combination with commands which don't calculate in ASL specifically.

winter rose
#

setPosASL is setPosASL, no matter the terrain

#

what the issue might be, though, is getPosATL in a house - the ground below may be wavy, we don't know

jolly jewel
#

But I use neither of those commands, I use setPosWorld

#

And it is also relative to the house, so the ground shouldn't factor into it at all

exotic flax
#

but if the house is turned due to the terrain, the relative objects are also turned

#

or not... which will than cause issues

still forum
#

is there a script function to get all magazines that fit a weapon?
cba has one, I think cba_common_compatibleMagazines

jolly jewel
#

@exotic flax The vectors for orientation are also turned relative to the house, so it shouldn't be the house rotation influence it in the wrong way

slate cypress
#

When using say3D and playing a sound file through the console in a dedicated server, is the standard file directory the location of the pbo?

#

So if I place a .wav file with the pbo, I can simply just use the name of the file rather than doing some kind of directory?

exotic flax
#

say3D requires the sound file to be configured in CfgSounds

#

and then you need to reference the classname instead of the filename anyway

ebon citrus
#

@slate cypress playsound3d (amd maybe2d) is the only sound script that can use direct paths to file without cfgSound, btw

#

PLEASE DONT CHANGE THIS

#

My reload script relies on it

#

Nope, only playsound3d

slate cypress
#

Thank you @ebon citrus @exotic flax

ebon citrus
#

But use playsound3d sparingly