#arma3_scripting

1 messages ยท Page 92 of 1

finite bone
#

So a remoteExec is required for global pip effect then, thanks!

warm hedge
#

Yup

#

GUI or such only exists locally AFAIK, so if everyone needs to see the same thing, you need to execute on every machine

finite bone
#

Thats good to know thanks a lot!

tribal sinew
#

I'd like to make some of the params of my script optional. I'm currently executing it this way:

[[p1,p2,p3]] execVM "scripts\someScript.sqf";

And then in someScript.sqf:
params ["_vehicleArray"];

But the [p1,p2,p3] array is not always needed.

How can I check inside the script whether the array was passed as one of the arguments in the execVM?

hallow mortar
#

Have a look at the params wiki page. It shows how to use default values for params that aren't received.

Note that because params are interpreted in the same order as passed, optional parameters must be after all the mandatory parameters, and aren't optional if you want to pass one that comes after it.

tribal sinew
#

Thanks Nikko, this seems to work
params [["_vehicleArray", ["_vehicleArray", []]]];

south swan
#

nil works as a placeholder for optional value that's not passed blobdoggoshruggoogly

[nil, 1] params [["_one", objNull], ["_two", objNull]];
[_one, _two] // gives [<NULL-object>,1]```
hallow mortar
#

HC icons are defined in CfgGroupIcons. You can look this up in the in-game config viewer to see what's available

vapid scarab
#

Awesome!

kindred zephyr
vapid scarab
# tribal sinew Thanks Nikko, this seems to work `params [["_vehicleArray", ["_vehicleArray", []...

