#arma3_scripting
1 messages · Page 557 of 1
Is it possible to move a respawn position or do you have to remove it and make a new one at the new position?
Did you try to change position of the marker?
Since I cant access arma atm, should this piece of code work:```sqf
case !objNull: {_UAV setIdentity (name _x)}
mainly the !objNull, its been a while since ive done SQF and wana make sure my syntax is right
most likely not
! expects bool
you can verify with SQF-VM
(or verify SQF-VM sometimes 😄 )
Nope
There aint no Object variant of that operator
I don't know if I am just being dumb but am I messing up my addaction? Seems no matter what distance I set its stuck at 50m.
bftarsenal addAction["<t color='#2ecc71'>Open Arsenal</t>", {[bftarsenal, player, false] call ace_arsenal_fnc_openBox;},[],20000, true, true, "","true", 2,false,"",""];
max* 50m iirc
He's trying to set it to 2 in that example. Is the iissue that the showWindow bool is set true?
I don't think so
@brazen smelt any script error (and do you use the -showScriptErrors flag?)
It works fine, just it seems stuck at 50 meters even when I tried to set it to like 20000 in the above as an extreme example @winter rose
It's the second number, read the doc @brazen smelt
https://community.bistudio.com/wiki/addAction
What you increased was… its priority
Any way to make the player wear the rebreather mask and goggles out of the watter?
good day gentlemen,
I want to give a new way-point to all the groups in the list,
{_x stuff}foreach allgroups in thisList;
but it definitely gives the WP to all groups in the mission instead. What's wrong?
allgroups returns all groups, in returns true/false
use arrayIntersect instead
@astral dawn will try, thanks
@dim terrace that explains nicely, thanks
@hot kernel using it in a trigger?
yes
Thislist contains units then. Dont know how to do it more elegantly but create an array,add all groups to it and then do a foreach
use arrayIntersect instead
I think @astral dawn was saying to filter the allgroups list by thislist with array intersect
He already got the answer to that one IR0NSIGHT.
It compares two arrays and outputs one with the items in both.
I'm still not sure about the syntax
_groupList = [];
{_group = group _x;
If !(_group in _groupList) then {_groupList pushback _group}
} foreach thisList;
{Addwaypoints} foreach _groupList
Thats how i would do it
arr1=allgroups;
arr2=thisList;
theseGuys=arr1 arrayIntersect arr2;
{_x code} foreach (allgroups arrayIntersect thisList);
@finite dirge , that's the one!
we all learned something! Hurray!
thanks!
{...} forEach (allGroups select {_x in _list}) is also pretty
thanks guys!
Isnt comparing allGroups super performance heavy?
depends on how often you do it 🤷 and what is performance heavy in your case
the trigger only exists for its half-second
Yeah alright then
Generally the less SQF commands the better, SQF operator overhead is larger than the underlying work that it does
Good to know
the trigger is called via function, does it's business and deletes
@astral dawn , is this more performant than arrayIntersect?
{...} forEach (allGroups select {_x in _list})
and does _list need to be defined?
is this more performant than arrayIntersect?
not sure, test yourself, most likely no
and does _list need to be defined?
Well if you are searching for all groups which are also in some array, does this some array need to be defined?
hey, those questions were rhetorical...
😉
Also, make it work first, then worry about performance
Well perf question didn't seem rhetorical, considering that I'm currently worrying about SQF being stupidly slow in my own code
What's the fastest way to multiply two arrays with numbers?
It takes an insane amount of time
like... around 200 microseconds for arrays of ~50 size??
count/apply I'd guess. Are they equal length?
yeah
params ["_comp", "_compMask"];
{
pr _cat = _comp#_forEachIndex;
{
_cat set [_forEachIndex, (_cat#_forEachIndex) * _x ];
} forEach _x;
} forEach _compMask;
Well they are arrays like [[0,1,2], [1,2]] in my case, but still
Oh, yeah you need the index. Not many options then.
May be better to not use the index (so use count) and create a third array and append. Not sure performance wise for set and append.
Hmm... in fact, what I really need is to set value in first array to zero, if value in second array is zero, else leave it unmodified 🤔 probably then I could use some select
select apply and such things
no errors but no results either, tried both variations:
in trigger statement
if (_condition) exitWith {
{ _wp = _x addWaypoint [goLOC, 0] } foreach (allgroups arrayIntersect thisList)
};
Well then dump variables with diag_log and do the usual debugging 🤷
@astral dawn , will do-- just reporting back what works
likely because, as we started with, thislist is units
Would make sense, so loop to get group and compare then.
@finite dirge ,
trying that now, thanks!
turns out to be much more simple to use doMove than set a WP, which functions well in this case. Still would be nice to generate an array of groups from thislist.
what is thislist? Array of units? Or array of groups?
I know it's some trigger thing but I have never used triggers (there is no use for them if you know how to code)
units
an array of objects that have been detected by the trigger
private _groups = thislist apply {group _x};
_uniqueGroups = _groups arrayIntersect _groups;
Is it what you need then?
That would fix what I sent, yes.
Is it what you need then?
I wonder if foreach group _x pushbackUnique is more efficient
I couldn't get pushback Unique to work but that doesn't say much
it was like this,
groupArr = [];
{groupArr pushBackUnique (group _x)} forEach thisList;
Looks ok
i never profiled apply/intersect vs pushBackUnique.
but pushBackUnique has to use existing array, which is unsorted, straight array. So it has to iterate over all entries to insert.
That's going O(N²) quick.
arrayIntersect could use a hashMap as intermediary (although it most likely doesn't)
well we're already way over my head so I'm going to,
{makeDinner _x}forEach (hungry kids);
thanks for all your help!
For each thisList
Q: when working with AI skill, do all AI have the enumerated skill names?
along these lines working with skill or setSkill, it says unitName is that a name? or the unit object itself?
then are we talking about a qualitative setting, i.e. aimingAccuracy, endurance, to name a couple, can be set from 0 to 1?
then how does general get divied up among the specific skills? never mind an overall skill level?
how do you engage the simple skill level? or the precision level of an AI unit?
That page explains exactly how to set it, which subskills are available and when it doesn't work
And yes, using the skill scripts are per unit/group by using the name of the unit (or group leader).
For global settings you can use the difficulty sliders (for SP) or skill sliders (missions).
I question "unitName" because the docs indicate unitName: Object, Object, and virtually every other API that is there dealing with unit this, that, or the other, is on the unit Object.
and yet setSkill is on the unit: Object.
As far as I can see it's just the internal variable name for the unit object, so nothing to worry about
and the examples seem consistent with the Object motif, i.e. _myCourage = player skill "courage", so maybe the docs are just an oversight.
Because technically player is an unit object and unit_name a unit name ;)
But they will both work
or _skill = skill unit1;
The docs seem right to me, just inconsistent naming in the functions themselves
or i.e. (units group player) select { !(isPlayer _x) }
(units group player) select { !(isPlayer _x) } select 0
anyway, we'll tinker some, just want to clarify the docs a bit.
First returns all AI units in group of player.
Second returns first AI unit in group of player.
Nothing wrong with those examples
Hi, I'm extremely new to Arma scripting. Like, I don't know how to use the init. I don't expect anyone to teach me personally from the ground up, but if someone has a link to a start up guide that is up to date, I would appreciate it!
Well, the wiki is a great source of what is possible and how it all works.
There are also some guides on the forums, but it's impossible to teach someone to code with just a guide.
To be clear, it is not "unitName" but rather "unit" that should be indicated in the skill documentation.
unitName is incorrect, does not work.
_speaker is not null, it may be nil. although how it got that way between lines 136 and 140 is not clear. maybe !isNil "_speaker" is a better test?
Q: I am trying to set unit skill levels on init using CBA_fnc_addClassEventHandler for the CAManBase class and when typeOf _civ in civilians. the block of code is being reached and should be setting the setSkill accordingly.
however, when I check skill afterwards, I see a default 0.5. I am also running ACE, in addition to CBA. I wonder if ACE is doing something there? or whether there is a better event I can watch? or I just need to configure ACE differently?
I know that ACE has a skill module in Zeus to update AI globally, which by default sets everything to 0.5
although that shouldn't trigger by itself, unless you use the module
ahh... it might do right that... it updates the AI skill on PreInit, which by default is 0.5
hmm, on "preinit" ? then how does my "init" event not see it and update it?
literally this is what I would like to do:
["CAManBase", "init", {
params ["_civ"];
if (typeOf _civ in civilians) then {
diag_log format ["Initializing unit type `%1´.", typeOf _civ];
// Not using "general".
private _level = 0.2;
{
_civ setSkill [_x, _level];
diag_log format ["Initializing unit type `%1´ skill `%2´ level %3.", typeOf _civ, _x, _level];
} forEach [
"aimingAccuracy" , "aimingShake"
, "aimingSpeed" , "endurance"
, "spotDistance" , "spotTime"
, "courage" , "reloadSpeed"
, "commanding" , "general"
];
};
}, true, [], true] call CBA_fnc_addClassEventHandler;
I get the logging, but the actual levels are superseded.
maybe I need to spawn another handler so that it can run after any other handlers have completed?
I am approaching this potentially as a class CfgAiSkill {} problem. However, again, I think the docs has a typo.
w, x, and y are minInputSkillLimit, resultingSubSkillLowerBoundary and maxInputSkillLimit. Tracking so far.
however, how can z be resultingSubSkillLowerBoundary? isn't that the resultingSubSkillUpperBoundary?
Spawning did the trick.
this scripts is throwing a error its for exile mod
heres the script :https://pastebin.com/L05ayPXx
heres the error
4:03:44 "ExileServer - Job with handle 10005 added."
4:04:05 ["ExileServer - Spawning persistent vehicle spawns"]
4:04:07 "[Display #24]"
4:04:09 a3\data_f\proxies\flags\flag_auto.p3d: No geometry and no visual shape
4:04:09 Error in expression <llExtension _query);
(_result select 1) select 0
>
4:04:09 Error position: <select 0
>
4:04:09 Error Generic error in expression
4:04:09 File Exile_Server_Overrides\ExileServer_system_database_query_insertSingle.sqf..., line 17```
anyhelp fixing it would be super awesome
Seems that (_result select 1) does not return an array of at least two elements
I assume _result = x callextension y?
then a select 1 makes no sense, unless y is array, where it still makes no sense.
Need to see atleast one more line of code
it might be that unknown parseSimpleArray bug that I've also seen in CBA. but noone so far has been able to provide any useful data (aka the input string given to parseSimpleArray) for that problem.
If noone can provide data, it will most likely not be fixed in the hotfix. meaning it'll stay for a couple months probably
The error is not for the script on pastebin
anyone good with 3d math around? feel like this should be simple but my mind is blank. given a surface normal (unit vector) how would i arrive at a 0.00-1.00 value based on the degree to which the surface is horizontal (0.00) or vertical (1.00).
Just check vertical component of the vector ?
abs (_surfaceNormal#2)
@cursive whale
thanks both, seems too simple sparker but i guess that makes perfect sense
Actually no, might want to 1 - (abs (_surfaceNormal#2))
If you need it to be 0 for a flat surface, since for a flat surface the normal vector is perfectly vertical
Doing cos(angle between vertical axis and our normal vector) will yield the same result actually. Because if you think of it, vertical component is equal to cos of that angle anyway
trying (10-minute compile), thanks
So im trying to get the respawn menu loadout to work, Im using loadouts already defined in the game. However having trouble as its only showing the first one.
Inside the description.sqf I have this:
{
class RifleBasic
{
vehicle = "rhsgref_ins_rifleman";
vehicle = "rhsgref_ins_rifleman_akm";
vehicle = "rhsgref_ins_rifleman_RPG26";
vehicle = "rhsgref_ins_grenadier";
vehicle = "rhsgref_ins_rifleman_aks74";
vehicle = "rhsgref_ins_rifleman_aksu";
};```
Inside the init.sqf I have this:
```[west,"RifleBasic"] call bis_fnc_addRespawnInventory;```
The result only show the first loadout any clue why?
https://imgur.com/a/C4lfJAV
i don't know anything about the system but that class RifleBasic just looks wrong (defining the same 'vehicle' member multiple times).
Should I change "vechile" for different names?
Try to use a array with each string as one element
Could you give me a example?
Should I change "vechile" for different names?
no you can't just change config entry names and expect it to work
Try to use a array with each string as one element
no you can't just change config entry types and expect it to work
I don’t know the system too^^
One respawn inventory, can only have one vehicle
You only have one inventory "RiflemanBasic" but it looks like you want multiple. So you gotta write multiple
I basically want multiple options for the rifleman etc.
Okay, I tried that and it didn't work though
show what you tried
{
class RifleBasic
{
vehicle = "rhsgref_ins_rifleman";
};
class RifleBasic
{
vehicle = "rhsgref_ins_rifleman";
};
};```
Something like that
UI does look like each class should have a choice of loadouts but it's not clear how
{
class RifleBasic
{
vehicle = "rhsgref_ins_rifleman";
};
class RifleBasic1
{
vehicle = "rhsgref_ins_rifleman";
};
};```
Like that
?
yeah
and then also use the new name, in a additional call to bis_fnc_addRespawnInventory
Do i need to update the init.sqf too then
I just wrote that. yes.
[west,"RifleBasic1"] call bis_fnc_addRespawnInventory;``` in the init.sqf
ah, each loadout needs the same 'role' (to be presented as a loadout option for that role)
🚜
So I added more, its now auto killing me on start and not showing any loadouts. Gonna revert back to when it worked and go from there.
as said i've not used the system but looking at the biki and your UI pic i'd guess you need something like;
class CfgRoles { class Rifleman { displayname = "Rifleman"; }; }; class CfgRespawnInventory { class RifleBasic01 { displayname = "AK-103"; vehicle = "rhsgref_ins_rifleman"; role = "Rifleman"; }; class RifleBasic02 { displayname = "AKM"; vehicle = "rhsgref_ins_rifleman_akm"; role = "Rifleman"; }; };
```cs
class CfgRoles {
class Rifleman {
displayname = "Rifleman";
};
};
```
↓ ↓ ↓cs class CfgRoles { class Rifleman { displayname = "Rifleman"; }; };
triple accent?
` yes
but not indented
that's your input 😄 once between ``` you can tab in Discord
good to know but not having any joy getting tabs in (paste was tabbed, and it seems to discard those i enter in Discord
spaces > tabs
tabs = tabs, you then adjust your IDE
space = between words
you press tab to have tabs, not spaces =]
tabs seem to be converted to spaces (and are present when editing) but so far i've not been able to insert any leading whitespace it will show (be they tabs or any number of consecutive space characters)
@astral dawn thanks, it was exactly that simple
How fitting that IDEology is the study of IDE configuration.
dudes are that extremist regarding IDE preference/settings/etc
i'm super particular about source formatting, just seem to be a very visual person, dealing with other people's styling about halves my comprehension
Heya, I am trying to create a custom faction for arma of "bandits" and as such I want them to randomise their clothing, equipment and weapons. So far I have aorted out everything except the randomised weapons.
Ive come up with a really rough script for the weapons but its inefficient and doesnt do what I want as it only allows for weapons that use the same magazine
if (isServer) then {
_unit = _this select 0;
_RandomWeapon = ["arifle_Mk20_ACO_pointer_F","arifle_Mk20_ACO_F","arifle_Mk20_ACO_pointer_F","arifle_Mk20_ACO_pointer_F","arifle_Mk20_ACO_F"] call BIS_fnc_selectRandom;
_RandomMagazine = ["30Rnd_556x45_Stanag","hlc_30rnd_556x45_EPR_PMAG","hlc_30rnd_556x45_SOST_PMAG","hlc_30rnd_556x45_SPR_PMAG","hlc_30rnd_556x45_S_PMAG","hlc_30rnd_556x45_M_PMAG","hlc_30rnd_556x45_t_PMAG","hlc_30rnd_556x45_MDim_PMAG","hlc_30rnd_556x45_TDim_PMAG","hlc_30rnd_556x45_EPR_STANAGHD","hlc_30rnd_556x45_SOST_STANAGHD"] call BIS_fnc_selectRandom;
_unit addWeapon _RandomWeapon;
_unit addMagazine [_RandomMagazine, 8];
};
Ive tried this script as well as in theory it would do what I want - add random weapons along with their compatible magazine but it only selects the first sub-array in the array and because of that its useless
if (isServer) then {
_weaponList = [
["arifle_Mk20_ACO_pointer_F","30Rnd_556x45_Stanag"],
["arifle_Mk20_ACO_F","30Rnd_556x45_Stanag"],
["arifle_Mk20_GL_ACO_F","30Rnd_556x45_Stanag"],
["LMG_Mk200_pointer_F","200Rnd_65x39_cased_Box"],
["srifle_EBR_MRCO_pointer_F","20Rnd_762x51_Mag"]
];
_weapon = _weaponList select floor(random(count _weaponList));
for "_i" from 0 to 4 do {
_unit addMagazine (_weapon select 1);
};
_unit addWeapon (_weapon select 0);
};
Im a bit stuck and have no idea where to go from here as I am pretty inexperienced with arma scripting so absolutely any help would be appreciated. 
First thing. BIS_fnc_selectRandom --> selectRandom
private _unit = param [0,objNull,objNull];
private _weaponsWithAmmoTypes = [
[["556_Wep_1", "556_Wep_2", "556_Wep_3"],["556_Mag_1", "556_Mag_2", "556_Mag_3"]],
[["762_Wep_1", "762_Wep_2", "762_Wep_3"],["762_Mag_1", "762_Mag_2", "762_Mag_3"]],
[["545_Wep_1", "545_Wep_2", "545_Wep_3"],["545_Mag_1", "545_Mag_2", "545_Mag_3"]],
[["9mm_Wep_1", "9mm_Wep_2", "9mm_Wep_3"],["9mm_Mag_1", "9mm_Mag_2", "9mm_Mag_3"]]
];
(selectRandom _weaponsWithAmmoTypes) params ["_weapons","_mags"];
_unit addWeapon (selectRandom _weapons);
_unit addMagazine [(selectRandom _mags),8];
matrixMultiply is awesome. If I get permission, will add 3 axis rotation function for vector dir and up
saw your video, think ppl would really appreciate a simple function to do 3d rotation (in degrees)
It is fast
vectordirandup does my head in
Yep same here because it is complex rotation
@ruby breach cheers ill try that after work
dont you guys know if .lip files is now working in A3? i cant get it to work. I make lip file from wav (via steam tool wavetolip). Then get wav or ogg(tried both) to the .ext and when i want to say3d (or say) by unit the sound is laggy and no lipsync. Someone have experiences with this? or am i doing something wrong?
(wav format is 16bit, mono, 44.1 sample rate)
when i delete lip file sound works good
(_result select 1) select 0
>
22:31:27 Error position: <select 0
>
22:31:27 Error Generic error in expression
22:31:27 File Exile_Server_Overrides\ExileServer_system_database_query_insertSingle.sqf..., line 17```
here is the ExileServer_system_database_query_insertSingle.sqf : https://pastebin.com/1APvNjAZ
here is the script: https://pastebin.com/hBzeVcqK
if someone can fix for me that would be cool i have been at this for days
looks like parseSimpleArray only takes a string
For example: [1,"2",true,[4,"five",false]]. The string representation of this array compatible with parseSimpleArray will be "[1,""2"",true,[4,""five"",false]]" accordingly.
Jack im not a programmer could you fix this for me by any chance and explain maybe what happened please 🙂
i can edit a array but that's about it XD
I am a programmer, but I don't know sqf that well. Or anything at all about exile. I just know how to spot syntax errors;
here's the secret
when it spits out a line number, the problem is usually the line before, or right before where it's pointing
_parameters = _this;
_query = [0, "SQL",_parameters] joinString ":";
_result = parseSimpleArray ("extDB3" callExtension _query);
(_result select 1) select 0```
just copy paste "arma 3 <name of unknown function>" into google, and you'll usually get examples on how it's supposed to work
line 17 is the last line
so _result = parseSimpleArray ("extDB3" callExtension _query);?
exactly
with certain functions, the string "[1,2,3]" is the exact same thing as [1,2,3]
parseSimpleArray seems to be kinda special in that it requires the input to be a string
i see so no "" needed
no you need more "
ok
wait a minute
could it be beaucse its misssing a " at the end ?
_result = parseSimpleArray ("extDB3" callExtension _query);
Example 1:
_arr = parseSimpleArray "[1,2,3]";
Example 2:
_bool = true;
_num = 123.45;
_str = "ok";
_arr = [1,false,"cool"];
_res = parseSimpleArray format ["[%1,%2,%3,%4]", _bool, _num, str _str, str _arr];
// Note how _bool and _num do not need str, however if used anyway, the result in this case would be identical
hint str _res; // [true,123.45,"ok",[1,false,"cool"]]
from the website
right before )
Yes, the query will return a string so that's not an issue
just took another look
ok
im still not understanding the format and _bool, _num, str _str, str _arr];
what do they do and what do they mean i guess
Ok so @finite dirge , he's using a .dll in that line?
and it's known that .dll always returns a string formatted array?
He's querying the DB with extdb. It's returning an array in a string.
ExileServer_system_database_query_insertSingle.sqf
I highly doubt is the issue. What's being queried and what's being returned likely is.
here is the script: https://pastebin.com/hBzeVcqK
@dawn hull , we can try the "hammer" way of debugging by putting in sideChat str <variable> and print line by line what's goin on
put a player infront of that or something
not sure how that fairs with MP though
print the _result to the sideChat before the line that fails when it tries to call it
i did not make this script
Me neither. 🙂
i just made the array how would i do that?
sorry duder, I can just give pointers until someone more familiar with that code comes along. Might be tough to find someone who just wants to debug for a few hours and hand you back something finished, unless it's a common problem.
Besides, better to get your hands dirty now so you can fix it on the fly when your buddies are online
how would i " print _result to the sideChat before the line that fails when it tries to call it "
do i literily put_result = ["test this a if this is on then test for the script"] call BIS_fnc_guiMessage; something like that ?
what what line would i put this on?
player sideChat str <array>
replace <array> with an array or some other variable
end with ;
@dawn hull diag_log _result; and post here what it logs. Whatever extension returns is not in proper format so you have error. Unless you know what it returns you can’t fix it
ok where would i put that just in the script anywhere ?
Sorry, log the result of extension call not _result
in the exile vehicle script or the ExileServer_system_database_query_insertSingle.sqf ?
im only seeing _result in ExileServer_system_database_query_insertSingle.sqf
sorry for me being a noob lol
Change _result = parseSimpleArray ("extDB3" callExtension _query); to _result = ("extDB3" callExtension _query); diag_log _result; _result = parseSimpleArray _result;
Then check rpt just before the error
@unique sundial server rpt https://pastebin.com/PzhM65d8
0:48:36 Error in expression <icles.sqf"
diag_log _result;
uiSleep 30;
diag_log ["ExileSe>
0:48:36 Error position: <_result;
uiSleep 30;
diag_log ["ExileSe>
0:48:36 Error Undefined variable in expression: _result
0:48:36 File mpmissions\__cur_mp.Chernarus_2035\Persistent\spawn_vehicles.sqf..., line 21```
Change what I posted to what I posted
i did that part 🙂
It cannot give undefined variable error so no you didn’t
* ExileServer_system_database_query_insertSingle
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
* 64Bit Conversion File Header (Extdb3) - Validatior
*/
private["_parameters","_query","_result"];
_parameters = _this;
_query = [0, "SQL",_parameters] joinString ":";
_result = ("extDB3" callExtension _query); diag_log _result; _result = parseSimpleArray _result;
(_result select 1) select 0```
did i not do it right ?
Yes that’s correct
rebooting let see now
0:59:30 [13586,50.094,2.711,"XEH: PostInit started. MISSIONINIT: missionName=Exile, missionVersion=53, worldName=Chernarus_2035, isMultiplayer=true, isServer=true, isDedicated=true, CBA_isHeadlessClient=false, hasInterface=false, didJIP=false"]
0:59:30 [13586,50.109,2.711,"CBA_VERSIONING: cba=3.12.2.190909, "]
0:59:30 [13586,50.117,2.711,"XEH: PostInit finished."]
0:59:30 "SC/BIS_fnc_log: [postInit] CBA_fnc_postInit (22.9988 ms)"
0:59:30 "ExileServer - Main thread started"
0:59:30 "SC/BIS_fnc_log: [BIS_fnc_preload] ----- Scripts initialized at 10106 ms -----"
0:59:35 "ExileServer - Job with handle 10005 added."
0:59:57 ["ExileServer - Spawning persistent vehicle spawns"]
0:59:59 "[Display #24]"
1:00:01 Cannot create non-ai vehicle B_APC_Tracked_02_AA_F,
1:00:01 "SC/log: ERROR: [BIS_fnc_GUImessage] Unable to create message box"
1:00:01 Error in expression <llExtension _query);
(_result select 1) select 0
>
1:00:01 Error position: <select 0
>
1:00:01 Error Generic error in expression
1:00:01 File Exile_Server_Overrides\ExileServer_system_database_query_insertSingle.sqf..., line 17```
Cannot create non-ai vehicle B_APC_Tracked_02_AA_F,?
what dose what mean exility?
Ok one more change to be sure, change that
diag_log _result;
to
diag_log "RESULT:";
diag_log _result;
So we know which one is the entry for result
wait what
Just add extra diag_log so we can find the correct line in rpt
like this private["_parameters","_query","_result"]; _parameters = _this; _query = [0, "SQL",_parameters] joinString ":"; _result = ("extDB3" callExtension _query); diag_log _result; diag_log "RESULT:"; _result = parseSimpleArray _result; (_result select 1) select 0
Other way round
_parameters = _this;
_query = [0, "SQL",_parameters] joinString ":";
_result = ("extDB3" callExtension _query); diag_log "RESULT:"; diag_log _result; _result = parseSimpleArray _result;
(_result select 1) select 0```
Yes
ok
1:10:34 "SC/BIS_fnc_log: [BIS_fnc_preload] ----- Scripts initialized at 10469 ms -----"
1:10:38 "ExileServer - Job with handle 10005 added."
1:11:00 ["ExileServer - Spawning persistent vehicle spawns"]
1:11:02 "[Display #24]"
1:11:04 Cannot create non-ai vehicle B_APC_Tracked_02_AA_F,
1:11:04 "SC/log: ERROR: [BIS_fnc_GUImessage] Unable to create message box"
1:11:04 Error in expression <llExtension _query);
(_result select 1) select 0
>
1:11:04 Error position: <select 0
>
1:11:04 Error Generic error in expression
1:11:04 File Exile_Server_Overrides\ExileServer_system_database_query_insertSingle.sqf..., line 17```
kk
1:16:25 "SC/BIS_fnc_log: [BIS_fnc_preload] ----- Scripts initialized at 10152 ms -----"
1:16:29 "ExileServer - Job with handle 10005 added."
1:16:51 ["ExileServer - Spawning persistent vehicle spawns"]
1:16:53 "[Display #24]"
1:16:55 Cannot create non-ai vehicle B_APC_Tracked_02_AA_F,
1:16:55 "SC/log: ERROR: [BIS_fnc_GUImessage] Unable to create message box"
1:16:55 "RESULT:"
1:16:55 "[0,""Error MariaDBStatementException1 Exception""]"
1:16:55 Error in expression <SimpleArray _result;
(_result select 1) select 0
>
1:16:55 Error position: <select 0
>
1:16:55 Error Generic error in expression
1:16:55 File Exile_Server_Overrides\ExileServer_system_database_query_insertSingle.sqf..., line 17```
Ah ok, parseSimpleArray is good. I know how to fix your error, give me 40 min
Gotta do something first
ok man thanks so much 🙂
You have database error, maybe incorrect query, can’t fix that but I can fix the result error
really you don't understand how much this help means lol been trying for days to fix it. even made a new mission.
ok
for the database error check your extdb logs it might give you a clue to what may be missing from your exile.ini
@frozen knoll
extDB3: https://bitbucket.org/torndeco/extdb3/wiki/Home
extDB3: Version: 1.031
extDB3: Windows Version
Message: All development for extDB3 is done on a Linux Dedicated Server
Message: If you would like to Donate to extDB3 Development
Message: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2SUEFTGABTAM2
Message: Also leave a message if there is any particular feature you would like to see added.
Message: Thanks for all the people that have donated.
Message: Torndeco: 18/05/15
extDB3: Found extdb3-conf.ini
extDB3: Detected 8 Cores, Setting up 6 Worker Threads
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
[01:16:16:666618 -05:00] [Thread 9032] extDB3: Locked
[01:16:55:480806 -05:00] [Thread 9032] extDB3: SQL: Error MariaDBStatementException1: Cannot add or update a child row: a foreign key constraint fails (`exilemod96192`.`vehicle`, CONSTRAINT `vehicle_ibfk_1` FOREIGN KEY (`account_uid`) REFERENCES `account` (`uid`) ON DELETE CASCADE)
[01:16:55:480833 -05:00] [Thread 9032] extDB3: SQL: Error MariaDBStatementException1: Input: insertVehicle:::-1:0:0:0:0:0:0:0:0:0:
is this a fresh db?
heres the thing...
i originally has exile mod and the db 2 version. it was just recently i upgraded. im with gtxgaming for host
so no uid registered to the database yet ? as in no connections to server ?
no successful connections *
no i can connect
but i have a script that i got from github. and i got someone else to edit that script for me. that script was never finished and now i have this problem above
Ok back, can you give link to original script? Not edited
sure
: https://github.com/secondcoming/Persistent-Vehicle-Spawns/tree/master/Persistent
i asked the coder that i wanted the outcome to be that vehicles spawn in random positions on this map instead of spawning them on the road witch the original code was doing to my understanding but he never finished
The _uid variable MUST be changed to a valid UID that already exists in the account table.
done?
_uid = "76561198079956410"; // Needs to be a valid UID that exists in the account table (best to use a server owners uid)
is that your uid?
But this script is not what causes script error
how do i check ?
like uid as in how i login to the database or ?
is this it ?
https://gyazo.com/e08bc9e846691530dccafadb791d95b5
i know i have to do it on the database side of things. just kind of wounding what it might be under or where it is.
The vehicles that this script generates, if they have invalid uid then when server tries to save them in DB that might cause database exception and result returned back to the script is not what is expected
this is my what my db looks like witch one should i maybe find the uid in ?
https://gyazo.com/0bcf4508300d244a5464d06254265fc3
here
76561198079956410
Yeah that uid
ok
Try it and see if exception goes away
Also post rpt with "RESULT:" want to see what is the expected result
Try it and see if exception goes away : the user id was already in there
ill get you the rpt
was it working before or is this fresh database
ill wipe it can run the server
that was a fresh wipe and same thing
2:54:26 "ExileServer - Job with handle 10005 added."
2:54:47 ["ExileServer - Spawning persistent vehicle spawns"]
2:54:48 a3\data_f\proxies\flags\flag_auto.p3d: No geometry and no visual shape
2:54:48 "SC/log: ERROR: [BIS_fnc_GUImessage] Unable to create message box"
2:54:48 "RESULT:"
2:54:48 "[0,""Error MariaDBStatementException1 Exception""]"
2:54:48 Error in expression <SimpleArray _result;
(_result select 1) select 0
>
2:54:48 Error position: <select 0
>
2:54:48 Error Generic error in expression
2:54:48 File Exile_Server_Overrides\ExileServer_system_database_query_insertSingle.sqf..., line 17
2:54:49 "[Display #24]"```
what is the database engine you use, MyISAM or InnoDB?
to connect ?
to connect with client im using : HeidiSQL
and for the server i have no idea what there using im going through https://www.gtxgaming.co.uk/
no when you create table you indicate what engine to use
go to table properties and see which one it is
can you show the same for vehicle
also just incase... since its a fresh db did you turn off strict mode?
this might also help https://gyazo.com/73c1161965c86b3e0e47089b715b29de
im sure the host dose that its
like all i did was click install for exile 64 bit and it dose it all
roger
ok can you show content of vehicle table?
data ?
yeah
nothing
however if i start walking around on the map they will appear in the db i think
like this only for vehicle https://gyazo.com/f070d4388712017c6d0fe75fca2d67bf
that was removed i wiped it remeber
here ill go pop into game and take another screenshot
the account entry has to exist
Meaning ?
I am not sure how you add account entry but the account table cannot be empty
its supped to form my understanding pic random vehicles spawn them on the map
diag_log "RESULT:";
diag_log _result;
@unique sundial I prefer to use
diag_log ["Result", _result]
That will make sure that even in scheduler its always together, and I also find array log easier to look at.
Also....... I don't understand why
parseSimpleArray "[0,""Error MariaDBStatementException1 Exception""]"will throw generic error? Looks like it should work, what am I missing?
Its valid array with number and a string?
hmm
Looks like it should work, what am I missing
nothing, it is not the error, trying to select 2 select 1 is
Ah I missed the second select
that exile code should probably have error handling. But its Exile... So no expectations about proper code should be made
so
yeah it is a combination of errors
the exception you get is because of key constraint, a key doesnt exist in one table so it cannot add entry to another
i just booted up the game and reeshed my db here the strange thing
It could be database misconfiguration or how the scripts are using it
vehicles are spawning from that array however only exile vehicles are making it into the db
the second error is because the result returned is not in format expected, most likely the Exile developer didnt count on error message returned instead of proper result
and accounts table?
"76561198079956410" \N "Gopnik" "0" "0" "0" "0" "2019-11-14 03:11:33" "2019-11-14 03:21:49" \N "3"
I prefer to use
yeah I thought about it, but have already posted, so not to confuse @still forum
@dawn hull you still get the error?
yes
can you show database error log again?
sure man
extDB3: https://bitbucket.org/torndeco/extdb3/wiki/Home
extDB3: Version: 1.031
extDB3: Windows Version
Message: All development for extDB3 is done on a Linux Dedicated Server
Message: If you would like to Donate to extDB3 Development
Message: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2SUEFTGABTAM2
Message: Also leave a message if there is any particular feature you would like to see added.
Message: Thanks for all the people that have donated.
Message: Torndeco: 18/05/15
extDB3: Found extdb3-conf.ini
extDB3: Detected 8 Cores, Setting up 6 Worker Threads
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
[03:21:14:696984 -05:00] [Thread 5152] extDB3: Locked
[03:21:53:957935 -05:00] [Thread 5152] extDB3: SQL: Error MariaDBStatementException1: Cannot add or update a child row: a foreign key constraint fails (`exilemod96192`.`vehicle`, CONSTRAINT `vehicle_ibfk_1` FOREIGN KEY (`account_uid`) REFERENCES `account` (`uid`) ON DELETE CASCADE)
[03:21:53:957964 -05:00] [Thread 5152] extDB3: SQL: Error MariaDBStatementException1: Input: insertVehicle:::-1:0:0:0:0:0:0:0:0:0:
whats insertVehicle show in your exile.ini that will tell you what it expects
and your ExileServer_object_vehicle_database_insert.sqf is it custom or original? what is that showing
custom now
please show
@dawn hull - have you done all the over rides for extdb3?
explain over rides ? please 🙂
current ExileServer_system_database_query_insertSingle.sqf:
* ExileServer_system_database_query_insertSingle
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
* 64Bit Conversion File Header (Extdb3) - Validatior
*/
private["_parameters","_query","_result"];
_parameters = _this;
_query = [0, "SQL",_parameters] joinString ":";
_result = ("extDB3" callExtension _query); diag_log "RESULT:"; diag_log _result; _result = parseSimpleArray _result;
(_result select 1) select 0```
and as elmo said have you done all your extDB overides as exile was written for extDB2 and your using extDB3
dose not exist in Exile_Server_Overrides so its in exile_server.pbo and i have not touched that
ExileServer_object_vehicle_database_insert.sqf is missing?
i did this https://github.com/BrettNordin/Exile
its not in overides then it is in default
to my knowledge exile is to be run on extDB2
it was updated
No it isnt
like its not official
Default exile = extdb2
unless u manually update it and overide your files
but your trying to run custom scripts that are most likely intented for extDB2
you should install extDB2
plus exile wants extDB2 and you probably havnt overidden all of exile files
extdb2 has differant calls to 3
there for default exile files will need updated calls to work on 3
calls / ini are different
https://github.com/BrettNordin/Exile in this your given Exile_Server_Overrides
how ever ExileServer_object_vehicle_database_insert.sqf is missing?
Please show your ExileServer_object_vehicle_database_insert.sqf
@dawn hull - My suggestion, start fresh. Use extdb2 get that working.
Follow default exile install guide.
* ExileServer_object_vehicle_database_insert
*
* Exile Mod
* www.exilemod.com
* © 2015 Exile Mod Team
*
* This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
*/
private["_vehicleObject", "_position", "_vectorDirection", "_vectorUp", "_data", "_extDB2Message", "_vehicleID"];
_vehicleObject = _this;
_position = getPosATL _vehicleObject;
_vectorDirection = vectorDir _vehicleObject;
_vectorUp = vectorUp _vehicleObject;
_data =
[
typeOf _vehicleObject,
_vehicleObject getVariable ["ExileOwnerUID", ""],
locked _vehicleObject,
_position select 0,
_position select 1,
_position select 2,
_vectorDirection select 0,
_vectorDirection select 1,
_vectorDirection select 2,
_vectorUp select 0,
_vectorUp select 1,
_vectorUp select 2,
_vehicleObject getVariable ["ExileAccessCode",""]
];
_extDB2Message = ["insertVehicle", _data] call ExileServer_util_extDB2_createMessage;
_vehicleID = _extDB2Message call ExileServer_system_database_query_insertSingle;
_vehicleObject setVariable["ExileDatabaseID", _vehicleID];
_vehicleObject setVariable["ExileIsPersistent", true];
_vehicleID```
kk i'm uninstalling 64 bit
all the best im sure extdb2 will bring u joy
Input: insertVehicle:::-1:0:0:0:0:0:0:0:0:0:
this should be filled with proper data and uid but it isn't so the key constraint failed. Why this is happening? No idea @dawn hull
He needs to check his ini
hey
```4:20:44 Error Undefined variable in expression: _clanids
4:20:44 File exile_server\code\ExileServer_world_loadAllClans.sqf..., line 20
4:20:44 CallExtension 'extDB2' could not be found
4:20:44 Error in expression <"extDB2" callExtension _query);
switch (_result select 0) do
{
case 0:
{
(format>
4:20:44 Error position: <_result select 0) do
{
case 0:
{
(format>```
this is after i reinstalled extdb2
Right so I have this conditions in an addaction: sqf (player == driver (vehicle player)) && {((vehicle player) isKindOf 'Helicopter') && { ((speed (vehicle player)) < 2) && { (count (crew (vehicle player)) == 1) && { ( (!canMove (vehicle player)) || ((fuel (vehicle player)) <= 0) )}}}
And every individual condition gives me the execpted return (I'm in a GH that's on its side without gear down and without a rotor) but the entire thing together doesn't give me any return. Not true nor false, just nothing. Anybody have a clue why?
Not true nor false, just nothing.
then there has to be a nil in there somewhere, which I cannot see
what I can see however is 4 opening { and only 3 closing }
I'm an idiot, tnx
you don't need parenthesis aobut vehicle player btw
commands with just one argument are always resolved from right to left
Yea, I know
@ruby breach The script successfully gives the AI the weapons as intended but it gives them random magazines not even defined in the script and spawns an ACP45 pistol on them as well, which they then swap to and will not swap back to their primary.
Yeah, that’s you not me
@dawn hull Are you running arma3server_x64.exe?
not anymore
oh exe idk
@finite dirge Yes i am sorry
C:\TCAFiles\Users\alexc2\96192\arma3server_x64.exe -mod="@Exile;@Ravage;@CBA_A3;@CUP_Terrains_Core;@CUP_Terrains_Maps;@CUP_Weapons;@A2ATA3;@Extended_Base_Mod;@ExtendedSurvivalPack;@RHS_AFRF;@RHS_USAF;@Chernarus_2035;@DS_Houses;@CUP_Vehicles;@CUP_Units;@A2ATA3;@infiSTAR_Exile;" -servermod="@ExileServer;@Ravage;@ExileServer;@infiSTAR_Exile;@CBA_A3;@CUP_Terrains_Core;@CUP_Terrains_Maps;@CUP_Weapons;@A2ATA3;@Extended_Base_Mod;@ExtendedSurvivalPack;@RHS_AFRF;@RHS_USAF;@Chernarus_2035;@DS_Houses;@CUP_Vehicles;@CUP_Units;@A2ATA3;" -config=@ExileServer\config.cfg -ip=198.50.232.241 -port=2312 -profiles=SC -cfg=@ExileServer\basic.cfg -name=SC -autoinit -enableHT -loadMissionToMemory -filePatching -malloc=
@finite dirge look closely to his servermod list
ExileServer is so nice he loads it twice?
He loads clients side mods in the servermod parameter as well
the guy from infinisstar help said i should do that shoud i not be doing that ?
shoud i not be doing that
you should not be doing that, thats absolute nonsense
Only servermods you have are ExileServer, and..... seems like nothing else
I'm also a guy from the infiSTAR discord and I would not say to do that, so I'm not sure what you are talking about. You are still running a 32bit extension with 64bit arma, so it'll never work.
theoldman told me to do that. may be he was confused
idk it is what it is
thanks for telling me i though something was off with that normally i would not put my mods into the servermods. but i was just listening to him
Anyone know how to see which turret owns a pylon weapon? setPylonLoadout lets you specify the turret that the weapon will be given to, but I can't see a way to back-trace either that or the turret ownership as assigned through the editor's pylon section in a unit's attributes... 🤔
Also, seems odd that it doesn't look like you can specify weapon owner for preset loadouts, only for the initial loadout?
(Should say for the first part that I realise I can do mashiness via magazinesAllTurrets, but it seems unnecessarily clumsy, and I was hoping I'd just missed a function/feature)
@dawn hull I doubt that TheOldMan told you that.
so this script is really strange. i have a array of vehicles, the server console is saying it can or is only spawning exile vehicles. however on the server if i go into game. there is vehicles from that array spawing but there not being put into the data base some help would he awesome thanks
heres my server rpt :https://pastebin.com/MJgPjsNN
Why ExileServer is listed twice in servermod?
mod="@Exile;@Ravage;@CBA_A3;@CUP_Units;@CUP_Vehicles;@CUP_Weapons;@CUP_Terrains_Core;@Chernarus_2035;@DS_Houses;@Extended_Base_Mod;@ExtendedSurvivalPack;@A2ATA3;" -servermod="@ExileServer;@ExileServer;@infiSTAR_Exile;" -config=@ExileServer\config.cfg -ip=198.50.232.241 -port=2312 -profiles=SC -cfg=@ExileServer\basic.cfg -name=SC -autoinit -enableHT -loadMissionToMemory -filePatching
?
oh
good point ty
== arma3server.exe -mod="@Exile;@Ravage;@CBA_A3;@CUP_Units;@CUP_Vehicles;@CUP_Weapons;@CUP_Terrains_Core;@Chernarus_2035;@DS_Houses;@Extended_Base_Mod;@ExtendedSurvivalPack;@A2ATA3;" -servermod="@ExileServer;@infiSTAR_Exile;" -config=@ExileServer\config.cfg -ip=198.50.232.241 -port=2312 -profiles=SC -cfg=@ExileServer\basic.cfg -name=SC -autoinit -enableHT -loadMissionToMemory -filePatching
Server rpt new one : https://privatebin.net/?1bed0be8620fc7f9#35QA6DoMo3oP1NfNAkSMe6Z5fw7PUHGFC8z6A1yA8mFD
script im using :https://pastebin.com/UpvxkQr1
i was using 64 bit exile but i reverted back now and. trying to fix this script was originally for extdb2
https://gyazo.com/034fe60816bc152c6ec1c844c0781748
can someone give me a idea what this error is saying
It tries to do some stuff on a variable which doesn't exist, most likely because createVehicle failed somewhere before those lines
Or simply a typo
The message actually tells you exactly what is wrong, just finding why is something it can't (nor we without the full scripts)
@exotic flax are you able to fix it for me 🙂 ?
i did not code it im just just to fix it but i have no idea how XD
not a programmer by far 😦
since it's Exile related you probably will have more luck in the Exile Discord channel
(especially since there seem to more errors there which are Exile related)
Is there a way to find out the length/width/rotorspan of a vehicle via script?
boundingBox and boundingBoxReal might be functions which can help you with that
eg. I use the following to get the length of a vehicle:
params ["_object"];
_bbr = boundingBoxReal _object;
_p1 = _bbr select 0;
_p2 = _bbr select 1;
_maxLength = abs ((_p2 select 1) - (_p1 select 1));
_maxLength;
Thankyou!
Question regarding the "onDraw" UI Event Handler and commands like drawTriangle, drawPolygon, ETC; does onDraw essentially function like onEachFrame but only when the map is open? and if so, then the drawXYZ commands only create the shape on that "frame"?
as far as I understand it, the draw* functions will only show for a frame, so using the Draw EH is required to redraw on the map every single frame (which only happens when the map is open)
so my concept is right it sounds like? EX: I wanna draw lines between all group members and their leader of a group only when the map is open, so i could set this up simply w/onDraw and drawLine basically?
thanks Grezany for confirming that for me. I'm not able to test it right now but might use that concept in a project I'm working on
cool, but is the GPS a different control from the main map findDisplay 12 if I'm not mistaken?
correct
private _miniMapControlGroup = _display displayCtrl 13301;
private _miniMap = _miniMapControlGroup controlsGroupCtrl 101;
_miniMap ctrlAddEventHandler ["Draw", {
// draw stuff on GPS
}];
Does allowDamage false prevent rounds to penetrate an object and go through it all the way to the other side ?
Let's say a wooden plank with damage disabled : can you hide behind it and stay safe while being fired at from the other side ?
projectiles still penetrate
it just disables the damage from being applied to the object that they penetrated
Make it as simple object
but simpleObject still has the surface material?
Yeah but have you seen it letting things through?
@still forum I recall you were talking about making an anything -> anything hashmap long time ago, I don't think you have made that, have you?
correct
Ok, I have realised that it could accelerate one my algorithm if I implemented a cache
Then, maybe there is a faster way to generate a string from an array of arrays of numbers, than just using str _array ?
main problem with the map is needing to have a hash implementation for every variable type
@astral dawn if you want fast, Enfusion is this way =>....
Yes is there also Arma 4 that way? No? Don't see it 😄
Me neither
Are there going to be any problems if I setVariable a string which has a length of ~1000 characters?
for the name?
yes
Looks like I have some troubles with Locations... According to BI wiki, setVariable should be able to work on locations. However, if I do the following :
loc = (nearestLocations[player, ["NameCityCapital", "NameCity", "NameVillage"], 1000]) select 0;
hint text loc; //Topolia
loc setVariable ["test", true];
hint str (loc getVariable "test"); //this fails, nothing is returned
hint str (loc getVariable ["test", false]); //this works, displays "false"
Do I miss something ?
Sorry for interrupting @astral dawn, didn't see you just posted a question 😅
maybe you cannot do it on existing map locations
there are a bunch of things you cannot do to them that you can do to locations created by script
You can setVariable on locations created by script, for instance
createLocation ["Invisible", [0,0,0], 0, 0];
@astral dawn no problems
Thx guys, indeed created locations are fine with setVariable... Strange. May worth mentionning on the wiki ?
maybe if you publicvariable those then you will have some problems? @astral dawn
Sure I will have... my application is local anyway
May worth mentionning on the wiki ?
gonna test it to confirm and then add if true
@astral dawn get/set variable is actually slower on 1000 char variable
2 times slower
Hey I need someones help to show me how to add a script to my mission file and make it work
For me getVariable on a string which is 1000 chars long is around 2 microseconds
It's quite fast
compare it with like 10 char string
as everyone has different PCs the total time means nothing
yeah ok, so to clarify, for my situation: my algorithm takes 3+ ms to compute, so I want to implement a cache, for that I do _key = str _this; and see if hashmap getVariable _key returns a cached result... so it should be okay for me 🙂
@still forum did cache revert break your offsets?
It broke the hotfix that I did for cache, I just reverted the hotfix again, all fine
that release before hotfix was odd
no doubts
@astral dawn I tested on player set/get variable. on missionnamespace takes 3 times longer
probably because there are 1753 variables already
yeah i guess so
depends on how.. dunno the word. spread,compacted the hashtable is
it only does hash lookup to find the correct array (out of which it has dozens, for hundreds of variables)
then inside that array it does stringcompare for every entry to find the right one
it should only do stringcompare until it finds the first not matching char tho.. so that should be fast.
But I can certainly see BI doing that improperly
Dedmen, do you know, when two strings are compared, does it compare the data pointer first?
IIRC i've read somewhere, it does this for arrays
Hmm okay... I am thinking of the fastest way to make my cache discard less frequently used entries when it gets too full
after doing object setVariable [varName, nil], varName will still be in allVariables object, is it a bug?
semi bug but not really kinda
First time visitor here, I have tried googling but have not found an answer to my question and friend pointed me here. Is it possible to extract Squad names from list of cargo? What I am trying to do is ( eventually ) have a gui that I can choose a particular squad in my cargo and have a particular squad get out. Is this even possible?
Get list of all units in cargo -> create a list of the group each unit is in -> cleanup list
The problem with that is that some vehicles have gunner positions which you'd probably consider as in cargo, so you'll want to evaluate certain turrets
Hmm...food for thought. Would it matter what position though, if you had say a squad that had filled some turret positions you could still unload / discharge them?
Hello, I'm rather new to scripting in arma, could someone help me with remoteExec and init.sqf since I'm running into some issues
Hello new to scripting in arma, I am dad!
Hello, could you tell me how can I add action to every player that is on the server? This script seems to work if I execute it serverwise (in debug console), however it doesn't do anything when it's in init.sqf
[player, ["Repack magazines", "magazineRepack.sqf"]] remoteExec ["addAction", 0, true];
should only the player be able to access this action, or all players/units?
All players that are on the server
If you put it in init.sqf you don’t need remoteExec
@hazy agate should a player be able to repack another player's magazines?
if not, then just addAction normally, don't remoteExec
No, he shouldn't be able to, he can only do it with his own magazines
Alright, let me give it a try
then player addAction [(...)] yes
Hmm, I still don't see action under scroll
code plz?
player addAction ["Repack magazines", "magazineRepack.sqf"];
Nothing innovative i think
You sure it is init.sqf and not init.sqf.txt? Add some logging to see if the file even runs
Nope, it's init.sqf, been playing with that file for quite a while today and it works
Adding some more things to it now, adding sleep and even moving the line to the very top didn't seemed to fix issue
What happens if you run that line from debug console?
It works perfectly fine, adds the action to player
Yes, init.sqf runs since I also load one more script and set the weather parameters and such
Then it doesn’t execute in init.sqf
or something crashes before that and you don't display errors maybe?
Well I see the syntax errors if I have any right after I get to the briefing, doesn't seem like there are any right now
Do this
[] spawn {uisleep 1;....your code...};
something holds up the execution before then?
Add that at the top of init.sqf
I don't think so, since I moved the execution to the very top and it still did not added action to player
Let me try @unique sundial
Still nothing, this is bizzare 😄
Well thing is I can assure it does run because I can change mission parameters such as weather, I also load a script that shows hints on the screen and I do see them right from the start of the game
That single line for some reason doesn't seem to run with addAction
Add diag_log "something"; at the top and check rpt
do that ^
also try add to initPlayerLocal.sqf
waituntil {!isnull (finddisplay 46)};
player addAction ["Repack magazines", "magazineRepack.sqf"];
Didn't know that there's such tool as diag_log, thanks for showing me, anyway got RPT log, 23:28:51 0 this line is result of addAction, not sure if I did it right but here's script and entire log from mission start
diag_log (player addAction ["Repack magazines", "magazineRepack.sqf"]);
23:28:51 c:\bis\source\stable\futura\lib\network\networkserver.cpp NetworkServer::OnClientStateChanged:NOT IMPLEMENTED - briefing!
23:28:51 [1.17796e+006,37650,0,"XEH: PostInit started. MISSIONINIT: missionName=sandbox, missionVersion=53, worldName=Altis, isMultiplayer=true, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false"]
23:28:51 [1.17796e+006,37650,0,"CBA_VERSIONING: cba=3.12.2.190909, "]
23:28:51 [1.17796e+006,37650,0,"XEH: PostInit finished."]
23:28:51 Weather was forced to change
23:28:51 Weather was forced to change
23:28:51 Weather was forced to change
23:28:51 0
23:28:52 Mission id: ad20d7251d871a0215aca8ef79fb1467566757e3
23:28:57 Duplicate weapon Throw detected for B_officer_F
23:28:57 Duplicate weapon Put detected for B_officer_F
Let me give it a try @frozen knoll
So you see the action?
Nope, still don't see it via init.sqf, trying with initPlayerLocal.sqf now
According to the log it is added. Try verifying local files via steam
Execute in debug console
hint str actionIDs player
What is the result?
Well empty array []
Killzone_kid? I dont see your name for soo long
I tried initPlayerLocal.sqf, still nothing for some reason
Then some script removes the action you added
That is also a possibility, I do not have any sciprts that do that, only mods that I run is CBA and ShackTac display
Should show [0]
I don't think they alter anything to be honest
There is only 1 way to find out, disable all mods
Yup, giving it a try now
Well, still nothing even on full vanilla
I think I found the issue, checking it now
the code is fine... test on a fresh mission without any other scripts then one by one add other scripts back
Yup, I feel like an idiot
Turns out respawn system broke everything
Running player addAction ["Repack magazines", "magazineRepack.sqf"]; in onPlayerRespawn.sqf fixed the issue
Found some info on forum that it's action is not persistent and needs to be assigned on each respawn
you run respawn on start i guess?
Nope players need to click respawn, I'm gonna change that so they respawn automatically right from the start without doing anything
Anyway thanks for the help everyone!
If I wanted to change the magazine capacity and ammo type of a gun, could I do it in the editor init of the gun?
how would i call for some code in a addon, and then tell it to disable/not use a certain please of code ?
example C:\Users\pc\Desktop\exilemod editing@Ravage_Server\addons\ravage\code\survival/inventory.sqf
call inventory.sqf "addons\ravage\code\survival"
but i have no idea how to tell it to disable this
Hi all! I'm having a pretty random problem with: loadFile
while {true} do {
_contents = loadFile "textDoc.txt";
if (_curUser != _contents && _contents != "") then{
etc, etc
sleep 10;
};
The problem I'm having is that whenever I put the loadFile in a loop, regardless of how long the sleep in the loop is, ARMA permanently has the file open and I'm unable to modify the file with note pad or any other program while the mission is running. ARMA doesn't seem to have the file open permanently if you just call it once so it seems to be something to do with having it in a loop...
Anyone know if there's some sort of closeFile function or some way around this?
Hey guys, bit of a random question but does anyone know of a way either using Notepad++ or Sublime Text to automatically format your SQF code. Meaning automatically add the indentations for the entire file (Too make it look prettier/cleaner I suppose) rather than having to do it manually?
Not sure if this still works, but here @modern sand https://github.com/billw2012/vscode-formatter-sqf
(vscode tho)
Thanks, I'll give it a try
Just further to my last, it turns out even without the loop loadFile keeps the file open until the mission ends. Anyone know if it can be closed somehow?
Ok, I didn't know that INIDBI2 was a thing. It can do exactly what I need 😄
So im using this script for spawning vehicles in but its not saving them all to the db and after restart there gone
https://pastebin.com/d2e7wPnp
error in console
3:39:03 "ExileServer - Job with handle 10005 added."
3:39:21 BEServer: registering a new player #427682043
3:39:26 ["ExileServer - Spawning persistent vehicle spawns"]
3:39:27 "[Display #24]"
3:39:28 Cannot create non-ai vehicle B_APC_Tracked_02_AA_F,
3:39:29 Error in expression <llExtension _query);
(_result select 1) select 0>
3:39:29 Error position: <select 0>
3:39:29 Error Generic error in expression
3:39:29 File exile_server\code\ExileServer_system_database_query_insertSingle.sqf..., line 16```
We are using
if(isClass(configFile>>"CfgPatches">>"modname"))then{
endMission "LOSER";};
to blacklist certain mods. It is for a private server and guys are starting to take more chances and in short, it will be a pain to find and blacklist all the force zeus and arsenal mods.
Do not want to whitelist Keys as we are using steam workshop and if a update releases just before or during a OP we do not want to wait for updates before we can start.
Is there a similar script that checks for "permitted" mods and allows the client to connect still allowing certain optional clientside mods like JSRS or Blastcore without forcing those mods on everyone?
Hello, anyone have idea how to loop animation on player until certain condition or disable movement for the player during the animation? I want to loop animation where player "uses" his inventory but whenever I put some input on the character he stops the animation.
@hazy agate while, waitUntil and animationState 😉
Do I need to run remoteExec on animation or I can just use _caller switchMove "anim";
https://community.bistudio.com/wiki/switchMove says the argument has to be local
Alright, forgot the player first argument
If you're in a multiplayer environment you have to run it on all clients if you want all clients to see the anim, as it is a local command
Which leads to a question: is it more efficient to:
- run a quick check to see how many players are within, say 200m and only remoteExec switchmove on them on the theory that it doesn't make sense to run it on a client who won't see it, or;
- just remoteExec it on all clients, for more network traffic.
@worn forge Argument local, Effect global
"In order for the animation to change immediately on every PC in multiplayer, use global remote execution"
to change immediately
but I agree, in this case it can be remotely executed
If you're in a multiplayer environment you have to run it on all clients if you want all clients to see the anim, as it is a local command
This ☝ was incorrect though
remoteExec is to have an immediate sync, with the downside that if an anim is supposed to remain, it would only be temporary if target is remote
Is there a way to customize the respawn screen just a bit? Maybe CBA has patched its function?
I'd like to set different marker names
I am a Newb scripter, could anyone please help in telling me how I can determine what group names are in a vehicle via script?
Sure, just push group of each crew member of vehicle into the array
use crew and group command for that
If I wanted ALL then I would have to choose cargo also, is turret covered by crew or vehicle dependant?
it returns literally all units in the vehicle
driver, gunner, commander, etc, and those who are in cargo seats too
Oh, I always thought cargo was seperated...huh good to know, cheers
Good morning. Has anyone of you tried directly applying damage to a player via ACE3's fnc_addDamageToUnit ? I couldn't find info on the scope of it - I would assume the arguments and effects are local, but I can't try it out at the moment
once did exactly what you're trying to do
followed this thread
https://forums.bohemia.net/forums/topic/219273-how-to-script-damage-to-specific-body-parts-in-ace3-environment/
Seriously, how can people develop A3 scripts on stable with -showScriptErrors off? I dont even....
if warnings/errors are disabled, they don't exist 🤣
Given the amount of crap that ends up in the .rpt file ("Server: object not found" hundreds of times) I'm sorely tempted to run without a log, except for the diag_log messages I put in there...
On servers and during regular play time I usually also have errors disabled, just to prevent having huge RPT files.
However when I'm working on mods, missions or scripts in general I always enable errors to make sure nothing is broken...
and even then some stuff pops up afterwards...
Hello everyone in the scripting community! New fresh meat here. I'm trying to get into scripting for Arma 3, and I have next to no experience in coding. My only "experience" was back when I was 15, I spent 3 days on making 50 lines of code for a minecraft server plugin that only said "JQM plugin activated!" in the server console, and it didn't even work. So, other than read the wikis in the pictures (i'm currently reading them all), how can I get into coding?
https://i.gyazo.com/9ab938439538a979e1ac3840551fe41c.png
https://i.gyazo.com/da01b4ac26df296235ee8d15c1df39b2.png
https://i.gyazo.com/8d0c5b0cec26eab4a18a9063cf33c1b8.png
Practice
Make some goal for yourself, like 'I want to make ..., ..., ... in ARMA', and try to solve how to reach that, asking questions here, but check biki first
@tough abyss http://killzonekid.com/category/tutorials/ is made for newbies in arma
That link is definitely going into my bookmarks
Guys, i need some help, for some reason the following code doesnt execute nor throws any error
it just gets skipped
{
[_x] call clv_fnc_puntosSpL;
}foreach Sectores;
i added hints inside but it doesnt call the function
that function is defined inside a functions.hpp and included in description.ext
😰 pls help
Dude, you provided no information
@unique sundial Sorry, i was in a hurry, i managed to fix it. Ill leave a piece of advice for anyone scripting. IF YOU COMMENT ANY TYPE OF LOOP, PLEASE FOR THE LOVE OF GOD, CHECK IF YOU LEFT ANY { OR } UN-COMMENTED
the script was made by a friend and he commented some parts incorrectly
You still haven't given us anything, really. What is contained in the Sectores variable? What is in that function you're calling? Pastebin both of those for a start
Are there any known practical limits of variable size for setVariable into profile namespace?
I'd assume if arma can hold a variable in RAM then it can serialize that into a file easily?
Probably yes to the latter. What's your use case @astral dawn
Well, potentially some kilobytes per profilenamespace variable
array with strings and numbers and arrays
As UI uses profileNamespace by clogging it you can potentially make UI laggy which would deteriorate user experience. I’d say no to using it for anything other than saving small amounts of data
@astral dawn at our unit, we're using profilenamespace to store mission state (units, objects, loadouts, tasks…). cant say how large those get off the top of my head, but you should be fine… at least no one has complained yet 😬
ah, but we do it on a dedicated server, so UI is not an issue there 🤔
Hey guys, how do you use createVehicle and spawn in the vehicle that you've spawned?
player moveInDriver _veh;
Ok, will try tomorrow 🙂
I've created an addaction to open the strategic map as a mean to teleport around the map but I can't apply a teleporter to each "mission"
the strat. map when in script works like this
, // 0: Position - 2D or 3D position of mission
, // Script code that is being executed after player clicks
"", // String - Mission name
"", // String - Short description
"", // String - Name of mission's player
"", // String - Path to overview image
, // Number - Size multiplier for overview image (Same for markers.cfg)
// Array - Parameters for on-click action.
],```
I've already understood where I need to place the teleporting script but the ones I know dont seem to work
what should I use to have MP players teleport when clicking on the mission?
@unique sundial thanks, that's for saving game world state anyway, so when the save happens, the game should freeze
I'm trying to loadouts with getUnitLoadout on a custom faction, which does return all the units I have (in ACE Default Loadouts), but custom weapons (with attachments) and backpacks (with contents) are not being included.
To me it seems to be related to (a broken) BIS_fnc_baseWeapon and BIS_fnc_basicBackpack, but perhaps I'm doing something impossible...
do note that the custom weapons and backpacks have a scope of 1, to prevent them from showing up in the Arsenal
What is broken in BIS_fnc_baseWeapon and basicBackpack and what getUnitLoadout has to do with these functions? @exotic flax
getUnitLoadout gives the exact loadout (including custom items with scope=1) which are then given to ace_arsenal_fnc_addDefaultLoadout (which is compatible). However ACE is using BIS_fnc_baseWeapon and BIS_fnc_basicBackpack to find the core configs (without attachments/contents).
This breaks the loadout, because it can't find the base weapon/backpack (not to mention it doesn't handle the attachments/contents, but that's another issue).
But like I said, perhaps I'm doing something impossible or completely wrong
So in which way both those BIS function are broken? @exotic flax
For the love of god I can’t figure out what you are saying
they don't return the base class, even when setting baseWeapon in the configs...
actually, it's a vanilla feature... just check the function in A3\Functions_F_Bootcamp\Inventory\fn_baseWeapon.sqf (line 26)
and ACE uses it to prevent issues with duplicates (like predefined attachments and pre-filled backpacks), just like vanilla Arma does
or stuff like TFAR/ACRE radios with a shitload of ID's to make sure only the core class is returned
tfar actually doesn't use baseWeapon.. probably should 🤔
In MP when player dead, I see bird.
I wish people have spectator, but I not wish see bird.
I have this setup: respawn = 1; respawnTemplates[] = {"Spectator"};
Ah yeah, looks like it is vanilla, and the function looks ok, what is broken? If there is baseWeapon entry it should return the content. @exotic flax
they don't return the base class, even when setting
baseWeaponin the configs...
You have repro?
respawn=1; is respawn as seagull @last rain
It is engine param
at this time I don't have a contained reproduction, will try to make one
@unique sundial
respawnTemplates[] = {"Spectator"};```
it is working in MP? I think respawn=1 need if you use "Spectator"
sleep 5;
this enableSimulation True;
this allowDamage True;
``` getting generic error in expression?
trying to enable & simulation & damage on a vehicle that has simulation & damage disabled through editor.
this is only valid in one context (init box in editor) and in init box in editor you cannot sleep
you can wrap it in a spawn {}, and pass the this through like this spawn {_this enableSim...}
k thanks
Can anyone tell me how I can detect if the RHS Tochka has been fired? Not sure how to use EventHandlers
Basically what i want to do is place a marker on the position of the launcher with createMarker, but i need to detect when it fired
fired eventhandler is probably the thing you want
massive dump coming, ill wait till you guys finish
this addEventHandler ["fired", createMarker in the init of the vehicle ?
yeah i saw that page, but like i said... i dont really know how to implement EventHandlers
youre in the right path with the addEventHandler command
here we go
description.ext:
#include "functions.hpp"
functions.hpp:
class CfgFunctions {
class fnc {
class rmStarterInfo {
postInit=1;
file = "\fnc\fnc_rmStarterInfo.sqf";};
};
};```
fnc/fnc_rmStarterInfo.sqf:
```sqf
starterInfo = ["starterInfo1", "starterInfo2"];
{deleteMarker _x} forEach starterInfo;
hint "it works!";```
calling fnc_rmStarterInfo does not work
does not get postInited either because i dont see hint
hälp
this addEventHandler ["fired", createMarker ["Launch Detected", position SCUD]; or am i thinking too simple here 😛
this addEventHandler ["fired", "createMarker [""Launch Detected"", position SCUD];"]; should work
thanks i'll try that
but that's all i need according to the example 😦
ah the scud
Im not sure if its a weapon
in the Arma sense that is
what do you use to fire it?
but that's all i need according to the example
Did you read the text in orange box?
your object should be named SCUD
SCUD addEventHandler ["fired", "marker1 = createMarker [""Launch Detected"", position SCUD];marker1 setMarkerShape ""ICON"";marker1 setMarkerText ""Launch Detected!"";marker1 setMarkerType ""hd_dot"";marker1 setMarkerPos getpos SCUD"];```
@quasi thicket
tell me if it works
anybody have any idea how to fix this here? https://discordapp.com/channels/105462288051380224/105462984087728128/646054472107163689
welcome
Hi-ho, might be being a tiny bit dumb, but at current I have the following thing I'm trying to do:
Addaction to a object to change a units equipment to whatever is contained within the .sqf for such item. At the current moment I have a rifleman loadout exported from arsenal within the .sqf file, an action on the object to give it, however when the action is selected nothing happens
Show the code, noone has a 🔮 here
On the item the action is attached to:
_actionID = this addAction ["<t color='#FF0000'>Get Rifleman Loadout</t>","Loadouts/rifleman.sqf"];
Rifleman.sqf (due to characters I've pastebinned it): https://pastebin.com/UgtmAKah
Hmm I've never tried to pass file path into addAction. Does it running the script with call compile preprocessfilelinenumbers "Loadouts/rifleman.sqf"; give you the effect?
oh, in fact I know what the problem is
this is wrong
it's because arsenal exports removeBackpack this and similar commands, this variable only exists in init field of a unit
yeah
so... you could add this = player; into your rifleman script
still does the same with this = player; in the rifleman.sqf
@astral dawn no, the script is execVMed if you pass script path to addAction. As for arsenal, there is an option to export for use in scripts instead of init, the unit uses _unit variable
nothing on google, forum & yt I can find helps either tbh
first make sure that running the script in question produces result alone
without addaction
so just slap the script itself in the init?
Has anyone got a script for damaging the helicopter i.e tailrotor in eden
call compile preprocessfilelinenumbers "Loadouts/rifleman.sqf"
absolutely nothing happens
Seems odd that nothing seems to appear anywhere as its such a simple thing I'm tryna do
well we have told you already that the problem is in this variable
and possible solutions are, re-export from arsenal as KK said
or do this = player; at the top of script
Where is this script called from?
from action context
AddAction context?
well yes, it's inside addAction
_actionID = this addAction ["<t color='#FF0000'>Get Rifleman Loadout</t>","Loadouts/rifleman.sqf"];
Its basically meant to give a preset loadout from a .sqf (exported from arsenal) to an action on an object (not player)
fixed slash issue, still doesnt give any effect
but... we have explained to you the problem... this variable... 😢
You need to use (_this select 1) instead of this
When action code gets called it gets these parameters
Parameters array passed to the script upon activation in _this variable is:
params ["_target", "_caller", "_actionId", "_arguments"];
target (_this select 0): Object - the object which the action is assigned to
caller (_this select 1): Object - the unit that activated the action
ID (_this select 2): Number - ID of the activated action (same as ID returned by addAction)
arguments (_this select 3): Anything - arguments given to the script if you are using the extended syntax
slaps everyone for not seeing that
slaps back because it works too
regardless I have tried all of the suggestions and to no avail, which is confusing
thats what I'm looking at doing.
You need tools for debugging? CBA has a good debug console. Arma Debug Engine helps find scripting errors.
Slinging the stuff from rifleman.sqf into the units init gives the exact stuff. I should also have the debug stuff to hand :}
Okay all I get out of it is: unit cannot be null
But thats all I get out of the debug console for both bits of code
I've just noticed something I am a f**king idiot.
So my files (sqfs) were going into the mission path. Where as eden was making ~missionpath
@astral dawn Now I've found that out I did the this = player; and the script works fine, thanks for helping out <3
keep in mind that this is a global variable
and if your script is scheduled, you may run into weird problems that won't make any sense to you
mhm, one other question I had, there's not a like low limit to how many addactions can be attached to one object?
Probably but its not like, a low number
max int or something like that
max int / 2 xD if it's signed
its RV engine, ofc its signed
array lengths are always signed
just in case you have to handle a negative size array sometime
Hang on a second...
@warm iris , "mhm, one other question I had, there's not a like low limit to how many addactions can be attached to one object?"
If you're considering performance and especially if the "object" is player the important factor is conditions. I think some lazy scripting can help here.
I'm sure there's a technical limit of the amount of addActions an unit or object can have, which most likely will hit due to memory limitations instead of integer limitations.
Although I also believe that it's near impossible to hit that limit on realistic use cases...
That said; unless an action is for a player himself it will make more sense to add actions to an object instead, which will prevent the action from being active all the time (since it won't do anything unless someone gets in range, except for checking if players are in range)
2D UI will most likely crash before reaching that limit yes 😄
I'm looking to put a player into a sitting position after selecting an action.
I may have misunderstood but I've tried using "switchMove" to get them into it a sitting animation
I'm hoping to see if someone here knows more on what to do
an animation to get into said position is also an issue
How do you use cursorTarget to move your player inside a vehicle you are pointing at. (your player intro driver seat)
I know player moveInDriver _veh;
But I don't know how to use cursorTarget to look at a vehicle and go in the driver seet
@bold kiln player switchMove "AidlPsitMstpSnonWnonDnon_ground00";
you can find animations in animation viewer under tools in 3den editor
Hi all! I asked about this late last week, but didn't get any nibbles at the time - query about scripting pylons, and determining which turret "owns" which hardpoint.
As far as I can see, there aren't any functions that directly return this information, nor can I see any way to reliably deduce the information from other means (such as examining weaponsTurret/magazinesAllTurrets, as these collapse duplicates and don't provide pylon-respecting ordering between the various turrets).
Anyone got any knowledge of this? Is it really a gap in the game, or have I just missed something?
(Use case is I've got an in-mission loadout UI that's working fine, except for knowing who the pylons currently belong to on loading the UI)
I guess you can take a look at how BI do it, iirc, they correctly show pylons placement on their loadout menu
If you're talking about inside the 3den editor, then that looks like it's because it's reading the data out of the mission.sqm itself, as an editor attribute
If you're talking about something else, then would you mind elaborating as I'm not aware of anywhere else it appears?
This might be a nooby question, but is there any way to reload an addon/extension without having to restart the game?
no
@scenic pollen what exactly you wanna do? Because you can load files outside pbos or enable filePatching for Not compiled final functions
@spice axle Mainly I'm interested in reloading an extension. I guess this isn't possible
Is it possible for you to change the extension file name? Because that could be possible to "deactivate" the cached extension. Possibly complete wrong but give it a try
Thanks, I'll give it a try 🙂
You could use extension to load second extension then you can unload and load second extension without restarting the game
Could also use http://killzonekid.com/callextension-v2-0/ if you’re just writing extension and need quick way of testing it
A freeExtension could be quite useful
unloadExtension*
extensions could force themselves to stay loaded, which might confuse arma when it tries to re-load it
One also could use SQF-VM to test his extensions (including potential SQF-Wrappers 😉)
I'm actually going to use SQF-VM for late-night coding when I travel in a month
Do not forget to update before you do then 😉
or, if no new release yet out, ask me for a lil snapshot
so you will be having the latest features
Will keep it in mind unless I forget as usual
@unique sundial says we need to skipTime on the server but how do we actually do that? Say we have an addAction with skipTime as the code, how do we make sure it is executed on the server?
Who says what?
remoteExec?
Does anyone know where I can get a script that will allow a player to Lock & Unlock land vehicles, and if possible claim it maybe through there steam id. Thank you
Regarding the "ACE Arsenal | Default Loadout" bug I described yesterday, I managed to lock it down to ACE and created a bug report (with reproduction code). Let's see how this is going.
https://github.com/acemod/ACE3/issues/7275
@unique sundial , you know what you did! :P
@still forum , remoteExec-- so put the function in it's own sqf and then in the addAction remoteExec that .sqf?
you don't have to remoteExec a file, but sure could do that too
I can remoteExec a function within a file?
ah- okay
I mean like in an addAction I can use braces instead of quotations but like, say in GUI "action" I cannot
check biki
none of the examples use braces. I mean like this,
[] remoteExec [{skipTime 6}];
syntax error
yup
remoteExec right side array takes string
if addAction can take code, then it probably can
just check the datatypes listed on biki
it's not really necessary for this example but I was curious for other uses. I'll research and play around with it a bit. Thanks @still forum
I can't blanket answer that for other uses
the answer is on the biki page for your specific use
[6] remoteExec ["skipTime", 2] ?
@worn forge , yes I think that's it
is there any forward thinking benefit of sending JIP variable?
what do you mean?
@winter rose , c'mon man, you know I have no clue what I mean 😄
my bad :p
@still forum , shows me something cool and then I ask a bunch of stupid question until I have 2 weeks to play around with it-- just let me go through the motions! 😄
I usually spend 2 weeks breaking my neck over an issue, ask it around here and Dedmen gives an answer in 2 minutes 🤣
or any of the other scripters around here
Or I just scream at you to read biki
or that...
GOM encouraged me to use the biki early on-- and I do, it's my bible, but sometimes chatting here yields better and more complete understanding (usually in context)
sure, ask precisions here all the way
but if you are "hey, what does setDamage do?" be ready for a flame wall 😄
hey, what does setDamage do?
assigns X to the damage variable of the unit
or in short, sets the damage.
so unit getVariable ["Dammage"] returns the damage @still forum ! oooh, smartz
I really love that typo... damage vs dammage 😉
And then why make a damage command, when you can getDamage instead!
you can use,
unit getVariable ["Dammage"];
!?-- see we do learn new things all the time!
no, you can't
sarcasm.exe has stopped working
Lou just made a joke
I still learned that you can't do that... 😄
Long story short is always:
- Check the BIKI
- If questions remain, #arma3_scripting
- and don't listen to Lou 😄
- Check BIKI
- Check source code
- Ask around
- Report bug
- Blame Lou
Always
well the other thing is several times I've had "working" code I posted here which got majorly improved because of scathing indictments of my intellect (it's waning as I get older for sure)
Answering the question of JIP
[6] remoteExec ["skipTime", 2, true] probably isn't necessary because in this case you're sending the command to the server, which (I don't think) will ever JIP
time is synced at join
jip makes no sense, also jip is only for clients, the aim was to run skipTime on server right?
thanks @worn forge
Educating me re JIP: doing something like
[player] remoteExecCall ["removeAllWeapons", player, true]
means that when the command is added to the JIP queue, so when a new player joins, it's run on that player: yes/no?
no
player is a single object, it will be executed on a single player
which is the local one
(I don't use this syntax or method as I use onPlayerRespawn.sqf to establish things)
so in this case remoteExec makes no sense at all since player is already local
I guess I'm looking for a use case where this would be the preferred method
can't think of any
Ha! Thanks Bohemia
if you want that, you should probably have that in initPlayerLocal
Yeah I have a mix of initPlayerLocal and onPlayerRespawn
Thanks @unique sundial @still forum @queen cargo for answering my question about loading extensions. Just saw your replies 🙂
"can't think of any"
that's why I was asking @still forum
Actually that's not true, I do use the JIP queue for something
liar
When server runs a mission script and uses BIS_fnc_holdActionAdd to add an action to an object, I do use the JIP flag set to true, so that a new player joining also has the holdAction added to the object
that would be a example of that being a thing
Yup
but also sounds like it could just be in initPlayerLocal
Well, the player client would have to know about the existence of the object, and then run a script to sync the action to that specific object
I guess something like publicVariable from the server attached to onPlayerConnected eventHandler?
dunno what you are really doing, might be that its really the most optimal way
I think it is
[eastWind, "Deactivate Device...", "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\intel_ca.paa", "", "_target distance _this <= 2.5", "_target distance _this <= 2.5", {}, {hint parseText format ["Deactivating device...<br />%1%2", round (((_this select 4)/(_this select 5))*100), "%"]}, {deviceDeactivated=true; publicVariable 'deviceDeactivated';}, {hint 'Device deactivation aborted.'}, [], 45, 10, true, false] remoteExecCall ["BIS_fnc_holdActionAdd", 0, true];
You saying I'm spamming the channel? Others have posted more 😛
@worn forge , I don't think ded is saying you're spamming, no. Just formatting the script makes it easier to read
its a pile of goo
I don't dare try to format anything according to anyone's standards, as there are so many to choose from
we'll take line-by-line as default
not gonna read your code if its too cumbersome
To be fair, I'm happy with my code and it works for me, I presented it for others as context for why I'm using it
But because I'm Canadian, I will accommodate
[ eastWind, "Deactivate Device...", "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\intel_ca.paa", "", "_target distance _this <= 2.5", "_target distance _this <= 2.5", {}, {hint parseText format ["Deactivating device...<br />%1%2", round (((_this select 4)/(_this select 5))*100), "%"]}, {deviceDeactivated=true; publicVariable 'deviceDeactivated';}, {hint 'Device deactivation aborted.'}, [], 45, 10, true, false ] remoteExecCall ["BIS_fnc_holdActionAdd", 0, true];
better :3
Thanks Dad
You can wrap your code in
```SQF
// Your Code
```
To make it look nicer 😉
// Your code
nicer dicer
Between here and reddit I can't keep the formatting tips straight. You're lucky I figured out about the tilde
tilts me
You can global exec skipTime it won’t hurt
Just ignored on clients, yeah?
Nope, but soon to be re sync by the server
Don't understand Lou
Will immediately sync every client
I understand that skipTime is a server-only command, so running it globally means only the server will run it, it will be ignored on the clients, and the server will act to sync every client with the new time
No, both server and clients will execute it, however the server will sync with the clients anyway. So clients will technically execute it twice
it will be ignored on the clients
A client executingskipTimewill see the change for a short period of time (+-5 seconds) and then the server will revert the client's time back
Even though the immediate effect of skipTime is only local, the new time will propagate through the network after 30 seconds or so.
In Arma 3 (around v1.14) skipTime executed on the server will get synced in 5 seconds or so with all the clients. It will also be JIP compatible. skipTime executed on a client will change time on client for about 5 seconds after which it will sync back to server time.
Alright then the wiki is a bit misleading as it has the SE/Server tag on the top, which suggests it's only used/usable by the server
It also works in SP, but for MP it's the server who takes the lead on it (even when not executed by the server)
Well yes that's clear now thanks to this channel, and reading through comments on the wiki, my point is just that the wiki is somewhat misleading on the issue.
No the biki is not misleading, SE means it should be executed on the server to function properly, which you do if you global execute it. It is just that effect on clients will be immediate with global execution
I'm actually a bit more confused now
either of these is what I'm trying to accomplish,
_obj addAction ["Wait 6 Hours", {
skipTime 6;
titleText ["Waiting 6 hours...", "BLACK FADED", 0.4];
}];
_obj addAction ["Wait 6 Hours", {
[6] remoteExec ["skipTime", 2];
titleText ["Waiting 6 hours...", "BLACK FADED", 0.4];
}];
Let's say time is 06:00 on client and server.
You execute skipTime 6 on a client > Client skips to 12:00, Server stays at 06:00 and then a few seconds later, the server re-syncs the Client to 06:00.
You execute skipTime 6 on the server > Server skips to 12:00, Client stays at 06:00 and then a few seconds later, the server re-syncs the client and the client jumps to 12:00.
You globally execute skipTime 6 > Client and Server both skip to 12:00, so when the Server syncs the Client it essentially has no visible effect
so no matter what it won't produce the day/night effect I'm looking for it will simply change the digits on the clock?
If it's Noon and you execute skipTime 12 globally, Clients and Server will immediately go to midnight. This includes sun/moon effects
I'm sorry I honestly have no idea how to skipTime globally
I assume that's what this does in SP,
_obj addAction ["Wait 6 Hours", {
skipTime 6;
titleText ["Waiting 6 hours...", "BLACK FADED", 0.4];
}];
Read the params
but isn't that,
[6] remoteExec ["skipTime", 2];
?
That's not globally, no. As stated in the wiki
targets (Optional): [default: 0 = everyone]
Number
When 0, the function or command will be executed globally, i.e. on the server and every connected client, including the one where remoteExecCall was originated.
When 2, it will be executed only on the server.
When 3, 4, 5... it will be executed on the client where clientOwner ID matches the given number.
When number is negative, the effect is inverted. -2 means execute on every client but not the server. -12, for example, means execute on the server and every client, but not on the client where clientOwner ID is equal to 12.
titleText ["Waiting 6 hours...", "BLACK FADED", 0.4];
Also this will only make the screen black on the client that executed the action, you need to remoteExec that too
Or just [6] remoteExec ["skipTime"];, yes
@cunning crown, thanks that'll be tomorrow's problem 😄
@ruby breach , thanks-- that's probably the clue I need to start making sense of this
@cunning crown , looks like kk already solved that one,
[["Test Message", "PLAIN", 1]] remoteExec ["titleText"];
Alright it looks like I am going to split the hair quite finely:
LE: Commands utilizing local arguments: Arguments of these scripting commands have to be local to the client the command is executed on.
GE: Commands utilizing global arguments: Effects of these scripting commands are broadcasted over the network and happen on every computer in the network.
SE: Commands requiring server side execution. Scripting commands that must be executed on the server to function properly.
In the case of skipTime, SE is a bit misleading because it has a dedicated synchronization function. In single player it's fair to say it's accurate because client=server, but it's muddy when it gets into multiplayer
for skipTime to function properly, it must be executed on the server.
Yes that is what it says on the wiki - not disputing that.
It's not really misleading though. If you want time to actually skip the way the command is intended to, that's how it has to be done. Regardless of SP or MP
I'm not even sure why or how I'm discussing this. I just use skipTime on the server, like the wiki suggests and seems to intend. Others have indicated you can use it in on the client, where there seems to be no real point, especially in an MP environment.
Yup
in Arma 3 it is sync'ed at least
owner command can be used on client too, but always returns 0
Well I did indeed click on the icon, as that's where I copied and pasted that text in all 3 cases
You're not wrong that it doesn't say server ONLY, but don't try to convince me that "must be executed on the server" implies anything else
It doesn’t but it also doesn’t limit it to server only execution, not sure where you see contradiction
I am fine to officially move on from this conversation, perhaps pretend it never happened
Alternative to calculate path (Example 3) https://community.bistudio.com/wiki/calculatePath no double execution
first time hearing of "double execution bug" maybe it should be mentioned in description?