#arma3_scripting

1 messages Β· Page 559 of 1

winter rose
#

fog of war, etc

real osprey
#

Thats the idea essentially

#

Just struggling to achieve it. This is my first venture with SQF

winter rose
#

oooooof, you didn't pick the easy first project - but if you need help, we're here!

steady terrace
winter rose
#

Do you mean the "terrain trivia" text @steady terrace? That would be by addon, nothing you can do by-mission

steady terrace
#

@winter rose yeah that's what I meant! Found it, thanks. Bit weird that maps are addons, but hey

exotic flax
#

well, it "adds on" the default game πŸ˜‰

tough abyss
#

Can anyone tell me why this scipt for warlords give me error

exotic tinsel
#

how can i determine if the object returned from nearest objects is in front of player?

tough abyss
#

oh wtf i cant send the full script and i cant send t he file

#

Can i Pm someone my warlords script to see why its not working?

daring pawn
tough abyss
#

ok

#

Mods im using are CUP weapons vehicles and units

tough abyss
#

How can I show HP using scripts?

ivory lake
#

I'm trying to work out a method to essentially have 'getDirTo' but for VectorDir, and while my current implemenation works, soon as any pitch is involved (like the vehicle is on a slope, and is doing a 180 on said slope) things behave incorrectly

#

currently i'm using

            private _dirTo = _positionVehicle getDir _positionTarget;

            private _dirVector = vectorDirVisual _vehicle;
            private _dirVectorUp = vectorUpVisual _vehicle;
            private _dirVectorTo = [sin _dirTo * cos _altitude, cos _dirTo * cos _altitude, sin _altitude];

which as said, works great on flat surfaces

tough abyss
#

Hello, do you know any trick for add addaction to my createsimpleobject p3d?

jade abyss
#

@ivory lake

_dir = (getPos _objA) vectorFromTo (getPos _objB);
_objA setVectorDir _dir;

Like that?

ivory lake
#

πŸ€”

#

lemme try it

#

I forgot that's a thing

jade abyss
#

That is what i am sometimes using, instead of getDir

ivory lake
#

ppppht

#

damn you @jade abyss always come in with a simple solution that works first go

jade abyss
#

πŸ˜›

ivory lake
#

ive been racking my brain all damn day with this crap

jade abyss
#

+i think... the same should be working with vectorUp πŸ€”

#

(maybe using vectorDiff, instead of vectorFromTo )

#

Also: I hate Vector-stuff the most, so that's probably the reason, why i go for the easiest way πŸ˜‚

ivory lake
#

I hate them too because I have NO idea what i'm doing with them

jade abyss
#

πŸ˜‚

ivory lake
#

vectorupTo might be important as well

#

ill try using vectorDiff for that

jade abyss
#

UH! Thx to you, i found a solution for one of my current problems πŸ˜‚
Thx alot πŸ˜„

ivory lake
#

glad I did something????

jade abyss
#

probably πŸ˜„

#

Okay, not problem, "improvement"

ivory lake
jade abyss
#

Have you vectorNormalized it?

#

or was it vectorMagnitude? i can't remember.

#

gtg now, hl me, if you found something o7

ivory lake
#

nope just private _dirVectorUpTo = _positionVehicle vectorDiff _positionTarget;

#

i dont really need it so I probably wont mess around with it unless someone hands me it solved

jade abyss
#

vectorUp needs normalized stuff, iirc

#

OH wait, fromTo already gives normalised one

#

anyway, later o7

errant patio
#

What's the best way to get the nearest road from a position? just nearRoads and then test the distance to each road and find the shortest one? :/

unique sundial
errant patio
dusky pier
#

is possible to change marker text color?

#

only text without picture

winter rose
#

text colour = marker colour
you can make two markers though

tough abyss
#

how can i show hp of people using scripts, i already know name and distance

#

But how can i show the hp :0

worn forge
#

Reaper when you say hp, do you mean their current damage level?

tough abyss
#

like health of player

worn forge
tough abyss
#

im asking how could i display this on the player

unique sundial
#

DrawIcon3d

tough abyss
#

killzonekid omg you are a godly script man, im a fan

#

i just dont know how to use drawicon3d to to this sadly

#

i love your blog man

unique sundial
#

There are 2 examples on wiki make it work then modify

tough abyss
#

how could i use that to draw the hp of players though (sorry for being a moron)

worn forge
#
   {  drawIcon3D [
    "\a3\ui_f\data\IGUI\Cfg\Revive\overlayIcons\r100_ca.paa",
    "colorBLUFOR",
    (getPosATL _x) vectorAdd (_x selectionPosition "Spine3"),
    1,
    1,
    0,
    format ['%1 (%2m) %3', name _x, floor(_x distance player), damage _x],
    2,
    0.03,
    "PuristaLight",
    "center",
    true];
   } forEach allPlayers;
}];```
#

Altered something I'm using, you'll have to tailor it for your own use

jade abyss
#

```sqf
script
```

#

@worn forge

worn forge
#

Well, that made everything better

jade abyss
#

If you add sqf, right after the first 3 `-> Highlights \o/

worn forge
#

Dscha, appreciated - between Reddit & Discord's formatting rules, I get lost

jade abyss
#

o7

tough abyss
#

appreciate the point in the right direction, i will *mess around with it at home πŸ™‚

unique sundial
#

Where the text goes put
format ["%1 %2%3", name player, 100 - round (damage player * 100), "%"]

worn forge
#

Ah KK you spoiled my fun, I was looking forward to the 12-digit decimal place

tough abyss
spice axle
#

You are sure all classnames are correct?

#
 class CUP_B_M1A2_TUSK_MG_US_Army //Tusk 2 M1a2
                      {
                     cost = 7000;
                    requirements[]={};
                   
               
            };

missing bracket + semicolon, you pls use a better tab style

