#arma3_scripting
1 messages ยท Page 620 of 1
Hello everyone so I decided to get my self a little project for this little quarantine that we got going on in my country so I want to create a mod that would make the helicopter dust effects larger dramatic and more realistic i guess and I got 0 idea where to start from anyone got any directions?
this way โ
@potent river yes, #arma3_scripting for the effects, and #arma3_config for the mod itself ๐
alright ๐ฏ then i guess ill start at the effects haha
thank you!
Is there a script floating around out there that lets you mark the remaining enemies after a certain amount of time has passed?
Hello i have a small problem with an if statement.
I made an variable that is normally on "false". So i wanted to make an if statement that is something like this: if (_var != true) then {}; but i really don't know how to do it with "if (false) then". I hope someone can help me out ๐
if (!_var) then {};
that'll invert the boolean so it becomes true and passes the check
nice thank you so much
@quasi cobalt
Would disabling AI autocombat and cover effect waypoints and triggers?
No
You've set up your trigger wrong
Is there a script floating around out there that lets you mark the remaining enemies after a certain amount of time has passed?
What do you mean "mark"?
Why does reloading the remaining missiles take for ages (like over a minute) with this script? Is there some special case where you get "time penalty" for reloading a whole static weapon?
private ["_unit","_weapon","_rocket","_ammo","_missile","_currentMag","_ammoCount"];
_unit = _this select 0;
_weapon = currentWeapon _unit;
_ammo = _this select 4;
_rocket = nearestObject [_unit,_ammo];
if (isNull _rocket || ({isPlayer _x} count (crew _unit) == 0)) exitwith {};
_missile = ["M_TOW_AT"];
if (!(_ammo in _missile)) exitWith {};
_currentMag = currentMagazine (vehicle _unit);
_ammocount = _unit ammo _weapon;
hintSilent format ["%1 missiles left",_ammocount];
(vehicle _unit) removeMagazine (_currentMag);
sleep 17;
(vehicle _unit) addMagazine [_currentMag,_ammocount];
reload (vehicle _unit);
Note: Arma 2: OA
I guess reload acts as if you change magazine after emptying one
@winter rose The result is same with and without the reload command
Yep; remove/add the weapon to get rid of the reload time
Ah, I see. Will try! Thanks! ๐
why does this keep giving me the error "Error missing [" at the <<
this addAction [ //red team
"Join Red Team",
{
params ["_target", "_caller", "_actionId"];
_caller setVariable ["arenaStatus", RED];
},
]; <<
@jade imp I think you have an extra , in the end of the addAction params
Try this
this addAction [ //red team
"Join Red Team",
{
params ["_target", "_caller", "_actionId"];
_caller setVariable ["arenaStatus", RED];
}
];
Np ๐
Hey there
I'm trying to enable a trigger by planting an explosive inside it's zone, but I can't seems to make it work.
I tryed to search on google but all I can find is not relevent to what i'm trying to do.
Here is what I tried so far:
nearestObjects [position Trigger, "SatchelCharge_Remote_Ammo"];
You mean you want the trigger to be triggered when you put an explosive inside it?
(count nearestObjects [position Trigger, "SatchelCharge_Remote_Ammo", <radius here>] > 0)
Or do you want the explosive to explode when someone steps in there?
something like that
I think your syntax is wrong Nica
Leopard20Aujourdโhui ร 19:06
You mean you want the trigger to be triggered when you put an explosive inside it?
Yep , this is what i'm trying to do
It's for a tutorial for beginning friends
@little raptor what's wrong with the syntax?
(count nearestObjects [position Trigger, ["SatchelCharge_Remote_Ammo"], <radius here>] > 0)
Now it's correct
yeah yeah
i just used the original syntax
im just writing from the top of my head ๐
making some soup atm. Leopard posted correct syntax
remember to specify the radius
What values does radius takes ?
nearObjects is safer
count (position Trigger nearObjects ["SatchelCharge_Remote_Ammo", <radius here>]) > 0
but i assume it is, otherwise nearestobjects isnt what you want
@ebon citrus It is still possible to use this command with other trigger shapes
it is, but it wont be accurate
Yes it will
because the radius is exactly that
no it wont
the radius creates a circle
anything within that circle is accounted
(position Trigger nearObjects ["SatchelCharge_Remote_Ammo", maxRadius]) findIf {_x inArea trigger} != -1
if you switch up to a non-circle trigger, you want to use another command
so I absolutely need a elipse trigger ?
This works with all shapes
yes, but the original command doesnt
@cobalt leaf No, use what I posted
The triggers don't trigger when you place an explosive in them
So you need to use a loop
waitUntil {
sleep 1;
(position Trigger nearObjects ["SatchelCharge_Remote_Ammo", maxRadius]) findIf {_x inArea trigger} != -1
}

No it wont work
because the trigger won't even "start"
It only "starts" if a unit steps in it
you can start triggers manually
if condition is "Present"
it doesn't seems to work...
condition is the script that gets evaluated when the trigger is active
That's what I mean. It won't activate at all
you can activate it manually
you dont want to have constantly running triggers anyways
usually you have a simple activation method and a more complex condition
saves up on performance
as far as I know there's no such command for enabling triggers manually
And yes, he doesn't need it
i believe if you set all the activations to "none" it will run constantly
it wont?
afaik no
afaik it does
better test it
only one way to find out
yep
looks like i was right
if the activation is none, then the trigger condition gets repeatedly evaluated
wait what?
we're not talking about triggering
we're talking about the condition
nevermind
the condition field is continuously evaluated if the activation is none
all good, i wasnt crystal clear on that either
well, that's cleared up now
so the condition is evaluated once per second-ish, it looks like
you can also use thisTrigger to get the trigger from the condition field aswell
I've put the lines you told me to in my trigger's condition, but it doesn't seems to work
@cobalt leaf Long story short:
(position thisTrigger nearObjects ["SatchelCharge_Remote_Ammo", maxRadius]) findIf {_x inArea thisTrigger} != -1
Put this in condition
remember to specify maxRadius
got it working. Thanks!
hey guys, im new to modding
how can I edit a texheaders.bin file
CFG convert does not seem to do anything
you dont edit files
why?
you inherit from them and make a change
also, this is more of a #arma3_config question
there's no need
oh ok
The texHeaders file is automatically generated

