#arma3_scripting

1 messages ยท Page 616 of 1

tough abyss
#

Alright thank you so much for the help mate, have a good night ๐Ÿ˜„

winter rose
#

U2! ๐ŸŽต
and as I said, the channel is here for that so no worries if you get stuck, we got your back oldman

tough abyss
cerulean cloak
#

Is it ok if I ask a question about scripting with ACE 3 here?

winter rose
#

it's OK, but you are not guaranteed to have an (accurate) answer. ACE has its own slack (see #channel_invites_list)

astral tendon
#

Also, any recommendation for a script to change pylons in a aircraft? especially some that can be added restrictions on what can be added to aircrafts.

cerulean cloak
#

Sure, it's pretty simple so I'm probably just being an idiot. I have a box with this in its init field [this, LRST_8] call ace_cargo_fnc_loadItem; and a car with the variable name LRST_8 that has more than enough cargo space but for some reason the box isn't getting loaded into the car.

stable wedge
#

How can I run this on an object in real time using Zeus and Achilies?

private _testingCrateObject = this;
if isServer then {
private _itemsArray = [
["ACE_1Rnd_82mm_Mo_HE_LaserGuided", 100],
["ACE_1Rnd_82mm_Mo_HE", 100],
["ACE_1Rnd_82mm_Mo_Smoke", 100],
["ACE_1Rnd_82mm_Mo_Illum", 100]
];
{
  _x params ["_stringItem", "_itemCount"];
  _testingCrateObject addItemCargoGlobal [_stringItem, _itemCount];
} forEach _itemsArray;
};
winter rose
#

@astral tendon Grumpy Old Man did something like that

astral tendon
#

I remember using it, need to find that again

winter rose
#

provided before you ask, of course ๐Ÿ˜Ž

tough abyss
#

Not qualified to answer, but I think you can use the execute code module

stable wedge
#

I received help yesterday regarding this but I am really unable to wrap my head around trying to make this work

#

Yea, I am trying that on the object, no luck

tough abyss
#

you might need to use variable names instead of this

#

thats what I did aswell to make it work

stable wedge
#

I thought I tried that, let me re do

#

ok yea

#

that worked~

#

I must have mistyped it the first time

tough abyss
#

@winter rose got one question, since the hacklaptop1 variable stops existing after I place it down, what could I replace it with?

#

I think _container doesn't work since its in the middle of the holdaction code itself

winter rose
#

correct
you can do a hacklaptop1 = _container to reassign it

#

and if you want this variable to be valid to all players, publicVariable "hacklaptop1";

tough abyss
#

That works ty, should I put publicvariable after I reassign it?

#
hacklaptop1 = _container;
publicVariable "hacklaptop1";
#

like this?

winter rose
#

purrfect

tough abyss
#

right, thank you ๐Ÿ˜„

#

https://prnt.sc/ub7jq2 I'm having this issue with this particular anim, its the one from contact DLC afaik in the first mission

#

its the computer typing one, and I can't get the gun to go out of his hand at all

#

@winter rose Is it just related to this animation, or is it possible to fix it?

#

because BI did it with contact, so it shouldn't be that broken

winter rose
#

remove weapon?

tough abyss
#

since a player does it, I can't really remove their weapon

little raptor
#

Give it back to them when the animation finishes!

tough abyss
#

would it keep attachments? and how would I go about that anyways/

little raptor
#

No

#

You can readd

#

Even if you put the weapon on the back, does it still happen?

tough abyss
#

yup

#

for some reason

#

it might be just that animation

little raptor
#

What you need is an animDone event handler

#

When you play the animation, save the weapon and its attachments to a variable (_unit setVariable....), then, once the animation is done, give them back!

tough abyss
#

How would I save the weapon & attachments if you don't mind?

#

@winter rose btw, afaik the event handler remove thing you suggested earlier only removes the handler from the player actually doing the action

#

is there a way to execute it for every player?

winter rose
#
unit setVariable ["MILK_weapon", primaryWeapon unit];```
tough abyss
#

Alright ty i'll take a look at that tomorrow

#

its 3 AM

#

too much arma ๐Ÿ˜„

winter rose
#

same :p but I want to finish something

tough abyss
#

I'll stop bothering (atleast until tomorrow :P) have a good night ๐Ÿ™‚

winter rose
#

see ya! ๐Ÿ‘‹

tough abyss
winter rose
#

you younglings have it easy! back in my days (โ€ฆ)

fair drum
#

you had to walk 15 miles in the snow to school?

fair drum
#

so AI in attack helicopters from CUP or RHS just don't shoot at anything?

sharp grotto
#
_ownedDLCs = getDLCs 1;
_configPath = configFile >> "CfgVehicles" >> _vehicleClassDLC;
_source = configSourceMod _configPath;
_source = getNumber(configFile >> "CfgMods" >> _source >> "appID");

if (!(_source in _ownedDLCs) && !(_source == 0)) exitWith {
    ["ErrorTitleAndText", ["MISSING DLC", "You don't own the required DLC for this Vehicle!"]] call ExileClient_gui_toaster_addTemplateToast;
};```
I have a another case of a script causing mass lag / mass kick "bug". It only runs client side on buying vehicles and restricts buying vehicles from a DLC you don't own.
After lots of testing i tracked this down as the cause for the problem. After arround 2 hours mission runtime and about 45+ player this causes mass kicks and mass lag.

Can somebody with much more scripting experience tell me how that is even possible ? Or show me the dumb error i made in this few lines ๐Ÿ˜…
fair drum
#

what if you stored those local variables as public global variables, that way they don't have to be created every time a player buys something?

little raptor
#

After arround 2 hours mission runtime and about 45+ player this causes mass kicks and mass lag.
@sharp grotto
I don't see anything in this snippet that could cause a lag.
What about that last function? Paste its contents here. (copyToClipboard str ExileClient_gui_toaster_addTemplateToast)

