#arma3_scripting

1 messages Β· Page 204 of 1

signal drum
#

I may be able to fix my issue

buoyant merlin
broken pivot
#

I probably found the last piece for my solution.
I was able to change the AA_Count value from my client machine.
So I managed this. But I noticed that my AA_Count allways resets to 0.
I started thinking and took a look about all moments when the script defines "0" as value

And I remembered that my script fires the randomGen again if there is no possabilty to
spawn in the selected objective. So it always gets new defined with 0 value so that the script
runs infity

#

You can see in my screenshot that Ive tried to only define it once and then skip
the part in the second launch because the If-Cause turns "false"

signal drum
#

I checked out the BIS function in the function viewer and the variable name keys in the docs are wrong

broken pivot
signal drum
#

Got it to work now, thanks and sorry for posting πŸ˜„

stable dune
broken pivot
#

LoL

#

I went back to send exactly this in

#

also thanks

signal drum
broken pivot
#

I dont have experience with getVariable

pallid palm
#

hello all: So on a hosted server: is the player the Server and also hasInterface with the Server: em i correct in saying this ?

hallow mortar
#

All servers are hosted. I assume you mean player-hosted, as in someone created a local server from the multiplayer menu.
In that case, the server machine is also a player machine, and hasInterface will return true if executed on that machine.
I think I've explained this before, but hasInterface does not mean "an interface with the server". It means the current instance of the game application is displaying a graphical interface (or not).

pallid palm
#

yes thats what i mean: and thxs you again Nikko

#

i didn't have anything go wrong, i was just woundering:

#

thx again

#

oh cool @thin fox

#

thx you m8

old owl
split ruin
#

addAction doesn't show up πŸ€”

private _action1 =
[
    "<t color='#80FF80'>Add Veles Crewman</t>",
    {
        _unit = veles createUnit ["O_R_JTAC_F", flg, [], 5, "NONE"];
        [_unit] joinSilent veles;
        addSwitchableUnit _unit;
        _unit setCustomAimCoef 6;

        comment "Remove existing items";
        removeAllWeapons _unit;
        removeAllItems _unit;
        removeAllAssignedItems _unit;
        removeUniform _unit;
        removeVest _unit;
        removeBackpack _unit;
        removeHeadgear _unit;
        removeGoggles _unit;
        comment "Add containers";
        _unit forceAddUniform "U_O_R_Gorka_01_camo_F";
        comment "Add items to containers";
        for "_i" from 1 to 4 do {_unit addItemToUniform "FirstAidKit";};
        _unit addItemToUniform "MiniGrenade";
        _unit addHeadgear "H_HelmetCrew_O_ghex_F";
        _unit addGoggles "G_Bandanna_Vampire_01";
        comment "Add items";
        _unit linkItem "ItemMap";
        _unit linkItem "ItemCompass";
        _unit linkItem "ItemWatch";
        _unit linkItem "ItemRadio";
        _unit linkItem "ItemGPS";
        _unit linkItem "NVGogglesB_blk_F";
        comment "Set identity";
        [_unit,"WhiteHead_02","male02rus"] call BIS_fnc_setIdentity;

        _unit setVariable ["BIS_enableRandomization",false];
        _unit setSkill 0.6;

        systemChat "A Crewman joined Veles!";

    },nil,1.5,false,true,"","true",2,false,"",""
];
[flg, _action1] remoteExec ["addAction",[0,-2] select isDedicated, flg];
stable dune
cursive tundra
#

can i use the path calculated event handler to force a group to move to a waypoint using the calculated path?
i want to make a unit take a more concealed path to an objective using a path calculated with "stealth" as the behaviour parameter & i want the group to follow this path but with behavour "Aware" (and best without messing up already established waypoints). Is that achievable?

torn jungle
#

yeah doesnt work. I disabled medical menu and revive. The basic ace wounding stuff still stays. So you cant even treat your injured body parts.

old owl
#

Hi guys, would anyone know where the P3D's used for players faces in the profile screen would be located? Have tried scrounging around configs but haven't had any luck

#

Ah wait might have just found one on the CT_OBJECT page

#

Okay yeah sorry appears I am good

buoyant hound
#

Hey
There is a problem about escape missions , where player must shoot about 20 or 30 shoot to kill ai!
Also a problem is bots moving like robots and like bad ping statement

Anyone can guide?

buoyant hound
#

Can i send you pm?@thin fox

thin fox
buoyant hound
#

Ok

buoyant hound
thin fox
#

any AI mods?

buoyant hound
#

No ai mods i think

thin fox
buoyant hound
#

No access now , i will send it tomarrow

drifting badge
#

Got a question in regards to decals - should one use createVehicle to create/place a lot of them via script or is it better to create them via createSimpleObject or maybe createAgent? Am not at all certain how placement of a lot of decal impacts performance and which would be the best/proper way to go. I should add that I did place everything via Eden so far, so this time I am trying to dabble in creating things via script.

winter rose
#

decals could be simple objects as they don't change over time

drifting badge
#

Thanks for the swift reply Lou! So I can/should use createSimpleObjectwhen creating/spawning/placing a decal (I do need the decals as they fit to the terrain automatically without any additional hassle).

Would be so great if we would finally get a usertexture decal of various sizes.

winter rose
#

same with grasscutters, they perform way better as simple objects

gleaming rivet
#

Ace medical is baked into ACE. You have to disable it fully to disable medical.

drifting badge
#

right so in case the decals do not adapt to the terrain ascreateSimpleObjectthen I should use createVehicle to spawn them? (will have to test tomorrow)

Oh did not know that grasscutters could be simple objects too! That is good to know!

winter rose
#

decals should adapt to the terrain even as simple objects, but I cannot certify it
otherwise yes, createVehicle

createAgent is for "simple AIs"

drifting badge
#

Ah got you! Thanks for clearing that up, the different "create" versions got me confused. Will test this tomorrow and let you guys know if the simple object thingy works with the decals ;)

gleaming rivet
#

If you have more questions, you can ask on the ACE slack.
There are no plans to make medical modular from the rest of ace, too many interdependencies.

torn jungle
#

Alrighto. Thanks!

ivory idol
#

not sure if this is the right playc but anyone know how to call a different skybox? im trying to do a halo campaign and theres only 4 halo maps and i want to just be able to change the skybox to say that we are on halo

warm hedge
#

You cannot through a script

ivory idol
#

would it be in the config then?

warm hedge
#

Yes

ivory idol
#

thanks

warm hedge
#

Ever seen a Mod that adds Halo ring

#

Can't tell which it was

ivory idol
#

operation trebuchet first contact

#

has 4 halo maps

#

ive found the .paa's used for the skybox but idk how they are called

hallow mortar
#

Hazard a guess it's the skyTexture property in CfgWorlds, but #arma3_terrain may be able to help you better

broken pivot
#

The GameDay is over and Im back into improving things.

Currently Im updating the script so it communicate correctly with the vars in their determining varspace.
But somehow the simplest thing isnt working. Im not able to define the publicVar. Even if Ive did it
like Ive always do it.

I attached you the error and the text location of it

warm hedge
#

Line 11 invalid quotation

#

Some to other lines, you are missing semicolons

broken pivot
#

Thats the most common issues I create. Working too early or too late haha

warm hedge
#

Also you really should to install at least a working syntax highlighter

broken pivot
#

You won

#

Finally

#

I agree

#

I will hit up a friend. He also got a highlighting for N++

hushed turtle
#

Also start using code blocks on Discord

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
hushed turtle
#

@broken pivot

drifting badge
#

@winter rose - Hey mate! Update from a few hours ago, tried to make the spawned decals (dirt patches) into simple objects but the weird thing is they "vanish" when I look straight at them and only show up when I looks straight down, at a medium distance from me or when I set the camera a bit back in 3rd person view), also the textures are blured (even if the scale is set to 1). So I guess I have to stick with createVehicle.

Btw. do I have that right that createUnit is just for spawning single AIs?

warm hedge
#

createUnit only spawns an AI, not multiple of

pallid palm
#

@thin fox you remember the thing, with us being player 10: insted of player 1: i found if you put player2 on the right of player 1: and player3 on the left of player 1: in Formation: and so on: back and forth: it seems to work better

#

@thin fox i was always putting player 2 on the left of player 1: i think this is why it was messing up

#

as soon as i put player 2: on the right of player 1: in Formation: it all worked great

broken pivot
#

# Hey there :D
Ive got a localization question :D

This is my script:

_marker1 = false;
_marker2 = false;

if ((getMarkerColor "capture_29") == "ColorOPFOR"            //hier "Capture_29" durch eigene Zonen austauschen
    ) then {
    _marker1 = true
    } else {
    _marker1 = false
    };

If the _marker1 is changed to the value "true" is the value tranmitted to the outer scope? So is the value also changed outside of the if-condition?
Or would I have to publish the value to the rest of the scope?

tender fossil
broken pivot
#

Im confused.

#

Because it wont work on the server

stable dune
broken pivot
#

Thats step 2/3

#

And I have the problem that the script dont pass in server enviroment but in Editor

stable dune
broken pivot
#

private !!!!!!!!!!!!!!

#

I totally forgot about that

#

But wouldnt it effect anything because that would lead into caging the var inside my if cause because that is the innermost scope in this case?

broken pivot
#

Because now I dont need a default value because the default value is already asked in the if cause, where it gets defined. Nice!

split ruin
#

how to make markers don't update for non existing players?

while {true} do
    {
        "kiba3x_mrk" setMarkerPos kiba3x;
        "bobcat2_mrk" setMarkerPos bobcat2;
        sleep 1;
    };
stable dune
# broken pivot Youve comprimised 20 lines in one haha

And you can check boolean in condition
_marker == true ,
!_marker == false,

So ->

//will continue if _marker1 or _marker2 isequalto false
if ((!_marker1 || !_marker2)
//if ((_marker1 || _marker2 || _marker3 || _marker4) == false
    ) then {
    "EBER\Erweiterungen\Luftabwehr\randomGen.sqf" remoteExec ["execVM", 2];
    systemChat "AA Nr1 <-> Not spawned";
};
//will continue if both _marker1 and _marker is true
if (_marker1 && _marker2) then {
....
}
old owl
odd ravine
#

Hey guys. I'm learning sqf and I have problem. Look, I wrote this script to create a marker that should appear only on my client. But when I tested it in multiplayer, the other client saw a black dot at the same position

private _markerName = format ["playerMarker_%1", getPlayerUID player];
private _marker = createMarkerLocal [_markerName, getPosATL player];

_marker setMarkerShape "ICON";
_marker setMarkerType "mil_dot";
_marker setMarkerColorLocal "ColorRed";
_marker setMarkerTextLocal name player;

Is there a way to make it completely local?

tender fossil
old owl
#

Ideally also making every prior command local will be more performant for network as well :)

tender fossil
old owl
#

Oh apologies I misread

tender fossil
#

