#arma3_scripting

1 messages Β· Page 101 of 1

queen cargo
#

cant be that hard

#

a vodka bottle

#

and its good to go

thick merlin
#

Thanks guys.πŸ‘πŸ»

fallen locust
#

well the thing is you will notice that comands to retrive contents of containers withing containers return doubled info and stupid crap

#

comands for inventory handeling dont really complement eachOther

#

especially

#

getItemCargo, everyContainer

queen cargo
#

grim ... dont make me do that ... PLEASE ... i already have like a ton of shit still to do :(

  • Fallout 4
  • OOS
  • XMS2
  • Study (ye ... i actually DO have a RL too :P)
native hemlock
#

@queen cargo I'm guessing you are being sarcastic, but it's not really redundant when it has different functionality, especially when the BIS function uses a command that would extend the scripts run time by like 200

fallen locust
#

X39 dont forget external UI

candid sun
#

which command is that pennyworth?

queen cargo
#

ha ... not even thought about starting that one yet @fallen locust :P

native hemlock
#

saveprofilenamespace

fallen locust
#

@queen cargo i dare you to do it :P

#

both things :P

queen cargo
#

@native hemlock besides the fact that it does exactly the same thing, the script time is just extended by somewhat around a few ms ... which is nothing

thick merlin
#

I have this now ```if (!isServer) exitWith {};

towerchat = { [] spawn {

private["_p1","_p2","_base","_h1","_h2","_activate"];
_p1 = p1;
_p2 = p2;
_base = carrier;
_h1 = h1;
_h2 = h2;
_activate = activate0;

while {true} do {sleep 1.5;

if ((_p1 in _h1) && (_activate) || (_p2 in _h2) && (_activate)) exitWith {};

};

sleep 1;

[_p1,"RadioMsg_Request_takeoff"] remoteExec ["sideRadio",0];
sleep 5;

[_base,"RadioMsg_Request_takeoff_TowerReply"] remoteExec ["commandRadio",0];
sleep 5;

[_p1,"RadioMsg_Request_takeoff_confirm"] remoteExec ["sideRadio",0];
sleep 10;

"Reminder: Adjust View Distance Before Take Off" remoteExec ["hint", 0];

[[this]] call ANZ_heli_mission_fnc_pzchat1;

};

};``` but its stopped working.i have executed it from debug console but nothing.no errors show either...

candid sun
#

oh yeah, it writes to disk. i'm definitely sticking with my own functions then, thanks for the heads up

fallen locust
#

and a fact it uses profilenamespace is anoying

willow hound
#

Because you're just assigning a value to a variable (towerchat = { ... };), but you're not executing any code.

willow hound
#

This should be all you really need:

if !(isServer) exitWith {};

[] spawn {
  //There's no need to assign hardcoded global variables to private variables, so I skipped that.
  waitUntil {sleep 1.5; activate0 && (p1 in h1 || p2 in h2)};

  sleep 1;
  [p1, "RadioMsg_Request_takeoff"] remoteExec ["sideRadio", 0];
  sleep 5;
  [carrier, "RadioMsg_Request_takeoff_TowerReply"] remoteExec ["commandRadio", 0];
  sleep 5;
  [p1, "RadioMsg_Request_takeoff_confirm"] remoteExec ["sideRadio", 0];
  sleep 10;
  "Reminder: Adjust View Distance Before Take Off" remoteExec ["hint", 0];

  [[this]] call ANZ_heli_mission_fnc_pzchat1; //This won't work because there is no variable "this" in this context.
};
thick merlin
#

using this to execute [[this]] call ANZ_heli_mission_fnc_towerchat;

winter rose
#
while {true} do {sleep 1.5;

if ((_p1 in _h1) && (_activate) || (_p2 in _h2) && (_activate)) exitWith {};

};
```↓```sqf
waitUntil { sleep 1.5; _activate && (_p1 in _h1 || _p2 in _h2) };
willow hound
#

Yoink

winter rose
#

I refuse!

ornate whale
queen cargo
#

sigh ... lets look at least into the UI editor the external one a lil bit closer ...

ornate whale
thick merlin
#

ok.got your edit.Thank you!

ornate whale
#

If you want it to execute right when u enter the main code (function), you need to restructure it a bit as @willow hound suggestted before. Basically you would need to take the content of the function and run it as a series of commands not as a function. If it makes sense.

fallen locust
#

<array> = serializeInventory <object>
and
deserializeInventory [<object>,<array>]
i would kill for that :P

ornate whale
#
call my Function; //now it will execute the insides of myFunction```

or you can just type and execute:
```do something here; //here it will execute the insides right away```
thick merlin
#

Its starting to get tricky...

#

Ok ,i'll try to get to grips with this.Thanks guys.:)

ornate whale
thick merlin
#

rgr that

granite sky
#

SQF is a bit special because anything wrapped in { } is a code object.

queen cargo
#

well ... more load-/unloadInventory

#

which returns an array

thick merlin
#

k.thanx.

queen cargo
#

would make more sense

fallen locust
#

same thing

ornate whale
# thick merlin k.thanx.

I feel like you have started a bit wrong, maybe you need to try few simple commands and functions first, and then read and try some bigger tutorials.

fallen locust
#

you get the point

thick merlin
#

been working from different examples to learn and just hoping for the best.

sullen sigil
queen cargo
#

and not be a special edge thing for special typee of missions

granite sky
#

An appropriate usage of the word, I guess :P

ornate whale
granite sky
#

From the SQF syntax page:

The SQF Language is fairly simple in how it is built. In fact: there are barely any actual language structures at all.

winter rose
sullen sigil
#

im not even a scripter im just a designer who likes sqf because i can do things how i like

#

and sqf is easily accessible to me because
i dislike oop scripting
its easily readable

ornate whale
sullen sigil
#

i know i just prefer call this text file

fallen locust
#

but so it saves and loads weapon attachments in vehicles

sullen sigil
#

rather than the word spaghetti of calling other methods in c# and other languages

#

its unironically my favourite language for how easy it is to make the stupid ideas i have

fallen locust
#

as this is atm not possible

ornate whale
sullen sigil
#

i dont know what that means and i think itll hurt my brain if i do

#

the only thing i dislike about sqf is no angular velocity commands (i am biased) and its performance (which isnt even terrible if youre not awful at scripting in a lot of cases) other than that its perfect

#

never fixed that ship orientation bug

little raptor
#

the only thing i dislike about sqf is no angular velocity commands
that's not related to "SQF" tho. the engine itself doesn't have angular velocity

sullen sigil
#

i must keep banging on this drum until something changes

#

the past 6 months of my life cannot have gone to waste like this

#

though tbf i am much better at scripting now

thick merlin
#

working from the towerchat example i edited another of my scripts to be the same but am getting nothing.as far as i can see it should work the same?```if (!isServer) exitWith {};

[] spawn {

waitUntil {

sleep 1.5;

activate1 && (h1 distance pzsmokepos1 < 2300 || h2 distance pzsmokepos1 < 2300)

};

[p1,"RadioMsg_Alpha_1_1_approaching"] remoteExec ["sideRadio",0];
sleep 6;

[carrier,"RadioMsg_Alpha_1_1_cleared_for_landing_1"] remoteExec ["commandradio",0];

gun1 doArtilleryFire [ship_target1, "magazine_ShipCannon_120mm_HE_shells_x32", 6];
sleep 1.5;

gun2 doArtilleryFire [ship_target2, "magazine_ShipCannon_120mm_HE_shells_x32", 6];
sleep 2.5;

gun3 doArtilleryFire [ship_target3, "magazine_ShipCannon_120mm_HE_shells_x32", 6];
sleep 2;

gun4 doArtilleryFire [ship_target4, "magazine_ShipCannon_120mm_HE_shells_x32", 6];

[] call ANZ_heli_mission_fnc_lzchat1;

};```

#

getting nothing though

sullen sigil
#

ive not had an error in my code for months now, just errors in whats produced

thick merlin
#

executing with this activate1 = true;[] call ANZ_heli_mission_fnc_pzchat1;

sullen sigil
#

where is that run

thick merlin
#

from debug console

sullen sigil
#

not on a server i presume

little raptor
#

is ANZ_heli_mission_fnc_pzchat1 defined?

thick merlin
#

in functions?

#

sp and mp

sullen sigil
#

yes or at all

#

you can run code by making it a public variable then calling the variable

#

doesnt need to be cfgfunctioned

little raptor
thick merlin
#

yes

#

seeing that but nothing happens

little raptor
#

like before try debugging it using systemChat

#

to see where it fails and why

sullen sigil
#

run things like h1 distance pzsmokepos1 etc in systemchats

little raptor
#

yeah

#

e.g. one systemChat in the waitUntil

systemChat str [h1 distance pzsmokepos1, h2 distance pzsmokepos1, activated];

and one after to see if it finishes at all:

systemChat "Condition satisfied"
granite sky
#

Also enable "show script errors" in the launcher so that you at least get a warning when your code falls over entirely.

thick merlin
#

you guys are starting to leave me behind.why does towerchat run but not pzchat1.different rules? or is the code ok?

sullen sigil
#

theres no syntax errors in the code

thick merlin
#

i have script errors on

sullen sigil
#

meaning its likely an issue with the waituntil never completing

thick merlin
#

ok wait1

#

aha.yes condition not met

#

wait1

sullen sigil
#

if theres no errors that get thrown just look for spots where your script can hang

ornate whale
thick merlin
#

yeah got that..activation numbers screwed

candid sun
#

is persistence really a niche thing?

thick merlin
#

now they are structured like this do still need to add them in with cfgfunctions ?

sullen sigil
#

cfgfunctions just serves as a way to define your function and prevent it being overwritten during runtime

#
kjw_fnc_ilikeballs = {
  systemChat "i like balls";
};
publicVariable "kjw_fnc_ilikeballs";```
does a similar thing but the function can be overwritten
#

which can help during developing code

thick merlin
#

lol ok

sullen sigil
#

i tend to use filepatching with cba's PREP macros so that i can edit code in vscode then just restart the mission and have the changes

#

and not be limited to a single mission file

thick merlin
#

i prefer pron

ornate whale
thick merlin
#

porn

#

i have this ```class ANZ_missions
{
tag = "ANZ_heli_mission";
class functions
{
file = "functions";

    class goodluckchat {};
    class towerchat {};
    class endchat {};
    
    class base_arty {};
    //class base_arty2 {};
    //class base_arty3 {};
    class fiftycal_fire {};
    class fiftycal_fire2 {};
    class fiftycal_fire3 {};            
        //class tank_fire {};
    //class vls_fire {};

    class Getin1 {};
    class Getin2 {};
    class Getin3 {};
    class Getin4 {};
    class Getin5 {};
    class Getin6 {};
    class Getin1_b {};
    class Getin2_b {};
    class Getin3_b {};
    class Getin4_b {};
    class Getin5_b {};
    class Getin6_b {};
    
    class Eject1 {};
    class Eject2 {};
    class Eject3 {};
    class Eject4 {};
    class Eject5 {};
    class Eject6 {};
    class Eject1_b {};
    class Eject2_b {};
    class Eject3_b {};
    class Eject4_b {};
    class Eject5_b {};
    class Eject6_b {};
    
    class pzchat1 {};
    class pzchat2 {};
    class pzchat3 {};
    class pzchat4 {};
    class pzchat5 {};
    class pzchat6 {};
    
    class lzchat1 {};
    class lzchat2 {};
    class lzchat3 {};
    class lzchat4 {};
    class lzchat5 {};
    class lzchat6 {};
            
};```
sullen sigil
#

yeah nothing wrong with that

#

just have to restart the game to change things etc

thick merlin
#

i havnt had to do that.restart game or mission?

sullen sigil
#

if you make changes to the functions if defined through cfgfunctions you need to restart the game

#

or should need to do so

ornate whale
#

If you are in editor playtesting just get back to editor and playtest again

sullen sigil
#

i test my mods in ace arsenal at the moment its very handy

#

supreme workflow

thick merlin
#

1 in 10000 times things do go arse up.is that why?

#

i just work in editor with scripts

ornate whale
#

But I am not sure if your tag could be that long? blobdoggoshruggoogly

thick merlin
#

not had issues tbh.that i am aware of..

#

Thnaks for ya time guys.Got alot to digets and some scripts to edit.:)

fallen locust
#

well more then 50% of arma player base uses some presistance, low or high i would say no

thick merlin
#

just gome 2am here.better jump off and go to bed.:)

#

gn

sullen sigil
#

i misread that for diglets, got very confused

thick merlin
#

lol.*digest

#

getting late...

fallen locust
#

but yea whatever

native hemlock
#

depends what you are doing really, if you had rotating scenarios you wouldn't need it but if people are playing the same content it gives them something to work towards

still forum
#

It had a purpose a lot of years ago.
It exploited a bug (= not returning a value) to workaround another bug (Editor script fields refusing the code if they returned a value)
Nowadays that doesn't make any sense anymore, and in standalone script files, it never did

#

There is Arma Debug Engine. If you're looking for a debugger

queen cargo
#

@candid sun yes it is
it might be true that many people play that stuff but nearly nobody needs that stuff who is doing SQF/missions

tough abyss
#

If you try to implement persistence, especially saving contents of containers inside containers.
You will notice the commands are all ad-hoc in arma, most of them don't have a reverse command.
So you will end up parsing the info to make use of it

sullen sigil
#

settorque doesnt count

tough abyss
#

*nearly all ad-hoc

sullen sigil
#

im very salty about 6 months of work not working because the engine doesnt want to interpolate the orientations

#

both me and leopard spent ~2 weeks debugging and i rewrote the function entirely with no joy

fallen locust
#

^^ that

sullen sigil
#

setvectordirandup on each frame also doesnt get interpolated

fallen locust
#

and you still cant get 1:1 replica

sullen sigil
winter rose
#

things without physics need an eachframe with valid values you provide (interpolated vectors)
network refresh rate is another thing

sullen sigil
ornate whale
# sullen sigil

You can not get the submarine-ariplane to turn smootlhy, or what is the problem?

sullen sigil
#

leopard and i spent ~2 weeks on debugging this and i spent another 2 weeks before giving up

#

works fine when its local (because it doesnt need to be interpolated)

winter rose
#

network doesn't try to interpolate vectorDir/Up changes, OK

sullen sigil
#

yes

#

its very annoying

#

worked on this from february to start of august

sullen sigil
#

real

candid sun
#

it's a pickle for sure

queen cargo
#

so @fallen locust ... your UI editor ... well ... it would not be that hard ... still a ton of work
would need at least like two month to develop a first version
which would get moved to trash after one month of polishing

ornate whale
sullen sigil
#

i do that

#

it works perfectly in sp

#

im 95% certain this is an issue with the game engine rather than my code

fallen locust
#

so you cant do it right:P not good enough? :P

ornate whale
# sullen sigil it works perfectly in sp

I think that this is not a task for SQF scripting then. The only thing that could help is to run it entirely on a local machine and shorten the time between anim changes.

tender fossil
#

Yeah, I guess you could have client-side interpolation and the server would just send position updates that would then get interpolated on the client. But in general it's a tricky problem to solve well

still forum
#

Yup, seems pretty obvious to me

queen cargo
#

i do can ...

sullen sigil
#

and no local effect setvectordirandup (else this'd be easy as piss)

queen cargo
#

but i cannot start another time intensive project

fallen locust
#

i bet you you cant :P

queen cargo
#

dude

#

you cannot catch me with that

granite sky
#

wonders

fallen locust
#

we will see

granite sky
#

Engine does have angular velocity, right. It just doesn't send it, or only sends it for objects with certain simulations?

sullen sigil
#

tried planeX instead of physx crate and has the same issue if thats what youre thinking

ornate whale
sullen sigil
#

its a physx crate with a sub attached

ornate whale
#

Aha.

sullen sigil
#

i see i have fooled you as well

#

(thats the point)

#

its intended for sci fi capital ships so you could have them hover, reverse etc without dealing with armas engine thats built for milsim helicopters and around irl physics

queen cargo
#

i could ref you to OOS where people said i could not do it ...

ornate whale
#

What if u used another virtual invisible object being attached to the sub from side (like a jet engine) and givin it its forward thrust? πŸ€”

winter rose
#

really reminds me of this tweet

ornate whale
sullen sigil
sullen sigil
ornate whale
sullen sigil
#

yes

#

with its vdirandup set on each frame

#

looks fine in sp

#

and if local to the client viewing

ornate whale
#

I think that it might have a workaround solution. It is just a hypothesis.

native hemlock
#

On another note, anyone aware if checking if the object you want to animate is already in that animated state is necessary? Obviously it would be slower to do if!(house animationPhase "Door" isEqualTo 0) then {house animate ["Door",0]}, rather than just ignoring the current state and doing house animate ["Door",0]. But if the animation was still broadcasted globally the check would be worthwhile.

sullen sigil
#

ive tried countless workarounds

#

just doesnt happen

tender fossil
sullen sigil
#

you cant have client side interpolation

#

theres no vectordirandup setter with local effect

tender fossil
#

I mean like do it manually

#

With delta time

sullen sigil
#

yeah i do delta time stuff

ornate whale
#

Would it interpolate correctly if you just let a physx box fall?

tender fossil
#

Oh, it's global effect only?

sullen sigil
#

ye

sullen sigil
ornate whale
sullen sigil
#

i cant, there is no physx angular velocity commands

#

which brings us back to the start of the conversation lmao

ornate whale
candid sun
#

so much passive aggression

sullen sigil
#

no because then you have a velocity change that you need to account for and setvelocity resets angular momentum

winter rose
sullen sigil
#

yep

#

had a version with addtorque working with the same issue

queen cargo
#

get used to it @candid sun
we are in the internet and i do not plan to treat anybody as SJWs or feminists (+ the "modern people") would like me to treat em

granite sky
#

So if you get a normal plane on the server, chuck it in the air without a pilot and give it some angular velocity with addTorque, what does that look like on the client?

sullen sigil
#

dont know and cant test at the moment but thats not having velocity set on each frame at the same time

granite sky
#

oh sure, it's not necessarily useful

#

But it seems odd that angular velocity wouldn't be transmitted or used for interpolation.

sullen sigil
#

yeah but it has no angular velocity as it gets reset when you setvelocity

#

and you cant give that angular velocity back afterwards

granite sky
#

right

sullen sigil
#

i know

#

(nice graphic)

#

but you would have an angular velocity that is difficult to calculate and also gets reset by setvelocity

#

so you would also need to somehow disable physx gravity on that object without setvelocity

still forum
sullen sigil
#

oh and if the object was already turning you would need to figure out where to place that object in accordance with it turning so you dont miss
which you cannot do as you cannot get the angular velocity πŸ˜›

sullen sigil
still forum
#

Β―_(ツ)_/Β―

sullen sigil
#

was introduced in .5

ornate whale
sullen sigil
#

then you would have some very bad sci fi capital ships if theyre all moving on the ground

ornate whale
sullen sigil
#

because you cant setvelocity on those

#

and setposasl and setvectordirandup on each frame also has no interpolation

granite sky
#

You could make your own submarine, but IIRC Arma has a size limit so it can't simulate anything large.

sullen sigil
#

yes thats why im doing this

#

so you can have a huge ass object with no collisions attached to the box

#

ive tested an 8km long one in sp and that works "fine"

#

i think its 8km anyway, may be 4km

ornate whale
sullen sigil
#

arma 4 will be enfusion, instant no

ornate whale
sullen sigil
#

dislike the language

winter rose
#

someone will make an SQF2EnforceScript class to help the transition I guess

winter rose
#

dropping that project now

sullen sigil
#

HEY

#

youre french i would never marry you

#

actually

#

french citizenship

#

maybe

#

(i have actually read the wiki articles about sqf to enscript and i still dislike it)

winter rose
#
class SQF2EnforceScript
{
  static void setDir(notnull IEntity entity, float directionAng)
  {
    entity.SetAngles({ 0, directionAng, 0 });
  }
}
```or something
sullen sigil
#

yeah im annoyed enfusion has got angular velocity from day 1

#

but oh well

#

im still not moving!

winter rose
#

did you like Windows Vista XP day one, no
it takes time to transition to it, dear sir

ornate whale
sullen sigil
#

wait does enfusion do angles in roll pitch yaw

winter rose
sullen sigil
#

definitely not day 1

#

im too young for that

winter rose
#

shush, you

sullen sigil
#

πŸ‘΅

#

what isnil does to a mf

winter rose
#

yet you use ScummVM font :p

sullen sigil
#

its monocraft actually

winter rose
#

(well, any low res old font actually yeah)

sullen sigil
#

and very easy for me to read

#

wait maybe thats why i dislike c#

#

my visual studio font isnt monocraft

winter rose
#

see?

sullen sigil
#

i actually dislike c# because its a pain in the balls to build dlls for .NET 6.0 but i digress

#

(i want my voice to text extension to work so i can make spell casting)

winter rose
#

you need glasses

#

to see sharp

sullen sigil
#

ffs

sullen sigil
#

nuget package for it doesnt work on .NET 4.8 and below

#

which i assume is what youre talking about i havent touched .NET in ages

candid sun
#

it's a game dude

queen cargo
#

so what?

#

as soon as you want to script you should make yourself clear that you now started to "program"
even if you do not have any clue what you actually do

#

you waste peoples time by asking for help
dont get me wrong
i really do want to help
but 80% of the stuff which gets asked is just random stuff you need 12 seconds to google

candid sun
#

crikey

#

don't take it out on me m8

#

if you can't take the heat, get out of the fire

queen cargo
#

ehh ... @candid sun ...

so much passive aggression

was not me who bothered

candid sun
#

just making a little observation

daring zinc
#

what's up with you always bringing up SJWs @queen cargo?

queen cargo
#

why you bother @daring zinc?
are you one?

daring zinc
#

of course not. but i fail to see what arma or scripting has to do with that tumblr bullshit

candid sun
#

x39 SQFJW IMO TBH

desert socket
#

How can I make an addaction on terrain objects to make it do the following?

Player uses addaction
Terrain object gets hidden/destroyed

daring zinc
#

"SQF Justice Warriors - Taking the fight to macros since 1999"

candid sun
#

stick that in your squad.xml and smoke it m8

hardy valve
#

It ended up working when I removed the // comments and after 9 hours of the mission running they are still knocked down πŸ™Œ

they are placed inside an invisible heli pad

hasty gate
#

This is just demonstration, overall we want to have multiple groups in one side to be sometimes hostile, sometimes not to each other, so kind of lets say 100 sides, so setCaptive is not an option

tulip ridge
fallow pawn
#

Hello, script gurus!

Here's the thing: I'm trying to get a marker position and render it onscreen for a limited amount of time using a resource (rscTitles) I built. I can get it to render it if my character happens to be looking to the direction of the marker at the moment the HUD opens. But it only stays on the screen position it was initially rendered (say it [0.5, 0.5]). I can't get it to "move" throughout the screen as I look around like draw3DIcon would (don't want to simply use draw3DIcon, I have greater plans).

What am I doing wrong?

My code is as follows:

disableSerialization;
params ["_display"];
private _marker = _display displayCtrl 100;
private _myMarker = missionNamespace getVariable ["SERGIO_myMarker", ""];
private _markerSize = 0.05 * safeZoneH;
private _markerPos = getMarkerPos _myMarker;
private "_worldToScreen";

while {!isNull _display} do {
_worldToScreen = (findDisplay 12 displayCtrl 51) posWorldToScreen [_markerPos # 0, _markerPos # 1];
_marker ctrlSetPosition [
_worldToScreen # 0,
_worldToScreen # 1,
_markerSize,
_markerSize
];
_marker ctrlCommit 0;
sleep 0.1;
};

granite sky
#

Well, _myMarker isn't defined.

fallow pawn
#

Sorry, my code is usually in brazilian portuguese so I made a hasty and sloppy translation and adaptation to post the code here.
Earlier in the script I get _myMarker through a missionNamespace variable I defined in the parent script.

#

Just fixed it up there ^

#

Ok so just figured it out!
_worldToScreen = worldToScreen _markerPos; is what I was suppose to use!

granite sky
#

wait, this isn't for the map view?

inland valve
#

trying to teleport a few hundred AI to an area on the map, I managed to get them to make a perfect circle around the area but I want them to be spread around the whole area not just the perimeter, herea is the Trigger on acivation: _enemies = allUnits select {side _x == independent};
_centerPos = getMarkerPos "AIRESPAWNCENTER";
_radius = 1000;

{
_newPos = [_centerPos, _radius, random 360] call BIS_fnc_relPos;
_x setPosATL _newPos;
} forEach _enemies;

granite sky
#

random _radius instead of _radius.

#

Now if you want them evenly spread out then that's a different problem.

inland valve
#

trying that thanks

fallow pawn
granite sky
#

Right, I assumed you were trying to render stuff on top of the map UI because you were using (findDisplay 12 displayCtrl 51) posWorldToScreen

#

The code is correct for that :P

fallow pawn
#

Guess my mind just remembers MAP_CONTROL commands nowadays

inland valve
#

@granite sky thank you, that was 100% it

fair drum
wanton swallow
#

How to determine if object is projectile? Please ping me.

gentle zenith
#

Greetings, I run a custom mission on my server (no mods), for the past few months we've had a problem with players becoming invisible to other players. I can't seem to replicate the issue on a dev server (probably because no desync).

  • Player can be seen by those with them at the time they become invisible
  • If they travel to a new area with other players, the players in this new area never see the invisible person exit their vehicle
  • The invisible person is normally unable to shoot people that can't see them (their bullets do no damage but blood is visible for both the shooter and the target.

Anyone with any ideas? I've tried running some hacky type fixes such as resetting a player's position when they exit a vehicle, but had no success

granite sky
manic sigil
#

Sounds like an ongoing Ace bug where wounded player's positions stop being updated, leaving their 'wounded' bodies whevever they fell while their client has them moving and shooting after being healed.

granite sky
#

Not seen that. I have seen the one where you wake up too fast and most other people see you slithering along the floor.

manic sigil
#

My group had it going for a while, was really bad because TFAR would register your position for everyone who sees you bugged out as where you got hit, so you'd be shouting at them but some corpse a mile away is the one emitting the voice, meanwhile everyone else who has the proper position updated is wondering why you're having trouble hearing them XD

#

I thought it got fixed... either that or we got so used to fixing it ourselves by running the affected player over so they ragdoll and force their model to update position and animation.

sullen sigil
#

may be fixed in next ace update

#

though think thats death related

gentle zenith
#

Happens quite often when there's 80 plus players, and yeah, I guess it isn't a scripting issue

molten yacht
#

So, ACE medical spits out a JSON string that has arrays I'd like to edit and then shove back into a reserialization function. Are there any good ways to edit the JSON as if it were a normal array?

#
"{""ace_medical_openwounds"": [], ""ace_medical_bloodpressure"": [80, 120], ""ace_medical_ivbags"": null, ""ace_medical_inpain"": false, ""ace_medical_medications"": [], ""ace_medical_tourniquets"": [0, 0, 0, 0, 0, 0], ""ace_medical_heartrate"": 80, ""ace_medical_pain"": 0, ""ace_medical_bloodvolume"": 6, ""ace_medical_stitchedwounds"": [], ""ace_medical_fractures"": [0, 0, 0, 0, 0, 0], ""ace_medical_triagelevel"": 0, ""ace_medical_bodypartdamage"": [0, 0, 0, 0, 0, 0], ""ace_medical_hemorrhage"": 0, ""ace_medical_occludedmedications"": null, ""ace_medical_triagecard"": [], ""ace_medical_bandagedwounds"": [], ""ace_medical_peripheralresistance"": 100, ""ace_medical_painsuppress"": 0, ""ace_medical_statemachinestate"": ""Default""}"

I really only need to switch ace_medical_bloodvolume to be a different number, and keep all the other things by default

#

but this isn't a normal array...

wind hedge
#

guys, any idea why this isn't working?

#
[] spawn {
    sleep 10;
    Hint "Minimap scritp running";
    waitUntil {!isNull (uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull])};
 
    disableSerialization;
 
    private _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];
    private _miniMapControlGroup = _display displayCtrl 13301;
    private _miniMap = _miniMapControlGroup controlsGroupCtrl 101;
    
    {
        _miniMap ctrlAddEventHandler ["Draw", {
            (_this select 0) drawIcon [
                getText (configFile >> "CfgVehicles" >> typeOf (vehicle _x) >> "icon"),
                [0,0.3,0.6,0.90],
                getPosWorld _x,
                19,
                19,
                getDirVisual _x,
                format ["%1:%2", profileName ,getText (configFile >> "CfgVehicles" >> typeOf (vehicle _x) >> "displayName")],
                1,
                0.03,
                "PuristaMedium",
                "top"
            ]
        }];
    } forEach (units group player - [player]);    
};```
#

It is running from initplayerlocal.sqf and the hint shows but then the icons on the GPS mini map don't...

#

And yes, I do have team mates on my group too πŸ˜‰

molten yacht
#

I feel like my brain is fried, is there no easy way to do "ForEach but only the first 3 indices and don't bother after that"

warm hedge
#
if (_forEachIndex >= 3) exitWith {};```
little raptor
#

