mihikle 2 Posted August 15, 2013 Hi all, So I've decided to punch above my weight and go for something more difficult in a mission - GUI's. For my mission I want people to be able to walk up to an object (in this case an empty ammobox) and be able to scroll and open up a GUI, which will have a series of pre-defined load-outs that people can select. I've made the GUI, although the buttons do not do anything as far as I know (It's not in-game yet). I used the GUI Editor for this, and although very easy to use it does not tell you how to actually get it in your mission. I have created a Config for my GUI, however I have no idea how to: a. Connect a button to a script (so when I press for example 'Rifleman' It will execute a script such as "rifleman.sqf") b. get the GUI into my mission at all, and have players able to walk up to the ammo-box, select 'open menu' and then the GUI comes up c. What format the config should be in (noob question... is it .cfg?) Here is my Config: class RscText_1000: RscText { idc = 1000; text = "Class Selection"; x = 0.459888 * safezoneW + safezoneX; y = 0.373096 * safezoneH + safezoneY; w = 0.0628658 * safezoneW; h = 0.0220091 * safezoneH; colorBackground[] = {0,0,0,0.5}; }; class RscButton_1600: RscButton { idc = 1600; text = "Rifleman"; x = 0.46093 * safezoneW + safezoneX; y = 0.396253 * safezoneH + safezoneY; w = 0.0592196 * safezoneW; h = 0.0349775 * safezoneH; }; class RscButton_1601: RscButton { idc = 1601; text = "LMG"; x = 0.46093 * safezoneW + safezoneX; y = 0.434232 * safezoneH + safezoneY; w = 0.0592196 * safezoneW; h = 0.0349775 * safezoneH; }; class RscButton_1602: RscButton { idc = 1602; text = "Grenadier"; x = 0.460931 * safezoneW + safezoneX; y = 0.472211 * safezoneH + safezoneY; w = 0.0592196 * safezoneW; h = 0.0349775 * safezoneH; }; class RscButton_1603: RscButton { idc = 1603; text = "MMG"; x = 0.46093 * safezoneW + safezoneX; y = 0.511115 * safezoneH + safezoneY; w = 0.0592196 * safezoneW; h = 0.0349775 * safezoneH; }; class RscButton_1604: RscButton { idc = 1604; text = "AT"; x = 0.46093 * safezoneW + safezoneX; y = 0.550021 * safezoneH + safezoneY; w = 0.0592196 * safezoneW; h = 0.0349775 * safezoneH; }; class RscButton_1605: RscButton { idc = 1605; text = "Pilot"; x = 0.46093 * safezoneW + safezoneX; y = 0.589852 * safezoneH + safezoneY; w = 0.0592196 * safezoneW; h = 0.0349775 * safezoneH; }; class RscPicture_1200: RscPicture { idc = 1200; text = "#(argb,8,8,3)color(1,1,1,1)"; x = 0.459889 * safezoneW + safezoneX; y = 0.392547 * safezoneH + safezoneY; w = 0.0623452 * safezoneW; h = 0.236913 * safezoneH; colorText[] = {0,0,0,0.5}; colorBackground[] = {0,0,0,0.5}; colorBackgroundActive[] = {0,0,0,0.5}; }; If anyone could help me out it would be great as this is something I have wanted to be able to do for ages! Please make any replies really simple :P Cheers, Mihikle Share this post Link to post Share on other sites
gizz46 28 Posted August 15, 2013 (edited) hi mihikle, here just a short info but I hope it will lead you to your solution a. to run a script use something like this; http://community.bistudio.com/wiki/User_Interface_Event_Handlers further information are in this link class RscButton_1600: RscButton { idc = 1600; text = "Rifleman"; action = execVM "your script!!!!!!!!"; x = 0.46093 * safezoneW + safezoneX; y = 0.396253 * safezoneH + safezoneY; w = 0.0592196 * safezoneW; h = 0.0349775 * safezoneH; }; b. you could do that via an addaction menu http://community.bistudio.com/wiki/addAction c. use a description.ext file for your mission. also there are planty of tutorial for GUI's, give google a try ;) hope thi helpes you Edited August 15, 2013 by gizz46 Share this post Link to post Share on other sites
mihikle 2 Posted August 15, 2013 Hey Gizz, Thanks a bunch for your help! I discovered Iceman's guide (http://www.armaholic.com/page.php?id=18362) whilst looking around for something more in-depth and I folowed that and now I have my GUI in-game and working, however I'm having trouble putting any colour into it, but I would rather get all my scripts working first before editing the frilly bits such as colours. Using the 'action =' method I've managed to get my GUI to DO something as well. Thank-you very much indeed! Very glad to have got this far with my Project :D Cheers, Mihikle Share this post Link to post Share on other sites