#arma3_scripting
1 messages ยท Page 205 of 1
Creates a local marker at the given position - the marker only exists on the machine that created it.
https://community.bistudio.com/wiki/createMarkerLocal
so if im a hosted server then that would mean all clients would see this marker is that correct
No
the marker only exists on the machine that created it
Means there is no networking about it
It is literally the point of createMarkerLocal being local
Same to other marker commands
i see ok thx m8
Yeah I started writing something similar. How did you get the ordering to go properly since using allGroups just has random ordering to each group. I've got atm a while loop and it basically has a current index it's working on and only when no other groups with the same index are left it moves up to the next index
Ahh okay
grab the units in a group entity, grab the first one that exists, use that group
slightly JIP incompatible
does this function save the "probability of presence" of objects?
BIS_fnc_objectsGrabber
Is there any BIS missions that are a good example of their ORBAT system?
some campaign missions
Can I put event scripts (onPlayerRespawn.sqf) in a mod and have it affect every mission that's run with the mod loaded?
The specific script names are just for missions, you'd need to add an actual event handler for it
Example using CBA's extended event handlers (this would just go in the config root):
class Extended_Respawn_EventHandlers {
class CAManBase {
class YourPrefix_yourAddon {
respawn = "call YourPrefix_fnc_handleRespawn";
};
};
};
Ok thanks. I'll have to look into the extended event handlers
Tl;dr, it's an easy way to add event handlers in config
https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)
To expand on this, this is what preInit.sqf and postInit.sqf are for in CBA as well as the preInit and postInit tags in CfgFunctions.
https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Attributes_3
the preInit attribute (formerly known as "forced") can be set to 1 to call the function upon mission start, before objects are initialized.
the postInit attribute can be set to 1 to call the function upon mission start, after objects are initialized.
the preStart attribute can be set to 1 to call the function upon game start, before title screen, but after all addons are loaded.
I'm looking at this ORBAT stuff and it's really cool, but the whole idea of having a tree view of the team is that you can see who is leading and stuff but there isn't a way to define player names in the class right?
doesn't show any hint ... ๐คท
['tsk','SUCCEEDED', true] call BIS_fnc_taskSetState;
Are you sure the task name is correct?
no but you can define their units
~
i dont think my thing exactly fits your solution
yes its "tsk"
I mean the BIS orbat thing
yea thats static
Do these carry the same params as the base EH's?
I'm seeing a lot of _this select 0 and so on in the examples
It's the same, it's just passed as an array
I think vanilla has some cases where it's just the value
if (!isNil "remoteExecutedOwner" && { clientOwner != remoteExecutedOwner }) exitWith {};
that line of code at the top of my module script should ensure that the module only runs once and it will only run for the person who placed the module correct
invalid, because remoteExecutedOwner is a Number
but why though why would that fail
right now the its still passing and running globally I just need to be able to have the module run for the one person who placed it is all
isNil "remoteExecutedOwner" checks whether the value of the variable remoteExecutedOwner in missionNamespace is nil.
This is unrelated to the remoteExecutedOwner command.
Most likely you don't have a variable remoteExecutedOwner in missionNamespace, so the exitWith won't be taken.
commands are not variables. Even commands with no parameters (nular commands).
alright so then in order for that to work I should do something like
private _reo = remoteExecutedOwner;
if (!isNil _reo && { clientOwner != _reo}) exitWith {};
It's never nil.
isNil does not take number
Cant you add an event handler with condition of checking the unit model to that of AAF?
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
private _classnames = [
"I_TargetSoldier", "I_soldier_F", "I_Soldier_lite_F", "I_Soldier_A_F",
"I_Soldier_GL_F", "I_Soldier_AR_F", "I_Soldier_SL_F", "I_Soldier_TL_F",
"I_Soldier_M_F", "I_Soldier_LAT_F", "I_Soldier_AT_F", "I_Soldier_AA_F",
"I_medic_F", "I_Soldier_repair_F", "I_Soldier_exp_F", "I_engineer_F",
"I_crew_F", "I_helipilot_F", "I_pilot_F", "I_helicrew_F", "I_officer_F",
"I_Story_Colonel_F", "I_soldier_UAV_F", "I_Soldier_universal_F",
"I_Survivor_F", "I_Soldier_unarmed_F", "I_diver_F", "I_diver_exp_F",
"I_diver_TL_F", "I_Spotter_F", "I_Sniper_F", "I_Soldier_AAR_F",
"I_Soldier_AAT_F", "I_Soldier_AAA_F", "I_support_MG_F", "I_support_GMG_F",
"I_support_Mort_F", "I_support_AMG_F", "I_support_AMort_F", "I_Soldier_VR_F",
"I_Protagonist_VR_F", "I_ghillie_lsh_F", "I_ghillie_sard_F", "I_ghillie_ard_F",
"I_Captain_Hladas_F", "I_UAV_AI", "I_UAV_AI_F", "I_Fighter_Pilot_F",
"I_soldier_UAV_06_F", "I_soldier_UAV_06_medical_F", "I_soldier_mine_F",
"I_Story_Officer_01_F", "I_Soldier_LAT2_F", "I_Story_Crew_F",
"I_Officer_Parade_F", "I_Officer_Parade_Veteran_F", "I_E_Uniform_01_F",
"I_E_Uniform_01_tanktop_F", "I_E_Uniform_01_shortsleeve_F",
"I_E_Uniform_01_officer_F", "I_E_Uniform_01_sweater_F",
"I_E_Uniform_01_coveralls_F", "I_HMG_01_F", "I_HMG_01_high_F",
"I_HMG_01_A_F", "I_GMG_01_F", "I_GMG_01_high_F", "I_GMG_01_A_F",
"I_HMG_02_F", "I_HMG_02_high_F", "I_Mortar_01_F", "I_static_AA_F",
"I_static_AT_F", "I_Heli_Transport_02_F", "I_Parachute_02_F",
"I_Plane_Fighter_03_CAS_F", "I_Plane_Fighter_03_AA_F",
"I_Plane_Fighter_03_dynamicLoadout_F", "I_Heli_light_03_F",
"I_Heli_light_03_dynamicLoadout_F", "I_Heli_light_03_unarmed_F",
"I_Plane_Fighter_04_F", "I_Ejection_Seat_Plane_Fighter_04_F",
"I_Plane_Fighter_03_Cluster_F", "I_Plane_Fighter_04_Cluster_F",
"I_UAV_06_F", "I_UAV_06_medical_F", "I_Quadbike_01_F", "I_MRAP_03_F",
"I_MRAP_03_hmg_F", "I_MRAP_03_gmg_F", "I_Truck_02_covered_F",
"I_Truck_02_transport_F", "I_Truck_02_ammo_F", "I_Truck_02_box_F",
"I_Truck_02_medical_F", "I_Truck_02_fuel_F", "I_Truck_02_MRL_F",
"I_APC_tracked_03_cannon_F", "I_MBT_03_cannon_F",
"I_APC_Wheeled_03_cannon_F", "I_LT_01_AT_F", "I_LT_01_scout_F",
"I_LT_01_AA_F", "I_LT_01_cannon_F", "I_Boat_Armed_01_minigun_F",
"I_Boat_Transport_01_F", "I_SDV_01_F", "I_UAV_01_F", "I_UAV_02_F",
"I_UAV_02_CAS_F", "I_UAV_02_dynamicLoadout_F", "I_UGV_01_F",
"I_UGV_01_rcws_F", "I_UGV_02_Science_F", "I_UGV_02_Demining_F"
];
if (typeOf _entity in _classnames) then {
_entity joinSilent createGroup west;
};
}];```
I took the classnames from https://community.bistudio.com/wiki/Arma_3:_CfgVehicles_GUER
(next time just @ me to respond quicker lmao)
- I wouldn't recommend checking for actual vehicle types, they can't join groups
- checking for unit types that exist solely to support uniforms and will not actually be spawned is pointless
- rather than prescribing specific classnames, you could use
isKindOfand just check if they inherit from the base AAF unit that all AAF units inherit from - you could also check for the unit's
faction
true i just typed this from mobile
Don't copy paste my code exact, as NikkoJT stated above, you are better off using isKindOf in lieu of typeOf - That way you dont need to use classnames exclusively.
Refer isKindOf ( https://community.bistudio.com/wiki/isKindOf ) from the BIKI and use the base class of AAF soldier. This way you are exclusively assigning the soldier to the group.
It might also be better to handle full groups together, rather than units, otherwise you'll end up with a lot of single-unit groups
Yea my haphazard implementation is just for a PoC/Idea. There are more optimized way of doing this. As for where to put it, @burnt matrix, you place them in the init field in the mission file (or just create an init.sqf and place it in the mission foldeR)
Something like this shouldโข do it:
addMissionEventHandler ["GroupCreated", {
params ["_group"];
if !(local _group) exitWith {};
if (side _group != independent) exitWith {};
private _newGroup = createGroup west;
_group setVariable ["jax_switchedGroup", _newGroup, true];
_group addEventHandler ["UnitJoined", {
params ["_group", "_newUnit"];
if (faction _newUnit == "ind_f") then {
_newUnit joinSilent (_group getVariable ["jax_switchedGroup", _group]);
};
}];
}];```
โณ
is there a script for d-day type pillbox fire because im doing "shooter suppressFor 100;
shooter doSuppressiveFire player;" on an enemy unit and its not giving me the results i like
@tranquil nymph there is a PR open to ACE for automatic AI to HC transferring, includes HC detection, it's pretty straightforward
Link @warped thicket ?
on HC it will notify all other machines that an HC has joined
in ACE that event simply adds it to the connected HCs array which is then used for AI passing
Does it copy things like init fields, waypoints etc.?
Really?! Is it new?
there are edge cases like support modules not functioning after move, but I added a blacklist variable that can be used on the group using that
no it's not new
from 1.40
there have been some scripts poking around using it for some time now, but they were all in one giant loop
I decided to make it fully event-based, nothing runs in a constant loop anymore
Hmm how come I haven't seen this before. Our group uses WerthlesHeadlessKit atm, is this PR a better solution do you think?
I am not sure what all WHK does
Oh sorry, just read your message, it is. WHK is loop based
its just firing in bursts at my player and not really cutting down my troops when the vehicle door opens
basically if nothing spawns, rebalancing of AI won't happen at all
it only does it on spawn of a unit (or player connect because at that point isPlayer check doesn't appear to work, not sure why exactly though), and even then there is a minimal delay you can specify
default 15s I think
So say for example I place units in the editor and the mission plays on the server, then a zeus joins and places units, it all goes to HC as soon as those units spawn?
after minimal delay yes
Awesome
delay is there because you never spawn all units at once
so you spawn one here, one there... etc, it makes sure everything stays in sync and no lag happens
Are you saying you want them to fire some MGs constantly and hrash, not burst?
I'm a bit of a newb when it comes to ACE, but do I just merge this PR with our version of ACE and it does the rest of is there some more configuration to be done?
you should be able to merge it if you want yeah, you'd have to rebuild the mod
milestone is set for 3.5.0 currently so I guess it'll be released with 3.5.0 ๐
Damn I can't wait that long
heh
you can also grab a version of it here https://github.com/Theseus-Aegis/tac-a3-mods
just remove all PBOs except main and headless
it's identical to the ACE PR actually
just under different namespace
Ah yeha
Zeus spawns units locally, and event handler for spawn is local to the machine
hopefully it works, we've only tested it on one session so far
with logging enabled, and the only problem is that it also does rebalance on player connects, isPlayer is failing for some reason
Well it's certainly miles better than our current HC support
We've had sooo many problems with UPSMON breaking
yes
I wrote it just because I wanted 0 performance impact for AI transferring and because I had too much time ๐
AI scripts may still break with this one
it's totally up to how the script works
Hello All: i'm still not sure: if i place a marker in the editer: and Host server the mission, would all clients see the marker
Well the problem we had was the minute HC took control, any init field stuff was lost
Yes
did it recreate the unit?
Not sure
don't know, setGroupOwner hasn't failed me so far
Yeah I don't even think WHK uses it, seems like it's all manual
Anyway, thanks tons dude, this has/will change a lot for us!
I haven't looked that closely at other scripts to know, all I saw is a constant loop
have fun, make sure to report bugs ๐
Will do ๐
๐
You actually need to script it. Let's say using while command and BIS_fnc_fire function to force them fire every once in a while (0.02 ish seconds)
and combine that with dosuppressivefire?
I don't think that's a useful command in this context
@foggy pike Thank you for asking all the right questions tonight. I've been looking at the exact same things for our group, but luckily you beat me to the punch, when it came to asking questions here. So just being away for a couple of hours, and coming back to see all this info, it's sweet. Naturally @warped thicket and @cptnnick deserve credit too, for providing good answers and feedback ๐
I want to save score to every player profile but no luck ... ๐
//initPlayerLocal.sqf
private _pScore = profileNamespace getVariable "KIB_PlayerScore";
[_pScore] remoteExec ["addScore",2];
//initPlayerLocal.sqf
sleep 60;
while {true} do
{
private _pScore = (getPlayerScores player) select 5;
profileNamespace setVariable ["KIB_PlayerScore", _pScore];
sleep 120;
};
maybe I have to spawn the loop? ๐ค
private _pScore = profileNamespace getVariable "KIB_PlayerScore";
[_pScore] remoteExec ["addScore",2];```
- if `KIB_PlayerScore` has not yet been defined, this will fail
- ~~if `KIB_PlayerScore` contains anything other than a unit, this will fail~~
- Actually this is guaranteed to fail because the syntax for
addScoreis wrong
_pScore remoteExec ["addScore",2];
??? as far as I know it should be executed on server
and first session fail is normal as it is defined later, some player score added and then the second session it will load from profileNamespace, right?
does anyoneknow what respawn template "TicketsSpawn" does
does it remove tickets on respawn
instead of on death
addScore requires a unit reference to add the score to
This is an unsafe fail (variable is nil, could cause script error). You should use the alternate syntax of getVariable to provide a default value if it's undefined (presumably 0)
@hallow mortar oh, I see my mistake should be, right?
[player, _pScore] remoteExec ["addScore",2];
Yes. That looks correct.
I am making a structured text editor. And I need to get the cursor position in the current text and also get the range of the selected text. We don't have any commands for this? I searched in CT_EDIT and through other pages on BIKI but I still didn't find anything useful.
I also want to add buttons to add all kinds of markup text and place them at the cursor position or if a range is selected then the markup will wrap around that text.
Ok i find command for this...... how i miss this no know....
ctrlTextSelection
Manage respawn tickets used by Tickets respawn template.
When player dies, number of tickets is decreased by 1
that isn't what I asked but I figured it out
ok
I was asking how that specific template worked
and if it removed the ticket AFTER the player respawns, instead of before
which it infact, does; it's just NOT written on the wiki
for some reason
ok what ever you say m8
???
yeah ok its all good
Can someone point me a wiki or tutorial for the variables to create weather changes? I am sure I can get started after familiarizing with the basics of how it works.
Thanks, exactly what I needed! I never know the correct Arma terminology to find what I am looking for.
once you get started you will know haha
how to get the unit using a radio trigger ? ๐ค
what are you trying to achieve?
I already achieved it, I wanted a radio trigger to be activated only by certain player
//radio trigger condition
this && ((str player) == "lynx1")
//player unit is called lynx1
I wanna make a nice little admin tool for my admins, for this, I am getting inspiration from cheats because I like the visualization on cheats.
I wanna make BOX ESP, (Bounding Box Outline wallhacks) don't ask me why, I just want to.
Would drawIcon3D run faster than drawLine3D 4 lines around the player's bounding box?
Is there a way to control weapon resting/deploy for AI via script? I would like to create a script to order an MG gunner to deploy/rest itโs weapon (with bipod) on the nearest object (and stay there to provide suppressing fire)
Use drawIcon3d with a box icon, and scale it depending on bounding box size
No need for 4 different icons
@split ruin
//script Activated by a radio trigger
// [] execVM allowedPlayer.sqf
private _allowedPlayers = [lynx1, lynx2];
if (player in _allowedPlayers) then
{
//==========================================
};
Gotcha, ty
You'll need to do some inverse distance calculation as well
How would I, theoretically, display a countdown to all players in a server leading up to a certain trigger firing?
Since I want to create a scenario with a time limit before a certain action occurs
Could use a hint(Silent) in a loop for something basic, if you want it to look nicer you can use a custom display (you can use some vanilla displays, I don't have the names on hand though)
Really basic example:
YourPrefix_timeRemaining = 30;
[{
params ["_args", "_handle"];
if (YourPrefix_timeRemaining == 0) exitWith {
hintSilent "Times up";
_handle call CBA_fnc_removePerFrameHandler;
};
hintSilent format ["%1 seconds left", YourPrefix_timeRemaining];
YourPrefix_timeRemaining = YourPrefix_timeRemaining - 1;
}, [], 1] call CBA_fnc_addPerFrameHandler;
If you're on a vanilla server you can use a scheduled (spawn) while loop instead, but you'll get inconsistent timings with it
(Wrote that on mobile, should be mostly fine though)
https://community.bistudio.com/wiki/BIS_fnc_countdown you can use this if you wish, a coundown will show on UI, you can also return the time left
Sweet! Thank you both, I'll try it out when I get home ๐ซก
Alright
Will try 2day
Also keep in mind players can switch stances, so you'll have to account for different player heights/widths as well :D
Yesss
Is that on the bounding box?
it shouldโข
idk mine doesn't use boundingBox
Any specific reason to why yours doesnt?
Can't remember, it was a long time ago
Multiple ways to do it but W2S right?
W2S will be laggy as hell right?
World To Screen
You can also use selectionPosition to find out where the head and feet are and draw appropriately. Best method depends on your specific implementation though
Hello, how can I extract all the class names from a specific category, for example vests, sights, silencers, backpacks, etc.?
getNumber(configFile >> "CfgWeapons" >> _class >> "ItemInfo" >> "type")
Some of the types: https://community.bistudio.com/wiki/getSlotItemName
I understand that this goes in the debug console, right?
No its just to get type for single classname
If you want to scan entire config you'll need something like configClasses command
anybody got suggestions on reliable convoy script ?
My idea is that I want it smooth and optimized, to show 40 - 100 players all at once.
I might want to not do many "function calls", right? I think I won't even get the bounding box ๐
Just get feet position and sum a fixed amount of meters to it for width & height
I guess getPos already returns feet position on a player?
Not necessarily, it returns something more like "ground contact position" or "bottom centre"; if they're prone it will be around their waist.
Also, use getPosASL or getPosATL, they're faster than getPos.
*actually, modelToWorldVisual is recommended for drawIcon3D
Shit aight
drawIcon3D won't draw thru the map it seems like, so I guess I kinda have to draw it in front of my player for it to show
@real tartan this one is very reliable, I use it all the time https://github.com/Wolfenswan/ws_fnc/blob/master/AI/fn_taskConvoy.sqf
Is there any AnimDone like event for vehicles rather than units? I'm looking to enable/disable sensors based on a vehicles animation sources
desperately trying to save player score in profielNamespace ๐ตโ๐ซ
player addEventHandler ["HandleScore", {
params ["_unit", "_object", "_score"];
profileNamespace setVariable ["KIB_PlayerScore", _score];
}];
this is not working ...
Unless it's SP or solo localhost then it won't. The documentation specifies that HandleScore only fires on the server.
I have an issue that just started today. If I alt+tab and go to the launcher to open another client (for MP testing), it will close my first session, then launch the new one, effectively preventing me from having two ARMA apps open at once. Has this happened to anyone?
@granite sky but his event handler must be applied every time after respawn, how to do it in initServer.sqf ?
Probably easiest to just remoteExec it back to the server.
Tracking players from the server side sucks.
That one looks like particularly dumb design. If you care about the score of one unit then you likely care about most or all of them, so a mission event handler would have made more sense.
Are you sure about that? Most EHs persist across respawn
Given that it's a server EH rather than a local one, it could well be non-persistent.
It looks like an extremely stupid EH though, so who knows :P
It's possible, but it would be best to be sure, because if it is persistent then you really don't want to keep re-adding it
Disable Battleye, it prevents duplicates from running
Thank you!
How would I script a trigger in the editor to display a short message in the vanilla notification UI?
I would need the trigger to be repeatable, and for the message to go to the detected player, not server wide.
untick server only in the trigger's attributes
Have you tried restarting the server...again?
I am familiar with how that works. Can you point me to an example or wiki for the script to make the message appear in the UI? I assume it can be done with an SQF.
you mean like systemChat?
I am not sure exactly what I am looking for. I need the message to display in the black box with white text (appears to the right of the player screen). Basically a simple hint system using the default UI.
@tough abyss That's hint and hintSilent
systemchat puts text in chat window. Useful for debugging as you can se multiple previous lines, while the hint will replace the old message with new one.
Note that hint window takes sometime to fade off.
Thanks, exactly what I needed. It is good to know about the systemchat as well. I have an RPG framework with notifications using that UI. Is there any way to adjust the sleep time on that, or is it hard coded. It hangs around for a long while it feels.
No, as far as I know, the hint has a set fade off time, with is very long. Other mods like ACE have their own custom hint system, basically a custom dialogue, that gives them more control.
spawn it, put a sleep and then hint ""
[] spawn {hint "something"; sleep 3; hint ""}
just careful with scheduler, it can overwrite other hint
I have only been scripting for a little while so bear with me, lol. In your example line is the second hint ""} what closes that?
the hint gets "deleted"
perfect
I said about scheduler, because it can delete other hints / it overwrites
Try this:
[] spawn {hint "Can you see me?"; sleep 4; hint ""};
[] spawn {hint "Deleting it"; sleep 1; hint ""}
Bad example anyway
Ok, so I could extend a chain of messages in a sequence, but the timing has to be correct or it will overwrite them?
if it's just a message, like You can't use this item use hint, if not, I would go with systemChat instead
Ok I finally get it, and what @thorn saffron was trying to say. I need to explain steps of things, or lists of info to players. systemChat will work great. I already have custom color coded side chats, I will just make a "hint channel." Thanks guys ๐ป
Have you proven that the clients are running the same mods as the host, or are you working on trust?
Usually the trouble with localhost is that anyone can join with any mods. Your friends will swear blind to you that they're running the correct mods when they're not.
Question,
How do I go about enabling/disabling a particle effect? I want to use it alongside my CBRN script so that when a certain trigger is met the gas is "deployed" so to speak, ideally with an acompanying sound effect for the smoke particle emitter
Nevermind, I think I figured out a solution ๐
Still need to figure out how to get the sound effect script thing to work nicely
# Do I understand that usage/ documantation correct?
sources:
https://community.bistudio.com/wiki/Arma_3:_Cars_Config_Guidelines#Model_config_changes_{model.cfg}
https://community.bistudio.com/wiki/CfgVehicles_Config_Reference
What are "token types" and what do PhysX simulation types have to do with it?
And how does that vehicle config correlate with scripting?
What's up with it
I want my addon (server side) to ask the player to send it some information (available locally only) when they join the server.
what is the most appropriate / efficient way to do this?
remoteExec from server to client, then remoteExec back again?
remoteExec from server to client, then publicVariableServer with a eventHandler on server?
something else? I also have CBA as a dependency already if that helps
RemoteExec back and forth
remoteExecutedOwner to easily reply
thank you, had not seen remoteExecutedOwner before either. very nice
Some of the Config Reference pages (I found it in cfgvehicles and cfgweapons, for example) refer to config attributes as "tokens" or "token pairs". It looks like it's old terminology going back to OFP when config was less understood/less refined.
Sorry for late reply, just spam me if I dont react haha
I gues my brain connected them because I both have found them in https://community.bistudio.com/wiki/Category:Arma_3:_Vehicle_Configuration and I saw some matching words
Unfortunately it doesn't work for headless clients. I usually just send clientOwner to the server instead.
Sounds like a bug
is there any performance difference between these?
[{code}] remoteExec ["call", _target];
[] remoteExec ["myFunc", _target];
good to know, luckily i just want this specific one to be called on actual players
Second one doesn't have to send {code} over the network.
ah, yea that makes sense. might as well make it a func then even if its small
Sometimes I get lazy and do the first one. But not for anything that's used frequently.
Second one is also necessary for CfgRemoteExec restrictions, if you ever start caring about security.
hello all: is it posiable to Send Structured Text over the network, like this
[format ["Remaining Lives: %1", _playerTickets]] remoteExec ["systemChat", TO_ALL_PLAYERS];
That's not structured text, that's just a string.
oh cool awsome thx m8
yea, i have used if for infrequent mission specific scripts before. and this would be infrequent as well, but since it is a addon i want try try and be as proper as possible
IIRC it does bitch about performance if you do attempt to send structured text.
I may be misremembering. Strings are fine anyway.
copy that thx man love you lots
looks interesting, so i can add CfgRemoteExec to the addon and only allow certain functions to be called on the server with allowedTargets = 2? or is this for the remoteExec command specifically and the function could be called using normal call on a client?
It's for remoteExec and remoteExecCall from clients. If you were using it properly, call would not be in your whitelist.
if i add this to a addon and whitelist a few functions, would that only blacklist the non-listed ones from that addon or any other addon + vanilla stuff as well? the wiki makes it sound like the latter
When using a trigger to exec an SQF, and it is set to run player side and not server side, is the trigger activated once per session, or per respawn within a session?
every client gets a copy, so the trigger will activated on each client, but it depends on how the sqf is structured and the trigger's condition, what's in your mind?
I wanted to know whether a hint string would be triggered the first time a player encounters it or if it would be triggered at every manual or death respawn. I will be adding some "dialog slideshows" as well for some things in place of hint or system chat. We just wanted to know how often a player would see it pop up. A repeated hint is a bit less cumbersome than having to go through clicking a dialog until it exits. We can work with whatever the constraints may be.
We need relevant information on how are you doing this so that we can help you
I will try to come back in a bit. We have a sped up time module, which is making the sleep timing difficult for testing. I will disable that, and we can give you a better idea of what we need to dial in.
Hello All: hay i just want thank all the great guys, that helped me with my scripting in Arma 3,
my missions are working so perfect im having so much fun : i just love it
im so happy i can't name all the people that helped me there's so many
thxs So Much guys im having So much Fun: its off the Hook WooHoo Arma 3 and WooHoo Discord
TLDR: Arma can't keep up with local script edits
Hey guys, I've been struggling with a weird issue recently - whenever I make edits to the mission scripts they're not recompiled at runtime for whatever reason. Whenever this happens i check with loadFile and as suspected the contents are different - Arma sees only the previous version of the script.
I tried saving multiple times, but the only thing that could help - resaving missions with a different name, copying all the scripts and running it in 3den. I'm not sure if it's a bug with Arma or some mod. Restarting the games also helps, but this is obviously not an option as well as copying the entire mission each time. Did anyone happen to have this kind of issue?
I've already asked around, but no one seemed to suggest anything of interest: #arma3_scripting message
so are you using mods /
I am, yes
have you had a look at the RPT file
Yep, nothing of interest there, no errors, nothing
what mods are you using
I tried adding diag_log to my scripts, but the edited scripts aren't still refreshed in Arma
One sec
what you said realy seems like it cant happend i never had anything like that happend did you check you game files i forget what it called
Verify game you mean? Nope, didn't resort to that
yes did you try that
I'll try
ok that may do it
This more looks like a shot in the dark, but I'll get back when I'll verify
VSCodium
ok cool
- Unload Mods
- Make sure you load the right mission and script
- Make sure your script is not actually updated
- Post your code that runs the script
i know some times i think the game is messing up but then i find it was me the hole time
The scripts are not much of a deal, just a bunch of execVMed sqf files through triggers
execVM you say hmmmmm
that could be it there if your running to many execVM it may be trying to compile all that stuff every time you run the game
I've just captured this:
Unloaded all mods except CBA, IMS, IMS:Warhammer, The Empires of Old and the map itself
Same stuff
Note: I've verified the game files
Unload all literally means unload all, at least you need to try
Even though it is very doubtful that a Mod can do such
Just, just actually in case. Which is the full path of your script? Absolute one, on Windows
about how many scripts are you running with execVM
Does it have a Cyrillic character?
I'm not on Windows, I'm using Arch Linux, running Arma 3 through Proton
The directory is a symlink to:
mpmissions -> '/home/homelessmage/.local/share/Steam/steamapps/compatdata/107410/pfx/drive_c/users/steamuser/My Documents/Arma 3 - Other Profiles/HomelessMage/mpmissions'
I see
No, I don't have Cyrillic characters
I've tried also editing directly the files in the full path
Same thing
shouldnt that be ---> Profiles/HomelessMage/missions
The mission is saved in mpmissions folder
are thay pbo-ed as it were
Nope, they're not PBOed
you should save your missions in missions not MPmissions
MPmissions is for PBO-ed missions
Uhhhh, what the actual fuck, you're right, it works
ahh haaa yes
nope? it is "save as" in MP Missions that saves as a PBO
well the game looks for PBO-ed missions in the MPmission folder
Hold on
I think
Uh, I can't figure out whether it works cause i saved it as a different one or not
yeah if you export your mission form missions to MPmissions then game will PBO the mission
Yeah, it works fine
yes put all your user saved missions in missions not MPmissions
Thank you, you're a legend
๐
I've just always thought the missions and mpmission is just a way for user to distinguish actual singleplayer or multiplayer missions
in your user profile directory, yes
but if you "save as"/"export" (I don't remember), then yes it's PBO'd
yup yes
it gets PBO-ed when you export the mission from missions to MPmissions
then you can host it and what ever
The game has a built-in PBOer?
yes it does the user mission in missions will remain in there for later use
The longer I live the more I know
hell yes whooo
i do some times also
so its all fixed now correct ?
I'm loading it up with the mods and stuff, but in vanilla Arma it works 100% when eediting scripts in missions dir
nice yes thats it yes keep all your user made missions in missions
Cheers
roger that mate
you can PBO them in missions folder and you can drag and drop to MPmissions or copy and past
i do that some time also
It works fine
Awsome cool
im so glad i could help you m8
I'm so glad you did it's the end of my psychological torment
With trying to figure out whether i'm overloading the engine of some other fuck up
lol it was a easy fix m8 ๐
It's just that I've all the time used the mpmissions and never ever had anything like this
Both on Win and Linux
copy that
yes Arma is epic
you made me happy by allowing me to help you
i guess im just a happy guy lol ๐
Openna dialog that captures input.
Afaik opening chat is enough
If a function has postInit 1 defined, and a player joins JIP, it will only be executed locally on the client machine? right?
it only runs once per machine. so yes
Thanks. ๐
@thin fox thanks for the help yesterday, and excuse the confusion earlier. My issue was major user error. Everything is running now, due to your help ๐ป
anytime! ๐ค
Can hint or systemChat be triggered with a simple add action? I want to make NPCs, or an object have a simple scroll option to set the script in motion.
addAction can execute whatever code you want.
Thanks, new to it. Great to know.
Can somebody tell me what is wrong with this init? Meant to trigger a systemChat. It glitches out and shows parts of the text, gives an error related to string. I am sure I did something incorrectly:
this enableSimulation false; this allowDamage false; this addAction[localize "STR_Guru_Welcome",execVM "WelcomeGuide.sqf"];
code has to be in {} brackets, as in examples on wiki
Would this be closer?
this enableSimulation false; this allowDamage false; this addAction{localize "STR_Guru_Welcome",execVM "WelcomeGuide.sqf"};
this addAction
[
localize "STR_Guru_Welcome",
{ execVM "WelcomeGuide.sqf"; }
];```
this addAction
[
"title", // title
{
params ["_target", "_caller", "_actionId", "_arguments"]; // script
},
nil, // arguments
1.5, // priority
true, // showWindow
true, // hideOnUse
"", // shortcut
"true", // condition
50, // radius
false, // unconscious
"", // selection
"" // memoryPoint
];``` this is the example on wiki.
Hey, im unsure if this is the place to look for help on this subject however- is there any intel i can read to find out how to make a aux mod, like use a bunch of steam mods and put them into one big mod like a compilation
why not just make a mod preset?
Thanks, complete newb. I have it now!
always scroll down to look for examples
Because- we need one mod that can support a general set of mods as the plan might be to make multiple modpacks- it would be nice to have one mod which has like the general amount of mods that all the modpacks share if that makes sense- so it would be easier to made new modpacks or alter them.
I just jumped through a few pages, can't believe I didn't pay attention to those. That will save a great deal of headaches!
repacking mods is against the TOS in general. And it is on the other side of being convenient as most people already have subscribed to the mods you need, except now they would have to download them again in a pack.
having presets is more convenient and easier to debug.
Word,thanks
are Scripted Event Handlers able to intercept inputActions?
Or should the be listened using other method?
Do you mean addActions ?
I'm poking around at the Play Sound module in Zeus because I was wondering why my game freezes for SO long when first placed down and running my modpack, and I learned that if uinamespace getvariable "RscAttributeSound_objects"; is not there (for some reason its there when I dont have all or as many mods loaded ) then it queries all of cfgvehicles instead with this:
{
if (gettext (_x >> "sound") != "" && getnumber (_x >> "scope") > 1 && gettext (_x >> "simulation") == "") then {
_sounds set [count _sounds,_x];
};
} foreach ((configfile >> "cfgvehicles") call bis_fnc_returnchildren);```
Is there any faster way to have sounds cached? With the full modset I have loaded, the code performance says it takes about 18.5 seconds to run and the game fully freezes that whole time since this runs unscheduled. I am not a coding expert or anything so this might just be the best that can be done anyway but I'm wondering if this could be old code and there are more efficient ways to build this array by sifting through so much data.
Or maybe I could just uinamespace setvariable ["RscAttributeSound_objects",_sounds] with this somewhere before they get in-game so it just freezes when its more convenient, instead of at the time of placing the module. Although now that I copied it to clipboard I see that I have 77,572 elements in this array so.. I guess there's not much else to be done besides loading less mods lol
is there a way to have a zeus module display a like text box or a slider bar within arma. I know about zen but I am having trouble with it when it comes to the module. The slider box apears for everyone on the server not just the person placing it. IDK if there is something I can do in the config as right now I have it in the script section of the module so yeah.
ps sorry if this is the wrong chat for this question
Post your config.
And function
class CfgVehicles
{
class Logic;
class Module_F: Logic
{
class ModuleDescription { class Anything; };
};
class IC51_Module_SpreadGroup : Module_F
{
SCOPE_PUBLIC;
displayName = "Group Dispersion";
category = "ic51_modules";
icon = "iconModule";
function = "ic51_fnc_moduleSpreadGroup";
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
curatorCanAttach = 1;
class ModuleDescription: ModuleDescription
{
description = "Place on an AI unit to spread its group randomly within the chosen radius around that unit.";
position = 1;
};
};
};
config for the module above
params ["_logic", "_units", "_activated"];
if (!_activated) exitWith {};
_module = _this select 0;
// Get the player who placed the module (the Curator).
_curatorOwner = _module getVariable ["curatorOwner", objNull];
// Check if the current client is the one who owns the module.
if (_curatorOwner == player) then{
// Slider bounds and default (meters)
private _R_MIN = 10;
private _R_MAX = 1000;
private _R_DEF = 150;
private _center = objNull;
// Resolve from provided units
{
if (_x isEqualType objNull && {!isNull _x} && {_x isKindOf "CAManBase"} && {alive _x}) exitWith { _center = _x };
} forEach (_units param [0, []]);
// Fallback to nearest AI
if (isNull _center) then {
private _near = nearestObjects [getPosATL _logic, ["CAManBase"], 10, true];
if ((count _near) > 0) then { _center = _near#0; }; // <-- fix
};
if (isNull _center) exitWith {
["Place module directly ON an AI unit."] remoteExec ["hintSilent", remoteExecutedOwner];
};
private _members = units (group _center) select { alive _x };
if (!isNil "zen_dialog_fnc_create") then {
// ZEN signature: [type, label, default, conditionBool, args[min,max,decimals]]
private _controls = [
["SLIDER:RANGE", format ["Radius (m) [%1..%2]", _R_MIN, _R_MAX], [_R_MIN, _R_MAX, _R_DEF, 0]]
];
[
"Spread Group",
_controls,
// onConfirm
{
params ["_results", "_args"];
_args params ["_center","_members","_R_MIN","_R_MAX","_logic"];
private _val = _results#0;
// Guard for very old ZEN that reports 0..1
private _radius = (
if (_val <= 1 && {_val >= 0} && {_R_MAX > _R_MIN}) then {
_R_MIN + (_R_MAX - _R_MIN) * _val
} else {
_val
}
);
_radius = (round _radius) max _R_MIN min _R_MAX;
// Do the spread on server
[_center, _members, _radius] remoteExec ["ic51_fnc_doSpreadGroup", 2];
// Delete the module (server deletes; replicates)
if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
},
// onCancel
{
params ["_results", "_args"];
_args params ["", "", "", "", "_logic"];
if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
},
[_center, _members, _R_MIN, _R_MAX, _logic]
] call zen_dialog_fnc_create;
} else {
// No ZEN: default radius, then delete module
[_center, _members, _R_DEF] remoteExec ["ic51_fnc_doSpreadGroup", 2];
["ZEN not detected. Using default radius 150 m."] remoteExec ["hintSilent", remoteExecutedOwner];
if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
};
};
current test code for the module text box function
if there was a way for it to be in the config file then that would be great or if there was a guard in place like ive been trying at the top of the module code that would also work for me
please ping with any info yall have
omg i helped so many people today i'm tyred
Is there any way to add a delay to a forEach loop? sleep doesn't work
spawn it
ah, forEach, never tried, what are you trying to achieve?
Hi i am a new guy here . Soon i will learn arma 3 scripting . Do you folks knew a good source/video to learn scripting
And was there anyone who worked on missile to missile anti air
Locking. I am trying to do iron dome in arma
Thank you . I save this for later
Legend, thanks. That made my paradrop script a lot more realistic!
@thin fox Works like an absolute charm, now rather than shotgunning soldiers everywhere over the battlefield they actually step out one at a time
Looks nice
_handle = 0 spawn { {moveOut _x; _x addBackpack "B_Parachute"; sleep 0.15} forEach units VDV_DROP_1;};```
Here's the script, for use in the plane's waypoint
VDV_DROP being the unit group name
I am going to create a some what random iron dome defensive system too remake/reimagine videos of iron dome in action.
Look really good in those videos. Like meteor showers get shot by missiles
And record it like 10 hours from (maybe multiple) an angle to make it a desktop background
I'd personally recommend looking into Triggers and stuff, they can have a certain X by Y by Z area of effect to apply their conditions to any objects that enter them
Keep in mind that this will remove the unit's existing backpack and all its contents
Sad but true, but I am not too fussed about that for the time being
I'm sure I could make some sort of script to return a loadout when they land but I am just happy it Worksโข for now
Also it's for AI, not players, so there's that too
I was thinking maybe at the start i assign every redfor missile an unique id and make the missile target select a circle based random positions.
For bluefor side was think a central
Set detect missile by half 3d circle and assign every missile to a to target by id.
And if the targeted missile got multiple missiles coming after hit the now headless missiles explode under some time to give affect that it got another one
So anyways my uni starts in monday and i am going too try this by sunday
zen_dialog_fnc_create
can you tell me what is in this function?
noted
creates the slider currently from zeus enhanced
i'm going to have to look it up on github to see what is in it. I'm not seeing any standing out problems so far, but I wonder if that function is doing something globally
I know its running for every client currently cause every person gets the slider box so would just removing isGlobal a fix for that?
well if you do isGlobal = 0, it will be only run on the server, not clients. you want it on a client right? just the correct client.
I think not sure honestly cause the box would need to be on the client
alright I will know more tomorrow sadly person I test with is offline currently so
I coudl only test in singleplayer
alright so then yea that should fix it
to test it yourself, you can start multiple instances of arma if you have battleeye turned off
keyword should fix it
you then join client 2 to client 1
?
no need for a dedi
turn off battleeye and click play twice. you'll get two clients
client 2 will be your client, client 1 will be your server (listen server).
alright and then in eden just start a multiplayer and have two slots
no, not really. InputActions, but there is an actual framework for that, which is addUserActionEventHandler thanks for asking though
so didnt come up for client 2 but came up for client 1 even though client 2 placed it
I did also comment out this part of the code
_module = _this select 0;
// Get the player who placed the module (the Curator).
_curatorOwner = _module getVariable ["curatorOwner", objNull];
// Check if the current client is the one who owns the module.
if (_curatorOwner == player) then{
as it was a check so
I dont know if there is a way to have maybe the slider stuff be apart of the module config I think I have seen that done but I dont remember
I'm assuming SCOPE_PUBLIC is scopeCurator = 2;?
just scope=2 I think let me double check
or better yet let me back that macro out and put in both scope =2 and scopeCurator =2
adding
scope = 2;
scopeCurator = 2;
didnt fix it either sadly
_curatorOwner = _module getVariable ["curatorOwner", objNull];
this will never exist with your current config
you dont have the attribute
class Attributes: AttributeBase {
class curatorOwner: Edit {
property = "myProperty";
displayName = "Curator Owner";
tooltip = "Stuff";
defaultValue = "";
};
};
well sorry I keep going back to standard modules since thats what I write
no hey if it works it works im still trying to learn stuff as I go so yeah
but if you have a way to basically just even if its a text box that you enter a vaule in that can be passed to have it be the radius that would work for me
people keep asking to make Modules Enhanced into a zeus set but because of UI I haven't gotten around to really testing the zeus side of things
/// Call for Fire
private _mortars = [["rhsusf_m109d_usarmy","rhsusf_m109_usarmy"], [], false, true];
if (!isNil "_mortars") then {
_mortarGun = _mortars select {side _x == west && _posOBJ distance _x > 400 && _posOBJ distance _x < 4000} select 0;
_artTrg1 = createTrigger ["EmptyDetector", _posAssault2WP0];
_artTrg1 setTriggerArea [100, 100, 10, false];
_artTrg1 setTriggerActivation ["WEST", "PRESENT", false];
_artTrg1 setVariable ["FireMisionParams", [_mortarGun, _posOBJ]];
_artTrg1 setTriggerStatements ["this",thisTrigger getVariable 'FireMisionParams' params ['_mortarGun', '_posOBJ']; [_mortarGun, _posOBJ, 25] execVM 'NatoMortarFFE.sqf'; deleteVehicle _artTrg1;", ""];
};
why does this give me the error "if (!isNil "_mortars") then {#
_mortarGun = _mortars... Error Missing } ? im closing the then with the last "}" am i not? am i overlooking something?
you arent your Then statement is missing the }
so somewhere in your code there is a missing }
yeah you have an extra " at the end
_posOBJ, 25] execVM 'NatoMortarFFE.sqf'; deleteVehicle _artTrg1;", ""];
that line at the end you have a "
private _mortars = [["rhsusf_m109d_usarmy","rhsusf_m109_usarmy"], [], false, true];
if (!isNil "_mortars") then {
_mortarGun = _mortars select {side _x == west && _posOBJ distance _x > 400 && _posOBJ distance _x < 4000} select 0;
_artTrg1 = createTrigger ["EmptyDetector", _posAssault2WP0];
_artTrg1 setTriggerArea [100, 100, 10, false];
_artTrg1 setTriggerActivation ["WEST", "PRESENT", false];
_artTrg1 setVariable ["FireMisionParams", [_mortarGun, _posOBJ]];
_artTrg1 setTriggerStatements ["this",thisTrigger getVariable 'FireMisionParams' params ['_mortarGun', '_posOBJ']; [_mortarGun, _posOBJ, 25] execVM 'NatoMortarFFE.sqf'; deleteVehicle _artTrg1;, ""];
};
that should work for you now
2nd to last line has a lot of errors, just redo that line
he is actually missing the quotes in the trigger statements, everything in the statements is done via stringified code
what is this doing for me if you dont mind me asking cause like I said at the very least a text box or a slider that can pass a number is all I really need to pop up for the single person
oh i see that now. I would use toString instead for the set trigger statements. Make it so much easier.
this is for 3ditor modules, it adds a spot to put a string into curatorOwner. so ignore it for now
ah got ya
private _controls = [
["SLIDER:RANGE", format ["Radius (m) [%1..%2]", _R_MIN, _R_MAX], [_R_MIN, _R_MAX, _R_DEF, 0]]
];
[
"Spread Group",
_controls,
// onConfirm
{
params ["_results", "_args"];
_args params ["_center","_members","_R_MIN","_R_MAX","_logic"];
private _val = _results#0;
// Guard for very old ZEN that reports 0..1
private _radius = (
if (_val <= 1 && {_val >= 0} && {_R_MAX > _R_MIN}) then {
_R_MIN + (_R_MAX - _R_MIN) * _val
} else {
_val
}
);
_radius = (round _radius) max _R_MIN min _R_MAX;
// Do the spread on server
[_center, _members, _radius] remoteExec ["ic51_fnc_doSpreadGroup", 2];
// Delete the module (server deletes; replicates)
if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
},
// onCancel
{
params ["_results", "_args"];
_args params ["", "", "", "", "_logic"];
if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
},
[_center, _members, _R_MIN, _R_MAX, _logic]
] call zen_dialog_fnc_create;
that code is basically all for the zeus enhanced slider box to appear and pass the number the slider is set to over to my other function that actually does the work idk if there is a way to just link this to the module config but at the end of the day its either that or I need a guard in place that ensures the person who placed it down and the server are the only two places it is running at least for the slider pop up
try this:
changeisGlobal = 1
params ["_logic", "_units", "_activated"];
if (!_activated) exitWith {};
- _module = _this select 0;
- // Get the player who placed the module (the Curator).
- _curatorOwner = _module getVariable ["curatorOwner", objNull];
- // Check if the current client is the one who owns the module.
- if (_curatorOwner == player) then{
+ if (local _logic) then {
alright lets see
also regardless of outcome I really appreciate the help you are giving me
i am an idiot and forget the "entities" in private _mortars = [["rhsusf_m109d_usarmy","rhsusf_m109_usarmy"], [], false, true]; , must have SOMEHOW deleted it while copying it from another script i made. Stared at this for like 30mins and didnt notice... no wonder it wont work
wokrs now, fixed the " issue too tho, thx for helping
got some more ideas if that doesn't work
that seems to have worked I guess tomorrow I will have this on the dedi to fully test but my god thank you so much for the help honestly
only showing on client 2 right?
yes
I have a few things to fix like you have to click thru the box twice and making sure the AI stay in place but its working how I was wanting it to by the looks of it
I would try one more time with 3 clients. test to see if it shows on client 3 while placing on client 2
worked for 3
good you are probably safe then
so now its just figure out why it requires me to click ok twice when the slider box comes up and why the AI still move even though they shouldn't be
for future,
isGlobal = 1 fires everywhere, but the client that places the zeus module actually is the local owner therefore local will filter out the others
ah got ya alright cool thank you
is _members populated?
?
_members meaning for the AI movement thing
that is the code for the actually spread of the units
private _members = units (group _center) select { alive _x };
is this being populated, or is it silently failing and returning an empty array
also, for constants, I would use define
private _R_MIN = 10;
private _R_MAX = 1000;
private _R_DEF = 150;
#define R_MIN 10
#define R_MAX 1000
#define R_DEF 150
now you don't need to pass them to the function as they are autofilled at compile
noted but yeah I just dont understand why the AI arne't staying in place even thought they should be having their pathing disabled
yeah i'm trying to see if the code is actually running on your units first. you don't have any logging going on (which you should def use when developing until you get it working, then delete or comment out)
so its funny cause this problem of the AI moving only just became a problem
then its most likely a locality problem now. remember, we just took away the server.
so this was working like in a single player setting then when tested in multiplayer it was then found to have the problem that was just fixed but then today we found while trying to fix the problem that now AI were moving
wasn't working before that even though and in the code when it teleports the AI to their now location it sets disableAI "MOVE" which should be stopping them from moving around
this one is probably going to be on you to find. do some logging, find out where the failure is first
if you are beyond the script error stage, its now deeper and you'll need logging
fair enough I really do appreaciate the help though with everything
Is there a way to use the civilian presence module with custom units? (CUP - Takistan) It only shows vanilla units.
you can execute code on each civilian that spawns i believe
change the loadout of the spawned unit
Yeah i tried to figure out how to do that, but im too stupid.
so if you read the tooltip on Code On Unit Created you can see that the unit that spawns can be referenced by using _this.
if you read https://community.bistudio.com/wiki/setUnitLoadout
you'll see that under syntax 4, you can use the config class of a unit to grab a loadout. This would be your cup unit class name.
so this example we will use the class "CUP_C_TK_Man_05_Jack" from CUP civilians
_this setUnitLoadout (configFile >> "CfgVehicles" >> "CUP_C_TK_Man_05_Jack");
now say you have a bunch of different loadouts you want to use; we can use an array of classnames:
private _loadoutClassnames = [
"CUP_C_TK_Man_04",
"CUP_C_TK_Man_07",
"CUP_C_TK_Man_08",
"CUP_C_TK_Man_02"
];
_this setUnitLoadout (configFile >> "CfgVehicles" >> selectRandom _loadoutClassnames);
hello all: because i like Team Respawn So much i had to Disable the Respawn Button in the Esc Menu
respawnButton = 0; // 0=Disabled 1=Enabled
i'll let you guys guess why i had to do it ๐

yeah it was because people were just hitting Esc and then hitting Respawn after the tickets ran out and there were dead ๐
but i some times kill myself if all other players are dead so we can all respawn
I have set up some "text NPCs" using systemChat, a unit or object, and addAction. It is working fine so far. I needed help with a couple things:
-Is the systemchat stream I am seeing for me as the player or is it displayed to the server?
-Is there a way to make the text stream end upon death? Our spawn areas have a welcome guide NPC. If you start her chat dialogue and respawn before it is finished, it will repeat at respawn if selected. Makes the system chat a duplicate chaotic mess. Open to any work arounds.
The format is terribly simple:
systemchat, sleep, systemchat, sleep, etc.
wow let me read what you texted so i can get what your saying
systemchats are always local to the machine that executes the command, so only you
systemChat is a Local Effect command, meaning its output is displayed on the machine where it's executed. Which machine it's executed on depends on how your code is being executed.
I feel stupid because I was wondering why a script in a trigger wasn't working, only to find out I forgot to set the countdown to 0
Don't feel stupid because we all do dumb things ๐
For the second part, you could use an if condition at break points of your choosing, for example:
systemChat "some line here";
if !(alive _unit) exitWith{};
systemChat "some line that won't be played if the unit is dead";```
Cheers ๐ป the alive/exit with combo is exactly what I needed!
I just find it especially funny because just before I managed to get my paradrop script working ^^
Only to comically slip up on a trigger countdown, it's funny
I'm pretty proud of it though
that's why we have great peolpe in discord to help us
For sure!
You can get better at understanding how things work but you'll never be safe from Error: missing ;
all the time when i think the game is messing up it was me the hole time ๐
I want to to take the above mentioned NPCs and link that text to color coded custom side channels. I have the channels working already. My issue is that we have two identical factions (civilian and independent), so there will an "NPC channel" for each. Can someone help me to correctly add a second channel with an "or" with the following? One NPC to chat to one of the two factions.
customChat [1, "customChat"]; (wiki example)
I'm a little unclear on what you're asking about. Do you want the script to select which channel to send the message to, depending on the player's side?
Yes, sorry a bit fuzzy headed.
There are a few ways to approach it, this is just one possible way:
private _channelID = switch (side player) do {
case west: {1};
case east: {2};
case independent: {3};
case civilian: {4};
};
_unit customChat [_channelID, "text"];```
wow that's Awsome Nikko
You have really helped me knock this one out! We are making a bunch of old school Pokemon/Zelda type avatars that ramble at you across our maps, haha. I would have made a way more complicated mess, that is sleek.
One thing I would add is that since this is local effect, you don't necessarily need to split the channels. You could have one channel that's just used for local NPC chatter, which all players have access to. Because only the executing machine sees the message, there's no risk of "cross-contamination" even though it's all in the same channel.
That would be best for sure. I will try to get a custom global channel going for that.
case global: {
if (_bool) then {
life_radio_guru radioChannelAdd [_unit];
} else {
life_radio_guru radioChannelRemove [_unit];
};
};
I am having trouble finding the case list for channels. Would global be correct?
You've misunderstood what's happening in that switch statement
The switch is checking side player and seeing if it matches each case's condition. If the player's side is independent then it returns 3, which is stored in the _channelID variable
west, east etc. are not channels but Sides, being used for comparison against the player's side
Jumped staight into the wrong file, that is a channel mute function for our player menu. I will go grab some coffee, have a smoke, and come back with fresh eyes, lol.
I instincively went into my DB folder. Need a break ๐
I am curious as to how I would disable player text input on the new NPC channel? I want it to be an NPC stream only, if possible.
enableChannel
Ok, had to fix that before the final question I had deleted. Which file does the radiochannelcreate go in?
I would put it in initServer.sqf, but there are other options depending on how exactly you want to do it
Perfect we already have one running for some other stuff. You have really saved the day, many thanks. The Arma community is extremely patient with new modders and scripters. That is a rare thing in the gaming world.
what is https://community.bistudio.com/wiki/getDLCs returning exactly? i though it would be appIds of dlcs/cdlcs only, but i also get decimal values back in the array which does not seem to match any appIds i know.
AppIDs are quite large numbers, so sometimes they are expressed using scientific notation; see https://community.bistudio.com/wiki/Floating_Point_Number
You could use toFixed to convert it to string, which never uses scientific notation
does anyone know how to fix "Receiving mission file (0 KB/ 0KB)"?
I don't think it can be solved with scripting. You might need to try #arma3_troubleshooting
_unit customChat [1, "Hi, I am a custom chat message"];
I had an NPC working great with the systemchat. I now have a player input disabled side channel, but I cannot get the custom channel to work the same.
I know the number is the channel ID (14 in this case). I think I am unclear what the _unit variable would be here?
The unit that should be attributed as the speaker
The speaking unit must be in the channel (and they may need a radio item). The receiving unit must be in the channel (and they may need a radio item). The code must be executed on machines that need to display it (Local Effect).
Note that for the purposes of customChat, the channel ID used is the ID within the range of custom channels, not the overall ID. So custom channel ID 1 is the same as overall ID 6. (see https://community.bistudio.com/wiki/Channel_IDs)
If you have the overall channel ID, you can subtract 5 from it to get the ID within the custom channel range
I am familiar with the sliding number for the ID. I simply had "player" for the unit. Is that acceptable?
If the code is being executed on a player client, and you want the message to appear to be sent by the player unit, then yes
I mentioned the difference in channel IDs because you mentioned you were using ID 14, which would be invalid for use with customChat, since it expects a number from 1 to 10
Oh that is the error! I misunderstood how it worked. My total list has 14 because of the default direct, group, vehicle, etc. I will try that now.
A final thanks as I rush off to make our world come alive! It is working perfectly. The string exits as needed upon player death. We now have a mini humble framework for this feature ๐ฎ ๐
@warped thicket does it transfer zeus units aswell?
i cant seem to figure out how to get the data created by BIS_fnc_unitCapture
it doesnt appear in the clipboard
the menu pops up with f1 / f2 to copy data, but it just opens the unit command menu (like report status etc) and doesnt copy the data
Are you getting a message in the top right corner when you start recording? It says that you can stop the recording by pressing ESC. Then you can press F1 to copy the recorded data into the clipboard.
i get both messages, but it seems to just not register the F1 press
i did manage to get it one time, then it said "savign data to clipboard"
Have you tried to press F1 while the game is still paused, right after the ESC?
I have never really had any issues with it, except for when I somehow dismissed the dialogue that propmts you to copy the data.
this is a guess, but possibly its because i started unitcapture via vehicle init
via admin command interface, it seems to work
Well, what I woud try first is to call the unitCapture function from the debug console.
There might be some issue causing no data being recorded.
At the time you are calling the function from the init field, all the necessary objects might not be fully loaded and ready yet.
that's a cool name you have @ornate whale
alr, admin console resolved that issue
man i don't even know how to use that unitCapture stuff
@ornate whale your name is like Rambo but with friend at the end
Does anyone know a good way to combine the respawn options of member of same group and same side
I'm looking to do something to the effect of
If you die you take over an AI in the same group as you, if the group is wiped then a new group is made available (spawned) idea being players that start in the same group must always be in the same group
Hello, i wrote a script few years ago and it used to work fine. Now it doesn't. Here's the problematic section: ```sqf
_ship addAction ["Deploy lifeboat", {
params ["_target", "_caller", "_actionId"];
private _lifeboat = createVehicle ["C_Rubberboat", _target];
Can't write out code since on mobile but could probably just either use a predefined set of coordinates using getPosASL where you would like it to be and that you could use in place of _target for createVehicle. Or alternatively if you use the addAction in multiple places and would prefer a more dynamic solution, you could save getPosASL _target to a variable then use set to change it's coordinates to increment a predefined offset. I think there are also some BI functions for relative position as well you could use if preferred but can't find those since yapping on my phone. Hopefully that's helpful tho ๐
Thank you, the addaction is on a ship so it's moving all arond, in case the ship gets damaged or destroyed and begins to sink, player can use the action to spawn the rubber boat and therefore it needs to spawn whereever the main boat currently is. On the wiki i just found model modelToWorld position where position seems to be some kind of parameter where i could actually set an offset? I don't really understand that. But i'm curious what's gonna happen so i'll try
It seems like this single extra line fixes the issue, i'll further test but looks promising. ```sqf
_ship addAction ["Deploy lifeboat", {
params ["_target", "_caller", "_actionId"];
private _pozice = _target modelToWorld [5,0,0];
private _lifeboat = createVehicle ["C_Rubberboat", _pozice];
Is there a way to get an AI helicopter to ignore all other input (ignore being shot at, moving itself automatically, etc) / force it to land at a specific location?
Setting the group to careless and telling it to land at a helipad should do that
I see I see, I'll see what I can figure out with that, thanks!
Seems to have gotten it working, thanks! I attatched the land thing to the helipad and set the helipad scale to 0 to make it invisible
Oh wait there's already an invisible one, oops. Either way, I got it working
Hey,
I need to count ai and vehicles of enemy team
Then act when killed ai or vehicle count is certain number
Any chanse for use killed eh for both at once?
Hello All: So i have this Briefing.sqf in my Scripts Folder
and in The init.sqf i have [] execVM "Scripts\briefing.sqf";
is there a better way to exec this Briefing.sqf
to make sure all players can see the Briefing
i noticed some people didn't see the briefing and i didn't know why
on a hosted server
maybe i need to exec in the initPlayerLocal.sqf also
I'm not sure of the particulars, but this one works for me:
if ((!isServer) && (player != player)) then
{
waitUntil {player == player};
};
_null = [] execVM "diary.sqf";
Looks like it waits to make sure the player is loaded.
oh ok thats what i was thinking
thx again m8
i wounder if i just put this at the top of the script
if (!hasInterface) exitWith {};
maybe that would do it too
you don't need to put anything, it should work with the code that fox provided
ok thx m8 cool oh btw why do you have _null befor the [] execVM this is not needed
Did you replace diary with your briefing in the code? Also the file needs to be in the mission directory or you need to specify the file path in the code.
I was trying to do the UnitCapture on the KeyFrame animation I did of the TV Tower falling but the data doesnt seem to have any movement. The KeyFrame animation moves but the record data is just the same position for the 6 seconds I recorded. Anyone else have any problems doing this?
Would this be put into the module init, or is it an SQF file?
You can put the code directly into the edit field. However, using an sqf will be easier if you need to adjust the code later.
Speaking of the civilian presence module, are there any scripts to dynamically place spawnpoints+waypoints in buildings, within, say, a marker area?
if (!isServer && isNull player)
// ...
waitUntil { not isNull player };
Cc @pallid palm
@inner umbra yes: all i can say is Civilian Occupation System (COS) its a bunch of scripts you can edit the to your liking
@blissful current yes its all working Now i just had to exec the Briefing in the initPlayerLocal.sqf
but now i'm wondering if my mission gets hosted on a Dedicated Server will the briefing show 2x, cuz im exec-ing it in the init.sqf and the initPlayerLocal.sqf
i mostly just player host the mission
so can i just remoteExec the briefing from the init.sqf and that would cover it all
just put in the initPlayerLocal and it will be fine in dedi
remove it from init.sqf
nice ty
but if i remove it from the init.sqf then the host of a player hosted server wont see the briefing
cuz the host is the server
there must be away to cover all the bases
i guess it must be exec both places to cover all base's
yeah see i want the briefing to show in all cases like SP MP and DED server
initPlayerLocal runs on everything that is a client, including self-hosted
i mean the wiki page I linked says that too
thats kinda funny cuz when i took the briefing exec out of the init.sqf the briefing did not show for my player on a hosted server but it did show for the clients cuz i had it in the initPlayerLocal.sqf
lol @winter rose
well it all seems to work good with the briefing.sqf exec-ed in both the init.sqf and the initPlayerLocal.sqf
so only the host see's the briefing from the init.sqf and the client see's the briefing from the initPlayerLocal.sqf
that seems to be the only way i could get it to work like i want
of corse you know i have custom briefing.sqf
Not module init. There is a code box that is Code On Unit Created when you open the civ presence module.
What kind of briefing have you made, and how do you fire it? I either use a CfgRadio, for a quick briefing over comms, or a video with this script, triggered by putting a side-specific unit inside a trigger to fire it. It shows for everyone at the same time.
["briefingvid.ogv", [10,10]] remoteExec ["BIS_fnc_playVideo", ([0, -2] select isDedicated), true];```
Video file located in mission folder.
The issue is if someone crashes or for whatever reason gets disconnected and then reconnects to the server, they are being subjected to the briefing again. (So if anyone knows how to make a "kill video" script when it has been completed to avoid this issue, i'd be thankful.)
Yeah sorry, i was really tired when i asked yesterday. I read it proper this time around, pasted the script in that box instead, and it instantly worked. In hindsight, my question seems kind of stupid after what you already told me the first time. Cheers.
you just need to make sure that the trigger won't fire again
by just letting it fire once
and server sided
The script only fires once for everybody else if you dont reconnect. The server doesnt hear it again if someone reconnects. Its only the person that reconnects that see/hear it.
are you calling it from a file or a trigger? I didn't get that
I use an in game trigger with the aforementioned script, to play a video file.
how is your trigger set up?
Blufor present, trigger fires only once. I cant look at the mission im outside.
server only ticked?
when you get home, check that
I believe so. But i dont recall. Would ticking it as server only potentially fix the issue?
yes because you're already remote executing it and if it fires, it will fire on the server and that's it, until the server is on / mission running, that trigger fired already.
if the server only is unticked, when the players comes back, he will load the mission again and load that trigger again to its machine
and for that player, the new loaded trigger on his machine wasn't fired
That makes sense, yeah. Ill take a look when i can.
is there a specific benefit to using FSMs over scripting normally? It doesnt seem like there's anything special with FSMs you cant do with scripting, its just more easily visible what's going on, so I was curious
It's mainly for complex state logic to be visualized since we don't have a state pattern in OOP (you can probably attempt it with hash objects). It's great for mission flow with multiple forks in the story, and great for AI state logic.
Fair enough. But it doesnt grant any additional functionality you can't just hash out with enough switch cases in SQF, right? (metaphorically, theres obviously more things you need to touch, but its all doable in SQF)
Yeah it's basically doing sqf itself on the backend, I believe they are scheduled and attempt to run at the fastest speed it can within scheduled environment.
Which is their main weakness. They fire every frame even if it's something that only needs to run, say, once per 5 seconds.
I kinda enjoyed writing them but they're a drain on performance.
Yeah, I mean you're just making an overly complicated flow chart, seems more fun than writing it by hand :P
It also has the lack of script macros. So for instance, LAMBS does function calls instead of inline code in the fsm so they can utilize macros.
hmm. Isn't LAMBS working from a native rather than scripted FSM anyway, so it's not really SQF until it calls?
so im trying to use titletext with valign to have text on the top of the screen, but i cant see to get it to work and the wiki said its broken. Is there a work around or just gotta wait for it to get fixed?
structured text?
Alignment is for alignment within the text control, not within the overall screen. titleText doesn't give you control of the text position.
If you want to put your text in a specific place on the screen, you might need to create a UI control (ctrlCreate) so you can directly manage its position.
Is there a way to disable rotation of or otherwise "lock" an aircraft's pilotcamera via script that doesn't involve something like looping every second and zeroing rotation?
Or disable it altogether
Lets say I have a function PEPE_someFunction - If remoteExec this entire function will it work on the server?
i.e.
remoteExec ["PEPE_someFunction", 2];``` will this actually work in the server or does it need it to be broadcasted first?
No the function is local - I am wondering if it is passed as is or the remoteExec only passes the reference which then instructs its client (in this case the server) to execute a function that corresponds to the one that is passsed.
I'm thinking of avoidingpublicVariableServer
yes, it requires the function to be defined on the client where it's executed:
https://community.bistudio.com/wiki/remoteExec
7erra
The remoteExec'ed function only has to exist on the target machine. For example:// initPlayerLocal.sqf TAG_fnc_testRemote = { hint "Remote Exec Received"; }; // executed on a DEDICATED server remoteExec ["TAG_fnc_testRemote", -2];``` Will display a hint for every client. This is especially useful for when the server is running a mod that is not required by clients.
But what if its reverse - the function exists locally in the client system and I want to run in the server
then yeah it'd be flipped around, the target is the server so the server needs the code defined there
So in theory, even if being remote executed, two clients (in this case, a server and client) can have different functions but under the same function name and execute different things.
that sounds about right
What I assumed is when you remoteExec with a function defined, it will pass the value (in this case the whole function) to the remote client / server and execute it. But what actually happens is that the function name is passed as a reference for the remote system to fetch from its pool and execute it as is.
yep, if you wanted the code to be sent as a value each time, you'd write [args, {code}] remoteExec ["call", 2]instead
of course that's more bandwidth-intensive, and also doesn't play well with CfgRemoteExec function whitelisting
Thought as much. Thanks for clarifying anyways.
It does @cedar kindle
I assume you want to use your module in Eden and via Zeus and execute function only on server?
if hes making a mod, then the function will exist on the server. what it sounds like he is asking is how to do a function on the server in a zeus execution because he states that the function only exists on the client
Is it possible to force player controlled unit in vehicle to move forward without setPos or setVelocity? I just need to let unit move his car forward while he is a driver of vehicle
If you only need straight forward you can use setCruiseControl, but if the driver applies the brakes, the cruise control will be turned off
exactly what i need. Ty!
Hello!
Are there any vector commandsโ or method for setting the pitch of a player unit's view angle?
For demonstration purposes, I have created a trigger that will kill a player and have them respawn instantly when triggered.
There is a 'Killed' and 'Respawn' EH on the player, whereas the player's current view direction vector is saved and creates a sphere on the desired "look" position when 'Killed' fires.
The goal is to have the player look at said position (ideally same camera view direction) after respawning, but I am not finding any command that would accomplish this together with setting the pitch.
Thank you in advance!
as far as I know you cannot change player's camera angles.
I was afraid that would be
perhaps by setting the unit's pitch then let the game reset its up vector, keeping the camera
however, you can absolutely create a camera and manipulate it ๐
is it at all possible to make individual players have night time while other players have daytime?
I want it to when a player uses a teleport to enter a tunnel, it also sets their time to night time so its dark like a tunnel should be instead setting everyone to night time.
Arma 3 synchronizes time automatically every 5 secs or so
Question is, can we disable time synchronization?
i didnt know that. i will see if i can look into it
(no)
Back in the old days the time commands were local, but it caused lots of problems for people not accustomed to multiplayer scripting and locality. Also a server with low fps could literally fall behind, so you might have reached night time but the server ai thought it was just getting dark.
@still forum could either a command or a description.ext setting exist for time/weather auto-sync?
๐
Just because of the spam removal I think
ah, fair
I was thinking some time ago about dark tunnel too and figured the only would be to have all players at the same time in tunnel.
I have made 2 scripts and want to make them into a mod, they depend on ACE and CBA, can someone please help? I have never made a mod before
You'd need to give more context on how they're written
But at the very least, you'll need https://community.bistudio.com/wiki/Arma_3:_Creating_an_Addon
I have init.sqf which adds Ace interaction if player has a shovel and then if player uses it digs ground using diging.sqf, nothing more. I have already tried uploading it with doing pbos etc.etc. but it seems init.sqf isnt launching, probably something to do with config.cpp which iI dont know how to set up really
The event scripts are only for missions, they won't automatically be called from pbos
You can also add ace actions through config
But is see there is a way to excute scripts in config.cpp, will init triget the other file if I execute it?
Just add the action through config and have the action call your digging function
Here's how to add the action
https://ace3.acemod.org/wiki/framework/interactionmenu-framework#21-class-interactions
And here's one way to compile functions
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
Thank you so much, hopefuly I wont mess it up
Hello. I would like to be able to enable/disable a change made in the cfg configuration (a value parameter). My idea is to let my editors decide whether to enable it or not. I don't mind if the mission has to be restarted.
Elaborate more.
I am new developer.. Let me give you a simple example: I want to allow the editors to change the fuel capacity of a vehicle between 20 or 40 (only two values). If the "setting" is enabled the fuel capacity is 20, otherwise it will be 40. How the editors makes that change is not what I'm primarily looking for. I'll figure out how to do it myself, whether with a module, cba settings.... (without modifying the addon, of couse). What I want to know is whether it's possible to enable/disable this by chaging from one value to another. And as I said, I don't mind if a restart is requiered for the change to take effect.
class CfgVehicles {
class Vehicle1 {
fuelCapacity = enabled? > 20; not enabled > 40;
};
};
Thank you
Don't think you can overwrite fuelCapacity from a mission itself. But you might look into setFuelConsumptionCoef. Perhaps then you could examine the mission parameter and whether to vehicle setFuelConsumptionCoef 0.5 to double the range.
Hey! The fuel example is just that, an example. What interests me is modifying the properties of certain classes under an adjustment decided by the mission editor. Thanks anyway.
Okay, but in that case, if the properties you want to adjust are of say vehicle entries, then I don't belive those can be changed from a mission.
Thank you, the mod is working
the sound distortion when you pass by the sound source (or it passes you) fast, is this something I can control via scripting? As in changing the sound's/music's pitch without playing it from the start.
you would make a sibling class for this and let the editors choose the vehicle they want
I think that's feasible if we're talking about objects that can be spawned. But for example, regarding AI behavior or particle lifetime (explosion particles), can you think of anything other than creating a sibling and duplicating all the grenades? Thanks

If I have a checkbox in a vic attributes in Eden that will add event handlers to the vic, how do I get it to actually work? Is there an order of operations that needs to be done? If I add the event handler normaly to the init box, it works fine but I cant get my mod to do the same. Is it not basically the same thing?
post your config and code so far
Good day. I use waypoints to move enemies around and/or attack players, but sometimes I see them just standing there and not moving ๐ค
Is there a way to debug this? What may be causing AI units to get stuck like that?
Would suggest to remove Mods first
No mods, vanilla
Wait 'til you find out what those patrol scripts use to control the AI
So what did you use instead of waypoints?
I would like to know what you are using inside the patrol script, to control where the AI move to, that is not a waypoint
I was thinking more about patrols outside of buildings. Waypoints are usually not used for precision movement inside buildings, for any purpose, since they're not very precise and can't control individual units within a group.
You keep saying "oh I just use scripts". My dude, scripts are a set of commands, not a magical thing that has its own inherent functionality. What commands are being used?
I actually don't feel like doing this for another 30 minutes so I'll skip to it: the thing I am getting at is that most group-level patrol scripts use waypoints internally.
If you understand the script, you should be able to tell me what commands are controlling the AI movement, without just pasting the whole thing.
Well, fair enough. I'm genuinely surprised it's using commandMove and doMove rather than waypoints.
I'm a bit surprised it works properly as well, I would've expected that using direct movement commands would prevent the AI from switching to combat maneuvers upon encountering the enemy.
Is there any known solution out there to prevent players from utilizing map functions like "Vote Kick" and "Vote Admin"?
I attempted to find the corresponding controls by checking ctrlText of allControls across allDisplays with no luck. Does anyone know if there is a way to access these controls? Alternatively and perhaps the better question- is there a way that I can prevent #vote from being available to the client?
It's not mentioned on that page, but those settings are part of https://community.bistudio.com/wiki/Arma_3:_Server_Config_File
Funny, and true.
Thanks so much you guys, I was losing my mind haha. Kind of crazy that we haven't done that after all these years- knew there had to be some way...
This was currently our server today ๐
what is wrong with this landing waypoint ? heli just sits forever on the previous waypoint ๐ค
//first wp works fine
private _movepos = [[6497.84,6497.37,0], 0, 7000] call BIS_fnc_findSafePos;
private _wp1 = _qrfpltgrp addWaypoint [_movepos, 50];
_wp1 setWaypointType "MOVE";
//second waypoint doesn't work
private _landpos = [(leader lynx), 300, 500] call BIS_fnc_findSafePos;
private _wp2 = _qrfpltgrp addWaypoint [_landpos, 50];
_wp2 setWaypointType "LAND";
[_qrfpltgrp, 2] setWaypointScript "A3\functions_f\waypoints\fn_wpLand.sqf";
the line is
[_qrfpltgrp, 2] setWaypointScript "A3\functions_f\waypoints\fn_wpLand.sqf";
landing waypoint ?
https://community.bohemia.net/wiki/Waypoints
biki is not very clear but they want to use scripted waypoint
omg it should be "SCRIPTED" lol ๐ the waypoint type
You might also like to try using the 3rd syntax of https://community.bistudio.com/wiki/landAt for some extra control options
dear, i try to change maxgroup by side (144) to more. someone know how to?
same behavior ๐ the heli just hover on the previous waypoint and that's it ...
it's just better to use landAt
didn't know that was possible
it says qrfheli is array not object ๐คท
private _rpos = [["ao_mrk"], ["ru_base"], {}] call BIS_fnc_randomPos;
arr = [_rpos, 180, "B_Heli_Light_01_F", west] call BIS_fnc_spawnVehicle;
qrfheli = arr select 0;
qrfpltgrp = arr select 2;
qrfpltgrp deleteGroupWhenEmpty true;
qrfpltgrp setBehaviourStrong "CARELESS";
[qrfheli, 500] call BIS_fnc_setHeight;
private _movepos = [[6497.84,6497.37,0], 0, 7000] call BIS_fnc_findSafePos;
private _wp1 = qrfpltgrp addWaypoint [_movepos, 50];
_wp1 setWaypointType "MOVE";
landpos = [(leader lynx), 300, 500] call BIS_fnc_findSafePos;
private _wp2 = qrfpltgrp addWaypoint [landpos, 50];
_wp2 setWaypointType "SCRIPTED";
[qrfpltgrp, 2] setWaypointScript "qrfheli landAt [landpos, 'GetOut', 10, true]";
landAt doesn't want local vars it says its global space etc. ...
take this script of mine and try to get something useful for you, find the "Land area/air drop" section
this script I did for my own qrf setup
can land or drop units in air
@thin fox thanks I will look at it, the script I made works except the landing part
that's why I've said to look for the land part ๐
it's always tricky
@silk hill dwarden say it can. I find some group info in CfgWorlds. but not sure how
Not sure how qrfheli would become an array unless you're setting it somewhere else too.
@granite sky nope, its just what I posted, its weird
Oh, you have the wrong syntax for setWaypointScript though?
It's not a standard SQF string.
If you want that instead, put the waypoint a bit further away and then use setWaypointStatements instead.
@granite sky got it working
_landpos = [(leader lynx), 300, 500] call BIS_fnc_findSafePos;
private _wp2 = _qrfpltgrp addWaypoint [_landpos, 50];
_wp2 setWaypointType "SCRIPTED";
[_qrfpltgrp, 2] setWaypointScript "A3\functions_f\waypoints\fn_wpLand.sqf";
[_qrfpltgrp, 2] setWaypointTimeout [10, 10, 10];
I wonder if waypoint type "GET OUT" will do better ...
and there is another type of waypoint mentioned "Transport Unload" ...
is this waypoint type even existing?
Yeah, that one's not bad.
With TR UNLOAD the crew group doesn't leave, only the cargo group. I'm not sure what it does if you don't have a 2-group split.
@granite sky I have two groups - pilots and troops in cargo
Hey
Any guide for trigger that count tanks in area?
You can just iterate over thisList and check if they inherit from a tank
{ _x isKindOf "Tank_F" } count thisList;
Or whatever list of objects you want to check, thisList will be whatever matches the trigger's condition
Its not in any configs i know of
I would be very surprised if its actually possible
Unless you count sneaky ways like alive virtualizing groups...
it's a trick.. get an axe
Or store them in a separate side while theyre not used, like sideLogic :D
If you changed loadouts of units in 3DEN using setUnitLoadout like so for example playableUnits apply { _x setUnitLoadout "B_Soldier_F" };
Changes aren't applied either to preview or even if scenario was saved, any solution for this?
save3DENInventory
Ahh tysm
@thin fox your script works perfectly and do the job, the only thing I couldn't figure out is to tell qrf troops to stalk player group after they left the heli
//these are the params I pass to your function
[
_rpos,
"B_Heli_Light_01_F",
west,
KIB_specOps,
_landpos,
[10,100],
120,
false,
"
params ["_groupTroops"];
private stalking = [_groupTroops, lynx] spawn BIS_fnc_stalk;
",
""
] call PIG_fnc_heliDropTroops;
I suggest you add number of troops for the qrf group because they spawn two additional guys when little bird is used, thank you again for this script ๐ค ๐ป
To should or not to should, is that the question?
@cedar kindle yes it does, it uses InitPost extended event handler on CAManBase class attached on each machine, this automatically includes units in vehicles as well, then it starts the 15 second delay to prevent desync, then just goes through all groups, passes them to HCs and flags them with "passed" variable, those are not checked again next time unless full rebalance is forced (when an HC connects or disconnects)
yeah it was for a specific mission
For that in particular, you need to add the heli object as a passed argument in the script troop part, "hardcoded"
Hello all. I want to make a jukebox for admins to use in my server. To keep the mission file reasonable, I will make a simple mod and use the path from there. I should be able to do that with this: Use CfgSFX to make a sound pack mod, of ogg music.
My question on the script side, is if this will suffice, or are there things I am not thinking of yet?
addAction > setMusicEffect + sleep and/or !alive, etc.
I have never used setMusicEffect, so I am open to any ideas.
@thin fox whatever I write in the troops script I got "Script not found" ๐
[
_spos,
"B_Heli_Light_01_F",
west,
KIB_specOps,
_uberPos,
[20,50],
100,
false,
"",
"
params ['_groupTroops'];
private _stalking = [_groupTroops, lynx] spawn BIS_fnc_stalk;
"
] call PIG_fnc_heliDropTroops;
setMusicEffect is for waypoints and triggers. If you just want to play something from CfgMusic, you'd use https://community.bistudio.com/wiki/playMusic
I assume that's what you're wanting at least, since it's for a jukebox
Thanks, that is exactly what I need for the current idea. I never know what to search to find the correct variables on the wiki.
The one for triggers is the same function then? Or does it have other features? I may have use for both. Thanks for any info.
Haven't used it before, but it seemingly just lets you set the music track to play on the trigger / waypoint rather than having it in the waypoint / trigger code itself
I don't know about any specific pros/cons to it over using playMusic in the waypoint / trigger code itself
Thanks, lol. They seemed really similar. I am new to it and didn't want to assume.
I guess it's maybe intended for if you're creating waypoints or triggers from a script, but for triggers you can still customize the statement so not sure there
I have a virtual item system, and could make tokens for the jukeboxes, add a longer sleep to prevent spamming, and let players use them. How would I make the addAction only work with a set of requirements?
My apologies, that is exactly how our shops work. I am overthinking things.
For any complex condition, I'd strongly reccomend using toString and a code block so you can read the code easier. E.g.
this addAction ["title", {
params ["_target", "_caller", "_actionId", "_arguments"];
}, nil, 1.5, true, true, "", toString {
// Your condition here, e.g. checking if the player has a coin
"YourPrefix_coin" in items _this
}, 5
];
Wow, that will make things WAY easier. I am not ashamed to admit, I started with notepad for my first month, haha. That formatting will be helpful for just about everything.
Like ive said, I think you need to change the code for this, it's requires the path because it uses execVM, so just make a file to call this function and it should work
@thin fox I packed it as sqf, no errors but heli just hover over player group
//this is in the file
params ["_qrfgrp"];
private _qrfstalking = [_qrfgrp, lynx] spawn BIS_fnc_stalk;
//arguments to the function
[
_spos,
"B_Heli_Light_01_F",
west,
KIB_specOps,
_uberPos,
[20,50],
100,
false,
"",
"stalk.sqf"
] call PIG_fnc_heliDropTroops;
What did you put in the sqf file?
params ["_qrfgrp"];
private _qrfstalking = [_qrfgrp, lynx] spawn BIS_fnc_stalk;
the last parameter is for the heli, if it's empty, the heli will rtb, if this parameter is not empty it will execute the script in the path that you provided, and your script does nothing with the heli. If you wanna call anything for the troop you should use the 9th parameter instead. And I don't think you calling the stalk function right (or I don't see what you're trying to do)
must is the answeeer ๐
and if one can do it per-client, that's even better!
Hi I have a scripted WP to make vehicles follow a straight-line path, and I'm wondering why after they get there they just spin in circles? What causes this behavior?
I'm getting an error for undefined variable _firstUnit here. But it only happens in SP when switching to a unit out of the trigger area. Any idea what is going on?
thisList spawn {
private _firstUnit = _this#0;
_scout = missionNamespace getVariable ["scout", objNull];
if (_firstUnit == _scout) then {
//code
} else {
//code
};
};
This is placed in a trigger set to fire when players are in the area.
i never saw this before ------->_this#0;
It's not incorrect in isolation but it's wrong here.
maybe it should be private _firstUnit = _this;
well, not wrong unless the list is empty...
so that's probably what happened.
Is this activation code or deactivation code or both?
Activation code.
So by using U to switch units it thinks the list is empty? But the trigger only fires once right? And when I does the list can't be empty because it wouldn't be able to fire in the first place.
this is why we use params
Sounds like this is the moment to learn what they actually do.
Mostly they seem to behave like variables to me.
Reading the wiki now.
it has a default value, just like your getVariable. you can use that to do checks with. abort if things are undefined, or make it use a default value, etc
but you should use diag_log more often. I notice you don't use it much when you ask questions. It will tell you what is in the variables you are passing.
params [["_firstUnit", objNull]];
diag_log format["First Unit: %1", _firstUnit];
Thats for debugging right?
Where would I see the diag? I'm looking for it in systemChat but I haven't noticed it yet.
in the arma log file
if you are using vscode, theres an extension to open it up using a shortcut, otherwise you have to go to your profile to find it
The rpt. Oh yeah I never look at that file because its like a foreign language. Any tutorials on what to look for in there? It's hard to parse what is important or not.
you would ctrl f your diag line, such as "First Unit"
A good general one is "error in" which will pick up all the SQF errors so you can read them at leisure.
But if you're not using diag_log already then they're probably at the bottom.
As I restart scenarios a lot for test purpose, I always try to find "Starting mission" to check for script error since the mission began
you can also use a watcher extension that will follow the lowest line in the file as they are created
and you can see stuff in real time
berublan.vscode-log-viewer
Hemtt vs code extension also does that, with a keybind to open your latest rpt
Thanks yall ill dive into this tomorrow
is there any way to prevent bots from discharging 8 mags into unconscious players? maybe script or dedicated mod?
how
i don't know, but we are playing a lot of pve cqb scenarios with my friends, and when they are losing conscious (ace medicine mod), closest bots just dump all of their mags into that poor player, who end up with 1000 traumas. I personally saw that while was zeusing
lol that seems funny
Hello All again: i want to addaction to one of the (spawned enemy soldiers)
where He has a (key) or a (jump drive) in his inventory: that you can take from His Dead Body:
and then if you have this key in your inventory: you can unlock the labtop:
I have the labtop set to unlock: if all enemy are dead at that location ATM:
You mean you want check if _caller has x item in his items
yes
"'youItem' in items _this"
or if multiple item
items _this findIf {"firstItem" in _x || "otherItem" in _x} != -1
Not work , can you explain correct usage?
?
You'd just do { _x isKindOf "Tank_F" } count <your list of objects>
{ _x isKindOf "Tank_F" } count thisList > 1
```sqf
On condition
I'm not sure what you're asking there
There i need a trigger that count the tanks in his area
Then detect if number are bigger or get smaller
Then do action
Yeah so just have that as the condition
Might need parenthesis around the left side of the >
Not work , may show me your idea?
That's it
I set this condition and a hint for test , condition not work cause no tank detected in zeus when i place them at trigge.
You need activation:Anybody/Present otherwise thisList is not populated
thisList is generated based on the type/activation settings of the trigger, e.g. with BLUFOR/Present, thisList will only contain BLUFOR units that are in the trigger. If everything is set to None, thisList is empty.
Hey everyone, I'm new to scripting, an i think i miss something here:
...
private _escapeSuccess = false;
while {true} do {
sleep 4;
if (!(alive _boat1) && !(alive _boat2)) then {
break; // We lost our escape vehicles!
};
...
if (_onBoard && _allDistant) then {
_escapeSuccess = true; // Hurray!
break;
};
};
sleep 5;
if _escapeSuccess then { ...```
Language server says "Value of private _escapeSuccess = false; is never used"
Language server, lol
Your code is correct. Whatever generates that warning message is not.
Alright, thanks! I was wondering if I messed up the scope or something. Since the initial value is propagated in case the first "if" condition breaks the loop.
The Language server addon is this one https://marketplace.visualstudio.com/items?itemName=SQF-VM.sqf-vm-language-server
Even if the loop always wrote the value, it'd still be an incorrect warning. So more likely the VM isn't registering the use in the if statement for some reason.
hey there, does anyone know if there exists a command for tfar to mute players? (eg. for a cutscene)
There are a couple of variables you can set on players.
From https://github.com/michail-nikolaev/task-force-arma-3-radio/wiki/API:-Variables
player setVariable ["tf_voiceVolume", 0];
player setVariable ["tf_unable_to_use_radio", true];
got it, thanks a lot! ^^
does setHitPointDamage influence the actual damage to the unit? As in, if I set it on player's legs, does it increase the chance of killing player if actually shot in the legs?
In that specific case it wouldn't.
Assuming that you're talking about the vanilla damage system.
Limb damage is non-fatal but limb hits also add a quantity of general damage, which is fatal when it exceeds 1. If you set the hit point damage directly then it doesn't change the general damage.
Note that there is no randomness in the calculations.
private _weaponItem = selectRandom a3e_arr_CivilianCarWeapons;
if !(isNil _weaponItem) then {```
I have a question for this piece of code: `_weaponItem` can become either `nil` or sth like `[x,y,z]`. If it is nil, i get an issue later, but if i check for nil, it says
`22:02:38 Error isnil: Type Array, expected String,code`
So how do i check for either array or nil?
isNil "_weaponItem"
Is there a way to detect small hills (like in the 40-70m range) and get their position? I know about https://community.bistudio.com/wiki/selectBestPlaces and https://community.bistudio.com/wiki/nearestLocations, but both only seem to allow for either hills at least 160 ASL or map locations designated as "hill" or "rocky areas" (which dont have to be on a hill)
Yes, but probably only a slow way.
Maybe if you chain enough tiny chunks of simpleVM code together with apply and select then you can get it nearly as fast as the engine methods.
hmm, unless waterDepth returns negative values. I forget.
Ambient Parameters: waterDepth 0..M where M is the actual water depth, and 0 on land. :/
sucks
on top of my head, maybe you can place a object for reference and use randomPos function with the last parameter to find positions in higher altitude than the object itself
uh
getting terrain altitude at a point is just ATLtoASL [_x, _y, 0] select 2
but having to iterate over a lot of positions yourself in SQF is not good.
yes
I have an interesting issue I just found. My helicopter lands like this:
[ExtractHeliGroup, [8584.56,8187.52,0], ExtractHeli] spawn BIS_fnc_wpLand;
But I must have been accidentally standing on that exact spot because the heli tried to land but then gave up and flew a few hundred meters north. I've been able to recreate this situation a few times now. Any ideas on a fix?
uh, what behaviour would you want? The heli to land on your head regardless?
im having a weird situation going on now - i get an error message saying "Error Type Any; Expected Number" when i call my function like this sqf private _mediumHillsInArea = [position player,1500,100] call AWP_fnc_findMediumHills; however when i call my other function sqf private _forestsInArea = [position player,1500,400] call AWP_fnc_findForests; there is no Error - the thing is those 2 functions are basically completely identical, the line that i get the complaint about is ```sqf
private _selectMediumHillsInArea = selectBestPlaces [_position, _radius, "hills", 50, 300]; /// throws Error about wrong Type
private _selectDenseForestsInArea = selectBestPlaces [_position, _radius, "(forest)* (1 - sea) * (1 - houses)", 50, 70]; /// no Error
```
im assuming its about the _radius but like why?
You'd have to show the rest of your function.
lol i remember setting up chopper stuff way back in The Unsung Mod omg im so glad we have Arma 3 now woohoo
Figured I'd ask about this; run into a really odd bug where the icons (using drawIcon3D) will just disappear for no apparent reason. Sometimes it happens when using a scope, sometimes when going to third person, I've even had it happen when I've pressed R to reload.
The function is still running perfectly fine in the background, all the conditions are firing and none of the variables are undefined or anything like that. Even reinitializing the event handler doesn't fix it.
The weird thing is it only happens to enemy units, friendly units seem completely unaffected.
Apologies for the spaghetti code in advance
GVAR(fireControlHandlerAdded) = true;
GVAR(fireControl_handler) = [{
[call FUNC(nearUnits)] call FUNC(IFF);
call FUNC(weaponCrosshair);
call FUNC(nametags);
}, 0.01, []
] call CBA_fnc_addPerFrameHandler;```
Do weaponcrosshair and nametags also stop rendering? Does it stop for all units at once or just some? Does it ever come back?
Only enemy IFF tags, everything else including friendly IFF stays
I tried adding a systemchat to the enemy condition of the IFF function and everything is working just fine even after the tags disappear. Also tried checking just before the drawIcon3D command, still fine
You're saying that the units in the clip are alive? I can't tell.
They are
I thought maybe the dead/uncon check might've been overwriting the later check but that wasn't the case either
which datalink mode?
Side, case 0
It isn't, checked that too
And if I press T it does nothing (when working it'll reveal the enemy)
Did you check getFriend too?
I think? I've still got the mission open, I'll double check
Yeah they're still enemies
Dunno then. That seems to account for everything. You'd need to add some brutally spammy logging to figure out what's falling through.
Mm. I'm wondering if it might be some kind of weird issue with the game itself? I tried increasing the sleep time on the handler just to see if that might've been the issue
Can't say until you did the logging. Your function is too complex to be sure otherwise.
Sleep time on the handler doesn't make sense because you said friendly IFF tags were still rendering.
Which means it's clearly running the code.
Unless you accidentally have a second copy that's actually what's rendering the friendly IFF tags.
Or maybe the handler init is being recalled constantly? The IFF function is definitely only called in one place in the entire mod
Nope it's not that either, just tested it
printf debugging anyway. Add like 10 diag_logs to that function that print if a global var is set, then clear the var afterwards.
Huh, my original suspicion turns out to be correct lol
It was the icon colour alpha all along lol
Ok now I'm even more confused, how the hell is this even happening?
It's not like it's being completely overwritten, it's just the alpha channel that's being overwritten
Wouldn't be surprised if that was an engine bug.
hmm. It's drawing a one-pixel icon?
The size is fine, 1 is an expected value
Well shit lol
How am I gonna fix this
Thanks for the help man
I assume you're setting GVAR(fireControl_enemyColor) in literally one place?
I guess 1 isn't one pixel:
The width and height parameters are multipliers for activeWidth and activeHeight set in config
In CBA settings. I've ensured the scripts are run after the CBA settings are initialized so it should be fine there
hmm. Does CBA settings actually support alpha for colour? I've never used it.
Their example is just RGB.
It's just rgb
It does support alpha
Oh nevermind, the param checking does allow 4 element arrays
https://github.com/CBATeam/CBA_A3/tree/master/addons/settings
Message was delayed, but yeah never knew that. Only used color specially like once
Idk if this is helpful at all to arma modding, but in graphics programming, textures and the backbuffer are stored in 32 bits, as R8G8B8A8. When you want to overwrite only one channel, you have to activate a render target write mask or specific blend instructions, otherwise it will replace all channels. So have you tried not just changing alpha but all channels (basically copy-paste the rgb values)?
In the function it should be overwriting every channel
alright
here's one for you chat
class EventHandlers
{
init = "params ['_entity']; [_entity, 'Imperial Command Post', 'I', 1, 10, true] call AWR_fnc_commandPostInit;";
};
i do this. my function works fine! except for the fact that if i place my object down in eden editor it will initialize, which will cause eden to explode, or make it init twice on maps
how do i get it to stop doing... that.
tldr; i want the init eventhandler to not run in eden editor
rn i have this inside my init function
if (!isServer) exitWith {};
but this obviously is so it doesn't run on clients
anything else i could add? bc i've been looking and i can't find anything on this
is3DEN
i love you
Has anyone used these animations before?
BRIEFING
BRIEFING_POINT_LEFT
BRIEFING_POINT_RIGHT
BRIEFING_POINT_TABLE
Basically, I wanted to do a thing in multiplayer where an officer walks over to start the briefing, i've forced him to dowatch a chair, sleep for a moment to make sure he completes the turn, I then used the point right animation to test it out. Problem is he just uses the default briefing animation, hands on his hips. But also the game strips his character of hats and clothing?
https://community.bistudio.com/wiki/BIS_fnc_ambientAnim
Check the doc. You need ASIS
so thats what the ASIS meant, damn. I completely overlooked that variable...
Just tried to use this function in my scenario and I can't get this function to work right in dedi
sometimes just works and sometimes doesn't (when it doesn't work, from the client perspective, restarting the mission gets the function to work), sometimes just rotate the unit to 0ยบ even though it's attached to a object, using the parameter option, I just gave up on using that
Someone knows where I can find a list of the vehicle "bases"? Like UAV_01_base_F.
Not the individual vehicles like B_UAV_01_F or O_UAV_01_F. But the "base", idk how to call it.
Use the config viewer, it lists the entire hierarchy.
In CfgVehicles ?