Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Daikonran

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Daikonran's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello guys. So I've been trying to find a tutorial for making a character customization that involves both Hair and Gender instead of just one sprite for EO 2.3\. However most things I found said that it must be programmed and that there is no tutorial out there for how to do it on EO 2.3\. I did however find DJMaxus's tutorial for how to do in CS:DE. I was hoping that perhaps someone could assist in making his tutorial for CS:DE compatible with EO 2.3? Or if that is even possible? Here is a quote of the code from the tutorial. > _**The Code:**_ > > ============== > > **Server Side** > > ============== > > First let's add the "Hair" declaration to the PlayerRec > > In **modTypes** > > Find : **Private Type PlayerRec** > > Find: > > ``` > Level As Byte > ``` > > Underneath it Add: > > ``` > Hair As Long > ``` > > In **modConstants** > > Change **MAX_BUTTONS** Value to equal 39 instead of 35 > > In **modPlayer** > > We're going to add a function and sub that will return the value of and set the hair, could be used for other source edits in the future. > > Find: **Function GetPlayerLevel** > > Above that entire function, add this: > > ``` > Function GetPlayerHair(ByVal index As Long) As Long > > If index MAX_PLAYERS Then Exit Function > > GetPlayerHair = Player(index).Hair > > End Function > > Sub SetPlayerHair(ByVal index As Long, ByVal Hair As Long) > > If index MAX_PLAYERS Then Exit Sub > > Player(index).Hair = Hair > > End Sub > ``` > > In **modDatabase** > > Find the **AddChar** Sub > > We're going to modify our AddChar sub so it can know which hair will be sent from the client, look for this on the same line as the name of the sub: > > ``` > ByVal Sprite As Long > ``` > > Directly after it on the same line, we're going to add this: > > ``` > , ByVal Hair As Long > ``` > > That whole line should look like this: > > ``` > Sub AddChar(ByVal index As Long, ByVal Name As String, ByVal Sex As Byte, ByVal ClassNum As Long, ByVal Sprite As Long, ByVal Hair As Long) > > ``` > > This will set the hair for the player on the server so it can be saved, in the same sub find this: > > ``` > Player(index).Level = 1 > ``` > > Underneath it, add this: > > ``` > Player(index).Hair = Hair > ``` > > The next two additions we'll make are so that the server saves the hair value. > > In the **SavePlayer** sub, > > Find: > > ``` > PutVar filename, "ACCOUNT", "Level", Val(Player(index).Level) > ``` > > Underneath it add this: > > ``` > PutVar filename, "ACCOUNT", "Hair", Val(Player(index).Hair) > ``` > > In the **LoadPlayer** sub, > > Find: > > ``` > Player(index).Level = Val(GetVar(filename, "ACCOUNT", "Level")) > ``` > > Underneath it add this: > > ``` > Player(index).Hair = Val(GetVar(filename, "ACCOUNT", "Hair")) > ``` > > Now we handle the sub that actually receives player data from the client. We need to tell it to read the hair value. > > In **modHandleData** > > Find the **HandleAddChar** sub. > > Find: > > ``` > Dim Sprite As Long > ``` > > Underneath it add this: > > ``` > Dim Hair As Long > ``` > > Find: > > ``` > Sprite = Buffer.ReadLong > ``` > > Underneath it add this: > > ``` > Hair = Buffer.ReadLong > ``` > > Now we tell the AddChar sub to include hair as well > > Find: > > ``` > Call AddChar(index, Name, Sex, Class, Sprite) > ``` > > Replace it with: > > ``` > Call AddChar(index, Name, Sex, Class, Sprite, Hair) > ``` > > In **modServerTCP** > > Find the **PlayerData** function > > Here, were going to send our saved hair value back to the client so it can load it every time. > > Find: > > ``` > Buffer.WriteLong GetPlayerLevel(index) > ``` > > Underneath it add this: > > ``` > Buffer.WriteLong GetPlayerHair(index) > ``` > > That's it for server side! On to the client. > > ============== > > **Client Side** > > ============== > > Doing the same thing as the server hereā€¦ > > In **modTypes** > > Find : **Private Type PlayerRec** > > Find: > > ``` > Level As Byte > ``` > > Underneath it Add: > > ``` > Hair As Long > ``` > > In **modClientTCP** > > Here we'll modify our SendAddChar to include a hair value to send to the server. > > Replace the entire **SendAddChar** sub with this: > > ``` > Public Sub SendAddChar(ByVal name As String, ByVal Sex As Long, ByVal ClassNum As Long, ByVal Sprite As Long, ByVal Hair As Long) > > Dim Buffer As clsBuffer > > ' If debug mode, handle error then exit out > > If Options.Debug = 1 Then On Error GoTo errorhandler > > Set Buffer = New clsBuffer > > Buffer.WriteLong CAddChar > > Buffer.WriteString name > > Buffer.WriteLong Sex > > Buffer.WriteLong ClassNum > > Buffer.WriteLong Sprite > > Buffer.WriteLong Hair > > SendData Buffer.ToArray() > > Set Buffer = Nothing > > ' Error handler > > Exit Sub > > errorhandler: > > HandleError "SendAddChar", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext > > Err.Clear > > Exit Sub > > End Sub > ``` > > In **modDatabase** > > Now we'll add two subs that return or set the hair value. > > Add this to the bottom: > > ``` > Function GetPlayerHair(ByVal index As Long) As Long > > ' If debug mode, handle error then exit out > > If Options.Debug = 1 Then On Error GoTo errorhandler > > If index > MAX_PLAYERS Then Exit Function > > GetPlayerHair = Player(index).Hair > > ' Error handler > > Exit Function > > errorhandler: > > HandleError "GetPlayerSprite", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext > > Err.Clear > > Exit Function > > End Function > > Sub SetPlayerHair(ByVal index As Long, ByVal Hair As Long) > > ' If debug mode, handle error then exit out > > If Options.Debug = 1 Then On Error GoTo errorhandler > > If index > MAX_PLAYERS Then Exit Sub > > Player(index).Hair = Hair > > ' Error handler > > Exit Sub > > errorhandler: > > HandleError "SetPlayerSprite", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext > > Err.Clear > > Exit Sub > > End Sub > ``` > > In **modGlobals** > > Adding in declarations that hold our gender and hair constants, can't remember if the "newCharSex" already exists or not, if it does, ignore it and don't add it. > > Find: > > ``` > ' New char > > Public newCharSprite As Long > > Public newCharClass As Long > ``` > > Underneath it add this: > > ``` > Public newCharSex As Long > > Public newCharHair As Long > ``` > > In **modGeneral** > > Find the **MenuState** sub > > We send our hair constant to the server with our modified SendAddChar sub. Also, we tell it to select the gender we've picked at character creation. > > Find: > > ``` > Call SendAddChar(sChar, SEX_MALE, newCharClass, newCharSprite) > ``` > > And Replace it with: > > ``` > Call SendAddChar(sChar, newCharSex, newCharClass, newCharSprite, newCharHair) > ``` > > In **modHandleData** > > Find the **HandlePlayerData** sub, > > Here we receive the saved hair constant from the server. > > Find: > > ``` > Call SetPlayerLevel(i, Buffer.ReadLong) > ``` > > Underneath it, add this: > > ``` > Call SetPlayerHair(i, Buffer.ReadLong) > ``` > > Add this to the bottom of the entire modGeneral module: > > ``` > Public Sub ChangeGender() > > If newCharSex = SEX_MALE Then > > newCharSex = SEX_FEMALE > > Else > > newCharSex = SEX_MALE > > End If > > End Sub > ``` > > Now we add the graphical functions of hair. > > In **modDirectX8** > > Find: > > ``` > Public Tex_Fader As Long > ``` > > Underneath it add: > > ``` > ' Hair > > Public Tex_Hair() As Long > ``` > > Find: > > ``` > Public Count_Fog As Long > ``` > > Underneath it add this: > > ``` > Public Count_Hair As Long > ``` > > Find: > > ``` > Public Const Path_Fog As String = "\data files\graphics\fog\" > ``` > > Underneath it add: > > ``` > Public Const Path_Hair As String = "\data files\graphics\characters\hair\" > ``` > > Find: > > ``` > ' Surfaces > > Count_Surface = 1 > > Do While FileExist(App.Path & Path_Surface & Count_Surface & ".png") > > ReDim Preserve Tex_Surface(0 To Count_Surface) > > Tex_Surface(Count_Surface).Path = App.Path & Path_Surface & Count_Surface & ".png" > > Count_Surface = Count_Surface + 1 > > Loop > > Count_Surface = Count_Surface - 1 > ``` > > Underneath it add this: > > ``` > ' Hair Textures > > Count_Hair = 1 > > Do While FileExist(App.Path & Path_Hair & Count_Hair & ".png") > > ReDim Preserve Tex_Hair(0 To Count_Hair) > > Tex_Hair(Count_Hair) = SetTexturePath(App.Path & Path_Hair & Count_Hair & ".png") > > Count_Hair = Count_Hair + 1 > > Loop > > Count_Hair = Count_Hair - 1 > ``` > > Find your **DrawPlayer** sub > > Find: > > ``` > RenderTexture Tex_Char(Sprite), ConvertMapX(x), ConvertMapY(y), rec.left, rec.top, rec.Width, rec.height, rec.Width, rec.height > ``` > > Underneath it add this: > > ``` > DrawHair x, y, GetPlayerHair(index), Anim, spritetop > ``` > > Underneath the entire **DrawPlayer** sub, add this: > > ``` > Public Sub DrawHair(ByVal x2 As Long, ByVal y2 As Long, ByVal Hair As Long, ByVal Anim As Long, ByVal spritetop As Long) > > Dim rec As GeomRec > > If Hair < 1 Or Hair > Count_Hair Then Exit Sub > > With rec > > .top = spritetop * (D3DT_TEXTURE(Tex_Hair(Hair)).height / 4) > > .height = (D3DT_TEXTURE(Tex_Hair(Hair)).height / 4) > > .left = Anim * (D3DT_TEXTURE(Tex_Hair(Hair)).Width / 4) > > .Width = (D3DT_TEXTURE(Tex_Hair(Hair)).Width / 4) > > End With > > ' Clip to screen > > If y2 < 0 Then > > With rec > > .top = .top - y2 > > End With > > y2 = 0 > > End If > > If x2 < 0 Then > > With rec > > .left = .left - x2 > > End With > > x2 = 0 > > End If > > RenderTexture Tex_Hair(Hair), ConvertMapX(x2), ConvertMapY(y2), rec.left, rec.top, rec.Width, rec.height, rec.Width, rec.height > > End Sub > ``` > > Up next, we will be moving some things around in the New Character screen, as well as adding in our buttons and defining what they do. > > Find your **DrawNewChar** sub > > Find: > > ``` > ' sprite preview > > sprite = Class(newCharClass).MaleSprite(newCharSprite) > > 'EngineRenderRectangle Tex_Char(sprite), x + 235, y + 123, 32, 0, 32, 32, 32, 32, 32, 32 > > RenderTexture Tex_Char(sprite), x + 235, y + 123, 32, 0, 32, 32, 32, 32 > ``` > > Replace it with this: > > ``` > RenderChar > > RenderTexture Tex_Hair(newCharHair), x + 265, y + 120, 32, 0, 32, 32, 32, 32 > ``` > > This sub will render the correct sprite based on gender on character creation. Above the entire **DrawNewChar** sub, add this: > > ``` > Public Sub RenderChar() > > Dim Sprite As Long > > Dim x As Long > > Dim y As Long > > x = GUIWindow(GUI_MAINMENU).x > > y = GUIWindow(GUI_MAINMENU).y > > If newCharSex = SEX_MALE Then > > Sprite = Class(newCharClass).MaleSprite(newCharSprite) > > Else > > Sprite = Class(newCharClass).FemaleSprite(newCharSprite) > > End If > > RenderTexture Tex_Char(Sprite), x + 265, y + 120, 32, 0, 32, 32, 32, 32 > > End Sub > ``` > > Time to draw our four buttons. Back in the **DrawNewChar** sub, were going to **add this just above the last "End If"** > > ``` > ' position > > For buttonnum = 36 To 39 > > x = GUIWindow(GUI_MAINMENU).x + Buttons(buttonnum).x > > y = GUIWindow(GUI_MAINMENU).y + Buttons(buttonnum).y > > Width = Buttons(buttonnum).Width > > height = Buttons(buttonnum).height > > ' render accept button > > If Buttons(buttonnum).state = 2 Then > > ' we're clicked boyo > > 'EngineRenderRectangle Tex_Buttons_c(Buttons(buttonnum).PicNum), x, y, 0, 0, width, height, width, height, width, height > > RenderTexture Tex_Buttons(Buttons(buttonnum).PicNum), x, y, 0, 0, Width, height, Width, height > > ElseIf (GlobalX >= x And GlobalX = y And GlobalY > ' we're hoverin' > > 'EngineRenderRectangle Tex_Buttons_h(Buttons(buttonnum).PicNum), x, y, 0, 0, width, height, width, height, width, height > > RenderTexture Tex_Buttons(Buttons(buttonnum).PicNum), x, y, 0, 0, Width, height, Width, height > > ' play sound if needed > > If Not lastButtonSound = buttonnum Then > > Play_Sound Sound_ButtonHover > > lastButtonSound = buttonnum > > End If > > Else > > ' we're normal > > 'EngineRenderRectangle Tex_Buttons(Buttons(buttonnum).PicNum), x, y, 0, 0, width, height, width, height, width, height > > RenderTexture Tex_Buttons(Buttons(buttonnum).PicNum), x, y, 0, 0, Width, height, Width, height > > ' reset sound if needed > > If lastButtonSound = buttonnum Then lastButtonSound = 0 > > End If > > Next > ``` > > In **modGeneral** > > Find the **InitialiseGUI** sub > > This is where we defined our buttons, their sizes and position. At the very bottom of the sub but above "End Sub", were going to add in our new buttons: > > ``` > ' main - Select Gender Left > > With Buttons(36) > > .state = 0 'normal > > .x = 175 > > .y = 114 > > .Width = 19 > > .height = 19 > > .visible = True > > .PicNum = 23 > > End With > > ' main - Select Gender Right > > With Buttons(37) > > .state = 0 'normal > > .x = 211 > > .y = 114 > > .Width = 19 > > .height = 19 > > .visible = True > > .PicNum = 24 > > End With > > ' main - Select Hair Left > > With Buttons(38) > > .state = 0 'normal > > .x = 175 > > .y = 141 > > .Width = 19 > > .height = 19 > > .visible = True > > .PicNum = 23 > > End With > > ' main - Select Gender Right > > With Buttons(39) > > .state = 0 'normal > > .x = 211 > > .y = 141 > > .Width = 19 > > .height = 19 > > .visible = True > > .PicNum = 24 > > End With > ``` > > In **modInput** > > Find the **MainMenu_MouseDown** sub > > This will check if we're clicking a button. > > Add this at the bottom before "End Sub" > > ``` > For i = 36 To 39 > > x = GUIWindow(GUI_MAINMENU).x + Buttons(i).x > > y = GUIWindow(GUI_MAINMENU).y + Buttons(i).y > > ' check if we're on the button > > If (GlobalX >= x And GlobalX = y And GlobalY > Buttons(i).state = 2 ' clicked > > End If > > Next > ``` > > Find the **MainMenu_MouseUp** sub > > This will check if we clicked a button and what the button will do once we've clicked it. > > Find: > > ``` > ' reset buttons > > resetClickedButtons > ``` > > Above it, add this: > > ``` > ' Character Customization Buttons > > ' find out which button we're clicking > > For i = 36 To 39 > > x = GUIWindow(GUI_MAINMENU).x + Buttons(i).x > > y = GUIWindow(GUI_MAINMENU).y + Buttons(i).y > > ' check if we're on the button > > If (GlobalX >= x And GlobalX = y And GlobalY > If Buttons(i).state = 2 Then > > ' do stuffs > > Select Case i > > Case 36 > > If curMenu = MENU_NEWCHAR Then > > ' do eet > > ChangeGender > > RenderChar > > End If > > Case 37 > > If curMenu = MENU_NEWCHAR Then > > ' do eet > > ChangeGender > > RenderChar > > End If > > Case 38 > > If curMenu = MENU_NEWCHAR Then > > ' Select Hair > > newCharHair = newCharHair - 1 > > If newCharHair < 0 Then > > newCharHair = Count_Hair > > End If > > End If > > Case 39 > > If curMenu = MENU_NEWCHAR Then > > ' Cycle Hair > > newCharHair = newCharHair + 1 > > If newCharHair > Count_Hair Then > > newCharHair = 1 > > End If > > End If > > End Select > > ' play sound > > Play_Sound Sound_Buttonclick > > End If > > End If > > Next > ``` Thanks, whether or not you can help, for taking the time to read this post. Any help is appreciated
  2. Thanks again, you have been very helpful. I really appreciate it
  3. Wow really? That's the best news I've heard all day! You have no idea how happy that makes me =] Is it possible to add more than 4 choices?
  4. Okay, not sure if this is the right place to post this, if not I apolgize in advance. Idk if anyone is familiar with the moongates from Ultima Online, but that is what I'm looking for. For those who do not know, a moongate was a gate (or warp in the case of EO) that when a player stepped on it would bring up a menu of options of places the player could go. Example: Player walks onto tile, menu appears with "Forest", "Desert", "Town" listed. When the player hit's "Forest" it warps the player to the forest map, if they hit "Town" it would warp them to town. This would make it so a player could warp to multiple places by stepping on one tile and deciding where they wanted to go. I did notice a "Travel Menu" thread for something just like this but it seems outdated and from comments not very functional. Does anyone know of a way to add this into a EO server?
  5. Nevermind, I located the problem, if a mod could please delete this thread when they view it, I apoligize for the pointless thread.
  6. Hey guys, I seem to be experiencing a weird problem and I'm kinda lost on how to fix it. I've added several item sprites to my client/graphics/item folder. Later I realized that only half of the item sprites I added are selectable in the Item Editor. As in, sprites 1-24 show up in the editor but anything pass that isn't showing. Does anyone know why? They are all .bmp. Any help would be greatly appreciated.
  7. I have a question regarding the [Change Sprite] button in character customization (EO). I have added several sprites to my game, and decided to add certain ones for certain classes. I looked on the forums and found out how to, did not seem difficult. However for some reason, when I hit change sprite it will allow the person to cycle through 2-4 of the sprites I assigned for each gender, and the rest are just black (or transparent maybe?). I'm not quite sure why, does anyone know? Here is an example of the code (without the name and stats, just sprite part). Ex: In this one, only the first three sprites are showing, rest are not selectable. **FemaleSprite=26,33,47,63,115,121,195,196,237,291,344,356,407**
  8. Darn =/ Well thanks for your time, it's unfortunate none of it can be salvaged. I guess it's time to start from scratch
  9. Thank you, I appreciate the reply. Do you know if there is a way to possibly use the scripts/maps/configs etc from stable in the new one. I have no problem upgrading, it's just I have a lot of work already completed for stable and would be a shame for it all to be useless
  10. Hey guys, so I'm kinda stumped and need help. My friend recently sent me the source code for a game he wrote in 2009, using the Eclipse Stable Edition Server. I wanted to start working on the project again and to progress it forward. However whenever I try to run the server I encounter an error. At first I had to update my libraries for the mscomct.ocx (I think that was the file name), so I did that, I then registered the file through my cmd prompt, and it said successful. However when I try to turn on the server I am getting an error "error loading script engine". I did my own research on this and from what I gathered, it appears the server was written for a 32 bit computer and I have a 64 bit. So of course, I set off to search for the 64 bit version of Eclipse Stable Edition Server but was rather unsuccessful. Is there a 64 bit version floating around somewhere in cyberspace or was it never created? If the ladder is the answer (there is none), is there a way to upgrade the server into a newer version that is compatible with Windows 7 64 bit? When I say upgrade, I mean to switch servers over but to still use the scripts and maps that I already have that work with the Stable Edition, or if I changed the server if I'd have to start from scratch?
×
×
  • Create New...