Does that actually do what you want?
This is how I would write it based on your original question: (you can remove the spaces, they are there to make it more readable)
params [ ["_vehicleArray", [], [ [] ] ];
One parameter name "_vehicleArray", a default value of [] (empty array), and acceptable types of only [] (type array).

And the condition would be something like:
if (count _vehicleArray != 3) then { /* do something else */ };

If im interpreting your code right, (rewrote below):
params [["_vehicleArray", ["_vehicleArray", []]]];
One parameter of "_vehicleArray", and a default value of ["_vehicleArray, []]

What you wrote VERSUS what I wrote based on how I interpreted what you wanted in your original question (#arma3_scripting message) have different behaviors.

sullen sigil
#

How do you not specify a soundPosition for playSound3D but still access the volume and such? meowsweats

proven charm
#

@KJW default [0,0,0] thonk

sullen sigil
#

that plays the sound at 0,0,0

vapid scarab
sullen sigil
#

if you dont provide a position but provide a soundsource it plays from that

#

which is what i want

tribal sinew
vapid scarab
sullen sigil
#

no its not because using nil returns an error

#

i dont want it to play from [0,0,0] it needs to play from the sound source

vapid scarab
#

I see what you want. You have to define position to define volume. What you need to do is provide the position of the object manually.

_pos = getPosASL soundSourceObject or something like this and pass that to position. It will result in the same thing. Read KillzoneKid's second comment at the end of https://community.bistudio.com/wiki/playSound3D

Is this right?

sullen sigil
#

oh yeah guh its not moving

#

ignore me then

vapid scarab
#

No problem. Happy to help ๐Ÿ˜

proven charm
sullen sigil
#

because you tell it to

proven charm
#

maybe the command ignores that location

vapid scarab
#

Position overrides object position.

proven charm
#

sure but there maybe exception

winter rose
#

oh?

proven charm
#

test it ๐Ÿ™‚

sullen sigil
#

you tell it to play at [0,0,0] so it plays at [0,0,0]

proven charm
#

did u test?

sullen sigil
#

yes

proven charm
#

ok

winter rose
proven charm
#

weird command what if u pass nil?

#

or empty array ๐Ÿ˜

winter rose
#

nil won't work iirc

it only plays at a position anyway, so provide soundSource's ASL pos?

sullen sigil
#

yeah it doesnt actually matter i was under the false impression source meant the sound would follow it

#

guess i have to get creative with say3d

winter rose
#

yeah say/say3D, otherwise attachTo

sullen sigil
#

attachto? que?

winter rose
#

well, + createSoundSource

#

say has a limit of one sound at a time

sullen sigil
#

ah

#

don't really want to use createSoundSource as it's another thing to attach to this

#

say3d will probably be fine

#

course, i forgot about the sound limit meaning i can't stack say3D notlikemeowcry

winter rose
#

well you can stack them and they will say thingsโ€ฆ one by one ๐Ÿ˜„

sullen sigil
#

its for an engine loop for my capital ships project so needs to be uh
substantially loud ๐Ÿ™ƒ

#

I guess I just need to find a super short loop then so it's not as noticeable as increasing volume in the file causes problems

winter rose
#

createSoundSource?

#

this way it will loop seamlessly

sullen sigil
#

i suppose if i stack them and attach them to where the engines physically are it could work? meowsweats

winter rose
#

stack?

sullen sigil
#

multiple of them on top of one another

#

more sound ๐Ÿ˜„

winter rose
#

. . .

sullen sigil
#

(its what i was doing for playsound3d)

#

oh, requires cfgvehicles config woo

winter rose
sullen sigil
#

oh joyous

#

ffs

sullen sigil
#

ya got it all already thanks

winter rose
#

GL! it's not complex, it's just one initial setup and it's entirely autonomous after that

sullen sigil
#

i think all i need is sound0[] in cfgsfx? not clear whether empty[] is required or not meowsweats

#

oh wait yes it is

sullen sigil
#

is there any reason a sound source would stop playing when moved a fairly big distance quickly? thonk

#

I'm hearing it on occasion when the ship (which source is attached to) is spawning but when its position is set the sound source just doesn't play

winter rose
#

try with a setPosWorld loop?

sullen sigil
#

thing is, it works 100% fine when I run nearly the exact same code (just changing how I reference the same object) in debug console after its position has been set notlikemeowcry

winter rose
#

ยฏ_(ใƒ„)_/ยฏ

#

have you thought of a potential simulation rate issue?

sullen sigil
#

the sources are being moved properly, but just not playing the sounds meowsweats

sullen sigil
hallow mortar
#
  • Does the sound actually stop or does it continue to play at the original location?
  • Does the sound update its position when moved a short distance?
  • Does this happen when the sound source is moved a large distance independently, without attaching it to anything?
sullen sigil
#
  • dont know, will check created at debug corner, sound isnt present there
  • when done on debug console it does (as im eachframing setposasl)
  • worked fine with attaching to a quadbike from creation at [0,0,0] but will check with same as this
#

it does not happen without attaching

#

however i do a lot of movement so im going to rework a function then come back to this

finite bone
#

So apparently if you set camSetTarget to a position / target directly below the camera, it simply points up to space. Is there anyway in achieveing this?

sullen sigil
#

revamping the function that moves the ship after its spawned did not help weirdly

sullen sigil
#

much like my previous relationship, ignoring my problems did not fix them

finite bone
# winter rose offset by 0.001

Yea even still its not exactly a top-down view of the target. I've found a work around by adjusting the offsets further but it now looks more like a drone view than a straight-down satellite view.

sullen sigil
#

putting a waitandexecute in worked fine, dunno why

#

seeing as other things were being attached etc just fine

finite bone
#

Also whats the difference between camconstruct and camera in the camcreate type?

vapid scarab
#

How can I check if a given string is the name of a item class?

sullen sigil
#

Think I've figured out the root of the issue
if i go far away (cant figure out how far, its not object render and its not sound distance as ive set that to 50km) from a soundsource the sound stops playing and doesnt start again thonk

still forum
#

you can set sound distance?

sullen sigil
#

yeah but is created at [0,0,0] and setting sound distance changes the volume from what i can tell as someone who is hearing impaired

#

(im referring to the distance in cfgsfx)

sullen sigil
#

not been able to find the precise cause but just going to have to deal with waitandexecuting it and having it sound shit

#

...i can just make the object itself have a sound ๐Ÿคฆโ€โ™‚๏ธ

#

no i cant because thats the same thing

still forum
#

Ahh that sound distance. I was thinking of like video settings

sullen sigil
#

ya, not that lol

#

this is a huge pain in the ass and i am no further with it lol

#

basically i just need to loop a somewhat long sound from an object while its moving, ideally with the ability to increase volume above 5 lmao

crisp cairn
#

Heya all, possibly dumb question. I am working on a mod with ace, however I can't really find out the variable names. Is there anyway to view the variables in use?

sullen sigil
#

look in their github

#

and/or functions viewer but that with ace is a bit of a pain

little raptor
#

an item class is already a string. so you can just use == to compare
or do you mean the item's display name?

vapid scarab
#

how do I test if "aaa" is or isnt a item?

hallow mortar
#

isKindOf? You might have to combine a couple depending on how broad your definition of "item" is

vapid scarab
#

what would be on the right hand side? What is the generic item class?

#

Definition of item is any item equippable or storable in the inventory

granite sky
#

Including backpacks or not?

#

Backpacks are in CfgVehicles. Everything else is in CfgWeapons.

vapid scarab
#
["I_supplyCrate_f","arifle_MX_F","B_AssualtPack_blk","aasiuhdaiuhds"]

1st string is a supply crate. 2nd string is a rifle. 3rd string is a backpack. 4th string presumably doesnt exist, but a mod from Mr. Boogie might have added an item called "aasiuhdaiuhds". How do I test each string to see if it is a item class?

granite sky
#

I feel like there's been a design screwup if you have that in an array.

vapid scarab
#

Exactly. A more realistic case would be "arifIe_MX_F". Do you see how that isnt a reference to the MX rifle? the L has been replaced with an I.
This is why I want to test a string and see if it is an item

#

And yes, backpacks need to be included, but I also understand they might need a special test case

hallow mortar
#

The way I am thinking would be a set of isKindOf checking against the highest-level parent for each type - e.g. itemCore, magazineCore etc. You'd need to do some config research to find all the possibilities.

vapid scarab
#

I think i just found what I want.
BIS_fnc_itemType.

granite sky
#

If you know it's not a backpack you can just do isClass (configFile >> "CfgWeapons" >> _item)

#

If you need to know exactly what type of item it is then itemType will do that. It is fairly slow, bear in mind.

vapid scarab
hallow mortar
granite sky
#

oh yeah, magazines as well :P

#

Common issue with itemType is that mods will just spam almost all primary weapons into Rifle.

vapid scarab
#

My primary purpose is to catch typos with a per mission inventory user config (script inventory config, not an actual arma config). A catch-all is fine.

granite sky
#

Oh, if you're looking for typos then just isClass on CfgWeapons, CfgMagazines and CfgVehicles (for backpacks) is sufficient.

#

itemType does a lot more than that.

vapid scarab
#

If I run into performance issues with itemType, ill use the other method

quiet pagoda
#

Hi I am making a convoy but I have a problem. when the first car gets blown up or cant drive anymore all the other cars stops behind it. I'm using a: Better convoy mod

quiet pagoda
#

evrything is working good but the only problem I have is what I explaind. Cant find anything on the internet.

#

when they are in one group they behave better. but it has minuses

#

yes

#

wait

#

ye I did seperate one truck from the cars but its hard to make all drive on its one while looking like a convoy

#

ye, no problem. I will try to make all cars drive on its one by making convoys for each others

#

But they act like children when I make them drive sepretliv. They always wants to be first on the road, so they tried to overtake everyone๐Ÿ˜‚

granite sky
#

yep

#

You can solve this stuff with a lot of scripting, but if your starting point is using a mod then you're a long way short of that.

vapid scarab
quiet pagoda
granite sky
#

Put the fastest vehicles at the front and they won't trip over each other as much :P

sullen sigil
#

how does antistasi do theirs? ๐Ÿค”

granite sky
#

Wellll, the waypointing and initial vehicle placement are so complex that they're out of scope. The convoy in-motion management uses a spawn per vehicle that: a) Bumps to the next waypoint when sufficiently close, b) Adjusts limitSpeed base on the distance to the vehicle ahead and c) Detects whether the vehicle hasn't made enough progress towards the current waypoint and removes it from the convoy.

#

Without intermediate waypoints, C is hard to get right and B breaks down because some vehicles will take different paths.

#

And then if you don't get the initial vehicle placement right they'll just fall over each other getting to the first corner.

mortal roost
#

Hey everyone

Im trying to limit a vehicles speed to 5kph and the following works great
_this setCruiseControl [5, false]

However it doesnt limit the reverse speed and players being players will find this and exploit it.

How do I restrict the reverse speed to 5kph as well?

#

disabling reverse would also work for my intentions

granite sky
#

Unless forceSpeed works, maybe nothing except config changes and dirty hacks (eg setVelocity looped).

mortal roost
#

cheers I will give that a go

#

Sadly doesnt appear to work

#

is there just a way to disable reversing?

shut carbon
#

Only positives values are valid, negative values will make the vehicle unable to move forward

#

see if that stops reverse

mortal roost
#

I did
And as it says when using a negative value it disabled forward movement and all reverse movement was still doable at all speeds

shut carbon
#

๐Ÿซค

mortal roost
#

I wouldnt mind disabling forward movement if it limited reverse speed

Basically I just want to emulate a crippled vehicle that can only limp out of combat

breaks immersion a little if it can reverse at 40kph haha

shut carbon
#

a keyhandler to disable backwards?

mortal roost
#

How would I do that

mortal roost
#

huh so lock out the "s" key

#

that should work

shut carbon
#

you lock out the actual action(s)

mortal roost
#

ahh got you

shut carbon
#

CarBack

mortal roost
#

was just looking for that

#

thanks

shut carbon
#

๐Ÿ˜‰

#

not sure that's the correct EH for the actions though, I know there's a way to input action instead of key

mortal roost
#

Thanks I will will have a play and see if I get it working

shut carbon
#

ok have fun ๐Ÿ˜„

mortal roost
#

I may have bruises on my forehead at some point from head butting my desk haha

vapid scarab
#

Im still learning how to work with configs, so if configs are required for this, please provide at least a basic example and explicit function to use.

How would I got about get all the items for a mod?
Essentially, I want to get all the items for Ace Medical, Ace Pharmacy, and ACE KAT

#

But not each may be loaded. I already know how to test if a mod is loaded.

hallow mortar
strange elk
#

Does anyone know how to make a script that respawns a vehicle 5 seconds after it fires?

#

I'm playing with the s-75 missile but I can't do the infinite ammo script that I use on everything else the "This event handler fired select zero script" everyone knows. Does anyone know of a way I can modify that script to respawn the vehicle instead?

#

I tried this "this addEventHandler ["Fired", ((.this select 0) respawnVehicle [5,0]}]; but It didn't work

finite bone
strange elk
#

The s-75 once fired is just done

#

It's a single use missile holder from what I see

#

So if I respawn it, I don't have to keep going into Zeus and placing endless missiles

finite bone
strange elk
#

No I just want it to respawn where it's already placed

finite bone
#

But you should be better off with BIS_fnc_spawnVehicle https://community.bistudio.com/wiki/BIS_fnc_spawnVehicle

this addEventHandler ["Fired",
{
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
_unit_pos = getPosASL _unit;
_unit_dir = getDir _unit;
_unit_type = typeOf _unit;
_unit_side = side _unit;
deleteVehicle _unit;
[_unit_pos, _unit_dir, _unit_type, _unit_side] call BIS_fnc_spawnVehicle;
}
];```
south swan
#

except the newly spawned vehicle wouldn't have this EH ๐Ÿฟ

winter rose
#
TAG_RespawnEvent = {
  params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
  _unit_pos = getPosASL _unit;
  _unit_dir = getDir _unit;
  _unit_type = typeOf _unit;
  _unit_side = side _unit;
  deleteVehicle _unit;
  [_unit_pos, _unit_dir, _unit_type, _unit_side] call BIS_fnc_spawnVehicle params ["_veh"];
  _veh addEventHandler ["Fired", TAG_RespawnEvent];
};
this addEventHandler ["Fired", TAG_RespawnEvent];
finite bone
#

For once my code works as expected Kapp

winter rose
#

thou shalt still be smitten for _snake_casing_your_variables! ๐Ÿ˜„

timid ridge
#

Would it be possible to create a script that checks what kind of gear the player(s) got on and fills an inventory with the ammo/other stuff that people might need to resupply?

warm hedge
#

For instance? You want to add magazines they use in their gun?

timid ridge
finite bone
manic kettle
hallow mortar
#

That only works if they haven't already run out

manic kettle
#

Sure I guess I assumed that would be the case that they prep a resupply box.

There are only two ways then if that isn't the case. 1 is to preprogram a gun to ammo array to fill the box with compatible mags.
2 use BIS_fnc_compatibleMagazines, but then you get a huge list of compatible mags depending on modpack

little raptor
#

You're probably just doing setAmmo. Missiles are mags not ammo (as in when you fire the mag itself is removed)

orchid yew
#

hey guys having issues with ghost riders classname puller script anyone able to have a look and figure out why its not working please?

winter rose
orchid yew
#

its doesnt pull anything what so ever

winter rose
#

maybe you are using it wrong?

orchid yew
#

all the other scripts work now and previously artemoz on this discord fixed the weapons and magazines script like its actually broken

winter rose
#

contact the author

#
Parameter(s):
    0: STRING - item class

there are no considered parameters in here

timid ridge
kindred tide
#

is it possible to combine an image texture/icon with a procedural one? e.g to tint it

#

something like #(argb,1,1,1)color(1,0,0,1) * image (\Ca\ui\data\markers\gr_flag_CA.paa)

warm hedge
#

No

hallow mortar
#

In structured text, the color attribute can be used on images, though I don't know how exactly it behaves outside of the NATO unit type markers.

tribal sinew
#

_vehicle emptyPositions "" seems to return 4 when I'm calling it for some RHS vehicles in which there are: driver, gunner, 3 x passenger (which is 5 seats). Any ideas why?

#

Nevermind I think, one of the comments mention that I should use fullCrew instead.

wary needle
#

Is there a way to remove the auto respawn by script? People are able to spawn on dead cars and people

slow brook
#

You mean when you respawn on the position you just died in?

wary needle
#

No there is a button that respawns you when the timer runs out. The issue is that bohemia devs are not smart. So it also works on dead respawns like a blown up respawn hemet

hallow mortar
#

Vehicles can only be used as spawns if they've been added with BIS_fnc_addRespawnPosition. So when you do that, save the ID it returns, and use a killed event handler to remove it with BIS_fnc_removeRespawnPosition once the vehicle is dead.

finite bone
south swan
#

๐Ÿง  create an Arsenal box with only magazines/grenades but without weapons/uniforms/whatevers

finite bone
# timid ridge Yes, is that unfeasible?

untested, but you get the idea

arcresupply = [];
private _players = allPlayers select {!(_x isKindOf "VirtualMan_F")};
{
    _mags = magazines _x;
    arcresupply pushbackunique _mags;
} foreach _players;
supplybox = createVehicle ["B_supplyCrate_F", position player, [], 0, "CAN_COLLIDE"];
{
    supplybox addItemCargoGlobal [_x, 10];
} forEach arcresupply ;

Things you need to edit:
position player => Position (Grid or another object) you want to create the supply drop
10 => Amount of magazines you want to load inside the supplybox

timid ridge
vapid scarab
#

If you by chance are making your own zeus module for resupply, zeus additions includes a really nice resupply module that is already placed.

timid ridge
#

I'll have a look at that as well, thank you

astral bone
#

scopes confuse me. Will this work? x3

// objs = array of objs. 
// _buildingStr = string, ie 'Land_i_Addon_02_V1_F'
_building = _objs select (_objs findIf {_buildingStr == typeOf _x});
#

normally I'd just check, but I can't right now, sadly

#

wait no, I should maybe just iterate through manually, since I needa touch the non building objs anyway

winter rose
south swan
#

and _array select -1 is apparently a supported way to get the last element now ๐Ÿ˜ฎ

astral bone
#

it can access the buildingStr

winter rose
#

yup

slow brook
#

Are we talking 1GB here? 300MB?

little raptor
#

e.g. mine is 600 KB rn

slow brook
#

Interesting

little raptor
#

it's not just a matter of performance. with larger profile namespace the risk of corrupting it is greater

kindred zephyr
#

^

I change profiles according to what mode im gonna play if they save to profile

little raptor
slow brook
#

Nope, I've made Simple Persist

#

Mines got 30~ players data stored in it

little raptor
#

oh you're the server ok

granite sky
#

Mine's 20MB, I restart Arma dozens of times a day, often with alt-f4, and it never corrupted :P

slow brook
#

๐Ÿ˜„

granite sky
#

Too many Antistasi test saves, a few Vindicta and an Old Man from before they fixed it.

little raptor
slow brook
#

ALIVE corrupted one of my profiles before

#

Thats why I've made my own one

little raptor
#

I recommend using a DLL instead (or an existing DB mod like exDB)

astral bone
#

ok. Now, I am about to need to leave for something, so I'm put my plan here so I can come back to it.
Syncing items to a game logic. In logic's init, call a function with the logic and a string. Finds all objects sync'd, finds the first one that matches the string and makes that the building. The rest of sync'd objects will be saved. When building is damaged- idk how, but check if damage is a certain amount. If yea, make the objects- "fall"

slow brook
astral bone
#

I think he means DLL for the saving

slow brook
#

Way too much hassle and it's not exactly well documented

little raptor
#

you could implement it in a safer way I guess

#
  • async saving maybe
slow brook
#

I mean, I'm likely to add a DB extension to this later.. but "simpler"

sullen sigil
#

for some reason my entire profile folder is excess of 1gb

#

unsure why

astral bone
little raptor
#

such as handleDamage

#

or hitPart if your building doesn't support damage (so you can implement a scripted damage system)

astral bone
#

OH PFFT
ok, maybe I wanna clear some of the data in my profile ๐Ÿ˜…

still forum
#

We have extra namespaces now per mission, that can be used for saving stuff

little raptor
#

or just the folder?

astral bone
#

folder

#

oh right, not the file

little raptor
#

well it contains lots of saves. if you don't need them they're safe to delete

#
  • missions you create in 3den
astral bone
astral bone
slow brook
#

Soo all I'm seeing here is that 4GB is workable ๐Ÿ˜„

astral bone
kindred zephyr
#

speaking of profiles. How does one fully remove data from the file?

Do I make the variable nil or...?

slow brook
#

we have proof

little raptor
#

then save it (saveProfileNamespace)

astral bone
slow brook
astral bone
#

the other image was not of the file, but the whole folder

little raptor
still forum
astral bone
#

I mean, in theory ya could make a txt file or no?

kindred zephyr
#

missionProfileNamespace?

slow brook
#

missionProfileNamespace

still forum
#

yes

slow brook
#

Interesting

little raptor
#

but reading txt is meh (if it actually contains text)

slow brook
#

Does that save to the MissionName? IE If you change the mission description.ext / mission.sqm would a new one be generated?

little raptor
#

yes

#

or per missionGroup

hasty gate
#

How to override a final compiled function?

little raptor
#

don't final it meowsweats

hasty gate
#

its not mine tho

little raptor
#

do you mean a cfgFunctions function?

slow brook
#

Ok i'm going to test that, but still. 4GB file yeah?

hasty gate
little raptor
#

well like I said compileFinal ones can't be overridden. but if you use allowFunctionsRecompile=1 in description.ext you can recompile cfgFunctions functions

#

I think it's enabled by default in 3den

kindred zephyr
# slow brook Ok i'm going to test that, but still. 4GB file yeah?

how much info are you saving?

realistically speaking, even saving every single item position and state should be < 50mb per person, barely 1gb according to your 30 persons. But i dont really think you need to save the exact same data for every client so its even lower in the long run, maybe even a couple of hundred mb being bad

hasty gate
#

ye, that doesnt help me, I need to use mission only related stuff to override a function

slow brook
#

If I could do it per flat file, I can split my mod up more effectively. But DLL

hasty gate
#

@little raptor or, if its possible to have an event which would trigger when a function is executed then it would help too

still forum
still forum
hasty gate
#

I like hacking, at least I tried ๐Ÿ˜„

slow brook
#

Everytime you use profilenamespace get variable, you hit the flat file for vars, right? There's no way to keep it in memory until flushed ?

sharp grotto
kindred zephyr
#

keeping it would only be detrimental, you would block writting access

slow brook
#

How would it be detrimental. You're literally reducing seek times when it's in memory

little raptor
#

well anyway the game keeps it in memory yes

slow brook
#

Ok, so 5 minute flush to disk, using the save profile, but everything else is just done through memory space. Ok

granite sky
#

Even saveProfileNamespace is typically well under a second :P

#

It does block though, so server can hang for a few frames.

slow brook
#

I'm asking because someone's said that 400 players worth of information is too much for my mod to handle

granite sky
#

shrugs

#

you can test it with missionProfileNamespace.

#

The storage format is... not efficient, but loadout saves aren't that large.

little raptor
#

you can also make backups of the file in case it goes corrupt

#

you don't want the players to lose their "valuable info" (whatever it is)

slow brook
#

I meant 5 minutes interval, or 15 ect

#

I can set a config option for that anyway, so the ServerAdmin can decide

#

in fact.. I can just switch it up. If the user wants to save to a separate flat file, AKA missionProfile, they can do

somber radish
#

Anyone go experience with the QGVAR system?
I am trying to get a handle on this ACE eventhandler, however I have no idea how to translate this into a string I can grab

[QGVAR(knockOut), _unit] call CBA_fnc_localEvent;
little raptor
#

what mod did you get it from?

somber radish
#

ACE medical

little raptor
#

GVAR is modName_addonName

#

so for ace medical should be something like:
ace_medical_knockout

#

check the script_macro file

south swan
#

Q for quotes, so "ace_medical_knockout" blobdoggoshruggoogly

little raptor
#

yes

somber radish
#

Aah

little raptor
#

I said GVAR is that. QGVAR is quoted

somber radish
#

sweet thank you both!

faint oasis
#

Hi, is it possible to add like 500 magazines inside the player inventory regardless of the max capacity ? Because when i use "addMagazine", it check the max capacity and i can't go further.

little raptor
#

if you haven't tried that one: player setUnitTrait ["loadCoef", 0]

#

not sure if it'll allow you to store as many items as you want tho

faint oasis
faint oasis
little raptor
#

another way is making your own backpack with infinite maxload meowsweats

faint oasis
hallow mortar
faint oasis
little raptor
#

e.g. 1e30

#

not sure if it'll crash the game or anything tho ๐Ÿ˜…
better keep it within a reasonable limit

little raptor
faint oasis
faint oasis
hallow mortar
#

You could also use a Reloaded EH to replace expended magazines

sullen sigil
#

still waiting for the day we get the ability to add fake weight to containers meowawww

finite bone
#
{  
    _camfeed_1 = "camera" camCreate [0,0,0];    
    _camfeed_1 cameraEffect ["Internal", "Back", "uavrtt1"];    
    _camfeed_1 attachTo [cam_target_1, [1,1,1], "ruce"];
    _camfeed_1 camSetTarget cam_target_1; 
    _camfeed_1 camSetFov 0.3;
    _camfeed_1 camCommit 0;
    [
    "featureCamera", 
    {
        _camfeed_1 cameraEffect ["Internal", "Back", "uavrtt1"];
    }
    ] call CBA_fnc_addPlayerEventHandler;         
} remoteExec ["call", [0, -2] select isDedicated, true];``` How'd I go on about having this camera be moved at a later point in time for all players?
sullen sigil
#

uh
just setposasl it? thonk

crisp cairn
#

Heya all, trying to execute my CBA Added Key. Getting no errors, my function name I am pretty sure is correct as I found it in the Functions Viewer with this name. An help would be great.

#include "\a3\editor_f\Data\Scripts\dikCodes.h"

[
    "WELSHY_KAT", "MyKey", 
    ["Tactical Recovery Position","Roll interface Key"], 
    {[_this] call WELSHY_KAT_fnc_RollPlayer}, 
    {}, 
    [DIK_NUMPAD1, [false, false, false]]
] call cba_fnc_addKeybind;
winter rose
slow brook
#

I'd like to throw a warning that it hasn't been set in my logs

little raptor
#

missionConfigFile >> "missionGroup"

slow brook
#

Ah cool, so if exists

little raptor
#

yeah

slow brook
#

Cheers!

little raptor
#

getText (missionConfigFile >> "missionGroup") != ""

slow brook
#
if ((getText (missionConfigFile >> "missionGroup") == "") && (profileNamespace getvariable ["SPSavelocation", 0] == 1)) then {
    [1, "SPSaveLocation is set to 1, however no missionGroup has been defined. Proceeding in this way will cause dataloss should the mission change."] call spp_fnc_log;
}
granite sky
#

You want to tag your profilenamespace vars a bit more than that.

quiet pagoda
#

How do you make an Ai to not react with others? I have a Ai as a driver but when it sees a Ai it tries to overtake it and everything just goes downhill from that.

crisp cairn
#

Hey guys, its sarting to bug me as I really can't seem to figure it out regarding why my function is not launching.

#include "\a3\editor_f\Data\Scripts\dikCodes.h"

[
    "WELSHY_KAT", "MyKey", 
    ["Tactical Recovery Position","Roll interface Key"], 
    {[_this] call WELSHY_KAT_fnc_RollPlayer}, 
    {}, 
    [DIK_NUMPAD1, [false, false, false]]
] call cba_fnc_addKeybind;
slow brook
#

There's a point somewhere on the WIKI that making excessively large namespace variables causes issues

granite sky
#

yes, but making overly generic ones leads to conflicts between mods/missions.

slow brook
#

if it becomes an issue, i'll deal with it. I've not come across any other mod that uses my variation of ProfileNamespace variables yet

manic kettle
crisp cairn
#

Ye it works find just told it to hint on press and it appeared, and yes it does show up and configurable

#

Getting this as an error - _fnc_scriptNameParent

manic sigil
#

@quiet pagoda its going to depend on whether youre scripting for MP or SP, but the driver's init box is a good place to start.

quiet pagoda
finite bone
#

a function within a function?

#

i initially setout with using publicvariables

slow brook
#

pass the value to the function? then do x on one, y on another?>

winter rose
#

the function itself stores it as TAG_fnc_cameraFunction_camera and works with it

winter rose
# finite bone Even with the function, how'd I go on about storing it so i can manipulate it la...

a remote function setup I commonly use is

params ["_mode", "_arguments"];

switch toLowerANSI _mode do
{
  case "start":  { /* create cam, store in TAG_fnc_cameraFunction_camera */ };
  case "move":   { _arguments params ["_pos", "_dir"]; /* use stored camera */ };
  case "stop":   { /* destroy camera and set value to nil */ };
};
```thus, everything is local, yet everything is decided by the server
finite bone
finite bone
#

ye, it'll be projected via rtt

winter rose
#

what if player doesn't have PiP enabled ๐Ÿ™ƒ

finite bone
#

so at one point it will be at location_a targeting target_a and then later, location_b targeting target_b

winter rose
#

but then yeah in _arguments use a number you can format ["myCamera_%1", _number]

finite bone
winter rose
#

Oo

#

_camName is used but not assigned in "start"

finite bone
#

Again for my dumb question - but what's the difference between this method and using non-sync publicvariable instead of the function?
Something like: https://sqfbin.com/cikujuzofelegemegise (I know its bad but im trying to understand, since even when using function, you are going to globalexec it so that all machines have the function to execute when called iirc)

finite bone
winter rose
sullen sigil
#

never used remoteexec in my life, never will ๐Ÿ—ฟ

little raptor
#

why 2 remoteExecs?

little raptor
little raptor
#

in which file?

sullen sigil
#

what's the difference between setVelocityTransformation and setPosASL/setVectorDirAndUp oneachframe? meowsweats

#

based on what i am seeing my guess would be SVT is different network wise but would be nice if someone could confirm that

granite sky
#

I'm not sure that there is any difference.

sullen sigil
#

similarly, am i missing some sort of diagnostic command for ping or does it just not exist?

sullen sigil
granite sky
#

Well, you'd need setVelocity as well.

sullen sigil
#

heres the neat part
its a house

#

or equivalent to it regardless

granite sky
#

Isn't the issue with houses that they have a slow network update rate in general?

sullen sigil
#

its a house attached to a cba target vehicle which has a high network update rate from what i can tell

granite sky
#

So if you want to move them, you attach them to an object with faster network transfer rate.

sullen sigil
#

like, it works fine aside from the juddering

#

i'll try grab a video in a bit but updating dedicated server with tcadmin takes a while ๐Ÿ™ƒ

granite sky
#

Are you saying there's a difference between svt and setpos/setvector/setvelocity or not?

sullen sigil
#

yes there is but im wondering if anyone knows what it is

#

-- though maybe not the setvelocity part, as setvelocity takes local args

granite sky
#

uh

#

svt has to be used locally as well. Probably for the same reason.

sullen sigil
#

yeah, all of this is run on server

#

but setposasl is global args so i feel it could be handled differently network wise which is why its ending up different to svt

#

but this is just guesswork on my part and i am here to try figure out if someone knows the actual answer ๐Ÿ™ƒ

granite sky
#

Are these local objects or not?

sullen sigil
#

they are local to where the setpos command is being executed which is the server

#

but they are not local objects in of themselves

granite sky
#

..

sullen sigil
#

i feel i may have misunderstood the question

#

oh i did i just gave an unhelpful response

#

the createvehicle is executed on the server

#

it is not a local object

#

the setposasl is executed on the server too

granite sky
#

Let's get this straight. You have two otherwise-identical cases. In one you use setPosASL, setVelocity and setVectorDirAndUp. In the other you use setVelocityTransformation. The movement equations are identical. From a client perspective, the first one judders and the second doesn't?

sullen sigil
#

I do not use setvelocity at all as they have none
I have two eachframe handlers which update the position and the vectordirandup according to its calculated velocity (which my code also handles -- looks identical to the other in SP). This is juddering, though not teleporting about -- just inconsistent movement in dedicated vs sp

I also have a setvelocitytransformation which is just from X to Y with interval increasing, which looks fine and smooth in MP

granite sky
#

I do not use setvelocity at all as they have none
I don't understand this part.

sullen sigil
#

running velocity on the object will always return [0,0,0] and setVelocity will do nothing; I am using the CBA target vehicles as logic objects, but for all intents and purposes are just houses with higher update rates

#

I'm trying to get videos but tcadmin is playing up

#

it is also not related to server FPS, I have tested that and it is more or less constant, +/- 1 or 2 fps, it still appears smooth down to 20fps in sp

#

tcadmin cooperating now, give me a sec

simple trout
sullen sigil
#

yeah, give me a sec to edit these together

#

hopefully that makes it clearer?

#

the jump out is where SVT is used -- jump in does too

#

but looks identical in dedi mp to sp so didn't include

#

im not asking for a solution to the issue as i can just do a 0.25 svt that loops -- but im trying to figure out why its happening in the first case, which is network i believe ๐Ÿ˜…

simple trout
#

You have a missmatch between client and the server

#

The jumps in position are because you have different frame rate updates

#

On the client and server

sullen sigil
#

but why does it look smooth on the svt instances? ๐Ÿ˜…

simple trout
#

Single player, 300+ fps = smooth

sullen sigil
#

it looks the same when i shift my fps down to 20

simple trout
#

Multiplayer, 60 fps client but 45 fps server = jumpiness because the server is boardcasting position data to the clients cause the jump

#

Also remember arma is lock step

#

Meaning the the physics updates are tied to your fps

sullen sigil
#

do you think changing it to setvelocitytransformation will cause any difference at all given the jump out is identical on dedicated to sp? meowsweats

simple trout
#

Remember that video in fallout 76? Where you can run faster while looking at the ground?

sullen sigil
#

i do not

#

but i understand what youre getting at

#

everything unrenders -> higher fps -> more physics updates

simple trout
#

Yes

sullen sigil
#

what im not understanding is the disparity between setposasl on each frame and setvelocitytransformation

#

like, it is completely identical between dedi and sp for svt and has been every time ive used the command

simple trout
#

What

sullen sigil
#

setvelocitytransformation is buttery smooth on dedicated and sp

simple trout
#

Are you manually setting the pos each frame?

#

Bruh

sullen sigil
#

eachframing svt for the jumping out, eachframing setposasl for the regular stuff because svt made me want to fucking die

simple trout
#

You need to times your velocity by your delta time

sullen sigil
#

i do

simple trout
#

Ahhhhhhhhh

#

I know you're problem then

sullen sigil
#

ive been working on this for 5 months, its basically finished aside for this ๐Ÿ˜…

simple trout
#

I'm surprised John didn't notice

granite sky
#

I never got to the point of being clear about what he's doing :P

simple trout
#

John

granite sky
#

and then I got some lunch

#

because it's 1am

sullen sigil
#

ive been working on this project for 5 months with a newly discovered brain injury that is making me forget a lot of things

#

the fact its even running on a dedicated server is incredibly surprising

simple trout
#

you need to do verlet integration rather than euler integration

#

Verlet integration (French pronunciation: โ€‹[vษ›สหˆlษ›]) is a numerical method used to integrate Newton's equations of motion. It is frequently used to calculate trajectories of particles in molecular dynamics simulations and computer graphics. The algorithm was first used in 1791 by Jean Baptiste Delambre and has been rediscovered many times since ...

#

your velocity times frame rate change is running into stability issues, hence the jumps

#

Now, I need food

#

John can tell you more about this lol

sullen sigil
#

im not integrating anywhere ๐Ÿ˜…
i have target velocity and current velocity, current velocity is updated oneachframe according to acceleration variables and then the current velocity is used with diag_deltatime to calculate how far the object should've moved between frames ๐Ÿ™ƒ

simple trout
#

yes you are integrating

sullen sigil
#

that is news to me

#

i failed calculus

#

(clearly)

simple trout
#

getting food. BRB

granite sky
#

does your path have very strong direction changes?

sullen sigil
#

how strong is very strong

#

i.e 90 degrees turning in a second?

granite sky
#

sec, I'll watch your video :P

sullen sigil
#

its just going in a straight line in it ๐Ÿ™ƒ

#

i will also sqfbin the functions im using

granite sky
#

yeah never mind then.

#

(integration method won't do that without major velocity changes)

sullen sigil
#

ah, sqfbin once more refusing to syntax highlight this monstrosity

brazen smelt
#

Did the new update change anything on how setDamage works? I have a addaction that use to work but now it does not and I don't know why.

_box addAction["<t color='#d85b55'>Reset Health</t>",
{
    params["_target","_caller"];
    _caller setDamage 0;},[],500,false,true,"","",5,false,"",""];
granite sky
#

You're saying that the addAction is there, it just doesn't reset vanilla damage?

#

You didn't switch to ACE or something? :P

simple trout
#

At the end

#

That's a major velocity change

sullen sigil
#

thats setvelocitytransformation

#

the whole jump out part ๐Ÿ™ƒ

granite sky
#

All I see in first part of the video is the submarine moving in a straight line at a fairly constant velocity with some random judder.

simple trout
#

yeah

#

and the most part that can be contributed too arma's netcode

simple trout
#

that's why it's happening

sullen sigil
#

yeah, thats what im getting at, setposasl is juddering but svt is not ๐Ÿ™ƒ

simple trout
# sullen sigil yeah, thats what im getting at, setposasl is juddering but svt is not ๐Ÿ™ƒ

At the end of this video, you may have a broad concept of how to implement a cloth simulation algorithm in your own game.

You can take a look at the webgl + js game engine I'm developing using the cloth simulation I implemented in the video: https://github.com/Fangjun-Zhou/White-Dwarf

I've also published all the code in the video to the reposi...

โ–ถ Play video
#

Don't be fooled by the cloth simulation in the name

sullen sigil
#

probably best i dont watch at 2am while im not entirely conscious right now lol

ill give svt a try tomorrow regardless, it if works it works

simple trout
#

you probably also, aren't going to get it smooth because the values of your "velocity" aren't being interpolated correctly

granite sky
#

I wouldn't rule out svt dodging some networking/simulation rules wrt. velocity of objects that don't normally have velocity.

sullen sigil
#

yeah, i think its probably the best ill be able to get over this -- probably just do a 0.25 second pfh that adds another pfh for a 0.25 second long svt

granite sky
#

Whether it's by forcing faster updates or actually passing some internal velocity that you can't set by other means.

simple trout
#

doesn't setPosASL also have a network propagation delay?

granite sky
#

Everything has a network propagation delay :P

simple trout
#

lol

#

true

sullen sigil
#

think 0.25s is a high enough update time for the vars given thats how often i network sync them

the piloting isnt actually working right now in mp but thats irrelevant

#

oh, its not going to be that simple actually given its not in modelspace stuff ๐Ÿ™ƒ
i could try use interval of 1 with svt instead of using setposasl etc and see how that goes, ill find out

granite sky
#

I need to check that my dive bombing stuff doesn't look terrible on DS+client now :P

sullen sigil
#

taking over the ais vehicle to stop ai making stupid decisions, i like it

simple trout
#

but I never check the second version

granite sky
#

ugh, might need to rewrite it again actually.

#

I guess svt really does stuff that you can't do otherwise.

#

I had to add setPosASL to make airplanex work, which probably made the networking worse.

keen stream
#

lol

brazen smelt
finite bone
# little raptor why 2 remoteExecs?

After the first one is executed, after like 15 - 20 mins the second one may or maynot be executed - but if it does, it should modify the camfeed_1 that was initially executed

molten yacht
#

Is there a way to script out a UAV so the players can look through the gunner's cam but not alter the flight path or anything

#

I'd like them to "capture" an intel feed

finite bone
molten yacht
finite bone
wary needle
#

Is there a way to export deformer stuff to a script like with sqf?

hallow mortar
#

Deformer uses https://community.bistudio.com/wiki/setTerrainHeight, so it is theoretically possible to use the same values with a non-mod script. However, whether Deformer provides a way to easily do that, or whether you'd have to go looking in the mission files and manually copy it out, is probably something you'd have to ask the Deformer devs about.

granite haven
#

i got some issues with changing uav sides, so i have a server sided file:

  _asset = createVehicle ["B_AAA_System_01_F", _pos, [], 0, "NONE"];
  _asset setDir (direction _sender);
  private _group = createGroup (side (group _sender));
  createVehicleCrew _asset;
  (crew _asset) joinSilent _group;
  (group effectiveCommander _asset) deleteGroupWhenEmpty true;

For some reason the crew never goes to the east side, on zeus you can see the praetorian is on nato side but the crew is in an opfor group.
Now whenever i run (crew _asset) joinSilent _group; on a client after the praetorian is created the side of the praetorian does change

#

my main issue is that the side doesnt change right after the vehicle is created causing nearby praetorians wich have the east side to shoot the new praetorian

#

is there some lacality issue that doesnt allow the server to change the uav side?

sullen sigil
#

suppose I have to find the object's destination in the next 0.25 seconds and then use that as its destination whilst changing the vdirandup and such still

#

really didnt want to have to meowsweats

molten yacht
#

Is there a way to have a combination of infinite and limited items in an arsenal, i.e. infinite rifle ammo but finite rockets for the launchers?

sullen sigil
#

It was not an issue with how I was doing it, svt was just so fast I was unable to see it having the same effect, both look identical now, the issue is just much more evident at lower speeds. Not sure if there's anything I'm able to do about it, but thanks for the help regardless
cc @granite sky @simple trout

#

ofc if either of you find out anything new about svt please let me know but I've just slowed the warp stuff down and they are having the same juddering

fair drum
astral bone
#

How would I invert an objects up/down direction, relative to an attached object's model up/down?
Also, position is gonna be offset so much downward relative to attached object

#

the way I am thinking about doing it, itd probably just be easier to try making a color picker in eden editor attributes xD

tidal aurora
#

Is this correct syntax? [Michaelangelo] remoteExec ["addWeapon arifle_Katiba_F", 2];

warm hedge
#

No

#

Check the pinned for remoteExec syntax

tidal aurora
#

aight thanks so [Michaelangelo, "arifle_Katiba_F"] remoteExec ["addWeapon", 2];

warm hedge
#

addWeapon already is an GE though

tidal aurora
#

Ye should but it seemed only to have only local effect when i tried it yesterday but i might be mistaken

sullen sigil
#

Possibly more of a #arma3_config question, but figure the people with more technical know-how will be here:
What does simulation config param change? Is it just how the engine treats the object? Can I turn a house to airplanex and have the engine interpolation between positions? ๐Ÿ˜…

astral bone
#

@worldly snow Why DM me?

worldly snow
#

as you have worked on them before

astral bone
#

Oh wait, this isn't config xD

worldly snow
#

breh

thorn saffron
#

I'm trying to add an ACE interact action to an object of specific class. I was able to make it appear, but I'm having a trouble getting the condition to work. Basically I want to add a separate action to an object for every grenade in the game. Managed to do that. However I want to add a condition that checks if the player actually that specific classname of grenade in the inventory. I just can't figure out how to get the currently evaluated grenade class from the for each statement, that creates the action, into the condition of that action.

copper nova
#

Hey, is there any event handler that fires when a vehicle is destroyed, as well as after deletion by deleteVehicle? I am looking for a more performant solution for waitUntil notlikemeow

warm hedge
#

Killed and Deleted

copper nova
#

Ah perfect ๐Ÿ‘

thorn saffron
#

Do I understand it correctly that the ace interaction has no way to actually pass any parameters into the condition of the interaction, only to execution?

opal zephyr
#

Im pretty sure things can be passed into it, the ace action doesnt call a function, it just calls the code in it. You coukd create a function, and call it through the code while passing your arguements, like {[_variable] call function}. Give that a try

thorn saffron
#

@opal zephyr AFAIK if you put stuff in curly brackets it will not pick up _variable that was defined before.

opal zephyr
#

How many loops of the forEach are you doing? Is it probable to pass it as a global statement? Or move the forEach into the interaction

thorn saffron
#

All of the possible grenades in the game, including from whatever mods you have loaded. Each interaction is for the separate grenade type.

#

I'm making a tripwire mod that lets you place down a generic tripwire mine, then you can "attach" a grenade to it, that arms the mine. When triggered the mine spawns the grenade from of the "attached" class.
I got all of it working except for a condition that checks if the player has a the specific grenade in the inventory.

#

Problem is that the function that adds the action expects the code unlike the vanilla add action that takes string. If it accepted string then I would be able to pass the grenade class into the condition code with something like: _grenadeClassname + " in magazines _player"; as it stands now I just can't figure out how to pass the grenade classname to check if the player has it.

brisk lagoon
#

Hello peeps, I am trying to make a composition of a gear locker, how would I place a vest that will float (trying to make it look like its hanging) without it falling to the ground?

#

thought disabling sim does that, but doesn't work

thorn saffron
#

@brisk lagoon You could create a simple object with the vest's mesh, if the vest does not need to interacted with.

brisk lagoon
#

It does not needs to be interacted, so just make it a simble object?

granite haven
#

i cant figure out why my friendly praetorians shoot other praetorian this is my code:

// Executed on server
_asset = createVehicle ["B_AAA_System_01_F", _pos, [], 0, "NONE"];
_grp = createGroup east;
createVehicleCrew _asset;
[_asset] joinSilent _grp;

So the issue is that when i exec this code there is a small window where other praetorians, wich are assigned to east, start shooting at this created one. how can i avoid this/ why is it happening

#

is there a way i can change the side of the praetorian right after its created?

#

i've tried using spawnVehicle but there there is no difference, for 2 seconds nearby csat ai etc still shoots at it causing it to usually blow up before the side really switched

thorn saffron
#

The UAV ai might be added separately from the vehicle

hallow mortar
#

You're passing the vehicle itself to joinSilent, which isn't exactly how it's supposed to work. Try passing crew _asset instead of [asset]

opal zephyr
#

@thorn saffron Is the variable you're trying to pass _x in the forEach loop?

granite haven
#

it has like 2 seconds where all nearby csat things shoot at it and then if its not dead by then the turret of the praetorian lowers a bit and then other csat units stop shooting at it

#

but even in those 2 seconds the side of the praetorian returns east

#

this is all on a dedicated server btw, on eden it works fine

hallow mortar
#

You can try using createUnit to directly create an O_UAV_AI and move it into the vehicle, rather than using createVehicleCrew. There seems to be some conflicting information on whether this works though.

#

Alternatively, wait for 2.14 and try the new alt syntax of createVehicleCrew

thorn saffron
#

@opal zephyr Yes, its the grenade classname. And it works, because I'm using to also get the name and icon for the action.

hallow mortar
granite haven
granite haven
hallow mortar
#

When was the last time we knew the release date of an Arma update before it happened?

thorn saffron
#

@opal zephyr Here's the code I use to add actions to my tripwire.

{
    // get the grenade info
    private _grenadeMagClass = _x;
    private _displayName = getText(configFile >> "CfgMagazines" >> _x >> "displayNameShort");
    private _icon = getText(configFile >> "CfgMagazines" >> _x >> "picture");

    //create action for the grenade type
    private _addGrenadeAction = [
        "Attach Grenade",
        format ["Attach %1",_displayName],
        _icon,
        taro_tripwire_fnc_setTripwire,
        {
        true
        }, // add a check here to see if the player has this paricular grenade magazine class in his invenotry
        {},
        _grenadeMagClass
    ] call ace_interact_menu_fnc_createAction;

    ["taro_tripwire_place", 0, ["ACE_MainActions"], _addGrenadeAction] call ace_interact_menu_fnc_addActionToClass;
    
} forEach _grenades;
brisk lagoon
#

is there anyway or anything that will let you place a uniform? like full uniform and not folded?

thorn saffron
#

@brisk lagoon Sadly not the uniforms have arms and such modelled in

brisk lagoon
#

Sadge ):

opal zephyr
#

@thorn saffron I havnt used them before, but you could try using the action parameters mentioned on the ace wiki, it looks like they get passed into the called code

thorn saffron
#

@opal zephyr Only into execution, not the condition. I'm already using that to pass the grenade classname into taro_tripwire_fnc_setTripwire function.

opal zephyr
#

hmm

granite haven
#

goes from civ to csat right away nrmly

#

thanks

kindred tide
#

just how parallel are scripts executed with spawn? seems almost like it's multithreading because even without sleep or anything of the sort one spawn'ed script gets its instructions run in the middle of another

#

what i mean is, it looks like it doesn't schedule the whole of A to be executed before B, but rather runs some instructions from A, then some from B etc

sullen sigil
#

important reading

willow hound
thorn saffron
#

Me dum, the action params are totally passed into the condition. I just set up the params wrong in the script that checked them.

sullen sigil
#

I have not got a clue why though as I was under the impression it is local

kindred tide
#

like a mutex

sullen sigil
#

i have no clue what that means

#

explain it to me like i have spent the last 5 months almost exclusively scripting in sqf

kindred tide
#

you know, an ability to lock one's thread access to some resource so that another one can't access it

#

e.g script A is doing something with object B and until it lets go of it, script C can't touch it and has to either wait or move on

hallow mortar
#

No such mechanism exists natively. If you have control of both scripts you could use waitUntil and object namespace variables to make one.

kindred tide
#

is setVariable and getVariable atomics by default?

#

when it's being set, it can't be being get simulteneously?

sullen sigil
#

you can get variable just fine from anywhere you can access the namespace

hallow mortar
# kindred tide when it's being set, it can't be being get simulteneously?

setVariable shouldn't take enough time for anything else to happen (on the same machine) while it's in progress.
Bear in mind that SQF is not the engine language, it's another layer on top of it. Everything we write in SQF is just instructions for functions in whatever C variant Arma uses, and that's the layer where stuff like atomics would be handled.

kindred tide
hallow mortar
#

I'm pretty sure the array is compiled by the game before setVariable internally receives it, and setVariable just stores a memory reference to the array. I don't think setVariable has a "partially done" state.

kindred tide
granite sky
#

Generally most things you'd put in one line are atomic.

#

It'll only interrupt on semicolons and loops.

#

You can also use isNil { some code } to force that chunk to run without interruption.

#

Bear in mind that there's no actual multithreading, so you can guarantee that only one piece of SQF is running at once.

kindred tide
#

ok that helps

tender fossil
kindred tide
#

async is usually funny yes

tender fossil
#

Yeah, it tends to make things more complicated initially at least

kindred tide
#

i almost had another major "oh shit here we go again" moment with my code

#

because

#

between this script adding to list and calling event i didn't really expect the other script to do anything

little raptor
#

the only exceptions are commands that execute code blocks (the whole block may or may not run "atomically")
but when you read a var with getVariable and set it with setVariable, it won't be atomic

kindred tide
#

is this the only way to make them run without interruptions?

winter rose
#

no need for if-then
yes, isNil runs unscheduled

little raptor
#

e.g. if you run that inside an event handler, it'll always be unscheduled

sullen sigil
#

welcome to sqf ๐Ÿ™‚

kindred tide
#

cause they start with spawn

little raptor
#

if you mean you first spawn something which calls that code, then it's scheduled

kindred tide
#

so, between these 2 instructions, if they are inside the IsNil block, would another script still be able to execute an instruction of its own?

little raptor
#

no

#

SQF runs serially

kindred tide
#

even if the isNil block itself is originally in a piece of code that was started with spawn

little raptor
#

isNil forces the block to run unscheduled

#

(ofc if you spawn something inside the block, it'll "detach" and run scheduled)

kindred tide
#

does that mean that instructions that precede/follow it no longer execute in the same order relative to it? A->IsNil->B could now become A->B->IsNil

little raptor
#

if A and B are in the same script, no it won't

#

you can assume the whole isNil block is "one instruction"

kindred tide
#

okay

granite sky
#

it should also break the 3ms rule, so in theory you could abuse it to get more than 3ms/frame of SQF.

#

occasionally tempted to try this :P

little raptor
#

it is sometimes helpful ๐Ÿ˜…
e.g. when you want to run a script that collects data but you neither want it to freeze the game, nor take too long

hallow mortar
little raptor
#

basically every context is explained on that Scheduler wiki page. you can just read that

sullen sigil
#

@granite sky @simple trout issue was fixed thanks to sebsterbl:
I needed to setvelocitymodelspace for the engine interpolation, I had been under the impression that engine handled it based off of position updates. Now only shuddering is due to ping and can't do anything about that, thanks for your guys' help last night too ๐Ÿ™‚

#

(so you may not need to rewrite your dive bombing stuff john)

vague harness
#

Hello, I need help correcting a script (18 lines) if you want to help please DM me

granite sky
#

Nah, I use setVelocity in that.

#

(and it's still a bit jittery)

kindred tide
#

for every object i create i start a scheduled script with spawn

#

and i rolled my own event system to make them communicate

tender fossil
kindred tide
#

would that be compatible with all arma games or just arma 3

little raptor
tender fossil
kindred tide
little raptor
#

bad

#

you should only spawn 1 code, which iterates over all objects in a loop
instead of spawning a loop for each object...

kindred tide
#

i've been considering that lately

#

spawn 1 per module and make the module go over its objects

little raptor
#

spawning 1 code that iterates over all modules, and then iterates over their objects is better

hallow mortar
kindred tide
#

i play all of them and trying to make a mod that could work for all

#

cause it's tempting lol

hallow mortar
#

that sounds like a bad idea

kindred tide
#

i guess i could define aliases in a separate script that would handle the differences?

#

e.g if some function is not present in Arma 1, it's called by the same alias but actually calls something else

little raptor
#

well if you "abstract away" how things work internally using functions, you could do that
but it's better to just stick with 1 game, and only bother with others once you're done with that

#

I'd say just stick with A3 blobdoggoshruggoogly

tender fossil
#

Yeah, I loved how Benny created "interfaces" like this in his edition of the Warfare mission:
init.sqf: sqf GroupChatMessage = Compile preprocessFile "Client\Functions\Client_GroupChatMessage.sqf"; ````Client_GroupChatMessage.sqf`: sqf
player groupChat _this
``` (The point is to use GroupChatMessage everywhere in the code, so if you want to add e.g. logging later, you can add it in the abstracted function instead of going through 100 calls of groupChat in code and adding it to those manually)

vague harness
# vague harness Hello, I need help correcting a script (18 lines) if you want to help please DM ...

//Gets what group will be used to put the player in.
_units = [_profile,"units"] call ALIVE_fnc_hashGet;
_group = group (_units select 0);

//List units in the group as an array
_aiUnits = units _group;

//and count them
_aiunitscount = count _aiunits;

//Join the player group to the ai group
_groupUnits join _group; {_x setposATL formationPosition _x} foreach _groupUnits;

//script to make room so that there is room for players in their assigned transport

if (_aiunitscount > 8) then forEach _groupUnits do {
     private _randomUnit = selectRandom _aiunits;
    
    // Check if the unit still exists and is not in a vehicle before using deletedVehicle
    if ((!isNull _randomUnit) && (incargo _randomUnit)) then {
        deletedVehicle _randomUnit;
    } else {
    
    _randomUnit = selectRandom _aiunits;
    
    // Check if the unit still exists and is in defined vehicle before using deletedVehicleCrew
    if ((!isNull _unit) && (isincargo _unit)) then {
    private _veh = vehicle _randomUnit;
        _veh deletedVehicleCrew _unit }};``` I'm not good enough in SQF to see all the errors and sometimes unsure how to correct them..
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

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

plz

little raptor
#

looks like chat GPT stuff ๐Ÿ˜…

vague harness
kindred tide
#

foreach is misplaced

sullen sigil
#

quite funny that properly noting your functions in this game is considered a mark of ai ๐Ÿ˜…

kindred tide
#

{ } foreach _groupUnits;

little raptor
vague harness
sullen sigil
#

i cant say much about commenting code properly seeing as i tend to remove my comments after ive written the code for some bizarre reason

tender fossil
#

I think comments are best when combined with self-documenting code. The code (like variable names) respond to questions "what" and "how", and the comments answer to question "why"

tepid vigil
#
{
            if ({!(isPlayer _x)} && {!(_x getVariable [""shopcheck"",false])} && { ({side _x isEqualTo civilian} count (_x nearEntities [""CAManBase"",150])) > round(150*OT_spawnCivPercentage) } ) then {
                private _unit = _x;
                [_unit] call OT_fnc_cleanupUnit;
            };
        }forEach (units civilian);
 1:49:52   Error position: <&& {!(_x getVariable ["shopcheck",false]>
 1:49:52   Error &&: Type code, expected Bool

meowsweats what gives

tender fossil
tepid vigil
#

Yeah that'll fix it but why is it erroring in the first place, why doesn't it qualify for lazy eval

hallow mortar
#
{ } && { }```
You can have Code on the right for lazy evaluation, but not the left
tender fossil
#

How's that so? Why is it allowed on the right? o.O

little raptor
#

because the command allows it...

#

BOOL && CODE

#

or BOOL && BOOL

hallow mortar
#

lazy evaluation

(isPlayer _x) && {time > 20};```
the right code will only be evaluated if the left returns true
tepid vigil
#

But this does work, is it so that the first condition must not be "lazy", the rest can be? This should work, right?
(true && {false} && {false})

hallow mortar
tender fossil
#

I guess it's some Arma 3 thing (having coded almost only Arma 2 recently) or then I've read the documentation badly ๐Ÿ˜„

tender fossil
#

Jeez

#

Have missed that completely

little raptor
vague harness
kindred tide
tender fossil
vague harness
hallow mortar
# little raptor BOOL && CODE BOOL && BOOL not CODE && CODE
(cond1) && {cond2} && {cond3}```
in theory this could work if `(cond1) && {cond2}` is resolved before `{cond2} && {cond3}` because then it works out as `bool && {cond3}`, but I can't remember if the order of operations works out that way
little raptor
tepid vigil
#

Comments are personal preference, but it's a pretty common rule that comments should not explain what is being done but why it's being done

vague harness
#

I'll do this next time. I'll write a small paragraph explaining the script then post code without comments.

hallow mortar
vague harness
#

Can I put then { if

tender fossil
little raptor
tender fossil
#

I'm such a simple being that I need to write readable code to be able to process it... ๐Ÿ˜„

tepid vigil
#

(true && {true}) && {true} Speaking of readability... blobdoggoshruggoogly

kindred tide
#

if (isNil {GLOBAL_DEFINE}) then { systemChat "GLOBAL_DEFINE set"; GLOBAL_DEFINE = 1; };

ok. if hundreds of spawned scripts ran that code, would there be any chance at all that the "GLOBAL_DEFINE set" message would show up more than once?

little raptor
#

the () wasn't needed
you could also write true && {true && {true}} which imo is more readable (especially if broken into lines and indented)

little raptor
kindred tide
#

isNil { if (isNil {GLOBAL_DEFINE}) then { systemChat "GLOBAL_DEFINE set"; GLOBAL_DEFINE = 1; }; };

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
kindred tide
#

okay

little raptor
#

but like I said the first one probably won't happen either

#

you might at most see 2 messages

#

if one code runs past the 3ms limit before reaching the var assignment

kindred tide
#

yeah that's the issue, i can't allow any chance for it being done more than once or else all hell will break lose

#

i've had enough of "sometimes it breaks mysteriously"

little raptor
#

also instead of isNil {GLOBAL_DEFINE} you can write isNil "GLOBAL_DEFINE"

#

it's more readable (since you commonly use isNil for unschd, or if you actually want to compute if a code returns nil)

tender fossil
#

What if he ran the guaranteed unscheduled code (with the isNil thingy) to set an "already run" flag in global variable and check whether it exists/is true?

tender fossil
#

And only proceed from there if the flag hasn't been set

kindred tide
#

i'm doing that to initialize my module framework (ONCE!) and start initializing my modules and objects that belong to those modules from there

tender fossil
#

I think I need to go to sleep ๐Ÿ˜„

sullen sigil
#

Anyone able to give me a pointer as to why all the objects are drifting downwards with this? Think it's due to modelToWorldWorld but vectorModelToWorld ends up shoving it pretty high in the air ๐Ÿ˜…
https://sqfbin.com/dolakifocuboquyosumo

#

(i know the two if statements arent properly optimised im doing that later)

#

effectively what is happening is there's a drift of ~5ms downwards when using this with Land_Cargo10_white_F object

elder vale
#

Aye, so I've got a question, how would I script it so that I can remove a turret off of a BMP-2 and replace it with a ZU-23-2, I don't know if it's important to say the exact names, but I'm using the ones from RHS if that effects anything.

sullen sigil
#

not possible, requires model modification which you do not have permission for

little raptor
sullen sigil
#

and getposasl i have to use for setvelocitytransformation, no?

little raptor
#

no that's not why it's wrong

#

you're using velocity to calculate distance

sullen sigil
#

yes

#

velocity is driven by variables

little raptor
#

well that's wrong

#

velocity multiplied by time is distance

sullen sigil
#

speed = distance/time
speed * time = distance

#

velocityworldspace is just the distance it needs to travel in the next second

little raptor
#

...

#

why do you even do that?!

sullen sigil
#

because the objects have no velocity

#

well, no velocity that i care about

little raptor
#

_nextPos = _pos vectorAdd (_x vectorModelToWorld (_velocity vectorMultiply _dt))

#

anyway what you wrote would work but it's just confusing

#

anyway the real problem is getPosASL as far as I see

#

unless you were using super simple object

little raptor
#

it should be diag_deltaTime * accTime

sullen sigil
#

i know its confusing im just trying to not change things this late until ive got it 100% working in mp
is there any way i can use a setvelocitytransformation with getposworld? meowsweats

little raptor
#

that's what you should use

#

use [0,0,0] as origin

sullen sigil
#

oh
oh wait of course it literally returns in asl ๐Ÿคฆโ€โ™‚๏ธ

sullen sigil
little raptor
#

well yes but you should also change the center in svt

#

yeah that's what they call it I guess...

sullen sigil
#

ya, thx -- wasnt sure what that was for

#

will test later on when i can be bothered with tcadmin again but fairly confident this should work, thanks leopard ๐Ÿ™‚

#

5 month project finally coming to a close and it's just a bunch of multiplayer stuff left before optimisations

kindred tide
#

are you making dogfights in space

#

i see i'm not the only one who makes a game inside another game

#

what i'm making is like urban fantasy rpg game

#

been SQFing for 2 months

#

kinda hard to switch to from C#/C++

little raptor
#

you can still use C++

kindred tide
#

huh, how

little raptor
#

well C# too

kindred tide
#

is that arma3 only

little raptor
#

yes

kindred tide
#

i already set up syntax highlighting for sqf in notepad ++

#

i did it by hand

sullen sigil
#

an entire movement system within sqf ๐Ÿ™‚

kindred tide
#

yeah i'm doing everything within sqf too. i'm currently finishing up a system for immersively spawning units on the map. like, it first creates transport (plane or convoy or boats) and delivers/drops them off at their bases

tender fossil
# kindred tide i already set up syntax highlighting for sqf in notepad ++

Visual Studio Code has really useful plugins for SQF if you want to use it. I think this is the most up-to-date: https://marketplace.visualstudio.com/items?itemName=vlad333000.sqf - you can find other plugins too by opening the extension search in VS Code and typing SQF in the search box

kindred tide
#

good to know

tepid vigil
#

How cursed is this and is there any smarter way to do this?

// Check if result is already known
        if (isNil {call compile format ["DYNCAS_playerTextureCache_%1", _playerTex]}) then {
            // Publish result
            call compile format ["DYNCAS_playerTextureCache_%1 = %2; publicVariable %1;", _playerTex, _playerTexAvg];
        };
granite sky
#

Maybe slightly less cursed:
missionNamespace getVariable format ["DYNCAS_playerTextureCache_%1", _playerText];

tepid vigil
#

Is missionNamespace synced over multiplayer?

granite sky
#

Not unless you publicVariable.

#

generally missionNamespace setVariable ["varName", 1] is identical to varName = 1

#

(the default namespace is missionNamespace)

tepid vigil
#
// Check if result is already known
        if (isNil {missionNamespace getVariable format ["DYNCAS_playerTextureCache_%1", _playerTex]}) then {
            // Publish result
            missionNamespace setVariable [format ["DYNCAS_playerTextureCache_%1", _playerTex], _playerTexAvg, true];
        };

Yeah that's definitely a lot cleaner

faint oasis
#

Hi, is it possible to get the direction like a "getDir" but of the head instead of the character ?

granite sky
#

There's eyeDirection

little raptor
#
  • getCameraViewDirection
wary needle
#
 MAZ_EH_suppression = player addEventHandler ["Suppressed", {   
   params ["_unit", "_distance", "_shooter", "_instigator", "_ammoObject", "_ammoClassName", "_ammoConfig"];   
   if !(MAZ_EP_suppressionEnabled) exitWith {};   
   [_distance] spawn {   
    params ["_distance"];   
    private _supressedValue = .55 * _distance;   
    if(isNil 'MAZ_PP_SuppressionEffect') then {   
     MAZ_PP_SuppressionEffect = ppEffectCreate ["ColorCorrections",1500];   
  MAZ_PP_BlurEffect = ppEffectCreate ["DynamicBlur", 500];  
    };   
    MAZ_PP_SuppressionEffect ppEffectEnable true;   
 MAZ_PP_BlurEffect ppEffectEnable true;   
    addCamShake [17 / _distance, 0.5, 7];   
    player setCustomAimCoef 2.5;   
    MAZ_PP_SuppressionEffect ppEffectAdjust [0,1,0,[0,0,0,0],[1,1,1,1],[0.33,0.33,0.33,0],[.66,.66,0,0,0,0,_supressedValue]];   
  MAZ_PP_BlurEffect ppEffectAdjust [1.2 / _distance];   
  
    MAZ_PP_SuppressionEffect ppEffectCommit 0;   
 MAZ_PP_BlurEffect ppEffectCommit 0;   
    sleep 1;   
    MAZ_PP_SuppressionEffect ppEffectAdjust [1,1,0,[0,0,0,0],[1,1,1,1],[0.33,0.33,0.33,0],[.66,.66,0,0,0,0,.75]];   
 MAZ_PP_BlurEffect ppEffectAdjust [0];   
    player setCustomAimCoef 1;   
    MAZ_PP_SuppressionEffect ppEffectCommit 4.5;   
 MAZ_PP_BlurEffect ppEffectCommit 0.7;   
   };   
  }];   
#

I'm trying to add a modifier based on caliber or damage to my suppression script.
I have these 3 parameters to build off of.

"_ammoObject", "_ammoClassName", "_ammoConfig"];

i dont want to create a list of every ammo type tho, just sort by calibeir, or damamage. where would i even start with the above params

faint oasis
warm hedge
#

You can just do a math

faint oasis
warm hedge
#
(eyeDirection player) params ["_x","_y"] ;
((_x atan2 _y) + 360) mod 360```
faint oasis
sullen sigil
#

is there any method of increasing player's fov? plan is to do so as their velocity increases ๐Ÿค”

#

(in vehicle)

ashen ridge
#

I have an AI unit alone in his group (he is his own leader) and i have set 6 waypoint to make he walk in circles around a city.
Eventually i want to make he go in the middle of the city and then back to run in circles arround the city.
With the 6 waypoints already set and he walking arround the city, can i use this code to make he tap the certer of the city?sqf _unit doMove _centerOfTheCity Looking at the wiki i believe he will reach the center and stay there forever.

slow brook
#

Does exitwith in a function returning an empty array not work properly?

In debug I can do,

_array = [];
if (count _array == 0) exitwith {_array}; 

Which returns

[]

but when I stick this in a fnc call.

private _fncOut = call test_fnc_EmptyArray;
_fncOut

The debug stays empty

winter rose
#

no issue reported

granite sky
#

@slow brook You probably failed to define the function.

#

call nil tends to fail silently.

slow brook
#

I've just changed it to pass back [""] and it works?

granite sky
#

but then the array count is 1

slow brook
#

aye but I changed the if to _fncOut IsEqualTo [""]

granite sky
#

shrugs

slow brook
#

Yeah... just weird

granite sky
#

exitWith works fine. It doesn't matter what you put in the return value.

slow brook
#

Oh I use it all over the place. Just for whatever reason that return [] was being dumb

granite sky
#
_fnc_EmptyArray = {
    _array = [];
    if (count _array == 0) exitwith {_array}; 
};

private _fncOut = call _fnc_EmptyArray;
_fncOut

returns []

fallen locust
#

NO!

queen cargo
#

YES!

#

Oos is the future @fallen locust

fallen locust
#

Not OSS parsing!

queen cargo
#

??

gentle zenith
#

Hey, I run an Arma 3 server that often has over 100 players on it and quite a lot of scripts running both server and client side.

At times players have become invisible to one another, if you can't see a player then their bullets do not hurt you, however any scripted attacks such as melee still affect you.

Only fix so far is to relog, can anybody point me in the direction of what may be causing this? Is it script related or due to desync? I have no scripts running that purposely make any player invisible

wary needle
#

hacker?

fallen locust
#

Well at the end you are parsing OssSQF to SQF

#

its like blueprint system it will never be a best thing for performance

kindred tide
#

if an array is acquired with getVariable, is it copied or referenced

warm hedge
#

It should be copied

kindred tide
#

writing queue basics

kindred tide
#

oh forgot about making it air tight

#

now should be better

#

cause it's possible a queue could be pushed to and popped from different scripts

kindred tide
#

aaand then process the objects from the queue

hallow mortar
kindred tide
# kindred tide

it doesn't allow me to return nil as default value for _item

#

(in case the queue is empty)

#

and i cant use null either because if the object was deleted after being added to the queue it'll be null but that doesnt mean the queue is empy

#

used a flag

little raptor
#

And write inline private instead of private array

warm hedge
#

More like just use params

little raptor
#

Yeah and use params for those params instead of select

kindred tide
#

that aint backwards compatible

little raptor
#

Isn't resize A3 only still?

#

iirc most important array commands were only added with A3

kindred tide
#

i need to stick to backwards-compatible code at least in the framework/backend side of things and use the new stuff in the specific-to-the-game side

little raptor
#

Well I recommend using newer stuff since they tend to be faster

#

You can still add backward compatible stuff using macros

#
#ifdef __ARMA3__

#else

#endif
kindred tide
#

is that possible in sqf

little raptor
#

Yes

kindred tide
#

does #define work like a c++ #define and i can #define SOMETHING ANYTHING

little raptor
#

Yes

#

__ARMA3__ is a predefined macro

queen cargo
#

Pff its a minimalistic overhead for easier coding

sullen sigil
#

How do you return ownership to server after setOwner? ๐Ÿ˜…

south swan
#

i'd assume 2 is the standard clientID of the server blobdoggoshruggoogly

sullen sigil
#

ah, thanks

#

netcode is hard meowsweats

winter rose
#

not so much now that we have RemoteExecโ€ฆ these were absolute game changers, I tell you

sullen sigil
#

remoteexec on each frame? no thx ๐Ÿ™ƒ

#

having juddering with my capital ships turning, fairly sure i need the system to be client authoritative rather than server

#

and unfortunately this isnt something i can fix in setvelocitytransformation as there is no angular velocity for client interpolation afaik

winter rose
#

ah, simulating driving. well, yes, ownership may be a good idea
and the server gives or takes ownership, as it should be

sullen sigil
#

i dont want client ownership because that ends up with arma'ing notlikemeowcry

#

though tbf my code isnt that awful

jade acorn
#

I am playing around the conversations system and I noticed that the kbTell for player does not follow the head movement, so in vehicles when you look around the sound will be played "in front", and outside if player is doing any idle animation the voice is also played from a static place. I thought about using playSound with it but I'm stuck with how do I mute the kbTell. I can't get rid of the ogg from speech[] because the conversation automatically skips to next kbtell.

sullen sigil
#

just need to get a friend online to help test the netcode because ive no way of doing it myself

tender fossil
sullen sigil
#

Yeah needs to be on dedi as looks fine in LAN ๐Ÿ˜…

#

regardless of ownership

#

it's usable as is so if i cannot make improvements it's not the biggest of deals, but it'd certainly be nice to have completely smooth stuff ๐Ÿ™ƒ

tender fossil
#

You can run a dedicated server and connect to it with multiple clients AFAIK (but yeah, it's still LAN so...)

sullen sigil
#

ya

#

also, lack of angular velocity commands is shocking

tender fossil
#

Need to do the math yourself I guess

sullen sigil
#

Yeah I'm just not doing it and relying on pilots of 1km long vehicles to not be shit

cerulean egret
#

Hey all. I'm looking for a way to get ai spawned groups to stop and throw smoke when a helo is within X meters. Any ideas

tepid vigil
#

How bad would it be to send functions to clients over the network? I have a mod that currently works serverside and I don't want to add clientside as a requirement, but I need to get a single function running on the clients

astral bone
#

What does the function do

fallen locust
#

depends on a project size

tepid vigil
# astral bone What does the function do

https://github.com/rekterakathom/DynamicCamoSystem/blob/c393c4ebddd40331d2aef275214530c7bda8d75d/addons/core/functions/fnc_clientLoop.sqf
Here is the whole function, I am not (right now) worried about the performance impact on the clients, more so about the network impact of sending the function

GitHub

A lightweight ARMA 3 mod that calculates camouflage levels based on worn gear - rekterakathom/DynamicCamoSystem

#

The entire thing in text is ~2KB, so I presume it's much less if compiled and then sent? So if I compileScript it on the server and then broadcast the resulting code with publicVariable, would the network impact be in any way significant

sullen sigil
#

have the server publicvariable it during init and I doubt it'll get noticed?

tepid vigil
#

Using rough math it's ~200KB of total data for 100 clients and I doubt that most servers will have that many

winter rose
tepid vigil
#

I would do local, but it's for an update to my mod with a decent amount of subscribers who expect it to be serverside and I'd like to retain that functionality. If I am using compileScript with .sqfc, do comments have an effect on the size?

queen cargo
#

the easier coding or the overhead?

#

Less possible issues apply to all

sullen sigil
slow brook
#

So! BIS_fnc_findSafePos is not safe!

When position cannot be found at all, default map center position is returned, which will be in format [x,y,0]

Sometimes this will return [x,y, 100]. Is the third parameter actually supposed to stick 0 or does it gather that from somewhere in config

#

my excerpt.

params["_player", "_ppos", "_mid"] 
// _player is object
// _ppos is getpos _player
// _mid is owner _player
[3, format ["Restoring position for %1 at %2", name _player, _ppos], _scriptName] call spp_fnc_log;
private _safepos = ([_PPos,0,10,5,0] call BIS_fnc_findSafePos);
// _safepos set [2, 0]; // Tads fix set ground height.
[3, format["It's safer here: %1", _safepos], _scriptName] call spp_fnc_log;
[_player, _safepos] remoteexec ["setPosATL", _MID];

On ALTIS if you set somewhere Out of Bounds.

"325.477: [SPP] | DEBUG | spp_fnc_setplayerpos | Restoring position for 2Lt. Tad at [9877.16,3971.51,0.00160217]"
"325.785: [SPP] | DEBUG | spp_fnc_setplayerpos | It's safer here: [10801.9,10589.6,100,0]"
hallow mortar
slow brook
#

Sure, but if you don't use that param, the "Find safe Spot" function can throw you into the air

#

which means that third value isn't always 0

#

as the wiki states

astral bone
#

does ctrlSetText call onEditChanged? I assume yes x3

little raptor
#

Yes

jade acorn
#

I placed a gunner in a vehicle with this doTarget wp_tgt_1; in his init so he can aim at a given target (in this case a sphere helper). Instead of doing that he is just making 360s. any idea why? Do I have to use something different to make the gunner aim at certain point and stay like that until threatened or whatever?

foggy stratus
#

If there is an Arsenal enabled ammo box near my AI squad mates, I can select the unit, hit 6 key for actions, and find Arsenal action to get unit to use the Arsenal. Is there a single scripting command where I can launch Arsenal for a particular unit immediately? The following does not work (it gives an unknown enum value error):

#

(units group player #1) action ["Arsenal", box2];

foggy stratus
jade acorn
#

it is still there, just texture made transparent.

foggy stratus
# jade acorn

Try putting it out 100 meters, it might be targeting relative to vehicle instead of unit.

ornate whale
#

How can I show a value of the variable in the displayed text? _variable=10; cutText ["Your variable is: ","PLAIN"]; Thank you

astral bone
#

format

jade acorn
foggy stratus
#

_variable=10; cutText ["Your cover has been blown!"+str _variable,"PLAIN"];

astral bone
#

concatenate requires it to be a string. format will accept anything, I think

#

bruh- "Ok, I've fixed all the errors... lets try it out!"
The game: "Oh yea, there's 2 composeTexts." (composeText (composeText [xyz]))

#

it's stil not working, but for different reasons now weeee

granite sky
#

The unit doesn't matter. The arsenal UI is always opened for the player, even if you triggered it with another unit's action.

foggy stratus
granite sky
#

You'd need to select into it first (selectPlayer). Or do some loadout swapping scam.

foggy stratus
#

Thanks. That blows for my needs though. I currently use a hidden ammobox, and have an action where I look at ai squad mate and my action appears. The action teleports the box to the cursorobject unit, and does the following to open the ammobox for that particular unit. I can then arm the AI. But Arsenal is superior UI for arming the unit...

#

_unit action ["GEAR",missionNamespace getVariable "jboy_SogAmmoBox"];

granite sky
#

The loadout swapping might not be too bad. The arsenal generates open/close events that you can hook with [missionNamespace, "arsenalOpened", { // your code here }] call BIS_fnc_addScriptedEventHandler

foggy stratus
#

I'll take a look at that. Thanks alot.

foggy stratus
#

Fug it. I'm going to keep my hidden ammo box approach, plus spawn a box with arsenal enabled. If player wants to use arsenal, he'll just have to use action menu to move AI unit there. It's a damn shame we can't call AI actions directly though (i.e., bypass selecting unit, scrolling thru actions, etc.).

little raptor
#

you can do this:

[missionNamespace, "arsenalOpened", { 
    BIS_fnc_arsenal_center = ai;
    BIS_fnc_arsenal_target = ai;
}] call BIS_fnc_addScriptedEventHandler;
["open", true] call BIS_fnc_arsenal
foggy stratus
little raptor
#

ah nvm don't do that ๐Ÿคฃ

foggy stratus
#

Nooooooooooo!!!!

little raptor
#

the Arsenal still switches to the other unit when you close it...

#

and worst of all the other unit was deleted... meowsweats