#arma3_scripting

1 messages · Page 33 of 1

copper raven
#

hint str (player getVariable "KJW_Radiate_AverageCounts"); // nil * defined here (second iteration)

sullen sigil
#

oooh, got you now -- thank you 🙂

tough abyss
#

Help! I am trying to reskin a T100 but can not figure out how to add all 3 textures to different parts of the tank currently trying this

#
Fnc_Set_Textures = {
  _vehicle = _this param [0,objNull,[objNull]];
  if (isNull _vehicle) exitWith {false}; 
  private ["_texture","_selection"];
  switch (typeOf _vehicle) do {
    case "O_MBT_02_cannon_F" : {
      _texture = "Data\VehicleSkins\mbt_02_greengrey_body_co.paa";
      _selection = 0;
      _texture = "Data\VehicleSkins\mbt_02_greengrey_turret_co.paa";
      _selection = 1;
      _texture = "Data\VehicleSkins\mbt_02_greengrey_co.paa";
      _selection = 2;
    };```
sullen sigil
#

not really how you'd do textures, but you never actually set them here

#

also

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
tough abyss
#

I dont understand, You dont set them in the init file?

sullen sigil
#

No, you retexture vehicles by setting their hiddenselections in their config

tough abyss
#

I am editing this in the mission file's init

#

Now given the way its setup how would i add hiddenselections? Ive seen that on the mod im making for uniform textures but havent seen any vic textures using that

#

Always setObjectTextureGlobal and then the path

#

Also edditing vanilla assets. Are you saying it is easier to add it to a mod and do it in the config.cpp? Because i figured that was the hard way

sullen sigil
#
class CfgVehicles {
  class classnameparent;
  class classname : classnameparent {
    hiddenSelectionsTextures[] = {"yourpathtotex1", "yourpathtotex2"};
  };
};```
#

its easy enough

tough abyss
#

Again though that is for a mod not the mission init yeah?

sullen sigil
#

yes

#

mission init is doable but not really friendly for repeated use

tough abyss
#

See i had been doing it like that and setting up a vehicle respawn to keep the textures added

#

Appreacite the advice will look into it

#

to clarify

#

classs classnameparent;

#

classnameparent is just my variable right?

#

then the class classname : classnameparent it would the vic class name : my vairiable

sullen sigil
#

no

#

classnameparent is the parent class of the one youre retexturing

#

found in config viewer

tough abyss
#

Arma tools?

#

yet to use config viewer im a noob

sullen sigil
#

no, place in 3den, right click, find in config viewer, at the bottom it should say parents or something of that ilk

#

you want the one thats at the end of that

tough abyss
#

Okay for sure.

#

Much appreciated

sullen sigil
crisp wolf
#

Anyone familiar with putting "livestream" cameras on a rugged large screen in a base? I'm attempting to have multiple UAVs show different areas at different times during a mission but the things I'm finding online aren't working to my liking. I have 3 uavs for 3 different screens. I would appreciate any assistance anyone can provide. Thank you in advance.
EDIT: I am stupid dumb when it comes to scripting so I apologize if I come off that way.

tough abyss
crisp wolf
sullen sigil
#

It is me again,

I can't seem to get lineIntersectsSurfaces to work how I want it to -- only return the number of object surfaces between the player and a pre-exiting object.

count (lineIntersectsSurfaces [_objPosASL, _playerPosASL, player, _obj1, true, -1, "GEOM", "VIEW", false])```
variables are fairly self explanatory, however this returns 1 always -- even when there's nothing between `_obj1` and the player
#

So here, return 0. On the other side of the cube, return 2 (as there's 2 faces of the cube between the player and object, though I'll settle for 1)

tough abyss
tough abyss
#

Does anybody have, Any clue how you would use "BIS_fnc_removeRespawnInventory". for some reason i just cant find any resources on removing loadouts. and i have no clue what im doing

warm hedge
#

What is the goal for you?

tough abyss
#

ive got an issue with JIP in my current setup

#

in which, every unit has a variable name

#

and ive used "[Soldier1, "Rifleman"] call BIS_fnc_addRespawnInventory". to do each thing, however they'd all be jumbled if another person joined. so now ive switched to west, call bis_fnc...

#

and the issue it

#

i wanna remove the loadout from a single unit. whilst keeping it on west so that JIP isnt removed

#

So far this is my initServer.sqf file

tough abyss
# tough abyss ive got an issue with JIP in my current setup

BIS_fnc_addRespawnInventory returns the target and the id needed for BIS_fnc_removeRespawnInventory. So you can just use them like so:

private _temp = [west, "US"] call BIS_fnc_addRespawnInventory;
_temp call BIS_fnc_removeRespawnInventory;
#

so, Is private and _temp representing something? because im quite lost

#

private _temp is defining a variable named _temp to store the results of [west, "US"] call BIS_fnc_addRespawnInventory

#

which you then use as the value to send to BIS_fnc_removeRespawnInventory

#

So i could do something like
private, (as in private variable) _Officer = [west, "US"] call BIS_fnc_addRespawnInventory;
_Officer call BIS_fnc_removeRespawnInventory;

#

and this would somehow result in everyone but the officer getting the loadout?

#

correct, though you're missing an = on the BIS_fnc_addRespawnInventory line

#

(and a space between _Officer and call)

#

Ok. and this isnt just removing it for everyone, but just the officer?

#

Well actually no, hold on

#

hmm

#

...try this

#
private _target = blahblah; // Set this to whoever you want to remove the inventory from
private _temp = [west, "US"] call BIS_fnc_addRespawnInventory;
_temp set [0, _target];
_temp call BIS_fnc_removeRespawnInventory;
#

ok so Target is the person who i want to remove the loadout from. temp is the loadout, and setting it to 0 is a Boolean, that disables it on them, and then calling it removes it for just them?

#

Not a boolean, _temp ends up being an array of format [target, id] which set [0, _target] sets the 0th index (target) to _target

#

and then that modified _temp is used with BIS_fnc_removeRespawnInventory to hopefully only remove it from that target

#

ill try that then. and let you know if it doesnt work

#

blahblah; is the Variable name yes?

#

_target is the variable name, replace blahblah with the unit variable name

#

Right

#

Damnit

#

didnt work

blazing loom
#

is there a way too see whats running in the background like scripts and which ones are taking the longest to process etc? building an altis life server and FPS seems pretty bad

tough abyss
#

That might be checking 1. Task manager and PC, or 2. experimenting with some things in eden

#

btw Sysroot it might help if i mention that the end goal is to apply the respawn loadout to west, however create an exemption script that can be used to stop others from having it. so if theres a way to simply remove someone from the west script. like an "uncategorised.cfg" or something that would also probably do the job

#

the only thing i can really think of would be to instead of going _temp call saying _target call

#

won't work

#

one thing you could do, is just apply it to each unit on west individually, excluding a list of units you want to exclude

#

like so:

#
private _excludedUnits = [unit1, unit2, ...];
{
  [_x, "US"] call BIS_fnc_addRespawnInventory;
} forEach (units west) - _excludedUnits;
#

Holy moly thats exactly what i was hoping for

#

a thing that just skips over certain ones

#

Thanks man!

#

No problem

#

_x meant all correct?

#

basically, it gets replaced by each individual unit

blazing loom
tough abyss
#

Right

#

With eden its simulation

#

for starters, Vehicles

#

make them simple where possible, or cut down AIs

#

then try to make it Multi script if its choppy, but if its doing 20 things per frame then maybe try to cut down the number of scripts and focus more on dynamic simulations

#

and with eden i've found making walls simple is really helpful. same with cutting code to make the code smaller and thus faster to run through

#

@blazing loom If you run that command I sent in debug console, it'll give you a printout of all of the SQF scripts currently running in the background.

blazing loom
#

that helps! thanks.
yeah i ran it but it was too big for screen so im trying to get it to work with diag_log ""; but not sure on syntax to use

copper raven
tough abyss
#

diag_log str diag_activeSQFScripts

#

^

blazing loom
#

would i use that like this? doesnt seem to work.
[] spawn { hint str diag_captureFrame 1; };

#

and i tried hint "diag_captureFrame 1;";

tough abyss
#

Can't hint it, it opens a gui

#

doesn't return a string

#

or, alternatively, if it's running serverside, it just logs the data in the same directory as diag_log

sullen sigil
tough abyss
#

Ah, that'd explain it

#

can always filter out objNulls to deal with that

sullen sigil
#

However when I did a systemchat oneachframe of the returned value it never changed anything except positions, regardless of my position in regards to the object

#

I.e if I was behind the cube it gave the same result as in front

tough abyss
#

hm, would need to see the returns

sullen sigil
# tough abyss hm, would need to see the returns

[[[2772.84,879.524,5],[0,0,1],<NULL-object>,<NULL-object>,[],"#GdtVRsurface01"]] is what's returned by this.

private _obj1 = KJW_Source;
private _playerPosASL = getPosASL player;
private _objPosASL = getPosASL _obj1;
//End variables
//Begin code
systemChat str (lineIntersectsSurfaces [_objPosASL, _playerPosASL, player, _obj1, true, -1, "GEOM", "VIEW", false]);```
#

with me just stood here

stable dune
#

Hi, well some reason bis_fnc_randomPos return position which is not in given area. Could you say what i should change?

[[3103.54,5951.89,0],[250,255,0,true]] call BIS_fnc_randomPos

[center - position of module (3103.54,5951.89,0) ], [a,b (a = 250, b = 255 (size of area)), angle (0), rectangle (true)]

at it return

[3495.71,4491.24,0]

Which is not in area

sullen sigil
stable dune
#

Yeh, seems i don't have correct syntax

tough abyss
#

Also, the second argument is a blacklist, not a whitelist

stable dune
#

it's in 1 array that 1st, thats my problem

tough abyss
#

Nvm you're just using the first arg

copper raven
stable dune
#

Yeah

copper raven
#

should be [[[[3103.54,5951.89,0],[250,255,0,true]]]] call BIS_fnc_randomPos

stable dune
#

Found out that with pasting my code to Watch list and it give error for wrong syntax

sullen sigil
#

Not even any positions returned

tough abyss
#

Hm, not sure

#

try moving your source object to be hovering slightly off of the ground

sullen sigil
#

gotcha

#

aha, vectoradd [0,0,0.5] works

#

However is only returning 1 count when behind the VR object, any way for there to be 2?

#

I guess I can just double it actually

tough abyss
#

Yeah just double it

#

will probably want to filter out objNull results if you don't want to include the ground

sullen sigil
#

I do want to include the ground but not when it's at the same level as the player so

tough abyss
#

hm

#

maybe special handling for it then

sullen sigil
#

It works as is, just need to deal with the slight vector add 🤷

#

Is there an easy way to find the thickness of the intersection? Assumption is no

tough abyss
#

The thickness? As in the thickness of the raycast?

sullen sigil
#

As in, if I'm stood behind the VR object, find the length the raycast is inside of the VR object

tough abyss
#

Mm

#

You could do some math with the boundingBox of the object combined with the vector of the raycast

#

but there's no built-in command or anything like that

#

overall, would be hard to do precisely

#

actually

#

I do have a simpler way in mind

#

just do a raycast from both sides and get the difference in their intersect positions

sullen sigil
#

That'd need to be done for every intersection, no?

tough abyss
#

Correct, but raycasts are cheap

sullen sigil
#

I'm effectively just trying to find the distance the raycast is inside of objects so

tough abyss
#

Well a two-way raycast is the simplest way I can think of doing so

sullen sigil
#

Don't think I actually need it to be that precise anyway as the only instance where this would be noticeable has an incredibly short range

#

Yeah, just number of intersections will work

young current
#

Inside of object in what sense? If you for example line intersect with geometry lod, it's surface might be accurate to visual model or it might not

#

Usually geometry is simplified a bit and made to fit inside the visual model, but not always the case

#

Firegeometry is usually the most accurate

sullen sigil
#

It's fine for this, but I meant the distance the raycast "travels" through the object

#

next question, though

private _countRate = player getVariable ["KJW_Radiate_CountRate",0];
player setVariable ["KJW_Radiate_CountRate",_countRate+1];
playSound "KJW_Geiger_Click";
systemChat str [_countRate];
``` seems to return 0 every time its run
copper raven
#

you never change _countRate in that snippet (after you assign it), so it prints the same value twice

sullen sigil
#

I thought it points to the getVariable rather than the value specifically returned from it..?

#

mb, fixed

#

variable is set to 0 on player init too so it is already defined

copper raven
#

so what's the issue with that piece again?

sullen sigil
#

systemchats [0] every time its run (every 0.005 seconds)

copper raven
#

do you set it anywhere else?

#

paste full code

sullen sigil
#

will grab relevant init fields 1mo

#
//Player init
player setVariable ["KJW_Radiate_CountRate",0];
//Object init
this setVariable ["KJW_Radiate_RadiationSource",true];
this setVariable ["KJW_Radiate_RadiationType", "Alpha"];
this setVariable ["KJW_Radiate_Activity",300];```
#

KJW_fnc_radiationProcess is just a switch statement and doesn't touch variables, only returns them

copper raven
#
private _countRate = player getVariable ["KJW_Radiate_CountRate",0];
private _radiationProperties = [_radiationType] call KJW_fnc_radiationProcess;
private _penetratingPower = _radiationProperties#0;
private _ionisingPower = _radiationProperties#1;
private _countRate = _radiationProperties#2; // ?
sullen sigil
#

...

#

im stupid

#

my bad, sorry -- i'd been totally ignoring that 😅

#

second countrate is only for background radiation so isn't defined on an object

#

Yeah, that works fine now -- sorry for such a stupid mistake

copper raven
#
private _penetratingPower = _radiationProperties#0;
private _ionisingPower = _radiationProperties#1;
private _countRate = _radiationProperties#2;
private _dropOff = _radiationProperties#3;
private _breathable = _radiationProperties#4;

params plz

if (player distance _obj1 > _dropOff) exitWith{};
if (_random > _sourceActivity) exitWith{};
if ((count (lineIntersectsSurfaces [_objUpPosASL, _playerPosASL, player, _obj1, true, -1, "GEOM", "VIEW", false])*2) > _penetratingPower) exitWith{};

can all be combined into a single if

sullen sigil
#

As in params["_penetratingPower", "_ionisingPower"] etc?

Yeah I'm just doing them one at a time atm for the sake of debugging, there were systemchats in the exits previously

copper raven
#

_radiationProperties params ["_penetratingPower", ...]

sullen sigil
#

Ah, I didn't know that was a thing, thank you 🙂

hallow mortar
#

I'm trying to change a camera's bank/roll angle. I can control it in other axes using setVectorDirAndUp/BIS_fnc_setPitchBank, but nothing seems to affect the bank angle. Any ideas?

winter rose
tough abyss
#

Wouldn't be surprised if it doesn't work, given that camSetBank is non-functional

hallow mortar
tough abyss
#

I assume you've tested with something like [[1,0,0], [0,1,0]] for setVectorDirAndUp?

hallow mortar
#

That gives me a nice 90 degrees of right yaw but no bank

drowsy geyser
#

are you using camSetTarget?

hallow mortar
#

I am not

tough abyss
#

that gives you yaw?

#

should give you bank with the upVec 90 degrees offset from the standard [0,0,1]

hallow mortar
#

I put the number into the computer and right yaw comes out

tough abyss
#

interesting

#

what about exchanging the two vectors

#

(granted, if the camera didn't start pointing at [1,0,0], that'd likely be why you're seeing yaw)

hallow mortar
tough abyss
#

this is particularly weird to me because I know banking them is possible

drowsy geyser
#

i remember such an issue when i used the command camPrepareTarget

tough abyss
#

as the cameras for my portals can bank

#

iirc I just use setVectorDirAndUp

hallow mortar
#
camFront = "camera" camCreate (getPosATL player);
camFront cameraEffect ["External","BACK"];
camFront setVectorDirAndUp [[0,1,0], [1,0,0]];```
tough abyss
#

Yeah, upon reviewing my code, setVectorDirAndUp seems to do the trick for me

#

get the initial vectors and then we can work from there

#
camFront = "camera" camCreate (getPosATL player);
camFront cameraEffect ["External","BACK"];
private _newUp = (vectorDir camFront) vectorCrossProduct (vectorUp camFront);
camFront setVectorDirAndUp [vectorUp camFront, _newUp];

^ or just try this

hallow mortar
#

That leaves it in the same orientation as its default when created

tough abyss
#

🤔

#

perhaps save the movement for after it's already spawned

hallow mortar
#

No change

tough abyss
#

Huh interesting

#

have to go for now, best of luck

hallow mortar
#

Well, thanks for trying

hallow mortar
#

It seems the problem is the camera type "External". Bank doesn't work with that, you have to use "Internal".

winter rose
#

ah yep

#

everybody uses internal, no? 😄

hallow mortar
#

I don't know, do they?
The cameraEffect types aren't terribly well-explained on the wiki page. I picked one, tested it, it appeared to work, and I thought nothing more of it until now.

winter rose
#

I'm teasing you :) yeah, it's an automated reflex to me since I saw OFP's camera scripts ["Internal", "BACK"] at the time 🙂

warm hedge
#

I never understood what does what 🙃

sullen sigil
#

Isn't there a command to round any numbers above a number down to it? Can't seem to find it

warm hedge
#

Mhm, my midnight brain struggles to understand what you've said but... is it min?

sullen sigil
#

Nvm, ceil works for it as I'm using decimals 😅

warm hedge
#

Any numbers above a number can be anything!!!!😠

sullen sigil
#

no wait no it doesnt ❗

warm hedge
#

floor, then?

sullen sigil
#

Basically trying to make sure 1/(distance from object) will never return a value greater than 1

warm hedge
#

Then _distance max 1 or something

sullen sigil
#

Oh wait yeah min works for that

#

1/_distance min 1

#

Perfecto

#

Time to convert it into % chance meowsweats

warm hedge
#

min in this context? Thought you don't want to divide by zero

hallow mortar
sullen sigil
#

If distance is less than 1, value returned is never above 1

#

so 1/0.1 min 1 will return 1 as 1/0.1 = 10

sudden yacht
#

any idea what this animation is to??? What is the thing/ computer it is opening? How to animate that said object and not the NPC. "Acts_TerminalOpen"

hallow mortar
#

Don't DM me for no reason

#

No, I don't know how to do a typing loop. If there's no animation for it then there's no animation for it.

sudden yacht
#

thanks for the help.

sudden yacht
#

Anyway to disable a light flare effect?

sullen sigil
#

if (X-Y == 2) then

#

or if you want 2 or more just

#

yes

boreal parcel
#

is there a way to force exit the server/local server im in? really dont want to force close the game when I break mission code and cant hit escape.

tough abyss
#

Pretty sure wanting to force exit while simultaneously not wanting to force close is an oxymoron

#

Unless you have a different definition of the differences between the two

sullen sigil
#

I think they mean kick the account from the server basically

#

Though how you'd manage that if you can't hit escape I have no idea

tough abyss
#

If your client is locked up to the point where escape doesn't work I'm not sure what other option you have other than to force close the game

#

The bigger question is why your debugging is leading to such a deadlock to begin with

boreal parcel
tough abyss
#

Ah I see

novel delta
#

Sorry if im in the wrong place but i think this would be it
Im looking at a old mod years out of maintanence that looks cool but none of the stuff spawns in zeus
What kind of code would that faction be missing to let is be usable in zeus?
Its already fully working in eden

novel delta
#

Whoops, Sorry

sullen sigil
#

No worries, people over there will be able to help more

brazen lagoon
#

how do you create a destroy waypoint attached to an object?

#

oh nvm i misread the wiki article for waypointAttachObject

tough abyss
#

whats a good script to make enemies disappear when about 1 kilometer away

#

im using the show hide module

#

but i still want them to reappear once i return

#

something like antistasi

granite sky
#
  1. 1km away from what? Consider MP.
  2. What do you want to do with the enemies when they're out of range?
tough abyss
#

so they dont take up fps

tough abyss
#

i already have them show up on a show hide module

#

but when i go about 1 km away i want them to disappear so they dont take up fps

granite sky
#

You have units associated with specific locations?

tough abyss
#

yes

granite sky
#

And given that you completely ignored the MP point, I guess you mean SP?

tough abyss
#

im setting up the scenario in mp

#

already

granite sky
#

1km from what then?

#

every player?

tough abyss
#

from a trigger

#

whenever a trigger in the 1km mark is touched

#

the ai disappear

#

then reappear when going through the same triggers

#

in that 1km point

light ivy
#

All the pictures are gathered in a pile, in which file to fix it!!please help me!!

warm hedge
#

Don't know what it is

stable dune
light ivy
#

@stable dune the tablet works on the first page!!!only the pictures are all in a heap on the second page

young current
#

Test tablet mod alone first, then add other mods to see where it breaks.

light ivy
#

@young current ✅

ripe sapphire
#

yo bros how do convert turn a string to an already assigned variable?

_myVar= {hint "hello!"};
_myString = "_my" + "Var";

how do i make it so that when i call _myString it returns the hint hello

warm hedge
#

Probably by call compile ?

stable dune
# copper raven you need one more array level

Can the command handle more than one blacklist? I mean if I have _blacklistmarkers = "blacklist1, blacklist2, blacklist3" Which are not "", or if I do, they are ""blacklist","blacklist2","blacklist3"" So Can I get the first and last "off. Well, I don't need the last option if only one blacklist is allowed

copper raven
copper raven
#

i read it wrong

#

should work if you pass an array of markers to it

ripe sapphire
# warm hedge Probably by `call compile` ?

thanx, apparently had to use double call as explained by killzone kid in a forum example:

call call compile format  ["AW_fnc_%1",_playerClass];

1format  ["AW_fnc_%1",_playerClass]; => "AW_fnc_B_Soldier_F"
2. compile format  ["AW_fnc_%1",_playerClass]; => {AW_fnc_B_Soldier_F}
3call compile format  ["AW_fnc_%1",_playerClass]; => call {AW_fnc_B_Soldier_F} => AW_fnc_B_Soldier_F


4call call compile format  ["AW_fnc_%1",_playerClass]; => call AW_fnc_B_Soldier_F
copper raven
#

this is just bad practice in general, what are you trying to do?

ripe sapphire
#

turn a string to a variable

stable dune
ripe sapphire
#

ok actually this is a better solution by moricky using getvariable

call (missionNameSpace getVariable format ["AW_fnc_%1",_playerClass]);
stable dune
# copper raven actually nvm, it can

~~Yeah, ~~
seems in module example is not told you can usetypeName = "ARRAY" , and when i wrote in box in module attributes blacklist1,blacklist2
~~it return text ["blacklist1,blacklist2"]. So this works perfectly! thanks alot! ~~

~~in example of module configs at wiki is ~~

typeName = "STRING"; // Value type, can be "NUMBER", "STRING" or "BOOL"

willow hound
#

So the wiki should state typeName = "STRING"; // Value type, can be "NUMBER", "STRING", "BOOL" or "ARRAY"?

stable dune
#

Nah

#

Naah, i just did wrong, it doens't work. my bad

warm hedge
#

It is way better just to leave your "simple miss" but not apologize and clear what you did

stable dune
# warm hedge It is way better just to leave your "simple miss" but not apologize and clear wh...

Just forgot i tried get them earlier to array via function just simple _blacklist = [_logic getVariable "VRK_IEDDblacklist"]
but i cannot add there more than 1 marker because box in module does string from all text what i wrote,
so when i add
blacklist1,blacklist it return
"blacklist1,blacklist"
but even i try same what alive use blacklist1, blacklist (with space)
it return
"blacklist1, blacklist"

So is there way to get multiple text seprated from 1 edit box

little raptor
#

or even if you want to, you can create a "fake" module, set the parameters, then and call the module function manually

#

actually modules have init fields right?

#

so you should be able to change the parameter using the module init field

stable dune
#

How do i change those? i mean which part and how

#

i would get blacklist area of module area, and like in alive mod you could write them to blacklist editbox

little raptor
#

find the module in config viewer

#

then check its attributes

stable dune
#

i have

little raptor
#

is that your module?

stable dune
#

Yes

little raptor
#

oh. well you can check if the user is passing a valid array using a regex and if so parse it using parseSimpleArray

stable dune
#

Awesome , that's look pretty simple solution

tough abyss
#

does anyone know how antistasi rngs its defenders at outposts and whatnot

velvet merlin
#

how does unscheduled behave if you call a function that uses while/waitUntil? especially if the wait may be influence by unit/group creation?
will it delay the frame completion like crazy and eventually cut to the next? or turn it into scheduled code?

stable dune
little raptor
#

call in schd env -> schd -> will wait for the whole code (including waitUntil) to complete before going to the next line
call in unschd env -> unschd -> error on waitUntil (unless skipped in the same frame)

little raptor
#

well you don't want to replace anything do you?

#

you can simply use _text regexFind ["[a-z_0-9]+", 0]
and it will give you all words in the text
or even simpler, \w+ (but this one allows non-English characters, which are obviously not valid variables)

stable dune
#

"blacklist, blacklist2"
Then if i split with ,
It gives " blacklist2" ,
So want replace empty .
""

little raptor
stable dune
#

Good to know

#

So i can use that which you shown i test that out. Thanks

velvet merlin
# little raptor depends where it's called

from unscheduled env this gets called in BI's fn_spawnGroup:

while {count units _grp > 0} do {
    private ["_maxRank","_unit"];
    _maxRank = -1;
    _unit = objnull;
    {
        _rank = rankid _x;
        if (_rank > _maxRank || (_rank == _maxRank && (group effectivecommander vehicle _unit == _newGrp) && effectivecommander vehicle _x == _x)) then {_maxRank = _rank; _unit = _x;};
    } foreach units _grp;
    [_unit] joinsilent _newGrp;
};```
little raptor
#

that one is fine

velvet merlin
#

p:\a3\functions_f\Spawning\fn_spawnGroup.sqf

little raptor
#

it doesn't have any suspensions
it could however freeze the game which ends after 10000 iterations

velvet merlin
#

from the looks of the profiler, it gets dragged into multiple following frames

#

i assume as the entity creation takes longer than some max frame limit

#

it doesnt freeze the game though. just down to 5-10 fps

little raptor
#

it doesn't look like it could think_turtle

#

you sure it's that fnc?

hallow mortar
#

Creating large numbers of units does tend to have a temporary effect on frame rate. Not because of the script, just because...creating large numbers of units

copper raven
stable dune
#

Awesome 😎

#

Thanks alot sharp!

copper raven
#

then in the editbox, you'd type ["my_blacklistmarker1", "blabla"]

stable dune
#

👍

#

So that is pretty less cost way to do. Seems i need modify my others to.
Is there examples / guide how to use expression/ what that do. Didn't know how that works

stable dune
#

Thanks alot

copper raven
#

that function probably does some suspending

#

while {true} do {

#

that's why nothing executes after you call this

#

spawn it instead

tough abyss
#
[_uid, 0, _id, "recieve"] remoteExecCall ["BIS_fnc_WL2_dataBase", 2]; //CP Saving system
sleep 1;

Why the sleep here?

#

Also, sending the value of clientOwner to a remoteExec'd function is a bit redundant -- you can easily access it via remoteExecutedOwner at the receiving end

#

Mm I see

#

just wanted to be sure it wasn't some sort of kludge for making sure the remoteExec goes through before the script continues

#

because such a method wouldn't be reliable or the correct way of doing so

#

Because there's no way to reliably ensure that the remoteExec'd code would actually finish within 1 second, scheduled code can be delayed by the scheduler indefinitely

#

and a kludge is pretty much a term used for bad solutions to problems in programming -- solutions that usually don't actually solve (or badly solve) the problem at hard

copper raven
#

use a callback function for things like that

velvet merlin
granite sky
#

As far as I know there's nothing special about a while loop aside from the 10,000 iteration unscheduled cap.

#

If you put a short sleep in a while loop then it acts a lot like a waitUntil, but the loop itself has no yielding functionality.

fallow pawn
#

Hey my dudes! So, I was wondering what does the paremeter "addCrew" in addCuratorEditableObjects does to a unit/vehicle if you apply it to them?
It doesn't seem to add actual crew to vehicles, also doesn't seem to make any difference on a unit (be it AI or player).
Sometimes I'm under the impression it gives/removes the ability of Zeus to move a AI unit around, but I feel it's inconsistent.

Am I losing something here? What's the catch?

Ps: I can make it Curator-accessible with said paremeter being either true or false.

granite sky
#

What it's supposed to do is add the crew to editable objects if you added their vehicle.

#

If you do something like allUnits+vehicles then it won't make a difference.

fallow pawn
#

Ooooooh so it's supposed to add the vehicle crew and spare me the job to do so manually.

#

Never would have noticed it as my codes always already adds vehicle + crew

jade acorn
#

what would be the best way to detect a player that's in water but not inland water? Can't check with depth because player won't dive, thought about checking distance from land overwater

jade acorn
#

unfortunately this one detects swamps and inland ponds in which player should be able to go in

#

I mean this probably could work but still I cannot imagine how to detect a range from land that's Z=0 is above sea level, these swamps and stuff do not go further away than 100 meters

granite sky
#

In general it's an expensive search problem.

#

There was a command that might work for it though, if I can remember the name...

jade acorn
#

oh, so with this I could check water depth around player?

#

I mean I assume it's for checking below 0 sea level, not for how deep the player is

granite sky
#

It's just sampling a bunch of random points and sorting them by an arbitrary expression, which you could do in SQF, but this might be faster depending on how the expression is processed.

#

If you know how large these ponds and swamps are that you want to exclude then that helps.

fallow pawn
#

You can check if it's water with surfaceIsWater and then check Z value from getPosATL. If that's somewhat high then the unit is probably in a large body of water (sea, lake, middle of a river) floating/swimming.

twin jolt
#

So I have a question for the scriptors of Arma - what kind of information can you send outside the game using scripting? Can you send information like where a player is, where a player is in relation to an objective, what kind of vehicle a player is in, etc, to an external script that controls something like a teamspeak bot?

#

so if for example I wanted to create a script that tracked where a player is and moved them to different teamspeak channels within a teamspeak server based on their current location, and proximity to an objective, would that be possible?

tough abyss
#

It's possible via extensions

#

but they need to be manually approved by battleye to work with battleye enabled

#

and you'd need to write the extension in a language like C++ or similar

twin jolt
#

that probably wouldn't be a problem? we're talking about a script for a public server in theory that would be a permenant fixture

tough abyss
#

the problem is that getting battleye to actually respond to anything not made by a large group can be... annoying

#

anyways, here's the page about them

twin jolt
#

ok before i start looking into this further, would this be possible completely vanilla

#

using a server sided script

tough abyss
#

no

#

SQF is completely incapable of interacting with things outside of the game other than via extensions

twin jolt
#

so it would require both the player and the server to download a mod

tough abyss
#

I mean whether the server would need it or not is up to how you implement it, but the players would need it, yes

twin jolt
#

ah balls

#

that won't work unfortunately

#

well thanks for answering my questions

tough abyss
#

no problem

#

well, actually

#

hold on @twin jolt

#

I misread your question

twin jolt
#

ok

tough abyss
#

if only the bot needs to know the information, then just having it serverside would work

#

the server would need to be running the mod which would then need to funnel the info to the bot

twin jolt
#

yeah I didn't want to have to have people install a ts3 plugin so I figured a server bot would be a better way to go

tough abyss
#

I would recommend first looking into how you can interface with the bot from C/C++/C#

#

as those are the primary languages for making extensions

twin jolt
#

right

tough abyss
#

and then look into making the extension itself

twin jolt
#

this probably won't happen but its good to know that its theoretically possible

#

gotta be realistic lol

#

thanks again

tough abyss
#

👍

fallow pawn
#

On vanilla you can always create and modify radio channels (radioChannelCreate) within the match and apply them to players based on your ideas. IDK if that helps you.

finite tusk
#

Is BIS_fnc_target specifically assigned to object type "TargetBootcamp_base_F"? or am I being an eejit?

jade acorn
#

looks like it is, otherwise I don't think Lou would mention that very type in every row possible

finite tusk
#

Thought as much!

#

ta

#

Possible to pull shooterData from other objects?

vernal pawn
#

Is there any way to animate and open the top hatch on the Hunter?

warm hedge
#

No

blazing zodiac
#

what are the best techniques to stop AI in a group from "forming up"?

stable dune
#

Hi,
Where i should save Eden attributes?
I do not get to init current area and isrectangle from module.
I get them in if Eden attributes changed. So can I save those some space and get them from there?

grand stratus
#

I read somewhere that decreasing view distance will decrease the client requests to the server for object positions. Is this true?
If so, does having client side triggers that check for objects out of view distance mess with it?

drowsy geyser
#

is it possible to reactivate a non-repeatable trigger?

hallow mortar
#

You could try toggling its setTriggerActivation state, maybe changing that will reset it. Not certain on that though.
Other options:

  • just create a new one with the same settings
  • have it actually be repeatable all along but with a secondary activation condition that only lets it activate when you want, e.g. a variable
fair drum
stable dune
chrome hinge
#

Greetings, any insight on why { _x forgetTarget SO1} forEach (units independent); or (units independent) apply { _x forgetTArget SO1}; Dont make side forget a target? units independent seems to return a array of independent units correctly

smoky rune
#

can anyone confirm that playSound "3DEN_notificationWarning" no longer works for them too?

#

I noticed that config entry for it has empty string in sound[] property, maybe it's a bug or I'm doing something wrong?

#

nevermind, it's Eden Enhanced addon clears sound[] property for both 3DEN_notificationWarning and 3DEN_notificationDefault CfgSounds entries for some reason

chrome hinge
#

Should i run it only on server? Or everyone?

copper raven
#

(that's terrible code though in that context, could make it better)

hallow mortar
#

Bear in mind that they can immediately regain that knowledge if they can still see the target / someone who can report to them can still see the target

chrome hinge
#

Okay, the side forgetting target has 1 player and a big bunch of AI, does this affect it any way?

copper raven
#

you should loop groups, not individual units

chrome hinge
#

so just switch units to groups?

copper raven
#

allGroups select { side _x == independant } if you're in stable, if dev you can use groups independant

chrome hinge
#

alrighty thanks

#

Does it matter if i use foreach or apply?

copper raven
#

no

#

but i'd suggest using forEach if you only want to iterate over an array

#

if you use apply for that it's abit missleading (imo)

chrome hinge
#

Okay, thanks for your help! Ill try it out

manic sigil
#

Someones thread on the subreddit got me in a mindpuzzle mode, and I threw something together. Unfortunately, Im at work, and unable to test it - and tbh, its just something I put together to see what Id do to get the effect they were going for, not something I need myself to work; thoughts welcome as review, though content warning: edited on a phone in haste, so not the prettiest or cleanest code.

copper raven
# manic sigil https://sqfbin.com/ulotayuzagowaqiyusus

Params ["N","POS","Hider","Seeker"];
params doesn't allow global identifiers.
,"F_40mm_Yellow"] missing ;
Sleep 10 random 15 precedence issue

`} // here

_flareTrg setTriggerStatements ["this","call flareTrgAction",""];missing;again_flareTrg setTriggerStatements ["this","call flareTrgAction",""]; flareTrgActionrequires suspension and you're usingcall` here (from unscheduled), wrong
many undefined variables

manic sigil
#

Sounds about right xD

#

Heck, when I was about to post I only just remembered to put Params items in quotes.

#

Doing this off the cuff would be so much easier if I could just convince them to let me install Arma on the work computers 👀

neat monolith
#

Hello, is there anyway to delate or remove a trigger with another trigger? I have a repeatable trigger that I wont to remove/permanently deactivate when another trigger is activated.

Thanks.

copper raven
#

you can put ... && !triggerActivated my_other_triggerwhich will prevent this trigger from activating while my_other_trigger is active

neat monolith
#

thanks

copper raven
#

alternatively you can deleteVehicle

neat monolith
#

and that where it goes? On the deactivate of the trigger?

copper raven
#

it goes to the activation of the trigger that would "disable" the other trigger

neat monolith
#

thanks

astral bone
#

Is there a way to run code when the game looses focus?

neat monolith
#

Is there anyway to delate a mark placed on eden with a ingame trigger?

#

I trt delatevehicle and didnt work

south swan
copper raven
grave thistle
#

what's the sqf command for getting current map's config name? There's one iirc, right?

sullen sigil
#

Is there an easy way to do either of the following:

Subtract Weapon_ from a string "Weapon_classname" to result in classname

Or get the first (or only) subclass occurrence in a getText -- i.e
getText (configFile >> "CfgVehicles" >> _obj1 >> "TransportWeapons" >> some class here >> "weapon");

winter rose
sullen sigil
copper raven
sullen sigil
#

I saw after looking at the wiki for select again, thanks

All good now though, streamlined making compat files to running 2 functions and some ctrl+h business now.

wary sandal
#

How do i center this text? I heard of the safezone stuff but i'm not sure how to use it to make the text centered
[parseText "<t font='PuristaBold' size='1.6'>My Mission</t><br />by Username", [0, 0, 1, 1], [9, 3], 2, [0.80, 0.30], 0.035] spawn BIS_fnc_textTiles

copper raven
#

align='middle' in the structured text params

#

or do you mean entire control/whatever?

wary sandal
#

i tried using align='middle'

#

but it still doesn't really center

#
[parseText "<t font='PuristaBold' align='middle' size='1.6'>My Mission</t><br />by Username", [0.5, 0.5, 1, 1], nil, 2, [0.80, 0.30], 0.035] spawn BIS_fnc_textTiles```
copper raven
wary sandal
#

oops

#

caps

#

0.5 - 0.16?

copper raven
#

would need to look at how that function calculates stuff

wary sandal
copper raven
# wary sandal did you figure out?

idk, open functions viewer and see what it does with the coordinates, you can try something like

private _h = 1.6 * getNumber (configFile >> "RscStructuredText" >> "size");
private _w = ("My Mission" getTextWidth ["PuristaBold", _h]) + 0.016;
[parseText "<t font='PuristaBold' align='middle' size='1.6'>My Mission</t><br />by Username", [safezoneX + safezoneW / 2 - _w / 2, safezoneY + safezoneH / 2 - _h / 2, _w, _h], nil, 2, [0.80, 0.30], 0.035] spawn BIS_fnc_textTiles

but height will be incorrect (your text is multiline), you can try playing with it by multiplying maybe

dreamy kestrel
#

Hello, IIRC there is a simple fire and smoke column effect I can attach to a target object? I do not recall what that is, but IIRC it was baked in as a resource I can call up?

icy seal
wary sandal
#

it looks like all the text is stacked on top of each other

copper raven
#

private _w = ("My Mission<br />" getTextWidth ["PuristaBold", _h]) + 0.016; this should fix it

#

oh actually it should be align='center' not middle

wary sandal
wary sandal
#

do i have to give it some height for the other text to appear?

copper raven
# wary sandal do i have to give it some height for the other text to appear?
private _size = getNumber (configFile >> "RscStructuredText" >> "size");
private _h = 2.6 * _size;
private _w = ("My Mission<br />" getTextWidth ["PuristaBold", 1.6 * _size]) + 0.016;
[parseText "<t align='center'><t font='PuristaBold' size='1.6'>My Mission</t><br />by Username</t>", [safezoneX + safezoneW / 2 - _w / 2, safezoneY + safezoneH / 2 - _h / 2, _w, _h], nil, 2, [0.80, 0.30], 0.035] spawn BIS_fnc_textTiles

try this

wary sandal
#

can't thank you more

#

i wanted to sync this with the music but the music still seems to play when i'm tabbed out

#

afaik there's no way to pause the music when isGameFocused resolves to true so i'm kinda screwed here

copper raven
wary sandal
#

that's pretty smart

dreamy kestrel
#

hrm I would half expect that something like an 'effects module' be an effects factory, in effect, and attach manufactured effects to target objects. but I'm not certain my expectations would be dashed where fire, smoke effects modules are concerned... is there a cohesive example that demonstrates both or either of these?

#

I know it is possible, so that once the target object is deleted, the effects go away as well... not sure this is the case here, however.

wary sandal
# copper raven https://community.bistudio.com/wiki/getMusicPlayedTime when the game loses focus...

it's not clean but i wanted to make sure i did it correctly

lastMusicPlayed = "";
lastMusicTimecode = -1;
addMusicEventHandler ["MusicStart", {
    params ["_musicClassname", "_ehId"];
    lastMusicPlayed = _musicClassname;
}];
addMusicEventHandler ["MusicStop", {
    lastMusicPlayed = "";
}];
addMissionEventHandler ["EachFrame", {
    if (lastMusicTimecode == -1 and !isGameFocused) then {
        lastMusicTimecode = getMusicPlayedTime;
        playMusic "";
    };
    if (lastMusicTimecode != -1 and isGameFocused) then {
        playMusic ["EventTrack02_F_EPA", lastMusicTimecode];
        lastMusicTimecode = -1;
    };
}];```
dreamy kestrel
#

so ModuleEffectsFire_F and ModuleSmoke_F appear to be objects. I can just create them then? using what, createVehicle? i.e. "ModuleEffectsFire_F" createVehicle _firePos?

meager spear
#

When I create a new function the path has to include also the pbo folder?
example: eugfunction.sqf is inside the path "@eugfolder\addons\folder1\folder2\eugfunction.sqf"

Is it correct to use only file = "\folder1\folder2\eugfunction.sqf"; ?

Here the example code:

`class CfgFunctions
{
class TAG
{
class Category
{
class myFunction {};
};

    class OtherCategory
    {
        file = "My\Category\Path";
        class myFunction {}; // file path will be <ROOT>\My\Category\Path\fn_myFunction.sqf";
    };`
copper raven
#

also keep in mind that playMusic "" won't fire the MusicStop event (if you decide to stop the music at some point manually), so if you run playMusic "" and unfocus&focus the game it will keep playing

#

make a macro or a function for it, e.g.,

#define STOP_MUSIC playMusic ""; \
lastMusicPlayed = ""
dreamy kestrel
copper raven
copper raven
dreamy kestrel
#

what am I doing wrong... trying something like this, I see no smoke created.

_grp = createGroup sideLogic;
module_smoke = 'ModuleEffectsSmoke_F' createUnit [getPos bar, _grp];
[module_smoke] call BIS_fnc_moduleEffectsSmoke

bar is a random object, H-barrier in this case. Just something to reference the effect.

copper raven
#

the syntax you're using of createUnit doesn't return the created unit, use the primary syntax

dreamy kestrel
#

even with that, I get the object, but I see no smoke...

_grp = creategroup sidelogic;
module_smoke = _grp createunit ['ModuleEffectsSmoke_F', getPos bar, [], 0, 'none'];
[module_smoke] call BIS_fnc_moduleEffectsSmoke
copper raven
#

try
[module_smoke, "BIS_fnc_moduleEffectsSmoke"] call BIS_fnc_moduleEffectsEmitterCreator instead

dreamy kestrel
#

call it a success... so... how do I get the effect to stop?
does not appear to be attached to the module, i.e. deleteVehicle module_smoke does not do it

copper raven
dreamy kestrel
#

okay doke... thanks. not the most elegant interface, but it works.

trail smelt
#

Is it possible to delete the trigger as well as the vehicle using AddAction ?

this addAction["Turn Alarm Off", {  
sleep 1;
{deleteVehicle _x} forEach crew jarda;
deleteVehicle jarda;
};
#

(in mission on dedicated server)

copper raven
#

also, use deleteVehicleCrew instead of what you are currently doing

#

to delete trigger, it's simply deleteVehicle myTrigger

trail smelt
#

jarda is the trigger

copper raven
trail smelt
#

I want to delete the trigger, no vehicle..

copper raven
#

{deleteVehicle _x} forEach crew jarda; what is this for then?

#

deleteVehicle jarda; is enough

trail smelt
#

Okey thanks

#

It doesn't seem to work at all..
to better describe what I'm trying to do, I have a trigger that activates an alarm when entering the zone, I'm trying to use another object via addAction to delete this trigger so that this alarm can be deactivated before entering the trigger zone

wary sandal
copper raven
copper raven
copper raven
wary sandal
#

so #define... fires the music stop event everytime playMusic="" is ran?

copper raven
#

it's a preprocessor macro, it simply replaces text

#

instead of typing everytime

playMusic "";
lastMusicPlayed = "";

you can make a macro,

#define STOP_MUSIC playMusic ""; \
lastMusicPlayed = ""

// then simply
STOP_MUSIC;

after this is preprocessed, it becomes

STOP_MUSIC playMusic "";
lastMusicPlayed = "";
wary sandal
trail smelt
copper raven
copper raven
toxic tundra
#

Hello, I got a little problem to solve problem.

So i am using the flight record function to have a more immersive helicopter landing. but after the recorded flight has finished the helicopter goes back in air.

I have tried:
using setThrottleRTD but wen i use this i get "blackhawk1 |#|setThrottleRTD"- error missing ;
even tho the "isObjectRTD blackhawk1" ist true on this object the "difficultyEnabledRTD" is false.

why not having the landing and starting in one recording? because i cant know for sure how long the ai will need with getting in the helicopter.

Would be nice if someone could help me.

copper raven
toxic tundra
#

sorry

#

i had give your the wrong command i entered.

#

blackhawk1 setThrottleRTD [0, -1];

copper raven
#

ah, that command is actually not in arma 3, that's why

toxic tundra
#

!?!

copper raven
toxic tundra
#

aAAAW JEEESE

#

its arma2

copper raven
dreamy kestrel
#

wut? I'm kinda curious about this one. how are engine rpms at all related to throttle? I mean, at least when you set a thermostat using BTUs you have some frame of reference, for instance.

copper raven
copper raven
toxic tundra
#

but whats about "difficultyEnabledRTD" comes false? I already set up "forceRotorLibSimulation = 1" multiple times

copper raven
toxic tundra
#

uhmmm Trigger at startup

copper raven
#

it should go to description.ext

toxic tundra
#

alright

stable dune
#

Which value i set to config so i can see in curator mode objects which are placed from module function?

#

seems none

#

I clearly need longer nerves, and waiting time. now everything is visible.

#

Is there value to set some of invisible? I mean if i have object where is multiple attached objects, all those is in empty list on curator mode

sullen sigil
#
_pos = getPosASL kjwshower;
_arr = [];
{
if (getPosASL _x inArea [_pos, 2, 0.25, getDir kjwshower, true, 4]) exitWith {_arr pushBack _x};
} forEach nearestObjects [kjwshower, [], 20];

_arr```
seems to only be returning `[30: <no shape>]` when only the player is in the area, pretty sure that's not what is returned -- anyone know what that even is?
#

No matter how big the inArea ones are it still returns that thonk
Varying the nearestObjects just changes the number returned to 29/28

south swan
#

"exitWith" inside "forEach"? Lemme check

sullen sigil
#

fml forgot you cant do that meowfacepalm

#

Yeah, that works -- just need to figure out how you actually exit the current cycle

south swan
#

continue?

sullen sigil
#

ah perfect thanks

south swan
#

also, maybe inAreaArray?

#

seems to fit the intent here

sullen sigil
#

Nah, chopped out a check from the code for variable

#
if (_x getVariable ["KJW_Radiate_Irradiated",0] == 0) then {continue};```
south swan
#

ye, converting only makes sense if it gets rid of forEach completely

sullen sigil
#

Yeah, then need another forEach of that array to reduce the variable every tick or so meowsweats

toxic tundra
#

i dont know why it does this in the first place

sullen sigil
#

Can you not just damage the engine of the helicopter?

toxic tundra
#

if a recorded flight ends and the helicopter is on the ground why does it take of again?

toxic tundra
#

not a great solution

sullen sigil
#

Oh, you're using AFM -- I'd assume it's going back up due to Arma AI or something similar

toxic tundra
#

uhm i don't care which one i use in the end

#

i just want the helicopter to not take off

south swan
#

doesn't AI just love to take off after landing?

sullen sigil
#

Indeed

#

Only solution I've found is switching off the engine or removing the fuel 🤷

toxic tundra
#

hmm i will try agian to diableAI features

sullen sigil
#

Alternatively you could try give the AI a land waypoint at their position, don't know if that'd work or not

toxic tundra
#

no. they alwas take off and fly to a more save place even if it is already right at the position. thats why this is so frustrating

sullen sigil
#

That's arma AI for you

toxic tundra
#

LUV IT 🫡

chrome hinge
#

How setTargetAge does? does ai behavior change somehow when target is known for longer time?

sullen sigil
#

yes, different lengths of time will result in different behaviour

dreamy kestrel
carmine sand
#

Anyone has a solution to stop the halo animation?

carmine sand
copper raven
#

but it might be ugly/glitchy, not sure

frank mango
copper raven
carmine sand
#

We will try it ✌ its for the jumpjet infantry

trail smelt
#

(laptop with name "ac" used with addAction)

this addAction["Turn Alarm Off", {  
sleep 1;

systemChat str ["deleting trigger", jarda]; 
deleteVehicle jarda; 
systemChat str ["deleted trigger", jarda];

player attachTo [ac, [0,-0.59,-1]];    
player playMoveNow "Acts_Accessing_Computer_in";    
sleep 0.8;  
ac say3D ["music1", 1000, 1];  
player switchMove "Acts_Accessing_Computer_loop"; 
sleep 3;  
ac setObjectTextureGlobal [1, "pic\disarmed.jpg"]; 
player playMove "Acts_Accessing_Computer_Out_short";    
detach player;  
alarmToggle = false; publicVariable "alarmToggle";  
}];```
trail smelt
#

If some one(blufor) step inside trigger "jarda" after use this action still trigger "jarda" in the place and activate the alarm..

trail smelt
#

Your code work only on localhost in editor as multiplayer.. on dedicated server absolutly game ignor the code..

tough abyss
#

yo can anyone help me with setting up a script like this

#

i want to setup patrols of gendermerie within 1-2 kms of the player

#

but when you are too far away from the patrols they disappear

#

or get deleted

copper raven
trail smelt
#

in editor test'
deleting trigger
next
deleted trigger
but on dedicated server nothing..

copper raven
#

doesn't make sense

#

sounds like you aren't reloading/repacking the mission correctly

trail smelt
#

Hmmm, i try put in another trigger and now worked.. 🤔

trail smelt
#

(Mechanically it works but it doesn't write anything in the chat..)

winter rose
tough abyss
#

ive tried a video

#

where you have to make a sqf file

#

this one to be exact

winter rose
#

so, just this script?

tough abyss
#

yeah

#

couldnt find any other tutorials about it

#

or guides

#

i just want ai to spawn about 300 meters from independent players

#

then delete at about 900 meters

#

to a kilometer

#

and patrol

wary sandal
#

does anyone know why the squad radar UI shows up during cutscenes?

hallow mortar
#

Because it's a third-party scripted element that doesn't know it's in a cutscene

wary sandal
#

it's a pretty popular mod so i thought they would've thought about that

little raptor
copper raven
true frigate
#

Hey! I'm trying to make something for a dedicated server, but for some reason this doesn't work correctly.

if (!isServer)exitWith{};

h1 allowDamage true;

h1 setHitPointDamage["HitVRotor", 1];
h1 setFuel 0.02;

{ _x removeweapon "ItemGPS"} foreach allplayers;
{ _x removeweapon "ItemAndroid"} foreach allplayers;
{ _x removeweapon "ItemMicroDAGR"} foreach allplayers;
{ _x removeweapon "ItemcTab"} foreach allplayers;

sleep 0.5;
h1 allowDamage false;```
It's a simulated helicopter crash, basically. But for some reason, the items get removed, however, the helicopter takes no damage and the fuel doesn't get removed. It works if I locally or globally execute the damage and fuel changes, but won't work with either of the:
 ```remoteExec [`...',2]
remoteExec [`...',0]```

Anyone know how to fix this? Thanks 🙂
winter rose
#

remoteExec on the target

copper raven
#

removeweapon also takes local arg though? (same for allowDamage)

true frigate
#

Ah, alright, I thought that would be done since I was running the script with remoteExec?

winter rose
#
[h1, ["HitVRotor", 1]] remoteExec ["setHitPointDamage", h1];
[h1, 0.02] remoteExec ["setFuel", h1];

// also one loop is better than four
{
  [_x, "ItemGPS"] remoteExec ["removeWeapon", _x];
  [_x, "ItemAndroid"] remoteExec ["removeWeapon", _x];
  [_x, "ItemMicroDAGR"] remoteExec ["removeWeapon", _x];
  [_x, "ItemcTab"] remoteExec ["removeWeapon", _x];
} forEach allPlayers;
true frigate
#

Ah alright, that makes sense, and about the loops, yeah I'm still learning haha, I suppose it's gonna be spaghetti for a while 😉
Thanks Lou pepeLove

thorn saffron
#

I'm trying to capture the moment when a tripwire mine is tripped and detonated. I want to run a custom function when that happens. Sadly I cannot find a way to patch myself into that, even with ACE explosives. I want to avoid any dumb stuff like spawning a waituntil or something for every tripwire, just to get if they were tripped or not.

halcyon temple
#

hey guys...

wrote a function to get to the property of a class, can't figure out how to the content of that property.

code is as follows

TGF_fnc_getConfig = {
    params["_config"];
    {
        if (isNil "_config") exitWith {};
        diag_log format ["Config %1", _x];
        diag_log format ["Name %1", configName _x];
        diag_log format ["Properties %1", configProperties [_x, "(configName _x) isEqualTo 'file'"]];
        ("true" configClasses _x) call TGF_fnc_getConfig;
    } forEach ("true" configClasses _config);
};
_configs = "(configName _x) isEqualTo 'TGF'" configClasses (configFile >> "CfgFunctions");
_configs call TGF_fnc_getConfig;
winter rose
# tough abyss then delete at about 900 meters

a quick way to do this:

  • have a global scope array variable where you store created groups
  • run one script periodically (e.g every 30s) that will delete groups when their units are > 900m
copper raven
#

or are you looking to recursively get all file properties?

halcyon temple
#

better way, I'm all ears (eyes?)

toxic tundra
#

Does somebody know what went wrong here?

copper raven
# halcyon temple better way, I'm all ears (eyes?)
TGF_fnc_getConfigPropertyRecurse = {
  params ["_cfg", "_name", "_arr"];
  private _value = getText (_cfg >> _name);
  if (_value isNotEqualTo "") then { _arr pushBack _value };
  { [_x, _name, _arr] call TGF_fnc_getConfigPropertyRecurse } forEach ("true" configClasses _cfg);
};

private _arr = [];
[configFile >> "CfgFunctions" >> "TGF", "file", _arr] call TGF_fnc_getConfigPropertyRecurse;

on phone, bit hard, but should work

#

edited, missed the CfgFunctions

toxic tundra
winter rose
#

no worries, it's sometimes tricky - and rares are the commands that were in TKOH and not ported in A3

halcyon temple
dreamy kestrel
#

day in reflection about working with BIS_fnc_moduleEffectsEmitterCreator and so forth... the one flaw I can determine is that I do not seem to be able to specify a target object. Or maybe I can, I do not see the options for it. Why, because when "effects", really particle effects, are created, IIRC, I can connect them with a desired target object. Say I have a helicopter wreck, I want to create the FIRE+SMOKE effects. When I delete that wreck, I want the effects to automatically go away. However, AFAIK, the module is the target object, correct? If I delete the module, will the effects go away? I have the GC mention from yesterday, so I know how otherwise to deal with it, but I think that is somewhat of an oversight...

hallow mortar
dreamy kestrel
hallow mortar
#

Have you tested that? I'm much less confident than you sound, that there is any difference between the object param of a particles array and just attaching the emitter with attachTo.

dreamy kestrel
#

just so we're clear on the bit of extra GC bookkeeping the caller has to handle using the modules.

#

it's all good; would be better if the particle source was connected to a target, but we can handle the bit of bookkeeping besides.

hallow mortar
#

Is it so much extra legwork? I would argue that it is in fact much easier, since the lack of documentation of the effects module is proving to be so inconvenient

dreamy kestrel
#

yeah well the docs issue aside of course...

hallow mortar
#

Make your own function that just contains one of the examples I linked, and accepts an object as an argument. You only have to write* the particle thing once, you know exactly how it works (having tested it, I assume) and you can use it easily.

  • and by "write" I mean "copy and paste"
toxic tundra
#

can somebody explain to me what values the BIS_fnc_unitCapture function exports?
Like this is the output of a flight recording BIS_fnc_unitCapture
[[0,[5994.6,7589.56,117.871],[-0.0612043,0.994945,-0.0796084],[0.0987933,0.0854049,0.991436],[-5.86476e-005,-5.91099e-006,3.07709e-005]]];
What does each spot mean?
[[value1, [value2-1,value2-2,value2-3], [value3-1,value3-2,value3-3], [value4-1,value4-2,value4-3], [value5-1,value5-2,value5-3]]];

Would be interesting for me because i want to manipulate these values to maintain the current position as of my questing earlier that day due to that ai pilot always trying to take of when recorded flight file ands and helo on the ground.

dreamy kestrel
#

I say yes it is more leg work. I mean, you can still monkey with particle or other module parameters besides, but it is better having the canned approach, IMO, and just tuck that away into an effects adapter layer, easy-pea-zee.

winter rose
wary sandal
#

How do i fade a sound created using playSound3D? i tried fadeSound but it fades all the sound and not the one i'm playing

little raptor
#

if you use say3D instead you can move the source away to mimic fading

wary sandal
#

i saw there was createSoundSource too but i still didn't get how it works lol

halcyon temple
#

hey guys...
can anyone tell me what's wrong with this...

PS G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\AddonBuilder> .\AddonBuilder.exe "P:\TGF_A3\x\tgf\addons\sspcm" "D:\Users\TGF\Documents\Arma 3\Mods\@TGF_A3\addons" -project="P:\TGF_A3" -prefix="x\tgf\addons\sspcm" -temp="P:\temp" -sign="P:\TGF_A3\keys\TGF.biprivatekey" -include="G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\FileBank\include.txt" -exclude="G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\FileBank\exclude.lst" -binarize="G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\Binarize\binarize.exe" -cfgconvert="G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\CfgConvert\CfgConvert.exe" -filebank="G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\FileBank\FileBank.exe" -dssignfile="G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\DSSignFile\DSSignFile.exe" -clear -binarizeAllTextures
[2022-12-02 21:38:05,334] [INFO ]: ==========================================================================
[2022-12-02 21:38:05,338] [INFO ]: WELCOME TO ADDON BUILDER
[2022-12-02 21:38:05,340] [INFO ]: Version: 1.5.146305
[2022-12-02 21:38:05,341] [INFO ]: ==========================================================================
[2022-12-02 21:38:05,342] [INFO ]:
[2022-12-02 21:38:05,342] [ERROR]: Invalid value for argument specified. [ArgumentName]=, Invalid number of arguments. There can be only one source_path and destination_path at the same time
[2022-12-02 21:38:05,342] [INFO ]: Use -help to see all parameters and example```

and please don't tell me "There can be only one source_path and destination_path at the same time" xD
jade acorn
#

FYI SSCPM is forbidden to be repacked.

halcyon temple
#

I may mod it right?

jade acorn
#

license is pretty straightforwad, it would be wise to read it.

halcyon temple
#

@jade acorn , you know, it's this king talk that discourages nobodies like myself from doing... whatever, you make it sound I'm a thief. Dude... I look some code and try to make my own. Nothing is published, nothing is sold, nobody is making any kind of profits, but most importantly, no one is claiming credit for anything...

and this wall of text http://www.bistudio.com/community/licenses/arma-public-license-share-alike

right... you need some context of one is, and what one does... like I said, a nobody just messing around with some code, after fucked up day of work, in an attempt to feel some fulfilment.

Don't get me wrong, I don't take what you said personally, but take a chill pill... you have never heard of me, ever, and neither will you, ever... that's how we nobodies roll...

jade acorn
#

why are you linking me a license different to which SSCPM was published under? And am I supposed to be ashamed of myself because I tell you stealing is bad? Why repack this stuff anyway? Make a collection or a HTML preset and follow the EULA. Your feelings have no legal power, Workshop EULA and the licenses do have.

halcyon temple
#
Simple Single Player Cheat Menu by Benargee
This work is licensed under the Arma Public License Share Alike http://www.bistudio.com/community/licenses/arma-public-license-share-alike
---v1.0 
--March 19, 2015
-Initial Release
---v1.0.1
jade acorn
granite sky
#

Huh, forum version does say APL-SA.

winter rose
#

the licenses have a short summary

halcyon temple
jade acorn
#

No Derivatives - If you remix, transform, or build upon the material, you may not distribute the modified material.

halcyon temple
granite sky
#

Changelog inside the mod also says APL-SA.

granite sky
#

Yeah, so maybe one of more of these is a mistake but if two different licenses are specified then you can choose.

#

As for your initial problem, no idea. Syntax looks correct.

halcyon temple
jade acorn
halcyon temple
#

for clarity

PS G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\AddonBuilder> .\AddonBuilder.exe `
>> 'P:\TGF_A3\x\tgf\addons\somethingSoNoOneIsOffend' `
>> 'D:\Users\TGF\Documents\Arma 3\Mods\@TGF_A3\addons' `
>> -project='P:\TGF_A3' `
>> -prefix='x\tgf\addons\somethingSoNoOneIsOffend' `
>> -temp='P:\temp' `
>> -sign='P:\TGF_A3\keys\TGF.biprivatekey' `
>> -include='G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\FileBank\include.txt' `
>> -exclude='G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\FileBank\exclude.lst' `
>> -binarize='G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\Binarize\binarize.exe' `
>> -cfgconvert='G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\CfgConvert\CfgConvert.exe' `
>> -filebank='G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\FileBank\FileBank.exe' `
>> -dssignfile='G:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\DSSignFile\DSSignFile.exe' `
>> -clear `
>> -binarizeAllTextures
>>
[2022-12-02 21:51:20,148] [INFO ]: ==========================================================================
[2022-12-02 21:51:20,152] [INFO ]: WELCOME TO ADDON BUILDER
[2022-12-02 21:51:20,153] [INFO ]: Version: 1.5.146305
[2022-12-02 21:51:20,155] [INFO ]: ==========================================================================
[2022-12-02 21:51:20,155] [INFO ]:
[2022-12-02 21:51:20,156] [ERROR]: Invalid value for argument specified. [ArgumentName]=, Invalid number of arguments. There can be only one source_path and destination_path at the same time
[2022-12-02 21:51:20,156] [INFO ]: Use -help to see all parameters and example```
jade acorn
halcyon temple
#

@jade acorn m8, can we move on... it's for personal use,

jade acorn
#

pack of reuploaded mods for personal use? Why not make a preset or steam collection?

halcyon temple
#

no idea what you are taking about. But to answer your question... sometimes one likes to one owns bread, rather then baying it from a bakery...

jade acorn
#

it's not about what you like, "m8", but you do you. You're making your first "modding" steps in a wrong way.

granite sky
#

In fairness, a lot of people start out by editing a mod or mission for personal use.

halcyon temple
#

@jade acorn , you know what, I'm sorry... 🚪

sullen sigil
#

are "nested" operators meant to work within in an if statement? i.e

if (((_maskDependent == 1) && (_backpackDependent == 0)) || ((_maskDependent == 0) && (_backpackDependent == 1)))```?
copper raven
#

no issues there except a bunch of useless parentheses

sullen sigil
#

i like brackets

#

thank you

#

I have however realised an easier way of doing this regardless

copper raven
#

you could also write that as _maskDependent + _backpackDependent - 1 == 0

sullen sigil
#

Yeah, they're altering values so I'm just going to use them as coefficients to multiply the values by 1 or 0 instead of worrying about conditional statements

#

no that doesnt work nvm

granite sky
#

Assuming that the valid values are only 0 and 1, _maskDependent != _backpackDependent also has the same results.

sullen sigil
#

Yup, now using that -- then flipping them meowsweats

#
if (_maskDependent != _backpackDependent) then {
    _maskDependent = (_maskDependent - 1)*-1;
    _backpackDependent = (_backpackDependent - 1)*-1; 
    _maskProtection = _maskProtection * _maskDependent;
    _backpackProtection = _backpackProtection * _backpackDependent;
};```
#

They are config values so keeping 1 as true and 0 as false makes most sense

granite sky
#

(_x - 1) * -1 is equivalent to (1 - _x)

sullen sigil
#

oh so it is

#

thank you

copper raven
sullen sigil
#

Though if it's performance actually bool is better

copper raven
#

getNumber _cfg == 1

sullen sigil
#

I'm confused

copper raven
#

don't use getText, keep using getNumber, and compare the value to 1, this will evaluate false if it's not 1 and true if it's 1

granite sky
#

Not sure what happens if you multiply by a bool though :P

sullen sigil
#

^

granite sky
#

In some cases SQF does treat them as 0/1

sullen sigil
#

I'll look in debug console one mo

copper raven
#

use && over multiplying

sullen sigil
#

Yeah, can't multiply bool by number

copper raven
#

why would you want to multiply by number?

#

to flip, use !

granite sky
#

it's instead of using a conditional to add the protection values.

sullen sigil
#

so I can set the protection values to 0 if false

#

No wait, if true

#
if (_maskDependent == _backpackDependent) then { //If they are both true or both false.
    _protectionStrength = _protectionStrength + _uniformProtection + _maskProtection + _backpackProtection;
};
if (_maskDependent != _backpackDependent) then {
    _maskDependent = 1 - _maskDependent; //Flip from 0 to a 1 and vice versa. Means if it's true (dependent on a mask) there'll be no protection.
    _backpackDependent = 1 -_backpackDependent; //Flip from 0 to a 1 and vice versa. Means if it's true (dependent on a backpack) there'll be no protection. Used for SCBA.
    _maskProtection = _maskProtection * _maskDependent;
    _backpackProtection = _backpackProtection * _backpackDependent;
};```
#

thats the full checks

#

strength is 0-1 value and dependent is 0 or 1

granite sky
#

Do you actually use maskDependent or backpackDependent after that?

sullen sigil
#

No

granite sky
#

ok, that's way overcomplicated then :P

open hollow
#

how i can get the parents of aconfig by script?

#

i mean this array

granite sky
#

Also not sure in what cases you're intending to add _uniformProtection, because that looks wrong.

open hollow
granite sky
#

normal for wiki :P

sullen sigil
#

Or rather, should do

sullen sigil
granite sky
#

Your code's just doing this as far as I can tell, but it doesn't make any logical sense to me:

if (_maskDependent == _backpackDependent) then {
   _protectionStrength = _protectionStrength + _uniformProtection + _maskProtection + _backpackProtection;
} else {
   if (_maskDependent == 0) then { _backpackProtection = 0 } else { _maskProtection = 0 };
};
sullen sigil
#

_maskDependent == 0 means that it is dependent on having a backpack which has a protection value > 0, and the same is true for backpacks about masks

#

This probably isnt the most intuitive thing to explain lol

#

Basically if _maskDependent == 1 then it's dependent on having a backpack with protection value > 0 to get any protection (SCBA from contact DLC for example)

#

If 0 then it's fine (regular gas mask)

#

But _backpackDependent == 1 means that to get any protection from the backpack, it must have a mask with protection value > 0 to get any protection (stops you just running around with an air tank on your back)

#

Basically does it need a tube from the backpack to the mask lol

sullen sigil
#

me again with yet another elementary question that i cant figure out the answer to
how do i exit the script/all scopes in sqf? thonk

#

i.e

if !(isNull objectParent player) then {
    _protection = [objectParent player] call KJW_fnc_protectionProcess;
    _random = random 1;
    if (_random < _protection) exitWith {systemChat "pee"};
};
systemChat "hi";
``` exits the entire script rather than just the `if` statement as it does here
granite sky
#

You can use breakout

sullen sigil
#

exitWith {break} works, had to specifically type in the url for break into the wiki on the off chance it was a thing

granite sky
#

It's a bit goto but sometimes preferable to "proper" methods.

sullen sigil
#

breakout there would make it do the "hi" systemchat wouldn't it?

granite sky
#

break specifically exits out of loops so it's a bit different.

#

With breakout you specify a scope to exit, so you can have scopename "main" at the top of the script and then breakout "main" will exit the whole script.

sullen sigil
#

Oh, I'd assume that it'd just breakout to the same scope the scopename is in

granite sky
#

that's breakTo

sullen sigil
#

ah gotcha

brazen lagoon
#

how exactly does the DESTROY waypoint work? a lot of the time if i give an ai helo a destroy waypoint they'll just ignore it.

#

conversely, the loiter waypoint seems to cause the helicopters to ignore enemies and just loiter around aimlessly..

granite sky
#

I think they still need to spot the targets, which they're quite bad at considering that they have a copilot with high-grade thermal optics.

#

I random-walk search & destroy waypoints for them and they usually find a target eventually.

#

If you want them to destroy a specific target then you could try a reveal.

sharp valve
#

Trying this but nothing seems to be happenjng

#

Et it to init space of a unit

#

Changed player to the unit name

#

The event does fjre

#

But nothing gets copued

#

Or sent in chat

#

Oh well, it wasn't working on my oc

sharp valve
#

Trying to use use this, any way to check where the shots are going to adjust the heights?

gaunt tendon
sharp valve
#

Or the Z axis shown in editor

#

Is there any way to trace its path??

#

Or any other simple way to do this

gaunt tendon
#

aimhght is relative to the target
muzhght is relative to the shooter

#

BIS_fnc_traceBullets traces bullet path but you need an actual shooter

gaunt tendon
sharp valve
#

I know them, but not sure how would I employ those

tough abyss
#

I will make something for you. Give me a bit.

#

This should (perhaps?) do the trick

#

small error, new version

#

should draw a red line along the trajectory of the bullet, much the same as BIS_fnc_traceBullets

tough abyss
#

can confirm the code works, on the caveat that the bullet actually successfully travels

shut gate
#

Very quick question: is there any way to make BIS_fnc_typeText display over the cutText/titleText black screen? or would I require some other sort of workaround to make the screen black?

#

(because currently the typeText seems to be a layer under the black screen)

copper raven
#

this would get you the ammo classname to use for createVehicle

tough abyss
open hollow
#

hello, i want to get the camera position of spectator, but for some reason cameraon its not working, there is a nother way?

warm hedge
#

Do you mean the local game's spectator's camera position, or someone else's?

warm hedge
#

Then positionCameraToWorld would help

open hollow
# warm hedge Then `positionCameraToWorld` would help

ive tryed but ask for a position

_posply = getpos player;
_poscam = getpos cameraon;
//this is the same pos

if i use positioncameratoworld:

>>getpos player 
[2583.07,9840.8,0]

>> positionCameraToWorld player;
error

>> positioncameratoworld getpos player;
[14.2896,10160,9844.12]
warm hedge
#

Huh wait, you're trying to get the spectator mode's current camera position right?

warm hedge
#

Then positionCameraToWorld [0,0,0]

open hollow
#

thankyou

warm hedge
#

It does happen when it does happen

astral bone
#

Is there not an event for when someone enters/exits the zeus interface?

hallow mortar
#

I don't believe so, but you can use a userAction EH to detect when they hit the Zeus button

copper raven
#

idd is 312 i believe, or you can filter by class, which should be RscDisplayCurator iirc

terse tinsel
#

why this script not workink for SP ?? "this enableStamina false" it worked a while ago 😦

copper raven
terse tinsel
copper raven
#

could be, yes

terse tinsel
cedar cape
#

will this script work cursorObject addWeaponWithAttachmentsCargo [["rhs_weap_XM2010_d", "optic_Tier1_LeupoldM3A_Geissele_Tan", "bipod_Tier1_Harris_Bipod_Tan", 1];?

#

ive tried putting it in and it says init missing ]

#

im not sure what ive missed out

terse tinsel
copper raven
copper raven
cedar cape
#

my bad i worded it wrong

#

i meant im not sure where ive missed it out

terse tinsel
#

ok

little raptor
#

according to wiki you're also missing several params for weapon config

cedar cape
#

rfip

little raptor
#

weaponConfiguration: Array in format [weapon, muzzle, flashlight, optics, primaryMuzzle, secondaryMuzzle, bipod]

cedar cape
#

how should it look?

#

the weapon doesent need any of those

copper raven
#

that message wasn't for you meowsweats

little raptor
#
cursorObject addWeaponWithAttachmentsCargo [["rhs_weap_XM2010_d", "", "", "optic_Tier1_LeupoldM3A_Geissele_Tan", [], [], "bipod_Tier1_Harris_Bipod_Tan"], 1];
cedar cape
#

thank you

little raptor
cedar cape
#

fuck

#

wait

#

no i have

little raptor
#

well it won't work in init ofc

cedar cape
#

but dont i put it in the init of the object i want the weapon to go in?

little raptor
#

it won't work like that

#

because of cursorObject

cedar cape
#

im actually so dumb

#

as soon as i re read the wiki i saw this

#

that it said container name

little raptor
#
if (!isServer) exitWith {};
this addWeaponWithAttachmentsCargoGlobal [["rhs_weap_XM2010_d", "", "", "optic_Tier1_LeupoldM3A_Geissele_Tan", [], [], "bipod_Tier1_Harris_Bipod_Tan"], 1];
#

use this

cedar cape
#

alr so

#

it spawns the gun but not the attachments

little raptor
#

are they even compatible with that weapon?

cedar cape
#

yeah

#

i got the names from the arsenal

sullen sigil
#

May be the command isn't compatible with CBA Rails -- though I would imagine it should be

#

Try with base game gun and attachment to check

little raptor
#

and paste the result here

cedar cape
#

[["rhs_weap_XM2010_d","","","Tier1_LeupoldM3A_ADM_Tan",["rhsusf_5Rnd_300winmag_xm2010",5],[],"Tier1_Harris_Bipod_Tan"],["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""]]

little raptor
cedar cape
#

wait

little raptor
#
if (!isServer) exitWith {};
this addWeaponWithAttachmentsCargoGlobal [["rhs_weap_XM2010_d","","","Tier1_LeupoldM3A_Geissele_Tan",["rhsusf_5Rnd_300winmag_xm2010",5],[],"Tier1_Harris_Bipod_Tan"], 1];
cedar cape
#

[["rhs_weap_XM2010_d","","","Tier1_LeupoldM3A_Geissele_Tan",["rhsusf_5Rnd_300winmag_xm2010",5],[],"Tier1_Harris_Bipod_Tan"],["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""]]]

#

there

#

i equipped the wrong scope

#

but all the names look the same

little raptor
#

no. the bipod and scope names were wrong

cedar cape
#

alr

#

works

#

oh yeah also, i want an objective that says "take the sniper rifle" is it possible to make it complete when the player takes said item out of the crab

jade acorn
#

you can either check if player has that weapon or if it was removed from the vehicle inventory, two ways

cedar cape
#

which script would i use

cedar cape
#

so it would be this addEventHandler ["Take", { params ["player", "weaponcrate", "rhs_weap_XM2010_d"]; }];

little raptor
#

put this in initplayerlocal.sqf

player addEventHandler ["Take", {
    params ["_unit", "_container", "_item"];
        if (_container == myCrate && _item == "rhs_weap_XM2010_d") then {
          
    ["myTask", "SUCCEEDED", true] call BIS_fnc_taskSetState
        };
}];
cedar cape
#

dont i put it in the condition of the task?

#

or smth

little raptor
#

no

little raptor
cedar cape
#

i see

little raptor
toxic tundra
naive needle
#

I have a question regarding hashmaps. I want to get the magazines inside a container summarised.
[["A3S_Item_Salt",1],["A3S_Item_Salt",1],["A3S_Item_Salt",1]]
To this:
["A3S_Item_Salt",1,3]

little raptor
naive needle
#
{
    _item = _x;
    _index = _list findIf {_x#0 == _item#0 && _x#2 == _item#1};
    if (_index != -1) then {
        _oldCount = _list#_index#1;
        _list set [_index,[_item#0,_oldCount+1,_item#1]];
    } else {
        _list pushBack [_item#0,1,_item#1];
    }
} forEach magazinesAmmoCargo cursorobject;```

Currently Im using this, but yea trying out to get it work with hash maps
#

When 1000 unique items are inside a container

#

For some reason extdb3 can't send long arrays to the database, atleast Im getting errors all the time

#

Thats why I need to count the items

little raptor
#
_list = [];
{
    _item = _x;
    _cnt = _list getOrDefault [_item, 0];
    _list set [_item, _cnt + 1];
} forEach magazinesAmmoCargo cursorobject;
#

if you want it in this format ["A3S_Item_Salt",1,3] then do:

_list = _list apply {flatten [_x, _y]};
naive needle
#
_list = createHashMap; 
{ 
    _item = _x; 
    _cnt = _list getOrDefault [_item, 0]; 
    _list set [_item, _cnt + 1]; 
} forEach magazinesAmmoCargo cursorobject;
_list = _list apply {flatten [_x, _y]};
_list```
#

Works good, thank you

#

1.55ms

little raptor
#

right I forgot to add createHashMap 😅

naive needle
#

other one is 3ms

#

so twice as fast now

little raptor
#

I wonder which one is faster think_turtle

naive needle
#

seems to be the same tbh

little raptor
naive needle
#

yea wasnt unique

sullen sigil
#
_obj1 = KJW_Source;
_objProtection = 0;
_objProtection = if (_obj1 isKindOf "CAManBase") then {
    [_obj1] call KJW_fnc_protectionProcess;
};
_uniformProtection = _objProtection#0;
_maskProtection = _objProtection#1;
_backpackProtection = _objProtection#2;
_objProtection```
KJW_Source is an object here and yet `_objProtection` is still returning as null 🤔 -- works fine for players
naive needle
#

I will try with unique items

little raptor
sullen sigil
#

Will it set it to nil if it's false?

little raptor
#

it returns nil if _obj1 is not CAManBase

little raptor
sullen sigil
#

Ah

#

then just need to get the variables scoped properly

copper raven
#

wat? has nothing to do with scoping here

fiery void
#

Hello there,
How to get player weight in kg? I'm using ACE3 mod.

sullen sigil
#

if _objProtection = 0 it wont work

#

and running an if for each variable isnt the smartest

little raptor
#
_obj1 = KJW_Source;
_objProtection = if (_obj1 isKindOf "CAManBase") then {
    [_obj1] call KJW_fnc_protectionProcess;
} else {0};
sullen sigil
#
_objProtection = if (_obj1 isKindOf "CAManBase") then {
    [_obj1] call KJW_fnc_protectionProcess;
}
else {
    0;
};``` is what I'm doing at the moment
#

Yeah, _objProtection is an array for the then and a number for the else

naive needle
little raptor
#

yep. told ya 😅

naive needle
#

🤣🥹

sullen sigil
#

I suppose I could use [0,0,0] and just have to deal with using uniform variables for vehicles meowsweats

copper raven
fiery void
drowsy geyser
#

im trying to disable the simulation for the triggers but i get an error that says:
error enableSimulation: Typ Array, expected Object

_allTrgs = nearestObjects [player, ["EmptyDetector"], 500, false];  
_allTrgs enableSimulation false;
stable dune
velvet merlin
#

is code execution inside the apply code block unscheduled?

little raptor
#

no

#

same as call

velvet merlin
#

ok thanks. cant quite make sense what i am seeing in the profiler

copper raven
sudden yacht
#

[player, "STAND1", "ASIS"] call BIS_fnc_ambientAnim; How would i use select random in this context to use for animations? Say i have STAND1 and SIT1.

sudden yacht
#

[player, selectRandom ["STAND1", "SIT1"], "ASIS"] call BIS_fnc_ambientAnim; cannot be? Oh it works. Ty

wary sandal
#

Mhmm, how do i make a given unit refrain from calling out contacts and speaking in general?

#

can i disable that with disableAI?

radiant siren
#

NEED HELP WITH:

Looking to spawn after death as a player in my current squad and to become squad leader?
(wanting to spawn as a different guy on my team after I die pretty much. doesn't have to be specific person, just random.)

sudden yacht
#

@wary sandal I think that's the only way. Can always re-enable the AI.

#

@radiant siren Attibutes/ Respawn. Then maybe using an event handler.

#

this addMPEventHandler ["MPRespawn", {
params ["_unit", "_corpse"];
}];

wary sandal
wary sandal
sudden yacht
#

@wary sandal I should have been more specific. That's what i ment. Wojtek le second.

boreal parcel
#

how would I grab the variable from a marker? currently im doing this

_zoneMarkers = []; 
{ 
  _x = toArray _x; 
  if(count _x >= 3) then { 
    _x resize 3; 
    if(toString _x == "AO_") then { 
        _zoneMarkers = _zoneMarkers + [_x]; 
    }; 
  }; 
} foreach allMapMarkers;
copyToClipboard str _zoneMarkers;

but it just returns this array

[[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95],[65,79,95]]
open fractal
#

why are you using toArray?

boreal parcel
#

unsure, code I grabbed online to try and quickly grab the markers since trying to copy them in the editor wasnt working. Im gonna try and write some new code to get the markers. All I want is the Empty markers

open fractal
#
if (_x select [0,3] == "AO_") then { _zoneMarkers pushBack _x };
#

what happened is you took the marker name, converted it to an array of numbers, resized it, and then appended the resized array of numbers instead of the marker name because your code overwrites _x instead of declaring a separate variable for the test

#

the code you copied must've been designed to resize a string before select took strings

boreal parcel
open fractal
#

you can't use == with an array and a number

#

that's not what you wrote here but count returns a number yes

#

yes it will get the variable then compare the array length with the number

sullen sigil
#

Anyone know if config actions allow while loops? Mine doesn't seem to be getting into it.

sullen sigil
# sullen sigil Anyone know if config actions allow `while` loops? Mine doesn't seem to be getti...
params["_obj1"];

//Variables
_objPos = getPosASL _obj1;
_dimensions = switch (true) do {
    case (typeOf _obj1 == "DeconShower_01_F") : {[1,1,2]};
    case (typeOf _obj1 == "DeconShower_02_F") : {[2,0.5,4]};
};
_dimensions params ["_posX", "_posY", "_posZ"];
//End variables
//Begin code
systemChat "ran";

while {_obj1 animationSourcePhase 'valve_source' > 0} do {
    systemChat "ran2";``` ran2 is never chatted
#

this works outside of the config one though thonk

open fractal
#

you're missing a bracket at the end

sullen sigil
#

chopped the code at the systemchat

#

It's much longer inside of the loop but calling the function through debug console works

#

spawning even

#

Ah, it wants a short sleep at the start for some reason 🤷

open fractal
sullen sigil
#

Indeed