And now that I look at the code again you didn't need a while at all

queen cargo
little raptor
little raptor
little raptor
#

it's before everything else

#

you should put it after the waitUntil to see if it succeeds at all

little raptor
little raptor
little raptor
little raptor
#

also you can get terrain objects using nearestObject + ID from getObjectID in case you want specific objects

grizzled cliff
#

lol now that i see that x39 is probably some redpill mra, kotaku in action man child i kinda wanna be actual serious competition for getting an OOP SQF thing out there :D

hasty gate
little raptor
#

I think because the AI targeting follows a change in knowsAbout. you reset the knowsAbout but the engine proceeds to tell the AI to engage, which again raises the knowsAbout (I think to 4)

#

also knowsAbout changing doesn't mean anything. e.g. the knowsAbout could be 4, in which case the EH won't continue to trigger anymore

#

so they will continue to engage

hasty gate
#

anyway I think the KnowsAboutChanged should have priority over engaging a target, meaning executed before the actual targeting etc. so it will allow devs to have more control over it

#

Another question: is there something like createUnitLocal?

warm hedge
#

For what purpose?

hasty gate
#

Well in my case we have complex situation: we want to have 1 side and the groups inside might be hostile to each other, we are investigating different ways to achieving that, now we are investigating possibility of virtually attaching "Invisible Target" unit from CBA_A3 mod to all units inside a side and managing hostility by playing with knowsAbout value

