#arma3_scripting
1 messages ยท Page 355 of 1
and thats only 3 lines.
You can also just a list of phone numbers and UIDs , then grab the phone number attached to player uid from that
public variables are jip compat.
Hold onto your butts.
// server preInit
commy_initPlayerServer = {
params ["_unit"];
diag_log _unit;
// do stuff
};
{
waitUntil {!isNull player};
[player] remoteExec ["commy_initPlayerServer", 2];
} remoteExec ["BIS_fnc_call", 0, true];
would'nt that be in the mission.pbo though ?
Mission or addon, doesn't matter.
Ill take a look, im just trying to hide a many of my functions as i can serverside.
people connect to my server just to take stuff.
using them on their own servers...
I'd hate it if someone came to my server and took my scripts so I could never use them again
Missions are cached
They are not stealing, they are copying...
how many servers have a phone calling system?
Just extract it and bam
Vanilla. ?
Does not sound like something that's hard to do...
Only 1 server that I know of.
Create a custom channel
I posted the simplest solution and challenge everyone to come up with something better than that โ
only enable when calling for the two players etc.
People dont like putting in effort though @peak plover
Still does not change the fact that no one is losing anything. But somone is gaining something
Copying scripts etc. is a win-win
A win for the person copying, a lose for the person trying to make something different.
You are not losing anything
Your ability to make something different is going to remain unhinged
If I make a system, not many servers have, I dont want just anyone to be able to come and take it ? that would make it, not so differnt ?
// server preInit
commy_initPlayerServer = {
params ["_unit"];
diag_log _unit;
// do stuff
};
{
if (!hasInterface) exitWith {};
waitUntil {!isNull player};
[player] remoteExecCall ["commy_initPlayerServer", 2];
} remoteExec ["BIS_fnc_call", 0, true];
There. Now it doesn't loop forever on a dedicated server or headless client.
Unless code is directly removed your computer, you are not losing anything is all...
However... your trying to attract more players with features that only you have, so if someone else had that feature, they would have no reason to play on your server?
What scripting language does arma use?
sqf
Thx ๐
That was simple ^_^'
why are cameras so difficult to work with ๐ญ
going from pos->pos with camCommit X interpolates differently from how target->target does
trying to use setPos & setVectorDir now, but that is a whole different can of delicious worms
has anyone managed to come up with a script that opens the player's map and centers it?
i found a solution online but its like 4 pages of code and looks like death and hell.
centers it on the player?
[] spawn {
disableSerialization;
openMap true;
waitUntil { visibleMap };
private _mapDisp = findDisplay 12;
private _mapCtrl = _mapDisp displayCtrl 51;
_mapCtrl ctrlMapAnimAdd [0.0, 1.0, [worldSize / 2, worldSize / 2, 0] ];
ctrlMapAnimCommit _mapCtrl;
};
like that?
will try
works perfectly, thanks!
i was using the map center before, and it is off by quite a bit
Is there a way to add item to inventory, even if it's full?
yo
Yo, wadup dog
is there any more animations hiden in arma they dont want us to know about? im a bit tired of using the same ones for ai
example
[this,"REPAIR_VEH_STAND","ASIS"] call BIS_fnc_ambientAnim;
There's an animation button in the debug console
ctrl+D in editor
Allows you to browse animations
also there is a command animationNames
it returns all animations
yeah animations viewer only works for infantry, with animationNames you get them for vehicles, too
actually this is a good time to ask if anyone knows of somewhere I can read about how to put my own NPC animations into arma
for when I get around to that
as in, making the animations, not just putting them in a pbo
nm I found some blender stuff after 10 seconds of searching, ignore me
thank you, sir
Does any know how to make a whitelisting Script for Altis Life?
or where I could find it
pretty sure forza has one you could use
hahaha ๐
Is this correct?
_action = param [2, true, [true];
missing a ] on the end
I noticed that earlier
I just don't know if this is how bool is supposed to be used with param
works the same as any other data type. So in that case if _this select 2 is not a bool or is nil it will set to true
I am making a basic resource counting script, and I have an issue with the last line. I have all the parameters in line, so that is good, but I get "Generic Error in Expression" on the last line of code:
_amount = param [0, 0, [0]];
_caller = param [1, objNull, [objNull]];
_action = param [2, true, [true]];
_sideName = format ["%1_balance", side _caller];
_sideName = _sideName + _amount;
there are three balance variables, WEST_balance, EAST_balance, and GUER_balance
is the _sideName text a variable?
yes
in which namespace?
shouldn't it be the same as WEST_balance = WEST_balance + 50
if the amount is 50 and the player is blufor
_sideName is a string not the variable you are trying to edit
so you're doing "WEST_balance" = "WEST_balance" + 50.
missionNameSpace setVariable [_sideName,(missionNameSpace getvariable [_sideName,0]) + _amount];```
That doesnt look very attractive but thats what you're trying to do (assuming the variable is in mns)
I'm not entirely sure what missionNameSpace even means to be honest
also I need it to actually hint the value for that variable so a string won't work
unless you have specified the variable to save elsewhere, its most likely in the missionNameSpace.
missionNameSpace getvariable [_sideName,0] will return the variable value (or 0 if the variable doesnt exist)
any variable you define in your mission is in the missionnamespace
yea, so itl be in the mns. does that line up there ^ work for u?
@robust hollow Thank you sir, it appears to work as intended
// Add or subtract resources to given side
// nul = [amount,caller,action] call BTH_fnc_HandleBalance.sqf;
// amount: Number - Amount of resources to be added or removed from faction's balance.
// caller: Object - Variable name of the unit that activates the function.
// action: Bool - Whether to add to, or subtract from the faction's balance. true = add, false = subtract
_amount = param [0, 0, [0]];
_caller = param [1, objNull, [objNull]];
_action = param [2, true, [true]];
_sideName = format ["%1_balance", side _caller];
missionNameSpace setVariable [_sideName,(missionNameSpace getVariable [_sideName,0]) + _amount];
_total = missionNameSpace getvariable [_sideName,0];
hint str _total;
I just need to make it determine whether to add or subtract, which should work with a simple if then statement if I understand correctly
yea. this would work https://pastebin.com/gYRBcuXg also looks a bit nicer imo.
im no good at explaining private ๐ฆ basically it stops local variables being edited up scopes. https://pastebin.com/RgA7Wime
I thought that was point of local variables in the first place
they are local to the scope they are made in and any scope below it unless you private in those lower scopes.
Actually nvm I think I get it
thats how i understand it anyway.
That makes sense
thanks for the help
hopefully this will work in multiplayer
don't see why it wouldn't
waitUntil {["set_up_fob"] call BIS_fnc_taskExists};
that seems fine to me?
6:21:10 Error in expression <askVar = _taskID call bis_fnc_taskVar;
!isnil {(missionNamespace getVariable (f>
6:21:10 Error position: <!isnil {(missionNamespace getVariable (f>
6:21:10 Error Generic error in expression
6:21:10 File A3\functions_f\Tasks\fn_taskExists.sqf [BIS_fnc_taskExists], line 45
params [
['_amount',0,[0]],
['_object',"CargoNet_01_box_F",[""]],
['_objPos', [0,0,0],[[]]]
];
_resObj = _object createVehicle _objPos;
_resObj setPos _objPos;
_resObj addAction ["<t color='#FF52C0'>Collect Resources</t>", {_caller = (_this select 1); nul = [_amount,_caller,true] call BTH_fnc_HandleBalance;}, 0, 10, true, false];
This doesn't successfully pass the _amount number into the add action.
How can I do that?
you cant use local variables in addactions like that
try this sqf _resObj addAction ["<t color='#FF52C0'>Collect Resources</t>", {(_this select 3) call BTH_fnc_HandleBalance;}, [_amount,_caller,true], 10, true, false];
oh yea, oops
_resObj addAction ["<t color='#FF52C0'>Collect Resources</t>", {[_this select 3,_this select 1,true] call BTH_fnc_HandleBalance;}, _amount, 10, true, false];```
also how are the parameters outside of the calling?
wait I get it
it is the array from the actual addaction
๐
that syntax seems very confusing
I can't tell which are addAction parameters and which are for calling the function
I can only tell the title and the script
wait nvm _amount takes the place of arguments
it says generic error in expression
but it appears to work just fine
I just forgot to quit the preview entirely to reload the function
all is good
I have a minor issue where it is possible to harvest a resource object twice (just barely possible) if you're fast enough
Is there anything I can do to remedy this issue? Here is what the addAction command currently looks like:
_resObj addAction ["<t color='#FF52C0'>Collect Resources</t>", {removeAllActions (_this select 0); deleteVehicle (_this select 0); [_this select 3,_this select 1,true] call BTH_fnc_HandleBalance;}, _amount, 10, true, true, "", "", 3];
you could set a cooldown in BTH_fnc_HandleBalance so even if it is called more than once it should exit after the first time without doing anything
that would cause an issue if you use that fnc very frequently tho.
that would definitely be an issue
It needs to be able to be called that quickly just not from the same object
tried disabling player simulation for a tiny bit of time
that doesn't disable the action menu though
I could do something with the addaction condition
Not sure if this actually helped, but it seems removing the actions and object first, then having a tiny delay before calling the function, makes the first commands activate faster. I can't seem to double the resource gain no matter how fast I try using this addAction:
_resObj addAction ["<t color='#FF52C0'>Collect Resources</t>", {removeAllActions (_this select 0); deleteVehicle (_this select 0); sleep 0.05; [_this select 3,_this select 1,true] call BTH_fnc_HandleBalance;}, _amount, 10, true, true, "", "", 3];
@robust hollow do you think maybe the function was somehow slowing it down?
i doubt it. the actions are removed and then the obj deleted (which to me seems a bit pointless doing both) before the fnc is called.
That is what I was thinking but it actually seems to make a difference
might be something else though
It makes no difference. Removing the actions right before deleting the object is pointless.
Can someone explain to me how setVectorDirAndUp works?
Please, I've been punching in numbers for an hour
this should be pretty self explenary:
https://community.bistudio.com/wikidata/images/thumb/8/80/Vectordirandup.jpg/300px-Vectordirandup.jpg
Except the variables don't actually equate to numbers. I can't figure out for the life of me how to turn something more than 90 degrees
*equate to angles
the numbers of the vectors just need to add up to 1
for example [0.5,0.5,0] in the dir vector should be a 45 degree rotation
But [1,0,0] is 90 degrees, and you can't make it any higher than that
I was playing around with that last night trying to point a camera where I wanted it to go
_camera setPosASL _pos;
_camera setVectorDirAndUp [
_pos vectorFromTo _target,
[0, 0, 1]
];
use a unit vector
When i put in negative numbers it flipped upside down
both vectors need to result in a 90 degree angle
@cyan pewter thats what it is supposed to do
that migh be usefull
https://community.bistudio.com/wiki/vectorNormalized
and someone recently posted a snipped to keep those two vector arrays in this 90 degree angle
So I've got a turret attached to the back of an aircraft, but the default heading is facing towards the cargo bay, so i need to spin it around 180 degrees on the z axis
yea thats correct
post your full params array
also keep in mind that attachTo and setVectorDirAndUp are bugged
the numbers of the vectors just need to add up to 1
for example [0.5,0.5,0]
That vector adds up to sqrt(2)/2 though.
I didnt think magnitude actually matters for the setDir vector set of commands
Guess the engine doesnt internally normalizes them to be sure then?
Idk, just felt like pointing out the wonky math.
Yea wasnt aimed at you in particular
2017/09/12, 14:20:37 "Failed to load plugins\loadout\loadouts\nato.sqf"
2017/09/12, 14:22:05 "loadout_fnc_cargo"
2017/09/12, 14:22:05 "beforeFile"
2017/09/12, 14:22:05 "Failed to load plugins\loadout\loadouts\csat.sqf"
because the file is in a clientside only mod
private _factionFile = format ["plugins\loadout\loadouts\%1.sqf",_faction];
if !(_factionFile call mission_fnc_checkFile) exitWith {
(format ['Failed to load %1',_factionFile]) call debug_fnc_log;
};
// load the file
call compile preprocessFileLineNumbers _factionFile;
File is inside the mission
it loads correctly on the client
what does checkFile do
private ["_ctrl", "_fileExists"];
disableSerialization;
_ctrl = findDisplay 0 ctrlCreate ["RscHTML", -1];
_ctrl htmlLoad _this;
_fileExists = ctrlHTMLLoaded _ctrl;
ctrlDelete _ctrl;
_fileExists
ohhh
LMAO
st00ped me D
eks dededede
I heard that this method doesn't work anymore? @little eagle Or something else was wrong with that
Dunno exactly what it was. But there was something..
@tough abyss I can't remember such a thing.
@still forum htlmLoad to check if a file exists? Works fine, but you need a machine with interface. No controls on a dedicated server machine, so no htmlLoad available there.
One thing to keep in mind about vehicle init is, that you can't use setVariable pubic. It will not synch the value.
The same might be true for setObjectTextureGlobal
Has nothing to do with the frame. It would work fine in the same frame in a scope that is executed after the init event.
When is display 46 created?
@peak plover There you have your answer why it doesn't work on Server
yeah thanks
mp?
After preInit, before postInit, no idea if the objects exist yet.
I'm getting ```sqf
Error Undefined variable in expression: ace_spectator_fnc_updatesides
Need to find a way to wait until the unit is initialized...
actually...
I got a way...
just execute your code during postInit. Everything should be done then
I'll just hide the unit until sleep 0.1;
then unhide after he is either put into spec or not
that one is during postinit dedmen
Why would ace_spectator_fnc_updatesides be undefined ๐ค
not initialized yet?
Functions are initialized in preInit/preStart
They definetly are initialized at init/postInit
ace does not use functions library
yeah.. and?
for some reaosn when my guy initializes, it's not :"(
I'm calling cookie fraud
Anyway I don't need to do that anyway
Cuz i just realized
player unit is created before anyway
I was trying to avoid the behavior of player appearing for like half a second when connecting and then being set dead and disappearing
I need to hideobjectglobal then run scripts and unhide
i deleted a group with a variable name and when i bild another one i cant put the same old name, how do i find that group with the variable?
If you are using addons, just make up an addon similar to how Exile does it.
The inital player model is VirtualMan_F
@peak plover ^^ its basically an invisible player character
That is exactly what VirtualMan_F was made for.
So you mod him so his scope is 2, then place him in the editor as playable and then selectplayer to someone else after player joins?
Nevermind, i fixed it by restarting the editor
Should already be placable. You don't really need a mod for this.
I can only see B_soldier_vr_f as placeable in editor - checked virtualMan_f and scope is 2 and side is 7
sorry I meant scope is 1
Pff, edit the mission.sqm
Ah, ok - thx for the tip
I've done that before to switch sides, but haven't thought to try and change classes for non-editor classes
^^
just wondering right now
is + deep copying arrays?
_arr1 = [1,2,3];
_arr2 = [_arr1];
_arr3 = + _arr2;
_arr1 set [3, 4];
//What is now the value of _arr3```
This question again.
reimplementing SQF, solves questions nobody asked before
[] + _arr
+ _arr
Iirc, one of these ^ is deep copy, the other is not.
you sure?
iirc
๐ฟ ๐ณ
private _array1 = [1,2,3];
private _array2 = [_array1];
private _array3 = + _array2;
_array1 set [2, 4];
_array3
[1,2,3]
private _array1 = [1,2,3];
private _array2 = [_array1];
private _array3 = [] + _array2;
_array1 set [2, 4];
_array3
[1,2,4]
ok ... so my testcase is wrong ๐
Conclusion, unary + is deep copy, binary [] + is not.
nope
invalid test case
expectation would be output of [[1,2,3]]
@commy - I get this: [[1,2,3]]
binary + is just append. It appends the existing objects to the other array.
Unary + is a real deep copy
Ah ok nvm
If you get 1,2,3; then you did use unary + to copy and not binary [] +.
NaN is accepted here? still wondering where it actually ever gets outputted ...
_indeterminate = log -1; + _indeterminate isEqualTo _indeterminate
true
_indeterminate = log -1; (- _indeterminate) isEqualTo _indeterminate
hmm, also true, despite it showing QNAN for the first and -IND for the second.
#Intercept
You'd think those would be useful in a 3d game.
@little eagle well some matrix stuff would make me happy <.<
L_ind = log -1;
L_qnan_p = + L_ind;
L_qnan_m = - L_ind;
[L_ind, L_qnan_p, L_qnan_m]
[-1.#IND,-1.#IND,1.#QNAN]
๐ค
L_ind = log -1;
L_qnan = - L_ind;
L_inf = 1E40;
L_inf_m = - L_inf;
[L_ind, L_qnan, L_inf, L_inf_m]
[-1.#IND,1.#QNAN,1.#INF,-1.#INF]
Any more of these?
[L_ind, L_qnan, L_inf, L_inf_m] find L_inf_m
0
Strange.
@little eagle looks like the math "error codes" are treated like one
theyre all NaN right? just different kinds of NaN
All NaN
They are treated equally by the isEqualTo/in logic.
But stringyfied they are different
nothing i need to bother about in the SQF-VM i think ..
or does anybody sees any use for that form of stringification?
@queen cargo debuging maybe
how does this be useful for debugging?
@queen cargo all of these are error codes ๐
sorta
#ind should be illegale operation, #inf should be an overflow and #qnan looks to be used once you do some additional computation with a NaN value, correct me if im wrong ^^"
minus qnan is ind again.
@little eagle okay O.o
is there a way to customize the gui buttons, like form them ? i mean like this: https://i.imgur.com/NY07xRq.png
No.
Yep keep using forza cars
you could do it via background pictures but not by shaping the button itself
but how have they done it in my screenshot ?
๐ค Ever thought of actually opening the mission file up?
@dim owl Probably same as ACE does it.. Or the good old commy rose.
I'm currently reworking the command rose and need a graphic for it.
To make it work with the coding it should look like this: http://i.imgur.com/LL6B4u4.png
The only real requirements are, that the...
I though there was a PR somewhere with the code.
but how have they done it in my screenshot ?
Not with gui buttons.
Actually.. The screenshot looks exactly like that....
But with math.
MouseMoving and MouseButtonDown eventhandler where you highlight the "buttons" yourself.
And calculate over which button the cursor is yourself.
but when you hover about a "button" it gets orange. how this happens ? like just this one piece changes its background
@dim owl they change the background pic of that area
what you see is mostly background pictures
@dim owl MouseMoving eventhandler most likely recalculating every time which "button" the cursor is over.
Those are not buttons. Buttons can only be rectangular. But you can make pictures with alpha that appear to have a different shape. Then you can't make them buttons though, because that would make them clickable in the transparent edges.
oh okay. so i just add every piece from the circle as picture ?
Yes. Or maybe it's always the same circle with different parts highlighted. Who knows.
Or make it a square setup and save yourself some time :P
Waidmannsheil.
lol ๐
@little eagle I feel offended
Good. That means I did something right.
Hey all o/
I want a seperate channel for commy.
@tame portal You a waidmann?
#ComeForCommy?
Discussion about anything related to Script creation
Good.
and usage within game ...
Shit.
#CumForCommy! @spice kayak
dam rite bb
I am spending too much time on FT...
#arma3_scripting_commy
Discussion about anything related to Script creation and NO usage within game
FetishTube?
@dim owl i think the BF2 comrose for example only calculated the direction from the screencenter to the invisible cursor to select the right button and was actually not a button to be clicked directly by the cursor
and imho every other comrose interaction is shit
That's a good solution
Unless you have other buttons floating around on your screen
@little eagle People want to be spoon-fed or else you look like a jerk!
Scripting is still my favorite channel. It's like it's own world within this Discord
Needs more rants and infighting.
I know, occasionally you come here to witness the funniest thing of the day
Even though my problem isn't technically scripting, I figured you guys would know the answer anyway. I have a global variable, which I know has the value of 1, yet my trigger, set to activate when this number is set to 1, doesn't activate. This is the condition code for it.
if ((missionNameSpace getVariable "vVariableHere") == 1)
in the debug console, vVariableHere is equal to 1, and triggerActivated tTrigger is false.
Doesnt the condition code has to return true or false?
I didn't think it did. I've used ot to equal numbers before.
Oh, you're right, must return boolean.
IF returns an IF type which is not accepted in triggers
So only
(missionnamespace getvariable ["vVariableHere", 0]) == 1
lgtm
lgtm?
lgtm?
Ah, all good, just thought I'd check.
Better than running into tons of rpt entries because the variable exploded or something
I want to tag emoticons aswell.
I always thought you could use IF in the condition boxes of those things. My whole lazy world has been changed :(
Well, inside the if and else scope you can return something, but in your example you would only return true or false anyway so you might aswell just put the condition there
_hello = if (condition) then {True} else {False};
_hello = condition;
Yeah, makes sense. I'm thinking this is taking longer than the condition of presence check anyway, which wouldn't work out.
When writing in the init box, I hit enter while holding shift and it went to a new line.
I tried Shift Tab, only to be greeted with the steam overlay - disappointing :(
The revolution, it has begun
`using that boolean code you sent before, that should technically work within the condition of presence field, wouldn't it? Considering the variable is being defined before that should happen, you'd think so.
Yes
Hey ๐ So I really want to understand what Param is (https://community.bistudio.com/wiki/param) . Fx in this sample:
_vehicle = param [3,ObjNull,[ObjNull]];
if (isNull _vehicle) exitWith {systemChat "Error! Null Vehicle"};
if !(alive _vehicle) exitWith {systemChat "Error! Dead Vehicle"};
if (player distance2D _vehicle > 7) exitWith {systemChat "Error! Too Far Away"};
Yeah, it doesn't. Odd.
[1,2] call {
params ["_num1", "_num2"];
_num1 + _num2 //3
};
???
anyone know if uniform arguments are global?
Yes. They are.
thanks
Or rather, it is.
@blissful fractal Parameters to a script are accessed with the _this variable. Most of the times, _this is an array holding an amount of parameters because you want to pass more than one parameter to the script. In this case instead of manually doing _this select 0; _this select 1; and so on you can use param which you just give the index to get the parameter from _this (in the default syntax) and additionally you can do filtering such as which datatype is allowed and specify a default value if the passed parameter is not of the correct data type or not defined
I dont like typing on my phone
Yeah, it seems like condition of presence seems to be calculated before the variable is set, which is odd.
At least, in my testing.
@tame portal Thanks.
IS there any way to get a list of objects or units synced to a trigger?
I thought thisList might work when it has no area, but it doesn't seem to be the case.
synchronizedObjects trigger1
Oh, that was simple enough, thanks!
Would that return an array?
Ah, yeah - great, thanks!
is anyone else having issues with the group system in arma not working correctly, sometimes?
we are observing a case where people within the same group all of a sudden cannot hear each other via VON
we boiled it down to inspect how the clients think what members are in their own group and it seems like the client sometimes think certain group members are dead AI
say Bob and Jamie are in the same group. everythings fine. but then all of a sudden Bob cant hear jamie anymore. they also dont see each others chat
the netIds of their "group player" are still the same. the server thinks both players are in the same group.
and suddenly Bob got replaced by a dead AI unit from Jamies standpoint
isPlayer Bob returns false for Jamie
damage Bob returns 1 for Jamie
alive Bob returns false for Jamie
and name Bob returns a random unit name for Jamie, for example Petridis (probably a CfgWorlds name)
this seems to happen randomly, but can be reproduced on a daily basis
even gets worse with more people in a group
eg. Bob, Jamie and Frank are in a group
Bob can hear Jamie and Frank
Jamie can hear Frank, but not Bob
and Bob can only her Jamie
i see the Task Force Radio guys are experincing the same issue since August 2016 already
it even got more absurd sometimes. It actually happened to me that my own player object was not in my own group. So basically "player in (units group player)" returned false. wtf?
I've noticed several small glitches with BIS's group manager ever since I switched over to it about a year or more ago. They are so random and I don't know how to reproduce though It is occouring less now since last update it seams. Never had any group issues before when I was using aeroson's group manager. And this is without mods on a dedicated server that never has chains (desync). Though I believe it may sometime have to do with a local clients not so good connection..
@little eagle i take it you want me to report?
@abstract sigil What issues are the TFAR guys experiencing?
Didn't get any report about that since one year.
for debugging, i made this output
diag_log format ["name player = %1", name player];
diag_log format ["group player = %1", group player];
diag_log "Outputting group:";
{
diag_log "---";
diag_log format ["_x = %1", _x];
diag_log format ["name _x = %1", name _x];
diag_log format ["netId _x = %1", netId _x];
diag_log format ["isPlayer _x = %1", isPlayer _x];
diag_log format ["alive _x = %1", alive _x];
diag_log format ["damage _x = %1", damage _x];
diag_log format ["typeOf _x = %1", typeOf _x];
}
forEach (units (group player));
diag_log "END DEBUG OUTPUT";```
which basically just dumps all the info about your own group to the RPT
for my own player it returns the expected result in that case:
18:54:52 "name _x = Not Eichi"
18:54:52 "netId _x = 2:25258"
18:54:52 "isPlayer _x = true"
18:54:52 "alive _x = true"
18:54:52 "damage _x = 0"
18:54:52 "typeOf _x = Exile_Unit_Player"```
for another dude in the same group standing right in front of me doing the QE dance it returned this
18:54:52 "name _x = Petridis"
18:54:52 "netId _x = 2:24663"
18:54:52 "isPlayer _x = false"
18:54:52 "alive _x = false"
18:54:52 "damage _x = 1"
18:54:52 "typeOf _x = Exile_Unit_Player"```
Can you reproduce that in vanilla without Exile?
That guy in the TFAR issue didn't answer for a year now.. So I guess the problem is not there anymore
have not tried to reproduce it in vanilla, no
from my experience, even if you send a mission with a reproduction of the issue to BI, it still will not be addressed
Might just be an Exile problem. I'd say it's using selectPlayer and moving the player into a non-player unit
Well.. sure... You could also do nothing. Then you have no chance of ever getting a fix
Uhm... wait... the players owner is 2 and the other players owner is also 2? That doesn't make sense
Sounds to me like the units are owned by the Server. Which.. Confirms my exile problem thought
2 is the server afaik
Meaning the unit is owned by the server and not by the player.
If you check isPlayer player on your mates machine.. It probably returns true. And on his machine isPlayer on you returns false
Because the unit really is not a player. It's an AI that is just currently possessed/controlled by the player
the thing is, if you look at your matey and inspect "isPlayer cursorObject" then it returns true
if you check what is in the "units group player", then it returns false for the same guy
str the player object. And compare if they are the same
they are
"R The Wookie Tribe:2"
notice how it doesnt say the player name in there
usually it says R Group:MemberID (Name)
wut? Usually it contains the adress of the object.. I thought
isEqualTo cursorTarget and the group unit?
Wait
Your logs you posted above are completly correct
your mate is dead 18:54:52 "damage _x = 1" thus he is not a player
which is not true! ๐
You probably have his dead body in your group but not him
he is alive, stands right in front of me and alive as one could be
and even more odd, the issue seems to sometimes even affect yourself
every unit has to be part of a group, all the time. thats how arma works
units lists corpses in your group when your avatar doesn't know that they died.
so one could say (player in (units (group player)) is always true, right?
As I said. The unit in your group is dead. The one infront of you is apparently not in your group
yes
its not!
๐ค
like, something has to broken to shit if your client thinks your player unit is not in the group of your player unit
except if you are in spectator. There you are not in a group and you are also not in that not group that you are in
^ and exactly this reminded me of why i have retired a year ago ๐
Maybe exile moves you into grpNull.. If that's possible
{isNull gunner _x} count [car1, car2, car3, car4, heli1, Heli2] <= (4 - count playableUnits) max 0
this is a coop set up, i wanna this trigger to work even with less than 4 player alive.
Probably just selectPlayer.
yeah, that was my guess, too
Also avoid selecting player into editor placed units in multiplayer, as it may, on occasion, lead to some undefined behaviour. If you need to selectPlayer into another unit, consider creatingUnit dynamically.
but its done only once in a life time: when they spawn
It sounds alot like a Exile problem. So....
Stop using Exile. And Battleye.. And Arma...
Never heard of this.
i have done that, dedmen ๐
Well, as I said, units lists corpses if your avatar doesn't know they're dead.
that is correct
one last thing: it seems to happen randomly. sometimes it does not happen for days. during other sessions it happens very couple of seconds
and it does not affect all clients, only a handful
so if you have a group of 10, it works fine for 8 of them, while 2 might have problems
its just super random ๐
Sounds like Battleye ๐
battleye is a good anti cheat
probably the best on the market as we speak
but lets put it this way: if you have a multiplayer environment where clients have authority, then even an anti cheat software cannot fix that
{isNull gunner _x} count [car1, car2, car3, car4, heli1, Heli2] <= (4 - count playableUnits) max 0
this is a coop set up, i wanna this trigger to work even with less than 4 player alive.
any idea?
{isNull gunner _x} count [car1, car2, car3, car4, heli1, Heli2] <= (4 - ({alive _x} count playableUnits)) max 0
thanks man
File C:\Users\Administrator\Documents\Arma 3 - Other Profiles\nigel\missions\test3.VR\mission.sqm, line 0: '/missionSQM.raP': '' encountered instead of '='
Anyone ever seen this?
nah. your mission is binarized? did you binarize it yourself or by editor?
editr
seems some encoding error
encoding error, so i screwd something up
DId you manually edit the file?
mission.sqm ? nah
Hmm.
// mission for refference
class missionSQM {
#include "mission.sqm"
};
Probably this
yup...
completly usless line ๐
you can't include a binarized file
Binarize it with a proper tool and copy over the *.sqm
"You can't use binarized files"
"is there a way to use binarized files?"
Uhm....
#Intercept.
Sadly.... That is quite often the answer for missing commands...
Does intercept have a wiki to get you going or do you need previous c++ knowledge?
@still forum has anyone used Intercept to create their mission or server?
i'll probably port my server sqf to intercept when it's done
You need a little of c++ knowledge. We have a Wiki on Github with a tutorial on how to get started. If you know how SQF syntax works then you already know the basics
You can't really use it for missions. Because Intercept needs to be a Mod.
Senfo built some Zombie AI for a Server using Intercept.
If you don't have C++ knowledge though I wouldn't recommend moving everything to Intercept..
But you can move some commands to Intercept using RSQF (self-registered SQF commands).
For example vectorLerp or vectorLinearConversion
i'm not planning to have a client-side mod for what I'm doing - luckily all the heavy lifting is done on the server so Intercept is perfect to offload the processing to
Sweet. Thanks for the info Dedmen.
but for the moment, I'm just playing with sqf to see if I can get the behaviour I need with what's there w/o mods
Basic setup https://github.com/intercept/intercept/wiki/Windows-Environment-Setup-and-Sample-Client-Installation
Self-registered commands: https://github.com/intercept/intercept/wiki/Registered-Functions
Basically all just copy-paste and modify to your liking
I hope that code is still correct ^^ There were a lot of changes recently. And the RSQF thingy will change
userFunctionWrapper won't stay because I am forced to use snake_case but I am too lazy to do that while coding so.. I sometimes forget to change it
What is more efficient, checking if player is inside an area trigger or checking player distance from an object?
Debug console performance test button
Checking if player inside an area is cheaper
distanceSqr is cheaper than distance 'tho
I've gotta start binarizing my mission.sqm for extra kilobytes and faster loading times ๐
Oh no, MULTIPLE kilobytes?!
That's all the white space from those
nested
classes.
shid, really?
What else?
I wonder how much would I save if I just replace all ; with , and remove all new lines and all useless spaces
make everrything into 1 line
so, i am using unit capture to a helicopter to land, but once the record end he start to hover, any work around this?
anyone worked much with ppEffects and cameras?
@ionic orchid what do you need?
having some trouble with motion blur on a fresh camera - it seems to be enabled by default and I'm not sure if I can turn it off
I have a question about addAction locality
If i put an addAction in the init of an object, it works just fine in multiplayer
but when i attach it to a unit with a script, it doesn't
i don't understand why that is exactly
private ["_unit"];
_unit = (_this select 0);
diag_log format ["addScript_Unit.sqf - _unit: %1", _unit];
_unit addAction ["Start conversation", "storylines\town_patrol\conversation.sqf"];
thats the script attaching the addaction to the unit
the diag_log output looks like this: 16:42:44 "addScript_Unit.sqf - _unit: C Bravo 3-6:1"
I'm executing the script on the server only
oh man, it might actually just be my monitor
printscreen screenshot has no blur, my eyes definitely see it
i figured that, but why does it work in the init then? is the object init executed everywhere automatically?
yes
ahhhh.
thats why scripts in init boxes are dangerous
you end up with an ammobox with 600 magazines
well i've got a map object that has a voting screen attached that lets each player send a vote to the server - works fine so far
yea for stuff like this its fine because it has local effects
global effects = bad tho
yeah i'm decently aware just fucked up this time
if (isServer) then {
};
well i have the server spawn civilians for players to question. so i need to attach a dialogue script to each civilian
the script is set up to handle being ran in parallel by multiple players
but i'm struggeling with attaching it to each civ with addAction
i guess a case for remotexec? but that command seems suspicious to me.
where do you have it?
where do i have it? so far the server handles all of that
the addiction script
well the server glues it to each unit it spawns and so obviously the only one who could use the action is the server itself i guess.
if you have it only on the server, you need to remoteexec it with JIP
also params ["_unit"]; but thats really separate
Well.
I can't really understand where the script is and when does it fire
i'm utilizing that "civilian occupation system" so thats leftover code from that.
by this point i ripped half of it out anyways. ๐
If you add action to the spawned NPC by the server, then yes you need to remoteexec it to target -2 with JIP
have to prettify that once it workss.
Mods?
remoteExec
do i need to whitelist the function if i send it server-> client ?
The solution could depend on your setup, so I had to ask.
You can white list it in a way that only the server can execute it, no?
well i will use mods, but i want to keep the mission in a state where it works fine with vanilla since i think it really makes testing much easier if you don't load a 20gb modpack each time.
you can select who can be the target commy
well this here: https://community.bistudio.com/wiki/remoteExec says "While any function can be used, only commands and functions defined in CfgRemoteExec will be executed."
now if i check this: https://community.bistudio.com/wiki/CfgRemoteExec all i see is "// List of script functions allowed to be sent from client via remoteExec" so i was wondering about the other way around
They're all white listed by default. Which kinda makes this a blacklist and not a whitelist ๐ค
i bet thats HORRIBLE from some security standpoint
uhm thats why you just use battleye filters
Eh, this is a game for milsim with closed servers.
not closed, public
but the amount of malicious people showing up is quite close to 0
expecially with large modpacks and signature verification
also having a non-persistent mission, a simple restart removes most headaches
write a function that will get the parameters for addaction
create remoteexec.txt
in the battleye folder
Btw I got a consipracy theory about why battleye is breaking up... I think all the PUBG is overloading their servers and they can't handle it all...
add ```
//regex
7 "" !=my_fnc
by "their servers" you mean the 386 in the basement of that one guy who pretends to be a company?
will kick every other remotexec
thanks Katekarin i'll write that down.
if you are interested about the security of your server
check out the battleye filters
and whitelist only what you use
yeah well i uploaded ~100 versions of my mission to my testserver to day to get my overly complex mission start theater working in MP with JIP
its on my plate but not an urgent issue
well it's pretty easy to do. log first, whitelist the ones which happen when only you play
I guess i'll record a video for you guys.
and then if that aren't using intercept they are limited to what you decided.
you can even restrict which vehicle players can spawn, if any. it's powerful
but.. that also means you as an administrator can't do anything more than players which is uhh
I'll end the off-topic here
well the mission concept includes a lot of freedom for players actually, with only semi-limited equipment and vehicle spawn. the idea is partially for players to limit themselves by the idea of realistic equipment. also, the more shit you bring, the more shit the enemy shows up with.
also i have included some mission elements with supply issues if you're too wasteful
but the mission is not designed to handle abusive people.
i've seen it work on other servers, if you attract the right crowd.
good luck!
You don't necessarily need remoteExec. You can build it with a PVEH too.
philosophical question: if you rotate your screen in windows, why does it rotate the "do you want to keep this setting" box as well
public variable, remoteexec. same security concerns, and remoteexec is just easier
The security concern of adding the civilian interaction to an illegal object?
Oh noes, be scared.
if you rotate your screen in windows, why does it rotate the "do you want to keep this setting" box as well
So you can read it upright to confirm your change?
yeah, imagine some hacker would attach my silly dialogue script to a rusty barrel. THE HORRORS.
Why do mirrors flip left and right, but not up and down?
but commy2, you don't rotate your screen physically BEFORE you open the menu to rotate it?
cause your eyes ain't onto of each other
you have to quickly rotate it within the 10 seconds
how evil. i bet microsoft secretly plots to kill people by crushing them with their own hectically rotated monitors. illuminati confirmed.
but commy2, you don't rotate your screen physically BEFORE you open the menu to rotate it?
There is no reason to rotate it, when it already is upright.
well. i bought this new monitor? and it is a good one. but the stand is horrible. luckily VESA is a semi standard so i can use the awesome 10kg heavy stand from my old monitor thats like cast iron, right? turns out the cables are totally in the way on the new monitor, so i had to mount it upside down. so what, just rotate the picture in the driver, right? now guess what, if i record a video ingame for you guys, its upside down.
lol
soooo i left the old stand on the monitor which doesn't use vesa, but some proprietary bullshit, so my monitor has two stands. one on the top, one on the bottom. good luck rotating that monster in 10 seconds.
am i hulk or what.
why do mirrors flip
They don't
I've never understood that one
I wonder if you do a negative width on a control, will it flip?
Look in the mirror. Raise your left hand. Dude raises his right hand. And you tell me they don't flip sides.
Acculty he raises his left hand
/o\
For the mirror guy it's both right hands
there is mirrors that don't mirror your image. they look like large boxes that contain multiple mirrors. if you look into those, you won't immediately recognize yourself. it looks a bit odd. because you're used to seeing the asymetrical parts of your face the wrong way around.
There is a see trough mirror its called a window look it up
i'm old ๐ฑ
see trough mirror its called a window look it up is that those things behind curtains?
yeah i hear about those. good graphics but the gameplay sucks and the story is the lamest stuff i've ever seen
๐ค
Just replace with a 4k tv and call it your 4k window and play games off of it
What's the syntax for window? Is the window local to the client or the host?
Uhh its a 4k tv
Is there an option to title a link
?
@north vortex dude stop being so stupid
@north vortex sorry
@simple solstice https://www.youtube.com/watch?v=itKM-bp6weo
I've spend the last days on making this MP and JIP proof
which was excessively more work than anticipated
how can i define a param that only accepts type object?
param [0,objnull,[objnull]]?
why don't these things occure to me. thanks!
Anyone know why this addAction doesn't appear?
initPlayerLocal.sqf
waitUntil{!isNull player && player == player};
waitUntil{!isNil "WEST_balance" && !isNil "EAST_balance" && !isNil "GUER_balance"};
sleep 0.25;
hintSilent "Initializing Player...";
nul = [player] call BTH_fnc_PlayerSetupLocal;
BTH_fnc_PlayerSetupLocal:
_pLocal = param [0, objNull, [objNull]];
private _pSide = format ["%1_balance", side _pLocal];
private _total = missionNameSpace getVariable [_pSide,0];
_pLocal addAction ["<t color='#FF992C'>Check Balance</t>", {hintSilent str (_this select 3)}, "test", 1, true, true, "", "", 1];
I can see the hint btw
so I know it isn't stuck on the waitUntil conditions
any script errors in the logs?
Condition has to return true inside a string, and cannot be blank iirc
oh yea. you can actually just throw out all these parameters you set on addAction since they're default values and optional anyways.
no errors and the blank condition hasn't been an issue before
how do you skip optional poarameters
how does it know which optional parameter you changed though
if you just don't put some in that appear before them
ah you want radius 1. well i would try to change condition to "true" first since that's the default and you're overwriting it with ""
also addAction is local and will only be executed where you call it so make sure you call it from player context script.
which you seem to do. ๐ค
still doesnt appear
_pLocal addAction ["<t color='#FF992C'>Check Balance</t>", {hint "Test";}];
This works
so it is an issue with the addAction syntax I am using or something
maybe the radius is just too small
It was the radius
I feel like an object being within a one meter radius of itself shouldn't be impossible
but what do I know
Is there a way to wait until a function is done executing?
Yeah
like scriptDone for scripts?
myScript = [] spawn myFnc;
waitUntil {scriptDone myScript};
in that case
call means that it will run the function and won't continute until it's done
_var = 1;
call myFncTakes10Sec;
_var = 2;
so it has basically the same effect as using scriptDone?
just having code after the function is called?
so when you run that in 10 seconds it _var will be 2
Yeah
if you want 3 functions to run in a certain order
call fnc1;
call fnc2;
call fnc3;
if u use functions library
sleep 0.5;
hintSilent "Initializing Player...";
private _setup = [player] call BTH_fnc_PlayerSetupLocal;
sleep 0.5;
hintSilent "Player Initialized";
So the second hint won't activate until 0.5 seconds after BTH_fcn_PlayerSetupLocal is done running
well, I don't
so I should be fine for now
hopefully I won't mess anything up for at least 10 minutes
does "onPlayerRespawn.sqf" activate when the respawn type "Switch to Side member" is used?
just tested it, and it indeed does work
Don't know
I'd assume yes
onKilled runs when unit dies
onRespawn should run when units is re-created, I assume switch to side memeber will be a part at this
I have the same init function in the "onPlayerRespawn.sqf" script and it runs once a unit is selected and switched to
I assume that respawn types are jsut functions added to onRespawn event, so it should fire, yeah
@waxen tide my bad, wasn't sure on the condition
waitUntil{!isNull player && player == player};
Delete that part after AND. Don't want to see that nonsense in my channel.
I think my brain has an incredible advanced algorithm for detecting wrong code and then ignoring it.
@little eagle Don't know why that was there tbh
also afaik they both do the same thing so it is pointless
well player should always be identical to player so you're comparing the same thing to each other. which is redundant
you might as well write "true == true"
hands a โ to Rylan
player == player
would report false if the player was null. But then the isNull check does the same already and is clearer code.
true == true
just errors, because comparing booleans is too advanced for this program.
..........
but shouldn't null == null equal to true?
Maybe, but it doesn't, which in a way makes sense too
is the status of nothing the same as nothing?
Is underdetermined the same as underdetermined?
this channel feels like SQF is the secret language dedmen and commy2 made up to pass naughty messages in school.
Because it is.
all those missed out on genital jokes
You can compare boolean like this:
true isEqualTo true // true
And even null equals null!
objNull isEqualTo objNull // true
if (!alive yourmom) then {hint "fucked your mom last night lol xd"} else {hint "lol ur moms dead"};
it all makes sense now
Vile.
I have the hints backwards oops
Should've at least included: https://community.bistudio.com/wiki/getShotParents
I'm not clever enough for that
You know whenever you post code that does anything, commy2 actually creates a new clever function to do it and adds it to the wiki just so he can smartass. i bet they push silent updates to arma all the time for that.
#conspiracy
@waxen tide cease your investigation immediately
Filter out ammo boxes and other unwanted stuff from the vehicles array.
vehicles select {!(fullCrew [_x, "", true] isEqualTo [])}
I'm not getting any errors when I try to load the mission,....but, the progress bar goes all the way across but then nothing happens. Here is what I touched since my last successful mission load,...gut says it's in here but I can't even get an error to show on the rpt.
_weapArr = [["uns_thompson",["uns_thompsonmag_30","uns_thompsonmag_30_T"]],["uns_uzi",["uns_32Rnd_uzi"]],["uns_sten",["uns_stenmag"]]];
if ((dayTime < 4.5) or (dayTime > 19)) then
{
_weapArr = [["uns_uzi",["uns_32Rnd_uzi"]]];
};
if (RYD_JR_BetterGear) then
{
_weapArr = [["uns_xm177e1s",["uns_30Rnd_556x45_Stanag","uns_30Rnd_556x45_Stanag_T"]],["uns_M16",["uns_30Rnd_556x45_Stanag_T","uns_30Rnd_556x45_Stanag_T"]],["uns_sten",["uns_stenmag_T","uns_stenmag","uns_stenmag"]]];
};
if (RYD_JR_Difficulty == 3) then
{
_weapArr = [["uns_38spec",["uns_38specmag","uns_38specmag"]],["uns_357m",["uns_357mag",uns_357mag","uns_357mag"]],["uns_coltcmdr",["uns_coltcmdrmag","uns_coltcmdrmag","uns_coltcmdrmag"]],["uns_uzif",["uns_32Rnd_uzi"]]];
};
gut says it in teh array but ???
@sage flume
["uns_357m",["uns_357mag",uns_357mag","uns_357mag"]],
this array element is broken
uns_357mag"
missing a " in the beginning
you should think about getting an editor with good SQF syntax highlight and a linter. sublime 3 works for me, some people use visual studio code or atom (from github)
my sublime draw a nice ? at that line and highlighted the bracket going all "wtf you want from me, asdfghj?"
_weapArr = [
["uns_thompson",["uns_thompsonmag_30","uns_thompsonmag_30_T"]],
["uns_uzi",["uns_32Rnd_uzi"]],
["uns_sten",["uns_stenmag"]]
];
if ((dayTime < 4.5) or (dayTime > 19)) then
{
_weapArr = [["uns_uzi",["uns_32Rnd_uzi"]]];
};
if (RYD_JR_BetterGear) then
{
_weapArr = [
["uns_xm177e1s",["uns_30Rnd_556x45_Stanag","uns_30Rnd_556x45_Stanag_T"]],
["uns_M16",["uns_30Rnd_556x45_Stanag_T","uns_30Rnd_556x45_Stanag_T"]],
["uns_sten",["uns_stenmag_T","uns_stenmag","uns_stenmag"]]
];
};
if (RYD_JR_Difficulty == 3) then
{
_weapArr = [
["uns_38spec",["uns_38specmag","uns_38specmag"]],
["uns_357m",["uns_357mag","uns_357mag","uns_357mag"]],
["uns_coltcmdr",["uns_coltcmdrmag","uns_coltcmdrmag","uns_coltcmdrmag"]],
["uns_uzif",["uns_32Rnd_uzi"]
];
};
_weapArr = [
["uns_thompson",["uns_thompsonmag_30","uns_thompsonmag_30_T"]],
["uns_uzi",["uns_32Rnd_uzi"]],
["uns_sten",["uns_stenmag"]]
];
if ((dayTime < 4.5) or (dayTime > 19)) then
{
_weapArr = [["uns_uzi",["uns_32Rnd_uzi"]]];
};
if (RYD_JR_BetterGear) then
{
_weapArr = [
["uns_xm177e1s",["uns_30Rnd_556x45_Stanag","uns_30Rnd_556x45_Stanag_T"]],
["uns_M16",["uns_30Rnd_556x45_Stanag_T","uns_30Rnd_556x45_Stanag_T"]],
["uns_sten",["uns_stenmag_T","uns_stenmag","uns_stenmag"]]
];
};
if (RYD_JR_Difficulty == 3) then
{
_weapArr = [
["uns_38spec",["uns_38specmag","uns_38specmag"]],
["uns_357m",["uns_357mag",uns_357mag","uns_357mag"]],
["uns_coltcmdr",["uns_coltcmdrmag","uns_coltcmdrmag","uns_coltcmdrmag"]],
["uns_uzif",["uns_32Rnd_uzi"]
];
};
see syntax highlight makes your error super obvious
I really appreciate that. Still learning and I use Notepad++ but I think I need to learn other ways as well
check that out. seems to be quite recent, too so likely its up to date and works nicely
๐
I'm still learning everyday as well, but using good tools makes a big difference for me.
disregard last
if (side (_this select 1)) != (side (_this select 3)) exitWith {hint "You cannot control a unit that isn't on your side!";};
I don't know why this doesn't work
I feel like I am missing something obvious here
(side (_this select 1)) you end the if before it can account for the rest of the statement
if ((side _this select 1) != (side _this select 3)) exitWith {hint "You cannot control a unit that isn't on your side!";}
Sure, try that out
It says the same thing it did before
what's the error?
type array, expected something else
you may need to close those brackets up, as it may stop at side _this .
if( side (_this select 1) != side (_this select 3)) exitWith {hint "You cannot control a unit that isn't on your side!";};
@hasty violet I would say it's easier to grab too. Just find the player and it's associated variable and use it. Compared to filtering the array and finding the associated unit
I fixed it
How so?
if ((side (_this select 1)) != (side (_this select 3))) exitWith {hint "You cannot control a unit that isn't on your side!";}
I thought that is what I had in the original
I must have been missing a ) or ( somewhere
Nope, but you could do with a little less brackets.
shouldn't the entire if condition be close in?
and (_this select #) also needs to be closed in
not necessarily. Because side (_this select 1) will return the same thing as (side (_this select 1))
ah
@runic surge I'd suggest adding a params above the if somewhere so you don't have to do the select inside the statement. and also checking the group's side, it's safer
params ["", "_unit", "", "_guy"];
if (side group _unit != side group _guy) then
no. why you think that?
because it is inside and addAction
@cedar kindle here is the full command
_soldier addAction ["<t color='#53BE5F'>Switch to Unit</t>", {if (side (_this select 1) != side (_this select 3)) exitWith {hint "You cannot control a unit that isn't on your side or dead!";}; removeAllActions (_this select 3); selectPlayer (_this select 3); nul = [(_this select 3)] call BTH_fnc_PlayerSetupLocal; removeAllActions (_this select 1); nul = [(_this select 1)] call BTH_fnc_UnitSetup}, _soldier, 1, false, true, "", "true", 4];
*hint* you can code just normal in code blocks
I need a bit of guidance. My mission scripts are growing a bit out of hand with more and more complex server<->client communication and various features i would like to switch on and off for debugging. So far i'm using whatever lends itself to trigger the next script in line. Is a task done? great, the next script can go do its thing. stuff like that. I lack structure, i lack a central place that gives me an overview of the mission state. I have a very complex story flowchart and lots of parallel things happening with various overlapping conditions and i don't want to dig this hole any deeper than i already have.
_soldier addAction [
"<t color='#53BE5F'>Switch to Unit</t>",
{
if (side (_this select 1) != side (_this select 3)) exitWith {hint "You cannot control a unit that isn't on your side or dead!";};
removeAllActions (_this select 3);
selectPlayer (_this select 3);
nul = [(_this select 3)] call BTH_fnc_PlayerSetupLocal;
removeAllActions (_this select 1);
nul = [(_this select 1)] call BTH_fnc_UnitSetup
},
_soldier,
1,
false,
true,
"",
"true",
4
];```
now i am happy
i need something robust that can universally handle whatever mission state i'm in with a lot of flexibility, with the ability to skip things, output debug info on demand, and some self-diagnostics in case something goes horribly wrong so my mission just doesn't entirely stall.
complex storyboard? different states in which your mission could be in?
check out FSM scripts
no idea why actual mission developers never use it ... state machines are great things especially for misions
with story flow etc.
i checked out FSM and considered it but so far i've nobody really seen using it which makes me very suspicious
no need to
most just simply do not use it
modders usually have no use for it
missions can benefit from it
or AI mods
but unless you do not have anything with different states, you have no need for a state machine
unless you lied with your story board etc.
you do have a need for states
thus you can put that story board into a state machine
transfer*
and youre done
FSM is actually quite easy to use too
nothing that complicated as long as you understood SQF
only that editor for FSM is ... nasty ...
ugly piece of s***
well i have someone who's tinkering out most of the storylines. because communicating this stuff is a pain in the rear, i found an online-collaboration-flowchart-tool and he went quite ballistic with it. story flow looks like this currently: https://i.imgur.com/zPub8Pg.png and probably you'll yell "FSM" at me for 10 minutes now.
i'm figuring most of what i need to do is just translate this straight to an FSM structure and then throw scripts in for each node
@peak plover less than with binarizing. Binarizing does all that and turns stuff like class from 5 bytes into 1.
what i liked about the FSM i looked at so far is the fact that you can pretty much just read it fine in an editor
not sure i would want to write it manually but i think i could.
use the editor
it is ugly as shit ... but it at least works
unless you make it crash
which can happen
so never forget to save
well i took a quick look at it and read a tutorial, doesn't seem to be that bad.
after youre done, execFSM is all you need to do
it rly isnt
also it does not shares performance with spawn
it has that win98 nostalgia going for it.
but got its own window of execution time
so, you might even get a little bit of performance out of that
anyways
im offline for now
okay. if it goes horribly wrong, i'll blame you.
also it does not shares performance with spawn
It does share the 3ms scheduler time. So... Not that true.. Also.. It has the same performance as spawn.. Same performance as any other script.
i mean worst case what does FSM do. check on a condition on each frame?
thats like one trigger, or one event handler, right?
yeah... kinda..
i don't quite understand the thing with global vars. i mean there is this one biki entry about using compilefinal and i kind of? get it, but it seems everyone is making at least a subtile effort of avoiding them altogether.
avoiding global variables? wut?
If you need them then you do.
well i've abused objects as namespace cause commy told me, i use task states to syncronize client/server side scripts, etc.
it seems a messy approach to me since its hard to track that centrally
sigh. i suck at this.
Take a ๐ช and lean back a minute
then wipe all the cookie crumbs off and get a broom to keep the floor clean
i just realized don't have a perforated floor with an inbuild vaccum system. i felt like a savage for a second.
so an FSM can always only be in one state at a time
so if i want to have multiple things independently happen in parallel
i need some sort of master FSM that just checks conditions all the time and spawns sub-fsms i guess
somehow seems a bit silly to me
Yeah.. I don't think you can have parallel things in FSM.. But I never tried it
Maybe the CBA Statemachine can.. But probably also not..
i think fsm wouldn't really work out with multiple states.
it would add a whole new dimension of complexity
Btw. Scheduler time is 3ms normally. and 50ms(20 fps) in Loading screen. Might be worth to add that to BIKI. Whoever reworked the scheduled links on BIKI could do that.
isn't there someone to contact for wiki changes? or is there just a bunch of very busy devs who could edit the wiki but have no time to do it?
Everyone can edit wiki. Just like Wikipedia. By the community, for the community.
somehow i assumed the opposite by default.
Wiki registration is disabled to prevent spam. So you have to ask a Wiki Admin to create you an account
i don't feel competent enough to ask for that. but there is 2-3 pages which contain nothing more than the automatically created page from the functions config and i would have had 1-2 things to add to those when i found out how to properly use it i guess.
your choice. It's not that hard. And if you do something wrong somebody else will probably fix it ยฏ_(ใ)_/ยฏ
Ask me and you'll have one in a couple minutes ๐ Don't you have an account? Could swear I saw your name on there
Don't see why they would be a loop. The AI loop runs through the next waypoint in the list when planning it's next move
I can tell you all the things about waypoints if you really want to know... But.. That takes so much of my time
AI's have a ordered list of waypoints. The next one on the top. They don't go through all waypoints after that. They only check the current next one every time they check.
If everyone can read out waypoints then everyone probably has them in memory. Meaning.. a 100 waypoints probably take up a couple KB of memory and nothing more
Adding them creates network traffic.. But.. That is negligible if you compare it to the AI's position updates that are sent anyway
i was actually surprised that my function that builds a database of map info generates ~1.5mb for altis
(i save it to the server profile) With everything being in the gigabytes these days i just assume every var i save is like bytes or kilobytes at most, but i guess it adds up.
so one of my issues is testing features separately. obviously i don't want to test the whole mission all the time, but just the feature i'm currently working on. issue with that is preconditions. a script that makes some AI do something won't work if that AI isn't spawned yet, etc etc. hence why i said a centralized approach for state management would be nice. but i don't see how FSM would provide that functionality. basically for that convenience i would only see the option to actually write some complex code just to debug things quickly and efficiently, and chances are i'll just end up debugging my debugging code. which seems silly.
_agent = createAgent [typeOf player, position player, [], 0, "NONE"];
_agent setVehicleVarName "ai";
systemChat format ["%1", side ai]
Outputs "Side: 00000000023AFA50"
I'm curious if anyone has an explaination for " 00000000023AFA50"
It's the memory adress of that side.
Hex, binary or something else?
Does that look like binary ๐ฎ
Im asking you, your the expert
Its hex
binary can only be 0 and 1.
So it's obviously not binary.
decimal can only be 0-9. So it's obviously not decimal.. Only hex left
To be fair, hex can be seen as a binary shorthand 8)
Then again so can decimals
Also an explanation codewise, I don't think the variable ai exists, try changing this line
systemChat format ["%1", side ai]
to
systemChat format ["%1", side _agent];
Don't forget the extra "
what are you talking about? 8)
https://community.bistudio.com/wiki/setVehicleVarName
So if you want to refer to the actual object by its vehicleVarName, an extra step needed to assign the object to a variable of the same name.
@atomic epoch
You discovered the string version of the SIDE type nil.
It's nil. No valid side, because vehicleVarNames don't assign global variables like the editor does when writing something in the name field.
ai is undefined
side ai is undefined
everything is undefined.
Cool. Maybe someone will find it useful someday ๐ค
If you incorporate this behavior into your scripts, then you deserve that an update breaks it.
00000000023AFA50 is a memory address where <side null> or something like it should've been.
Even restarting Arma changes that adress. Cuz ASLR
ASLR?
Address space layout randomization
Yee, googled it.
Arma is on a random Address (almost) everytime you start it
Meaning the memory offset is also different everytime.
00000000023AFA50 could be an internal address pointing to the systems address.
It is an internal address. Pointing to where sideNull should be. Like you said
Not sideNull, <side null> as in nil not null
Anyway to get a Marker's grid ref?
Or any way to accurately change the results from a getPos call into the gridref displayed on the map?
@kindred lichen getMarkerPos
That gives the world address, not the grid reff
Like, it gives distance from origin, not the 6 or whatever digit grid ref you'd see on a GPS or the map.
Trying to make it a little harder for players than just having a marker apear on the map. I'm trying to send players grid refs over sideChat.
@kindred lichen https://community.bistudio.com/wiki/mapGridPosition
There you go, my bad. Did not know what you meant sorry
thanks man
I just did a Intercept performance test with a real world example
Intercept code:
game_value redirectWrapNular() { //Intercept_loopTest
types::auto_array<types::game_value> output;
for (auto& unit : sqf::all_units()) {
output.push_back(reinterpret_cast<game_data_object*>(unit.data.getRef())->get_position_matrix()._position);
}
return std::move(output);
}
game_value redirectWrapNularScript() {//Intercept_loopTestScript
types::auto_array<types::game_value> output;
for (auto& unit : sqf::all_units()) {
output.push_back(sqf::get_pos(unit));
}
return std::move(output);
}
Results:
Function, time (diag_codePerformance), cycles
count allUnits -> 232
allUnits apply {getPosWorld _x}; 0.480077 ms 2083/10000
allUnits apply {getPos _x}; 0.619579 ms 1614/10000
Intercept_loopTest 0.229674 ms 4354/10000
Intercept_loopTestScript 0.398248 ms 2511/10000
Intercept_loopTest can also be multithreaded. So that could theoretically be 8x faster with a 8 core CPU.
I still don't get why diag_codePerformance doesn't just run the full 10000 cycles for all tests
anyway, neat stuff ๐
I did expect more from the loopTest variant actually.. But.. Oh well. I won't try multithreading that because that would take too much time now. And it's not really worth it for 200 units
Still impressive
I still don't get why diag_codePerformance doesn't just run the full 10000 cycles for all tests
So you don't have to wait while your machine freezes for 2 minutes?!
well then just lower the number of cycles ๐
i wonder if it internally checks the mean and sigma deviation values
and just stops when its 95% accurate enough
probably not
No. I think it has a time limit it will run.. Like.. a couple seconds
It stops when the time is up.
seems to be ~1s
It doesn't mention a standard deviation, so it probably doesn't record it.
Just the average time spend per iteration.
Ideally 10k if they're short enough.
anyone know of a script that will simulate a riot/uprising? thinking muslim country outside an embassy throwing rocks kinda style?
i bet alive has it but soudns liek you are looking for a ready made independent plug and play script
well, havent been able to find anything in there really. But yes, a done script would be awesome!
you should try make it yourself. more fun anyways. not sure if throwable stones are still in the game but should be possible to achieve relatively easy, if you ask the right questions here
There are throwable stones still in
Yeah, they are available as a throwable
muslim countryside
Going after the religious, huh?
@peak plover well, you understood what i meant then, didnt ya ๐
burkal. do you already have civs spawning?
but, on the doing it myself, i would have no idea how to. only do small stuff in the init lines. beside from that im retarded