So ```sqf
private markerName = format ["playerMarker%1", getPlayerUID player];
private _marker = createMarkerLocal [_markerName, getPosATL player];

_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "mil_dot";
_marker setMarkerColorLocal "ColorRed";
_marker setMarkerTextLocal name player;

#

If you miss the "local" appendix in any of the marker commands, it becomes instantly global

broken pivot
tender fossil
old owl
# broken pivot <@790272937994879047> thats a question for you

I'm not fully sure I entirely understand your question but if you're just wondering if private would make a variable out of scope if defined within an if statement, it will.

if true then {
  private _variable = true;
};
_variable // nil
private "_variable";
if true then {
  _variable = true;
};
_variable // true
broken pivot
#

Does someone got capacity to take a look at a screenshare?

#

So I gues not.

My current problem is that something wont work with my markers.
I gues that because the red marked areas arent getting passed.
Its all with the marker condition.

Works in the editor but not on the server. Like always...

tender fossil
#

Check the values of _marker1 and _marker2 with debug logging. And you can remove the == true part from the if clause

#

Oh I'm blind, you have the logging there already

broken pivot
#

true. Because the if cond is awaiting an true value

pallid palm
#

why so much scripting for markers seems like it should be way smaller

pallid palm
#

oh ok copy that

old owl
#

Or alternatively if it lets you fit it all in markdown
```sqf
```

broken pivot
thin fox
broken pivot
#

And its weird you dont understand that I use this for learning

pallid palm
#

yeah but its way easyer with collored text m8

broken pivot
#

Ill install highlighing if I stop doing letter issue

#

Its "learn the hard way"

pallid palm
#

thats not the hard way thats i omg this sucks way lol

broken pivot
#

Hahaha true
But in that way I learned it

pallid palm
#

i used to use ArmaEdit program but now VSCode is awsome m8

broken pivot
#

Milo writes

#

He got the script. So maybe he got some new intel.

old owl
pallid palm
#

ill telling you man collerd Text helps big time if you really want to learn

broken pivot
# old owl Are you able to describe your issue a little more? What do you mean by the red m...

Sooooo: ill update the msg
My script first picks (in randomGen.sqf) 3 random AA fortifications
Then it launches the activation.sqf (the sent script)

There it checks if the areas are red or blue (enemy/ player conquered)
After the are is red, it belongs to the enemy, its clear to spawn the AA with
the deformer, the patrouls, the Object ASL and so on

But: (now my issue)
The script isnt launched in server enviroment with also headless clients

old owl
#

Or that there aren't any script errors on server? Are you able to send the file of where the markers are handled?

broken pivot
#

I havent. But it works in editor.

pallid palm
#

why are you using headless client

broken pivot
old owl
#

Oh wait you might have already sent earlier

#

Let me take a look at some of your previous pastebins 1 sec

broken pivot
#

The .rpt of the server isnt in the time Ive used the script

old owl
#

If you want it to be launched for headless clients, you will need to specify that in remoteExec as well as 2 is just server

broken pivot
thin fox
broken pivot
#

So in our case 5 times

  • Server
  • Client
  • HC1
  • HC2
  • HC3
broken pivot
old owl
#

AI can be a crutch but syntax highlighting is just saving your sanity

#

If you're wanting to learn you're not disadvantaging yourself by using syntax highlighting. If anything you're giving yourself larger opportunity to see where potential problems are. This is currently how it looks with my Visual Studio Code extension.

broken pivot
#

Ok kids Im getting a highlight

#

Can we focus again?

stable dune
broken pivot
#

negativ

old owl
#

Are you able to send the file where you create your markers?

#

Plus the name of what it is called

broken pivot
#

Scripts:

1/3: https://pastebin.com/euxMJUeY randomGen
2/3: https://pastebin.com/VfvCiNVR spawnCheck
3/3: https://pastebin.com/FiskmQHM playerInteraction

broken pivot
old owl
#

Are you sure that's it's file name?

broken pivot
#

Its ErstelleAufgabe.sqf

#

"CreateTask.sqf"

#

In line 19. Sorry for that language gap. You couldnt know that

old owl
#

It's okay, that's your native language πŸ™‚

#

Just to confirm, is it that you are wanting these markers to be visible to all players?

broken pivot
#

All people recommend to write in english but I argue with "My vars wont collapse with common english words" πŸ˜„

broken pivot
hushed turtle
broken pivot
pallid palm
#

im still not sure what your what to happend with them markers

broken pivot
#

Sad

#

I explained it now 4 times

pallid palm
#

yes ok

broken pivot
#

The markers are there to check if the player conquered the area because the markerColor changes

thin fox
pallid palm
#
getmarkercolor "marker1" == "colorBlue"
broken pivot
broken pivot
pallid palm
#

copy that

hushed turtle
broken pivot
#

Got it earlier but you cant force people by ignoring what they say. I would like to stay with N++

pallid palm
#

im sorry again: but what r you saying that's not happening for you in your script

broken pivot
#

I dont understand what you mean

pallid palm
#

yeah what's not working in your script

broken pivot
#

Now Ive got you πŸ˜„

broken pivot
broken pivot
valid abyss
#

hey, im trying to learn about multiplayer scripting and i have a few questions:


    private _h = _unit getVariable ["MRPH_forceSprint_Handle", nil];
    // Ensure _h looks like a script handle before scriptDone
    if (!isNull _h && { typeName _h isEqualTo "SCRIPT" } && { !scriptDone _h }) then {
        terminate _h;
    };

_h is a scripthandle, but when i check if it is defined it gives an error saying _h is undefined and i dont understand why

second question is how do I safely exit a loop?
exitWith {}; on its own gives an error.
Thanks

broken pivot
#

@old owl do we have some news? Im really in a mess this time haha

hallow mortar
# broken pivot Scripts: 1/3: https://pastebin.com/euxMJUeY randomGen 2/3: https://pastebin.com...

The way your Boolean (true/false) checks are written is a bit clunky. For example, you have this:

if ((_marker1 || _marker2) == false) then```
and similar structures. But think about it: `||` and `==` both return booleans. So you're making a boolean that reports on the status of another boolean. It's pointless - just use the first result.
```sqf
if !(_marker1 || _marker2) // succeed if neither is true
if (_marker1 || _marker2) // succeed if either is true```
broken pivot
old owl
thin fox
broken pivot
broken pivot
thin fox
stable dune
#

Good πŸ‘

broken pivot
pallid palm
#