#

forgetTarget doesnt work via KnowsAboutChanged EH as we expect, and we found it somehow works via perFrameHandler, but later we found it's not good solution in multiplayer game as it will DDOS the server as each forgetTarget call will cause sync over network, so having a LOCAL unit could prevent that

sullen sigil
#

just make the units local to the server

#

setowner

hasty gate
sullen sigil
#

have you evem tested the network strain

#

and creating a local unit would mean only the server could see it

hasty gate
#

yes, it DDOSED the server

sullen sigil
#

because its local to the machine and doesnt exist on any others

hasty gate
#

units exists on all machines

sullen sigil
#

yeah, because theres no createunitlocal command

#

run createvehiclelocal with a unit on the server, see what happens lmao

hasty gate
sullen sigil
#

no

#

it wont

hasty gate
#

what the hell?

sullen sigil
#

its a local vehicle

hasty gate
#

ok I will try that, thank you for the info. Anyway it's not proper solution to our problem as it causes tons of performance issues, we just need the EH to work as I wrote in the ticket

sullen sigil
#

execute on next frame or two

hasty gate
#

I tested that, the forgetTarget will become unstable and units will attack each other every few seconds

#

must be every frame

sullen sigil
#

so sounds like its a case of the units instantly seeing the target again which makes sense

hasty gate
#

yes, but we also overwrite it instantly

