#arma3_scripting
1 messages ยท Page 277 of 1
it's all hashes internally anyway. not like you slow down anything with more of them
it would be faster if he didn't store nested arrays
Is there a way to get the x and y coordinates from somethign when teh map is open without UI handlers?
What would be better for example?
no need to walk them. can let that be handled with hashmaps
getVariable set variable?
It worked Quiksilver
Only problem it wouldn't work in Unscheduled
tripleNested = [
[
[01,02,03],
[04,05,06],
[07,08,09],
[10,11,12]
],
[
[13,14,15],
[16,17,18],
[19,20,21],
[22,23,24]
]
];
fn_iterativeDeepSearch = {
params [
["_toFind",0],
["_finalRet",0],
["_i",0],
["_j",0]];
hint format ["%1",_toFind];
for [{_i=0}, {_i<count(tripleNested)}, {_i=_i+1}] do {
ret = (tripleNested select _i);
for [{_j=0}, {_j<count(ret)}, {_j=_j+1}] do {
subRet = (ret select _j);
finalRet = subRet find _toFind;
};
};
finalRet;
};
[05] call fn_iterativeDeepSearch;
Well you could do a recursive solution.
could probably use forEach instead of for
fn_name = { [_x] call fnc_name };
I knew what the inner most data was.
It was able to match and find it
only issue was after the code finished the variables become undefined
unlikely in a "real" programming language
what I posted would have been completely valid.
I know was testing the possibility it was related to that.
but no it wasn't.
Yeah I did that.
step 1
I still complained at this
Would forEach not be more expensive?
Thats why I always avoided forEach
because I thought it would be more expensive?
Yeah I also read on the wiki
you can re-assign the innermost _x = _newX
So they don't conflict.
Nah I just give it a boolean
count is playing with fire though. I remember when they added a return value to pushBack when it had none before...
just stick a boolean there
forEach should still be faster than for. especially since you don't need the _x = _a select _i; line
Whenever you use count, just stick a boolean there, no need to think about it
while that does look ugly, it's probably faster than droping a true or nil
need all those nano seconds
๐
yeah. why
at least it's tagged ยฏ_(ใ)_/ยฏ
well, except for the underscore. gotta save those bytes
@MrSanchez#5319 just a important note, deleteAt also works like pushBack and set.
๐ค ?
tripleNested = [
[
[01,02,03],
[04,05,06],
[07,08,09],
[10,11,12]
],
[
[13,14,15],
[16,17,18],
[19,20,21],
[22,23,24]
]
];
fn_iterativeDeepSearch = {
params ["_ret"];
{
_outerX = _x;
{
innerX = _x;
_ret = innerX find toFind;
} count _outerX;
true
} count tripleNested;
_ret;
};
ret = [5] call fn_iterativeDeepSearch;
Refuses to work in non-scheduled
error message?
Nope
None
When I set ret to a global variable
It rets the index
and value
tripleNested = [
[
[01,02,03],
[04,05,06],
[07,08,09],
[10,11,12]
],
[
[13,14,15],
[16,17,18],
[19,20,21],
[22,23,24]
]
];
fn_iterativeDeepSearch = {
params ["_toFind","_innerX","_outerX"];
{
private _outerX = _x;
{
private _innerX = _x;
private _ret = _innerX find _toFind;
true
} count _outerX;
true
} count tripleNested;
_ret;
};
ret = [12] call fn_iterativeDeepSearch;
Nope just doesn't return _ret at all
yet when changed to global variables it works
I don't understand how that function works though
seems to me like it constantly overwrites _ret
and at the end just returns -1
most likely scenario
Okay to ensure _x is not over written
I assign _x to unique variable
On the innermost scope
it simply returns the nested array
no, _ret is constantly overwritten
?
it's just set the the latest result of find
What should I do instead?
exit when _ret happens to not be -1
also
private _ret = _innerX find _toFind;
means _ret is only defined in that inner scope
Thanks commy
I see now.
tripleNested = [
[
[01,02,03],
[04,05,06],
[07,08,09],
[10,11,12]
],
[
[13,14,15],
[16,17,18],
[19,20,21],
[22,23,24]
]
];
fn_iterativeDeepSearch = {
params ["_toFind",["_innerX",0],["_outerX",0],["_ret",0]];
{
private _outerX = _x;
{
private _innerX = _x;
_ret = _innerX find _toFind;
true
} count _outerX;
true
} count tripleNested;
_ret;
};
ret = [18] call fn_iterativeDeepSearch;
Only problem now is _ret is defined
but find isn't returning the index.
tripleNested = [
[
[01,02,03],
[04,05,06],
[07,08,09],
[10,11,12]
],
[
[13,14,15],
[16,17,18],
[19,20,21],
[22,23,24]
]
];
fn_iterativeDeepSearch = {
params ["_haystack", "_needle"];
scopeName "search_main";
{
private _index0 = _forEachIndex;
{
private _index1 = _forEachIndex;
private _index2 = _x find _needle;
if (_index2 != -1) then {
[_index0, _index1, _index2] breakOut "search_main";
};
} forEach _x;
} forEach _haystack;
[] // default
};
ret = [tripleNested, 12] call fn_iterativeDeepSearch;
this would report [0,3,2]
or it should, untested
forgot a number, fixed
@tough abyss thanks a lot but i don't understand what is this code for. Everything is working at the best now, may be you is going further in the question and i sadlly can't go along, to complicated for me.
ProfileNameSpace is saved when you close the game or the server?
Are there commands to set the font size and/or style of a control in SQF? e.g. ctrlSetSizeEx and/or ctrlSetStyle...
I guess there is no command for the style cause its defined in the config of the contols class which leads me to the question: is there a predefined class for right aligned text? e.g. RscTextRight?
Workaround would be a RscStructuredText but i am looking for other possibilities
@deft zealot You can write simple script which will scan config for classes with needed parameters to be used with ctrlCreate
@little eagle @tough abyss Here's my attempt at recursive search, supports any depth:
tripleNested = [
[
[01,02,03],
[04,05,06],
[07,08,09],
[10,11,12]
],
[
[13,14,15],
[16,17,18],
[19,20,21],
[22,23,24]
]
];
deepSearch = {
private _needle = _this select 1;
private _path = [];
(_this select 0) call deepSearchRecursive;
reverse _path;
_path
};
deepSearchRecursive = {
{
if(
_x isEqualTo _needle ||
_x isEqualType _path && {_x call deepSearchRecursive}
) exitWith {
_path pushBack _forEachIndex;
true;
};
false;
} forEach _this;
};
[tripleNested, 12] call deepSearch;
3 times slower though, [0.07,10000] vs [0.0268,10000]
but universal with any depth and data type
@meager granite Yeah iterative solutions are often faster.
Even in the real programming world
This is a very big project I am undertaking lots of sponsors involved.
Now when I get a sponsor
Sounds like the typical "Hey, want to get rich?" kind of idiot... ๐ค
@open vigil / @graceful pewter
ok just thought it's kind of not done ๐
It's not
@deft zealot you could use something with structured text. Then just do ctrlsetstructuredtext and then do the styles in t element
Or whatever
@tough abyss saveProfileNamespace
@marceldev89#4565 best bet if u need me is to pm me if you can
So, about dialogs
Where can I find an up to date defines.hpp with all the controls in it?
When I use th gui editor and put a combo box, ingame it never appears.
Thanks but both commands dont work.
When I try ctrl p it throws an error saying gui_styles.hpp not found
hm. are you on dev branch? maybe they broke it
No, I am on stable
i don't know, i haven't tested it but those posts are very recent and there are no complaints or disclaimers there
[] call BIS_fnc_exportGUIBaseClasses;
this appears to work, it created a clip paste of 4000+ lines
well there you go then
Excellent! just what I needed too! Thanks guys
Thanks for the hint
ARMA3 dialogue coding, for when you are bored with triggers and scripts!
Or when your day is not frustrating enough!
I find dialogue code very frustrating but teh rewards are amazing when it works out.
When using the GUI editor, and creating a new control from the list, it directly reads from available and defined classes and therefore should match up with my exported defiens?
I am confused with this page:
the second half of the page has an "example".
Is that example something I put into the defines? or use directly as is in my dialog?
Dialogs are pretty simple, just time consuming as hell
it's an example of how your combo class could look like. probably taken from moricky's templates with a bunch of debug for the EHs which is nice if you are new to this.
so, afaik, this one has all the entries to be able to work as a base class that you can inherit all your actual combo boxes from.
How would I use the example? Paste it into a dialog?
if you lack basic knowledge of it, then it'S always good to get a working example and start by modifying it, unless you find an uptodate step by step tutorial
moricky ftw
I have used the basic dialogs but shyed away from the complicated oens so far, this template looks amazing.
If I want to split up my description.ext, can I use any file ending I want or does it have to be .hpp?
anything
.*pp is just affiliated with Config Files
When using the Killed event handler, how would you check if the killer is in a vehicle and get the gunner that killed them?
Currently checking it in the editor, but figured I would ask here as well.
I'm sure there are easier ways, but you can track getIn and out of vehicles
instigator: Object - Person who pulled the trigger```
May be helpful...
Checking returned values now
Yep
Works nicely, makes my job easier.
Yep
btw. objectParent should als be helpfull with that (not sure what Killed EH returns)
https://community.bistudio.com/wiki/objectParent
The new addition to the killed EH works perfectly. Tested in lots of different conditions. Thanks!
@MrSanchez#5319 but you know if it is saved when you close the server process?
@everyone Would anyone be willing to be my Dev for my Life server, we doing Tanoa Life which means you must have Apex. Please DM me, I really need the help.
... ... ...
@tough abyss How about no?
life servers are a cancer that need to be removed before it metastasizes like a maliginent growth to stop it spreading to all systemetlc parts
Thats you opinion, but im trying to make a server for my people ,
Thats nice. Keep playing the get rich quick off other peoples work. How about instead you go get a job?
Stop generalising!
No, some people may be, but you can't generalise, we went through this. You have people that let the team down everywhere
@jade abyss You ever dealt with the ORBAT module?
Can all cfg Class types?
be included?
class cfgRespawnInventory {
#include "Mission Framework\shared\CfgRespawnInventory.hpp"
};
You can include like that yeah
class CfgORBAT
{
class 1stPlatoon
{
id = 1;
idType = 0;
side = "west";
size = "Platoon";
type = "HQ";
insignia = "\ca\missions_f\data\orbat\7thInfantry_ca.paa";
commander = " Mr Cmdr";
commanderRank = "General";
text = "%1 %2 %3";
textShort = "%1 PC %3";
tags[] = {BIS,USArmy,Kerry,Hutchison,Larkin};
color[] = {1,0,0,1};
description = "All of your text would go here.";
assets[] = {{B_Heli_Transport_03_F,5},{B_Heli_Light_01_F,3},{B_Heli_Light_01_armed_F,4},B_Heli_Transport_01_camo_F};
// When 'subordinates' are missing, child classes will be used. They can have their own subs - number of tiers is not limited.
class 1stBCT
{
id = 1;
type = "Armored";
size = "BCT";
side = "West";
commander = "Cmdr";
tags[] = {"BLUFOR", "USArmy","Kerry"};
};
};
};
Any reason it's not showing up?
Even when directly included
in the description.ext
Wonder if the strat map needs to be open first.
Hmmm.
Looks at BI config
Grrr
Why are you being a pain cfgORBAT.hpp
It's the exact same SYNTAX as the BI one...
WHY....
facedesk
You know @dusk sage ArmA 3 is more frustrating than it needs to be...
Not even a useful error to say whats wrong
I believe I've identified the problem
the function being used to retrive the config file is broken
Sometimes ArmA gives you free candy. Other times it screws you right in the ass. It's a love-hate relationship
Yes...
The ORBAT module is broken by the way.
It attempts to use BIS_fnc_retriveMissionClass or whatever it is
It attempts to use BIS_fnc_retriveMissionClass or whatever it is
and fails
sign SQF is an aweful language.
i wish it was lua
kek
hell i would settle for C#
i wish SQF allowed the usage of dlls like in C# using Windows;
(it does but i mean like system dll's bnuilt in whatever)
that would be a terrible idea
think of security
someone would write a mission that formats your hard drives before anyone wrote a "proper" mission
proper sandboxing. I've seen it done. Sure theres ways to get around it but is it really worth the time
i mean i guess it depends on your intentions but for the most part a sandbox properly made would be fine
dlls actually isn't stupid @rancid ruin
SpaceEngineers did it.
They use a sandboxed version of C#
Have most of the features of C#
And the code is performance capped
So bad code == bad consequences
worse than SQF
@tough abyss That what you meant?
By Sandboxing what SE does?
SQF would be a less aweful language IF everything WAS DOCUMENTED
Sandboxing meaning closed enviroment so you can't execute certain OS functions
or run anything malcious
Exactly what SE does
yep
Has a "NameSpace"
restriction they use to the inGame objects
exactly
ModAPI has less restricts but is still restricted to VRage .dlls
that don't interact with certain things such as the DX11 draw call system.
i would love sqf if it allowed it. easier to do lots of things then
Interesting question
if Intercept allowed direct access to SQF functions internally
Why not just build a native library that is within in game
and BI made it?
Making default into arma 3?
This would allow direct interface with C++
theres key for it. might there be some sort of action for that
or find out what the key actually does
Is there a simple solution for allowing a player to destroy disabled friendly vehicles out in the field in order to let them respawn, without them getting lit up by the base guards when they return?
Is there anything that would speak against a Client WebAPI? I know the most common way is to have the client contact the server, which then gets stuff via .dll from the database.. and I still go over the server (via private WebAPI, encrypted, but not via htmlLoad) for a bit more sensible data. For things that "may" are not even needed during the entire mission however, I decided to dynamically load the content only if needed via htmlLoad over my public WebAPI. I.e. for general stuff like job descriptions, mission data, etc. Works pretty well and the server is being left alone but is there anything I should take into consideration or is there any reason why this isn't common practice?
That way I can also work with caching more easily ^^
@willow basin well I would love to do in that way my Community is against it. So the mission developers post to a mysql database I get it via php to my node.js application into a mongodb.
@willow pike ah, great so nothing would speak against it. Thanks for the links but I made my own .dlls for that ^^
Can you tell me why your community is against it o.O? I only can see everyone profit from it.
Well there is no real reason. I just gave up. They are happy that they can use extDb3 and I import the data for the WebApp and do over the webapp some changes to the mysql db (whitelisting)
@leaden summit Couldn't you add an Add Action to the vehicle? Something like a "Recycle" action to just delete the vehicle instead of destroying it? Not positive if that would trigger respawn though...
Is looping a script to apply to all objects a add action useful?
What would be best way to get ammo total from a specific turret on a vehicle?
define "ammo total"
Is looping a script to apply to all objects a add action useful?
maybe
Anyone know what this means and why it is getting spammed in my RPT?
Unexpected context inside house
No, but it sounds funny
@little eagle aim is to show ammo/magazine count of given turrets on the gunner HUD, but I think I can manage now that I spotted magazinesTurret and couple of other commands I had not noticed. :9
Probably could I guess, but was hoping more for a "set a charge on the hunter before we abandon it" type of thing
Haha woops
i am blind my bad
Nah man I had not scrolled through the new posts myself
A really easy solution would be to completely disable the baseguards from >ever< shooting you. Would that work for you?
e.g. use player addrating 500000 at the beginning of the mission (e.g. init.sqf) and friendly AI will never start shooting you. That however also means you can shoot 20 friendly AI and they won't retaliate on you. (not sure why anyone would ever do this though)
Not sure if sideEnemy ( https://community.bistudio.com/wiki/sideEnemy ) can be affected using setFriend. Worth a try though ๐
iirc it does
erm, not sure anymore
I did find a suggestion that I set the rating of all vehicles spawned at base to 0, but I couldn't seem to get that to work
Looping through those vehicles to do that seems kinda useless if you can just addRating in init.sqf
@jade abyss Just tested, cos why not. Turns out you can't. Even after setting west setFriend [sideEnemy,1]; sideEnemy setfriend [west,1] the getFriend command still returns almost-0 and the AIs still attack ya
uhhm xD
Wang goes out and about and blows up a disabled friendly vehicle. This lowers his rating and his side is switched to the renegade side. that renegade side is sideEnemy......I don't think making west friendly to east will work but I can try it xD
Naw that trick doesn't work ๐ Even when that code is placed in init.sqf
You must be doing something pretty wrong oO
I used that while i was playing around with the AI for 2017mod
try it with an init.sqf
Is there any reason for modelToWorld (and associated) commands to return Z above surface and not ground\water?
I mean does anything ever really use it
It feels like a bug/cluelessly added feature, eons ago
Maybe we can request this command to stop taking walkable surface into account and return proper AGL coordinate?
modelToWorld uses AGL, so it is ground level
the only command that reports surface (highest pathway LOD) I know of is getPos and position
position, visiblePosition, getPos, getPosVisual
these four apparently
modelToWorld does it as well
Quick question: is there any way to store a value locally to a unit?
a variable, on other words
exactly what I was looking for, thanks a lot ๐
okay, here's another question
if I want to add an action to an object
on all clients that are playing and that join later on (JIP)
What's the best way of removing the action?
I'd have to 1) remove the addAction from the JIP queue and 2) remove the action on all clients, right?
don't remove it, but use a public global variable boolean in the condition field of addAction
in my opinion
good idea
thanks again ๐
by "public variable" do you just mean not local, or something else related to multiplayer?
a global variable that exists on all machines and is set by the JIP quene
missionNamespace setVariable ["myTag_canUseAction", false, true];
then you can use myTag_canUseAction as condition in the condition field of addAction
missionNamespace tells the server to keep them synced?
aren't variables global by default?
but synched on all machines
the third param of setVariable makes it synched on all machines including JIP ones
Variables are global if they don't start with an underscore
but don't confuse global variables with global effects
then, do I need to run missionNamespace setVariable ... on the server only?
missionNamespace setVariable
[
"VarName",
DataInsideVarName,
Bool(SyncedOverNetOrNotToAllClientsIncl.JIP (True/False)
];```
does it explode if it accidentally runs everywhere?
but the global variable can take different values or be undefined on other machines
You should ideally only change it on the server
to avoid race conditions
but the global variable can take different values or be undefined on other machines only if I tell it to, right?
"Ideally" he... he... he...
well imagine this
MyTag_variable = random 10;
in init.sqf
the global variable will exist on every machine
but it's different everywhere
okay I see
I'm pretty sure modelToWorld does take surface height into z, I've experienced it a lot of times, trying to repro it
please do
erm, don't think so @meager granite
Array - translated world position, format PositionAGL
if (isServer) then {
missionNamespace setVariable ["MyTag_variable", random 10, true];
};
Thanks for the help guys, this would have taken me at least 3 hours of reading to find out myself ๐
this would make the variable be defined everywherre and the same everywhere
@meager granite
Mtw take the center of the model, then add stuff to it
like: Center of Player = [0,0,0]
I have icon displaying over dead player and I sometimes see it appear at ground level when body is inside high cargo tower
oO
_pos = _body modelToWorld (_body selectionPosition "head")
_pos set [2, (_pos select 2) + 0.5];
_screen = worldToScreen _pos;
since it takes the center of the corpse (that might have fallen through the tower on the server or whatever arma does)
This is how positions is determined, through modelToWorld and then UI element is displayed at worldToScreen position
Yeah, did it the same. Never had that Problem
is the head selection still accurate after ragdoll though?
it is, its fine everywhere except sometimes inside cargo tower
Wait Matra, i used the whole body, not the "head"
x and y of position are clearly fine as icon is directly below body at ground level
What commy mentioned, prolly something wrong with the memPointSelection
My only guess is that modelToWorld does take surface into z under some circumstances
or worldToScreen I guess
hm
Hey guys, I've done this _text ctrlSetStructuredText parseText "<t style='text-align: center; font: PuristaMedium; font-size: 14pt; color: #FFFFFF;'>Press</t> <t style='font: PuristaMedium; font-size: 14pt; color: #006196; text-align: center;'>[SPACE]</t> <t style='font: PuristaMedium; font-size: 14pt; text-align: center; color: #FFFFFF;'>to continue</t>"; to get blue in the middle [Space] but everything is just white. Do anyone see what im doing wrong?
arma structured text is not html\css
<t align="center" font="PuristaMedium" color="#ffffff">
You're trying to use html tags with css styles in arma
What i used for the Corpses:
{
if(_x isKindOf "Man")then
{
_Dist = (player distance _x);
if(_Dist < 150)then
{
_SideCheck = _x getVariable ["D41D_CorpseSide",Civilian];
if(_SideCheck == (side player))then
{
if( (_x getVariable ["D41D_DeadAndWaiting",[false,"12345"]]) select 0 )then
{
if(_Dist < 0.5)then{_Dist = 0.5};
_PosX = 2.25 + (_Dist/100);
_FontSize = 0.05 - ((_Dist/1000)*0.5);
_Transp = 0.8 - ((_Dist/1000)*1.5);
_Name = "";
if( (CVD41D_UI_ShowNames > diag_TickTime) && {_Dist < 50} )then{ _Name = (_x getVariable ["D41D_CorpseName",""]); };
drawIcon3D ["\a3\ui_f\data\Revive\revive_ca.paa", [0.8,0.2,0.2,_Transp], (_x modelToWorld [0, 0, 1.25]), 1, 1, 0, _Name, 2, _FontSize, "RobotoCondensed", "center", false];
};
};
};
};
}forEach allDead;```
Found piece of stream with icon on ground level: https://www.twitch.tv/greenhawk2124/v/113762530?t=50m30s
body is on top of tower, icon is under it
Okay, interesting.
Wish I had this myself so I can run modelToWorld against such problematic body to see what happens
My guess is still (agreeing with Commy on that):
(_body selectionPosition "head") <- that part screws it up
What can it even return to screw it up?
[0,0,0] would result in just body position
Its Arma.
ragdolls
Ragdolls different on every client.
So you're assuming that head memory point could bug out to ground level?
No clue without further testing, but i never had that problem with the whole body itself.
Thats what i can tell from my side.
Couldn't image what else it could be
Makes sense though in such cases that I remember body was always fine
Maybe modelToWorldVisual would work as intended.
@tough abyss I had some success with https://community.bistudio.com/wiki/fireAtTarget
@round scroll thanks!
So could not figure out after all how to get ammocount on my turret weapons, magazineTurretAmmo command is broken with multiple same name magazines in different turrets. I could make different named magazines for the turret weapons but would like to avoid that.
Ho!! Got magazineTurretAmmo working! ๐๐
What would I use from here ( https://community.bistudio.com/wiki/leader ) if I want a condition to check if player is leader?
Trying to make a script for assigning High Command units, trying to figure out a way to phrase "If (in the array of High Command groups) "Team One" DOESN'T exist, then..."
I've got a variable for hcAllGroups Player, so the array list should be available, I'm just not sure how to bend it around an If Then statement.
if !{"Team One" in _Groups} returns the expected 'got code instead of bool' complaint.
if !("Team One" in _Groups) actually works, but skips straight to the else result.
Wrong syntax
if ( ) is valid
if { } is not
Okay so your groups variable doesn't contain "Team One" variable
@manic sigil
To test this.
Assign the _groups variable
to a global variable
and put the variable in the watchfield of your debug console
_Groups = globalGrps;
@tough abyss Yeah, got the syntax fixed in the second run. I'm trying >> if !("Team One" in hcAllGroups player) now, skipping the array to variable step I hope.
Or should I put it into a variable first?
Bluh, I'll just post code as a whole.
_Select = [];
if !("Team One" in hcAllGroups player) exitwith {hint "Team One Already Exists"};
_Select = groupSelectedUnits player;
_newGroup = createGroup WEST;
_Select join _newGroup;
player hcSetGroup [_newGroup,"Team One"];
Sounds like you haven't decomposed the script specifications enough.
Quite likely, I need to stop scripting at 2am.
Cleared up the errors, the function creates a group and reliably names it Team One... but I can't get the 'If Team One already exists, exit script" part working. To what I can tell, that group isn't registering in hcAllGroups array, which just returns blank after the first time, then starts listing off groups the more I run the script (B Alpha 1-3, etc)
And when I do get 'B Team One' to appear in the array, "B Team One" in _Groups doesn't return true apparently.
Anyone has insight into how particle model preloading works? Say I need to guarantee that my drop command created spaceObject particle appears properly. Can I say spawn several particles with needed model outside of map on mission start to make sure game preloads the model and use it half hour later with drop command?
Can having outside of map particle source with huge\no interval outside of map help with preloading?
Anyone has experience?
What are you trying to achieve?
I need to make sure that my single particle spawns through drop command when I need it
At the moment you have to call drop several times to make sure model preloads and then next drop commands will finally start creating the particle
basically drop command does nothing if spaceObject model is not preloaded yet
createSimpleObject the particles model? I don't think there is any other way to preload objects without config changes.
createSimpleObject might do for single particle
Gonna try and see if particle source that doesn't spawn anything will help with preloading
So yeah, apparently having particle source with setDropInterval 0 preloads needed particle model and keeps it preloaded
and I kinda solved my own problem while asking it
Erm, is simpleObject evern usable for particles? oO I would wonder if
Well you kinda can simulate needed particle-like behavior
hm, meh. doesnt sound right
Not a proper solution indeed
yeah
Anyway, looks like #particlesource that doesn't spawn anything is the answer for preloading particles
I just meant that you can use it to preload the particles model
not as a replacement
Don't know any other way to load / preload models without CfgVehicles config.
(still can't imagine a situation where its rly needed)
I think entity models are preloaded separately from particles
For instance having full entity with some model and then trying to "drop" same model will work with preloading behavior that I explained above
I meant for the Particles.
I think entity models are preloaded separately from particles
It's the same model though. If it works or not - no idea.
@meager granite If only there was a diag_activeParticleSources ๐
Except there kind of is in arma3diag https://community.bistudio.com/wiki/Arma_3_Diagnostics_Exe
Particles - displays what particles are used in scene and their count
ParticleNames - attaches a name to each particle effect used so that it may be identified
Are you trying to ask if it can be defined in a description.ext or if it has to be in a config?
Wanting to know where it's defined?
It says it's in cfgAISkills
Which is in ArmA3Profiles
but not quite sure.
hey how can i attach a object on projectile with fired EVH ? i tried to just create the object and attach it but that doesnt work
nvm found it ^^
i wonder, can you attach a parachute to a bullet?
@tough abyss allMissionObjects "#particlesource"
can you please use paste/hastebin @dark shadow
Put the link in your first message / remove the code ๐
Hello guys, i am trying to use Simple_Earplugs Script and it shoud be very easy to install. it states to copy the .sqf file into the scripts folder and to type in ""player execVM "scripts\simpleEP.sqf"; " into the init file.
When i try to execute the earplug in the game (left side mousewheel action), i get this error:
""Error undefined variable in expression: _C""
The simpleEP.sqf file code:
https://hastebin.com/ponumivizi.cpp
any idea?
Who loves obscure variables
in scripts.
-,....,-
I'll fix it so it's easy to use.
2 seconds just refactoring variables
Hello GeekyGuy, thanks BoGuu just came back with an answer ๐
It works?
yes, what he has done was taking the _c variable out entirely
Me personally I'd get rid of the obscure variables, and rename them something more sensible.
and it seems to work now
YES, you see i have spent HOURS yeasterday trying to figure this out (and as you can tell, i dont know anything about coding) hahah so, a simpler way might have made it easier for me to understand
What did boguu give you?
Still obscure ๐
hahah yes it is
maybe I should change it.
make it less obscure.
release it.
probably save people a lot of headache
And document it ๐
interactEarplugsAction = ["<t color='#ffff33'>Put on ear plugs</t>",{
_actionAssignedTo = _this select 1;
_whoCalledAction = _this select 2;
if (soundVolume == 1) then {
1 fadeSound 0.5;
_actionAssignedTo setUserActionText [_whoCalledAction,
"<t color='#ffff33'>Take off ear plugs</t>"]
} else {
1 fadeSound 1;
_actionAssignedTo setUserActionText [_whoCalledAction,
"<t color='#ffff33'>Put on ear plugs</t>"]
}
},[],-90,false,true,"",
"_target == vehicle player"];
_this addAction interactEarplugsAction;
_this addEventHandler ["Respawn",{
params ["_playerUnit"];
1 fadeSound 1;
_playerUnit addAction interactEarplugsAction;
}];
@dark shadow
checks it works
nicely done. you should mention this to the developer: http://www.armaholic.com/page.php?id=26624
_whoCalledAction hehehe
Most people don't script for re-usability
that isn't bad is it @thin pine ? is it?
For tutorial purposes it's a nice var name. For more common usage I'd go for _caller
But var names are preference anyway
And put a comment yeah.
_caller _player etc.
Then //comment explaining what is what //
As long as it isn't a single letter or in a foreign language that isnt english it tends to be good
params!
๐
I'd improve it further with.
Yay!
Variable obscurity gone
@dark shadow
self-documenting variable strings
== -> isEqualTo
yep
its a drop in replacement for everything except string comparison
as it is case sensitive
_target == vehicle player
Can do that too?
ofc
_passedPlayerObj = _this;
interactEarplugsAction = ["<t color='#ffff33'>Put on ear plugs</t>",{
params ["_actionAssignedTo","_whoCalledAction"];
if (soundVolume isEqualTo 1) then {
1 fadeSound 0.5;
_actionAssignedTo setUserActionText [_whoCalledAction,
"<t color='#ffff33'>Take off ear plugs</t>"]
} else {
1 fadeSound 1;
_actionAssignedTo setUserActionText [_whoCalledAction,
"<t color='#ffff33'>Put on ear plugs</t>"]
}
},[],-90,false,true,"",
"_target isEqualTo vehicle player"];
_passedPlayerObj addAction interactEarplugsAction;
_passedPlayerObj addEventHandler ["Respawn",{
params ["_playerUnit"];
1 fadeSound 1;
_playerUnit addAction interactEarplugsAction;
}];
@dark shadow fully cleaned up and readable
for your enjoyment
now this i can understand ๐
bad programming == broken code
^
All my stuffs highly modular.
Functions galore
I mean
You can take a massive test expression
and put it in a if ([] call myTag_fnc_myConditionalChk) then { };
instead of stringing together a giant if ( _cond1 || _cond2 && _cond3 || _cond4) then {};
and put those conditional checks inside their own function
Is it faster @dusk sage
?
if (true) then {
if (true) then {
};
};```
is faster than
```sqf
if (true && {true}) then {};
which is faster than
if (true && true) then {};
yeah but what if you wrapped it into a function?
Put the conditionals into like a function file
and return the condition?
sure, then you don't have to evaluate them all
but it would be cleaner to evaluate them step by step and exit if one fails
Thats actually cool
fnc_conditionalCheck = { params ["_cond1","_cond2","_cond3"];
_return = _cond1 || _cond2 && _cond3;
_return;
};
if ([true,true,false] call fnc_conditionalCheck) then {
hint "conidtional check was true";
} else {
hint "conidtional check was false";
};
0.0067 ms for the [true,true,false] call fnc_conditionalCheck
and
compiling
0.0025 ms [true,false,true] call fnc_conditionalCheck;
Interesting
There is a difference between on-demand compiled code
Thats very wierd.
The first evaluation is slower than the next.
wth....
If you introduce a falsity
it takes near 0.0040ms longer
than with a true true true
Nope there is a definite difference between compiled code and non-compiled
use lazy eval. No bytecode in SQF, no
All code in ARMA is compiled
If you call the same file twice, compiling it twice will take longer
Okay so
This
newFunc = compile "{ params ['_cond1','_cond2','_cond3'];
_return = _cond1 || _cond2 && _cond3;
_return;
};"
Executes faster
than this
fnc_conditionalCheck = { params ["_cond1","_cond2","_cond3"];
_return = _cond1 || _cond2 && _cond3;
_return;
};
Why?
I would imagine you're including the compile in your checks
The compile will add time
Like asking
Why is
But there is a definite difference between the 2
test = compile "hint _this";
["test"] call test;
Slower than not compiling
It's because you have an extra step there
hm?
fnc_conditionalCheck is slower
than
newFunc
because of the length of the variable itself.
yes, because one is compiling
it's compiling during your time checks
which will make it slower
Ohhh so it compiles line by line?
where as
compiled
Compiles ALL the code?
So there is no line by line compiling overhead?
That right @dusk sage
?
Your two functions are inevitably the same, except you go through the step of compiling one of them
You're converting it to code, from string, during your time test, which will slow it down
fnc_conditionalCheck = { params ["_cond1","_cond2","_cond3"];
_return = _cond1 || _cond2 && _cond3;
_return;
};
initial function called and executed
to register it
then register
newFunc = compile "{ params ['_cond1','_cond2','_cond3'];
_return = _cond1 || _cond2 && _cond3;
_return;
};"
call the newFnc
new func is faster
than fnc_conditionalCheck
So in both you are placing one of those functions, then calling it?
By an entire 0.0040 ms
Using the code performance button
after executing it yes
So these 2 tests
[true,false,true] call fnc_conditionalCheck;
vs
[true,false,true] call newFnc;
NewFunc is faster by an entire 0.0040ms
and how many tests have you done for this?
Several now.
Changed the variable size
changed the input parameters
Results keep coming back the same.
scratches head
I'm going to purist test this now.
I'll make the funcs the exact same length
in text
and exact same instructions
testing now
2 functions same variable length
This is also MP
and executing it local does not change the time difference
clean restart
2 functions
fnc_condA
fnc_condB
same variable length
same inputs
[true,false,true]
Results.
0.0058 ms fnc_condA
fnc_condA = { params ["_cond1","_cond2","_cond3"];
_return = _cond1 || _cond2 && _cond3;
_return;
};
[true,false,true] call fnc_condB;
0.0057 ms
fnc_condB = compile "
params ['_cond1','_cond2','_cond3'];
_return = _cond1 || _cond2 && _cond3;
_return;
"
Lets change the input parameters
see what happens
0.0057 ms fnc_condA
Sorry I did call
100 nanoseconds means nothing in ARMA
With the compiled one.
There is many factors to consider
I don't know the specifics on how SQF is handled, a dev would need to answer that
But it's not bytecode
Not sure why they wouldn't implement a bytecode to be honest.
it would be a lot faster.
Magic.
Some vector calculations done by engine
Myeah its looping
I would imagine there is some lazy evaluation to get decent performance
Add like a 1000 of them and see what framerate u get
The actions do a 15 meter check anyway
The distance parameter probably just modifies that number
Can anyone help me with setting up file patching on my server so I can load unpacked serverside code into the server.
there's a channel called server_admins. probably better to ask there
@tough abyss I know how to enable it, but it doesn't load the code.
a3Server/@MyAddonFolder/Addons/FolderXYZ/init.qsf
Now you just load it with -mod=@MyAddonFolder
ok will try, thanks
Hi everyone. I have a script which passes global variables between clients. What is best:
publicVariable PV_1;
or
missionNamespace setVariable ["PV_1", _PV_Local];
What is the difference between them? I also later whant to recall them. Can I just use PV_1 in my script or do I now first need to:
missionNamespace getVariable "PV_1";
To make it global (incl. JIP)
missionNamespace setVariable ["PV_1", true,TRUE];
On Client
hint str (missionNamespace getVariable "PV_1"); (Result: "true" in hintbox)
(added: Can't remember if a simple hint str PV_1; would also work on Clientside, you might have to test it out)
If I wanted to use getText from CfgVehicles to get the Classname of the vehicle, what would that be called?
I.e. _vehicleName = getText ( _x >> "classname" );
... you'd already have the classname in order to access its config, do you maybe mean the displayName?
yeh it will @jade abyss
This is what I mean @indigo snow ```// -- Load vehicles into variable
private _mcfVehicles = missionConfigFile >> "CfgVehicles";
// -- Purge Listbox
lbClear _listbox;
{
// -- Get vehicle class name
private _vehicleName = getText ( _x >> "classname" );
// -- Get vehicle picture
private _vehiclePicture = getText ( _x >> "picture")
// -- Add all vehicles
_listBox lbAdd _x;
// -- Set Picutre
_listBox lbSetPicture _vehiclePicture;
_listbox lbSetData [ ( lbSize _listbox )-1, _vehicleName ];
} forEach _mcfVehicles;```
so you want an array containing all child classes of cfgVehicles? what you have right now will plain not work.
I want to get all vehicles in CfgVehicles
private _mcfVehicles = "getNumber (_x >> 'scope') == 2" configClasses (configFile >> "CfgVehicles"); would return an array with all the config classes in cfgVehicles with a scope of 2
then configName <CONFIG ENTRY> would return the config name of a specific config entry
which you then cann access through configFile >> "cfgVehicles" >> vehicleConfigName
What does the 'scope' do?
only config entries with a scope of >= 1 can actually be created
else youd try to add stuff like the base classes
Ah alright
youd still have to filter out a lot of stuff, best to filter by the simulation type
all units, backpacks, etc also have entries in cfgVehicles
buildings and objects too
What do you mean by this configFile >> "cfgVehicles" >> vehicleConfigName?
vehicleConfigName is just a random variable name I used
it would contain the configName of the current entry
So you mean something like this ? ```// -- Load vehicles into variable
private _mcfVehicles = "getNumber (_x >> 'scope') isEqualTo 2" configClasses ( configFile >> "CfgVehicles" );
// -- Purge Listbox
lbClear _listbox;
{
// -- Get vehicle class name
private _vehicleName = ( configFile >> "cfgVehicles" >> _vehicleClassName );
// -- Add all vehicles
_listBox lbAdd _x;
_listbox lbSetData [ ( lbSize _listbox )-1, _vehicleName ];
} forEach _mcfVehicles;
private _vehicleName = ( configFile >> "cfgVehicles" >> _vehicleClassName ); no
you need to define _vehicleClassName there first
yes, but you can't just plonk _x in there
since _x is already the config path to the vehicle
So how would I use _x then?
You'd use configName to get the classname of the vehicle as a string I'd imagine
So basically like this then ```// -- Load vehicles into variable
private _mcfVehicles = "getNumber ( _x >> 'scope' ) isEqualTo 2" configClasses ( configFile >> "CfgVehicles" );
// -- Purge Listbox
lbClear _listbox;
{
// -- Get vehicle class name
private _vehicleName = configName _x;
// -- Add all vehicles
_listBox lbAdd _x;
_listbox lbSetData [ ( lbSize _listbox )-1, _vehicleName ];
} forEach _mcfVehicles;```
now your _vehicleName is correct, but it will break at this
_listBox lbAdd _x;
look at what types lbAdd accepts on the wiki
Ok so that wont be a string
So I need to get the displayName
which is displayName I assume?
its the displayName property of the vehicle class in cfgVehicles, yes
So ```// -- Load vehicles into variable
private _mcfVehicles = "getNumber ( _x >> 'scope' ) isEqualTo 2" configClasses ( configFile >> "CfgVehicles" );
// -- Purge Listbox
lbClear _listbox;
{
// -- Get vehicle class name
private _vehicleClassName = configName _x;
private _vehicleDisplayName = ( missionConfigFile >> "CfgVehicles" >> _x );
// -- Add all vehicles
_listBox lbAdd _vehicleDisplayName;
_listbox lbSetData [ ( lbSize _listbox )-1, _vehicleClassName ];
} forEach _mcfVehicles;```
private _vehicleDisplayName = ( missionConfigFile >> "CfgVehicles" >> _x ); no
what is _x here?
getText(_x >> "displayName") ?
I'll try that
also wait one sec I see you use missionConfigFile vs configFile, is this intentional? do you have a defined cfgVehicles in your description.ext?
naaah
Ye
So it needs to be from default arma vehicles
Not my own
So I changed _mcfVehicles ```// -- Load vehicles into variable
private _mcfVehicles = "getNumber ( _x >> 'scope' ) isEqualTo 2" configClasses ( missionConfigFile >> "CfgVehicles" );
// -- Purge Listbox
lbClear _listbox;
{
// -- Get vehicle class name
private _vehicleClassName = configName _x;
private _vehicleDisplayName = getText ( _x >> "displayName" );
// -- Add all vehicles
_listBox lbAdd _vehicleDisplayName;
_listbox lbSetData [ ( lbSize _listbox )-1, _vehicleClassName ];
} forEach _mcfVehicles;
// -- Define Button to Spawn Vehicle
private _buttonSpawn = _display displayCtrl IDC_RscDisplayVehicles_ButtonSpawn;
// -- Add action on button click for spawn button
_buttonSpawn ctrlAddEventHandler [ "onButtonClick", {
// -- Get Selected Vehicle
private _selectedVehicle = lbData [ IDC_RscDisplayVehicles_ListVehicles, lbCurSel ( IDC_RscDisplayVehicles_ListVehicles ) ];
// -- Create Vehicle at Position of Player
private _vehicle = _selectedVehicle createVehicle position player;
} ];```
from configFile to missionConfigFile instead
Maybe that will do it
no please you need to use configFile please look up the commands on the wiki
you need to understand configs more
So it doesn't matter? It will still load vehicles from default ArmA configs and not defined ones in description.ext?
you can't define vehicles mission side, you need to use configFile
Got a bit confused by your comment also wait one sec I see you use missionConfigFile vs configFile, is this intentional? do you have a defined cfgVehicles in your description.ext?
And I was confused by you using missionConfigFile consistently so I was trying to make sure there wasnt any wierdness going on
it's fine tho, just use configFile consistently
Alright
Yeah missionConfigFile would be description.ext ๐คฃ
not configClasses lulz
Any idea how I can convince AI to jump out of a flying helicopter?
moveOut
nothing that works with waypoints?
correction: nothing that works with JUST waypoints?
it's really not that complicated
{ if (_x != driver _x) then {moveOut _x}; } forEach thisList;
on Act.
@little eagle why not !(_x isEqualTo driver _x) ?
Because it doesn't matter
isEqualTo is faster, no?
So? It doesn't matter if you save a millisecond once in a mission
No, but why not if it's faster
It isn't. They are about the same, because the difference is too small to matter.
I mean.
Sure.
But if you wanted to save performance
You wouldn't use waypoints or triggers in the first place
So
I guess
I didn't think of that but I'll change to count
๐
Does forEach and count work basically the same?
So you can use the exact same stuff in there?
Just use forEach
So it's not the same?
If they were the same, then there would be no point in having them both
I know they're not exactly the same
Then ask: "How are they different"
But if I made a forEach that worked, would I be able to change it to count and it still being compatible?
Not necessarily
And how are they different?
Sniped? From what I read they're used to count i.e. a string which cant be done with foreach?
Sniped
I would make the perfect answer pointing out all differences, but 3 other people throw in their ideas and the chat becomes a mess
As usual
lol
So?
forEach has _forEachIndex
CODE count doesn't
CODE count expects a nil or boolean return value of the code block
otherwise it errors
CODE count reports the number of times the code block reported true
forEach reports the return value of the last iteration through the code block
that's basically it
Oh ok
CODE count is also different from count, which does not iterate through a code block like a loop and has therefore nothing to do with this at all
CODE count is marginally faster, because it does not increment the _forEachIndex thing
Still waiting for the day they add _countIndex and this discussion dies once and for all
theyll also add a _currentCount and suddenly everyone uses forEach to count stuff
I'd laugh
Oh, really annoying fact.
CODE count errors when the code block reports that null pointer type of nil
It has to be GameValueNil and not a GameValue with null pointer
{
nil animate ["", 0];
} count [0];
^ this errors
Btw, to get an icon from config file, would that be icon or picture?
I.e. private _vehicleDisplayIcon = getText ( _x >> "icon" );
I couldn't find what it was when looking at the config
Discussion about it: https://github.com/acemod/ACE3/issues/4814
check the ingame config viewer, Sim
I did
Uhm, and?
Oh yeah its picture
Didnt find it before
Do I need to do str like here _listbox lbSetData [ ( lbSize _listbox )-1, str ( _vehicleClassName ) ]; or no because it should already be a string when doing this private _vehicleClassName = configName _x; right?
all you do by adding the str to a string is adding more quote marks
ah ye ok
wait what?
Also, when doing lbSetPicture, it would be _control lbSetPicture [_x, _picture] right?
Cause when I did 0 only the first one got a picture
_listbox lbSetData [lbSize _listbox - 1, str _vehicleClassName];
Alright
idk tbh
SQF already has so many brackets
But people love their parenthesis
I'll never understand that mindset
All they do is make things more complicated
Well in this case, they did nothing but in some cases they are pretty good for readability
No
Well I think that at least
for example if ( !( player isEqualTo player ) )
and not just if ( !player isequalto player )
Its only an example ๐
But you see what I mean atleast?
That is okay
Then use it, because that is how I'd do it
private _listbox = _display displayCtrl IDC_RscDisplayVehicles_ListVehicles;
// -- Load vehicles into variable
private _mcfVehicles = "getNumber ( _x >> 'scope' ) isEqualTo 2" configClasses ( configFile >> "CfgVehicles" );
// -- Purge Listbox
lbClear _listbox;
{
// -- Get vehicle class name
private _vehicleClassName = configName _x;
private _vehicleDisplayName = getText ( _x >> "displayName" );
private _vehicleDisplayPicture = getText ( _x >> "picture" );
// -- Add all vehicles
_listbox lbAdd _vehicleDisplayName;
// -- Set picture for each vehicle
_listbox lbSetPicture [ lbSize _listbox -1, _vehicleDisplayPicture ];
// -- Set listbox data to be used later
_listbox lbSetData [ lbSize _listbox -1, _vehicleClassName ];
} forEach _mcfVehicles;
// -- Define Button to Spawn Vehicle
private _buttonSpawn = _display displayCtrl IDC_RscDisplayVehicles_ButtonSpawn;
// -- Add action on button click for spawn button
_buttonSpawn ctrlAddEventHandler [ "onButtonClick", {
// -- Get Selected Vehicle
private _selectedVehicle = lbData [ IDC_RscDisplayVehicles_ListVehicles, lbCurSel ( IDC_RscDisplayVehicles_ListVehicles ) ];
// -- Create Vehicle at Position of Player
private _vehicle = _selectedVehicle createVehicle position player;
} ];```
It shows everything alright
Only thing is, it doesnt spawn and it when opening the menu it says picturelogic not found
When I had _listbox lbSetPicture [ 0, _vehicleDisplayPicture ]; it looped through all images to the top list item
I tried putting -1 or _x but didnt work
Not every line needs a comment, mate. Especially when the comment for lbSetPicture is "Set picture ...".
Or are programmers paid per line?
It's just how I write my code
Do I need to call compile on the string?
so call compile _selectedVehicle?
What do you think im doing wrong for it not to spawn?
idk, add diag_logs and systemchats to debug that bitch
Alright ill do that
And you have no idea of why this wouldnt work? _listbox lbSetPicture [ lbSize _listbox -1, _vehicleDisplayPicture ];
Oh shit it actually works lol
It was just some stuff didnt have pictures lol
should add a default picture for that case then
How would I do that?
just check if the picture is ""
and oerwrite the variable with a default picture path
If I wanted to list only a certain types of vehicles, what would be the best way to do that?
Actually found a way
Certain classes?
or certain types?
Better description, certain catagories?
isKindOf will give you the ability to filter
vehicles of Air,Sea,land etc.
@rotund cypress
Hey @meager granite explain to me why the reverse works in this?
deepSearch = {
private _needle = _this select 1;
private _path = [];
(_this select 0) call deepSearchRecursive;
reverse _path; <---- This line ?
_path
};
deepSearchRecursive = {
{
if(
_x isEqualTo _needle ||
_x isEqualType _path && {_x call deepSearchRecursive}
) exitWith {
_path pushBack _forEachIndex;
true;
};
false;
} forEach _this;
};
[tripleNested, 12] call deepSearch;
(edited)
Ok I found a way to do it
Only problem I have now is that I can't spawn vehicles because it says can not spawn Non AI vehicles
I guess it's because im trying to spawn weapons using createvehicle but hmm
Requires a weapon holder
Is it the same with clothes and stuff?
Likely
Why do you look on the forum?
To double check your problem wasn't already solved?
weapon1 = "groundweaponHolder" createVehicle position gunrack1; weapon1 addweaponcargo ["srifle_EBR_F", 10];
exactly what I said
it's s screwy hack.
I know it is
Because most of the interaction, with stuff on the ground is just like interacting with a container'
What is currently the nicest way of finding strings in an array and remove them ?
I have two arrays and I want to have all the elements that are not in one of them.
well sometimes bi methods are not the best. ๐
sometimes there is room for improvement
using cba functions for example.
_neededaddons = [
"a3_ui_f", "a3_structures_f_mil_helipads", "a3_modules_f", "a3_characters_f", "a3_data_f_exp_a_virtual", "a3_modules_f_curator_curator", "ace_advanced_ballistics", "ace_hearing", "ace_interaction", "ace_map", "ace_microdagr", "ace_finger", "ace_respawn", "ace_explosives", "ace_advanced_throwing", "ace_advanced_fatigue", "ace_cargo", "ace_repair", "ace_refuel", "ace_rearm", "task_force_radio_items", "ace_medical", "ace_medical_menu", "a3_structures_f_mil_fortification", "ace_logistics_wirecutter", "ace_concertina_wire", "cup_cabuildings_misc", "a3_signs_f", "a3_structures_f_mil_bagfence", "a3_boat_f_boat_transport_01", "cup_camisc", "rhs_us_a2_airimport", "ace_compat_rhs_usf3", "rhsusf_vehicles", "a3_soft_f_exp_lsv_01", "rhsusf_c_statics", "a3_structures_f_mil_cargo", "rhsusf_c_melb", "rhsusf_c_m1a2", "rhsusf_c_ch53", "a3_structures_f_system", "cup_misc_e_config", "a3_structures_f_mil_shelters", "a3_weapons_f_ammoboxes", "a3_structures_f_mil_flags", "a3_structures_f_walls", "rhsusf_c_hemtt_a4", "rhsusf_c_troops", "a3_soft_f_quadbike_01", "cup_cwa_misc", "a3_structures_f_heli_items_airport", "rhs_c_weapons", "rhsusf_c_f22", "rhs_us_a2port_armor", "cup_castructuresland_nav_boathouse", "rhsusf_c_markvsoc", "a3_boat_f_exp_boat_transport_02", "a3_structures_f_naval_buoys", "a3_structures_f_naval_piers", "rhsusf_c_fmtv", "a3_armor_f_beta_apc_tracked_01", "ace_realisticnames", "ace_weather"
];
_missingaddons = [];
{
if (activatedAddons find _x == -1) then {
_missingaddons pushBack _x;
};
} forEach _neededaddons;
I am building my own missing addons system right now so people can join in and can get an explenation what is going on
then exiting with.
Why do this anyway?
Thats a lot of elements in an array to iterate over.
it is but I want them to see what addons they are missing when joining our server.
Get teamspeak info
we have like 20 - 30 connects each hour that go missing because they do not have any info.
So we remove the required addons from mission sqm
but it in sqf and work from there
As I said binary search
You could also use a pseduo-hashtable
BIS_fnc_addPairs
Basically a dictionary.
forEach is a linear search.
Any new tricks to running missions with higher frame rates like enableEnvironment false; ?
The impact of the environment from what I noticed is minimal
I got the gold edition, it comes with a constant loop of {deleteVehicle _x} count alldead;
@tough abyss One thing I like about Python
I can compare "C" > "F"
Binary search very easy.
Whoa
It might work
isEqualTo can compare strings
Can it compare 2 different strings hmm
I wish we had case-insensitive find to cut on toLower'ing everything beforehand
yes i do
show me your code
I'd call it findCI
shared_func_unflipVehicle = {
_z = getPosATL _this select 2;
_this setVectorUp surfaceNormal getPosWorld _this;
if(local _this) then {
_pos = getPosATL _this;
_pos set [2, _z - (boundingCenter _this select 2)];
_this setPosATL _pos;
};
};
here is my code if you want to use it
execute on all clients & server
everywhere, yes
as you can see it does setPosATL only on local while just fliping it everywhere as setVectorUp is local
No, it works 100% of the time
On any height or sloped ground
boundingCenter manipulations are needed to prevent vehicle from jumping up\down during flipping
you probably can execute it only where vehicle is local too
center differs from vehicle to vehicle a lot
will cause issues at some point
is it possible to terminate the threads shown in diag_activeSQFScripts somehow?
k thx for swift answer
I nominate this for the worst variable name ever used:
_onoff
It's a number between 0 and 0.95
Just think about it though
Imagine if that was a boolean. I mean it basically is since it's either 0 or 0.95
It's basically named _truefalse
Has anybody else ever dealt with (nato) helicopters simply refusing to land?
I've had this happen a lot, but I never found a way to fix it
this time the mission depends on it though
do u use helipads?
This WIKI seens outdated: https://community.bistudio.com/wiki/ParticleTemplates
I'm trying to make the Light Wood Smoke Small but the model "\Ca\Data\ParticleEffects\FireAndSmokeAnim\SmokeAnim.p3d" is missing.
Anyone can help?
both path and screenshot next to the example suggest that it's from arma 1 ๐
It's a wiki. You or anyone else can fix it.
@polar folio @little eagle thanks!
I was searching for something similar, but there isn't anything in A3. Sorry
does anyone knows a WORKING taser script (non altis life) and a restarin script which works in MP?
@tough abyss go here https://community.bistudio.com/wiki/ParticleArray
random stuff from the config as an example "\A3\data_f\ParticleEffects\Universal\Universal", 16, 7, 48, 1
above page will tell you what the numbers are
@polar folio the parameter seens to be the same from Arma 1. Thanks, i will unpbo data_f. Here i found some smokes: https://community.bistudio.com/wiki/createSimpleObject/objects
@little eagle no problem mate, found some smokes here: https://community.bistudio.com/wiki/createSimpleObject/objects
"the parameter seens to be the same from Arma 1"
almost. if you look closely you see that arma 3 has one more behind the model path. not sure if i'm mixing something up here but i mean by comparing both wiki pages. the page i linked you defo works. i used it several times before
I was searching the AllInOne config for 1.66
But the only "smoke.p3d" there is cloudletMissile="A3\data_f\missileSmoke.p3d";
@polar folio thanks. It's not worked, will try to add the missing number.
arma uses a single atlas texture/model for most particles
its the loop or not to loop parameter
it's all explained on that link i provided
it's like a sprite sheet, if that explains it better
i'm reading it all
the numbers define which of the parts of it are used and how many and stuff
so that way you can have a single billboard that has an animated texture on it using those squares as frames. you'll see when you experiment wtih some settings
Thanks!
@meager granite Is it worth implementing a binary search algorithm in arma 3?
Or is it more costly computationally than simplely array find x ?
what is the selection name of a turret barrel?
"otochlaven",
"bolt",
"magazine",
"bullet008",
"bullet001",
"bullet002",
"bullet003",
"bullet004",
"bullet005",
"bullet006",
"bullet007",
"zasleh",
"proxy:\a3\data_f\proxies\muzzle_flash\mf_machinegun_mk30.001",
"recoil",
"otochlaven_shake",
"proxy:\a3\data_f\proxies\gunner_standup01\gunner.001",
"camo1",
"camo2",
"zbytek"```
Anyone knows how to server side you missions file
Yes and no.
Look at how Altis Life does it.
You have to resort to message passing if you do.
Which means server-side data has to be remoteExec'd
to get to a client
which generates more traffic overhead, from the actual remoteExec of the functions / data
Okay, but how do i actualy make it server sided then
cfgPatches
You know any side with like a tutorial on that?