sharp grotto
#
_template = _this select 0;
if !(isClass (configFile >> "CfgExileToasts" >> _template)) exitWith 
{
    systemChat format ["UNKNOWN TOAST TEMPLATE: %1", _template];
};
_placeholders = param [1, [""]];
_placeholder1 = _placeholders param [0, ""];
_placeholder2 = _placeholders param [1, ""];
_placeholder3 = _placeholders param [2, ""];
_placeholder4 = _placeholders param [3, ""];
_templateConfig = configFile >> "CfgExileToasts" >> _template;
_color = getArray (_templateConfig >> "color");
_templateText = getText (_templateConfig >> "template");
_rawText = format [_templateText, _placeholder1, _placeholder2, _placeholder3, _placeholder4];
[_rawText, _color] call ExileClient_gui_toaster_addToast;```
#

I don't get it either. But iam 99 % sure. I put it into missionfile yesterday and mass lag appeared again. I removed it again and no mass lag since then ๐Ÿ˜‘

little raptor
#

Another function in this too: ExileClient_gui_toaster_addToast

sharp grotto
#

All these functions are called frequently by the mod (Exile) and never caused such issues

little raptor
#

Actually, I've seen GUI elements causing issues before

#

But I'm not sure what is the real culprit here

#

Do you get any errors in the rpt?

sharp grotto
#

Well if no one is playing me like a fiddle. Just this lines i posted cause this error. All clients get high ping / high desync server fps freezes and they all get kicked. Only happens with +45 players after arround 1.5 - 2 hour mission runtime

wraith cloud
#

Doubt any of that is causing server lag

sharp grotto
#

I remove it, the rest is unchanged and no mass lag / mass kicks.

wraith cloud
#

For how long?

sharp grotto
#

multiple days
i spent like 100 hours to debug script by script, addon by addon.

wraith cloud
#

Idk. I'd wait more to see. We had some days with no server lag

sharp grotto
#

Its like a clock, yesterday i put it into the mission file (no mass lag for a week) and bรคm it started ๐Ÿ˜“
removed it again and no problem since 24 hours ๐Ÿ˜‚

#

I only started scripting two years ago as a hobby and i see myself as noob. So my only other plausible explanation is sabotage (memory injector) and someone is having his fun with me.

wraith cloud
#

Was that the only stuff you removed?

sharp grotto
#

yes

fair drum
#

theory question, can I shorten long chains of or? can I shorten this?

(!(alive intel) or !(alive intel_1) or !(alive intel_2) or !(alive intel_3) or !(alive intel_4))
#

kk cool beans

strange seal
#

itโ€™s a longshot but Is there anything for iOS that I could use to write down code for SQF? I use notepad++ with the language addon from ARMAholic at home but would like to be able to try stuff on the go as well

little raptor
#

I don't think so. And even if there was, how would you debug your code?!

strange seal
#

Iโ€™m thinking more for just writing down ideas, Iโ€™m new to scripting and would like to have something that can tell me my syntax is messed up like how notepad++ can, right now Iโ€™m either handjamming it or writing a note on my phone

little raptor
#

Sadly, there's no such app. Not even for Android.

harsh vine
#

disableSerialization;
1 cutRsc ["Contacts","PLAIN"];
_display = uiNameSpace getVariable "Contacts";
_setText = _display displayCtrl 1001;
_setText ctrlSetStructuredText (parseText format  ["
<t size='1.3' color='#FFE933' align='left'> <img image='icon\b.paa'/>%1</t> 
",_newxp]);
_setText ctrlSetBackgroundColor [0,0,0,.2];
Sleep 1;
1 cutRsc ["Contacts","PLAIN"];
#

does anyone know how to remoteExec this?? ๐Ÿ™ˆ

winter rose
#

make it a CfgFunctions, and remoteExec it ๐Ÿ™ƒ

#

that's the only way - you cannot manipulate local variables from an external pov

harsh vine
#

is it possible to allowDamage false; to slingload rope??

fair drum
#

anyone use ACE's Check PBO framework? I have well over... idk... 500 CfgPatches values and it crashes the game when I try to copy past them to the ACE options lol. just wanted to try it out

queen cargo
#

Coding on Android actually is possible using vscode and one of the plenty Linux apps

gilded rover
#

hey guys , so I am trying to code a destroy coms room , but the remote server , router , generator and rugged pc thing just don't want to die unless I use this setDamage 1
So i was thinking about adding a event handler to all these objects so that when they are damaged by explosives there damage is set to 1. any idea how to put this in code , my knowlage of eventhandlers suck , for now the mission is singleplayer , but i remember that when its MP its just a MPeventhandler

cosmic lichen
winter rose
#

which is precisely why you would want to check if isServer then {}.

gilded rover
#

thanks guys
@winter rose yeah i learned the importance of that when i spawned units in a MP scenario, without it it spawns the unit x amount of times depending on how many players are in the server

winter rose
#

Correct! Init fields are ebol

strange seal
#

does format work in ARMA 3? I'm trying to use it to give the lifeState of subordinate units but I can't seem to get the format right

warm hedge
#

Post your format

strange seal
#

{format ['%1-%2', name _x, lifeState _x]} forEach FL;

warm hedge
#

And this supposed to do what? I don't see this does something

strange seal
#

I tried nesting it into a hint but I was working on that part when I sent it

warm hedge
#

Post the entire. The code itself supposed to do nothing with it

strange seal
#

SG = hcSelected A16;
SU = [];
FL = [];
{
SU = units _x;
{
FL pushback _x;
}forEach SU;

}forEach SG;

hint {format['%1-%2', name _x,lifeState _x]} forEach FL;};

#

selects high command groups, then gets the individual units and puts them into FL[]

warm hedge
#

This is simply illegal. hint does take no code

strange seal
#

ah

#

so if I made a variable = the code and post str(_var);? should that work?

#

or is hint just out of the question for passing this info along

warm hedge
#

Once again, this does what? Describe all of variables?

strange seal
#

SG is the selected high command groups, SU is storage in order to pull the units out of the returned array and put them into FL, so what I'm trying to do with it is be able to find out which members of which groups are dead/injured etc. in high command

cosmic lichen
#

if you post code, please use meaningful variable names.

#
{
  hint format ['%1-%2', name _x, alive _x];
} forEach FL;
warm hedge
#

And the hint shows all units' status?

cosmic lichen
#

Also you can do something like

allOfYourUnits select {alive _x};
strange seal
#

@cosmic lichen will do, I'm a bit new to this, kind of assumed more experienced people would be able to make sense of it

cosmic lichen
#

No problem. That's why ppl are here

strange seal
#

@warm hedge that's the goal, eventually I'd like to have it stored in a diary entry or custom gui, but right now I just want to get the info

warm hedge
#

Also never use global variable for temporary variable. Use _ as the prefix (= local variable), so won't longer than your script's lifetime thus happy for your RAM

strange seal
#

@cosmic lichen I was thinking about that, but I was hoping to make it seem more like getting a sitrep from the subordinate, I'm hoping to turn this into an Ammo,Casualties,Equipment report

#

@warm hedge Very true, that's usually something I do in the "I got everything working, lets make it not a mess" phase

warm hedge
#

That's actually the step I took years before! ๐Ÿ™‚

cosmic lichen
#

@cosmic lichen I was thinking about that, but I was hoping to make it seem more like getting a sitrep from the subordinate, I'm hoping to turn this into an Ammo,Casualties,Equipment report
@strange seal Should not be too hard. Just grap all units and then get the information you need.

strange seal
#

@R3po The only thing I've been able to get from Subordinate HC units is a percentage of their strength, which hasn't even been accurate most of the time, I'm doing a Platoon level scenario and want to be able to figure out where to guide the medics

spark turret
#

just out of interest, does sqf have a way to multithread?

cosmic lichen
#

@strange seal You could try to get the avergage health with damage _unit;

pliant stream
#

@spark turret of course not. that would be an absolute security disaster

spark turret
#

why is that?

pliant stream
#

how many SQF scripters do you think could write threadsafe code, even if it were possible to do so?

exotic flax
#

if any script kiddie can access different threads, it simply would overflow them and crash the game of any client and/or server within seconds

spark turret
#

ah i though security in terms of trojans etc

#

yeah man its not like i need access to multiple threads to kill the game

tough abyss
#

next thing you know: Arma C++

pliant stream
#

yeah letting SQF scripters have access to threads would open you up to all sorts of attacks. like connecting to any server could allow the server owner to take over your computer

tough abyss
#

^^ any kind of low level access a scripter has is terrible

spark turret
#

i remeber a blood and gore script that was "multiplayer compatible" from armaholic. it spawned bloodstains based on injury for AI. it did not have a max counter and ran locally on each client. it spawned around 8 000 blood stain objects after we killed a single BMP with infantry on it and froze the server.

tough abyss
#

Yes, but thats within script limitations

#

you have to purpousely enable a malicious script

pliant stream
#

denial of service isn't as bad as a RE vulnerability

tough abyss
#

having low level access just allows anyone to bsod your PC

pliant stream
#

bsod is still a good outcome

tough abyss
#
  • not to mention its through the vessel of arma 3
pliant stream
#

they could also quietly attach your PC into a botnet

tough abyss
#

so it just makes BI untrusted if that shit becomes the norm

spark turret
#

interesting

#

multithreading is a new concept to me and i already wondered why so few games do it

tough abyss
#

its why games with modding make their own/use scripting languages

exotic flax
#

looking at engines like Unity or UE, which support multi-threading, it only supports it at (game) engine level, and not useably within mods (unless devs messed something up)

tough abyss
#

^

pliant stream
#

lots of games use multiple threads, they just don't let untrusted scripts do it

#

and SQF is always untrusted

exotic flax
#

and SQF is always untrusted
even when made by BI ๐Ÿคฃ

tough abyss
#

arma 3 is the only game I know with that much possibility

#

take a look at any paradox game, they have their own pseudolanguage with only access to the stuff they allow

pliant stream
#

well it's no different in SQF

#

SQF is also limited to the commands BI has given you

tough abyss
#

good point, but you cant really use scripts with hoi4

#

only mods, and the checksum changes

#

so you can only voluntarily fuck yourself over

#

by enabling a bad mod

cosmic lichen
#

@tough abyss Language

tough abyss
#

right

cosmic lichen
#

Also getting off topic here

exotic flax
#

although since BI uses SQF as well for all their own programming, it has everything they use

tough abyss
#

funnily enough, there used to be an exploit in HOI4

#

there's one LUA file in the game, defines file, for some variables they have

#

and they never limited it, so you can technically execute any LUA on game launch

#

was patched though

#

anyways, getting offtopic, this script is wrong for some reason:

hackerman1 = _unit;
hackerman1 setVariable ["HackermanWeapon", primaryWeapon hackerman1];
hackerman1 removePrimaryWeaponItem "HackermanWeapon";
#

Can I not input variable names in that function?

cosmic lichen
#

you need to get the variable first

#
hackerman1 removePrimaryWeaponItem (hackerman1 getVariable ["HackermanWeapon", ""]);
tough abyss
#

missing bracket, but ty

#

will try that

#
hackerman1 = _unit;
hackerman1 setVariable ["HackermanWeapon", primaryWeapon hackerman1];
hackerman1 removePrimaryWeaponItem (hackerman1 getVariable ["HackermanWeapon", ""]);
#

going with this, it still doesn't work for some reason

cosmic lichen
#

Are you sure you want to remove the primaryWeaponITEM or just the primaryWEAPON?

tough abyss
#

ok wew wiki lied to me

cosmic lichen
#

Because you are trying to remove the primary weapon with a command which is used to remove the item ๐Ÿ™‚

tough abyss
#

thats my bad then lol

#

works, ty ๐Ÿ˜„

#

@cosmic lichen What's the variable for launcher if i may ask?

#

primaryWeapon, secondaryWeapon are the ones im using

#

oh nevermind, I think secondary is the launcher

#

handgunWeapon is the pistol

cosmic lichen
#

it's primary, secondary (launcher) and handgun (Don't ask me who though of the naming ๐Ÿ˜„ )

tough abyss
#

@cosmic lichen one problem though, it doesn't return the weapon with attachments

#

any way to save those aswell?

cosmic lichen
#

These are all the commands you need

tough abyss
#

Right, I'm gonna have a look at this, thank you ๐Ÿ˜„

cosmic lichen
#

Adds a weapon into cargo space of a vehicle / box with given attachments / magazines.

tough abyss
#

@cosmic lichen okay so, how would i go around creating an array like this?

hackerman1 setVariable ["allweaponstest", weaponsItems hackerman1];
{ cursorObject addWeaponWithAttachmentsCargo [_x, 1] } forEach "allweaponstest";
timid cedar
#

Hi guys, hopefully a fairly simple question about forcing a certain texture on a vehicle when it spawns, when that texture doesn't have an associated classname.

The vehicle in question, the L-39 Albatross, has classnames and associated skins for the AAF, Takistani Forces, and generic desert army. If you access vehicle appearance, however, there is also a 2-tone grey camo scheme, for which there is no associated classname.

Would it be possible to run a script that means whenever one spawns in, the game automatically changes the (global) texture to the grey scheme?

For info, exporting that grey colour scheme provides the following:

[
    _veh,
    ["GREY",1], 
    true
] call BIS_fnc_initVehicle;```

Many thanks!
cosmic lichen
#

@tough abyss please read the examples of setVariable and getVariable. You are not using it correctly

tough abyss
#

right, thank you

tough abyss
#
{ hackerman1 addWeaponWithAttachmentsCargo [_x, 1] } forEach (hackerman1 getVariable ["allweaponstest", ""]);

is this correct?

#

because it doesn't work for some reason

astral tendon
#
_Pos = getPos PlayerPlaneSelection; 
_camera = "camcurator" camcreate _Pos;  
_camera cameraeffect ["external","TOP"];  
_camera camPrepareFOV 0.75; 
_camera camPrepareTarget PlayerPlaneSelection; 
_camera camPreparePos _Pos; 
_camera camCommand "manual on";  
_camera camCommand "surfaceSpeed off";
_camera camCommitPrepared 0; 

This camera is moving as I want but I did not find a way to make it not go too far from the target that it is suppose to look at, any way to fix that?

winter rose
#
if (_camera distance _target > _maxDistance) then
{
  private _vectorFromTo = getPosASL _target vectorFromTo getPosASL _camera;
  private _normalised = vectorNormalized _vectorFromTo;
  private _finalPosition = _normalised vectorMultiply _maxDistance;
  _camera setPosASL (getPosASL _target vectorAdd _finalPosition);
};
```๐Ÿฎ *perhaps*
astral tendon
#

Looks like I gonna need to put that on a loop.

winter rose
#

wait, it's a curator camera
can't you restrict these to areas?

astral tendon
#

maxPitch and minPitch have no effect

winter rose
astral tendon
#

myCurator if for zeus right?

thorn cape
#

@thorn cape

this isn't working for you? synchronizeObjectsAdd is a global command so you shouldn't have to remoteExec it. are you sure you are calling it right? and are your units named player1,player2,etc?
@fair drum

I have no idea.
I put in init.sqf/initServer.sqf
[Offi1, [task1]] remoteExec ["synchronizeObjectsAdd", 0, true];
In singelplayer works excellent. When I run multiplayer mission - this wouldn't work.

Also I tryed simple
Offi1 synchronizeObjectsAdd [task1];
Not work in MP.

But Offi1 setDamage 1 works.

task1 is Create task module with assigned status

vernal venture
#

Anyone have experience with ACE event handlers that can point out my error here?

//Respawn Loadouts
if (hasInterface) then {
    [] spawn {
        waitUntil {alive player};
        player setVariable ["loadout",getUnitLoadout player,false];
        player addEventHandler ["ace_arsenal_displayClosed", {
            player setVariable["loadout", getUnitLoadout player];
        }];
        player addEventHandler ["Respawn", {
            player setUnitLoadout (player getVariable "loadout");
        }];
    };
};
winter rose
#

aren't ACE EH scripted EHs @vernal venture?

vernal venture
#

I'm not positive, which is why I was hoping there'd be someone around more familiar with it, because that looks like it should work, at least to me.

winter rose
#

BIS_fnc_addScriptedEventHandler perhapsโ€ฆ

#

addEventHandler are engine handlers, I don't think ACE has access to that

vernal venture
#

Aha

#

So this should work.

//Respawn Loadouts
if (hasInterface) then {
    [] spawn {
        waitUntil {alive player};
        player setVariable ["loadout",getUnitLoadout player,false];
        player addEventHandler ["[ace_arsenal_displayClosed] call CBA_fnc_addEventHandler", {
            player setVariable["loadout", getUnitLoadout player];
        }];
        player addEventHandler ["Respawn", {
            player setUnitLoadout (player getVariable "loadout");
        }];
    };
};```
winter rose
#

โ€ฆno

vernal venture
#

Like I said, amateur.

copper raven
#

did you look at the link i sent at all?

vernal venture
#

