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

damian666

Members
  • Posts

    1632
  • Joined

  • Last visited

    Never

Everything posted by damian666

  1. sigh… so close xd gimme your source again ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png) ill have to debug.
  2. oh my bad, forgot the = sign xd ``` .Face = Buffer.ReadLong ```
  3. you havent added ``` Private Type ClassRec Name As String * NAME_LENGTH Stat(1 To Stats.Stat_Count - 1) As Byte MaleSprite() As Long FemaleSprite() As Long Face As Long ' For client use Vital(1 To Vitals.Vital_Count - 1) As Long End Type ``` to client did you?
  4. ok, except it doesnt loop, its just 1 face right? now client ``` ' loop-receive data For x = 0 To Z .FemaleSprite(x) = Buffer.ReadLong Next .Face Buffer.ReadLong For x = 1 To Stats.Stat_Count - 1 .Stat(x) = Buffer.ReadLong Next ```
  5. lol no, only need the Buffer.WriteLong Class(i).Face rest was to show where you place it ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons//tongue.png)
  6. server ``` ' loop around sending each sprite For q = 0 To n Buffer.WriteLong Class(i).FemaleSprite(q) Next Buffer.WriteLong Class(i).Face For q = 1 To Stats.Stat_Count - 1 Buffer.WriteLong Class(i).stat(q) Next ``` client ``` .Face Buffer.ReadLong ```
  7. oh come on, your doing good. send Class(i).Face in server, sendclasses, then in client set Class(i).Face with the recieved data from server in HandleClassesData.
  8. ``` Sub SendClasses(ByVal index As Long) Dim packet As String Dim i As Long, n As Long, q As Long Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong SClassesData Buffer.WriteLong Max_Classes For i = 1 To Max_Classes Buffer.WriteString GetClassName(i) Buffer.WriteLong GetClassMaxVital(i, Vitals.HP) Buffer.WriteLong GetClassMaxVital(i, Vitals.MP) ' set sprite array size n = UBound(Class(i).MaleSprite) ' send array size Buffer.WriteLong n ' loop around sending each sprite For q = 0 To n Buffer.WriteLong Class(i).MaleSprite(q) Next ' set sprite array size n = UBound(Class(i).FemaleSprite) ' send array size Buffer.WriteLong n ' loop around sending each sprite For q = 0 To n Buffer.WriteLong Class(i).FemaleSprite(q) Next For q = 1 To Stats.Stat_Count - 1 Buffer.WriteLong Class(i).stat(q) Next Next SendDataTo index, Buffer.ToArray() Set Buffer = Nothing End Sub ``` check that sub serverside. and ``` Sub HandleClassesData(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long) Dim n As Long Dim i As Long Dim Z As Long, x 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.WriteBytes Data() n = 1 ' Max classes Max_Classes = Buffer.ReadLong 'CByte(Parse(n)) ReDim Class(1 To Max_Classes) n = n + 1 For i = 1 To Max_Classes With Class(i) .Name = Buffer.ReadString 'Trim$(Parse(n)) .Vital(Vitals.HP) = Buffer.ReadLong 'CLng(Parse(n + 1)) .Vital(Vitals.MP) = Buffer.ReadLong 'CLng(Parse(n + 2)) ' get array size Z = Buffer.ReadLong ' redim array ReDim .MaleSprite(0 To Z) ' loop-receive data For x = 0 To Z .MaleSprite(x) = Buffer.ReadLong Next ' get array size Z = Buffer.ReadLong ' redim array ReDim .FemaleSprite(0 To Z) ' loop-receive data For x = 0 To Z .FemaleSprite(x) = Buffer.ReadLong Next For x = 1 To Stats.Stat_Count - 1 .Stat(x) = Buffer.ReadLong Next End With n = n + 10 Next Set Buffer = Nothing ' Error handler Exit Sub errorhandler: HandleError "HandleClassesData", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ``` that clientside
  9. check how server sends class data to client, make sure your new option is send too.
  10. not bad, i presume you send the data to the client too?
  11. yes it is… O.o sure, there are some things i didnt mention ,but all code is allready in the engine, just a small copy/paste adjust job.
  12. you should just add a seperate setting to store the face number in. that would be easy, and the simplest way to do it. just add it to the classes rec ``` Private Type ClassRec Name As String * NAME_LENGTH Stat(1 To Stats.Stat_Count - 1) As Byte MaleSprite() As Long FemaleSprite() As Long MaleFace() as long FemaleFace() as long End Type ``` then just add some way to the npc editor to add the face number.
  13. yeah basicly, but those still work too, paperdoll gets drawn ontop of the hair ^^
  14. its due to the color, i changed ``` RenderText Font_Default, Chat(i).text, Camera.Left + 10, (Camera.Bottom - 20) - (i * 20), Chat(i).Colour ``` to ``` RenderText Font_Default, Chat(i).text, Camera.Left + 10, (Camera.Bottom - 20) - (i * 20), White ``` and it works.
  15. k, i added the last fixes, now all should work. ill attach a clean Eo with this system to first post
  16. only thing that errors, is If Player(Index).Sex = SEX_MALE Then Player(Index).Sprite = Class(ClassNum).MaleSprite(Sprite) Else Player(Index).Sprite = Class(ClassNum).FemaleSprite(Sprite) End If server side, should be If Player(Index).Sex = SEX_MALE Then Player(Index).Sprite = Sprite Else Player(Index).Sprite = Sprite End If and client side If frmMenu.optMale.Value = True Then Sprite = Class(frmMenu.cmbClass.ListIndex + 1).MaleSprite(newCharSprite) Else Sprite = Class(frmMenu.cmbClass.ListIndex + 1).FemaleSprite(newCharSprite) End If should be If frmMenu.optMale.Value = True Then Sprite = newCharSprite Else Sprite = newCharSprite End If rest works fine. what did you do to fix it?
  17. paperdolls still work indeed. ill add the tut to a clean eo, gimme a bit to test it.
  18. yep, found it, its sending a long, and it should be a byte, my bad xd function playerdata, buffer.Writelong GetPlayerHair(Index), should be buffer.WriteByte GetPlayerHair(Index)
  19. perhaps a mistake in the function playerdata server side, make sure it sends and then recieves in client the same way. seeying thats where it sends the hair stuff, it could be where it ducks up.
  20. i didnt even come close to that sub xd
  21. try replacing Sprite = Class(frmMenu.cmbClass.ListIndex + 1).MaleSprite(newCharSprite) with Sprite = newCharSprite
  22. yep, ill add it ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons//smile.png)
×
×
  • Create New...