JohnPony Posted June 7, 2012 Author Share Posted June 7, 2012 #Things that need to be added:1\. Drag Bank Items To Different Slots.~~*I added a few anti-leech pieces of code, this way you copy + paste kiddies may actually read the code! They aren't hard to find if you just search through the damn code.~~I removed the anti leech until the end of the contest, as soon as the winners have been declared i will add it back in.Ok, first we are going to head over to modDx8 and add this at the bottom:```Public Sub DrawBank()Dim i As Long, x As Long, y As Long, Itemnum As Long, ItemPic As Long, left As Long, top As Long, amount As Long, colour As Long, width As LongDim height As Long width = 480 height = 384 RenderTexture Tex_GUI(41), GUIWindow(GUI_BANK).x, GUIWindow(GUI_BANK).y, 0, 0, width, height, width, height ' render the bank items' are you serous? that is it??? maybe... one sec :D :Polol For i = 1 To MAX_BANK Itemnum = GetBankItemNum(i) If Itemnum > 0 And Itemnum <= MAX_ITEMS Then ItemPic = Item(Itemnum).Pic If ItemPic > 0 And ItemPic <= Count_Item Then top = GUIWindow(GUI_BANK).y + BankTop + ((BankOffsetX + 32) * ((i - 1) \ BankColumns)) left = GUIWindow(GUI_BANK).x + BankLeft + ((BankOffsetY + 32) * (((i - 1) Mod BankColumns))) RenderTexture Tex_Item(ItemPic), left, top, 0, 0, 32, 32, 32, 32 ' If the bank item is in a stack, draw the amount... If GetBankItemValue(i) > 1 Then y = top + 22 x = left - 4 amount = CStr(GetBankItemValue(i)) ' Draw the currency If CLng(amount) < 1000000 Then colour = White ElseIf CLng(amount) > 1000000 And CLng(amount) < 10000000 Then colour = Yellow ElseIf CLng(amount) > 10000000 Then colour = BrightGreen End If RenderText Font_Default, ConvertCurrency(amount), x, y, colour End If End If End If Next DrawBankItemDescEnd Sub```That just handles the bank interface being drawn, along with the items and there amountsNext we are going to add:```Public Sub DrawBankItemDesc()Dim bankNum As Long If Not GUIWindow(GUI_BANK).visible Then Exit Sub bankNum = IsBankItem(GlobalX, GlobalY) If bankNum > 0 Then If bankNum > 0 Then If GetBankItemNum(bankNum) > 0 Then DrawItemDesc GetBankItemNum(bankNum), GUIWindow(GUI_CHARACTER).x - GUIWindow(GUI_DESCRIPTION).width - 10, GUIWindow(GUI_CHARACTER).y End If End If End IfEnd Sub```At the bottom of modDX8Now in modInput lets add:```Public Sub Bank_DoubleClick()Dim bankNum As Long bankNum = IsBankItem(GlobalX, GlobalY) If bankNum > 0 Then ' withdraw item Call WithdrawItem(bankNum, 0) End IfEnd Sub```Below:```Public Sub Shop_DoubleClick()Dim shopSlot As Long shopSlot = IsShopItem(GlobalX, GlobalY) If shopSlot > 0 Then ' buy item code BuyItem shopSlot End IfEnd Sub```Now still in modInput find:```Public Sub HandleDoubleClick()```And in that sub find:``` Case GUI_SHOP```And right below that case add:``` Case GUI_BANK Bank_DoubleClick```Now back into modDX8, find```Public Sub DrawGUI()```And in that sub find:```If GUIWindow(GUI_SHOP).visible Then DrawShop```Below that add:```If GUIWindow(GUI_BANK).visible Then DrawBank```Now in modGameLogic find:```Public Function IsBankItem(ByVal x As Single, ByVal y As Single, Optional ByVal emptySlot As Boolean = False) As Long```Replace that whole sub with:```Public Function IsBankItem(ByVal x As Single, ByVal y As Single, Optional ByVal emptySlot As Boolean = False) As LongDim tempRec As RECT, skipThis As BooleanDim i As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler IsBankItem = 0 For i = 1 To MAX_BANK If Not emptySlot Then If GetBankItemNum(i) <= 0 And GetBankItemNum(i) > MAX_ITEMS Then skipThis = True End If If Not skipThis Then With tempRec .top = GUIWindow(GUI_BANK).x + BankTop + ((BankOffsetY + 32) * ((i - 1) \ BankColumns)) .bottom = .top + PIC_Y .left = GUIWindow(GUI_BANK).y + BankLeft + ((BankOffsetX + 32) * (((i - 1) Mod BankColumns))) .Right = .left + PIC_X End With If x >= tempRec.left And x <= tempRec.Right Then If y >= tempRec.top And y <= tempRec.bottom Then IsBankItem = i Exit Function End If End If End If skipThis = False Next ' Error handler Exit Functionerrorhandler: HandleError "IsBankItem", "frmGameLogic", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit FunctionEnd Function```Now in modClientTcp find:```Public Sub CloseBank()```And below:```Set Buffer = Nothing```Add:``` InBank = False GUIWindow(GUI_BANK).visible = False```In modConstants find:```Public Const GUI_SHOP As Byte = 12```Below it add:```Public Const GUI_BANK As Byte = 13```In modGeneral find:```' 12 - Shop With GUIWindow(GUI_SHOP) .x = 118 .y = 110 .width = 252 .height = 317 .visible = False End With```Below that add: ``` ' 13 - Bank With GUIWindow(GUI_BANK) .x = 118 .y = 110 .width = 480 .height = 384 .visible = False End With```Next in modHandleData find:```Private Sub HandleBank(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)```In that sub below```Next```Add:``` InBank = True GUIWindow(GUI_BANK).visible = True```Finally download the attachment below, now depending on your client's gui graphics you may need to rename it to the next number such as 39 or 40\. And if you have to do that, simple change``` RenderTexture Tex_GUI(Your Bank Gui Number), GUIWindow(GUI_BANK).x, GUIWindow(GUI_BANK).y, 0, 0, width, height, width, height```to your gui bank number.Edit:Forgot, in modDX8 find:```DrawPlayerSpellDesc```in```Public Sub DrawGUI()```And below it add:```DrawBankItemDesc```And in modConstants change```Public Const GUI_Count As Long = 12```to```Public Const GUI_Count As Long = 12```You may also want to add this:``` If GUIWindow(GUI_BANK).visible Then If keyCode = vbKeyEscape Then GUIWindow(GUI_BANK).visible = Not GUIWindow(GUI_BANK).visible InBank = False End If End If```Sorry, i thought i forgot some things xDIll clean up this tutorial ASAP, im just tired tonight…That should be it, if i forgot something, tell me and ill be sure to get it in :)Have a nice day Link to comment Share on other sites More sharing options...
tslusny Posted June 7, 2012 Share Posted June 7, 2012 can you make tutorial for working trade system pls? :DDbut i want to port my game to csde and i cant fix trade system Link to comment Share on other sites More sharing options...
JohnPony Posted June 7, 2012 Author Share Posted June 7, 2012 I may make one, depending on the mood i am in ;] Link to comment Share on other sites More sharing options...
erkro1 Posted June 7, 2012 Share Posted June 7, 2012 @John:> I may make one, depending on the mood i am in ;]All send gifts and chocolate pie's to his house. Link to comment Share on other sites More sharing options...
The New World Posted June 7, 2012 Share Posted June 7, 2012 @John:> I may make one, depending on the mood i am in ;]If you can figure it out without asking for my help then you get a cookie. Link to comment Share on other sites More sharing options...
JohnPony Posted June 7, 2012 Author Share Posted June 7, 2012 @WÑ–ng:> If you can figure it out without asking for my help then you get a cookie.I figured the bank system out, Jc helped me with one fragment of code:```GUIWindow(GUI_BANK).y```Which i forgot to add somehow xD Link to comment Share on other sites More sharing options...
eltony Posted June 7, 2012 Share Posted June 7, 2012 @Deathbeam:> can you make tutorial for working trade system pls? :DDi second that :D Link to comment Share on other sites More sharing options...
JohnPony Posted June 8, 2012 Author Share Posted June 8, 2012 Im working on the trade system right now, i should have it done in a few days. There is just a few things that need to be worked on, and i am kinda lazy about it :/ Link to comment Share on other sites More sharing options...
jcsnider Posted June 8, 2012 Share Posted June 8, 2012 @WÑ–ng:> If you can figure it out without asking for my help then you get a cookie.:P Link to comment Share on other sites More sharing options...
JohnPony Posted June 8, 2012 Author Share Posted June 8, 2012 @jcsnider:> :PIdk what he is talking about, i totally asked jc for help with that one missing piece xDTotally stealing your glory ;]TROLOL:>! ![](http://www.freemmorpgmaker.com/files/imagehost/pics/15fb5263e3dcfebe8a1f0b23bb54b40a.png)Ill finish working on it tomorrow ;] Link to comment Share on other sites More sharing options...
eltony Posted June 9, 2012 Share Posted June 9, 2012 cool i cant wait to see it looks awesome Link to comment Share on other sites More sharing options...
Richy420Rich Posted June 9, 2012 Share Posted June 9, 2012 Haha John. Good tutorial. :P Link to comment Share on other sites More sharing options...
Darknesslighter Posted June 10, 2012 Share Posted June 10, 2012 @John:> *I added a few anti-leech pieces of code, this way you copy + paste kiddies may actually read the code! They aren't hard to find if you just search through the damn code.Hahah, made me laugh :) Link to comment Share on other sites More sharing options...
Ariel Posted June 10, 2012 Share Posted June 10, 2012 Niiiice :) thanks im using !also:```Public Const GUI_Count As Long = 12```to 13 Link to comment Share on other sites More sharing options...
JohnPony Posted June 11, 2012 Author Share Posted June 11, 2012 @Ariel:> Niiiice :) thanks im using !> > also:> ```> Public Const GUI_Count As Long = 12> ```to 13Oh yeah, thanks. Forgot to put that… Link to comment Share on other sites More sharing options...
tslusny Posted June 11, 2012 Share Posted June 11, 2012 Can you post trade system tutorial pls? Link to comment Share on other sites More sharing options...
Ariel Posted June 11, 2012 Share Posted June 11, 2012 You should add in sub handlekeyup``` If GUIWindow(GUI_BANK).visible Then If keyCode = vbKeyEscape Then GUIWindow(GUI_BANK).visible = Not GUIWindow(GUI_BANK).visible InBank = False End If End If``` Link to comment Share on other sites More sharing options...
JohnPony Posted June 11, 2012 Author Share Posted June 11, 2012 Ahh yes, thanks. Don't know how i forgot to add that to the tutorial xD@Deathbeam:> Can you post trade system tutorial pls?Ill release that when i think you guys deserve it. Link to comment Share on other sites More sharing options...
aaaron Posted June 11, 2012 Share Posted June 11, 2012 @General-Pony:> Ill release that when i think you guys deserve it...or before someone else posts it. Link to comment Share on other sites More sharing options...
JohnPony Posted June 11, 2012 Author Share Posted June 11, 2012 @Aáron:> ..or before someone else posts it.Like i care if some one else does. That will save me the trouble of writing the tutorial. Link to comment Share on other sites More sharing options...
aaaron Posted June 11, 2012 Share Posted June 11, 2012 @General-Pony:> Like i care if some one else does. That will save me the trouble of writing the tutorial.True dat. Link to comment Share on other sites More sharing options...
Stein Posted June 11, 2012 Share Posted June 11, 2012 It's fairly simple anyway.. It's the EO trade system with the rendering modified to CS:DE. Anyone that's halfway serious about it *should* be able to pull it off if they want to, or ask for help regarding certain parts of the process. :] Link to comment Share on other sites More sharing options...
JohnPony Posted June 11, 2012 Author Share Posted June 11, 2012 It was literately the easiest thing i have ever done after i figured out how rendering works. I didn't need any help with the trade system. But i admit JC helped me with a fragment in the bank system (Still cannot believe i forgot that xD) Link to comment Share on other sites More sharing options...
BeNjO Posted June 22, 2012 Share Posted June 22, 2012 hi there i put this banking system in and it seems to crash my client when i step on a bank tile. The only thing that pops up is a black box that is ment to be the bank window then it stops responding. Any ideas? Link to comment Share on other sites More sharing options...
JohnPony Posted June 23, 2012 Author Share Posted June 23, 2012 Run the client & server in the IDE and tell me the error it returns. 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