#arma3_scripting
1 messages ยท Page 532 of 1
If I'd do something like this
{getPlayerUID _x} foreach allPlayers I'd assume I'd get an array off playerUIDs on the Server. But then? How'd I use this list to add the action to only a specific player with a specific player ID? (By the way, I do already have an array of the PlayerIDs/steamID64 I want to use)
you find the player object as you have posted above, then you use remoteExec and use that player as a target
in the remoteExec you addAction
so addAction runs on the computer of that player
do you do this from server side or from where?
Oh find was actually the word that made it clear to me. (I somehow didn't know I can find a specific spot in an array....which does make sense that there is one)
I think I can work with that. Thanks ๐
I am still quite noob to most things ARMA on build side.
Looking for a solution that creates a area that will delete air vehicles in in the trigger area only. Scenario is that pilots keep landing in a prohibited area to everyone's demise. I am not looking for explosion effects but just a simple "remove object" kind of function. Either I suck at google or answer is not posted on there so hoping someone can help please. Not sure how to fill it in but - http://prntscr.com/ntikl9
yeah pin that, took me forever to find it again 
yeah use find command @spring stone
private _index = allPlayers find {(getPlayerUID _x) == _theRequiredUID};
if (_index != -1) then {... we have found him! };
" I'd assume I'd get an array off playerUIDs on the Server" forEach doesn't return an array
I will make possible for players to bury money in my mission, the place dug will have no grass... Arma 3 have a clutter cutter?
yes, grasscutter
also if you are using it in a spawned script make sure you make the whole code I posted above atomic in case that allPlayers array changes in between commands... which could happen... once per a million years maybe ๐ค
@still forum thanks
Oh, yeah you are right Dedmen. Slight overside in my Idea. Thanks at all an @astral dawn ^^
Does anyone have any idea what could be another way to execute string like this: SQF _code = str(_object) + " setDamage 1"; call compile _code;
Can you exitWith an EH ?
player addEventHandler ["Hit",
{
if (condition) exitWith {};
...
sure, but the eh will still stay
you can try to use waitUntil?
by saying that the eh will saty I mean that it wont get deleted
it just quits and it will run again when the event is performed
"also if you are using it in a spawned script make sure you make the whole code I posted above atomic"
Just store allPlayers in variable.
@grim coyote why are you trying to do that?
waitUntil doesn't suit
so have a spawn inside the EH ?
ye
making the code scheduled again, is that it ?
or executing it in a scheduled environment ?
@still forum Storing scripts
for later use
but guess I need to use remoteExec :/
also I cant store _object I need to store "this" and then later replace "this" by new object
@quartz coyote basically ```SQF
_object addEventHandler ["eventName",{
_this spawn {
params ["_object","_param2","_param3"];
waitUntil {_object getVariable ["var",false]};
//.... code
};
}];```
yeah, i'd understood that.
It's the scheduled / unscheduled environment I'm still learning
All you need to know is that you can't run uiSleep, while(kinda), waitUntil etc in unscheduled
The advantage of scheduled code is that it runs asynchonously in the background and that you are able to run code with a huge performance impact (nearly) without slowing down the game.
this is the reason you cant use waitUntil etc in unscheduled, it would slowdown the game too much
since its executing and testing for the value so fast
spawn creates a scheduled script, where you can suspend.
Eventhandlers are unscheduled, where you can't suspend
it would slowdown the game too much No that's not the reason
thanks @still forum thats what I wanted to know
Yes I know but thats just the easiest way to explain it
the entire game freezes while unscheduled code executes. Meaning your waitUntil condition can never change. Meaning you freeze the game and it will never unfreeze
mhh well that was well said xd
Do scripted objects allow comments? It keeps throwing an error when I use //Comment
What? Where do you put the scripts? Into object init fields?
Yes
Thank you
@grim coyote you can use waitUntil in unscheduled, the only time it is allowed if condition returns true on the very first evaluation
Does the standard remainsCollector also delete inventory items which were dropped on the ground?
For instance I have killed an AI unit, I add him to remainsCollector, then I take out some items from his inventory.
And drop the items on the ground, then run away.
Does it erase browser history?
I would expect it not to, but who knows!
I know exactly who
Abstract question - is there a way to set a variable on a player and then retrieve it from the player? A la OOP?
Unless I'm misunderstanding you can't use an object as a namespace with setVariable and getVariable
yes you can
objects have namespaces
If you read
you'll see that it takes object
Oh see I'm just reading this wrong, got it
varspace can be any of these types Namespace, Object, Group, Team_Member, Task, Location, Control, Display
I'm struggling centring my miniMap in the screen position I gave the display :
waitUntil {!isNull (findDisplay 46)};
private _ctrlGPS_Map = (findDisplay 46) ctrlCreate ["RscMapControl", 9943];
_ctrlGPS_Map ctrlSetPosition [0.846354 * safezoneW + safezoneX,0.728704 * safezoneH + safezoneY,0.103125 * safezoneW,0.209 * safezoneH];
_ctrlGPS_Map ctrlSetFade 0;
_ctrlGPS_Map ctrlCommit 0;
private _pos = getPos player;
_ctrlGPS_Map ctrlMapAnimAdd [0, 0.05, [(getPos player select 0),(getPos player select 1),0]];
ctrlMapAnimCommit _ctrlGPS_Map;
["myCompassID", "onEachFrame",{
//GPS UPDATE
_ctrlGPS_Map = _this select 0;
//_ctrlGPS_Map ctrlMapAnimAdd [0, 0.05, [(getPos player select 0)+550,(getPos player select 1)-250,(getPos player select 2)]];
_ctrlGPS_Map ctrlMapAnimAdd [0, 0.05, [(getPos player select 0),(getPos player select 1),0]];
ctrlMapAnimCommit _ctrlGPS_Map;
}, [_ctrlGPS_Map]] call BIS_fnc_addStackedEventHandler;```
I most be missing something most have done things in the wrong order or the wrong way
you want the players position on the map, not in the world
so replace getPos by ... ?
but that returns screen coordinates in format [x, y] how do I exploit that ?
isn't it the other way round i want ?
oh nvm. ctrlMapANimAdd seems to take full position
https://community.bistudio.com/wiki/ctrlMapAnimAdd maybe the last note is relevant?
can you say what your actual problem is? besides "I'm struggling"?
so, this display is rectangle in the bottom right of the screen (aprox) in which I have a map displayed. but that map doesn't show the position of the player. it's like it was scrolled up-left somehow
in order to show player position I do _ctrlGPS_Map ctrlMapAnimAdd [0, 0.05, [(getPos player select 0)+550,(getPos player select 1)-250,(getPos player select 2)]];
which isn't the correct way of doing it
Might be related to the last note
ah okay yes might be ...
I could drawRectangle ?
but then I don't know how to use that ... Draws a rectangle on the map. so it's probably not relevant
General Tip: To prevent dupe deu to syncronized execution on different clients, exec the clients codes on the server.
it doesn't work for everybody and I can't figure out why
for me it works fine
but someone with slow ass computer it will not
Is there any recommended reading on file structure/mod architecture? I'm converting my code from a bunch of execVM scripts to precompiled functions and am curious about best practices
Is there an event handler that is called when a vehicle is deleted? For instance when the remains collector deletes a wreck object?
Deleted
is there somewhere I can find the list of IDC for displayCtrl
and the IDD for displays ?
How do you know it's this specific IDC and that specific IDD ?
Ah thanks I'm being blind... I have even clicked on it some time in the past according to my browser history
From the config @quartz coyote
IDC/IDD's are defined in the display/control config classes
can I check em out in the AiO config ?
yes
none
i'm in Splendid Config viewer and can't figure out where to look ...
RscDisplay*
for example
Bottom, Rsc prefix
opening some old code, this doesn't look right for some reason for "_i" from 1 to 6 step 1 do { - anyone getting the same feeling or just me?
Just looked off, haven't used a for in a while, wasn't sure ๐ ty
I've personally never used it but I read the wiki article once
and step 1 is default I think
ah
Is there a way to add the respawn templates via script? I've made a template tool for some friends but they're currently required to add it into the description.ext - instead i'd like the tool to add this for them.
@lavish ocean thx alot ๐
First off, sorry for having so many questions today - many projects atm. I'm trying to find a way to do that for some time now but I just don't get an idea:
I want to have whenever a player joins a mission have a systemchat message saying the name and the role description of the unit the player chose. So the first part would be rather easy to do with onPlayerConnected I'd guess but I just can't figure out how I then get the roledescription of the unit he chose.
I think this could be very easily done via the initplayerserver.sqf or so but I want to have it as script/function so I can use it in a mod.
Does anyone have an idea what I could do?
yeah
@spring stone
Line 149
Basically import the mission config
private _groupsCfg = (format ["getText(_x >> 'dataType') isEqualTo 'Group' && ((toLower(getText(_x >> 'side'))) in %1)",_sides]) configClasses (missionconfigfile >> "MissionSQM" >> "Mission" >> "Entities");
loop through the groups and then all the units in the groups
find the matching unit
And then you can access his attributes
private _role = (getText(_unitCfg >> "Attributes" >> "description"));
the attribute "name" is the variable name of the unit
Okay, gimme a moment to understand all this ^^
Mhhh okay I might missunderstand all that code but I'm trying to figure out right now how I could execute this whenever someone joins a mission.
The reason why I say that is that in private _role = (getText(_unitCfg >> "Attributes" >> "description")); you need to know the unit - here _unitCfg. If I'd use onPlayerConnected I'd not have that information though. (I mean, I'm willing to say that I don't understand how onPlayerConnected and/or the code above works)
Why does dynamic simulation disable simulation of an enemy vehicle driven by an enemy AI when I enter a static machinegun? :/ Or should I just give up the standard dynamic simulation and write my own? :\
Probably because getting in vehicle for some strange reason removes you from scene so engine thinks there is no one to simulate it for
Smells like a bug and warrants a ticket
But wait there's more! If I place a static with zeus it works fine ๐ค
Make a repro
Oh well, what's the chance that they are even going to look at it?
Well without a ticket the chance is definitely close to 0
Yeah it's working very very weird, I don't understand it, I guess I will just not use it for now. Or maybe I need to refine it so that my code only enables dynamic sim. for vehicles that are empty.
As for chances, I guess that if I create a ticket they are somewhere close to chances of this: https://feedback.bistudio.com/T126877
Ok IDK why, this makes no sense. Type object, expected array. _Bullet = _this select 0;
thats literally the entire program.
its the first line in an SQF... and I'm not calling it right
๐ฎ
...no I am calling it right
this execVM "Track.sqf";
I think my armas just having an anurism theres no way I'm erroring out trying to define a variable
well you tell it, variable _bullet is equal to element 0 of _this
Yes
it tells you that variable _this must be an array because select works only with arrays
so... _this must be not array then
select 0 is the first instance in an array
if its not an array its the first instance, which is itself
if it is an array, its the first instance of an array
Type Object, expected Array,String,Config
so...
where do you call it? Vehicle init field? or somewhere else?
first line of an SQF is _Bullet = _this select 0;
this execVM "Track.sqf"; is in an init of a unit
yes
then you do
objectHandle select 0
it tells you, it's an object and it expected array or config
you could just do _ Bullet = _this; then
...that doesn't make a lot of sense to me. I've literally never had to use objecthandle select 0
select is an operator to work with arrays, and you are giving it not an array ๐คท
or you can use params inside your script:
params ["_bullet"];
use params everywhere you need to unpack parameters incoming into a function through a call or spawn or execvm
...Oh. Oh. Its because I did this execVM and not [this] execvm
_this execVM is also valid... if you just unpack it inside your script properly
@tall crescent probably, above SQF basics, also remoteExec / remoteExecCall and its JIP parameters
Also locality things
Thank you
Hi! The grass cutter "Land_ClutterCutter_small_F" is not removing grass, why? The "Land_ClutterCutter_medium_F" one is removing...
But "Land_ClutterCutter_medium_F" is too much big
Anyone can help on making "Land_ClutterCutter_small_F" work?
Land cutter small does work.
It just might not be very visible to you.
Just used it yesterday.
I have a question for someone, I have an interface, a buddy made it for me and I modified it, I'd like to make right clicking execute a script, or a function, in my case, I'd like it to close the current interface and then execute a script to open the previous interface, but the right clicking part is what I'm stuck on.
@devout stag thanks. I ran this code in the console, with the player standing on the grass: createVehicle ["Land_ClutterCutter_small_F",ASLToAGL getPosASL player,[],0,"CAN_COLLIDE"]; and there is absolutely no change in the grass.
Medium cutter works.
I got a similar thing in my mod for cutting grass if you're sniping.
does anyone know if there's some function to create that circular progress bar used for vanilla revive?
@tough abyss Once the display is open, you can use https://community.bistudio.com/wiki/displayAddEventHandler to add a handler for mouse events
The list of events can be found here
never mind, found it: https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
Can someone tell me if VCOM Driving is still an up to date script? I remeber reading about it being abandoned long ago bc Vanilla fixed its driving or something
when I got
params ["_array"];
and I need to add a default value, is
params [["_array", [], [""]];
correct?
nope
the third argument is an array of accepted types, so here you would only accept strings
params [["_array", [], [[]]];``` would be better @spice axle
ah yes of course, arrays inside params is a mess for me every time, thanks a lot
anytime!
Does anyone know what the animations for the landing gear on the back wasp are? Or at least where I can find them so I can force a gear up/down?
planeOne action ["LandGearUp", planeOne];
planeOne action ["LandGear", planeOne];
https://community.bistudio.com/wiki/action
https://community.bistudio.com/wiki/action/Arma_3_Actions_List#LandGear
@fluid wolf
Is there a way to add the respawn templates via script? I've made a template tool for some friends but they're currently required to add it into the description.ext - instead i'd like the tool to add this for them.
respawnTemplatesVirtual[] = {}; - https://community.bistudio.com/wiki/Arma_3_Respawn#Respawn_Templates
yes
The config is read by a BI script, which then creates the thingies
So if it can do it, so can you
BIS_fnc_initRespawn
Or no. Maybe it was BIS_fnc_selectRespawnTemplate ๐ค
Thank you ๐ - I'll look into it. I saw that it runs predefined scripts, but I wasn't sure where to even start ahah
or BIS_fnc_showRespawnMenuPosition ๐ค
So many xD
@spice axle That doesn't work
AI overrides the action
And without an AI you cannot use actions on the object
have you tried disableAI to stop them from performing actions themselves? I think it's "FSM"
I have disableai "ALL" on both pilot and aircraft
CHeck your object argument.
they do not function
Its this disableAI "ALL"
unitName: Object - AI unit
for both the pilot and the plane
Well if you all AI features, it wont do anything at all.
Thats what you think. Put a plane near a runway and it does't care
I did this enablesimulation false; on the pilot and disabled "ALL" for both pilot and plane and it still took off
Might help
` No way to solve this without disabling the simulation of the pilot.
If the plane was moving before the command with throttle setting above 0 it will continue to move in a wonky way.
Setting the fuel to 0 might be the more elegant solution, if you're okay with the canopy opening. `
basically it's setting it's engine and path before you've told it not to do it anymore, by the sounds of things
It doesn't actually matter what you do to the pilot
You got showScriptErrors on yeah?
I do not, what is that?
Tells you errors with commands
oh wait is that the black boxes
Yea I have that on
No this enablesimulation false does not matter on the pilot at all
A plane will continue to function without a simulated pilot
Only on the plane
but if you're not getting expected results, you're execing it wrong
you should be dealing with the object, rather than the pilot.
I'd love to think that but I have no idea how I could possibly be doing it wrong
Yea if you disable sim of the VEHICLE it stops moving
but not the pilot, it doesnt care about the pilot
It's how the engine reads the object/unit
problem is if you disable sim of the vehicle it wont accept any commands
meaning if you want to park and turn off a plane
you can only do one or the other
What is your intended result?
Literally landing a plane and pulling it off the runway
You thought if just recording this?
I did
I'm using a playmove on it
while {Basejetphase == 1} do {Basejet action ["LandGear", Basejet];}; is being used to FORCE landing gear to deploy because the AI will not use it otherwise
playMove is for a single animation
^
Landing a plane is something completely different ๐
Bad use of a while by the way - no delay so you'll lag like hell evemtually
Not playmove sorry yea, the rec and playback
it turns off after 10 seconds, thats not the whole script for it
but anything short of calling that every frame and the AI retracts landing gear and smashes into the runway
And if I have no AI in the seat or kill him, I cant use an action on the plane at all
unitPlay and unitCapture might be smoother results anyway.
but it needs gear to land or it explodes
and the SECOND the unitplay ends, the AI tries to take off again, wont respond to engine shutoff scripts
and if I dont get the engine shutoff the noise just covers the area forever
var = compile preprocessFile "__path to data__.sqf";
BasejetLand1 = compile PreprocessFile "PATHS\BasejetLand.sqf";
Which is what I'm doing
๐ Making sure lad thats all
thats fine
If I can like, force the animations that would be ideal, because then I can just have the already desimulated pilot be dead
you're better of just having scripted AI, rather than letting them have semi-control
if you want the same result every time
They dont have any control, or very minimal
the one split second they have though is messing shit up
Then have the plane empty on startup, disable sim on it.
Have an AI pilot and disable it's AI etc. move him into the pilot seat. from there so there is a pilot on the cockpit.
unfortunately action does not work on vehicles if the pilot isn't dead
you can kill a unit if the simulation is disabled
he wont react arma reads it as a dead object.
Planes already disabled sim on startup, it gets its landing call off a trigger right now
Problem with that is if he's dead, I cant use actions on the jet
btu if he's alive, I cant turn the jet off
and I cant lazarus him as far as I know, so I cant turn him on and off by killing and resurrecting him
Well i've given you how i'd do it, I myself have done something similar with a helicopter landing and stuff and mine worked with little error. Gonna go back to working out this dumb respawn template thing.
Alright
Perhaps someone with more knowledge can help you further ๐
I rarely fuck with AI
How would I grab the attribute name for set3DENAttribute with system-specific modules, for example owner on the Zeus GM module.
I'm right in thinking it would be the attribute name made by the class by default right?
https://i.gyazo.com/281f4fbb0a17ca816a641177ce6d3e32.png
Can I add my own items to this part of the zeus interface? Or change the existing groupings?
getVariable "owner"
I think
Use allVariables
to see what it has you can access
It's a classname
I'm thinking
Looking up the class names now
property = "ModuleCurator_F_Owner"
Oh well found it now ๐
playerA locally executes
player setVariable ["myVar", true];```
Will it return ``true`` (on my server) if my server executes server-side
```SQF
playerA getVariable ["myVar", false]
// or
playerA getVariable "myVar"```
?
Arguments are global
Effect is local
for setVariable
if you use the alt syntax, varspace setVariable [name, value, public] you can use the public parameter to make the effect global.
Public is BOOLEAN
so for you example
but then I can't use player as argument or everyone will get player instead of the PlayerA ?
playerA setVariable ["myVar", true, true];
@quartz coyote no. Player is a command that returns the local unit
setting a variable on player means "set on current played unit"
not "set on every player"
if you wanted all players you could use forEach and allPlayers, right dedmen?
If that was what he's after that is
If that was what he's after that it
If that was what he's after that it
yes
My discord is soo laggy today xD
why can some ammo be spawned with createVehicle such as "Bo_GBU12_LGB" but not others such as "Sh_125mm_HE"?
Anyone know how to get the vehicle Engines RPM
By Script? ๐ค Don't think you can.
๐ฆ
I think there's one for helicopters: https://community.bistudio.com/wiki/enginesRpmRTD
cars
have you tried that with a car?
Very nice idea! ๐
Have you tried sound controllers?
@still forum
After further testing, it seems that it works for me because +550/-250 are working with my screen rez or UI size.
people with different one will see there miniMap shifted.
How could I adapt it to every screen rez or UI size ?
I have no idea. Maybe collect matching values from different screen sizes / aspect ratios and see if you can find a pattern in there
so predefined parameters and depending of the client's ones, the script would select the correct settings ?
could do
the miniMap isn't centred on the player's location @cosmic lichen
tried pixelGrid system?
no, what is that ?
shit reading ...
๐
Or use GUI GRID
nah, I like challenges !
Also in Eden Editor
try findDisplay 313 createDisplay 'RscTestGrids'
This will give you an idea what the different methods for dimensioning and positioning of GUI do.
okay thx
but in the first place, if ctrlMapAnimAdd and ctrlCreate worked correctly, I wouldn't be doing this ......
In your case it would be helpful to have the code and a sceenshots (from you and from those where it's not working)
i'll pm you
Someone have a script for status bar (for in wasteland ?
Made simple gui arty computer to replace legacy artillery computer
Aww no picture
Discord allows you to delete one y'know ^^
looks like something in it is not working.
I got a question about some weird script code used by BI in the Jet DLC showcase.
switch _taskID do {
_this call _taskFunction;
default {
["Task ID '%1' not defined in %2",_taskID,_taskFunction] call bis_fnc_error;
};
};
This is an extract of code from the function: BIS_fnc_missionTasks.
It seems to call missionsTasks.sqf inside the missions folder.
But the structure of the missionTasks.sqf looks like this:
case "BIS_tskEquipment": {...}; //... indicates there is code there which is not important to my question.
case "BIS_tskJet": {};
case "BIS_tskTakeOff": {};
etc.
It seems to be possible to use case from a switch do in different file when the file gets called by a switch. There is nowhere noted on the BIKI though. And the BIKI also says that case can only be used in a switch do. Why does this even work?
that'sโฆ awful
It is? I was planning on using something like this for my missions because it seems to make work a lot easier
It works because the switch condition is stored in a magic/secret local variable
and as you know, local variables carry over to lower scopes
so that's why that works.
so the _this is the magic variable of that scope?
I guess I have not understood how scopes work then. I always thought call makes code execute somewhere else and not just in a lower scope.
Would be cool if this example of BI code would be noted on the BIKI
since it seems kinda useful
awful* ^^
Bury it.
Why is it awful though?
it makes something like
switch (_condition) do {
call {
case "rabbit": { hint "ok"; };
case "pink": { hint "nope"; };
}
default { hint "failed"; };
};```
and it skips the logic to another file, which is not really readable
true
but the thing about scopes and call is really new to me.
If I got a variable, like _a in a higher scope. And I call code, the code will be able to use _a?
Like:
_a = 1;
call {hint str _a};
yes, hence the need for private
@winter rose missing call in your code
nope ๐
I should start to use private then...
take good care of them yes :-]
Will params also make stuff private like private does?
yes
that probably explains why I never had issues
don't use the private command though.
the private keyword is infinite times as fast
ah okay
well, unless you declare your var beforehand but it's not really the top case
e.gsqf private "_myVar"; _myVar = 5; // bad private _myVar = 5; // good
Thanks for the help Dedmen and Lou Montana. Really appreciate it ๐
Is it possible to override the default ammunition settings in a scenario? For example, say I wanted to change the velocity of a particular magazine of 9x19mm ammo to 100m/s instead of whatever the default is.
not really
you can use a fired Eventhandler. and just call setVelocity to set a custom velocity
But you cannot edit the default as that's config
rgr. thanks
How can I identify what different layers exist to select the right one ? or is it just a custom name ? layerName: String - layer name on which the effect is shown. Layer names are CaSe SeNsItIvE
https://community.bistudio.com/wiki/cutRsc
Looks like I just used 1 for my custom HUD. 1 cutRsc ["CQCHUD","PLAIN"];
Not sure how to get a list of what exists. Looks like you can just use 100 to guarantee it'll be 'on top'? Or whatever the max int is.
I guess to more directly answer your question, there exists this command: https://community.bistudio.com/wiki/allCutLayers
yup, thanks !
does the class: String - the class name of the resource. ("Default" will remove the current resource.) need to be in RscTitles ?
ah yes it does
answered my own question
If I get a display using findDisplay,can I view the controls of that display?
Also what does RSC stand for?
Resource I assume (wild guess)
I doubt that
It's in reference to displays
Maybe though
It's Rsc so possibly
You're right actually
Scripting question from uber scripting beginner
private["_weapon","_muzzle"];
_weapon = currentWeapon player;
_muzzle = currentMuzzle player;
if (_weapon != "") then {
[player, _weapon, _muzzle] call ace_safemode_fnc_lockSafety;
};
waitUntil {!isNil "MyVariable"};
[player, _weapon, _muzzle] call ace_safemode_fnc_unlockSafety;
if player change weapon during the waitUntil, are _weapon and _muzzle stored ?
or will it run on updated currentWeapon/currentMuzzle ?
no it doesn't auto update it
purfect
ty ๐
(I'm sure it's not going to store the actual weapon and unsafe it if it's not in player's hand but well)
it actually works and automatically switches back to previous gun to unsafe it
yeeeey
So can someone help me get a player UID before the player character is spawned?
There is an event handlwr for joining the server
hi is there a way to change the side of an empty object ?
like a car
i'd like it changed from Civ to sideUnknown
I tried with createCenter and createGroupbut didn't work
You could put an invisible (and AI dead) sideUnknown guy in the back seat?
i'll try
not working because this idiot is ejecting when the vehicle is too damaged
even with simulation disabled
private _sideCars = createCenter sideUnknown;
private _grpCars = createGroup sideUnknown;
doesn't work
if I try sideLogic they correctly change sides
but sideUnknown they don't
So I have found a script by TacticalGamer on YT that shows how to enable respawn loadouts via respawn module. Looking for a way to duplicate it to OPFOR but noting I know nada, zero and zulch about coding I am at a bit lost.
Question is how to "duplicate" the following to apply to OPFOR as well without the two sides sharing kit.
desc.exe
{
class RifleBasic
{
vehicle = "B_Soldier_F";
};
class SquadLeader
{
vehicle = "B_Soldier_SL_F";
};
class Medic
{
vehicle = "B_Medic_F";
};
class AR
{
vehicle = "B_Soldier_AR_F";
};
class LAT
{
vehicle = "B_Soldier_LAT_F";
};
};```
initServer.sqf
```[west,"RifleBasic"] call bis_fnc_addRespawnInventory;
[west,"SquadLeader"] call bis_fnc_addRespawnInventory;
[west,"Medic"] call bis_fnc_addRespawnInventory;
[west,"AR"] call bis_fnc_addRespawnInventory;
[west,"LAT"] call bis_fnc_addRespawnInventory;```
This goes with a onPlayerKilled invent call command
is there a function or script that tells me the actual round a weapon or vehicle is using; eg "Sh_155mm_AMOS" for "B_MBT_01_arty_F"?
@signal kite https://community.bistudio.com/wiki/Arma_3_Assets not sure if that will help | example http://prntscr.com/nutc4x
@drifting copper I'm already using that, but with mods it would be handy to get it in-game
For modded I usually search in the Config Viewer
@drifting copper in CfgRespawnInventory make new classes for each. And use O_ vehicle entries instead of B_
O for opfor.
And in the initServer.sqf use east instead of west
You need to choose other names for the new classes in CfgRespawnInventory
You can't have duplicate names
So if I understand correctly?
{
class BLUFOR RifleBasic```
classnames cannot have spaces in them
Roger
Thank you, most is working so far. Except for one role ๐
It did not like NAR but accepted HAR. @still forum much appreciated!
Host\Local I get no errors. Though on server "Script loadouts\medicOpfor.sqf not found.
I assume it is related to case "Medic": { player setUnitTrait ["medic",true,false]; _loadoutPlayer = [player]execVM "loadouts\medicOpfor.sqf"; };?
If so how would I fix the error?
well is the script in the folder that it's supposed to be in?
As far is I know it calls to basic arma "medic" role. No idea where to even look. As far as I know blufor "medic" works fine with
{
player setUnitTrait ["medic",true,false];
_loadoutPlayer = [player]execVM "loadouts\medicBlufor.sqf";
};```
It references a script file in your missiin
the error complains about the file not existing
Mind if I DM you all the scripts as it will be too much for on here
Don't have time to look through that stuff
But as I said, you have a medicBlufor script in the loadouts folder, but you don't have a medicOpfor script. So you have to make one.
Probably copy and edit the blufor one
Author of the original script has not set a loadout.cpp so I do not have one either http://prntscr.com/nuvk1l
No idea where your "medicBlufor.sqf" comes from then
But whatever you did with that one, do the same for the opfor one
Is there a way in Arma 3 to set the viewdistance seperatly for each client?
Yeah it is already in Vanilia game
GUI onLoad seems to be not working and Could not find solution... Anybody has any idea about this??
Yo all
I'm doing a
_ctrl ctrlSetStructuredText parseText '<t size='2'>M16A1</t>';
and i'm getting an error <t size='#2'> missing ;
anyone got an idea ?
just look at where your string starts and ends
it starts at the ' and ends at the next '
no that's just me not pasting the full script
no it's not
Do you want me to repeat exactly what I just said now?
still don't see what you mean
should have pasted the full code :
why did you chose to use ' on the outer quotes? People usually use " and I've also seen you use " in the past, why change now?
((findDisplay 9997) displayCtrl 2400) ctrlSetEventHandler ["MouseEnter",
"((findDisplay 9997) displayCtrl 1200) ctrlSetText 'Images\assault\m16a4.paa';
((findDisplay 9997) displayCtrl 1000) ctrlSetStructuredText parseText '<t size='2'>M16A1</t>';
((findDisplay 9997) displayCtrl 1001) ctrlSetStructuredText parseText '<t>Semi-automatic with three round burst fire.<br/>Effective at medium to long range.</t>';"];```
Okey so..
You really expect me to repeat myself for the third time now?
Now I can atleast see why you chose to use '
class BTCS_Vehicle: RscListboxBTCS
{
idc = 1500;
x = 0.0309451 * safezoneW;
y = 0.253 * safezoneH;
w = 0.0825207 * safezoneW;
h = 0.066 * safezoneH;
onLBSelChanged = "player setDamage 0;";
};
``` onLBSelChanged also not working.. whats wrong with listbox
If you start a string with " it ends at the first "
If you start a string with ' it ends at the first ' too
you can repeat or not, i'm just not seeing the point. but if you explain why you are repeating i'll understand i'm sure ๐
I just told you
sorry I write slower than you
'<t size='2'>M16A1</t>' You have two strings.
Here, I'll seperate them for you by inserting a space
'<t size=' 2 '>M16A1</t>'
The game things you are trying to call the script command 2 with two strings as arguments
uh ....
so just adding spacing solves the problem ?
am i crazy or does uiNamespace not work in multiplayer anymore.
crazy
The solution is to have either different quotes (which is why you were trying to use ' quotes inside a " quoted string) or doubling them to "escape" the quotes
https://community.bistudio.com/wiki/isKindOf
Can some one add a comment on this page about how you can get the "KindOf" of a object instead of compare?
You can get the "KindOf" of a object with BIS_fnc_objectType
https://community.bistudio.com/wiki/BIS_fnc_objectType
isKindOf checks if the class of the object inherits some other class
BIS_fnc_objectType doesn't return the class
Still get the type you need to compare.
What are you trying to do?
vehicle player call BIS_fnc_objectType ;// return ["Vehicle","Helicopter"]
vehicle player isKindOf "Helicopter"; //return true
Now you showed me a piece of script and I have still no idea what you are trying to do
I'm quite sure you are asking the wrong questions and assuming things that aren't true
Check what "Kind of" the vehicle is.
๐
how would you know which one might be the one you want
What do you need to know that for?
What are you trying to do
Im looking at a black fish, how do I know what kind he is?
should I check each option with isKindOf or just check with BIS_fnc_objectType? or go trough the config file?
I think you want to know the class of an object
_unitClasses = [(configFile >> "CfgVehicles" >> _unit), true] call BIS_fnc_returnParents;
_unit is your object
That returns all parent classes
(configFile >> "CfgVehicles" >> _unit)
For just the class I think
"should I check each option with isKindOf or just check with BIS_fnc_objectType?"
objectType is probably faster, but I have not looked into what it does
in Dialogs, if display idd is different can control idc be the same from one display to another ?
yes
okay thanks
Is there any good starting good for scripting in Arma 3 ?
well i guess i cant just code stuff in C#?
I thought the engine was c#?
I'm not sure, but the scripting language used for missions is SQF
So we cant run a script in C# even if it was on a mod?
Not sure about with mods
The engine is C++
No mods also don't do C#
You might be mixing Arma up with DayZ who has a C# like language (still no C#)
So could i call scripts using c++ as surely the engine should handle that
No
You can write extensions in C# or C++. But unless you use Intercept you cannot call back into the game and use any of the scripting API
Ahh ok so just best to keep it in swf
sqf*
So i write the script put it in the mission and say execute script .sqf in the mission
Can the script change without needing to reload the game ?
You can reload the mission, or use filePatching and reload the script
Ok perfect ill get onto trying to create what i need to do then i was just wondering where the best place to start is
Given an IDC from a gui can I remove/ edit that element?
@fluid pier check the pinned msg in this channel, if you want to start. It's an overview with all commands (incl. examples)
I have created a new Rsc layer, and when I spawn it, it's behind the curator UI
So I can't interact with it
How can I place it on top
Hello i am a idiot
I am trying to attach a camera to an aircraft turret, Killzone Kid's tutorial ( http://killzonekid.com/arma-scripting-tutorials-uav-r2t-and-pip/ ) provides the details for the Darter's turret however Im not sure exactly what I am looking for if i want to use other vics. Could someone please tell me what files I should be searching through?
@peak plover Clicking buttons etc
Is there a fuction for the AoA (angle of attack) of the F/A 181 black wasp hud? or any way to reverse enginner that?
@tough abyss cutRsc is not suitable for interactive meanings, its suitable for things like HUD.
You can modify existing display via ctrlCreate or addon with curator display class substitution.
Given an IDC from a gui can I remove/ edit that element?
Can hide it with ctrlShow or move away with ctrlSetPosition, can change appearance yes. However if the control is engine driven, it might be not possible to maintain the changes
๐ค isMultiplayerSolo ๐ค
https://community.bistudio.com/wiki/isMultiplayerSolo
@astral dawn Welcome to BIS Consistency โข
AFAIR that concludes any multiplayer hosted mission, including hosting editor.
Yes you can host editor in multiplayer.
yes I know that I can host, I didn't know that isMultiplayerSolo would return true there, might be useful for me
I didn't know that isMultiplayerSolo would return true there
it doesnt
if you wanted to know how much cover an object provides, how would you go about it? Other than sqf _armor = getnumber (configfile >> "Cfgvehicles" >> typeof _obj >> "armor");
The armor entry returns 0 for a lot of map objects that could be used as cover, but I can not think of ways to filter them any further unless _armor > 0 is true
it's mostly defined in the material on the triangle in geometry lod of the model of that object
Can't retrieve via script, besides maybe firing a fake projectile into it and seeing what happens
oh no - my worst expectation ๐ I read about bullet penetration and found no way to read the entries that came up
the fake projectile is a great idea, i'll see what i can do - thanks!
If I'm using ctrlCreate ["RscPicture_test", 1200];
How can I access the class if its nested in another class?
class or control?
they're not the same, but ctrlCreate returns the Control so you can access the control by that value
private _control = _someDisplay ctrlCreate ["SomeCLass", 2143214];
_control ctrlSetPosition [0,0,1,0.04];
Okay I see what you mean
I'm referring to the class
So I have a class RtsControls
With sub classes
How can I use a subclass in the ctrlCreate class
So it has to be in the root of description.ext
yes
That sucks :/
if you want to nest stuff then you have to build the entire dialog in config
and not use the ctrlCreate commands
Suggestion. Open up the arma config and look how similar vanilla stuff is set up.
There are no scripts in there
wait. if you are creating a display, you can just create whole display from config. or are you adding controls to an existing display?
The latter.
The classes are the same
Shall I give some context of what I'm trying to do
Maybe you guys can suggest a better solution than mine
For adding controls to an existing display I have made this thing (because FFS why didn't they make ctrlCreate receive any control class, not only the one from config root)
https://github.com/Sparker95/Project_0/blob/development/Project_0.Altis/UI/fn_createControlsFromConfig.sqf
Base controls must be located in the config root, and the controls in your config must inherit most features from the base classes. The rest of features is set by the script (like text, color, other simple things).
I want to make it so all classes within a certain class, are iteratively added to a display
But when they're within another class,they cant be found
yeah that's what my code was solving... I was adding controls to map display
What's the solution you have in mind?
So I wanted to iterate through all of the classes within the parent class
And then add them to the display
But obviously I cant
But I can just put them in a hpp file and define them in the class and in the base of description.ext
Or I could keep the class names in a separate array
But I cba typing them out twice
Hi,
i'm trying to reduce the number of bullet to break a wheels,
but the wheels don't break even at 1 of damage value anybody know why?
@astral dawn
//description.ext
class RTSControls {
#include "dialogs\curator_extensions.hpp"
}
#include "dialogs\curator_extensions.hpp"
//sqf code
_addNewElements = {
_curatorUI = (findDisplay 312);
_classes = "true" configClasses (missionConfigFile >> "RTSControls");
{
_name = configName _x;
_curatorUI ctrlCreate [_name, -1];
}forEach _classes;
};
That does it perfectly ๐
Can I spawn a building without collisions?
A param [B,C] seems to do the same as A max B min C But is not mentioned on biki
Can I spawn a model without any collisions?
So its literally just rendered and nothing else
No need to repeat your Q =}
check the pinned link and look for simpleObject
(ctrl+F if not known @tough abyss )
@jade abyss But simple objects still have collisions?
Yes
Thats baked in the model.
๐ค idk if attachTo disabled that, can't remember right now
(don't think so)
It disables the collision detection with other objects aswell, when it gets moved around
means: When a house is attached to you, you can run through other houses without collisions.
Different thing with PhysX Object.
iirc, they would still go crazy.
I just want a player to be able to have a preview of where its going to place a building without accidentally killing other units
or destroying other buildings
What if the existing units are local
For everything else -> You need a new model without Geo
(or lets say: I can't think of any other way currently. But i personaly doubt there is.)
private _op1 = _check_comp select 1;
private _op2 = _check_comp select 3;
private _op3 = _check_comp select 5;
private _op4 = _check_comp select 7;
private _op5 = _check_comp select 9;
I thought I could make it simple with forEach but I just stuck. :(
What should I do to make it simple?
maybe params
(first example)
[1,2,3] params ["_one","","_three"];
systemchat str _one; //1
systemchat str _three; //3```
@manic bane
*
Thanks! I will check.
How would I get a certain players UID from a serverside function?
check pinned Msg and look for: getPlayerUID
+allPlayers probably, if you can filter it out who it is.
okay thanks
A param [B,C]seems to do the same asA max B min C
No it doesnโt @unreal leaf
Hi all, could you help me with why this script doesnt work? I am adding it to a vic to give an action that changes the normal flag texture to our groups. this addaction ["Change Flag", {ForceFlagTexture "images\clanFlag.paa"};];
"A param [B,C] seems to do the same as A max B min C But is not mentioned on biki"
it's not on the wiki because that's not at all what it does. @unreal leaf
whats potential usage of skeleton bool returned by getModelInfo?
Trying to find out if a moedl has skeletal animations
Skeletal models are more expensive to render, but I don't know why one would care
for some dynamic class/object handling, but so far i can see no practical purpose
_list_comp ctrlAddEventHandler ["onLBSelChanged", {params[ "_ctrl", "_index" ];
if (_index > 0) then {[] spawn fnc_I_Gorgon_comp;}];
I don't know why this doesn't work. Need help ๐ฆ
what does fnc_I_Gorgon_comp do?
It changes vehicle animation. It is precompiled.
When I put hint on there, it also didn't worked.
Never mind. Adding sleep before that code solved problem. ๐ฆ
do you guys know why player setAnimSpeedCoef 0.75; doesn't work for me? it works just fine with AIs but not players
[thisTrigger, thisList, "foxHoleName", (configFile >> "CfgGroups" >> "West" >> "BIS_US" >> "Armored" >> "US_MGSPlatoon")] spawn VKN_fnc_createFoxholeAttack;
params ["_thisTrigger", "_thisList", "_foxHoleName", "_factionToSpawn"];
_playerPresent = false;
_delay = floor random [30, 45, 60];
_spawnPoint = selectRandom ["VKN_AI_spawnPos_1", "VKN_AI_spawnPos_2", "VKN_AI_spawnPos_3", "VKN_AI_spawnPos_4", "VKN_AI_spawnPos_5", "VKN_AI_spawnPos_6", "VKN_AI_spawnPos_7", "VKN_AI_spawnPos_8"];
{
if ((alive _x) and (side _x == independent)) then {
if (_x in _thisList) then {
_playerPresent = true;
};
};
sleep 0.01;
} forEach allPlayers;
while {_playerPresent} do {
_group = [getMarkerPos _spawnPoint, west, _factionToSpawn] call BIS_fnc_spawnGroup;
_waypoint = _group addWaypoint [getMarkerPos _foxHoleName, 0];
sleep _delay;
};
```I'm not getting anything returned in the logs or any error message, but the group doesn't seem to be spawning. Anyone see a problem at a glance?
try making the first _playerPresent private
also, you could probably replace that forEach loop with something like
private _playerPresent = (count (allPlayers select { ((alive _x) and (side _x == independent)) && (_x in _thisList)})) > 0;
but _playerPresent would not update in the while loop
so putting (count (allPlayers select { ((alive _x) and (side _x == independent)) && (_x in _thisList)})) > 0 directly in the while loop work
Can I reference another class in config?
What do you mean ?
@brave jungle while {_playerPresent} do { that while loop will never exit. as _playerPresent can never become false
True
@manic bane missing }
Can I add an event handler to a building?
_b addEventHandler ["Hit", rts_fnc_buildingDamageHandler];
Doesn't trigger when I shoot the building
not any building
Use "hitpart" instead of "hit"
HitPart doesn't work either
I'm creating the building using createVehicle
And its a barracks building
Which command to use for executing a script locally in a repeatable trigger only on the player that activated that trigger?
remoteExec with that player as second remoteExec parameter argument?
you can pass objects and players into remoteExec
[] remoteExec ["script.sqf", player];
like this?
it will then execute the command only where the player is local
something like [arguments, "yourscript.sqf"] remoteExec ["execVM", thisList # 0];
I don't think sqfs can be put as the 1st remoteExec argument, but someone correct me if I'm wrong
better {[arguments, "yourscript.sqf"] remoteExec ["execVM", _x]} forEach thisList;
"I don't think sqfs can be put as the 1st remoteExec argument" correct
{[arguments, "yourscript.sqf"] remoteExec ["execVM", _x]} forEach thisList;
nah
[arguments, "yourscript.sqf"] remoteExec ["execVM", thisList]
hey guys just wondering, im trying to break 6 vehicles into 2 seperate squads after a trigger is activated. Right now they are not splitting off correctly and im wondering if anyone can point me in the right direction, here is the activation function
true;
Hint "engaged";
vehicle1 joinSilent (group Group2);
vehicle5 joinSilent (group Group2);
ah great thanks! so I can just do [vehicle1, vehicle5] joinSilent?
or do I have to specify each unit of those vehicles?
2nd one
oof, thanks!
or crew veh1, etc
im getting a break for #group Group2
thanks again btw!
actually it worked when I removed group! thanks!
[arguments, "yourscript.sqf"] remoteExec ["execVM", thisList]
nah
if (isServer) then {[arguments, "yourscript.sqf"] remoteExec ["execVM", thisList]}
^ good call, otherwise trigger will fire on every machine, I forgot about that
Just tick the "server only" checkbox?
Yeah, or add if isServer and never wonder "Did I tick server only checkbox or not"
Is the screenshot command supposed to produce bright and blown-out images that don't look like what you see in game?
So I know the attachTo is a thing but how would you go about attaching trailers to vehicles without making the physics weird? I am trying to make a trailer to haul containers as part of my supply missions.
Just a hint: Don't try.
Either it's attachTo/vector mess (coding/performance nightmare) or (and?) it just looks... meh
+there were already some mods in the workshop, that added that clunky attachTo Method, maybe worth a try before you re-invent the wheel.
I have tried the screenshot command with nearly every combination of graphics and display settings I could think of. Even with the asset preview recommended settings I still can't get the screenshots to look normal. I guess the command is simply broken or doesn't work with the 'new' lighting
Hard to believe "screenshot" would be broken. What is it you're trying to get a screenshot of?
Yes, it was like this since screenshot introduction @runic surge
@night frigate Anything. I just need the screenshots to have a specific naming system applied to them automatically, which can be done through scripting
Ah, OK - I should have paid more attention to the channel name... I thought you were saying that just pressing F12 was acting weird.
That's my bad
I'm happy to test your script on my system if you like, though, to see if it does the same thing
I think it's just an issue with the command itself
OK. Yeah, I see M242's comment now
Disabling PPAA and setting Bloom to 0 did make a difference for me. Still brighter, but closer.
would there be any reason why a container (crate) would randomly make items disappear from it? most often weapons in an overfilled crate when player logs out and back in. weapons will be there for others but not the player joining
items are being added with a normal addWeaponCargoGlobal
I would say don't overfill, maybe it has an issue with network sync
kinda part of the mission that you're allowed to overfill when transferring from a vehicle
then don't disconnect :p
Hi, guys! I'm new to the Arma 3 scripting. Could anybody advise me on the detailed Objects structure documentation? For example I want to know everything about the Player, Person or Unit object. Sorry if this is a wrong thread for such questions.
Ask a more detailed question. What is "everything" ?
For example, a Player or Person has a name as in pName = name player. But I don't know what else is there except the name and what are the right keywords to the object's parameters.
Wow, great. Thank you sir.
@still forum is it possible to view the scipt behind a command ? example getPos ?
There are no scripts behind commands
how do they work then ?
They are engine things
shit
i found addOwnedMine & getAllOwnedMines but no command to return the owner of a mine. I get there is no way to achieve that ?
a command like getMineOwner would be great
its the unit you use the command on
yes but if you don't know the unit it's owned by ... ?
and there is no EH for placing mines
you check all units if the mine is in their owned list?
True, apparently there is no command to check who the owner of a specific mine is. Probably just forgotten by the dev who added that
๐ฆ
@quartz coyote you pick unit, and getAllOwnedMines and compare to the mine you want to check who owns it
then you pick another unit and go throuhg his owned mines
and so on
oh...
I have miss interpreted the description of getAllOwnedMines
it could indeed satisfy my issue
other related question :
Is there a way to make a unit that is not demo to disable mines ?
did it trigger at all?
Let me rephrase it:
Have you tried, if the trigger actives at all, when you tested it?
yes
+No, i won't test it. ยฏ_(ใ)_/ยฏ
Then you can't say it doesn't work with put...
Have you tried, if the trigger actives at all, when you tested it?
put EH, to be even more precise
e.g.: PUTting a gun on the ground or so
Yes I tried the put and drop EHs and they do not trigger when I place a mine
ok
gl
thx
@young current so I'm struggling with this. It's completely wrong I know but can understand which way to put it :
_enemyMines = allMines apply {{getAllOwnedMines _x} forEach allUnits};```
๐ค
yeah that's how I feel too
Get all "enemy" units.
Then call "getAllOwnedMines" for all enemy units. And collect all the mines that they own.
Now you have all enemy mines
so step one :
_enemyUnits = allUnits select {side _x isEqualTo EAST};
step two (not so sure about this one)
_enemyMines = {getAllOwnedMines _x} forEach _enemyUnits;
if not lemme correct myself before spitting out the answer
or maybe :
_enemyMines = _enemyUnits apply {getAllOwnedMines _x};
forEach only returns last result, so you only get one array of mines for the last unit
apply returns all.
But now you have an array of arrays of mines. You probably want to get that into a single array
private _enemyMines = [];
{_enemyMines append getAllOwnedMines _x} forEach _enemyUnits;
Thanks @hollow thistle
I'm correct in thinking I can use params to set a variable to a default value even when there are no more arguments being passed right?
i.e 3 arguments are passed
params [
["_one",1,[0]],
["_two",2,[0]],
["_three",3,[0]],
["_adefaultvar",false],
"_aprivatevar"
];
I added a tanoa big house inside a big dome and added AI turrets on the house open areas. The AI turrets shot enemyes outside the dome with no visual contact. If i move the dome a bit, the AI turrets don't shot anymore. A small part of the house ceiling intersects the dome before i move it.
A bug?
I can try to do a repo.
@sullen pulsar yes. But I think on wrong datatype it errors out instead of using the default value, which is stupid :U
well a datatype isn't being defined and nothing is being passed at that point so ๐ค
if it works the way i think it does this thing is neat
Does anyone happen to know if something will break if I completely disable the alternative syntax of createunit? Assuming the mission I'm doing it on doesn't use that syntax
Today is the day Arma 3 modding changed forever
Okay
31st of May 2019, add this to the Arma history books
...next dev branch
Type faster & stop making mysteriรถs, I am the one on phone @tough abyss
Im driving
Then why are you on the phone in first place ๐ ๐
Historic event
Sooooo... What now is the fancy thing? @tough abyss
I honestly don't know how my own stuff works, vas is like such a cluster of junk it makes no sense 
https://community.bistudio.com/wiki/addAction
player addAction
[
"test1",
{
systemChat "test1";
},
[],
1.5,
true,
true,
"HeliDown",
"true",
50,
false,
"",
""
];
player addAction
[
"test2",
{
systemChat "test2";
},
[],
1.5,
true,
true,
"HeliDown",
"true",
50,
false,
"",
""
];
Its displays only the test1 when using shortcuts
The shortcut seems to only work with one at the time, in this case was only the frist one, does some one can put an note in the page? or it is possible to use two shorcuts?
https://community.bistudio.com/wiki/addAction
player addAction
[
"test1",
{
systemChat "test1";
},
[],
1.5,
true,
true,
"HeliDown",
"true",
50,
false,
"",
""
];
player addAction
[
"test2",
{
systemChat "test2";
},
[],
1.5,
true,
true,
"HeliDown",
"true",
50,
false,
"",
""
];
Its displays only the test1 when using shortcuts
The shortcut seems to only work with one at the time, in this case was only the frist one, does some one can put an note in the page? or it is possible to use two shorcuts?
Performance-wise, what's the best way to put an addAction on a unit if it it's 1: an OPFOR unit, and 2: Captive?
I want the action to appear on any OPFOR unit that gets captured, and units spawn dynamically in this mission.
Event handler for when the players use the Take Prisoner action?
So im trying to automate kicking players with too many team kills. Everything is done and we are good to go except, i cant find any script commands to be executed on the server to kick a player or temporally ban them for an amount of time.
both these places say these commands for doing so are disabled.
https://community.bistudio.com/wiki/BattlEye
https://community.bistudio.com/wiki/Multiplayer_Server_Commands
is there something else out there aside from lowering the players rating everytime they join the server?
@sour island if you can find a eventhandler for that then sure, that would be the best
Think I found a solution:
["ace_captiveStatusChanged", {
params ["_unit", "_state"];
if (_state) then {
systemChat format ["%1 was handcuffed.", name _unit];
} else {
systemChat format ["%1 was released.", name _unit];
};
}] call CBA_fnc_addEventHandler;
@exotic tinsel where does it say that kick/ban are disabled?
is there any way of tweaking Stamina without config ?
I don't like mods.
https://community.bistudio.com/wiki/Arma_3_CfgMovesFatigue
@still forum
https://community.bistudio.com/wiki/BattlEye
"NOTE: The #beserver command has been disabled for now, due to the game admin hijacking hack.
You need to use the BE RCon tool to ban players from your server."
why do you need #beserver ?
lol i dont know mate, it just says "You need to use the BE RCon tool to ban players from your server" on an official website so i figure its true.
" on an official website" official website that's written by community members and not updated for years
arh, give me a break mate. just doing research and asking the community to help validate research, its kinda the whole point of these communities.
Well that's why I've just told you that
yeah so you didnt tell me anything though, just that the website might be wrong like all websites. so what did you help me with?
How do I get this to apply to all units, even dynamically spawned ones?
["ace_captiveStatusChanged", {
params ["_unit", "_state"];
if (_state) then {
systemChat format ["%1 was handcuffed.", name _unit];
} else {
systemChat format ["%1 was released.", name _unit];
};
}] call CBA_fnc_addEventHandler;
it is a cba event handler it listens to the event named ace_captiveStatusChanged. Meaning this even will work for any unit in the game surrendering or being handcuffed
the ace_captiveStatusChanged is also global, so you will get the event from any unit
Keep in mind this event fires for both surrendering and being handcuffed. so you probably should check the third parameter called "_state" as well, with that parameter you can figure out if someone surrendered or was handcuffed
@exotic tinsel so you've found out that a command that you don't even need might have been disabled years ago.
Have you tried if it's still disabled? Have you thought about just not using that specific thing that's disabled?
I added this to my InitServer, but no dice
["ace_captiveStatusChanged", {
params ["_unit", "_state"];
if ((side _unit) == "GUER")) then
{
if (_state) then {
systemChat format ["%1 was handcuffed.", name _unit];
_intelpos = getPosATL _unit;
_intelpaper = "Leaflet_05_Old_F" createVehicle _intelpos;
_intelpaper addAction
[
"Intel",
{
[] spawn btc_fnc_info_hideout;
[5] remoteExec ["btc_fnc_show_hint", 0];
deleteVehicle _intelpaper;
},
[],
1.5,
true,
true,
"",
"true", // _target, _this, _originalTarget
5,
false,
"",
""
];
} else {
systemChat format ["%1 was released.", name _unit];
};
};
}] call CBA_fnc_addEventHandler;
(side _unit) == "GUER") That can never be true
side doesn't return a string
Also you said you wanted opfor units
why are you checking for independent now?
Independent is our enemy in this mission
@still forum
i have tried both of these commands on a server running battleye. Be aware that i dont know shit about server configuration.
i do know that battleye is running for the server because of RCON
serverCommand format ["#exec kick %1", name _player];
serverCommand format ["#kick %1", name _player];
```sqf
these commands are executed server side and not client side. Let me know if there is any more information i can provide to help solve the issue.
where is the password?
serverCommand takes password as arg
also afaik neither kick nor ban need battleye
ok im getting into it. thx
Fixed the scope of the intel paper, but it's still not spawning and basically nothing happens when I Take Prisoner on a GUER
["ace_captiveStatusChanged", {
params ["_unit", "_state"];
if ((side _unit) == GUER)) then
{
if (_state) then {
systemChat format ["%1 was handcuffed.", name _unit];
_intelpos = getPosATL _unit;
intelpaper = "Leaflet_05_Old_F" createVehicle _intelpos;
intelpaper addAction
[
"Intel",
{
[] remoteExec ["spawn btc_fnc_info_hideout", 0];
[5] remoteExec ["btc_fnc_show_hint", 0];
deleteVehicle intelpaper;
},
[],
1.5,
true,
true,
"",
"true", // _target, _this, _originalTarget
5,
false,
"",
""
];
} else {
systemChat format ["%1 was released.", name _unit];
};
};
}] call CBA_fnc_addEventHandler;
i'm trying to create a "juggernaut" perk.
I've done this. Any suggestions to do better ?
juggernautEH = player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (getDammage _unit > 0.9) then
{
player setDamage 0.5;
player removeEventHandler ["HandleDamage",juggernautEH];
};
}];```
(side _unit) == GUER that can never be true. GUER doesn't exist
What is independent called then? Because when I monitor a green unit's SIDE, it says GUER
I'm looking at the in-game variable monitor and it says the guy's side is GUER
I'll try Independent
Read the wiki page that was linked
@quartz coyote you using ace medical as well?
@digital jacinth vade retro satanas
What ever that saysd
jokes. No, i'm not. and don't want to
aight. Otherweise this would not work.
Keep in mind handledmage EH fires for each body part even if it is not hit at all
this is also BEFORE any damage is applied
so getDammage _unit will return previous overal damage and not current
for current damage use the _damageparameter
yeah thats why i'm using getDammage and not exploiting the given _damage
sorry, unclear
let me explain
you can just return the damage value you want the unit for have aftwewards. so you can change the then clause with an exitWith and jsut return 0.5 flat
juggernautEH = player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (getDammage _unit > 0.9) exitWith
{
player removeEventHandler ["HandleDamage",juggernautEH];
0.5
};
nil
}];
basically, i'm using the EH as the closest event before the player's death. Using _damage would have meant dealing with a one time event damage. I wanted the general health of the player
@quartz coyote the word "Independent" doesn't even appear on that page, wth?
_damage will be the "new" damage of the body part
@sour island I agree it's tricky.
that will be returned by getdammage after it was applied
it is not the "added damage ontop of the current" it literally is the new damage value
I understand what _damage is. that's why i'm not using it. I want to extend the players life.
So what was I supposed to get out of that page other than the side is supposedly called GUER?
you have to use the _damagevalue otherwise you do not know if the unit will die with this damage or not. right now you are just asking the current damage before the new damage is getting applied to. Meaning you are just checking a value that is most def below 0.9 and with next tick the unit is above 0.9 or at 1.
There we go
@digital jacinth right I get your point.
i'll re-write that and submit again
@digital jacinth in your script, what does the 0.5 on it's own do ?
handledamage is an EH that can interpret the return value of a script. meaning it will apply the value thatis being returned.
that is the reason why
player addEventHandler ["HandleDamage", {0}];
makes you unkillable
it returns 0 for everything
meaning your damage will always be 0 as this EH tells the game
again i need to stress that this EH will fire for EVERY hit point! So if you remove the EH early you might end up killing the unit as the next run of the EH might apply the necessary damage to kill the unit it
i do recommend reading through this.
https://forums.bohemia.net/forums/topic/205515-handledamage-event-handler-explained/
@sour island independent == resistance == "GUER"
"should have linked this page sorry mybad" no. The side page says that too. In the big yellow box
I know from experience how hard it can be to understand the wiki when you're a beginner.
@digital jacinth i'm stalling. i'll test your and go to bed. i'll try tomorrow
that is fine.
Is GetInMan event handle persistent or is does not keep with the player afther he dies or uses team swich?
I'm not even getting any results with this on initServer
["ace_captiveStatusChanged", {
params ["_unit", "_state"];
if (_state) then {
systemChat format ["%1 was handcuffed.", name _unit];
} else {
systemChat format ["%1 was released.", name _unit];
};
}] call CBA_fnc_addEventHandler;
you sure you are setting people to captive AFTER this is applied?
I'm using the ACE Take Prisoners thing with the cable ties
@digital jacinth Not a great success. what would be ideal would be to have "what ever damage is taken, if over 0.9 then add 50% of life" ... but it seams hard to achieve with the way the EH works and the amount of hitpoints...
@quartz coyote another possibility is to just add threshold how much damage they can take, as in, you reduce the taken damage that is getting applied.
@sour island are you testing locally on your machine or a dedicated server?
seems interesting. how would I do that ?
@sour island weird that EH should fire every time someone surrenders or gets cuffed. same if they stop surrendering or get freed.
You're telling me
@quartz coyote
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
private _currentDamage = _unit getHit _selection;
if (_selection == "") then {
_currentDamage = damage _unit;
};
private _addDamage = (_damage - _currentDamage) * GVAR(damageMultiplier);
_currentDamage + _addDamage
@sour island try to put thatin initPlayerLocal.sqf instead. you want players to see that message, right?
The full script I'm trying to put together is above a few posts, this little one was just for testing purposes
Just to see if ["ace_captiveStatusChanged", { would actually trigger anything really
any coughing or sniffle script out there?
most likely yes
I've looked, couldn't find anything. I was hoping someone would know one.
["diw_cough",{
if !(hasInterface) exitWith {};
params ["_unit", "_sound"];
_unit say3D _sound;
}] call CBA_fnc_addEventHandler;
misc_fnc_cough = {
private _plr = ace_player;
if (alive _plr && (isNull objectParent _plr)) then {
["diw_cough",[_plr, format ["cough%1", (floor random 11) + 1]]] call CBA_fnc_globalEvent;
};
[misc_fnc_cough, nil, 45 + (random 255)] call CBA_fnc_waitAndExecute;
};
// coughing
[misc_fnc_cough, nil, 45 + (random 255)] call CBA_fnc_waitAndExecute;
if you do not mind cba and ace dependencies, it basically is just a loop really.
There are a handful of "units spout random bullshit" mods you could look at
you need to get your own sounds tho
I'm alright with CBA but I was hoping to avoid ace
i just quickly copy pasted this form one of my missions
you can replace ace_player with call cba_fnc_currentUnit
ok, thank you
normally you can skip the addition of the eventhandler, but this is written so it also works on BE enabled servers
ok
Does anyone know if/how I can make units walk on a predetermined path
Set em to Careless?
Well this what Iโm trying to do
I have a cutscene with the player and an AI walking with Hubspectator_walk
But I want the AI to turn left and walk that way
I tried using the turn animation but it didnโt work
setPos?
Well that would just teleport him wouldnโt it