Jump to content

cookies2432

Member
  • Content Count

    246
  • Joined

  • Last visited

  • Medals

Everything posted by cookies2432

  1. cookies2432

    Delete object without ID

    Thank you! It works, however it gives me a weird error (even tho it works) deleteVehicle type number, expected object?
  2. cookies2432

    Delete object without ID

    _item is the whole id name sort of of the item (a rice box for example) and _itemClass is the pure classname itself (land_rice_somethinghereidk.p3d) And ah okay, how would i go on about deleting the object?
  3. cookies2432

    Delete object without ID

    fnc_pickup = { hint "fired"; _item = _this select 0; _plr = _this select 1; _itemClass = typeOf (_item select 0); _indexNum = itemArray find _itemClass; _plrInv = profileNamespace getVariable "VirtualInventory"; _amount = _plrInv select _indexNum; _plrInv set [_indexNum, _amount +1]; profileNamespace setVariable ["VirtualInventory",_plrInv]; _plrInv = profileNamespace getVariable "VirtualInventory"; hint format ["%1",_item]; deleteVehicle (_this select 0); }; This is the code i'm using, the object calls it via an addAction put on the object however, in the future it wont be an addAction in its init line
  4. Hello, i'm in the need of help with a script that's supposed to "pick up" an item from the ground (soda for example) and then it will take its classname, check it if it matches any of the variables in an array and if it does it will add a value to that variable. After all of that it will find the pic of that item in the config file (haven't begun with this part yet). After this it will add the picture to a rsclistBox on a GUI (IDC = 1500) and the name of the item (for example, can of soda or whatever it's called). I have begun working on it but i'm getting errors about my function being undefined ? This is my code: _itemType = (_this select 0); call fnc_addItem; fnc_addItem = { private ["_Rice","_Beans","_Water","_Soda"]; _Rice = "Land_RiceBox_F"; _Beans = "Land_BakedBeans_F"; _Water = "Land_BottlePlastic_V2_F"; _Soda = "Land_Can_V1_F"; if ({_x == _itemType} forEach ["_Rice","_Beans","_Water","_Soda"]) { hint format ["Hello"]; } else { hint format ["RIP"]; } deleteVehicle _itemType; hint format ["Rice %1 Beans %2 Water %3 Soda %4",_Rice,_Beans,_Water,_Soda]; }; Any help would be extremly appriciated! :)
  5. Also, i think that this part of the code is not needed (I could be wrong) [_itemType] When I call the function I already have the data from the can (_target = _this select 0) and so because of that, I don't think it's needed to declare it again, however, I could be completely wrong :)
  6. gives me an error missing " ; ". But yea something like that, i'm kind of new to scripting but i really want to learn it so i can actually finish my project :D
  7. Yea you are correct, my bad :D. Also, I tried to make them equal to the config paths but it proved, unsucessfull, still having the undefined variable error.
  8. Thanks! :D I got another issue but I think I can solve it on my own, not sure.it's that it now says "undefined variable" on them. I think I know how to fix it, not sure.
  9. I thought I had to use a string format since they are classnames :/
  10. Thank you! Now it's giving some weird "reserved variable in expression" error message for some reason, it's about this I think: if ({_x == _itemType} forEach ["_Rice","_Beans","_Water","_Soda"] Any idea why? As I understand that's correct usage of forEach but i'm proabably wrong, still learning :). Could it be because i mention the variables twice (private) and in the if statement?
  11. Thanks! :D, How would I use it tho?
  12. The script is still not working tho, it says that line 13 (the one with "if" and "forEach" is missing a " ; ".
  13. Oh well, I'm happy it's that simple lol. Sometimes when you focus on one thing you find it hard to spot other things. Thanks a lot! :D
  14. Thanks for all the replies, I will listen to all of your suggestions :D
  15. Hello, i'm working on something for arma 3 that i've always wanted to do but I could really use some advice or help sometimes, I cannot offer any salary, just looking for someone who shares the same interesst as me, creating content for arma 3 and learning while doing so. Thanks for reading this! :) The work is about dialogs and scripting :) Steam: http://steamcommunity.com/profiles/76561198103602415/
  16. For the first 2 points, you can record a path for the ai to follow:
  17. What do you suggest, sorry, I really didn't know what to put Thank you! I have been here a little but not too often, thing is that i need help with a lot of different kinds of things and when I work on it, I work for only a certain period of time but hard. I just need someone who can quickly helpe me with a small issue :)
  18. cookies2432

    Dialogs issue

    Thank you! I tested this as well and something weird happend, some of my frames became black and some didn't, I used "IGUIBack" as a parent on all of them but it still, flipped out.
  19. Soo.... I'm having 2 issues, one of them is that I cannot seem to import my saved GUI data from my dialogs.hpp (to edit ingame). The second issue is that I cannot load the dialog ingame using a script. These are the scripts: _handle=createdialog "gunShop_dialog"; To execute the Dialog class gunShop_dialog { idd=1; movingenable=false; class controls { //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT START (by [HP] James, v1.063, #Vynuxo) //////////////////////////////////////////////////////// class left_frame: RscFrame { idc = 1800; x = 0.29375 * safezoneW + safezoneX; y = 0.225 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.55 * safezoneH; colorBackground[] = {-0,-0,-0,-0}; colorActive[] = {-0,-0,-0,-0}; }; class middle_frame: RscFrame { idc = 1801; x = 0.479375 * safezoneW + safezoneX; y = 0.225 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.55 * safezoneH; colorBackground[] = {-0,-0,-0,-0}; colorActive[] = {-0,-0,-0,-0}; }; class right_frame: RscFrame { idc = 1803; x = 0.665 * safezoneW + safezoneX; y = 0.225 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.55 * safezoneH; colorBackground[] = {-0,-0,-0,-0}; colorActive[] = {-0,-0,-0,-0}; }; class weapon_image: RscPicture { idc = 1200; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.335 * safezoneW + safezoneX; y = 0.555 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.165 * safezoneH; }; class weapon_information: RscStructuredText { idc = 1100; x = 0.520625 * safezoneW + safezoneX; y = 0.599 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.121 * safezoneH; }; class weapon_information_text: RscText { idc = 1000; text = "Weapon information"; //--- ToDo: Localize; x = 0.520625 * safezoneW + safezoneX; y = 0.555 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.044 * safezoneH; }; class left_top_frame: RscFrame { idc = 1804; x = 0.335 * safezoneW + safezoneX; y = 0.225 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.022 * safezoneH; }; class right_top_frame: RscFrame { idc = 1805; x = 0.520625 * safezoneW + safezoneX; y = 0.225 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.066 * safezoneH; }; class bottom_left_frame: RscFrame { idc = 1806; x = 0.335 * safezoneW + safezoneX; y = 0.72 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.055 * safezoneH; }; class bottom_right_frame: RscFrame { idc = 1807; x = 0.520625 * safezoneW + safezoneX; y = 0.72 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.055 * safezoneH; }; class small_weapon_pic1: RscPicture { idc = 1201; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.335 * safezoneW + safezoneX; y = 0.291 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class small_weapon_pic2: RscPicture { idc = 1202; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.335 * safezoneW + safezoneX; y = 0.335 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class small_weapon_pic3: RscPicture { idc = 1203; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.335 * safezoneW + safezoneX; y = 0.379 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class small_weapon_pic4: RscPicture { idc = 1204; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.335 * safezoneW + safezoneX; y = 0.423 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class small_weapon_pic5: RscPicture { idc = 1205; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.335 * safezoneW + safezoneX; y = 0.467 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class small_weapon_pic6: RscPicture { idc = 1206; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.335 * safezoneW + safezoneX; y = 0.511 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class small_weapon_pic_bar6: RscFrame { idc = 1809; x = 0.335 * safezoneW + safezoneX; y = 0.544 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class small_weapon_pic_bar5: RscFrame { idc = 1808; x = 0.335 * safezoneW + safezoneX; y = 0.5 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class small_weapon_pic_bar4: RscFrame { idc = 1810; x = 0.335 * safezoneW + safezoneX; y = 0.456 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class small_weapon_pic_bar3: RscFrame { idc = 1811; x = 0.335 * safezoneW + safezoneX; y = 0.412 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class small_weapon_pic_bar2: RscFrame { idc = 1812; x = 0.335 * safezoneW + safezoneX; y = 0.368 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class small_weapon_pic_bar1: RscFrame { idc = 1813; x = 0.335 * safezoneW + safezoneX; y = 0.324 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class sell_weapon_button: RscButton { idc = 1600; text = "Sell Weapon"; //--- ToDo: Localize; x = 0.520625 * safezoneW + safezoneX; y = 0.467 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.055 * safezoneH; }; class sell_under_frame: RscFrame { idc = 1814; x = 22 * GUI_GRID_W + GUI_GRID_X; y = 13.5 * GUI_GRID_H + GUI_GRID_Y; w = 14 * GUI_GRID_W; h = 2 * GUI_GRID_H; }; class sell_weapon_small_pic1: RscPicture { idc = 1207; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.520625 * safezoneW + safezoneX; y = 0.291 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class sell_weapon_bar_pic1: RscFrame { idc = 1802; x = 0.520625 * safezoneW + safezoneX; y = 0.324 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class sell_weapon_small_pic2: RscPicture { idc = 1208; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.520625 * safezoneW + safezoneX; y = 0.335 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class sell_weapon_bar_pic2: RscFrame { idc = 1815; x = 0.520625 * safezoneW + safezoneX; y = 0.368 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class sell_weapon_small_pic3: RscPicture { idc = 1209; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.520625 * safezoneW + safezoneX; y = 0.379 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class sell_weapon_bar_pic3: RscFrame { idc = 1816; x = 0.520625 * safezoneW + safezoneX; y = 0.412 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class sell_weapon_small_pic4: RscPicture { idc = 1210; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.520625 * safezoneW + safezoneX; y = 0.423 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; }; class sell_weapon_bar_pic4: RscFrame { idc = 1817; x = 0.520625 * safezoneW + safezoneX; y = 0.456 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.011 * safezoneH; }; class buy_weapon_text1: RscText { idc = 1001; x = 0.37625 * safezoneW + safezoneX; y = 0.291 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class buy_weapon_button: RscButton { idc = 1601; text = "Buy Weapon"; //--- ToDo: Localize; x = 0.335 * safezoneW + safezoneX; y = 0.247 * safezoneH + safezoneY; w = 0.144375 * safezoneW; h = 0.044 * safezoneH; }; class buy_weapon_text2: RscText { idc = 1002; x = 0.37625 * safezoneW + safezoneX; y = 0.335 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class buy_weapon_text3: RscText { idc = 1003; x = 0.37625 * safezoneW + safezoneX; y = 0.379 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class buy_weapon_text4: RscText { idc = 1004; x = 0.37625 * safezoneW + safezoneX; y = 0.423 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class buy_weapon_text5: RscText { idc = 1005; x = 0.37625 * safezoneW + safezoneX; y = 0.467 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class buy_weapon_text6: RscText { idc = 1006; x = 0.37625 * safezoneW + safezoneX; y = 0.511 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class sell_weapon_tex1: RscText { idc = 1007; x = 0.561875 * safezoneW + safezoneX; y = 0.291 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class sell_weapon_tex2: RscText { idc = 1008; x = 0.561875 * safezoneW + safezoneX; y = 0.335 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class sell_weapon_tex3: RscText { idc = 1009; x = 0.561875 * safezoneW + safezoneX; y = 0.379 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class sell_weapon_tex4: RscText { idc = 1010; x = 0.561875 * safezoneW + safezoneX; y = 0.423 * safezoneH + safezoneY; w = 0.103125 * safezoneW; h = 0.033 * safezoneH; }; class RscControlsGroup_2300: RscControlsGroup { idc = 2300; x = 17 * GUI_GRID_W + GUI_GRID_X; y = 3 * GUI_GRID_H + GUI_GRID_Y; w = 1 * GUI_GRID_W; h = 12.5 * GUI_GRID_H; class controls { }; }; class RscControlsGroup_2301: RscControlsGroup { idc = 2301; x = 35 * GUI_GRID_W + GUI_GRID_X; y = 3 * GUI_GRID_H + GUI_GRID_Y; w = 1 * GUI_GRID_W; h = 8 * GUI_GRID_H; class controls { }; }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// }; }; Dialogs.hpp // Control types #define CT_STATIC 0 #define CT_BUTTON 1 #define CT_EDIT 2 #define CT_SLIDER 3 #define CT_COMBO 4 #define CT_LISTBOX 5 #define CT_TOOLBOX 6 #define CT_CHECKBOXES 7 #define CT_PROGRESS 8 #define CT_HTML 9 #define CT_STATIC_SKEW 10 #define CT_ACTIVETEXT 11 #define CT_TREE 12 #define CT_STRUCTURED_TEXT 13 #define CT_CONTEXT_MENU 14 #define CT_CONTROLS_GROUP 15 #define CT_SHORTCUTBUTTON 16 #define CT_XKEYDESC 40 #define CT_XBUTTON 41 #define CT_XLISTBOX 42 #define CT_XSLIDER 43 #define CT_XCOMBO 44 #define CT_ANIMATED_TEXTURE 45 #define CT_OBJECT 80 #define CT_OBJECT_ZOOM 81 #define CT_OBJECT_CONTAINER 82 #define CT_OBJECT_CONT_ANIM 83 #define CT_LINEBREAK 98 #define CT_USER 99 #define CT_MAP 100 #define CT_MAP_MAIN 101 #define CT_LISTNBOX 102 // Static styles #define ST_POS 0x0F #define ST_HPOS 0x03 #define ST_VPOS 0x0C #define ST_LEFT 0x00 #define ST_RIGHT 0x01 #define ST_CENTER 0x02 #define ST_DOWN 0x04 #define ST_UP 0x08 #define ST_VCENTER 0x0C #define ST_GROUP_BOX 96 #define ST_GROUP_BOX2 112 #define ST_ROUNDED_CORNER ST_GROUP_BOX + ST_CENTER #define ST_ROUNDED_CORNER2 ST_GROUP_BOX2 + ST_CENTER #define ST_TYPE 0xF0 #define ST_SINGLE 0x00 #define ST_MULTI 0x10 #define ST_TITLE_BAR 0x20 #define ST_PICTURE 0x30 #define ST_FRAME 0x40 #define ST_BACKGROUND 0x50 #define ST_GROUP_BOX 0x60 #define ST_GROUP_BOX2 0x70 #define ST_HUD_BACKGROUND 0x80 #define ST_TILE_PICTURE 0x90 #define ST_WITH_RECT 0xA0 #define ST_LINE 0xB0 #define ST_SHADOW 0x100 #define ST_NO_RECT 0x200 #define ST_KEEP_ASPECT_RATIO 0x800 #define ST_TITLE ST_TITLE_BAR + ST_CENTER // Slider styles #define SL_DIR 0x400 #define SL_VERT 0 #define SL_HORZ 0x400 #define SL_TEXTURES 0x10 // progress bar #define ST_VERTICAL 0x01 #define ST_HORIZONTAL 0 // Listbox styles #define LB_TEXTURES 0x10 #define LB_MULTI 0x20 // Tree styles #define TR_SHOWROOT 1 #define TR_AUTOCOLLAPSE 2 // MessageBox styles #define MB_BUTTON_OK 1 #define MB_BUTTON_CANCEL 2 #define MB_BUTTON_USER 4 //////////////// //Base Classes// //////////////// class RscText { access = 0; idc = -1; type = CT_STATIC; style = ST_MULTI; linespacing = 1; colorBackground[] = {0,0,0,0}; colorText[] = {1,1,1,1}; text = ""; shadow = 0; font = "PuristaLight"; SizeEx = 0.02300; fixedWidth = 0; x = 0; y = 0; h = 0; w = 0; }; class RscPicture { access = 0; idc = -1; type = CT_STATIC; style = ST_PICTURE; colorBackground[] = {0,0,0,0}; colorText[] = {1,1,1,1}; font = "PuristaLight"; sizeEx = 0; lineSpacing = 0; text = ""; fixedWidth = 0; shadow = 0; x = 0; y = 0; w = 0.2; h = 0.15; }; class RscButton { access = 0; type = CT_BUTTON; text = ""; colorText[] = {1,1,1,.9}; colorDisabled[] = {0.4,0.4,0.4,0}; colorBackground[] = {0.75,0.75,0.75,0.8}; colorBackgroundDisabled[] = {0,0.0,0}; colorBackgroundActive[] = {0.75,0.75,0.75,1}; colorFocused[] = {0.75,0.75,0.75,.5}; colorShadow[] = {0.023529,0,0.0313725,1}; colorBorder[] = {0.023529,0,0.0313725,1}; soundEnter[] = {"\ca\ui\data\sound\onover",0.09,1}; soundPush[] = {"\ca\ui\data\sound\new1",0,0}; soundClick[] = {"\ca\ui\data\sound\onclick",0.07,1}; soundEscape[] = {"\ca\ui\data\sound\onescape",0.09,1}; style = 2; x = 0; y = 0; w = 0.055589; h = 0.039216; shadow = 2; font = "PuristaLight"; sizeEx = 0.03921; offsetX = 0.003; offsetY = 0.003; offsetPressedX = 0.002; offsetPressedY = 0.002; borderSize = 0; }; class RscFrame { type = CT_STATIC; idc = -1; style = ST_FRAME; shadow = 2; colorBackground[] = {1,1,1,1}; colorText[] = {1,1,1,0.9}; font = "PuristaLight"; sizeEx = 0.03; text = ""; }; class Box { type = CT_STATIC; idc = -1; style = ST_CENTER; shadow = 2; colorBackground[] = { 0.2,0.9,0.5, 0.9}; colorText[] = {1,1,1,0.9}; font = "PuristaLight"; sizeEx = 0.03; text = ""; }; Defines.hpp Anyone got a clue as to what i'm doing wrong? :) Also, since i've already made a post, how can I make a scrollbar for my GUI? Thanks for your help!
  20. cookies2432

    Dialogs issue

    Where do i put this? :/ And how do i connect it to my all of my frames?
  21. cookies2432

    Dialogs issue

    I don't seem to be able to change the color of the rsc_frames :(. I'm trying to make the frames have the background color of black but it isn't working, i'm using {0.0.0.1}
×