@valid abyss ```sqf
if (whatever you want) exitWith {whatever you want};
//or
if (!alive player) exitWith {};

thin fox
hushed turtle
broken pivot
old owl
# broken pivot <@306893295211118592> do we have some news? *Im really in a mess this time haha*

Honestly I am still just having a really hard time understanding the logic enough to find where the problem is. It appears you're executing those marker commands as global, so really not sure why you'd be having an issue unless there is some sort of logic issue. Kind of just difficult to look into when I don't exactly understand the order of operations, what files are beign ran, etc. I would just continue to debug and make sure that all of your conditional stuff is hitting the way you're expecting it to

valid abyss
old owl
broken pivot
#

Good call πŸ˜„ Also really relatable. The more I learn the more I see the mess...
Ill dm you

valid abyss
old owl
valid abyss
old owl
#

Maybe give this a whirl

    private _h = _unit getVariable ["MRPH_forceSprint_Handle", scriptNull];
    // Ensure _h looks like a script handle before scriptDone
    if (!isNull _h && { typeName _h isEqualTo "SCRIPT" } && { !scriptDone _h }) then {
        terminate _h;
    };
#

Although if it is being spawned in an order prior than expected then the above could still produce issues if not addressed

#

This would really just prevent it from ever being undefined

broken pivot
#

@old owl ive DMed you

tender fossil
valid abyss
hallow mortar
old owl
tender fossil
old owl
# valid abyss this works, thank you!

You're welcome! Again though just be cautious of what I had there though. If it is an issue with the script not being spawned before it actually runs, you might still run into issues with unintended behavior. To resolve this you would likely just put some sort of uiSleep before your if statement if you run into issues with that later down the road πŸ™‚

valid abyss
broken pivot
#

@old owl did you have seen that I tried to send you a DirectMessage?

pallid palm
#
//what condition is your condition in
private _condition = (!alive Helo2 || !canMove Helo2 || !alive Pilot2);
//systemChat str _condition;
if (_condition) exitWith {
    deleteMarker "mkr_LZ2";
    SAA_mapPosition = nil;
};
#

| | = and or

signal frigate
#

cost

winter rose
signal frigate
#

oh

#

nvm

#

i was using the wrong thing

#

I was trying to figure something out, the cost vs threat targeting system

#

Cause i noticed AI doesnt use the Vorona launcher at all anymore, no matter the target

#

And in general i experimented a bit with vehicle AI and the way AI chooses what to target needs some improvement

#

Couldnt find much in the search bar

winter rose
#

even without mods?

split ruin
#

how to check if unit is driver, gunner or commander in vehicle ?

_unit == driver _veh
stable dune
#

You could give more content, where do you want to check it and when

thin fox
oblique arrow
#

Hey peeps is there a singular command that can return all items inside a crate/vehicle or do I have to use the different commands and combine the result?

tulip ridge
#

Different

split ruin
#

@stable dune

_veh addEventHandler 
[ 
  "GetIn", 
  {
    params ["_vehicle", "_role", "_unit", "_turret"];
    if (_unit == driver _vehicle || _unit == gunner _vehicle) then
    {
      if ( headgear _unit != "H_HelmetPilotHeli_O" ) exitwith
      {
        _unit action ["Eject", vehicle _unit];
        systemChat "You are not Pilot!";
       };
     } else {};
    }];

I had success, only "pilots" (units with heli pilot helmet can get in as pilot or gunner)
And in the mission I am making you can get "pilot training" along with pilot gear that allows you to fly helis and jets - for a price (score points). The idea is to make pilots expensive asset and make player want to save their pilot - ejecting, crash landing, etc. And to make pilot rescue actually vital tactic.

pallid palm
#

hello all: if i have this marker selectRandom
How do i make sure it selects a different one each time the script is run
or can i Delete the one it picked from the list so it can pick a New one the next time

_mrk = selectRandom ["C1","C2","C3","C4","C5","C6","C7","C8","C9","C10","C11","C12","C13","C14","C15","C16","C17","C18","C19","C20"];
granite sky
faint burrow
#
markers = [...];

// ----

_index = floor (random (count markers));

_mrk = markers select _index;

markers deleteAt _index;
pallid palm
#

oh nice Awsome m8

#

wow thats so cool

granite sky
#

_mrk = markers deleteAt floor random count markers :P

pallid palm
#

really cool man thx

granite sky
#

deleteAt returns the value that was deleted. Which is handy.

pallid palm
#

yes i see really cool

#

thx guys @faint burrow @granite sky

pallid palm
#

Ohhh Hell Yeah: WooHoo: Works like a Charm: guys thx soooooo Much: WooHoo Arma 3 @faint burrow @granite sky

#

OMG It Works So Good: thx again Guys i Love you Guys @faint burrow @granite sky

radiant lark
#

Hey there, do you guys know of any EH that I can use for all my terrain objects so when they get damaged I can repair them every once in a while? (Doesn’t matter if I have to override the object’s config)

Objective: a little cleanup script to save me some performance, and to also clean JIP Queue a bit

broken pivot
#

I think I cant help you there but got an problem on my own.
Somehow my condition turns false when it should be true.

Im checking 2 markers if there color is "colorOPFOR" (both have) but my condition
turns false...

If I check them one by one, my output is true.

Maybe you see or know something I dont

small gyro
#

Is it possible to make an **ammo_Missile_Cruise_01 ** (cruise missile from VLC) rocket fly to its target using the **setMissileTarget **command so that it uses its flight profile (cruise one)? Or maybe someone know how would be better to do that ?

warm hedge
#

Yes, you can use a laser target to make it guide to somewhere

small gyro
warm hedge
broken pivot
#

wait what

#

Isnt || and/ or?

warm hedge
#

It can't be both

#

|| is or

broken pivot
#

But thats okay. In that case it means that the AA wont spawn until one of both marker isnt colorOPFOR anymore

warm hedge
#

To simplify true || false == false is true || true because false == false has priority AFAIK

broken pivot
#

Okay so thats good to know lol I dont know where Ive catched that... But in that case its still what I need because one not red marker is enough to not spawn the AA

small gyro
warm hedge
#

laserTargetW / E / G IIRC

broken pivot
#

The problem is that he selects the first case if both markers return "true" so if they are colorOPFOR

#

Here Ive checked both markers and they return "true".

small gyro
#

Aww....Yeah, u r right. But **setMissileTarget ** have some condition to using, right ? Like the missile has to be in the cone of target or smt like that

dusk gust
warm hedge
#

Do you mean (not _marker1 && not _marker2)

broken pivot
#

Ill need to read a few more times

warm hedge
small gyro
broken pivot
warm hedge
radiant lark
small gyro
warm hedge
#

?

warm hedge
#

A laser target cannot lock a laser target?

dusk gust
broken pivot
#

Its because Im covering both cases. So I would need to create another scope to pack the anwser

radiant lark
small gyro
broken pivot
small gyro
#

So missile should hit this laserTarget. Guided ammo should be able to hit any surface or object if its see the laser here. Even just a surface if there is a laser on it

broken pivot
warm hedge
#

See also, fireAtTarget

small gyro
# warm hedge See also, fireAtTarget

its good but for case if ammo wasn't created yet. In my case i'm firing a one projectile object and changing it "on the fly" to cruise missile. And it should hit pos that i want (which one i'm also configuring on the fly)

#

but your knowledge about laserTargetW helps, rly. Didn't find that in wiki

radiant lark
stable dune
dusk gust
radiant lark
broken pivot
warm hedge
small gyro
# warm hedge Yes

unfortunately missile flies directly to target and ignoring any obsticle (like a hills). Its not using its own cruise fly profile
that's all what i'm doing with it:

private _target = "LaserTargetE" createVehicleLocal _targetPos;
private _successful = _projectile setMissileTarget _target;

btw _successful returns true if it matters

dusk gust
thin fox
#

is there a way to get the config path by the classname only?

dusk gust
radiant lark
granite sky
warm hedge
#

Well true point anyways

granite sky
#

BuildingChanged still works.

thin fox
radiant lark
small gyro
granite sky
#

I don't think BuildingChanged applies to trees, only models like houses that have ruins and/or partially destroyed models.

radiant lark
#

Shoot

granite sky
#

So maybe it's no good for your case. You'd have to test whether any of the killed EHs fire the second time around.

#

(fire with correct parameters)

radiant lark
#

Yeah my issue is with those models that just give up and fall onto the ground. It’s bad for performance and even worse for my eyes

granite sky
#

Is it bad for performance?

warm hedge
granite sky
#

Like once they're done falling

radiant lark
# granite sky Is it bad for performance?

I think so? I don’t really know but I guess it’s an entry on JIP Queue and over the time with multiple objects breaking and falling it might cause a little lag though

granite sky
radiant lark
#

Tryna find out the key parts to making my server less redundant on restarts, and achieve a similar outcome than the one you get from restarts but via SQF

granite sky
#

Now if you know whether it's a weapon/item, magazine or backpack through other means then you can certainly look the thing up.

thin fox
dusk gust
small gyro
# warm hedge How do you actually run the code then? Entire code?
this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

    [{
        params ["_unit", "_projectile"];

        private _pos = getPosASL _projectile;
        private _velocity  = velocity  _projectile;
        private _vectorDirAndUp = [vectorDir _projectile, vectorUp _projectile];

        if (!isServer) exitWith {};

        private _projectile = createVehicle ["ammo_Missile_Cruise_01", [0,0,1000], [], 0, "FLY"];
        _projectile setPosASL _pos;
        _projectile setVectorDirAndUp [_vectorDirAndUp#0, _vectorDirAndUp#1];
        _projectile setVelocity _velocity;

        _targetPos = _unit getVariable ["aslPosOfTarget", []];

        private _target = "LaserTargetW" createVehicleLocal _targetPos;
        private _successful = _projectile setMissileTarget _target;
    }, [_unit, _projectile], 3] call CBA_fnc_waitAndExecute;
}];

Technically i'm replacing one missile with new one bc i need its cruise profile

thin fox
# granite sky Now if you know whether it's a weapon/item, magazine or backpack through other m...

I have this script, and some times _name is returning empty for some items, like some of the CUP ones, and I find out that they are in a different config path

    {   
        private _name = "";
        private _picture = "";
        if ((_x isKindOf ["Default", configFile >> "cfgWeapons"])) then {
            _name = getText (configfile >> "CfgWeapons" >> _x >> "displayName");
            _picture = getText (configFile >> "CfgWeapons" >> _x >> "picture");
        } else {
            _name = getText (configfile >> "CfgMagazines" >> _x >> "displayName");
            _picture = getText (configFile >> "CfgMagazines" >> _x >> "picture");
        };
        private _amount = (_allCount # _forEachIndex);
        if (_name isEqualTo "") then {_name = _x};
        private _rowIndex = _control lnbAddRow ["", _name, str(_amount)];
        _control lnbSetPicture [[_rowIndex, _itemsPics], _picture];

        _control lnbSetData [[_rowIndex, _itemsColumn], _x];
        _control lnbSetValue [[_rowIndex, _itemsAmountColumn], _amount];
    }forEach _crateAllItems;
meager granite
#

An easier and better way to check would be isClass(configFile >> "CfgWeapons" >> _x)

warm hedge
#

In this context you need to check type etc to find it is a CfgMagazines or CfgWeapons or CfgGlasses or CfgVehicles

warm hedge
#

At least I recall it is possible

small gyro
warm hedge
#

Maybe, maybe not

#

We'll see in 6 hours

small gyro
#

Sure. If u don't mind i'll ping u here in case u will forget

warm hedge
#

Sure

meager granite
#

setMissileTarget does engine checks for target validity

granite sky
meager granite
#

But since recently you can bypass that with alt syntax

warm hedge
#

In this context it is valid

#

Oh rly?

meager granite
#

munition setMissileTarget [target, force]

#

Also don't scripted laser targets delete after a few seconds?

warm hedge
#

Oh 2.18. Does that mean I can, let's say use Macer to take down a soldier target?

small gyro
meager granite
meager granite
#

Does it exist for cruise missile? If not, you'll have to do your own

#

Probably move that laser target in front of the missile for desired profile

small gyro
#

which works fine if u r using MK41 VLS

#

but in this case i want to spawn it on the fly and tell it to hit a target (flying over obstacles)

meager granite
#

Hmm, perhaps its triggered by the engine on actual fire

#

Haven't touched any of this myself

#

What entity does the firing?

#

You can add VLS missile weapon and magazine with 1 ammo, do the fire then delete it

small gyro
meager granite
#

Didn't it also have some cruise missile already?

small gyro
#

Yeah but its using performance-intensive script. RHS team wrote it in years when there was no cruise missile profiles

meager granite
#

My guess is that you need missile fired from an entity for these profiles to work

#

For a test try just adding VLS weapon and magazine to it?

small gyro
radiant lark
#

https://community.bistudio.com/wiki/Arma_3:_Simple_Objects -> Simple objects are ideal for decorative objects in situations where fully simulated and destructible objects are not required or we can sacrifice full simulation and destruction of some objects to get some performance improvements.

Can that be done from within TB or some config directly?

stable dune
small gyro
broken pivot
#

Also || = and/ or
@warm hedge

warm hedge
#

It is not and or. It is or

broken pivot
#

Both of my markers are "colorOPFOR" so _marker1 and _marker2 got the value "true"
Then Im checking if one or both _marker is "true" and receive the value "false"
dafuq

Please explain for a monkey

meager granite
#

You shouldn't get false if either or both are true there, how do you even check it?

broken pivot
#

I check with the else cause and the system Chat

broken pivot
#

as you can see at the screenshot

warm hedge
#

Then probably both markers don't exist in the client that runs the script

broken pivot
#

hmmmm

#

thats a new perspective

#

Arent marker names always global?
I havent even thought about because

small gyro
meager granite
#

How do you change marker colors?

broken pivot
meager granite
#

Markers and their colors/texts/etc. can be local

broken pivot
#

How could I find and publish the marker to the rest of my machines?

granite sky
#

You call any non-local set function on that marker.

meager granite
#

The better idea would be to find out what these markers represent and use that as condition instead of markers

granite sky
#

but yeah, don't pass information to SQF via markers. That's icky :P

broken pivot
granite sky
#

but any global set function on a marker broadcasts all information about that marker. Hence common creation code looks like this:

_mrkFinal1 = createMarkerLocal [format ["Arty%1", random 100], _pos];
_mrkFinal1 setMarkerShapeLocal "ICON";
_mrkFinal1 setMarkerTypeLocal "hd_destroy";
_mrkFinal1 setMarkerColor "ColorBlack";
#

If all the commands were non-local then it would broadcast all the information four times.

broken pivot
meager granite
#

Find the code that changes marker colors in Liberation to see what it does

broken pivot
meager granite
buoyant hound
#

Hi
I see somewhere player shoot ai and in some pos of screen damage recived and name of bot who is player target
That was good with some display effect
Any guide?

meager granite
#

But yeah you'll need a function that properly checks sector ownership rather than relying on UI info like marker color

broken pivot
#

But it only returns "TEST". That is prepared for the cause of an independant sector lol

Look at line 30 in the script
Ive used the example Ive writen down in there

meager granite
meager granite
broken pivot
#

Previous? Why?

#

Ive also tried the "getNearestSector" function but it also returns only the kind of name of the marker that Ive already using in my script

meager granite
broken pivot
#

Thats also a cool idea. So I would build in another step that checks for a minimum distance to the player.
If this boolean fails the random genarator goes in again. So I could build up more dynamcly formed focus points

#

Im into testing with multiple preset functions of Liberation. But they are all not exact what I need.
I would combine some of them and would start with the F_getSectorOwnership to receive the current owner of predefined
capture zones in the near of the AA fortification I would like to spawn in.

Ive used the red_underlined code from my screenshot
The problem about is that I only receive "TEST" as return value...

But "TEST" value is defined for the resistance fraction, as you can see in line 30

buoyant hound
#

How i can build a text hint style
For fade in and out with typer effect
I need use it for show damage recived by shoot

meager granite
harsh vine
#

hello, Is it possible to add a player respawn cooldown on a specific respawn position? For example, if a player respawns at base, prevent him from using that base again for 30 seconds. (I'm using BIS_fnc_addRespawnPosition)

calm basalt
#

im trying to do some basic elint sandbox stuff with the editor in the contact dlc, is there any documentation anywhere on how the radio stuff works? ive got the ability set up to place down a basic transmitter and have the player be able to detect it, but i cant for the life of me work out how to set up any more complex antennas (like the ldf base, or antennas on squads for deception). Theres clearly scripts there to set this stuff up like initAISquad, and preInitEM but its totally undocumented

#

surely in the 5 years since this dlc came out someones gone though this ane made like a really basic scenario, right?

calm basalt
dire island
#

This may be a bit out there, but I might as well ask:
I am trying to use the tracer module from Zeus Enhanced in a script instead of manually plopping it down from zeus in order to choreograph a large firefight.
I've tried calling it directly ([test1, "LMG_Mk200_F", "200Rnd_65x39_cased_Box_Tracer_Red", [0, 1, 2], 2, test2] call zen_modules_fnc_moduleTracers;), and I've tried de-pbo:ing the module and putting the code in an SQF (manually assigning the QGVAR). In both cases, the invisible gunner spawns, but he only ever fires a single round towards the target. There are no players nearby to trigger {allPlayers findIf {_gunner distance _x < 100} == -1}, so that's not the issue.
Any ideas?

still forum
#

VoN is getting eventhandlers

thin fox
radiant lark
#

Is setVariable going to accept an array of player objects on β€œpublic” param?

#

Like remoteExec

radiant lark
# thin fox wdym?

I was tryna setVariable on an array or nearby players and it couldn’t be done

#

.

thin fox
#

just do the easy way

#

don't create problems

#

it's not going to affect the performance

radiant lark
thin fox
radiant lark
#

client sided, yeah

thin fox
#

what is SP_69 is going to do in your framework?

radiant lark
#

matter of fact I did delete it because I found another solution

#

it was supposed to be set to true whenever the player was speaking

thin fox
radiant lark
#

This helped me

radiant lark
thin fox
radiant lark
#

yeah but apparently owner command is only giving a valid return value when server sided

thin fox
#

it depends on how you set up your scripts

hollow stirrup
#

Just thought Id show something off for a change rather than asking for help

Developed a cool new feature im not entirely sure i've seen before. With these swing gates you can shoot out the two locks when they are locked via 3den/zeus (When the variable: bis_disabled_Door_x where x = door index number is set to 1) and once both are shot out the door pops open slightly to let you know its unlocked

https://gyazo.com/963c24a0512d2473eb1d41119b6ddb07

radiant lark
#

I wanna do smth similar with houses. I wanna make the doors slowly open whenever they get shot at

buoyant cairn
#

player addEventHandler ["FiredMan", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
if(_unit == _vehicle) then {
if(_unit ammo _muzzle == 0) then {
_unit addMagazine _magazine;
};
};
}];

#

Does this code works for vehicles as well?

warm hedge
buoyant cairn
hallow mortar
#

if(_unit == _vehicle) then {
This will never return true and so your code will do nothing.
_unit is the unit the EH was added to. If they are not in a vehicle and they fire their own weapon, _vehicle contains objNull and so your == returns false. If they are in a vehicle and they fire the vehicle weapon, _vehicle is the vehicle they are in, but _unit is still the unit the EH was added to and so your == returns false.

buoyant cairn
#

So i'd have to add a EH to the vehicle separately

hallow mortar
#

That is one way to do it but it's not the only way. You could also modify this EH so that it works with vehicles as well. The problem is the code inside the EH, not how the EH inherently works.

#

It depends how you want it to behave. An EH on the vehicle is attached to that vehicle. It's specific to that vehicle; if you want to work on all vehicles, you'll have to add an EH to each of them. An EH on the unit is attached to that unit. You could use such an EH to affect any vehicle that unit gets into, and also affect the unit itself when outside any vehicle.

pallid palm
#

sounds perfect to me: nice Nikko: very good and clear info

buoyant cairn
granite sky
#

(getBackpackCargo is CfgVehicles, for completeness)

#

If you merge the results into one array then you're losing valuable info.

thin fox
thin fox
#

I'm doing something like this:

    (getMagazineCargo _crate) params ["_magsArray", "_magCount"];  // [["5MagsType1","10MagsType2"],[5,10]]
    (getWeaponCargo _crate) params ["_weaponsArray", "_weapCount"]; // [["a", "b"], [3, 2]]
    (getItemCargo _crate) params ["_itemsArray", "_itemCount"]; //  [["5ItemsType1","10ItemsType2"],[5,10]]

    private _crateAllItems = _magsArray + _weaponsArray + _itemsArray;
    private _allCount = _magCount + _weapCount + _itemCount;
#

but now is working fine, I just added one more config check for Glasses

round hazel
#

Hey folks!

Trying to get a screen to display a score, held in variable '_Score'. Using this code:

screen setObjectTexture ["Screen_1", "#(rgb,512,512,3)text(0,0,""Caveat"",0.3,""#0000ff7f"",""#ff0000"","_Score")"];

But I cannot figure out for the life of me how to get my '_Score' string variable to be displayed, due to the funky """" formating Any ideas?

stable dune
round hazel
#

Already attempted that, but I believe I may have formatted the script wrong, as I get a 'missing ]' error. How do I fit that into

screen setObjectTexture ["Screen_1", "#(rgb,512,512,3)text(0,0,""Caveat"",0.3,""#0000ff7f"",""#ff0000"","_Score")"];
```?
stable dune
#

