#arma3_scripting
1 messages ยท Page 233 of 1
the object was created on each client ...
for sure i wont get the variable then on my local instance of that object :3
oh, that makes sense
why is it so hard to make say global.. i mean its very easy using CBA's globalsay function, otherwise it doesnt seem to work
i wonder if it can be done with remoteexec or BIS_fnc_MP i just dont have a clue on how to call it the right way
"hello" remoteExec ["hint"];```
yeah, i have been struggling, but there is one more vairable in say, and i dont know where in the array to put it :S
[_unit, _params] remoteExec ["say"];
ah, gonna try that
The bible of Arma 3: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
yh ofcourse im looking trough that aswell, but sometimes the exmaples doesnt match up with my ideas ๐
Think outside the examples.
RE is pretty simle for binary commands
_whateverIsOnLeftSide command _whateverIsOnRightSide
[_whateverIsOnLeftSide, _whateverIsOnRightSide] remoteExec ["command"]
Fix PBO for the 3den camera being stuck bug with CBA + R3F_ARMES:
http://www.mediafire.com/download/2os5vm16534o039/cba_r3f_3den_fix.pbo
The file has to be moved here: Arma 3\@R3F_ARMES\Addons\CBA_R3F_3den_fix.pbo
i seem cant get #lighpoint to work on a server.. on local it works flawless, it seems though that i cant get it globally should i use remoteexec on setlightbrightness and such?
nvm, solved it with remotexec
any idea how I could sort multiple subarrays without having to reverse them, sort them, and then reverse them again ?
I want to avoid this >
{
_buildingPos = _x buildingPos -1;
{
reverse _x;
} foreach _buildingPos;
_buildingPos sort false;
{
reverse _x;
} foreach _buildingPos;
_buildingsIndexes pushback _buildingPos;
} foreach _buildings;
(sorting the positions by height)
sort?
nah, some building positions have different x and y positions.
around 8 posts above ?
sort by "lowth" and you don't have to reverse it :kappa:
i don't see anything but your post about sort
I wish I could commy :^)
so.. when you create local variables, and make them private, can you then use the same script to create more isolated instances of the same variables. cuz im trying to create instances of lightpoints, but if i create more than one it only affect the last one, and the first is there but forgotten.. i am using global vars atm, so thats why i wonder about the nature of the local namespace :)
privatizing push the variable into the innermost scopes, doesn't work the other way.
you can have one global variable per namespace, and one local variable per scope, unless you private it
so if i for example create a #lightpoint object called _light createvehicle and i want to create another one, i guess i need to rename the variable for each instance? for an example beacons on a building or lightbars on cars
if i want to be able to either deletevehicle or set brightness or whatever
basically what im trying to figure out is a way to generate lightpoints, and still maintain the control of the variables on each instance.
and thats why i wonder how the local namespace really works, ive read on biki, but i couldn't really figure out if it can use the same variables in different instances of the script
yes if you private the var in your script
ok, thanks! :)
Hi guys ! I've got a problem and maybe you can help me. I dev an Altis-Life server but when people connect them on it, the are seagulls. Any ideas ?
check if the group limit for their side hasn't been reached
i tried with something like " {if !(count units group > 0) then {deleteGroup _x}} foreach allGroups".. Seems to work.
Does anyone know the command to modify the "AccFPS" parameter ? Like in the CAMERA, you can define the "slow-motion" thingy, is there a scripting command for this ? I have a mission scene in my game background, and I wanted to slow down the time a bit. // SOLVED: setAccTime 0.1
im having trouble to attach lights to my car, when i create the lightpoint and attach it, it doesnt seem to attach, doesnt matter if i use lightattachobject or attachTo..
[_light,_auto,[2,3,-1]] remoteExec ["attachTo"];
or
[_light,_auto,[2,3,-1]] remoteExec ["LightAttachObject"];
the object is just spawned in place, and the script runs as it supposed to, just that it doesnt attach to the car.. im talking about lightbars
i guess it could be my remoteexec structure thats wrong though.. ill try to rebuild it without the structure to see if it even works then ๐
ok, so apparently its something wrong with my structure as the regular command did work
hm maybe [_Light,[_auto,[0,3,-0.5]] remoteExec ["LightAttachObject"]; will try that ๐
got it!
I'm trying to understand if there is a way to force drawIcon3D with "onEachFrame" to update position smoother?
Here is an example:
_on_each_frame =
{
_pos = getpos Unit1;
_colorGreen = [0.5,1,0,1];
drawIcon3D ["", _colorGreen, _pos, 0, 0, 0, "UNIT", true, 0.03, "PuristaLight"];
};
["Mrk", "onEachFrame", _on_each_frame, nil] call BIS_fnc_addStackedEventHandler;
When Unit1 runs, marker update rate is about 10 FPS when overal FPS is 60. How to make it smoother?
Use getposVisual instead of getpos.
Will it help to improve update speed?
Yeah I tested this yesterday
Thanks!
It had to do with the interpolation system bohemia introduced in arma2
The rendering is interpolated ahead of the simulation or something like that. there's an ancient blog about it on bohemia blogs page ;)
Wow! Works great. Thanks!
anyone familiar with exile and infistar?. i tried my scripts and functions on a local server and everything worked fine, but on our dedicated server we have infistar and the server seems to silently block all remoteexec commands :S, they are not even showing up in any logfile.. i guess there is som remoteexec config for infistar somewhere?
Just look for config files or headers. Just search for Cfgremoteexec
is it cfgremoteexec.hpp?
Likely, yes. Did you fix it?
Hi, Guys! I want to attach to all wheeled vehicles on server script that controls veh's state and position on road. How to implement looping for each instance of script without or less lags? I prefer to run independent spawn for each veh. Is it correct?
how many vehicles are we talking about?
And what is best way to implement global loops in Arma, i.e. control all states of mission. while(true) or waituntil is the bad way i suppose.
10-20 maybe
well if you want to go for state control you could try putting together a FSM
i think that many stuff I can solve with triggers, but I want to know right way to implement some global loop like permanent check health for all bots of becti mission
internet is lack of scripting architecture for Arma. Many stuff how to SQF, but no information how to construct correct MP mission or mission architecture
is it possible to make MVC pattern in Arma?
what does that have to do with this channel
Noone knows
I've got a list of arrays in xyz format, and I want to compare all of them to another and return which is the closest, how can I accomplish this? http://pastebin.com/raw/Q8KenQki
If only this was C# ;D
updated the code
so did u fix it?
what is colorArr?
colorlist is an array with both arrays and strings?
wait
there are many ways to go about this really
color is rgb value
Yes.
which can also be used with distance
yes
so theres your answer
nice
the name of the variable is completely irrelevent
Eagleblade should stop relying on this channel to script his things
He's been doing this since the skype chat started
blade or dude?
eagledude~
right
seriously, whats your deal?
well i was cooking up this; _arraySortedFromClosestToFurthest = [_colorList,[_colorArr],{_input0 distance (_x select 0)},"ASCEND"] call BIS_fnc_sortBy; - I only recently found this function and i've used it a couple of times. Like I said, there are many ways to sort arrays...this BIS functino is one of them
don't expect it to work outta the box. I obviously didn't test it nor spent much time on it ๐
I used it for a couple of things in my gamemode so yeah it works proper. Not sure if it'll work with your multi-datatyped-array though, so yeah gl
so, looking to start getting into scripting in arma.. where do I start? have previous experience in easy languages like php and vb.net, just unsure what sorta thing I should be starting on?
this should be the ticket sanchez, thanks
no mate, I'm keen to learn though;)
@agile pumice good to hear - next time http://lmgtfy.com/?q=sort+array+by+distance+arma+3 btw ๐
I understand logic well, guess it's just syntax that I should be learning?
sort of wondering what sort of project to start off with
yeah syntax will be quite different from vb.net & php ofcourse
hmm
have you made missions w/ the editor before?
not even tried to
I mean I've seen script code
and it doesn't look awfully difficult
but ofcourse I couldn't do it myself by any means
I'd need to work up
well the editor is like a graphical UI that does 80% of the (very common) scripting for you. You can make missions without any sqf knowledge basically... I started out making missions that way. Only when I found out that certain things were only possible by actually scripting them, did I start learning how to script these specific things.
Like - if a truck driving by is shot - make all crew immediately disembark and engage the enemy was one of my first scripts ๐
So I suggest that you find an use for your scripting first.
my google search lead me to spending 10 mins researching k-nearest neighbor algorithm before posting here btw ๐
yeah...you need a goal and then learn how to do it and as you learn more, do it better, more efficient etc
Yeah. As a beginning mission maker - scripts are to assist your editor-created missions.
Ofcourse, you can use scripts in mods too (so no need for mission making) - but that's very hard to start out with if you have no prior experience on that field
ah
alright
I'll give it a go tonight when I'm home then I guess
making a mission
Yeah. Doesn't have to be hard, nor long (o.o). My first mission took max 15 mins. ๐
alright cheers mate
Goodluck
@indigo oracle One more thing. The community wiki and the bohemia forums(combined w/ Google) are your best friends once you start scripting.
Alright
and say I'm storing data
what's the best type of database or is it preference
Big plans eh. ๐
Afaik there are many different database extensions/mods out there. I think that's a preference thing but not sure. Inexperienced on that field I'm afraid.
I wanna realistically make a mission that is going to have to store data, so why not find out how now:p
cheers @agile pumice said what I wanted to hear haha
you're welcome
np
Hey! Could anyone point me in the direction of how to get the armor and pass-through values of vests and uniforms? I've found spreadsheets with these properties for the default Arma gear, but I have not found it for gear from RHS etc. so I would like to be able to extract this information myself.
What's the fastest way these days to determine whether an object is a vehicle or soldier?
_source isKindOf "CaManBase"
``` or anythign else?
_isSoilder = _object isKindOf "Man";
Actually, while I'm asking here anyway: Is there an easy way to determine who actually killed someone, if the killer object is a vehicle? Killed EH returns the killer vehicle, but it would be nice to establish whether it was the gunner or the commander that shot someone.
AI Log update: https://forums.bistudio.com/topic/150500-development-branch-captains-ai-log/page-5#entry2989127
Page 5 of 5 - Development Branch Captains AI Log - posted in ARMA 3 - DEVELOPMENT BRANCH: 14-09-2015EXE rev. 132389 (game)DATAFixed: B_127x108_Ball audible/visibleFireAll anti-material rifles should now be heard and seen by the AI on a similar distance.ENGINEFixed: AI does not switch to combat mode when they see an entity killed by script(Also applies to suicides and similar) Solves: http://feedback.arma...ew.php?id=2479215-09-2015EXE rev. 132404 (game)Fixed: AI co-pilots hiding in cockpit...
_isSoilder = _object isKindOf "Man";
That is not completely correct
Animals like snakes, fish and rabbits are "kind of Man"
class Animal: Man {
correct would be:
_object isKindOf "CAManBase";
Yeah that's what i had already, just wondering if there was another way, I prefer not to use config in case someone fucks up inheritance, but I guess i don't have a choice
You heard it here first arma confirmed:
Animal is a type of Man
I forgot that logic excapes arma ๐
In theory someone could totally ignore the established inheritance.
CBA_fnc_isPerson = {
params [["_unit", "", [objNull, ""]]];
if (_unit isEqualType objNull) then {
_unit = typeOf _unit;
};
private _config = configFile >> "CfgVehicles" >> _unit;
isClass _config && {getNumber (_config >> "isMan") == 1}
};
Sounds like some devilish stuff to me.
^ this is the only way to firgure it out 100%
Basically i just want to figure out which player actually killed someone as opposed to the vehicle
params ["_killer"];
// -- Allows resetting the saved killers on respawn and similar -- //
if (isNull _killer) exitWith { [objNull] };
// -- If soldier save the soldier -- //
if (_killer isKindOf "CaManBase") exitWith { [_killer] };
var(_killerUnits) = [];
// -- If not soldier check crew of source -- //
{
_x params ["_unit", "_role"];
if (toLower _role in ["commander", "gunner", "turret", "driver"]) then {
_killerUnits pushBack _unit;
};
} forEach (fullCrew _killer); // Note: crew of a person returns [person].
_killerUnits;
I think the killed eh returns unreliable stuff when the units are inside vehicles
It returns the vehicle, not the units yea
Sometimes it reports the drivers
I think the same logic as with effectiveCommander is used
And if you die from lets say by assistance of gravity it also returns null as a killer
or any explosion for that matter
Also when crashing it reports different killers on different machines
Mortars are null half the time (Because they trigger like 50 times handleDamage EH ๐ )
i think any explosion does
Anyway I guess I'll put reliable kill reporting out of my head and keep what I have now which seems good enough for what's possible
This has always been an issue.
Engine is to limited / to ambiguous with what it reports
Also kind of prevents me from doing automated teamkill kicking...get shot down in a helicopter with 5 people? Pilot gets kicked from server ๐
This is stupid anyway. Probably better of implementing a vote kick sytem
Doesn't that already exist? I can remember something like that
Maybe different game... That would be ideal though.
I'll probably do that eventually
There is vote kick within vanilla arma, just like there is vote mission
use that?
remoteexec is not working, doesnt throw anything into the RPT, the functions and commands are whitelisted in the cfgremoteexec class.. what is going on!? :P it does work on a listen server , and also all the clients get the commands as supposed. but on our dedi box. its just... NOTHING, very weird! anyone have a clue?
the thing that bothers me most is the lack of logs..
gah.. so how would i allow some remoteexec commands without risking the security? :S
dunno, they might've fixed it in the meantime, who knows.
thats borked as you said
ok, good to know.. i guess i have to continue digging! ^^
ok, well im starting to think there is something very special with exile, as even if i whitelist the functions and commands where exile has its whitelisted, which is in cfgremoteexec.hpp which is included in description.ext instead. i still can get any single remoteexec command to work from the admin console ingame. and the functions itself are dead, and logs are silent, its so weird and im out of clues.. next thing ill try is to rework the functions and scripts so they are adapted to be run from the missionfile instead of the mod itself. because when i dig in the exile functions, they use remoteexec, so the command itself should be allowed, even if they made everything kinda cryptic with all functions. but atleast from clientside nothing happens when you try to run a remoteexeec cmd, and iam an high admin so it should work!
Can I somehow get "BIS_fnc_ambientAnim" to work in Multiplayer? Atm it doesn't do anything in MP!
@spring stone use remoteExec
Does anyone know how can i attach in an universal way a vehicle to another vehicle?(to the rear)
I tried tha:
[this,"SIT_AT_TABLE"] remoteExec ["bis_fnc_ambientanim",0];
But it did not work. I'm still not familiar with remoteexec
I test it on the MP editor :3 (on the SP Editor it works, on the MP one not) Will try...what does the 2 actualy do?
Execute it only on server
Ahh okay
Nono...have not tried 2 yet. Will do it when my mission decides to load! ^^
Okay, 2 doesn't seem to work. -2 is next then :3
oKay, doesn't work either. May need to test it on a real server then @.@
Greetings, is it possible to remove a specific item from cargo, or only with clearing the whole cargo and adding the new inventory back?
()
What is the script command for that? Magazine with unique ID? That's kind of new for me.
Commy was talking about it a while ago, there might not be a variant for vehicle cargo detailed magazines
But cannot do anything with the IDs whatsoever . Also tried removing items from cargo, none of the commands work. What's the command?
I mean all topics on this I only find clearXYcargo commands, not remove one specific classname ๐
yeah, so it's not possible. Too bad ๐ฆ
anyways, thanks for the help
@spring stone lol sad it didn't do the trick,going to try it tomorrow,in the meanwhile please check your logs for anything strange and use remoteExecCall instead
i have been struggling with my remoteexec call for days now, and i cant get it to work! i have set the cfgremoteexec accordingly, tried to run simple remotexec function on the server, and it doesnt work. and no logs, im really clueless! :S
maybe its something in the infistar admin console. thats prevents remoteexec or something, but what other console could i use to test commands on a debugbasis?
or is it so that infact, remoteexec havent yet been added since they removed it temporarily?
actually got it to work.. now im just curious about how the postinit functions work.. if i have a function in postinit and the function itself loads from a addon.. when the client triggers the eventhandler will it execute on the server or the clientmachine?
this is just a snippet of the function fomr the top
if (hasInterface) then
{
vehicle player AddEventHandler ["Fired",
{
if (!isNull cursorObject && currentWeapon vehicle player == "Immobilizer" && vehicle player distance cursorObject < 200) then {
IBZ_targetHit = True;
hint 'Keep on target!';
player say "immobilizer_locking";
IBZ_target = typeof cursorobject;
the confirmed working version, atleast locally is using the hasinterface.. but it doesnt work on our dedicated box.. sp that why im wondering, from where the execution happens
the script postinit fine.. but it seems that it get stuck on the eventhandler somehow or that hasinterface part
here's a video of it working locally
https://drive.google.com/file/d/0B7ATkkHFYIX7N1RzSlZ1Nml0aFE/view?usp=sharing
now imagine it on a dedibox.. nothing happens when you "fire"
so i think its something with the fist statements, either something with the eventhandler not being applied mp, or the first hasInterface statement needs to be isDedicated or something
postinit should run everywhere. the event handler should fire on the client where you added it.
so it sounds like you said, for some reason the event handler isn't being added.
maybe 'vehicle player' is changing at some point?
and it happens before that script in single player and after that script in multiplayer
Is this designed for use in a vehicle? If not you just need player
if that doesn't work i'd probably try something like waitUntil {player == player}; to make sure it's being called after the player exists.
ah ok.. yeah its supposed to be ran in a vehicle, and only in a vehicle, if you look at the video i posted above you will see th efull functionality ๐ thanks though!
How exactly configProperties works? For example when I pull all classes off weapon's WeaponSlotsInfo it returns following list:
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/rifleSAMROpticrail
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/MuzzleSlot
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/asdg_OpticRail_RU556
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/asdg_FrontSideRail_RU556
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/asdg_MuzzleSlot_556_RU556
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/CowsSlot
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/PointerSlot
But if I do it with count and select it only returns single children config:
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/rifleSAMROpticrail
If I take all classes from WeaponSlotsInfo and each of inherited WeaponSlotsInfo I get yet another list:
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/rifleSAMROpticrail
config.bin/CfgWeapons/hlc_rifle_RU556/WeaponSlotsInfo/MuzzleSlot
config.bin/CfgWeapons/hlc_rifle_RU556/WeaponSlotsInfo/asdg_OpticRail_RU556
config.bin/CfgWeapons/hlc_rifle_RU556/WeaponSlotsInfo/asdg_FrontSideRail_RU556
config.bin/CfgWeapons/hlc_rifle_RU556/WeaponSlotsInfo/asdg_MuzzleSlot_556_RU556
config.bin/CfgWeapons/hlc_ar15_base/WeaponSlotsInfo/MuzzleSlot
config.bin/CfgWeapons/hlc_ar15_base/WeaponSlotsInfo/CowsSlot
config.bin/CfgWeapons/hlc_ar15_base/WeaponSlotsInfo/PointerSlot
config.bin/CfgWeapons/Rifle/WeaponSlotsInfo/MuzzleSlot
config.bin/CfgWeapons/Rifle/WeaponSlotsInfo/CowsSlot
config.bin/CfgWeapons/Rifle/WeaponSlotsInfo/PointerSlot
Anybody has idea what exactly configProperties does and if its logic can be replicated using other commands?
Looks like it just dumps whatever is defined under the class
If I look into weapon config that I'm testing with it only has:
class WeaponSlotsInfo : WeaponSlotsInfo {
mass = 90;
class rifleSAMROpticrail : asdg_OpticRail1913_long {};
};
Which is exactly what I get when I use select and count on the config:
config.bin/CfgWeapons/hlc_rifle_SAMR/WeaponSlotsInfo/rifleSAMROpticrail
How configProperties gets other subclasses then?
I assume select and count that work with configs do not take inherited classes into account then?
Dunno, you might want to do some testing to find out.
I just did and above list is result, it seems that configProperties does things differently from select and count
Scripts that I used in case anyone is interested
configProperties:
_br = toString [13,10];
_str = "";
_cfg = configFile >> "CfgWeapons" >> (currentWeapon player) >> "WeaponSlotsInfo";
{
_str = _str + str _x + _br;
} forEach (configProperties [_cfg, "isClass _x"]);
copyToClipboard _str; _str
Iterating through config with select and count:
_br = toString [13,10];
_str = "";
_cfg = configFile >> "CfgWeapons" >> (currentWeapon player) >> "WeaponSlotsInfo";
for "_i" from 0 to count _cfg - 1 do {
if(isClass(_cfg select _i)) then {
_str = _str + str(_cfg select _i) + _br;
};
};
copyToClipboard _str; _str
Iterating through config and each parent class of it with select and count:
_br = toString [13,10];
_str = "";
_cfg = configFile >> "CfgWeapons" >> (currentWeapon player) >> "WeaponSlotsInfo";
while{isClass _cfg} do {
for "_i" from 0 to count(_cfg) - 1 do {
if(isClass(_cfg select _i)) then {
_str = _str + str(_cfg select _i) + _br;
};
};
_cfg = inheritsFrom _cfg;
};
copyToClipboard _str; _str
You'll get same results for stock A3 weapons since these mostly share attachments, problem is apparent with addon weapons like HLC or RHS which add more weapon slots classes and use stock A3 slots as well.
If I iterate through parent classes of the weapon itself, not WeaponSlotsInfo and get WeaponSlotsInfo off each I get even bigger list as a result
I just want to know what exactly configProperties does
Well I guess I figured it out, configProperties checks through inheritance but returns found subclasses for base class instead of associated parent classes
And in case anybody bothered to look through my wall of text here is pretty much what configProperties does implemented with select, count:
_basecfg = configFile >> "CfgWeapons" >> (currentWeapon player) >> "WeaponSlotsInfo";
_cfg = _basecfg;
_result = [];
while{isClass _cfg} do {
for "_i" from 0 to count(_cfg) - 1 do {
_class = (_basecfg >> configName(_cfg select _i));
if(isClass _class) then {
if!(_class in _result) then {
_result pushBack _class;
};
};
};
_cfg = inheritsFrom _cfg;
};
_br = toString [13,10];
_str = "";
{
_str = _str + str _x + _br;
} forEach _result;
copyToClipboard _str; _str
@jovial nebula remoteExecCall doesn't work either. I'd love to check my Log (and will do it later) but its cluttered with information (Big mission, many mods.... @.@)
1.56.hotfix out: https://dev.arma3.com/post/spotrep-00053
tools update too https://dev.arma3.com/post/techrep-00027
@spring stone going to test it right now e.e
Very nice... thank you >.<
I need it even for my mission
Yeah, stupid immersion...xD
Hey does anybody know what seat a co-pilot appears in when using the GetIn Event Handler?
Nevermind, turns out that it is a gunner seat
In the Ghost Hawk, at least
yeah its gunner :)
Anyone know how to make the VR obstacle blocks dark? They give off ambient light and have orange edges and I'd like to have a pitch black VR map
i think you have to set their materials to something that doesn't have any self illuminating values
setObjectMaterial or whatever the command is
Q: what would be a simple script to check what addons someone is running? ( _banana = civ_1 activatedAddons; hint format ["%1",_banana];
There's a script on the Wiki page for activatedAddons to do it.
How does one properly use paths for ctrlSetText? I'm trying to use someting within my mission now and for some reason I can't get it too work whatsoever.
Even putting it in the root of the mission gives no luck. Using ctrlSetText with images from A3 files works fine.
in a mission, it should be "folder_in_your_mission\pic_ca.paa"
or just "pic_ca.paa" if it's in the root
Added inline SQF to Intercept tonight.
You can now write SQF in the middle of your C++ code (if you really wanted to).
void __cdecl intercept::on_frame() {
__SQF(
_str = "";
for "_i" from 1 to 3 do {
_str = _str + _this;
};
player sideChat format["Rick says: %1", _str];
).capture("WUBA LUBA DUB DUB!");
}
Cool stuff
@grizzled cliff do you have a discord server for intercept?
@pliant stream I think there was a link posted, some days (weeks?) ago.
Is there a way to properly determine how many magazines of a certain type are in a uniform container (Vest, uniform or backpack?). There is vestMagazines and so, but it doesn't return the actual class of it.
can anyone tell me how i can add an " \ " in the end of multiple marked rows at the same time?
in notepad ++
in extended character recognition you can replace \n with \\\n
@austere granite
Example: (gives the _unit a Magazine, if MagazineCount is below 2)
_unit addEventHandler
["Take",
{
_player = _this select 0;
_Mag = _this select 2;
if ( ({_i == _Mag} count(magazines _player)) < 2 ) then { _player addMagazine _Mag; };
}
];```
Should give you a hint in the right direction
Unfortunately it doesn't. Magazines is not container specific ๐
I'll probably end up having to loop through magazines, creating a list of their display names, then splitting up the returns of vestItems and comparing them to the magazine name list or something like that.
๐
nice. ๐
Except.... that it's not actually correct
It doesn't return the names ๐
I'll just split names up and check for matching display names probably.
that doesn't sound like a good idea
hint str getMagazineCargo uniformContainer player; ...
It's for a gear export script, won't be used within the mission other than dev purposes. Not too worried about performance related things
Fucking A
Thans ๐
https://community.bistudio.com/wiki/All_Arma_Commands_Pages
Again: Save that Page
I got it
How can I add a Backpack with a Toolkit in it to a Vehicle Cargo?
I have this:
if (typeof _x == "IP_B_AssaultPack_EFAltis") then {
_x addItemCargoGlobal ["Toolkit",1];
} forEach (everyBackpack this);```
But I always get:
```Init: Local Variable in global space```
I think I know its due to the _x but I have no clue how to do it on another way >.<
Yeah, makes sense. There does my lack of scripting skill comes to light >.<
I advice against using the activatedAddons. Some BI modules use activateAddons and ignore modded addons, thereby "turning them off" for the command.
Actual check if addon is present:
private _isACE = isClass (configFile >> "CfgPatches" >> "ACE_common");
Has anyone established a 'format' for aar data? I saw a Shacktac video and the UO leaflet js test but I wasn't sure if the community had coalesced around a format that was interchangeable?
Ohhh appearantly the only thing missing was a { }
{if (typeof _x == "IP_B_AssaultPack_EFAltis") then {
_x addItemCargoGlobal ["Toolkit",1];}
} forEach (everyBackpack this);```
Thanks anyway
anyone here use extdb2 whitelisting within your database?
@cold quartz http://replay.armaworld.de my work
@deft zealot The map looks awesome
I'm the athenamod (athenamod.com) dev
I'm working on a server side mod/logger and I wasn't sure if there was an agreed upon format that others were using for their AAR
Athena to this point has mostly been client side/real time
someone know a good paradrop script where u can go to an object and then paradrop the 1 i had did work but did mess up everything else on the map that i am using is losis armory ๐ anyone ?
the paradrop script i had was ATM airdrop i think it was
@cold quartz ?
Na, sorry. I don't really get into mission design anymore.
ah ok
Yea, all of my references would be years old at this point ๐ฆ
i need some help with it bcs losis has some tons of scripts and shit in INIT file + Description.EXT ๐ฎ
if i had my pc running maybe u could help me remove the TFR`s radios on spawn that also messes up all the stuff idk where in the file to put it ๐ญ it works whenever i am on other missions like ya @cold quartz
tfar has some variables you can set. Check out their wiki.
ya ik but it messes with all other codes but idk where to put it ๐ฆ
@jolly bridge in the userconfig folder, you have some variables to tweak
for TFR ? ya but its for my mission or not my mission but ya ๐
In userconfig, you have the file radio_settings.hpp
There is that one variable that might interest you: TF_give_personal_radio_to_regular_soldier = 0;
Same for long range radios, squad leaders, etc.
ah but what about my friends and stuff ?
Same
Oh
You can set this server side
Yeah, my bad, these are server side values
You change this in the userconfig of your server, and you're good to go
ya but its not a server its that i am hosting missions ๐
if (server == _playerPC) then {change _userConfigValues;};
no, just change it on your own userconfig, that's it
ah ok
As your PC is running the missions, it hosts the missions. So the game consider your PC as the remote server for your friends
ah ok i understand
Try that and see if it works
btw u know any working paradrop script that u got to a pole and then click paradrop and the map comes up and u click and u drop ๐ ? ATM airdrop is out of date http://www.armaholic.com/page.php?id=21307 idk how it dosent work :;( trying to add it to NMD sandbox mission but nop my friend told me this: Sometimes it works perfectly and you don't understand why, most of the time it doesn't work at all.
@prime valve like this ? tf_no_auto_long_range_radio = 1;
Yes, this value will not give a long range radio to squad leaders
It's like answering yes or no to questions
or any other right ?
For others, you have the two next values
TF_give_personal_radio_to_regular_soldier = 0;
TF_give_microdagr_to_soldier = 0;
put that in
@prime valve this is whats it here tf_no_auto_long_range_radio = 1;
TF_give_personal_radio_to_regular_soldier = 0;
TF_give_microdagr_to_soldier = 1;
tf_same_sw_frequencies_for_side = 0;
tf_same_lr_frequencies_for_side = 0;
tf_same_dd_frequencies_for_side = 0;
microdagr is used for the walkie talkie we gonna use :;P
You could just arsenal the radio you like. Or yes, leave it like that
ok
sheria: you can add those settings to your mission's init script too
if you want it to be mission-specific rather than server-wide
@vapid frigate ya thats what i wanted to have it to my init file
but i fixed it mr @prime valve did help me :;)
Glad to help folks !
๐ @prime valve
Can someone help me: I need a Trigger Condition.
Trigger should be triggerend when a player is inside and the player is not in a height above 2 Meter.
singleplayer? something like this && (((getPosATL player) select 2) < 2)
Multiplayer
something like {isPlayer _x && (((getPosATL _x) select 2) < 2)} count thisList > 0
okay, I'll try...thanks
Hey, me and a collegue are working on a 100% handmade survival gamemode. Any scripter help would be appreciated ! Contact me via PM if you want more infos about this (to not spam the channel)
the param command is what select should've been in the first place.
hopefully they'll fix the -1 index bug with it eventually
on param... can you actually make it so it only checks the default value if there is actually no param given?
[1,2] param [0, ([blabla] call FRL_fnc_getDefaultValue)];
_a = []; _a param [0, "default"];
?
I mean... why is getDefaultValue run there?
IDK
You can do crazy shit with it though:
magazinesDetail _unit select {_x find _displayName == 0} apply {_x = _x splitString "[:]"; _x select (count _x - 1)};
oh wrong one. cool too though
... that's apply ๐
fullCrew vehicle _unit select {(_x select 0) isEqualTo _unit} param [0, [nil, ""]] select 1
the more commands SQF gets the more cryptic it becomes
test passed
i do like the select true ๐
Yeah, but it's the reverse order of then else, which always throws me off
That can help to keep shit pretty readable in some cases
... no shit about that
I started replacing a lot of if then returns and was so confused why everything was constantly fucking up
Is there a way to drag and drop from a treeview to another treeview?
Or do I need to come up with another solution?
https://community.bistudio.com/wiki/inArea
This command also supports hexagon area which can be created from ellipse when both a and b are negative. Hexagon ellipses are also supported by both marker creation and drawEllipse
Oh god. It's like grade school geometry class all over again.
why didn't they just give us an array of positions so we could test any polygon
oh wait
they have an inPolygon too
They do. Quite nice me thinks
Just gotta test how fast it is
Gotta make a simple Eden script to draw polygons on the map
Do it like the old cba ways, place invisible helipads at each positions supposed to be a point ๐
hmpf... why is BoundingBox so fkd up?
Never had much use for it, so I'm curious: how is it f*ucked up?
Both are shitty
iirc it also takes the RoadwayLOD in, wich is... hmm.. lets call it "less optimal"
I have yet another trigger related question: I'd like a trigger that triggers when the rating of a player is lower then one. If it triggers the rating should be resetted to 1000.
I have never worked with the rating, so I'm not sure how I'd accomplish that :3 (It would be great if one could turn of the rating completely @.@)
Could you handle it by adding a HandleRating event handler to players?
Mhhh sounds good. From what I can read, "HandleRating" we look if the engine will give rating to a unit. If rating is a number (e.g. 1000) then the "HandleRating" will take over and gives the rating defined by the Handler to the unit instead (e.g. in my case 0 would be good)...am I right?
Anyone know if its possible to get a script to read part of a player placed marker on the map. IE if marker name contains LZ create a waypoint for ai group on that marker
This should provide insight on dealing with player made markers http://killzonekid.com/arma-scripting-tutorials-whos-placingdeleting-markers/
Thanks
hey guys, does anyone know why there is an error in the position _configPath #select _i line 8 ? _http://pastebin.com/31p5dp3K
(configfile >> "CfgWorlds" >> worldName >> "Names") select 0 works strangly
(there might be a few more errors but the one of interest is the discribed one)
i assume its because of the domain of your for loop
assume an array with 6 elements
count _array will be 6
_array select 6 will be selecting the 7th element
since arrays are zero-indexed
damn ... is it because i've forgot the -1...
... jup this was the error....
thx ๐
you should consider using configProperties though
Hmm the command sounds interesting. Didn't know it existed :) I will give it a try . A few lines less
Hey I was wondering if i could speak to someone with experience in Arma 3 life server scripting?
altis life forum?!
no arma 3 life
...
Another copy cat? :s
Arma 3 Life is Altis Life @lavish marsh
I would suggest going to altisliferpg.com
You probably not gonna find any help here for specific scripting for that genre.
As long as theres specific questions i dont see why they wouldnt belong here
Just please guys do not re-open that cursed debate again
Mainly because their bad name in not respecting licenses.
I've got a question about remoteexec, I'm trying to call a script on who ever the vehicle is local to. Would this be the correct format?
"crash.sqf" remoteExec ["execVM", Heli];
pretty sure you want to do this: _client = owner Heli; "crash.sqf" remoteExec ["execVM", _client];
if you are running that code on the server
@jaunty drift You don't need to check for owner if the target is an object. The function will only be executed where the object is local. Besides, the owner command only works on Server afaik. ๐
@normal beacon So you should be fine. Although I thought it was BIS_fnc_execVM instead of execVM - but things may've changed and I didn't pay attention...or it always worked ๐
Also if I'm not mistaken - since execVM essentially spawns code and remoteExec also spawns code - I see no need for a double spawn. So use remoteExecCall ( https://community.bistudio.com/wiki/remoteExecCall ) instead. Identical parameters fyi
+runs in unscheduled envirobla
ahhh... so instead of excevm it would remoteExec
nul = [Heliname] remoteExecCall "crash.sqf";
?? Why changing the example
"" [params1, params2] remoteExecCall ["command", targets, jip]; ""
Sorry, I'm in way over my head here, super novice at scripting
Then just read, what was written before
"crash.sqf" remoteExec ["bis_fnc_execVM", _client];```
Thanks
How do you make those code blocks in Discord ?
3x ` code 3x
fk this^^
3x
Does anybody know of a way to manually close the menu from the menuPosition respawn template? I'd like to close the menu when the player is out of respawn tickets and put him into spectate mode.
hmm... to do a constant check (max. 1-2min)
OnEachFrame StackedEH OR While?
I am very undecided
Not so sure, whats more taxing
(needs to be pretty accurate / reacting quick)
Does the check need to happen every frame or approximately every frame?
(Not sure what you mean by 1-2min)
waitUntil with no sleep should be slightly more efficient (because it is just suspending an SQF code block) but it isn't guaranteed to run every frame.
waitUntil with a sleep is even better, the per-frame overheads of sleeping scripts is tiiiiny.
Far better than a OnEachFrame that's set up to only run sometimes.
It needs to check the distance (1m)
While Eden attributes' expression are not globa yet, is there another way to access the values on client without having the server broadcast it?
Maybe I'm overlooking something, but for now only mission attributes are accessible everywhere?
Are you doing a custom attribute? You should be able to setVariable on the object globally.
Yeah i guess that'll work for now
Still haven't figured out getting custom connections to show up either
Why would a global setVariable be unreliable? It's how modules work.
They're broke too? ๐
network traffic
its a pubVar
you cant have a global thing like with modules is the point
only runs on server
so you need to pubVar all attributes that clients need
Modules appear to do the same thing in Eden; there's an expression="..." that does setVariable.
I guess they could have a special case that ignores that and does module attributes locally, but that doesn't seem likely.
modules have an isGlobal switch
even still if its how modules do it
having to realy on network traffic at mission start
not ideal
The isGlobal setting in the config controls where the module gets run; you can read the bis_fnc's that implement modules and see how it does that.
It isn't engine magic.
(Where the module script gets run, I mean; it doesn't change where the object or attributes exist)
sure, cool, but that doesnt change you need to pubVar all attributes which isnt always reliable
When does it fail?
I can't for the life of me figure these custom connectoins out. Does anyone have a working exxampe later? Even running add3DENConnection ["Custom",get3DENSelected "Object","marker_23"] from debug console does nothing (Got empty object selected and marker selected just like the default custom connection type in 3den configs)... nothing
You gotta love that even the include examples don't work.
If you put:
isClass (configFile >> "Cfg3DEN" >> "Connections" >> "Custom")
In a watch in the debugger, does it return true?
Heh.
All my own custom configs show up fine as well
Using the same command with RandomStart works fine, but I can't get anything else to work... might be something in conditions or so, but obviously(!!) there is no documentation on it and the provided example doesn't work
Oh, "Custom" is already defined.
The condition on it is "objectEmpty * objectAI", both of which never appear anywhere else in Eden (nor in the docs) and would seem to be hard to satisfy if you took their literal meaning. ๐
Yeah I know
Tried changing it?
Ah, right.
:(:
Tried condition1 = "1" and condition2 = "1" ? ๐
I did try True, but I guess I'll try that as well
I give up
Nope
add3DENConnection ["Custom8",[get3DENSelected "Object" select 0],(get3DENSelected "Object") select 1] trying to add like this now, but no luck
Also did with marker and trigger, same story
Replace by Sync and all good
anyone know an easy-ish way to transfer AI ownership from my server to my HC?
tryed a few methods but they dont work
You could try the setGroupOwner command. https://community.bistudio.com/wiki/setGroupOwner
anyone know an easy-ish way to transfer AI ownership from my server to my HC?
Curiosity. For what purpose? Why not create them on the HC in the first place? Zeus?
@little eagle mainly for load balancing between HC's and Server
Use my headless mod
Ok, let me paste the doc I wrote for it
Enables automatic passing of AI groups to (up to 3) Headless Clients using round-robin system, with automatic Headless Client recognition. Due to the fully event-based transferring (on unit spawn and on Headless Client connect and disconnect) the performance impact is minimal. It transfersgroupsย of units and not each unit separately!
The system works on the basis of unit spawning, when a unit is spawned it will schedule a rebalance after the specified delay (described below), after the delay rebalance runs on all groups. Groups already local to any Headless Client are skipped, also those blacklisted (described below) and in the same group as any player are skipped. All others applicable for a transfer are then transferred in round-robin fashion, equalizing the number of groups on each Headless Client (most effective with 3 Headless Clients). In an event when a Headless Clients disconnects during the mission (is kicked, loses connection or similar) all units on local to that Headless Client are automatically transferred to the server by Arma 3 and a full rebalance will be forced, meaning all units, including those already on other Headless Clients, are transferred again to equalize the load. Same happens when a Headless Client connects during the mission.
Available with this mod (just main and headless pbos are necessary for headless)
@warped thicket it adds settings to ace serverconfig.hpp tho :]
You are running ace somewhere for sure
how are we supposed to know what you are doing with your server?
ace_common_fnc_addEventHandler is compileFinaled in the latest version, so you can't overwrite it on clients
both
So this log is from clients with ACE joining your server? I think that's all the explanation you need
Nothing we can do about that
Server keys?
So clients with mods can't join?
So they get kicked anyway?
Filepatching is something else dude
checkSignatures = 2 is what you need
^ this probably
in your server's config
verifySignatures, sorry; exactly what commy2 posted
Then they can't play with mods enabled
Maybe this is logged before they are kicked? Never messed around with that
what's your onDifferentData?
so you don't do anything to players with different data (if I understand that correctly)
try: kick (_this select 0)
onDifferentData = "kick (_this select 0)";
same for onUnsignedData
also
onUnsignedData = "kick (_this select 0)";
onHackedData = "ban (_this select 0)";
jep
ODD is empty, they have signatures locally, but they are not on the server
matches what you described
You want to kick those with different addons that the server, so set ODD
I've never done this myself, but this sounds pretty logical
one way to find out ๐
sounds like a Grey Hat
You mean he just wanted to adjust the mission to make it harder/better?
I understand it as not black and white - not purely bad
He got carried away?
Just ban him. Changing the mission as client not allowed
signature check with kick would've prevent this
probably
nice
can't prevent that I guess
How does one return what 3den camera is pointed at?
I want to make a little 'Copy camera position' button so that position can be used as starting point for intro camera
Managed to work all that out. Next up: Is there a magical prayer you need to say for setVariable broadcast to actually work.
class FRL_zOwn {
displayName = "Zone Owner";
tooltip = "Sets the owner of this zone at the start of the round";
property = "FRL_zOwn";
control = "Combo";
condition = "true";
expression = "_this setVariable ['%s', _value, true];";
defaultValue = 4;
typeName = "NUMBER";
class Values {
class zOwnerBlu {
name = "BLUFOR";
value = 1;
};
class zOwnerRed {
name = "OPFOR";
value = 0;
};
// class zOwnerGreen {
// name = "INDFOR";
// value = 2;
// };
class zOwnerNeutral {
name = "Neutral";
value = 4;
default = 1;
};
};
};
Not available on connecting client for some reason. That's a attribute on a trigger
in my experience, broadcasting in the expression would be available on all clients including JIP on postInit
allVariables on the trigger doesn't show anything at all on client ๐ฆ
trigger commands are local even though createTrigger is global by default
meh, i'll just work around it for now. Just need global expressions and things would be a lot better
Ideally even just a getObjectAttribute or something like that that actually works in-game
Hi, is there an easy way to detect when the loading screen in a multiplayer mission is finished? (the screen where you see the map and the loading bar)
The one before or after briefing?
Both use BIS_fnc_endLoadingScreen so you might be able to add something there. If it's a mod you can also make an adjustment to the dialogs 'onUnload' script
Does anyone have any knowledge about say3D and globalsay3D? I'm sure I'm just making a basic mistake somwhere in my scripting: https://forums.bistudio.com/topic/188977-issues-with-say3d-and-cba-fnc-globalsay3d-on-dedicated-server/#entry2994140
doesnt work everytime tho
hysterical
Thank you, I will see how it works
There also is this:
https://community.bistudio.com/wiki/onPreloadFinished
But it will execute after every loding screen (i.e. again after changing graphics settings
@warped thicket @vagrant kite tanks for the info, sos for the delay lol
I don't mean to spam or anything, but would anyone want to look at my issue with "CBA_fnc_globalSay3d" and an EH on an object?
I updated the BI forums post with more up-to-date information: https://forums.bistudio.com/topic/188977-issues-with-say3d-and-cba-fnc-globalsay3d-on-dedicated-server/#entry2994265
I just want the "plink" sound when I hit a target, damnit T_T
@frail dune have you ever tried say3D? :/
Yeah
Wouldn't run globally, which is why I used the cba function instead
But at this point they work pretty much just as well lol
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDisconnect
does this EH fire if player returns to lobby?
yes
Unless you're talking about on the client itself, in that case no. It's server only
Greetings, is the Simulation manager module any good? Was thinking about dynamically manage object simulation and I've just found there's a built in module for this.
It's no different to the code enableSimulation. Probably safer-wise and less-hassle if you use the code version. (But I guess other members don't give a fuck about me, idk :( )
Anyone know if there are any string length limitations that would limit a string to either 8165 or 8122?
Disregard, https://community.bistudio.com/wiki/format
In Arma 3 the max length of String returned by format command seems to be 8191 characters
Hmmm, I had asked a few weeks ago if there was a limit on the string size being sent 'out' through the extension to the DLL and we had thought it was just the string limitation itself (10m) but that doesn't appear to be the case. I was limited to ~8000 characters and had to cycle through the string to get the complete message out.
just fyi
depends on the command you use. a string itself can be 1E6 or 1E6-1 characters long. can't remember
how long does the earthquake last for bis_fnc_earthquake?
i know i can set intensity but dont see time
@cold quartz use joinString or just + a string together. that way there is basically no limit on output to extension.
last time i checked output from an extension is around 10k in Arma3 (cant remember what Arma2 was), but this can change
Yea, I was able to build a really long string (<10k) but I wasn't able to get all of it out of arma to the extension. I just set a low limit at 2k and sent it out in chunks. It'd be nice if there was something to check like outputSize (or whatever the var is) gives to the extension.
er, >10k
sry, beer
There is no limit on output to the extension
You can sent it a 65k string if you want
Just don't use format
Yea, I'm able to build a long string using + or format or formatText but the extension doesn't receive the whole string....
Well your extension is broken then (or hardcoded at 2k inputsize)
Format cuts a string at 8 or 10k
The only string limit with extensions is when the extension is returning a string back to arma i.e outputsize
You might have an extension make for arma2 that is hardcoded at 2k. I believe arma2 extension was around 2k outputsize, i could be wrong
Na, it'll accept ~8k. I just was overly cautios and set it to 2k.
I kinda spent when to much time making extensions.
You can output whatever size string you want to an extension (once you dont hit arma max string size)
Its only when you are fetching a result from an extension, then there is a limit. Believe its 10k size atm.
That is when an extension needs to split up the result if its larger than outputsize limit
for arma3
So you saying extension only accepts 8k input.
Makes no sense unless you are using format.
Or the extension is hardcoded to max inputsize of 8k
It appears so. I didn't set a limit on the acceptance but ... it was only receiving ~8k characters that the extension received from the sqf.
@cold quartz that is litterally bs ... @Torndeco is right here ... ouput is limited ... and if your extension is not getting the full string then you did bullshit with your extension or sqf
Pretty cool... you hooking the script interpreter?
Skills to do that were present for years... Just no one did it...
Even i know where to hook what to build something like that.. Just wasnt really worth the work.. Because i know someone else would do a better job
And most of the guys with that Knowledge are eigther BI devs (obviously) not having the time.. Or Hackers.. Who just build it for their own.. to Reverse Engineer obfuscated scripts...
@fallen locust i guess just the Scheduler ExecStatement function... It gets source file and location in file + Variable Namespace and tons other stuff but thats really all thats needed
@still forum but with that you cant really get local variable contents
Really? interesting
@queen cargo, why don't you build an extension, a giant string and try it out yourself?
I wasn't arguing with torndeco, just explaining what I was seeing.
@cold quartz how fast you want that extension
and with what exact purpose?
will start tomorrow (and that time just becaue i am not able to write today apperantly due to coldness)
Here is how I'm building my string: _ink = "{""netid"":""" + netId _x + """,""player"":""" + name _x + """,""strokes"":""" + _ath_strokes + """}";
The _ink contains the entire string w/o limit
good lord use ' '
ha, will do
When I call: "Athena.Extension" callExtension "ink " + _ink;
the extension receives only part of the string
I'm not saying that it's hard coded. I'm not saying anyone is wrong. All I'm saying is when I do that, the extension doesn't receive the full _ink
@cold quartz have made around 6 different extensions not including linux extensions. that is how they work. there is no limit on inputsize.
sounds like your extension is cutting off the string
That very well could be
Arma just gets the pointer to the data in the string and sends that to the Extension... I dont even think its creating a copy of the original.. But i hope they are.. otherwise you could modify ingame string variables in extension ^^
but its not truncating anything
K, I'll keep poking. Thanks for the hospitable environment.
So what's the word about sqf. I keep hearing that it's going to be phased out.
so my source is full of shit like usual
Is there any way to reliably check if a unit was killed by an explosion?
Try using EH MPKilled,but you will have to create a static array of things that could have killed your unit
It doesn't return the weapon used though does it?
Doesn't it just return the killer and the unit killed
@blazing zodiac And ammo type, IIRC
'cause why not? https://youtu.be/N0cjY9UDAp4?t=32
...i'm having an orgasm
whats the command to get the selected string of RscToolbox?
Is there any way to reliably check if a unit was killed by an explosion?
No
_doors = 5;
doorName = str "Door"; _source = str "_source";
hint format ["%1%2%3", _doorName, _doors, source]; Output = "Door"5"_Source" - including all quotes. how do I get rid of the quotes around the number 5?
by getting rid of the ones around _doorName and _source, most likely
don't do str("Door")
That just adds double quotes which is what you don't need here.
parseNumber "5"
-> 5
Oh, do as Adanteh said. remove the str s
@lone glade are you by chance related to adanteh ?
nope
Got it, thank you for the responses.
noticed a problem with eden. Unchecked enable simulation on a unit, but when I do simulationenabled cursorTarget, it's returning true
anyone else experience unit attribute checkboxes not having an effect?
Okay, I disabled simulaiton via init line, so I know for a fact that its disabled, yet simulationenabled still returns true
Your cursortarget is a null object? Thats not right.
Use cursorObject instead, it doesn't require the use of reveal
Has anyone had success using the removeActionFromObject ace function? (I'm having issues getting in the slack channel so I'm asking here)
I can only seem to get removeActionFromClass to work
@agile pumice why don't u use the standard commands like addAction or removeAction. ACE, btw, is only a mod...not a game.
I know rawner, but I've been redirected to the slack thing a few times already (reasonably). I also don't have any intention on using the vanilla actions.
Thanks for the reply though.
@agile pumice: I just tested it, it works.
But I'm guessing only on actions that were added via addActionToObject, not addActionToClass or via configs.
You can test with this to add it: [cursorObject, 0, [],["test","action test","","hint 'test'", {true} , {}, [], [0,0,1], 10] call ace_interact_menu_fnc_createAction] call ace_interact_menu_fnc_addActionToObject;
and this to remove it [cursorobject,0,["test"]] call ace_interact_menu_fnc_removeActionFromObject;
Removing actions works, always. actions are added locally so it needs to be executed on every machine.
(be it vanilla or ACE3 actions)
I'm trying to use the onPlayerConnected with a stackedEventHandler, and from my understanding this would work and fire my script. Any idea whats wrong here? ["REV_playerConnected_Id", "onPlayerConnected", {[_name, _uid, _owner] spawn REV_fnc_retrievePlayerData;}] call BIS_fnc_addStackedEventhandler;
["REV_playerConnected_Id", "onPlayerConnected", {
_this params ["", "_name", "_uid", "_owner"];
[_name, _uid, _owner] spawn REV_fnc_retrievePlayerData;
}] call BIS_fnc_addStackedEventHandler;
ahhh, i see what you mean now
let me try thta
unfortunately that did not work either
this works, but doesn't pass the name or owner: [{[_name, _uid, _owner] call REV_fnc_retrievePlayerData;},[]] call bis_fnc_onPlayerConnected;
or the uid*
please use 3x"`"
@cold quartz with your extension input issue, you mentioned only getting around 8k characters. Were you using format? Pretty sure it has a ~8k character limit.
Yep, that's all it was. I may have been building my original var using + or working around the format limitation using structured text but the actual call to the extension was using format. My eyes just didn't want to see it.
And I was concerned that because i had written the extension in c# that it may have been a marshalling issue behind the scenes but nope, it was a simple issue. Thanks to everyone that helped!
format output is max 8191 chars AFAIK
yep... Its even on the Wiki entry in the Notes
Yea, I saw that in the wiki. Then i switched to +, still only got 8k, then to formattext and still got 8k and then was like, ok, i'll just work around it. Because I was only getting 8k, i was only focused on how I was building the original var, not how I then went and used that var in feeding it to the extension.
In my head, it was, I'm getting 8k, there must be something wrong w/ building the string so I focused exclusively on how I built the string and not what I did with it. Like I said, my eyes just didn't want to see 'the problem'.
then when I got pushback in here, I figured most of you are developing your extensions in C++ wherewas I'm using C# so perhaps it's some marshalling issue behind the scenes that I don't have control over so I dropped it. Then I was going about cleaning up the sqf after all the messing around w/ the original string variable, no longer focused on why my string was being limited to 8k that I finally figured out why my string was limited to 8k. Even though what I referred to as my string variable was whole, the 'actual' string that was being passed to the extension was being 'format'ed and silently limited to 8k.
which it kind of sucks that it silently fails btw but I'm sure there's a good reason for it.
or silently truncates
So there's the story of how focusing on my assumptions wasted so much of my time and generated lines of code to compensate for a simple mistake.
Arma language pack for Atom v2.3.1 released! Thanks to @cuel it now has support for all ACE3 public functions from ACE3 3.5.0 https://atom.io/packages/language-arma-atom
I hate headache. It feels like someone shoved a metal bar inside my head and then melted it.
I love how Nou keeps spamming every channel at its disposal! ๐
๐
I'm probably just broken and stupid, but I can't figure out how to get ExtDB2 to work with any of my missions. Just literally a mission with the server inserting a new table or anything, I just can't get it to work or get to output errors. Please send help.
If you would be willing to write me a short piece of text/tutorial with info on how to use it I would โค you + @tough abyssntion me if you do this
run debug version of EXTDB2
anyways.... could anyone explain this Fix?
Fixed: The one parameter of the remoteExecCall command was not called in a scheduled environment
it literally makes no sense from first word to last
@hasty pond Check extDB2 logs for error messages.
If you cant figure it out, pastebin extDB2 logs from debug version
Alright, I'll make sure to do that tomorrow! Thanks ๐
@fallen locust They had a long day at the office.
for..do is interesting
in terms of scope
Eg.
{
systemChat str _holySh;
};```
Which scope is parent to which scope? Or do the for paramters have no parents, and their variables are just transfered to the do code block?
Or maybe the initialization code block is the parent of all
Seems that may be the case
for [init, condition, afterthought] do X - variables defined in init can be accessed in all code blocks. variables defined in X can only be accessed in X (and not, for example, afterthought).
Likewise, variables defined in condition and afterthought cannot be accessed from X
Can someone help me with a little scripting trouble. I want to run a script, but while the script is running, I want it to stop if my player has moved > 5 meters from where he was when the script started.
@normal citrus Either perform checks in the script, or make another script that terminates the first when the criteria is met
@normal citrus quick example:
_DidExit = false;
_PPos = getPosWorld player;
while{true}do{
sleep 0.5;
if( (_PPos distance (getPosWorld player)) > 5)exitWith{_DidExit = true;};
};
if(_DidExit)exitWith{hint "moved to far away, blablabla";};```
- save that Link
https://community.bistudio.com/wiki/All_Arma_Commands_Pages
Or if it's a long script without loops, and many sleeps that you don't want to place a condition after each one, eg.
sleep 10;
do_whatever;
sleep 10;
do_whatever;```
You can spawn code in your script to do it, then make the calling script terminate it.
```_script = _this spawn
{
do_whatever;
sleep 10;
do_whatever;
sleep 10;
do_whatever;
};
_startPos = getPos player;
waitUntil { scriptDone _script || player distance _startPos > 5 };
if (!scriptDone _script) then
{
terminate _script;
};```
Thank you for the responses.
wtf. I don't remember Arkham Knight being 55GB..
my GTA V installation is 95GB...
So yesterday I asked about extDB and I'm still getting an error like this it seems like:
2016/03/17, 20:50:35 "extDB2: Version: 71"
2016/03/17, 20:50:35 "extDB2: Connected to Database"
2016/03/17, 20:50:35 "extDB2: Error Database Setup: [0,"Failed to Load Protocol"]"
Here is extDB log http://pastebin.com/fbje5yry
- This is the array I'm sending to the default init example ["test", "SQL_CUSTOM_V2", "test"]
Where is your test.ini file located ?
Arma 3@extDB2_DEBUG\sql_custom_v2
i.e should be @extDB2/extDB/SQL_CUSTOM_V2/test.ini
Even if I'm running the debug version?
Yeah, do you think that'll solve the problem?
Well it would bad if it didn't considering i wrote the extension.
Next version will have error output when SQL_CUSTOM_V2 directory doesn't exist
๐ heh This is the new log that I got after fixin that http://pastebin.com/MDWvSj0b
Well you broke the SQF Code ๐
It randomizes up the Protocol Name & compileFinals it in extDB_SQL_CUSTOM_ID
To make it harder for hacker to directly call the extension
Look @ fn_async.sqf to see the example method
You should go over the wiki & use the test application the exe
Much easier to test it out and see how it works, before you mess around with sqf code
Ah, this is my sqf and I guess the problem might be just here, but as I'm new to this extension http://pastebin.com/USTZKfkE
_checkstr = format ["0:test:existPlayerInfo:%1", getPlayerUID player];
->
_checkstr = format ["0:%1:existPlayerInfo:%2", (call extDB_SQL_CUSTOM_ID), getPlayerUID player];
But you should really use the example fn_async
Or use the test application if you are going to rewrite your own sqf functions.
That way you will figure out how to test stuff out, like handling ASYNC talking to the extension.
Or what todo when the extension output is greater than 10k, or error handling etc
Where can I find the test application on github? And what would be the array I send to async with this goal that I had with this script because I just couldn't figure it out
Its in the download zip file in folder called test
Look @ the examples and the wiki, am kinda busy.
Alright, Thank you so much for all your help!
Finally got it to work correctly with one of the prepared statements. Thank you Torndeco! โค
I've got a little question I've been troubling over. I'm trying to make it such that players go into a spectator camera on death, but if they manually choose to respawn , it will bring them to the respawn menu instead of that happening after a set amount of time
or rather to the "MenuPosition" style respawn when they choose
Hello I'm having trouble getting ACE3 and Infistar to play nicely together, but nothing I've done works. The problem I'm having is the ACE3 Menu's (Medical Menu, ect.) dissapearing after popping up, I've tested it with Infistar not loaded and it works perfectly. I've tried disabling most of the Anti-Hacks settings and this problem still persists. Any help would be greatly appreciated.
whats the best way to generate an unique identifier in SQF? (unique for all clients + server)
client https://community.bistudio.com/wiki/getPlayerUID
server... dunno
i think that its a random and format and a array is the only way
depends what you mean by unique... Per session that would be random.. but unique so its the same after reconnect.. then only playerUID
i think he want to generate multible UID per Client
Random is not unique
i mean like this:
globalUID = [""];
private _uid = "";
while {_uid in globalUID} do {
_uid = format ["%1%2%3%4%5%6%7%8%9%10", random 100, random 100, random 100, random 100, random 100, random 100, random 100, random 100, random 100, random 100];
};
globalUID pushBack _uid;
_uid
any bugs known with allVariables on a logic?
looks like variables with value nil dont get removed from allVariables on objects (its working fine with missionNamespace)
That isn't necessarily a bug, private variables are the same.
anyone know if i can execute bis_fnc_earthquake with CBA in the console?
server-wide
not local
doesnt have to
just thinking that was the only way i could do it
admin_d0 needs STRING code!
infistar doesnt seem to like it im guessing
same
out of luck
ill add some stuff server side so it passes it
If its not a bug the docs are wrong cause they say setting a variable to nil removes it
@deft zealot nil does remove the variable.... to check, use the condition: isNil "variable"
but its still listed in allVariables
Then allVariables must be recording 'used' variable names, then. But technically It doesn't exist.
i just wanna tell you that the behaviour of allVariables is different when used on objects vs missionNamespace.
When executing allVariables missionNamespace there are no nil veriable names listed
this is inconsistent and not documented anywhere (maybe BI want to change it)
Wait, so the nil variables do not show up on allVariables missionNamespace?
jep
But nil is designed to remove the variable from total existence :/
If nil variables don't show up on allVariables, then it prooves the variable is deleted. If it does show up on allVariables missionNamespace, then it must be reported on the feedback tracker.
feedback tracker is still down
@zealous solstice down? I didn't know, lol. I've been off ArmA for like 2 months (still haven't touched 3DEN xD)
jep still down sinse 3den release
Wow
Hi, i need a scipt to spawn items in front of a player, in a weaponholder. can anyone help me?
@quick summit https://community.bistudio.com/wiki/addMagazineCargoGlobal Use this with the weaponholder as the containe/vehicle for magazines and https://community.bistudio.com/wiki/addItemCargoGlobal this for items.
thanks
that's everyone except the server there quicksilver
how can I wait for this to complete? "call compile PreprocessFileLineNumbers"
it returns when its complete
no because it's a call compile.
that thing will complete when it reaches the end of the file.
(or block of code supplied)
how do I check if its completed was what I meant to ask
would not be unique @zealous solstice
@deft zealot in which term it has to be unique?
mission runtime or persistent global?
mission runtime
how long you want your UUID to be?
as short as possible ๐
time + random 100000 hf
there was also a diag tickwhatever command
but i do not memorize that right now :3
diag_tickTime
found it diag_tickTime
i used diag_Ticktime but i got the same value when i run it twice in a short period of time
but random is random not unique
longer => less chance of dups
random just has to serve you enough randomness to not have two times the same value in a single frame eg.
thats why you have to use more or less what joko did
with multiple random calls
but as you want to use pure SQF
thats as unique as you can go
if i execute your example 100001 times per frame i get a duplicate
however ... can also get some more fancy
gimme something without random pls
if you exec it 100001 times per frame you will get a million $$$
as said: you wont get around the random command due to native SQF having nothing for it
if you have an identifier with a fixed length youre gonna run into duplicates at some point anyway
Quick question, will ExtDB2 Allow this kind of SQL statement "SQL1_1 = SELECT * FROM users WHERE uid=?;"
can write you together something proper ... but that still would have the random command in it
but the chances of dups will be quite low
i wont even dare to answer that @hasty pond ...
that pretty much is an idiots question ...
i'm entering half way through this conversation but why can't you just....check if the UID is unique before assigning it?
@fading gorge good question
easy answer
you cannot because you might generate thousands of UIDs --> cross checking is time consuming more and more
if you do it on a non-local level you are even more fucked as you would have to sync em
@queen cargo ๐ Not that familiar with extDB and how it deals with everything
@hasty pond does not matters ... extDB is a database frontend ...
its just as dump to ask if it is possible as it would be dump to ask if callExtension supports dlls
@deft zealot gimme 10 minutes and you will have some proper generator for it ๐
@hasty pond
Easier to just test out your SQL Statements, if there an error check extDB logs for info.
But once its a valid prepared statement it should work (minus the odd unsupported datatype)
There is even a command line test application. (So you don't even arma running).
You can also check out exileserver + a3wasteland sql_custom_v2 ini files
@deft zealot https://gist.github.com/X39/903e512c3bd865e3736b
untested
so ... might have some syntax error
but you wont get much more unique
be aware that you cann still add another layer of uniqueness if you only generate them on playerside
and never on server
the function there is suitable for both
chances for dups is quite low
or more: extremly low
but i have to edit it again ...
you can get more uniqueness into it
by randomness ๐
updated
X39, missing some macros there.
what should i use macros in there for?
define entire script as a macro
that is the biggest bullshit i was forced to read in my entire life
thanks
thanks for this experience
so ... what do you guys think about this here?
https://www.youtube.com/watch?v=egsuCESsPlE
i personally look extremly forward to that tool ๐
I need this in my life
right now however ... it does not supports macros at all so ... kind of a downside ^^
@queen cargo does it lint correctly and build the script like engine would?
if not there is nothing more to it than yet another editor
@warped thicket just can speak from what i got from the offficial dev
it hooks arma (no building the script itself) and provides a basic linting to it
debuging with breakpoints and viewing the contents of variable XYZ is also possible (just check his channel for more info)
btw. the discord is here: https://discord.gg/0soUkHOCbgKLE3IC
to be more precise: it is still ArmA running everything (from inside the game etc. no action provided by the tool yet)
yeah
it probably just adds diag_logs and reads those or something for variable reading
any idea if it needs Arma running in the background or?
nope
it hooks the SQF functions for debugging
ArmA has to run if you want to debug a script
and the script has to be ran in ArmA
the tool itself does not seem to provide a way for it yet
thought so
he teasead
it so long
like a year
So long infact
I consider it vaporware
heeeh
i recongize that UI middleware
just write addons in c++ and use a normal good debugger. ๐
@grizzled cliff you wear glasses?
cause you dont c#
or just lazy ones
also you can write c++ now without ever using a new statement
you have to teach me some basics in a codin session
in C++11/14/17 almost everything in the STL/STD library has move semantics.
@grizzled cliff did you get the c# == see sharp ?
You declare everything on the stack and just pass it around until it finally just goes out of scope forever, releasing it's memory in it's destructor.
and yes @zealous solstice ... of course... lol
RAII + move semantics, and using shared_ptr (basically a ref counter wrapper for any dynamically allocated object) makes memory leaks something you really need to try and create on purpose.
and compilers can do some amazing optimizations with move semantic rvalues now too, just really slick, fast code
like before rvalue type variables, doing something like
std::vector<some_obj> make_list() {
std::vector<some_obj> my_list;
for(size_t i = 0; i < 10000; ++i)
my_list.push_back(some_obj());
return my_list;
}
auto returned_list = make_list();
would mean that the return statement would execute a copy constructor on returned_list
instead now using move semantics it knows it can call the move constructor and instead of copying the data, it just takes the pointer to the data in my_list in the function and moves it to the pointer in returned_list.
Then it nulls it out in my_list and when my_list goes out of scope it just frees up everything except it's data, because returned_list is now the owner of that data.
and compilers often can optimize that entire move out (even though its super cheap anyways) and just use returned_list as my_list
when that function is called via inlining (or possibly in some cases passing an extra variable address to the function)
c++ is neat.
NetFusion - Today at 1:44 AM cause you dont c#
Oh my god... badumm tss
I am happy with just /bin/sh.
wait, you mean nobody writes everything in binary ? ๐
What is SQF derived from?
mish mash of around 4 languages
That isn't used for anything else other than BI Games
TKOH arma 2 and arma 3, maybe VBS products too dunno. Take on mars is pretty interesting and low level, dunno for Ylands
nope, it uses a modified branch of RV from arma 2, which has been heavily modified and renamed enfusion
Ylands uses unity.
I thought that was what ToH uses
pretty sure TKOH is just a branch of A2 with rope physx and whatever the flying lib is.
Doesn't ToH use RotorLib?
yes that
It's exactly the same as A3's AFM
A3 afm IS rotorLib ported to A3 from TKOH