#
class B_APC_Tracked_01_AA_F
 
               {
                    cost = 4000;
                    requirements[]={};
                };
 
               class CUP_B_M1128_MGS_Woodland //MGS
                  {
                    cost = 5000;
                    requirements[]={};
                };
               class CUP_B_LAV25_USMC //apc
                 {
                    cost = 4300;
                    requirements[]={};
                };
              class CUP_B_M2Bradley_USA_W //Bradley
                    {
                       cost = 6000;
                       requirements[]={};
                    };
              class CUP_B_M1A2_TUSK_MG_US_Army //Tusk 2 M1a2
                      {
                     cost = 7000;
                    requirements[]={};
                

That are 5 different tab alignments, don't do that, nobody can read that without looking closely. @tough abyss

winter rose
#

zOMG what he said!

tough abyss
#

@spice axle pastebin took my copy+paste wierd idk what i did for it to turn out like that i also just noticed the comments moved down a line for each one, ill look at missing bracket + semicolon when i get home ty for time

spice axle
#

you are mixing tab and spaces

tough abyss
#

rgr ill fix it now

tough abyss
#

fixed but still getting some error when loading the game i dont understand

#

^^fixed the error in the gyazo screenshot but the issue of the diffrent tabs not showing in warlords (only gear amd arsenal still persists

noble storm
#

If I get an error with something that spits out Unit C Alpha 1-2:1
is that referring to the first unit in Alpha 1-2? The "Unit C" thing is throwing some of us since we don't know what that means

still forum
#

yes

#

thats the name of a "unit"

#

Group is "Alpha 1-2", not 100% sure about the :1 might aswell be ownerid

noble storm
#

alright. So the C thing doesn't relate to which specific unit in the group it is?

still forum
#

Not sure. Might be units description/name thing?

#

Do you have a "Unit C" in that group?

noble storm
#

Give me a bit to relook at the mission we were testing. There may be one. Although it would have to be variable name since the normal "slot" name was pretty generic.

still forum
#

otherwise we have to wait for someone who knows for sure how that unit name is made up. I'm sure I knew it at some point in the past, but I don't anymore

tawdry harness
#

Is it possible to set a ai squad's waypoints from a waypoint array?

#

If not how would you suggest I got about it?

worn forge
tawdry harness
#

nope

#

i want to see if i can use another way

#

i already looked into that

worn forge
#

Then you'll have to explain a bit more what youw ant

tawdry harness
#

I have a squad1 with a set waypoints and squad2 without any waypoints. Is there anyway to copy and store squad1's waypoints and apply it to squad2 after a set amount of time without using copyWaypoints? Would I have to loop through all of squad1's waypoints to gather the positions and store that info (and maybe apply to a squad3 or 4) and then apply it to squad2's through addWaypoint or is there an easier way?

tough abyss
#
drawPlayerDmg = addMissionEventHandler ["Draw3D", {
   {  drawIcon3D [
    "\a3\ui_f\data\IGUI\Cfg\Revive\overlayIcons\r100_ca.paa",
    "colorBLUFOR",
    (getPosATL _x) vectorAdd (_x selectionPosition "Spine3"),
    1,
    1,
    0,
    format ['%1 (%2m) %3', name _x, floor(_x distance player), damage _x],
    2,
    0.03,
    "PuristaLight",
    "center",
    true];
   } forEach allPlayers;
}];```
#
{ |#|drawIcon3D [
    "\a3\ui_f\data\IGUI\Cf...'
Error 0 elements provided, 4 expected```
#

^ I get that message when I execute in my test server

#

@worn forge any idea

cunning crown
#

"colorBLUFOR", I don't think it's valid

worn forge
#

Yeah, my bad, shouldn't be in quotes, it's a global

tough abyss
#
drawPlayerDmg = addMissionEventHandler ["Draw3D", {
   {  drawIcon3D [
    "\a3\ui_f\data\IGUI\Cfg\Revive\overlayIcons\r100_ca.paa",
    colorBLUFOR,
    (getPosATL _x) vectorAdd (_x selectionPosition "Spine3"),
    1,
    1,
    0,
    format ['%1 (%2m) %3', name _x, floor(_x distance player), damage _x],
    2,
    0.03,
    "PuristaLight",
    "center",
    true];
   } forEach allPlayers;
}];```
worn forge
#

yup, should do

tough abyss
#

^ Still getting that same message

#

0 elements provided 4 expected

worn forge
#

Well technically it's looking for a four-number array, for [Red, Green, Blue, Alpha]

#

colorBLUFOR is a global that encapsulates that

#

but you could just as easily do [1,1,1,1]

tough abyss
#

yeah, i don't think that's the issue x)

#

getting the same message

#

I also tried putting killzone kid's

format ["%1 %2%3", name player, 100 - round (damage player * 100), "%"]```
#

to replace the sqf format ['%1 (%2m) %3', name _x, floor(_x distance player), damage _x] in yours

worn forge
#

I'd advise removing the fancy stuff and building it back up

tough abyss
#

that script should be showing hp right?

worn forge
#

should be

tough abyss
#

i wonder what the heck is the issue, lol

worn forge
#

did you swap colorBLUFOR for [1,1,1,1] ?

tough abyss
#

ok, that worked. but it's only showing my own "hp". i say "hp" because it's either a 1 for dead or 0 for alive. and it's only showing on my player, not the npcs i've placed in this test

worn forge
#

It won't work on npcs, because the loop runs on allPlayers

#

You can use allUnits for the test you want to do

tough abyss
#

killzone's part is showing my actual hp

#

cool

#

appreciate all the help guys

plain current
#

what does getObjectFOV actually return? the size of the object on screen?

winter rose
#

it might seem so, but I cannot confirm

young current
#

What does it say in the wiki page?

#

That's what it gives.

slate sapphire
#

a stupid question it's possible to disable radio chatter on planes/heli without disable radio between AI ? and it's possible to avoid you char scream so loud that can be ear by 2 km far when give orders?

errant patio
#

Working on my deadzone fix mod and I'm trying to set the view angle of the player. I can do it with setVectorDirAndUp but that angles the entire body :/

Is it possible to manipulate only the upper half of a character's torso? It seems like it is possible to do so with things like vehicle turrets but i'm not exactly sure how to alter CAManBase (or if that class can even be edited?) to make the same functionality available...

still forum
#

Is it possible to manipulate only the upper half of a character's torso?
no

errant patio
#

:(

smoky verge
#

Is there any way to move a static object x meters in a direction?

errant patio
#

I might just add this to my mod with a little 'this looks awful in third person do you really want to enable it?" checkbox :/

still forum
#

Is there any way to move a static object x meters in a direction?
uh setpos?

smoky verge
#

doesnt this just teleport the object?

still forum
#

yes

smoky verge
#

uhh maybe that
I'll check
seems tricky but it may work

knotty kayak
#

Asking for a friend.
We are looking to script a working ECM Backpack that can disrupt the activation of IEDs while also blocking radio communications, needs to be able to be toggled on and off, testing so far he has a somewhat working script but radios do not work at all and sometimes IEDs still trigger, we use ACRE2, any help would be appreciated, for more details I can pass on my friends details.
This is for a British Milsim we are in.

exotic flax
#

For ACRE you already seem to found a solution, which probably needs some modifications.
For IED's it's relatively easy: simply disable the IED when jammed:

_enitity = [explosive object];

// disable simulation = disable triggering
if (isMultiplayer) then {
    _entity enableSimulationGlobal false;
} else {
    _entity enableSimulation false;
};                           
#

Something that I found out while trying to do the same, with the addition of failing to jam IED signals, was that I had to run event handlers on the explosives instead of the item. Otherwise you might have 2 people trying to jam and get very strange results πŸ˜‰

ivory lake
#

Anyone got any experience with using onDestroyScript on particles?
I need to pass parameters to it but it only lets you specify a script name, whats passed to that script is set (just the position of the particle)

I've tried setting up a queue system where it takes the latest parameters from an array when the script runs but this is unreliable when multiple instances of the script run.

does anyone have any better ideas?

unique sundial
#

how many particles you have? you can make script1 to scriptN and depending on the particle call this or the other script and call your function from each script but with param, you know what I mean? @ivory lake

#

Not the most elegant solution but it will be reliable

ivory lake
#

unlimited, I ended up just using a vehicle instead of a particle

#

ThingX to be specific

smoky verge
#

I attached a platform to a vehicle with attachtorelative
if I use the vehicle as anchor the platform becomes untouchable by other vehicles
if I use the platform as anchor the vehicle becomes unuseable
any way to solve this?

astral dawn
#

no

#

unless... setPosWorld getPosWorldVisual on each frame?

smoky verge
#

what does it do?

#

but it doesnt seem something that applies to moving stuff right?

astral dawn
#

Well if you update the position of the attachment on each frame, it should work ok

#

Unless it lags by one frame

#

Might look ugly on clients, I am not sure

smoky verge
#

its for sp

astral dawn
#

well then go ahead and try it

#

of course you will have to run the model to world position and rotation transformations as well

#

thankfully SQF has such commands

smoky verge
#

to save on performance I could update it only when player enters a specific area
but how do I do that?

astral dawn
#

I am not even sure if my method works

smoky verge
#

maybe I can find a way to limit how the attachtorelative works

hollow thistle
#

you will not have collisions on object when using attachTo, get/setPos seems like ok solution in SP.

#

In MP it could lag and generate a lot of trafic.

smoky verge
#

I can't seem to understand how to use them correctly
what I'm trying to do is to use said platform as a bridge, so I need the collision, which seems to work when walking but not with vehicles

astral dawn
#

Okay, so you have an _object, when you attach that _object to another _vehicle, the _object has no collisions with other vehicles

#

so as workaround we suggest to try to NOT use attachTo command

#

but instead make an onEachFrame event handler, which does setPos/getPos

#

to teleport the _object every frame

smoky verge
#

oh I see
so fps will become a must

astral dawn
#

no, what makes you think so?

#

you are not going to have 1000 of such platforms, are you?

#

Anyway, Arma Script Profiler will help you see the slow parts of your algorithm

#

But generally you can use the 'performance test' button in the console to see how much time it takes

smoky verge
#

oh no its just 4 floating boxes
though that with this system objects would feel laggy when the framerate lowers
just realized it doesnt make sense

astral dawn
#

though that with this system objects would feel laggy when the framerate lowers
why?

#

Oh you mean if their positions lag by one frame

#

Yes but I am not sure if they indeed lag by one frame in that case or not

#

Need to know how engine works

smoky verge
#

so I did some tests and I've most likely done it wrong
used
BoxA setPosWorld getPosWorld car;
didn't expect to work flawlessly but hoped it could at least fix boxA on the same position as the car

astral dawn
#

How does it work when run on each frame then?

smoky verge
#

it doesnt

#

I hope someone more capable than me manages to find a solution for this problem in the future
as for now I've just used a disgustingly cheap and easy trick
I'm simply activating the attachto only when the player enters the vehicle, and detaching when he gets out
https://imgur.com/a/SI96F5T

tough abyss
#

Anyone else having issues with the wiki? I'm trying to look up some variables n what not but its giving me 502 Bad Gateway.

exotic flax
#

yup, known problem

tough abyss
#

I needs some dikcodes from it 😦

worthy willow
#

@tough abyss What code?

hollow thistle
#

(uiNamespace getVariable "RscDisplayMission") displayAddEventHandler ["KeyDown", "systemChat str _this"];

#

One of the values in array should be the dik code of the pressed key

#

(not sure if works, typed from phone)

worthy willow
tough abyss
#

I found it finally, I was looking for numbpad codes, but i found one that was for number 1 and i just went up from there.

worthy willow
#
_xx = _vec # 0;
_vec set[0,(_vec # 1) * -1];
_vec set[1,_xx ];
#

Is that the fastest way to rotate 2d vector 90 counter clockwise?

#

Guessing it is

exotic tinsel
#

bohemia is down for me at the moment so is there anyone willing to share a script that would allow me to loop through all animations and play then on a player? just trying to create a handy script for finding animations

tough abyss
#

@exotic tinsel animationNames will be of help

exotic tinsel
#

yeah i cant access bohemia at this time to look that up. i will make a note of it for later. hoping someone has a script i can work off of until the site is back up.

worthy willow
#

There is an Anim viewer

#

[] call BIS_fnc_animViewer;

unique sundial
#

If you can play anim with playMove you can just execute them all at once and they will play one after another

delicate lotus
#

Is it somehow possible to give agents waypoints directly?
Or do I have to write my own "waypoint system" by telling the agents to move to A, when they are near A to move to B, ...,when they are near N to move to N+1.

little ore
#

Hello, i having trouble to find an array where i can define a vehicle as an ace-medical-vehicle (_vehicle setvariable ["ace_medical_isMedicalFacility", true];) . Before they moved the acesettings to cba you could simply write them in an array in the medicalmodule, i find nothing about it in the cbasettings.sqf

#

Anyone can help?

still forum
#

double click the vehicle in 3den

little ore
#

@still forum ty, i saw that allready. The Problem is this will only set this specific vehicle to an medfacility. I want to define a vehicle ones and spawn vehicles during the mission with the var allready been set, like how it worked with the module.

still forum
#

is there no cba setting anymore?
Could use initpost eventhandler to set the variable, but no time to explain that

digital hollow
#

Do you mean a class of vehicles?

little ore
#

@digital hollow yes i do

digital hollow
sonic linden
#

hi how can i get the current opened container / weaponholder when player is in gear ?

little ore
#

@digital hollow ty

digital hollow
sturdy sage
#

Sometimes when i change the fog via setFog i get a white line across the screen and don't see the actual fog. Some things can fix this issue, like for example going into Zeus and then out of it again fixes it. What is causing this and how can i prevent this from happening? Could it be, because i change it with a serverside script?
https://imgur.com/a/M6h1BWE

exotic flax
#

I guess there's some script which messes it up...

#

and based on the screenshot there are a lot of places where it can go wrong

sturdy sage
#

That was during a play session. I also did some testing with only northern fronts terrains loaded in an empty mission and it still happened.

exotic flax
#

and if you test it in a vanilla environment (so without any mods)?

sturdy sage
#

I could, probably should do that. But i was told this isn't a new issue so i hoped someone had a quick solution or at least some information on it.
The problem is that this happens very unreliably, so its a bit annoying to test. But i will try it on a vanilla map without mods loaded again a few times till it happens.

exotic flax
#

I know several issues related to fog, but never saw this one. And setFog should be executed on the server, so that won't be the issue.

sturdy sage
#

Yeah that is how i did it.

exotic flax
#

The only thing which currently comes to my mind is that a mod/script is messing with the fog settings of the terrain(s), which causes this glitch.

sturdy sage
#

I also only had it happen on server, never when i host the mission myself. Which is why i assumed some locality issue.

tough abyss
#

Hello, do u think it's possible to store a var on inactive user profile with profileNamespace command?

winter rose
#

none that I know of

#

that would be a security issue, e.g being able to corrupt all the profiles at once

tough abyss
#

thanks for your response.

worn forge
#

I've seen issues with setFog before, owing mostly to how Bohemia works fog. If you haven't read https://community.bistudio.com/wiki/Arma_3_Improved_Fog it's worth playing with those variables. Essentially the base of the fog can interfere with the height of the fog as time goes on, and the result is a weird horizontal line. It's more obvious with heavy fog, so just don't go crazy with the values and you should be alright.

exotic flax
#

I'm using the following line in a script:

if ((difficultyOption "thirdPersonView") == 1) thenο»Ώ {
   // some code
};

However this gives the error:
Error Invalid number in expression

I know that difficultyOption returns an integer (and in this case 0 or 1), and even when I make it a string (using str ... == "1") it gives the same error...

jade abyss
#

πŸ€”

exotic flax
#

ikr

jade abyss
#

In Editor

exotic flax
#

the only thing I can image is that the value is not set/available yet... since the function which I have this in is called through Extended_Init_EventHandlers

jade abyss
#

Same result on Dedicated Server.

#

Maybe a line earlier?

#

Mod-Issue then

#

Command works as expected in Vanilla Β―_(ツ)_/Β―

#

(still don't know how πŸ€” )

exotic flax
#

I know the command works, I did the same tests πŸ˜‰

jade abyss
#

Just a guess: It probably get's loaded too early

exotic flax
#

It's part of a mod, however the script should only be called when a MP mission is running (and needs to be called from the mission).

So technically it should not call before that... and at the moment it already returns the error the moment I start the game...

jade abyss
#

πŸ€”

#

Are you sure, that you haven't missed anything earlier? Missing ) or } or ] etc

exotic flax
#
// works
((difficultyOption "thirdPersonView") == 1)

// error
if ((difficultyOption "thirdPersonView") == 1) thenο»Ώ {
   hintC "test";
};
#

^^ in debug console

jade abyss
#

gonna start arma again

#
if (difficultyOption "thirdPersonView" == 1)then //wΓΆrks
{ 
   hintSilent "test"; 
};```
winter rose
#

and with extra brackets?

#

(should)

jade abyss
#

with extra brackets = wobblewobble

winter rose
#

wobblewobble such as no worky worky?

exotic flax
#

hmmm.... seems I had some kind of weird hidden character on that line which broke the script...

winter rose
#

Alt+255

#

don't code using Word πŸ˜„

exotic flax
#

I use Atom πŸ˜‰

winter rose
#

heh

exotic flax
#

I really should stop copy and pasting code from others...

#

because that's where the issue came from

winter rose
#

☝️ yup, a thousand times yup

#

it happened to me with some wiki code, that was not using the usual quote "
I looked for some time indeed

jade abyss
#

I remember, there was a greek ; that was a , or something

winter rose
#

That too, it's a known joke now amongst devs :p

jade abyss
winter rose
#

unless they use GitHub of course

exotic flax
#

so... another interesting question: Is it correct that isClass only returns objects which have scope = 2?

In other words, for a class to exist, it needs to be public?

#

Because I don't seem to be able to identify the class when it's protected

winter rose
exotic flax
#

same result... although expected... searching in "CfgWeapons" when the object is in "CfgVehicles" πŸ€¦β€β™‚οΈ

#

always a bad idea to do bug hunting when tired

winter rose
#

πŸ˜„

#

- 2, get in ammo shell
- no can do!

unique sundial
#

so... another interesting question: Is it correct that isClass only returns objects which have scope = 2?

No, isClass returns true if the argument is config property defined with keyword class

wary field
#

Also, is there a plugin that is useful when editing .cfg in visual studio code?

exotic tinsel
#

is there a function i can call that does what the orient to terrain does in the eden editor to fix these objects?
https://imgur.com/Zx3oz3a

digital hollow
#

surfaceNormal

exotic tinsel
#

@digital hollow thanks mate!

dreamy kestrel
#

Q: whenever you see curly braces, i.e. {}, these are just functions, correct?

#

along which lines, I wonder if this makes sense:

_caseOneCallback = { /* ... */ };
switch (_x) do { case 1: _caseOneCallback; case 2: ... };
#

Or would we need to still provide the switch body, i.e. { [] call _caseOneCallback; }? which wouldn't be the worst thing. just curious. thanks...

hollow thistle
#

these are just functions
no, these are CODE type.

#

case requires CODE type.

#

so yes, case 1: _caseOneCallback this is valid.

dreamy kestrel
#

@hollow thistle okay, well, semantics, po-tay-to, po-tah-to. yes, what I meant. good to know, thank you.

knotty mantle
#

How is arma calculating the time between a (mortar/arty/mlrs) Shell fired and the impact?

winter rose
#

math

knotty mantle
#

Yeah nice. Not gonna need to learn wizardry.

#

But is it calculate like in real life? Are there things I need to know? Has anyone done it and I just didn't find it via Google?

winter rose
#

I suppose they calculate from the angle/velocity/distance factors yes, but how factually I have no idea of the formula. do you need the result yourself?

knotty mantle
#

Basically I want to do a custom support system like the one arma has. But as arma ( in my experience) doesn't like support links between modules added on the fly I want to rewrite it. And one of the few things I don't know how to do is to give a timer on the map until shell impact.

winter rose
knotty mantle
#

How did I not find that with an hour Google search? Sorry.
I'll start testing that. But if it is the same vanilla arma uses it is not very accurate. So if anyone has deeper insights in the calculations needed I'll be very thankful

winter rose
#

it should be the same as vanilla, I do believe this is the command they use for Artillery interface

knotty mantle
#

Thanks anyway. And again. Sorry.

winter rose
#

no problem at all? you're welcome

runic surge
#

Hey, quick question. Can scripts in the file-patching folder not have return values?

still forum
#

They can. They are scripts like any other

#

Also there is no "the filepatching folder" but I guess I know what you mean

runic surge
#

I just mean the scripts folder in the player profile folder

#

It doesn't matter anyway, I was just trying to test something with the debug console

still forum
#

All scripts are same no matter where from

#

Scripts are just pieces of text

runic surge
#

I forgot that scripts executed with execVM only returns the directory

#

My current goal is to have a function set as a variable be called within an event handler but I can't seem to get it to work inside the event handler

still forum
#

only returns the directory
It doesn't. It returns a script handle

#

Call compile preprocessfilelinenumbers
Is your friend

runic surge
#

I see, thanks

#

I have solved all of my problems anyway lol they were just simple things that I missed somehow

#

Another question for anyone who might know, is it possible to get the position of the splendid camera?
It is easy to do in eden since it has its own command (get3DENCamera), and it is simple to get the player position, but I am missing a way to get the actual camera position itself

still forum
#

GetCameraPosition command. Maybe that's not the correct name, screen to world maybe
... Tfar has it.

#

Tfar_fnc_defaultPositionCoordinates see on tfar github

runic surge
#

positionCameraToWorld You mean this one? I looked at it but I guess I misunderstood what it does

still forum
#

Yes

#

If you use 0,0,0 you get campos

runic surge
#

Indeed it does seem to work

#

It doesn't work if there is no player unit, but it seems to work otherwise

#

thanks again

still forum
#

Should work without player too.. dunno..

sleek sail
#

Is it possible to mark some area as enemy so when you instruct AI to move by vehicle somewhere it will avoid roads in that place?

winter rose
#

not really, but you might make a trigger or a script that would set them "STEALTH" or "COMBAT" when entering, and back to "AWARE" when leaving @sleek sail

tame lion
#

what would be the best way to multiply the velocity of a bullet w/o changing its direction? Would it be vectorMultiply?

ivory lake
#

AI avoid mines so you could set up a bunch of mines surrounding the area and reveal them to the AI

#

that should make them avoid the area then

runic surge
#

is there an alternative to inputAction that can detect a specific key that doesn't require a display event handler?

#

I want to check if a key is pressed, regardless of what the current display is, and without the necessity to remove any event handlers

velvet merlin
#

@runic surge you can just add to main display. that should work all the time while playing

still forum
#

@tame lion yes. If you multiply a vector with a scalar you keep same direction... or you go opposite direction if you multiply with negative

slate sapphire
#

hello, I need help with unflip, it's not possible that a little stone kill a tank more than missiles.... do you have a safe code to unflip/unstuck vehicles that prevent the explosion on vector up, next to map objects, cos this physics is really really frustrating.

sonic linden
#

Hi can someone tell me how to get uniforms and vests from a container ?
there is :

WeaponCargo box
ItemCargo box
MagazineCargo box
BackpackCargo box

but how do i get Uniforms and Vests ?

still forum
#

the "items" for uniform/vest should be item or weapon I think

restive leaf
#

getItemCargo returns uniforms/vests

sonic linden
#

but
everyContainer box
only tells me the object and not the ammout of object (uniform/vest/backpack)

restive leaf
#

E.g. hpp [["FirstAidKit","V_PlateCarrierSpec_rgr","U_B_CombatUniform_mcam_tshirt"],[10,1,1]]

sonic linden
#

okay getItemCargo seems to do the job

tough abyss
#

Hello! So, a developement team I know wants to "add a command that measures how frequently a function or loop is called" to see what's causing lag & performance issues for a mission file and how it can be fixed and optimized. Any help?

still forum
#

Just use script profiler Β―_(ツ)_/Β―

tough abyss
#

You mean the mod you made or something else?

still forum
#

yeah

#

doesn't work with scheduled, but scheduled scripts themselves are limited to 3ms execution time anyway, so they won't really cause lag

tough abyss
#

I've passed on the word to them. Thank you!

tough abyss
#

In what language are the scripts for Arma 3

cunning crown
tough abyss
#

@still forum Is there a possibility for your script profiler to work on scheduled events?

#

Only?

winter rose
#

@tough abyss yes, why?

still forum
#

no

#

well you can enable instruction profiling and you'll see scheduled scripts

#

but as scheduled scripts cannot cause lag, it doesn't make much sense anyway

runic surge
#

@velvet merlin thanks. I'll look into it

cold mica
#

I must ask: is there a way to set myself to a variable name in Debug Console?

still forum
#

myVar = player

cold mica
#

Would it matter if I global, local, or target execute it?

still forum
#

yes

#

it will set the variable locally where the script is executed, to the local player where the script is executed

#

if you execute globally, everyone will have that variable with themselves in it.
If you target then only that target will

cold mica
#

understood, thank you. I have been trying to assign myself to the zeus module in a mission rn, but I think I have follied it

#

nvm, it worked after respawn. thank you very much

small iron
#

With camouflageCoef, is 1 is like invisibility while 0 is visible?

#

Or is it the other way around

ruby breach
#

^ That answers it pretty well

unique sundial
#

but as scheduled scripts cannot cause lag
Unless there is a single instruction that takes very long to execute

winter rose
#

looking at you, nearObjects πŸ‘€

winter rose
#

```sqf
/* your code */
```

#

could be pinned ^ πŸ˜„

wary field
#

Has anyone had any luck with forcing vehicles to reverse even for a few meters?

sonic linden
#

is there a function that convetrs a multi dim array to a single array ?

ruby breach
#

A command, don't believe so. A function, someone's probably written something at some point

still forum
#

turn array to string

#

strip all []
add [] on outside
parse simple array back to array

ruby breach
#

He'd still have to solve the issue of magazine/ammo counts if all he wants is classnames

still forum
#

iterate through the flat array, filter out all isEqualType string

analog inlet
#

dont know where to post this so i apologise, i cannot get rcon to work properly on my server, i have looked it up but cannot find a tutorial which actually works

lucid junco
#

do someone has an experience that the say3D command in some cases play sound twice?

peak hound
#

Added a p3d to an mpmission and players are getting random kicks for wrong signature for file. Anyone got any ideas?

lucid junco
#

so files seems somehow broken, after reexport audio everything works good πŸ˜•

twilit scarab
#

I know im doing something stupid but havent tried basic scripting in awhile

#

Keeps telling me "Error missing_;"

still forum
#

@peak hound missions (mpmissions) aren't signature verified.. so.. what other file are you getting sig error for

peak hound
#

I have a file in my mpmission called mymodel.p3d, I spawn it in using createSimpleObject and I am kicked for "wrong signature file for mymodel.p3d"
@still forum

twilit scarab
#

vehicle disableAI "LIGHTS"; _vehicle setPilotLight true;

#

what am i doing wrong

#

Wait

#

Think i got it

still forum
#

well there are no signature files in a mission pbo

#

so...

peak hound
#

so why is it kicking me for that reason then?

still forum
#

you have a mission pbo right? not a folder?

peak hound
#

yeah

#

mission pbo

still forum
#

might be game bug then πŸ€”

hoary mural
#

yeah I've also had this issue

#

with p3d in missions

still forum
#

and that ping is supposed to do what now?

hoary mural
#

maybe get a issue resolved in the game for once?

hollow vigil
#

get shit fixed for once

still forum
#

Is there a feedback tracker ticket? If not then it won't get fixed.

hoary mural
#

instead of issues being posted on a issue tracker which is looked at once a year

hollow vigil
#

last time i submitted one of those bad boys bohemia lads ignored it for 2.5 years

peak hound
#

How do I make a ticket, i will make a ticket then

still forum
#

instead of reporting tickets properly. You instead just throw it at some guy in discord?

#

And thats supposed to be better?

hollow vigil
#

isnt it his job

still forum
peak hound
#

Thanks

still forum
#

please remove that ping.
According to #rules

2. Please refrain from tagging `Bohemia.net` staff, if situation needs immediate attention, please tag a Moderator. 
    When they can't provide the necessary information or are unresponsive, then you may tag `sysop` administrator.
hoary mural
#

please remove your ping on me then

restive leaf
#

Is there a full moon tonight?

still forum
#

apparently

#

@peak hound optimally please also attach the mission pbo, or atleast a similar one that can be used to reproduce the issue, and the script to spawn the object

peak hound
#

I'll send over something similar

#

Thank you for your help

still forum
#

yeah just something to reproduce it. doesn't need to be that exact mission

#

if a dev has an hour time to look at a bug, he doesn't have the time to also find out how to reproduce it.

lavish ocean
#

plus afaik what you trying to do never was possible, aka model file in mission pbo

peak hound
#

thats the issue i am having

#

model spawns absolutely fine but then i randomly get kicked for the message in the screenshot

hoary mural
#

exactly the same issue I was having when I created a small model and put it into the mpmission

knotty mantle
#

@wary field setpos is not an option? Wouldn't turn tyres but depending on distance that might not be needed?

lavish ocean
#

objects and such needs to be own addon in own mod file with e.g. config definition, it's not scripted element

#
hoary mural
#

so we can't use p3d (spawnable via createSimpleObject) in missions without mods?

still forum
#

atleast not with signature verification enabled

lavish ocean
#

it has nothing with signature verification, it wasn't possible even before that

#

it's jsut different error message ...

still forum
#

nah it works fine

#

createSimpleObject from mission works just fine

hoary mural
#

I am able to create the object and spawns correctly from the mission

#

however it just kicks you off randomly

#

signature verification

peak hound
#

if we disabled signature verification are you saying that would work?

still forum
#

I would say so yea

lavish ocean
#

in terms of usage of CSO vs p3d in mission file, i don't think that was intended to work

#

so it's undocumented grey zone (and also untested then)

#

anyway make the feedback tracker ticket, if it can be fixed for the CSO w/o unforseen consequences then it may get improved

still forum
#

i thought that it was even advertised to be usable for p3d's in mission file

#

but that may just have been community statements

lavish ocean
#

but fully fledged objects weren't supported in mission file

hoary mural
#

would be nice to have custom models in the mission

lavish ocean
hoary mural
#

instead of that, I'm using the new getMissionPath command

#

but as the issue above, we spawn the model in fine, wait 5-10mins then kicked for "wrong signature"

lavish ocean
#

ye that's logical as the check fails to find the file

hoary mural
#

shame really

lavish ocean
#

anyway, when one of you make the ticket, post it here and dm it to me (just for sure)

hoary mural
#

will do

peak hound
#

cheers for your help

dreamy kestrel
#

the whole select reference thing is still a bit fuzzy to me. if we have,

_arr = [0, 1, [2, 3, 4], 5, 6];
(_arr select 2) deleteAt 1;

then _arr should be [0, 1, [2, 4], 5, 6], is that right? in other words unless select is referencing a view into the array?

hoary mural
#

yes

dreamy kestrel
#

huh, okay, excellent. also as borne out in a debug console. thanks.

#

although sometimes it slices a reference, sometimes it does not. i.e. _x = [0, 1, [2, 3, 4], 5, 6]; (_x select [3, 2]) deleteAt 1; _x yields the original _x value.

hoary mural
#

inconsistent return values for the different syntax I guess

dreamy kestrel
#

hmm, interestinger and interestinger... in this case, _y still has the reference to its view... _x = [0, 1, [[2], [3], [4]], 5, 6]; _y = +(_x select 2); _y deleteAt 1; _x set [2, _y]; _y deleteAt 1; _x yields [0, 1, [[2]], 5, 6]

winter rose
#

_y is an array duplication (+array) yes

still forum
#

y is a deep copy, so no it doesn't have a reference

#

but then you replace the array reference at index 2, with _y

dreamy kestrel
#

in getting there, yes, but point is illustrating _y still has its reference when deleteAt occurs.

still forum
#

well yeah, if you delete an element inside an array, the array doesn't disappear, it just gets its contents modified

dreamy kestrel
#

can even do magic like, _x = [[0, [1, 2, 3]]]; _x select 0 select 1 append [4, 5, 6]; _x; yields [[0, [1, 2, 3, 4, 5, 6]]]

still forum
#

why is that magic?

dreamy kestrel
#

illustrating the point, select is powerful, but you have to be careful you may be selecting a reference view into the operand.

hoary mural
lavish ocean
#

ty

dreamy kestrel
#

hmm also good to know... _x = [0, [1, 2, 3]]; _x params ["_id", "_arr"]; _arr append [4, 5, 6]; _x yields [0, [1, 2, 3, 4, 5, 6]]

astral dawn
#

You are discovering properties of arrays being passed by reference, right?
You can use that if you want to pass a 'pointer' to a function so that it puts the result into that 'pointer'

digital hollow
#

Is there a command or function for the in-engine gravity acceleration?

feral kestrel
#

One message removed from a suspended account.

grim coyote
#

Does anyone know if allPlayers array return players in logical order as owner. Meaning I could use allPlayers select (_owner - 3)

unique sundial
#

@grim coyote No

#

@feral kestrel Yes, there are millions of scripts like this, just do a little searching

#

@digital hollow what do you mean?

grim coyote
#

Okay thanks.

knotty mantle
#

Is there a way to check the performance difference between a enabled trigger and a frozen (via enable simulation) one? Or basically, is it worth it to freeze them if they are not needed right now?

winter rose
#

it depends on the checked conditions (and the trigger size) @knotty mantle
usually it's not worth it
if you can enableSimulation false it, you can maybe also script its effects

knotty mantle
#

Thank you

digital hollow
#

@unique sundial I just used ~9.807 since it's close enough for military work =p

still forum
#

you want the gravity constant that arma uses?

#

9.8066

winter rose
#

Self-quoting is not source

real osprey
#

When working with an addAction, do I have to include all the parameters if I just want specific ones?

I want radius and hideOnUse, could I do

this addAction ["rescue","rescue.sqf", 3 , true];

winter rose
real osprey
#

I see object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint]

#

How would I "skip" sections?

winter rose
#

check parameters: some are marked Optional

#

you have to "reach" the one you want by filling with default values the ones you don't want to change, then you can leave out the ones after because optional

real osprey
#

Alright

#

so it would look more like
this addAction ["Rescue","rescue.sqf", nil, 1.5, true, true, "", true, 3];

winter rose
#

condition is a "string"

#

"true", not true

#

@real osprey

real osprey
#

and a string just means it has to be in quotes?

winter rose
#

yes

#

you can click on the String word for more explanation on the data type

real osprey
#

Awesome

#

Thank you

#

Another quick question

#

If I assign an AI to a group, the group leader would then be able to command him, yes?

#

ex

winter rose
#

yes?

real osprey
#
surv1 join (group player);```
winter rose
#
[surv1] join player```
#

you can activate the -showScriptErrors flag in the launcher to see script errors on screen

real osprey
#

does join player and join group player do the same thing?

winter rose
#

yep

real osprey
#

Will an AI following a player automatically get into a vehicle that the player its following gets into or no?

winter rose
#

nope, one has to order it

real osprey
winter rose
#

" quotations

#

or two apostrophes, 'string' and "string" are the same

#

you can literally copy-paste from the wiki here

real osprey
#

Im getting an "error bool expected string"

still forum
#

you were just told why

real osprey
#

So does every true need to be in "" or only the ones marked as string?

still forum
#

only strings need to be strings

tough abyss
#

all strings need ""

still forum
#

true is a boolean
"true" is a string

tough abyss
#

regardless if the string contains true or false or when is arma 4 coming out

#

all need quotes

real osprey
#

So my understanding is:
string, string, anything, number, boolean, boolean, string, string, number

still forum
#

yep

winter rose
#

as said in the biki yep πŸ™‚

#

(same order obviously)

real osprey
#

I must be missing something

still forum
#

maybe the error is on another line? near to the addAction? if you already fixed that

real osprey
#
this allowDamage false;
this addAction ["Rescue","rescue.sqf", nil, 1.5, true, true, " ", "true", 5];
#

is the whole thing

winter rose
#

and the error is still error bool expected string ?

real osprey
#

yes

winter rose
#

Ctrl+S? 😁

#

you may have the error in some other file or you are not working on this file, it should work in Eden

real osprey
#

I found my error. I somehow had this running twice, and one of them was on an object rather than a player

#

Another question however. Can you place an array inside an array to have it randomly select?

to
[this, 0.8, ["all the body parts"], ["all the injuries"] ] call ace_medical_fnc_addDamageToUnit;```
hollow thistle
#
[this, 0.8, selectRandom ["all the body parts"], selectRandom ["all the injuries"] ] call ace_medical_fnc_addDamageToUnit;
winter rose
#

@real osprey see ☝️ selectRandom indeed

sonic linden
#

is there a way to confirm that an item has been removed ? removeItem dose not have an return value.
eg. systemChat str(player removeItem "hgun_P07_F"); // true / false

winter rose
#

hasItem?

#

@sonic linden

sonic linden
#

thanks i will test that

high silo
#

When a heli lands on a heli pad, I want it to be Rearmed, Refueled and Repaired anyone know of a good script to do this?

worn flame
sonic linden
#

@winter rose i tested it now and i dont really get a good result
im testing this:

systemChat str _r; // = false;```
but
```_r = [player, "SmokeShell"] call BIS_fnc_hasItem;
systemChat str _r; // = true;```
And the SmokeShell is stored in the uniform. any idea how i can only check the uniform ?
runic quest
#

excuse me ,What is the difference between the three param private params, and under what circumstances is it called in the script? I've always wondered, even if I read the wiki several times, I don't understand it very well, who can help me, thank you!

dreamy kestrel
#

whereas params allows you to unpack one or more, https://community.bistudio.com/wiki/params. params also has the added advantage, in my opinion, of deconstructing "tuples", loosely so-called by this man, by name. although folks would argue whether there are really "tuples" in SQF. IMO they are by application, but this is neither here nor there.

#

I find myself using params in numerous places these days, inserting placeholders for don't care positions, etc. i.e. _x params ["_0", "_1", "_icare2", "_3", "_icare4"] and so on.

#

I think _x params ["", "", "_icare2"] may also be acceptable.

#

but be careful when you deconstruct, it will preserve references when "appropriate" to do so.

exotic flax
#

Here's the gist of it:

// get variables from _this
_variable = param [0];
params ["_variable"];
_variable = _this select 0;
// set a variable as private directly
private _variable = "value";

// create a private variable for later use
private ["_variable"];
private "_variable";
#

but the wiki explains exactly what each is doing, how to use it and how it works

dreamy kestrel
#

well, the wiki does not use the word deconstruct anywhere, but, depending on the context, that is exactly what it is doing.

#

it also does not clarify as to the referential nature under some circumstances. i.e. [0, 1, [2, 3, 4]] params ["", "", "_ref"], is perfectly fine. then you can manipulate the composition of the third array element through _ref.

#

I'm unfamiliar with the validation form, however.

exotic flax
#

in normal cases;

  • use params to get passed values (top of script), and automatically make them private
  • use private when you create a new variable which should remain within scope (script/loop/etc.)
  • use select to get a single value out of an array, and params for multiple
#

validation in params is actually very simple, as long as you understand the data types

dreamy kestrel
#

more or less, but for the reference gotcha. that can get you into trouble if you are unsuspecting.

exotic flax
#

array starts at 0, always!

#

πŸ˜‰

dreamy kestrel
#

and last is count _x - 1 πŸ˜‰

#

Q: separate topic, I am looking for a way to format a timer time. I have it in seconds, do I need to RYO algo for that? do format and/or %n offer any specifiers along these lines?

exotic flax
#

no, format is a simple string_replace without any smart references

dreamy kestrel
#

I see... algo it is. thanks much.

runic quest
#

tks for helping me !

dreamy kestrel
unique sundial
#

I found my error. I somehow had this running twice, and one of them was on an object rather than a player

Player is also an object, and running something twice should not produce an error second time

winter rose
#

@sonic linden take a look at the wiki, in the Containers function category

#

(I'm on mobile now)

primal marten
#

Hi All, I am looking to have a script that will play a sound if the player has a certain object and they are in a trigger area. Basically trying to work out how to use the Chemdetect as a gieger counter if in a certain area?

spice axle
#

@primal marten you could do something like

// this function is named myTag_fnc_chemdetect
if (getPos player distance _myTriggerArea > 500) then { // 500 in meter as example
    playSound β€œmySoundβ€œ;
}; 
[{call myTag_fnc_chemdetect}, 1] call CBA_fnc_waitAndExecute;

But if you want to have it doing the same as a ginger counter

// this function is named myTag_fnc_chemdetect
private _repeat = 1;
switch (getPos player distance _myTriggerArea) do {
    case 100: {_repeat = 0.2;};
    case 200: {_repeat = 0.3;};
    case 300: {_repeat = 0.5;};
    case 500: {_repeat = 1;};
};
if (getPos distance _myTriggerArea > 500) then {
    playSound β€œmySooundβ€œ;
}; 
[{call myTag_fnc_chemdetect}, _repeat] call CBA_fnc_waitAndExecute;

But there could be a syntax error, wrote on the phone. But give it a try

#

This code is optimizable because the condition is checked 2 times but that would be my start to the problem

primal marten
#

awesome thanks @spice axle will give it a go!

spice axle
#

@primal marten there is a logical error
The distance Condition need to be of course lower then 500 not greater and the variable _myTriggerArea is not a area just a single point position like [5, 13, 1]

dreamy kestrel
#

need a couple of pointers. I've got a dialog "manager" which would follow a while {dialog} ... approach, I'm looking at optimizing it to a more .hpp event driven model. problem is, its chief data sources are refreshed via publishVariable and publishVariableClient from outside of itself. short of rolling our own event model, is there a way to signal to the dialog that is has new data, that it might possibly refresh itself?

#

along similar lines, what "type" is a dialog anyway? i.e. when we say typeOf _dlg or typeOf _ctrl for one of its controls?

still forum
#

publicVariableEventHandler

#

will trigger when someone sends you a pubvar

dreamy kestrel
#

right, but this stands alone does it not? I mean apart from the context of an operational dialog, with built in event handlers, etc.

still forum
#

Ye

dreamy kestrel
#

or I need to look up the dialog via findDisplay I suppose and inject the update that way.

still forum
#

Or store it in a variable in uiNamespace

dreamy kestrel
#

ah, correct. good point, thanks.

tough abyss
#

I've found out that you can put non-compatible ammo in any weapon through scripts, like putting a 40mm into the ammo slot of a revolver. This is what it feels like now with this power

surreal peak
#

@tough abyss do tell...

unique sundial
#

Someone substituted bullets on fire event with 40mm grenades and you feel like you are holding HK P7 M13 in Iraq @tough abyss ?

exotic flax
#

Every OP should have a Rambo 🀣🀣🀣

plain current
#

Are there any BE whitelisted extensions for handling large numbers? I'm trying to make a mildly secure crypto fnc, the random command with a seed looks promising but is only accurate up to 999999, which can be bruteforced in about half a second...

woeful pike
#

Hi people! please tell me how to implement the transition of a player on another server using a trigger?

plain current
#

Use selectPlayer to switch player into another unit

woeful pike
#

second moment, or connecting a player to another server if the first server is unavailable

#

πŸ˜€

#

There is the first dedicated server (192.168.0.101:2312) with its own map of the area. There is a second dedicated server
(192.168.0.101:2322), with a different map of the area. The player connects to the first dedicated server (192.168.0.101:2312) and if some condition is met, for example, this player is not in the whitelist or the server is full, then this player is redirected to another server (192.168.0.101:2322). Or, a player connected to the first server activates a trigger on the map, in the initialization of which a redirect to another server is specified (192.168.0.101:2322), after which the player reconnects to the second server (192.168.0.101:2322). Is this realizable?

plain current
woeful pike
#

thank you friend!

tough abyss
#

@plain current im not aware of one currently available for that purpose

sudden yacht
#

how can i modify this to increase the volume of custom music?
class sound1
{
name = "sound1";
sound[] = {"music\tune1.ogg", 40, 0};
titles[] = {};
};

still forum
#

His name is "Jack O'Neill" btw, not "Jack Oniell"

sudden yacht
#

im that other Oniell

#

I am unable to hear a difference. Setting it much greater? sound[] = {"music\tune1.ogg", 500, 0};

#

whats the max i can set it?

still forum
#

don'T know what the max is

#

maybe you need to just make the soundfile itself louder

primal marten
#

@spice axle Have to admit sir cant get it to work

unique sundial
#

@sudden yacht do you know what pitch does? Somehow I don’t think it should be 0

tough abyss
#

@unique sundial More like a miniature, handheld Mk19

nocturne pagoda
#

Looking for a autorun script that allows a player to hit a key so their character will keep running, like what Exile has. Thank you

unique sundial
#

Wrong channel, try #google

#

It literally the top result

nocturne pagoda
#

I did I found a mod, no server side scripts

#

@unique sundial This channel is called "Scripting" im looking for a script

winter rose
#

it won't be a server-side script, it will be client-side though

#

@nocturne pagoda also, the channel's description states otherwise: this channel is about script creation and usage

nocturne pagoda
#

I was trying to find something like what Exile uses, which is server side

unique sundial
#

This channel is for people with concrete script problems

nocturne pagoda
#

ok

worn forge
#

Then maybe you should unpack exile?

unique sundial
#

Like I made autorun script but something is not working, here is my script...

nocturne pagoda
#

πŸ‘

plain current
#

__EVAL macros MUST be assigned to a config property does this mean __EVAL cannot be used for macros (#define and stuff)?

winter rose
#

source?

unique sundial
#

example?

#

source?
right here

plain current
#

#define MEME __EVAL(parsingNamespace getVariable ["test", ""])

#include "macros.hpp"
private _meme = MEME;
diag_log format["_meme: %1", str _meme];
unique sundial
#

where is __EVAL?

plain current
#

in macros.hpp

unique sundial
#

might work

#

preprocessor is strange you need to test this

plain current
#

well it's putting the entire __EVAL.... into the script

#

if i do MEME = __EVAL(...) in description.ext and do getText (missionConfigFile >> "meme") then it works, but thats not what i want

unique sundial
#

then no __EVAL macros are not suitable for SQF/SQS scripts

#

it will put it in script but it wont get processed

plain current
#

Yes i know it's erroring out because it's just replacing MEME with the __EVAL(parsingNamespace getVariable ["test", ""]) in the script, which is illegal (as stated on the wiki).
What I'm looking for is to use #define to make a macro with the value returned from __EVAL. I don't want it to be a config property. I'm just asking if it's possible to define a macro using __EVAL so it runs parsingNamespace getVariable ["test", ""] gets the value and puts it into the macro once at the start of the mission?

unique sundial
#

#define MEME (parsingNamespace getVariable ["test", ""])

plain current
#

Yes but then it just replaces MEME in all the scripts with (parsingNamespace getVariable ["test", ""]) meaning if the variable gets changed/removed the macro will change as well (which is not what i want). I need the value to be read once at the start of the mission and then be the same till the end (even if it's changed in the parsingNamespace).

still forum
#

you cannot store a static value in a macro

plain current
#

U mean i can't eval a static value into a macro? I could just do #define MEME "hello" but that's not exactly what i want

still forum
#

yes

plain current
#

ok thanks anyways

still forum
#

you could do it with config tho, whys that not an option?

plain current
#

The idea was for preventing cheats, because you can't read the macro values at run time with scripts outside the mission file (correct?), so sensitive data such as exp/money variable names, etc could be stored in a macro that gets set with __EVAL(parsingNamespace getVariable ["test", ""]) when you join and then the test variable could be nilled and it wouldn't be possible to get the contents of the macro.

still forum
#

because you can't read the macro values at run time with scripts outside the mission file (correct?)
you can preprocessFile the script file, the script text will contain the macro value

#

or loadFile the macro hpp

#

when you join and then the test variable could be nilled
that would defeat both my ideas. But I assume you store the then compiled script in a variable

#

If the user knows the variable name of the function containing the secret, he can just dump that

forest ore
#

Just can't seem to untangle myself from the fact that this

[ 
    "Test action",  
    {}, 
    [], 
    1.5,  
    true,  
    true,  
    "", 
    "(testArray # 0) findIf {player inArea (_x getVariable "objComplete")} == -1", 
    50, 
    false, 
    "", 
    "" 
];```
is giving this:

```18:43:40 Error in expression < findIf {player inArea (_x getVariable "objComplete")} == -1", 
    50, 
    fal>
18:43:40   Error position: <objComplete")} == -1", 
    50, 
    fal>
18:43:40   Error Missing ]```

Missing ] from where?
unique sundial
#

Quotes

plain current
#

"(testArray # 0) findIf {player inArea (_x getVariable 'objComplete')} == -1",

#

^^ there u go

forest ore
#

Those it was, thanks KK and Fini. Actually tried with 'blah blah' just there earlier but didn't work back then. Just realized I had something else messed up then when I had the quotes correct πŸ€¦πŸΌβ€β™‚οΈ

plain current
#

@still forum if you can't do the eval in a macro, then the entire idea is a bit scuffed, the idea somewhat was that preprocessFile afterwards wouldn't work because the variable that the eval reads would be nilled and loadFile of the hpp would just show the #define __EVAL(parsingNamespace....) which would also be useless if the variable is nilled. Tho you could just diag_log one of the functions that uses the macro and yeah....

still forum
#

even if you did it in a macro, macros are placed in script text before compiling

#

and the string input to compile you can always get back

#

you can't read macros, because they don't exist

#

they exist for a split millisecond while a script is preprocessed

dreamy kestrel
#

what is a CT_TOOLBOX control in user interface terms?

#

I think I see, looks like possible a radio button of sorts, but I've been wrong before.

woeful pike
#

Hi guys! how can I change texture on hiddenSelections[] = {"camo1"}; as for example with the command setObjectTextureGlobal

unique sundial
#

<yourobject> setObjectTextureGlobal [0, <yourtexture>];
execute

woeful pike
#

she changes on the whole object and I need to Selections

unique sundial
#

0 means you change it to the 1st element of array, which is "camo1"

#

what does getObjectTextures <yourobject> return?

dreamy kestrel
#

Q: client/sever, does time yield the "same" value? intuitively I'm thinking probably not, but could be wrong about that. i.e. we have an elapsed "timer" refreshing primarily on the server, the artifacts of which get published to clients. probably want to keep it that way, but I wonder if there is any possibility there is client/server consistency in that.

hollow thistle
#

time is local simulation time since you started the mission / joined the server.

#

serverTime is synced from server to clients

wet garden
#

need some help when one of you guys have a second, I am trying to put in a curfew siren script into my mission file, the sound file plays as intended, however it seems that the script loops at the end of the .ogg file. Ill paste the script below, any help is greatly appreciated.

GOM_fnc_baseLoudspeakers = {

    params ["_loudspeakers","_sounds"];

    GOM_fnc_basePlaySounds = true;

    while {GOM_fnc_basePlaySounds} do {

        sleep random [90, 95, 100];

        {

            _sound = selectRandom _sounds;

            if (alive _x) then {

                [_x,_sound] remoteExec ["say3D",0];

            };
            sleep -1;

        } forEach _loudspeakers

    };
    };



_loudspeakers = [speaker1, speaker2, speaker3]; 
_sounds = ["H_Curfew_Near"]; 
_play = [_loudspeakers, _sounds] spawn GOM_fnc_baseLoudspeakers;

dreamy kestrel
#

@hollow thistle so... if the server is refreshing using its own time, that is theoretically analog if not the same as serverTime on clients?

winter rose
#

negative @dreamy kestrel, time is for mission time, serverTime is for server uptime

#

(at least according to the wiki)

dreamy kestrel
#

in that light, then I take it time, per se, should be consistent client to server to client, etc?

craggy bluff
#

I want to spend time slowly during the day.

On the contrary, I want to pass the time quickly at night!

I want to know the code that works in the MP.

dreamy kestrel
#

Q: about dialog controls[] = {} ... do the ones that are displayed need to be enumerated? or do all of them need to be enumerated? including the base classes, for instance.

still forum
#

@dreamy kestrel considering cba adds its own server and client synchronized time. I'd assume that time is not synchronized

dreamy kestrel
#

@still forum Hmm, that's good to know. I might look into that. Thanks.

unique sundial
#

time is simulation time, it can be accelerated, decelerated and stopped all together. While this related to SP more than MP, if you have scripts that run longer than frame time in MP the time will start lagging behind

#

As for controls[], personally never needed to put anything there

dreamy kestrel
#

Not sure what you mean by "lag behind". I'm not looking for a real time heart beat or anything of that sort. I take a time measurement, and gauge a duration in order to derive elapsed and remaining components. this happens periodically, yes, but I refresh the timer component at the moment I need to evaluate.

#

as far as periods and frequencies, the managers or other service loops could be asleep for several seconds or more between actual measurements.

unique sundial
#

Lag behind as in it shows 5 seconds elapsed but in fact it was 15

#

Not that drastic of course, just an example

dreamy kestrel
#

I've seen that sort of behavior out of the "ticks" (theoretically, milliseconds) timer. have not tracked time that closely yet.

unique sundial
#

I doubt ticks timer does that

ruby breach
#

@craggy bluff search for sunormoon in this channel and I had a post earlier this year on how to do that. Can’t seem to copy the link from search on mobile

sonic linden
#

hi im search for a box removeItemCargo [item] script, because remove Item only works on units and i need to remove an item from a container. Can someone tell me where I find something like that πŸ˜„

unique sundial
#

There isn’t one

sonic linden
#

why ?

unique sundial
#

Because no one implemented it

sonic linden
#

So is there another way to remove an item from a box?
That seems to me to be quite essential

winter rose
#

remove everything, then re-add, unfortunately (afaik)

sonic linden
#

but what about attachments and backpack items ...
well i will try ( thats why i thought someone made allready something like that).

winter rose
#

not ideal, believe me I know

still forum
#

Attachments addWeaponWithAttachmentsCargoGlobal
Backpack items backpackContainer

slate sapphire
#

I have a question, if I check side of nearest player vehicle, the side of vehicle (tank/car) will return the side of vehicle by config or by the crew that is manning the vehicle, example if bluefor crew inside redfor tank, what side _vehicle will return?

unique sundial
#

Better check side group vehicle

slate sapphire
#

I am using that for now but I was thinking if allow or not the script to vehicle unmanned of other side

if (count _vehCrew > 0) then {
                {if (side _x != sideJoined) then {_enemyIn = _enemyIn + 1;}} forEach _vehCrew;
            };
#

@unique sundial I've sent you a friend add request, if you mind accept I would like to talk with you.

unique sundial
#

That’s cool, but I’d rather you continue posting in public channels, this way you might find what you are looking much faster

slate sapphire
#

one thing doesn't exclude other one, but nevermind it's ok

worn forge
#

I don't think vehicles have a side, not even in config... which is a shame as I was hoping something like that was present in previous coding. You can kludge something by converting the class to a string (str typeOf vehicle _x) and then running a switch on the first letter... B would be west, O would be east, I would be independent

restive leaf
#

From the Biki... ```- side of an empty vehicle is civilian

  • side of a crewed vehicle is, if present, commander's > gunner's > driver's or > cargo's side, in this order
slate sapphire
#

For my goal need to be studied cos it's a warfare with a lot of vehicles, if you kill for example gunner/driver from a car the car side will be still enemy cos the crew as far as I read count also if dead, so until the crew will get deleted by the cleaning script, the vehicle will be enemy side, then civilian, so it's better if I base my code on crew instead of side of vehicle, I think I will stick with the crew system

winter rose
#

you could use faction

restive leaf
#

if you kill for example gunner/driver from a car the car side will be still enemy cos the crew as far as I read count also if dead That is not true. Just tested and the vic became CIV as soon as the last occupant was dead, even if they are still inside

slate sapphire
#

Description
Description:
Returns the crew (both dead and alive) of the given vehicle.
Syntax
Syntax:
crew vehicleName

restive leaf
#

I thought you wanted side not crew???

#

That was your original question

slate sapphire
#

I need to know if I can recover the vehicle or not, if there is enemy crew inside the vehicle can't be recovered ( it's a unflip/unstuck), I wanted to know if it's more convenient for my goal to check if there is crew, or check the side of vehicle, if I do for example a check if side joined if civ will not work, instead if I count alive crew and check that crew is not == to side joined, I got my goal, I think

restive leaf
#

If side is CIV then it is empty... Unless you have CIVs driving vics around. If crew are present and you need them to be the same side as something you just use side <vehicle object> and see whether it's the same as you need...

ruby breach
#

Also with respect to the car side will be still enemy cos the crew as far as I read count also if dead > All dead units are civilians

restive leaf
#

Yeah. That

slate sapphire
#

Thanks all, I learned new things that lead in less confusion, much appreciated

plain current
#

Does description.ext not support emojis in defines or variable names? arkamangry

tough abyss
#

Angery @plain current

unique sundial
#

Better check side group vehicle
dead crew or empty == sideunknown

#

otherwise the side

still forum
#

description.ext has no variable names. You mean the eval thing? Might be that it doesn't support it

unique sundial
#

you mean #define SMILE :)?

plain current
#
#define πŸ˜€ SomeConfigProperty

class Test {
    πŸ˜€ = "hey!";
}
tough abyss
#

lmao why would you ever want to do that? @plain current

plain current
#

Mate it's 2019, emojis are lyfe, all other languages are fine with them

unique sundial
#

no, won't work

tough abyss
unique sundial
#

Macro names should only consist of alphanumeric characters and underscores, i.e. 'a-z', 'A-Z', '0-9', and '_', and the first character should not be a digit. Some preprocessors also permit the dollar sign character '$', but you shouldn't use it; https://stackoverflow.com/questions/369495/what-are-the-valid-characters-for-macro-names

dreamy kestrel
#

Q: when you style = ST_RIGHT; on a textual UI resource, is that right aligned in the w of the resource? does that change the x component at all? i.e. your x is still "left of" the resource? or is the x then on the "right of" the resource?

winter rose
dreamy kestrel
#

thanks.

oak parrot
#

Somewhat new to scripting, is there a variable that represents basically all things in the game, or all units of a side?

young current
#

there are others there too for different scopes

oak parrot
#

Thanks

sleek token
#

cba related question:
Imagine attaching an class eventhandler to CAManBase with killed event on the server doing some stuff, it doesn't really matter

#

because it is local to the machine added

#

what happens if we transfer a unit from the server to a headless client and kill it

#

will it trigger the event on the server?

digital hollow
#

killed eh is local, so will trigger on the hc. You can remoteExec the code that it triggers.

dreamy kestrel
#

@unique sundial re: the ticks timer, it was pretty bad. probably along the same lines. anyway, if I were timing 1 tick equals 1 millisecond as the docs claim, it was definitely not that. trust me, I measured.

unique sundial
#

How did you measure? By running a script?

#

The script that can be suspended at any time by the engine and resumed god knows when?

tough abyss
lament grotto
#

Hey all quick q I am setting up some waves of Ai for a mission, I want the ai and its group to teleport to a marker so far I have

waveai_1 setPos (getPos wavespawn_1);``` What do I need to make it so it tps the group aswell?
#

would { _x setPos (getPos wavespawn_1) } forEach units group waveai_1; work?

#

it does ty for help

unique sundial
#

you're welcome

unique sundial
#

@tough abyss probably not, since there isn't a UI event that would register on these displays

carmine trench
#

Hey guys, quick question: I have written a script that applies flags to vehicles via forceFlagTexture. I wanted to make it so that you could call the script like this

flagfun = [this,"UN",true] execVM "fahrzeugFlaggen.sqf";

#

the second argument passed is linked to configs. So for example, if you put "US" instead of "UN", the flagtexture is different. The problem that I have is with the texture path.

#

_flaggenKonfig = _this select 1;

#

if (_flaggenKonfig == "UN") then { flaggenSkriptTextur = "\A3\Data_F\Flags\Flag_uno_co.paa";};

#

So - how does the texturePath need to look, when I want to load a texture from a loaded addon like CUP?

unique sundial
#

try \cup\......

carmine trench
#

The Texture I am trying to load is in @ek_bwmod\addons\bwa3_common\data\flag_germany_co.paa"

#

Just putting down the path is giving the same error.

#

i've also tried \bwmod\bwa3_common\data\flag_germany_co.paa"

cunning crown
#

Have you tried \bwa3_common\data\flag_germany_co.paa?

carmine trench
#

Yes, no luck

carmine trench
#

I wonder if this is even possible with a addonTexture.

unique sundial
#

Yes it is possible, what do you think Arma 3 is?

carmine trench
#

Cool. So you know how to do it?

young current
#

use correct path to the texture and it should work

carmine trench
#

I know that it works with vanilla flags

#

finding the correct path is the whole point.

exotic flax
#

for that you can extract the pbo of the mod which contains the flags, and see what the path is (basically the directory structure within the P: drive)

dreamy kestrel
#

@unique sundial yes, isolated functions, ran scripts, dumped to diagnostics. nothing too mysterious there, just using the tools at my disposal.

#

Q: we are doing a mass sync publishing a bundle of otherwise unrelated variables server to client, and I currently need just one of those elements in an aspect of the client UI. Is it possible to publishVariableClient on the client itself to itself in order for such an event to be "see" by that client?

#

i.e. clientOwner publishVariableClient "My_variable"; client side?

unique sundial
#

you want to broadcast a variable to the client that updated the variable?

velvet merlin
#

in certain situations hideObject no longer works (in SP) - i think its when the player camera is not on the object or camera is not on the player

#

the BIKI page mentions

When used on player, it only has an effect on third person mode. First person LOD is still visible. (A3 Dev 1.33)

leaden parrot
#

Hi! Im making a few simple missions for my friends who is not big into the sudden deaths buit still want heavy firefights. I would like to make, lets say helicopters be invincible and the players inside to only take 10% of the real damage. I know JiP is hard to script so im thinking it'll just ahve to be without.

but can you help me/ guide me in the right direction? I know allowdamage false on the vehicle but how do I make it apply to all players that occupy it and how do i do the reduced damage?

exotic flax
#

Do you use any mods which modify the damage in any way (like ACE 3)?

#

And do you just want to reduce the damage to the people inside, or apply the damage from the vehicle to the units instead?

leaden parrot
#

nop no ace.

I want to make the vehicle take no damage and eveyrone who jumps in the vehicle to only take 10% damage

exotic flax
#

This should get you started ;)

player addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
    private _newDamage = _damage;
    if (_unit in name_of_vehicle) then {
        _newDamage = _damage * 0.10;
    };
    _newDamage;
}];
leaden parrot
#

Thank you. Ill look into it πŸ™‚ and does allowdamage false work in MP or will it only aspply to the first player? im guessing it will have to be scripted in hte init then to apply server wide?

exotic flax
#

it's a bit complicated with allowDamage...

This command has to be executed where object is local and as long as object does not change locality the effect of this command will be global. If object changes locality, the command needs to be executed again on the new owner's machine to maintain the effect

So as long as you set the value in the editor and don't use HC you should be fine.

winter rose
leaden parrot
#

What is Hc?
Ah headless client. Na I will just host the server myself. Would ideally be that the effect on the vehicle would start once a player hopped in the driver/pilot seat and the driver/pilot and all passengers would take reduced damage.

tough abyss
#

Hello, where can I find init.sqf samples for simple singleplayer missionscripts? For example I only need really basic things like patroling, infiltrating, 2 AI Squads fighting against each other etc. On searching only found the high complex ones for famous mods like Altis Life, DayZ and so on. I prefer Arma 2 Engine.

exotic flax
#

"only need really basic things like patroling, infiltrating, 2 AI Squads fighting against each other etc."
2 things which don't really match in one sentence πŸ˜‰

#

but especially for Arma 2 the forums are a good source for scripts (since most people moved to Arma 3, or never saw Arma 2)

dreamy kestrel
#

@unique sundial from the client to itself, yes. possible?

unique sundial
#

@dreamy kestrel its nonsense. You have variable set on client already. It is like doing a = 1; a = a; what does the second expression achieve?

slow isle
#

Hey can someone tell me how i can put a delay between the shots of an AI ? I cant figure it out

#

i tried this: this addEventHandler ["Fired", {sleep 10}];

#

doesnt work

#

Also tried using this (with 2 rounds, 1 in weapon and 1 as mag(using GL)):

 sleep 5;
 _unit = _this select 0 ; 
 _mag = _this select 4 select 0 ; 
 _unit addMagazine _mag ; 
}] ;```
#

^ With this i get a generic error expression

#

i basically want to do that:
if Projectile is Fired at enemy then wait 5 seconds and shoot again at enemy if there is still one

winter rose
#

@slow isle you cannot sleep in EH itself, use a spawn

tough abyss
#

Hey

#

I'm back again

#

I needed to respawn one vehicle loaded on other vehicle cargo. Like:

Respawn one vehicle with other on cargo

#

I'm trying to search internet. But it looks helpless

young current
#

youll just have to respawn it and move it to the cargo

#

theres no respawn vehicle as cargo command

tough abyss
#

It can't respawn respawn inside other vehicle?

Because it's a water operation where I need to spawn barges with trucks inside to land on the beaches

#

Guess no then

#

😞

young halo
#

Respawn the trucks on land and move them to cargo after they are spawned.

young current
#

no you need to spawn all vehicles and then on their initialization move them in their places

#

also the above

tough abyss
#

Ok

#

Guess I can try... but I'll need a empty spot right?

#

Like a marker

#

So the vehicle spawn there and instantly go to the barge

#

With script

#

Ok thank you. Guess it's a north for me to start.

#

Ah! I forgot to say that they need to respawn

#

As it's a liberation mission. KP version. Guess I should ask them directly

young current
#

yep

#

that would be best option

dreamy kestrel
#

@unique sundial no it's not, really. not our fault dealing with brittle code and an arguably poorly conceived bundle of public components. I want to take one of those components and individually publishVariableClient, from the client to itself. Which in turn might do things like notify a UI to refresh itself, that sort of thing.

#

Q: re: sorting... is it possible to sort by alphabetical order?

#

seems like perhaps sort would do the trick, especially since the array elements share the same shape.

odd pollen
#

Is it possible to decrease vehicle speed using vectorAdd?

#

i tried running this but it doesn't appear to work

fn_mcno = {
    if (_speed <= 1 || _speed >= 0 || _velXM > _velYM) exitWith {};
    _speedBrake = -10;
    _curVMS = velocityModelSpace _veh;
    _newVMS = _curVMS vectorAdd[0, _speedBrake, 0];
    _veh setVelocityModelSpace _newVMS;
};
unique sundial
#

Because your script will always exitWith on condition _speed >= 0

unique sundial
#

@dreamy kestrel It is not BI's fault that you are trying to use outdated convoluted way doing things instead of more modern approach. remoteExec will do what you want if only you can bother to learn it

long glacier
#

Hey guys I am trying to use this on a dedicated server but with no luck works in SP/MP local testing if (isServer) then { [prisonguard,"PrisonGuard",4] call prison_guard_voice_over; };

#

Would I need to remote exec this and if so how do I add that into the script above? Cheers for any help.

winter rose
#

we would need to know what the prison_guard_voice_over is @long glacier

long glacier
#

@winter rose it is this mate

prison_guard_voice_over = {
    params ["_speaker","_voice_sample_name","_number_of_voiceovers"];    
    private _voiceover_list = [];
    
    for "_i" from 1 to _number_of_voiceovers do {
        _voiceover_list pushBack (format ["%1%2",_voice_sample_name,_i]);
    };
    
    _speaker kbTell [_speaker,"prisonchat",(selectRandom _voiceover_list)];
};```
#

and then this is the prison.bikb ```class Sentences
{
class PrisonGuard1
{
text = "";
speech[] = {"\sounds\PrisonGuard_1.ogg", 2, 1, 20};
class Arguments {};
};

class PrisonGuard2
{
    text = "";
    speech[] = {"\sounds\PrisonGuard_2.ogg", 2, 1, 20};
    class Arguments {};
};

class PrisonGuard3
{
    text = "";
    speech[] = {"\sounds\PrisonGuard_3.ogg", 2, 1, 20};
    class Arguments {};
};

class PrisonGuard4
{
    text = "";
    speech[] = {"\sounds\PrisonGuard_4.ogg", 2, 1, 20};
    class Arguments {};
};   

};

class Arguments{};
class Special{};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university};```

winter rose
#

kbTell is local iirc @long glacier

long glacier
#

Rgr cheers I will see if there is any global alternative

winter rose
#

your bikb is fine since it is working in SP/hosted MP

You can remoteExec the kbTell ! @long glacier

long glacier
#

ohh ok thanks a lot mate

#

Would this work? _speaker remoteExec [[kbTell [_speaker,"prisonchat",(selectRandom _voiceover_list)]];

winter rose
#

negative πŸ˜‰

// select random voice over prison guard
prison_guard_voice_over = {
    params ["_speaker","_voice_sample_name","_number_of_voiceovers"];    
    private _voiceover_list = [];
    
    for "_i" from 1 to _number_of_voiceovers do {
        _voiceover_list pushBack (format ["%1%2",_voice_sample_name,_i]);
    };
    
    [_speaker, [_speaker, "prisonchat", selectRandom _voiceover_list]] remoteExec ["kbTell", _speaker];
};
long glacier
#

ohh god I always think think simple changes will be easy, I am alway wrong

winter rose
#

one piece at a time, really!

long glacier
#

Thanks a alot man

winter rose
#

you're welcome, don't hesitate to ask questions here

lucid junco
#

do setvelocity work for the rocks? i can get it to work. need falling rock but when use setvelocity nothing happen... ideas?

winter rose
#

you would need PhysX-simulated objects yes
you could use rocks as drops I think

lucid junco
#

pff πŸ˜•

#

but thx πŸ˜„

#

use setpos is bullshit right? i wasnt able to find way how to loop setpos somehow effectively

#

or do you see some way?

winter rose
#

should they damage people or not?

lucid junco
#

it should fall from A to B vertically (just Z) and yes if player will step just under the falling rock it should kill him. I need it just for the one huge rock. Not for many small falling rocks

winter rose
#

then setPos may not be the solution (unless you script the damage) as setPos is not "falling", just small teleports

#

if it's only one rock, you could setPos + script damage yeah

lucid junco
#

yea i can handle it. my problem is when i use setpos in loop. The loop gets unpredictable (sometimes go slower, sometimes faster, depends on scheduler i gess) delay so its sometimes desync with the sound

winter rose
#

the setPos might be better in non-scheduled environment yes

lucid junco
#

im using bad code for sure.... but cant handle it for now πŸ˜„

#

so how to execute?

winter rose
#

this ensures your script is not "slowed down" if you have plenty of scripts, so aesthetically "cleaner" yes πŸ™‚

lucid junco
#

oh cool i forgot about this

#

i tried compileFinal preprocessfilelinenumbers

#

better, but not good

#

going to try evenhandler

#

thx man!

winter rose
#

with pleasure!

tough abyss
#

Guys

#

Where do I edit the vtv exit of one model in the addons mod folder?

winter rose
tough abyss
#

I just want to make one vehicle drop cargo a bit foward to not crash on the transport vehicle

#

and this internet searches I'm doing isn't helping, but confusing my mind @winter rose

#

AH! I need a hint:
I'm making one respawn with this expression:
Β΄_success = barge setVehicleCargo truck;Β΄

the barge is the transport vehicle
the truck is the loaded vehicle

the option of force respawn is on

the problem:
-> It wont respawn when far
--> possible cause is that the vehicle is a single variable,
--> possible solution is to make a trigger to multiply the variable and make it readable to the script:
_success = barge setVehicleCargo truck;
something like this:
_success = typeOf("barge") setVehicleCargo typeOf("truck");

cold mica
#

Is there a way for my mission script to disable modules when testing a mission in ED3N and enable them when properly hosted?

#

there is probably some boolean that detects if a mission is in ED3N or not.

twin steppe
#

Does anybody know if BI are going to add some of the functions that were in the contact version? Seems like they've added the gasmask stuff but not the chemlight function or the ragdoll function.

#

I mean they seem to be pretty normal. Nothing "alien" or "unrealistic" about these, right?

dark ocean
#

its possible attach magazine to player

unique sundial
#

Is this a question or a statement?

dark ocean
#

question

young current
#

Short answer, yes, longer answer yes, but in a way that it looks nice it's not quite as easy.

I'd assume you would want it to either follow the players movements or hands or something?

dark ocean
#

attach to the left hand

young current
#

Quite difficult and possibly not very mp friendly.

#

I mean you can simply attachTo a thing on the hand bone, but it will not properly follow the movement.

winter rose
#

as in, it would follow the hand but always face the same "up direction" unless (heavily) scripted

tiny wadi
#

Is there anyway to use lineIntersectsSurfaces in a similar fashion to the difference between getPosVisual and getPos

#

Im running into issues where the simulation version of the object does not match up with the rendered version, which causes my intersection check to return either the wrong surface or nothing at all

winter rose
#

since you can use it with positions, you can use it with visual positions with visiblePositionASL @tiny wadi

tiny wadi
#

Right yeah, I actually used the visual model to world command to get the head position of the player due to having the same problem with eyePos. But the actual problem I believe is that the surface check is looking for the view geometry LOD but that is still in simulation position?

#

Main issue is when the player is in a vehicle

winter rose
#

ah, the intersection itself

that I don't know

tiny wadi
#

Right yeah, i was considering abandoning the intersection check and somehow creating my own based on predefining the relative memory point positions of the vehicle

#

sounds like a pain though

winter rose
#

wait, if it is surfaces, it shouldn't matter

#

ah no, forget what I said

tiny wadi
#

rgr

winter rose
#

I thought of terrainIntersects*

tiny wadi
#

ah

winter rose
#

mornings

tiny wadi
#

Haha, more like late nights πŸ˜‰

young halo
#

insert time zone joke

unique sundial
#

@tiny wadi it is tricky because in order to define the scope (render or future) you need to have an object you want to test intersection with, which is not an argument of the command, so the scope is undefined

tiny wadi
#

ah

#

So if the scope is undefined, would it be best to come up with my own intersection determination? Or is there a way to work around that problem

unique sundial
#

what is the exact problem that you are trying to work around

tiny wadi
#

I am using the surface intersect to determine whether a person is viewing a specific part of the model using the view geometry lod to replace the scroll wheel. then if that surface check comes out good I draw an icon and some text to indicate there is an action there. It works fantastic when you are not moving, or are moving at like 3km/h. The problem is when you begin to go over that speed the surface intersection check doesnt work reliably anymore and you cant use any actions while moving

unique sundial
#

what does the lineintersectssurfaces expression look like?

#

also have you tried getCursorObjectParams?

tiny wadi
#
    _begin = AGLToASL (player modelToWorldVisual [ _headX - 0.05, _headY, _headZ + 0.05  + (_distance / ( 12 ^ 2 )) / 1.5 ]);
    _end = (_begin vectorAdd (getCameraViewDirection player vectorMultiply _distance));

    _lod = getText(configFile >> "CfgVehicles" >> typeOf (_ob) >> "Interaction" >> "LOD");
    if (isNil "_lod" || (typeName _lod) != "STRING" || _lod == "") then {_lod="VIEW";};
    
    _intersect = lineIntersectsSurfaces [_begin, _end, player, objNull, true, 1, _lod, "NONE", true];```
#

Got the head position from this guy:

#

I have not looked at that command, ill take a look now

#

Thats an interesting command, i've never seen it before.

#

let me see how that works real quick

unique sundial
#

isNil "_lod" || (typeName _lod) != "STRING"
FIY _lod cannot be nil and is always a string

tiny wadi
#

ah okay

unique sundial
#

I assume you run this code every frame?

#

what do you use EachFrame or Draw3d?

tiny wadi
#

EachFrame

unique sundial
#

maybe you should try draw3d for comparison, they are executed at different time during the frame

tiny wadi
#

Oh πŸ€” Also was not aware. Let me see how that goes

#

Same issue

#

getCursorObjectParams won't work b/c cursorObject wont return the vehicle you are in

#

I found this however: BIS_fnc_getIntersectionsUnderCursor

#

going to check it out now

young current
#

How about getSelection position and compare that to screen coordinates?

unique sundial
tiny wadi
#

yes exactly

winter rose
#

Take On Helicopters interface

upper gazelle
#

Hi, I'm having some trouble with this bit of code:

{
    _knowledge = (_group knowsAbout _x);
    if (_knowledge > 0) then {
        _enemyForceKnown pushBack _x;
    };
} forEach _unitsUnknown;

specifically the line: _knowledge = (_group |#|knowsAbout _x);, I'm just getting generic error
_unitsUnknown and _enemyForceKnown are both arrays of units.

tiny wadi
#

Ohhhhh... @unique sundial Looking at your debug console. You check the screen coordinates and how much they differ from the center.

#

Thats actually neat

#

@young current Pretty much same thing

winter rose
#

@upper gazelle previous code lines plz? is _group a group?

tiny wadi
#

So what I could do instead of using the intersect surface, I iterate each interaction class and check if the memory point screen position is within a boundary to the center

upper gazelle
#

@winter rose yes it is

winter rose
upper gazelle
#

this is in an FSM where _group is a group that has been passed to it through execFSM

unique sundial
#

who must be local, while target can be remote.
generic error has nothing to do with locality, in this case one of the arguments type is not what is expected

winter rose
#

might _unitsUnknown have undefined objects? or be a non-array @upper gazelle

unique sundial
#

could be anything, @upper gazelle thinks we are all clairvoyant here

upper gazelle
#

@unique sundial nah, just want to see if my sleep deprived brain is missing something

unique sundial
#

yes

upper gazelle
#

@winter rose im double checking that right now

unique sundial
#

it is missing diag_log

tiny wadi
#

oof

winter rose
#

oof?

tiny wadi
#

uhh... long story

winter rose
#

oof.

tiny wadi
#

lmao

winter rose
#

@upper gazelle SITREP? ^^

upper gazelle
#

@winter rose you were correct, i had messed up building my _unitsUknown array
thanks for the help!

winter rose
#

w00t w00t
go get some sleep, though πŸ˜›

upper gazelle
#

i would but i just hit another error πŸ˜”

#

im trying to get this FSM bug free before hitting the sack

winter rose
#

you don't always have to; sometimes you would struggle for hours but after a fresh brain you go "oh, it's that" and carry on πŸ˜„

#

brain is a wonderful (and mysterious) machine

#

(next error though?)

upper gazelle
#

another type error on one of my functions. the function works fine, which means my issue is with how im calling it somewhere

#

might just look at in the morning afterall lol

winter rose
#

params, params, params

#

'night, though πŸŒ›

tiny wadi
#

Got it working, thanks @unique sundial

ornate quail
#

Heya, I've got a little issue with playSound3D.
I'm using it to play a sound originating from a vehicle.
So far so good, but when the vehicle starts moving, the sound origin is not synced with the vehicles current/new location.
Is there a way to fix that?

winter rose
#

you could use vehicle say "mySound" ?

#

(or say3D of course)

dreamy kestrel
#

I am a bit confused, where exactly does the root land you when you do an include? i.e. #include "...\path\to\defines.hpp", if we are talking about \path\to\profile\mpmissions\MyMission\... and on from there, i.e. into scripts, scripts\shared, and so on. If I read the docs I am left with the impression that maybe it lands me in mpmissions? or is it MyMission?

still forum
#

root is virtual filesystem root

#

current directory is the same dir where your mission.sqm is

dreamy kestrel
#

I get that much, I need to know where it lands us.

still forum
#

different

#

can differ between client/server and also between different clients

velvet merlin
#

getting some weird variables undefined after savegame loading - anything specific to do?

still forum
#

what was stored in the variables

still forum
#

https://community.bistudio.com/wiki/list

Calling list immediately after creating a trigger via createTrigger (and setting up activation, area, statements, timeout, etc..), will return <null> instead of an array. It seems the trigger needs about 1 second to initialise
I assume same thing

dreamy kestrel
#

huh, so saying #include "scripts\shared\defines.hpp" is the same as saying #include "\scripts\shared\defines.hpp". that's easier than remembering relative paths.

still forum
#

no