Jump to content

riouken

Member
  • Content Count

    570
  • Joined

  • Last visited

  • Medals

Everything posted by riouken

  1. They can't communicate. The only two ways to get data in or out is to pass data to the thread: _null =[this,stuff gets passed to the thread] execVM "my script.sqf"; And saving variables to a global namespace and then checking those in another thread. Scope matters a lot when coding like this. ---------- Post added at 03:16 PM ---------- Previous post was at 03:10 PM ---------- A lot of scripting in arma revolves around functions. You pass data to them and either wait for a return or they go off on their own to do a task while your other script finishes up.
  2. In reference to your locality check question yes you can check it. There is a. Command for it: http://community.bistudio.com/wiki/local
  3. To hopefully get this back on topic... There are some conversion mods out there but it does not work the same as some other engine's like "source" etc... In arma you do not have as much access to the engine. Almost every thing is done with the API. So almost everything is done either mission/script based or Mod based. For some good examples of conversion mods and how they are done here are some you can download and open up to see how it works. http://dayzmod.com/ http://www.invasion-1944.com/download-i44/ http://www.cityliferpg.com/
  4. riouken

    Alarm delay

    You can set this even with a little bit of randomness directly in the trigger interface: https://community.bistudio.com/wiki/Mission_Editor:_Triggers#Countdown.2FTimeout_Counters
  5. riouken

    getMarkerPos using an Array

    Normaly I would say you are correct but I would adviase against using BIS_fnc_selectRandom right now(Unless they have fixed it and I missed that). https://dev-heaven.net/issues/69439 Edit: Nevermind I just checked in the function viewer and they did stealth fix this for Arma 3. scriptName "Functions\arrays\fn_selectRandom.sqf"; /************************************************************ Random Select By Andrew Barron / Rewritten by Warka Parameters: array This returns a randomly selected element from the passed array. Example: [1,2,3] call BIS_fnc_selectRandom Returns: 1, 2, or 3 ************************************************************/ private ["_ret","_i"]; if(count _this > 0) then { _i = floor random (count _this); //random index _ret = _this select _i; //get the element, return it }; _ret Thanks Warka:)
  6. You dont need all those MP event handlers and script executions to get rid of bodies. put this in your init.sqf _nul = spawn { while {true} do { sleep 300; // You can change this to make this check faster or slower. { deleteVehicle _x } forEach allDead; }; };
  7. The solution is a lot easier than you think , With getVariable you can set a default value to return if the the var is not defined. Then check for that default vaule for your case B. _varTest = nsf_oJIPns getVariable [_this,"myVarIsNul"]; if (_varTest == "myVarIsNul") then { hint "You did not declare the variable!"; }; http://community.bistudio.com/wiki/getVariable
  8. riouken

    Satchel charge only to Destroy

    You can use this command to disable damage for all the other things around it. http://community.bistudio.com/wiki/allowDamage
  9. riouken

    loop performance

    Maybe english isn't your first language and that is the communication problem. Have fun...
  10. riouken

    loop performance

    And once again you do not understand at all, your question is WRONG, the whole idea, the way your coding etc... It does not matter what you put in the if statement, as you can see from your test, the difference is imperceptible. What matters is that your completing the if statement. If you already have the var, or bool figured out, before the if statement (Like in your example A) then why do you need to complete the if Statement? ---------- Post added at 08:47 PM ---------- Previous post was at 08:35 PM ---------- Let me explain it another way. if (scoreLimit > 0) then { limitScore = true; }; if (timeLimit > 0) then { limitTime = true; }; [color=#ff0000]// Everything above this line only runs once in this script. And you set limitScore & limitTime based on the if statements above. This only happens once.[/color] while { true } { if (limitScore) then [color=#ff0000]// Next you are checking the above variable and if its true then you do stuff. But this is in a loop, and it will keep running over and over. There is no reason to spend this proc power on this unless limitScore will be changing. And // if its going to be changing then your test is moot because at some point your going to have to evaluate limitScore so you can just do it here if that is the case. [/color] { if (scoreLimit..........) then { do something.... }; }; if (limitTime) then { if (timeLimit ..........) then { do something.... }; }; sleep 1; };
  11. riouken

    loop performance

    What two loops are you referring to? You said in the beginning this was theoretical. If you have a real problem your trying to solve please tell us and we will be able to assist you better.
  12. riouken

    Select all buildings?

    http://community.bistudio.com/wiki/nearestObjects
  13. riouken

    loop performance

    Yes I do but i'm afraid you're missing the point. There is no need to check an if statement you know it to be true... that is where the real processing time come from. There is no need to put an if statement in a loop unless you need to check the statement each iteration. Method 2 could look something like this. if (myVariable > 0) then { while {true} { do something.... sleep 1; }; }; processMyVar = false; if (myVariable > 0) then { processMyVar = true; }; while { true } { if (processMyVar ) then [color=#ff0000]// There is no need for this statement, why spend the time checking this if you already know it to be true in your if statement above. The only time you need to check would be if this var would be changing.[/color] { do something.... }; sleep 1; };
  14. riouken

    loop performance

    Lol. Your not getting it. The engine does the same exact same thing in both your examples. The engine just checks if the statement is true or not. The only way you could see an impact is if you checked one single condition on one and multipul conditions on the other. That doe sent even take into account your deviation in your results. Your test for all intents and purposes is the exact same.
  15. riouken

    loop performance

    Your still not comparing anything In your last example. To compare two functions you need a few things. 1. They need to do the same job. -- ie how long would it take to spawn 100 opfor vs spawning 10 tanks. 2. They need to work at least slightly different. -- ie. If I was trying to spawn 100 ai would it be faster to spawn 10 groups of 10 air or a 100 groups of 1 ai. Each of these example accomplished the same thing the just did it in different ways. Then you can test to see which one is best.
  16. riouken

    loop performance

    Those two examples in your first post don't even function the same way. No since trying to figure out if one is faster or anything. I don't think you quite understand how those would run. In your first example your while true block would begin to run in a loop and each cycle it would execute the if statement. Your second example the first if statement would execute one time. Then the while true loop would begin to run and it would execute the if statement inside the while loop each cycle. The two algorythims don't function the same so you can't compare them. Like another poster said when you start running functions hundreds or thousands of times a frame or your running hundreds of loops. You probably don't need to worry about it. But there is nothing wrong with learning about it.
  17. I have made a simple GUI to help with the new gear system while we are testing Alpha. I made this to test out the new gui setup and to help test out all the gear in A3. [Disclaimer] My UI still has several bugs, and a bunch of the gear is incomplete or buggy. But the ui is still quite functional. This is distributed as a mission, I included the MP pbo along with the editor folder for the mission. It is MP compatible. Each player will have an Action to open the menu. If you want to only have this available all the time, you can edit rgm_init.sqf to place the action on an object such as your ammo box. ---Features--- - Can cycle between [Helmets, Clothes, Vests, Weapons, Optics,Attachments, Suppressor's and backpacks] - You can add ammo for your primary weapons. - Most of the items will show a hint with picture and the name of the item. - Some of this gear can only be added by script so it makes quite a bit more gear available than what is normally available. ---Known Issues--- - Some of the gear that I included does not work properly. - There is an error the first time you open the GUI. ( I'm working on this now and it does not effect the functionality.) - Some gear combinations are client side only. - Some gear combinations will glitch your player model. - I did not include pistols in this release( I might add this later.) Download - link Updated! Armaholic - [ALPHA] Riouken's Gear Menu v1.0 - Not updated yet.
  18. riouken

    Dialog Layering Issues

    Use RscPicture: http://community.bistudio.com/wiki/DialogControls-Text#Static_Pictures to deal with layers, the way you define the elements differs how they are treated. For instance you can specifically define something as the background to your UI and it will always be the first layer: class RSLO_dlg { idd = -1; movingEnable = false; onLoad = "execVM 'RSLO\RSLO_ui_setup.sqf';uiNamespace setVariable ['RSLO_main_dlg', (_this select 0)];" objects[] = {}; class controlsBackground { [color=#ff0000] class background: RSLO_RscPicture[/color] [color=#ff0000] {[/color] [color=#ff0000] idc = 1200;[/color] [color=#ff0000] text = "\ca\ui\data\ui_background_controls_ca.paa";[/color] [color=#ff0000] x = 0.0138894;[/color] [color=#ff0000] y = 0.194989;[/color] [color=#ff0000] w = 0.810784;[/color] [color=#ff0000] h = 0.629413;[/color] [color=#ff0000] moving = false;[/color] [color=#ff0000] };[/color] }; class controls { class extbtn: RSLO_RscShortcutButton { idc = 1700; text = "Close"; x = 0.47304; y = 0.721132; w = 0.16536; h = 0.110893; action = "closeDialog 0"; }; class mainframe: RSLO_RscFrame { idc = 1800; text = "RSLO"; x = 0.0228757; y = 0.254902; w = 0.616339; h = 0.480174; }; class loadoutbox: RSLO_RscCombo { idc = 2100; x = 0.0988562; y = 0.342048; w = 0.181699; h = 0.0324619; tooltip = "Select a loadout from the list box."; }; class terraindetbox: RSLO_RscCombo { idc = 2101; x = 0.0972222; y = 0.488018; w = 0.180882; h = 0.0357298; tooltip = "Select a Terrain Detail level from the list box."; }; class looadouttxt: RSLO_RscText { idc = 1000; text = "Loadouts"; x = 0.126634; y = 0.281046; w = 0.168627; h = 0.0400872; }; class gearbtn: RSLO_RscShortcutButton { idc = 1702; text = "Gear Up"; x = 0.402778; y = 0.303922; w = 0.16536; h = 0.110893; action = "execVM 'RSLO\loadouts.sqf';"; }; class terrdetbtn: RSLO_RscShortcutButton { idc = 1701; text = "Set"; x = 0.403595; y = 0.454248; w = 0.16536; h = 0.110893; action = "execVM 'RSLO\settr.sqf';"; }; class terrndettxt: RSLO_RscText { idc = 1001; text = "Terrain Detail"; x = 0.104575; y = 0.430284; w = 0.168627; h = 0.0400872; }; class viewdisttxt: RSLO_RscText { idc = 1002; text = "View Distance"; x = 0.250817; y = 0.559912; w = 0.168627; h = 0.0400872; }; class RscSlider_1900: RSLO_RscSlider { idc = 1900; x = 0.138889; y = 0.666667; w = 0.379412; h = 0.0488018; onSliderPosChanged = "_this call RSLO_set_vd_fnc;"; tooltip = "Slide to set View Distance."; }; class viewdistnumb: RSLO_RscText { idc = 1100; text = "1000"; x = 0.294935; y = 0.610022; w = 0.168627; h = 0.0400872; }; }; }; Also the order in which you define the controls will define their layers, so the first control you define will be your lowest layer or your first. class RscTitles { titles[]={}; class dis_divecomp { idd = -1; fadeout=0; fadein=0; duration = 99999; name = "dis_divecomp"; onLoad = "uiNamespace setVariable ['dis_divecomp', _this select 0]"; controls[]= { [color=#ff0000]background,[/color] remaintime, bottomtime, tempture1, depth, gassname }; [color=#ff0000] class background: DIS_RscPicture { idc = IDC_DIVECOMPUTER_BACKGROUND; text = "\DIS\pics\divercomp.paa"; x = -28 * GUI_GRID_W + GUI_GRID_X; y = 0.5 * GUI_GRID_H + GUI_GRID_Y; w = 25.5 * GUI_GRID_W; h = 19 * GUI_GRID_H; shadow = 0; };[/color] class remaintime: DIS_RscText { idc = IDC_DIVECOMPUTER_REMAINTIME; text = "00:00"; x = -25.01 * GUI_GRID_W + GUI_GRID_X; y = 6.73 * GUI_GRID_H + GUI_GRID_Y; w = 8.0505 * GUI_GRID_W; h = 3.41583 * GUI_GRID_H; colorText[] = { 0, 0, 0, 1 }; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 2)"; shadow = 0; }; class bottomtime: DIS_RscText { idc = IDC_DIVECOMPUTER_BOTTOMTIME; text = "00:00"; x = -25 * GUI_GRID_W + GUI_GRID_X; y = 11.5 * GUI_GRID_H + GUI_GRID_Y; w = 8 * GUI_GRID_W; h = 3 * GUI_GRID_H; colorText[] = { 0, 0, 0, 1 }; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 2)"; shadow = 0; }; class tempture1: DIS_RscText { idc = IDC_DIVECOMPUTER_TEMP; text = "68"; x = -10.5 * GUI_GRID_W + GUI_GRID_X; y = 7 * GUI_GRID_H + GUI_GRID_Y; w = 5.5 * GUI_GRID_W; h = 3.5 * GUI_GRID_H; colorText[] = { 0, 0, 0, 1 }; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 2)"; shadow = 0; }; class depth: DIS_RscText { idc = IDC_DIVECOMPUTER_DEPTH; text = "100"; x = -10.5 * GUI_GRID_W + GUI_GRID_X; y = 11.5 * GUI_GRID_H + GUI_GRID_Y; w = 5.5 * GUI_GRID_W; h = 3 * GUI_GRID_H; colorText[] = { 0, 0, 0, 1 }; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 2)"; shadow = 0; }; class gassname: DIS_RscText { idc = IDC_DIVECOMPUTER_GASSNAME; text = "P0.7"; x = -16 * GUI_GRID_W + GUI_GRID_X; y = 11.5 * GUI_GRID_H + GUI_GRID_Y; w = 4.5 * GUI_GRID_W; h = 3 * GUI_GRID_H; colorText[] = { 0, 0, 0, 1 }; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 2)"; shadow = 0; }; };
  19. You also can copy the text from your saved config to your clipboard on your computer. Then the dialog editor will auto load it.
  20. @zorrobyte, NVG's are working fine for me. Are you trying to load the NVG's without a vest or backpack? Also you should be aware, wearing clothes that are not your faction, while it can be forced by a scirpt, is limited by the game, and after you force it on the player it becomes a client side only effect. So in a mp game other people will not be able to see the clothes if your wearing civ clothes as a bluefor.
  21. I am planning on doing a duel version. So people can run this as a mod or as mission based scripts. If a mod wants to move the thread that's fine, I just didn't want to make a new thread with my other version, just thought I would put it all here.
  22. Nope not at all, you are free to edit, use and change all my code, just please leave in a credit to me please.
  23. riouken

    Riouken's Gear Menu - Alpha

    I included the wrong Editor mission, that is not the correct mission, I will post an update in a few minutes with the correct files. You can re - download. ---------- Post added at 07:26 AM ---------- Previous post was at 07:23 AM ---------- Updated with correct files - link
  24. riouken

    Riouken's Gear Menu - Alpha

    @lo0se hmm. Ill have to check into the editor version.(edit - I see the problem, i include the wrong editor file, i will fix it tommorow and update along with a few other things) I may add a few more things like goggles and a a few other features, but this is mostly for me to learn the new gear system and gui in preparation for RSLO 3.0. I'm just getting started with it but it will have wealth of features and be your go to one stop shop for load-out related addons.
×