#arma3_scripting
1 messages ยท Page 616 of 1
U2! ๐ต
and as I said, the channel is here for that so no worries if you get stuck, we got your back 

Is it ok if I ask a question about scripting with ACE 3 here?
it's OK, but you are not guaranteed to have an (accurate) answer. ACE has its own slack (see #channel_invites_list)
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.
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.
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;
};
I remember using it, need to find that again
provided before you ask, of course ๐
Not qualified to answer, but I think you can use the execute code module
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
you might need to use variable names instead of this
thats what I did aswell to make it work
I thought I tried that, let me re do
ok yea
that worked~
I must have mistyped it the first time
@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
correct
you can do a hacklaptop1 = _container to reassign it
and if you want this variable to be valid to all players, publicVariable "hacklaptop1";
That works ty, should I put publicvariable after I reassign it?
hacklaptop1 = _container;
publicVariable "hacklaptop1";
like this?
purrfect
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
remove weapon?
since a player does it, I can't really remove their weapon
Give it back to them when the animation finishes!
would it keep attachments? and how would I go about that anyways/
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!
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?
unit setVariable ["MILK_weapon", primaryWeapon unit];```
same :p but I want to finish something
I'll stop bothering (atleast until tomorrow :P) have a good night ๐
see ya! ๐

you younglings have it easy! back in my days (โฆ)
you had to walk 15 miles in the snow to school?
so AI in attack helicopters from CUP or RHS just don't shoot at anything?
_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 ๐
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?
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)
_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 ๐
Another function in this too: ExileClient_gui_toaster_addToast
All these functions are called frequently by the mod (Exile) and never caused such issues
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?
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
Doubt any of that is causing server lag
I remove it, the rest is unchanged and no mass lag / mass kicks.
For how long?
multiple days
i spent like 100 hours to debug script by script, addon by addon.
Idk. I'd wait more to see. We had some days with no server lag
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.
Was that the only stuff you removed?
yes
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
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
I don't think so. And even if there was, how would you debug your code?!
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
Sadly, there's no such app. Not even for Android.
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?? ๐
make it a CfgFunctions, and remoteExec it ๐
that's the only way - you cannot manipulate local variables from an external pov
is it possible to allowDamage false; to slingload rope??
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
Coding on Android actually is possible using vscode and one of the plenty Linux apps
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
For explosions you can also use https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Explosion
which is precisely why you would want to check if isServer then {}.
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
Correct! Init fields are ebol
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
Post your format
{format ['%1-%2', name _x, lifeState _x]} forEach FL;
And this supposed to do what? I don't see this does something
I tried nesting it into a hint but I was working on that part when I sent it
Post the entire. The code itself supposed to do nothing with it
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[]
This is simply illegal. hint does take no code
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
Once again, this does what? Describe all of variables?
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
if you post code, please use meaningful variable names.
{
hint format ['%1-%2', name _x, alive _x];
} forEach FL;
And the hint shows all units' status?
Also you can do something like
allOfYourUnits select {alive _x};
@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
No problem. That's why ppl are here
@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
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
@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
That's actually the step I took years before! ๐
@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.
@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
just out of interest, does sqf have a way to multithread?
@strange seal You could try to get the avergage health with damage _unit;
@spark turret of course not. that would be an absolute security disaster
why is that?
how many SQF scripters do you think could write threadsafe code, even if it were possible to do so?
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
ah i though security in terms of trojans etc
yeah man its not like i need access to multiple threads to kill the game
next thing you know: Arma C++
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
^^ any kind of low level access a scripter has is terrible
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.
Yes, but thats within script limitations
you have to purpousely enable a malicious script
denial of service isn't as bad as a RE vulnerability
having low level access just allows anyone to bsod your PC
bsod is still a good outcome
- not to mention its through the vessel of arma 3
they could also quietly attach your PC into a botnet
so it just makes BI untrusted if that shit becomes the norm
interesting
multithreading is a new concept to me and i already wondered why so few games do it
its why games with modding make their own/use scripting languages
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)
^
lots of games use multiple threads, they just don't let untrusted scripts do it
and SQF is always untrusted
and SQF is always untrusted
even when made by BI ๐คฃ
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
well it's no different in SQF
SQF is also limited to the commands BI has given you
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
@tough abyss Language
right
Also getting off topic here
although since BI uses SQF as well for all their own programming, it has everything they use
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?
you need to get the variable first
hackerman1 removePrimaryWeaponItem (hackerman1 getVariable ["HackermanWeapon", ""]);
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
Are you sure you want to remove the primaryWeaponITEM or just the primaryWEAPON?
ok wew wiki lied to me
Because you are trying to remove the primary weapon with a command which is used to remove the item ๐
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
it's primary, secondary (launcher) and handgun (Don't ask me who though of the naming ๐ )
@cosmic lichen one problem though, it doesn't return the weapon with attachments
any way to save those aswell?
Right, I'm gonna have a look at this, thank you ๐
so there's this function, and it seems to be only available to cargo?
https://community.bistudio.com/wiki/addWeaponWithAttachmentsCargo
does a primary slot count as cargo?
Adds a weapon into cargo space of a vehicle / box with given attachments / magazines.
@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";
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!
@tough abyss please read the examples of setVariable and getVariable. You are not using it correctly
right, thank you
{ hackerman1 addWeaponWithAttachmentsCargo [_x, 1] } forEach (hackerman1 getVariable ["allweaponstest", ""]);
is this correct?
because it doesn't work for some reason
_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?
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*
Looks like I gonna need to put that on a loop.
wait, it's a curator camera
can't you restrict these to areas?
maxPitch and minPitch have no effect
See https://community.bistudio.com/wiki/Category:Command_Group:_Curator:
addCuratorCameraArea
setCuratorCameraAreaCeiling
myCurator if for zeus right?
@thorn cape
this isn't working for you?
synchronizeObjectsAddis 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
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");
}];
};
};
aren't ACE EH scripted EHs @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.
BIS_fnc_addScriptedEventHandler perhapsโฆ
addEventHandler are engine handlers, I don't think ACE has access to that
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");
}];
};
};```
โฆno
Like I said, amateur.
did you look at the link i sent at all?
That's where I got [ace_arsenal_displayClosed] call CBA_fnc_addEventHandler
if you fully read the page, you'd have understood that what you're doing is wrong and won't work
how can i address terrain objects like "1d590150100# 12261: qalat.p3d" ?
i want to detect its destruction.
nearestTerrainObjects iirc
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.
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
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
@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.]
I don't know much about that I'm afraid.
is there a way to check if a script is working / loaded?
depends on what you want to check / how you call it
well i am trying to load a sqf from a mod, can i see it in the function tab in editor/zeus?
you can see it, but you could use diag_* commands to count threads
i can see the headline, but no code in it, probs forgot something ๐ค
diag activeScripts
diag activeSQFScripts
diag activeSQSScripts
How delete "Respawn vehicle module" by trigger?
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?
Unsure if you can
Try playing with Locations @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
what is the command that makes a number a negative number?
unary minus ...?
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??
Could easily realize Real threading using sqf-vm ๐ค๐ค though... Interactions with the game would be troublesome
Q: is there a (hidden) command/function like ctrlTextHeight, but working for CT_HTML (or RscHTML)?
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...
why not simply use _unit setUnconscious true and ignore AIS (unless they check for that value)
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
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;
string comparison requires isEqualTo. != doesn't work.
Did that used to be the case?
Supposed to
!= not working was never the case.
Quite sure != was there before isEqualTo was
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).
the alternative Syntax for this command does not work, what's wrong? even the example 4 does not work.
https://community.bistudio.com/wiki/selectionNames
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.
Builds with odd minor versions are dev builds (1.99, 2.01, etc)
@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
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!!
Use a dummy object, then delete it
See the second example : https://community.bistudio.com/wiki/say3D
Why don't you define it in cfgMusic and use playMusic instead? It can be stopped too.
You can click on the command to see what it is.
Arma has several types of positions:
https://community.bistudio.com/wiki/Position
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.
@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)
createVehicle, setVectorDirAndUp or setDir/setVectorUp, setVelocityModelSpace ๐
thanks, do i use Weapon_launch_RPG7_F for the createvhicle?
_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
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
https://community.bistudio.com/wiki/Arma_3_CfgMagazines for a complete list ๐
Or in-game config viewer
ahhh ok i foind it, thanks!
Oh. Sorry
np ^^
Class Name Inventory description Ammo Used by
Or in-game config viewer
@warm hedge
@ripe sapphire That's where I found it.
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
got it thanks!
@ripe sapphire like this: https://discordapp.com/channels/105462288051380224/329978448938532868/751785916841984040
i tried the script too it works!
is there a way to offset it to make it a near miss tho?
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.
Does anyone know any good scripts for random loot spawns? Please @ me.
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
You've probably forgot to update a variable
the first one i think achieved the effect im looking for though
Make sure all variables are correct
the xyz variables are they in meters?
yes
I did test it myself and it works
is possible to do 0.1 as a x variable?
how low can we go
hmm perhaps i set the helicopter too near?
_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);
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
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
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
@still forum Does difficulty of exploitation really matter? I would only care about the worst case personally. Broken is broken.
@ripe sapphire see the new code
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
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
That's a dozen too many then. I would not be willing to ship that personally.
@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
ok, is the sound path found using config viewer too?
Do you want the firing sound?
sound[] = {"A3\Sounds_F\weapons\Launcher\rocket_launcher_5",1,1,800};
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?
yes
wooo epic it works, perfect!
one last thing, does random 1 returns any number between 0 and 1?
yes
thanks a lot @little raptor ! cant wait for your super AI mod! ๐
@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
Got it, thanks
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.
Post your code?
addMissionEventHandler ["Draw3D", {
drawIcon3D ["mwd\sfx\icon_dog.pac", [1,1,1,1], ASLToAGL getPosASL cursorTarget, 1, 1, 45, "Target", 1, 0.05, "TahomaB"];
}];
.pac?
anyways, is the texture inside mission?
if so you need to provide full mission path, mission root + texture path, look at https://community.bistudio.com/wiki/getMissionPath
Ah, yeah I was using relative path ๐
Also .pac works just fine if you were wondering
yea, not as usual for me ๐
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.
Are you sure it is alive and known to the datalink for the entire flight duration?
you might want to take a look at how ZEN is handling VLS fire missions: https://github.com/zen-mod/ZEN/blob/master/addons/common/functions/fnc_fireVLS.sqf
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.
Hi guys, I have never attempting scripting before, just installing mods and such, but I am trying to set this up on a KP Liberation and have 0 idea what I am doing. I was wondering if anyone could give me some direction;
https://forums.bohemia.net/forums/topic/173952-soldier-tracker-map-and-gps-icons/
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?
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 ๐
@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)
so this will work only as long as there is only uniform on?
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.
@tired sigil Check the provided GitHub link, it has clear instructions how to start the script
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...
Put the script in you mission folder and then:
In initPlayerLocal.sqf
[] execVM "QS_icons.sqf";
Anywhere in the mission folder?
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";
I'm not seeing initPlayerLocal.sqf anywhere hmmm
You could always create one if your mission doesn't have it ๐
idk where to even look
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?
Yep
Assuming the script works ofc, won't guarantee that. Its pretty old
Yeah last updated feb 2018, fingers crossed.
Unless you are familiar with something similar that's updated
Well seems to be working actually, thanks again for your help!
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
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.
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.
SogetPylonMagazinesalready 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)
I will try to work with that, I was afraid that at some point the array could get mixed depending on the mod.
Anyone knows how to avoid a dialog to close with the ECS key and only if you press one of the buttons?
did you check the forums?
https://forums.bohemia.net/forums/topic/211570-disable-esc-button-in-dialog/
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.
is it on purpose that music stops playing once I exit a vehicle if I started the music while I was in the vic?
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
@little raptor hey thanks alot, it kinda works but i will be messing around with it.๐
@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.
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.
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?
drop only creates one droplet @quaint ivy.
if you want to stop this, stop your looping script
I would recommend using particle sources though
@winter rose Thanks, can you give me a reference to particle sources? I have no idea how to do it, just experimenting atm
Sure, see https://community.bistudio.com/wiki/Particles_Tutorial ๐
(the wiki is a bit slow today, it's its day off)
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
@tough abyss So far so good, no issues yet. Awesome work as usual, wish I found this sooner!
hey there, is there a way to use createSoundSource locally? I'd like to avoid using a custom script with a looping say3D :/
createVehicleLocal + "#dynamicsound" ?
could you explain a little more? I'm not familiar with that ๐
yeah i know, but how do i get that dynamicsound object to play a sound? ๐
so looping say3D is currently the only way to get a local environment sound on a server?
โฆon a client, no? ๐ค
sry with server i meant a multiplayer environment, my bad
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?
afaik, yes
thanks
I'm still stuck on custom leaflets as described here https://discordapp.com/channels/105462288051380224/105462984087728128/751645551434530919
How can I make Radio Message ONLY play when trigger is activated? Screenshot: https://prnt.sc/ucnlnk
did you sync it?
@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.
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
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.
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?
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 ^
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
Basically I was a specific sound to play on radio by "HQ" when the player activates trigger.
All I'm asking for.
//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"
@fair drum How can I locate radio sounds that are already in game?
ah so you want the ingame ones, not custom ones, my bad
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.
standby
@knotty flame
https://sqfbin.com/bojoduwijipubekixafi
have fun. be sure to make it a string when you select one of them
[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
fantastic
also one little thing
any way to preview some of them
?
if not its fine
look in this location
bin\config.bin/CfgRadio
im not too familiar with browsing game files though
alright, thank you
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
or just get cheeky and make your own radio message, thats always fun
@fair drum screenshot: https://prnt.sc/ucpd6p
"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"
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
https://streamable.com/6lg993
@knotty flame
yup that works too
thank you so much for your time god bless you
{
if (side _x == playerSide ) then {
_X setVariable ["bluforCash",0,true];};
} foreach playableUnits;
is that even a thing ??
where are you pulling it from
initplayerserver.sqf
instead of playerSide which probably means nothing in a server-executed script, try (side _playerUnit) using the playerUnit param available in initPlayerServer.sqf. See: https://community.bistudio.com/wiki/Event_Scripts#initPlayerServer.sqf
yeah, almost positive side takes a global args. Whilst playerSide is local.
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?
almost certainly
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
those are from the support missions only tho?
found the actual files in the dubbing_f_epa/b/c pbos
thats all I get for "true" configClasses (configFile >> "CfgRadio")
hmm ok thanks
feel free to grab the CfgSounds as well but thats gonna be a pain to sort
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
Nvm that, i found the stringtables which has all the filenames and its subtitles so even better lol
got a linky?
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];
};
};
}
];
because dead units are civilian
oooh nooo... ugh
https://community.bistudio.com/wiki/side explained here
okay side group _unit fixed it, thanks
Is there a way to check if an object has a cargo inventory? (ammo box, vehicle ...)
canAdd perhaps?
otherwise, maybe a config check
If it has an item, and if not, check via canAdd indeed?
@cosmic lichen โ
canAdd, never heard of that ๐
I thought about config too, but no clue what property defines that
Is there a way to check if an object has a cargo inventory? (ammo box, vehicle ...)
everyContainer?
I believe he wants to check if the object itself can hold anything (soldier vs ammobox)
@cosmic lichen ```sqf
private _hasStorage = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "maximumLoad") > 0; // should be that
@cosmic lichen
private _hasInventory = _obj call {_this in (_this nearSupplies [typeOf _this, 0])};
but a fuel truck without storage would still appear as having inventory :p
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 ๐
taru fuel pod has inventory
my point is, a fuel/ammo/repair station without inventory would still be listed with your code
dunno gimmie example of one and i will check
(a fuel station perhaps?)
Thanks for the help. Gonna test it.
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
yes
Yes, he should execute for every unit, or yes, there is a better way ? ๐
or, yes, forEach would work ๐
(a fuel station perhaps?)
@winter rose indeed
@cosmic lichen yes
troll ๐
using foreach resulted in error generic expression :/
then use forEach properly? ^^
what's your code
sorry sir i'm noob
[_x,[2713.54,957.866,0],"",100,12,1] spawn BIS_fnc_fireSupport forEach units group arts;
{...} forEach ...
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
nope (have you tried it?)
yes it returned generic error in expression
what is arts?
group name
if it is already a group, group arts won't work
so units arts
(why you should name it e.g artilleryGroup)
@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
does anyone know if i can put scripts on equipment pieces? or can i only put it on units?
you can refer to an object yes, such as containers (backpacks, vests, uniforms) @pale ridge
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.
Does anyone know of any script or way to make a vehicle/aircraft float on water?
Try googling it.See what comes up
nothing >_>
๐ฆ
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
@versed belfry ```sqf
_vehicle enableSimulation false;
if it's a boat you want unsinkable, try ```sqf
_boat allowDamage false;
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
tell us the whole thing you want to do, we can maybe provide a more accurate solution
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.
fixed wing?
yep
With damage disabled it should not explode in impact but it will still sink after a second
attach it to an invisible object maybe
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.
you can't think of any other objects that can float?
is it possible to remove mass via script? a weightless effect.
you can't think of any other objects that can float?
nope ๐
maybe an APC or something but that's about it
rhib
A zodiac?
yeah
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.
the weight of the plane may sink the boat though
attachTo'd objects do not have weight
When using attachTo weight doesn't matter
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
@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.
Spawn it anywhere you want
Just make sure you attach it right below the aircraft
And use setVelocity so it doesn't lose velocity
a'ighty, thanks a lot
@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.
@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)];
}
}
a'ighty will test it right now actually
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.
what does this line do exactly? check for the height?
waitUntil {getPosASLW _plane select 2 < 1};```
Yes, checks if the plane is less than 1 metre above the sea
oki doki
personally I would give it a little more leeway in case the server is slow, but that's preference I guess
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?
Change the 1. The 2 is part of select 2, which is selecting a component of the array returned by getPosASLW
- fixed typo
This is best done in a script you call from somewhere before this happens. The vehicle init is not locality safe.
I would love if they were unavailable in the editor as soon as the mission is marked as MPโฆ
Inits are still convenient for some basic things where it doesn't really matter / needs to always be done on every client anyway
duck
if damage is disabled I guess I can just say the boat is "floaters" or whatever as long as the plane floats
That is a fantastically interesting property of hideObjectGlobal
@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
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
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
done, lets see how it goes now
It works ๐
just need to set the correct position of the boat according to the plane
a'ighty
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
_plane is a variable. You can replace it with any other variable
it is PERFECT
@little raptor @hallow mortar @winter rose thanks a lot for the help guys.
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
it is public? (the true argument)
a couple of notes though:
- you could use
independentinstead of "indep" string - if this is in an init fieldโฆ it will be set everytime a user connects
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
it should though.
then don't use the init field
oooh, disregard my independent earlier remark.
it is for a BI Module, ok
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
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
@hallow mortar in missionNamespace* (afaik?)
I'll give it a try now.Thanks.:)
@winter rose Yes. I think it is also true about the localNameSpace that was added recently
?
Also uiNameSpace
missionNamespace, uiNamespace, parsingNamespace, and each object is its own namespace, as well ๐
(& profileNamespace)
object namespaces are not affected though. You can use player setVar ["side", 1]
i thried this in the init of the module -
missionNamespace setVariable [ "side", "West" ];
missionNamespace setVariable [ "faction", "myCustomWestFaction" ];
but gave an error
You cant do that
That's what we were talking about!
Add a tag to it
Like
missionNamespace setVariable [ "MY_side", "West" ];
@thick merlin don't touch missionNamespace, only the module itself
i missing alot here i think.the bi wike gives this as an example -
missionNamespace setVariable ["YourString",3];
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)
missionNameSpace is like defining a global (and with true flag, public) variable
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 ];
myObject setVariable ["varName", "varValue", publicOrLocal];
What you wrote is correct.
this setVariable[ "side", "Indep", true ];
It should work (I mean be read) on each client
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];
?
should be that yes
instead of public you should write true or false
It should be set on the module's init (I think)
this setVariable ....
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 ๐คท
im reading the topic
Ok so what is the problem right now?
Iam unsure as how to write it uup so it sends globally
ive tried a few ways but no go.:(
Does it work locally?
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
what?!
private _progressbar = currentMoney / maxMoney;```@harsh vine
fair enough :p
@thick merlin You can try modifying the module values manually in mission.sqm
Worth a try
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.:)
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
evryone
I know that but that isn't the problem.
so what is the problem?
problem seems to be; he wants "Alpha", but instead it says "Move to point Alpha"
There is alpha
I have a .bikb-file and am trying to submit a callsign as an argument as seen in the link below (and above). The problem is that I need the plain phonetic alphabet letter. There surely is a way to do that...
https://community.bistudio.com/wiki/Conversations#.bikb_advanced_example
which sounds like you're using the wrong audio files
I am using the words defined in configfile >> "RadioProtocolENG" >> "Words".
What is the full kbtell command you're using?
I think the real problem is how you've set up the topic.
(and did you kbAddTopic, obviously)
Everything is working as intended (and yes I did kbAddTopic, obviously). All I need is the plain phonetic alphabet.
"alpha", "bravo" don't work?
@winter rose @little raptor omg you guys are the best๐ ...too bad its not so ez for me ๐ถ
What is the full kbtell command you're using?
_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};
ah, yes
Delta or Alpha etc are "Move to point X"
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
you can make an AI give time ๐
I know that (because that's exactly my problem) but there surely must be a plain phonetic alphabet somewhere, right?
"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
I just checked. There aren't any alphabets in the game
and some words don't play ๐ค
like "and", "one2", etc
@winter rose Ok, then maybe you should remove or change it here because it's really misleading...
https://community.bistudio.com/wiki/Arma_3_Radio_Protocol#Words
I can amend, for sure
If you're in the mood, you can cut out the alphabet parts and create new words! ๐
not sure if it is legal, though ๐
It is for this game though
still, has to be checked
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?!
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!
The phonetic alphabet is universal. That's the whole point of that thing. ๐คฃ
anyway, that's the state of things
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?
You can use playSound
add an offset and you're done
Although I'm not sure if it works with words
extracted with```sqf
private _array = configProperties [configFile >> "RadioProtocolENG" >> "Words" >> "Normal"] apply { configName _x };
_array sort true;
_array;
playSound should work with words since the word sound files do exist somewhere in the game files. You've just got to find them.
playSound will have an offset option in the next patch
also, playSound needs a CfgSounds entry, not a RadioProtocolX one
it doesn't
playSound3D does
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
@hallow mortar according to @winter rose , it might not be legal
I'm quite confident BI doesn't care
I am not an expert of copyright or Arma permissions; but always at least check before doing
@hallow mortar Honestly I wanted to call a ship anyways so I am just going with "Ship 831" now...
BI not caring is not a reason @hallow mortar.
Only "BI allowing" is.
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
is it in the "free to use" data pack? if not, DON'T. End of discussion.
Let's just pray to god that BI will not do that s||tuff|| again in Arma 4...
That's how copyright works - can't edit it without license or author permission, period
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...
anyway I still haven't figured out the problem with the custom leaflets https://discordapp.com/channels/105462288051380224/105462984087728128/751645551434530919
did you init the leaflets?
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, 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?
Hola everybody, is anyone aware if there is some sort of eventHandler that fires when manually placing map markers?
Not yet
squints eyes
Please elaborate, @winter rose ๐
@winter rose Oh damn, thanks for showing!
Also thanks to @still forum , you're doing god's work once more ๐
anyone knows if scripts have priorities at all? or is it always round robin?
how do you mean? the first script you call will be executed first
when using spawn it will run when possible
like does scheduler prioritize scripts that don't use up their 3ms window
and deprioritize those that tend to take too long
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.
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
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
since I try to use call at all times
To correct what you said, usingcalldoesn't necessarily mean that the code will run in the unscheduled environment. (callpreserves 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?
@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
If I put profileNamespace setVariable and profileNameSpace getVariable in initPlayerLocal.sqf, the variable and value are stored and get from client's profile?
yes
thx
That makes me wonder though. Isn't this namespace local to each client? So shouldn't one remote exec this to get the variable?
it is local to each client, yes
I don't think you can public it, but now I wonder ๐ค
Was just gonna ask!
(by setVariable [x, y, true] I mean)
I think if you public it, it'll be saved to each client's namespace. (although it doesn't make much sense)
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
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
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 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?
Yeas mate i switched to doartilleryfire
Worked like a charm
So im guessing its something with the firesupport function
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.:)
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?
count thislist < 10 if the trigger is set to OPFOR
(counting a vehicle as 1, though)
OPFOR present
Roger
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?
[_unit, _message] remoteExec ["sideChat",0];
0 = everyone
Oh, wait. Never mind. Just saw it...

So the message will be sent to everyone, but opfor won't see it (but still receive the message)
side _unit is doable, iirc
Isnt the syntax for that
[side, identity] sideChat chatText ?
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 ?
well, yes
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.
you cannot sleep (or waitUntil) in an unscheduled environment
you can [] spawn { ... }; if needed
@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?
you didn't run it in an unscheduled environment
just wrap it with a [] spawn { }, it's working
So i have to do [] spawn "script.sqf"
*execVM
What is the difference between those ones
Basically, you can't call it if you want to use sleep or waitUntil (suspend commands), you need to do spawn or execVM
Well. On activation: Type Script expected nothing
Put _nil = as prefix. This is magic, there's no thinking needed. Just put
yep (or 0 = , and I never knew why this would work either)
Or null = or whatever. I just prefer _nil because Jay did ๐
Thanks, guys. These scripts moments sometimes blows my mind...
(in Triggers, OnAct code is unscheduled indeed)
Well, at least once it worked well. It was trigger with addAction that runs script
as long as you don't sleep, uiSleep or waitUntil there is no issue with code you put in there ๐
Thats the problem, because there was a sleep command and not even once but i had no problem ๐
I very much doubt it :p
if the sleep was in the action code itself, no issue at all
p1 removeAction 0;
p1 sideRadio "01r00";
Task1_Done=true;
c1 flyinheight 25;
sleep 3.5;```
A small part of it
(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
sleepwas in the action code itself, no issue at all
Ah, i guess if i will use [] exec "script.sqf"; then it'll say error
0 = [] execVM* "script.sqf"
no issue at all
Lou, is it possible to make hints appear on the left side of screen instead of right?
My hints collide with uav feed
not easily ^^
Oof, iโll just delay the uav feed then lol
or make shorter hints ๐
You'd have to make an RscTitle that shows custom hints
It's not really difficult if you know how to make displays
you can actually move the UAV feed's miniscreen, but that's something to do locally of course ^^
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
Do those go in description.ext?
What's that?!
Its like hints in the campaign which can be expanded
Like how to use the UaV
Press H to expand
What type of feed do you use?
The one from modules
Thermal
Live feed
Think iโll just delay the feed after the hint is done, save the trouble lol
I'm not sure. I can check if you want
idd 160 according to findDisplay page
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
๐
Epic let me boot up my pc
Can you increase the size too? Felt like its too small
I can introduce a resize factor
That would be amazing
@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
Does anyone know why vectorDotProduct returns a number instead of a vector
Because it does?
because this is apparently what is supposed to be a dot product @quaint ivy:
https://en.wikipedia.org/wiki/Dot_product
(I am no vector expert, far from that)
if you want to multiply a vector, use vectorMultiply
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
seems not ยฏ\_(ใ)_/ยฏ sorry :(
ยฏ_(ใ)_/ยฏ
there's no such thing! xD
Matrix multiply, more or less
[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)
yeah thats not a defined operation
no, I dont need vectorMultiply. I did it with select but i was confused
thats just the scalar product
Maybe you're looking for matrixMultiply? I'm not a math guy and never touched with it so I might saying smth wrong
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
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;
yeah that is it, i did something similar
no, the operation that i did is not defined in maths
Every operation is defined in math
You'rescalinga 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
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.
Look again
no i know
That's a 3x3 * 3x1
you did what i needed but there is a much simpler solution
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.
i didnt say you cant do it, only that the operation is undefined. ๐
How create players spawn inside vehicle in MP? For spawns I use markers.
I believe you have to script this
on respawn:
_unit moveInCargo _vehicle```
@thorn cape ^
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
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
Why not: not using markers, and directly selectRandom vehicles?
@obtuse quiver Use an RGB color picker or something
@little raptorโฆhe doesn't know the value ^^"
google this:
rgb color picker
i think it's white white red green blue white?
R, G, B, Alpha
what weird marker command is this that doesn't accept the ordinary CfgMarkers and CfgMarkerColors references?
@little raptor he does not know the independent green colour values
here are the marker colours you need: https://community.bistudio.com/wiki/CfgMarkerColors_Arma_3