#arma3_scripting

1 messages · Page 19 of 1

velvet knoll
#

No i had been manually placing and ied and detonating it

lunar goblet
#

I'm trying to make an NPC that the players have to put into a dedicated vehicle so that they don't die, but I'm quite new to arma mission making and don't know much about scripting. could anyone help?

ocean folio
#

more specific

#

how do you want them to put the dude in the vehicle?

#

one way is having the unit join their group and having the group leader order the AI to get in the vehicle

#

or you could put an action on the guy to load him into the vehicle. This could also be combined with a system to move him, either your own or you could try the ACE mod's handcuffs and escorting

gaunt tendon
#

thank you

ocean folio
#

trying to figure a way to detect if a player enters an area in MP, but have it be exclusive to each player

#

right now I globally execute a function which creates a trigger which has its global flag set to false. So every client should have its own trigger for anyplayer present. If worst comes to worst I can just catch the global execution of the trigger with if (player inArea _trg) but I'd rather not execute that check on every single player's machine for every player who enters the area.

lunar goblet
#

I’m thinking of having it detect whether the “squad” enters a trigger area (by squad I mean the npc)

#

Would that work?

ocean folio
#

what would the trigger do? I dont see why you need to detect when the players enter to load the guy in

lunar goblet
#

Kill him, unless he’s in an ambulance/medical vehicle

ocean folio
#

oh that isnt too complex actually, let me look some stuff up real quick but I think I know how to go about it

lunar goblet
#

Alright, thanks!

#

I might have my do not disturb turn in since it’s late but I will check when I can.

ocean folio
#

ugh, I know how to do this though code, but I dont know how to do it using the editor properties for triggers 😆

#

this might not be exactly what you want though. This will detect when the injured man (with the variable name hurtMan) enters the trigger area. If he isnt in the ambulance when he enters the area, then he will die

lunar goblet
#

Yes that’s exactly it! Thank you!

ocean folio
#

you can change "C_Van_02_medevac_F" to the class name of any vehicle you want

#

that will be the vehicle that will protect the guy

lunar goblet
#

Thank you Ajdj100, very cool 😎

pulsar bluff
#

perhaps … it feels like something else tho

#

how is a lobby slot evaluated as joinable/not occupied?

#

here is how the bug presents to players (and why skipLobby cant be used)

#

if a player ingame is in the glitched state where he appears as “Error: No unit”, will his slot appear joinable in lobby?

meager granite
#

From my experience their slot would still be occupied

unique sundial
#

error no unit used to happen when you tried name command on dead unit

meager granite
#

Pretty sure I had cases where remote players returned "Error: No unit" on "name"

#

Seeing players with no group is a very common occurrence in multiplayer, see it almost every day

#

isPlayer => false, group => null

maiden juniper
#

Anyone know of a good way to check if an object is a drone?
Currently I'm using "isKindOf" and checking these base classes,
uav, UAV_01_base_F, UAV_02_base_F, UAV_03_base_F, UAV_04_base_F, UAV_05_Base_F, UAV_06_base_F, UGV_01_base_F, UGV_02_Base_F
I'm sure not all drones have these bases, and using this method, I'm sure i could never check for bases of drones from all the mods out there. Seems like there would be a better way to go about it.

meager granite
#

getNumber(conifgFile >> "CfgVehicles" >> typeOf _vehicle >> "isUav") > 0

misty epoch
pulsar bluff
maiden juniper
warm hedge
#

Alternatively, getNumber (configOf _vehicle >> "isUAV")

#

Basically the UAV term here is just drone

misty epoch
meager granite
#

Most bizarre MP bug I've seen was OPFOR groups all being null. At some point all clients started seeing OPFOR groups as nulls, allGroups returned bunch of nulls and then other side groups fine, rejoin didn't help, only server restart helped.

#

Even have a screenshot somewhere, really weird stuff

misty epoch
#

I've seen a similar thing as well. Server restart fixed it so I chocked it up to Arma being Arma

boreal parcel
#

so im modifying some code, why would one use removeMagazineGlobal in a loop rather than removeMagazines?

open fractal
#

removeMagazines will only remove the magazine for the client executing the command

boreal parcel
#

ahh, ill leave it then

open fractal
#

you should use the global command for MP

#

assuming it's only executed once

unique sundial
hallow mortar
meager granite
pulsar bluff
#

yea these are "busy multiplayer" issues

#

only workaround for the "receiving data" bug i can think of, is for player to be dropped into a random lobby role when "skipLobby" is used, instead of "first available". that way if the first available role is glitched, they can re-attempt entry and probably get a different non-glitched role @unique sundial

meager granite
#

skipLobby randomly kicks players off the server on round end for us, did you see this happen as well @pulsar bluff ?

#

What's the modern approach to get view port zoom level?

manic sigil
#

So I have some functions; when an object is hit with a weapon, it's supposed to move. This works, in a fashion, but it's not perfect yet; in SP its fine, in MP the object will move on some machines, but take several seconds to move for others, which is a bit of a problem when the one with the delay is the one trying to move things around.

The relevant parts of my script:
https://sqfbin.com/wapawasogiguqecukedi

#

the Destroy function at least works smoothly, so I'm assuming it's a problem with propagating the new position/direction of the object.

meager granite
#

Are you trying to move island-placed objects?

#

also be careful with switch as it is case-sensitive, currentWeapon returns classes with whatever casing config has

little raptor
#

some objects take too much time to sync, because they're meant to be static

manic sigil
#

That is an excellent question; the objects are buildings placed via SOGPF's Mike Force building system, so I'm not sure how they are handled, locality speaking. Things like trenches, bunkers, towers, etc.

#

So not map-objects, mission specific ones.

little raptor
#

but anyway, since they're buildings, the sync delay is obviously huge
you can try remoteExecing the setPosASL on all clients, but not sure about any side effects

manic sigil
#

Like, amplifying the movement x the number of players, sort of thing?

meager granite
#

setPos* on remote entities will generate network messages

#

While locally position will update when engine decides to

granite sky
#

hmm. Might work if you moved it far away and back again :P

#

(remoteExec setPosASL is probably preferable)

meager granite
#

Another hacky solution would be broadcasting position and orientation everywhere, then creating a dummy local object on that position on remote clients, then attaching your object to that local object, then deleting it

#

This way you'll move the object without any network messages to everyone from each client

#

If waiting for the engine to update position globally is the issue

#

if not then just remoteExec setPos* commands to where object is local

#

If its an island object, then you'll need to do setPos on each client

#

By island object I mean getObjectType _object != 8

manic sigil
#

Ech... remoteExecing the move seems to have broken the action :/

meager granite
#

Paste remoteExec line here

manic sigil
#
'... call BIS_fnc_callScriptedEventHandler;
|#|if (count _bypass_projectile >0 && {_by...'
Error if: type String, expected Bool
#

[_hitObject, _dirElev] remoteExec ["setposatl",0];

meager granite
#

you have its return in the condition

#

check wiki, it returns string

manic sigil
#

Ah, I think I follow. Since I have it running as a mini-function and the last line is the remoteExec, the call's final line is a string rather than a bool?

meager granite
#

your {} must return bool for it to be used in condition\lazy &&

manic sigil
#

Yeah, capped it with a true;, and that cleared the error.

#

Unfortunately, the multi-jump is now in effect T_T

#

Even in single player, which is bizarre.

#

Damn... was hoping it was just a matter of trying different setpos*'s, but no dice.

#

Double damn, trying to do the invisible helipad attachTo workaround but it keeps shooting off into the stratosphere T_T And I can't imagine 'delete object, create new object at new position' would be much better.

#

Yeah, doubly so since that'd interrupt the whole Supply system of MF.

granite sky
#

Do you actually need the position to adjust immediately for other players, or just the user?

#

Because otherwise you could hide the real object locally, create a local copy and move that around.

manic sigil
#

The actual speed of the change is a bit of a tossup, if it moved for the user actually doing the thing, it'd be fine - but if other players are nearby, it'd be nice for the object to move in the same moment so they don't get surprised and have !!fun!!.

And creating a copy is a no-go, this is for SOGPF's Mike Force, so the objects have a whole supply system to keep them active. Granted, I usually handwave that kind of needless pedantry in favor of gameplay, but in this case I'd like to keep it closer to the original intent.

granite sky
#

That's not a problem is it? The real building is still there, just hidden to one user and not syncing very often.

#

Maybe we need a forceNetworkUpdate command :P

cerulean cloak
#

Is there any good way to do a plus/minus function?

little raptor
#

plus minus function?

sharp grotto
cerulean cloak
#

Number +/- number

#

I'm trying to place another object randomly within 100m E/W and 100m N/S of the first object

little raptor
cerulean cloak
#

Won't that only place it somewhere randomly to the north or east of the first object? Never south or west

south swan
#

100 - random 200 🤷‍♂️

cerulean cloak
#

Fair

cerulean cloak
#

I didn't like it's distribution. Gonna just do the 100 - random 200 solution

meager granite
#

Was there a command to return attachTo offset or do you have to calculate it yourself?

little raptor
#

no

dreamy kestrel
#

Q: re: map shapes i.e. ellipses and such...
I have a default shape working on the default map...
IIRC, when I have a second map control, i.e. in a dialog, that needs to be a second shape, correct?
The awkward part, IMO, is that markers are ubiquitous (?) i.e. regardless of the map control (view) ...

little raptor
#

I don't understand the question
are you trying to have 2 different shapes for 2 different map controls?

dreamy kestrel
#

I have one shape, it is showing on the default map control. Do I need a second shape for the second control?
Which seems different from map markers.

little ether
#

Holy shit help me out here;

I'm trying to take a brick explosive which lays flat on the ground, tilt it 90 degrees forward so the panel is facing out and then 90 degrees counter clockwise (-90) so it sticks to the side of a car.

I've been trying to wrap my head around this setVectorDirandUp for hours and nothing I input gets me even close, most just ending up at some vague 45 degree angle. Is anyone able to help me out?

sweet salmon
#

Howdy all, random question: Is there a way to make a player no longer be able to control their vehicle? i.e. say they take enough damage to the controls, the controls stop responding?