That's where I got [ace_arsenal_displayClosed] call CBA_fnc_addEventHandler

copper raven
#

if you fully read the page, you'd have understood that what you're doing is wrong and won't work

waxen tide
#

how can i address terrain objects like "1d590150100# 12261: qalat.p3d" ?

#

i want to detect its destruction.

winter rose
#

nearestTerrainObjects iirc

waxen tide
#

i know how to find them with nearestobject, but i can't even pick it out of the list by comparing it

#

because iskindof etc seem to fail

#

nearestObject 444472; // get the object by ID

#

ah. i'll try that.

winter rose
#

very bad idea.

#

object ids can evolve with time (e.g the map gets updated)

young current
#

where is the object from?

#

you should be able to compare its name to whatever object you want to pick

#

the p3d name that is

waxen tide
#

the object is on the "kunduz" map

#

it's a fortifcation tower of sorts

#

how do i compare it?

#

jesus the wiki is slow today

astral tendon
#

@winter rose That script did not worked and the camera just got stuck, for context, I am trying to recreate a camera just like the one we have in the garage.]

winter rose
#

I don't know much about that I'm afraid.

pale ridge
#

is there a way to check if a script is working / loaded?

winter rose
#

depends on what you want to check / how you call it

pale ridge
#

well i am trying to load a sqf from a mod, can i see it in the function tab in editor/zeus?

winter rose
#

you can see it, but you could use diag_* commands to count threads

pale ridge
#

i can see the headline, but no code in it, probs forgot something ๐Ÿค”

winter rose
#

diag activeScripts
diag activeSQFScripts
diag activeSQSScripts

thorn cape
#

How delete "Respawn vehicle module" by trigger?

ionic orchid
#

I can hideObject existing terrain objects, like a Church or Gas Station building, but does anyone know how to also hide the map symbol for it?

winter rose
#

Unsure if you can
Try playing with Locations @ionic orchid

ionic orchid
#

I think I used those for named places, but I don't think it works for objects

#

iirc there's some cfg entry on the buildings that provides an icon, but I didn't see any way to override it last time I looked (or to just delete it from the map)

#

oh cool, I can at least manually add them in 3den (Markers->Icons), looks like i'm out of luck with removing them, though

astral tendon
#

what is the command that makes a number a negative number?

copper raven
#

unary minus ...?

still forum
#

yeah letting SQF scripters have access to threads would open you up to all sorts of attacks. like connecting to any server could allow the server owner to take over your computer
No idea how you get the idea that multithreading == everyone can take over your computer??

queen cargo
#

Could easily realize Real threading using sqf-vm ๐Ÿค”๐Ÿค” though... Interactions with the game would be troublesome

exotic flax
#

Q: is there a (hidden) command/function like ctrlTextHeight, but working for CT_HTML (or RscHTML)?

gentle plaza
#

Anyone familiar with the A3 Wounding System - AIS Revive? I use it for the players BUT I have an AI unit that Ive set to "Unconscious" and I would like the player to not be able to revive them, and instead drag/carry them to an MEDEVAC point. Basically remove the revive addaction but keep the drag/carry addactions for only that ai unit...

exotic flax
#

why not simply use _unit setUnconscious true and ignore AIS (unless they check for that value)

gentle plaza
#

Thats probably prefect, I didnt know the base game had a drag/carry mechanic. Testing now.

#

problem is that AIS is necessary for the drag/carry mechanic. With ```_unit setUnconscious true;

#

should have explained not using Ace or other mods

astral tendon
#

any tip on how to get all vehicles Array that are usable? I tried this with the CFG but it also returns vehicles that don't even have a model

_AllPlanes = []; 
{ 
    _Configname = configName _x; 
    if (
    _Configname isKindOf "air" and
    (count getArray (_x >> "weapons") > 1) and
    (getText (_x >> "editorPreview") != "")
    ) then { 
        _AllPlanes append [_Configname]; 
    }; 
} forEach ("true" configClasses (configfile >> "CfgVehicles")); 
_AllPlanes;
digital hollow
#

string comparison requires isEqualTo. != doesn't work.

still forum
#

string comparison requires isEqualTo. != doesn't work.
what?

#

That's.. not right

digital hollow
#

Did that used to be the case?

warm hedge
#

Supposed to

still forum
#

!= not working was never the case.
Quite sure != was there before isEqualTo was

hallow mortar
#

So I'm using one of the BI preset custom leaflet classes for the drone leaflet bomb. I've defined the text and image in description.ext as required. However, when I order the drone to fire (using the script command), I get the following function error:
[BIS_fnc_initLeaflet] Script not defined for leaflet Custom 01
What do I need to do to...define this script? The Arma 3 Leaflets page doesn't mention it, and the BIS_fnc_initLeaflet page only really talks about it in the context of manually using it to configure individual leaflet objects (which I'm not doing).

astral tendon
warm hedge
#

Since Arma 3 v1.99.146486

#

AKA Dev-Branch only for now

astral tendon
#

oof

#

what a waste of time, I was about a hour trying to figure why the command was not working, would be better if we had the DEV tag instead of just the numbers.

little raptor
#

Builds with odd minor versions are dev builds (1.99, 2.01, etc)

pliant stream
#

@still forum

No idea how you get the idea that multithreading == everyone can take over your computer??
Multiple threads with equal access would inevitably lead to some exploitable race and open an RE vector
In fairness yeah you could safely run sqf on a background thread if it had no access to any game state and everything passed between it and the main was serialized. That would diminish the usefulness though. You don't often have heavy pure workloads like that in sqf

thick chasm
#

Hello!! I have a problem

I have this script to put music on radio...
class CfgSounds
{
sounds[] = {};
class music1
{
name = "music1";
sound[] = {\Sounds\ride.wav, 300, 1};
titles[] = {0,""};
};

and in the init radio this script
h1 addAction ["Music ON", {h1 say3D ["music1", 100, 1];}];

the main problem is how can i turn off the music, help me!!

little raptor
#

Use a dummy object, then delete it

#

Why don't you define it in cfgMusic and use playMusic instead? It can be stopped too.

thick chasm
#

Because I'm a noob

#

In the example what is this? ASLToAGL

little raptor
#

createVehicleLocal requires an AGL position (above ground). getPosWorld gives an ASL (above see level) position. So ASLToAGL is used to covert the heights.

#

If you don't get that, you can simply use attachTo (attach the dummy to the actual object) and save yourself the headache.

ripe sapphire
#

@little raptor can this dummy object method be used for moving things like vehicles?

#

also can someone tell me how to spawn RPG rocket aimed at a certain direction?

#

im trying to make a scene where as a helicopter pass thru an RPG is fired from the ground towards it (doesnt necessarily have to be fired from a unit, the idea is to fire a near-miss)

winter rose
#

createVehicle, setVectorDirAndUp or setDir/setVectorUp, setVelocityModelSpace ๐Ÿ™‚

ripe sapphire
#

thanks, do i use Weapon_launch_RPG7_F for the createvhicle?

little raptor
#
_pos = getPosASL player;
_rpg = createVehicle ["r_pg7_f", _pos];
_rpg setPosASL _pos;
_dir = _pos vectorFromTo aimPos _heli; 
 _xx = _dir#0; 
 _yy = _dir#1; 
 _up = _dir vectorCrossProduct [-_yy, _xx, 0]; 
 _rpg setVectorDirAndUp [_dir, _up];
_rpg setVelocity (_dir vectorMultiply 200);
#

@little raptor can this dummy object method be used for moving things like vehicles?
@ripe sapphire yes, but it won't be pretty

#

You can test this in editor. Just replace _heli with your actual heli

#

You can also use

_rpg setVelocityModelSpace [0,200,0]

In the last line as @winter rose said

ripe sapphire
#

thanks! i will try now

#

btw where can you find the classname for r_pg7_f?

#

i dont know where to find it in wiki

winter rose
little raptor
#

It's an ammo

#

Not mag

warm hedge
#

Or in-game config viewer

winter rose
#

and this list has ammo in it

#

@little raptor

ripe sapphire
#

ahhh ok i foind it, thanks!

little raptor
#

Oh. Sorry

winter rose
#

np ^^
Class Name Inventory description Ammo Used by

little raptor
#

Or in-game config viewer
@warm hedge
@ripe sapphire That's where I found it.

ripe sapphire
#

ah ok

#

how do you search in the config viewer?

little raptor
#

I didn't search

#

When you open the config viewer as a player, it shows:
Your current vehicle
Your current weapon
Your current mag
Your current ammo

ripe sapphire
#

got it thanks!

little raptor
ripe sapphire
#

i tried the script too it works!

#

is there a way to offset it to make it a near miss tho?

little raptor
#

Add an offset to the heli position

#

replace:

aimPos heli

with:

aimPos heli vectorAdd [_x,_y,_z]
#

If you want it to be accurate, you must account for the heli velocity (and bullet drop) as well

#
aimPos heli vectorAdd (velocity heli vectorMultiply (_pos distance _heli)/200) vectorAdd [_x, _y, _z]
#

It is better to replace:

getPosASL player

With

eyePos player

Because getPosASL means at the feet. It could touch the ground.

onyx gust
#

Does anyone know any good scripts for random loot spawns? Please @ me.

ripe sapphire
#

thanks leopard, the offset works!

#

If you want it to be accurate, you must account for the heli velocity (and bullet drop) as well
@little raptor this one however make it go nowhere near the heli

#

sometimes it shoots into the ground

little raptor
#

You've probably forgot to update a variable

ripe sapphire
#

the first one i think achieved the effect im looking for though

little raptor
#

Make sure all variables are correct

ripe sapphire
#

the xyz variables are they in meters?

little raptor
#

yes

ripe sapphire
#

there were no errors

#

just that the missile trajectory is weird

little raptor
#

I did test it myself and it works

ripe sapphire
#

is possible to do 0.1 as a x variable?

#

how low can we go

#

hmm perhaps i set the helicopter too near?

little raptor
#
_pos = getPosASL player; 
_rpg = createVehicle ["r_pg7_f", _pos]; 
_rpg setPosASL _pos; 
_dir = _pos vectorFromTo (aimPos aheli vectorAdd (velocity aheli vectorMultiply (_pos distance aheli)/200) vectorAdd [random 1, random 1, random 1]);  
 _xx = _dir#0;  
 _yy = _dir#1;  
 _up = _dir vectorCrossProduct [-_yy, _xx, 0];  
 _rpg setVectorDirAndUp [_dir, _up]; 
_rpg setVelocity (_dir vectorMultiply 200);
still forum
#

Multiple threads with equal access would inevitably lead to some exploitable race and open an RE vector
@pliant stream yeah but race condition != RCE, race conditions are rarely predictable and lead to crashes, would be very hard to exploit

little raptor
#

is possible to do 0.1 as a x variable?
how low can we go
As far as the floating point accuracy allows

#

up to 6 decimal places I believe
1e-6

ripe sapphire
#

If you want it to be accurate, you must account for the heli velocity (and bullet drop) as well
@little raptor leopad, the first code had 2 vectoradds

#

i think thats why

little raptor
#

Put all of them in one bracket ( )

#

That was why

pliant stream
#

@still forum Does difficulty of exploitation really matter? I would only care about the worst case personally. Broken is broken.

little raptor
#

@ripe sapphire see the new code

ripe sapphire
#

ahh right the closing bracket

#

he'll yeah new code works!

#

one more thing tho how can i play the launch sound when it fires?

#

with createvhicle it doesnt add sound i think

still forum
#

Does difficulty of exploitation really matter?
yeah it does, there are maybe a dozen or so hackers playing with Arma that are on that level

pliant stream
#

That's a dozen too many then. I would not be willing to ship that personally.

little raptor
#

@ripe sapphire

playSound3D [ "A3\Sounds_F\weapons\Launcher\rocket_launcher_5.wss", player, true, getPosASL player, 5, 1, 0 ];
#

something like that

#

Just replace the sound with the rpg sound

ripe sapphire
#

ok, is the sound path found using config viewer too?

little raptor
#

Do you want the firing sound?

ripe sapphire
#

yes

#

sound[] = {"A3\Sounds_F\weapons\Launcher\rocket_launcher_5",1,1,800};

little raptor
#
sound[] = {"A3\Sounds_F\weapons\Launcher\rocket_launcher_5",1,1,800};
ripe sapphire
#

i think i fouund ti

#

xD

#
playSound3D [ "A3\Sounds_F\weapons\Launcher\rocket_launcher_5.wss", player, true, getPosASL player, 5, 1, 0 ];
#

like this?

little raptor
#

yes

ripe sapphire
#

wooo epic it works, perfect!

#

one last thing, does random 1 returns any number between 0 and 1?

little raptor
#

yes

ripe sapphire
#

thanks a lot @little raptor ! cant wait for your super AI mod! ๐Ÿ™‚

little raptor
#

@ripe sapphire You're welcome! ๐Ÿ™‚

#

@ripe sapphire BTW, if you want a better random, use:

random [-1, 0, 1]

Because error should be negative too

ripe sapphire
#

Got it, thanks

wet shadow
#

Hey people, Im having problems using drawIcon3D to place an icon in the world for the player. What format does the icon texture need to be to work? Normal .paa icons with 2^n resolutions result in 'unable to load texture' error.

warm hedge
#

Post your code?

wet shadow
#
addMissionEventHandler ["Draw3D", { 
 drawIcon3D ["mwd\sfx\icon_dog.pac", [1,1,1,1], ASLToAGL getPosASL cursorTarget, 1, 1, 45, "Target", 1, 0.05, "TahomaB"]; 
}];
copper raven
#

.pac?

#

anyways, is the texture inside mission?

wet shadow
#

Ah, yeah I was using relative path ๐Ÿ‘

#

Also .pac works just fine if you were wondering

copper raven
#

yea, not as usual for me ๐Ÿ˜„

vague geode
#

Is there any way to forcefully increase the precision of AI controlled VLS cruise missile strikes?

I have VLS platforms at the outer parts of the map but whenever I tell them to fire at a lasertarget I spawned their aim is always of by something between 75 and 125 meters. I already tried to increase the crews' skill to 100% (AI setSkill 1;) but the results didn't get any better...

PS: I am both revealing the lasertarget to the crews' side and confirming it as hostile before I order them to fire.

willow hound
#

Are you sure it is alive and known to the datalink for the entire flight duration?

exotic flax
vague geode
#

Thanks alot. It was known and it was still "alive" (as alive as a lifeless lasertarget can be) because otherwise the missile would just overshoot the target entirely but it wasn't reported during the entire flight and that actually fixed it.

I looked it up in the script as well and ZEN is handling it exactly the same way so again thanks alot.

tired sigil
vestal compass
#

hello, I could really use a feature in a sci-fi mission I am working on, but I found no ready solution for it.
Unfortunately my knowledge of scripting is very limited, and the best feedback I got so far was "engine most likely won't allow it, or performance will be hit massively"
https://forums.bohemia.net/forums/topic/145581-invisibility-effect-help/
this is something I found that is very close to what I am looking for, specifically getting this blurry-semitransparent effect, preferrably togglable by player too
is this even doable? if so, more or less how?

harsh vine
#

does anyone knw how to get a heli to move to a waypoint and hover (the exact marker position ) not 200m away ๐Ÿ˜ง . The only one that truly work is "hook" waypoint , but hes taking forever to line up ...i would be dead by then ๐Ÿ˜•

little raptor
#

@vestal compass I don't get it. Isn't that what you wanted?
If you want to hide the vest,etc., AFAIK it's not doable (they don't support texturing).

@harsh vine AFAIK it is not possible with waypoints. You can do it with the moveTo command though (doMove is also possible, but it won't work if the destination is too close to the helicopter < 100 m).

_destination = markerPos "Marker";
_vec = getPosASL heli vectorFromTo _destination ;
_vec set [2, 0];
_vec = vectorNormalized _vec vectorMultiply -_offset;
doStop heli;
sleep 0.001; //this needs at least a 1 frame delay
heli moveTo (_destination vectorAdd _vec)

_offset is a number that you can find by trial and error (you can also try without that part, i.e. offset = 0, see what happens)

vestal compass
#

so this will work only as long as there is only uniform on?

high marsh
#

Backpacks have hiddenSelections.

#

pretty sure you can also applu a 'material' to it, and just set the alpha to a really low number. That way you have a sort of outline of the players stuff still.

wet shadow
#

@tired sigil Check the provided GitHub link, it has clear instructions how to start the script

tired sigil
#

Yeah I saw that, I have never messed with this aspect before, it might as well be Chinese to me. I don't know what to do with that...

wet shadow
#

Put the script in you mission folder and then:

In initPlayerLocal.sqf

[] execVM "QS_icons.sqf";

tired sigil
#

Anywhere in the mission folder?

wet shadow
#

If you change the file path then modify the run command. I.e. if you have your script in a folder called 'scripts' then

[] execVM "scripts\QS_icons.sqf";

And so on.

#

The ```sqf
[] execVM "QS_icons.sqf";

