#arma3_scripting
1 messages ยท Page 268 of 1
to make sure the player is in-game and not loading in mods or something
this script shouldn't run until then
okay haha
the if-statement, do I need to put extra brackets for the !_auth_result && (player in _reserved_units) and (player in _reserved_units_admin)&& !(_uid_admin in _reserved_uids_admin)? due to the OR
(!_auth_result && (player in _reserved_units)) or ((player in _reserved_units_admin)&& !(_uid_admin in _reserved_uids_admin)) Like I did here
hqSideChat also needs a _player
AND is higher in order of operations than OR. At least in most other programming languages
but, more parens can't hurt
alright
for the servercommand, if it requires a password
"Password" serverCommand format ["#kick %1",name _player]; or Password serverCommand format ["#kick %1",name _player];
quotes
copy that
ugh, this means that your server password will be in the mission file ๐คฆ
It would seem that serverCommand should run on the server without need for the password.
But all the docs seem to indicate that the server still needs it
well I know infistar needs it to kick people...
but it's working local for admins I believe
does playMove work on arma 3?
how could one make a message appear in the arma 3 server window?
for some reason the dancing animations are not working
p1 switchMove"ActsPercMstpSnonWnonDnon_DancingDuoIvan";
rather than putting your server password in the mission file, couldn't you just load it from a file which is only on the server?
@tough abyss have you replaced p1 with player?
@paper rain unfortunately doesn't work. Spawning in without Authentication assigned
I tried both on a unit named p1 and on my self
We're not using Authenticated anymore?
Hmmm @tough abyss I cannot find that animation in the animations browser
iirc that's a arma 2 animation?
lol right in was in the description ><
yep
pft silly me
params ["_player", "_didJIP"];
auth_check = {
_infoArray = squadParams _player;
_infoSquad = _infoArray select 0;
_squad = _infoSquad select 1;
_infoName = _infoArray select 1;
_name = _infoName select 1;
_email = _infoSquad select 2;
//--------------------- Reserved Slots
private _authenticated = false;
if (_email == "XXXXXXXX") then {
_authenticated = true;
};
_authenticated
};
private ["_reserved_units_admin", "_reserved_uids_admin", "_uid_admin"];
private _auth_result = [] call auth_check;
_uid_admin = getPlayerUID _player;
_reserved_uids_admin = ["XXXXXXXX"/* TheNightstalk3r */];
// Variable Name of the Player Character to be restricted. //
_reserved_units = [s22,s40,s44,s42,s41,s46,s43,s45,s47,s32,s34,s38,s39,s35,s37,s36,s33,s3,s4,s2,s5,s6];
_reserved_units_admin = [s1];
if ((!_auth_result && (player in _reserved_units)) or ((player in _reserved_units_admin)&& !(_uid_admin in _reserved_uids_admin))) then {
hqSideChat = format ["Player '%1' tried using a locked slot! He will be kicked off this server.", name _player];
[hqSideChat] remoteExec ["AW_fnc_globalSideChat",0,false];
serverCommand format ["#kick %1",name _player];
} else {
if(_auth_result) then {
_GlobalHint = format["<t align='center' size='2.2' color='#FF0000'>%1<br/></t><t size='1.4' color='#33CCFF'>%2</t><br/>has joined the server. To get involved, visit TS.JSFAR.COM</t><br/>",_squad,_name];
[_GlobalHint] remoteExec ["AW_fnc_globalHint",0,false];
};
};```
@paper rain
@tough abyss Personally, I'd recommend Acts_EpicSplit
oh woops
@tough abyss couldn't you just _globalMessage remoteExecCall ["hint", 0];
what do you mean?
What is your globalHint doing? just litreally what it says?
yea
you should just be able to remoteExec the hint command
but I doubt that keeps the script from running
named in the editor, i assume
does it global-side chat?
can I make an authenticated that is local too?
there's no error
there's lack of kick ๐
serverCommand format ["#kick %1",name _player];
"password" serverCommand format ["#kick %1",name _player];
ius there anything in the RPT?
nah I didn't get any notification from another script cause that's based on a global Authenticated xD
oh
lemme check that first
that's why it was global
it's fine. Just added the same check in local
try adding the serverCommandPassword before serverCommand
well, after the auth_check = {} close-bracket, _authenticated will be gone, which is why we're returning it and storing it seperately
that'll work?
haven't tried it.
looks cleaner than my version
๐
but it seems servercommand does need the password ๐ฆ
cause I get the sideChat that I am in a forbidden slot but it doesn't kick me
You also might want to put a if (_infoArray isEqualTo []) exitWith { false }; in your auth_check so it does not get zero devisor.
with password I was just kicked
๐
but that means that the password in available in the mission file itself...
create a server-side PBO
how?
loadFile or something, can't remember the name
for files, images etc, the game looks first in your mission directory, then elsewhere for the file
addons folder and main game folder are checked i think
loadFile is preprocesFileLineNumbers
well, close
[] call compileFinal preprocessFileLineNumbers "some\random\code.sqf";
but that's still in the missionfile itself isn't it?
http://hastebin.com/asepumikoq.bash shouldn't the 'XXXXXX' be "XXXXXX" for the email check?
"SM_Server\random\code.sqf"; SM_Server is a server-side pbo with the prefix SM_Server.
compileFinal expects a string, and putting a "" in a string will break up the string the only way to do that is to double quote something you want to put in that string, or use ' '
""xxxx""
' excape taht rule
I tried to get the dancing animation from the mod but it doesn't.
All I get is the weapon pulling out animation. Other animations like "HubBriefing_think" works fine.
' bla ' still counts as a string
" or use ' ' "
okay, I'll not change it then
using 'xxx' does not break up the string using ""
yes use ' to make a string in a string
"xxx" does not break up a string using ' '
if you use " " as string marking and inside the marking you use the " mark again it will break the string so you have to you ' inside it
or the opposite use ' and inside it use "
so I have now a folder @160th/addons/SM_160th.pbo -> SM_160th/Prefix.txt, $Prefix$ and commandpass.sqf
that about right?
SM_ is my prefix for StokesMagee ๐
not the sqf?
of course that is a must ๐
copy
-servermod=@160th
now how do I call the _commandpass = "xxxx"; from the commandpass.sqf?
"xxx" serverCommand format ["#kick %1",name _player];
I don't fully understand..
i'm still confused on how to do a code block like that on discord, teach meh.
"serverCommandPassword here" serverCommand format ["#kick %1",name _player];
and on the end xD
lol
yay!
but how do I extract the _commandpass from the mod?
the serverCommandPassword is defined in the server.cfg
yeah I know ๐
take that password and put it "here" serverCommand format ["#kick %1",name _player];
but for security reasons it's not in the ArmA 3 installation
best way ist through macros
yeah but I don't want it INSIDE the mission pbo
as everyone that opens it knows the servercommandpassword
have it, called commandpass.sqf
alright
then inside it's only _commandpass = "serverpassword";
pack the pbo, enable it as a server-mod and in initPlayerServer do _this call compile preprocessfilelinenumbers "160th\commandpass.sqf";
okay then _commandpass serverCommand format ["#kick %1",name _player];?
yes
unit leader and mission developer takes dedication ๐
heh
??
I got the animations working for AI with adding disableAI "ANIM" to the init of the unit but I can't get it working for players
is there something similar for players?
@runic spoke ```2:38:55 Error in expression <
_email = _infoSquad select 2;
//--------------------- Reserved Slots
2:38:55 Error position: <//--------------------- Reserved Slots
2:38:55 Error Invalid number in expression
2:38:55 Error in expression <
_email = _infoSquad select 2;
//--------------------- Reserved Slots
2:38:55 Error position: <//--------------------- Reserved Slots
2:38:55 Error Invalid number in expression
2:38:55 Error in expression <PlayerUID _player;
_reserved_units = [s22,s40,s44,s42,s41,s46,s43,s45,s47,s32,>
2:38:55 Error position: <s22,s40,s44,s42,s41,s46,s43,s45,s47,s32,>
2:38:55 Error Undefined variable in expression: s22
2:38:55 File mpmissions__cur_mp.Altis\initPlayerServer.sqf, line 29```
remove the reserved slot comment.
and your global variable s22 is not defined.
i would imagine it's the same for all the others, and my question is, why are you doing this? why not just put a password on the server.. lol
because I have two fireteams called Raptor and Sandstorm that are reserved for the members of the fireteam in the 160th
for the rest it's public
s22 is undefined because there is no player in it
s22 = objNull;
initilize it like that ๐
and then it will get defined when a player get's there
well I get the error often but it never stopped a script from running
no errors are better than errors ๐
start diag_logging stuff.
diag_log "i'm here";
diag_log "i'm this far";
or you can diag_log varibles
add some debugg ๐
i'm going to sleep ttyl
params [["_player",objNull],"_reserved_units_admin", "_reserved_uids_admin", "_uid_admin", "_auth_result"];
auth_check = compileFinal
"
_infoArray = squadParams _this;
if (_infoArray isEqualTo []) exitWith { false };
_infoSquad = _infoArray select 0;
_squad = _infoSquad select 1;
_infoName = _infoArray select 1;
_name = _infoName select 1;
_email = _infoSquad select 2;
private _authenticated = false;
if (_email isEqualTo 'XXXXXXXXXX') then
{
_authenticated = true;
};
_authenticated
";
_auth_result = _player call auth_check;
_uid_admin = getPlayerUID _player;
// Variable Name of the Player Character to be restricted. //
_reserved_units = [s22,s40,s44,s42,s41,s46,s43,s45,s47,s32,s34,s38,s39,s35,s37,s36,s33,s3,s4,s2,s5,s6];
_reserved_units_admin = [s1];
if (!_auth_result && (player in _reserved_units)) then
{
hqSideChat = format ["Player '%1' tried using a locked slot! He will be kicked off this server.", name _player];
[hqSideChat] remoteExec ["AW_fnc_globalSideChat", 0, false];
"Caelum" serverCommand format ["#kick %1",name _player];
}
else
{
if(_auth_result) then
{
_GlobalHint = format["<t align='center' size='2.2' color='#FF0000'>%1<br/></t><t size='1.4' color='#33CCFF'>%2</t><br/>has joined the server. To get involved, visit TS.JSFAR.COM</t><br/>",_squad,_name];
[_GlobalHint] remoteExec ["AW_fnc_globalHint", 0, false];
};
};``` Doing something wrong?
goodnight!
{ ```
no syntax errors that the Intell J lexer can detect
you have player, it should be _player ๐
... I feel so stupid right now
last test, then I'm gonna call it a day
well.. more like 2 hours of sleep
good luck
where is your coffe
right here next to me now
03:19 now
one working version now with password inside the script
thank God finally... doing the servermod option tomorrow. Thanks guys @noble juniper and @runic spoke !!
and of course @paper rain ๐
The script is currently in the mission, although I could of course add it to the @160th mod
because you obviously don't want the password in plaintext somewhere in your mission.
Moving essential scripts to a serverside mod
im just repeting this, that you don't forget that
It's my next step, no worries
Gonna sleep for two and a half hours now :p
It really should save the admins on the server time to sort these people out
I got the animations working for AI with adding disableAI "ANIM" to the init of the unit but I can't get it working for players
is there something similar for players?
hey any ideas how i can pushback a varialb for all clients and JIP ? i tried it with remoteExec and target -2 but if i rejoin the variable was any :/
-2 is server only -1 is all but server.
oh... okay try it
but my command is right or is there an error ?
[name player, position player] remoteExec ["pushback", -1];
what are you even using pushback for?
i want to pushback the dispatches for the police (roleplay)
dispatches = [];
dispatches pushback [name player, position player];
I'm till trying to rap my head around what you're going to use that for lol
i want a dialog where all dispatches are listed and i need to fill it with the global var dispatches
i tried publicvariable but thats not working right for me
on the server just publicVariable "dispatches"; and clients can access the variable dispatches.
you're able to do it on clients, but it's not very sercuirty friendly.
you can also do missionNamespace setVariable ["dispatches", dispatches, true]; and to get it just do, _dispatches = missionNamespace getVariable ["dispatches", []];
okay try it
@runic spoke Now it works but if i rejoin the variable is []; because i defined it in the init of the server so it will reset it every time i rejoin. any ideas where i can define it in the server ?
publicVariables, and missionNamespace variables shoud be persistant, if the mission is persistant.
so the server loads just one time the server mod ? because i think he is loading the server mod every time i join the server. and yes the mission is persistent
in my serverside addon i have
dispatches = [];
publicVariable "dispatches";
then it will be []; until you pushback new data and publicVariable it.
thats in my server init so the server can fill it
@runic spoke Would it be possible to move files like init.sqf, initplayerlocal.sqf, initplayerserver.sqf and initserver.sqf to @160th mod?
I think Domination has something similar
Where the files required to run the mission are contained in a serverside mod?
does _auth_result = _player call auth_check; work if auth_check is in the script contained by the mod?
ah seems I can't put the servercommandpassword in a mod and then compile the lines. The servercommand simply will not do anything whatsoever
I use in the pbo script _serverCommand = "Password"; and in playerinitserver _serverCommand serverCommand format ["#kick %1",name _player];. Does nothing whatsoever
@runic spoke
-2 is server only -1 is all but server.
I think you're thinking ofCBA_fnc_globalExecutehttps://github.com/CBATeam/CBA_A3/blob/master/addons/network/fnc_globalExecute.sqf#L10
ForremoeExec(Call), the numbers are different. https://community.bistudio.com/wiki/remoteExec
The whole problem described above was solved by making _serverCommand -> serverCommand
Situation: one client create a simple object in [0,0,0] and then move it to another position. It's expected to the simple object only move on the client it was created because it have simulation off, but it move on all clients. Not obstant, if i continue moving it with setPos, it will move only on the client that created it.
@little eagle UI EH worked perfectly. I will also use then to cancel open/close doors on protected houses. And this will work in ANY map!
My actual implementation of protected doors only works on vanilla maps.
yeah. the A2 ports don't support that door lock variable method
@little eagle don't you know about my above question about simple objects? ๐
(sorry for my english)
Seens the first few setPos on simple objects are transmited though the network but subsequents setPos dont.
@little eagle i don't use CBA for anything, so wouldn't know. and i was thinking of allowedTargets = ;;
i guess it is not beautiful, but: I have a unit in the editor, that has a name that is combined of the the word "bla" and a UID. in a script i am finding a UID and need to check whether this is the correct unit. so could i combine that UID and the word "bla" in a script (which would be a string) and check whether its the required unit by call compile (format ["bla%1", _uid]) == _unit
i think in some other script i generate a bit of code and thereby also name a variable in a similar way
yeah here i did that something like that.
_string = format ["%1markers = _arrays;",_uniquename];
_code = compile _string;
call _code; ```
if (_uid in str(_unit))
^^
of course that might also be a way :D
oh wait in doesnt support strings in arma
no but there i also have something for
use find ๐
it returns a number though
if ((str _unit) find _uid >= 0 (fixed)
exactly find
yea its an old script ^^
if ((_uid find (str _unit)) >= 0)
just wanted to get this dobe quickly but find is good. no idea why i didnt look up in the string operators
i managed to switch _uid and str(_unit), watch out for that too
The arma update has broken so much..... player spawned in-game. If you die, onPlayerKilled does not fire. Click respawn, you get booted for no UID. You re-join and select a spawn, you get stuck in debug and server side logs that there is no PUID. onHandleDisconnect doesn't fire at all. was something changed that i didn't know about? lol
never ever use call compile in arma
O.K.
@runic spoke they did touch that area: "Fixed: The "onPlayerKilled.sqf" and the "Killed" Event Handlers were not fired when players would bleed out in Revive"
@halcyon crypt and handleDisconnect is completly broken. ๐
all those EHs seem to work fine here
@little eagle why "O.K." about "never ever use call compile in arma"?
unless you are very sure about what you are doing
You shouldn't use it for that example
But it's used thousands of times in ACE. Every function has to be precompiled
Just ask yourself: Is there a way to manipulate that String from the outside to get malicious code executed
if the answer is no, then its fine
if you use it with profile names i.e. a user could name himself "execVM 'test.sqf'; bla" or something and bam you are done
@vague hull i use "call compile preProcessFileLineNumbers '[file path]';" but i don't use "_maFunc = compile preProcessFileLineNumbers '[file path]';"
Edited 10 times! Ouch ma brain!
as long as the filepath is static this is safe to the point where you can secure it
execVM 'test.sqf'
this is my new nickname
apparently I need a new profile anyway after this update
player names are a bitch anyway with ui. you have to sanitize "<>" and all other html tags if you want to convert it to structured text for something
Why can i use setPos in a simple object and it change position on all clients?
there is no point in having special characters in your name
simpleobject still broadcast positionchanges afaik
some people use <> for clan tags
why would you even want to change the position of a global object locally
we have a function in ACE to sanitize those names
clan tags == units
Not everyone uses that thing
its all covered
Also it was made before that was made
if they done want to use that, they may as well dont need to play on your server
its not 2008 COD MW2 anymore
they may as well dont need to play on your server
I think you're misunderstanding. It's not a server. It's a mod on many servers
@vague hull simple objects have simulation off, but you can set pos on it, with simulation on, for some time after it creation. This is causing problem.
yeah, but not allowing special chars can be done by your serversettings
i.e. battleye, rcon, onplayerconnected or whatnot
that is no option for me
so setpos activates the simulation/uses it
it active the simulation only if you use it imediatly after the creation
well you always have the option of not using the name command and instead just creating a name variable which fits your needs on player object creation
does that apply for setPosASL too?
Samatra ones told me that setPos does alot of manipulating, maybe that causes it
try it with setPosASL maybe that helps
you could also try spawning a sleep of a second and setPos again after that sleep
Anyone that knows shit about sqf?
noone
lmao
SQF , who?
not even BI
Great banter
what do you want to know
Tweaked: The InventoryOpened Event Handler now provides more Intel on what containers were opened
Finally, after two years!
Yiiis, now I can finish my inventory actions code
by container they mean rucksack/uniform/vest?
If you get an error, you should fix it
It returns the ground container and the secondary container now
I thought it always did that and what is a secondary container?
It was returning only single container since introduction of the command
if you select the inventory of a box a groundcontainer is provided too
which is the ground tab so to speak
if you however select a weaponholder it could happen that a nearby box is selected as the Crate tab
My only problem was that the player was reported sometimes and not the uniform/vest/backpack
thats the single big issue with it
so this issue persists?
I wonder what it reports if you take attachments from weapons on the ground
well you still take something
yeah you take it from the initial weaponholder
It only returns what's opened when you open the inventory. AFAIK, whatever you open from inside the inventory (eg: backpack on ground) isn't reported. Maybe by "Take"?
the only thing you can select is the top most parent
Can anyone help me out?
I am getting an error saying: The server-side extension extdb was not loaded into the engine
Altis life ?
well
0815
Look for the same problem related to Altis life or Exile
shit ton of stuff out there.
1.66 change:
// fn_selectRespawnTemplate.sqf
- if (_isDeath && alive player) then {
+ if (_isDeath && {alive player} && {!unitIsUAV cameraOn}) then {
behind that if is:
if !(_respawnOnStart > 0) then {
_isDeath = false;
};
later in the function:
_scriptName = if (_isDeath) then {"onPlayerKilled"} else {"onPlayerRespawn"};
I think this broke onPlayerKilled.sqf
can't tell / confirm, but thx for showing me that i need to put a hole server into git.
Exile tweeted about this problem and this is the only diff in the game side files
dunno why, but maybe they have a spectator script that is considered a UAV by the new command
or the new command is b0rked
Why would anyone want to use these scripts anyway?
@little eagle we found a other problem in the direction with select player and the respawn system
yeah. I might know why this is
the respawn thing depends on a respawn event handler that is added to the player
it worked befor this update today
ok, it's not what I was thinking of
but check out this shitcode:
//for reseting all PP when player respawned in MP
BIS_respawned = false;
if (isNil {player getVariable "BIS_fnc_feedback_respawnedHandler"}) then {
player setVariable ["BIS_fnc_feedback_respawnedHandler", true];
player addEventHandler ["respawn", "BIS_respawned = true"];
};
//player addEventHandler ["respawn", "debugLog 'FSMPP-EventHandlerTriggered' "]; //TEST if event handler is destroyed when player dies
//for reseting all PP when Team switch is done (player switched to another unit)
BIS_teamSwitched = false;
onTeamSwitch "BIS_teamSwitched = true";
BIS_teamSwitched = false; //to avoid team switch that occurs when player is created
fn_feedbackInit.sqf
this doesn't work either with team switch
/ selectPlayer
can't stack those onTeamSwitch. also race conditions due to the loop running scheduled
maybe it's related. dunno what else they use BIS_respawned for. variable name sounds pretty generic and could cover your problem too
Right now I'm seeing bodies stick around and still alive, even when a player DCs.
time to @..... a BI Minion or Dwarden
I'm basically seeing disabledAI not work.
How would i go about doing a initEventHandler on a Agent, that executes globaly when it spawns without having to do a network message? because the
{
class Ryanzombies
{
init = "if (hasInterface) then {(_this select 0) call SM_SetZombieVariables };";
};
}; ``` only fires on the controller that spawnd it (in my case the server). and i want it to fire on all clinets.
Anyone else not seeing HandleDisconnect fired correctly on the server?
@kindred kayak it's broke.
How broke? ๐
Ah, so that's why I have AI bodies littering my lobby.
Didn't see mention of HandleDisconnect in that one, but assume it's related.
(the tracker issue of onPlayerKilled)
@noble juniper No, we don't @ D or minions, we file a ticket on the Feedback Tracker.
well it might not be timemultiplier but I sound like im sprinting everywhere
im running mods so better unload them first
Having some trouble with setting a variable to false
yep seems to be enhanced movement ignore me
Calling it via [var1,var2] execVM "Script.sqf";
Where script.sqf is
_locvar1 = _this select 0;
_locvar2 = _this select 1;
_locvar1 = true;
_locvar2 = false;
@lavish ocean much appreciation. Loving the new scripting commmands
diag_codePerformance!
Where the intention is to make var1 true and var2 false
My christmas is complete ๐
Any help anyone? I think I'm missing something obvious
and no, I can't just use var1,var2 in the script because there's like 300 different vars it needs to be called on
Are they sequential variables?
numbered from 0 to some value?
I'd advise against this but you could use a for-loop and compiled string values
No strings like v_i_Town1
That's not the problem
They're being called to switch a capture point, and I'm using the same script to handle every point
of which there is like 200
sorry for the confusion
I need the script to be able to fetch the global variable inputted and set it to true/false
Got some code I can look at to better understand this?
Sure
//This is to be activated when BLUFOR captures an INDUSTRIAL area
//
//Example: _handle = ["l_i_VyborDepot",2,"Vybor Depot",cB_i_VyborDepot,cO_i_VyborDepot] execVM "b_cap_industry.sqf";
_mkr = _this select 0;
_avalue = _this select 1;
_aname = _this select 2;
_truecon = _this select 3;
_falsecon = _this select 4;
//Reward BLUFOR and change marker status
_mkr setMarkerColor "ColorBLUFOR";
_reward = (_avalue * 100);
vblue_i = vblue_i + _avalue;
vblue_money = vblue_money + _reward;
//Message for BLUFOR (Executed only on West clients)
strb_1 = "<t font='Zeppelin33'>";
strb_2 = _aname;
strb_3 = "</t>";
strb_4 = " has been captured!";
strb_5 = "<br />";
strb_6 = "<t color='#33FF33'>";
strb_7 = str _reward;
strb_8 = "</t>";
strb_9 = " has been added to the treasury";
_handle = {hint parseText (strb_1 + strb_2 + strb_3 + strb_4 + strb_5 + strb_6 + strb_7 + strb_8 + strb_9);} remoteExec ["bis_fnc_call", west];
//Message for OPFOR (Executed only on East clients)
stro_1 = "<t font='Zeppelin33'>";
stro_2 = _aname;
stro_3 = "</t>";
stro_4 = " has been lost!";
_handle = {hint parseText (stro_1 + stro_2 + stro_3 + stro_4);} remoteExec ["bis_fnc_call", east];
//Exiting script and enabling OPFOR capture trigger
_this select 3 = true;
_this select 4 = false;
I tried _truecon = true; _falsecon = false; previously
Okay so you are clearly making somekind of hinting data messager.
Thats a lot of variables...
Couldn't you do that a better way?
This
strb_1 = "<t font='Zeppelin33'>"; strb_2 = _aname; strb_3 = "</t>"; strb_4 = " has been captured!"; strb_5 = "<br />"; strb_6 = "<t color='#33FF33'>"; strb_7 = str _reward; strb_8 = "</t>"; strb_9 = " has been added to the treasury";
Considered sticking all the data in an array?
the bit in question is changing the state of the global variables cB_i_VyborDepot and cO_i_VyborDepot
Yeah
Just getting it to work rn, I've got a shitload of scripts to plough through so I'm leaving optimisation to later
Globals
Only needs to be server exec'd
Using a straight command call didn't let me compound use hint and parseText
tried converting the parseText section to a string and then hinting that but it wasn't working
Call is fine anyways, as it's a client execution and the hint isn't time-critical
Okay what doesn't it do?
Doesn't change the boolean state of the last two arguments
cB_i_VyborDepot and cO_i_VyborDepot
Might be because you didin't assign your parameters to anything...
They are
//Exiting script and enabling OPFOR capture trigger
_this select 3 = true; <--- ?
_this select 4 = false; <--- ?
Yeah I posted a correction
_truecon = true;
_falsecon = false;
where truecon is cB_i_VyborDepot and falsecon is cO_i_VyborDepot
You do know that local variables are local to their scope?
Yeah
when you declare locals they can't be accessed outside of the function
unless the function performs a return
I'm not sure how to express the desired globals as a dynamic variable
if that makes any sense
Not really because to me a global variable is
just this.
MyGlobal = false;
Variables global / missionNameSpace
Not sure what that is
Oh, I've checked if the variable has changed after the script fires
diag_log format ["%1",somevar]; logs a value to the arma 3 .rpt file
Ah
I am wondering how you expect these values ```
_truecon = true;
_falsecon = false;
to change when they are local.
Not global.
When this script finishes running
I didn't :p I'm not sure how to do it
The variables are destroyed.
They are local to this script
Just use truecon = true;
and falsecon = false;
They need to be global vars if you are going to manipulate them outside a script
Otherwise locally defined variables just get destroyed.
They effectively won't exist after you run the script and it finishes
And this can help you immensely
Yeah
Wait.
Okay'
for the second operand in the flowchart change it to 'dynamic variable = false'
Having a real brain fart today
Me personally, I feel you don't completely understand the problem yet.
You want to dynamically create variables from some piece of code?
Okay
What do you want to assign those variables?
No no no
Because this is how I'd do it.
The dynamic variable is what's being set to false
and I want that operand to effect the global it's bound to
So you want to feed a variable into your script that has a value, then globally change it when the script is done?
Actually pretty simple.
@tough abyss diag_codePerformance has been here awhile before 1.66 ๐
๐
How many dynamic variables are you needing Madopow2110 ?
Around 200
It's got to be enough for 3x every settlement in Chernarus
Incl subdivisions of cities, petrol stations that sort of thing
for "_i" from 0 to 200 do {
MissionNameSpace setVariable [compile format ["dynamicVar%1 = %2,_i,_value];
};
I don't know if it would work.
Gotta do lookup of it though
I've manually set all of the variables
I just need to look them up and change them without having 200 if statements in every script
Exactly
Well if you use my method
You can create an array
within an array
And assign all the array true / false values
at once.
Ah
And just run a check every so often when you activate a zone.
I was thinking I could maybe check truecon against an array
get the entry in the array that matches
and set it to true/false
@dusk sage We got bitwise functions ๐
@nocturne iron This reminds me so much of bitflags
the guys here were discussing
Nice
Found a janky workaround it's alright
It's not inefficient, just a pain in the ass
Whats the work around?
The script is called via trigger
manually going in and setting a var=true,var2=false on deactivation
Set an eval timer
I've got like 300+ triggers so it'sa dick but yeah
Triggers will try to evalulate more than every frame
Okay
Will tank your FPS pretty bad.
Oh already got that
when a value is set inside presents 2 problems.
One problem is, keeping track of the Global variables
When a single global variable is assigned being global defined
If you don't have another unique variable
you will over-write the previous
Thats why
compile format ["dynamicVar%1 = %2];
That is used
yeah
I'm using manually set globals checked against a spreadsheet so it's all good
It creates a globally defined value with an incrementing value
This ensures you've got all 200 unique global vars
Planning to dynamically apply that to all the houses on the map
And this.
_handle = {hint parseText (strb_1 + strb_2 + strb_3 + strb_4 + strb_5 + strb_6 + strb_7 + strb_8 + strb_9);}
Bad practice very slow.
Better option.
_handle = {hint parseText format ["%1 %2 %3 %4 %5 %6 %7 %8 %9,strb_1,strb_2,strb_3,strb_4,strb_5,strb_6,strb_7,strb_8,strb_9];}
format is several orders faster than operator based concatonation.
Thanks
I've never really dabbled in formatted text
Too lazy to bother doing it for mission's I'll never release
Yeah
We work with ALiVE
Nice
I've got a couple nifty scripts for actual unit optimisation
nothing ALiVE level
just dynamically spawning targets for CAS missions
setting simulaton zones
that sort of thing
hint parseText format ["%1 %2 %3 %4 %5 %6 %7 %8 %9",strb_1,strb_2,strb_3,strb_4,strb_5,strb_6,strb_7,strb_8,strb_9];
To correct my wrong code.
Thanks
Madopow2110 I am currently working on my groups I&A mission
Nice
Everything is being EVENT driven.
Radio tower blows up runs some code to say yes towers dead.
WaitsUntil unit count < 4
Runs the GC after the event handle completes it run
Next AO spawns
Tower is created handler added
Try applying an EH that runs an if unit count < 4 on the death of each enemy unit in the AO
saves a ton of compute time when hundreds of units are on the field
No I mean instead of the WaitUntil you've got going
make it an EH
because the WaitUntil checks every couple frams
waitUntil is cheaper as it evaluates once per frame.
OnDeath should be cheaper shouldn't it?
Counting the dead AI?
Hmmm maybe.
I'll show you a script I did that does something like that
/*
USAGE:
_handle = [unit] spawn fnc_act3_unitspawn_blufor_eh
OR
{
if ((side _x) == West) then
{
_handle = [_x] spawn fnc_act3_unitspawn_blufor_eh
};
} forEach allUnits;
*/
_unit = this select 0;
_unit addEventHandler ["Killed",{
_totWest = WEST countSide allUnits;
if (_totWest < 100) then {
_reinforcementChopper = selectRandom ["B_Heli_Transport_01_F","B_Heli_Transport_03_unarmed_F"];
_reinforcementPoint = selectRandom [[6895.02,7329.84,0],[7855.58,7702.19,0],[7277.63,7893.46,0],[7046.4,7845.28,0],[8584.05,7689.91,0]];
_reinforcementLZ = selectRandom [lz_b_reinforce_1,lz_b_reinforce_2,lz_b_reinforce_3,lz_b_reinforce_4];
_grpCargo = [[0,0,0], WEST, (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> "B_T_InfSquad")] call BIS_fnc_spawnGroup;
_grpHelicopter = createGroup WEST;
_helicopterarray = [[7323.4,6227.24,50], 0, _reinforcementChopper, _grpHelicopter] call bis_fnc_spawnVehicle;
_helicopter = _helicopterarray select 0;
{_x moveincargo _helicopter; _nul = [_x] spawn fnc_act3_unitspawn_blufor_eh;} foreach units _grpCargo;
_wpgrpCargo_1 = _grpCargo addWaypoint [_reinforcementPoint, 0];
_wpgrpCargo_1 setWaypointType "SAD";
_wpgrpHelicopter_1 = _grpHelicopter addWaypoint [(getpos _reinforcementLZ), 0];
_wpgrpHelicopter_1 waypointAttachObject _reinforcementLZ;
_wpgrpHelicopter_1 setWaypointBehaviour "CARELESS";
_wpgrpHelicopter_1 setWaypointType "TR UNLOAD";
_wpgrpHelicopter_2 = _grpHelicopter addWaypoint [[5600.95,9802.29,300], 100];
_wpgrpHelicopter_2 setWaypointSpeed "FULL";
_wpgrpHelicopter_2 setWaypointType "MOVE";
_wpgrpHelicopter_2 setWaypointStatements ["true", "{deleteVehicle _x} foreach units _grpHelicopter;"];
sleep 10;
};
}];
applies itself to the spawned units
I function the crap out of everything.
Waypoint functions are given their own folder etc.
yeah
Half of the functions I've written have been execeptionally helpful.
Particularly with group mission development
ALiVE does it ๐
I can just hook alives stuff and create my own virtual profiles from within alive
I can make the mission run with thousands of AI
but they're not spawn'd in.
ALiVE calls them virtualised units
Yeah, I'm familiar with ALiVE
The virtual war system is excellent
params [
["_queuedArray",[]],
["_toBeQueued",[]]
];
private _addedToQueue = _queuedArray pushBack _toBeQueued;
_addedToQueue;
Thats the prototype of the queue
For adding data to it
//Flush queue
params [
["_queuedArray",[]]
];
_queuedArray deleteRange [0, count (_queuedArray)];
Purges the queue array
for example I&A uses a queue with no explicit queu
queue*
I can actually use this for pretty much anything.
//Adapted from killzone kids array pop
params [
["_queuedArray",[]]
];
_queuedArray deleteAt (count _queuedArray - 1)
tripel ` or backticks tild key
Stuck to gether
Cool
I'm reading up on optimising script at the moment pretty hard
because I'm trying to do a more realistic version of Warfare
based around the War in the Donbass with Chernarus as an analogue
going to have public relations simulation (ie how much of your territory is in ruins) etc
BI will be releasing dynamic simulation soon I hope.
Going to be entirely zeus based so it plays like an RTS
Yeah I'm super super keen
Includes a fog of war and everything
Going to add a feature later where a squad of players can play as NAPA while the two main players (CDF and Chedaki) fight
NAPA won't be able to capture territory but will gain units and supplies by capturing them, blowing up buildings in controlled towns etc
Did you play much A2?
No not really.
Ah, makes sense :p
_queuedArray deleteRange [0, count (_queuedArray)]; ```
??? Why?
@jade abyss Groups you know AI groups yeah?
When you assign them into an array
and delete the group
and the array still exists
Var = [];
Var = nil; preferably
Or that
What you did was overkill ^^
Don't think in SQF
or at least... ignore almost everything you knew from other languages
๐ฆ
As @nocturne iron mentioned:
Var = nil; //Var doesn't exist anymore.
and
Var = []; //Var = Empty array
Also that script speed tester they include in the dev version of the editor is delicious
A new one?
Nah it's been there forever
I've just been playing since A2 so it's a godsend
not that I have anything on the OFP chaps
Its not only in DevVersion then. Also in regular.
Oh :p
Editor -> Esc -> There is a clock somewhere ๐
Haha
Also @tough abyss if you ever want to retain 'scenery' from old scenes you can convert all the objects to simpleobjects
takes the performance hit down to 0
and you can do super detailed towns
As long as you don't want to interact with them.
It's why I recommend you shouldn't depend on the ALiVE caching
New command to deal with decimal values
and string conversions
that retain their accuracy
it misses some things you can do with disable commands that are quick and very powerful
Nice
Yep, KKs Fnc (KK_fnc_positionToString ) is obsolete now.
Try doing what it does yourself
Indeed
It'll end up quicker due to less variables
less baggage really
Yeah
I wrote a small script to transfer AI from server to HC
that didn't go down too well.
So ALIVE just spawns directly onto the HC's
No transfer time.
Yeah
Haha
I try to specialise my scripts per use case
as you can get teeny bits of perfomance boosts
it doesn't work outside of the box neccesarily
but if you've got time and a shit pc I've managed to get a 400+ ai battle in tanoa with hundreds of little tidbits and fully furnitiured houses run at 40fps
I generalise all my code into functions
If I can take 4 , 5 operations
and pack them into 1 function that does it all
It makes it like a swissarmy knife kit
Yeah
jack of all trades, master of none though
Which can be good for functions certainly
but if you can separate rarely used operations you'll shave off a couple ms here and there
params [
[["_group",grpNull],
[["_behaviourMode","CARELESS"]],
[["_combatMode","GREEN"]],
[["_formationMode","LINE"]],
[["_speedMode","NORMAL"]]
];
_group setBehaviour _behaviourMode;
_group setCombatMode _combatMode;
_group setFormation _formationMode;
_group setSpeedMode _speedMode;
private _ret = if (isNil "_group") then {false} else {true};
_ret;
As an example.
Yeah
yes I know the ```
private _ret = if (isNil "_group") then {false} else {true};
can be replaced by this
private _ret = isNil "_group" select [false,true];
That works but the params fire repeatedly
Try making them globals in the init
It's all good to optimise how you define the variables
but check if you need to define them in the first place
It'll be on the biki
^
Oh well I can get rid of that entire isNil group then
๐
params [
["_group",grpNull],
["_behaviourMode","CARELESS"],
["_combatMode","GREEN"],
["_formationMode","LINE"],
["_speedMode","NORMAL"]
];
_group setBehaviour _behaviourMode;
_group setCombatMode _combatMode;
_group setFormation _formationMode;
_group setSpeedMode _speedMode;
There we go
Universal group setting function
Indeed
@tough abyss
It's
private _ret = [true, false] select isNil "_group";
and tbh, it can be simplified to just:
private _ret = !isNil "_group";
lol, i've seen it done the above way a few times, and i coudn't figure out why people did it that way.
is there any way to disable groundweaponholder inventory? I tried enablesimulation false, but it did not work
looking at a weapon, but not being able to pick it up
inGameUISetEventHandler
If no one is suposed to get the weapon ever so createSimpleObject.
Hey! On my simple object adventure i dont create buildings with doors as simple objects because they will have doors closed forever. But i liked the idea of create then as simple objects and change then to normal objects when a player is near. May be i can store doors state with animationNames function plus a state function for each animation.
Also... HandleDamage is triggered in simple objects. So you can do some fake damage manipulation, delete it with fake explosion and even change the model to the ruins version if present.
Just cant remember what is the damage value send to the HandleDamage EH. If it is zero you can process damage due to the ammo type.
Or do something really simple like 5 shots on a chair kills it.
ok thanks
Hey is there a command for checking if a player is in a group?
_unit in units _group
Could it be player in units group player?
the player is always in the players group
you can use units _object. so need for group
I dont understand what you mean with _object
The object would be the player wouldnt it?
seems like you're looking for if ({isPlayer _x} count (units _group) > 0) then {};
@halcyon crypt thanks looks a lot like it, but what do I define _group?
_group is the group that you want to check for a player
So that could be group player?
like @little eagle said, group player has always a player
ah ye
player in units group player will always return true.
maybe tell us what you want to do exactly ๐
Its a gang
I want to check if a certain player is in a gang
For the official life framework
but @runic spoke that would always return true?
cursorTarget is not player.
i want to check a player
you first have to figure out how to fetch the player you want to check.
I want to check the player who is executing the script
do you want to check if he is in a gang?
yes
ok I'll try that
does Life have a gang system by itself?
yes
If so, they'll probably have a function to check all that
Ye but it seemed like it just check if (unit in units group player)
Im checking right now
_group = groupPlayer; _members = _group getVariable ["gang_member", []];
if it's [] then the player is not in a group
ok so if (_group isEqualTo []) then { hint "you are not in a gang";}; ?
sure
Ok thanks a lot!!
@nocturne iron "but if you've got time and a shit pc I've managed to get a 400+ ai battle in tanoa with hundreds of little tidbits and fully furnitiured houses run at 40fps"
How many MP players you got running around in that mission?
Is it possible to remoteExec something on everyone except for your own group?
Hi. I'm learning arma 3 modding by using the arma 3 sample files. The Test_Tank_01 has a "pos driver", "pos driver dir", "pos gunner", "pos gunner dir" and "pos commander", "pos commander dir".
For some reason the "pos driver does not work. The only way to drive is to spawn inside the vehicle, and Im not able to get back in if I exit the tank.
Anybody seen this issue before? Whats wrong?
@rotund cypress more like allGroups - [group player] I think
so that is just allGroups minus your own group?
yes
@nocturne basalt you should probably try in #arma3_config or #arma3_model to target the people that know about that stuff ๐
ok thanks
Can u help me?
no, because you're not telling us what your problem is ๐
Haha, i am getting the "server-side extension extdb is not loading report this to an admin
no clue, maybe @tough abyss can help you ๐
There should be an extDB logs directory that if created will contain more info on error (assuming the extension loaded correctly)
If there is no logs directory.
Then the chances are that either
- extDB files aren't in correct place
- You didn't install the requirements i.e vc2013/vc2015 (x86) depending on which version of extDB/2/3 you are using.
- Or you didn't place tbbmalloc.dll in your arma3server root directory.
- Dll is blocked / file permission issue
But you are best off to ask for support for Exile/Wasteland/Life in thier forums for support.
- No
- Ill check now
Got number 2
- Done
4)Check now
Where can i check perms?
@tough abyss
google windows unblock files
Say what
Nope thats not it ๐ฆ
Did you restart the server after the vc 2015 install
That shouldn't affect it, but hey, anything is worth a shot
You have to restart server 2012 when you change core modules. Vc is has always been that way.
@runic spoke so I've openend the RPT log and check the number of hits on 'diag_log "Player as kicked for slot"'. About 30 times
The functions is a life saver ๐
anyone getting problems with respawn after the update?
Negative
Is there a scripting command for limiting vehicle speeds?
no
@somber skiff none :p was giving it as an example of smart caching of AI/scenery
@rotund cypress you can make a script that monitors the speed of the vehicle and manipulate the control of the vehicle if it breaches speed limits.
setVelocity... meh
I have my own BRPVP_getShitOnCrosshair function that is ultralight and works with everything!
Why, because i did what probably BI did with cursorObject, but for me, 8 meters foward is enough, while BI function even return objects kilometers away!
Works even with simple objects
Thankyou mister lineIntersectsSurfaces, you are great!
profanity in function names ๐
Ah thanks @tough abyss
I'm trying to find the display number of the debug console in splendid camera in the config viewer but I can't find it there. Does anyone know what it's called?
Ah so RscDisplayDebug is the same for the splendid camera and the normal debug?
Yeah but then you press F1 in the camera and you get up the debug
So I guess it's just calling RscDisplayDebugPublic?
Ah ok thanks
Yeah ok
What is the difference between Non public and public one?
Ye
Yeah
I was checking in there, but I thought the splendid camera had a different debug that I was checking the idd off
}];```
I did that to close the display
So as soon as someone opens it it would close but that doesn't work
When the debug console is open, it will close
So as soon it gets open it will close and this is becuase I want people to be able to use the camera but not the debug console
Yes
But do you see why it wouldn't work?
ah thanks
ah yeah
I did this but it isn't working private _missionEVH = addMissionEventHandler ["EachFrame",{ if (!isnull finddisplay 316000) then {316000 closeDialog 0;}; }];
Got this error 13:21:21 Error in expression <isnull finddisplay 316000) then {316000 closeDialog 0;}; }];> 13:21:21 Error position: <closeDialog 0;}; }];> 13:21:21 Error Missing ;
private _missionEVH = addMissionEventHandler ["EachFrame",{ if (!isnull (finddisplay 316000)) then {316000 closeDisplay 0;}; }];
Did that
Didnt work
Generic error in expression
closeDisplay needs display, not number
Also closeDisplay simply sets flag for closure, it doesn't close it right away, if display is inactive dialog it will not be closed until other dialogs let it simulate.
But @tough abyss that doesnt find the specific display
private _missionEVH = addMissionEventHandler ["EachFrame",{ {if (dialog) then {closeDialog 316000;};}; }];
Should it be like that?
it doesnt work
You mean until they press escape or something?
Yes!
How?
disableGlobalSimulation?
Ok so you mean like if findDisplay bla then disableglobalsimulation?
I need to freeze the player for some time
i already make then unable to move with w s a d
But need to avoid mouse movement now
oh
and i don't want to use disableInput
I thought you were talking about my problem ๐
Ah sorry
Why dont you want to use disableInput?
because input will be needed while the player is freeze
Yes
can isNil be used to check if a function is defined ?
A user function?
yeah, something defined in CfgFunctions, if (!isNil "TAG_fnc_AwsomeFunction") then {};
yes
ty
Sorry, i was away. Yes.
Can I get access to for example the code for the debug console in a PBO?
thanks
Is it possible to script apex object on the map so people that doesnt have apex still can join?
Obviously no
but you can place objects through for example zeus but people can still join
but they wouldn't see the objects and I'm pretty sure they get an error message "class not found"
Ah ok I see
I guess that is because they don't have the downloaded content
Btw I'm getting this error 23:46:40 Warning Message: Resource title RscStatusTextFr not found
But I have that in a dialog
Think I figured it out
Yep fixed it ๐คฃ
Is there anyway to interface with the dynamic simulation system?
@little eagle Do you know of being able to do this?
what's the best way to intercept the exit mission button? e.g to prompt the player to save before exiting
like, the IDC for the existing exit prompt?
do you know of any mods which do something similar that i could have a look at?
god damn
it's bin.pbo