So double "" or ' in " "

round hazel
#

I'll give it a go, but Wiki disagrees

#

And the provided wiki example works fine

stable dune
#

Well it seems I missed that, sorry, througt there was a normal "issue" with quoting,
But did you get your _score shown?

round hazel
#

With this variant it displays the given text 'Hello'

galleryScreen setObjectTextureGlobal [0, "#(rgb,512,512,3)text(1,1,""PuristaMedium"",0.3, ""#000000ff"",""#ffffff"", ""Hello"")"];

With this variant there is an error (Missing [) just before 'format'

galleryScreen setObjectTextureGlobal [0, "#(rgb,512,512,3)text(1,1,""PuristaMedium"",0.3, ""#000000ff"",""#ffffff"", "'format ["%1",_score];'")"];

With this variant there is an error (Missing [) just before '#(rgb,')

galleryScreen setObjectTextureGlobal [0, "#(rgb,512,512,3)text(1,1,"'PuristaMedium'",0.3,"'#000000ff'","'#ffffff'", "'format ["%1",_Score]'")"];

Apologies for the slightly different script; The main bits are the same, I just edited variable names and stuck a 'Global' on setObjectTexture. I don't believe this changes anything, as the top line still works.

stable dune
round hazel
#

Ahhhhhhhh, I understand. I hadn't thought to treat the whole thing as one big string. I'll test it out, cheers!

#

Sweet, works as intended. Cheers!

#

In case others wish to do something similar in future, here's my full code. Put it inside the 'Hit' event handler.

private _score = (galleryScreen getVariable ["_score", 0]) + 1;
galleryScreen setVariable ["_score", _score];
galleryScreen setObjectTextureGlobal [0, format["#(rgb,512,512,3)text(1,1,""PuristaMedium"",0.3,
            ""#000000ff"",""#ffffff"", ""%1"")", _score]];

galleryScreen is the screen you wish to display the score on. Critiques of my method welcome.

broken pivot
#

Gooood morning!
Im into remoteExec (my worst nightmare)
I still need to practise this more and need to find more out.

So Im here to ask you how I remoteExec an "createMarker" command global for everybody.
I dont know if Ive did the order syntax right, I basicly just packed the whole command in an string

cosmic lichen
#

In the future you can check the commands locality on the biki

broken pivot
#

But Ive now got the problem that I cant see the marker after creating it like Ive did on the
screenshot Ive attached to my message.
Also the camera drive wont happen. I think "remoteExec" will help me a lot in this case

meager granite
#

Dont just remoteExec without an exact reason why you need it

broken pivot
#

Good call

#

I think it can go out of controle fast

#

But why cant I see the createMarker wich executes itself global automaticly

meager granite
#
  1. You didn't execute it
  2. You already have a marker with same exact name
#

If you create marker with same name again I think it just gets ignored

broken pivot
#

If I copy the part of my script and launch it in server debug:
Server -> Nothing
Global -> Marker

Thats what confusing me

weary ice
#

Remove the 1 at the end of the line

broken pivot
#

The creator?

weary ice
#

Actually let me ask this, do you want everyone to see the marker or only specific players/sides?

#

If you want everyone to see it, then yeah just remove it

broken pivot
#

I want to bring it up to the BLUFOR players

weary ice
#

Ah, and this script is being executed by who?

broken pivot
#

By a further script wich launches this one in server space

weary ice
#

I believe it being executed as server with the creator of 1 is your issue.

#

Iirc 1 indicated the creator is side, meaning it is visible to all players on the side of the person executing the script

broken pivot
#

Were wrong

#

Were talking about the channel. Its placed in side channel.

#

There is no creator defined. Im using default creator lol

weary ice
#

Lol, my 3AM brain is failing haha

broken pivot
#

btw check your dms

#

But why is my global command not visible if I execute it in server space?

hallow mortar
# broken pivot

This one? Probably because when executed on the server, the side channel is for...I dunno, sideLogic or something, so you don't see it. When executed globally (on every machine), there are many copies, and at least one of them was created on your machine, where the side channel belongs to your side and you have access to it.

slow inlet
#

does anyone know why this wouldn't be able to close the inventory with tab. awhile ago I found a post on the forums I think that had a console debug script to close the inventory with tab but i cant find that post any where prob cause the forums are down so im left to make my own. this code was generated with chatgpt but it does work for all other keybinds but TAB any help would be nice.


waitUntil { !isNull findDisplay 46 }; // Wait for main display 
 
    (findDisplay 46) displayAddEventHandler ["KeyDown", { 
        params ["_display", "_key", "_shift", "_ctrl", "_alt"]; 
 
        // Tab key (key code 15) 
        if (_key isEqualTo 15) then { 
            if (!isNull findDisplay 602) then { // 602 = Inventory display 
                (findDisplay 602) closeDisplay 2; 
                hint "Inventory closed"; 
            }; 
        }; 
        false 
    }];
stable dune
#

And if you search "arsenalOpened" from this community, you will find some examples that other ppl has done

faint dragon
#

Hi, is there a script to paradrop any vehicle on the map ? Even with the crew if possible

fair drum
restive hinge
#

Hey guys, not sure if this is the right channel, but I've been struggling with a weird issue - whenever I make edits to the mission scripts they're not recompiled at runtime for whatever reason.
I tried saving multiple times, but the only thing that could help - resaving missions with a different name, copying all the scripts and running it in 3den. I'm not sure if it's a bug with Arma or some mod. Did anyone happen to have this kind of issue?

#

Basically what happens is Arma runs the last iteration of the script and whatever changes I make to the script are ignored

cosmic lichen
#

Is the mission folder in a cloud drive?

restive hinge
#

Nope, local

#

Also if I wait long enough in the editor - it eventually runs the up-to date scripts

cosmic lichen
#

How do you run the script?

restive hinge
#

Trigger

cosmic lichen
#

execVM?

restive hinge
#

Yep

cosmic lichen
#

Can you check with loadFile if the content is up to date?

restive hinge
#

Seems to be up to date in 3den

cosmic lichen
#

Then it should work.

split ruin
#

I have problems with object (repair station) jumping around at the beginning of the mission, sometimes it moves around 10 m until it stops, wtf πŸ˜΅β€πŸ’« map is Sefrou Ramal

restive hinge
#

Running loadFile later (about 2 minutes later) shows correct content

#

Making an edit and immediately checking with loadFile shows correctly

#

It seems there are times when Arma can't keep up with edits, very weird

slow inlet
# rain void Add EH to display 602, not 46.

like this?

waitUntil { !isNull findDisplay 46 }; // Wait for main display

    (findDisplay 602) displayAddEventHandler ["KeyDown", {
         params ["_display", "_key", "_shift", "_ctrl", "_alt"];

        if (_key isEqualTo 15) then {
            if (!isNull findDisplay 602) then {
                (findDisplay 602) closeDisplay 2;
                hint "Inventory closed";
            };
        };
        false
    }];
winter rose
#

also the nullcheck is useless πŸ™‚

slow inlet
#

this better? it returns -1 in debug console

waitUntil {findDisplay 602 }; // Wait for main display

    (findDisplay 602) displayAddEventHandler ["KeyDown", {
        params ["_display", "_key", "_shift", "_ctrl", "_alt"];

        if (_key isEqualTo 15) then {
            if (findDisplay 602) then {
                (findDisplay 602) closeDisplay 2;
                hint "Inventory closed";
            };
        };
        false
    }];
warm fern
#

waitUntil {!isNull (findDisplay 602)};

winter rose
#

something like that```sqf
waitUntil { !isNull findDisplay 602 }; // wait for main display
(findDisplay 602) displayAddEventHandler ["KeyDown", {
params ["_display", "_key", "_shift", "_ctrl", "_alt"];

if (_key isEqualTo 15) then
{
    _display closeDisplay 2;
    hint "Inventory closed";
};
false;

}];

slow inlet
#

still getting -1 on return

thin fox
slow inlet
#

inventory

rain void
#
player addEventHandler ["InventoryOpened", 
{
    [] spawn {
        waitUntil { !isNull findDisplay 602 };
        (findDisplay 602) displayAddEventHandler ["KeyDown", {
            params ["_display", "_key", "_shift", "_ctrl", "_alt"];
            private _handled = false;
            if (_key isEqualTo 15) then
            {
                _display closeDisplay 2;
                _handled = true;
            };
            _handled;
        }];
    };

}
];
slow inlet
thin fox
#

but Weiss' code is better structured

winter rose
blissful current
#

I need to put a pause in between these two functions. Would sleep be the best choice like so?

if (alive _leader && _leader != _scout && _leader in units playergroup) exitWith {     
    ["playersspotted", [_leader, _scout]] remoteExec [    
        "FoxClub_fnc_Conversation",    
        allPlayers select { _x distance _leader <= 100 }    
    ];
sleep 5;
    if (_leader distance _scout <= 100) then {
    ["bombplantedScout", [_scout]] remoteExec [    
        "FoxClub_fnc_Conversation",    
        allPlayers select { _x distance _scout <= 100 }    
    ];    
};  
};
winter rose
blissful current
winter rose
#

then it is scheduled πŸ™‚

blissful current
#

Happy days!

cosmic reef
#

is any1 able to assist me with this issue

#

if needed i can stream and show you the other scripts i have

austere granite
#

Does anyone here have any experience creating respawn templates with adding to the normal menu system that menuInventory and menuPosition use?

winter rose
#

well, it's pretty clear
it says the function is not defined

cosmic reef
#

could it be something named improperly

winter rose
#

the files seem good, it could be a lack of config

cosmic reef
#

could you elaborate

austere granite
#

http://i.imgur.com/wXmOnWi.png adding extra tabs to this with custom systems is what I mean. Or just a gamemode that already does something like that. I'm trying to do it myself now and I can't figure out why the hell it doens't work.

winter rose
#

did you define them in CfgFunctions?

cosmic reef
#

ah

#

see

#

that might be the issue

#

sorry for wasting ur time

#

😭

winter rose
#

:D

cosmic reef
#

thanks

#

@winter rose 1 more question

#

i promise

#

is this viable

winter rose
#

I… think so?

cosmic reef
#

k

#

badass

#

thank you again

winter rose
cosmic reef
#

yep it should work

#

thanks

#

i completely forgot the bistudio site existed

versed trail
#

after long enough you begin to become a wiki dependent

blissful current
#

I need this condition to work on a dedicated server. What could I use instead of player?

if (player != (_this#0)) then { playsound "talkradio"; };
winter rose
blissful current
thin fox
winter rose
#

BIS_fnc_listPlayers may interest you yes

#

that + remoteExec

blissful current
#

Which of these two options is preferable if so?

winter rose
#

allPlayers can return headless clients, BIS_fnc_listPlayers returns all player units

thin fox
winter rose
#

(alive or dead though)

#
private _allPlayers = call BIS_fnc_listPlayers;
_allPlayers - [_this select 0];
["talkRadio"] remoteExec ["playSound", _allPlayers];
thin fox
blissful current
#

Oh I see now. So if I want to do it without the bis_function, can I do it?

allPlayers - [_this select 0];

Btw the function is already remoteExec so this might double up things?

["generalfled", [HQRadio, leader playergroup]] remoteExec ["FoxClub_fnc_Conversation"];
#

So I think this will be remoteexec

if (allPlayers - [_this select 0];) then { playsound "talkradio"; };
winter rose
#

wat

blissful current
#

Lol I'm doing a poor job of explaining the full picture.

winter rose
#

the function is already remoteExec
then you have params ["_unit"]; available right?

blissful current
#

maybe not? Here is the function

params ["_convo", "_speakers"];

{
    _x setVariable ["foxclub_var_isTalking",true];
} forEach _speakers;

private _conversationData = foxclub_var_conversations get _convo;
{
    _x params ["_speakerIndex","_text","_sound", ["_delayAfter", 0], ["_customCode", {}]];
    private _speaker = _speakers select _speakerIndex;
    if (isNull _speaker) then { _speakers spawn _customCode; sleep _delayAfter; continue };
    if !(alive _speaker) then { break };
    _speakers spawn _customCode;
    private _sound = _speaker say3D _sound;
    _speaker customChat [FOX_DialogueChannel, _text];
    _speaker setRandomLip true;
    waitUntil {isNull _sound};
    _speaker setRandomLip false;
    sleep _delayAfter;
} forEach _conversationData;

{
    _x setVariable ["foxclub_var_isTalking",false];
} forEach _speakers;
#

I'm having a hard time explaining because I don't fully understand it myself. It something NikkoJT wrote for me. I'll just mess around with it. I think one of the options yall gave will get me there.

blissful current
# winter rose ```sqf private _allPlayers = call BIS_fnc_listPlayers; _allPlayers - [_this sele...

I'm testing this in SP right now (will do MP later) and it's not filtering out the player it should. So then I changed it to

private _allPlayers = call BIS_fnc_listPlayers;
_allPlayers - [leader playergroup];
["talkRadio"] remoteExec ["playSound", _allPlayers];

But it's still playing the sound talkRadio for me. And I'm the leader of playergroup, so shouldn't I be removed from _allPlayers?

tulip ridge
#
  • / - return new arrays, not modify them in place
winter rose
#

long time I did SQF apparently πŸ˜„

#
private _allPlayers = call BIS_fnc_listPlayers;
["talkRadio"] remoteExec ["playSound", _allPlayers - [_this select 0]];
blissful current
winter rose
blissful current
#

I was told I can't use player on a dedicated server.

#

But maybe that's just for conditions? And not code elsewhere?

hallow mortar
#

You cannot use player on the dedicated server machine because the DS machine has no player unit. It just returns objNull.
You can use player on player clients that are connected to a dedicated server. They have player units and player will return their player units when executed on the clients.

winter rose
#

listen to NikkoJT
he has a wiki account

blissful current
#

Ahhh this is going to help so much. Thank you all!,

crisp cairn
#

Hey all - I was wondering if there is a smart way to return if a player is being shot at

granite sky
#

Like I said, if you're using that then you're doing it wrong.

#

The config of the item is already known from where you get it from.

thin fox
#

not using it, I just found out

granite sky
#

Never try to do this with backpack/weapon, because they actually do collide in some modsets.

#

magazine/weapon probably never does.

thin fox
#

okay, thanks for the advice

#

Yeah, I'm going to use it in all sorts of items

granite sky
#

why :/

thin fox
#

oh sorry, not native speaker here haha I'm not going to use it*

granite sky
#

item/weapon => CfgWeapons, magazine => CfgMagazines.

thin fox
#

I'm going to script a thing for all sorts of items I mean

thin fox
crisp cairn
thin fox
frigid oracle
#

how can i use nearEntities to find nearby corpses in a radius? syntax 3 doesn't seem to have radius.

granite sky
#

you'd pass in [pos, radius, radius] as the left-hand parameter.

#

not necessarily faster than starting from allDeadMen, although I don't know if that's a fast command.

frigid oracle
granite sky
#

yeah but you can do allDeadMen inAreaArray [pos, radius, radius]

#

And inAreaArray is fast.

frigid oracle
#

are you able to make an area in code rather than editor?

granite sky
#

like that, yes.

frigid oracle
#

Ohh I see

finite bone
#

Anyone has any sample code / reference for an audio (playMusic / playSound3D) being jip compliant? (i.e. the jip player must hear the audio based on the audio's runtime and not from the beginning)

hushed turtle
placid root
#

so I have a small question to. Does this work the intended way? -> init.sqf : isHC = false; if (!hasInterface && !isServer) then {isHC = true}; -> some script that gets called global : if (isHC or {isServer}) then {hint "yay"};

#

so when a hc is present only hc will execute it. if a hc is not present only the server executes it. client never executes it?

earnest ether
#

I'm looking for a solution to the problem that the settings for group indicators and friendly name tags are active on the dedicated server, but I don't want them to be displayed on my client. i tried something with a config mod but that is not a good solution. when i switch the settings the change is instant active so i thought a3 would save this maybe into a variable inside the uiNamespace and check this every frame to choose to display group indicators and nametags but i did not found anything in uiNamespace, localNamespace, profileNamespace. Anybody has an idea how this could be solved? thank you

cosmic lichen
#

Difficulty settings are engine driven sadly.

austere granite
#

Problem was adding new template and showing it in the same, not using one of the existing templates. Was testing MP though and description.ext didn't reload properly apparently so that ended up being the problem

placid root
#

ok sorry. didn't get your question right ^^

earnest ether
#

i'm not ready yet to accept that i can not solve this with sqf but maybe i have to stick with my config solution. Thank you R3vo for your reply

austere granite
#

@placid root In the bit you posted the server would also execute it whenever there is a HC present.

placid root
#

ok. i thouht the conditions are met as soon as ishc is true.

#

and {isServer} will never be called

austere granite
#

Actually that's a good point ye

foggy pike
#

Function for executing stuff on HC id present or server if not: ```/*
Author: Kingsley
Description: Execute given code on either the headless client or on server depending on which is present
Parameter(s): CODE - { ... } or string code
Returns: Spawned code handle
Example _handle = { hint "Ran on HC" } call ARC_fnc_execHC;
*/

if (typeName _this != "STRING" && typeName _this != "CODE") exitWith { diag_log "The argument(s) specified in ARC_fnc_execHC are not of type STRING or CODE." };

private "_handle";

_handle = _this spawn {
private "_code";
_code = if (typeName _this == "STRING") then {compile _this} else {_this};
if (!isNil "HC" && isMultiplayer) then {
if (!isServer && !hasInterface) then {
call _code;
};
} else {
if (isServer) then {
call _code;
};
};
};

_handle

#

requires HC unit to be called HC

austere granite
#

kingsley quicktip

_this isEqualType ""

is faster then typeName _this == "STRING"

foggy pike
#

ah okay cheers

austere granite
#

New command.

foggy pike
#

So rather than putting something like STRING or ARRAY you just put the actual thing like "", [], 0?

austere granite
#

Yes

foggy pike
#

Alrighty

austere granite
#

player isEqualType objNull

placid root
#

and my stuff does not work?

austere granite
#

@placid root on the server isHC would be false, meaning that it would still check isServer which is true, so it would still execute no matter what.

placid root
#

damn you're right ...

austere granite
#

You need a check on the server if the HC exist, kingsleys isNil "HC" does that, but you can also use something like

if (!hasInterface && !isServer) then { hcPresent = true; publicVariable "hcPresent"; };
#

In case you don't have named HC

#

if ((!hasInterface && !isServer) || {hcPresent}) then { };

#

Obviously you gotta make sure you only execute that after the HC had a moment to set the variable, so just naming it and using kingsley function should do whatever you want

placid root
#

puhh ok. give me a minute to get through the code πŸ˜›

austere granite
#

okay edit doesn't work. need !hcPresent && isServer in the bit i send :p

blissful current
#

I was checking my mission for dependencies and found this CBA - Joint Ammo Magazines. What did I do to have this dependency?

hallow mortar
#

You had CBA loaded and your mission.sqm contains weapons it modifies

blissful current
hallow mortar
#

You don't use it to modify weapons, it's part of what the mod does. It changes weapon config to add its common magazine wells; this means the weapon has CBA as a dependency while it's loaded.

#

If your mission uses ZEN, then your mission will require CBA anyway and you shouldn't worry about removing this dependency.

granite sky
#

Normally Zen is a thing you use for testing/admin, not a mission requirement. In that case just manually delete the dependency from the SQM file.

#

Oh, mission needs to not be binarized.

#

I vaguely recall CBA adding some other shit too though.

#

Like script snippets.

blissful current
#

ZEN isn't listed as a dependency for me in this list. I just use it for testing.

#

If I don't use CBA for anything in the mission I figured why have it?

granite sky
#

Save mission without binarization, open as text file, search for CBA.

#

At least they tag everything properly :P

blissful current
granite sky
#

yeah I remember that one.

split ruin
#

upload script message is constantly showing, cannot use Discord normally

blissful current
#

So my solution is before I publish the mission just load into the editor without CBA and save as, then Im good?

granite sky
#

shrugs

#

The setCallsign code doesn't actually introduce a dependency.

#

If the function doesn't exist then it just runs setGroupID instead.

#

So it sounds like manually stripping the dependencies out of the SQM should be easy enough.

blissful current
#

Am I to understand you mean to delete all these mentions in the .sqm? Then open the file in the editor and see if there's a dependecy like in my screenshot?

granite sky
#

You can leave the setCallsign ones.

#

The actual dependency is stored in addons[] near the top. But if you remove that then you'll need to remove the related items too or something will break.

blissful current
#

Okay thanks. As Nikko said it seems CBA is just modifying while it's loaded. I didn't actually do anything with the weapons. So in this case it sounds like I should be OK.

split ruin
#

are dead players existing objects ? πŸ€”

granite sky
#

corpses are objects. And entities.

split ruin
#

yeah but if corpse disappear before respawn?

granite sky
#

Then the player probably doesn't have an object. Test it.

blissful current
#

I've been updating my holdAction conditions now to use toString, but some of my old ones are working just fine with code in the string part

"_this in (crew _target) && !scubaEquipped && ActionSCUBA",

Why did the below not work, but the above does?

(missionNamespace getVariable ['ActionSTABTimeBombs', false]) && (vehicle _caller != ptboat)
hushed turtle
#

Like JSRS always adds itself as dependency while it's not required at all

blissful current
#

Now that I remember more I think CBA is needed for EdenEnhanced. That's probably why I load it.

#

I don't even know if Im using the features it has but a tutorial I watched a year ago said it was a good idea.

split ruin
#

@granite sky tested, seems like players are always !isNull

thin fox
blissful current
#

The second example gave me an error "code, expected string" or something like that IIRC. It's like if I use some code it'll work but not too much lol. Im sure that's not how it works but I can't explain it otherwise.

thin fox
#

check the last rpt file for silent/masked errors

stable dune
#

Because you are using _caller in condition , which is not present in condition params.
conditionShow: String - (Optional, default "true") condition for the action to be shown. Special arguments passed to the code: _target (action-attached object), _this (caller/executing unit)

blissful current
#

So I can write whatever code I want in there except _caller?

hallow mortar
#

No, there are other limitations. You can't use any other variables that aren't defined in that context. You can't use suspension. Your code must eventually return true or false.

#

Not being able to use _caller isn't some special "you can't use a variable named _caller" rule, it's literally just that no variable named _caller is automatically created, and your code assumes one exists.

blissful current
#

Is this the best way to write this? I noticed that code B is repeated, so I thought maybe there is a way to restructure it?

if (conditionA) then {
    // code A
} else {
    // code B
};

if (conditionB) then {
    // code C
} else {
    // code B
};
hallow mortar
#

That's what functions are for

blissful current
#

So make a function are place code B in it?

#

Its only like 10 lines of code if that matters

hallow mortar
#

If it's going to be used elsewhere as well, you can make a full function for it.
If it's only used here, you could use a private variable. The function won't be available to other scripts, but you won't need to do CfgFunctions.

#

But why is code B repeated in this system? What if conditionA is false AND conditionB is false? Is it meant to be run twice?

blissful current
#

The best would be if conditionA is met to exitwith all of it. But I need that else for conditionA.

blissful current
#

So one of them should fire.

#

But thats why I wish I could use exitwith because if conditionA fires then no need to run condition B.

tulip ridge
#

Or just use a switch, assuming you don't want codeB to run twice

#
switch (true) do {
    case conditionA: { codeA };
    case conditionB: { codeC };
    default { codeB };
};
hallow mortar
#

If you've only got these two conditions and B can be discarded if A fires, you can also try putting B inside the else for A

hearty plover
#

Guys, the hashmapObject is a bit ridiculous.

#
_class_a = createHashMapFromArray [
    ["#type",["a"]]
];

_class_b = createHashMapFromArray [
    ["#base",_class_a],
    ["#type",["b"]]
];

_class_c = createHashMapFromArray [
    ["#base",_class_b],
    ["#type",["c"]]
];

(createHashMapObject [_class_C,[]]) get "#type";
//["c","b","a"]
(createHashMapObject [_class_C,[]]) get "#type";
//return ["c","b","a","b","a"]
#

If #type is an array, every time I create a hashmapObject, it will stack on top of the previous ones like described above.

#

But if #type is a string, rpt will write some garbage information.

#
Bad conversion: array
 βž₯ Context:     [] L81 (DBUG\functions\console\exec\fn_exec.sqf)
    [] L81 (DBUG\functions\console\exec\fn_exec.sqf)
    [] L16 (new_1.sqf)
 <-     [] L23 (/DEV_TOOLS/functions/general/fn_addSchd.sqf)
    [] L76 (DBUG\functions\general\EHs\fn_eachFrame.sqf)
    [] L65 (DBUG\functions\general\EHs\fn_eachFrame.sqf)
    [] L68 (DBUG\functions\general\EHs\fn_eachFrame.sqf)
    [] L77 (DBUG\functions\console\exec\fn_exec.sqf)
    [] L80 (DBUG\functions\console\exec\fn_exec.sqf)
blissful current
#

In my case they both shouldnt be true. But what would happen if they are? Code B runs twice?

hallow mortar
blissful current
hallow mortar
#

Look at the structure. There is a case for when each condition is true, and then a default case. Under what circumstances do you think a default case might be used?

blissful current
#

Always?

hallow mortar
blissful current
#

Oh it's like a backup if none fire.

blissful current
fair drum
hallow mortar
#

What are you actually trying to do here that's not covered by a single if else?

hearty plover
# fair drum Base needs to be deep copied or your member variables will be combined with pare...

Very effective! I’ve got another question.
How do I override a base class method?

_class_a = createHashMapFromArray [
    ["#type",["a"]],
    ["@method",{}]
];

_class_b = createHashMapFromArray [
    ["#base",_class_a],
    ["@method",{
        // Can't get #base here
        private _base = _self get "#base";
        private _baseMethod = _base get "@method";
        call _baseMethod;
    }]
];

Like in the example above, I can't access #base, so I had to write it like this:

_class_a = createHashMapFromArray [
    ["#type",["a"]],
    ["@method",{
        systemChat "parent";
    }]
];

_class_b = createHashMapFromArray [
    ["#base",_class_a],
    ["_base",_class_a],
    ["@method",{
        private _base = _self get "_base";
        private _baseMethod = _base get "@method";
        call _baseMethod;
        systemChat "children";
    }]
];
#

Is there really no way to directly access #base? This feels a bit messy.

hearty plover
#

Maybe it's because the data type of #base is an array or hashmap. Since arrays are mutable collections, could #base be hidden for that reason?

#

Can't be made final like a hashmap with compileFinal.

hushed turtle
hearty plover
fair drum
hushed turtle
#

Hmm, maybe #base just causes child object to have all pairs from parent rather than storing parent object in #base

fair drum
#

Also, I would not have any local hash objects if making systems with them. I would treat them globally for easier reference elsewhere later

hushed turtle
#

If all pairs from parent were in #base then you would have to use get twice to do anything with them

#

So overriding means removing original value

hearty plover
#

Alright, looks like there's no other way then.

#

I'm using it to write UI controls.

#
    ["_newindex",0],
    ["_isShowing",true],
    ["@toggle",{
        FLOG("toggle");
        private _isShowing = GPROP("_isShowing");
        SPROP("_isShowing",!_isShowing);
        METHOD("@resize");
    }],

    ["@addChildCtrl",{
        params ["_childCtrl"];
        private _result = _this call BASEMETHOD("@addChildCtrl");

        if !(_result) exitwith {false};

        METHOD("@resize");
        true;
    }]
    ```
hushed turtle
#

Just to be clear I'm guessing how it may work. So it may not be true

blissful current
# hallow mortar Wait, why is this even a thing that needs multiple conditions and shit? It shoul...

Because mainly I want the leader group to say the voice line. He is American and speaks English. But there could be a situation where leader group ends up being scout. Like, if someone dies, then now the scout is leader group. The scout is Vietnamese and speaks broken English, and has different voice lines.

When I do the voice recording, it wouldn't make sense to have the scout saying American voice lines. So I have an if statement for all the convos to filter out if the scout is speaking or the American.

But since players can be separated on the map. I need a backup in case the scout or the american aren't in the area. In that case who says the line is chosen randomly from units in the trigger area.

#

There are 8 total characters but its would be too hard to give them each their own personality and such. So I scoped it down to two characters. American leader and scout. Sure, it would break continuity to have the leader's voice be switching between 7 americans (based on who is the leader of the group) but it's the best compromise I can think of.

hallow mortar
#

You can do this with if structures and you don't need to have any duplicate code. You just need to think about it logically.
There are a few ways you could implement it; here's one:

private _units = units _group inAreaArray ...; // some inAreaArray to find who's in the area
private _speaker = selectRandom _units;
private _convo = "americanLines";
if (_scout in _units) then {
  _speaker = _scout;
  _convo = "vietnameseLines";
} else {
  if (_american in _units) then {
    _speaker = _american;
  };
};
[_convo, _speaker] call fox_fnc_convo ... // I don't remember the exact syntax for this but you know what it is```
blissful current
#

I think I have a use for something like this, even if it's not exactly what Im trying to do in this specific case.

hallow mortar
#

It is exactly what you just told me you're trying to do in this specific case :U

blissful current
#

I'm probably explain myself poorly. I will modify your code then I think it will be more clear.

blissful current
# hallow mortar It is exactly what you just told me you're trying to do in this specific case :U

Here's what I got so far. This should prioritize the american leader for the voice line. Then give it to the scout if he's not there. And finally give it to a random american if either the american leader or scout arent present.

private _units = units _group inAreaArray ...; // some inAreaArray to find who's in the area
private _speaker = selectRandom _units;
private _convo = "americanLines";
private _americanLeader = leader playergroup;

if (_americanLeader in _units) then { 
    _speaker = _americanLeader;
} else {
if (_scout in _units) then {
    _speaker = _scout;
    _convo = "vietnameseLines";
  } else {
    // code to somehow choose an unit that isnt the leader or scout
    _convo = "americanLines";
  };
};

[_convo, [_speaker]] remoteExec [    
    "FoxClub_fnc_Conversation",    
    allPlayers select { _x distance _speaker <= 100 }    
];
#

I already see some issues here. I'll try it again.

#

Nevermind Im stuck.

hearty plover
#

You can use speaker to return the unit's voice class name, like "male01ENG", and then you'll know what voice they originally used.

hallow mortar
#

Go back and read the original code again

hearty plover
#
private _speaker = ...
    
private _speakerClassName = tolower speaker _speaker;
private _convo = 
    switch (true) do {
        case "eng" in _speakerClassName :{
            //speak english
        };
        case "fre" in _speakerClassName :{
            //speak freach
        };
        default {...};
    };

[_convo,_speaker] call ...
hallow mortar
blissful current
#

Ok I'll read it again. I modified it because I thought it's not going to do what I wanted. Let me look again. It seemed to me preference was given to the scout instead of he american leader.

hallow mortar
blissful current
#

Okay I see now that it finds the unit I want it to in the else portion. So if the _americanLeader is in area, he would get the line. What I dont see is a case where his line is given to anyone else in the area should he (or scout) not be present.

#

Oh wait. I might get it.

#

If the leader is not in the array, then its given to a random unit in the group?

#

No nevermind that wouldnt happen because the condition can only be true if the american leader is in the area array

#

Yeah, I'm stumped.

hallow mortar
#

Follow each reference to _speaker and see under what circumstances it can change, and what it changes to

blissful current
#

Ok. Doing now.

#

🀯 If neither condition is true, then the original private _convo = "americanLines"; runs along with private _speaker = selectRandom _units;
So then the function calls a random unit to say the american line!

#

And it wont be the scout or leader else one of the conditions would have fired!

#

Wow, I'm impressed with how you and others here seem to think in different dimensions.

#

Okay so now I will clean it up to give preference to the leader. And try to complete the array check.

#

Here is the code now.

_scout = missionNamespace getVariable ["scout", objNull];   
_leader = leader playergroup;
private _units = units playergroup inAreaArray pilot_trigger; // why not inArea? I've used that one before.
private _speaker = selectRandom _units;
private _convo = "americanLines";

if (_leader in _units) then {
    _speaker = _leader;
} else {
  if (_scout in _units) then {
    _speaker = _scout;
    _convo = "vietnameseLines";
  };
};

[_convo, [_speaker]] remoteExec [    
    "FoxClub_fnc_Conversation",    
    allPlayers select { _x distance _speaker <= 100 }    
];
hallow mortar
# blissful current Here is the code now. ```sqf _scout = missionNamespace getVariable ["scout", obj...
_leader = leader playergroup;

You said sometimes the scout could be the group leader. If the scout is the group leader, this will result in them being picked even if the American is available but not the leader.

why not inArea? I've used that one before
Look up inArea and inAreaArray and see what the difference is between how they work. It should be easy to see why inArea is not appropriate for this use.

blissful current
#

Oh right, so I need to filter out the scout:

_scout = missionNamespace getVariable ["scout", objNull];   
private _allPlayers = call BIS_fnc_listPlayers;  
_playergroup = _allPlayers - _scout;
_leader = leader _playergroup
private _units = units playergroup inAreaArray pilot_trigger;
private _speaker = selectRandom _units;
private _convo = "americanLines";

if (_leader in _units) then {
    _speaker = _leader;
} else {
  if (_scout in _units) then {
    _speaker = _scout;
    _convo = "vietnameseLines";
  };
};

[_convo, [_speaker]] remoteExec [    
    "FoxClub_fnc_Conversation",    
    allPlayers select { _x distance _speaker <= 100 }    
];
hallow mortar
# blissful current Oh right, so I need to filter out the scout: ```sqf _scout = missionNamespace ge...
_playergroup = _allPlayers - _scout;
_leader = leader _playergroup;```
You can't do this. `leader` returns the leader of a _group_. It's not for using on arbitrary arrays of units. Who do you think is the `leader` of an array?
If it matters which American you pick, you need to identify the priority American specifically and reference them specifically. Stop hanging onto `leader` if the group leader could be someone else.
If it doesn't matter which American you pick, then this could be substantially simpler.
blissful current
#

Thematically, it makes sense for the group leader to be saying these lines. That person controls the AI so they are a leader of sorts anyway. Also, by choosing the leader of the group it adds some continuity.

Since I have 100's of lines, it wouldn't make much sense for a random American in the squad to be barking orders throughout the mission. But if it's always the leader of the group then it kind of makes sense, even if the leader gets tossed around a time or two during the mission.

So I could specifically say the leader is _leader = missionNamespace getVariable ["commander", objNull];
But then I open a can of worms if the leader has changed by the time the code runs.

#

If I'm hitting the limits of what the system can do then I accept that and randomization is what's left.

hallow mortar
#

If it's more important that it be the group leader than that it not be the scout, then _leader = leader playergroup is fine

#

If the scout is the group leader, it will prefer the scout (because they are the group leader).
Your original phrasing made it seem like there was a specific "leader" character, separate to the mechanical group leader, who should be prioritised. If that doesn't really matter then that's not an issue.

blissful current
#

Yeah its fine for the scout to be the group leader. All do is give them unique voice lines. I just dont want the voices line to get crossed up if that makes sense. If he is the leader he has to say his line.

blissful current
hallow mortar
#

OK then we just...

_scout = missionNamespace getVariable ["scout", objNull];   
_leader = leader playergroup;
private _units = units playergroup inAreaArray pilot_trigger;
private _speaker = selectRandom _units;
if (_leader in _units) then {
    _speaker = _leader;
} else {
  if (_scout in _units) then {
    _speaker = _scout;
  };
};
private _convo = ["americanLines", "vietnameseLines"] select (_speaker == _scout);
[_convo, [_speaker]] remoteExec [    
    "FoxClub_fnc_Conversation",    
    allPlayers select { _x distance _speaker <= 100 }    
];```
thin fox
hallow mortar
thin fox
blissful current
#

Im trying to break this line down private _convo = ["americanLines", "vietnameseLines"] select (_speaker == _scout);

hallow mortar
blissful current
#

ima go read select brb

#

Okay I get that. But if the first if condition isnt true speaker isnt defined and would throw an error

#
_scout = missionNamespace getVariable ["scout", objNull];   
_leader = leader playergroup;
private _units = units playergroup inAreaArray pilot_trigger;
private _speaker = selectRandom _units;
if (_leader in _units) then {
    _speaker = _leader;
} else {
  if (_scout in _units) then {
    _speaker = _scout;
  };
};
private _convo = ["americanLines", "vietnameseLines"] select (_speaker == _scout);
[_convo, [_speaker]] remoteExec [    
    "FoxClub_fnc_Conversation",    
    allPlayers select { _x distance _speaker <= 100 }    
];
hallow mortar
blissful current
#

Ima test this now. I think it's gonna work!

#

Wait I can make this more complicated! Now there can be a response to the _speaker.

_scout = missionNamespace getVariable ["scout", objNull];   
_leader = leader playergroup;
private _units = units playergroup inAreaArray pilot_trigger;
private _speaker = selectRandom _units;
private _responder = _scout;

if (_leader in _units) then {
    _speaker = _leader;
} else {
  if (_scout in _units) then {
    _speaker = _scout;
    _responder = _leader;
  };
};
private _convo = ["americanLines", "vietnameseLines"] select (_speaker == _scout);
[_convo, [_speaker, _responder]] remoteExec [    
    "FoxClub_fnc_Conversation",    
    allPlayers select { _x distance _speaker <= 100 }    
];
hallow mortar
#

Or what happens if the responder (be it the scout or the leader) is outside the area, or worse, outside the range used for the remoteExec targeting?

blissful current
#

Oh yeah I would have to do a _leader distance _scout <= 100 check so it makes sense they are talking to each other.

#

Still working on your first question

#

Okay so for the first question the scout would end up speaking to the scout. Not good.

#

As for the second question then if the responder is outside the range of the remoteexec then it looks like hes talking to no one.

#

And if I put that distance check somewhere then _responder could be nil or objnull in the remoteexec which would throw an error

blissful current
#

Ok heres an idea. Would it be possible to find the opposite of _speaker? Then that could be responder?

fair drum
#

I think you shouldn't get an error if you target objNull in remoteExec. I think it will silently fail. Or you should have checks to make it silently fail.

blissful current
#

Okay like defining it as objNull before in case of never being definded through the conditions?

#

Whew, my brain is fried. Ima sleep on this and hit it again tomorrow!

fair drum
#

you still putting this on github?

placid root
#

`//init.sqf
hcPresent = false;
if (!hasInterface && !isServer) then
{
hcPresent = true;
publicVariable "hcPresent"
};

//in a script executed global
if ((!hasInterface && !isServer) || {!hcPresent && isServer}) then { };
/*
hc present
hc -> true
server -> false
client -> false
hc not present
server -> true
client -> false
*/`

#

this should work, i think

hearty plover
# hearty plover Very effective! I’ve got another question. How do I override a base class method...

Regarding the implementation of calling super methods in hashmapObject:

_class_A = createHashMapFromArray [
    ["#type","A"],
    ["@method",{
        params ["_whatever"];
        systemchat str _whatever;
    }]
];

_class_B = createHashMapFromArray [
    ["#type",["B"]],
    ["#base",_class_A],
    ["__base",_class_A]
];

_class_C = createHashMapFromArray [
    ["#type",["C"]],
    ["#base",_class_B],
    ["__base",_class_B],
    ["@method",{
        params ["_whatever"];
        private _currPrototype = _self;
        private _types = _currPrototype get "#type";
        for "_i" from 0 to (count _types) - 1 do {
            if !("__base" in keys _currPrototype) exitWith { diag_log ("method not exist")};
            private _cache = (_currPrototype get "__base");
            _currPrototype = _cache;
            if !("@method" in keys _currPrototype) then {continue};
            breakWith (_this call (_currPrototype get "@method"));
        };
    }]
];

Could also be defined as a macro:

#define SUPER_METHOD(_method)\
    private _currPrototype = _self;\
    private _types = _currPrototype get "#type";\
    for "_i" from 0 to (count _types) - 1 do {\
        if !("__base" in keys _currPrototype) exitWith { diag_log ("method not exist")};\
        private _cache = (_currPrototype get "__base");\
        _currPrototype = _cache;\
        if !(_method in keys _currPrototype) then {continue};\
        breakWith (_this call (_currPrototype get _method));\
    };\


_class_C = createHashMapFromArray [
    ["#type",["C"]],
    ["#base",_class_B],
    ["__base",_class_B],
    ["@method",{
        params ["_whatever"];
        SUPER_METHOD("@method");
        
    }]
];

There might be potential performance issues, but it's a working solution at least.

ivory idol
#

would anyone have any idea how to change a skybox for mission specific? i have a mod that does what im looking for on any maps that use altis or stratis but i dont want to have to change the code for every map i want to use, i would like to have the skybox be able to to just be added to the mission files and called/changed easier than that

warm hedge
#

No

hushed turtle
#

Or save method from parent in child constructor into something like @super_method before overriding it?

hearty plover
#

It could also be written as a function, but that would defeat the purposeβ€”it's mainly meant for smaller functions that might need modifications.

#

When you call the @method of __base, the _self still points to the current class instead of __base.

#

If write it like this, computer might literally explode:

_class_B = createHashMapFromArray [
    ["#type",["B"]],
    ["#base",_class_A],
    ["__base",_class_A]
    ["@method",{
        _this call ((_self get "__base") get "@method")
    }]
];

_class_C = createHashMapFromArray [
    ["#type",["C"]],
    ["#base",_class_B],
    ["__base",_class_B],
    ["@method",{
        _this call ((_self get "__base") get "@method")
    }]
];
tulip ridge
#

Was there a way to make attachTo use render time scope? I could've sworn there was so you didn't have to use to set the position in a loop but I can't find anything about it on the biki. Trying to fix arma (seemingly) over-compensating with some attached objects on a fast moving vehicle, which ends up with lights in front of the vehicle at high speeds

still forum
#

I don't think so

hallow mortar
tulip ridge
#

Ah
Could make a dummy object with a reflector in it then, tempting

thin fox
#

Hello. This addAction is giving me Bad conversion: scalar in rpt file when the condition is true. Seems like the problem is related to the alt syntax of nearSupplies, the original syntax works fine (no error in rpt file). The alt syntax is giving the origin (inside an array) instead of supply objects nearby.

_crate addAction [["<img size='1.5' image='Supplies_Menu\icons\exchange.paa'/>","<t color='#00FF55' size='1.2'>", " " , "EXCHANGE CARGO", "</t>"] joinString "", {
    params ["_target", "_caller", "_actionId", "_arguments"];
    private _supplyNearby = (((_target nearSupplies 5) select {_x isKindOf "ReammoBox_F"}) - [_target]) # 0;
    [_target, _supplyNearby, _caller] execVM "Supplies_Menu\functions\suppliesMenuManager.sqf"
}, nil, -400, true, true, "", 
toString{
    count(_target nearSupplies ["ReammoBox_F", 5]) > 0
}, 5];
thin fox
blissful current
tranquil nymph
#

Unfortunately automated HC detection is a giant pain in the ass

#

I messed around trying to do that a while back, came to the conclusion it was easier and more reliable to just use a mission parameter

blissful current
# hallow mortar OK, now what happens if the scout is the leader? (and the scout is present in th...

Here is the new version, which should address the issues of the proximity and _scout talking to himself. I put _responder as objNull in hopes that I would avoid an error. Going to test now.

_scout = missionNamespace getVariable ["scout", objNull];   
_leader = leader playergroup;
_responder = objNull;
private _units = units playergroup inAreaArray pilot_trigger;
private _speaker = selectRandom _units;


if (_leader in _units) then {
    _speaker = _leader;
} else {
  if (_scout in _units) then {
    _speaker = _scout;
  };
};

private _convo = ["americanLines", "vietnameseLines"] select (_speaker == _scout);

if (_leader distance _scout <= 100) then {
    if (_speaker == _scout) then {
        _responder = _leader;
    } else {
        _responder = _scout;
    };
};

[_convo, [_speaker, _responder]] remoteExec [    
    "FoxClub_fnc_Conversation",    
    allPlayers select { _x distance _speaker <= 100 }    
];
tranquil nymph
#

(The main problem is that timing isn't guarenteed unless you wait specifically for a variable. You can't do that though for cases where the HC isn't present. Though now that groups can be transfered a PV EH to transfer groups on the server is a viable alternative.)

foggy pike
#

What's "PV EH to transfer groups" @tranquil nymph ?

delicate hedge
#

is it now possible to apply post effects in thermal mode?

pliant stream
#

anyone ever seen this immensely helpful error?Error Type Number, expected Number

austere granite
#

What are you getting it from? I think I've had cases where getHitpointDamage or something like that didn't actually return anythign and I believe it showed that error, but i might b wrong

still forum
#

At least the resolution effect is supposed to work πŸ™‚

fossil hamlet
#

@foggy pike I'm guessing Public Variable EventHandler?

brittle minnow
#

good day y'all. does anyone know how to disable that slight camera shake during firing small arms?
If not how should i move on with this?

earnest ether
#

hmm you could set sqf player setUnitRecoilCoefficient 0;but this also eliminates the recoil at all, no exactly what you want

pallid palm
#

why did you want to disable the slight camera shake during firing small arms ?

#
player setCustomAimCoef  0.0;
#

but like Moerderhoschi said this make all weapons this way

fair furnace
#

does anyone know how to stop dynamic groups overriding patches

brittle minnow
# pallid palm why did you want to disable the slight camera shake during firing small arms ?

just for the feels, and I've already tried many ways to counter this but still there is some sort of camera shake or movement (In first person) that is bothering me. I changed so many values in "cfgRecoils" and "cfgCamerashake" and still nothing. I wonder if it's something that is forced by the engine.
I don't want to defuse the weapon recoil but the camera movement only.

pallid palm
#

@brittle minnow maybe see if this would work for you

#
if (!hasInterface) exitWith {};

private _weapon = "hgun_P07_F";

// Check if player has the weapon
if (_weapon in weapons player) then 
{
    player enableFatigue false;
    player enableStamina false;
    player setCustomAimCoef 0.0;
};
hallow mortar
#

Also make sure you don't have any mods running that might be adding their own manual camera shake, some mods like to do that for "immersion"

brittle minnow
#

yeah I'm running the vanilla right now. still no clue what else should i try.

brittle minnow
pallid palm
#

oh hmmm ok

#

i'm not sure what Camerashake your talking about: i have no Camerashake with pistols:

#

unless its like what Nikko said mods or what

#

really i have no Camerashake at all: when i run this script

brittle minnow
pallid palm
#

oh maybe you need to ajuest your flote in settings

#

like the dead zone

brittle minnow
#

both dead zone and head bob is set to zero, unfortunately it couldn't fixed that.

pallid palm
#

hmmm that really looks ok to me the way you have it set

#

go to opticts mode and show me again

brittle minnow
#

there is definitely nothing wrong with the recoil. arma 3 had this camshake since i remember. but recently I've come around some other shooter games that don't have any camera shake. I wanted to capture that feeling here. that's all. it nothing like bug or anything.

pallid palm
#

iv found if you disable recoil and AimCoef it really stays still

#

in vanilla

brittle minnow
#

yeah but look at the edges of the screen, there is still some movement.

#

even with recoil set to 0 in config

#

all values in cfgCameraShake set to zero

#

i wonder if it's tied to character animation

pallid palm
#

hmmm yeah i see that intersting

#

oh maybe you need to set player enableFatigue false;
player enableStamina false;

thin fox
brittle minnow
pallid palm
#

maybe try this

#
if (!hasInterface) exitWith {};

private _weapon = "hgun_P07_F";

// Check if player has the weapon
if (_weapon in weapons player) then 
{
    player setDamage 0;
    player setFatigue 0;
    player enableFatigue false;
    player enableStamina false;
    player setUnitRecoilCoefficient 0;
};
#

Fatigue will affect camshake

hallow mortar
#

Fatigue affects weapon sway, I wasn't aware it affected shake in any way

brittle minnow
#

but the effect is still persistence.

pallid palm
#

yeah it seem like we can't stop that effect

#

but it look really good the way you have it set

#

that weapon you have is really bad for cam shake

#

any MG is really going to shake the cam

earnest ether
#

like i already wrote afaik with sqf you can only kill the effect with sqf player setUnitRecoilCoefficient 0;but this also eliminates the recoil at all

pallid palm
#

me myself i don't like to disable Recoil: but thats just me

#

it may seem to Arcade if you disable Recoil

#

but that may be the only way to do it

#

as Moerderhoschi said

#

i changed my script up there

#

to what Moerderhoschi said

exotic gyro
#

Do you have Ace recoil loaded? It adds a little more cam shake as well.

pallid palm
#

no he said hes using no mods

#

only vanilla

#

good thing i don't use Ace lol

#

well i mean i use no Mods at all

ivory lake
thin fox
brittle minnow
#

both in script level and config level there are no command or parameter that could remove weapon firing camshake.

I think I should fill a feature request. I've tried everything and nothing seems to work in this case. by everything I mean every relatable sqf command or any config related settings. I tested all of it in vanilla environment.

by the way, I recently tried to reconfigure a weapon to have to recoil in the config. even with that, the camera still shakes.

exotic gyro
#

You can do one better, do a pull request

#

It's like six lines

#

unless you mean for non ace

#

in which case feature from dedmen I guess

brittle minnow
# exotic gyro unless you mean for non ace

It's not tied to ACE or other mods, the game add that punch to the camera for some reason. as you said "ace recoil" messes with some addCamShake but I'm not using that at all.

exotic gyro
#

Yeah it does a little extra

ivory lake
#

its set in the ammo

#

but from what Ive seen all the infantry weapons has the values set to 0

#

for the fire/playefire camshake

regal kraken
#

is there any reason why _player and _hostage would come back as undefined?

_player = _this select 0;
_hostage = _this select 1;

 detach _hostage;
 Removeallactions _player;```
#

[player, hostage1] execVM "scripts\gamemode_release.sqf";

#

its genuinely confusing

granite sky
#

Where are you running the code?

regal kraken
#

basically in a holdaction, one checks if a hostage is attached to you or not, when it attaches a hostage, it adds a holdaction to the player, but its that translation right there thats the issue

#

i'll put the full code, its probably worth nothing anyway

#
_player = _this select 0;
_hostage = _this select 1;

if (!isNull attachedTo _hostage) exitwith {
    hint "Gamemode: Hostage is already being handled!";
};


if ((isNull attachedTo _hostage) && (!isNull attachedTo hostage2) ||
    (isNull attachedTo _hostage) && (!isNull attachedTo hostage1)) exitwith {
    hint "Gamemode: You can't take two hostages!";
};

if (isNull attachedTo _player) exitwith {
    hint "Gamemode: You're now handling a hostage!";
    _hostage attachTo [_player, [0, 1, 0]];
    
    call{        
    [_player,        
    "Handle Hostage",        
    "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\interact_ca.paa",        
    "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\use_ca.paa",        
    "_this distance _target < 1",   
    "_caller distance _target < 1",        
    {hint "Shop Status: Loading..."},        
    {},        
    {        
      
    hint "Shop Status: Complete";        
    [player, _hostage] execVM "scripts\gamemode_release.sqf";        
    },        
    {hint "Shop Status: Interrupted"},        
    [],        
    0.5,        
    nil,        
    false,        
    false] call BIS_fnc_holdActionAdd;          
    };
    
};```
#

release sqf is the code i posted above, i seperated it to see if the _hostage / _player scenario would fix

granite sky
#

_hostage doesn't exist in that scope.

#

player does, so I assume you're misreading the error.

regal kraken
#

i'll take a screen just incase

#

never really proof read that screen πŸ˜…

#

Sorry John, hopefully that helps

#

is there something i need to do to get the _hostage into the scope with a holdaction involved?

versed trail
#

You can probably use attachedObjects and filter it to get the hostage and use that, but the easier way is probably to just set a variable on the player when they pick him up e.g. player setVariable ["hostage", _hostage] and then grab him again in the action completed section, so adding private _hostage = player getVariable ["hostage", objNull]

#

Not sure if this action is supposed to go on the player or the hostage though cause you're adding it onto thr player but then checking the distance from the caller (the player) to the target (the player) if I'm reading it rigth

pliant stream
#

nvm it was a vector passed to createVehicle, it turns out one of the components was NaN

regal kraken
#

got ti working with the variables

#

thats fantastic

#

cheers guys

errant iron
#

(coincidentally similar subject, but separate question)
I've got a few functions for escorting prisoners and carrying incapped units, both of which use attachTo and detach. However, sometimes when releasing the unit, they'll teleport back to the position where they were first attached. Anyone have an idea on what causes this?

I've encountered this every so often since 2.18, when I first wrote the code, but never figured out why it happens. Only some target units are affected, both local and remote. Seemingly after some time, the issue goes away and the unit will drop where they were released as normal.

granite sky
#

Hmm. I wouldn't ever use a detach without setting the position afterwards.

#

but maybe it works if the locality is right.

blissful current
#

I'm trying to use this event handler by putting it in the object's init. However, it won't fire when the pilot ejects for some reason.

this addEventHandler ["GetOutMan", {
    params ["_unit", "_role", "_vehicle", "_turret", "_isEject"];

    if (_isEject) then {
        missionNamespace setVariable ["pilotEjected", true, true];
    };
}];
#

The wiki says _isEject is boolean.

granite sky
#

What's the locality of the event handler?

blissful current
#

Im testing it on SP at the moment, so my computer?

granite sky
#

No idea then. Is the unit human or AI?

blissful current
#

AI. Would locality matter since my variable is broadcast to all?

granite sky
#

It doesn't matter in SP.

#

I'm assuming that the event handler is bugged for the eject case, but you would need to research exactly which cases work and which don't.

blissful current
#

I guess I'll try out "GetOut" next. You can put that EH on the vehicle.

blissful current
granite sky
#

I don't remember if AIs even have a vanilla eject.

#

so yeah, maybe

#

I mostly remember RHS planes dropping 30 copies of the same canopy due to locality bugs.

hallow mortar
#

GetOutMan is supposed to be triggered by all methods of leaving a vehicle. Even if the Eject action isn't used, they would have to use moveOut to transfer the unit to the ejection seat vehicle, so it should still trigger

#

It just wouldn't be detected as being an eject by that parameter in the EH

blissful current
#

Ah okay so my condition shouldnt be to look for _isEject. I could find a way to look if the unit is not in the vehicle anymore.

hallow mortar
#

Well if getOutMan fired you can be fairly sure they are no longer in the vehicle

#

You should test though, and make sure that getOutMan fires at all in the circumstances you need. I've described how it should work, but it would be good to verify.

blissful current
#

Good point, I already spent the last hour trying to break getOut, so I'll just stay with this one instead.

#

Works great so far.

hallow mortar
#

Assuming getOutMan fires, your challenge is going to be determining whether it was an ejection.
You could look for whether the pilot is now in an ejection seat; you could look for whether the plane is at altitude (might fail if they pull the lever while parked, but ejecting is the only way to leave the plane while it's flying).
Also worth checking the ejector seat functions to see if there's a scripted EH for it.

blissful current
#

My setup is pretty simple. The plane is hidden in the sky until players get to a trigger area. Then a SAM fires and the pilot ejects. I had to play around with the damage a bit to get it consistent, but if I set the plane to 60% health, he ejects every time.

hallow mortar
#

OK well then you don't even really need to check if it was an ejection. There's no other reason for the pilot to leave the plane, so you can just assume that if GetOutMan fired at all, the job is done.

errant iron
granite sky
#

They're both global effect so you can probably just run them in order from anywhere.

#

I don't recall running into any trouble with that. Velocity is another matter.

#

Oh, you're attaching units? Not tried that.

#

Basically every type of object has different rules and none of them are documented :P

foggy pike
#

Has anyone got any good group matrix systems setup? Like with F3's framework I'm trying to get a dynamic and reliable tree view of a side's units starting with command, then squads, fireteams etc. But I don't want to have to hardcode group names since it seems very un-future proof

#

So like a group could be called GrpNATO_0_PltHQ which would basically be side west, index of 0 so it#s at the top and then called PltHQ.

indigo snow
#

a way if you use consistent naming scheme is using splitstring

#

if you split by _

foggy pike
#

Yeah that's what I'm leaning more towards

#

Just don't want crazy long group names

indigo snow
#

a different system is coding an orbat into the .ext

foggy pike
#

Oh you can do that? I'll have to look into it

indigo snow
#

well if you go by a pure arma style scheme

#

grp_side_number_number_number would handle most use cases

#

gpr_east_1_1_6 : 1 coy, 1 plt plthq

#

its more about the consistency

foggy pike
#

Yeah that would work and then I just have a class for each

indigo snow
#

i spent a summer on something like this

#

take from it what you want

#

its missing some defines but it should be fairly intuitive