Matt Posted December 15, 2012 Author Share Posted December 15, 2012 This finishing skill system merges with the shop system. By following this tutorial, you will have five finishing skills in your game. These skills will be Smithing, Cooking, Fletching, and Crafting. This has only been tested on 2.0\. I apologize if the explanation at the end is a bit confusing.Lets get started!First off, _**MAKE A BACKUP OF YOUR ENGINE**_Download this and put it into your \gui\main folder[http://www.freemmorp…79e0f943128.jpg](http://www.freemmorpgmaker.com/files/imagehost/pics/ba076be40b65b5d37157679e0f943128.jpg)Now lets go to the server. Go to modTypes and look for Private Type PlayerRec. At the bottom of the rec, put there this.```SmithingXP As LongCookingXP As LongFletchingXP As LongCraftingXP As Long```Now lets go to Private Type ItemRec. At the bottom of the rec, put there this.```SmXP As LongCoXP As LongFlXP As LongCrXP As LongSmRew As LongCoRew As LongFlRew As LongCrRew As Long```Now lets go to Private Type ShopRec. At the bottom of the rec, put there this.```ShopType As Byte```Look for```Function GetPlayerAccess(ByVal index As Long) As Long```and above it put there this```Function GetPlayerSmithingXP(ByVal index As Long) As LongIf index > MAX_PLAYERS Then Exit FunctionGetPlayerSmithingXP = Player(index).SmithingXPEnd FunctionFunction GetPlayerCookingXP(ByVal index As Long) As LongIf index > MAX_PLAYERS Then Exit FunctionGetPlayerCookingXP = Player(index).CookingXPEnd FunctionFunction GetPlayerFletchingXP(ByVal index As Long) As LongIf index > MAX_PLAYERS Then Exit FunctionGetPlayerFletchingXP = Player(index).FletchingXPEnd FunctionFunction GetPlayerCraftingXP(ByVal index As Long) As LongIf index > MAX_PLAYERS Then Exit FunctionGetPlayerCraftingXP = Player(index).CraftingXPEnd Function```Now look for this```Player(index).Level = 1```Underneath it put there this``` Player(index).SmithingXP = 1 Player(index).CookingXP = 1 Player(index).FletchingXP = 1 Player(index).CraftingXP = 1```Now look for this```Buffer.WriteLong GetPlayerPK(index)```Underneath it put there this```Buffer.WriteLong GetPlayerSmithingXP(index)Buffer.WriteLong GetPlayerCookingXP(index)Buffer.WriteLong GetPlayerFletchingXP(index)Buffer.WriteLong GetPlayerCraftingXP(index)```Now look for this sub```Sub HandleBuyItem(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)```In this sub should be code that looks like this```With Shop(shopNum).TradeItem(shopslot) ' check trade exists If .Item < 1 Then Exit Sub ' check has the cost item itemamount = HasItem(index, .costitem) If itemamount = 0 Or itemamount < .costvalue Then PlayerMsg index, "You do not have enough to purchase this item.", BrightRed Exit Sub End If ' it's fine, let's go ahead TakeInvItem index, .costitem, .costvalue GiveInvItem index, .Item, .ItemValueEnd With```Replace that with this```With Shop(shopNum).TradeItem(shopslot) ' check trade exists If .Item < 1 Then Exit Sub ' check has the cost item itemamount = HasItem(index, .costitem) If itemamount = 0 Or itemamount < .costvalue Then ' finishing skill If Shop(shopNum).ShopType = 0 Then PlayerMsg index, "You do not have enough to purchase this item.", BrightRed Else PlayerMsg index, "You do not have enough to make this item.", BrightRed End If Exit Sub End If ' finishing skill If Shop(shopNum).ShopType > 0 Then If Item(Shop(shopNum).TradeItem(shopslot).Item).SmXP > Player(index).SmithingXP Then PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).SmXP - Player(index).SmithingXP & " more smithing experience to make this item.", BrightRed Exit Sub End If If Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP > Player(index).CookingXP Then PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP - Player(index).CookingXP & " more cooking experience to make this item.", BrightRed Exit Sub End If If Item(Shop(shopNum).TradeItem(shopslot).Item).FlXP > Player(index).FletchingXP Then PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).FlXP - Player(index).FletchingXP & " more fletching experience to make this item.", BrightRed Exit Sub End If If Item(Shop(shopNum).TradeItem(shopslot).Item).CrXP > Player(index).CraftingXP Then PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP - Player(index).CraftingXP & " more crafting experience to make this item.", BrightRed Exit Sub End If If Item(Shop(shopNum).TradeItem(shopslot).Item).SmRew > 0 Then Player(index).SmithingXP = Player(index).SmithingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).SmRew End If If Item(Shop(shopNum).TradeItem(shopslot).Item).CoRew > 0 Then Player(index).CookingXP = Player(index).CookingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).CoRew End If If Item(Shop(shopNum).TradeItem(shopslot).Item).FlRew > 0 Then Player(index).FletchingXP = Player(index).FletchingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).FlRew End If If Item(Shop(shopNum).TradeItem(shopslot).Item).CrRew > 0 Then Player(index).CraftingXP = Player(index).CraftingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).CrRew End If SendPlayerData (index) End If TakeInvItem index, .costitem, .costvalue GiveInvItem index, .Item, .ItemValueend with```At the bottom of the same sub should be this```' send confirmation message & reset their shop actionPlayerMsg index, "Trade successful.", BrightGreen```Replace that with this.```If Shop(shopNum).ShopType = 0 Then ' send confirmation message & reset their shop action PlayerMsg index, "Trade successful.", BrightGreenElse PlayerMsg index, "Item made.", BrightGreenEnd If```I believe that should be it, so save and compile.Now to the client!Go to modTypes and look for Private Type PlayerRec. At the bottom of the rec, put there this.```SmithingXP As LongCookingXP As LongFletchingXP As LongCraftingXP As Long```Now lets go to Private Type ItemRec. At the bottom of the rec, put there this.```SmXP As LongCoXP As LongFlXP As LongCrXP As LongSmRew As LongCoRew As LongFlRew As LongCrRew As Long```Now lets go to Private Type ShopRec. At the bottom of the rec, put there this.```ShopType As Byte```Look for```Call SetPlayerPK(i, Buffer.ReadLong)```and put it underneath it this```Call SetPlayerSmithingXP(i, Buffer.ReadLong)Call SetPlayerCookingXP(i, Buffer.ReadLong)Call SetPlayerFletchingXP(i, Buffer.ReadLong)Call SetPlayerCraftingXP(i, Buffer.ReadLong)```Now look for```Sub SetPlayerExp(ByVal Index As Long, ByVal EXP As Long)```And put this above it```Sub SetPlayerSmithingXP(ByVal Index As Long, ByVal SmithingXP As Long)If Index > MAX_PLAYERS Then Exit SubPlayer(Index).SmithingXP = SmithingXPEnd SubSub SetPlayerCookingXP(ByVal Index As Long, ByVal CookingXP As Long)If Index > MAX_PLAYERS Then Exit SubPlayer(Index).CookingXP = CookingXPEnd SubSub SetPlayerFletchingXP(ByVal Index As Long, ByVal FletchingXP As Long)If Index > MAX_PLAYERS Then Exit SubPlayer(Index).FletchingXP = FletchingXPEnd SubSub SetPlayerCraftingXP(ByVal Index As Long, ByVal CraftingXP As Long)If Index > MAX_PLAYERS Then Exit SubPlayer(Index).CraftingXP = CraftingXPEnd Sub```Now go to```Private Sub picShopItems_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)```In this sub should be code like this```If shopItem > 0 Then Select Case ShopAction Case 0 ' no action, give cost With Shop(InShop).TradeItem(shopItem) AddText "You can buy this item for " & .CostValue & " " & Trim$(Item(.CostItem).Name) & ".", White End With Case 1 ' buy item ' buy item code BuyItem shopItem End SelectEnd If```Replace it with this```If shopItem > 0 Then Select Case ShopAction Case 0 ' no action, give cost If Shop(InShop).ShopType = 0 Then With Shop(InShop).TradeItem(shopItem) AddText "You can buy this item for " & .CostValue & " " & Trim$(Item(.CostItem).Name) & ".", White End With End If If Shop(InShop).ShopType = 1 Then With Shop(InShop).TradeItem(shopItem) AddText "You can make this item with " & .CostValue & " " & Trim$(Item(.CostItem).Name) & ".", White End With End If Case 1 ' buy item ' buy item code BuyItem shopItem End SelectEnd If```Now look for```Public Sub OpenShop(ByVal shopnum As Long)```And replace this```InShop = shopnumShopAction = 0frmMain.picCover.Visible = TruefrmMain.picShop.Visible = TrueBltShop```With this```InShop = shopnumShopAction = 0frmMain.picShop.Picture = NothingIf Shop(shopnum).ShopType = 0 Then frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\shop.jpg") frmMain.imgShopSell.Visible = TrueEnd IfIf Shop(shopnum).ShopType = 1 Then frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\anvil.jpg") frmMain.imgShopSell.Visible = FalseEnd IffrmMain.picCover.Visible = TruefrmMain.picShop.Visible = TrueBltShop```Lets go to the forms now.Go to the shop editor form.Make a new scroll bar and label. Name the label lblShopType, and name the scrollbar scrlShopType. Double click the scrollbar and put there this code.```' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerSelect Case scrlShopType.Value Case 0 lblShopType.Caption = "Shop Type: Shop" Case 1 lblShopType.Caption = "Shop Type: Anvil" Case Else lblShopType.Caption = "Shop Type: None"End SelectShop(EditorIndex).ShopType = scrlShopType.Value' Error handlerExit Suberrorhandler:HandleError "scrlBuy_Change", "frmEditor_Shop", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit Sub```Now go to ShopEditorInit and look for this```If frmEditor_Shop.Visible = False Then Exit SubEditorIndex = frmEditor_Shop.lstIndex.ListIndex + 1```and place under it this```frmEditor_Shop.scrlShopType.Value = Shop(EditorIndex).ShopType```Now go to the item editor. Make 8 labels and 8 scrollbars. Name 1 label lblSmithing, name another lblCooking, another lblFletching, and another lblCrafting. As for the last 4 labels, name one lblSmithingRew, name another lblCookingRew, name another lblFletchingRew, and name the last lblCraftingRew.As for the scrollbars, name one scrlSmithing, another scrlCooking, another scrlFletching, another scrlCrafting, another scrlSmithingRew, another scrlCookingRew, another scrlFletchingRew, and the last scrlCraftingRew.Go into the code of your item editor form and put there this.```Private Sub scrlSmithing_Change()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerlblSmithing.Caption = "Smithing: " & scrlSmithing.ValueItem(EditorIndex).SmXP = scrlSmithing.Value' Error handlerExit Suberrorhandler:HandleError "scrlSmithing_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubPrivate Sub scrlCooking_Change()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerlblCooking.Caption = "Cooking: " & scrlCooking.ValueItem(EditorIndex).CoXP = scrlCooking.Value' Error handlerExit Suberrorhandler:HandleError "scrlCooking_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubPrivate Sub scrlFletching_Change()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerlblFletching.Caption = "Fletching: " & scrlFletching.ValueItem(EditorIndex).FlXP = scrlFletching.Value' Error handlerExit Suberrorhandler:HandleError "scrlFletching_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubPrivate Sub scrlCrafting_Change()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerlblCrafting.Caption = "Crafting: " & scrlCrafting.ValueItem(EditorIndex).CrXP = scrlCrafting.Value' Error handlerExit Suberrorhandler:HandleError "scrlCrafting_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubPrivate Sub scrlSmithingRew_Change()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerlblSmithingRew.Caption = "Smithing: " & scrlSmithingRew.ValueItem(EditorIndex).SmRew = scrlSmithingRew.Value' Error handlerExit Suberrorhandler:HandleError "scrlSmithingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubPrivate Sub scrlCookingRew_Change()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerlblCookingRew.Caption = "Cooking: " & scrlCookingRew.ValueItem(EditorIndex).CoRew = scrlCookingRew.Value' Error handlerExit Suberrorhandler:HandleError "scrlCookingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubPrivate Sub scrlFletchingRew_Change()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerlblFletchingRew.Caption = "Fletching: " & scrlFletchingRew.ValueItem(EditorIndex).FlRew = scrlFletchingRew.Value' Error handlerExit Suberrorhandler:HandleError "scrlFletchingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubPrivate Sub scrlCraftingRew_Change()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerlblCraftingRew.Caption = "Crafting: " & scrlCraftingRew.ValueItem(EditorIndex).CrRew = scrlCraftingRew.Value' Error handlerExit Suberrorhandler:HandleError "scrlCraftingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub```Lastly, go into ItemEditorInit and put there this``` frmEditor_Item.scrlSmithing.Value = .SmXP frmEditor_Item.scrlCooking.Value = .CoXP frmEditor_Item.scrlFletching.Value = .FlXP frmEditor_Item.scrlCrafting.Value = .CrXP frmEditor_Item.scrlSmithingRew.Value = .SmRew frmEditor_Item.scrlCookingRew.Value = .CoRew frmEditor_Item.scrlFletchingRew.Value = .FlRew frmEditor_Item.scrlCraftingRew.Value = .CrRew```under this``` frmEditor_Item.scrlRarity.Value = .Rarity```Now let me explain what you should know about this. You can add various different interfaces for your finishing skills. I put there an interface called "anvil" as a default. I'll provide a download link for the image so you can try it out. When you're making items with your finishing skill, you shouldn't be able to sell the item (as it shouldn't be a store). So I made it so that when the skill interface is shown, the selling button is invisible. When the shop interface is shown, the button becomes visible.To set a new interface for a shop (for your finishing skill) is similar to adding a new item object type.Double click on the shop scrlShopType and add there a new case.Go to```Private Sub picShopItems_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)```And add in a message to appear upon clicking an item in the shop/skill interface.Lastly, go to```Public Sub OpenShop(ByVal shopnum As Long)```and code in the gui you want for the interface.You may have noticed you have two types of scrollbars; skill xp requirement (scrlSKILLNAMEHERE) and skill xp reward (scrlSKILLNAMEHERErew).The xp requirement is the requirement to "make" an item (in reality buying it from a shop), and the xp reward is the amount of xp rewarded for successfully "making" (buying) an item in the skill interface (shop).And that should be it! Save, compile, and enjoy. Link to comment Share on other sites More sharing options...
hisherwin Posted December 15, 2012 Share Posted December 15, 2012 What do you mean about Finishing Skill System? Link to comment Share on other sites More sharing options...
Matt Posted December 15, 2012 Author Share Posted December 15, 2012 > What do you mean about Finishing Skill System?My other tutorial for a skill system is for gathering. These skills are Woodcutting, Fishing, and Mining. Once you have wood, what do you do with it? Once you have raw fish, what do you do with it? Once you have ore, what do you do with it? I made this "finishing skill system" so that these gathering skills can enable the player to do more with the items they've gotten from the gathering skills. Link to comment Share on other sites More sharing options...
JohnPony Posted December 15, 2012 Share Posted December 15, 2012 Nice submission,Thanks for your contribution to the community! Link to comment Share on other sites More sharing options...
Matt Posted December 15, 2012 Author Share Posted December 15, 2012 > Nice submission,> > Thanks for your contribution to the community!Thanks General Pony! ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) Link to comment Share on other sites More sharing options...
Ganjika Posted December 16, 2012 Share Posted December 16, 2012 What changes (if any) would need to be made to make this compatible with 3.0 Nightly?UPDATE: Installedit ondragon Eclips (3.0 Nightly) and it works fine (IN TEST-COMPILE only, while trying to actually compile it i gt an rror) without and revisions with the exception of oneerror:i recieve a sub or function not defined at```BltShop```in ModGameLogic(provided below for rference)```Public Sub OpenShop(ByVal shopnum As Long)' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerInShop = shopnumShopAction = 0frmMain.picShop.Picture = NothingIf Shop(shopnum).ShopType = 0 Then frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\shop.jpg") frmMain.imgShopSell.Visible = TrueEnd IfIf Shop(shopnum).ShopType = 1 Then frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\anvil.jpg") frmMain.imgShopSell.Visible = FalseEnd IffrmMain.picCover.Visible = TruefrmMain.picShop.Visible = TrueBltShopfrmMain.picShopItems.Refresh' Error handlerExit Suberrorhandler:HandleError "OpenShop", "modGameLogic", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub```(the line highlighted is the first one: (Private Sub scrlCraftingRew_Change())```Private Sub scrlCraftingRew_Change()' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerlblCraftingRew.Caption = "Crafting: " & scrlCraftingRew.ValueItem(EditorIndex).CrRew = scrlCraftingRew.Value' Error handlerExit Suberrorhandler:HandleError "scrlCraftingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd SubPrivate LastIndex As Long```UPDATE: I deleted 'Private LastIndex As Long'and i couldnt find anything in the tutorial about it - not sure what it was… is/was it important? it works without it. Link to comment Share on other sites More sharing options...
Matt Posted December 16, 2012 Author Share Posted December 16, 2012 > What changes (if any) would need to be made to make this compatible with 3.0 Nightly?> > UPDATE: Installedit ondragon Eclips (3.0 Nightly) and it works fine (IN TEST-COMPILE only, while trying to actually compile it i gt an rror) without and revisions with the exception of one> > error:> > i recieve a sub or function not defined at> > ```> > BltShop> > ```> in ModGameLogic> > (provided below for rference)> > ```> > Public Sub OpenShop(ByVal shopnum As Long)> > ' If debug mode, handle error then exit out> > If Options.Debug = 1 Then On Error GoTo errorhandler> > InShop = shopnum> > ShopAction = 0> > frmMain.picShop.Picture = Nothing> > If Shop(shopnum).ShopType = 0 Then> > frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\shop.jpg")> > frmMain.imgShopSell.Visible = True> > End If> > If Shop(shopnum).ShopType = 1 Then> > frmMain.picShop.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\anvil.jpg")> > frmMain.imgShopSell.Visible = False> > End If> > frmMain.picCover.Visible = True> > frmMain.picShop.Visible = True> > BltShop> > frmMain.picShopItems.Refresh> > ' Error handler> > Exit Sub> > errorhandler:> > HandleError "OpenShop", "modGameLogic", Err.Number, Err.Description, Err.Source, Err.HelpContext> > Err.Clear> > Exit Sub> > End Sub> > ```> > (the line highlighted is the first one: (Private Sub scrlCraftingRew_Change())> > ```> > Private Sub scrlCraftingRew_Change()> > ' If debug mode, handle error then exit out> > If Options.Debug = 1 Then On Error GoTo errorhandler> > lblCraftingRew.Caption = "Crafting: " & scrlCraftingRew.Value> > Item(EditorIndex).CrRew = scrlCraftingRew.Value> > ' Error handler> > Exit Sub> > errorhandler:> > HandleError "scrlCraftingRew_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext> > Err.Clear> > Exit Sub> > End Sub> > Private LastIndex As Long> > ```> > UPDATE: I deleted 'Private LastIndex As Long'> > and i couldnt find anything in the tutorial about it - not sure what it was… is/was it important? it works without it.Private LastIndex as Long isn't in the tutorial at all.In your old OpenShop sub, look for something referring to DD8 (I assume nightly uses this) and shops. Use that instead of BltShops. If there isn't anything, then remove BltShop. Link to comment Share on other sites More sharing options...
Ganjika Posted December 16, 2012 Share Posted December 16, 2012 Thanks for your response (as well as this and pas contributions as well) -I removed bltshop +I now get a method or data member not found at .scrlShopType in 'modeditorscode' in:(highlighted is ".scrlShopType")(UPDATE: might have missed a few things (forgot to create label as well as to properly name the scrollbar (both in scrlShopType) -It now compiles so i will try it out and see how it goes, on a quick note - how do i utilize the items once they are made?```' /////////////////' // Shop Editor //' /////////////////Public Sub ShopEditorInit()Dim i As Long' If debug mode, handle error then exit outIf Options.Debug = 1 Then On Error GoTo errorhandlerIf frmEditor_Shop.Visible = False Then Exit SubfrmEditor_Shop.scrlShopType.Value = Shop(EditorIndex).ShopTypeEditorIndex = frmEditor_Shop.lstIndex.ListIndex + 1frmEditor_Shop.txtName.text = Trim$(Shop(EditorIndex).Name)If Shop(EditorIndex).BuyRate > 0 Then frmEditor_Shop.scrlBuy.Value = Shop(EditorIndex).BuyRateElse frmEditor_Shop.scrlBuy.Value = 100End IffrmEditor_Shop.cmbItem.ClearfrmEditor_Shop.cmbItem.AddItem "None"frmEditor_Shop.cmbCostItem.ClearfrmEditor_Shop.cmbCostItem.AddItem "None"For i = 1 To MAX_ITEMS frmEditor_Shop.cmbItem.AddItem i & ": " & Trim$(Item(i).Name) frmEditor_Shop.cmbCostItem.AddItem i & ": " & Trim$(Item(i).Name)NextfrmEditor_Shop.cmbItem.ListIndex = 0frmEditor_Shop.cmbCostItem.ListIndex = 0UpdateShopTradeShop_Changed(EditorIndex) = True' Error handlerExit Suberrorhandler:HandleError "ShopEditorInit", "modGameEditors", Err.Number, Err.Description, Err.Source, Err.HelpContextErr.ClearExit SubEnd Sub``` Link to comment Share on other sites More sharing options...
Matt Posted December 16, 2012 Author Share Posted December 16, 2012 > It now compiles so i will try it out and see how it goes, on a quick note - how do i utilize the items once they are made?Ah yes! I forgot to add this information.You may have noticed you have two types of scrollbars; skill xp requirement (scrlSKILLNAMEHERE) and skill xp reward (scrlSKILLNAMEHERErew).The xp requirement is the requirement to "make" an item (in reality buying it from a shop), and the xp reward is the amount of xp rewarded for successfully "making" (buying) an item in the skill interface (shop). Hope that sheds some light on your question. I'll add this bit to the tutorial now.EDIT:Just realized I missed out something important.Go to sub HandleBuyItem (server sided) and replace your entire With Shop(shopNum).tradeitem(shopslot) with this```With Shop(shopNum).TradeItem(shopslot) ' check trade exists If .Item < 1 Then Exit Sub ' check has the cost item itemamount = HasItem(index, .costitem) If itemamount = 0 Or itemamount < .costvalue Then ' finishing skill If Shop(shopNum).ShopType = 0 Then PlayerMsg index, "You do not have enough to purchase this item.", BrightRed Else PlayerMsg index, "You do not have enough to make this item.", BrightRed End If Exit Sub End If ' finishing skill If Shop(shopNum).ShopType > 0 Then If Item(Shop(shopNum).TradeItem(shopslot).Item).SmXP > Player(index).SmithingXP Then PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).SmXP - Player(index).SmithingXP & " more smithing experience to make this item.", BrightRed Exit Sub End If If Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP > Player(index).CookingXP Then PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP - Player(index).CookingXP & " more cooking experience to make this item.", BrightRed Exit Sub End If If Item(Shop(shopNum).TradeItem(shopslot).Item).FlXP > Player(index).FletchingXP Then PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).FlXP - Player(index).FletchingXP & " more fletching experience to make this item.", BrightRed Exit Sub End If If Item(Shop(shopNum).TradeItem(shopslot).Item).CrXP > Player(index).CraftingXP Then PlayerMsg index, "You need " & Item(Shop(shopNum).TradeItem(shopslot).Item).CoXP - Player(index).CraftingXP & " more crafting experience to make this item.", BrightRed Exit Sub End If If Item(Shop(shopNum).TradeItem(shopslot).Item).SmRew > 0 Then Player(index).SmithingXP = Player(index).SmithingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).SmRew End If If Item(Shop(shopNum).TradeItem(shopslot).Item).CoRew > 0 Then Player(index).CookingXP = Player(index).CookingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).CoRew End If If Item(Shop(shopNum).TradeItem(shopslot).Item).FlRew > 0 Then Player(index).FletchingXP = Player(index).FletchingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).FlRew End If If Item(Shop(shopNum).TradeItem(shopslot).Item).CrRew > 0 Then Player(index).CraftingXP = Player(index).CraftingXP + Item(Shop(shopNum).TradeItem(shopslot).Item).CrRew End If SendPlayerData (index) End If TakeInvItem index, .costitem, .costvalue GiveInvItem index, .Item, .ItemValueend with```The main tutorial has been fixed as well. Link to comment Share on other sites More sharing options...
Ganjika Posted December 20, 2012 Share Posted December 20, 2012 encountered a subscript out of range when trying to cmbine a two items.(highligheted (in modHandleData)```If Item(Shop(shopNum).TradeItem(.Item).Item).SmXP > Player(index).SmithingXP Then```Aside from that the only other bug is the fact that gold doesn't exist and cant be created or used/traded in shops. Link to comment Share on other sites More sharing options...
Matt Posted December 20, 2012 Author Share Posted December 20, 2012 What two items? Link to comment Share on other sites More sharing options...
Ganjika Posted December 20, 2012 Share Posted December 20, 2012 Its two items set as a 'price' to 'create' another in the anvil. When i try i get a subscript out of range. Link to comment Share on other sites More sharing options...
Matt Posted December 21, 2012 Author Share Posted December 21, 2012 Did you make any changes in the code? Because I got it working for you just fine on teamviewer. Link to comment Share on other sites More sharing options...
nazhana95 Posted March 7, 2013 Share Posted March 7, 2013 ![](http://www.freemmorpgmaker.com/files/imagehost/pics/93278456366dea9e1369ec879f22819e.png)I tried many times correcting the bug and do all over again your tutorial but none of my effort is successplz help me to fix it ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) Link to comment Share on other sites More sharing options...
Matt Posted March 10, 2013 Author Share Posted March 10, 2013 > I tried many times correcting the bug and do all over again your tutorial but none of my effort is success> > plz help me to fix it ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png)Well, its saying that the value does not exist. Are you sure the scrollbar is called scrlSmithing? Link to comment Share on other sites More sharing options...
nazhana95 Posted March 10, 2013 Share Posted March 10, 2013 > Well, its saying that the value does not exist. Are you sure the scrollbar is called scrlSmithing?I checked all the value and I think none of them misstyping…but thx for the answer I will check it again... Link to comment Share on other sites More sharing options...
Matt Posted March 10, 2013 Author Share Posted March 10, 2013 > I checked all the value and I think none of them misstyping…> > but thx for the answer I will check it again...Let me know what happens. Link to comment Share on other sites More sharing options...
Kemerd Posted March 11, 2013 Share Posted March 11, 2013 Really good tutorial! Works wonderfully on Eclipse Nightly! Link to comment Share on other sites More sharing options...
Matt Posted March 11, 2013 Author Share Posted March 11, 2013 > Really good tutorial! Works wonderfully on Eclipse Nightly!Thank you! ![^_^](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/happy.png) Let me know if you run into any problems! Link to comment Share on other sites More sharing options...
nazhana95 Posted March 14, 2013 Share Posted March 14, 2013 > Let me know what happens.As you have replied to me about the scrl- code, I've relized that I missplacing between the combo box and the scroll bar XDSo for the conclusion;all the value without "Rew" at the back is the lvl needed to harvest the resourcesand all the value with "Rew" at the back is the EXP will receive when harvest the resourcesgreat tut anyway but I have some suggestion;why don't you make tut of system that will use two types of items to get one product?it would be epic! Link to comment Share on other sites More sharing options...
Matt Posted March 14, 2013 Author Share Posted March 14, 2013 > As you have replied to me about the scrl- code, I've relized that I missplacing between the combo box and the scroll bar XD> > So for the conclusion;> > all the value without "Rew" at the back is the lvl needed to harvest the resources> > and all the value with "Rew" at the back is the EXP will receive when harvest the resources> > great tut anyway but I have some suggestion;> > why don't you make tut of system that will use two types of items to get one product?> > it would be epic!*ahum*[http://www.touchofde…em/#entry870781](http://www.touchofdeathforums.com/community/index.php?/topic/130991-eo-shop-multiple-item-cost-system/#entry870781) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now