Waldemar 337
Member-
Content Count
92 -
Joined
-
Last visited
-
Medals
Everything posted by Waldemar 337
-
ListBox overflow issue
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
... -
ListBox overflow issue
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have re-checked. This bug does not depend on the listbox size. It just happens when I select one of the assault backpack classes in the list box. After this selection I make some checks with isClass, getText and getNumber and I see the backpack created on the ground, though I did not run any createVehicle functions. Looks like a game's bug, not mine. -
ListBox overflow issue
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am moving an array of all classes in CfgVehicles into a listbox. Some of the classes like "B_AssaultPack_rgr_Medic" and other assault backpacks produce strange bugs when I use some methods on them. For example, when I use isClass, getText and getNumber with these classes, I not only receive the output values (boolean, string and number), but also see these backpacks created on the ground around the player. This looks strange. I am trying to make a minimal working example of this behaviour, but it takes a lot of time, because I have dozens of script files ... -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sounds interesting. Thank you. I have a couple of questions. 1. How much memory will it take to store a big array of arrays ? 2. Does Arma engine offer a hash map or some similar type for storing big data ? Searching the 1M-item-sized array using a simple forEach would take a lot of time. -
Which is the most efficient way to move the position by a vector ? I don't think that the + operator in SQF is capable of doing it. The vectorAdd function ( https://community.bistudio.com/wiki/vectorAdd ) sums two vector operands. I need to apply a vector to a 3D point which is a position. E.g. (position player) += delta_vector; _obj setPos ((position _obj) vectorAdd delta); Will this work ? Thank you.
-
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
But I provided an answer to your question before. It was in a previous message on the first page. It reminds me a situation. A person on a street asks you what the time it is. And instead of telling the time, you are starting to find reasons why you should not bother telling the time. LOL 😂 Let us be kind to other people. Please. Humanity is the key to all questions on this planet. Especially at this moment of time ... -
Moving a position by vector
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I wanted to create an object infront of the player. At the moment I found a simple solution, but I do not know whether it is efficient or not. _vehPos = (position _caller) vectorAdd ((vectorDir _caller) vectorMultiply (k)); Why is it confusing ? What is the better way ? -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes, I wrote the same. Such functions should be provided by the game developers. But we do not have access to the game engine. If you know how to get the theoretical vehicle's mass by its class name, please let the community know it. I did what I could instead of complaining. I provided my piece of shitty code. I would do it better if I could change the game engine, but I have no access to it, and will never have it. You are very curious. I am writing a simple add-on for the game which will be some kind of a vehicle viewer. I will publish it on Steam very soon. -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Short version of the answer is following. In this "hack" script the vehicle is created in the sky above the player to minimize the possible collision with environment. What does that mean ? If several players start using this function, they will be creating a lot of mess and the possibility of collision will increase. If the vehicle was created in the same place, it would limit the usage of the script to one function at the same time. So, here I tried to minimize the possibility of collision using two methods. First one -- player creates a temporary "hack" vehicle above him, X and Y coordinates of the created vehicle are the same as the player's X & Y. This minimizes possibility of collision between different players. Note that objects larger than a player increase the possibility of collision greatly because objects having the same altitude may collide. Second one -- a random number is used in the Z coordinate (height) to minimize possibility of collision for the same player if he calls this function several times simultaneously. As we know Arma's engine uses some kind of scheduler which is non-managed, i.e. player can not control the scheduler and execution of the code. So, this is just a safety measure for parallel code execution. Of course, if the vehicle is very big, much bigger than a player, and a neighbour player creates his flying vehicle at the same time, there will be a great possibility of collision. So, this workaround will not work every time. And again, this does not work all the time, as the random number generator may generate two equal numbers and all this "hack" will not work. The good solution would be to create a special controller which would allow only one created vehicle instance at the time, but it is too complicated for this situation. Such functions as 'getMass' for vehicle classes should be provided by game developers, because they have access to the game engine. The source code of the game is not accessible by the community, so we do not have to do their job. -
The 'isClass' function is not working properly when it is called from the script which was called by the GUI eventhandler. It returns false when it should return true. Example. isClass (configFile >> "CfgVehicles" >> "SDV_01_base_F") This code returns false when called from GUI event handler and returns true when called from debug console. Why is it so ?! How can I use this function in GUI event handler ?
-
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I understand that this game is difficult to develop and this game is unique. I very much appreciate the job of the developers. But there is a moment. The "Operation Flashpoint: Cold War Crisis" was released in EU on June 22, 2001. Now it is April, 2022. In the year 2022 I see the same bugs that were peresent in the good old Op. Flashpoint. I like this game because of its freedom to create, its editor and its community. I wish B.I.S. good luck in creating a new engine and releasing the fourth Arma. I wish to see working towing with low gear mode for vehicles. -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It works! 😀 // MCA_fn_getVehicleMass.sqf. // This function tries to get the mass of a vehicle. // This is a hack, it may not work every time. params ["_caller", "_vehClassName"]; if (!(isClass (configFile >> "CfgVehicles" >> _vehClassName))) exitWith { 0.0 }; private ["_callerPos", "_vehPos", "_veh", "_mass"]; _callerPos = position _caller; _vehPos = [_callerPos select 0, _callerPos select 1, (_callerPos select 2) + 5000 + (random 2000)]; _veh = createVehicle [_vehClassName, _vehPos, [], 0, "FLY"]; _mass = getMass _veh; deleteVehicle _veh; _mass -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
LOL. If I hated it, I wouldn't play Op. Flashpoint, Armed Assault, Arma 2 and Arma 3. Arma 3 is the top of my games in Steam. Looks like I have to invent the wheel again. This is Arma 😂 -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
LOL. I can say the same to game developers who introduced vehicle towing functions (setTowParent and disableBrakes) in the game version 2.08, which came out March 8, 2022. Knowing that Steam says that Arma 3 was released on 12 Sep, 2013, we can calculate that the ability to use towing appeared more than 8 years after the game was released. Greetings to the Bohemia Interactive Studios. -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I want to be able to view vehicle mass for the same purposes as for 'getMass' function. These purposes may be different: loading vehicles into aircrafts; sling loading vehicles; calculating the probability to tow; calculating the probability to be towed; something else. -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
To find the mass without any mass ? What do you mean ? -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
For now I see one way, but it is an ugly hack. I can create a vehicle somewhere in the sky, far from the player, try to use 'getMass' on it, and then to delete the vehicle. But this hack may make some mess if several players will do it at the same time ... I should create a mess controller to avoid several vehicles in the sky ... Oh... This is weird 🙂 -
How to find a vehicle's mass / weight
Waldemar 337 replied to scifer's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am trying to get the theoretical mass of a vehicle class by looking into its config via the built-in config viewer, and I still can not find anything that could remind mass, weight or something like that. The game engine is known to support PhysX which works with mass parameter, but vehicle classes do not store it. Why ? -
How can I change a single-line RscEdit to a multi-line RscEdit ? I have an RscEdit. class ParentClasses: RscEdit { idc = 913; moving = "true"; text = "..."; x = 20 * GUI_GRID_W + GUI_GRID_X; y = 8 * GUI_GRID_H + GUI_GRID_Y; w = 19 * GUI_GRID_W; h = 2.5 * GUI_GRID_H; colorBackground[] = {0,0,0,0.5}; //canModify = 0; }; When I enter some text into it and press Enter, nothing happens. If I press Shift+Enter also nothing happens. So, how to enable multiple lines ? The RscEdit was taken from the built-in GUI editor, so it is fully vanilla. class RscEdit { deletable = 0; fade = 0; access = 0; type = 2; x = 0; y = 0; h = 0.04; w = 0.2; colorBackground[] = { 0, 0, 0, 0 }; colorText[] = { 0.95, 0.95, 0.95, 1 }; colorDisabled[] = { 1, 1, 1, 0.25 }; colorSelection[] = { "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])", 1 }; autocomplete = ""; text = ""; size = 0.2; style = "0x00 + 0x40"; font = "RobotoCondensed"; shadow = 2; sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; canModify = 1; tooltipColorText[] = { 1, 1, 1, 1 }; tooltipColorBox[] = { 1, 1, 1, 1 }; tooltipColorShade[] = { 0, 0, 0, 0.65 }; }; Thank you.
-
Multiline RscEdit
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have tried increasing the height, but it did not enable multiple lines. class ParentClasses: RscEdit { idc = 913; moving = "true"; text = "..."; x = 20 * GUI_GRID_W + GUI_GRID_X; y = 7 * GUI_GRID_H + GUI_GRID_Y; w = 19 * GUI_GRID_W; h = 3.5 * GUI_GRID_H; canModify = 1; }; -
isClass function is not working
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
By the way, there is an error on the wiki page about this str function. https://community.bistudio.com/wiki/str The same code is wrong and correct at the same time. // Before the fix: hint str "string "" string"; // "string " string" <- invalid string call compile str "string "" string"; // ERROR // After the fix: hint str "string "" string"; // "string "" string" <- valid string call compile str "string "" string"; // OK So, even the documentation has bugs ... That is what arma players mean when they say "This is Arma", LOL. -
isClass function is not working
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yes. I have spent several hours finding the bug because of this str function. I thought that it was safe to use str on variables which are already strings. Now I know that it is a completely different function. Thank you for the detailed explaination. Arma scripting has a lot of surprises. -
isClass function is not working
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I didn't know that. Thanks. In all the programming languages that I know (C, C++, C#, Java, Python, and many others) conversion of a string to a string does not add any quotation symbols. So, this is weird. -
isClass function is not working
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Looks like str function is breaking the existing string variables. str of a string adds quotation marks to the string. This is ducking ridiculous. "This is arma". -
isClass function is not working
Waldemar 337 replied to Waldemar 337's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Seems that I have found the cause. It is not the event handler itself. The listbox returns its string value with quote signs at the edges of the string. This is ducking ridiculous. Will make additional checks.