tired sigil
#

I'm not seeing initPlayerLocal.sqf anywhere hmmm

wet shadow
#

You could always create one if your mission doesn't have it ๐Ÿ˜‰

tired sigil
#

idk where to even look

wet shadow
#

If you don't have one create one in your mission root folder

tired sigil
#

So just make a new file in the root directory with the name initPlayerLocal.sqf then drop the file I downloaded into the root folder, open the initPlayerLocal.sqf file and paste [] execVM "QS_icons.sqf"; then repack the PBO and that's it?

wet shadow
#

Yep

tired sigil
#

Ok cool thank you so much

#

I will give that a shot

wet shadow
#

Assuming the script works ofc, won't guarantee that. Its pretty old

tired sigil
#

Yeah last updated feb 2018, fingers crossed.

#

Unless you are familiar with something similar that's updated

tired sigil
#

Well seems to be working actually, thanks again for your help!

stuck rivet
#

how do i remove weapon UI elements of weapons added with setPylonLoadout?

#

like if I add something, then expend the munitions, and then replace the weapon on the pylon with something else, the UI element on the top right is still there saying I don't have ammo for the weapon(s) I added beforehand

astral tendon
#

how to get what ammo is on a pylon? getPylonMagazines gives what ammo there is in the plane but no index or wath pylon is loaded with what.

exotic flax
#

The indexes of the returned array's elements are relative to the pylon indexes, such that element 0 is pylon 1, element 1 is pylon 2, etc.
So getPylonMagazines already gives an "index" back.

If you check example 4 on https://community.bistudio.com/wiki/getCompatiblePylonMagazines you get see which pylon is what (and should match the index)

astral tendon
#

I will try to work with that, I was afraid that at some point the array could get mixed depending on the mod.

astral tendon
#

Anyone knows how to avoid a dialog to close with the ECS key and only if you press one of the buttons?

exotic flax
astral tendon
#

Yes, and the problem with that solution is that it bricks the Esc button, I want to let the player to access the main menu but not close the dialog.

smoky verge
#

is it on purpose that music stops playing once I exit a vehicle if I started the music while I was in the vic?

astral tendon
#

had to change the action to open the menu

onLoad = "escKeyEH = (_this select 0) displayAddEventHandler [""KeyDown"", ""if (((_this select 1) == 1)) then {findDisplay 46 createDisplay 'RscDisplayInterrupt'; true;};""];";
#

but seems kind wrong

harsh vine
#

@little raptor hey thanks alot, it kinda works but i will be messing around with it.๐Ÿ‘

tired sigil
#

@tough abyss I will let you know for sure, thanks! I just put it up on a TADST server and seemed to be working fine, I just need to configure some settings before I throw it up on the dedicated server.

vague geode
#

Is it possible to change the progress icon of a hold action while it is being performed? Like for example if you are transmitting data the progress icon would be displaying an outgoing signal (first no bars, then one, then two and last three and then the same thing again) until all data has been transmitted.

quaint ivy
#

If I use drop to create an infinite source of smoke, is it possible to somehow delete this source or stop the effect trough some other command?

winter rose
#

drop only creates one droplet @quaint ivy.
if you want to stop this, stop your looping script

I would recommend using particle sources though

quaint ivy
#

@winter rose Thanks, can you give me a reference to particle sources? I have no idea how to do it, just experimenting atm

winter rose
#

