Jump to content

NumbNutsJunior

Member
  • Content Count

    65
  • Joined

  • Last visited

  • Medals

Everything posted by NumbNutsJunior

  1. NumbNutsJunior

    [RELEASE] Notification System

    Updated 7/18/2019: Added timer conditions Added cleanup for controls Fixed issue related to RemoteExec/RemoteExecCall Use fn_handleMessage with these commands
  2. I am not sure what kinda testing environment you have setup, and from the information given to use it looks like it should work perfectly fine. So rather wasting time playing 20 questions I went ahead and created an example mission for you, recreating exactly what you are trying to do with what you have showed us from your script. My assumption is that your diag_logs are going to a server rpt file and you are just looking in the wrong place because the event handler is assigned to a globally created vehicle and not a player but they would show up in your own rpt files if you ran the mission as the host. Hopefully this helps! https://drive.google.com/open?id=1h4yG0cNClq3MR8-phCTtcA6HHzc_mYnG
  3. The example @Maff gave worked fine for me, the event handler 'fuel' only gets activated when "Triggered when the vehicle's fuel status changes between non-empty and empty or between empty and non-empty." I got your "systemchat 'setfuel 1';" twice, once for when the car ran out of gas and again after the code "(_this select 0) setFuel 1;" ran. Depending on the testing environment you might not get the system chat because the event handler is assigned to the vehicle, not to the player and systemChat has a local effect while setFuel has a global effect. So probably don't base your testing on that alone.
  4. Nothing about this seems to make any sense, I think this is more than just a bracket ... Look at your parameters: this (good) "INIT=" (good) [_proxyThis,]addeventhandler ["Fuel",{(_this select 0) setfuel 1; systemchat "setfuel 1";}]; (bad) addeventhandler takes an object as its first parameter, not an array. "[_proxyThis,]", _proxyThis is undefined (you say its treated as "this" but you still use "this" rather than _proxyThis as the first parameter). "[_proxyThis,]" you have a comma after the first element with no second element of the array Why are you trying to assign an event handler to something as a parameter, unless you are trying to pass the handler id. "addeventhandler ["Fuel",{(_this select 0) setfuel 1; systemchat "setfuel 1";}];" you have a semi colon at the end of the element, that is like saying _array = [1,2,3;]; You should probably do something like what @Maff suggested. Then do some more reading up on the wiki on how to script cause you will get generic error messages for a lot of different problems and will waste your time looking for some missing bracket or semi colon that does not exist.
  5. NumbNutsJunior

    Change Text of an edit box

    Your problem is that in your conditions you are trying to compare text to a number ... // Returns text _am1 = ctrlText _ctrl1; _am2 = ctrlText _ctrl2; _am3 = ctrlText _ctrl3; // Error - checking if text is less than a number if (_am1 < 200) then {_ctrl1 ctrlSetText "200"; player setVariable ["overall_distance",200]}; The very simple fix for this is to parseNumber for those three variables // Returns text _am1 = parseNumber(ctrlText _ctrl1); _am2 = parseNumber(ctrlText _ctrl2); _am3 = parseNumber(ctrlText _ctrl3); // No-error - Checking if a number is less than a number if (_am1 < 200) then {_ctrl1 ctrlSetText "200"; player setVariable ["overall_distance",200]};
  6. NumbNutsJunior

    Drawing on GPS panel

    Update: The control does draw icons as intended. // Wait for display waitUntil {!isNull (uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull])}; private _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull]; // Controls private _miniMapControlGroup = _display displayCtrl 13301; private _miniMap = _miniMapControlGroup controlsGroupCtrl 101; // Event handler _miniMap ctrlAddEventHandler ["Draw", { // Wiki example (_this select 0) drawIcon [ "iconStaticMG", [1,0,0,1], getPos player, 24, 24, getDir player, "Player Vehicle", 1, 0.03, "TahomaB", "right" ] }];
  7. NumbNutsJunior

    Drawing on GPS panel

    Hello HazJ, The mini-map control is held within a controls group and so you need to access it via the command controlsGroupCtrl. I did not go as far as to actually draw icons but I am assuming from the hint of params that the rest should work as you said it already does, hopefully this info helps. For future work on these IGUI displays you can loop through them and use the command ctrlType in order to figure out what controls are what so that you are not just staring at the control ids. // Wait for display waitUntil {!isNull (uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull])}; private _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull]; // Controls private _miniMapControlGroup = _display displayCtrl 13301; private _miniMap = _miniMapControlGroup controlsGroupCtrl 101; // Event handler _miniMap ctrlAddEventHandler ["Draw", {hintSilent (format [":: %1", _this])}];
  8. NumbNutsJunior

    help with returning a value from script

    The command apply takes an array and applies the given code to the element, so when you exitWith true or just exit with false the resulting array will just be [false, true, false, ect] (runs for each member of the crew). The reason it is returning this array is because it is the last line of code in your function, also it does not automatically override the given array unless you assign it again such as _crew = _crew apply {true}.
  9. I am trying to create a type of leaderboard on a dialog menu, where it will display stats such as their overall ranking in the list, name, kills, deaths, ect. The best example of the result i am trying to recreate would be the server browser: I have tried to use the Table Dialog Control but have failed, looking for some help with trying to get this type of dialog to work as it seems to be the best option available. The example they provide seems to only have the base defines from what I saw and when I try to create a row or header row with the commands, I get no result and no error: Add Row - https://community.bistudio.com/wiki/ctAddRow Add Header Row - https://community.bistudio.com/wiki/ctAddHeader With from my "extensive research", literally no online existing help, I've come here ... If you know how to actually use this type of dialog control, please help. Thank You!
  10. NumbNutsJunior

    Creating Table Dialog

    Unfortunately RscListNBox only got me so far in finding something that replicates the server browser. From the looks of it they lined up buttons to match the columns in the list but I am still unsure how the server browser is made because I cannot find any "column" functionality with RscListBox as they use it for the server browser so my guess is that its using the table dialog type but all the defines in config.bin point to using RscListBox. I am aware that RscListNBox can create columns, but with the server browser they are able to add tool tips to certain column items and can click on column cell items such as the favorites icon without selecting the entire row which both RscListBox and RscListNBox cannot do.
  11. There is a setting in the editor that you can check, or that you can add to description.ext: disabledAI = 1; // 0: disabled - 1: enabled. Default: 0 1 (checked) will do what you want, 0 (not checked) will allow AI to be in place of playable units. This does not disable AI units entirely, only units set to player or playable.
  12. I am trying to find the display/controls for the RscTitle that appears when using night vision, I have searched through many displays while nvg was active and not active and have yet to find it. I am just trying to access the control which holds this texture: ""\A3\Weapons_f\Data\nightvisiontl.paa"". All the active textures I could find: If anyone knows the display/control which is used with night vision or if it is even possible that would be really great. I also searched through all of "functions_f.pbo" for anything related to night vision ...
  13. NumbNutsJunior

    Night Vision Display? [SOLVED]

    You saying its possible to change without having a modded mission/server? Iv'e never tried creating "modded" content for arma, so if its related I would not know.
  14. NumbNutsJunior

    Night Vision Display? [SOLVED]

    Thats kinda a shame. Assuming that means there would be no way to alter the vision of NVG in vanilla arma 3? I wanted to alter the "modelOptic" while still animating the night vision to flip and keeping the ppeffect. Edit: Feel kinda dumb not realizing that when the texture is in weapons_f with all the other textures labeled optic lol
  15. NumbNutsJunior

    Dialog math?

    Can anyone explain how arma figures out its math when creating dialog because I can have some precise calculations and it will work out for 3/4 controls but one does not compute the same, or even worse changing interface size just has completely different math Very Large (Interface Size) - Essentially exactly how it should look Large (Interface Size) - Third padding is differnt and total is short Normal (Interface Size) - Center padding is different and total is too long Small (Interface Size) - Padding is decent but total comes short Is there an error in this math or is arma just dogshit, I don't use safezone or anything as such cause it scales bad with text or images in controls and defeats the purpose of interface size // Defines #define buttonPadding 0.0028 #define buttonWidth (0.65 - (buttonPadding * 3)) / 4 class CloseButtonKey: Life_RscButtonMenu { idc = -1; text = "Close"; //--- ToDo: Localize; onButtonClick = "closeDialog 0"; // 14.6375 x = 0.1750; y = 0.75975; w = buttonWidth; h = 0.0400; colorText[] = {1,1,1,1}; colorBackground[] = {0,0,0,0.8}; }; class ButtonSlot1: Life_RscButtonMenu { idc = 2408; x = __EVAL(0.1750 + ((buttonWidth * 1) + (buttonPadding * 1))); y = 0.75975; w = buttonWidth; h = 0.0400; colorText[] = {1,1,1,1}; colorBackground[] = {0,0,0,0.8}; }; class ButtonSlot2: Life_RscButtonMenu { idc = 2409; x = __EVAL(0.1750 + ((buttonWidth * 2) + (buttonPadding * 2))); y = 0.75975; w = buttonWidth; h = 0.0400; colorText[] = {1,1,1,1}; colorBackground[] = {0,0,0,0.8}; }; class ButtonSlot3: Life_RscButtonMenu { idc = 2410; x = __EVAL(0.1750 + ((buttonWidth * 3) + (buttonPadding * 3))); y = 0.75975; w = buttonWidth; h = 0.0400; colorText[] = {1,1,1,1}; colorBackground[] = {0,0,0,0.8}; };
  16. Although it may be in the same file, when you used the event handler the code is within its own scope and everything outside of it is non existent unless it is assigned to a global variable
  17. What I am trying to do probably makes no sense, and I really have no idea what i'm doing in this place of algebra but here is my problem ... I am trying to populate a list of values from min (x) to max (y) increasing the values by the step amount (z) easy enough, but I want to have the step value increase in size as the numbers get larger and larger so I don't have a list the size 'max / step', if max is say 5000000. So once the current value reaches another place the step value matches in increase by the same amount: min(0); max(5000000); starting step(2500); + 2500 +25000 +250000 Expected output: [0, 2500, 5000, 7500, 10000, 25000, 50000, 75000, 100000, 125000, ... , 975000, 1000000, 1250000, ... ] Below is probably just a bunch of junk, so maybe cover your eyes from this part, as It likely will lead you no where but I would not really know ... // Limits _min_value = 0; _max_value = 5000000; // Init _values = []; _current_value = _min_value; // Init loop variables _value_step = 2500; _step_power = floor(log _value_step); _base_step = _value_step / (10 ^ _step_power); // Populate values while {_current_value <= _max_value} do { // Push to value list _values pushBack _current_value; // Figure step amount _current_value_power = floor(log _current_value); _value_step = _base_step * (10 ^ _current_value_power); _powers_difference = _current_value_power - _step_power; // ... // Update current value _current_value = _current_value + _value_step; }; I figured this fell into the category of logarithms but I am apparently not very good at learning and using them as I have been stuck on trying to complete this problem all day. Please help 🙂 Note: I would like to figure this problem without a bunch of 'if' or 'switch' statements, just good old reliable math
  18. NumbNutsJunior

    Add action if item is in inventory

    https://community.bistudio.com/wiki/addAction
  19. The way you are calling the event handler in initPlayerLocal you may want to change to: player addMPEventHandler ["MPKilled", {_this execVM "scripts\sg_stats.sqf";}]; _this is a special "magic" variable that holds the arguments/parameters in this case _this is an array of the unit killed and the killer passed from the event handler MPKilled
  20. It just allows other players to use the same command getVariable but instead of player they could replace the unit of someone who updated with true so if you did something like _killer getVariable ["sg_kills", 0] and find out how many kills that player has if you update using false then only your computer can get the variable that you just set with setVariable. It depends on if you want others to have access or not that is all.
  21. I am assuming you are just trying to keep track of kills so this should lead you in the right direction // initPlayerLocal.sqf private ["_sg_kills"]; // Check if player has kills saved if (isNil {profileNamespace getVariable "sg_kills"}) then { // Set first instance of variable profileNamespace setVariable ["sg_kills", 0]; }; // Get players current kill count and set to player _sg_kills = profileNamespace getVariable ["sg_kills", 0]; player setVariable ["sg_kills", _sg_kills, true]; // True lets everyone on the server know this variable was updated // Run on all clients in multiplayer when player is killled player addMPEventHandler ["MPKilled", {null = execVM "scripts\sg_stats.sqf";}]; // sg_stats.sqf - executed on every client when player it is assigned to is killed params [["_unitKilled", objNull], ["_killer", objNull]]; // https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#MPKilled private ["sg_kills"]; // Check if you are the killer if (player isEqualTo _killer) then { // Update kill count _sg_kills = (player getVariable ["sg_kills", 0]) + 1; // 0 is the default value profileNamespace setVariable ["sg_kills", _sg_kills]; // ProfileNamespace cannot use true with setVariable player setVariable ["sg_kills", _sg_kills, true]; // Inform user of kill if (_unitKilled in allUnits) then { hint format["You just killed %1, and now your current kill count is %2", name _unitKilled, _sg_kills]; }; }; // Check if your are the one killed if (player isEqualTo _unitKilled) then { // Code here };
  22. The command modelToWorld returns a position and you assigned that to variable _localitation. Then you tried to find the "position" of a position. Just replace "position _localitation" to just "_localitation"
  23. I am just curious on how you might actually use the position command to find the position of a location of one of the major towns such as Athira or Sofia, clearly the locations are marked out somewhere because the editor already has a list of locations and 3D markers placed. I simply could not find a way to do this, so I've come to the people of the forums to save me. Just to be clear, I don't want to find the location of the nearest town based on an object or a marker, just if it is possible from the built in game locations Thank you, Pizza Man
  24. NumbNutsJunior

    Location location?

    This is exactly what I was looking for thank you
  25. NumbNutsJunior

    Location location?

    After testing, I don't think this would work sadly
×