#arma3_scripting
1 messages ยท Page 214 of 1
Not very convenient.
Let me check... But looks exactly what I need.
ok cool
Use getRelPos instead of bis_fnc_relPos
https://community.bistudio.com/wiki/getPos Syntax 3 ?
Expansion: same as getRelPos except it returns AGLS rather than AGL
ya all good ๐
how to wright that @hallow mortar
I imagine if you read the documentation it might tell you
oh shit ok lol
This is wrong for other reasons too, but one quickly identifiable way it's wrong is that there are no commands with only a left argument. Commands that only have one argument (unary commands) always have it on the right.
Please read the first 7 words of my previous message, and all of the message before that
Every command page includes a Syntax section, which clearly lays out the position and type of the required arguments. For some commands it can be complicated because they have many arguments in nested arrays.
getRelPos is not one of those commands. Its Syntax section is quite simple. There are a total of 3 arguments, all with very clear names.
oh i see now ok
@modern plank sorry, I was slightly wrong here. getRelPos has other differences from the getPos alt syntax. It can only work with an object as reference, not a position, and it uses a relative bearing rather than absolute. Those are probably more important differences than the slight difference in return format :U I apologise for getting that wrong.
i was thinking that: but what do i know ๐
no issues, what I want is functions to search in the wiki, you gave me nice pointers ๐
@pallid palm did you manage to make heli transport support to land on a carrier?
well yeah kinda did but its more like a hard landing thing i had to remove the fuel at the right time to get it to kinda crash land : but not what i wanted ๐
lol
im still trying stuff tho i may get it ill let you know
see i was trying to make the heli land on the front of a Destroyer ๐
AI piloted heli does autorotation on a carrier wow ๐
yeah that can work ๐
im also useing my chopper command scripts to make this all happen ๐
but i bet it will be way easyer to land on the back of the Destroyer or carrier ๐
using alt key to raise or lower the pad can help lots
I used alt to change pads position vertically and its on the deck technically but AI does not detect it at all and is just hovering
yeah i found that chopper does not hover where you need it to over water
it falls short of the pad over water
wounder why that is
If you can consistently reproduce this, please comment on this ticket: https://feedback.bistudio.com/T193098 because this was supposed to be fixed and BI needs to know if it wasn't
@split ruin so in my chopper command it allows you to take over the controls from the Co-pilot seat and land the chopper your self: and then release the controls after you land the chopper: and then your free to call the chopper at anytime after that
so the chopper will pick you up anywhere on the map and fly you to the carrier: even on water extraction: then make sure your in the Co-pilot seat: so you can land the chopper: but insertion from the carrier can be funny only caz the chopper wont land back on carrier after insertion
if there is no one in the Co-pilot seat to land the chopper
so thats the part im working on now
oh and btw i just came up with a: Awsome Diver under water patrol script: can be set to any depth for the divers to swim at: and they patrol at that depth: and if they see you they Attack you its cool ๐
btw over land the chopper command works perfect or hover over water @split ruin would you like a demo mission of my chopper command
I just tested with landAt and it's woking fine to me with an invisible helipad
chopper landAt [helipad, "land", 10, false]
oh nice
I spent the last month messing with helicopters landing on ships. It was primarily using simplex support but also alive and ai with waypoints. Nothing seemed to work consistently until I tried using deformer to flatten an area to place the fleet. Placing all the ships above a flat spot 25m deep below the surface did it. They work consistently for me now.
@pallid palm actually that diver script is something I can use it in the upcoming mission if you care to share ๐ป
I just found out that remoteExec and remoteExecCall were added in version 1.50. How did people even scripted multiplayer before? ๐
i want to make a script that finds entities in the mission minus modules, ai, turrets, drones and submarines. this is what i have so far but i can't figure out the class name for turrets, drones, and submarines. any ideas or common name lists for the iskindof command?
entities [[], ["Logic","Man"], false ,true]; // returns [helo,car,quad,boat,arty,apc,antiair,tank,drone,sub,turret,plane]
https://community.bistudio.com/wiki/BIS_fnc_MP
But also you can do a surprising amount of basic, and even advanced, stuff without needing remoteExec. Not to mention all the stuff that wasn't even in the game yet back in 1.50
I would guess that BIS_fnc_MP worked with public variable event handlers as the underlying mechanic.
Well, we can find out, it's still in the game (do not take this to mean you should use it)
Nope, they've replaced the contents with a remoteExec implementation
I guess way more logic had to run on all machines in older titles, compared to how now, you can just run most of it on the server and then just tell clients what to do.
publicVariable is a thing since OFP and public variable EH since Arma 1. So you could execute function based on variable change for example
i think BIS_fnc_MP was arma 2
any script way to mute players characters, they always hint where enemies and vehicles are and are very annoying ๐คข
setSpeaker(?) to NoVoice
it's a server profile config "Auto Reporting"
Does anyone have a script lying around for adding a damage handler to a thing that only allows certain weapons to damage it?
I'd like to harden these SAM sites against anything that isn't a demo charge.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage pretty much all you need
Yes, that's the documentation there, which is not what I asked about.
I wondered if someone already had one I could modify to avoid needing to go from scratch and make from-scratch mistakes.
Well, your first hurdle is defining a demo charge.
Because Arma doesn't :P
We're currently using getText (_ammoCfg / "mineTrigger") == "remotetrigger" but that might not work for some ACE-specific charges.
Should be >>, / is slower for whatever reason
more valid inputs, so I guess that makes sense
Oddly enough, everything else in this file uses >> and I'm fairly sure I wrote all of it :P
hmm
I've got all the classnames of the explosives allowed, could that help?
Because I also have the luxury of defining the arsenals.
You could just check the type of the projectile, which would be the CfgAmmo class
@split ruin oh sure m8 i can send you the Diver patrol script
i'll put all the where how/s and how do's: in the top of the script then ill send it to you ok m8
@molten yacht```sqf
// here you go m8: If I Remember Correctly
this addEventHandler ["HandleDamage",{
((_this select 4) == "SatchelCharge_Remote_Ammo")
}];
Thanks, I'll try that.
not sure where to put this, but wat was the video setting to change when using BIS_fnc_exportEditorPreviews to not cause image preview screenshot from being so bright?
Try the settings listed here: https://community.bistudio.com/wiki/Eden_Editor:_Configuring_Asset_Previews
ahhhh it was brightness cool
wat a weird thing to do I keep forgetting about that lol
ty
vehicles paradrop script attempt ... it moves the player but not his vehicle
_veh addAction
[
"<t color='#FF80FF'>Paradrop Vehicle</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
openMap true;
onMapSingleClick "
openMap false;
[(objectParent _caller),1500,_pos] call BIS_fnc_setHeight;
onMapSingleClick '';";
},nil,3,true,true,"","true",3,false,"",""
];
Guys, I have a few questions
First is, can I somehow see the changes that this mod does https://steamcommunity.com/sharedfiles/filedetails/?id=3432188295 in redactor via console or smth?
And about vehicle animations. So can I somehow hide the hull of the vehicle? I know that u can hide the turret and some other things with animate... command, but I couldn`t find any information about this on bi wiki.
@kiba that's weird because _caller shouldnt be available in onMapSingleClick ?
True, but setHeight uses default ->
_obj = _this param [0, player, [objNull,0]];
that explains why player moves
this addAction
[
"<t color='#FF80FF'>Paradrop Vehicle</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
openMap true;
onMapSingleClick "
systemChat format ['in map single click player veh pos :%1' , getPosATL objectParent player];
openMap false;
[objectParent player,1500,_pos] call BIS_fnc_setHeight;
systemChat format ['in map single click player veh pos :%1' , getPosATL objectParent player];
onMapSingleClick '';";
},nil,3,true,true,"","true",3,false,"",""
];
You can use in addaction -> player , because addaction statement is local and player is local.
@proven charm now its working ... I have the vehicle dropped from needed height
_veh addAction
[
"<t color='#FF80FF'>Paradrop Vehicle</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
openMap true;
onMapSingleClick
"
openMap false;
[vehicle player, 1500, _pos, 'ATL'] call BIS_fnc_setHeight;
onMapSingleClick '';
";
},nil,3,true,true,"","true",3,false,"",""
];
now I need the parachute part ๐
gives "expected bool" error ๐ญ
_veh addAction
[
"<t color='#FF80FF'>Paradrop Vehicle</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
openMap true;
onMapSingleClick
"
openMap false;
[vehicle player, 1500, _pos, 'ATL'] call BIS_fnc_setHeight;
onMapSingleClick '';
_chute = createVehicle ['B_Parachute_02_F', (getPosATL (vehicle player)), [], 0, 'FLY'];
_veh attachTo [_chute, [0, 0, -1.3]];
waitUntil { sleep 1; isTouchingGround (vehicle player)};
detach _veh;
";
},nil,3,true,true,"","true",3,false,"",""
];
dunno but, _veh defined? waitUntil allowed there?
@proven charm yeah, now its working until the waitUntil part, it doesn't want to allow it in this context, I need condition to detach the parachute ...
_veh addAction
[
"<t color='#FF80FF'>Paradrop Vehicle</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
openMap true;
onMapSingleClick
"
openMap false;
[vehicle player, 1500, _pos, 'ATL'] call BIS_fnc_setHeight;
_chute = createVehicle ['B_Parachute_02_F', (getPosATL (vehicle player)), [], 0, 'FLY'];
(vehicle player) attachTo [_chute, [0, 0, -1.3]];
waitUntil { sleep 1; isTouchingGround (vehicle player)};
detach (vehicle player);
onMapSingleClick '';
";
},nil,3,true,true,"","true",3,false,"",""
];
does using a server profile name space to store mass data (like ingame report with variables hosting an array) can cause performance issue?
you should put your script in a [] spawn in the addaction this could allow you to use sleep or waituntil correctly
Unless you intensely save/load every frames/seconds etc, no, just store it won't do any performance issue
sounds great, edited for privacy reasons
So it won't have issue?
now its working perfectly, thanks @knotty totem and @proven charm ๐ฅณ
_veh addAction
[
"<t color='#FF80FF'>Paradrop Vehicle</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
openMap true;
onMapSingleClick
"
openMap false;
[vehicle player, 1500, _pos, 'ATL'] call BIS_fnc_setHeight;
chute = createVehicle ['B_Parachute_02_F', (getPosATL (vehicle player)), [], 0, 'FLY'];
(vehicle player) attachTo [chute, [0, 0, -1.3]];
_handleParadrop = 0 spawn
{
waitUntil {(position (vehicle player) select 2) < 0.5 || isNull chute};
detach (vehicle player);
};
onMapSingleClick '';
";
},nil,3,true,true,"","true",3,false,"",""
];
The thing should be added into the hard drive, not RAM, from what I can tell, that means it will not make any memory issues or CPU being busy (besides when you read/write) issue, that means no, from what I can tell. (The reason why I use that term twice is I'm not Dedmen so can't tell the 100% answer)
It makes complete sense! Thanks
I use missionProfileNamespace to save my mission and havent got issues. I used profilenamespace first but changed it
Technically, if it does, you can easily observe it by having intense amount of garbage data into profileNamespace even in SP
I'd recommend using a mapSingleClick mission EH if you can. onMapSingleClick is not stackable, meaning whatever you set it to overrides the existing value - there can't be multiple values at once. That's a problem for compatibility between different scripts.
I want to part of the map (incuding a marker) on a Screen ("Land_TripodScreen_01_large_F").
I want to center it around a moving object (e.g. a car to follow)
Is this even possible?
UI on Tex
This is a POC that was posted couple of years ago. Works great in single-player but in MP, it will be a slideshow for everyone looking at the map, (if you look somewhere else, it will be fine)
if (!isNil "mapboard_1") then { deleteVehicle mapboard_1 };
mapboard_1 = createVehicle ["Land_MapBoard_F", [19986.6, 16985.5, 10], [], 0, "CAN_COLLIDE"];
mapboard_1 setPosASL [19986.6, 16985.5, 3.9];
mapboard_1 setDir 180;
publicVariable "mapboard_1";
mapcenter_1 = [10641.9, 9292.85, 0];
publicVariable "mapcenter_1";
{
mapboard_1 enableSimulation false;
mapboardtexture_1 = "map";
mapboard_1 setObjectTexture [0, format["#(rgb,2048,2048,1)ui('RscDisplayEmpty','%1')", mapboardtexture_1]];
onEachFrame {
private _displays = [
findDisplay mapboardtexture_1
];
if ( _displays findIf { isNull _x } < 0 ) then {
mapdisplay_1 = _displays;
{
private _map = _x ctrlCreate ["RscMapControl", -1];
_map ctrlMapSetPosition [0.2, 0.2, 0.6, 0.6];
_map ctrlMapAnimAdd [0, 0.1, mapcenter_1];
ctrlMapAnimCommit _map;
_x setVariable ["map_1", _map];
private _marker_color = (["ColorBlack", "ColorGrey", "ColorRed", "ColorBrown", "ColorOrange", "ColorYellow", "ColorKhaki", "ColorGreen", "ColorBlue", "ColorPink", "ColorWhite", "ColorWEST", "ColorEAST", "ColorGUER", "ColorCIV", "ColorUNKNOWN", "colorBLUFOR", "colorOPFOR", "colorIndependent", "colorCivilian", "Color1_FD_F", "Color2_FD_F", "Color3_FD_F", "Color4_FD_F", "Color5_FD_F", "Color6_FD_F", "ColorHBarrier", "ColorHungar", "ColorCargo", "ColorHighway", "ColorMainCity", "ColorDirtRural", "ColorSlumBlue", "ColorSlumBlack", "ColorHedge", "ColorTankRust", "ColorWoodenPlankPine", "ColorWoodenPlankKauri", "ColorWallCityOrIndustrial", "ColorWallVillage", "ColorShed", "ColorShedTanoa"] select (_forEachIndex % 43));
_map setVariable ["color", getArray(configFile >> "CfgMarkerColors" >> _marker_color >> "color")];
displayUpdate _x;
} forEach mapdisplay_1;
onEachFrame {
{
private _map = _x getVariable "map_1";
_map ctrlMapAnimAdd [0, 0.1, mapcenter_1];
ctrlMapAnimCommit _map;
displayUpdate _x;
} forEach mapdisplay_1;
};
};
};
} remoteExec ["call", [0,-2] select isDedicated, mapboard_1];
Stripped down version of some UI to Tex stuff from my mod
if (isNull (findDisplay "YourPrefix_mapDisplayScreen") then {
_object setObjectTexture ["screenCamoName", "#(rgb,1024,1024,1)ui('MapDisplayClassName','YourPrefix_mapDisplayScreen','ca')"];
};
// Seems to take four frames to create display for local units, and six for remote
[{
!isNull (findDisplay "YourPrefix_mapDisplayScreen");
}, {
params ["_object"];
private _display = findDisplay "YourPrefix_mapDisplayScreen";
displayUpdate _display; // Updates display on the texture
}, _object] call CBA_fnc_waitUntilAndExecute;
remoteExec ["call", ...]
๐
Its only a PoC based loosely on some vivid imagination
but worked great
Ok @tulip ridge, @finite bone thanks I will try it out and adapt it to my use case.
missionProfileNamespace is fine unless it's a Linux server :/
@tulip ridge @finite bone : I merged both of your code for a proof of concept.
This is nearly ok (I just need to figure our some resolution issues):
params["_screenObject","_centerObject"];
// For testing override functions params with cursorTarget and player
_screenObject = cursorTarget;
_centerObject = player;
_mapCenter = getPosATL _centerObject;
_mapTexture = "Screen_0_Texture";
_screenObject setObjectTexture ["Screen_0", format["#(rgb,2048,2048,1)ui('RscDisplayEmpty','%1')", _mapTexture]];
[{
params ["_mapTexture","_mapCenter"];
! isNull (findDisplay _mapTexture);
},{
params ["_mapTexture","_mapCenter"];
private _display = findDisplay _mapTexture;
private _map = _display ctrlCreate ["RscMapControl", -1];
_map ctrlMapSetPosition [0.2, 0.2, 0.6, 0.6];
_map ctrlMapAnimAdd [0, 0.1, _mapCenter];
ctrlMapAnimCommit _map;
displayUpdate _display;
},
[_mapTexture, _mapCenter]] call CBA_fnc_waitUntilAndExecute;
Can anyone help me with why my pbo isnt loading OGGs
but when i do
if (fileExists "sounds/AnNirana.ogg") then { hint "VFS: OGG exists"; } else { hint "VFS: OGG MISSING"; };
it says its missing
they are all vorbis
if you are looking from xx mod ->
you need use prefix , assume yours is QamarSounds ->
fileExists "QamarSounds\sounds\AnNirana.ogg"
And which program do you use to pack your mod?
Ill check this now, but they also arent previewing the sound when selected under playmusic in zeus
does \ or / matter?
Even with your change to checking it, it just doesnt work
its loading the classes too because i've ran a check for that. Its just the OGG's
CURRENT
class SuratAlMaun {
name = "SuratAlMaun";
sound[] = {"sounds/SuratAlMaun.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};```
Will this fix it below?
```cpp
class SuratAlMaun {
name = "SuratAlMaun";
sound[] = {"QamarSounds\sounds\SuratAlMaun.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};```
if not try absolute path \QamarSounds\sounds...
class SuratAlMaun {
name = "SuratAlMaun";
sound[] = {"QamarSounds\sounds\SuratAlMaun.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
So this?
yes, try this first, and if you dont hear anything, try absolute path \QamarSounds...
I saw some mentions about paths in official documentation
so absolute path is just putting a \ in front?
Sorry for my ignorance im very new to this. First mod
yes absolute is \ in front
ok
so music works now however, its not showing up under play sound
what do you mean by " not showing up" ? in editor ?
I am sorry, I am not familiar with zeus modding, but probably it has to be listed in some configuration of zeus, probably extend its configuration in your mod.
class CfgSounds {
sounds[] = {};
class AnaMaradun {
name = "AnaMaradun";
sound[] = {"QamarSounds\sounds\AnaMaradun.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
class AhmedTahoun {
name = "AhmedTahoun";
sound[] = {"QamarSounds\sounds\AhmedTahoun.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
class BaqayaalMajd {
name = "BaqayaalMajd";
sound[] = {"QamarSounds\sounds\BaqayaalMajd.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
class ElDjihad {
name = "ElDjihad";
sound[] = {"QamarSounds\sounds\ElDjihad.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
class AnNirana {
name = "AnNirana";
sound[] = {"QamarSounds\sounds\AnNirana.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
class AlAraf {
name = "AlAraf";
sound[] = {"QamarSounds\sounds\AlAraf.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
class Surah47 {
name = "Surah47";
sound[] = {"QamarSounds\sounds\Surah47.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
class SuratAlMaun {
name = "SuratAlMaun";
sound[] = {"QamarSounds\sounds\SuratAlMaun.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
class JihadKi {
name = "JihadKi";
sound[] = {"QamarSounds\sounds\JihadKi.ogg", 1, 1};
titles[] = {};
soundClass = "Qamar";
};
};```
I thought thats what this did as its the sound class instead of the music class
Hello, looking for a side teleportation respecting squads, to have something like in the drawing. I know how to do it manually, but is there any function doing a similar thing? Cause I guess we all have the same needs, here for mass teleportation. Not to reinvent the wheel.
How do i make so this works with _KeyDown instead of _actionText ? Want to bind it to the "9" key on the keyboard.
_actionText = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"} else {"View Distance Settings"};
This is the hole file
something like this maybe ?
if (!hasInterface) exitWith {};
//Micro-optimization
private _player = player;
{_player setPosATL (getMarkerPos "Homebase")} forEach nearestObjects [_player,[],2];
//ok hows that lol
not tested
!quote 5
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
nope, it will teleport all on the exact same position...
There is no reason to have the forEach, either.
The crappy implementation but written in one shot and working fine is that shit:
I have all my groups regouped behind the TV, the SL separated... all moved on a simple marker. (A few items are generated with BIS_fnc_objectsMapper). Tested with all AI, but in the end only humans groups will be TP.
ok hmmm
Small nitpicks:
_all_groups = nil is dangerous (not really) if it fails to initialize anyways. I guess [] is better so forEach won't complain
% 360 is not needed in this context
_forEachIndex can be your friend if you use it properly
Like this?
_keyDown = if (isLocalized "STR_chvd_title") then {localize "STR_chvd_title"};
player addAction [_keyDown, CHVD_fnc_openDialog, [], -99, false, true];
player addEventHandler ["KeyDown", "if (_this select 1 == 10) then player addAction ['%1', CHVD_fnc_openDialog, [], -99, false, true]"];
Does anyone know?
- What is redactor
- Deoends on the vehicle model. Some have one, some don't
- 3den editor
- Can I see somewhere which one have or not
It is Eden Editor, not redactor. Use the correct term to ask.
- What is wrong with that composition that already is a part of Eden Editor?
- animationNames command and check animationSources config class to check potential animations
Sorry, I'm not good in english
So this composition changes surface level according to it's placement, but isn't really predictable, so I can't know where to place things, so they won't float or be underground. And that's why I want to know how it looks in editor, so I wouldn't need to start a scenario each time
Even the thing, in which is code placed float sometimes
So you want to preview while you are in Eden Editor, that is the question, not how to apply in game
Yes
@haughty hare have you looked at deformer? If there is a lot of area that needs to be changed then I think that might be a better option for you
I'm making it for server, that don't have that mod on
a quicker way might be to call an sfq file with the code and play in multiplayer.
place the object in the editor, check in game. If you need to adjust the code then you only need to go back to the lobby to refresh it. It might be a bit faster
There is something really strange about radius of addWaypoint command. On Virtual Reality terrain with no objects around, it does produce good results, but in towns... that's something man.
Take a look at a following code. I would expect this to evenly distribute all the 1000 waypoints in 300 metres radius. Instead it seems to put waypoints in some places and in some just doesn't, even on multiple runs. Sending La Trinite from Malden 2035 and Camp Rogain from Stratis on screenshots as examples.
for "_i" from 0 to 999 do
{ group player addWaypoint [ player, 300 ]; };
I'm better of counting waypoint's position in radius myself:
for "_i" from 0 to 999 do
{
private _pos = player getPos [ random 300, random 360 ];
group player addWaypoint [ _pos, 0 ];
};
Only advantage of addWaypoint's algorithm is not putting these waypoints in sea.
I've kinda learned this the hard way, since I was using Seek and Destroy waypoint, which by itself makes units to move within radius, it took me quite some time to realise this.
I usually force it myself
https://sqf.ovh/sqf math/2018/05/05/generate-a-random-position.html
The example in middle on the first picture looks great. I might update my function to behave just like that.
I thought example on the left would be even distribution
I have this same problem , getting those stripes
btw, if you want the points spaced evenly over the circle, use 300 * sqrt random 1 as the distance instead.
Yeah, I've just changed it in my function
Oh, Hypoxic answered the same thing :P
I read somewhere that the reason is the difference in the resolution between the UI and the Land_TripodScreen_01_large_F screensize.
But I am new to GUI scripting, maybe someonelse has a solution or insights.
Hi folks. I'm struggling with timing issues around player object initialization. Other than XEH init handlers, what's the earliest place to hook into (player) objects? JIP queued stuff seems to run before initPlayerLocal.sqf but not reliably AFAIK.
Hallo, had a question about unitPlay. I've recorded a tank moving around at 100 FPS and got around 60 after lag reduced the quality of the recording.
I've pre-processed the data in init.sqf using
movementData = call compile preprocessFile "tankMov.sqf";
Playing it back however, the tank still jitters quite a bit, though it's not as bad as if I were to play the whole recording without pre-processing it
Is there a way to reduce the stutter/jitter further? Thanks in advance
I'm publishing to the workshop. It requires several addons. How do I make it require those addons in the workshop
I just do it on steam after the item is published
Not sure if publisher has a way to set required mods
Some PBO files were included outside of addons folder
IDK what this means
It's an AU Extender
their init fields are ran pretty early
Antistasi extenders were a mistake :/
Sorry what?
You shouldn't have PBOs outside the addons folder. I don't know why you have PBOs outside the addons folder. I think the correct channel for Publisher is #arma3_tools anyway.
But the general problem with Antistasi extenders is that we made it look like you could create an Arma mod without knowing how to create an Arma mod :P
this is not actually true.
Thoughts on organization, folder structure, etc?
all good, but # - name.sqf/txt, dafuq? ๐
I put the # there to order those from top to bottom, sorted by importance.
I have my to-do list which helps me stay on track. I like it in VScode because it's easy to see at a glance but I also hate it for some reasons. For example, I have to manually hit return to start a new line instead of it automatically doing it in google docs.
Short one: How to find the index of an element into an Array ? I would like something like (groups (player side)) indexOf (group player) to know that the the player group is the 3rd one for example. (I guess groups returns always the elements in the same order).
thank you, this one doesn't want to stay in my mind!
Text files don't have limited width like papers do
Can you set the init field without editing the mission, just out of curiosity? TBH, I hadn't considered just adding to the init field in the mission but now that you've said it, that is the easiest thing to do.
View -> Word Wrap
The "automatic new line" in Google Docs isn't a real new line, it's just visually constraining the line (wrapping) to fit the width of the document. If you paste the same line into an environment with no width restrictions, you'll see it's still actually all the same line (no newline character)
Google Docs is designed for making documents that can be printed on paper, or look like they're on paper, so it follows paper restrictions. Code has no such restrictions, and since the presence of a real new line can be actually important for parsing (not so much in SQF but in some languages), code editors typically don't do wrapping.
I have wrapping in .md files, but that maybe because I have Markdown All in One extension
For real code, typically there is a formatter to rearrange lines, often to max column width, and using visual wrapping could even perhaps be misleading.
But for text-primary formats like markdown it make sense to wrap IMO.
๐
I'm familiar with the contents of that link. So there are no techniques beyond either XEH init handler and init field to initialize objects before JIP queue is processed?
This is so helpful! Thank you!
Is there any difference performance-wise between these?
remoteExec ["FoxClub_fnc_deleteAchievementTriggers", 2];
remoteExec ["FoxClub_fnc_delAchieveTrigs", 2];
One is easier for me to read, but I don't want to negatively affect anything.
go for readability.
Technically there is a small performance effect from longer names. But it is very small, you'd have to be going much bigger for it to be worth caring about.
deleteVehicle is a GA, so why do I have to use remoteExec like my previous post to delete some server-only triggers?
A server-only trigger only exists on the server. Other machines don't know it exists and have no reference to it.
But the trigger is stored in a global variable:
deleteVehicle trgCompleteTaskPerfect;
So even the client sees the variable, so it should be able to delete it, no? When I check what it contains, it doesn't go from empty detector to objNull unless I remoteExec it.
- Global scope variables aren't necessarily network global variables. Global scope just means every script on the machine can access it.
- Even if a variable is network global, it can still contain things that aren't necessarily valid on every machine
Ah, so when I create the trigger on the server like this:
trgCompleteTaskPerfect = createTrigger [
"EmptyDetector", // type
objNull, // position
false // makes global
];
Even though it is global scope the client doesn't see it. So deleteVehicle trgCompleteTaskPerfect; from the client does nothing?
setting up the trigger is one thing, defining a variable is another
Like Nikko said, in that example, only the server "knows" that variable
unless you publish it to the clients as well
In this case, publishing it to the clients may not be enough, because it's a server-only trigger, and trying to tell other machines about an object reference that doesn't exist for them might not go well
I got what you're saying
in that case (if you publicVariable it), the variable is objNull on clients, iirc
So how many functions does one need to have, to warrant folders to categorize them?
one thousand and one
init.sqs <-- what? Is realy someone that kind of masochist to still use that?
it still exists
Absolutely up to you.
I wouldn't do folders if there's only going to be one in each because that's just wasting my time clicking on them, but if I have several systems that have more than one function each, I'm separating them so I can find stuff. But it depends on how easy you find it to find stuff in a list.
and there are still ppl in here who do SQS
Oh boy
๐
Yeah I was just talking about the variable per se
RemoteExec: scheduled enviroment or un-scheduled?
scheduled, RemoteExecCall unscheduled
thx4Info
@queen cargo Yeah, found that later also. Thx anyway
Is there any reason to use BIS_fnc_MP now that remoteExec and remoteExecCall are available? As I understand it, the former is just a wrapper around the latter now.
yes
if you got old scripts and are too lazy to upgrade em
then you should continue using BIS_fnc_MP
in all other cases: no
I should have clarified, when writing new scripts ๐
and due to the fact that you never touched the old scripts when youre lazy: no you should never ever use BIS_fnc_MP again
๐
haha since a are right at the subject :[{ hint "This hint is really strangely executed." },"BIS_fnc_spawn",_player] call BIS_fnc_MP; is senceless if _player == player am i right?
why should it be senseless?
ok the i didn't get it quite right. is spawns a hint where player is local?
It looks like it to me @placid root, but I'm still somewhat noob.
actually, it should spawn the code in a scheduled env
thus thats equal to _this spawn {_this spawn {...}}
but since the player runs the code anyway i can just replace it with a hint can't i?
I think the take away is that if you're passing an arbitrary code block for remote execution, you have to wrap it with a function, but if it's an existing command or function, you don't need the extra spawned environment.
So in your example, you could just call hint directly.
Does anyone know how I can move a unit that I created using create3DENEntity into a vehicle that also has been created using create3DENEntity?
I'm trying for hours now and nothing works.
Well, just drag and drop? Otherwise you are doing something wrong
okay I notice I forgot to mention that I need to do it using a script (i'm creating a mod that needs that)
Now that's a good question ๐ค
In Zeus it would just be moveInDriver but that does not seem to work in Eden
i am just looking through the code of http://www.armaholic.com/page.php?id=30336 and i am wondering about the execution, since every command is run by the player and remoteExecuted where the player is local. so it seems to me the remoteExec is sensless
or bis_fnc_mp in this script
(well not every, but a lot of them)
so you want to tell us not everybody who creates popular scripts is a good scripter @placid root ?
http://www.tegile.com/wp-content/uploads/2015/08/captain-obvious-south-park.jpg
always a pleasure chatting with you x39 ๐
Kind of my job ๐
just thought maybe i missed something obious.
Would have to dig into it to comment further, but maybe it was an issue where the script with the remoteExec calls wasn't only being executed in the same locality as that targetted by the remoteExec.
@queen cargo
if you got old scripts and are too lazy to upgrade em <--- Also not rly needed, since it will (or is already?) implemented for the bis_fnc_mp)
and due to the fact that you never touched the old scripts when youre lazy: no you should never ever use BIS_fnc_MP again
@jade abyss
remoteExec == bis_fnc_MP
(again: Not so sure if already in or not, haven't checked it yet)
backwards compatibleblebleble
no incapacitatedState EH? ๐ค
Let's say I want to get class of whatever unit I want. For example NATO pacific sniper. Can I somehow reach by something like: "blufor -> nato -> pacific -> specials -> sniper" or do I just have to know his class?
Why you have to know the class is one question
And... no, that's not usually how it works
To spawn him. I guess the only way, is to save classes I want to use in array or hashmap
how to delete customWaypointPosition? 
And what is responsible for displaying it on the map? Can it be completely removed from the map?
Engine has the responsibility. I don't think we can mess with it
force a difficulty setting
Mmmmaybe
maybe its a control?
Group doesn't even need any waypoints, if any player is leader
@hushed turtle sorry i meant this https://community.bistudio.com/wiki/configOf
How do I return a list of config items that start with a certain prefix?
like this ```
"((configname _x) select [0,3] ) == 'O_A' " configClasses (configFile >> "CfgVehicles")
That'll pull all O_A_ config classes from cfgVehicles?
it should
it faster
"(configName _x find 'B_') isEqualTo 0" configClasses (configFile >> "CfgVehicles");
I used to not understand why its slower. But I just figured it out lol.
Its becase / command has multiple syntax'i
So the execution of it first iterates through them and does type compares on all the arguments to find the matching one
Lol I wasn't even able to read the one message below that already explained it ๐ข
I assumed that was why, hadn't cared enough to ask why it was slower though
im a ghost ๐ป
๐
hehe
Yeah
word*
I finally found what we use PaperCar for! XD
It basically does a findFreePosition, that would fit a paper car.
A car doesn't fit inbetween buildings.
The search is based on grid cells, and then within the cells.
It tries to avoid water, deep water fullyblocked, shallow water might be acceptible.
It skips cells that are "full of objects", for that it sums the area of the buildings and objects, and if larger than 90% then its "full", but only if the full cell doesn't have any roads.
Gradient is blocked, gradient greater than 6... uh ๐คท
So some of the town cells will probably be excluded because too full.
Your first image is probably "too steep"
The rest will be due to not being able to find a spot that fits a car.
(That might be able to go onto the wiki page)
findEmptyPosition command with default vehicle type would simulate the "within cells" search.
It's missing the exclusion criteria for water/full/gradient though
In Camp Maxwell it was even more ridiculous, since 200 m radius would result in placing all waypoints at the same spot right next to me. Same in jungle on Cam Lao Nam, 300m radius and all waypoints were right next to me ๐
Wiki page update would be appreciated. Who would expect behaviour like that?
I guess it's pretty good for land vehicles though
Since it finds position where vehicle can drive
Good morning/afternoon/night.
I want to change factions in Liberation but i don't seem to find the mission folder, i see through Arma files and user files but the mission folder is not there or no files
Ask in lib discord
thanks!
When player throws a grenade, the top action in action list becomes active and displays at center of screen. Is that normal? It's distracting, and actions should only appear if using scroll wheel. What causes that, and how do I prevent it?
These are player actions that are always visible, or what?
Player actions, and its an action my mod has created for player. I'm going to set its priority down to see if it stops happening, because after this action performed and it disappears I throw more grenades and the other actions in action menu do not pop up in the center.
SOLVED: It was created by Hold Acton, and I need to set "BOOL - show on screen" to false.
Are there any recommendations for/against putting a function call in a condition for a userAction? I'm looking to replace a condition = "player == this turretUnit [-1] && BigMessOfCode"; with a condition = "player == this turretUnit [-1] && [this turretUnit [-1]] call MyFunctionTag"; assuming my function returns a true/false
As you might already guessed a condition is just an SQF, so no, there is no (at least significant) downside
Never used a userAction but if it works the same as the addAction command the only real draw side I can think of is that you could potentially be negatively impacting client performance as the condition is ran on every frame. For the sake of any ol object probably won't matter if what you're calling isn't an intensive script but if you're running that on the player then it'll be running every frame all the time
Most function calls in conditions can be lazy eval'd
The times I've bothered to check the perf it's always been better to lazy eval
This is kinda more nitpicky and doubt it matters but could also probably use preprocessor to toString your function and use that for the condition. Then use Darts suggestion to lazy eval to reduce checked code
Oh wait
Seeing you have a condition before that function- I guess better to just lazy eval that as Dart was meaning- missed that- no need to toString
Why would you use toString, it's config
My thought was to avoid the usage of call of the function on every frame. I didn't realize he had a condition before that- doing lazy eval with that as you mentioned would be better. On my phone so just didn't see it 
What do you think that would resolve?
Using call every frame isn't the issue, it'd be checks in the function itself that would be the issue if there was a perf hit from running the code
I'm aware that's why I said in combination and that it was nitpicky. Really was just thinking out loud. Thought process was:
toString TAG_fnc_functionName
Is faster then:
"call TAG_fnc_functionName"
No-parameters call is very quick. Parameters version is a bit slower. Note that using CfgFunctions by default adds a lot of extra boilerplate to the function (scriptname etc) that you might want to disable.
Hadn't thought of that- also true 
Ah you mean like that, I thought you meant literally using toString in the condition (and then presumably re-compiling it)
In that case yeah, a lot of people use a similar thing for event handlers with a CBA's LINKFUNC macro.
Tldr it's { call fnc_foo } in debug mode (for recompiling) and just fnc_foo when not in debug
Whether it's worth worrying about is another matter. UserActions and addActions likely don't touch the condition unless you're looking at or crewing the object.
They still run when not looking at it / crewed
I really need to look into CBA sometime. You guys always make it sound super great and useful when you guys talk about it. A lot of cases where I could probably be using it to do things better
I'm not sure what the exact cut off is, but I remember seeing it run way more often than I'd expect it to when debugging stuff
I think alike triggers an action only evaluates the condition within the given distance of the object. That or it is a static 50m. Can't remember
Vanilla is better ๐ ๐ ๐ lol No i just like no mods that's all ๐
so i just got this part right in the crate init of a Supply Drop Support module```sqf
_this addAction ["<t color='#ff1111'>BIS Arsenal</t>",{["Open",true] spawn BIS_fnc_arsenal},"",1,false,true,"","(_target distance _this) < 5"];
im happy now ๐
WooHoo ๐
What a Awsome Game Arma 3, i love it
Note that
condition = "player == this turretUnit [-1] && MyFunctionTag"; is also an option.
You get lazy eval, and spare the "call" instruction. But you don't get a _this
Does that still allow params? I still need some way to pass the player to the function.
But come to think of it, its probably a good idea to make sure the condition and function has good short-circuits.
What is that in this context
You have this variable in there, you don't need to pass anything
condition = "player == this turretUnit [-1] && {alive this}";
and
MyFunctionTag = {alive this};
condition = "player == this turretUnit [-1] && MyFunctionTag";
is the same thing
So if I want to reference the player in the function, since its established that the player is a turretUnit of vehicle this, I could put _unit = this turretUnit [-1]; as the first line of code in yhe function and proceed as normal from there?
Or could I put player directly?
On second look, I see that the function call is basically a paste-in block of code.
I read somewhere (probably in the BIKI) that call executed inside a spawn is still a scheduled function that can be paused using sleep? Or am I spouting shit?
If you already know that player == this turretUnit [-1], then you can just use player directly.. because they are equal anyway
call doesn't change the environment. So yes and no
Can you explain what the 'no' is?
Or am I spouting shit?
Ah 
Could you give me an example on how to write the code? and should i put it in the initPlayerLocal.sqf then?
@tough abyss
I'm sorry, new to arma 3 scripting
What the easist way to calculate terrain slope in degress? Direction of slope doesn't matter, just slope angle from horizontal line
acos (surfaceNormal _pos # 2)
Is it possible to make your own revive mechanic. The base game appears to be a holdAction to revive downed units. Could one replace that with their own holdAction that revives units?
I'm guessing the first step would be to select the disable option here:
But that would probably just make units skipped the downed step and go straight to dead.
Yes, you'd need to have your own handleDamage EH to prevent that and make your own downed state
Is it possible to return which face the player object is using? Lol it's a weird question but I want to create a dialog that has the player's face/head displayed, sort of like most gmod life servers.
This is like... halfway between config and scripting, sorry: I am setting up a custom attribute for a thing in 3den and I have this expression. I don't know how many quotes deep I can nest them, I need like 4 layers:
expression="private _nameplateText = format ["#(rgb,1024,256,3)text(1,1,""RobotoCondensed"",0.3,""#ffffff"",""#000000"",""%1"")",_value];_this setObjectTexture [0,_nameplateText];";
Nvm! Why work harder when you can expression="[_this,_value] call bro_fnc_textureIt;";
I want to see how A3 does it. I've been poking around in the function viewer but haven't found it yet. It should be there somewhere right?
Hello All: so is there away to stop my team of players from Speaking ```sqf
{_x setSpeaker "NoVoice"} forEach units _player;
how would i go about doing that
maybe i should do player
Do you mean the radio speak from your group? Like, "man. 200. meters", etc?
yeah like man man. 200. meters", etc?
Take a look at these two:
enableRadio false;
enableSentences false;
setSpeaker "NoVoice" is fine if you want to kill all chat, IIRC
yes i use both of them and it stops my guys from talking but i want enemy Ai to keep talking
everytime i stop my guys frome talking the enemy Ai do also
and i want enemy Ai to keep talking
Best bet is probably just to put [player, "NoVoice"] remoteExec ["setSpeaker", 0, true] in your initPlayerLocal.
ahhh coool
So building your own revive seems quite a large undertaking. I don't want to do much. I just want to access their hold action and add my function to "on start" and "on complete" code. Is there a way I can inject my code there without rebuilding their whole framework?
thx @granite sky
@blissful current I wouldn't know without reading it. Maybe they throw some sort of events.
Otherwise you can't directly overwrite a compileFinal'd function, but what you can do is patch your own function path into config.
And then it'll run your code instead for that function call.
Hmm I dont want to replace what they have since who knows what I'd break by removing it. But just adding some would work if that's possible.
I found a function for health effect but not for the holdaction that does reviving.
How do you make this button (parameters)? In my mission I have my options on a object and players can interact with it to change things. But if I could put them in this button that would be pretty slick.
I thibk it has to do with identity but not sure and not on th pc atm.
@ruby spoke , well it is possible to get the users color selection (porfile/hub color and stuff)by some configpath thingy. i saw it when i was looking through the Rsc in the configviewer. if it is possible to get these i am quite sure you can get the players face the same way. just dig through some Rsc and you will propably find something
okay, thanks. Which config is it in particular? @placid root
Is it possible to make my own version of official function in mission and keep same function name? In other words overwrite addon function by mission function?
forgot the name but there a lot of Rcs like "RscButtonMenuCancel" or "RscButtonMenuOK" just go through dem and in some onload stuff you will find something with profilecolor bla. sorry for beeing so vage can't start up arma atm
Any scripts to generate road civilian traffic between towns?
No, why would you?
If it's a mission specific function then you can give it any name you want as only you will be able to call it.
I call BIS function which calls other BIS function and I let's say I want my version of the second one. So only way is to have own version of both.
e.g. the hud color can be changed by userpreferences. so try to find the rsc for the hud
Yes. There is nothing wrong with that.
We have our own revive system because the default one doesn't really do what we want. The way we do it is by capping units' damage to 0.99 (which is treated as the incapacitated health). There are a bunch of things you have to take care of, especially around vehicles (they have to be moved out but immune to the fire or you'll get AIs screaming friendly fire into the radio for minutes).
I'm not saying there is something wrong. I was just curious. ๐
i am off to bed. good luck
and when you find a way this will help you to display it alongside with propably setFace.
btw. anybody knows a simple way to prevent units from trying to get into formations?
need them to work as individuals ...
a math question, if you have 4 tv screens in row and you want to give them number from 1 to 4 from left to right , how do you do that?
Well, in what context? Does the number really matter to this usecase?
i want to give each screen a camera so screen # 1 gets camera 1 etc
but the screen should be in left to right order
You have four TV objects, you have four cameras, but they are not named (yet)?
no not named
just need to know which screen access which camera so left screen would be assigned to cam 1 and the next screen to camera 2 etc
setVariable?
I genurely cannot understand why that could be a case actually
Why you can't just hardcode it?
Not sure I understand what you're wanting to do but if I am understanding you correcly Jouklik is correct in that setVariable would likely help you do it. Perhaps something like this?
{
(_tvArray # _forEachIndex) setVariable [format ["camera_%1", _forEachIndex], _x];
} forEach _cameraArray;
On phone so apologies for any bad formatting
Is there a way to make ambient sounds go silence (bird chirping and ambient animals) but keep the wind sounds?
I know EnableEnvironment [false, false];
Does it but it makes the wind sounds gone too
To prefix honestly no idea. Purely guessing but might be able to change the date of mission to a colder day that has less insects maybe. If not could potentially just disable environment as you put there and play whatever wind .ogg file through playSoundUI or something but no idea if there's perhaps a better way to do it. Never tried something like that
maybe im not good explaining XD
Give setDate a try- perhaps colder times won't have insects. Totally guessing but worth a shot maybe ๐
Ungroup em ๐
The relative position of the cameras is important, and you need to make sure the screens match that. Like having a multi-monitor PC and making sure the monitors are arranged correctly.
If you don't have control over the placement of the screens, it's going to be a real mess to detect them, find their relative positions, and sort them by that ๐ค
If possible, I'd suggest creating them by script, so you have control over their positions and the order they're created in and can store that information for use with the cameras.
@hallow mortar they are created via composition, so cant manage the order too much
If they're a composition and you're OK with the composition only working in the Editor or on servers that allow compositions to execute scripts, you could use setVariable in each screen's init field to have them identify themselves (or have each one separately initialise its own camera feed with the correct camera)
If you want the composition to work with Zeus placement on servers that don't allow compositions to execute code... you're screwed
i think the compositions work/are allowed if server runs the script... in my case the comp is just CCTV room in the base. not using zeus
If it's placed in the Editor, there are no restrictions. The settings for compositions executing code only apply to Zeus placement.
its placed once mission starts. there maybe newer eden compo system that im not using
ha ha ...
funny boy ...
at some point you will run out of groups due to the fact that there is a total maximum of groups in ArmA
wh...how are you placing this composition? You say it's not using Zeus, but you also say it's "once mission starts" so presumably not placed in the Editor. But those are the two ways you can place a composition.
im using the old objectMapper/grabber scripts
Okay, so not a composition then :U
i have always called them compositions ๐
A composition is an actual specific thing and the difference does matter
ok
snippet from the mapper script: ```sqf
//See if an object array, specific composition class or tag array was given.
private ["_cfgObjectComps", "_script"];
_cfgObjectComps = configFile >> "CfgObjectCompositions";
This functionality isn't documented on the wiki so I would need to look at it in full later, but that looks like the function is also capable of loading an actual composition from config, in addition to the documented method of creating an array from existing objects
Using object init fields to either set variables or individually initialise camera feeds is still the way to go. Have the left screen's init activate the left camera, etc. or have the left screen's init set a variable identifying it as the left screen, etc.
that would work, just not with compo
Why not? The mapper function supports init commands
oh right, Im actually looking at my modified version, for some reason i dropped init support or something
well thanks for the pointers NikkoJT, I could add back the init storing if I choose to go this route
Is there a list somewhere of all the bullet points that need to be ironed out? Or is it more of a trial and error process?
Trial and error for us.
We also do custom respawn handling, so basically every second after you're incap, we set your respawn timer to be -1s. That way people can't just respawn to skip their respawn timer.
And make sure to switch camera back to player if you have cameras/uavs
Why not just turn off the respawn button?
Actually not sure for missions. Mission config supports CfgFunctions but I don't know which one takes precedence.
R3vo said it's not possible 
Wanted people to be able to respawn by pressing the button.
Managing the respawn timer isn't actually that complex. I just remembered, the hardest part is getting AI in each players' group to behave. When you go unconscious (we set the incapacitated player to unconscious which hard locks them from actions etc), AI in your group will take over and start issuing commands.
How can I find the correct structure in description.ext for this file: a3\functions_f_mp_mark\revive\fn_reviveonstate.sqf
For example I just tried this without any luck:
class CfgFunctions
{
class A3
{
class Revive
{
class reviveOnState
{
file = "functions\fn_reviveOnState.sqf";
};
};
};
};
Basically, I want to overwrite that file with my own code. I've been able to do this with the SOG CDLC functions, using the same method. But this time it's not working and I suspect I am using the wrong path in description.ext
If you are overriding BIS_fnc_reviveOnState, your first level should be BIS, not A3. I'm not sure if overriding the bis functions with the function library works at all but if anything you'll want to try that. The second level doesn't matter. The third looks right.
You can't overwrite config functions from a mission
I can do this with a CDLC function. Maybe the base game is different in some way?
BIS_ functions are protected iirc (though you can still just modify the config with a separate mod)
Oh wow that seemed to do the trick. I can print a hint with "my" version. I just copy and pasted BI code into my replacement of that file. So it has been successfully intercepted. Got some errors but this is progress.
That's a really nice finding. Great to know we can to this
And if you ever need to find a function, just type something in the search field.
https://steamcommunity.com/sharedfiles/filedetails/?id=1678581937
In mission rather than mod config?
I don't know what mod config is. But I am testing this in my mission if that helps answer your question.
yeah
Mod config is config that is in a mod
So now, my job is to insert my convo function into BI's revive system. I placed a hint in there so I should be able to get that to work. I'm not sure if it will accept _caller/_target, but I'll try.
I also get an error on death related to fn_holdActionRemove.sqf. So I wonder if I need to intercept that one as well.
There may be file included, which you don't have
I did copy/paste 3 include files into my functions folder which cleared up the other errors.
I see, so it should technicaly work then
And those files have their own include but I dont get errors on mission load so maybe that is working ok
3 files? I see 4 being included from the same folder
Hello, can someone help me finish writing the ORBAT for Task Force Aegis or explain to me how I need to write the rest? class CfgORBAT
{
class AKO
{
id = 0;
idType = 0;
type = "Infantry";
side = "West";
size = "Company";
commander = "Johnson";
commanderRank = "Captain";
text = "Alpha Kompanie";
textShort = "A KO";
description = "";
class 1Z
{
id = 0;
idType = 0;
type = "Infantry";
side = "West";
size = "Platoon";
commander = "Robinson";
commanderRank = "Lieutenant";
text = "1.Zug";
textShort = "1.Zug";
description = "";
};
class 2Z
{
id = 0;
idType = 0;
type = "Infantry";
side = "West";
size = "Platoon";
commander = "Edwards";
commanderRank = "Lieutenant";
text = "2.Zug";
textShort = "2.Zug";
description = "";
};
class 3Z
{
id = 0;
idType = 0;
type = "Infantry";
side = "West";
size = "Platoon";
commander = "Phillips";
commanderRank = "Lieutenant";
text = "3.Zug";
textShort = "3.Zug";
description = "";
};
class 4Z
{
id = 0;
idType = 0;
type = "Infantry";
side = "West";
size = "Platoon";
commander = "Burr";
commanderRank = "Lieutenant";
text = "4.Zug";
textShort = "4.Zug";
description = "";
};
};
}
My mistake. Yes there are 4 included. I went ahead and put those in my functions folder and also intercepted the file that was throwing the error on death (fn_holdActionRemove.sqf). I still the the error, so I blocked out the intercepted files in description.ext to see if that is the issue and I still get the error. So now I'm restarting the game to see if I need to do that after changes I've made.
After restarting and disabling the revive in eden editor I still get the error pointing to that file. So it might not be related to my messing around with this stuff.
From the console I do player setdamage 1;
Maybe this is an error I have always had but it's just showing its head now as a coincidence.
haaaaaah please use pastebin or something e_e
Yep found it. It has nothing to do with overriding the A3 function. Ok back to poking and prodding that.
Overwriting from mission doesn't work for me. Dunno how have you achieved that
It didn't work the first few tries for me either. I was about to give up then tried one more time. I'm not sure what I did but it worked. And is still working.
Show me your description.ext
class CfgFunctions
{
class BIS
{
class HoldActions2
{
class holdActionAdd
{
file = "Functions\HoldActions2\fn_holdActionAdd.sqf";
};
};
};
};
Are you trying to modify the revive hold action like I am?
I'm asking what your goal is because I'm using a different file.
I've tried this one
What do you aim to do?
Nothing I just wanted to try to overwrite a function, based on what you've said
I thought it could be handy one day
Ah okay, then I'll just show you what I did and you can play around.
class CfgFunctions
{
class bis
{
class Revive
{
class reviveOnState
{
file = "functions\fn_reviveOnState.sqf";
};
};
};
In my funcitons folder are fn_reviveOnState.sqf plus the 4 include files.
At the top of reviveonstate put a hint. Then play in multiplayer and kill a client and the hint will pop up. Bingo!
I'm injecting my convo function into the holdAction for reviving. It already accepts _caller and _target! So I think this is going to work. Progress at the very least.
I've tried to call it from debug console
I gotta head out to work but I can help when I return in a few hours.
Is there a way to hook commands in such a way that I can control the use of them?
Just like normal hooking, you hook a command from your SQF and everytime somebody calls that command, it executes whatever code you specified, including the original command if you want to
I think it'd make up for cool things
I've also read somewhere (I think on this discord) that the game executes those commands as well, so yeah, I think it could make a good feature
You could create a function which does something prior to calling the command
Yeah, well, my idea is to try and defeat cheaters from executing commands (even tho they could bypass those hooks too, just adds a layer to it). And it would also be helpful to add more functionality in case the game (regardless of my server and scripts) actually calls those commands
Commands can be banned for remote execution
Totally feel for you. We deal with the same too. Our AC is pretty damn good but every once in a while someone finds a way around it and it is a large pain in the butt when they execute something like setUnitLoadout on every player in mission. Pretty much leaves us no choice but to add whatever the command is to CfgDisabledCommands. Which obviously then requires a lot of reworking.
I have thought about something, will take a deep look into my idea and hopefully I can make it not need any mods
@hushed turtle Did you get it working? Want some help?
No, it's ok. It doesn't matter
Jouklik don't need much help: he's Awsome imho ๐
holy shit i was just working on a enemy script i made: and now i made them basterds even better: they act like real now: lol its Awsome fun ๐
i made them dive on the ground if you shoot your weapon or any explotion happends: and they pop up to kneeling to see what's going on: lol looks so cool:
then they sneek around and investigate: and if they don't know what happend they start shooting like hell all over lol so cool lol ๐
Arma 3 is So Cool ๐
i did have it where they just bum rush you: like the whole enemy team: but that was way to hard: lol
What could be causing this block of code to silent fail (no error message)?
The commented version is hardcoded one level down and works fine returning true as intended if the player has proper headgear on.
Is it because the exitWith is exiting the block of code insdie curly braces and not the function itself?
How does the gane know what addaction to add when looking at vehicles? Sometimes get in driver is first, sometimes passenger. Is there anyway to execute "do top available action"?
Yes
Also you can just use findIf > -1
Awesome, working version attached for anyone who stumbles across this.
They are sorted by the "priority" parameter and if they have the same priority the newer one is at the bottom
Look at the priority parameter here https://community.bistudio.com/wiki/addAction
(optional): Number - Priority value of the action. Actions will be arranged in descending order according to this value. Every game action has a preset priority value. Value can be negative or decimal fraction. Actions with same values will be arranged in order which they were made, newest at the bottom. The bigger the number the higher the action will be positioned on the menu. Typical range is 0 (low priority. Eg: 'Get out') to 6 (high priority. Eg: 'Auto-hover on'). Default value: 1.5
that's for custom addactions, i think matey is asking about the un-modded vanilla actions like "get in as passenger"
Yea im trying to check out how vanilla vehicles handle the get in actions. Or to run code that does what ever highest priority addaction is
Well those actions should operate under the same rules for priority https://community.bistudio.com/wiki/UserActions
I'm not sure about running the highest priority one though
Maybe use https://community.bistudio.com/wiki/inGameUISetEventHandler PrevAction until you are at the top?
this is what I have for arranging composition objects in sequence. In objects init field (The code part is saved in the composition): ```sqf
this setvariable ["init",{ [_this,4] call setobjectSequence; }]; // This object is #4
You don't even need the exitWith
Just do the findIf > -1 and have the whole thing be the return
Thanks for the info, I'll check it out.
Hey, guys. I'm currently having an issue with TFAR. I've posted in the TFAR thread as well, but I don't want to bother nkey more than I already have. What I'm looking to do is place a radio backpack on the ground, and set the radio to speaker and the frequency to 70. I've got all the functions and pieces I need, but I'm not sure how to put it together. So far I've tried naming the radio backpack "speakerradio", and putting this in the init line: [speakerradio, "radio_settings", "70.00"] call TFAR_fnc_setLrFrequency;
[speakerradio, "radio_settings"] call TFAR_fnc_setLrSpeakers;
Here's the BI Forums thread for reference: https://forums.bistudio.com/topic/159393-task-force-arrowhead-radio/?p=2975208
So if I understood it correctly the backpack goes into a weaponHolder, and I need to use the everyBackpack function. Would I need to make an sqf and do "everyBackpack _WeaponHolder"?
Are config classes "BulletCore" and "BulletBase" good for checking if ammo is bullet?
https://community.bistudio.com/wiki/BIS_fnc_itemType has "Bullet" check
I wanted projectile type, not magazine
oh sorry
I always load shitty mods as a reference to check things like that ๐
Can a module be added through the server params settings? For example, if I wanted have the option to use the SOG Advanced Revive module, I can easily make the setting show up in the param but how would I call it since the only way I know how is to drop the module down in the editor.
I assume that the module is just a UI wrapper for a function call or something.
So presumably I could find the name of that function and call it in initServer.sqf?
That is completely based on how the module is setup internally.
The things you can customize are stored in variable namespace of the module object. Sometimes they have it set up that it's not compatible with a direct call.
You could also just create the module object and call it
the most foolproof is checking if it's shotBullet simulation
...But I cannot imagine someone not inheriting from at least BulletCore
How can I check if a unit's primary weapons is capable of automatic fire?
Get all modes of current weapon and check if they have autofire = 1
Wrote this on my phone, might have formatting issues
private _weaponConfig = configFile >> "CfgWeapons" >> currentWeapon player; (getArray (_weaponConfig >> "modes")) findIf { getNumber (_weaponConfig >> _x >> "autofire") == 1 } > -1; // true if there's a full auto mode
Thanks. But I'm getting "type array, expected config entery" on getArray _weaponConfig >> "modes"
Oh needs parentheses before _weaponConfig and after "modes"
I'm doing the following in console, and showing the isAuto result var:
private _weaponConfig = configFile >> "CfgWeapons" >> currentWeapon player; isauto=(getArray (_weaponConfig >> "modes")) findIf { getNumber (_weaponConfig >> _x >> "autofire") == 1 } > -1;
And its returning true for shotguns and m79 grenade launchers which aren't full auto... unfortunately
They may have modes for AI that are auto fire?
Only thing I can think of
Could also check if showToPlayer is 1, I think that's the property at least
I appreciate the help. I've done config modes checks on these weapons and they all return FullAuto in the array. I don't know if that is a Prairie fire thing or true for all Arma weapons or not.
When I do this command on player who has an M79 (which is obviously not an automatic weapon)
modes = getArray (configFile >> "CfgWeapons" >> primaryWeapon player >> "modes");
modes array has these values:
["Single","FullAuto","AICQB","AIClose","AIMedium","AIFar","AIOpticmode1","AIOpticmode2"]
Which mod's M79 is that?
I would guess the trouble is that weapons with a 1-round magazine could have fullAuto set and it wouldn't hurt.
And modders are usually like "if it works then it's fine"
These are prairie fire weapons. Same problem with their shotguns.
I may resort to a blacklist of PF known non-auto weapons, which sux
Are these single-barrel shotguns?
pump action single barrel
curious. I wonder how that works.
I guess if you hold the fire button down it'll fire again after the rack animation.
One does that...it's called slam firing. But the other does not have that feature. But obviously M79 must be broken open and reloaded.
I'm gonna check bolt action rifles now...
Bolt actions are normally another special case because they don't work the bolt until you release the trigger. Not sure what the config is for that.
Interesting. Bolt Action rifle did not contain "FullAuto" in modes list, but M79 grenade launcher does.
For my simple needs, I need to find the unit with greatest firepower in my squad to pick for a specific purpose. So I think I will check mag capacity instead.
thx
Have fun finding which wepons are fullAuto, when even double barrel shotgun has fullAuto mode ๐คฃ
hello all: so if i'm hosting: is my player considered (local player) and the server at the same time
Yes
oh nice thats Awsome
thx m8 @proven charm you see what i did there: rhyme ๐
get it m8 GenCoder8 ๐
sorry?
not sure i follow ๐
rhyme
ya it rhymes a bit ๐
lol ok lol ๐
i'm just in a happy mood ๐
as always ๐
So i have this Special reload script that i made: and i want to run it on any player that Activates the radio trigger in a Hosted server
and i have in the radio trigger in the Condition (local player)
and in the OnActiveation i have [player] call SFA_fnc_playerReload;
so would that work correctly
it works on the host: but i'm not sure it will work on any player that Activates the radio trigger
i did not have a chance to test it with all players yet
any coments or ideas or even giving me hell is ok ๐
i dont use triggers but if the trigger is activated via selecting the radio thing then I dont think your condition makes sense or has any effect
i think you dont need a condition if its radio
(local player) is always true in client and has no effect on dedi server
copy that
so i only host but its good to know if it would work on ded server also
so maby i should script a radio trigger on the clients mach
i think radio triggers can only be activated by client
maybe something like
firstBackpack theWeaponHolder
(why can't I press enter to send a message after doing ''' for code?)
(i know it's not actually ''' but if i type the correct symbol i can't send the message)
Hello, small issue with setFace, just want an AI with a tatoo.
I have this in my description.ext:
class CfgFaces {
class Default;
class Man_A3: Default {
class WhiteHead_01;
class FynnHead: WhiteHead_01 {
displayName = "Fynn Face";
texture = "img\Fynn.paa";
};
};
};
But the setFace fails with:
16:18:14 Error: Error during SetFace - class CfgFaces.Man_A3.FynnHead not found
16:18:14 Error: Error during SetFace - class CfgFaces.Man_A3.FynnHead not found```
It does work with a vanilla class like `Miller`. Any idea?
You can only define new faces in mods
@modern plank ^
(also your first script line makes no sense)
They know how to do it, they're trying to add faces in a mission, which you can't
ACE delays kill of weapon caches, since it does munition exploding sequence. Is there any event handler to catche this? Because of that "Killed" EH is delayed.
ACE provides the ace_cookoff_cookOffBox CBA event which fires when the cookoff starts
It's emitted on all machines as well
Should also note that if you want whatever you're making to work the same with and without ace cookoff, you'll probably want to listen to both killed and cookOffBox
I don't understand CBA events at all. I don't see anywhere explained what event is local or global.
To close my topic, you can go with this mod: https://steamcommunity.com/sharedfiles/filedetails/?id=2389052317 but no tattoo directly on the face, some on the throat, or build your own small mod. I will go with Tattoo Mod Pack for this time, but will probably publish a mod with different kind of face tattoos (good for fast identification through a scope).
Well it's different per event
https://ace3.acemod.org/wiki/framework/events-framework#210-cook-off-ace_cookoff
I will check if ACE is loaded and use correct EH based on that
ok
CBA events are just like BI's scripted event handlers but way easier for networking (i.e. telling a server / client to do something)
how can i disable the black background if mouse hovers above a button, is it possible?
0 spawn
{
disableSerialization;
waituntil {!isnull (finddisplay 46)};
private _display = findDisplay 46 createDisplay "RscDisplayEmpty";
private _para_playButton = _display ctrlCreate ["RscButton", -1];
_para_playButton ctrlSetPosition [0.45 * safezoneW + safezoneX, 0.75 * safezoneH + safezoneY, 0.1 * safezoneW, 0.1 * safezoneH];
_para_playButton ctrlSetTextColor [1, 1, 1, 1];
_para_playButton ctrlSetBackgroundColor [0, 0, 0, 0];
_para_playButton ctrlSetText "S T A R T";
_para_playButton ctrlSetFontHeight 0.1;
_para_playButton ctrlSetFont "PuristaMedium";
_para_playButton ctrlCommit 0;
_para_playButton ctrlAddEventHandler ["ButtonClick",
{
params ["_ctrl"];
_display = ctrlParent _ctrl;
_display spawn
{
_this closeDisplay 1;
};
}];
};
is BIS_fnc_taskPatrol working for boats ?
//not working boats are static
[_boatgrp, position (leader _boatgrp), 300] call BIS_fnc_taskPatrol;
maybe PosASL needs to be used ?
Commands usually expect Position AGL
Which is same as ASL when above sea
I don't see where I can specify to which object I want to add CBA EH. Do I have to add it for everyone and then check if _object in EH is same as some global var?
if you define new button class its probably one of these, (I forgot): ```
colorBackgroundFocused[] =
{
1,0,0,
1
};
colorBackground2[] =
{
0.75,0.0,0.0,
1
};
No, the CBA event handlers are local.
I.e. adding an event handler on the server doesn't make the event handler code run on the clients
You need to add the event handler wherever you want the code to run
@hushed turtle this make them patrol just fine
[_boatgrp, getPosASL (leader _boatgrp), 300] call BIS_fnc_taskPatrol;
Correct
Because CBA events aren't specific to any object
Like I said, they're like BI's scripted event handlers (but better)
Description of cookOffBox says global, so I guess that just means it can execute on all machines? Meaning will execute everywhere where I add an event
I don't know BI's scripted EHs
It means the event is emitted everywhere
If a machine doesn't have an event handler for cookOffBox, nothing happens on their machine
Thanks for advice. I understand it better now.
but this is from Description.ext, right? isent it possible with the ctrl commands?
I wonder if in case of 0 there will be no code execution or will do one iteration?
private _rn = selectRandom [0,1,2];
for "_i" from 0 to _rn do
{bla-bla};
In for? There will be one
It will do it once
yes. if its not possible via script commands then making class is the solution
holy shit guys: i'm just starting to get a little better at this stuff: thx so much for all your help: (you all know who you are that helped Me) WooHoo ๐
i just made a Awsome destroy Cache Script: and i think its a Master piece ๐
it choses a random marker on the map : markers are placed for control of locations: spawns the cache at that marker then moves the box to a random house pos and spawns enemy: and sets AO and Pint Point markers : which can be turned off in the params In the Discription.ext if wanted
thx so much guys im lovin it ๐
i even put comments in for any one that want to read them ๐
I try to figure out what is the "better" way of propagating data to all client: global variables vs CBA EventHandlers
Context: I want to implement some way to disable/enable BFT.
Using global variables:
// fnc_disableBFT.sqf
params ["_bftObject"];
// propagate new state as a global variable on the _bftObject
_bftObject setVariable ["CTAB_Has_BFT_Enabled", false, true];
// set last known position etc. as a global variable on the _bftObject
_bftObject setVariable ["CTAB_Last_Known_Tracking", [(getPosASL _bftObject),(getDir _bftObject), (direction _bftObject), (mapGridPosition _bftObject)], true];
// fnc_enableBFT.sqf
params ["_bftObject"];
// propagate new state as a global variable on the _bftObject
_bftObject setVariable ["CTAB_Has_BFT_Enabled", true, true];
Using CBA Eventshandlers
// disable BFT EventHandler
["CTAB_Disable_BFT", {
params ["_bftObject", "_lastKnownTracking];
// set new state local only
_bftObject setVariable ["CTAB_Has_BFT_Enabled", false];
// set last known position etc. as a local variable on the _bftObject
_bftObject setVariable ["CTAB_Last_Known_Tracking", _lastKnownTracking];
] call CBA_fnc_addEventHandler;
// disable BFT via Event
["CTAB_Disable_BFT", [player, [(getPosASL player),(getDir player), (direction player), (mapGridPosition player)]] call CBA_fnc_globalEvent;
// enable BFT EventHandler
["CTAB_Enable_BFT", {
params ["_bftObject"];
// set new state local only
_bftObject setVariable ["CTAB_Has_BFT_Enabled", true];
] call CBA_fnc_addEventHandler;
// enable BFT via Event
["CTAB_Enable_BFT", [player] call CBA_fnc_globalEvent;
Question:
- What is the preferred way for better performance?
- Is there event a significant performance improvement?
you can test it right ?
Mh never did it - where do I start learning performance measurements?
in the umm: shit i forget what its called now damit
you know when you hit Esc in game
Debug Console?
Just handle all the tracking locally on each client. For the love of god do not broadcast variables on every single object being tracked like every second
No the variables are evaluated later.
the functions are called once for each change of state
I am not a madman.
Evaluation is (just a random example from within the code):
// current position
_veh = vehicle cTab_player;
_playerPos = getPosASL _veh;
_heading = direction _veh;
_lastKnownPosition = [_veh] call cTab_fnc_getBftLastKnownTracking;
if (!(_lastKnownPosition select 0)) then {
_playerPos = _lastKnownPosition select 2;
// only position is disable so no: _heading = _lastKnownPosition select 4;
};
[_cntrlScreen,false] call cTab_fnc_drawUserMarkers;
Then there's just no point in using CBA event handlers there
The enable one is literally just setting a var to true
Also should really just use camelCase for those variable names and not make them "sentence-case"-esque
CTAB_Has_BFT_Enabled -> CTAB_bft_enabled
CTAB_Last_Known_Tracking -> CTAB_bft_lastKnownPosition
I still have problem with BIS_fnc_taskPatrol and boats ๐
it keeps finding positions on land instead of sea and on top of that it finds positions with much bigger distance than set in the function ...
[_boatgrp, getPosASL (leader _boatgrp), 300] call BIS_fnc_taskPatrol;
Rewrite the function so that it works as desired then?
good idea actually ... but too much work ๐ตโ๐ซ
couple of waypoints do the work
private _pos1 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
private _wp1 = _boatgrp addWaypoint [_pos1,0];
_wp1 setWaypointType "SAD";
private _pos2 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
private _wp2 = _boatgrp addWaypoint [_pos2,0];
_wp2 setWaypointType "SAD";
private _pos3 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
private _wp3 = _boatgrp addWaypoint [_pos3,0];
_wp3 setWaypointType "SAD";
private _pos4 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
private _wp4 = _boatgrp addWaypoint [_pos4,0];
_wp4 setWaypointType "SAD";
private _pos5 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
private _wp5 = _boatgrp addWaypoint [_pos5,0];
_wp5 setWaypointType "SAD";
private _pos6 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
private _wp6 = _boatgrp addWaypoint [_pos6,0];
_wp6 setWaypointType "SAD";
private _pos7 = [uberPos, 0, 2000, 5, 2, 0, 0, ["player_base"], []] call BIS_fnc_findSafePos;
private _wp7 = _boatgrp addWaypoint [_pos7,0];
_wp7 setWaypointType "CYCLE";
@split ruin why not just use LV patrols they work great
i could send you the folder if you like
or you can edit the Diver patrol script i sent you m8
Maybe I am misunderstanding the tone but #arma3_scripting and the entire Discord is supposed to be drama free. If I am being real though I don't really see where Scotty said anything to really instigate either. Dude's just wanting to learn, which is what this channel alike others are here for. Plus we're all friends here
!!
Shift-enter
well, it's plausible enough if you have west instead of east in the second one. Formatting though :/
Not sure if getUnitLoadout in a Killed EH works as expected because units drop their weapons on death. Would need testing.
is it not possible to get the objects init field via script? right now im using setVariable in the init field to make my own init code for composition object
@pallid palm I made a boat mission, divers will come in the next one, thanks for the script again ๐ป
Cleaned up, seems like a bot wave again ๐
how to get the player who activated a radio trigger?
you mean like "Radio alpha" ?
yes, the problem is its executing the code to everyone and I need it only for the player who actually activated the trigger aka where player is local
how to chek if object is local ?
local _object
not good with triggers ๐
they are very dark and undocumented area
Trigger has thisList array, doesn't it?
So I guess it would containt player who activated the radio. Hopefully only him
So: local (thisList #0)
yes, now I will get
_player = thisList select 0;
if (!local _player) exitWith {};
hope this will make the code run only to the guy actually activating the trigger ...
im getting empty thislist
Well that's bad 
๐ญ
Spambot wave with bitcoin spam ๐ฎโ๐จ
@hushed turtle , @proven charm I run the code just fine, no errors but need more MP testing
I'm getting empty thisList too
you want only one player to be able to use the radio trigger?
no, I just want the activation code to be executed on the machine of the player who activated it, nowhere else, not on server or other clients
maybe use https://community.bistudio.com/wiki/Arma_3:_Communication_Menu if that works better
already full ๐
I put there admin stuff like return to base, end session, activate next mission, etc
You could consider making a briefing tab instead
or use submenus
Question, so I want to script a thing, where when you press a button, that menu on the left side of your screen opens and you can select 1-9 an option and than do a hand signal and everyone around you gets a hint. (like SOG)
I WILL script it myself. Issue is I dont know where to start as I have no idea how that thing is even called, so I could look up on wiki xd
@hot sapphire dude wtf man sheees: i only host mission No Ded server
https://community.bistudio.com/wiki/BIS_fnc_createMenu
May not be the best way, but this should at least get you started.
https://community.bistudio.com/wiki/Arma_3:_Communication_Menu
Or here if you're looking more generally
How can I get the velocity of a projectile during flight? I have the following code but it keeps printing out only the initial velocity of the projectile instead of the real velocity, as in the reported velocity does not change at all during flight
Edit: I think the problem was the while-loop reaching the 10k iteration limit, was fixed by spawning the while-loop and adding a 0.1 second delay per iteration
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
systemChat "Projectile fired";
systemChat str _ammo;
while {!isNull _projectile} do {
hintSilent str vectorMagnitude (velocity _projectile);
};
}];
copy that m8
id use https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#EachFrame because there is no way to tell how fast that while loops
hay m8 did you get this to work ?
i'm not sure how to use this but this is what i found
//Local Execution:
_tr1 = createTrigger ["EmptyDetector", getPos player]; //(Creates it on the player's machine)
_tr1 setTriggerActivation ["Alpha", "PRESENT", false]; //(Sets it to be activated by "Radio Alpha")
_tr1 setTriggerStatements ["this", " hint 'You activated the local trigger' ", ""];
//(The condition this means "this trigger/player") is activating it,
//so the code runs only on that player's machine.
//ServerSide Actions (Optional):
//If the radio activation needs to trigger something global (like a task for everyone)
//the local onActivation code needs to call a server function using
_tr1 remoteExec ["yourServerFunction", 0]; //(0 means server)
i'm still afraid to try it ๐ cuz im not sure
it doesnt set the locality value tho (in createTrigger ) (But IDK if thats needed)
I know that!
i think cuz it creats the ragio trigger on the players mach,
so if the radio trigger is created on the players mach then it would be local to that player: yes ?
it's global by default
im not sure i understand
the part i dont understand is that a radio trigger has no radius so we can't use thislist
Yeah, maybe that's why thisList is empty when trriger is activated by radio
roger that
i'm still trying to do what Kiba was talking about: like getting the player that called the radio trigger
and only have that player Activate the script
_tr1 = createTrigger ["EmptyDetector", getPos player, false]; // Creates local trigger, wow

He wanted trigger for all player, but somehow catch who activated it
on the machine that you executed the command
yeah i can only seem to get a radio trigger to work on all players or just the host player
By this he can track who activated it, but if one player activates it, the radio won't just disappear from other player's machines. Since those wound be separate triggers. He would have to remove them for other players manually, if he wants only first player to able to activate it
// To make it only activate once and disappear from the menu:
_radioTrigger setTriggerStatements ["this", "hint 'Local Radio Alpha Activated!';
_radioTrigger setTriggerStatements ["this", "", ""];
_radioTrigger setTriggerActivation [player, "NONE", false];", ""];
//By making the trigger local and using this
//the action runs only on the machine of the player who selected the radio option
//making it perfect for specific player interactions in multiplayer.
again im afraid to try this ๐
I am too
lol he he
setTriggerStatements cannot be set twice ๐ค
What is that second line with \"\" even doing?
im not sure m8 im just a newbe
im hoping you guys can figure it out and tell me what im doing ๐
but I don't undestand those \
yeah im not sure what thats for myself ๐
but if i get this stuff to work, i don't want the radio triggers to go away, i want them to stay on the players mach, and set the radio triggers to repete
It looks like those are meant to escape the " because those are syntax-relevant characters in whatever context this was written in. Where did you get this?
i can't remeber i think it was on the wiki
i was just grabing stuff to try to figure it all out
but im not sure where i got it really
Seems likely. I think " means stuff in wiki markdown. It should've been invisible to the reader but oh well, it's not always done right.
I'd strongly recommend that you read and understand the code before pasting it and telling other people to use it, though.
You can set trigger to repeating using setTriggerActivation
https://community.bistudio.com/wiki/setTriggerActivation
oh sorry i did not tell others to use it: was hoping they could figure it all out for me: from what i found
right now: i can only have radio triggers work on all players: or only the host player
so like Kiba was saying: i would like to target just the player that Activated the radio trigger
but i don't know how to do that yet: ๐
you can try
if (!local player) exitWith {};
//code
in the "on activation" field of radio trigger
wat
did you try it does it work ?
I tried
_player = thisList select 0;
if (!local _player) exitWith {};
seems to work, no errors but need testing in real MP
ok cool thx m8
i'll try it and i'll let you know
w8 a min there's no thislist on a radio trigger
a radio trigger has no radius
players can not be in a radio trigger
they can only Activate a radio trigger
thisList is whoever activates the trigger's condition
oh hmmm ok i'll try it
lol now you got me thinking lol
really i think we must
i think what i must do is: if the player Activates the radio trigger on the server: then i must send the info to the players mach: then back to the server: to get only that player to Activate the code
or something like that
in a hosted server
Its simpler ... the code is executed on every client but the server (or only on server if you checked server only). We need the code to be executed only on one client that activated the radio trigger and since there is not such option we just exit the code on every one else client but one. Its the same idea like
if (!isServer) exitWith {};
but condition is the player object should be **local ** to player's machine
or it "owns" this unit
hmmm ok m8 i'll try it and see what happends
I already test it and work without errors and the radio trigger works too
I need Saturday to come faster so I can check when we play MP
I suspect if you use player command it already selects the local player, that's why @winter rose reacted
@pallid palm yesh in the beginning
then you put your code
copy
hmmm i'm not sure i understand: cuz all players are local, i'm not sure whats hmmm happening here
in the onActivation of the radio trigger i have ```sqf
[] spawn SFA_fnc_playerDoWhatever;
i'm almost sure that
_player = thisList select 0;
if (!local _player) exitWith {};
is only working on the host player
if this: #arma3_scripting message
is inside of this: #arma3_scripting message
then you aren't passing anything to that function so _player is always nil
copy that
You can't exit code on every one's else machines when you don't even know who activated it
yeah radio triggers are funny knida
i'll get it right some day
or one day
there is 1 sure way to do this: is to make a radio trigger for each player on the server: but i don't want to do that
cuz my chopper command uses 5 radio triggers
Isn't possible to create radio using purely scripting anyway? Like completely avoiding triggers, even scripted ones?
by gorge i think i got it Woohoo
we will see i'll let you know Woohoo ๐
this is what iv come up with
//Scripting with remoteExec
//Global Trigger:
//Place one radio trigger in the editor that all players can activate (e.g., Radio Alpha).
//Server-Side Script:
//Have the trigger call a script (e.g., DoWhatEver.sqf) on the Server.
//remoteExec in Script:
//Inside DoWhatEver.sqf, use remoteExec to run code on the specific client who activated it.
// In the global radio trigger's "On Activation" field
[player] remoteExec ["DoWhatEver", 2]; // Send the activating player to server (2)
//in my case i use
[player] remoteExec ["SFA_fnc_DoWhatEver", 2];
// In a separate file, DoWhatEver.sqf
// This code runs on the server, receiving the player who activated it
params ["_activatingPlayer"];
// Then use remoteExec to run a *local* command back to that player's machine
_activatingPlayer = _activatingPlayer; // Ensure it's the actual player object
_activatingPlayer remoteExec ["my Local effect", _activatingPlayer];
//Key Concepts
//player Variable:
//In a trigger's local script (or remoteExec target)
//player refers to the unit on that specific machine
//Trigger Locality:
//Standard radio triggers activate globally in multiplayer
//but their On Activation code runs locally on each client, which can be tricky
by gorge i think i got it Woohoo
How do you know who activated it?
well atm i just have this in the condition
but i may need to change that
like maybe local player
or player == player or something like that
im still trying to get it better
i have this in the coditiond and it seems to work
but need to test it on hosted server soon
but i kinda knew we had to send info back to the players mach. anyway
so do i get a pat on the back for that ๐ lol
he he
just kidding ๐
It's kind of a standard pattern :P
You can use remoteExecutedOwner instead of sending the player, but that doesn't work if the originating client was a headless client.
copy that thx m8
oh yeah, also doesn't work in SP. So I'd generally avoid it.
i found it works in SP
but i may be just luckey im still trying to get it all together
the script that i run is only 9 lines
but you know me im trying to learn as much as i can
at my age i don't have a life time left ๐
I guess it'll return 0 in SP which kinda works as long as you're only using it as a remoteExec target.
roger that
thats a roger
its so much fun tryin to get this stuff to work
for me anyway
if (behavior Target_Contact == "Combat") then {titleText ["You spooked the contact", "PLAIN"];};
I haven't scripted in a while and feel like a legit idiot
I'm using this as the condition for a trigger and it kind-of makes sense to me but I can't figure out what's the problem
would anyone be able to help?
Well Nevermind, seems like its just not highlighted for some reason. I was thinking of behavior isn't a command is your first issuecombatMode
If you're trying to use some AI garbage, don't.
damn.
I'm just throwing together comments from the bohemia website
Because that code isn't returning a true/false value, which is what a condition should be.
You should just have behavior Target_Contact == "Combat" in the condition code, and put the titleText in the On Activation / Statement section (can't remember the name)
thank you
hmm. Does behavior work? I thought it was just the english spelling.
Of course setMarkerColor is American spelling.
That's probably why
I copy/pasted from their code
I think I read that page a couple times before I noticed the u
Is it possible to drag a dead body?
Dragging bodies (alive or dead) isn't a vanilla feature
Is there a workaround?
There are however animations for it, so it's not hugely difficult to implement. At least for the live ones.
Yeah
ACE has the most commonly used carrying/dragging, which yes does allow dragging dead bodies
I vaguely recall some recent change that might have allowed dragging corpses? Not sure how that'd work though.
I've ever tried addForce workaround. It was messy solution but it I polish it it maybe would shine like a good solution
ACE just uses a dummy unit that you drag instead, and just swaps them on drag start/end
yeah that makes sense.
I mean probably as easy as just setting actions, animations and attachTo right? I think KOTH does it in Vanilla iirc?
Which actually would work like a funny ragdoll sandbox game
For AI dragging we attach the AI unit in the dragging position to an invisible one that's walking normally.
So i could attach a dead body or has to be a living body?
Whatever ACE does is usually the best way :P
They have a lot of experience in weird hacks.
Hey guys, looking for a scripter for my project - anyone looking to join a project ?
I guess i will setUnconscious the unit and drag him, thats the safest way
Using the animations too
need to be ๐
๐
its passion, i'd make love to it if i could :p
there is one kind-a dragging in vanilla:
Dragging your feet the next day from Coding all night ๐
just a little joke ๐
Hay make sure you guys are eating right: good food and stuff: we don't want to lose anyone: we need you guys so much ๐
well i need you guys so much ๐
Man, I just cant get this sound to work...
Filed under root folder \ sounds, as 'IncomingAlarm.ogg', with
class CfgSounds
{
sounds[] = {};
class incomingalarm {
name="incomingalarm";
sound[]={"sounds\IncomingAlarm.ogg",1,1};
titles[]={};
};
};
in description.ext.
and just "IncomingAlarm.ogg"?
Yeah, that's the file name and extension. using
playSound "incomingalarm";
Just produces the 'Sound IncomingAlarm not found' error popup.
Debugbox, trigger, doesn't matter.
saving = 0;
//thx Lou Now i got this right
class CfgSounds
{
sounds[] = {};
class Cool
{
name = "Cool";
sound[] = {"sound\Cool.ogg", db+10, 1};
titles[] = {};
};
};
```ok i fixed it Lou thx Mate
no I mean, if you used "IncomingAlarm.ogg" in sound[]
iirc (but maybe I'm wrong), the game looks by default in the /Sounds/ dir, I may be terribly wrong ofc
use quotes please, also keep titles[] empty if there is nothing to show
copy that
Hrn, I may be unfortunately on to something; I stripped out that section and made a blank VR map scenario, threw it into it's description.ext and copied over the Sounds folder, and it worked.
I'm working with my Arma group's mission framework, maybe they did something wonky that redirects where it's looking. I'll have to bug them directly :/
nay, it's engine only
... actually, now that I reopened it, I'm seeing the issue ๐คฆโโ๏ธ
They have a whole paragraph explaining how to use the section for new missionmakers, but forgot to mention they comment-blocked it all out.
Lou what do you mean: use quotes please ?
sound[] = {sound\Cool.ogg, db+10, 1};
// โ โย โ
sound[] = { "sound\Cool.ogg", db+10, 1 };
because the engine tries to fix your mistakes
make it not
I don't remember if A3 supports forward slashes, it should do both
was thinking cuz its a config file
it does Both ๐ people say no: only back slash \
Hello, can someone help me?
I am trying to make SP mission in Editor and faced a problem: I can't understand how to make unit speak in chat, like with his name and text.
I searched how do it, and sadly it seems impossible to do through modules. I placed a trigger and wrote this in In Act field:
unit1 sidechat "text";
sleep 5;
unit sidechat "text";
It gives error 'Suspending not allowed in this context'. How can I make unit speak without messing with code in mission folder outside the game, is it even possible? And I don't understand how to force his name to be visible, it only gives 'Alpha (Alpha 1) "text"'.
tldr: you use spawn
Long answer: https://community.bistudio.com/wiki/Scheduler
Also no to crosspost, thanks
Thank you, I'll look into it
Sorry for crosspost, didn't knew where to ask
The second part of your question: using sideChat, you can't make the unit's name appear. Built-in channels like Side have their own rules for what callsign is displayed, and in the case of sideChat, for AI it's only their group ID. You can either set the group ID to be what you want (setGroupID/Global) or create a custom channel with whatever callsign suits you.
// which is correct in the description.ext ?
enableSaving = [false, false];
enableSaving = {false, false};
im not sure
Seriously, you have been hallucinating yourself at least twice, and this one is the third one
hallucinating yourself what does this mean
meaning "you hallucinated twice"
also see https://community.bistudio.com/wiki/Description.ext#saving
whenever there is doubt, see the doc please
Wow, Arma mission making is complicated I see.
Thank you, I'll try to get it work
ok thx you could of just showed the wiki: insted of being nutty don't you think
but i see some people have personal things going on: be that as it may thx any way
I actually showed you one of the wiki article
yeah and thats good thx
@warm hedge @hallow mortar
Sorry for a ping, but I don't really understand how to use "spawn".
I don't know anything about how to code, thought it will be easier to learn how to make missions.
Can you help me and tell how to properly make units speak in chat, please? Google doesn't help at all.
There are two contexts for executing SQF code in Arma 3. Unscheduled, and scheduled. Unscheduled code is executed right now, in the current simulation frame. It's not managed by the script performance manager (the scheduler) and cannot be delayed. This makes it good for time-sensitive applications, but it also means slow code can result in slow frames, and you can't use suspension like sleep. Trigger code fields are unscheduled.
spawn is used to create a new scheduled thread. The thread is managed by the scheduler, and is allocated a per-frame time budget. If it exceeds the budget it can be delayed to the next frame. Because the scheduler is able to delay and resume threads, scheduled code can use suspension like sleep.
Because you're in an unscheduled context and you want to use suspension, you should use spawn to create a new scheduled thread to execute your code in.
In case it wasn't clear, neither is correct. enableSaving is an SQF command; description.ext is a config file. You cannot directly use SQF commands in config. If you want to manage saving through description.ext, you need to use the equivalent config attribute, which Lou linked to.
Thank you for such detailed answer.
Yes, I understand what 'spawn' does and why I need to use it.
I mean, I don't know how to paste it in code. Like it doesn't work:
spawn;
unit1 sidechat "text";
sleep 5;
unit sidechat "text";
```I know I just being stupid, but I didn't found any info about how to use it exactly on Wiki.
oh i see thx Nikko
https://community.bistudio.com/wiki/spawn
This page contains a description of the syntax and some basic examples
_arguments spawn _code```
Your code doesn't require any arguments, so that can be `0`. Your code is...your code, so we slap that in there. So:
```sqf
0 spawn {
unit1 sideChat "something";
sleep 5;
unit2 sideChat "something else";
};```
God bless you, Nikko.
It seems I need to learn how to code things before making missions in Arma.
Didn't knew anything about 'arguments' and why do I have to place brackets in start and end of code.
"arguments" is just the technical term for "information that needs to be given". Sometimes it's also called "parameters". In the case of spawn and call, it's anything you want to make specifically available to the new code. It's a good way of making one piece of code that can accept dynamic inputs, instead of hard-coding specific references.
And I still don't understand how to make units actual names displayed instead of their group name...
Tried to create custom channel - seems to be too complicated and I was immediately scared. And I can't understand what is 'group ID' and how it works.
The brackets are used to indicate a Code data type. It's like putting a piece of code in an envelope so it can be manipulated and passed around before being given to a command like spawn, which opens the envelope and reads the code to execute it.
Thank you, Mentor.
I really appreciate your help. Such explanations mean a lot to me.
Group ID is the displayed name of the group. I think the field is called "Callsign" in the group's Editor attributes. It's displayed in various places throughout the game, including the sender information in the Side channel.
Working with custom channels is a little complex, but those are your choices: make a custom channel, or keep using Side chat and change the group's callsign.
Or you could choose to not use chat channels at all, and instead use subtitles: https://community.bistudio.com/wiki/BIS_fnc_EXP_camp_playSubtitles
I am just trying to port one of my favorite missions from Arma 2 and units speaking in chat are just giving a right vibe.
Anyone else having issue with their C# ?
Just got back into plugin creation a week ago and been chipping away at something which I been thinkin of
Tried a simle hello world, nay say
Quick question regarding the Arma3 scheduler.
When a script runs in a scheduled environment, it says it can run for a max of 3ms before it gets interrupted...
Whenever the scheduler decides to run the script again, does it resume from previous line where it stopped? what's the actual behaviour and how does it affect script semantics?
Yeah, it resumes exactly from where it was.
I'm not sure what exact scheduler break rules are. Loops can certainly be interrupted halfway.
Is there any way to return all variables attached to a certain namespace? eg. profileNamespace
Alright, I was reading through Advanced Equipment github repository (the ArmaOS mod if you know what I'm talking about) and a user opened a pull request where he proposes a revamped version
In said revamped version he basically implements a way to do mutexes, but in theory they can't work because the scheduler at any point can interrupt the current "thread" and in doing so breaking atomicity.
Thanks for your answer
p.s. I'd like to provide you with a link but I was blocked by automod ๐
It's not "at any point" and you can make substantial expressions that are atomic
even without using isNil {}
But the atomicity is not documented.
I get it, better to try and understand then throw something at a wall and make it stick but like... come on dude ๐ฆ
Is there anyway to trigger the Zeus' atomic bomb through a trigger or is the module the only way?
Typical italian crashout ngl
Specially coming from naples
Damn dude I have read the whole lore
The module works by calling a function, and it is possible to execute that function without the module. However, it's a fairly complex system and you'd have to read it quite thoroughly to figure out the parameters. I did it once, I don't remember what I had to do, and I don't want to do it again :U
The atomic bomb module is added by a mod btw, either Zeus Enhanced or Ares/Achilles. You should be able to find it in the Functions viewer under that mod's category, or you can look up the mod on Github and read the code there.
Thanks, I'll give it a look
hallaucinates?, don't you think ur going a bit far here? this is a channel for arma 3 scripting not for throwing mockery or insults mate
just keep things civil
Tbh I just thought the community (including @warm hedge) would have more love for veterans.
Why don't you f off of him then? 
I don't care how 'correct' he is, he means good and tries to help others. That counts.
I need to admit I made an unnecessary hostility and results a series of clutter which should not take place in this channel (nor anywhere this server actually). I can try to justify myself but I should not for reasons, <@&105621371547045888> may act if I needed to be punished. For the record I'll leave it for now and I for one will not moderate myself since it's going to be extremely unfair, but moderators may, so please don't put more replies to the tree
@tough abyss i cannot imagine of any system capable of holding a ton of units with different groups to prevent em from clunching
right now ... i try some weirdo combination with doStop and various other commands ... it kinda works ... however ... they rly just stand aroudn right now which is kind of expected as i ordered them to "do Stop" ...
i hate arma sometimes
also uncalled for.
anyway POLPOX is right here, let's not make it X vs Y โ this channel is about helping and sharing, modding is about helping and sharing, and I recommend everyone reading and abiding by @old owl's message: #arma3_scripting message
quick sanity check, if you remotexec an addaction does it effect hide on use paramater functionality?
@lime rapids not at all it should function just as it is, though be careful with remoteexec