which tool generates it?
you might want to use mikero's tools to unrap files instead
you don't edit texheaders.bin, you just simply don't at all.
That's not a file that's edited
pbomanager is ... not good
yes
if you are trying to edit it, you are doing something wrong
if you want to study mods, there is also the arma 3 samples
i also recommend taking a look at the PMC guides to modding
they helped me plenty along the way
Is there a reason you guys can think of that values would be recognized with a CBA_FNC_ServerEvent but be null when CBA_FNC_OwnerEvent on a HC?
If I have an array like ["A", "A", "A","A"] how do I return that they are all equal?
findIf not isequalto first element?
Perfect thanks!
Sent you a pm Dedmen, it's sorta long and complicated
Is it possible to delay the player going to the select respawn screen?
In an MP environment might I add.
@little raptor Thanks for the replies. I sorted the trigger, just being a moron with the mag names. I also sorted the marking of enemies but just scripting in a massive bombing run to wipe out the last few that are dug down somewhere in the objective area haha.
Do have a question about BIS_fnc_fireSupportVirtual.. On certain types of ammo, it's working perfectly but on the mag type I really want to use, it's triggering and the arti is coming down but about 700m away from the marker. Only thing changed is the mag type.
hi, can i asking
hi, you can ask
my server display this.
8:41:19 Warning Message: Script functions\fn_uh80Turret.sqf not found
8:41:19 Warning Message: Script functions\fn_uh80TurretActionCancel.sqf not found
8:41:19 Warning Message: Script functions\fn_uh80TurretActions.sqf not found
8:41:19 Warning Message: Script functions\fn_uh80TurretControl.sqf not found
8:41:19 Warning Message: Script functions\fn_uh80TurretReset.sqf not found
you most likely have a function (declared in CfgFunctions) and the file is not present
inside class "class CfgFunctions" right
This makes no sense... A bug?
[getMarkerPos "M1_Arti2","R_230mm_Cluster", 200, 10, 5] spawn BIS_fnc_fireSupportVirtual;```
The R_230mm_HE is hitting on the red arrow, the Clusters are hitting on the black. Both Arti1 and Arti2 markers are pretty much in the same area. I've tried different mag types on different markers (3 in total) and the only round that has problems is the R_230mm_HE....
If I set all three markers to the HE round, they all hit off to the right there in the same exact spot.
maybe it needs more altitude/speed? just a (wild) guess
but weird indeed
@sand elm yes
I didn't think of that... I'll give it a shot.
Holy shit.. @winter rose You were correct haha
Default values weren't enough. Double speed and alt and it works perfectly -.-
w00t w00t
@quasi cobalt cluster munitions are aimed at where you want them to disintegrate
If you give them too little altitude, they will auto-disintegrate
The clusters were working with default values but the HE's needed more power.
That was the last major thing to do in my mission so now I'm just cleaning it up ๐
There is one part where it's a time skip and it fades and displays text etc... What's the best way to reset the player position? I've tried just setting the position but if you're in UAV or doing something you fade back into the same thing you faded out on. It can't be forcerespawn right?
@quasi cobalt use https://community.bistudio.com/wiki/switchCamera during the fadeout
Hello, I would like to set a variable on the player, but only the server (and the player himself) can access it
player setVariable ["var", value, -2];
Number - the variable is set only on the client of given owner (clientOwner) id, or if id is negative, the variable is set on every client except the given one
Not sure about the -2
@ebon citrus Just for effect or does that it do something more then what's on the wiki page?
I'm going to use it for effect anyway, that's fancy haha
the variable is set on every client except the given one
your number is negative, meaning the variable is set on every client that's not "2" and 2 is server.
so you are setting it on everyone BUT the server, exactly the opposite of what you want
@quasi cobalt it's to force the player out of the UAV view
Oh duh...
Oh, so it's just 2, thanks, I misread it
Yeah, ignore me. Thanks mate, solves it all haha.
Are there any simelar functions like BIS_fnc_establishingShot to enhance a scenario?
thnx!
@compact maple 2 means only the server will see it, you'd need to do [player,2] to get both
@cold pebble Y but I wanted only the server to see it :p
forgot I wrote that lmao, I changed my mind
๐
{
[str _x] remoteExec ["systemChat"];
_player = _x;
[str _player] remoteExec ["systemChat"];
[_player, [
"Teleport players on Pad",
{
params ["_target", "_caller", "_actionId", "_arguments"];
_player = _this select 3 select 0;
[str _player] remoteExec ["systemChat"];
[_player] remoteExec ["removeAllActions",0,true];
[] spawn {
[teleFrame, "teleport"] remoteExec ["say2D"];
["teleportIn", ["","BLACK", 2]] remoteExec ["cutText", 0];
sleep 5.3;
["teleportOut.sqf"] remoteExec ["execVM",2];
_players = nearestObjects [teleFrame, ["Man"], 5, true];
[str _players] remoteExec ["systemChat"];
{
[str _x] remoteExec ["systemChat"];
_location = getPosASLW telePosition;
[str _location] remoteExec ["systemChat"];
_x setPosASLW _location;
} forEach _players;
["teleportIn", ["", "PLAIN"]] remoteExec ["cutText",0];
};
},
[_player],
1.5,
true,
true,
"",
"_player inArea teleTrigger",
5,
false,
"",
""
]
] remoteExec ["addAction",-2];
} forEach playableUnits;
This script is being executed on the server. I'm essentially wanting to add an action to each player that is local to them i.e. a action that appears when they just scroll wheel, except it wont show up
Because _player doesn't exist in the condition, I would say
Also, remoteExec -2 is "stupid", drop it (a server can be a player)
Code with -showScriptErrors, too
i am doing, but wont show an error cause im testing on dedicated
[player, [
"Teleport players on Pad",
{
params ["_target", "_caller", "_actionId", "_arguments"];
[player] remoteExec ["removeAllActions",0,true];
[] spawn {
[teleFrame, "teleport"] remoteExec ["say2D"];
["teleportIn", ["","BLACK", 2]] remoteExec ["cutText", 0];
sleep 5.3;
["teleportOut.sqf"] remoteExec ["execVM",2];
_players = nearestObjects [teleFrame, ["Man"], 5, true];
[str _players] remoteExec ["systemChat"];
{
[str _x] remoteExec ["systemChat"];
_location = getPosASLW telePosition;
[str _location] remoteExec ["systemChat"];
_x setPosASLW _location;
} forEach _players;
["teleportIn", ["", "PLAIN"]] remoteExec ["cutText",0];
};
},
[],
1.5,
true,
true,
"",
"player inArea teleTrigger",
5,
false,
"",
""
]
] remoteExec ["addAction",0,true];
also tried this script but didnt work either
its a community server so dont have easy access to the server rpt
the action will not add
testing it locally (in MP environment) I can see the remoteExec working, but no addAction being added.
Although adding the action without remoteExec also doesn't add the action
just noticed that ๐
btw... I asume teleTrigger is a marker area and not a trigger
Ah, there's a handful of other issues too.
well, if I change
"player inArea teleTrigger",
to
"player inArea ' teleTrigger'",
it works ๐
teleTrigger is a trigger,
ok, i'll try that
did you try the first or second one with that
2nd
ok, i'll give it a shot
actually the 2nd script works with a trigger (and without modifying it)
didnt seem to work in dedicated MP though
// Using 'player' here, means it'll add an action on this one player. So everyone on the server will see an action to teleport this one guy.
// Except on the server, 'player' is meaningless. So if execute on the server, it doesn't add an action to anyone.
[player, [
"Teleport players on Pad",
{
params ["_target", "_caller", "_actionId", "_arguments"];
//This'll remove all actions on the local player, for everyone.
//removeAllActions is generally bad, because it'll strip *all* user actions, including ones added by mods.
[player] remoteExec ["removeAllActions",0,true];
[] spawn {
[teleFrame, "teleport"] remoteExec ["say2D"];
//This'll execute for everyone, even players not on the pad.
["teleportIn", ["","BLACK", 2]] remoteExec ["cutText", 0];
sleep 5.3;
["teleportOut.sqf"] remoteExec ["execVM",2];
//So, I *think* this will teleport any nearby animals too. Because they inherit from "Man" in the config.
//Fun fact - you can remote control animals because of this!
_players = nearestObjects [teleFrame, ["Man"], 5, true];
//...Code cut...
//This'll again play for everyone, even players not on the pad.
["teleportIn", ["", "PLAIN"]] remoteExec ["cutText",0];
};
},
[],
1.5,
true,
true,
"",
"player inArea teleTrigger",
5,
false,
"",
""
]
] remoteExec ["addAction",0,true];
Check the comments on that code for issues.
all I did was creating 2 flags (teleFrame and telePosition), and a trigger (teleTrigger) at the same place as teleFrame
yea that's what's on my end as well, also @cold glacier , the sound is supposed to play globally, so that even if people aren't stood on it realise its being used
If teleFrame is an object, I suggest replacing that first player with teleFrame, and add the action to that.
also according to this article player is local to each machine https://community.bistudio.com/wiki/player
It is, but think of it this way: RemoteExec sends all of the arguments you give it over the network to other machines. player is evaluated on the current machine, and returns the player object on the current machine. This player object is then passed over the network to everyone else.
the thing is though, the action needs to always be there, but not appear until anyone steps on the platform. I tried adding it to the teleframe object, but its a weird object so its hard to actually click the action. Thats why its just easier to add to the player
how could i get around that issue then?
Rather than remoteExec'ing addAction, you could remoteExec call and just pass the code you want to run on each client.
Though it's much better if you define a function in CfgFunctions, and remoteExec that.
or simply set addAction to teleFrame instead of the players
I tried adding it to the teleframe object, but its a weird object so its hard to actually click the action. r
@exotic flax ๐
set the distance radius higher, so it will show up even when just close to it
I'm pretty sure you'd still need to look at it, unfortunately.
I'm currently standing 2-3 meters from the object and not facing it, and works perfectly fine
You should need to look at it, but the reality is that isn't always true. Try setting the radius to 50m, and then stand 40m away from it. You should need to look roughly at it.
im confused about this functions thing, as i've never used it before. How would i convert the script i have to work with the function. I can put the full sqf file in a pastebin if needed?
You'd need a section in your mission's description.ext with CfgFunctions defined.
but would I just put the addAction in there, seeing as all the other code in the same sqf file is working fine?
class CfgFunctions
{
class bensMagicalCode
{
class Anything
{
class myFunc {file = "path\to\my\func.sqf"};
};
};
};
You'd then call it like this:
[] call bensMagicalCode_fnc_myFunc;
And yeah, just make that function do the addAction
Then your server can execute:
[] remoteExec ["bensMagicalCode_fnc_myFunc", 0, true]
so i'd have to make another sqf file for the addAction. Would that then allow me to use player for the addAction?
Yeah, it would.
You'd have something like this in the function file:
player addAction [
"Teleport players on Pad",
//...Etc
];
so if the sqf file that i call the function from is already running serverside, i dont need to remoteExec it?
You need to remoteExec anything you want to run on the clients, if the code is currently running on the server.
In this case, you need to remoteExec the code containing addAction
Take a look at https://community.bistudio.com/wiki/Multiplayer_Scripting and https://community.bistudio.com/wiki/Arma_3_Remote_Execution if you haven't already ๐
ok, works fine, except when i get back after the teleport sequence, the action is now there twice
the sounds in the teleport out script are also playing twice
cant seem to post the code, says it cant send
https://pastebin.com/PJ4yWew4 - error is commented on here
nvm, working fine, had a random trigger placed with duplicate code in
Glad it's all sorted Ben! :)
can disableUserInput be used on specific players?
disableUserInput works locally on the machine it's run on. If you want to target a specific player, just run the command only on their client @copper needle.
The above links for Multiplayer Scripting and remote execution might be useful!
So {true} remoteExec ["disableUserInput", _arrayofplayers] would only run on players in the array right?
@cold glacier
[true] remoteExec ["disableUserInput", [playerA, playerB]] would do it, yeah.
Alright thank you!
will make sure to be. I'm fully aware of the risks
If you don't have it automatically re-enable user input correctly, you'll have to restart Arma to fix it.
Awesome! Just wanted to be sure :)
I appreciate the help!
Np, good luck with it!
- ] ^^
right, so
Scripting can be very useful, yes?
So it's probably possible for me to perhaps script something that would essentially be a currency mod, just as a script.
Like, what'd be my possibilities?
almost anything can be done.
Does this fall within the "almost"?
there are many ways to do money yeah. you may have seen such featutes on some game modes already.
how difficult it is depends on how do you want to use it
literally just want it to be a value that I can add and subtract to and from
nothing fancy, really
Ye thats possible @flat geyser
If you're willing to achieve by any means necessary, almost everything except hardcoded things or engine limitations are possible.
it shouldn't be that hard right?
By no means have I any clue how scripting works, so this is just a hunch
Create a variable on startup of the mission
create some way (like a command) to either increase or decrease that variable by a certain value
True. Would require only few lines of codes
time to figure out how to script I guess
yyyup!
Could someone point me in the right direction so I can learn how to change faction relationships with triggers? EG: You kill 3 Ind men as Blufor and ind turn hostile towards blufor.
I was looking at setFriend before but found a big argument on the forums about using it during mission runtime.
Eh, guess setfriend it is. Can you be even more of a legend and point me in the right direction for checking faction kills and things (If West have killed X East men: Setfriend)? Or am I diving down a rabbit hole I'm not ready for? ๐
Hm not sure about that so I cant help with that, sorry
Still a legend.

you can use Killed EH and count side killer
as for setFriend during a mission, it was an issue in Arma 2 (where units that would know you as a friend would need to forget about you first iirc)
in A3 it is instant
Ahh ok awesome.
That first sentence though honestly doesn't make much sense to me haha.
an Event Handler (EH) is code that will execute on said event (here, "Killed")
adding an EH to all resistance units will allow you to increment a variable by one if the killer is e.g of the west side
Ohhhh thank you!
That sounds a lot better then a trigger for something like this haha.
An EH gets called on the event right? So it's not like a trigger checking constantly if the conditions are met?
yes
Thanks heaps!
hint "Objective Alpha has been taken by BLUFOR."; redalpha1 call BIS_fnc_removeRespawnPosition; redalpha2 call BIS_fnc_removeRespawnPosition;``` Doesn't actually delete the respawn points given. Anyone know why? (Using the 3den editor respawn module)
@broken forge https://community.bistudio.com/wiki/BIS_fnc_removeRespawnPosition where's your "id" parameter?
Is there a function to limit the targeting range of static turrets?
nope! Besides viewdistance
Can you set view distance per object?
of courseโฆ not ๐
Guess I'm not using those awesome SAM Systems then ๐ฆ
Killing all the planes before they are in a decent view range haha.
Well, you can disable their simulation until planed are less than x meters, that's what I did
enableSimulation?
hello gamers, is it possible to execute a few functions with only one remoteexec?
if you group them in another function, it's the safest
how do you use the cinematic camera now? the exec "camera.sqs" is outdated and doesnt work
it should still work (and maybe tell you to use BIS_fnc_camera)
yeah thats it, but is it still the same process, just with a different command?
I suppose so, it has been since OFP I used camera.sqs
ah ill have a look thanks, camera.sqs defo doesnt work anymore tho, it just said to use BIS_fnc_camera
i acc cant find ANYTHING, BIS_fnc_ camera and the old one dont work, camera.sqs doesnt work.. i dont know what to do
try without mods?
acc yeah good idea will do
still doesnt work, surely im doing something wrong, ive seen missions with cutscenes before
wait, what are you trying to do?
camera.sqs only provides a floating camera you can use to grab camera position data, that's it
otherwise, see https://community.bistudio.com/wiki/Camera_Tutorial
yeah ik but it doesnt even load, just tried BIS_fnc_camera, which spawns in but as soon as i click right mouse it kicks me out
oh cheers ill have a look but i dont rlly understand what im doing, ill figure it out tho
omfg @winter rose life saver ty
๐จ
just a crosspost, nothing popcorn-worthy
I just got the package out
title of your sextape
I love the emotes 
Do I have access to the missionNamespace and BIS_fnc_listPlayers when I spawn code in the initServer.sqf without arguments or do I need to pass them as arguments?
I will report you for sexual harrasment
Where's the Human Resources
I am. Now please have a sit on this black couch
@vague geode you have access, these are commands/functions
||Ok, thanks alot. (originally)||
@winter rose Ok, thanks a lot. (edited)
a lot* ^^
If I use ctrlCreate is there a way to set the control as a background element?
So it doesnt overlap anything
and is it possible to have every element faded out/hidden from the start.
Actually fading/hiding them onload looks kinda dumb since it will quickly appear before it dissaperas.
I usually just create those controls first, but then I create every control via script so that's easier to pull off
Just a lot more work
it can be, it's just how I'm used to making UIs
What are you trying to do?
Do you want to place elements UNDER existing elements, or do you just want to have elements placed on top of each other?
Trying to place a background under existing elements
Depending on the existing elements, you can use core display IDD's which set the layer you place elements in, so putting it in a higher/lower layer could do that.
By default it should be IDD 46:
// create new Display at MISSION layer
_display = findDisplay 46 createDisplay "RscDisplayEmpty";
but other IDD's can be used as well, if they exist at that moment: https://community.bistudio.com/wiki/Arma_3_IDD_List
Alright but then I still have the issue of fading/hidding from start
and is it possible to have every element faded out/hidden from the start.
Actually fading/hiding them onload looks kinda dumb since it will quickly appear before it dissaperas.
@timid niche if you are talking about controls in configs, just change their background color alpha to 0
Alright but then I still have the issue of fading/hidding from start
_ctrl = _display ctrlCreate ["CLASSNAME", 1234];
// hide control completely
_ctrl ctrlSetFade 1;
_ctrl ctrlCommit 0;
// fade in control over aprox. 3 seconds
_ctrl ctrlSetFade 0;
_ctrl ctrlCommit 3;
Yeah obviously, but then I would have to use ctrlCreate on every single control, which just makes it rather difficult/messy to look at
if you use configs for your UI, you can use ctrlSetFade/ctrlCommit in the onload property
and in that case you can also use class ControlsBackground to put stuff in the background of your custom UI
Could someone help me with understanding the config system and accessing it?
Like how do I list all enemy types and filter those?
And how would I get a list of all buildings (what's the difference between "Building" and "House"?)
for what use will those lists be?
I want to spawn different kinds of zombies
and I'd like to spawn vehicles around buildings
I'd also like to randomise objects that I'll spawn in buildings
and on zombies
and I'd prefer not to write out the entire lists by hand
I mean I can get a list by [0, 0] nearObjects ["Building", 20000]; and so on
but that sounds silly
Should I do it differently?
making the zombie list is definiely simperl to make by hand. there cant be that many types
I mean there's like 25
for buildings its not as simple as not all buildings have config classes
it takes you less time to copy paste those than create a script that parses them form the config
assuming they have some attribute or name that you can even sort them with
in editor there is a tool to copy selected objects classes to clipboard
woudl be good idea to work out some of the basic stuff first before jumping into creating complex random missions
Well I did go through all the tutorials in eden and this is just a learning opportunity
ie I would still have to learn all this anyways
hmm I can't seem to understand how to select multiple items from the assets list
wait you mean I need to spawn all those types first and then I can copy them?
And there's like 100 to 150 types of zombies ๐
yes, place all different units, select all, right click, log classes to clipboard
Is anybody able to help me out on how I would go about checking if a missionEventHandler is active?
I have a paradrop script which allows the player to paradrop using MapSingleClick. However after the player has used it for the jump, they can then repeatedly use it. This is the code I currently have:
if (player inArea paraTrigger) then {
openMap true;
_paradrop = addMissionEventHandler ["MapSingleClick", {
params ["_units", "_pos", "_alt", "_shift"];
_marker = createMarker ["DZ", _pos];
_marker setMarkerType "mil_end";
_marker setMarkerColor "ColorRed";
_marker setMarkerText " DZ";
_marker setMarkerSize [1,1];
player setPos(getMarkerPos _marker);
deleteMarker _marker;
openMap false;
}];
} else {
removeMissionEventHandler["MapSingleClick", _paradrop];
};
While that code would likely work, I don't want the else condition to run if the eventhandler doesn't exist as it will likely generate a script error. I have read a few forum posts but didn't really understand them to be honest.
Edit: I know the paradrop script itself works. It is just the else condition
Problem 1: _paradrop is a local variable. Aka: Unless the whole thing actually refers to some variable in a lower scope, where you properly store it, _paradrop never will contain a proper value
Problem 2: Solvable once you solved problem 1. As after that, it is just a "does this exists" check
Ah I see. I did initially try a truthy check on _paradrop but if it cannot store a proper value, it'd make sense for it not working as expected. Thank you ๐
well it can
but ...
fnc_myMethod = {
private _foo = "bar"; // _foo got created
}; // _foo got destroyed
[] call fnc_myMethod;
diag_log isNil "_foo"; // Will result in true as `_foo` only ever existed inside fnc_myMethod
one solution is to use a global instead ... or to just store it somewhere else
or to eg. create the EH once and leave it there forever
Hmm ok. I think I can make sense of that ๐
I just remembered I am dumb. I only have that EH check inside a function which only gets called after an addAction. So I need to run the EH check from a different location otherwise the EH will never get removed.
Have you considered using _thisEventHandler?
It stores a reference to the event handler that you're currently in.
Not entirely sure if it'd help in this context, actually :D
I didn't even think of that to be honest. I believe I have a method which should work but if not, I will give that a shot. No harm in trying anyway
Just an idea, there's many, many ways to skin a cat, as they say :P
That is very true ๐
I've been racking my brain and all. I thought declaring a variable without an underscore made it accessible "globally".
Why is it that when it comes to setting the player position, it is undefined?
openMap true;
paradrop = addMissionEventHandler ["MapSingleClick", {
params ["_units", "_pos", "_alt", "_shift"];
marker = createMarker ["DZ", _pos];
marker setMarkerType "mil_end";
marker setMarkerColor "ColorRed";
marker setMarkerText " DZ";
marker setMarkerSize [1,1];
}];
player setPos(getMarkerPos marker);
deleteMarker marker;
openMap false;
removeMissionEventHandler ["MapSingleClick", paradrop];
are you sure marker clicked is executed before the setPos line?
Because right now, it's not
๐
Ah yeah... I suppose I kind of have to waituntil or something before executing the rest of the code
Also, currently there would be no delay between creating the marker and teleporting the player. So you might wanna get rid of the marker all together and just teleport the player onMapClick
You overcomplicate it yourself a bit there. Just4Info
You can easily include the code INSIDE the Eventhandler, so you don't have to wait for any code.
fu R3vo :angrypepe:

I did originally have that but then i was being dumb because I couldn't figure out when to remove the eventhandler
So yeah, just ditch the marker and exec it from within the Eventhandler
Right after you executed the code
removeEventhandler _thisEventhandler (mockup example)
openMap true;
paradrop = addMissionEventHandler ["MapSingleClick",
{
params ["_units", "_pos"];
player setPos _pos;
openMap false;
removeMissionEventHandler ["MapSingleClick",_thisEventHandler];
}];
If you need the marker
OR
removeMissionEventhandler ["MapSingleClick", paradrop];
So you CAN remove an EH inside the EH itself?
yes
Yeah sure
WTF???
ยฏ_(ใ)_/ยฏ
I have been working under the logic that it is impossible to do such things
I thought you could do that but surely removing the eh you have made whilst inside of it is just....
GAHHHH!
Indeed I do and I hate myself for it! Thanks ๐
๐
Always good to read the description ๐
I did read... most of it ๐
"most" != everything!!11111oneoneoneeleven
๐
On the biki, important stuff is always at the end ๐
Notes for example
Seems that way. Made this mistake a few times
Who hasn't ๐
Indeed
So many hours wasted because I refused to read completely
Who hasn't ๐
@cosmic lichen
<--- perfect!!1111
which command adds a launcher to a unit?
I never make mistakes you know. Like editing the backup file, wondering why it doesn't work etc.
addWeapon?
I guess that some people are still used to pre-1.63 ;)
Although even there it it would be possible to remove EH's by storing the index in a global variable and retrieving it again when inside the EH
@fair drum Check Weapons and Unit Inventory https://community.bistudio.com/wiki/Category:Scripting_Commands_by_Functionality
dis new?
Why isn't that pinned?
It's not yet done
It's actually in strings
Commands to handle arrays and other variables
๐
I edited like 1700 pages with new categories
Why do we (not) pay you?
the old ones need to get removed
@jade abyss did you check both? Because format is in both ๐
When all other 500 commands are done I will remove the old categories, then it should only be in strings.
Ty
just speaking of it:
Anyone ever had an issue with a wild "!" appearing, after parseText?
like this parseText! ?
Nope
_text = format["<t align='center' font='FONTNAMEBLUB'>%1</t>", "TEXT"];
_ctrl ctrlSetStructuredText parsetext format[localize "STR_SOMESTRINGTABLENAME", _text];
๐ค
It's clearly excited to see you @jade abyss
currently checking the stringtable output
floor(random 100) < 33 will give a 33% chance to fire right?
just speaking of it:
Anyone ever had an issue with a wild "!" appearing, after parseText?_text = format["<t align='center' font='FONTNAMEBLUB'>%1</t>", "TEXT"]; _ctrl ctrlSetStructuredText parsetext format[localize "STR_SOMESTRINGTABLENAME", _text];
Okay... that was unexpected:
The stringtable entry "STR_SOMESTRINGTABLENAME" was "Text: %1!" and has align=left.
When it was merged together with the alight=center part -> It "decoupled" the ! and added it to the left (since it is not inside the _text align definition...

ยฏ_(ใ)_/ยฏ
having some problems with this line. telePosition is a invisible cube in the centre of a room, and im wanting to teleport all players in that room by using this line of code:
_players = nearestObjects [telePosition, ["Man"], 15, true];
The height doesnt matter as its only 1 story, yet if i'm at a certain spot thats like 1-2m near the object, it wont teleport me. Everything else is fine, its just this one line
I'd try using CAManBase instead of Man, though I'm not sure it will help. another method could be
_players = allPlayers select {_x distance telePosition <= 15};
would that teleport a zeus as well though? just in case they get too close
i assume both would. you can add a condition to prevent moving specific units.
yeah, shouldnt be too much of an inconvenience tbh
is there a isKindOf for any UAV controllable?
if I had players unpack a mortar in a trigger area, how could I go about checking if it is present? I know that thisList will give an entire array of objects, but should I go about it by checking if the class is in the list? or do some sort of isKindOf or typeOf manipulation
this is if the mortar has no variable name obviously cause I'm giving them the backpacks to assemble
Could always give this a whirl - https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#WeaponAssembled
Add that to the players, wait for them to build it, then check the area it's in.
In terms of checking if the object is a mortar, isKindOf is probably your best bet.
i guess I could add a variable to said mortar using the weapon assembled
then check for the variable
Why are you wanting to check if a mortar has been assembled in the area?
just to trigger a objective complete for building it in a specific area. make a full hand holding mission for ace mortars
The easiest way I'd probably do that, is wait for the WeaponAssembled event handler to fire, then when a mortar is built, spawn a script to check if it's in the area. Something like _mortar inArea "mortarTargetArea"
figured out a easier way than that...
{
if (typeOf _x == "O_Mortar_01_F") then {
true;
};
} forEach thisList;
for trigger activation
that foreach would only return true if the mortar is the last object in the list though. sure you dont want something more like this?
thisList findIf {typeOf _x == "O_Mortar_01_F"} > -1```
yes that would be much better
Hey, is it possible to trigger a mission complete when an area as less then x men from whatever faction in it?
I can't seem to find anything.
yes - e.g in a trigger set to "any", count thislist < 10
Legend. Thanks mate!
Is there an event handler for when someone pressses the autonomous button on drones?
I want to be able to disable this, using an event handler to automatically disable it is the simplest thing I can think of
none afaik @surreal peak
shame, if you use disableAi would reselecting the button turn the AI back on
I don't think so
aight ty, more testing required it seems
Lou, when you say set to any do you mean "anybody"?
mayhaps, I don't use triggers very frequently ๐
Haha fair enough. Is this correct? (Tried both Anybody and OPFOR)
https://imgur.com/a/lF10lBx
Also, do you just full script missions?
when I do missions, I either place units in the editor or script-spawn them
Type: Present
@quasi cobalt โ
No Present option under type ๐ฆ
There is Guarded by OPFOR though so maybe that'll work.
nope
what is listed in Type?
Do I maybe have to count the alive ones? count thisList alive < 10 or something? I'll be honest... I haven't really spent much time learning the syntax yet -.-
Thanks!
I'm just finishing the end of the missions then I can put the final touches on everything.
How do you make it so a trigger isn't activated until all players are in? I can't test with anyone else at the moment but I'm assuming using "vehicle player == heli" as a condition will activate the trigger as soon as the first player enters.
allPlayers.... I haven't seen that once up until now -.-
allPlayers findIf { !(_x in heli) } == -1
@winter rose You said BIS_fnc_ambientAnim should best be executed server side so I put this into the units init-field (since it is pre-placed in the editor it should be local to the server and that's how it was recommended in the Community wiki). I use spawn in order to add a delay to make sure that the unit is already there before the code gets executed.
The problem is that the unit isn't doing anything now and is just standing around even though it has the right unit insignia which means that the code is actually working.
Any idea how I can make the ambient animation visible for the clients (including JIP) without having dozens of logic entities spawning whenever someone joins the server?
if (local this) then {
this spawn {
sleep 60;
[_this, "REPAIR_VEH_KNEEL","ASIS",objNull] call BIS_fnc_ambientAnim;
[_this,"Jets_ID"] call BIS_fnc_setUnitInsignia;
};
};
It appears so even though switchMove is used the effects of which are said to be global...
out of curiosity (this isn't causing the problem), why are you including the snapTo parameter, when it's an optional parameter and you're just giving it the value it defaults to if you don't include it?
is there some way to "force" grass cutters to actually ... update?
like ... removing grass cutters not always "shows" the grass again
(same with moving them btw.)
context: looking into a way to make a farming sim mod in arma 3 a reality
Farma 3 CDLC?!
but to answer you question; I believe the "remove clutter" feature in Arma is engine based, since it also works when placing objects etc. (and the grass cutter is just an empty object).
I could be wrong though...
yeah .. that much i already found out during "research" sadly ๐
I think you can make the engine update that by placing an object nearby but I'm not sure about that @queen cargo
atleast in 3dent hat did the trick iirc
that ain't enough sadly ๐
just refreshes that seemingly at random
Move away, then come back :p
Hi, how would you save the inventory of a player in a relational database ?
I got a player table, and I tought of creating a gear table and sub_gear table, gear would be things such as uniform, backpack, headgear
Subgear would be anything that can fit in a container such as ammo
Idk what is the most optimized way to do this
out of curiosity (this isn't causing the problem), why are you including the snapTo parameter, when it's an optional parameter and you're just giving it the value it defaults to if you don't include it?
@hallow mortar Oh, that's just a relic because I tried having it snap to something before to see whether that would fix it.
@compact maple we just stored the output of getUnitLoadout as a string in the database, and use setUnitLoadout in-game after getting the data
I didnt saw that function, thank you
Is it possible to somehow detect if an error is displayed on the screen, and what it says? Trying to create some automated config tests.
nope afaik (though maybe an idd or idc might be something doable?)
Yeah, that is sort of what I'm currently thinking
buuut you can use some community tools that intercept exceptions?
Probably possible, but I'd like to avoid creating dependencies or extensions.
But the function getUnitLoadout do save ammos depends on what containers theyre in i.e uniform back pack vest?
Or will setUnitloadout randomly add it to containers
dunno (I think it does check the container), but you can check ๐
It does
The containers are individual objects within the array
Each item/magazine is saved within the object
If you explore the output of getUnitLoadout a little, this would be evident
Effectively, setunitloadout will create a carbon copy of the loadout you pass it
Nice! Thanks:)
Hi guys! I was planning on making a rebreather for a helmet. Question is, does it have to be in a specific slot in order to give unlimited breath or can it be in any slot as long as the correct code is in place?
context: looking into a way to make a farming sim mod in arma 3 a reality
@queen cargo I suggested this as a joke damnit ๐ . Although I would actually really like to see it, and seriously considered doing a gamemode around it xD
In terms of grass cutting... What about fishing around for a modeller to make a spawn able grass object with animation sources for cutting? I imagine spawned grass would be much more flexible than using the grass that's already there.
it is more about being able to "regrow" and remove the existing grass here
preparing areas etc. also is required
long story short: currently in the POC phase, in case someone wants to actually do the whole animation and texture stuff tho, feel free to DM me
Yeah, I'm just wondering if there's insufficient control ever existing grass/foliage. You almost want placeable fields.
does anyone know the scripting for menus in vanilla arma 3?
like you activate a certain trigger and your mouse appears with a menu
and you can select different options
@tough abyss #arma3_gui
Also, it sounds like youre talking about dialogs
here's a guide
anyway to see a child control from a parent control in the GUI editor?
_playersPaP = allPlayers select {_x distance telePosition <= 15}; this doesnt seem to work. Wanting to select all players in a a certain area
_playersPaP = nearestObjects [telePosition, ["Man"], 15, true]; this works, but it doesnt cover the whole area. If im like directly under it or in the opposite corner of the room it doesnt work
nevermind, fixed it
yeah, select doesnt work like that
wat? well, yes it does? ๐ค
see Alt Syntax 5 @ebon citrus
private _allOpfor = allUnits select { side _x == opfor };
what is the need for that syntax ๐
but yeah, it seems like it works like that nowadays
โฆa filter?
It has a lot of purposes
i've been using apply for ages like an idiot
apply is different
like, poopton of usage yes ๐
apply doesn't filter
unless you do something boring
and lengthy with it
like apply {if (true) then {a} else {-1}} and then removing that [-1]
you can filter with it, yeah
not the best way
but good to know this
thanx Lou!
now i can stop being an idiot and actually go and rewrite like 60% of my scripts with this change
private _array = [1,2,3];
_array select { _x > 2 }; // [3]
_array apply { _x > 2 }; // [false, false, true]
```yup
after the apply
Even after
you build a list of elements that dont fit and delete all those elements from the original array
unless there's one element, you shouldn't use deleteAt in a loop
You can test it if you want
You'll see what I mean
Apply here to build the list;
Delete elements according to list```
deleteAt 2 // delete at 2
deleteAt 3 // delete at 4 (from the original array)
which is why you loop the find outside the apply
build a list of elements
not a list of indexes
but YES
select alt syntax 5 is ALOT BETTER
and the way to go
im just arguing what i've been doing
OR:
Start from the end ๐
Yeps
im just gonna go and farm cabbages
๐
naaah, you're just farming for compliments here :p and you might have them, ya sneaky bum!
that's weird
I just tested this:
_a = [1,2,3,4,5,6,7];
{
if (_x mod 2 == 0) then {
_a deleteAt _forEachIndex
}
} forEach _a;
_a
And it works (?!)
It didn't use to
Have they changed something here?
I think forEach loops properly though an array now
try with 3
what do you mean?
if (_x mod 3 == 0)
ยฏ_(ใ)_/ยฏ
dang, they fixed that magic
@still forum ๐
Am I going crazy?! Or have you guys fixed it (sorry for the ping)
no ping
I was just curious. Sorry
It is both a good thing and a bad thing
If you do:
_a = [1];
{
_a pushBack 1
} forEach _a;
You'll end up with an infinite loop!
I don't know how I feel about that! ๐
This doesn't work:
_a=[1,2,3,4];
{
_a deleteAt _forEachindex
} forEach _a;
_a
I expected to get an empty array, but it returns [2,4]
Also tried with deleteAt 0 and I got [3,4]
๐คทโโ๏ธ
If you later see this message Dedmen, can you please explain what's going on here?! (I'm not pinging you this time)
I think it's a bug
@little raptor wasn't changed, and it'll skip every second element
why explain
isn't it logical enough?
why does this work?
_a = [1,2,3,4,5,6,7];
{
if (_x mod 2 == 0) then {
_a deleteAt _forEachIndex
}
} forEach _a;
_a
deleteAt skips every second element
but because of the mod 2, you only delete every second element
mod 3 works too
yeah, realised later ๐
too good to be true :p
https://steamcommunity.com/sharedfiles/filedetails/?id=2237410223 @winter rose Finally got something playable after asking so many questions here haha
congrats! if you want to advertise it, you can move it to #production_releases, players will see it better ๐
i need saved from myself. please tell me there is a better way to exit
switch(_test) do {
case CIVILIAN: {if(1==1)exitWith {}};
}
... stuff to do if _test != CIVILIAN```
O__o
i have other evaluators
if (_test isequalto civilian) exitwith {};```
?
but.... i just need a simple exit lol
eh i guess i need to add more context
case WEST: {
_veh = "B_T_VTOL_01_infantry_olive_F";
_units = ["B_T_Recon_Medic_F"," B_T_Recon_F","B_T_Soldier_AAA_F","B_T_Soldier_F","B_T_Soldier_F"];
_spawnpos = [worldsize,worldsize,0];
};
case EAST: {
_veh = "O_T_VTOL_02_infantry_F";
_units = ["O_medic_F","O_engineer_F","O_Soldier_AA_F","O_Soldier_A_F","O_medic_F"];
_spawnpos = [worldsize,0,0];
};
case INDEPENDENT: {
_veh = "I_Heli_Transport_02_F";
_units = ["I_Soldier_SL_F","I_Soldier_AT_F","I_Soldier_AA_F","I_medic_F","I_Soldier_SL_F"];
_spawnpos = [0,0,0];
};
case CIVILIAN: {if(1==1)exitWith{}};
};```
@robust hollow's avatar says it all ๐ ๐
i would rather not add unecessary evaluations
scopeName "root";
switch _test do {
case civilian:{breakOut "root"};
case west:{...};
case east:{...};
...
};
...
case CIVILIAN: {}; ? or even nothing?
not placing case civilian is even faster ๐คจ
he wants the script to exit and not run code after the switch too though
though an exitwith above the switch would have worked too
ya it would have, but i would rather evaluate the side once
well yep
oh, and breakOut can stop the current script?
exits the scope with that name
connor got it. tyty
so same as exitwith if breaking out of the top level scope
noice. I kinda despise breakTo/breakOut, as it's a kind of goto ๐
but they ofc have their use in some cases
cough cough return cough cough
that's the closest we have, with the alternative syntax yes
but here, a if/exitWith is the more readable solution
shameless self advertisement
with proper alt syntaxes like SQC, that is even a proper solution
thats why i was thinking if(1==1)exitwith{}
(plus exitWith is not leaving the current call scope)
if(1==1)exitwith{} can be reduced to if true exitWith {}
exitWith in switch would have broke out of the switch scope I believe? not the script itself?
lemme try
not sure actually
anyway, an if (_test == civilian) exitWith {} before the switch is better
switch (1) do {
case 1: { if true exitWith {}; }
systemChat "foo";
};
systemChat "bar"```
would expect this to print "bar"
but might also print "foo" and "bar"
(breakOut forces you to read scope names to know where it breaks)
(unless you just do scopeName "__function" everywher :P)
ya i was reading about it. not sure im crazy about it
guess im evaluating side twice
it isnt heavy enough to notice
switch will evaluate side multiple times anyway
how do you think it is comparing it to each cases ^^
11:00:56 Error in expression <do {
case 1: { if true exitWith {}; }
systemChat "foo";
};
systemChat "bar">
11:00:56 Error position: <systemChat "foo";
};
systemChat "bar">
11:00:56 Error Missing ;
o, i should have read that first ๐คฆ
only prints bar
*you might have to fix things i failed at typing in discord ๐
@orchid stone it compares to every case until it find a true comparison
exactly
kinda what Zacho40 said
the last one will take the longest to execute, the first not
case WEST: {
_veh = "B_T_VTOL_01_infantry_olive_F";
_units = ["B_T_Recon_Medic_F"," B_T_Recon_F","B_T_Soldier_AAA_F","B_T_Soldier_F","B_T_Soldier_F"];
_spawnpos = [worldsize,worldsize,0];
};
case EAST: {
_veh = "O_T_VTOL_02_infantry_F";
_units = ["O_medic_F","O_engineer_F","O_Soldier_AA_F","O_Soldier_A_F","O_medic_F"];
_spawnpos = [worldsize,0,0];
};
case INDEPENDENT: {
_veh = "I_Heli_Transport_02_F";
_units = ["I_Soldier_SL_F","I_Soldier_AT_F","I_Soldier_AA_F","I_medic_F","I_Soldier_SL_F"];
_spawnpos = [0,0,0];
};
};
if((_this select 1) == CIVILIAN) exitwith{};```
so thats basically the same thing
โฆthis is in these moments I realise we spent way a ridiculous amount of time analysing/benchmarking this game xD
biggest issue with execution times is the amount of actual instructions required
the if for example is faster, because less stuff is done simply
got it
makes sense
wow that topic was way more interesting than i expected, thanks guys lol
Is there a way to identify which server a script is running on?
Like e.g. by getting and comparing server IPs...
there is serverName
@winter rose Do you ever sleep? I worried about your health, mate.
Still thanks for the tip.
I happen to sometimes :-]
I am asking because it's about 4 am here and I have seen you here all day long and the only reason I am here at this hour is because I just woke up due to rain...
I played an MP games with friends until 2 then I fixed earlier mistakes I made on the wiki due to a regex, all solved now. But I don't work on Fridays, so there is that ๐
Thanks for your concern! ๐
I attached a ED-1 onto an offroad and then added weapons to the ED-1 with addWeapon/addMagazine. My question is why my missiles are being shot from the ED-1, but not actually appearing.
I can see the smoke and hear the sound of them being fired, but they never actually appear. It's very strange. Does addWeapon not work when it's on a vehicle already attached to another vehicle?
it does, since they are fired
check unattached?
Is there any way to let an NPC do a move in an infinite loop? (It would be great if the solution would take global effect since the effect of BIS_fnc_ambientAnim appears to be local)
That causes the unit to go into a loop?
no, use animation done EH along with this
Would there be any reason why a script doesn't run properly, but doesn't return errors either? ๐ค
// some code
diag_log ">> before switch"; // returns ">> before switch"
diag_log format ["-- %1", _mode]; // returns "-- Init"
switch _mode do {
case "Init": {
diag_log ">> Init"; // doesn't do anything
// some code, doesn't run
diag_log ">> Init - done"; // doesn't do anything
};
// more code, doesn't run
};
// more code, doesn't run
_mode being undefined on switch? (yet still displaying)
otherwiseโฆ idk
maybe some unclosed { }
The log is right before the switch, no code in between, so it should be there...
And if it would miss a bracket or other code it should give some error (and yes, errors are shown and logged)
Guess I'll have to debug line by line to figure out where it goes wrong ๐คฏ
although it's a copy from a BIS function, so it should work...
a wrong case somewhere? (switch-case are case-sensitive btw, but it doesn't explain why it would stop code after the switch)
we have a wiki page for everything!
@winter rose I can't seem to find a page for mines, any chance you know of one?
a mine? not personally, every time the relationship ended in an explosion
@shell cipher mines, on which topic?
how to setup/config entries
I can find bits and pieces and work out from official mines but something aren't adding up and was hoping to find more info
https://community.bistudio.com/wiki/Category:Command_Group:_Mines for commands,
but unfortunatelyโฆ
we don't have a page on the wiki for everything ๐ญ it was a figure of speech
if you have data, be sure to provide it in #community_wiki so we group the info on a brand new page ๐
๐Thanks for the help
no, use animation done EH along with this
@winter rose On the Community wiki it says that that event handler isn't getting triggered by switchMove...
where?
where?
@winter rose Quote:
Killswitch: "This command will not cause an AnimChanged or AnimDone event. However, playMove will."
You have to use this workaround:
unit switchMove anim;
unit playMoveNow anim;
@winter rose Please add this to the wiki too.
This workaround can also fix some animations not playing on a unit (you can put it on playMove/playMoveNow and switchMove pages too)
โฆI use animDone with switchMove ๐ค
I'll have to do some tests and edit accordingly
Would there be any reason why a script doesn't run properly, but doesn't return errors either? ๐ค
@exotic flax would need to see more of your code to debug it, as the error in the code you sent isn't apparent!
Could always drop it on pastebin or somewhere.
Have fun going through 1500 lines of code ;)
Although after debugging it line for line (in blocks) I managed to fix it... still no idea why though, or why it never displayed an error...
Just connect debugger and step through the code line by line to see where its going?
I'm sure it was a typo somewhere, just strange it didn't give any errors
params ["_killed","_killer","_instigator"];
if (isPlayer _instigator && getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2) then {
hint "you ve just killed an independant!";
} else {
_unitside = getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side");
hint str _unitside;
};
}];``` having some issues with this. Returns the hint saying "2" which should indicate the first part of the if statement works. I think it's down to the isPlayer _instigator thing but i'd have no clue how to fix it
getNumber (configFile >> "cfgVehicles" >> typeOf _killed >> "side") == 2
why not just
side _killed
or
side group _killed?
taking this from an old forum post and trying to integrate it into a mission ๐
any clue on how i'd go about fixing the if statement?
what would that entail?
if (isPlayer _instigator) && (side _instigator == "resistance") {...}
I imagine that would solve it if it was broken
hint _instigator?
str
hint and diag_log
null object won't be a player
I guess you should fallback to using _killer if _instigator is null
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#EntityKilled
The example even shows that
okay, _killer returns "R Alpha 1-3:1" which i presume is the player character. But i still have no clue why that wouldn't activate the first part of the if statement
How come I am unable to take a value from the array and use it with playMove?
Obviously I am overlooking something but it just shows "Playing: Any".
_animsArray = selectRandom ["HubBriefing_pointAtTable","HubBriefing_scratch", "HubBriefing_stretch", "HubBriefing_talkAround", "HubBriefing_think"];
hint format ["Playing: %1", _animsArray];
jumpCoordinator playMove _animsArray;
does hint display the correct thing?
Ah any
ANy means undefined variable
but if that really is your whole code, then that looks good to me
Nah, it shows up as "Playing: Any" and I get a "Generic error in x" or something like that
"Any" means undefined variable. But your code looks correct
This is the entirety of this function file. It is called on activation of a trigger using player call JC_fnc_aiAnims
_isInTrigger = player inArea paraTrigger;
_animsArray = selectRandom ["HubBriefing_pointAtTable","HubBriefing_scratch", "HubBriefing_stretch", "HubBriefing_talkAround", "HubBriefing_think"];
if (_isInTrigger) then {
[] spawn {
sleep 0.5;
hint format ["Playing: %1", _animsArray];
jumpCoordinator playMove _animsArray;
};
};
yeah the variable _animsArray is undefined
ta-daaa
"spawn" creates a completely new script instance, it doesn't know about your local variables that once existed
got it working, moved to init.sqf
hey i got a problem with my if operator. When i try it it gets an error "missing ) "
_number = floor random 100; if (_number =< 10) then {};
what am i doing wrong ? or am i just dumb.
@tired delta You want <=, =< is not an operator. ๐
So oddly enough, switchMove works however when I use playMoveNow, nothing happens. The AI just plays an idle anim (Not one from the array).
Any thoughts why this occurs? I think I am using playMoveNow correctly ๐ค
[] spawn {
_animsArray = selectRandom ["HubBriefing_pointAtTable","HubBriefing_scratch", "HubBriefing_stretch", "HubBriefing_talkAround", "HubBriefing_think"];
for "_n" from 1 to 10 do {
sleep 0.5;
hint format ["Playing: %1", _animsArray];
jumpCoordinator playMoveNow _animsArray;
sleep 10;
hintSilent "";
};
};
Not sure why it happens @rain mural - but you could try doing a switchMove before your spawn
It might be the animation the AI is currently playing can't transition to the next move or something (I'm not super familiar with the animation system)
I'll give it a shot and see what happens. I'll switchMove 0; to reset the anims
@rain mural โฆswitchMove doesn't take Number
Sorry, I meant ""
The AI is... locked... switchMove doesn't even fix him ๐ค
I am going to try giving switchMove an anim rather than " " and see if that works
Ok so providing an anim fixes it. Not sure why he doesn't change initially though
@rain mural The animations you provided do not work with playMove (they have no interpolations or connections)
To fix these anims, you should use this:
https://discordapp.com/channels/105462288051380224/105462984087728128/759073846258171945
Another example Lou!
Ah so I switch to the move then play it?
Ah ok. Thank you very much
Also, you don't have to add a random sleep number like 10. You can get the animation time:
_animTime = -1*getNumber (configFile >> "cfgMovesMaleSdr" >> "states" >> _anim >> "speed");
if (_animTime < 0) then {
_animTime = -1/_animTime
};
Oooh ok thanks!
- Fixed the code
Does anyone have a script that limits turret rotation?
If I know the typename of a unit, say "B_Soldier_F" how can I get the parent classes of it?
I think that's the reverse of configName
hmm I wonder if it's "configName _x == ""B_Soldier_F""" configClasses ( configFile >> CfgVehicles");
and then you can call BIS_fnc_returnParents
So you want to get the config of the soldier?
Yo, Iโm looking to create a stupid super weapon (bunch of vehicles combined) and Iโm looking for how
@little raptor of arbitrary typename, yes
what you wrote works
altho it has an error
"configName _x == 'B_Soldier_F'" configClasses ( configFile >> "CfgVehicles")
In v2.0, you also get configOf command
whaaaa the F is that
If you intend to use that you need to optimize it tho
"configName _x == 'B_Soldier_F'" configClasses ( configFile >> "CfgVehicles")
->
configFile >> "CfgVehicles" >> "B_Soldier_F"
what I wrote is the same as what he wrote
yeah it's a general question
You know like weapons and other stuff
@amber lantern
"configName _x == 'B_Soldier_F'" configClasses configFile
Maybe this
no
but I suppose that if I know it's a unit then configFile >> "CfgVehicles" >> "B_Soldier_F" works
if (isClass (configFile >> "CfgVehicles" >> "B_Soldier_F"))
if (isClass (configFile >> "CfgWeapons" >> "B_Soldier_F"))
if (isClass (configFile >> "CfgMagazines" >> "B_Soldier_F"))
but the class could also exist in all 3 of these
Hmm I see that the parents returned don't match the asset browser hierarchy
@still forum Then how do you get the config without even knowing where it comes from?
I just wrote above how
What if it comes from another class?
or names
Altho it's a good point
What I wrote above is what I wrote
you either guess, or iterate literally all configs that exist and probably get a dozen hits for your thing and still don't know what it might be
What I wrote was a general search
Is there a way to filter based on the name I see in the asset config?
what you wrote was general search on a single level that is literally the exact same as just
'B_Soldier_F'
just implemented in a stupidly inefficient way
@amber lantern All vehicles come from cfgVehicles
that's all
This includes all objects and units
@little raptor yeah I know, just that BIS_fnc_returnParents doesn't match the asset browser names
Maybe just explain your usecase, maybe there's a better way and you are thinking in the wrong direction
For example there is no "Zombies" classname
what "asset browser names" ?
@still forum if you are in 3den
You mean the categories in editor?
yeah
they are categories, they are not config parents
they are defined in the Vehicle's "editorCategory" entry
if you want to search for "zombies", then:
"getText(_x >> 'displayName`) == 'Zombie'" configClasses (configFile >> "cfgVehicles")
editorSubcategory = "EdSubcat_Helicopters";
for example. That's in "Helicopters"
what are you trying to do? what's the use case?
"'zombie' in toLower getText(_x >> 'displayName')" configClasses (configFile >> "cfgVehicles")
@still forum I want to randomise the units I spawn
the editorSubcategory is a classname, you probably want to search in its displayname
isKindOf? ๐
ie I need a list of all the type names
And I'm not in a thousand years going to write them out by hand
all the type names
of a specific faction/side?
yeah
Just go through all cfgVehicles and filter them by side and type
look in config viewer for "CfgEditorCategories"
in there you have a list of all categories
{
} forEach ("true" configClasses (configFile >> "cfgVehicles"))
Thank you so much for the help so far btw
find the classname of the category that you want in CfgEditorCategories, and the subcategory in CfgEditorSubcategories
for example if you want all "Structures -> Village"
the category is "EdCat_Structures"
and the subcategory is "EdSubcat_Residential_Village"
Then find all vehicles in that category that are listed in 3den
("
getNumber (_x >> 'scope') == 2 &&
{getText (_x >> 'editorCategory') == 'EdCat_Structures' &&
{getText (_x >> 'editorSubcategory') == 'EdSubcat_Residential_Village'}}
"
configClasses (configFile >> "cfgVehicles"))
tadaa all spawnable objects in Structures -> Village
And you could also do things like
("
getNumber (_x >> 'scope') == 2 &&
{toLower getText (_x >> 'editorCategory') in ['EdCat_Structures', 'EdCat_Structures_Malden', 'EdCat_Structures_Enoch'] &&
{getText (_x >> 'editorSubcategory') == 'EdSubcat_Residential_Village'}}
"
configClasses (configFile >> "cfgVehicles"))
get all spawnable objects in
Structures -> Village
Structures (Malden) -> Village
Structuers (Livonia) -> Village
y'all know if it's possible to change a variable in the config? https://i.imgur.com/IHvRcbJ.png
yep, that
how would i go about changing it?
@broken forge its not a variable, its a config entry.
You make your own mod and change it in there
rip
It's wrong, what are you pointing at?
was wanting to make a sort of perk system but guess that idea's out ๐
what are you pointing at?
at you telling others what's wrong and what they should fix
("
getNumber (_x >> 'scope') == 2 &&
{toLower getText (_x >> 'editorCategory') in ['edcat_structures', 'edcat_structures_malden', 'edcat_structures_enoch'] &&
{getText (_x >> 'editorSubcategory') == 'EdSubcat_Residential_Village'}}
"
configClasses (configFile >> "cfgVehicles"))
Fixed
Yo the guys in editor didnโt help so, I wanted to know how to do a script without a trigger, just in mission start
@tough abyss you can place it in initServer.sqf
execVM requires params



. @ornate marsh, that was for you.