#

specifically for aircraft

hallow mortar
# little ether Holy shit help me out here; I'm trying to take a brick explosive which lays fla...

Vectors aren't in degrees, so forget about all that :P
Place a C4, name it, and start the mission. Then use the debug console to do setVectorDirAndUp on it so you can see your changes live without restarting every time. Change one axis at a time in small increments (remember, 1 is a lot) until you figure out which way each axis rotates it. You'll get there in the end if you take it cautiously.

dreamy kestrel
little raptor
#

no. markers properties apply to all controls

dreamy kestrel
dreamy kestrel
#

marks do appear on multiple map controls. that's fantastic... the shape does not.

little raptor
dreamy kestrel
little raptor
#

then I have no idea what you mean. you say it's not a marker and it's not an icon. then what is it?

dreamy kestrel
little raptor
sweet salmon
#

Which call allows for that?

little raptor
dreamy kestrel
little raptor
#

which returns true to override the keys

#

you can use actionKeysEx to get the keys for aircraft controls and override those

sweet salmon
#

Can this also be applied to joystick?

little raptor
#

it should. try it out

sweet salmon
#

Awesome! Thank you, sir!

little raptor
#

I haven't tested anything analog with keyDown tbh

little raptor
# sweet salmon Awesome! Thank you, sir!

for testing, get into an aircraft, then run this and try moving your joystick:

findDisplay 46 displayAddEventHandler ["KeyDown", {
  params ["", "_key"];
  _key > 1;
}];

if the aircraft still responds then it won't work

sweet salmon
#

Will give it a whirl

boreal parcel
#

hey just a quick question, is it possible to write to a txt file with sqf rather than logging to rpt?

little raptor
#

no

boreal parcel
#

okey

#

logging it is then

little raptor
#

unless you use an extension

fresh crater
#

i want to use the "look at command" but im new to scripting is there a tutorial or someone can help

little ether
#

Help me out here

private _goat = synchronizedObjects thisTrigger; _expl1 = "DemoCharge_Remote_Ammo" createVehicle position _goat; _expl1 attachTo [_goat, [0.15, 0.30, 0.60], ""]; _expl1 setVectorUp [1,0.001,0.001];

The bottom 3 lines of that work perfectly if I name my animal goat and remove the _ in front goat. I'm trying to add something like the top line so that I can have as many of these as I want and I don't have to rename each goat as goat 1, goat 2 etc etc Is there any reason what I'm doing is failing? Is there a way that would work?

granite sky
#

synchronizedObjects returns an array, not an object. So you'll do something like this:

private _goats = synchronizedObjects thisTrigger;
{
  _expl1 = "DemoCharge_Remote_Ammo" createVehicle position _x; 
  _expl1 attachTo [_x, [0.15, 0.30, 0.60], ""]; 
  _expl1 setVectorUp [1,0.001,0.001];
} forEach _goats;
little ether
#

Not throwing errors, but not spawning the explosive and placing it on the goat sadly

#

Wait, sorry it's working perfectly

#

Gotta love coding overtired 😛

#

Yeah works like a charm, thanks a ton mate

brazen lagoon
#

is there any way to disable 3D markers and map markers (i.e. where players are on the map, but not enemies) in script? or is this only done in difficulty options?

delicate lotus
#