(the wiki is a bit slow today, it's its day off)

quaint ivy
#

Oh I should be able to just spawn the vanilla smoke effect, set its parameters like the BIS module in editor and work with that

tired sigil
#

@tough abyss So far so good, no issues yet. Awesome work as usual, wish I found this sooner!

viral basin
#

hey there, is there a way to use createSoundSource locally? I'd like to avoid using a custom script with a looping say3D :/

winter rose
#

createVehicleLocal + "#dynamicsound" ?

viral basin
#

could you explain a little more? I'm not familiar with that ๐Ÿ˜„

winter rose
viral basin
#

yeah i know, but how do i get that dynamicsound object to play a sound? ๐Ÿ˜‚

winter rose
#

โ€ฆlooping say3D ๐Ÿ˜ฌ I think

#

yeah nope, no workaround this one

viral basin
#

so looping say3D is currently the only way to get a local environment sound on a server?

winter rose
#

โ€ฆon a client, no? ๐Ÿค”

viral basin
#

sry with server i meant a multiplayer environment, my bad

finite sail
#

guys, does KIllzonekid's advice from 2013 that says

#

Make sure you setDir BEFORE you set position. Setting direction after set position could lead to unpredictable behaviour

#

still hold true?

winter rose
#

afaik, yes

finite sail
#

thanks

hallow mortar
knotty flame
fair drum
#

did you sync it?

knotty flame
#

@fair drum I have tried that but did not work.

#

Now I'm trying to do it via Description.ext but I can't locate it.

fair drum
#

i haven't messed around with that module much. lets see if there is a function for it...

#

or are you just going to do some sort of playSound over radio

knotty flame
#

I'm trying to learn globalRadio so that I can have headquarters entity talk as like air traffic control.

#

But I'm seriously struggling to do that.

fair drum
#
class CfgRadio
{
    sounds[] = {};
    class RadioMsg1
    {
        // display name
        name    = "";

        // filename, volume, pitch
        sound[]    = { "\sound\filename1.ogg", db - 100, 1.0 };

        // radio caption
        title    = "I am ready for your orders.";
    };
    class RadioMsg2
    {
        name    = "";
        sound[]    = { "\sound\filename2", db - 100, 1.0 }; // .wss implied
        title    = $STR_RADIO_2;
    };
};

were you looking for this?

knotty flame
#

I was trying to put something like this in a trigger

#

HQ globalRadio configName selectRandom ("true" configClasses (configFile >> "CfgRadio"));

#

But I don't know how to actually select what they say.

#

@fair drum ^

fair drum
#

Define your description.ext with the different radio stuff you want, remember the name = "";

Setup your trigger how you want, in the On Activation put:

private _radioChats = ["radio1","radio2","radio3","radio4","radioN"];

[west,"HQ"] sideRadio selectRandom _radioChats;

if you want them randomized

#

or globalRadio if you want

knotty flame
#

Basically I was a specific sound to play on radio by "HQ" when the player activates trigger.

#

All I'm asking for.

fair drum
#
//In description.ext

class CfgRadio
{
    sounds[] = {};
    class thisIsTheNameOfTheRadioYouWantToPlay
    {
        // display name
        name    = "SimilarButShorterName";

        // filename, volume, pitch
        sound[]    = { "soundFileLocation", volumeHere, 1.0 };

        // radio caption
        title    = "Sir, Land Before I Poop My Pants";
    };
};

//In the On Activation part of a trigger 

[pickASideHere,"HQ"] globalRadio "classname of the sound here from above"
knotty flame
#

@fair drum How can I locate radio sounds that are already in game?

fair drum
#

ah so you want the ingame ones, not custom ones, my bad

knotty flame
#

Because I do not know the sound file location.

#

There are many many good in-game radio sounds that I want to use.

#

In the Fighter Jets showcase there are very good air-traffic control sounds that I want to use in my scenario.

fair drum
#

standby

knotty flame
#

so if i want to use it,

#

how would i use it lol?

fair drum
#

[west,"HQ"] globalRadio "mp_groundsupport_60_uav_IHQ_0"

#

if CfgRadio isn't user defined, I believe it defaults back to this file destination so just list the classname

knotty flame
#

fantastic

#

also one little thing

#

any way to preview some of them

#

?

#

if not its fine

fair drum
#

look in this location
bin\config.bin/CfgRadio

#

im not too familiar with browsing game files though

knotty flame
#

alright, thank you

fair drum
#

actually just start up a editor and go to preview single player after placing a unit

#

open up debug and type

#
player globalRadio "mp_groundsupport_65_chopperdown_BHQ_0"
#

and just replace the string with different ones and hit exec

#

@knotty flame

knotty flame
#

okay, one more thing

#

standby

fair drum
#

or just get cheeky and make your own radio message, thats always fun

knotty flame
fair drum
#

"USS" isn't in the list of CfgHQIdentities. just make a unit and do the normal syntax, just make sure that unit doesn't die

#

unit globalRadio "className"

knotty flame
#

understood

#

let me try

#

@fair drum i still have the same error

#

is there a way to let headquarters entity run this [west,"HQ"] globalRadio "mp_groundsupport_60_uav_IHQ_0" because i have headquarters entity as USS @fair drum

fair drum
knotty flame
#

i have fixed it

#

i just did USS globalRadio "mp_groundsupport_60_uav_IHQ_0";

fair drum
#

yup that works too

knotty flame
#

thank you so much for your time god bless you

harsh vine
#
{
    if (side _x == playerSide ) then {
    _X setVariable ["bluforCash",0,true];};
    } foreach playableUnits;
#

is that even a thing ??

fair drum
#

where are you pulling it from

harsh vine
#

initplayerserver.sqf

hallow mortar
high marsh
#

yeah, almost positive side takes a global args. Whilst playerSide is local.

quasi rover
#

When client call a script which contain diag_log in it. then it goes to the client's report file, not server's report?
If so, I have to use remoteExec for server's report?

hallow mortar
#

almost certainly

ripe sapphire
#

look in this location
bin\config.bin/CfgRadio
@fair drum hi, where can we find this location?

#

im interested to grab some of the voicelines from the campaign

fair drum
#

pulled them all out

ripe sapphire
#

those are from the support missions only tho?

#

found the actual files in the dubbing_f_epa/b/c pbos

fair drum
#

thats all I get for "true" configClasses (configFile >> "CfgRadio")

ripe sapphire
#

hmm ok thanks

fair drum
#

feel free to grab the CfgSounds as well but thats gonna be a pain to sort

ripe sapphire
#

yeah i already found all of the eastwind campaign voice files in the pbos

#

but i'd be convenient to have a list like the one you grabbed for support scenario

ripe sapphire
#

Nvm that, i found the stringtables which has all the filenames and its subtitles so even better lol

fair drum
#

got a linky?

fair drum
#

why does this seem to pass for every unit? no matter what side I kill it runs

antiWarCrime = addMissionEventHandler [
    "EntityKilled",
    {
        params ["_unit","_killer","_instigator","_useEffects"];
        if ((_unit isKindOf "Man") and (side _unit == civilian)) then {
            if (_instigator in allPlayers) then {
                [side _instigator,-1] call BIS_fnc_respawnTickets;
                [format ["%1 has killed a civilian or a surrendered unit! Tickets for %2 have been decreased!",name _instigator,side _instigator]] remoteExec ["systemChat",0];
            };
        };
    }
];
unique sundial
#

because dead units are civilian

fair drum
#

oooh nooo... ugh

unique sundial
fair drum
#

okay side group _unit fixed it, thanks

cosmic lichen
#

Is there a way to check if an object has a cargo inventory? (ammo box, vehicle ...)

winter rose
#

canAdd perhaps?
otherwise, maybe a config check

warm hedge
#

If it has an item, and if not, check via canAdd indeed?

winter rose
#

@cosmic lichen โ†‘

cosmic lichen
#

canAdd, never heard of that ๐Ÿ˜„

#

I thought about config too, but no clue what property defines that

unique sundial
#

Is there a way to check if an object has a cargo inventory? (ammo box, vehicle ...)
everyContainer?

winter rose
#

I believe he wants to check if the object itself can hold anything (soldier vs ammobox)

unique sundial
winter rose
#

@cosmic lichen ```sqf
private _hasStorage = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "maximumLoad") > 0; // should be that

unique sundial
#

@cosmic lichen

private _hasInventory = _obj call {_this in (_this nearSupplies [typeOf _this, 0])};
winter rose
#

but a fuel truck without storage would still appear as having inventory :p

unique sundial
#

It has 10 firstaid kits

#

you can access inventory

winter rose
#

a fuel truck without storage
vanilla fuel assets have storage hopefully
but e.g a Taru container, I am not sure

#

time for a nearContainers maybe ๐Ÿ˜‰

unique sundial
#

taru fuel pod has inventory

winter rose
#

my point is, a fuel/ammo/repair station without inventory would still be listed with your code

unique sundial
#

dunno gimmie example of one and i will check

winter rose
#

(a fuel station perhaps?)

cosmic lichen
#

Thanks for the help. Gonna test it.

ripe sapphire
#

hello, im trying to use BIS_fnc_fireSupport to make a group of arty do a fire mission, but the syntax for that function is for an object only and not a group, should i call a function for each arty piece? or is there a better way? thx

#

would foreach work

winter rose
#

yes

cosmic lichen
#

Yes, he should execute for every unit, or yes, there is a better way ? ๐Ÿ˜„

#

or, yes, forEach would work ๐Ÿ˜›

unique sundial
#

(a fuel station perhaps?)
@winter rose indeed

winter rose
#

@cosmic lichen yes

cosmic lichen
#

troll ๐Ÿ˜›

ripe sapphire
#

using foreach resulted in error generic expression :/

winter rose
#

then use forEach properly? ^^
what's your code

ripe sapphire
#

sorry sir i'm noob

#
[_x,[2713.54,957.866,0],"",100,12,1] spawn BIS_fnc_fireSupport forEach units group arts; 
unique sundial
#

{...} forEach ...

ripe sapphire
#

roger fixing now

#
{[_x,[2713.54,957.866,0],"",100,12,1] spawn BIS_fnc_fireSupport} forEach units group arts;  
#

is there still a mistake

winter rose
#

nope (have you tried it?)

ripe sapphire
#

yes it returned generic error in expression

winter rose
#

what is arts?

ripe sapphire
#

group name

winter rose
#

if it is already a group, group arts won't work

#

so units arts

#

(why you should name it e.g artilleryGroup)

#

@ripe sapphire โ†‘

ripe sapphire
#

ohhh thank you

#

now its no longer returning an error, but the units are not firing :/

{[_x,[2713.54,957.866,0],"12Rnd_230mm_rockets",100,12,1] spawn BIS_fnc_fireSupport} forEach units arts;
#

used on 2 sandstorm MLRS

pale ridge
#

does anyone know if i can put scripts on equipment pieces? or can i only put it on units?

winter rose
#

you can refer to an object yes, such as containers (backpacks, vests, uniforms) @pale ridge

thick merlin
#

Has anyone had any issues with spawning custom groups of ai in the spawnai module?I can get it to work in sp and mp if i host but not if i host the mission on a dedi server/headless client.

versed belfry
#

Does anyone know of any script or way to make a vehicle/aircraft float on water?

thick merlin
#

Try googling it.See what comes up

versed belfry
#

nothing >_>

thick merlin
#

๐Ÿ˜ฆ

versed belfry
#

have been searching all day, I just need some kind of a script to keep the vehicle from starting to sink, all I found is how to do it as a mod and all

#

and that doesn't really help much

thick merlin
#

does it have to move?

#

the vehicle?

winter rose
#

@versed belfry ```sqf
_vehicle enableSimulation false;

#

if it's a boat you want unsinkable, try ```sqf
_boat allowDamage false;

versed belfry
#

yea thought of doing that, tho that makes it risky since the aircraft is landing on water

#

simulation will have to be disabled at a logical point, and it will also cause the vehicle to have no sound

#

not to mention players inside the vehicle will get glitched and won't be able to do anything

winter rose
#

tell us the whole thing you want to do, we can maybe provide a more accurate solution

versed belfry
#

I want to have a plane at the starts in the sky [flying]. [all players are inside that plane] that starts to slowly land on water for them to dismount from it, with the plane floating when the engine is stopped and it not sinking during the landing.

thick merlin
#

fixed wing?

versed belfry
#

yep

#

With damage disabled it should not explode in impact but it will still sink after a second

winter rose
#

attach it to an invisible object maybe

versed belfry
#

was thinking of doing that, the only objects I can think of is some helicopter that can float, will try to test that real quick, cause I am not sure how well it will work.

hallow mortar
#

you can't think of any other objects that can float?

thick merlin
#

is it possible to remove mass via script? a weightless effect.

hallow mortar
versed belfry
#

you can't think of any other objects that can float?
nope ๐Ÿ˜•
maybe an APC or something but that's about it

thick merlin
#

rhib

little raptor
#

A zodiac?

thick merlin
#

yeah

hallow mortar
#

When the aircraft reaches ~5m ASL, spawn an invisible boat directly below it (inside it, if it doesn't cause an explosion) and attach the plane to it.

thick merlin
#

the weight of the plane may sink the boat though

hallow mortar
#

attachTo'd objects do not have weight

little raptor
#

When using attachTo weight doesn't matter

versed belfry
#

When the aircraft reaches ~5m ASL, spawn an invisible boat directly below it (inside it, if it doesn't cause an explosion) and attach the plane to it.
@hallow mortar that could actually work will start testing rn thanks

little raptor
#

@cloud delta Don't use ASL, use ASLW

thick merlin
#

@ripe sapphire, have you named the groupt correctly? artygroup1 = group this;

#

?

versed belfry
#

@hallow mortar could you by any chance help me with how to spawn the invisible boat inside the aircraft and attach it? ๐Ÿ˜…
cause the aircraft will be on the move and I am not sure if when attaching it to the boat it might just lose all its speed and become static, which is not that much of a problem really but a bit weird for the players.

little raptor
#

Spawn it anywhere you want

#

Just make sure you attach it right below the aircraft

#

And use setVelocity so it doesn't lose velocity

versed belfry
#

a'ighty, thanks a lot

hallow mortar
#

@versed belfry createVehicle the boat at 0,0,0 or wherever. Use hideObjectGlobal to make it invisible and intangible. Use getPosASLW and setPosASLW to move it inside of the plane. Use BIS_fnc_attachToRelative to smoothly attach the plane. Yes, down velocity will be lost, but at 5m or less from impact, it should ideally be not very noticeable. You can try using setVelocity to reintroduce velocity but it's a dangerous game to play.

little raptor
#

@versed belfry
Something like this:

[] spawn {
_plane = vehicle player;
waitUntil {getPosASLW _plane select 2 < 5};
isNil { //doing this all in one frame for safety
_boat = createVehicle ["B_Boat_Transport_01_F", [0,0,0]];
//_boat hideObjectGlobal true;
_boat setPosASLW getposASLW _plane;
_boat setVectorDirAndUp [vectorDir _plane, vectorUp _plane];
_boat setVelocity velocity _plane;
_plane attachTo [_boat, [0,0,2] vectorAdd (_boat worldToModel ASLtoAGL getPosASL _plane)];
}
}
versed belfry
#

a'ighty will test it right now actually

hallow mortar
#

I would not recommend using setVectorDirAndUp because the plane may be at an unsafe attitude. Leave the boat upright and use BIS_fnc_attachToRelative instead.

#

And before testing that, change _pps to _pos in line 5.

versed belfry
#

what does this line do exactly? check for the height?

waitUntil {getPosASLW _plane select 2 < 1};```
hallow mortar
#

Yes, checks if the plane is less than 1 metre above the sea

versed belfry
#

oki doki

hallow mortar
#

personally I would give it a little more leeway in case the server is slow, but that's preference I guess

versed belfry
#

if I want it to be 5 meters do I just change 1 to 5 or do I have to change 2 to something else as well?

#

also to make sure where do I place the script?
in the vehicle init? or somewhere else?

hallow mortar
#

Change the 1. The 2 is part of select 2, which is selecting a component of the array returned by getPosASLW

little raptor
#
  • fixed typo
hallow mortar
#

This is best done in a script you call from somewhere before this happens. The vehicle init is not locality safe.

winter rose
#

I would love if they were unavailable in the editor as soon as the mission is marked as MPโ€ฆ

little raptor
#

@versed belfry apparently hiding the boat makes it unable to move

#

Just tested

hallow mortar
#

Inits are still convenient for some basic things where it doesn't really matter / needs to always be done on every client anyway

versed belfry
#

duck

#

if damage is disabled I guess I can just say the boat is "floaters" or whatever as long as the plane floats

hallow mortar
#

That is a fantastically interesting property of hideObjectGlobal

winter rose
#

@hallow mortar rarely convenient, and would prevent plenty of user issues
even I sometimes use them, but I know what I do

#

like good old OFP, a "Basic" and an "Advanced" Editor mode could be the answer hehe

versed belfry
#

got an error when I tried to execute with an action

#

gave an error when I was above 5 meters and when I was below 5 meters

hallow mortar
#

You have to define _plane

#

if you know the variable name of the plane object just use that instead of _plane everywhere it appears in the script

versed belfry
#

done, lets see how it goes now

#

It works ๐Ÿ˜„

#

just need to set the correct position of the boat according to the plane

little raptor
#

test it again

#

I have updated the code

versed belfry
#

a'ighty

little raptor
#

And define

_plane = vehicle player;
#

Also, you should spawn the code

#
  • Updated
versed belfry
#

can't I just replace _plane with P1 if the varbal name for the plane is V1?
thanks a lot guys, this works like magic

little raptor
#

_plane is a variable. You can replace it with any other variable

versed belfry
#

it is PERFECT

#

@little raptor @hallow mortar @winter rose thanks a lot for the help guys.

thick merlin
#

iam using these commands for my spawnai modules but it evidently needs to be pbulic variabled.

#

'''this setVariable[ "side", "Indep", true ];
this setVariable[ "faction", "IS1", true ];'''

#

ive used them before in another mp mission but iam stuck as to how to write this up

winter rose
#

it is public? (the true argument)
a couple of notes though:

  • you could use independent instead of "indep" string
  • if this is in an init fieldโ€ฆ it will be set everytime a user connects
thick merlin
#

ive been advised to use this-

#

Make sure the variables are set globally for multiplayer.

this setVariable[ "side", "Indep", true ];
this setVariable[ "faction", "IS1", true ];

#

they fire locally but on a server nothing happens when i use the init field

winter rose
#

it should though.
then don't use the init field

thick merlin
#

this is what iam going off atm

#

Larrow posted i

#

*it

winter rose
#

oooh, disregard my independent earlier remark.
it is for a BI Module, ok

hallow mortar
#

I'm curious about the use of side and faction as the names of variables, since you're not supposed to be able to have variables with the same names as commands

thick merlin
#

i tried this in a initServer.sqf -

#

spawnai_west setVariable[ "side", "West"];
spawnai_west setVariable[ "faction", "myCustomWestFaction"];
spawnai_east setVariable[ "side", "East"];
spawnai_east setVariable[ "faction", "myCustomEastFaction"];

#

but no good

#

named the modules acordingly

winter rose
#

@hallow mortar in missionNamespace* (afaik?)

thick merlin
#

I'll give it a try now.Thanks.:)

little raptor
#

@winter rose Yes. I think it is also true about the localNameSpace that was added recently

winter rose
#

?

little raptor
#

Also uiNameSpace

winter rose
#

missionNamespace, uiNamespace, parsingNamespace, and each object is its own namespace, as well ๐Ÿ˜‰

#

(& profileNamespace)

little raptor
#

object namespaces are not affected though. You can use player setVar ["side", 1]

thick merlin
#

i thried this in the init of the module -

#

missionNamespace setVariable [ "side", "West" ];
missionNamespace setVariable [ "faction", "myCustomWestFaction" ];

#

but gave an error

little raptor
#

You cant do that

#

That's what we were talking about!

#

Add a tag to it

#

Like

#

missionNamespace setVariable [ "MY_side", "West" ];

winter rose
#

@thick merlin don't touch missionNamespace, only the module itself

thick merlin
#

i missing alot here i think.the bi wike gives this as an example -

#

missionNamespace setVariable ["YourString",3];

little raptor
#

So?

#

What are you trying to do again?! ๐Ÿ˜…

winter rose
#

the variable that is read by the module is on the module itself
the module will not read missionNamespace (as you could have multiple modules with different settings)

little raptor
#

missionNameSpace is like defining a global (and with true flag, public) variable

thick merlin
#

yeah.i get that

#

but i cant see how its supposed to be written

#

ive been advised to set these variables globally to get the module to read it on the server

#

this setVariable[ "side", "Indep", true ];
this setVariable[ "faction", "IS1", true ];

winter rose
#
myObject setVariable ["varName", "varValue", publicOrLocal];
little raptor
#

What you wrote is correct.
this setVariable[ "side", "Indep", true ];
It should work (I mean be read) on each client

thick merlin
#

it doesnt get read evidently

#

in the forums Larrow researched this and found its not getting done correctly

#

so i write this - spawnai_west setVariable ["side", "West", public];

#

?

winter rose
#

should be that yes

thick merlin
#

in my initServer.sqf?

#

or module?

little raptor
#

instead of public you should write true or false

#

It should be set on the module's init (I think)

#

this setVariable ....

thick merlin
#

from bi forums

#

how did you know that?

TBH I have no idea why it works.

The module is flagged as server execution only in the config, and as far down as I have read into the modules functions, maybe 75% of it, I see no reason as to why it would be needed. Also if your setting the variables in the modules init surely every client already has the variables anyway?

Yet when I checked how the variables where being saved by the editor in the mission sqm they are PVed. So I tried it out and it worked ๐Ÿคท

little raptor
#

im reading the topic

thick merlin
#

Larrow was the member

#

ta.thanks

little raptor
#

Ok so what is the problem right now?

thick merlin
#

Iam unsure as how to write it uup so it sends globally

#

ive tried a few ways but no go.:(

little raptor
#

Does it work locally?

thick merlin
#

yep.

#

like a charm

#

but nothing on server

harsh vine
#
    with uiNamespace do {
    my_awesome_progressBar = findDisplay 46 ctrlCreate ["RscProgress", -1];
    my_awesome_progressBar ctrlSetPosition [ 
     0.005 * safezoneW + safezoneX,
     0.962 * safezoneH + safezoneY,
     0.170156 * safezoneW,
     0.033 * safezoneH];
    my_awesome_progressBar ctrlSetBackgroundColor [0, 0, 0, 0.25];
    my_awesome_progressBar ctrlSetTextColor [1,0.804,0,1];
    my_awesome_progressBar progressSetPosition 0;
    my_awesome_progressBar ctrlCommit 0;
    
    _counter = 100;
    for "_i" from 1 to _counter do {
(uiNamespace getVariable "my_awesome_progressBar") progressSetPosition (_i/_counter);

  sleep 0.1; // interval
};
_opforcash = {_X getVariable ["bluforCash",0];} foreach PlayableUnits; //this is what im working with.

//how can i get it to only show the value : for  example if opfor has $1000 and the bar length is $2000 to (full)
//how can i get it, so the bar will stop in the middle so basically  i want the bar length to change depending on the value. 
//10% will show just a little bit 50% in the middle 100% full ๐Ÿ˜‚ 
#

lol sorry guys

little raptor
#

what?!

winter rose
#
private _progressbar = currentMoney / maxMoney;```@harsh vine
little raptor
#

There's no need for *100 though!

#

progress should be between 0 and 1

winter rose
#

fair enough :p

little raptor
#

@thick merlin You can try modifying the module values manually in mission.sqm
Worth a try

thick merlin
#

I have it running now on my server.It was the true value to send it globally.The answer was right in front of me but i couldnt see it.Thanks for your time and patience.:)

vague geode
#

How can I use the phonetic alphabet with kbtalk because in the Community wiki it says that you can use the phonetic alphabet but whenever I try to use it the person just says "Move to point <insert phonetic alphabet letter>".
Is there any way I can just use Alpha, Bravo, Charlie etc. e.g. to make them say a call sign?

https://community.bistudio.com/wiki/Arma_3_Radio_Protocol#Words

thick merlin
#

evryone

little raptor
#

kb talk requires a topic

#

a .bikb file

vague geode
#

I know that but that isn't the problem.

little raptor
#

so what is the problem?

exotic flax
#

problem seems to be; he wants "Alpha", but instead it says "Move to point Alpha"

little raptor
#

There is alpha

vague geode
exotic flax
#

which sounds like you're using the wrong audio files

vague geode
#

I am using the words defined in configfile >> "RadioProtocolENG" >> "Words".

hallow mortar
#

What is the full kbtell command you're using?

little raptor
#

I think the real problem is how you've set up the topic.

winter rose
#

(and did you kbAddTopic, obviously)

vague geode
#

Everything is working as intended (and yes I did kbAddTopic, obviously). All I need is the plain phonetic alphabet.

winter rose
#

"alpha", "bravo" don't work?

harsh vine
#

@winter rose @little raptor omg you guys are the best๐Ÿ˜š ...too bad its not so ez for me ๐Ÿšถ

hallow mortar
#

What is the full kbtell command you're using?

vague geode
#
_senderEntity kbTell [_receiverEntity,"protocol","CSWeaponsFree",["Callsign", {}, "D 8-3", ["delta","eight","three"]],"SIDE"];

/* inside protocol.bikb */
class Sentences
{
    class CSWeaponsFree
    {
        text = "%callsign WeaponsFree";
        speech[] = {%Callsign, WeaponsFree};
        class Arguments
        {
            class Callsign { type = "simple"; };
        };
    };
};

class Arguments{};
class Special{};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university};
winter rose
#

ah, yes
Delta or Alpha etc are "Move to point X"

little raptor
#

A sample:

class Sentences
{

    class Radio
    {
        text = "%1";
        speech[] = {"XMIT","%1"};
        class Arguments {};
    };
};

class Arguments{};
class Special{};
startWithVocal[] = {hour};
startWithConsonant[] = {europe, university};
player kbAddTopic ["Radio", "myradio.bikb"];
player kbTell [player, "Radio", "radio", ["1", {}, "", ["alpha"], true]
#

He's right

winter rose
#

you can make an AI give time ๐Ÿ˜„

vague geode
#

I know that (because that's exactly my problem) but there surely must be a plain phonetic alphabet somewhere, right?

winter rose
#

"Five O'clock, Fifteen",
"Ten, to, Five O'clock"

#

there surely must be a plain phonetic alphabet somewhere, right?
I am nooot suuureโ€ฆ

#

maybe the wiki is incomplete and you can dig CfgWords (ping in #community_wiki so we can update it), but I don't believe so

#

also, Arma 3 coordinates are xxxyyy format

little raptor
#

I just checked. There aren't any alphabets in the game

winter rose
#

and some words don't play ๐Ÿค”
like "and", "one2", etc

vague geode
winter rose
#

I can amend, for sure

little raptor
#

If you're in the mood, you can cut out the alphabet parts and create new words! ๐Ÿ˜Ž

winter rose
#

not sure if it is legal, though ๐Ÿ‘€

little raptor
#

It is for this game though

winter rose
#

still, has to be checked

vague geode
#

But I mean seriously how is there
"Move to point Alpha", "Move to point Bravo", "Move to point Charlie", "Move to point Delta", "Move to point Echo", "Move to point Foxtrot", "Move to point Golf", "Move to point Hotel", "Move to point India", "Move to point Juliet", "Move to point Kilo", "Move to point Iima", "Move to point Mike", "Move to point November", "Move to point Oscar", "Move to point Papa", "Move to point Quebec", "Move to point Romeo", "Move to point Sierra", "Move to point Tango", "Move to point Uniform", "Move to point Victor", "Move to point Whiskey", "Move to point Xray", "Move to point Yankee" and "Move to point Zulu"
but no phonetic alphabet
instead of "Move to point" and the phonetic alphabet?!

little raptor
#

True!

#

Maybe to make it simpler for different languages

#

Some languages may need the noun and modifier to be in reversed order compared to english
E.g instead of point alpha they have alpha point
Just guessing though. This doesn't apply to any of the languages I know!

vague geode
#

The phonetic alphabet is universal. That's the whole point of that thing. ๐Ÿคฃ

little raptor
#

These are callsigns though. And they only apply to American English

#
  • AFAIK
winter rose
#

anyway, that's the state of things

vague geode
#

Is there any way to get the sound files to cut the whole "Move to point" out and is there any way to use those sut files as plain phonetic alphabet?

little raptor
#

You can use playSound

#

add an offset and you're done

#

Although I'm not sure if it works with words

winter rose
#

extracted with```sqf
private _array = configProperties [configFile >> "RadioProtocolENG" >> "Words" >> "Normal"] apply { configName _x };
_array sort true;
_array;

hallow mortar
#

playSound should work with words since the word sound files do exist somewhere in the game files. You've just got to find them.

winter rose
#

playSound will have an offset option in the next patch

#

also, playSound needs a CfgSounds entry, not a RadioProtocolX one

little raptor
#

I didn't know it accepts files too

#

If it does, you're good

winter rose
#

it doesn't
playSound3D does

hallow mortar
#

It does in the sense that you can define whatever sound file you like in description.ext and use that

#

If you're not willing to wait for next patch for the offset parameter, you can extract the word sounds from the game files (or record them), cut them appropriately, and include the resulting clip in the mission. It shouldn't be a dramatic filesize hit since it's, like, 3 seconds long

little raptor
#

@hallow mortar according to @winter rose , it might not be legal

hallow mortar
#

I'm quite confident BI doesn't care

winter rose
#

I am not an expert of copyright or Arma permissions; but always at least check before doing

vague geode
#

@hallow mortar Honestly I wanted to call a ship anyways so I am just going with "Ship 831" now...

winter rose
#

BI not caring is not a reason @hallow mortar.
Only "BI allowing" is.

hallow mortar
#

You aren't distributing anything people don't already have in their own Arma install, and it's not from the encrypted "do not reuse" files

winter rose
#

is it in the "free to use" data pack? if not, DON'T. End of discussion.

vague geode
#

Let's just pray to god that BI will not do that s||tuff|| again in Arma 4...

winter rose
#

That's how copyright works - can't edit it without license or author permission, period

vague geode
#

That's how copyright works - can't edit it without license or author permission, period

Granted I didn't have copyright yet but that sounds pretty much how it works...

hallow mortar
winter rose
#

did you init the leaflets?

hallow mortar
#

The properties of the custom class are defined as required in description.ext. I'm not specifically calling bis_fnc_initLeaflet - the wiki page appears to only describe it in terms of manually applying it to placed leaflets, which isn't what I'm doing, I'm just firing the leaflet bomb from the drone.

ripe sapphire
#

@ripe sapphire, have you named the groupt correctly? artygroup1 = group this;
@thick merlin yes mate, but i think its something the function, i have been getting nothing but weird results with it, i tried using it on a single arty piece named art1, and it fires 1 shot, turns gun down, turns it back up, fires another shot, repeat, and if set the delay to 1 it wont work at all

#

idk whats wrong, switched my method to use doartilleryfire and it worked like a charm so im just using that

#

do you think you can test out that function and see if it works normally?

reef walrus
#

Hola everybody, is anyone aware if there is some sort of eventHandler that fires when manually placing map markers?

winter rose
#

Not yet

reef walrus
#

squints eyes
Please elaborate, @winter rose ๐Ÿ˜„

winter rose
#

iirc, in v2.00 the mission EH will arise ๐Ÿ™‚

reef walrus
#

@winter rose Oh damn, thanks for showing!
Also thanks to @still forum , you're doing god's work once more ๐Ÿ˜„

tough abyss
#

anyone knows if scripts have priorities at all? or is it always round robin?

exotic flax
#

how do you mean? the first script you call will be executed first

#

when using spawn it will run when possible

tough abyss
#

like does scheduler prioritize scripts that don't use up their 3ms window

#

and deprioritize those that tend to take too long

exotic flax
#

I believe the queue is FIFO, although never had any issues with the order since I try to use call at all times, and the moment I need spawn I don't really care about when it runs

#

and as far as the wiki describes it; it will run all scripts in the queue till it reaches the 3ms mark. After that it will wait till the next frame and runs continues the queue (starting with oldest) till the 3ms mark.

tough abyss
#

would be nice if the game automatically demote the scripts that take too long so they don't run too often.. or at least provide a way to manually set priority so i can avoid dumb things like if <fps too low> then sleep 1

exotic flax
#

I guess that is more an issue with how the code is written than an issue with the engine ๐Ÿคทโ€โ™‚๏ธ

#

because if you use sleep, it means you use spawn, which means it's scheduled

little raptor
#

since I try to use call at all times
To correct what you said, using call doesn't necessarily mean that the code will run in the unscheduled environment. (call preserves the current environment and handle, i.e. call {...} means: put {...} here)
if <fps too low> then sleep 1 @tough abyss
Why do you need that though?

winter rose
#

@little raptor Grez' most likely means that by calling scripts he doesn't create any new thread.

@tough abyss the less spawn and threads you have, the better - e.g instead of having one spawn per object, have one spawn that processes every objects

quasi rover
#

If I put profileNamespace setVariable and profileNameSpace getVariable in initPlayerLocal.sqf, the variable and value are stored and get from client's profile?

winter rose
#

yes

quasi rover
#

thx

little raptor
#

That makes me wonder though. Isn't this namespace local to each client? So shouldn't one remote exec this to get the variable?

winter rose
#

it is local to each client, yes

#

I don't think you can public it, but now I wonder ๐Ÿค”

little raptor
#

Was just gonna ask!

winter rose
#

(by setVariable [x, y, true] I mean)

little raptor
#

I think if you public it, it'll be saved to each client's namespace. (although it doesn't make much sense)

still forum
#

would be nice if the game automatically demote the scripts that take too long so they don't run too often..
game gives each script a fair share of runtime, 3ms per frame, once a script ran all other scripts will run first before a script is revisited

unique sundial
#

would be nice if the game automatically demote the scripts that take too long so they don't run too often..
no it wouldn't it would be unpredictable inconsistent mess

little raptor
#

But still, I do understand what he means. A lot of people think that the scheduler has a magical power that enables you to run as many scripts as you want without slowing down the game, without realizing that this will cause other scripts to take longer to finish.
I once tried this mission that had over 100 running loops! And my scripts took several seconds to finish. It was really annoying.

thick merlin
#

@thick merlin yes mate, but i think its something the function, i have been getting nothing but weird results with it, i tried using it on a single arty piece named art1, and it fires 1 shot, turns gun down, turns it back up, fires another shot, repeat, and if set the delay to 1 it wont work at all
@ripe sapphire ,You can send it over and i can take a look.Iam really not good at scripts either bud.I use this for arty.

#

gun9 doArtilleryFire [getmarkerpos "lz1target_1", "32Rnd_155mm_Mo_shells", 5];

#

it makes the guns stay up ,aimed untill its finished the salvo.

#

is that what you use? this code?

ripe sapphire
#

Yeas mate i switched to doartilleryfire

#

Worked like a charm

#

So im guessing its something with the firesupport function

thick merlin
#

yeah prolly.Can you work with that code or it doesnt "work" for what you want?

#

These guys here are talented scripters .I usually come here first for help.:)

ripe sapphire
#

Well i have found the solution by ditching that function and switching to doartilleryfire so all is good

#

Btw guys how do i make a trigger fire only if there is <10 opfor units in the area?

winter rose
#

count thislist < 10 if the trigger is set to OPFOR

#

(counting a vehicle as 1, though)

ripe sapphire
#

Wow, thats easy, thanks lou

#

Should i set it to opfor not present too in the menu?

winter rose
#

OPFOR present

ripe sapphire
#

Roger

vague geode
#

Quick question: If I remoteExec the command _unit sideChat _message; will it only display the message for everyone that has the same side as _unit or will it be displayed to everyone regardless of their side?

winter rose
#

@vague geode remoteExec how?

#

You can choose where to send it

vague geode
#

[_unit, _message] remoteExec ["sideChat",0];

winter rose
#

0 = everyone

vague geode
#

Oh, wait. Never mind. Just saw it...

meowtrash

winter rose
#

So the message will be sent to everyone, but opfor won't see it (but still receive the message)

#

side _unit is doable, iirc

ripe sapphire
#

Isnt the syntax for that
[side, identity] sideChat chatText ?

winter rose
#

only for HQ, otherwise it's the unit itself (see the wiki)

ripe sapphire
#

Ah ok just realized how remoteexec works

#

If we use true for the isPersistent param in a remoteExec, does this mean the script will run for every player who joined after the initial execution of the script ?

winter rose
#

well, yes

tough abyss
#

Hi, guys.
Im getting error: |#| Sleep 4' Error generic error in expression.
Dunno what to do.

Task2_Done=true;
sleep 4;
sokol sideRadio "01r05";
Task3_Assign=true;
PlayerSkipBase=true;

It`s my first time im getting such thing, in my other scripts almost the same type of things works well.

#

It happens with any values of sleep command, i tried it many times.

winter rose
#

you cannot sleep (or waitUntil) in an unscheduled environment

#

you can [] spawn { ... }; if needed

#

@tough abyss โ†‘

tough abyss
#

Well i just want to do some radio samples and mission assigns, why then my previous script works fine with the same thing?

winter rose
#

you didn't run it in an unscheduled environment

#

just wrap it with a [] spawn { }, it's working

tough abyss
#

So i have to do [] spawn "script.sqf"

warm hedge
#

*execVM

tough abyss
#

What is the difference between those ones

winter rose
#

execVM takes a file path, spawn takes Code

warm hedge
#

Basically, you can't call it if you want to use sleep or waitUntil (suspend commands), you need to do spawn or execVM

tough abyss
#

Well. On activation: Type Script expected nothing

warm hedge
#

Put _nil = as prefix. This is magic, there's no thinking needed. Just put

winter rose
#

yep (or 0 = , and I never knew why this would work either)

warm hedge
#

Or null = or whatever. I just prefer _nil because Jay did ๐Ÿ™‚

tough abyss
#

Thanks, guys. These scripts moments sometimes blows my mind...

winter rose
#

(in Triggers, OnAct code is unscheduled indeed)

tough abyss
#

Well, at least once it worked well. It was trigger with addAction that runs script

winter rose
#

as long as you don't sleep, uiSleep or waitUntil there is no issue with code you put in there ๐Ÿ˜‰

tough abyss
#

Thats the problem, because there was a sleep command and not even once but i had no problem ๐Ÿ˜„

winter rose
#

I very much doubt it :p
if the sleep was in the action code itself, no issue at all

tough abyss
#
p1 removeAction 0;
p1 sideRadio "01r00";
Task1_Done=true;
c1 flyinheight 25;
sleep 3.5;```

A small part of it
winter rose
#

(although, now I'm not so sure ๐Ÿค” it's not listed)

#

if directly put in the trigger field, it will throw an error.
if you have a case where it works, please forward ๐Ÿ˜„

#

note,

if the sleep was in the action code itself, no issue at all

tough abyss
#

Ah, i guess if i will use [] exec "script.sqf"; then it'll say error

winter rose
#

0 = [] execVM* "script.sqf"
no issue at all

ripe sapphire
#

Lou, is it possible to make hints appear on the left side of screen instead of right?

#

My hints collide with uav feed

winter rose
#

not easily ^^

ripe sapphire
#

Oof, iโ€™ll just delay the uav feed then lol

winter rose
#

or make shorter hints ๐Ÿ™ƒ

little raptor
#

You'd have to make an RscTitle that shows custom hints

#

It's not really difficult if you know how to make displays

winter rose
#

you can actually move the UAV feed's miniscreen, but that's something to do locally of course ^^

little raptor
#

Yeah that's also possible

#
class MyStctText {
    idc = -1; 
    type = 13;  
    style = 2;         
    colorBackground[] = {0.1,0.1,0.1,0.7};
    x = 0; 
    y = 0; 
    w = 0; 
    h = 0; 
    size = 0.032;
    text = "";
    class Attributes {
        font = "PuristaMedium";
        align = "center";
        valign = "middle";
    };
};
class RscTitles
{
    class myHint
    {
        idd = -1; 
        duration = 5; 
        fadeIn = 0;
        fadeOut = 0;
        onLoad = "uiNamespace setVariable ['MyHint', _this select 0]"; 
        onUnLoad = ""; 
        class Controls
        {
            class hintText: MyStctText
            {
                idc = 1200; 
                x = 0.0 * safezoneW + safezoneX;
                y = 0.170 * safezoneH + safezoneY;
                w = 0.1 * safezoneW;
                h = 0.030 * safezoneH;
            };
        };
    };
};
#
("myHint" call BIS_fnc_rscLayer) cutRsc ["myHint", "PLAIN", -1 , false];

_display = uiNamespace getVariable ["myHint", displayNull];
_ctrl = _display displayCtrl 1200;
_ctrl ctrlSetStructuredText _hint; //ctrlSetText might also be possible (not sure)

You'd have to change its height if your hint is too long

ripe sapphire
#

Do those go in description.ext?

little raptor
#

The first one yes

#

The second one is sqf code

ripe sapphire
#

I forgot to say im using advhint

#

Would that work

little raptor
#

What's that?!

ripe sapphire
#

Its like hints in the campaign which can be expanded

#

Like how to use the UaV

#

Press H to expand

little raptor
#

No

#

It's simply some "overlay" that displays some text

ripe sapphire
#

Ah ok

#

How about moving the UaV feed ?

little raptor
#

What type of feed do you use?

ripe sapphire
#

The one from modules

#

Thermal

#

Live feed

#

Think iโ€™ll just delay the feed after the hint is done, save the trouble lol

little raptor
#

I'm not sure. I can check if you want

winter rose
#

idd 160 according to findDisplay page

little raptor
#

It has so many idcs

#

@winter rose Actually, it is:

uiNamespace getVariable "BIS_fnc_PIP_RscPIP"
#

But it has so many IDCs

#

All I figured out was that IDC 2300 was the main feed

#

Let's offset them all together!

#

@ripe sapphire

_d = uiNamespace getVariable "BIS_fnc_PIP_RscPIP";
_c = _d displayCtrl 2300;

ctrlPosition _c params ["_x0", "_y0"];

_x1 = safeZoneX + 0.01 * safeZoneW;
_y1 = safeZoneY + 0.5 * safeZoneH;

_c ctrlSetPosition [_x1,  _y1];
_c ctrlCommit 0; 
{
    _pos = ctrlPosition _x;
    _x ctrlSetPosition [(_pos#0 - _x0) + _x1, (_pos#1 - _y0) + _y1];
    _x ctrlCommit 0;
} forEach (allControls _d - [_c]);
#

Puts it on the left

ripe sapphire
#

๐Ÿ‘

#

Epic let me boot up my pc

#

Can you increase the size too? Felt like its too small

little raptor
#

I can introduce a resize factor

ripe sapphire
#

That would be amazing

little raptor
#

@ripe sapphire

_d = uiNamespace getVariable "BIS_fnc_PIP_RscPIP";
_c = _d displayCtrl 2300;

ctrlPosition _c params ["_x0", "_y0", "_w", "_h"];

_resizeFactor = 1.5;

_x1 = safeZoneX + 0.01 * safeZoneW;
_y1 = safeZoneY + 0.5 * safeZoneH;

_c ctrlSetPosition [_x1,  _y1, _w * _resizeFactor, _h * _resizeFactor];
_c ctrlCommit 0; 
{
    _pos = ctrlPosition _x;
    _x ctrlSetPosition [(_pos#0 - _x0)* _resizeFactor + _x1, (_pos#1 - _y0)* _resizeFactor + _y1, _pos#2 * _resizeFactor, _pos#3 * _resizeFactor];
    _x ctrlCommit 0;
} forEach (allControls _d - [_c]);
#

Puts it on the left and makes it 50% larger

quaint ivy
#

Does anyone know why vectorDotProduct returns a number instead of a vector

warm hedge
#

Because it does?

winter rose
#

if you want to multiply a vector, use vectorMultiply

quaint ivy
#

Okay I guess I lived my life in a lie and [2,2,2] * [3,3,3] = [6,6,6] is not a vector dot product

winter rose
#

seems not ยฏ\_(ใƒ„)_/ยฏ sorry :(

quaint ivy
#

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

little raptor
#

there's no such thing! xD

winter rose
#

Matrix multiply, more or less

little raptor
#

[2,2,2] * [3,3,3] = [6,6,6]
I mean this ๐Ÿ˜„
If you transposed the matrix it would make sense tho (altho it still gives scaler)

quaint ivy
#

yeah thats not a defined operation

little raptor
#

You can use vectorMultiply thou

#

[2,2,2] vectorMultiply 3 gives you [6,6,6]

quaint ivy
#

no, I dont need vectorMultiply. I did it with select but i was confused

#

thats just the scalar product

warm hedge
#

Maybe you're looking for matrixMultiply? I'm not a math guy and never touched with it so I might saying smth wrong

quaint ivy
#

no, the operation that i did is not defined in maths

#

but thanks anyway, at least you guys made me figure out that i was wrong

warm hedge
#

Stupid workaround came to my brain if I read your goal correctly:sqf _ary1 = [2,2,2]; _ary2 = [3,3,3]; { _ary1 set [_forEachIndex,_x*(_ary2#_forEachIndex)]; } forEach _ary1;

quaint ivy
#

yeah that is it, i did something similar

little raptor
#

no, the operation that i did is not defined in maths
Every operation is defined in math
You're scaling a matrix so this is what you wanted to do:

[[3,0,0],[0,3,0],[0,0,3]] matrixMultiply [[2],[2],[2]]
#

It looks a bit awkward in arma but still this is what it was essentially

quaint ivy
#

you cant multiply an AxB dimension matrix with a CxD matrix unless B=C. That's just a complicated solution for a simple problem that I had.

little raptor
#

Look again

quaint ivy
#

no i know

little raptor
#

That's a 3x3 * 3x1

quaint ivy
#

you did what i needed but there is a much simpler solution

little raptor
#

I was just saying what you say is wrong. You can do everything in math. You just need to know what you're looking for.

quaint ivy
#

i didnt say you cant do it, only that the operation is undefined. ๐Ÿ˜›

thorn cape
#

How create players spawn inside vehicle in MP? For spawns I use markers.

winter rose
#

I believe you have to script this

#

on respawn:

_unit moveInCargo _vehicle```
#

@thorn cape ^

obtuse quiver
#

hey guys, ["\A3\ui_f\data\map\markers\nato\n_inf.paa",[0,0.3,0.6,1],group_2,1,1,0,""]
i need to change the color to ind green but i don't know the value

#

[0,0.3,0.6,1] this is the color part

thorn cape
#

on respawn:

_unit moveInCargo _vehicle```

@winter rose yes, I know this command, but I use several spawn markers(not modules): respawn_guer_1, respawn_guer_2.

If it possible to make check If player use respawn_guer_1, and after this exec _unit moveInCargo _vehicle

winter rose
#

Why not: not using markers, and directly selectRandom vehicles?

little raptor
#

@obtuse quiver Use an RGB color picker or something

winter rose
#

@little raptorโ€ฆhe doesn't know the value ^^"

little raptor
#

google this:
rgb color picker

obtuse quiver
#

i think it's white white red green blue white?

winter rose
#

R, G, B, Alpha

hallow mortar
#

what weird marker command is this that doesn't accept the ordinary CfgMarkers and CfgMarkerColors references?

winter rose
#

@little raptor he does not know the independent green colour values

hallow mortar