sullen sigil
#

yes, but you cant forget about a person if youre staring at them

#

if you forgot they exist youd just instantly remember they exist

#

hence why your solution doesn't work

#

they forget about them then instantly know about them again because theyre looking at them

hasty gate
#

that's why the EH should have priority over it

sullen sigil
#

no, because itd just cause a recursive loop

#

if i am staring at someone and forget about them i instantly remember them

#

however having it changed to an eh that changes output on return value could work i think

#

but doubt thatd be done for backwards compat or smth

hasty gate
sullen sigil
#

yes i will leave a comment on your "bug" report

hasty gate
#

thank you

sullen sigil
#

there, done

tribal sinew
proven charm
tribal sinew
#

I'll give it a go, thanks πŸ™‚

heavy dew
#

Seems I'm misreading the syntax
how can I get the player unit from the machineNetworkID?

proven charm
#

if you have the right ID

heavy dew
#

that takes PlayerID as the argument not the machine Network ID doesn't it?

proven charm
#

yea 😐

#

getPlayerID can be used to get the correct ID

deep vessel
#

Is there an easier way to copy script errors out of the game? at the moment i'm jsut typing them in full into a notepad haha

hallow mortar
#

Script errors are recorded in the RPT file, which is in uhhhhhh localappdata Arma 3?

proven charm
#

C:\Users\username\AppData\Local\Arma 3

hallow mortar
deep vessel
#

Has anyone tackled virtual arsenal whitelisting per role/player slot ? google has not been forthcoming

#

i have created whitelists and defined them as "slots" so that i can use a function to apply the whitelists to the virtual arsenal, however i think i might be misusing the bis_arsenal function:


{
    private["_playerRole", "_whitelist"];
    _playerRole = _x select 0;
    _whitelist = _x select 1;

    {
        BIS_arsenal addItemToCargoGlobal [_x, 1];
    } forEach _whitelist;
} forEach [
    ["d_legend", d_legend_whitelist],
    ["d_pilot", d_pilot_whitelist],
    ["d_med_pilot", d_med_pilot_whitelist],
    ["d_riflemen", d_riflemen_whitelist],
    ["d_grenadiers", d_grenadiers_whitelist],
    ["d_autoriflemen", d_autoriflemen_whitelist],
    ["d_snipers", d_snipers_whitelist],
    ["d_missilesp", d_missilesp_whitelist],
    ["d_medics", d_medics_whitelist],
    ["d_crewmen", d_crewmen_whitelist],
    ["d_engineer", d_engineer_whitelist]
    // ... add entries for other roles```
south swan
deep vessel
#

Ah perfect thank you!

south swan
#

or you can create multiple global arsenals, place empty object for players to interact with and manually add actions to it with conditions that only show the correct arsenal to the player (yeah, the description sounds like a proper mess)

red shale
#

hey i am hiving trouble getting an add action on one object the change the texture of another

south swan
#

should work. What code are you using?

red shale
#

this addAction ["Mod2_1", S1 setObjectTexture [0, "Slideshow\1.paa", 0]];
this addAction ["Mod2_2", S1 setObjectTexture [0, "Slideshow\1.paa", 2]];
this addAction ["Mod2_3", S1 setObjectTexture [0, "Slideshow\1.paa", 3]];
this addAction ["Mod2_4", S1 setObjectTexture [0, "Slideshow\1.paa", 4]];
this addAction ["Mod2_5", S1 setObjectTexture [0, "Slideshow\1.paa", 5]];
this addAction ["Mod2_6", S1 setObjectTexture [0, "Slideshow\1.paa", 6]];
this addAction ["Mod2_7", S1 setObjectTexture [0, "Slideshow\1.paa", 7]];

#

i dont know how to do the box thing on here

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
south swan
#

looks like wrong bracket order πŸ€·β€β™‚οΈ setObjectTexture [0, "Slideshow\1.paa",0] should be setObjectTexture [0, "Slideshow\1.paa"], 0 and so on

#

although having numbers for a third argument of addAction doesn't make sense as well. What are you trying to achieve with it?

red shale
#

useing a laptop to change what is showing on an abject

granite sky
#

The second argument there is supposed to have code brackets around it too.

red shale
#

tried using the ace slide show but that not working either

granite sky
#

When the wiki says a parameter is code, it means a code object.

south swan
#

so this addAction ["Mod2_1", {S1 setObjectTexture [0, "Slideshow\1.paa"]}]; and so on then

red shale
#

ok i will try this

analog hull
#
; script by David Berka (David.Berka@nmi.at)
; 2006/08/29 quick fix cosmetic repairs by Mr.Peanut

private ["release1"];
_heli = _this select 0
_car = _this select 1
_chute = _this select 2


#Update

_heliPos = getPos _heli
_heliPosX = _heliPos select 0
_heliPosY = _heliPos select 1
_heliPosZ = _heliPos select 2

_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2

_chute setPos [_chutePosX, _chutePosY, 300]
_car setPos [_heliPosX, _heliPosY, _heliPosZ - 5]
_car setVelocity velocity _heli
_heading = getDir _heli
_car setDir _heading
~0.01
? (release1 == 1) : goto "Drop"
goto "Update"


#Drop
_chute setDir _heading

~0.01

_carPos = getPos _car
_carPosX = _carPos select 0
_carPosY = _carPos select 1
_carPosZ = _carPos select 2

_chute setPos [_carPosX, _carPosY, _heliPosZ - 18]

#DropUpdate

_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2

_car setPos [_chutePosX, _chutePosY, _chutePosZ - 3]
_car setVelocity velocity _chute
~0.01
? (_chutePosZ > 3) : goto "DropUpdate"

south swan
#

eyyy, sqs

analog hull
#

I have this script and I keep getting Undefined var error 'release1 == 1' Any Ideas why?

#

In a move to marker I have on activation realease1 = 1

#

In the helo I have this flyInHeight 75 ; [this, car1, chute1] exec "helidrop.sqs"

south swan
#

do a release1 = 0 somewhere before running that chungus πŸ€·β€β™‚οΈ

analog hull
#

I will try that. Is there a better script then this around?

red shale
#

@south swan Thank you its working now

sullen sigil
#

have got an odd issue, have a hashmap in an array. trying to do _arr = _arr#1 to get the hashmap returns error of type hashmap, expected array, but typeName of _arr at that point is returning array

#

(and getting type array expected hashmap afterwards if i do not do _arr#1)

#

changing to a different variable worked tho, dunno why

analog hull
#

I knew it was that easy.

astral bone
#

dumb question, how do I add 200000 to a number and keep decimal points? πŸ˜…

granite sky
#

You can't.

astral bone
#

oh horray

granite sky
#

At least not reliably :P

astral bone
#

so I'd need to do some string hacking to get it- Since it's already being made to a string xD

granite sky
#

toFixed might help if the limiting factor is output

south swan
sullen sigil
#

you cant do large numbers in sqf really

#

or small numbers

#

only medium numbers

astral bone
#

To fixed? Hmm- idk if that'd work xD But maybe I could grab the number, convert to string, grab everything after the ., get the number BEFORE I converted to string, and do the addition, then concat to the end. Output is a string so

sullen sigil
#

you'd have to do the addition in string format

astral bone
#

string format?

sullen sigil
#

yes

#

you cant convert it to number to do the addition

#

you have to figure out how to do "3" + "7" = "10"

south swan
#

yaaay to making SQF even slower

sullen sigil
#

personally would just write an extension for it

astral bone
#

Heh- it's literally only for a single script x3

south swan
#

then check the video i've linked x3

#

yaaay for making SQF not a ton slower but a whole lot more convoluted

astral bone
#

I got a a map I was given permission to mess with by the creator, but cant do stuff in the WRP.
So to make new roads, I need to place objects, then make sure I copy and paste them somewhere, then add 200000 to the X value, then I can make points for the road polyline.

#

With the correct ordering.

south swan
#

even if you do the string shenanigans - you'd lose the precision as soon as you try to feed that number back to game, though

astral bone
#

Not feeding to the game, feeding to terrain builder. :P

#

oh

#

well, it's working so far atleast, so eh πŸ€·β€β™‚οΈ

south swan
#

then export as-is and use some real programming tool. Like Excel blobdoggoshruggoogly

astral bone
#
_obj = get3DENSelected "object" select 0;
_br = toString [13,10];
TEMP_getSynced = {
    params["_obj"];
    private _synced = [];
    diag_log get3DENConnections _obj;
    {
        diag_log ((_x select 0) == "Sync");
        if((_x select 0) == "Sync")then{
            _synced pushBack (_x select 1);
        };
    } forEach get3DENConnections _obj;
    _synced;
};
TEMP_getSyncedOrdered = {
params["_obj","_doneObjs","_positions"];
{
    if(_doneObjs find _x < 0)then{
        _doneObjs pushBack _x;
        private _objPos = position _x;
        
        _positions = _positions + "20" + str(_objPos # 0) + " " + str(_objPos # 1) + _br;
        if(count ([_x] call TEMP_getSynced) > 0)then{
            _positions = _positions + ([_x,_doneObjs,""] call TEMP_getSyncedOrdered);
        };
    };
} forEach ([_obj] call TEMP_getSynced);
_positions;
};
_txt = [_obj,[],""] call TEMP_getSyncedOrdered;
copyToClipboard _txt;
#

then I paste into notepad, and can do part 2 of the tedious task of making the road polyline xD

#

oop, alt syntax of toFixed worked xD

tulip ridge
south swan
#

with official python support in excel now that joke is even funnier

sullen sigil
#

what is scalar NaN? undefined number?

fleet sand
#

Hi guys myb somebody can awnser me on this question. So i have audio file and i put that audio file in mission folder. When i call audio file in debug console with PlaySound3d it works it plays normaly but when i take the same code and put it inside the trigger it dosent. The debug console and Trigger are in the same enviormente ?

astral bone
#

Not a Number. I believe that's when math goes wrong, but not 100%

sullen sigil
#

thats impressive

fleet sand
astral bone
sullen sigil
#

it is not

#

πŸ™ƒ

astral bone
#

wait what line

sullen sigil
#

who knows! πŸ˜ƒ

#

unitdata is getting set as sclara nan

winter rose
astral bone
little raptor
little raptor
sullen sigil
sullen sigil
#

systemchats are returning numbers only on the first iteration

#

so probably something to do with how data is saved

little raptor
astral bone
#

hashmaps to string, do those display like array to string?
[xyz,xyz]

little raptor
#

yes

sullen sigil
#

[[xyz,zyx],[sdois,dopsiapdoi]] but yes

fleet sand
astral bone
#

Well what'd I'd do is put a log that tells me "_value" right above the _unitData set [_x,_value]

sullen sigil
#

i have done that

#

theyre all numbers for the first iteration

#

then no systemchats again, probably due to error πŸ˜ƒ

astral bone
#

what about after _unitData set?

sullen sigil
#

doesnt change

astral bone
#

wait, first iteration as in first loop in the for loop, or first time the for loop completes

sullen sigil
#

this is a Moment

#

except the variable is fine and has scalar nan everywhere which... shouldnt happen

fallen locust
#

persistant missions are future of arma MP lbh

sullen sigil
#

i love this game

astral bone
#

print the hashmap.
chat str(<hashmap>) (example)

#

oh-

#

Well, still, wouldn't mind seein that myself x3

sullen sigil
#

its a moment

#

one mo

#

it just stops after a single iteration

granite sky
#

what's _deltaT?

sullen sigil
#

time since last iteration, passed by ace

#

usually ~1

granite sky
#

shrugs

sullen sigil
#

im just going to systemchat all the variables in a second

astral bone
#

Try to put all variables you are using at the start of the iteration.

granite sky
#

Whole thing is gonna be garbage-in, garbage-out. Only question is which input is the garbage :P

sullen sigil
#

mashallah

sullen sigil
# sullen sigil wtf

except this says that it should be setting the variable as the one with numbers

#

so for some reason when it gets numbers it breaks

astral bone
#

ok, try making _value in the set be "0.066667" or whatever.

#

Replace _value I mean

#

_unitData set [_x,0.01667]

#

if it still happens, try just 1

sullen sigil
#

its only systemchatting 3/6 times notlikemeowcry

#

oh thats deltaT, the foreach has 3 loops

astral bone
#

wait-

#

oh- DeltaT is the value directly from Ace?

sullen sigil
#

yes

astral bone
#

I was assuming- uh, yea, set a value to deltaT before the for loop :P

sullen sigil
#

i see a zero πŸ€”

#

big brain pain

#

deltat is fine

astral bone
#

well, maybe also do systemChat "xyz: " + str(xyz)

#

so you know what value is what ;P

sullen sigil
#

this is all of the values for final iteration

#

values are getting set properly so somewhere in second iteration its fucking up because theres now values

#

this works fine too

#

wtf

astral bone
#

wait

#

try setting it to the player's variable

#

the try getting it

sullen sigil
#

although....

#

that shouldnt be happening? meowsweats

#

i dont set the variable to the player again in this bit

astral bone
#

try making a new variable, temporarily

#

Like, add "_test" to teh end

sullen sigil
#

yeah, same thing

#

wonder if it could be an issue with the createhashmap as default value πŸ€”

wind hedge
# little raptor you should put it after the waitUntil to see if it succeeds at all

It succeeds after the waituntil... I guess the issue is the sqf ctrlAddEventHandler ["Draw" ?
Updated script: ```sqf
[] spawn {
sleep 10;
waitUntil {!isNull (uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull])};
Hint "Minimap script running";
disableSerialization;

private _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];
private _miniMapControlGroup = _display displayCtrl 13301;
private _miniMap = _miniMapControlGroup controlsGroupCtrl 101;

{
    _miniMap ctrlAddEventHandler ["Draw", {
        (_this select 0) drawIcon [
            getText (configFile >> "CfgVehicles" >> typeOf (vehicle _x) >> "icon"),
            [0,0.3,0.6,0.90],
            getPosWorld _x,
            19,
            19,
            getDirVisual _x,
            format ["%1:%2", name _x ,getText (configFile >> "CfgVehicles" >> typeOf (vehicle _x) >> "displayName")],
            1,
            0.03,
            "PuristaMedium",
            "top"
        ]
    }];
} forEach (units group player - [player]);

}; ```

astral bone
#

what about bloodData, what's that look like after

sullen sigil
#

looks perfectly fine

#

values from unitdata subtracted

#

im not crazy, right? im not setting the variable anywhere?

#

the variables also update fine for iteration one but never on iteration 2 regardless of predefined or not

#

yeah what the dick

astral bone
#

Hmm- Maybe it's hashmap reference?

#

idk why tho

#

here, dumb idea, try backing to eden or whatever, then previewing again.

sullen sigil
#

no need as just running scenario for a second resets to nan

astral bone
#

yea, but reset all values.

sullen sigil
astral bone
#

Perhaps something is running that's messing with it, in the backgroun

sullen sigil
#

thats why lmao

astral bone
astral bone
sullen sigil
#

i bet it still doesnt work after removing the setvariable though

astral bone
#

I don't normally use hashmaps, I normally just use arrays xD

sullen sigil
#

it shouldnt be creating that error either though

#

unless it is due to the createhashmap default value and a mix of the setvariable or some shit like that

astral bone
#

Did you ever put this into an event handler or something that runs in the background?

sullen sigil
#

this is called by a 1 second pfh iirc

astral bone
#

I'm thinking something in the past was giving NaN, but then it was fixed, but it's still running and referancing the hashmap.

sullen sigil
#

removing the setvariable also didnt fix

#

ffs

#

dont need a setter in the getordefault actually

astral bone
astral bone
#

idk- maybe try breakpoints

granite sky
#

just dump the whole input data with diag_log before each iteration and you'll find what's breaking pretty fast.

sullen sigil
#

this would be so much easier if i didnt need to use cfgfunctions to overwrite ace

deep vessel
#

Anyone got a second to look over my arsenal whitelisting script per player slots, i get this error:


{
BIS_fnc_addVirtualBackpackCargo [_x, 1];
} forEach _backpacks;

{
BIS_fn>
16:32:38   Error position: <[_x, 1];
} forEach _backpacks;

{
BIS_fn>
16:32:38   Error Missing ;
16:32:38 File C:\Users\ezhpo\Documents\Arma 3 - Other Profiles\Wombat\missions\Legandary_Domination.Altis\whitelist.sqf..., line 184```

But i can't see the syntax problem on that line for the life of me
sullen sigil
#

you need to actually call the functions

granite sky
#
  1. You don't know how to use it? :P
sullen sigil
#

(i forgot to str the variables)

sullen sigil
#

like everything

#

why do i subject myself to ace function overwrites this was working perfectly fine until i fucked with it

granite sky
#

@deep vessel The BIS functions are functions, not commands. You call them like this:
[_x, 1] call BIS_fnc_addVirtualBackpackCargo;

deep vessel
sullen sigil
#

well then

south swan
#

yeah, number + string tends to error out in many programming languages 🀣

sullen sigil
#

oh im stupdi

#

ctrl+h isnt a good idea

#

this is a moment

south swan
#

getVariable ["blahblahblah", createHashmap, true]?

sullen sigil
#

eh?

south swan
#

are you creating BloodInfo hashmap anywhere?

sullen sigil
#

yeah gets created on players postinit

#

could be why? wouldnt explain why it worked in debug fine tho

south swan
#

well "will always be executed" means "empty hashmap will always be created, but not used if not needed" in this case πŸ€”

sullen sigil
#

(and i removed the default variable and this still happened)

#

god why do i always get the most obscure bugs

granite sky
#

(this is not an obscure bug)

#

In your code you're spamming extra createHashmap calls but that doesn't hurt anything except performance.

sullen sigil
#

i shall change that part to [] and createhashmapfromarray if []

#

done, didnt fix

#

thats expected tho

#

uh

granite sky
#

You've never said where _bloodData comes from in your original code. It's just a hanging local variable.

sullen sigil
#

its params passed into the function

sullen sigil
granite sky
#

well no, because that's not being passed into a function.

sullen sigil
#

its done here in a different function but is passed across perfectly fine

#

i had this whole thing working before but took a break and forgot where i left off

granite sky
#

That's kinda impressive. You define _bloodData as three completely different things within four lines of code :P

sullen sigil
#

found where it breaks

sullen sigil
#

so issue is blooddatahash gets cleared for some reason

#

...

#

dear fucking lord

granite sky
#

Looks like the fluid data lookup is missing some data?

sullen sigil
#

this is so embarassing

#

its in a different scope

granite sky
#

lol

#

i like recycling

sullen sigil
#

i am going to bash my head against a wall

#

because i even thought

#

hey why dont i move this out of the scope seeing as its fixed

#

and just went meh let me fix this bug first

#

if you never hear from me again i have moved to poland to start a new life away from all this shame

granite sky
#

Enfusion script wouldn't let you do this because the variables are typed :P

sullen sigil
#

i was actually relying on my linter to catch it

#

nobody can convince me to use enscript

#

i spent 6 months on a project that would take me maybe a week to make in enscript but i still refuse to touch it

#

i have never been so happy about having testicular torsion

#

that is so fucking embarassing

hallow mortar
#

Are you making STD simulation in Arma?

#

Actually, on second thoughts, pretend I didn't ask

astral bone
#

I thought it was just filler and "haha, funny thing for debug"

astral bone
#

it's not the same thing, but it reminds me of it.

sullen sigil
#

i am doing the hee hee funnee

#

but you can spread diseases by IVs πŸ™‚

#

as well as blood cell counts etc

astral bone
#

oh, that will be SO annoying :D

sullen sigil
#

so giving someone with acute radiation poisoning some blood is probably a good idea

sullen sigil
astral bone
#

i just had an Idea, but considering we're in the same unit, I don't wanna share it and then have to worry about it xP
lol

sullen sigil
#

im not in your unit

#

ive just shown up to your ops for a month

astral bone
#

close enough

sullen sigil
#

i keep getting invited

astral bone
#

Welp, as for me, lets see if my road export script worked

hallow mortar
#

Exporting roads? Ah, so you're simulating the Roman Empire

astral bone
#

Sorta

#

I'm placing spheres, syncing them so their connections look like how I want the road to look, then run the command. Then it gives me the X and Y of each sphere in a way I can easily paste it to a file editor, then go through and copy past each X, then Y :P

#

End product usage*

#

so looks like it works! :D

still forum
tulip ridge
sullen sigil
#

is there any easy way to get all numbers out of a string? regex makes my head hurt

found a workaround

#

so
peqwjo231230909j290jdasj0a9samd0a9 would become 2312309092900909

little raptor
#

well you've crossed stuff out so idk what you wanted blobdoggoshruggoogly

dreamy kestrel
#

trying to find references for the mass to kilograms conversion factor ... IIRC wasn't it 2.2 or something? could someone direct me to that url(s)? thanks...

little raptor
#

mass to kilograms?
ah you meant Arma's mass

dreamy kestrel
# little raptor mass to kilograms? ah you meant Arma's mass

right, for uniform/vest/backpack containers, as well as for vehicle mass i.e. cargo maxLoad getContainerMaxLoad, etc... one blog suggests 1 kg = 22 mass units, something like that... but possibly being different for vehicles from the other...

south swan
#

Arma mass units are whatever

#

If you check AKM mass you'd get 33 (or even 40) units per kilo

little raptor
#

maybe it's just a heavy AKM meowsweats
maybe made out of lead πŸ˜…

south swan
#

Magazines and small arms tend to be close to 22 iirc

dreamy kestrel
#

I mean it could be DU rounds...

south swan
#

I somehow remember mentions (maybe from Dedmen) of size being a factor as well or something

dreamy kestrel
#

I'm not really fixed to the conversion just making a sensible one... with 22 sort of being the baseline atm...

#

right that is the mass consideration not just weight but also bulk...

#

but I am aiming to display a sensible weight (kg or lb)...

south swan
#

Long story short: find something close you want to be consistent to and go somewhere near that blobdoggoshruggoogly

#

Vehicles' physx masses were pretty consistent to kilos if i remember correctly

dreamy kestrel
#

physx masses? you mean in terms of the vehicle itself? or its carrying capacity, i.e. load, maxLoad?

wind hedge
south swan
#

In terms of its physics mass. Collisions, slingloading, that stuff

dreamy kestrel
#

oh okay... right, if it helps for context, I am cargo focused right now, literally, inventory manager. that's all...

south swan
#

Go for 22 mu/kg and blame the cruel world for inconsistencies then blobdoggoshruggoogly

dreamy kestrel
#

fair enough... I mean bottom line if I am gauging whether a thing can be contained, I want to go with getMass and then decide whether the OBJECT was vehicle or not for maxLoad etc purposes... the kg conversion being a nice to have. thanks...

molten yacht
tulip ridge
#

Is there a way to get all functions from a category?

granite sky
#

Read the config?

tulip ridge
#

Yeah I was just wondering if there was a command to do it too

#

Was just going to do that if there wasn't

granite sky
#

Single config lookup command is a weird thing to have a command for.

tulip ridge
#

I figured there wasn't

hasty current
#

Is there an Event Handler for getting when a game master remote controls a unit?

dreamy kestrel
#

Q: in terms of cargo, estimating whether an item by class may be added to a vehicle cargo, best if I use this to gauge the item requirement?

// assuming I know the item CONFIG from its CLASS (STRING)
getNumber (_item_cfg >> 'ItemInfo' >> 'mass'); // ...
// then evaluating versus container load, maxLoad, etc
hallow mortar
#

Unless you're trying to check for multiple potential items at once, you can use canAdd

dreamy kestrel
dreamy kestrel
#

hmm another cargo inventory scenario... uniform vest backpack objects contained in a vehicle... seems like the scripting commands tend to prefer containers be slotted on an actual unit... or is it possible to manage container cargo for them while stowed in a vehicle?

grizzled lagoon
#

Hello, I have created a script for simulates the effect of a trailer being towed. It works well, but I have the impression that it is not optimized for multiplayer. What do you think?

[] spawn { 
 _dir_c = getdir camion; 
 _dir_r = _dir_c; 
 remorque setdir _dir_c; 
 sleep 1; 
 while {true} do { 
 
  if (_dir_c != _dir_r) then { 
   if (_dir_c > _dir_r) then { 
    if (_dir_r + 0.1 >= _dir_c) then { 
     // on aligne parfaitement 
     remorque setdir (getdir camion); 
    }else { 
     // on ajoute 
     _dir_r = _dir_r + 0.1; 
     remorque setdir _dir_r; 
    }; 
   }else { 
    if (_dir_r - 0.1 <= _dir_c) then { 
     // on aligne parfaitement 
     remorque setdir (getdir camion); 
    }else { 
     // on ajoute 
     _dir_r = _dir_r - 0.1; 
     remorque setdir _dir_r; 
    }; 
   }; 
  }; 
 
  remorque setpos (camion modelToWorld [0.11792,-2.3,0.1]); 
  sleep 0.001; 
  _dir_c = getdir camion; 
 }; 
};```
dreamy kestrel
# grizzled lagoon Hello, I have created a script for simulates the effect of a trailer being towed...

is it a script you have to write for that, don't know, have not dug into the particulars, for native towing (if it is possible) or Advanced Towing (mod)... but some known issues either way, kiting or when the towed object rides up on nearby terrain objects... also some walls, railroads, tend to be fatal to catastrophic events for the towed vehicle, so if you can figure those scenarios out, that's key.

grizzled lagoon
winter rose
#

!quote 5

lyric schoonerBOT
dreamy kestrel
grizzled lagoon
winter rose
#

yes

dreamy kestrel
# grizzled lagoon You have alternative ?

I'm not sure I have any ready alternatives, the objects have to sync somehow. would need to know how deep the averaging runs reference towed to towing vehicles. and/or how frequent is acceptable in terms of sampling those details.

grizzled lagoon
#

what are you thinking ? x)

winter rose
#
setPosASL
setPosATL
setPosWorld
hallow mortar
#

If you use setPosASL, use modelToWorldWorld rather than modelToWorld.
Trying to use setPosWorld is probably more trouble than it's worth; its incredibly useful unique thing is using the model centre rather than its origin and converting for that is complex.
For using setPosATL, you'd want to use modelToWorldWorld and then convert it to ATL with ASLtoATL.
In short...use setPosASL and modelToWorldWorld.

ornate whale
#

Is it possible to re-declare a private var with the same name in a sub-scope? What would it result in?

fnc =
{
  private _var = 21;

  {
    private _var =15;

  } forEach array;
};```
wind cairn
#

Has anyone been experiencing a bug where players go invis and go into some defualt t pose state in their vehicles?

warm hedge
#

Which kind of vehicle (which Mod or?)

wind cairn
#

Just the default arma ones

warm hedge
#

Any Mods?

wind cairn
#

Its been a big problem lately, and theres no clear cause

#

No, scripted mission file

warm hedge
#

Then AnimDataCache issue I assume

#

Located in Profile or parent(s) of it, detele the folder and try again

wind cairn
#

Its not something that stays between game sessions though, it stops when the player either switches seats in their vehicle, or logs back to the lobby

warm hedge
#

You can try what I said anyways

wind cairn
#

It has never happened to me, I wont be able to see if that fixes it

#

and I cant delete it for other players

warm hedge
#

As I said, you can try. And report back if it doesn't help

wind cairn
#

Will try, does the AnimDataCache just get to big sometimes and break?

warm hedge
#

No, it harms nothing if you delete. No need of backup too

wind cairn
#

Does it just store info about the animations? Thats what I assume by the name

warm hedge
#

Just do

#

It stores relations between anims, not anims itself

wind cairn
#

alright thanks, Ill see if this helps

little raptor
#

so now you have 2 _var variables. one belongs to the outer scope, and one to the inner scope. while you're in the inner scope you won't see the outer scope _var so it remains unchanged
once you exit the inner scope you can continue to use the outer scope _var like nothing happened

private _var = 21;
{
    private _var =15;
} forEach array;
// _var is still 21
#

tho you should also be careful of reference modification (only relevant with hashmaps, arrays and structured text):

private _arr = [];
private _var = _arr; // _var points to _arr
{
    private _var = _arr; // _var now points to _arr array
    _var pushBack 1;     // pushback modifies the array by reference
} forEach array;
// _var and _arr are now both [1] because the data was modified by reference

while the inner var is a completely different variable (due to private), since it uses the same data as the outer var, you end up modifying both

mystic hawk
#

How would you make a sniper reveal a group of targets instead of just one target in a trigger?

thick merlin
#

been playing with this script but need to find out how to replace p3d with p3d.the script replaces p3d with classname of the p3d.Any help appreciated.

#

private _repleacearray = [

    ["t_BroussonetiaP1s_F.p3d", "CUP_b_betula2w_summer", 0],//CUP_les_singlestrom_b
    ["t_FicusB1s_F.p3d", "CUP_hrusen2", 0],              
    ["t_FicusB2s_F.p3d", "CUP_str_javor", 0],
    ["t_FraxinusAV2s_F.p3d", "CUP_t_PistaciaL2s_EP1", 0],
    ["t_OleaE1s_F.p3d", "CUP_les_singlestrom", 0], //CUP_t_picea3f    CUP_les_singlestrom
    ["t_OleaE2s_F.p3d", "CUP_str_fikovnik2", 0],                
    ["t_PhoenixC1s_F.p3d", "CUP_misc_BrokenSpruce_PMC", 0], 
    ["t_PhoenixC3s_F.p3d", "CUP_misc_TorzoTree_PMC", 0],//CUP_DD_borovice02
    ["t_PinusP3s_F.p3d", "CUP_t_picea3f", 0],  //CUP_DD_borovice
    ["t_PinusS1s_F.p3d", "CUP_t_picea2s", 0], 
    ["t_PinusS2s_b_F.p3d", "Land_HelipadEmpty_F", 0], // *No trees  //CUP_t_PinusS3s_EP1
    ["t_PinusS2s_F.p3d", "Land_HelipadEmpty_F", 0], // *No trees  //CUP_t_PinusE2s_EP1
    ["t_poplar2f_dead_F.p3d", "CUP_Smrk_maly", 0],  //  CUP_t_picea1s
    ["t_PopulusN3s_F.p3d", "CUP_str_vrba", 0], //CUP_Smrk_siroky
    ["t_QuercusIR2s_F.p3d", "CUP_str_liskac", 0] 
];


{
    ```
#

2nd part ```private _a = ((getModelInfo _x) select 0);
private _c = _repleacearray select {_a == _x select 0};

if !( _c isEqualTo []) then {

    private _b = ((getModelInfo _x) select 1);
    private _replacetree = ([(_c select 0) select 1] call BIS_fnc_simpleObjectData) select 1;
    private _directionOffset = (_c select 0) select 2;

    private _position = getPosWorld _x;
    private _vectorDirUp = [vectorDir _x, vectorUp _x];

    
     
    hideObjectGlobal  _x;
    private _simpletree = createSimpleObject [_replacetree, _position];
    _simpletree setVectorDirAndUp _vectorDirUp;
    _simpletree setDir (getdir _simpletree) + _directionOffset;
    _simpletree enableSimulationGlobal false;
    
    systemchat format["getModelInfo: %1     getPosWorld: %2     replacing tree ",getModelInfo _x, getPosWorld _x,  _x];    

};

} forEach nearestTerrainObjects
[
[worldSize/2, worldSize/2],
["Tree"], //["Tree","Bush"],
worldSize,
false
];
};

hint "Replacing_trees_script done";```

little raptor
#

also your question is confusing. you're trying to replace p3d with p3d?!

#

also using setDir after setVectorDirAndUp makes no sense to me

#

it will reset the up too

#

also your script is very very slow. just use a hashmap instead of the select

#

the script is very bad too

#

you should only replace objects locally for each client (terrain objects are local anyway)

#

not on the server...

#

here's a slightly better one:

private _repleacearray = [

    ["t_BroussonetiaP1s_F.p3d", "CUP_b_betula2w_summer", 0],//CUP_les_singlestrom_b
    ["t_FicusB1s_F.p3d", "CUP_hrusen2", 0],              
    ["t_FicusB2s_F.p3d", "CUP_str_javor", 0],
    ["t_FraxinusAV2s_F.p3d", "CUP_t_PistaciaL2s_EP1", 0],
    ["t_OleaE1s_F.p3d", "CUP_les_singlestrom", 0], //CUP_t_picea3f    CUP_les_singlestrom
    ["t_OleaE2s_F.p3d", "CUP_str_fikovnik2", 0],                
    ["t_PhoenixC1s_F.p3d", "CUP_misc_BrokenSpruce_PMC", 0], 
    ["t_PhoenixC3s_F.p3d", "CUP_misc_TorzoTree_PMC", 0],//CUP_DD_borovice02
    ["t_PinusP3s_F.p3d", "CUP_t_picea3f", 0],  //CUP_DD_borovice
    ["t_PinusS1s_F.p3d", "CUP_t_picea2s", 0], 
    ["t_PinusS2s_b_F.p3d", "Land_HelipadEmpty_F", 0], // *No trees  //CUP_t_PinusS3s_EP1
    ["t_PinusS2s_F.p3d", "Land_HelipadEmpty_F", 0], // *No trees  //CUP_t_PinusE2s_EP1
    ["t_poplar2f_dead_F.p3d", "CUP_Smrk_maly", 0],  //  CUP_t_picea1s
    ["t_PopulusN3s_F.p3d", "CUP_str_vrba", 0], //CUP_Smrk_siroky
    ["t_QuercusIR2s_F.p3d", "CUP_str_liskac", 0] 
];

_replaceHashmap = createHashmapFromArray (_replaceArray apply {[_x#0, getText(configFile >> "CfgVehicles" >> _x#1 >> "model")]});
{
  private _mInfo = getModelInfo _x;
  private _model = _replaceHashmap getOrDefault [_mInfo#0, ""];
  if (_model == "") then {continue;};
  private _position = getPosWorld _x;
  private _vectorDirUp = [vectorDir _x, vectorUp _x];
  private _simpletree = createSimpleObject [_model, _position, true];
  _simpletree enableSimulation false; // this line is probably useless
  _simpletree setVectorDirAndUp _vectorDirUp;
  _x hideObject true;
} forEach nearestTerrainObjects 
    [
        [worldSize/2, worldSize/2], 
        ["Tree"], //["Tree","Bush"],
        worldSize / sqrt 2, 
        false,
        true
    ];
thick merlin
# little raptor for long scripts use https://sqfbin.com

Thanks for the quik reply.I was hoping for it to replace bush1.p3d with bush2.p3d.the script replaces bush1.p3d with the classname of bush2.p3d.Not many objects have classnames/no cfg entry.I found the script on BI forums and started toying with it.I have noticed there is a significant performance loss after the script has run., iam pretty sure.I'll give your script a whirl.Is that your script? So i know who to credit in my mission if it gets released in a mission.

#

Huge Thanks m8!πŸ‘πŸ»

#

ran it from init.sqf

little raptor
#

Well it's your script. I just modified it

thick merlin
#

undefined variable _replacehashmap and _model

little raptor
#

replace the first array with _replaceArray

#

the typo was actually from the script you posted. I typed it correctly myself πŸ˜…

thick merlin
#

coll.tryn it now.:)

#

hahaha

little raptor
#

but in mp the original one will destroy the performance

thick merlin
#

looks like it works a treat.heaps faster too

#

b4 the performance seemed to suffer after the script was run.while playing.

#

Nice one m8.Thanks!!

thick merlin
#

It looks to me that there is a roughly 10fps loss after the process.even if i use a game logic to delete the specified trees.I dont think the script veg replacers are a feasible process.

#

b4 you edited it it took about 90 secs to run .now you edited it it takes maybe 10 secs.

#

You da man!!

#

🀘🏻

sullen sigil
#

if i want to get a hashmap out of _hash apply {}; am i supposed to just output with [_x, _y]; and create the hashmap from the result?

little raptor
#

you mean literally the same _x and _y?

sullen sigil
#

having changed _y but yes

#

use case:

private _arr = [1,2,3];
private _hash = createHashMapFromArray [[1,1],[2,2],[3,3],[4,4],[5,5]];

private _newHash = _hash apply {
    if (_x in _arr) then {
        continueWith ([_x, _y*20]);
    };
    [_x, _y]
};
createHashMapFromArray _newHash;```
little raptor
#

is that an example?

#

it's kinda bad if not

sullen sigil
#

thats what im doing atm, wondering if its the "correct" way

little raptor
#

no it's not

warm hedge
#

BIKI says it only returns array and no mention about modifying Hash

sullen sigil
sullen sigil
little raptor
#

not creating a hashmap unnecessarily

sullen sigil
#

wait i need to do that anyway if im multiplying

#

just realised

#

_hash in my use is a variable on the player that is values per 250ml blood, im multiplying up by blood bag volume/250

#

so need to create that new hashmap anyway to stop the original being modified

ornate whale
little raptor
#

all data in SQF are ref counted pointers under the hood

sullen sigil
#

i really need a new syntax highlighter

warm hedge
#

Oh my the font

sullen sigil
#

you have discovered how i script now

#

i hope you hate it as much as everybody else

warm hedge
#

Instaban ready

sullen sigil
#

the worst part is how much easier it makes reading the code for me lmao

warm hedge
#

But TBH I don't really see why you need to store a person's blood into a Hash instead of their namespace

sullen sigil
#

this is the data for the blood bag

#

if i kept reading out of persons namespace while i had a 1000ml iv going and they contracted hiv midway through

#

i would suddenly get hiv

#

despite the fact they donated hiv-less blood

little raptor
#

wut

sullen sigil
#

if i donate blood

#

then get hiv afterwards

#

the blood i donated does not become hiv positive

ornate whale
sullen sigil
#

but if i kept reading out of the players blood data rather than giving blood bags hashmaps of data

#

then any changes to the players blood data mid iv would mean they would be reflected in the iv bag

winter rose
sullen sigil
winter rose
#

I mean the font QGVAR - the A and R are too alike for me

tender fossil
#

Back to the days of illegible handwriting πŸ˜„

#

(Yikes, that actually reminded me from a programming course exam where we had to "code" on paper...)

winter rose
#

reminds me of a job offer test too

#

"here's a pen and a paper"
…dude, Ctrl+Z?

tender fossil
#

Exactly

sullen sigil
sullen sigil
#

the grind never stops

sullen sigil
kindred zephyr
#

does anyone know what the following hitpoints are used for?

258 leg_l Leg (Left)
259 leg_r Leg (Right)

You can actually detect these parts, but the hitpoint commands does not return the equivalent to them on units.

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


getAllHitPointsDamage player;
//[
//["hitface","hitneck","hithead","hitpelvis","hitabdomen","hitdiaphragm","hitchest","hitbody","hitarms","hithands","hitlegs","incapacitated"],
//["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"],
//[0,0,0,0,0,0,0,0,0,0,0,0]
//]
sullen sigil
#

are they for the dog

kindred zephyr
#

2 selections for left and 2 selectiosn for right?

#

oh god

sullen sigil
#

🀷 just my guess

granite sky
#

HandleDamage detects them on humans. Selection rather than hitpoint.

#

I think they just stack damage onto the legs hitpoint. Same with the separate arm/hand selections.

kindred zephyr
#

yeah, I've noticed that

#

brings hope to my situation but makes me wonder why the hitPoint commands generalize them

granite sky
#

I would guess it's because the sub-selections don't store damage. They just pass it up the chain.

#

But I've not done any Arma modelling so it is just a guess.

astral bone
#
{
    if(_x isKindOf "EmptyDetector")then{
                 ....
        deleteVehicle _x;
    };
}forEach synchronizedObjects _obj;

Will this work or will it break the for loop and make it skip over things
Also, can I delete triggers with deleteVehicle? x3

granite sky
#

IIRC deleteVehicle doesn't actually delete the vehicle until the next frame, so it might be fine in unscheduled.

#

and even if it did, it might not change the array immediately.

analog hull
#

Also is there anything I can change to make it better?

#

Helo comes to me and lands, I get in and it errors with var base not declared

winter rose
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
sullen sigil
#

!quote 5

lyric schoonerBOT
astral bone
#

they're just using getPos, no?

winter rose
#

getPos is only good to know the altitude from the surface below, otherwise something else should be used

astral bone
#

What aobut if ya don't need alt?

sullen sigil
#

getpos is slow

winter rose
#

getPosASL is the fastest (getPosWorld is the fastest but it has an offset, so beware with non-flat)

sullen sigil
#

any pos without a suffix is slow

astral bone
#

oh heh- heads up, if ya wanna make a ctrl event handler, wait until after the senario is ready πŸ˜…
Been pulling my hair out, of course, finally check if it's being made. Nope, trying to make it too early xD

#

no, you had it, just before the new line after ``` put sqf without a space between them

#

```[LANGUAGE]
code
```
will make it appear according to the language's syntax

astral bone
jade acorn
#

is there a fade out function for titleRsc just like cutRsc has cutFadeOut?

#

trying to find a way of getting rid of resources of infinite duration.

analog hull
# wicked roost

Been trying to use the syntax highlighting, BUT its not working

winter rose
#

@analog hull ```sqf <line return>

stable dune
analog hull
#

There worked this time. Someone said stop using "getpos" What do I use in its place????

winter rose
#

getPosASL getPosATL getPosWorld
the choice is yours

astral bone
#

can you tell what has been manually added? x3

#

hmm- wish I could make the outline, but eh well

sullen sigil
#

use o&t eden expansion

#

im 90% sure it lets you add road markers

#

i know it lets you do map markers for "terrain" objects

astral bone
#

does it cover up location names

sullen sigil
#

🀷

#

do you want to hide location names

astral bone
#

no

#

but if you make a marker for buildings via a map marker, it covers location names x3

sullen sigil
#

oh

#

i dont know

analog hull
winter rose
hallow mortar
#

Marker names and variable names aren't quite the same thing. You can save a marker name into a variable with its own name, but really markers are referenced by strings passed to marker-specific commands.

granite sky
#

Here it'd probably be getMarkerPos "base"

little raptor
#

I don't think it modifies the road network, so AI can't use it

sullen sigil
#

ive added bridges over land before and ai have used those

#

tho it was a small distance

dreamy kestrel
hallow mortar
#

You need a `, not a '
* or rather, three of them

dreamy kestrel
little raptor
#

` is basically the same button as ~ on most keyboards
if you press it with shift you get ~. without it you get `

red shale
#
fn_changeTexture = {
    params ["_object", "_texture"];
    _object setObjectTexture [0, _texture];
};

{
    private _unit = _x;

}
 {

    Laptop2 addAction ["Modual2_1", { 
        [S1 , "Slideshow\1.paa"] call fn_changeTexture; 
    }]; 
    Laptop2 addAction ["Modual2_2", { 
        [S1,  "Slideshow\2.paa"] call fn_changeTexture; 
    }]; 
    Laptop2 addAction ["Modual2_3", { 
        [S1 , "Slideshow\3.paa"] call fn_changeTexture; 
    }]; 
    Laptop2 addAction ["Modual2_4", { 
        [S1, "Slideshow\4.paa"] call fn_changeTexture; 
    }];
    Laptop2 addAction ["Modual2_5", { 
        [S1 , "Slideshow\5.paa"] call fn_changeTexture; 
    }]; 
    Laptop2 addAction ["Modual2_6", { 
        [S1, "Slideshow\6.paa"] call fn_changeTexture; 
    }];
    Laptop2 addAction ["Modual2_7", { 
        [S1, "Slideshow\7.paa"] call fn_changeTexture; 
    }];
Laptop2 addAction ["Modual2_8", { 
        [S1, "Slideshow\8.paa"] call fn_changeTexture; 
    }];
Laptop1_1 addAction ["Modual1_1", { 
        [S1, "Modual\1.paa"] call fn_changeTexture; 
    }];
Laptop1_1 addAction ["Modual1_2", { 
        [S1, "Modual\2.paa"] call fn_changeTexture; 
    }];
Laptop1_1 addAction ["Modual1_3", { 
        [S1, "Modual\3.paa"] call fn_changeTexture; 
    }];
Laptop1_1 addAction ["Modual1_4", { 
        [S1, "Modual\4.paa"] call fn_changeTexture; 
    }];
Laptop1_1 addAction ["Modual1_5", { 
        [S1, "Modual\5.paa"] call fn_changeTexture; 
    }];
} forEach playableUnits;``` 

Got it,
#

anyway trying to make so all players can see the texture change

hallow mortar
#

There's not much point in having fn_changeTexture if calling the function is the same length as just doing it without a function

#

The main answer though is to use setObjectTextureGlobal

red shale
#

OMFG i feel so stupid

#

Thank you vey much Nikko

dreamy kestrel
#

Q: about adding bits via any of the addXyzCargoGlobal commands... apparently Ga+Ge, 'when' does the local player 'see' the change? synced, yes, but 'when' is the local effect?

hallow mortar
#

On the machine that executed it? Same or next frame, I would expect.
On other machines? However long it takes the message to cross the internet, probably.

dreamy kestrel
#

thanks... 'irrelevant' for other machines in this case... player will have a inventory manager display open, needs to be refreshed immediately (ish) for the lists to show correctly. thanks...

#

corollary to all that, weapon inventory, and its accessories, magazines and attachments... can I gauge whether I can add or load such an item using the same base canAdd command? i.e. does not matter whether associated with the weapon at all, it is treated the 'same' from an overall inventory perspective for things like mass considerations?

pulsar pewter
#

Hey folks, I am making an op for my players where they have to go destroy some SAMs, and theyre gonna be using a bunch of drones. I dont want the SAMs to just destroy the drones, though, so I wanna limit their engagement to stuff that is above a certain altitude.
What might be better, performance-wise?
A trigger that is server-only, which occupies most of the map, with an activating condition of that specifies altitude>100 (or something), or an executed script with a loop that checks every 10 seconds or so, and if a drone is above 100m, it turns the SAM radars on?

#

Im leaning to the script, but not sure.

#

For script, I was thinking of something like:

  sleep 10;
_UAVinRange = [];
               {
                    private _altitude = getPosATL _x select 2;
                    if (_altitude > 100) then {_UAVinRange pushBack _x}
                }
                forEach allUnitsUAV;
                if (count _UAVinRange > 0) then {
                {_x setVehicleRadar 1} forEach SAMSonMap} else {{_x setVehicleRadar 2} forEach SAMSonMap;
winter rose
#
sleep 10;
private _UAVinRange = [];
{
private _altitude = getPosATL _x select 2;
  if (_altitude > 100) then
  {
    _UAVinRange pushBack _x
  };
} forEach allUnitsUAV;
if (count _UAVinRange > 0) then
{
  { _x setVehicleRadar 1 } forEach SAMSonMap
} else {
  { _x setVehicleRadar 2 } forEach SAMSonMap;
}; // ← missing "}"
pulsar pewter
#

oops, didn't copy/paste everything from VSC.
I'm also not being careful enough to script it so the SAMs target only stuff that has above that altitude, but should be fiiine.

winter rose
#
sleep 10;
private _UAVsInRange = allUnitsUAV select { getPosATL _x select 2 > 100 };
if (_UAVsInRange isEqualTo []) then
{
  { _x setVehicleRadar 2 } forEach SAMSonMap;
}
else
{
  { _x setVehicleRadar 1 } forEach SAMSonMap;
};
```simplified
#

actually, you don't even need to get them all, just check if one UAV is > 100m

#
private _isOneUAVAbove100m = allUnitsUAV findIf { getPosATL _x select 2 > 100 } > -1;
if (_isOneUAVAbove100m) then // ...
pulsar pewter
#

True.
I originally set it up to make an array of which UAVs were above 100m so I could then write a script telling the SAMs to only target the UAVs in that array, but then decided not to bother haha.

winter rose
#

fair enough!

dreamy kestrel
desert socket
#

how can i make a sound loop? i have the sound already ingame, just dont know how to make it loop. (added by a mod, in the SFX category)

desert socket
#

I want it to be looped with a trigger if possible

sullen sigil
#

then loop it with a trigger

hallow mortar
#

Scripters hate this one simple trick

#

I don't have time right now to write a full explanation, but the most basic way is to use a while to create a loop, and sleep to create a delay the length of the sound. If running from a trigger, you may need spawn to create a scheduled thread where using sleep is allowed.

noble flicker
#

Is there a way I could fade an image (I've have a paa file ready) in and out during a cutscene? It's a logo for the mission that's just for the intro.

hallow mortar
#

ctrlCreate with RscPictureKeepAspect to make a picture displayer; ctrlSetText to give it the image path; ctrlSetPosition to set position and size; ctrlSetFade to adjust transparency; and ctrlCommit to apply properties like fade over a given duration.

dreamy kestrel
grizzled cliff
#

too bad the only type of persistent missions that make sense in Arma are COIN and arcade games.

#

maps are way too small for anything else

drowsy geyser
#

I have this code below and I want the same result for every client. How would I achieve that? I just did it via the server only trigger and sent the sql file to everyone via remotexec, but it's still not synced.
https://sqfbin.com/nagowokenavifujuyale

golden cargo
little raptor
#

also:

_objectsInTriggerArea = [];

{
    if (_x inArea arenaTrg) then 
    {
        _objectsInTriggerArea pushBack _x;
    };
} forEach _allObjects;

can be shortened to:

_objectsInTriggerArea = _allObjects inAreaArray arenaTrg;
drowsy geyser
#

then if replaced with the boxes it would look like this

#

now i need to delete some of the boxes to make some free space

little raptor
kindred tide
#

are you making a maze generator

#

i suggest some cellular automata algorithm instead of randomly placing walls

drowsy geyser
kindred tide
#

well then i'll write one

drowsy geyser
little raptor
#

there's nothing local about it as far as I see

drowsy geyser
#

Yes but the random deletion and random placement of object are not same for everyone, thats the problem

little raptor
#

are you executing it on the server?

drowsy geyser
#

I tried with server only trigger

slender beacon
#

Is there a way to move what part of the map is viewed with UIToTexture?

little raptor
#

ctrlMapAnimAdd?
ctrlMapSetPosition?

slender beacon
#

I couldn't make that work last time. I think my params were meh, I'll try again. Thanks!

#

I'll come again if that doesn't work!

distant egret
#

I tried both of those as well a while ago, no luck either πŸ˜…, tell me if you get it working 🀞

slender beacon
#

Sure thing!

rancid lance
#

if im using the hit part event handler and want to spawn something on the _selection of the _target that was hit
How would i go about doing that?

Like i have the object spawning on the target but i need the "_selection" to attach it to the lad properly < -> i know _selection returns a string but how do i tell it to pick the nearest selection/first selection hit?

tulip ridge
#

Can't you just give the selection to attachTo?

rancid lance
#

no

#

because _selection returns a string

#

a list of selections available on the object
Not the selection hit

#

but i know something returns that value notlikemeow

#

like its shown here

tulip ridge
#

HitPart gives an array of arrays, just do it how it's shown on the EH wiki:

this addEventHandler
[
    "HitPart",
    {
        (_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
        someObj attachTo [_target, [0, 0, 0], _selection#0];
    }
];
tulip ridge
rancid lance
#

i put it in there but didnt have the #0

#

goober moment, hopefully that works

rancid lance
#

or is there another resource i be missin

tulip ridge
#

That's the one

rancid lance
#

hmmm

rancid lance
#

weird

#

if i shoot them in the head it sticks in the head, hand in the hand, but anywhere else, ground

little raptor
#

if you're using attachTo, it uses the memory LOD

#

so the damaged selection may not exist in that LOD

tulip ridge
#

Yeah I just looked at attachTo again and saw it takes a mem point, was thinking it took a selection for some reason

little raptor
#

it does take a selection

rancid lance
little raptor
#

are you just trying to show it temporarily?

#

or you want it to "stick" there (like attachTo)?

rancid lance
#

i want it to attach to the point hit temporarily then vanish after a bit

#

for now im focusing on the attach part

#

Marb_Brute_FNC_Spiker = {

    _projectile addEventHandler ["HitPart", {
        params [ "_projectile", "_hitEntity", "_projectileOwner", "_pos", "_velocity", "_normal", "_component", "_radius", "_surfaceType"];
        systemChat "yeoch!";

        private _dumbass = _hitEntity;
        private _HitSection = _component;

        [_dumbass] remoteExec ["Brute_SpikeFNC", 0, _dumbass];
    }];
};

Brute_SpikeFNC =
{
    params ["_dumbass", "_lightSource", "_HitSection"];
    _dumbass addEventHandler ["HitPart", {
        (_this select 0)params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect", "_lightSource"];

        private _bruteSpike = createVehicle ["P_Brute_Spike", getPosATL _projectile, [], 0, "CAN_COLLIDE"];

        _bruteSpike attachTo [_target, [0, 0, 0], _selection#0];
        _bruteSpike setDir getDir _projectile;
        deleteVehicle _Projectile;
    }];
};

publicVariable "Marb_Brute_FNC_Spiker";
publicVariable "Brute_SpikeFNC";
little raptor
#

it's sqf btw