Hello, I currently have a problem with ending a mission in multiplayer.
I use ["endDeath"] call BIS_fnc_endMissionServer; when all players are dead and all respawn tickets are exhausted.
But the closing shot seems look quite bugged (https://imgur.com/a/fx7yW0x). This does not happen when I end the mission while I am alive (everything looks normal there).
How can I fix this?

The Debriefing class looks like this:

class endDeath {
    title = "MISSION FAILED";
    description = "All defenders were killed.";
    picture = "KIA";
};
#

It should not have the big blue square and neither the 0 below it.
Which it also doesn't happen if I end the mission the same way while I am still alive.

#

Force closing the map, switching the camera or force respawning the player does not seem to fix this.
Even with a delay after all of that and any combination of the above.

hallow mortar
#

That looks like the game showing the ticket count for BLUFOR to me. I'm hesitant to describe it as bugged because it's probably supposed to do that.

delicate lotus
#

Probably, but why does it do that when I use a custom debriefing class?

hallow mortar
#
  • endDeath isn't a custom debriefing class, it's one of the default ones and you're overwriting its content
  • this may be something it does automatically when the mission ends with 0 tickets, not part of the debriefing class
#
  • the mission may be automatically ending itself because you're out of tickets (this is controlled in the respawn template settings) rather than using your endMissionServer call
delicate lotus
#

nah, its not ending itself. I already checked that. The timing is consistent with my sleeps and such in my script where I check if the mission should end.

#

It probably really is that it only happens when the tickets are zero. Hm... maybe I can increase the tickets before ending.

#

This certainly is very weird, since when I increase the tickets again it still shows the "wrong" debriefing screen.

#

And the "Tickets" Template itself also doesn't call or run any mission ending functions.
I've now even check BIS_fnc_endMission and BIS_fnc_endMissionServer and neither seems to special case the debriefing screen for tickets.
Even failMission, an engine command, seems to show the ticket debriefing screen.
So I guess this is an engine limitation then and I would have to make my own ticket system.

fresh crater
#

i want a helo gunner to sweep an area left to right

#

i found this [_someSoldier, _otherSoldier] lookAt markerPos "markerOne";

copper raven
#

use waypoints or doMove maybe

fresh crater
#

no im talking about the turret

#

the heli stays in place and the gunner looks left and right

hallow mortar
fresh crater
#

idk how to write the position (im new to scripting )

#

helogunner lookAt [100, 100, 100]

#

is this correct ?

hallow mortar
#

That's correct as long as the [x,y,z] coordinates you want them to look at are [100,100,100], which seems somewhat unlikely

fresh crater
#

i have no syntax error

sand drum
#

hello

#

can anyone tell me how to script an ai to follow his waypoints without turning left or right or doing stuff to protect himself when the enemy is shooting him?

granite sky
#

Try this lot:

{
  _unit disableAI _x;
} forEach ["AUTOTARGET","AUTOCOMBAT","SUPPRESSION","WEAPONAIM"];
        
_unit setSpeedMode "FULL";
_unit setUnitCombatMode "BLUE";
_unit setCombatBehaviour "AWARE";
fresh crater
#

how can i make ai get out of helo when it lands

granite sky
#

Crew or passenger group?

fresh crater
#

2 pilots

granite sky
#

leaveVehicle is pretty effective. You can even call it in mid-air and they'll land to get out :P

devout surge
#

Hello, im looking for a little help. I need a way to rearm a plane with a code, so the players can rearm it interacting with an asset and not having the zeus doing it. is there a way or some code that i could use

meager granite
#

What's the reliable way to delete dead unit from the vehicle?

#

deleteVehicleCrew doesn't work properly

#

Even executing it globally doesn't work, funnily enough it deletes it everywhere except where unit is local

#

Deletes after few seconds too

granite sky
#

deleteVehicle is fine now, I think.

meager granite
#

No, deleteVehicle does nothing

granite sky
#

Huh. I thought they fixed that.

meager granite
#

Nope, nothing happens

#

Actually, something happens

#

Unit deletes everywhere after some time

#

Except where it was local

#

I test it with unit on turret though, so it might be turret switching locality back to vehicle owner and it triggers unit disappearing

#

Locality didn't change

#

Maybe since player has a phantom dead body on that turret locality jumps back and forth or something

ocean folio
#

is there a way to create a radio channel that can only be drawn in? no text or voice, only map markers and drawings

meager granite
#
10:28:59 Server: Object 9:113 not found (message Type_96)
10:29:18 Server: Object 9:113 not found (message Type_124)
10:29:18 Server: Object 9:114 not found (message Type_124)
10:29:19 Server: Object 9:114 not found (message Type_96)
10:29:19 Server: Object 9:113 not found (message Type_96)
```Lots of this in RPT
#

I guess these phantom dead bodies produce most of this crap

ocean folio
#

interesting, I'll take a stab at it

meager granite
#

What's funny is that createAgent deletes easily all the time

#

createUnit only deletes while its in group few seconds after death

#

Then its a headache

#

Looks like moveOut u; deleteVehicle u; is a proper way to delete dead units now

#

Since moveOut was patched to work with fully dead bodies some time ago

#

deleteVehicleCrew is broken and useless

#
This command attempts to move the given crew member out before deleting it.
```(❌) DOUBT
#

I wonder if deleting vehicle with dead bodies inside is safe

#

And won't trigger that RPT spam in some form

ocean folio
#

having a strange issue with calling a function in the init field of an object

#

if I call this [this, 5] call AJDJ_fnc_createArea; in the init field, it seems to break and doesnt actually pass the object in via this

#

if I execute that code while the mission is running, it works perfectly fine

#

passes in the object exactly like it should

little raptor
ocean folio
#
/*
creates a new contamination area

Params:
0: Position array OR Object - The source of the contamination
1: Radius - the radius of contamination around the object
*/

params ["_location", "_radius"];

systemChat str _location;

if ("OBJECT" isEqualTo typeName _location) then {
    _location = getPos _location;
    private _emitterObject = _location;
    systemChat "existing object";
} else {
    private _emitterObject = "Land_GarbageBarrel_02_F" createVehicle _location;
    systemChat "new Object";
};
#

when I run it in the init, none of the systemchats spit out anything

little raptor
#

SystemChat doesn't work in init

ocean folio
#

I.... think it does?

little raptor
#

There's no display

little raptor
ocean folio
#

hang on let me try it

warm hedge
#

*In very first milisecond of the mission start

ocean folio
#

I must be tripping, maybe its because in past I have had other code run first

#

regardless, that's not all that doesnt work

little raptor
delicate lotus
ocean folio
# little raptor Spawn it

this seemed to have worked, but it looks like that was hiding a real issue somewhere that I'll have to dig out. Thanks for the help

#

lol I think the issue is just trying to work when I should be asleep meowsweats

little ether
#

Alright I'm sure I'm fucking this up and am overthinking it but nothing seems to be working

this addAction ["Remove Spike Strip", {{deleteVehicle _this;} forEach _x;}];

warm hedge
#

And this supposed to do what?

#

What is this in this context?

little ether
#

Delete the object it's in the init field of when the action is triggered

warm hedge
#
this addAction ["Remove Spike Strip", {deleteVehicle (_this#0)}];```
little ether
#

God damn I even tried that but missed the _

Thanks a ton mate

dreamy minnow
#

total noob wanting to know what the parts of this script do (or should do as i cant get it to work) if (!isDedicated && {playerSide == civilian}) then {this setVariable ["bis_disabled_Door_1", 1, false];}

dreamy minnow
#

door only opens if your a member of a faction (civ opfor etc) this one suposed to be civ right?

#

i say right it is SUPOSED to be civ

#

my understanding is you cant the server host and you must be civ if thats true then it unlocks the door 1 on the building the code is in the init for

#

or i misunderstood the dedicated comand?

#

i see that explains alot so ill need to set a trigger up?

#

is there a major difference between gates and doors in houses? in terms of scripting

meager granite
#

deleteVehicleCrew

#

Just tested it and its broken, couldn't get it to delete local body from remote vehicle properly

#

no matter what I tried

#

Turned out since moveOut works with bodies now, moveOut + deleteVehicle works properly

unique sundial
#

it call moveout why you doubt it? i can double check

meager granite
#

even if you do it globally it deletes it for everyone but for body owner

unique sundial
#

can you give me quick repro?

meager granite
#

What I had approximately:

  • Server-owned vehicle
  • Client-owned dead body in vehicle (wait until it stops being in group)
    No matter how I tried deleteVehicleCrew from client side, couldn't get it to reliably delete the body everywhere
unique sundial
#

the body is just dead ai?

meager granite
#

I had the body on a turret seat specifically and server on driver of that vehicle

#

Yes, createUnit, was never a player

#

createAgent deletes properly all the time, createUnit doesn't

#

I think best result was executing deleteVehicleCrew globally through remoteExec, it instantly deleted it for everybody but for client that owned the body

unique sundial
#

i’ll check after i had a coffee

meager granite
#

Then I abandoned it and went for moveOut+deleteVehicle

pulsar bluff
#

moveout is better anyways, cleaner and generates fewer “object not found” errors

meager granite
#

Yeah, it used to not work with dead bodies some time ago

#

When I implemented "take out bodies" feature I had server create invisible AI units and have them get into seats to push out dead bodies, lol

pulsar bluff
#

i remember

#

looked into how you did it long time ago, decided not worth my time 😂 pve dont need to manage bodies/weaponholders as much

#

i think in pvp the body is a duping issue?

unique sundial
#

have you tried deleting where is local?

meager granite
#

Yes, tried most combinations

#

deleteVehicleLocal where body is local, then from server, then remoteExec it everywhere

#

None worked properly with different results

pulsar bluff
#

i was using deletevehiclecrew for awhile (before 2.06 moveout) in server "entitykilled" event, no trouble

#

it was instantaneous tho, not sure if that changes locality considerations

pulsar bluff
#
    if ((owner _killed) isNotEqualTo (owner (objectParent _killed))) then {
        [
            (objectParent _killed),
            _killed
        ] remoteExec [
            'deleteVehicleCrew',
            (objectParent _killed)
        ];
    };
}```
meager granite
little raptor
cosmic lichen
#

Anyone knows a way to reliably check whether a vehicle and all its turrets are entirely out of ammo?

#

There is unfortunately no getter for setVehicleAmmo

unique sundial
#

I reproed, but the code is doing something fishy

meager granite
cosmic lichen
#

Interesting. Gonna test that

fresh crater
#

"this createSimpleObject " and after this what do i type

meager granite
cosmic lichen
#

Does this work with none local objects?

#

ArgGlobal so I guess it does.

meager granite
#

It checks whatever weapon and magazine state was broadcasted to your client

cosmic lichen
#

That suffices

meager granite
#

So it might be lagging behind real ammo count a little bit, depending on who the turret is local to, how much they lag, etc.

#

So somewhat reliable

#

Like only check magazines that have CfgAmmo with simulation=shotBullet,showShell,shotMissile,shotRocket

fresh crater
#

anyone knows whats the syntax to create super simple object

unique sundial
# meager granite Curious, what was the issue?

So the problem is that the unit has to be moved out first then deleted. But then it gets messed up because of localities and so request to move out is sent but then unit is deleted immediately locally before the remote request is completed

meager granite
#

I wonder why moveOut+deleteVehicle works then

cosmic lichen
#

Question about the Task Framework. Is it possible to transfer ownership of a created task from target A (original owner) to target B or do I need to create the task from scratch for the new target?

sharp grotto
#

How to stop players autoreporting, because even with all this they still do it. 🤔
Auto reporting is disabled in the difficulty settings autoReport = 0;

enableSentences false;
enableRadio false;
player disableConversation true;
player setSpeaker "NoVoice";
showSubtitles false;
unique sundial
#

tried disableAI "RADIOPROTOCOL" ? Stops AI from talking and texting while still being able to issue orders.

sharp grotto
unique sundial
#

why dont you try it

sharp grotto
#

meowsweats guess i will, thanks 👌

unique sundial
tough abyss
#

I'm so glad I don't work on the SQF code.... everything being broken would drive me up the wall.

unique sundial
#

everything being broken would drive me up the wall
Good job this is not the case, we wouldn't want you on the wall

tough abyss
#

Wouldn't you prefer to work on something else?

unique sundial
#

why? 99% of the sqf is solid

tough abyss
#

I've never understood why you never just used an already existing language. I mean SpaceEngineers did that and it works very well.

#

They choose C#

#

And Enfusion script looks a lot like C#

warm hedge
#

None of us here made the SQF syntax. What's wrong with it in the first place?

tough abyss
#

Procedural language is a little limiting.

unique sundial
warm hedge
#

Tell Bohemians so 25 years ago

tough abyss
#

No I've written some scripts. I don't like it when it does things like commands doing what they should when they should. Like what happened with deleteVehicle

warm hedge
#

If you do deleteVehicle, it deletes a vehicle, what's wrong?

unique sundial
#

but that is not SQF this is engine bug

tough abyss
#

True. I've noticed you've been expanding the expressiveness of SQF.

#

Great work with the setTerrainHeight command.,

warm hedge
#

It's Ded's work

tough abyss
#

Too bad you can't ask BIsims for some input.

#

They had a fully fledged terrain editor that could build scenarios from blank slates not just have maps

warm hedge
#

I still don't really know what's your point

unique sundial
#

Me neither

tough abyss
#

VBS 3.0 allows you to do full on terrain editing change terrain height etc. and Place plants, grass etc. It eliminates the requirement for a single map.

winter rose
#

yeah, but the point?

tough abyss
#

More flexibility?

warm hedge
#

No, your point, not VBS's point

winter rose
#

oh, you wish to have that
OK, not related to SQF then

warm hedge
#

Nor Arma

tough abyss
#

Fair enough.

unique sundial
tough abyss
#

Fair enough. Sorry.

#

Where would be suitable?

unique sundial
#

general discussion BIS forums

tough abyss
#

k

warm hedge
meager granite
#

Body dragging live aviator

meager granite
#

Had that no group no uid bullshit on a player just now:
[group o, side group o, getPlayerUID o, isPlayer o, name o] => [<NULL-group>,UNKNOWN,"",false,"Kiraa"]

#

Happens pretty much each live game, not reproducible in closed environment it seems

#

[alive o, group o, side group o, getPlayerUID o, isPlayer o, name o, o in allUnits, o in playableUnits, o in switchableUnits]
=>
[true,<NULL-group>,UNKNOWN,"",false,"Kiraa",false,false,false]
not in any of the lists

#

Going back to lobby and joining again helped, so it might be local issue

#

Player respawning didn't fix it

#

What's interesting is that it returns player name, yet isPlayer=>false

delicate lotus
#

Hey, who can I ask regarding if something is a bug or an intended engine feature?

meager granite
#

Try here

pulsar bluff
#

they would start to complain "i think im glitched, XXX or YYY isnt working for me"

meager granite
#

Yeah, kicking them back to lobby gonna help as well

#

I wonder if they're broken simultaneously for everyone or just some clients

#

because as I just tested, me going back to lobby and joining again fixed it

pulsar bluff
#

often is for everyone, their group reports grpnull from other client

#

if you use zeus, you will see them as yellow icon

meager granite
#

Wonder why this happens and if there can be some safeguards against it. Very big problem if you ask me

pulsar bluff
#

we can only speculate ... are the lobby groups being destroyed ... client IDs being recycled ...

meager granite
#

My kill feed shows whatever side server had them on and it shows as proper side, so this issue isn't present on the server, only on some or all clients

pulsar bluff
#

maybe another client has joined their same slot and orphaned their character, etc

meager granite
#

We can try nagging Dedmen or KK to add something for logging on profiling build to diagnose it, as it happens fairly often on live populated server aviator

meager granite
#

So it might be something else

pulsar bluff
#

you mean in lobby each player is separate lobby grp (alpha 1-2, 2-2, etc)?

#

you ever have the "stuck on receiving data" bug in koth?

delicate lotus
#

Okay, so my problem is that somehow any usage of the respawn ticket system,
besides querying the ticket count, causes the game to always use a unspecified
debriefing ending.

My mission looks like this:
Description.ext

respawn = "BASE";
respawnButton = 1;
respawnDelay = 15;
respawnOnStart = -1;
respawnVehicleDelay = 15;
respawnTemplates[] = {"MenuInventory", "MenuPosition", "Tickets"};

class CfgDebriefing {
    class endCustom
    {
        title = "Mission Failed";
        description = "All players died";
        picture = "\a3\Ui_f\data\GUI\Cfg\Debriefing\endDeath_ca.paa";
    };
};

My initServer.sqf looks like this:

[west, "respawnMarker"] call BIS_fnc_addRespawnPosition;
[west, 1] call BIS_fnc_respawnTickets;

Steps to reproduce:

  1. Kill player (setDamage or Respawn Option Menu)
    => Respawn Menu Opens, but can not respawn since tickets are exhausted!
  2. Use BIS_fnc_endMission or BIS_fnc_endMissionServer or endMission engine command with
    custom ending "endCustom" defined in description.ext.
    What happens: Closing Shot and debriefing looks different than the one specified in description.ext.
    What should happen: Closing Shot and debriefing looks like the one defined in the description.ext.

Note: This only happens if you ever modify the ticket amount with "BIS_fnc_respawnTickets".
If you never modify the ticket amount and just end the mission, everything looks normal.

Now what really confuses me is that even endMission has this problem, which is an engine command.
And I could not find any specific setting that "BIS_fnc_respawnTickets" modifies to make the debriefing look like that.

This also happens if you restore the ticket amount to any positive number, and then end the mission, even with players still alive.

pulsar bluff
#

debriefing = 1;

delicate lotus
#

but doesn't that just toggle whether the debriefing even happens?

#

It does happen after all, but just looks nothing like the specified one / the one that happens without ever running "[west, 1] call BIS_fnc_respawnTickets;".
But I'll test regardless.

#

Even with debriefing = 1; it still happens. I'll try to post two pictures of what I mean with: "What happens" and "What should happen".

pulsar bluff
#

open up bis_fnc_respawnTickets and see what its doing

#

maybe it has its own debriefing hardcoded

delicate lotus
#

I did. It sets some global vars regarding tickets count and thats it.

#

well some more stuff regarding argument parsing and all the different ticket namespaces, but yes.

#

It doesn't even have anything regarding any of the end mission commands in its code.

pulsar bluff
#

also check module functions in case there is some system being initialized

delicate lotus
#

My test mission also does not have any modules.

#

Are there like "ghost" modules?

pulsar bluff
#

check what else is running with copytoclipboard str diag_activeSQFscripts; and also check for events with copytoclipboard str diag_allmissioneventhandlers

#

sometimes those systems have like a "multiplayer module" running

unique sundial
#

@meager granite is here a bug ticket for deletevehiclecrew? I fixed it will try to push it for the next profiling

delicate lotus
#

Regarding the pictures:
This is what happens when the ticket count is modified at all (Not Intended):
https://imgur.com/y3A6pG3
This is what happens when the ticket count is never modified using BIS_fnc_respawnTickets (Modifying the global vars manually seems fine):
https://imgur.com/BPZglJ6

sick lance
#

how many gb is arma 3

delicate lotus
#

copytoclipboard str diag_activeSQFscripts; results in []
copytoclipboard str diag_allmissioneventhandlers results in https://hastebin.com/arirusobin.json.
So this problaby is like a list of eventhandler type and count.
The only culprits that could be it are: Loaded, HandleDisconnect, EachFrame, Ended.
Of these, the most logical ones would be EachFrame and Ended. Is there a way for me to get the code that these event handlers have?

unique sundial
delicate lotus
#

Even if I remove all the event handlers listed by diag_allmissioneventhandlers with removeAllMissionEventHandlers it still happens.
(Checked if they were all gone before running endMission)

sick lance
unique sundial
#

but i have all dlcs

#

and some community

delicate lotus
#

For my actual mission I currently have to work around this by never using BIS_fnc_respawnTickets at all and instead having a custom ticket system and setting the vars visualized by the Respawn GUI myself. But that is very hacky and, in my opinion, should not be necessary. If I specify a specific ending using any of the ending commands it should use that ending like it is defined in the config and not something else.

little raptor
unique sundial
meager granite
#

will do

manic sigil
#

I've got a mostly working AI revive script, but I'm having a devil of a time making sure they don't just keel over dead; as far as I've seen it's related to how much damage I allow before running the actual wounded portion, but it feels like there's no safe level.

_unit addEventHandler 
    ["HandleDamage", 
        {
            params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];

            if (units group _unit findif {isPlayer _x} == -1) exitWith {_unit removealleventhandlers "HandleDamage"};

            if (_unit getVariable ["srd_downed", false]) exitWith {_damage = 0}; 

            if(alive _unit && _selection == "" && _damage >= 0.5 && !(_unit getVariable ["srd_downed", false])) then 
                { 
                    _unit setVariable ["srd_downed", true, true]; 
                    _damage = 0; 
                    [[_unit],SRD_AIRevival_Wounded]remoteExec ["call",0];
                
                }
        }
    ];

I can shoot them in the arms or legs and they'll fall down and run the script, but chest or head and it's instant kill :/

If I turn down the if _damage >= to .1, then it works - but they'll go down at the slightest shrapnel.

granite sky
#

I think you have to block the non-"" selection damage too.

#

oh wait

#

You're not blocking damage at all?

delicate lotus
granite sky
#

Or only by accident. HandleDamage uses the return value to override damage inflicted.

#

Just setting the _damage var to zero doesn't do anything. You need to actually return a value.

manic sigil
#

Ahh, cripes, I see it now.

granite sky
#

also be really careful that it's returning on every path.

manic sigil
#

I will confess, I'm using the Dynamic Recon Ops revive system as a basis, though it's been so stripped down I think it's basically just reference at this point. But I think I stripped down too much :/

granite sky
#

Also if you don't want to change the damage in a handledamage, make sure you explicitly return nil.

manic sigil
#

Yarp, he has a line negating kill damage and then returning at the end of the function.

#

Does that include exitWiths? Like for my second If statement... though I suppose it makes no difference, the reflexive variable was just an attempt to patch this same problem.

granite sky
#

Yes, it does.

manic sigil
#

Would I need to change it, or is leaving the exitWith like that fine for returning the 0 value?

granite sky
#

both of those exitWiths are broken.

#

although I think removeAllEventHandlers does return nil :P

#

just do it explicitly though, avoids non-obvious fuckups where a command returns an unused value.

manic sigil
#

Yeah, there's a lot going on that needs tightening up. The former one works, though, if the player abandons the team - so they don't get the protection anymore. Adding the return and overkill protection worked, though now they take two shots to the head... but I can live with that.

#

And the latter apparently keeps it from firing twice every time they get shot.

unique sundial
delicate lotus
#

Is it intended that the ticket says createVehicleCrew and not deleteVehicleCrew?
@meager granite

manic sigil
#

Hrn... damn, that still hasn't fixed the issue when the script is run in multiplayer.

granite sky
#

Are you installing the EH local to the units?

#

And is their locality constant?

manic sigil
#

Lemme see...

#

the aiRevival function is called on every unit that it create via two different means;

One is serverside, has a if {!isServer} check and all, before calling srd_fnc_AIRevival on the unit.

The second is a trigger, created on the server but set to global, running a function to createVehicleCrew, which is remoteExec'd to the driver of the vehicle.

Both sets of units will die if shot in the head or chest - but weirdly, the script does fire, because they do my groupChat 'i got hit' callout before dying o.0

granite sky
#

So what is your script now? Because the previous one clearly wasn't going to work.

manic sigil
#
_unit addEventHandler 
    ["HandleDamage", 
        {
            params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];

            if (units group _unit findif {isPlayer _x} == -1) exitWith {_unit removealleventhandlers "HandleDamage"; _damage};

            if (_unit getVariable ["srd_downed", false]) exitWith {_damage = 0; _damage}; 

            if(alive _unit && _selection == "" && _damage >= 0.5 && !(_unit getVariable ["srd_downed", false])) then 
                { 
                    _unit setVariable ["srd_downed", true, true]; 
                    _damage = 0; 
                    [[_unit],SRD_AIRevival_Wounded]remoteExec ["call",0];
                
                };
                
            if(_damage >= 1) then {_damage = 0.85};    

            _damage
        }
    ];

It works in SP, for what that's worth.

granite sky
#

If there's no player in the group then you remove the handler?

#

but you said these AIs were created on the server?

manic sigil
#

Yeah, the script creates them on the server side, then assigns them to the player.

south swan
#

would the server transfer ownership if the player isn't a group leader, though?

granite sky
#

I think it does, not sure.

#

It certainly transfers ownership if the player is group leader :P

#

And then the handleDamage won't work because it's on the wrong machine.

south swan
#

so we have like 75% probability of AI locality changing and server-added EH doing nothing O_o

manic sigil
#

But it does partially work?

granite sky
#

In what case does it work?

manic sigil
#

Getting shot in the arms or legs. Torso and head are just straight to death.

#

I've tested with the debug console, no difference in how it's executed.

south swan
#

inb4 somebody asks for "Killed" EH to become override-capable

granite sky
#

Curious. Maybe the handleDamage documentation is wrong and it fires everywhere but only overrides locally.

#

You understand the locality issue, right? You create AI on server, install the EH on server, and then join them to a player group, at which point they're no longer on the server.

#

handleDamage is only supposed to execute for local units.

manic sigil
#

Yeah, I believe I'm following, it's just weird that it'd still work - mostly. Rather than just not working at all?

granite sky
#

Override thing would explain it, but I'm not 100% clear on what you're doing so I'd have to check here.

south swan
#

maybe transferring override over the network works but is just too slow for it to work on oneshots. Or some other meme reason

#

also, i believe certain body parts have their own damage thresholds for unit to get killed

manic sigil
#

This is possible, I am working with SOGPF's weapons, so I'm not sure if they have the exact same damage system :x

#

Lemme put a sqfbin together for the proper file hierarchy.

south swan
#

mag? Does the array get populated at all?

exotic flax
#

you delete the index before deleting the item itself

manic sigil
south swan
#

array deleteAt index returns the deleted element

meager granite
#

Mine class is APERSMine_Range_Ammo

#

you're comparing magazine class to entity class thus it never adds anything

#
    class APERSMine_Range_Mag: ATMine_Range_Mag
    {
        ammo = "APERSMine_Range_Ammo";
#

getText(configFile >> "CfgMagazines" >> "APERSMine_Range_Mag" >> "ammo")

#

to return ammo\entity class that magazine shoots out

#

Or go into config explorer

manic sigil
#

Hrm, referencing DRO's revival system again, it does look like he remoteExecs his eventhandler. I'll give that a try.

south swan
#

yes, you're already using it O_o

manic sigil
#

Well, I didn't break it, but now they're just immortal 🙃

drifting portal
hallow mortar
#

I think that setting is in the Editor mission attributes as well (presumably under Multiplayer)

drifting portal
little ether
#

Hey all, this was working last night, now is throwing errors. All I'm trying to do is attach the trigger to the synced object. Any ideas?

private _suicide = synchronizedObjects thisTrigger; { thisTrigger attachTo _x; } forEach _suicide;

hallow mortar
#

It would be useful to know which errors it's causing

little ether
#

Error attachto: type Object expected Array

#

Actually might have an idea one sec

hallow mortar
#

Yes, it should be thisTrigger attachTo [_x]

drifting portal
#

might wanna use the offset parameter too

#

I assume you are making a car bomb ?

hallow mortar
#

For a trigger on any object smaller than a building, object centre is probably fine.

little ether
#

Goat bomb, but same principle. Explosion on a trigger, suicider may not be in the location he started so I need the trigger to travel with him

drifting portal
#

yeah well you might wanna do thisTrigger attachTo [_x, [0,0,0]];

little ether
hallow mortar
#

This is a goat, right? Is the synchronised object the goat itself, or a goat module?

little ether
#

I'm fairly new to arma coding so let me know if I've got any basics wrong

Goat specifically, although for testing I've also got it on a man and a car, same issue each time

drifting portal
#

Well can you do us a little test, give the trigger a variable name, then do
attachedTo triggerName

#

What does it return?

hallow mortar
#

Where are you actually putting this code - which code field?

little ether
#

I am fucking stupid

#

that's what I am

drifting portal
#

Average status quo format scrippter

little ether
#

hahahahaha

#

of course I put the attach in the activation which required a player to be in it....fucking of course I did

#

Now the question is where the hell can I put it to attach it. Unit leader doesn't want us using object inits

hallow mortar
#

Give the trigger a name, put the code in the mission init inside an if isServer then, and replace thisTrigger with the trigger name

little ether
#

I'm trying to create a small pack of easily placeable set pieces for some particularly uninspired zeus's in the unit, I'm try to avoid anything that isn't just copy and paste in eden, so init is out or that's what I'd do

#

the On Deactivation field, is that just when the stated activation is not met?

hallow mortar
#

No, it's when it stops being met having been met

little ether
#

So I could set activation to Player Not Present - put the attach script in activation

Then have the bomb in deactivation?

hallow mortar
#

I......maybe? That could work. Hell of a hack though.

little ether
#

Nah that doesn't seem to do anything

hallow mortar
#

Not being able to use any init fields or external code files is a pretty major limiter to be honest

little ether
#

Yeah well aware, i've had to use some roundabout logic for these set pieces

hallow mortar
drifting portal
#

Fair enough

hallow mortar
#

Why is it that you're not allowed to use any init fields? They can be unsafe if used improperly, but a simple attachTo is perfectly fine

little ether
#

because they call on every players machines every time someone connects (according to our head zeus) and at 40-60 people an op performance can get a bit rough

drifting portal
#

What

#

So a question

#

Are you going to deploy this script using a composition?

#

Through zeus?

open fractal
little ether
#

If that's possible with trigger that's an option, but also placeable in eden

hallow mortar
#

Wait

little ether
open fractal
#

yea exactly

little ether
#

huh

hallow mortar
#

For Zeus-placed compositions you can't use an if isServer check, because when placed in Zeus the init only runs on the client that placed it

#

In the Editor it does run on every machine, but not Zeus

drifting portal
#

Thats why i asked

hallow mortar
#

For Zeus compositions you may also need to add a small sleep, because the init doesn't wait until all the objects in the composition exist - it may create the trigger, run its init, then create the object you want to attach it to (too late)

drifting portal
little ether
#

I've sent a message off to the head zeus so I'll see what he thinks of that approach

#

Otherwise I really can't think of a way to do it, attach a trigger to an object without init or outside code

proven charm
#

I would make sure "EntityKilled" is called for mines by putting some print there

#

also i dont get why you delete index 0 and not the mine's actual index...

broken stirrup
#

Hi, I have a quick question if anyone is willing to lend a hand. I'm trying to disable Collison for certain units and it seems that whenever an object initiates the script it only applies to the last line of it, only disabling collision for one unit. In my case whenever I apply the script, collision is disabled for the unit named "p3" and the others are ignored. Any idea what I may be doing wrong?

Script I Used:

this disableCollisionWith p1;

this disableCollisionWith p2;

this disableCollisionWith p3;

warm hedge
#

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

open fractal
#

maybe

{ _x disableCollisionWith this } forEach [p1,p2,p3];
```?
#

unless I'm remembering wrong

broken stirrup
#

Let me try it out, thanks for the quick response

open fractal
#

i think it's stored to the object in the first parameter

warm hedge
#

Well, true IIRC

broken stirrup
#

Unfortunately it seems like the same issue again, only the object named "p3" has collision disabled. Is there any other possible script or have I hit a dead end?

open fractal
#

you may be out of luck

broken stirrup
#

That's alright, I'll try to tinker around with some other methods that could possibly work. Either way thanks a lot for the help, always nice to get a second opinion.

proven charm
#

you could find the _unit in the array and get the index then deleteAt that index

#

yes IDK if it does

south swan
#

or do array = array - [_unit]. Or just run array = array - [objNull] before trying to add a new one to get rid of destoyed objects. Or any number of other solutions.

#

not like anyone is gonna notice a performance difference on 3-length array

proven charm
#

i forgot that simplest option 😀

south swan
#

at those lengths i'd go for a separate watchdog cycle to do all the maintenance once every, say, couple of seconds 🤷‍♂️

#

just a separate piece of code that does all the maintenance outside the EH

steady matrix
#

Don't know if we have any ACE gurus here, but I'm trying to figure out a way to detect damage to a unit, or check their wounded state. I know that there are options for enabling a "Sum of Trauma" death state - what I'm wondering is, if there is a way to find out what a unit's current "Trauma" value is.

#

I was initally going to use 'damage' method, but this doesn't work with ACE Medical because of how damage is interecepted and converted to wounds.

#

It also does not appear to work with 'Lifestate' either, as they seem to not be in an 'injured' state.

stable dune
open fractal
#

you can find the function on their github if you want to see the variables

steady matrix
#

Oh awesome, thanks for the Discord link, and the info!

open fractal
#

ace medical handles just about everything differently so I highly recommend looking at their docs if you want to script with medical

granite sky
#

Looks from the code like that's working as intended?

#

Maybe describe exactly what you're trying to do.

#

That's way simpler than what you wrote :P

#
MRTM_spawnedAPERSMine_Range_Ammo = [];

addMissionEventhandler ["EntityCreated", {
  params ["_entity"];
  if (typeOf _entity != "APERSMine_Range_Ammo") exitwith {};
  if (count MRTM_spawnedAPERSMine_Range_Ammo >= 3) then {
    deleteVehicle _entity;
  } else {
    MRTM_spawnedAPERSMine_Range_Ammo pushBack _entity;
  };
}];
#

...what

#

I have never used EntityCreated so it might be bugged to hell, but otherwise yes.

vague geode
hardy valve
#

Any working scripts i can place into the init field of "playable" unit/character for them to respawn on starting position? When they are controlled by AI they always respawn on their group on custom warlords game mode instead of back at base as a player.

sharp grotto
#

Is there any way to detach the weapon from a dead player ?
So when i delete the corpse the weapons doesn't get deleted with the corpse ? 🤔

young current
#

you would have to create a new groundholder and put same weapon into it

sharp grotto
#

Yea thought, but also thought there might be an easier way 😅

#

guess i just move the body to [0,0,0] and add it to garbagecleaner
that leaves the weapon there #Lazy

broken stirrup
sharp grotto
broken stirrup
#

Ok then I'll run it back a bit. Is there any way to keep AI contained within a certain radius, (let's say within 100 meters of a certain point) while keeping their ability to move? I'm building an OP that has the players moving from village to village and I want to keep a dynamic flow of combat going, but I don't want the AI pissing off into the sunset randomly. My solution originally was to surround the area with invisible walls and then disable collision for players. But since that would be impossible, is there any other alternative anyone can recommend?

broken stirrup
#

Thanks will try

wispy gorge
#

I'm not quite sure what the issue is here, I don't think I'm missing a semi-colon but the error message says I do. Can someone take a look real quick?

winter rose
#

use set

wispy gorge
#

Yep, I realized that as soon as I posted lol

#

That error seems to have gone away

#

but now my script doesn't seem to be going past an if statement

#

if ((_radioList select _forEachIndex) in uniformItems _player)

#

I'm not sure if it's because of (_radioList select _forEachIndex) or in uniformItems _player

winter rose
#

if you don't get an error message, there's no error

misty epoch
winter rose
#

well, if you use -showScriptErrors it is :p

misty epoch
#

Even then, some errors don't pop up

copper raven
#

yep, if one of those variables is undefined, and it's unschd, it will fail silently

winter rose
#

yep

#

hence why sometimes the debug console is not one's best friend :'(

tough abyss
#

I used to use [] spawn {offending code}

pseudo ridge
#

What is the best way to get all Weapon Holders in the server?

pseudo ridge
#

@copper raven this function take 62 ms to find the weapons holders. I was hoping there was something faster. Thanks.

#

entities or nearEntities don't work on Weapon Holders 🫂

copper raven
#

yeah

#

well, you can use event handlers and track stuff manually

#

like Put or Killed

#

then use nearEntities or something

#

you can also use schd code, and compute nearEntities in a grid kinda way (piece by piece of the map)

pseudo ridge
#

I will use scheduled allMissionObjects so i have sure to generate no freeze

copper raven
#

it will freeze regardless

pseudo ridge
#

This is why scheduled not make much difference, sch allMissionObjects takes 80 ms.

copper raven
#

you can't measure sched code properly anyway, so it makes no sense, if a command call halts the game, moving to scheduled will not make it magically not freeze, scheduler suspends between instructions, not within command call

pseudo ridge
#

I understand

#

But i need to use nearestObjects or nearObjects, because nearEntities don't get Weapon Holders.

copper raven
#

the latter is faster iirc

meager granite
#

Ground weapon holders could use a dedicated list, such a pain to iterate through them for cleanup purposes

tough abyss
#

Why aren't they cleaned up by default?

#

Doesn't corpseManager handle them?

meager granite
#

No idea, I want my own cleanup logic

plush belfry
#

Is there a way to make a custom hint for the function call BIS_fnc_advHint;?

plush belfry
open fractal
#

yeah

#

it's one of the supported configs

plush belfry
open fractal
#

i'm just lookin at the wiki

#

but sure

tough abyss
#

@plush belfry Add create a separate file

#

then add the entry to the include in description.ext

#
#include "hint/cfgHints.hpp"
plush belfry
tough abyss
#

So make your cfgHints class

#

Put it in it's own file

#

name it cfgHints.hpp

plush belfry
#

oh okay

tough abyss
#

That way it's not cluttering up the description.ext with a slab of classes

#

They will be included into the description.ext at mission run time but you'll have a common place to edit it from.

copper raven
unique sundial
meager granite
#

But because the command is slow it still produces microfreeze which isn't good for server-side

#

So I ended up tracking all GWHs with InventoryOpen and Put event handlers

#

Ones dropped from units can be get with entities "WeaponHolderSimulated"

unique sundial
#

so you do the whole map at once? why not separate map into sectors and do smaller cleanups but more often?

fading magnet
#
class CfgPatches{

    class FirstAddon{

        name = "FirstAddon";
        author = "Me";
        url = "http://pewpew.com";

        requiredVersion = 1.60;
        requiredAddons[] = { "CAWeapons"};
        units[] = {};
        weapons[] = {};
    };
};

class cfgWeapons{
  class Pistol;
  class M9: Pistol{
      begin1[] = {"/m9",1,1,800};
      soundBegin[] = {"begin1",1};
  };
};

I'm trying to make an alternative sound for m9 pistol as practice, but it doesn't change the sound in game. I dunno what I'm doing wrong :(

#

arma 2 btw

fading magnet
unique sundial
#

@meager granite 8 allobjects 0 way way faster

meager granite
#

{8 allobjects 0 select {typeOf _x == "GroundWeaponHolder"}}

little raptor
meager granite
#

compared to
allMissionObjects "GroundWeaponHolder"

little raptor
#

but at least no freeze in scheduled

meager granite
#

I would've checked if diag_codePerformance wasn't disabled for clients

unique sundial
#

you disabled it?

meager granite
#

No it does single cycle only in MP

little raptor
#

for loop 😛

meager granite
#

For security purposes, this command will only run for 1 cycle in multiplayer, unless in-game debug console is available via description.ext option or Eden attribute setting.

unique sundial
#

if you don’t have debug console enabled

meager granite
#

I don't because enableDebugConsole[] = {"76561198018221755"}; also allows the console for logged admins

#

instead of listed UIDs only

#

What security purposes btw? Freezing the server/client with cheats?

unique sundial
#

because you can execute a lot of code very quickly

#

sky is the limit

#

does it have to be ground weapon holder or any supply will do?

meager granite
#

If the security reason was freezing the server, then you can easily do for "_i" from 1 to 2 do {_i = 1}; to kill it as cheater anyway (do not execute in scheduled, freezes the game completely)

meager granite
unique sundial
#

even when you open it on vehicle?

meager granite
#

Though there is now another way, server-side EntityCreated mission event handler

#

so you can manage the list yourself

meager granite
unique sundial
#

yeah but temporary

meager granite
#

If you drop something into it, it stays

unique sundial
#

if you don’t drop anything it is deleted

meager granite
#

Either way, issue is script-solvable with EntityCreated or allObjects now

#

Was much more problematic before

unique sundial
#

did you check how long the ordered vehicles list gets by the end of the game, including nulls?

meager granite
#

Lemme see on a live server

#

Do you mean 8 allObjects 0?

unique sundial
#

no -1 allobjects 8

#

count (-1 allobjects 8)

meager granite
#

Oh, -1 is 2.12

unique sundial
#

ah true

meager granite
#

count (8 allObjects 0) => 261 on a 80 players server 30 minutes in

unique sundial
#

nah not the same, that list is never resized could get very long if you create delete

meager granite
#

I guess you have to stay the whole round in to see how many nulls there are

#

as rejoining would wipe it?

unique sundial
#

not sure about that

#

i think it might be jip

meager granite
#

sent from the server?

#

interesting

#

Well if you can hack yourself to connect to 2.10 server with 2.12, you can check it yourself

unique sundial
#

in which case the longer the game runs the longer this list will be

#

can ask @still forum to add it to perf as an exception

meager granite
#

Its KotH though, so not that many objects with pretty aggressive clean up

#

So around 100 times faster again

unique sundial
#

you are building an array but if you just use it after condition could be faster

meager granite
#

0.0319824 without select

#

Viable either way, while allMissionObjects is unusable during gameplay at all

#

So problem is pretty much solved as of 2.10

unique sundial
still forum
unique sundial
#

still slower

unique sundial
still forum
#

Then I don't know what you are referring to, I assumed

Well if you can hack yourself to connect to 2.10 server with 2.12, you can check it yourself
?

unique sundial
#

allObjects tweak

still forum
#

Ah, can do that if we don't document it, I'll put it on the list for v5

unique sundial
little raptor
unique sundial
#

speed

little raptor
#

the command is not that fast anyway meowsweats

unique sundial
#

it is the fastest it could get

little raptor
#

I mean not fast enough for array arg to matter

little raptor
#

supporting array of types

unique sundial
#

thats the worst for speed

little raptor
#

not just allObjects

unique sundial
#

you have plenty of tools to play with this command is built for speed.

little raptor
#

you no longer have to write slow selects anymore

meager granite
little raptor
#
  • cfgAmmo + cfgNonAIVehicles I guess
meager granite
#

I see such command being useful, no urgent need for it though

#

I'd make it even more universal though

#

Idea: ARRAY/OBJECT/STRING isKindOfList ARRAY
Left argument being object, class name or array of these
Right argument being list of branches for isKindOf check and list of strings for exact matches

#

Kinda lost faith in such idea a bit while thinking about it though, not sure if worth it

#

vehicles isKindOfList [configFile >> "CfgVehicles" >> "Air", configFile >> "CfgVehicles" >> "Ship", "I_Heli_light_03_F"]

little raptor
#

how is that more universal?

#

_arrayOfObjs selectObjectClasses [ ["class1", "class2", ...], (exactMatch = false)];

meager granite
#

Lets you compare list of against both branches and exact classes

#

Not sure if its really needed though

little raptor
#

this one also has exactMatch parameter

meager granite
#

Mine lets you have both at once

#

List of classes + list of kind ofs

#

as well as comparing non-entity configs

#

questionable practical usage though

little raptor
#

the O one says МИНЫ

#

on the MFD

#

it's for OPFOR

#

yeah

meager granite
#

Happens somewhat consistently on live games, maybe you guys can prepare special EXE with logging to figure why it might fail?

unique sundial
#

the player is alive and in the game?

#

is he in allServerPlayers?

meager granite
#

I think server sees him fine because my kill feed generated by server shows his side properly

#

while client shows him having no group

unique sundial
#

what geUserInfo returns?

#

sorry allUsers

meager granite
#

Didn't check, but I bet its all fine on server side

#

Gonna collect more info but so far it seems to be client-side issue

#

Clients randomly see players broken - no group, isPlayer=>false, getPlayerUID=>"", all that stuff you seen in that output

unique sundial
#

can you collect info from all clients including server when this happens?

meager granite
#

Going back to lobby and joining again helps

#

Alright, I'll setup some kind of data poll

#

This is a very old issue I believe, I remember it as long as I did scripting, back in 2012 in A2OA, some players randomly not included in playableUnits, no UID, etc.

unique sundial
#

when group goes after respawn or randomly

meager granite
#

Not sure, but them respawning doesn't fix it

#

They still respawn without a group

unique sundial
#

can they be using hacked exe?

meager granite
#

Doubt it, happens very often, several times per round for random players

#

Not sure about exact frequency but I see it very often

unique sundial
#

ok good then you can log all the info plus do jip queue and log entities

meager granite
#

Will calling exportJIPMessages "somefile.txt" suffice on stable server exe build?

unique sundial
#

and any errors server spits out?

meager granite
#

Alright

unique sundial
#

i think what does it say on the wiki page

meager granite
#

Was unsure if I needed prof exe or any will do

unique sundial
#

dwarden uses it in official servers so should be fine maybe

open hollow
#

idk if this is the same issue

meager granite
#

@unique sundial Sharing a bit of observation. Ran each frame on a live server to find player units that aren't player:

entities "Man" select {toLower typeOf _x find "soldier" >= 0} select {alive _x} select {!isPlayer _x}
```(Only players use classes with "soldier" in it)
then logged how long they remain in this state.

19:27:06 [132279,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132280,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132281,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132282,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132283,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132284,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132285,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132286,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132287,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132288,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132289,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132290,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132291,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]
19:27:06 [132292,[[24924ea2880# 1786670: ia_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"Slava",false,false,false]]]]

19:27:31 [135145,[[24a12e20c00# 1787151: b_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"BigCoolBoy85",false,false,false]]]]
19:27:31 [135146,[[24a12e20c00# 1787151: b_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"BigCoolBoy85",false,false,false]]]]
19:27:31 [135147,[[24a12e20c00# 1787151: b_soldier_01.p3d REMOTE],[[true,<NULL-group>,UNKNOWN,"",false,"BigCoolBoy85",false,false,false]]]]

#

log is diag_frameNo, then entity and same array from original message I linked to

#

Gonna setup proper polling from each client later, but maybe this info can give you an idea what might be going wrong on engine side

unique sundial
#

what is the array format

#

respawn happens locally then unit sends the info to the server then server updates everyone. This is why it is important to know who sees what, you, server, client

meager granite
#

just a hasty logging I did, list of problematic units, then that list with isPlayer, getPlayerUID commands ran on each item

meager granite
unique sundial
#

the only difference is when player spawns for the first time when joining

#

then it is pretty much client driven

meager granite
# unique sundial what is the array format

Array format is the same on as in linked message: [alive _x, group _x, side group _x, getPlayerUID _x, isPlayer _x, name _x, _x in allUnits, _x in playableUnits, _x in switchableUnits]

meager granite
unique sundial
#

if there is no group any commands about units would not succeed

pulsar bluff
#

@unique sundial can we extend the "skipLobby" to allow connection to randomized slot

#

like skipLobby = 1; joins first available skipLobby = 2; joins random

#

with exception of headless client

#

this would bypass the "stuck on receiving data" issue

unique sundial
finite imp
#

Hello guys, short question. Im trying to implement respawn into my missions (first time!) and am trying to achieve different respawn templates for East and West.
I'd like for East to respawn after 5 minutes, in waves, inside their base. During respawn, they should have access to spectator mode.
For West, I'd like them to have the singleplayer death screen so that they get forced back to the Slot-In screen. ALTERNATIVELY, if that does not work, I'd like them to have access only to the spectator mode, and no respawn.

I added this to my description.ext

respawn              = 3;
respawnDelay         = 300;
respawnTemplatesWest[] = { "Spectator" };
respawnTemplatesEast[] = { "Wave", "Spectator" };

But BLUFOR keeps respawning after the timer ends. OPFOR is working fine and as intended, but BLUFOR keeps respawning inside their base unfortunately. Anyone know what I am doing wrong?

pulsar bluff
#

I suspect theres an objnull/grpnull/"error: no unit" player actually in that slot

#

so it gets evaluated as empty and joinable

#

i never solved the "error: no unit" issue, just papered over it by not using (name player)

#

i guess i could boot the player back to lobby if their name is returning as error no unit

simple ore
#

Does Bohemia have any documentation yet on utilizing terrain deformation? We were looking at creating a weapon that can "terraform", but I'm not finding much on the topic since it's so new. I'm pretty sure we can only raise/lower the terrain and can't use it to dig underground just with how the engine is, am I correct on that?

#

I didn't want to post this in #arma3_terrain since the use case is a bit different.

pulsar bluff
#

i can usually see the bugged player as they appear as yellow objects in Zeus

meager granite
#

It happened on usual lobby units servers too

hallow mortar
simple ore
#

At least we can raise/lower the terrain, so it's use case for creating trenches is there. I come from sci-fi land so for us this would be nice to implement.

little raptor
#

you can create tunnels by lowering the terrain first, then placing objects on top with the same texture as the terrain texture

upper siren
#

any way of attaching curator EHs to zeuses that are created by other mods like ACE?

copper raven
#

im sure ace would have it's own events of some sort that you could hook into aswell

upper siren
upper siren
#

ah and filter that for "curator entities"?

copper raven
#

yes

copper raven
#

look into the config

hallow mortar
#

The ammo the mine dispenser itself fires is APERSMineDispenser_Ammo, but you should look that up in CfgAmmo and see if it has submunitions, because I've got a feeling that's not the actual mines

#

You could also just spawn one, use it, and do typeOf cursorObject on one of the mines

dense galleon
#

ok so say you make a mod that changes the main menu background and one of the spotlights, but you want to also use another mod that has its own custom main menu , is it possible to choose which one runs / decide priority? or will they just clash? (this involves scripting so id assume its ok to ask this here)

sullen sigil
#

im back bitches and i need help (again)

#
{
    params ["_value"];
    if (Six12th_Core_Settings_FreeFallHeight_Enabled) then {
        player setUnitFreefallHeight _value;
    };
    this addEventHandler ["Respawn", {
        params ["_unit", "_corpse"];
        player setUnitFreefallHeight _value;
    }];
}``` this script is run on the player after init or when the option is changed in cba settings, however doesnt actually seem to be changing the freefall height upon respawn
#

have any of you got any clue why that is

#

(it works upon initial spawning in perfectly fine, just not after the player has died in either mp or sp)

sullen sigil
#

it is under CBA however i have tried using player as well and it did not work

distant oyster
#

this is usually only defined in the init box of an object, do you have a link to the cba documentation?

sullen sigil
distant oyster
#

welp time to add debug statements. add one before and after the if statement, one in the if code block and one in the eh code to make sure which parts of the code are failing. i also find the opening and closing brackets very weird, you sure this is correct?

winter zephyr
#

For a trigger condition, can I use !Alive [vehicle classname], or is that only for specifically named variables?

warm hedge
#

What exactly you want to achieve?

winter zephyr
#

A trigger to check to see if all of a vehicle class is destroyed. The vehicles are spawned with some randomization, so I'm not currently giving them specific variable names.

#

So would !Alive B_MRAP_01_F return anything?

warm hedge
#

No, alive only checks an object

winter zephyr
#

Okay. I could use a count then and set it to == 0

warm hedge
#

Probably the easiest and reliable way is to use an array that contains all of your objects and check if all of them are dead

winter zephyr
#

...meaning I'd need a way to name them all?

warm hedge
#

no

#

Can you, let's say make an array and add the object in it when you spawn them?

winter zephyr
#

Is there some way to make something like this work?:
count [B_MRAP_01_F]) == 0 ...or countType ?

warm hedge
winter zephyr
#

That's similar to what I found here:
https://forums.bohemia.net/forums/topic/232737-creation-of-trigger-condition-destroy-or-incapacited-tank/?do=findComment&comment=3429501
The last step I don't get yet is how to use the classname to populate the array.

warm hedge
#

You don't

#

Actually, you can, but I can say the way is performance unfriendly so I wouldn't recommend

winter zephyr
#

Yes. I hadn't considered that it'd be more performance friendly to do it that way, but I see at your link that it can stop when it finds one remaining.

#

Looks like the trigger modure doesn't like waitUntil as a condition: "Condition Type Nothing, Expected Bool". As far as I can tell this setup should return a bool:
waitUntil { [unit1, unit2, unit3] findIf { alive _x } == -1 };

stable dune
#

Hello,
Is there already avaible "reArm" command, if not.
Which is the easiest way get unit starting medical items and rearm those from box without opening and selecting items. I mean if i have 10 bandage, 10 Morphine, 10 splint at start. I use 5 all of them. And when i click box it returns all med items back to 10.

open fractal
#

just get rid of the waitUntil. what you wrote is intended for code in the scheduler, not for triggers

winter zephyr
#

That's left me with {["array"] findIf { alive _x } == -1 }; and it warns that the return type is code instead of Bool.

open fractal
#

don't randomly put brackets around it

winter zephyr
#

Yeah, just figured out they needed to have gone with the waitUntil.

winter zephyr
#

Well, can't test quite yet due to some other issues, but that should get me started. Thanks all!

cursive lake
#

Im trying to get images on billboards, but only a white screen appears. Tried paa png and jpg and it finds the image, but displays a white picture.

plush belfry
#

"All textures must have a resolution of 2^x × 2^y (16×16, 16×32, 64×256, 512×512, ...). The largest texture size supported by the RV engine is 4096×4096"

#

What is the best way to display information to the user besides a simple hint?

winter rose
plush belfry
winter rose
#

speak here if you encounter any issues, the channel is here for you 🙂

proven charm
#

do all unscheduled calls run the same max time? like "EachFrame" etc

little raptor
#

What max time?

#

unschd has no timer

proven charm
#

like scheduled has max of 3ms i think

little raptor
#

unschd doesn't have any limit like I said

proven charm
#

they all the same?

little raptor
#

Yes

proven charm
#

ok great, ty 🙂

little raptor
#

Instead of a timer, your script directly affects the FPS when it exceeds a few ms

proven charm
#

yep

plush belfry
#

So I am trying to get custom hints to work, here's how my files are setup within the mission folder,

cfghints.hpp:
https://www.sqfbin.com/evofibovikeratocabeh
(Disclaimer: I copy pasted the sample on the wiki to make sure of no human error, I have tried editing the sample before to suit my own needs but in game the hint does not change despite changing text in the file itself)

description.ext:
#include "hint\cfgHints.hpp"

My question is, how do I get the hints that the game reads to be from the mission folder instead of the arma 3 directory, it tries to find the custom hints in the arma 3 directory, is there a seperate syntax for that? Because I try using this, [["Common", "GPS"]] call BIS_fnc_advHint;, with the respective class names changed, nothing more is added

proven charm
#

@plush belfry you probably need to put the CfgHints into description.ext

#

im only guessing because havent used this my self

granite sky
#

@plush belfry It should work. BIS_fnc_advHint uses BIS_fnc_loadClass which checks missionConfigFile first.

#

(anything in description.ext goes into missionConfigFile)

#

maybe check in config viewer that your stuff is actually loaded.

cursive lake
plush belfry
hallow mortar
#

That's not an exhaustive list, it's a list of examples that fit the 2^x * 2^y formula

#

1024x512 is valid

compact maple
#

Hi, I have an array of objects, how can I pick the closest one from the player? should I use apply?

plush belfry
hallow mortar
compact maple
#

Thank you 🙂

plush belfry
granite sky
#

If you're finding vanilla stuff then you're in the wrong place. Look in missionConfigFile not configFile.

upper siren
#

question about setVectorDirAndUp and its reference frame

#

I've got this code snippet I'm executing from debug console while looking at the rear of the vehicle

_flag = "pook_Flag_vehicle_UNO" createVehicle position player;
_flag attachTo [cursorObject,[0.687,-1.482,-0.23]];
_flag setVectorDirAndUp [[0.988,0,0.15],[-0.15,0.011,0.989]];
_flag setPosWorld getPosWorld _flag
#

wait wtf... ignore for now 😄

ocean folio
#

is there any way to associate a piece of gear with a specific player?

#

I'm hoping to do something where everyone can put their gun in a car and easily find which one is theirs

#

I could always do an ace interact and just store the weapon and attachments into the "vehicle" and just shove them in the vehicle's varspace, but I was hoping to go through the regular inventory

sharp grotto
#

Don't think there is any way that would work with duplicates

kind cedar
#

Init for unlimited ammo for mortar?

open fractal
#
this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]
smoky wagon
#

is there a (vehicle player) variable but for other players?

winter rose
smoky wagon
#

ah i was wondering if there was a way cause i'm tryna replicate Ace combat 7s intros but with the ability to choose your own vehicle.

open fractal
#

you can use vehicle with any unit variable

smoky wagon
fair drum
#

are there any getters for setAmbientColor setLightColor?

warm hedge
#

No

fair drum
#

maybe i can do a workaround with getLightingAt

warm hedge
#

Maybe, yeah

hallow mortar
#

If it's your lightpoint, you could save a variable on it with its properties when you create it

ivory lake
#

Feel like i'm having an empty brain moment, is there a good way to get the distance between two objects? 'distance' 'nearEntities' etc all seem to use the model center.

The scenario i'm having is I have a grenade, I want to find objects within 2m of the grenade. But if the grenade lands behind or otherwise near to a tank, the tanks center can sometimes be greater than 2m away even though the grenade could be right behind the exhaust or next to the track

#

using lineintersects and taking the returned positions of the first intersect usually gives a more accurate distance but that seems kinda expensive

winter rose
ivory lake
#

hmmm how so? I vaguely recall having done something similar in the past but I'm drawing a blank on the actual details 😬

meager granite
#

Do something like tank worldToModelVisual getPosWorldVisual grenade and compare it against boundingBox tank

#

Probably can use position inArea [center, a, b, angle, isRectangle, c] with these arguments taken from boundingBox with whatever margin you want, might be faster than script ifs

ivory lake
#

yeah I saw that alt syntax for inArea and was curious how fast it was

meager granite
#

boundingBox also returns boundingSphereDiameter, might be useful too

#

Won't be that good for long objects to check distance against, but maybe such error is acceptable for you

ivory lake
#

tanks and trucks are probably the biggest things I'm caring about

#

I'll play around with inArea with the boundingbox corners, seems like a good possible solution

meager granite
#

@ivory lake Got curious myself and wrote this:

    private _bbox = 0 boundingBoxReal tank;
    private _center = _bbox # 0 vectorAdd _bbox # 1 vectorMultiply 0.5;
    private _box = _bbox # 1 vectorDiff _bbox # 0 vectorMultiply 0.5;

    tank worldToModelVisual ASLToAGL getPosWorldVisual grenade inArea [_center, _box # 0, _box # 1, 0, true, _box # 2];
#
tank worldToModelVisual ASLtoAGL getPosWorldVisual grenade inArea [_center, _box # 0 + _margin_x, _box # 1 + _margin_y, 0, true, _box # 2 + _margin_z];
```to add margin to bounding box in meters
#

Some bounding boxes make no sense though, so it will depend on how much modeller messed it up

#

tank is zamak, grenade is player and hint is output of the function on the screenshot, seems to work fine

#

Not really a distance to bounding box, but at least very fast calculation

hallow mortar
#

Use the alt syntax for boundingBoxReal with clipping type 0 for a more accurate result

meager granite
#

True, 0 boundingBoxReal fixes that

ivory lake
#

oh cool

#

that looks pretty solid tyvm

meager granite
#

@ivory lake Forgot ASLToAGL, added to the snippet

#

0 boundingBoxReal on problematic Zamak

ivory lake
#

yeah without 0 the bounding box includes stuff like memorypoints and the like

#

so you end up with stuff like... that

meager granite
#

diag_codePerformance => [0.00355,100000] aviator

ivory lake
#

that's definitely better than my first attempt with lineintersect

winter rose
#

well, lineIntersects is just a true/false
lineIntersectsSurfaces would give you the intersection's posASL, from which you can get distance

ivory lake
#

that's what I meant sorry

#

ok just tested it out and yep its working great

#

even works well with units

meager granite
#

👍

tough umbra
#

how do i make pistol ammo explode on impact?

winter rose
meager granite
#

serverCommand returns true regardless of whether password was correct or not 🤔

Return Value:
    Boolean - true if password is correct

diag_log ["123321a" serverCommand "#logout"];

2022/09/14, 18:26:37 [true]
2022/09/14, 18:26:37 Failed attempt to execute serverCommand '#logout' by server.

diag_log ["123321" serverCommand "#logout"];

2022/09/14, 18:26:39 [true]
2022/09/14, 18:26:39 Successfull attempt to execute serverCommand '#logout' by server.
#

Anybody dealt with serverCommand and checking if password is correct?

pulsar bluff
#

for most incorrect setups i have some logging, but i have nothing to log whether serverCommand will work

#

thanks for saving me the time of writing something that might not work !!!

meager granite
#
2022/09/14, 18:49:55 [true]
2022/09/14, 18:49:55 Successfull attempt to execute serverCommand '#exec 1' by server.
2022/09/14, 18:49:55 1
2022/09/14, 18:49:57 [true]
2022/09/14, 18:49:57 Failed attempt to execute serverCommand '#exec 1' by server.
```same picture with other commands
#

I guess its a bug? @unique sundial

pulsar bluff
#

i mean i guess it always returning true prevents easy password cracking?

meager granite
#

Brute forcing isn't that easy

#

Isn't easy in a sense that it would slow down the server to get decent rate, and since you hacked the server to execute SQF on the server side, might as well kill it in myriad other ways

unique sundial
unique sundial
#

it is definitely not the password is right

#

there is no return on command fail or success

#

there is only return on whether the command when through all stages of verification and is attempted

meager granite
#

Wish it was, to know if you can use server commands. My use case would be changing the mission with #mission through voting screen, but I'd like to know if provided server password is correct or not beforehand (so people don't vote and then nothing happens), if password is incorrect, then only provide voting options within current mission

#

As an idea serverCommandPasswordTest STRING with a 1 second timeout so you can't use it to brute force passwords

#

or serverCommandPasswordCheck

granite sky
#

can't you just use serverCommandAvailable with admin-specific commands?

#

oh, I guess if you're using the password form...

meager granite
#

Yeah, I want scripted admin command usage through serverCommand

unique sundial
#

passworded version is server only

#

are you planning to give people access to server side?

meager granite
#

No, I just want to wrap up #mission command with a proper in-game UI

exotic flame
#

How can i set walk to default on a server ?

meager granite
#

But I'd like to know if server admin provided the correct password beforehand, so I can hide serverCommand options if it isn't

#

Practically this ^

#

If server password is invalid, only show towns on current island

#

Otherwise also include other islands so server switches the mission once vote ends

#

Not critical as I can say its admin's fault for providing wrong password in config, but I expected serverCommand to work as described:

Return Value:
    Boolean - true if password is correct
unique sundial
#

so you want to authenticate player by whether or not they know server password?

meager granite
#

No, players won't do anything with the password or commands

#

Server admin provides password in server setup addon and I'd find it useful to check if password is correct and know that serverCommand will work, before I offer options to players

#

Expected to be able to check by looking at wiki, but apparently its not possible, thus the idea for command to check if password is valid before running serverCommand stuff

#

Ifs its a wiki description issue and not a bug and checking password validity is a security concern/philosophy issue then nevermind, I'll manage without it

unique sundial
#

There is some sort of counter of failed attempts so dont think brutal force will work, the client is free to ban itself after n attempts

meager granite
#

Meant a brute force in case cheater gains access to executing any SQF on server-side

#

To then brute force it to find out server.cfg's serverCommandPassword

#

Not sure why they'd want that as they can already mess up the server as they want though

wind hedge
#

Quick question: Can the select command used like this duplicate the markers it adds to the "_activeMarkers" array or will it act more like "puchbackUnique"? sqf _activeMarkers = allMapMarkers select { private _markerPos = getMarkerPos _x; ((allPlayers - entities "HeadlessClient_F") findIf { (alive _x) && (_x distanceSqr _markerPos < 800^2) }) != -1; };

meager granite
#

it won't have any duplicates as allMapMarkers doesn't

#

Small tip: move (allPlayers - entities "HeadlessClient_F") outside of select so its not calculated over and over for each checked marker

#

private _players = allPlayers - entities "HeadlessClient_F"; and use _players inside select

unique sundial
#

@meager granite clearly the wrong description on wiki

#

I cannot make it return true is password correct because it returns true for many other reasons as well

meager granite
#

Lets just correct the wiki then

#

Up to you since you know exactly what it returns

unique sundial
#

i don’t know what to write it returns true for many reasons inconsistently too

granite sky
#

@wind hedge inAreaArray is much better than findIf+distance unless the findIf it hitting early almost every time. And yeah, pull the player array calc out of the select.

#
private _players = allPlayers - entities "HeadlessClient_F";
private _activeMarkers = allMapMarkers select {
    _players inAreaArray [markerPos _x, 800, 800] isNotEqualTo []
};
unique sundial
patent lava
#

how to properly scale decals? if it is at all possible without side effects

pulsar bluff
#

“hey your passwords arent matching. X and Y will not work”

pulsar bluff
#

in my opinion the EH should be baked into servercommand and we just have to define the code it executes

unique sundial
#

to put in same container as server.cfg
why? You get server log on every successful or unsuccessful attempt

#

Also this is not what @meager granite was asking, making it server.cfg event would be beyond useless

#

[true,"#kick 5","SERVER",2,""]

open flume
#

So in Ace3 im trying to have it so that if a person has a specific item in their inventory they can put it on ai or other players.
Ive been trying to figure it out but idk how to do it with the ace interaction menu.
I have the menu itself but just not the adding the item to the target

vernal venture
#

I feel like I'm missing something simple. When I try to call this script in an object init, it tells me undefined variables in expression "_this" and "_crate". There's a format for calling it that I'm not doing right, isn't there?

_items = ["ACE_quikclot","ACE_elasticBandage","ACE_bloodIV","ACE_bloodIV_250","ACE_bloodIV_500","ACE_epinephrine","ACE_morphine","ACE_tourniquet","ACE_surgicalKit"];

_crate = _this select 0;

clearBackpackCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearWeaponCargoGlobal _crate;
clearItemCargoGlobal _crate;

{
    if (_x != "") then
    {
        if ("B" in [_x splitString "_" select 0]) then
        {
            _crate addBackpackCargoGlobal [_x, 5];
        }
        else
        {
            _crate addItemCargoGlobal [_x, 5];
        };
    };
} forEach _items;