#arma3_scripting
1 messages ยท Page 378 of 1
onButtonClick = "[] spawn life_fnc_useItem;";
Yes but in that script
I call the storagebox script
So I can simple spawn that one
And keep the call for useitem
Yes, but I hope you understand what I mean by call having no influence. There is no dichotomy of call vs. spawn and it's a common misconception.
We just love teaching people rather than just giving them the answer too much..
People will think we are rude or trolls
Yes yes I read some more information now on what about you are talking.
And it's more clear to me now.
I also fixed another issue with this
On another script i had an uisleep running unsheduled
Was also erroring didn't understood why.
Now I knew and removed the sleep.
:)
You can use canSuspend to check if suspension commands are allowed.
For debugging.
Good I finally understand why that other script was also in the rpt log
Never understood why it was wrong ...
As I used the same sort of code in other script.
But those are called.
Read some kkk blog info about it now also.
Since the biki is still in maintenace mode
help we need the biki back. people are turning to the kkk for help now!
KK? I thought he was gone?
Kappa
Read some kkk blog
O_o
๐๐น
@little eagle Idea! #dev in Slack
Everything is a Namespace!
15 hashMapSet [key,value]
"helloWorld" hashMapSet [key,value]
If the value that is used as a hashMap isn't one. Then it automatically creates one. And everytime it sees the same value it uses the hashMap it created earlier
Not really different from just using Variables but....
What are hash maps?
Lgtm. Needs no create command. But on the other hand, it's not very consistent with sqf.
@tough abyss Namespaces
basically
It's friggin weird yes.. But that's what makes it awesome
And not basically?
Arrays, but you don't use indices, but strings for your items.
Namespaces. But my hashMap can accept any type as key not just strings
The awesome thing is you don't have to store it in a variable. Meaning no one can call allVariables on anything and get it
Yeah, true. Any type.
so you can have a secret key which is a number. And only things that have the secret key can access the map
It's what SQF should've added 4 years ago.
The problem is. Garbage collection
is what we can hopefully add by ourselves in future enfusion engine based cames, aka dayz and arma 4
How should the hashmap know that it's last reference was deleted if there is no reference to it
@barren magnet - 4rm4.
@barren magnet We can already somewhat do it right now in SQF.
I just doesn't make sense because it's so friggin slow
by adding numbers to the start of the varName you store ascends
Enfusion will only really change the speed and add OOP to it
higher thonking ๐
wait, better, create an object at 0,0,0 and delete one everytime you remove a ref
sure thing, but there are more interfaces that could be opened to us in the engine. Also no matter what you do current arma is not the best when it comes to speed
Pretty sure @alganthe#8904 works for BIS.
Hey guys, in the absence of the BIWiki, does anyone know offhand what number getDLCs should be putting out for the Orange DLC/
*?
I think he means the number used as modID
Not even on Biki btw
@lone glade from Biki
288520 - Arma 3 Karts
Karts steam page http://store.steampowered.com/app/288520/Arma_3_Karts/
See?
That is the number
@still forum cheers mate, that's exactly what I was after
CfgMods also has the ids.
Appreciate that pal
Do you know if it returns the appID array as strings or integers?
Arma 3 107410
Unknown -1
Arma 3 Zeus 275700
Arma 3 Helicopters 304380
Arma 3 Laws of War 571710
Arma 3 DLC Bundle 2 612480
Arma 3 Malden 639600
Arma 3 Alpha Lite - expires now 228800
Arma 3 Server 233780
Arma 3 Soundtrack 249860
Arma 3 DLC Bundle 1 304400
Arma 3 Samples 390500
Arma 3 Apex 395180
Arma 3 Jets 601670
Arma 3 Maps 249861
Arma 3 Tactical Guide 249862
Arma 3 Tools 233800
Arma 3 Karts 288520
Arma 3 Marksmen 332350
And they are in the RPT file:
15:39:53 ----------------------------------------- Dlcs -----------------------------------------
15:39:53 name appId owned installed available isDlc
15:39:53 Arma 3 107410 yes yes yes no
15:39:53 Unknown -1 no no no yes
15:39:53 Arma 3 Zeus 275700 yes yes yes yes
15:39:53 Arma 3 Helicopters 304380 yes yes yes yes
15:39:53 Arma 3 Laws of War 571710 yes yes yes yes
15:39:53 Arma 3 DLC Bundle 2 612480 yes no no yes
15:39:53 Arma 3 Malden 639600 yes yes yes yes
15:39:53 Arma 3 Alpha Lite - expires now 228800 no no no yes
15:39:53 Arma 3 Server 233780 yes yes no yes
15:39:53 Arma 3 Soundtrack 249860 no no no yes
15:39:53 Arma 3 DLC Bundle 1 304400 yes yes yes yes
I ninjaed you ๐
๐
@marsh storm Click the wiki Link I've sent and read up yourself
The one before the steam link
It says "array of numbers", so I'm gonna assume integers
vomits
Natural number. Dumb hackers.
OK I'll give it a go! Cheers @still forum
@little eagle Okey fine then.... Single precision IEEE 754 numbers.
https://imgur.com/a/B4Koe never use mass 0 kids
managed to get to 10 000, didn't knew there was no limit on inventory items number
they really don't have any, no idea
Now use items player
already did in Slack
using my code that I put into hasItem
the vanilla stuff from that
So when do we fully integrate Intercept into ACE?
CBA settings first
Arsenal only uses CBA
Alganthe's?
yup
You can already integrate Intercept optionally
check in PREP if ACE Intercept plugin is there and compile a different function depending on that
Sounds like a pain.
Then it's just add Intercept and everything get's faster
You can also overwrite variables post PREP from inside Intercept
so you load it and it replaces stuff by itself
Does BE greenlight Intercept or do they still hate it?
They didn't say anything yet
we didn't ask them about anything yet
Overriding compileFinal is only allowed if you have a certificate though. But luckily I am the one creating them ๐
I wasn't there when the ACE dll were in question.
You can just include it. It will do nothing if Intercept doesn't work. And do magic if it does
Yes, but then it errors when I use my juicy inCI.
and if you only keep it to Intercept CBA like stuff where you just replace small often used helper functions people won't have to argue about duplicate code
I don't want a function for case insensitive in though. I can already use the BIS function if I wanted that.
but muh perf
are you using anything like inCI right now that could easilly be replaced?
Theoretically Intercept can also turn your script back to string. regex replace stuff and compile it again
BIS functions
๐คข
Yep.
Or you can just have duplicate code but I know that is one of the reasons not to Intercept soo...
Oh, that reminds me. I wanted to PS a puke emoji Google blob styl.e
I think Intercept is far enough to go apply for BE signing. Right now I'm working basically full time on it.. Because I don't have anything else to do at work :D
I have about half a dozen things to add one of these is quite big..
I guess after 1.78 release when we know Intercept will be fine with that we'll try and apply for BE
We still don't have our daily dev branch test thingy setup
Good. Until then you can release TFAR 1.0.
Dorbedo is making the last quality of life changes right now
Only fixing that one bug. then release
well.. then RC for atleast 2 weeks...
But THEN release
He's also working on TFAR? Nice.
He has a lot of free time currently. unlike me.
you mean not unlike you ๐
Mm
I run on the eventhandle handledamge
That you don't receive damage when you are run over with a vehicle.
The thing is people ignore this cause they switch to passenger seat.
So it's the car object that kills them and not them.
if (vehicle _unit isEqualTo _unit) then {
if ( _source isKindOf "Air" OR _source isKindOf "Car" OR _source isKindOf "Boat" OR _source isKindOf "Tank" ) then
{
}
else
{
_isVehicle = vehicle _source;
//if ((_isVehicle isKindOf "Air" OR _isVehicle isKindOf "Car" OR _isVehicle isKindOf "Boat" OR _isVehicle isKindOf "Tank") AND (driver (vehicle _source) isEqualTo _source)) then
if (_isVehicle isKindOf "Air" OR _isVehicle isKindOf "Car" OR _isVehicle isKindOf "Boat" OR _isVehicle isKindOf "Tank") then
{
_damage = _currdamage;
hint "Since you were VDM'ed you received no damage.";
player playActionNow "stop";
} else {
if (_source isKindOf "Air" OR _source isKindOf "Car" OR _source isKindOf "Boat" OR _source isKindOf "Tank") then {
_damage = _currdamage;
hint "Since you were VDM'ed you received no damage.";
player playActionNow "stop";
} else {
};
};
};
};```
There is 6 { and 7 } ?
6 and 7?
I think I found another one. This is really messy.
Well uhm yeh it is ...
Cause I'm experimenting with what works for the issue and what not ...
You are missing brackets.
{
if ( _source isKindOf "Air" OR _source isKindOf "Car" OR _source isKindOf "Boat" OR _source isKindOf "Tank" ) then
{
}
else
{
_isVehicle = vehicle _source;
//if ((_isVehicle isKindOf "Air" OR _isVehicle isKindOf "Car" OR _isVehicle isKindOf "Boat" OR _isVehicle isKindOf "Tank") AND (driver (vehicle _source) isEqualTo _source)) then
if (_isVehicle isKindOf "Air" OR _isVehicle isKindOf "Car" OR _isVehicle isKindOf "Boat" OR _isVehicle isKindOf "Tank") then
{
_damage = _currdamage;
hint "Since you were VDM'ed you received no damage.";
player playActionNow "stop";
}
else
{
if (_source isKindOf "Air" OR _source isKindOf "Car" OR _source isKindOf "Boat" OR _source isKindOf "Tank") then
{
_damage = _currdamage;
hint "Since you were VDM'ed you received no damage.";
player playActionNow "stop";
}
else
{
};
};
};
};```
cleaned up your code and its amazingly easy to see.
use a program like notepad ++ that does tabs properly and it will be easier to see errors
another tip, always put the brackets and 'else' on their own line
@frank ruin
brackets -> [] braces -> {} ๐
} else {
but the code was such a mess you couldn't easily see the mistake
{
_damage = _currdamage;
hint "Since you were VDM'ed you received no damage.";
player playActionNow "stop";```
you missed the closing brace(for the terminology wizards) on that part
{} are curly brackets. Don't listen to the lies.
lol 'if' has an opening bracket and no closing bracket
can you not see the issue with that?
player playActionNow "stop";
} else {
there were 7 opening and 7 closing braces sooo I don't know what you found ๐
his post wasn't edited
^indeed
I found the seventh one, but it was well hidden.
{
if ( _source isKindOf "Air" OR _source isKindOf "Car" OR _source isKindOf "Boat" OR _source isKindOf "Tank" ) then
{
}
else
{
_isVehicle = vehicle _source;
//if ((_isVehicle isKindOf "Air" OR _isVehicle isKindOf "Car" OR _isVehicle isKindOf "Boat" OR _isVehicle isKindOf "Tank") AND (driver (vehicle _source) isEqualTo _source)) then
if (_isVehicle isKindOf "Air" OR _isVehicle isKindOf "Car" OR _isVehicle isKindOf "Boat" OR _isVehicle isKindOf "Tank") then
{
_damage = _currdamage;
hint "Since you were VDM'ed you received no damage.";
player playActionNow "stop";
}
else
{
if (_source isKindOf "Air" OR _source isKindOf "Car" OR _source isKindOf "Boat" OR _source isKindOf "Tank") then
{
_damage = _currdamage;
hint "Since you were VDM'ed you received no damage.";
player playActionNow "stop";
};
}
else
{
};
};
};``` is correct. run that code and i bet it will work now.
I mean I agree it's a mess.
But I do look if all my {} are closed.
@little eagle :%s/{//n and :%s/}//n ๐
not a nightmare if you use notepad++ and put them on their own line.
I eagle eye this usually, but this mess was too much for me ๐ฆ
at that point it becomes very easy to see if there is one missing or not
I'm sorry ๐ฆ
๐ฆ
Actually I noticed another issue
When my friend drives me over
in driver seat
following logs
22:47:44 "Handledamage: unit civ_3 - part arms - damage 0.744614 - source civ_2 - projectile - index 8 "
When he drives me over and switches passenger seat:
i can see where this is going...........
22:48:49 "Handledamage: unit civ_3 - part head - damage 6.73285 - source civ_3 - projectile - index 2 "
It says I'm killing myself
yes, because it's collision damage
arma is fucked in this regard. Instead of driver getting blamed for hitting someone it either blames the civ that got hit or the commander of the vehicle :p
๐ฎ commy had a emoji instead of a point behind a sentens!
Sentence*
๐ฉ
So I have to add
OR _unit isequalto _source
So if the source is myself it will not deal damage to me.
The problem is ... how far does this affect other things?
Wouldn't epeContact be more fitting to detect this?
It works now
But ...
You can't drown nor receive fall damage ...
So ... it works a bit too much. ๐
OK so related to my last question:
Any idea why this would work in a local test (both SP and MP) and not on a dedicated?
// Checks for LOW DLC before assigning backpacks
_bagsmall = "VSM_OGA_OD_Backpack_Compact";
_bagmedium = "VSM_OGA_OD_Backpack_Compact";
if (571710 in (getDLCs 1)) then {
_bagsmall = "B_LegStrapBag_olive_F";
_bagmedium = "B_LegStrapBag_olive_F";
};
For context, it's in an F3 gearscript assignment
Oh that is weird.
Drowning does work, fall damage doesn't ...
Interesting observations ...ยต
So when you eject out of choppers you don't even die ...
Yeh that could be an issue lol
you forgot to return the damage ๐คฆ
No lolz
That was my point
People are driving in a car
People over which I don't want.
So they switch to passenger seat and they can still kill them with the vehicle.
Cause arma see's it as you killing yourself.
Now I blocked that.
And they can't kill you anymore when they drive you over and switch to passenger seat.
The only issue is, you don't take damage from jumping of high building at all ...
why not just kick the offending player
is there a event handle or something that can detect when the player use a save game afther restart?
i am having a trouble were the music stop playing after use the save
Yes.
addMissionEventHandler ["Loaded", {
}];
thanks
yw
does triggers also have a tendency to fire again once the game is loaded?
params ["_posize"];
_soldiaG = createGroup resistance;
_soldia = _soldiaG createUnit ["rhssaf_army_m93_oakleaf_summer_engineer", _posize , [], 0, "NONE"];
_soldia allowDamage false;
removeAllWeapons _soldia;
_soldia setUnitPos "UP";
_fridge = createVehicle ["Fridge_01_closed_F", position _soldia, [], 0, "CAN_COLLIDE"];
_fridge attachTo [_soldia ,[0.0869141,0.219727,0.679982]];
_light = "#lightpoint" createVehicle (getpos _soldia);
_light setLightBrightness 0.8;
_light setLightAmbient [0,0,0];
_light setLightColor [0.5,0,0.5];
_light lightAttachObject [_soldia, [0,0,1]];
_soldia setSpeaker "NoVoice";
_fridge setVariable ["KI_unitToKill", _soldia, true];
_fridge setVariable ["KI_vehToRemove", _light, true];
[_fridge, ["HitPart", {
_object = _this select 0 select 0;
_hits = _object getVariable "hitTimes";
_unit = _object getVariable ["KI_unitToKill", objNull];
_light = _object getVariable ["KI_vehToRemove", objNull];
if(isNil "_hits") exitWith { _object setVariable ["hitTimes", 1]; };
if(_hits == 1 && alive _object) exitWith {
for "_i" from 1 to 2 do {
createVehicle ["Bo_GBU12_LGB",[(getPos _object select 0)+ (_i*cos (_i*17.5)),(getPos _object select 1)+ (_i*sin (_i*17.5)),0],[],0,"CAN_COLLIDE"];
_object setDamage 1;
_unit setDamage 1;
deleteVehicle _light;
};
_object setVariable ["hitTimes", 0];
};
_object setVariable ["hitTimes", (_hits + 1)];
}]] remoteExecCall ["addEventHandler", 0, _obj];``` someone can tell me why my EH is not firing? this is one script I executed so the EH is within it
not sure if this is the right place, but I am trying to script a demand for a specific facewear item. Wiki is currently down - does anyone know what the facewear 'class' is called?
if (facewearclass = "specificfacewear) then
etc
config parent for facewear is CfgGlasses
thank you very much
how do i get a value of allowDamage if is true or false?
how do i make a bug report about the editor?
whats the bug?
the enable damage check mark does not work if the player load a save, the unit will have damage enable
but if you put allowDamage false on the unit init it keeps
actually, nevermind. this seens to be a problem only with the explosive satchel, even if you put allowDamage on it init
scracth that, this seens to be a problem to all props.
hmmmmmmm
what would cause a function not being "available" in the editor
but it is during mission play
when returning to the editor the function is gone again
๐ค
or, in other words, how do I get my function to work in the editor?
hi, can this work?
{
_x setCaptive true
} forEach thisList;
if I want everyone in the trigger show as a civilian?
i think this list only shows units in the trigger that can activate the trigger
so if your trig activation is set to opfor then only opfor in the trigger will show up
i think
@halcyon crypt Do you use CfgFunctions / preInit = 1 to define your functions? If so then it's absolutely broken. The 3D editor is essentially incompatible with the CfgFunctions framework.
https://github.com/CBATeam/CBA_A3/issues/349
https://github.com/CBATeam/CBA_A3/pull/350
https://github.com/CBATeam/CBA_A3/pull/563
https://github.com/CBATeam/CBA_A3/pull/624
Not sure if 1.60 or today's hotfix but 3den no longer calls functions with preInit = 1
The first time loading into 3den XHE-Preinit works because of the fix in PR #295
But loading into a mission an...
closes: #349
this must've been broken by the hotfix yesterday as this worked fine before, even with 1.60
there is a failsafe in fnc_preInit.sqf, so even if BI reverts their change, we won't have it...
Switching terrains in 3den will reset missionNamespace.
(either creating a new mission on a new map or loading a save on a new map)
This breaks addons that count on pre-init functions being availab...
we use CfgFunctions and not preInit
CfgFunctions has preInit.
It's just happens to have the same name as XEH preInit.
Don't mix them up.
yeah but it's not set to 1 is what I meant ๐
@little eagle Why cfgfunctions is incompatible with 3D Editor simple question ?
Read the links.
Why? Because it is. It doesn't work. They way the programmed it makes it incompatible and it's basically random if your functions are defined or not.
Not really random. It depends on how you open the 3den interface. All explained in these issues/pull request.
we never used preInit and it worked just fine before like a year ago
Yes, but not always in 3den. Read the issues.
Anyway. ACE3 uses CBA's preInit XEH and that solves all the problems.
No.
we never used preInit and it worked just fine before like a year ago
We've been checking this since 3den came out every patch and it never worked. It only appears to work, because it strongly depends on how you enter the 3den display.
It never worked in all circumstances.
Although there have been random changes in patches without them appearing in the changelog.
I realise there's another topic going on but I may as well ask - with the wiki still under maintenance I'm at my wit's end.
I am trying to run a constant check within a trigger area if the players are wearing a specific item. If they do not, the specific player that isn't wearing that item is punished (e.g. setdamage 1;). I really don't know enough about scripting to make it work, so I'd appreciate some help.
What item?
Facewear, it is meant to be a gas mask.
@little eagle 3den enhanced seems to be working and just uses CfgFunctions (without preInit = 1), no 3DEN EHs either
Yes and those are wiped if you switch the terrain or return from a preview.
0 spawn {
if (player inArea "MARKER" && {goggles player != "GASMASK"}) then {
player setDamage 1;
};
};
Something like this ^ @hollow raft
?
"googles". Damn muscle memory
something like that, my problem is that this is a script that needs to be run for several players, so using a thislist I imagine
player will count all players?
//รฌnit.sqf
0 spawn {
while {
sleep 1;
if (player inArea "MARKER" && {goggles player != "GASMASK"}) then {
player setDamage 1;
};
true
} do {};
};
You don't need allPlayers if you execute this on every machine.
There is only ever one player on any machine.
Let each client handle their local player.
@little eagle just checked 3den enhanced and the functions persist when changing terrain and after previewing etc
weird stuff
What build are you on?
the linux port
Oh, that's a few versions back.
1.70
I think opening the functions viewer makes the editor recompile all CfgFunctions defined functions.
didn't open the function viewer, just a diag_log of the function
anyway, I guess I'll just have to find out what 3den enhanced does differently
or switch to CBA's function system thingy
I don't remember old versions, but try to figure out when they're undefined and if the same repro still works for 1.76
Switching terrain, returning from preview, entering the first time from main menu etc. Those are all different scenarios that can lead to different results.
well for 1.70 3den enhanced works on first editor entry, after preview and after switching terrain. ALiVE functions don't exist in all cases. ๐
What function for example?
3den enhanced: Enh_fnc_logFactions
ALiVE: ALiVE_fnc_copyFactionClasses
but it's the same for ALL functions in ALiVE
๐ค
Comment out the RECOMPILE entry?
I have no idea tbh. That is not what I encountered.
So I've tested this and it does not appear to work.
I tested with changing so that it would look for a specific variable, to run a hint if {goggles player != "avon_FM12"}, etc. I'm not sure what's not functional
That's not how you use if.
No, as in I tested a trigger with the condition that "{goggles player != "avon_FM12"}", not with if in it
Scrap the trigger and use a marker.
I named it "MARKER" in my example, but you probably have to chose a different name.
i'll try that and see if there's a difference
You did place that code in init.sqf though?
yeah, in the init.sqf
A condition {goggles player != "avon_FM12"} will never report true, because it's just a CODE block that is never evaluated.
Putting it as a marker worked, you're a hero.
call {goggles player != "avon_FM12"} <<< this could report true, but then you might as well delete the call {} part.
in theory, would putting a "sleep" in give them the possibility to stop the script? or since it has already evaluated it as true keep running? so for example:
0 spawn {
while {
sleep 1;
if (player inArea "MARKER" && {goggles player != "avon_FM12"}) then
hint "You're not wearing a Gas Mask!";
sleep 3;
{
player setDamage 1;
};
true
} do {};
};
i guess I could run that same twice, e.g. check, then hint, sleep 4-5, then run that check again and if still no gas mask, it kills them?
Doesn't look right to me. The hint comes immediately after the then without the curly bracket for the CODE block.
well, the principle behind it?
The player would die regardless if he left the area or put on a mask, because after those 3 seconds, that is never checked again.
Yeah, that makes sense - thanks again
Wow, that was just a weird guess.
no it's a question of why the hell that's causing a problem
I don't know. CfgFunctions internals are really strange.
It looks like someone amended the code until it appeared to work. Over and over again in the past.
Maybe it was fixed in the last year. 1.70 is pretty old.
well it also happens in 1.76 or whatever the latest version is
as in, the reports are that the function doesn't work
I guess you have to remove the recompile flag then.
yeah oh well, not a big deal
I guess it kinda makes sense since it's supposed to recompile on mission start but I don't get why they would not compile it before and after
It makes no sense. It's just broken like so many other things when you look at them long enough.
Did anyone ever observe the types TARGET SUBGROUP or NetObject in SQF?
No, no and there is a command that is supposed to report NET_OBJECT, but just reports a number instead.
netObjNull
There it is. netObjNull. Reports 0 or -1 or something like that instead of the proper type.
false! It was false.
log -1 hashCreate ["key", 123]
?
Working on Intercept backend
As workaround for the types that I don't know I just call str and hash the string
but I'm sure that str will just return "NaN"
Types that Intercept doesn't know
I know the typename
but I don't know the underlying structure
Can't you make the SQF data type (right name for typeName?) part of the hash?
sure
But..
Can you theoretically have 2 different NaN's
because in that case they should have different hashes
No. But could appear as key
And? Just define all NaN to be the same key.
Do you know of a way to create NaN's that wouldn't be the same?
- log -1
vs
log -1
In C++ if you get a NaN or inf for example you can still calculate with them although they are out of spec
Both are == equal, but stringified they are different.
So even SQF is not as rigorous.
hmpf... I guess I'll just use str then if that works somewhat
I only use that for types I don't know the structure of
These are NaN, TASK and DIARY_RECORD
I already know the last 2 produce different strings based on value
No one will ever use those as keys^^
ยฏ_(ใ)_/ยฏ
I'm building the backend here. That has to support everything anyone might ever do
Try to make it like find would.
And:
[- log -1] find log -1 // 0
Even though one is QNAN and the other is INF
find calls isEqualTo on each member. Iterating lineraly.
I can't do that with a hashmap
And if idiots use those as keys it's their fault ยฏ_(ใ)_/ยฏ
Sure. I didn't say reuse it. But try to find a way that emulates the same results.
has the wiki been down for the past few days ?
Yes.
Sure.
how do you stop that one ?
unit action ["salute", unit];
Doesn't work on AI.
This is for AI though
Causes a person to salute. AI controlled units will only make a momentary salute, unless the AI is in safe or careless behaviour mode.
Put them in safe or careless apparently.
unit setBehaviour "SAFE";
unit action ["salute", unit];
Something like that I guess.
Never tried this myself, but I'm sure that playMove wouldn't do it.
thanks btw, trying
Anyone know how to set the supply drop module to use a different crate? I want it to drop the IDAP orange crate or the food bags and currently I can't get it to use anything but the NATO one.
And I also can't get it to work as CIV side
if I sync to a BLU unit it works fine and I can call a crate
but no dice with the CIV faction.
I can set the crate loadout etc, that's A-OK
but no idea how to set the model
doesn't it just have a different object name ?
oh the module, i dont think you can change that
but im probably wrong >.>
you'd have to alter the class perhaps, but thats way beyond me
You can try something like http://www.armaholic.com/page.php?id=31915 but i have no idea is it still working
Create your version of it..
why would if (_State == "open") { _Gate animate ["Door_1_rot", 1]; }; cause a missing ; error ..
Because you have a syntax error
D:
Which would be fixed by putting a ; in there
where did i goof up, im not used to arma scripting
That's not the fix that you would want. But seen from engine that is a fix
right in the middle between ) and {
whats the fix that i would want
put a then in there
ah derp
if () then
thanks
so used to php that those differences get me all the time
im sure others have asked it but any eta on the BIS wiki?
It's dead, get used to it.
any way to pass around an object to setTriggerStatements?
global variable
boooo
why?
needs to be unique
global array that you only push to and never delete.
Then hardcode the array index into the string using format
That's unique enough
ah I guess that would work well enough ๐
thanks
could also just setVariable on the trigger object
I guess it's "cleaner" than polluting the global scope
Doesn't necessarily mean it's the best
well it is the best since only the trigger needs to know about the object IMO
setVar on the trigger object?
Isn't a trigger also just a game logic?
Not got my type list of sqf rdy right now
Game logics are objects and so are triggers. With both you can use setVariable.
So you can store the object on the trigger and have the same statement for multiple triggers that pull an object from the triggers namespace and check for that. No globals unless you consider object namespace variables as globals.
Agreed.
With triggers you already waste computation time on an network synched object. Might as well use the namespace from it.
@Dedmen simple in area command comparing current position with two positions provided could also be useful
2d and 3d should be supported
Could save time
@still forum gah.. Bloody app
Isn't this what inAreaArray does?
Not doing what I was talking about
Example then.
But close to it
@Dedmen simple in area command comparing current position with two positions provided could also be useful
Thats what it sounds like ยฏ_(ใ)_/ยฏ
Player isincommand [[1,1,1],[50,50,50]]
Alternatively with only two scalar per array for non height related
๐ค
Though.. Was not aware of the command you gave
Yeah, I don't think a point can be inside another point.
But I think I get it.
player inArea "marker_1" || player inArea "marker_2"
This?
You give two points as area
inAreaArray for that
Those give bounding box in which you check if another point is in there
They just give 2D-Coords, no BB
So not my example?
Tbh... Was not aware of inareaarray which would cover the use case I had in mind
But would not be useful for simple bounding box expansion checks
player inAreaAny [trigger1, "marker1", [center1, a1, b1, angle1, isRectangle1, c1]];
A command like this maybe?
If course oO
InArea can check for markers (of any shape) or Coords
+what Commy wrote: isRectangle1 <-
So BB Checking is possible
Yes. By any I mean that you provide multiple positions as shortcut for having to use multiple inArea commands. How would you write my example with inAreaArray? I don't see it.
lemme try to find something, not sure if i still have it
Thx.
Currently on mobile that is why I cannot really explain enough ๐
Gonna try to get something together later
Not Rly needed though...
The use case I wanted covered to replace triggers is already covered by inareaarray
Dedmen is currently working on ACE Intercept stuff. And Dedmen has to go to bed early today. Dedmen no time for stuff
Poor Dedmen
mimimi
Got headaches today preventing me from doing anything..
@little eagle Can't find anything here anymore, only inArea commands -.-
Hey, Wiki is back up
player inArea "marker_1" || player inArea "marker_2"```
was correct.
```sqf
allPlayers inAreaArray location_1;```
was the correct one for checking if multiple Units are in an Area. No clue what i did back then, prolly just adding a forEach Loop for each Location/Marker. Can't remember
Ah, i used inPolygon before (regarding "multiple Coords"). Tricky memory...
https://community.bistudio.com/wiki/inPolygon
Yup
Would be the closest to resemble what I was talking about
Probably not with scripting alone and without configs / mods.
What do you think?
Quick question I'm pretty sure I already know the anwser to:
"Yes".
Is it more efficent to cache config values as variables or cache the paths
or just avoid caching anything
because varaible pollution is annoying
I would run a test but I'm on my laptop >.>
Depends on how you do it I guess.
getNumber (configfile >> stuff)
every time a script executes
Or: globalCacheVar = getNumber (configfile >> stuff);
Vanilla?
Vanilla or modded
Doesn't really matter in this case
It's for a loot spawn script I've been making/messing around with
if (isNil QGVAR(namespace)) then {
GVAR(namespace) = call CBA_fnc_createNamespace;
};
private _compatibleItems = GVAR(namespace) getVariable _weapon;
if (isNil "_compatibleItems") then {
_compatibleItems = [];
// do lots of config look ups and evaluations
GVAR(namespace) setVariable [_weapon, _compatibleItems]; //save entry in cache
};
_compatibleItems // return
This is the principle. GVAR(something) is just a global variable.
Yeah...
I was wondering based on code execution time
pretty sure globalvar < config
in speed
This makes it like a thousand times faster after the first run. But it all depends on how much stuff you do.
can you use ropecreate without the Helo Dlc ?
Yes
i keep getting those Shift + P
Yes?
dlc advert when i enter roprecreate
Why wouldn't you be able to?
Probably because you have a weapon you don't own or are sitting in a heli you don't own.
something something bishill
yeah
im on Dev im in a civilian unit no weapons or anything
Are you using the slingloading ui?
Items too. Like uniforms.
in VR as a civ
or just the command?
no, there should be no restrictions on slingloading
There aren't
Like I said
just the command in a line of code ropeccreate and then screen full of handshkaes
lolwut
ropecreate is just a command just like anything else
welp
has nothing to do with dlc ownership
yeah but the rope is a model
I guess I'm going to cache all them variables
.>
Acutally
fuck it
multi-dim array
the created model is maybe DLC ?
because I can't be assed to make like a gazzilion variables
doesn't matter
anyway thanks for the definiet answer as always , great pool of knowl;edge ๐
lol
Yeah sure lol ๐
Yesterday the wiki was down
It was terribe
I had to use the cached page... So all the links didn't work
Wasn't just yesterday lol
It was more like 4 days
goto OFPEC or use the comref
Wouldn't suprise me, shit happens lol
No one "acidentally deletes" forum / wiki software lol
pretty sure they are using a form of media wiki correct?
You would be suprised
There is a story of a new hire accidentally deleting a company's production database
Shit can happen
Or my personal favorite
that is why you don't let people have power to everything
In vancouver we have a light rail system called the skytrain
It's completely automated
divy it up between all employees, so if all else fails they will have to work together
One time
The were doing maintainence
so they moved everything on to the backup server and ran that
a tech accidentally unplugged the wrong thing
and hardcrashed the entire system
All the trains just stopped
yeah lol
shit happens
Config values are retreived from disk?
right?
Or are they cached in memory?
Not sure. #arma3_config is your best area for questions like that
iirc though they are from disk, not sure though.
I'm asking for the sake of script performance
Yeah
i'm 90% sure it's disk
because monitoring disk usage shows that when you do things on a server it reads certain pbos at certain times
or when loading the game yeah
Well
It loads and compiles everything
scripts and such
then I guess it refers back to the configs when needed
I honestly have no idea lol
I would think so too. #arma3_config has a wealth of knowledge
Yep
Oh, script related question and sometimes makes me stay awake a night...
Is there a performance hit if you use a multi-dim array to store lots of values instead of dedicated variables?
I don't think there would be, but it's sqf ๐คท
well if you need to do a multi dimensional array, then I would say it's better than just trying to spread it out with multiple variables.
ofc
especially if you are going to be getting that data later on
I always try to abuse arrays to their full potential
Alright, so what's the confusion?
No confusion
I'm just wondering if everything I've ever done is a lie
and if it's actually more performance heavy
I don't think it is, but in sqf you can overide nil with a value soo
well if you are setting that variable constantly, maybe.
yeah...
I wish sqf had hash tables
that would make me very happy
(ik there are ways to implement them)
but native hash tables would be nice...
enforcescript pls
iirc kk has something like tha in an extension format
Only 3 more years and Dedmen releases Intercept.
lol
Then you have your hashes.
3 years? jeesh man
it even has classes apparently
no it's actually more like C# and Java
properly classes
ah right
It was C#
not C++, morning... Tired....
anyway
actual OOP
yayyyy
_myArray = [[],[]];
(_myArray select 0) pushback "stuff";
will that horribly break?
Ehhh..I would recommend you store your data before nesting it in that array
but I'm using the array to store the data
Works just fine.
Make Array - > Store Data - > Insert Array
Eehh
It just adds execution time
also
Not really relevent for the function
I'm compressing an array
[["class1",0.15],["class2",0.12],["class3",0.15]] >>> Turning that to >>> [[0.15,0.12] , [["class1","class3"],["class2"]]
basically compression
the select pushback makes my life easier
Why don't you just create a LOCATION as container and use setVariable / getVariable at that point?
Does that increase network traffic?
This is running serverside only
no need to broadcast
LOCATIONS only exist on the machine they're created on.
No network stuff in that simulation.
hmm
If you need to broadcast then you can use simple objects. Type "Building" for example.
Yeah... Using a location is a good idea
That is what CBA_fnc_createNamespace does.
what type of location?
Optimized version of "Name"
But doesn't matter for a dedi, because that never opens the map anyway. No interface.
myNamespace = createLocation [ "NameLocal" , [0,0,0], 0, 0]; ?
@old glade Config is in Ram. But config lookups are VERY slow compared to Global var lookups.
Namespace is a hashmap. Array is fine if you don't search for stuff.
We have hashtables. CBA can create Namespaces. But they only support STRING as keytype. Which is what Commy already told you
If you are running serverside only you might aswell just use Intercept CBA's hashMap
k
Is there a command to get the specific rangefinder slot item?
As it's seen as a weapon by Arma 3.
binocular
Ah there is ๐ฎ
Cheers!
Was filtering on weapon but didn't find it. ๐
But no addbinocular
that's still weapon lolz
sense ...
Oh yes thanks I was aware of that command.
Just had some issue figuring out how to get the class of the rangefinder and such
cause you have the entire primary,secondary, handgun commands for the rest ๐
Err..yeah, well you also have hmd for head mounted displays / goggles / nvg type equipment
The only thing that's missing is removing or adding a magazine to a binocular/rangefinder.
The batteries.
Wouldn't you technically be able to just reload it ?
Yeah, but what if you're naked or all containers are full?
ยฏ_(ใ)_/ยฏ
You mean like a virtual weapon holder?
Like how they added underbarrel, extra inventory slot for small items.
Right, but do you seriously want another item slot just so you can reload something without a holder present?
More of a joke suggestion, but why not?
ยฏ_(ใ)_/ยฏ
The current system is way too rigid. For A4: Ctrl+A , DEL
I was inspired by remembering Receiver, which let you put your flashlight in your mouth while manipulating your stuff.
does this actually execute? selectrandom ["item"]
Or does it just give you the string
i want to know whether it's worth my time to not create single element arrays in a loop
it would mean putting in another check
well 2 checks
anyone?
is there a big deference performance by doing selectrandom ["item"] over just "item"?
code performance it /shrug
like 60% or so of the executions of a function will have arrays with lengths greater than 1 but is it worth making an exception for the rest?
I'm on a phone lol
also I was on my laptop earlier
I'm probably going to do it when I get hone,but I thought I would ask
it's a vehicle?
Well it's a turret?
turrets are vehicles
Well doesn't disable it though ...
does that command normally work on vehicles?
Yes it does
selectRandom ["item"]
is always "item".
Knowing sqf it's probably still faster than
["item"] select 0
lol
yeah I figured it was always "item", I was wondering if it was worth putting in a check but it's probably nor
not*
Definitely not.
Try to put as much load into C++ internals as possible. The less SQF commands you use, the better.
There is gigantic overhead for every command used no matter which one it is. Most of it is type validation I believe.
Nope doesn't wanna remove thermal on the turret fml ...
Yeah, but you'd do that when compiling the code. Not during runtime. But I guess you'd need ...
Yes.
Otherwise it wouldn't be so slow.
ik why
It's all fixable. You need to put a lot of time into it though.
This is why I'm not very optimistic about EnScript. It's the same people making it that made SQF and developing it takes away time that could be spent fixing the actual issues.
So it's probably the same mistakes all over again.
eh idk
I'm a bit optimistic
although. intercept will be awesome... When it gets done lol
First step would be identifying the issues. But no one really names them ever. Just a general "it's bad". But if you don't know why, you won't be able to solve them.
yeah i hate that
When people use "Its arma" as a reason something fixable is broken
although there are some things that works as an explanation for lpl
"It's Arma" most of the time comes from people that didn't understand what they were doing. But it's partly Arma itself that is to blame. Many things don't do what their names imply. I have no idea how it is in programming in other places. I hate computers. But people are way to quick in believing what a name says.
Or my favorite thing: ___ map kills servers
Or ___ mod is lagging the server
-.-
it's the least descriptive thing you could say
honestly it's just a lack of understanding
people don't understand that the client and server are separate
That the users are dumb is a given.
Guys, thanks for the help on make this mission
http://steamcommunity.com/sharedfiles/filedetails/?id=1175600763
All that script help was for this.
Again with the insane amount of mods
"insane"
meh that ain't bad
15 mods? That is too many
More mods = more fps or did i get something wrong ?
so 15 seems like a great number to me
But really, 15 mods is not too much, considering that some of them belong together ....
That's the thing... Mod count doesn't mean Jack shit... Except for breaking the server browser :p
It's not about how many mods you have but about how well they're made and how well they run
erm, iirc there was a Limit on how many you can load
Rly @jade abyss?
Yeah, but not related to Arma itself iirc
Cannot imagine due to bi also just providing pbos
I think the -mod Path had a limit of how many sign can be added
You mean the 256 windows buffer problem
No clue how it's called
There was a guy in here, wich Path was too long and it didn't load all the Mods properly
Not related to the parameter but to how Windows stores links
No clue. Is there a workaround doable?
Using command line it will work
He used .bat File
let's use a byte to store mod ids
you can use parameter file to get around that
Could be that there is also a limit on that buffer for cmd line
Yep, i guess so
@old glade no game limitations we talk about here
If you use full paths it quickly adds up, so just use a parameter file, put the mod paths in there and all good
He removed some/shortened the links -> Worked
why on earth would you load 256 mods tho
Signs, Jmaster
PBO limits that's why there's the special thing for 'sub configs'
Not 256 mods
Characters
init.sqf
MYT_spectatorGroup = createGroup [sideLogic, false];
MYT_spectatorGroup setGroupIdGlobal ["Spectators"];
publicVariable "MYT_spectatorGroup";
};```
onPlayerKilled.sqf
params ["_oldUnit", "_killer", "_respawn", "_respawnDelay"];
waitUntil {!isNil "MYT_spectatorGroup"};
[_oldUnit] joinSilent MYT_spectatorGroup;
In some playthroughs, `MYT_spectatorGroup` evaluates to grpNull and everyone joins different group upon death. Any idea why would that be?
@queen cargo what do you mean about that
a = 1 Char
aa = 2 Char ๐
@digital pulsar groups get cleaned up automatically
You have to explicitly disable that behavior
Probably your group was empty at some point
No they dont ๐
And thus got garbage collected
i do, i specified false in createGroup
I was making a joke about bethesda
You cannot do that without them being wrong
Syntax: createGroup [side, deleteWhenEmpty] (since Arma 3 v1.67)
deleteWhenEmptyButOccasionallyIgnoreThisFlagAnyway
You prob have some code deleting groups somewhere using any particular addos / missions
garbage collector?
inb4 the garbage collector had groups re-added to it
lol
after all, they were removed from it for no reasons cough, because of a bug actually
yes, since 1.47 or somethng
probably because it gained sentience and killed the cat or something
wouldn't surprise me
nah, afaik a bug caused it to not delete groups anymore and somehow it was considered a feature
I want copilot FFV in the hummy back T.T
that 1 day was glorious
"No garbage collector stop! that's not garbage it's mittens!
wait what
ffv from the copilot seat?!
yes, you could fire your pistol from the copilot seat
because it isn't, it stayed for a day and got removed
then jumping out and tackling someone
damn
it would be awesome to have it as an option...
let's see how bad the search is on the BIS forums
lol
https://pastebin.com/raw/vciE6vAr I get the exit 2 hint, but the loop doesn't stop
someone needs to make a mod where you can fire from a quads driverseat
Or at the very least the backseat
I thought you could already do it from the back seat
anyone that happens to know how getPylonMagazines behaves on vehicles without pylon support?
returns and empty array
thanks anyway ๐
can anyone tell me why the loop continues despite the exitwith?
what loop?
from the pastebin I linked
you're using while true, ohgod
well my exit conditions aren't very simple so
they are
not to me, sorry, correction XD
don't I need an exit to break the scope and terminate the code?
you do, exitWith exit the current scope
so either the local var you're using isn't defined or it's not a bool
if I put all my conditions in the while {}, what do I have left to breakout with?
eh, there isn't that many options in vanilla
didn't he said he get the "exit 2" hint?
I do
So everything should be fine, unless you got a 2nd loop running
I am right now ๐
๐
No, inside the Loop
if I see two of these, then there are two loops
with
systemchat str diag_TickTime;
it might trigger spam protection if his sleep timer is under 1s
What?
oh wait, that only apply to the RPT
what is "spam protection"?
it could be
you can log a limited amount of messages per second, otherwise they won't get logged
hm, never heard of it
+systemchat/hint isn't blocked anyway^^
I used them so often for debuging in perFrameEH
okay so, only one loop running at a time
what's the issue? sound keep playing?
got my exit 2 hint and it still keeps on truckin along
exit 2 as systemchat appears only one time? +how do you know it's still running?
yes
Yeah
What Alganthe wrote
for anoter script, I attached a say3d to an object
erm... i am pretty sure there was a command that instantly played it (no queue)
- better do uisleep
- Are you sure, it's the exact time? (even *1ms diff can make a diff ๐ )
say3D might work, I know directSay has the same issue
I narrowed that sleep down quite a bit XD
wiki's back btw
thankfully
what's the real difference between UI sleep and regular sleep
I figured UI sleep was best done for UI stuff
sleep = can be delayed by low FPS
UIsleep = nope, i don't care. I wait for exactly 0.1ms, then doing it, no matter how much your PC is loaded
(simplified)
roger
Yeah. idk why sleep should be used anyway
To spice things up ๐
๐ฆ - erfly
๐
no work ๐ฆ
add another systemchat "I am running"; after the exitWith{} part
too late, I'm making that damned helipad to attach the sound to
I want this sound utterly annihileated
ยฏ_(ใ)_/ยฏ
Can your script even suspend?
Not that its throwing an error, skipping sleep and going wild with playSound3D
@agile pumice try to use the say command instead
I will end up using say3d and rewriting my sound configs if this doesn't work, At that point I won't be needing assistance
Did you know that if you do playSound, you can stop the sound again by deleting the object it creates for itself?
private _existingSound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle";
Quite silly if you ask me that the command itself does not return this object
Thats for playSound though ๐
i do believe I have showscripterrors
"do believe" != "know" ๐