#arma3_scripting
1 messages Β· Page 281 of 1
hm. are we talking vanilla here?
ye
how do you wrap code in here?
ty
Guyz anyybody knows just only 1 country can join to the server how can I do it on Dedicated Server?
D:
configure your servers firewall accordingly
huhu π
configure your servers firewall accordingly
Dedmen gave you the answer
Understood dude thnx also @still forum .
π¨
β
That coffee is on me btw
Much appreciated brother
Hey guys, anyone know how I can create a dialog within a addaction?
nvm
this addAction ["dialog",{createDialog "";}];
hahah
player addAction [magicHappens,"createDialog 'NameOfDialog'"]; ?
Well if you can put in hints that way then it should work
I have an idea, I'll give it a try π
Just found out that it IS possible to get classname through an eventHandler in the inventory
Quite happy now π
You mean get display? @cerulean whale
As in, you can get the classname of an item that you double click on
oh
I was just going to put all the names in a config for my purpose, but now that I found I can do classname that is easier
I was just mucking around, even though I was told it didn't work. I'm quite happy, solves a ton of issues
@cerulean whale Only Magazines.
If you would read everything:
I told you it works, but only with Magazines. Other items will not be shown.
Why is it only Magazines?
If you wan't to work with other Items, you have to check for the localized name.
Because Arma
Taken from my old files:
private["_selectedIndex","_Item","_ItemName","_idc"];
disableSerialization;
_idc = ctrlIDC (_this select 0);
_selectedIndex = _this select 1;
_Item = format ["%1",lbData [_idc, _selectedIndex]];
_ItemName = format ["%1",lbText [_idc, _selectedIndex]];
//systemchat format ["_idc: %1 | _selectedIndex: %2", _idc, _selectedIndex];
//systemchat format ["_Item: %1 | _ItemName: %2", _Item, _ItemName];
if(_ItemName == localize "STR_A3_cfgWeapons_FirstAidKit0")then
{
systemchat "FirstAidKit selected";
};```
I'll just use displayName then, considering the only items I need it to work for will be entirely unique anyway
Thanks for the help though, I didn't see that message the other day
Again: localize
Is it possible to add a "unit" to Zeus's placeables, which functions as a module to run a brief script?
What im thinking is, Zeus has "AT Soldier" selected, places it, it costs points - then the item runs a script to wait x seconds and spawn said AT soldier from a barracks before running them to that spot.
CfgFunctions effectively compileFinal by default unless I set allowFunctionsRecompile = 1; right?
ahh, nm yeah that's right
rrrrad
Agents geting stuck , running without move can be fixed?
Found the problem, use moveTo to a place where the agent can't go.
How would one tell the difference between a uniform and a vest?
ooookayy Im having trouble understanding why this isn't working ..
a = objectList;
b = a select 0;
c = b select 0;
d = c find guy1;
where objectList is a global var that holds a bunch of different objects. These objects are suppose to be removed from this array as they are interacted with. In this instance, I have 2 objects (both AI)
objectList = [[[guy1]],[[guy2]]];
The problem is, when I interact with the object, if fails to be removed. The object can't be found in the array. d returns -1.
Here's my confusion, and Im sure it has something to do with global arrays (though I cant modify it if I cant find the item in the index).
When I manually delcare the array:
a = [[[guy1]],[[guy2]]];
b = a select 0;
c = b select 0;
d = c find guy1;
d returns the correct index. what the hell am I doing wrong? ._.
to clarify; I am running the deleteAt method when I find the index. Just cant find the index π
also, when I manually delcare, the debug console output shows a as this
[[[<NULL-object>]],[[<NULL-object>]]]
despite declaring it
a = [[[guy1]],[[guy2]]];
Are guy1 & 2 actual names units?
They are vehvarnames. typeName returns "OBJECT"
could be a type issue, then. as in, I'm trying to array find object and the array is full of strings
quick check says no. Surrounding guy1 in quotes does not change results.
a little tough to explain lol. basically Im using it to keep track of mission progress. Each interaction that is complete results in that object being removed from the array. once that array is empty, the empty array is removed and the mission progresses to the next array in the overall array
nope, I need that amount of arrays lol.
[//mission
[//section
[//objectives for this section
]
]
[//second section
]
]
the good news is I made progress. instead of adding and removing references to the object, I switched over to strings referencing the object's name (all of which are unique)
so now I can drill down, find the string and remove the string
now I just need to figure out how to access the object given a vehiclevarname string
for example,
removeMPEventHandler["MPHit", 0];
but in order to do that I have to pass OBJECTremoveMPEventHandler ARRAY.
any idea how I get OBJECT from the object's name in string format?
call compile "stringobject"
that didnt work :S
doesnt return anything anyway. setting
a = call compile "guy1";
a doesnt equal anything and cant be accessed or acted on
Call compile won't work for strings like that because it aint a valid operator
If guy1 was a array you would get an array... but it aint. What are you trying to achieve?
Why don't you set the object as a public variable when you create it. If there is more than 1 pushBack it into ann array then select it
"guy1" is an element of a multidimensional array. The object is a global and accessible any time, but I dont know what those names will be (they are generated, not manually set. think militaryDude1 through militaryDude5123135). These strings are added to the global array on init and throughout the mission these strings need to be removed. Which is fine, it works as expected, but I need to do something with the objects that the string references
hence trying to get a reference to that object based on string.
ultimately what Im trying to accomplish is to set hideObjectGlobal false at some point in the mission. I cant do that without OBJECT hideObjectGlobal false, but at that point all I will have is a string that is the object's vehiclevarname
If it's a public variable why do you need a string at all? Just reference the public var
Or add a schedule array then run a foreach using that schedule in a while loop
@broken mural _unit = call compile "guy1";
missionNamespace getVariable ["guy1",objNull] solves Nil issues too
What's up with people using [[[ nested arrays? Do you really hate yourselves this much?
Use more than one variable?
also configs
If I have more than 1 variable I'll still need to store all those variables in an array to access them
No, you store them in multiple arrays.
Once I have them in multiple arrays, I will need an array to accces those multiple arrays
No, you don't.
How do I acquire the information than ? In a dynamic script ?
I want as little human involvement as possible. So it's automatic
[[_group,[var1,var2],var3,"var4"]]
Oh! A woman in Arma!
π€
call compile "[0,1,2,3]"
Is there a way I can pass params into an BIS_fnc_addStackedEventHandler?
@rotund cypress use global params
As not passing a param just saving it to one of the namespaces
cant i just do _display = findDisplay IDC; [ "eventhandler", "onEachFrame", { params [ "_display" ]; } , _display ] call BIS_fnc_addStackedEventHandler;
I could save a var to uiNamespace but if above is possible that would be easier
I think you can do some magic with format
@tough abyss
Are you trying to avoid call compile because cheaters?
private _string = "[0,1,2,3]";
private _result = [];
{
_result pushBack parseNumber _x;
} forEach (_string splitString "[,");
_result
Oh sorry @rotund cypress you can pass params
'[key, event, code, arguments] call BIS_fnc_addStackedEventHandler;'
`
So what I did before will work? @rapid plume
_display = findDisplay IDC;
[ "eventhandler", "onEachFrame", { params [ "_display" ]; }
, [_display] ] call BIS_fnc_addStackedEventHandler;
Should work
ah ye
Yeah, just use call compile for callExtension
Sucks, but it's alright for short strings.
Just write a function for it. It's not a operation you need all the time.
Just sharing: checkVisibility is a bit faster than lineIntersectsSurfaces in the same check.
Extra 1: using a second ignored object in checkVisibility will make it slower, but still faster than lineIntersectsSurfaces.
Extra 2: in checkVisibility, if you use the "VIEW" LOD, you don't need to ignore the player when, for example, using eyePos player as the begin.
If you use "FIRE" or "GEOM" LOD, you need to ignore the player otherwise it will have a vision field based in the head geometry.
what would be an efficient way to structure a script which goes through cfgVehicles and finds every structure which isn't just a base class?
right now i'm trying configClasses and testing if "structures" is in _x >> vehicleClass, but it takes fucking ages, like 20 mins
(([(toLower (getText (_x >> 'vehicleClass'))), 0, 5] call BIS_fnc_trimString) isEqualTo 'struct') &&
!((getText (_x >> 'displayName') isEqualTo ''))
)" configClasses (configFile >> "CfgVehicles");```
that is not the best way to approach this, right?
@peak plover I've tried call compile "string" and it doesn't appear to set a reference to that object. It doesn't return anything and it doesn't allow me to interact with the object via script.
@indigo snow same thing, actually one of the first bits I've found. I'm lead to believe there's an issue with something other then this, seeing as how this answer keeps coming up.
@little eagle I'm using nested arrays because I wont know how many of each object for each section or how many sections there will be. I dont have much of an issue dealing with the logic behind nested arrays so Β―_(γ)_/Β―
Hey I'm trying to make 2 hidden selection textures on a model I have, but it doesn't seem to be working. Can anyone see anything wrong with my config or model.cfg? Here is my model cfg: http://pastebin.com/63c4ar0H and my config.cpp http://pastebin.com/M2MbP8KU
Just did a quick test and. well this is interesting. I have the object spawn on init named guy1. I add an object named test123 in the editor, do
a = call compile "test123";
and it gets the ref just fine, but doing the same for guy1 results in <null-Object>
If you want to change the value of that variable use >
value = 0;
_var = "value";
_temp = call compile _var;
missionNamespace setvariable [_var,_temp + 1];
also tried that lol
doesnt return anything.
this is super weird π doing vehicleVarName cursorObject returns the correct string for both objects (test123 and guy1). call compile both results in different information.
a = call compile "test123";
a
test123
a = call compile "guy1";
a
any idea why
_a = cursorObject;
wouldn't return a reference to the object, but if I
hint format ["%1", cursorObject];
it works just fine?
i think _a = format ["%1", cursorObject]; would work
nada
there's a difference between the cursorObject and formatting the cursorObject in to a string
really?
Yeah seems so lol
_a in watch is blank using that code
but vehiclevarname cursorOjbect isnt
i've not scripted in about 6 months, am rusty, ask someone good π
the nature of communal assistance is taking whatever you can get lol
what are you trying to do exactly?
oh, switching the var to global (a instead of _a) returns the string
WTF ITS WORKING NOW ><
a = cursorObject returns ref to object.
okay working backwards now,
a = missionNameSpace getVariable ["guy1", objNull];
a
<NULL-object>
is there a different namespace I could/should check?
What
think it's an old skool arma 1 function that nobody uses
@broken mural Found that myself, yeah.
Still doesn't change the fact: Why? It makes no sense^^
cursorTarget/Object = VarName of it oO
I parse the object names to dictate what spawns, when, and where. All of this is being done in init or eventhandlers, not in game so cursorObject/Target isnt an option
That was an example...
do you have another example where it's done automatically instead of requiring interaction?
What are you trying to achieve?
thats not an answer
Means: Why do you use VehicleVarName, what you wanna do with it or where its beeing used in.
in this particular instance I'm trying to spawn however many of a specific unit the mission builder wants. on init, all but the one dictated to be the first objective is visible and is killable. On kill, the next one is suppose to be visible and the event handler for that particular AI is replaced.
Yessir. The mission builder never places the actual AI, either. just an invis helipad with a specific name that dictates what is suppose to spawn there and what part of the multidimensional array it belongs to
maybe, but I'm trying to avoid loops and bogging down performance and rely solely on event handlers and pre mission string parsing that occur precisely one time on init
Var_VehName = "ClassName" createVehicle [0,0,0];
Do not overreact. I assume your Mission is not for >60Players?
Its complicated, but I'm going this route to obfuscate the actual logic. The end goal is for players to only have access to a bunch of invisible helipads with weird names and calls to serverside scripts. the mission is going to be 100+.
big task, chipping away at the details. one of the last is this referencing object by string lol
That's not an issue. π
it is, but okay.. you will notice
nah theres a bunch of cleanup going on. I'm limiting how much AI can spawn in at a time
reference by String?
_abc = missionNameSpace getVariable["VehVarName",ObjNull];
systemchat str _abc;
Simply the amount of 100ppl will be a prob, but... as i said: You will notice.
_abc returns nothing for these objects i'm spawning on init. It works fine if I reference a vehvarname that I spawn in the editor, though
currently, cursorObject on the init spawned returns the object reference.
Then, you should rework your scripts again, cause that is stuff that works. I used it in the past pretty often.
mkay, I'll take a look at adjusting how I'm doing this.
there's a part Im missing that is, what the hell is the difference between an object im spawning programmatically vs an editor object
_VarName = _x select 0;
_Type = _x select 1;
_MtWPos = _x select 2;
_Dir = _x select 3;
_Car = _Type createVehicle [0,0,0];
_Car call _ClearVeh;
_Car setDir _Dir;
_Pos = _Side_Toilet modelToWorld _MtWPos;
_Car addEventHandler ["HandleDamage", { call gD41D_fnc_g_Handle_Damage_Vehicle; }];
_Car setPosATL [(_Pos select 0),(_Pos select 1), 0.25];
missionNameSpace setVariable[format["SVD41D_Veh_%1",_VarName], _Car];
Thats what i used to spawn a Veh wich can be accessed by missionNameSpace getVariable["SVD41D_Veh_1",ObjNull];
later on.
Im gonna try that again (the setVariable portion).
This ran in a forEach-loop, creating every base vehicle at Spawnpoint.
yeah Ive got the spawns in a loop as well. Testing here in a sec.
Play around with missionNameSpace setVariable and getVariable out of context. Not directly inside your mission. Take your time and test a bit around.
Thanks for the back and forth, @jade abyss . I program for a living and the one thing i've found frustrating about this environment is the lack of solid communication lol. Cheers π
That's been the experience so far. Even so, just asking questions on here gets me thinking in a different approach and gets me there. This one has just had me confused lol
You are fantastic, @jade abyss. I had incorrectly setvariable last night at 2 AM and gave up on it. It worked wonderfully π
`
Kot - Today at 7:40 PM
You are fantastic, @Dscha.`
I know.
I am curious what you think of KOTH seeing as how several of those servers are running 100+ players and performs fine
@broken mural btw.:
Stuff that has been set with
missionNameSpace setVariable["VARNAME", "123",(if in MP for JIP/broadcasting:) TRUE];
can easily be accessed with a:
hint str VARNAME; //Result: 123
Yeah I misinterpretted setVariable as a way to return specific properties of an object. I didnt realize you could return the entire object using the objNull
*get, not set
using the objNull
Has nothing to do with that
the objNull is just specifying what to default to, if your variable is undefined
Considering you're expecting an object, best to give you a null object
π
so you could technically exclude that, its just a try catch method to avoid errors
yep
good to know π
It doesn't error, it just gives you objNull instead, if you didn't have the default, you'd need to check if your variable was nil
VarWithStringInside = "123";
_abc = XXNameSpace getVariable ["VarWithStringInside",ObjNull];
Result:
_abc = ObjNull;
Ah okay
@jade abyss That wouldn't give you "abc" π€ ?
Snap, yeah. I mixed that with Param. My bad
Nah I mean
_abc = XXNameSpace getVariable ["gerigjeriogjeroigjeriogjeriogerjiogj","abc"];
Result:
_abc = "abc";
I think is more appropriate
π
I delete mine, had a brainfart π
So, anyone interested in this ai script?
Anyone know how to make a EMP nuke script? Been trying to make one for a sanario i'm working on. Any help would be great!
can't you also damage the intruments on helos and stuff using sethitpointdamage? can't remember, if that was another game or older arma but i remember instruments being able to be damaged.
you can also do some fun stuff like damage light poles around the area
what language would you say sqf most resembles?
esperanto
early 1900's reference. nice.
thank you red dwarf
okay one more question in line with multdimensional arrays;
{
{
{
}foreach _x;
}foreach _x;
}foreach globalArr;
is this operation allowed?
I was wondering that the other day
I think you need to
{
private _l1 = _x;
{
private _l2 = _x;
{
}foreach _l2;
}foreach _l1;
}foreach globalArr;
despite running
_guy1 addMPEventHandler ["MPHit",{0}];
I can still kill them with grenades/explosives. Doing something wrong?
Try using "Hit" instead of "MPHit". Unless you have a need for that.
Also note: Is not always triggered when unit is killed by a hit. Most of the time only the Killed event handler is triggered when a unit dies from a hit.
@broken mural
You shouldn't need to do that, using _x will work fine, there should be no collision @broken mural @still forum
Should be bound to that scope
is this operation allowed?
Yes, but it looks verboten.
Doing something wrong?
Yes. HandleDamage expects a number as return value to overwrite received damage, not (MP)Hit. Those MP event handlers are also really shitty, because they transfer their code over net each time they're triggered and cause therefore a lot of network traffic / low FPS in situations where a lot of them are triggered in a short amount of time with lot's of connected players.
each time they triggered?
MP* event handlers broadcast code on moment you create them
That would be smart Β―_(γ)_/Β―
thanks for the info π
I wanted to use RscListBox...so I ended up having to copy the def (and a ton of extra config defines) out of "\Arma 3 Tools\Binarize\bin" and put them in my description.ext
Is that how people normally do it?
I was following tutorials that just inherited from the class, but didn't say anything about where it was declared, and that's the solution I end up with
@hasty violet Known problems (occurs with Vanilla also)
@ionic orchid
Is that how people normally do it?
Yes and No.
I did copy the Baseclasses and added my Tag infront of it (e.g. RscListBox -> D41_RscListBox ), just to make sure, nothing gets touched by an A3-Patch (Yes, that happend in the past).
But basicly, you can just use
class RscListBox;
MyListBox: RscListBox
{
Magic
};
in the config/Files
I think I figured that RscXXX were required but they're really just examples of all the relevant params for that particular Type of control, I think
It gets confusing sometimes, the tutorials don't make various things clear
or
erm...
DschaIsTheBestBox
haha yeah
I can just outright make my own, they're just nice templates (that are hidden away for whatever reason)
Example:
class RscButtonMenu;
class 2017_RscInvisibleButton: RscButtonMenu
{
color[] = {0,0,0,0};
color2[] = {0,0,0,0};
colorActive[] = {0,0,0,0};
colorBackground[] = {0,0,0,0};
colorBackground2[] = {0,0,0,0};
colorBackgroundFocused[] = {0,0,0,0};
colorDisabled[] = {0,0,0,0};
colorFocused[] = {0,0,0,0};
colorText[] = {0,0,0,0};
};
That is inside the config.cpp of the Addon
See, I was doing exactly that, but RscText, etc were never actually filled because I wasn't referencing any .hpp/etc that declared them
So it would run fine, but the control would never actually be created in the dialog
Thats why you load it in the first place like in the example above
OR:
You copy and paste it to your own *.cpp
Which is why I copied all the stuff out of the Binarize/bin folder
Example:
http://pastebin.com/aeRZ0Ajn
Yeah, that would be fine
I just had 'class RscListBox;' at the top and presumed it was referencing some internal class in the engine, but it doesn't
Just search the orig A3 Files and Copy&Paste it inside your own RSCDefines.cpp (how i called my file)
erm, If you define it, you have to call it later oO
class 2017_RscInvisibleButton: RscButtonMenu
{```
like here
I had a look for various RscXXX keywords but all I could find was the stuff in Binarize. I reckon I haven't done something or other where I set up my evn
or whats the Problem?!
Yeah, I did that...
BUT there was no corresponding..... class RscButtonMenu { //DEFINITION };
I have it :p
What do you mean with that?
"no corresponding class" ??
Did you called it before or not?! If so, there shouldn't be a prob
If you do it as above, you don't need to do anything else oO
class IAE_My_RscButtonMenu_I_Placed_Somewhere_In_The_UI: RscButtonMenu
{
idc = 1234;
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
};
That should be enough oO
Look at your Step 1 + 2 and then Look above.
Yours
You don't tell the ListBox where it has to be
No Coords given
So Width
no height
Never leave anything out, if you want help
I'm just explaining my steps, sorry
Okay, is the LB beeing created now or not?
Or... let me rephrase this:
Is the Dialog beeing opened?
Anyhoo, the problem was that I was missing that extra definition in step 3, I assume that gets include automatically somewhere?
Everything is fine now that I'm doing Step 3
I'm just very confused that none of the tutorials I looked at ever mentioned this :/
Maybe because my Dialog defs are in description.ext and not config.cpp?
Doesn't matter.
//Interface stuff
#include "UI\DispDefines.hpp"
#include "UI\RscDefines.hpp"
class RscTitles
{```
that was in one of my description.ext
And the stuff inside it were the ordinary definitions etc
Is RscDefines.hpp your own file or provided by A3?
My own
Ahh okay, cool
#define Txt_Small "0.01 * safezoneH"
#define Txt_Norm "0.02 * safezoneH"
#define Txt_Big "0.03 * safezoneH"
#define Txt_VBig "0.04 * safezoneH"
Yeah, that's a good idea
I wasn't keen on just including all the given defs in Binarize, at least I can pick and choose the controls I'll be needing like you have
(with the additional tag prefix)
that Txt_Small etc stuff is inside the RscDefines.hpp , you might wanna use that one too.
Inside there is stuff like:
#define Txt_Small "0.01 * safezoneH"
#define Txt_Norm "0.02 * safezoneH"
#define Txt_Big "0.03 * safezoneH"
#define Txt_VBig "0.04 * safezoneH"
//Overview UI
#define Ctr_Inf_Display 411441
#define Ctrl_Inf_Indic_A 2000
#define Ctrl_Inf_Indic_B 2001
#define Ctrl_Inf_Indic_C 2002
#define Ctrl_Inf_Overlay 1000
//Display
#define Ctrl_Display 412000
//Klassenauswahl
#define Ctrl_Cls_BKG 2000
etc. blabla
So you basicly just have to type it, instead of writing it over and over again (and remembering the IDC-Numbers)
Anyway, enough Arma for today. hf with it. O7 I am out and watch some more pr0n/series/whatevercomesinfrontofmylenses π
o7
Anyone got an idea why my 'RscMapControl ' is stuck in front of the other classes in my dialog? It's set to the back but appears in front.
Is it in the config file above the Controls that you want ontop of it?
map control is always drawn on top of everything
Well you can sort of make it behind some controls but as soon as focus switches it will be on top again
You can disable it but it will not be interactible
Realy? Oh my
What about having the map as RscTitles and then a Dialog above it? Should work, aye? @meager granite
Likely yes, didn't test it
Could https://community.bistudio.com/wiki/inArea be a faster alternative to {_location distance _x}count allunits
I've got a mathematical problem
I want a value to increase by 0.1 for every 2 buildingpositions available
_value = _buildingPosAmount / 10 wont work
ohh, silly me. Overworked brain does not compute well
_Alpha = ((ceil(_buildingPosAmount/2))/10);
this addEventHandler ["killed", "_bomb = createVehicle ['DemoCharge_F', position (_this select 0), [], 0, 'CAN_COLLIDE']; _bomb setDamage 1;"]
any idea why the setDamage part gets ignored?
try using a tiny sleep. Maybe it's too young to take damage
did some more testing and found out the source of the problem
It doesn't place down a proper bomb
it seems the DemoCharge_F class itself is not a bomb
so I guess some more magic happens in the background when you place one down
Try createMine? Or just create an actual piece of ordnance.
@indigo snow createMine works, thanks for the help π
Or just create an actual piece of ordnance That wouldn't work with the rest of the script
here's the finished thing
this addEventHandler ["killed", "bomb = createMine ['DemoCharge_F', position (_this select 0), [], 0]; [bomb] spawn {sleep (5 + random 5); (_this select 0) setDamage 1;};"];
as you can see, I want there to be an actual bomb so that the players have time to spot it and react
this addEventHandler ["killed", "[createMine ['DemoCharge_F', position (_this select 0), [], 0]] spawn {sleep (5 + random 5); (_this select 0) setDamage 1;};"];``` and you wont need a bomb global var
Yup
bomb wasn't meant to be public, but I changed it for testing
it's _bomb now
but I guess I will still change it to avoid using a variable at all
DemoCharge_F does not explode after setDamae 1
Just use createVehicle with this CfgAmmo class:
DemoCharge_Remote_Ammo_Scripted
Also, you can use CODE blocks in addEventHandler and don't have to worry about escaping strings...
Is it still not possible for people to join servers with apex objects on map or did BI change that?
Buy APEX.
Make them buy it too.
Don't argue with me about that.
You didnt actually answer my question but I take it is a no?
It's an ironic "no".
Sorry for me being an asshole. It's just that we had this conversation today already.
I didnt ask, and I didn't know anyone else did
create them mid game π ?
But if they don't actually have it downloaded won't it show weird for them and without any types or textures and similar?
Because the p3d's are not actually on their pc?
They won't see them and can shoot through them.
Ye
And walk through them.
I mean, it allows the people with APEX to enjoy it, and makes non APEX people sad π
Then they buy it
easy
To quote myelf:
Something something DLC
True @dusk sage
I mean, decoration apex items would be nice
So what I'll end up doing is probably createSimpleOject
Just for decoration items
No offense, but this conversation is pointless.
and then fuck people without apex
createSimpleOject won't work either. If they don't own APEX, they don't have the assets on their machine.
But it can create it for the people with apex
I can do a DLC check
If they have it
Then createSimpleObject
createSimpleObject has global effects
Then I'll just use that on mission start
is there a getMarkerAlpha ?
No @peak plover
Ah ye
makes me kinda sad that it has a set, but the get isn't prefixed get
^
AGL?
Above ground level.
Basically ATL on terrain, and ASLW on sea
Ah kk
AGLS is like AGL, except that it uses the highest pathway LOD if present as 0
I see
Tons of script use setPos getPos in combination, even BI ones like turning upside the carts. They all break on objects pathway LODs. Β―_(γ)_/Β―
Getting you stuck inside rocks or the harbours.
Or buildings.
Thanks commy. AGLS is like visiblePosition?
?
- puts link back *
That is why I have a blue name and you don't.
AGLS is like visiblePosition
It's not like it
AGLS and all the other formats exist in the render and in the simulation thread
By default the commands read the position from the simulation thread
But for fast moving objects, it might be better to read the position from the render thread.
Which is updated more frequently.
That is why I have a blue name and you don't.
y u do dis
You don't want to display a nametag where the object is, but where the object is drawn.
this playAction "SitDown";
0 = this spawn {
while {(behaviour _this) == "SAFE"} do {sleep 1};
(group _this addWaypoint [markerPos "rp_fia_1", 0]) setWaypointType "SAD";
};
just felt like sharing that in case anybody needs something like that
You can press shift+enter to make newlines without sending your chat message.
who needs newlines xD
It would make the script more readable.
you don't even need to hold shift
once you write the ``` it automatically adds newlines instead of sending the message
Neat. I don't trust it however.
You could use waitUntil instead of while for slightly better performance, because it has only one code block to execute.
Also, I think you loop eternally if you instagib the unit before it can stand up.
I run this script during the init of a unit, and it crashes arma with an access error.
_waypointListtest = ["wpMarker","wpMarker_1","wpMarker_2"];
_wpSelected = floor (random 3);
_posSelected = _waypointListtest select _wpSelected;
_posSelected = getMarkerPos _posSelected;
_wp=_group addWaypoint [ _posSelected, 2];
_wp setWaypointScript {hint " Arrived at waypoint"}; ```
Executing in mission with [this] execFSM "generateWp.sqf";
Switched to execVM command, fixed it.
Yeah. execFSM is for .fsm files and not .sqf files.
makes sense, am dumb.
Ideally Arma would display and log an error instead of crashing.
what's the purpose of setWaypointScript does it execute a script when reaching a waypoint?>
Wiki is a stub
When I end my cutscene with
camDestroy _cam;```
it doesn't show my cutscene at all. But when I delete that code and just play my cutscene it will finish the scene and just stay static in the last position of the camera. Does anyone know how to switch back to the players view after a cut-scene properly this is KILLING me
Oh
Doesn't look like a stub?
But it looks stange. Might be better of using this:
https://community.bistudio.com/wiki/setWaypointStatements
@tough abyss show your full script please. if it's long use pastebin or similar
i'm thinking you are mistaking camcommit for suspending the whole script which it doesn't but hard to tell without seeing the whole thing
At the minute @polar folio as terminating isn't working I'm trying to switch it instead but still doesn't work ```private "_cam", "_pos", "_player";
_pos = (position player);
_pos set [2, 1500];
_player = player;
titlecut [" ","BLACK IN", 1];
_cam = "camera" camCreate _pos;
_cam camSetTarget (position player);
_cam camSetRelPos [0, 0.5, 1.5];
_cam cameraEffect ["internal", "back"];
showCinemaBorder false;
_cam camCommit 3;
_player switchCamera "Internal";```
That just gets to the player then stays in that static camera position
line 1 is broken
private ["_cam", "_pos", "_player"];
Is this script running in scheduled environment?
Oh fuck a duck and not sure what you mean by that pal
How is this script executed?
By calling the function when a player spawns
Show me
[] call life_fnc_camSeagull;
Change that call to spawn
....
_cam camCommit 3;
// wait for the camera to be done
waitUntil {camCommitted _cam};
_player switchCamera "Internal";
....
You basically have to suspend your script until the camera is done with it's task.
Yea I've used that before but I'll wack that in again & in regards to spawn, it callsa through a function.hpp file
which reffers to my function
its probs that broken top line mate ill give it a try now
Having two issues with a script I'm working on right now. Source: https://gist.github.com/anonymous/65aa189367eb59925207362de9d7fbff Basically, what happens is that police cars chase the unit named "hunted" and if close enough dismount, if too far away mount up again and drive closer. I tried to do it in a way to not spam the waypoint creation command but also in a way that a single while loop can control any amount of units I like. Two issues though: 1. Sometimes the AI will refuse to drive their car upon remounting the vehicle despite the car not having any damage at all. (AI is inside, when multiple units are used, you can hear them giving the move order but they don't move) 2. It appears that as soon as I use the spectator camera (Both in editor aswell as in mutliplayer with a spectator slot) most if not all cars stop moving. Anyone smart enough to figure out what the AI's issue is?
Really wierd.
I can only think of a bug i had once playing with ai. Sometimes you have to get the driver to get in last
Try quickly by _driver = driver cursortarget; _driver setpos [0,0,0]; _driver moveInDriver cursortarget;
if the ai starts driving after that then it's your issue
who posted that video of their modded explosions with added shockwaves?
and how were the shockwaves achieved? ppEffect?
Taro, I think
nice, found it
\A3\data_f\ParticleEffects\Universal\Refract
didn't realise it existed
AV camera?
Hey, I am using BIS_fnc_numberText and when I put in a number over a certain size it is not listing the proper number (1709488592 detects as "1 709 488 640"). Is there a possible fix for this?
Somewhat yes. Used for communication between players to open channels
Is there a way to select the first 3 digits of a string?
I've figured it out using ```SQF
string select [0,3];
Is there a way to tell what's in the radio slot / if there is something in it?
doesn't seem like it
I've just made an array of all my Radio ID's and done ```SQF
if (_x in assignedItems Player) then {....
Why does nearestObjects not pick up editor placed buildings?
it should, you're doing something wrong
eden placed buildings are simple objects aren't they? Maybe they lose base class info or something?
Is there a way to check out if the speed of a vehicle you're sitting in (not driver) is more than 1?
I know the speed part
Just have a tough time figuring out to check on the vehicle you are sitting in passenger seat of
vehicle player
Doesnt work on passenger seats
it should
nearestObjects [position player,["ALL"],100], only returns the player
@rotund cypress another option is https://community.bistudio.com/wiki/objectParent but vehicle really should work though
Vehicle player does work for non drivers... I've used it more than once
Ye my bad
Ohh, wow I used cursortarget. Seems the object results in <NULL-object>
But after around 30 seconds. It's giving it's true cursortarget value
Just fk my st up
Simple objects seem to never go past <NULL-object>
cursorobject
Shows the real object, but
Doesn't fix my problem
[cursorObject,1] call BIS_fnc_isBuildingEnterable
Still results to nothing
*false
Does it allow a config name as param too?
It doesn't well
Did u test if it works with non simple objects of the same type?
After you created the simple object or the normal one?
Normal one. Simple objects never go past NULL
The wait is wierd in the first place 'tho
I can try using a script to create the buildings later
Have a look how the function works
It's not really that I think.
Maybe there are some additional checks which prevent it from working with simple objects
Cursortarget should not say NULL until like 30 seconds in-game
Also using nearestObjects... why does that not work?
It works way better than cursor target in detecting
Depends
I think the classes to look for are case sensitive and not all objects have a class
So let it look for an empty array
It's also mentioned in the comments I think
Hey guys
// -- Get Params
params [
[ "_unit", objNull, [ objNull ] ],
[ "_targetSeatUnit", objNull, [ objNull ] ],
[ "_vehicle", objNull, [ objNull ] ]
];
// -- Prevent VDM when switching seats and vehicle is moving
if ( _vehicle isKindOf "Car" && { speed _vehicle > 1 } && { assignedDriver _vehicle isEqualTo _unit } ) then {
// -- Put unit back in driver seat
_unit moveInDriver _vehicle;
};
}];```
So I made that
Unfortuantely does not work and not moving the player back into triver
Not all objects in cfgvehicles inherit from the "all" class
Simzor I think you should place more brackets in your if condition (just my guess)
isEqualTo might check for equality of vehicle and unit before assigned driver is executed. Sometimes errors aren't logged in EH's
whats the best way to check if a vehicle has rounds (of any type) missing?
check magazinesAmmoFull and cycling through the configs of all magazines seems a bit overhead...
@rotund cypress
There is no need to define default values in params for event handlers. They will always report something, even if it's objNull (which should be impossible for SeatSwitchedMan")
Don't listen to Senfo. There are exactly enough superfluous parenthesis: none.
assignedDriver does not do what you think it does. If you have someone else as group leader (AI in SP, AI or remote player in MP), it will report what position you should be in according to him. It only works the way you want if you're the group leader.
I think the problems with your script are:
assignedDrivermight reportobjNull, because you are most likely the group leader and just got out (event handler fires too late)moveInDriverdoes not work for players. I'm not sure if this is still true, but I remember that it got broken ages ago - if it ever worked at all.
Alright, thanks for input @little eagle
I'm not sure if it's possible then
Or could there be another command?
Instead of assignedDriver, you can use the seatswitched event handler to cache the latest driver in a object namespace variable on the vehicle
Just attach the EVH to vehicle instead
Instead of moveInDriver, you can use:
https://community.bistudio.com/wiki/Arma_3_Actions#MoveToDriver
aaah
This emulates the action menu action, so it should work for players too.
Ah yeah this is probs what im looking for
Ye
I used actions like this in this command on other things, really handy but didnt think to check here π
Most of the really interesting and useful ones are b0rked
Yeah, it won't work if you've switched with another driver and he is now occupying the driver seat
Btw. Can't you just overwrite the move to gunner and move to commander etc. action menu entries with ingameUiSetEventHandler ?
Might not be appropriate if you're doing a mod, as these don't stack well with other content creators using the same method...
but brackets are nice :(
lazy eval has enough brackets
Some people are only happy if every second word / character is a bracket : /
Yeah I know, its just that some rules in sqf dont work as expected when it comes to executionorder
|| and && are fine. lowest priority and && goes before || like in every other language.
and since I dont want to learn every special case I just use some brackets and its clear
I am talking about stuff like this:
str count _array isEqualTo "0"
even if its complete nonsense
even diag_log "asdf" + "asdf2"; results in asdf being written to the rpt
I'd love to have a function syntax like c/java
then this wouldnt even be a problem
The first one is correct, the second one isn't. unary commands first, then binary commands. It's really not that difficult.
well then its just me being in love with brackets
Β―_(γ)_/Β―
Ohh the performance boost I would get
not
Back to serious questions. I want to make an AI inform other units nearby of a found target but they are not in the same group and the unit sharing doesn't have weapons. What would be the best way (performance wise) to do that? I wanted to avoid a nearEntities since it could happen very frequently. Yet I can't abuse the firednear event handler because they haven't got weapon.
What I could do is to give them a chemlight and let the throw it to trigger the firednear, but is there any way to make them throw it without animation?
{if (leader _x distance _informant < 300) then {_x reveal [_enemyspotted,_knowlege];}}count allGroups
Have it on a loop ~ every 5/10 seconds. Whichever you think is enough for them to grab radios and call friends
Is there a command to check if a vehicle is drivable?
_vehicle in vehicles
But that does not mean they are drivable / enterable by the ai
Telling a unit to get in a vehicle with no tyres results in a "No can do"
How do I figure out which vehicles do that in a script?
canMove vic
This command will return true for a car or a tank out of fuel, but false for an helicopter or a plane for the same condition.
funny
I thought you meant how to figure out if a CfgVehicles object is a car or tank and not a soldier or building.
canMove should do it
true
objectiveCrate addItemCargoGlobal ["ACE_bananaItem",10];
Anyone know why this isn't working?
Trying to add ace bananas to a crate. they don't want to spawn.
The class name is "ACE_Banana"
"ACE_bananaItem" is for when using createVehicle
"ACE_Banana" is for addItem(cargoGlobal)
@peak plover they are all basically one to 4 man groups and there are many of them. And maybe a groups units are separated a few kilometers so yeah, group leaders won't do the trick
I just need to have a fast way to get a certain variable spread to all the units within 60-100m
you want the unarmed man to 'radio' inform the other leaders that are within a 60-100m radius?
or do the detected units need to be in 60-100m radius
private _units = _origin nearObjects ["CAManBase", 60];
{
_x setVariable ["My_varName", _value];
} forEach _units;
???
First Senfo talks about informing other nearby units. Now it's about "spreading a certain varaible" to nearby units. 10/10 question description
Yeah. It's weird.
@vague hull poke
It's just that, the other units are informed of that target by having it set as a certain variable
What code is faster to be run multiple times?```//ON A SERVER ONLY WITH PLAYERS, NO AI OR NPCs
//CODE 1
_nearMans = _pos nearEntities ["CaManBase",100];
_nearPlayersCount = count _nearMans;
//CODE 2
_nearPlayersCount = 0;
{
if (_x distanceSqr _pos < 10000) then {
_nearPlayersCount = _nearPlayersCount + 1;
};
} forEach allPlayers;```
@little eagle Thanks Commie!
If I can use another way for it that's no problem, just needs to be fast
@tough abyss the range is the main factor
Try https://community.bistudio.com/wiki/nearTargets - maybe it's faster than something like nearEntities
@vague hull the range is allways 100.
I don't get it. What is the point?
The first one is faster, but use CAManBase and not Man to avoid the rabbits and snakes
class Animal: Man {
"No AI" is a weird requirement for a script to work though.
It's for exile I think
It's the discussion about whats faster for the function called nearby players
They had that going on for ages
So avoid loops at all costs
People think this is C++. To get fast SQF, you have to throw out everything you know about low level languages.
If there is a command that kinda does what you want, use it. It probably does actually do what you want in C++ and that is magnitudes faster than anything you can construct with SQF.
@tough abyss code 2 can be rewritten: SQF _nearPlayersCount = count (allPlayers select { _x distanceSqr _pos < 10000 })
supposably faster
some people are obsessed by milliseconds
It is. One less sqr() in C++
That's why I wanted to know if I could use the firednear eh
It probably is, QS
I think the Eh is triggered by the engine side and not some sqf loop, that's why I tried to do that instead of the nearEntities
Correct me if I am wrong
@vague hull too bad this was never implemented https://forums.bistudio.com/topic/103262-new-event-handler-enemy-detected/
The detection has already been done, it's now just about how to spread the information, because all other units should track that target if they haven't already got one
Imagine a hostage situation where the hostage was able to send away only his position and the code for attack here
The hostage ofc got no weapons
private _units = _origin nearObjects ["CAManBase", 60];
dunno what you mean by "spread information"
haha literally 0.01 ms difference
Basically this just maybe in a better way: sqf
private _units = _origin nearObjects ["CAManBase", 60];
{ _x setVariable ["traget",_target];} Foreach _units;
Thanks for all the help. I will try to create a test situation to compare the codes.
there is nothing wrong with that, besides capitalization and typos
Yeah sorry I am on my phone ^^
But you get what I am trying to do now I guess
The thing is that this will get fired very often for different units
And as you said, I want to avoid that loop at all costs
how often is very often? eachframe?
So that's why I came up with the firednear EH. Then just use the unit who fired and grab that variable from it
Could be ..
It depends on the amount of targets and how often they change and also how many nearby units there are and this is the problem.. there could be hundreds
Optimization isn't just about using the most efficient commands. It's also about using the most efficient techniques. I very much doubt that cycling through all units nearby on each frame is a good technique to do whatever it is you're doing
That's why I want to use the EH >.<
Or anything else that I might haven't came up with ^^
This was the question in the first place
It's easy to do with nearEntities, I know that
It's just about what could be faster/better
Well, the confusion began with what you called "informing". In ArmA terms that means you reveal an unit. You however are talking about sumn like: _x setVariable ["traget",_target]; - I don't know why you would want to do that but I assume you have some other script running in the background that deals with the actual doMove/reveal part.
I don't need to know who is near or if there is somebody near. I just need to make sure that everyone who is near gets to know (gets a variable set) about the target.
Thanks commie the leavevehicle seems to work wounders. Now my units will dismount and attack nearest enemy if the gunner is killed or the vehicle is immobile π
It's just like a trigger for all other units to get a new target (or just information about it)
E.g. Somebody screams -> everybody near now knows that there was somebody screaming at a certain position
Do you get what I'm trying to say ? (Sorry for those descriptions but I can't find a better way)
somebody emits screaming sound -> loop through all units within a given range and set a variable on each unit. Can be done using foreach loop. You'll have to cycle through an array of units within range. To get that array of units within range you can use nearEntities, nearObjects. Or you can use something like allUnits or allGroups and only select those whose distance to the 'somebody' is less than the defined range.
Those are your options
I get why you wanted to use firedNear now
but no cigar for you
Dark's daily problem for January the 24th:
I want a unit to be injured
I can't find that as an action, but I've found an animation that looks about right
Am I just missing an action that does this, or can I really only do this with an animation?
How do I check if an object is an enterable vehicle?
fuel < 1 ?
{fuel < 1}count vehicles; ?
I don't know about that, but depending on your situation, remember you might also want to check that the unit is NOT a drone https://community.bistudio.com/wiki/isAutonomous
@loud python setDamage or setHit or that other one that sets hitpoint damage
I found a solution for my previous problems (The animation names were just weird, it's playAction "AgonyStart" and playAction "AgonyEnd"
Oh
The damage part was easy, but thanks xD
What I do right now is spawn the unit, set it captive, disableAI "MOVE" and play the agonystart animation
then I have a scripted waypoint that reverses all of the above and the condition is damage this < 0.8 (it spawns with damage 0.9)
so when somebody heals the unit, the waypoint completes and it follows whatever waypoint goes next
which leads me to a new question
is there a way to tell a unit to re-equip from near inventories?
in other words, to take his weapon from the ground next to him or alternatively from a weapon box near him?
How does he lose his weapon
Is it placed on the ground with a script?
You could make a script that makes the ai move to the weaponholder and then once he is close enough, just add the weapon with script and removeWeapon from the weaponholder
That might be an option, thanks
Is there a way to get the trigger owner similar to synchronizedObjects?
[synchronizedObjects thisTrigger] call {
_activate=false;
{
if (damage _x > 0.8) then {
_activate = true;
};
} forEach param [0];
_activate;
}
Any idea why that doesn't work in the activation condition field of a trigger?
put nul = in the front
On activation or condition? condition expects a BOOL , on act expects none.
It's the condition
what have you synched out of interest? synchronization in MP only works with objects that have an AIBrain
A rifleman
it works now by the way
I had just made a lot of simple mistakes
like renaming a variable to _activate but returning the old variable name =/
synchronization also works with regular objects. I thought that's how the Vehicle Respawn module worked
_unit = param [0];
_unit disableAI "ALL";
_unit setCaptive true;
_unit playAction "AgonyStart";
_unit setDamage 0.9;
group _unit addWaypoint [
_unit, 0, // Placement and Radius
0, // Index
"Healed" // Name
] setWaypointStatements [
"(damage this) < 0.8",
"this setCaptive false; this playActionNow 'AgonyStop'; this enableAI 'ALL';"
];
SQF just doesn't like me today =/
The waypoint I create in that script doesn't activate
any idea why?
instead of _unit = param [0]; do...
params ["_unit"];
maybe not sure. Haven't been writing SQF Arma in awhile
ah ok. That's new to me I've never seen that. Interesting
also the parameter works
the first part of the script is executed
it's just the waypoint that is ignored
group _unit addWaypoint [
_unit, 0, // Placement and Radius
0, // Index
"Healed" // Name
] setWaypointStatements [ // < THIS LOOKS WEIRD
"(damage this) < 0.8",
"this setCaptive false; this playActionNow 'AgonyStop'; this enableAI 'ALL';"
];
maybe need to wrap your setWaypointStatements like so...
group _unit addWaypoint [
_unit, 0, // Placement and Radius
0, // Index
"Healed" // Name
] (setWaypointStatements [
"(damage this) < 0.8",
"this setCaptive false; this playActionNow 'AgonyStop'; this enableAI 'ALL';"
]);
interesting
I was just about to try
(group _unit addWaypoint [
_unit, 0, // Placement and Radius
]) setWaypointStatements [
"(damage this) < 0.8",
"this setCaptive false; this playActionNow 'AgonyStop'; this enableAI 'ALL';"
];
the easiest solution is ...
_newWP = group _unit addWaypoint [
_unit, 0, // Placement and Radius
0, // Index
"Healed" // Name
];
_newWP setWaypointStatements [
"(damage this) < 0.8",
"this setCaptive false; this playActionNow 'AgonyStop'; this enableAI 'ALL';"
];
yours will work actually. I wrapped the wrong one
trying
_wp setWaypointStatements [
"(damage this) < 0.8",
"hint 'Healed'"
//"this setCaptive false; this playActionNow 'AgonyStop'; this enableAI 'ALL';"
];
to see if that's the problem
there are only 2
^ that xD
yeah that's why I deleted it lol
I'm half asleep reading this at work. Give me a break
did you try (group _unit)? cant remember presedence of unary vs binary commands atm
π
The night before I was up till 4am playing HOI IV with friends and again I was doing the same thing last night till midnight. My last two days have been brutal
[[B Echo 1-3,0],[B Echo 1-3,1]]
the unit has 2 waypoints???
why?
waypointStatements (waypoints (group bob) select 0) returns ["(damage this) < 0.8","hint 'Healed'"] (debug console)
and yes, the unit is called bob (for now)
damage bob == 0.25
looks like 2 waypoints, yes
no idea wherre the second one comes from =/
oh, that's probably the one that is created when the unit spawns
FFS BOB! You are perfectly healthy! Stop playing sick and go to work!
#fml
What are you trying to acheve?
Do simpleobjects work well with AI/
I've built an array
I'm not afraid to use it
I have no problem with loops, a loop that is allways heavy is a problem but a loop that most of the time is just some light ifs, and other times execute some real code, is not a problem. also you can wait without using sleep.
FSM is a loop right? Changing from a waitUntil {.... false}; with fake sleep to a FSM that forcedly check the conditions many many times a seconds can easlily be no gain.
Fake sleep: _initA = time; _initB = time; _initC = time; waitUntil { _time = time; if (_time - _initA > 1) then { _initA = _time; //CODE 1 }; if (_time - _initB > 0.5) then { _initB = _time; //CODE 2 }; if (_time - _initC > 10) then { _initC = _time; //CODE 3 }; false };
I must credit the tip on using waituntil instead of while to maca134.
waituntil also adjust its frequency based on fps.
An fsm for what it is designed is very good
- it checks its conditions "only" each frame
waitUntil does so too, but I wouldnt wanna design State Machines in pure SQF
the thing about "fake sleeps" is that they are active waiting
and active waiting is bad (most of the times)
Thats why you use FSMs for stuff like KI (because you need an unknown time for events to happen but if there is any special event while you are waiting you may need to escape really quickly)
http://i.imgur.com/FvPP84s.jpg arma been running all day long with no crashes. The logs are getting big 'tho.
so always chose best for your needs
btw some more stats:
the source is written in c++ and is "exactly the same" but has some overhead due to functionselection
just to give an example tho, I'd hate myself for calculating the sum this way anywhere else
wat
Any good stress tests to run arma that might crash it?
Put a ton of vehicles on top of each other, so they all explode at once.
You get a nice meteor rain too.
A koth server might be worth the try. Might get kicked for afk 'tho
@little eagle spawning vehicles does not work http://streamable.com/e2yfo
spawn more
It's beautiful. Spawn more.
Honestly @peak plover put a ton of BLUFOR and OPFOR groups down (infantry/vehicle/helicopters) and have them fight over a sector or something
before: http://i.imgur.com/nemGfCn.jpg
after: http://i.imgur.com/HN9pmW5.jpg
That was what you wanted to achieve, right?
I'm currently a bit stuck. I'm trying to work on a game mode whereby, Blufor can spawn once, but when they die, they have to join Opfor. Opfor can spawn as much as they like.
Anyone got any ideas how to force Blufor to switch sides on death?
Is remoteExec scheduled or unscheduled?
It's neither and both.
Lets say it this way:
remoteExecCall is instant
remoteExec can be "delayed"
{systemChat str canSuspend} remoteExec ["call"];
-> false
{systemChat str canSuspend} remoteExec ["BIS_fnc_call"];
-> true
Don't ask why.
My head went: "Because call is a call and bis_fnc... hmm.. arma"
remoteExecCall is supposed to execute the functions and commands unscheduled and it works.
remoteExec is supposed to execute functions scheduled, which is fine, but commands are still unscheduled, which I guess makes no difference, unless you try it with call.
RemoteExec can have waitUntil/Sleep etc in it
while RECall can not
Well, unless you use it with "call".
afaik remoteExec is like spawn.
While remoteExecCall is like.. erm.. yeah, call.
Yeah, makes sense π
Yeah, a bit
I've just been using remoteExecCall this whole time and it takes a long af time to restart my server to check remoteExec xD
makes sense
{systemChat str canSuspend} remoteExec ["call"];
-> false
{systemChat str canSuspend} remoteExec ["BIS_fnc_call"];
-> true
Not really Β―_(γ)_/Β―
So? call can run scheduled too.
can't find it anymore, too long ago
@little eagle indeed, nearEntities is incredibily more faster than checking distances with the allPlayers array.
But may be the number of "interations", the size of the code that make it slower.
having an issue with my script atm.
(_x select 0) createVehicle (_x select 1); seems to spawn my object but it has collision
when i do createVehicle[(_x select 0), (_x select 1), [], 0, "CAN_COLLIDE"]; it spawns my object but it ends up in the air like 700m
an example of _x select 1 is [4422.25,10764,339]
Laser coming out of laser pointer is just a model of long line, you can try to spawn it with createSimpleObject
@tough abyss First createVehicle version searches for safe position disregarding provided elevation, second createVehicle spawns it where you provided the position, 339 means 339 meters above ground
alright figured it out thanks my man
Just tested laser beam object, it is too short in its original form
is there a script that disables dmg from driving against players? so they pop in ragedoll fly but get 0 dmg of it ? not sure if it is even possible ...^^
Its possible, through HandleDamage
0 = this addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_ammo", "_hit_index"];
if(!isNull _source && vehicle _source != _source && driver vehicle _source == _source) then {
_old_damage = (if(_hit_index < 0) then {damage _unit} else {_unit getHitIndex _hit_index});
_damage = _old_damage;
};
_damage;
}];
had snippet at hand
Should work, double check it doesn't block other types of damages (check vehicle fire, firing from vehicle seat)
thanks alot mate
@little eagle indeed, nearEntities is incredibily more faster than checking distances with the allPlayers array.
Of course it is. I don't know why people still doubt me all the time. Must be that the truth is difficult to accept. You're better off telling everyone what they want to hear instead.
π€£
It works for politicians. Β―_(γ)_/Β―
"Tell it like it is" is the epitome of "telling everyone what they want to hear" though.
Of course not, you speak the truth
Telling people what they want to hear, isn't the always the truth
π
So nearEntities "ALL" is faster than {_x distance _group}count allPlayers ?
{_x distance player < 800}count allUnits = 0.17854 ms
{player in(_x nearEntities 800)}count allUnits = 0.506586 ms
Don't see how ?
count (player nearEntities ["CAManBase", 800]);
{player in(_x nearEntities 800)}count allUnits = 0.506586 ms
{_x in (player nearEntities ["CAManBase", 800]);}count allunits = 0.39032 ms
{_x distance player < 800}count allUnits = 0.17854 ms
_near = (player nearEntities ["CAManBase", 800]);{_x in _near}count allunits = 0.0976 ms
count (player nearEntities ["CAManBase", 800]); = 0.0064 ms
I see it now... I see the light
Beware the light at the end of the tunnel might just be a flamethrower.
Hey, if the line is short, it must be quick, right?
@commy2 Lol didn't know that. Guess my Conquest gamemode will get a lil optimization then :D
FFS why did i type "lol optimization" that doesnt even sense.exe EDIT: I Know now. Bad mobile phone touch screen "keyboard"
@little eagle xD sure. That's why variables shouldn't be longer than 1 letter. Also most minifiers work pretty well with sqf π everything to make life a bit harder.
Irony is lost on you guys.
I used to call things like v1v2v3v4v5 etc. for a while
Yep, it's great to annoy people who have to work with your code π
@peak plover I see that a way too often, unreadable 1 liner code. Especially in A2
It's fine for smaller scripts. But sometimes it starts small and ends big. Then all the variables have to be renamed ;S
doWatch will make the unit turn its head or its entire body to the watching direction?
@tough abyss thanks a lot.
the rules on space usage are interesting
More of a speed thing
More of a we are lazy thing.
(beware: hyperbole)
Striping a string of all white space should be easy enough. Replacing the ' with "" should be too if that's even necessary. Great command, I already have good uses for it.
I think the command has been in dev for a couple of months.
parseSimpleArray
The timing for BI to do stuff is almost unfortunate for me... My extension returns multiple Bools. And i made a workaround using splitString to get each char and my extension returns the stuff as binary..
Compiling stuff get from MySQL should be faster if i understand the command correctly.
Sorry for being a noob, but how do you interact with a MySQL database from Arma?
You need an extension such as ExtDB
@tough abyss Really shouldnt be much work to change your extension to return an array etc. But if you are returning numbers or comparing string for true/false. Then your method is prob faster
@tough abyss didn't you once have a wiki about extdb2? ^^
@tough abyss yes. This command should be alot better than using call compile for extDB etc.
Yeah but i stopped supporting it over a year ago.
extDB3 is very similar and it supports MySQL alot better.
I hope Arma series does not change engine to Efusiom π
Ahh okay. Only remebered something about it and was wondering why my link stopped working ^^ I also made my own DLLs for WebAPI & direct SQL-Requests so I have really no Idea what changed about Arma2Ext / extDB, etc.
@civic maple i use extDB3: https://forums.bistudio.com/topic/169723-extdb-arma3-extension-linuxwindows/
Ok, thank you
class Animal: Man
class Snake_base_F: Animal
And rabbits, cows, sheep and I think fish and turtles, birds and seagulls
CAManBase always
lol... changing all my "Man" to "CaManBase" π€
Oh and of course also dogs
Can't forget about dogs.
Why do we only have dogs in Arma and no cats?
Tip: i use the same unit classname for all players, and since its a survive game mode, the initial unit clothes and gear does not matter since it get deleted. With that i can easily find players with _pos nearEntities [playerUnitClassName,500] without the need to filter AI and NPCs out after that.
I also comment the code PLY_playerClassName = "O_I_SOLDIER_F"; //DONT USE THIS CLASS IN AI OR NPCs
_medicAtScene = !(((_unit nearEntities ['CAManBase', 1.9]) select {_x getUnitTrait 'medic'}) isEqualTo []);
^ this is just more readable
How do you post in [code]
```sqf
code
```
And the highlights?
the SQF part does the highlighting
Ahhh...
can use other languages if you want too
I got it
how do you linebreak in the discord text input box, ctrl+return doesn't do it
asdf
rad thanks
my brain is tuned for shift+return and plain return to send
i don't think it is
It's the best question I've heard today tbqh.
Either have maybe a slight fps drop on every client. Or put a bigger load on the Server which is most likely idling most of the time anyway.
Thinking about the amount of stuff that needs to be sended over the net/Syncronized -> I repeat myself and say: "I don't think so". Prove me wrong π
You also save a little network load for the clients sending over if they are near or not. The Server has the positions anyway
So does the client
I mean, about how much load do we talk? How many ms? 0.003-4? maybe
imho not worth the effort/network
Scrolling up count (player nearEntities ["CAManBase", 800]); = 0.0064 ms
negligible on client.. But if the Server has to do that for 20 or more players
Any arma experts could explain me why changing the font use on DisplayMPInterrupt makes the game go to a loading screen and be stukc in it? π
How did you change it?
perfect square would be if w and h are the same...
w = 0.22 * safezoneH;
h = 0.22 * safezoneH;
All monitors should be wider than they are high, so safezoneH it is
Whats your Interface size? "Mole"?
You will get problems with 16:10 and 5:4 monitors with your approach, QS
in this example https://puu.sh/tA2oB/519930f79f.png what is preventing containerbox from recieving the pistol magazine? it is set in the same way that questofficer is, through the init field in the eden editor, and no script errors are generated. the addaction is present on the office in question and the entity containerbox is an emptied nato ammo box that the player can successfully interact with
does sqf have any builtin command analogous to Lerp for vectors and scalars?
@vast gorge too many code brackets in the addAction
drawIcon3D is probably worse. Something is seriously wrong with that command. It's like they load the file from hdd every render frame or something.
^2 ???
@indigo snow thank you, that was it
Does anyone know if there's a way to disable collision between (you + the vehicle you're in) and an object?
disableCollisionWith doesn't work
local server
Mind the locality. The arguments have to be LOCAL to the client on which they are executed on
It works when I'm doing (object disableCollisionWith player), and I get out of the vehicle
but doing (object disableCollisionWith (vehicle player)) in the vehicle doesn't work
0x800 in style entry, QS?
You're probably better off using the https://community.bistudio.com/wiki/Pixel_Grid_System tbqh
try with + 0x800. They call it keep aspect ratio.
You'd think if width and height are the same, then you have a square.
Or are you in a controls group?
w and h are relative to the 4:3 square that w=1,h=1 is
so to get the same h (visually) as w you can do (h = w * 4.0 / 3.0)
(or was it 3.0 / 4.0)
Oh right
whichever, I messed with this last night trying to get square pictures
Something has to be multiplied with 4/3
w = 0.22 * safezoneH * (4/3);
h = 0.22 * safezoneH;
or
w = 0.22 * safezoneH;
h = 0.22 * safezoneH * (4/3);
too lazy to think
starts digging in the nose
yeah that'll do it (top one I think)
class D41D_Area_Indic_A: D41D_RscPictureKeepAspect
{
idc = Ctrl_Inf_Indic_A;
x = "0.799 * safezoneW + safezoneX";
y = "0.863 * safezoneH + safezoneY";
w = "0.06 * safezoneW";
h = "0.11 * safezoneH";
};```
w = "0.06 * safezoneW";
h = "0.11 * safezoneH";
= square
It is
I believe all you need is that hex number commy posted
iirc i tried that in different solutions
Can't you just get the aspect ratio by doing (safezoneW / safezoneH)?
or am I completely wrong?
Never seen it
1 entry
class ctrlDefaultText: ctrlDefault
{
sizeEx="4.32 * (1 / (getResolution select 3)) * pixelGrid * 0.25";
font="RobotoCondensedLight";
shadow=1;
};```
->
` class ctrlDefaultButton: ctrlDefaultText `
` class ctrlStatic: ctrlDefaultText `
Anyone got an idea why the black text in my RscEDit is coming out REALLY bold?
How does one get rid of the black outline around text in an RscEdit? I tried colorBorder but that didn't work
using OnFrame to force a client-side setDate would work great, if it didn't freeze slightly every second to battle with the server time sync
I'm talking about the border / outline around text