-- spawnable items shelter etc --entity_number1 = 45 --shelter --entity_number2 = 30 --workbench --entity_number3 = 30 --stove -- globals --Level one g_berriescollected=0 -- Add any new global items to this list g_tuberscollected=0 g_mushroomscollected=0 g_woodcollected=0 g_flintcollected=0 g_featherscollected=0 g_fiberscollected=0 g_watercollected=0 g_berry_pie=0 g_berry_soup=0 g_fdagger=0 g_faxe=0 g_fhammer=0 g_ibow=0 g_arrow=0 g_meatcollected=0 g_hidecollected=0 g_meat_pie=0 g_meat_soup=0 g_camp_fire=0 g_shelter=0 g_workbench=0 g_cooker=0 g_ironscollected=0 g_copperscollected=0 g_leadcollected=0 g_exp=0 g_planks_made=0 g_logs_made=0 g_sulphurcollected=0 g_saltpetercollected=0 g_carboncollected=0 g_furnace=0 g_lathe=0 g_iingot=0 --iron ingots g_lingot=0 --lead ingots g_cingot=0 -- copper ingots g_singot=0 -- steel ingot g_pistol=0 g_rifle=0 g_rifle_ammo=0 g_pistol_ammo=0 g_bandages=0 g_medipack=0 g_antidote=0 g_booster=0 MouseActive=0 pressed=0 MouseDown=0 -- Buttons Array Buttons={} -- How many Buttons do we have in the script MaxButtons=59 function survival_inventory_init(e) -- Option Buttons as Button 1 - whatever bOption1= LoadImage( "scriptbank\\ss1\\b_option1.png" ) -- if you make a new image they get added here bOption2= LoadImage( "scriptbank\\ss1\\b_option2.png" ) bOption3= LoadImage( "scriptbank\\ss1\\b_option3.png" ) bOption5= LoadImage( "scriptbank\\ss1\\b_option5.png" ) --Lathe bOption6= LoadImage( "scriptbank\\ss1\\b_option6.png" ) --funace bOption7= LoadImage( "scriptbank\\ss1\\b_option7.png" ) --survival exp bOption8= LoadImage( "scriptbank\\ss1\\b_option8.png" ) -- tools bOption9= LoadImage( "scriptbank\\ss1\\b_option9.png" ) -- weapons bOption10= LoadImage( "scriptbank\\ss1\\b_option10.png" ) --shelter bOption11= LoadImage( "scriptbank\\ss1\\b_option11.png" ) --food bOption12= LoadImage( "scriptbank\\ss1\\b_option12.png" ) --plant bOption13= LoadImage( "scriptbank\\ss1\\b_option13.png" ) --water bOption14= LoadImage( "scriptbank\\ss1\\b_option14.png" ) --rock bOption15= LoadImage( "scriptbank\\ss1\\b_option15.png" ) --wood bOption16= LoadImage( "scriptbank\\ss1\\b_option16.png" ) --meat bOption17= LoadImage( "scriptbank\\ss1\\b_option17.png" ) --hide bOption18= LoadImage( "scriptbank\\ss1\\b_option18.png" ) -- hammer bOption19= LoadImage( "scriptbank\\ss1\\b_option19.png" ) -- axe bOption20= LoadImage( "scriptbank\\ss1\\b_option20.png" ) --dagger bOption21= LoadImage( "scriptbank\\ss1\\b_option21.png" ) --bow bOption22= LoadImage( "scriptbank\\ss1\\b_option22.png" ) --ammo bOption23= LoadImage( "scriptbank\\ss1\\b_option23.png" ) --berry pie bOption24= LoadImage( "scriptbank\\ss1\\b_option24.png" ) -- berry soup bOption25= LoadImage( "scriptbank\\ss1\\b_option25.png" ) -- meat pie bOption26= LoadImage( "scriptbank\\ss1\\b_option26.png" ) -- meat soup bOption27= LoadImage( "scriptbank\\ss1\\b_option27.png" ) -- shelter bOption28= LoadImage( "scriptbank\\ss1\\b_option28.png" ) -- stove bOption29= LoadImage( "scriptbank\\ss1\\b_option29.png" ) -- workbench bOption30= LoadImage( "scriptbank\\ss1\\tubers.png" ) -- tubers -- started to change these to names rather than button numbers bOption31= LoadImage( "scriptbank\\ss1\\berries.png" )-- berries bOption32= LoadImage( "scriptbank\\ss1\\iron.png" )-- iron bOption33= LoadImage( "scriptbank\\ss1\\copper.png" )-- copper bOption34= LoadImage( "scriptbank\\ss1\\lead.png" )-- lead bOption35= LoadImage( "scriptbank\\ss1\\planks.png" )-- Planks bOption36= LoadImage( "scriptbank\\ss1\\logs.png" )-- logs bOption37= LoadImage( "scriptbank\\ss1\\chems.png" )-- chems1 bOption38= LoadImage( "scriptbank\\ss1\\chems2.png" )-- chems2 bOption39= LoadImage( "scriptbank\\ss1\\chems3.png" )-- chems2 bOption40= LoadImage( "scriptbank\\ss1\\isteel.png" )-- steel ingot bOption41= LoadImage( "scriptbank\\ss1\\pistol.png" )-- Pistols bOption42= LoadImage( "scriptbank\\ss1\\rifle.png" )-- Rifles bOption43= LoadImage( "scriptbank\\ss1\\ammo.png" )-- ammo bOption44= LoadImage( "scriptbank\\ss1\\ammo.png" )-- ammo bOption45= LoadImage( "scriptbank\\ss1\\usepistol.png" )-- use pistol bOption46= LoadImage( "scriptbank\\ss1\\usepistolammo.png" )-- use pistol ammo bOption47= LoadImage( "scriptbank\\ss1\\userifle.png" )-- use rifle bOption48= LoadImage( "scriptbank\\ss1\\userifleammo.png" )-- use rifle ammo bOption49= LoadImage( "scriptbank\\ss1\\title.png" ) --title bOption50= LoadImage( "scriptbank\\ss1\\mushroom.png" ) --mushrooms bOption51= LoadImage( "scriptbank\\ss1\\dressing.png" ) --dressing bOption52= LoadImage( "scriptbank\\ss1\\medikit.png" ) --Medikit bOption53= LoadImage( "scriptbank\\ss1\\pill1.png" ) --pill1 bOption54= LoadImage( "scriptbank\\ss1\\pill2.png" ) --pill1 bOption55= LoadImage( "scriptbank\\ss1\\usebandage.png" ) --use bandage bOption56= LoadImage( "scriptbank\\ss1\\usemedipack.png" ) --use medipack bOption57= LoadImage( "scriptbank\\ss1\\useantidote.png" ) --use antidote bOption58= LoadImage( "scriptbank\\ss1\\usebooster.png" ) --use antidote bOption59= LoadImage( "scriptbank\\ss1\\recipies.png" ) --use antidote -- OK Button as Button nr 4 leave this as is bOkImg= LoadImage( "scriptbank\\ss1\\b_ok.png" ) -- MouseCursor CursorImg = LoadImage ( "scriptbank\\ss1\\cursor.png" ) end function survival_inventory_main(e) ActivateMouse() if GetInKey()=="i" then MouseActive = 1- MouseActive pressed = 1 if MouseActive == 0 then MouseDeactivated() else MouseActivated() end end if g_MouseClick == 0 then pressed = 0 MouseDown=0 end if MouseActive == 1 and pressed == 0 then SetSpritePosition ( Cursor , g_MouseX ,g_MouseY ) if g_MouseClick ==1 and MouseDown==0 then MouseDown=1 MouseClicked() end Panel(0,0,100,88)--background Panel(37,1,61,10)--Top Panel(1,13,49.5,68)-- left Panel(49.5,13,99,68)-- right Panel(55,69,99,86)-- right bottom Panel(1,69,45,86)-- left bottom Panel(78,1,98,10)-- survival exp Panel(1,1,21,10)-- survival exp --menu text plants TextColor(8,20,1,"Fibers "..math.floor(g_fiberscollected),10,255,10) TextColor(20,20,1,"Tubers "..math.floor(g_tuberscollected),10,255,10) TextColor(32,20,1,"Berries "..math.floor(g_berriescollected),10,255,10) TextColor(42,20,1,"Shrooms "..math.floor(g_mushroomscollected),10,255,10) --menu text water TextColor(8,28,1,"Water "..math.floor(g_watercollected),10,255,10) -- menu text minerals TextColor(20,36,1,"Iron "..math.floor(g_ironscollected),10,255,10) TextColor(8,36,1,"Flint "..math.floor(g_flintcollected),10,255,10) TextColor(32,36,1,"Copper "..math.floor(g_copperscollected),10,255,10) TextColor(43,36,1,"Lead "..math.floor(g_leadcollected),10,255,10) -- menu text Chems TextColor(8,52,1,"Sulphur "..math.floor(g_sulphurcollected),10,255,10) TextColor(20,52,1,"Saltpeter "..math.floor(g_saltpetercollected),10,255,10) TextColor(32,52,1,"Carbon "..math.floor(g_carboncollected),10,255,10) -- menu text wood TextColor(8,44,1,"Wood "..math.floor(g_woodcollected),10,255,10) TextColor(20,44,1,"Planks "..math.floor(g_planks_made),10,255,10) TextColor(32,44,1,"Logs "..math.floor(g_logs_made),10,255,10) -- menu text meat TextColor(20,28,1,"Meat "..math.floor(g_meatcollected),10,255,10) -- menu text Skins TextColor(32,28,1,"Hides "..math.floor(g_hidecollected),10,255,10) -- menu text tools TextColor(57,20,1,"Hammers Crafted "..math.floor(g_fhammer),10,255,10) TextColor(81,20,1,"Axe's Crafted "..math.floor(g_faxe),10,255,10) --menu text weapons and ammo TextColor(57,30,1,"Daggers Crafted "..math.floor(g_fdagger),10,255,10) TextColor(81,30,1,"Bows Crafted "..math.floor(g_ibow),10,255,10) TextColor(81,34,1,"Arrows Crafted "..math.floor(g_arrow),10,255,10) --menu text housing TextColor(57,45,1,"Shelters Crafted "..math.floor(g_shelter),10,255,10) TextColor(81,43,1,"Stove Crafted "..math.floor(g_cooker),10,255,10) TextColor(81,47,1,"Workbench Crafted "..math.floor(g_workbench),10,255,10) TextColor(57,51,1,"Furnace Crafted "..math.floor(g_furnace),10,255,10) TextColor(57,39,1,"Lathe Crafted "..math.floor(g_lathe),10,255,10) -- menu text food TextColor(57,57,1,"Berry pies crafted "..math.floor(g_berry_pie),10,255,10) TextColor(81,57,1,"Berry soup crafted "..math.floor(g_berry_soup),10,255,10) TextColor(57,61,1,"Meat Pies crafted "..math.floor(g_meat_pie),10,255,10) TextColor(81,61,1,"Meat soup crafted "..math.floor(g_meat_soup),10,255,10) -- menu text ingots TextColor(8,61,1,"Iron(i) "..math.floor(g_iingot),10,255,10) TextColor(19,61,1,"Lead(i) "..math.floor(g_lingot),10,255,10) TextColor(32,61,1,"Copper(i) "..math.floor(g_cingot),10,255,10) TextColor(43,61,1,"Steel(i) "..math.floor(g_singot),10,255,10) -- Advanced Weapons TextColor(64,75,1,"Pistols "..math.floor(g_pistol),10,255,10) TextColor(64,83,1,"Rifles "..math.floor(g_rifle),10,255,10) TextColor(82,75,1,"Pistol Ammo "..math.floor(g_pistol_ammo),10,255,10) TextColor(82,83,1,"Rifle Ammo "..math.floor(g_rifle_ammo),10,255,10) --menu text experience TextColor(95,5,1,""..math.floor(g_exp),10,255,10) -- Meds TextColor(10,75,1,"Bandages "..math.floor(g_bandages),10,255,10) TextColor(10,83,1,"Medipacks "..math.floor(g_medipack),10,255,10) TextColor(30,75,1,"Antidote "..math.floor(g_antidote),10,255,10) TextColor(30,83,1,"Boosters "..math.floor(g_booster),10,255,10) else DeactivateMouse() end end function ShowMouseCoords() -- for if you need to know them Prompt ("X :"..g_MouseX.." Y:"..g_MouseY) end function MouseActivated() -- init dialog -- icons -- Menu Buttons -- if you add a new image as above you need to edit the last button line to match just copy and paste and change -- Setup the Buttons in an Array Buttons[1] = {} -- create a new Button Buttons[1][1] = 3 --x top left Buttons[1][2] = 59 --y top left Buttons[1][3] = 10 --width Buttons[1][4] = 6 --height Buttons[1][5] = CreateSprite (bOption1) -- Image to use Buttons[2] = {} -- create a new Button Buttons[2][1] = 15 --x top left Buttons[2][2] = 59 --y top left Buttons[2][3] = 20 --width Buttons[2][4] = 6 --height Buttons[2][5] = CreateSprite (bOption2) Buttons[3] = {} -- create a new Button Buttons[3][1] = 27 --x top left Buttons[3][2] = 59 --y top left Buttons[3][3] = 20 --width Buttons[3][4] = 6 --height Buttons[3][5] = CreateSprite (bOption3) Buttons[4] = {} -- create a new Button (exit) Buttons[4][1] = 47 --x top left Buttons[4][2] = 69 --y top left Buttons[4][3] = 20 --width Buttons[4][4] = 6 --height Buttons[4][5] = CreateSprite (bOkImg) Buttons[5] = {} -- create a new Button Buttons[5][1] = 72 --x top left Buttons[5][2] = 38 --y top left Buttons[5][3] = 20 --width Buttons[5][4] = 6 --height Buttons[5][5] = CreateSprite (bOption5) Buttons[6] = {} -- create a new Button Buttons[6][1] = 72 --x top left Buttons[6][2] = 50 --y top left Buttons[6][3] = 30 --width Buttons[6][4] = 6 --height Buttons[6][5] = CreateSprite (bOption6) Buttons[7] = {} -- create a new Button Buttons[7][1] = 80 --x top left Buttons[7][2] = 3 --y top left Buttons[7][3] = 30 --width Buttons[7][4] = 6 --height Buttons[7][5] = CreateSprite (bOption7) -- Menu icons Buttons[8] = {} -- create a new Button Buttons[8][1] = 52 --x top left Buttons[8][2] = 18 --y top left Buttons[8][3] = 40 --width Buttons[8][4] = 6 --height Buttons[8][5] = CreateSprite (bOption8) Buttons[9] = {} -- create a new Button Buttons[9][1] = 52 --x top left Buttons[9][2] = 30 --y top left Buttons[9][3] = 20 --width Buttons[9][4] = 6 --height Buttons[9][5] = CreateSprite (bOption9) Buttons[10] = {} -- create a new Button Buttons[10][1] = 52 --x top left Buttons[10][2] = 43 --y top left Buttons[10][3] = 20 --width Buttons[10][4] = 6 --height Buttons[10][5] = CreateSprite (bOption10) Buttons[11] = {} -- create a new Button Buttons[11][1] = 52 --x top left Buttons[11][2] = 57 --y top left Buttons[11][3] = 20 --width Buttons[11][4] = 6 --height Buttons[11][5] = CreateSprite (bOption11) Buttons[12] = {} -- create a new Button Buttons[12][1] = 3 --x top left Buttons[12][2] = 18 --y top left Buttons[12][3] = 20 --width Buttons[12][4] = 6 --height Buttons[12][5] = CreateSprite (bOption12) Buttons[13] = {} -- create a new Button Buttons[13][1] = 3 --x top left Buttons[13][2] = 26 --y top left Buttons[13][3] = 20 --width Buttons[13][4] = 6 --height Buttons[13][5] = CreateSprite (bOption13) Buttons[14] = {} -- create a new Button Buttons[14][1] = 3 --x top left Buttons[14][2] = 34 --y top left Buttons[14][3] = 20 --width Buttons[14][4] = 6 --height Buttons[14][5] = CreateSprite (bOption14) Buttons[15] = {} -- create a new Button Buttons[15][1] = 3 --x top left Buttons[15][2] = 42 --y top left Buttons[15][3] = 20 --width Buttons[15][4] = 6 --height Buttons[15][5] = CreateSprite (bOption15) Buttons[16] = {} -- create a new Button Buttons[16][1] = 15 --x top left Buttons[16][2] = 26 --y top left Buttons[16][3] = 20 --width Buttons[16][4] = 6 --height Buttons[16][5] = CreateSprite (bOption16) Buttons[17] = {} -- create a new Button Buttons[17][1] = 27 --x top left Buttons[17][2] = 26 --y top left Buttons[17][3] = 20 --width Buttons[17][4] = 6 --height Buttons[17][5] = CreateSprite (bOption17) -- Menu icons end -- Use Buttons Buttons[18] = {} -- create a new Button Buttons[18][1] = 72 --x top left Buttons[18][2] = 19 --y top left Buttons[18][3] = 20 --width Buttons[18][4] = 6 --height Buttons[18][5] = CreateSprite (bOption18) Buttons[19] = {} -- create a new Button Buttons[19][1] = 95 --x top left Buttons[19][2] = 19 --y top left Buttons[19][3] = 20 --width Buttons[19][4] = 6 --height Buttons[19][5] = CreateSprite (bOption19) Buttons[20] = {} -- create a new Button Buttons[20][1] = 72 --x top left Buttons[20][2] = 29 --y top left Buttons[20][3] = 20 --width Buttons[20][4] = 6 --height Buttons[20][5] = CreateSprite (bOption20) Buttons[21] = {} -- create a new Button Buttons[21][1] = 95 --x top left Buttons[21][2] = 29 --y top left Buttons[21][3] = 20 --width Buttons[21][4] = 6 --height Buttons[21][5] = CreateSprite (bOption21) Buttons[22] = {} -- create a new Button Buttons[22][1] = 95 --x top left Buttons[22][2] = 33 --y top left Buttons[22][3] = 20 --width Buttons[22][4] = 6 --height Buttons[22][5] = CreateSprite (bOption22) Buttons[23] = {} -- create a new Button Buttons[23][1] = 72 --x top left Buttons[23][2] = 56 --y top left Buttons[23][3] = 20 --width Buttons[23][4] = 6 --height Buttons[23][5] = CreateSprite (bOption23) Buttons[24] = {} -- create a new Button Buttons[24][1] = 95 --x top left Buttons[24][2] = 56 --y top left Buttons[24][3] = 20 --width Buttons[24][4] = 6 --height Buttons[24][5] = CreateSprite (bOption24) Buttons[25] = {} -- create a new Button Buttons[25][1] = 72 --x top left Buttons[25][2] = 60 --y top left Buttons[25][3] = 20 --width Buttons[25][4] = 6 --height Buttons[25][5] = CreateSprite (bOption25) Buttons[26] = {} -- create a new Button Buttons[26][1] = 95 --x top left Buttons[26][2] = 60 --y top left Buttons[26][3] = 20 --width Buttons[26][4] = 6 --height Buttons[26][5] = CreateSprite (bOption26) Buttons[27] = {} -- create a new Button Buttons[27][1] = 72 --x top left Buttons[27][2] = 44 --y top left Buttons[27][3] = 20 --width Buttons[27][4] = 6--height Buttons[27][5] = CreateSprite (bOption27) Buttons[28] = {} -- create a new Button Buttons[28][1] = 95 --x top left Buttons[28][2] = 42 --y top left Buttons[28][3] = 20 --width Buttons[28][4] = 6 --height Buttons[28][5] = CreateSprite (bOption28) Buttons[29] = {} -- create a new Button Buttons[29][1] = 95 --x top left Buttons[29][2] = 46 --y top left Buttons[29][3] = 20 --width Buttons[29][4] = 6 --height Buttons[29][5] = CreateSprite (bOption29) Buttons[30] = {} -- create a new Button -- newly added icons Buttons[30][1] = 15 --x top left Buttons[30][2] = 18 --y top left Buttons[30][3] = 20 --width Buttons[30][4] = 6 --height Buttons[30][5] = CreateSprite (bOption30) Buttons[31] = {} -- create a new Button Buttons[31][1] = 27 --x top left Buttons[31][2] = 18 --y top left Buttons[31][3] = 20 --width Buttons[31][4] = 6 --height Buttons[31][5] = CreateSprite (bOption31) Buttons[32] = {} -- create a new Button Buttons[32][1] = 15 --x top left Buttons[32][2] = 34 --y top left Buttons[32][3] = 20 --width Buttons[32][4] = 6 --height Buttons[32][5] = CreateSprite (bOption32) Buttons[33] = {} -- create a new Button Buttons[33][1] = 27 --x top left Buttons[33][2] = 34 --y top left Buttons[33][3] = 20 --width Buttons[33][4] = 6 --height Buttons[33][5] = CreateSprite (bOption33) Buttons[34] = {} -- create a new Button Buttons[34][1] = 39 --x top left Buttons[34][2] = 34 --y top left Buttons[34][3] = 20 --width Buttons[34][4] = 6 --height Buttons[34][5] = CreateSprite (bOption34) Buttons[35] = {} -- create a new Button Buttons[35][1] = 15 --x top left Buttons[35][2] = 42 --y top left Buttons[35][3] = 20 --width Buttons[35][4] = 6 --height Buttons[35][5] = CreateSprite (bOption35) Buttons[36] = {} -- create a new Button Buttons[36][1] = 27 --x top left Buttons[36][2] = 42 --y top left Buttons[36][3] = 20 --width Buttons[36][4] = 6 --height Buttons[36][5] = CreateSprite (bOption36) Buttons[37] = {} -- create a new Button Buttons[37][1] = 3 --x top left Buttons[37][2] = 50 --y top left Buttons[37][3] = 20 --width Buttons[37][4] = 6 --height Buttons[37][5] = CreateSprite (bOption37) Buttons[38] = {} -- create a new Button Buttons[38][1] = 15 --x top left Buttons[38][2] = 50 --y top left Buttons[38][3] = 20 --width Buttons[38][4] = 6 --height Buttons[38][5] = CreateSprite (bOption38) Buttons[39] = {} -- create a new Button Buttons[39][1] = 27 --x top left Buttons[39][2] = 50 --y top left Buttons[39][3] = 20 --width Buttons[39][4] = 6 --height Buttons[39][5] = CreateSprite (bOption39) Buttons[40] = {} -- create a new Button Buttons[40][1] = 39 --x top left Buttons[40][2] = 59 --y top left Buttons[40][3] = 20 --width Buttons[40][4] = 6 --height Buttons[40][5] = CreateSprite (bOption40) Buttons[41] = {} -- create a new Button-pistol Buttons[41][1] = 57 --x top left Buttons[41][2] = 73 --y top left Buttons[41][3] = 20 --width Buttons[41][4] = 6 --height Buttons[41][5] = CreateSprite (bOption41) Buttons[42] = {} -- create a new Button -rifle Buttons[42][1] = 57 --x top left Buttons[42][2] = 80 --y top left Buttons[42][3] = 20 --width Buttons[42][4] = 6 --height Buttons[42][5] = CreateSprite (bOption42) Buttons[43] = {} -- create a new Button pistol ammo Buttons[43][1] = 77 --x top left Buttons[43][2] = 73 --y top left Buttons[43][3] = 20 --width Buttons[43][4] = 6 --height Buttons[43][5] = CreateSprite (bOption43) Buttons[44] = {} -- create a new Button rifle ammo Buttons[44][1] = 77 --x top left Buttons[44][2] = 80 --y top left Buttons[44][3] = 20 --width Buttons[44][4] = 6 --height Buttons[44][5] = CreateSprite (bOption44) Buttons[45] = {} -- create a new Button use pistol Buttons[45][1] = 70 --x top left Buttons[45][2] = 74 --y top left Buttons[45][3] = 20 --width Buttons[45][4] = 6 --height Buttons[45][5] = CreateSprite (bOption45) Buttons[46] = {} -- create a new Button use pistol ammo Buttons[46][1] = 91 --x top left Buttons[46][2] = 74 --y top left Buttons[46][3] = 20 --width Buttons[46][4] = 6 --height Buttons[46][5] = CreateSprite (bOption46) Buttons[47] = {} -- create a new Button use rifle Buttons[47][1] = 70 --x top left Buttons[47][2] = 82 --y top left Buttons[47][3] = 20 --width Buttons[47][4] = 6 --height Buttons[47][5] = CreateSprite (bOption47) Buttons[48] = {} -- create a new Button use rifle Buttons[48][1] = 91 --x top left Buttons[48][2] = 82 --y top left Buttons[48][3] = 20 --width Buttons[48][4] = 6 --height Buttons[48][5] = CreateSprite (bOption48) Buttons[49] = {} -- create a new Button use rifle Buttons[49][1] = 38--x top left Buttons[49][2] = 0 --y top left Buttons[49][3] = 20 --width Buttons[49][4] = 6 --height Buttons[49][5] = CreateSprite (bOption49) ---title Buttons[50] = {} -- create a new Button use rifle Buttons[50][1] = 39--x top left Buttons[50][2] = 18 --y top left Buttons[50][3] = 20 --width Buttons[50][4] = 6 --height Buttons[50][5] = CreateSprite (bOption50) ---mushrooms Buttons[51] = {} Buttons[51][1] = 5 --x top left Buttons[51][2] = 73 --y top left Buttons[51][3] = 20 --width Buttons[51][4] = 6 --height Buttons[51][5] = CreateSprite (bOption51) ---dressing Buttons[52] = {} Buttons[52][1] = 5 --x top left Buttons[52][2] = 80 --y top left Buttons[52][3] = 20 --width Buttons[52][4] = 6 --height Buttons[52][5] = CreateSprite (bOption52) ---medikit Buttons[53] = {} Buttons[53][1] = 25 --x top left Buttons[53][2] = 73 --y top left Buttons[53][3] = 20 --width Buttons[53][4] = 6 --height Buttons[53][5] = CreateSprite (bOption53) --pill1 Buttons[54] = {} Buttons[54][1] = 25 --x top left Buttons[54][2] = 80 --y top left Buttons[54][3] = 20 --width Buttons[54][4] = 6 --height Buttons[54][5] = CreateSprite (bOption54) --pill2 Buttons[55] = {} Buttons[55][1] = 20 --x top left Buttons[55][2] = 74 --y top left Buttons[55][3] = 20 --width Buttons[55][4] = 6 --height Buttons[55][5] = CreateSprite (bOption55) ---use dressing Buttons[56] = {} Buttons[56][1] = 20 --x top left Buttons[56][2] = 82 --y top left Buttons[56][3] = 20 --width Buttons[56][4] = 6 --height Buttons[56][5] = CreateSprite (bOption56) --- use medikit Buttons[57] = {} Buttons[57][1] = 38 --x top left Buttons[57][2] = 74 --y top left Buttons[57][3] = 20 --width Buttons[57][4] = 6 --height Buttons[57][5] = CreateSprite (bOption57) --pill1 use antidote Buttons[58] = {} Buttons[58][1] = 38 --x top left Buttons[58][2] = 82 --y top left Buttons[58][3] = 20 --width Buttons[58][4] = 6 --height Buttons[58][5] = CreateSprite (bOption58) --pill2 use booster Buttons[59] = {} Buttons[59][1] = 7 --x top left Buttons[59][2] = 3.5 --y top left Buttons[59][3] = 20 --width Buttons[59][4] = 6 --height Buttons[59][5] = CreateSprite (bOption59) --recipies -- use buttons end -- Set Up Sprite Positions for i=1,MaxButtons do SetSpritePosition ( Buttons[i][5], Buttons[i][1], Buttons[i][2] ) end -- create MouseCursor Cursor= CreateSprite ( CursorImg ) end function MouseDeactivated() DeactivateMouse() MouseActive=0 -- Delete MouseCursor DeleteSprite ( Cursor ) -- clean up dialog pictures -- DeleteSprite ( Dialog ) for i=1,MaxButtons do DeleteSprite( Buttons[i][5] ) end end function MouseClicked() -- Handle Your mouse click events here local bt_clicked=0 for i=1,MaxButtons do if g_MouseX>Buttons[i][1] and g_MouseXButtons[i][2] and g_MouseYOK Button -> leave Dialog leave this one here if bt_clicked==4 then MouseDeactivated() end -- Button 4 clicked if bt_clicked==5 then PromptDuration ("Lathe",3000) end -- Button 6 clicked -- Furnace if bt_clicked==6 then PromptDuration ("Funace",3000) end -- Button 7 clicked if bt_clicked==7 then PromptDuration ("Menu 6",3000) end -- lines below are to tell GG what to actually do when the buttons are pressed e.g copy and paste a section and edit to suit -- use buttons -- Button 18 clicked =hammer if bt_clicked==18 and g_woodcollected >=1 and g_fiberscollected >=1 and g_flintcollected >=1 then AddPlayerWeapon(51) -- number of the Hammer entity goes here g_woodcollected = g_woodcollected - 2 --take items from inventory g_fiberscollected = g_fiberscollected - 2 --take items from inventory g_flintcollected = g_flintcollected -2 --take items from inventory g_fhammer = g_fhammer + 1 -- adds crafted item to inventory for exp g_exp = g_exp + 10 --adds exp N.B you can change this to what you want depending on the complexity of each item PromptDuration ("You Crafted a Hammer",3000) end -- Button 19 clicked =axe if bt_clicked==19 and g_woodcollected >=1 and g_fiberscollected >=1 and g_flintcollected >=1 then AddPlayerWeapon(48) -- number of the Axe entity goes here g_woodcollected = g_woodcollected - 2 --take items from inventory g_fiberscollected = g_fiberscollected - 2 --take items from inventory g_flintcollected = g_flintcollected -2 --take items from inventory g_faxe = g_faxe + 1-- adds crafted item to inventory for exp g_exp = g_exp + 10 --adds exp PromptDuration ("You Crafted an Axe",3000) end -- Button 20 clicked =Dagger if bt_clicked==20 and g_woodcollected >=1 and g_fiberscollected >=1 and g_flintcollected >=1 then AddPlayerWeapon(47) -- number of the Dagger entity goes here g_woodcollected = g_woodcollected - 2 --take items from inventory g_fiberscollected = g_fiberscollected - 2 --take items from inventory g_flintcollected = g_flintcollected -2 --take items from inventory g_fdagger = g_fdagger + 1-- adds crafted item to inventory for exp g_exp = g_exp + 10 --adds exp PromptDuration ("You Crafted a Dagger",3000) end -- Button 21 clicked =Bow if bt_clicked==21 and g_woodcollected >=1 and g_fiberscollected >=1 and g_flintcollected >=1 then AddPlayerWeapon(49) -- number of the Bow entity goes here g_woodcollected = g_woodcollected - 2 --take items from inventory g_fiberscollected = g_fiberscollected - 2 --take items from inventory g_flintcollected = g_flintcollected -2 --take items from inventory g_ibow = g_ibow + 1-- adds crafted item to inventory for exp g_exp = g_exp + 10 --adds exp PromptDuration ("You Crafted a Bow",3000) end -- Button 22 clicked =arrows if bt_clicked==22 and g_woodcollected >=1 and g_fiberscollected >=1 and g_flintcollected >=1 then AddPlayerAmmo(50) -- number of the Arrows entity goes here g_woodcollected = g_woodcollected - 2 --take items from inventory g_fiberscollected = g_fiberscollected - 2 --take items from inventory g_flintcollected = g_flintcollected -2 --take items from inventory g_arrow = g_arrow + 1-- adds crafted item to inventory for exp g_exp = g_exp + 10 --adds exp PromptDuration ("You Crafted 10 Arrows",3000) end -- Button 23 clicked =berry pie if bt_clicked==23 and g_berriescollected >=1 and g_watercollected >=1 and g_tuberscollected >=1 then g_berriescollected = g_berriescollected - 2 -- subtract berries from inventory g_watercollected = g_watercollected -2 -- subtract water from inventory g_berry_pie = g_berry_pie +1 -- add amount of pies made to the inventory SetPlayerHealth(g_PlayerHealth+21)AddPlayerHealth (40) g_exp = g_exp + 10 --adds exp PromptDuration ("Eat Berry Pie",3000) end -- Button 24 clicked =berry soup if bt_clicked==24 and g_berriescollected >=1 and g_watercollected >=1 then g_berriescollected = g_berriescollected - 2 -- subtract berries from inventory g_watercollected = g_watercollected -2 -- subtract water from inventory g_berry_soup = g_berry_soup + 1 SetPlayerHealth(g_PlayerHealth+11)AddPlayerHealth (40) g_exp = g_exp + 10 --adds exp PromptDuration ("You eat some Berry Soup",3000) end -- Button 25 clicked =Meat Pie if bt_clicked==25 and g_berriescollected >=1 and g_watercollected >=1 and g_tuberscollected >=1 and g_meatcollected >=1 then g_berriescollected = g_berriescollected - 2 -- subtract berries from inventory g_watercollected = g_watercollected -2 -- subtract water from inventory g_meatcollected = g_meatcollected -2 -- subtract meat from inventory SetPlayerHealth(g_PlayerHealth+41)AddPlayerHealth (40) g_exp = g_exp + 10 --adds exp PromptDuration ("You Eat Meat & Berry Pie",3000) end -- Button 26 clicked =Meat Soup if bt_clicked==26 and g_watercollected >=1 and g_meatcollected >=1 then g_watercollected = g_watercollected -2 -- subtract water from inventory g_meatcollected = g_meatcollected -2 -- subtract meat from inventory SetPlayerHealth(g_PlayerHealth+31)AddPlayerHealth (40) g_exp = g_exp + 10 --adds exp PromptDuration ("you eat Meat Soup",3000) end -- Button 27 clicked =shelter if bt_clicked==27 and g_woodcollected >=1 and g_fiberscollected >=1 then g_woodcollected = g_woodcollected - 2 --take items from inventory g_fiberscollected = g_fiberscollected - 2 --take items from inventory g_shelter = g_shelter + 1 --add shelter to inventory g_exp = g_exp + 50 --adds exp PromptDuration ("You have crafted a shelter",3000) end -- Button 28 clicked =stove if bt_clicked==28 and g_woodcollected >=1 and g_flintcollected >=1 then g_woodcollected = g_woodcollected - 2 --take items from inventory g_flintcollected = g_flintcollected - 2 --take items from inventory g_camp_fire = g_camp_fire + 1 -- add fire to inventory g_exp = g_exp + 50 --adds exp PromptDuration ("You have crafted a camp Fire ",3000) end -- Button 29 clicked =workbench if bt_clicked==29 and g_woodcollected >=1 and g_flintcollected >=1 and g_ironscollected >=1 then g_woodcollected = g_woodcollected - 2 --take items from inventory g_flintcollected = g_flintcollected - 2 --take items from inventory g_ironscollected = g_ironscollected - 4 --take items from inventory g_workbench = g_workbench + 1 g_exp = g_exp + 100 --adds exp PromptDuration ("You have crafted a Workbench",3000) end -- Button 45 clicked =pistol if bt_clicked==45 then PromptDuration ("Pistol Used",3000) end -- Button 46 clicked =pistol ammo if bt_clicked==46 then PromptDuration ("Pistol Ammo Used",3000) end -- Button 47 clicked =rifle if bt_clicked==47 then PromptDuration ("Rifle Used",3000) end -- Button 48 clicked =rifle ammo if bt_clicked==48 then PromptDuration ("Rifle Ammo Used",3000) end -- Button 55 clicked =Dressing if bt_clicked==55 then PromptDuration ("Dressing Used",3000) end -- Button 56 clicked =Medikit if bt_clicked==56 then PromptDuration ("Medikit Used",3000) end -- Button 57 clicked =Antidote if bt_clicked==57 then PromptDuration ("Antidote Used",3000) end -- Button 58 clicked =Booster if bt_clicked==58 then PromptDuration ("Booster Used",3000) end -- Button 59 clicked =Recipies if bt_clicked==59 then PromptDuration ("Recipies",3000) if GetTimer(e) > 999 then StartTimer(e) secs = secs + 1 if secs > 59 then mins = mins+1 secs = 0 if mins > 59 then hours = hours + 1 mins = 0 if hours > 23 then hours = 0 Text(50,10,3,hours..":"..mins..":"..secs) end end end end end end