Kemerd Posted March 7, 2013 Author Share Posted March 7, 2013 You know how there was the CS:DE Hair customization tutorial? I got it all converted over. Except the Saveplayer and LoadPlayer subs, in modDatabase.Here's what I was supposed to do.> 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"))So, I tried EVERYTHING. Here's my subs without any added code. I tried putting it in #f, doing all this in the Trim$, and frankly, I don't know what to do. Any help?```Sub SavePlayer(ByVal index As Long) Dim filename As String Dim f As Long[color][font] filename = App.Path & "\data\accounts\" & Trim$(Player(index).Login) & ".bin" f = FreeFile Open filename For Binary As #f Put #f, , Player(index) Close #fEnd Sub[/font][/color][color][font]Sub LoadPlayer(ByVal index As Long, ByVal Name As String) Dim filename As String Dim f As Long Call ClearPlayer(index) f = FreeFile Open filename For Binary As #f Get #f, , Player(index) Close #fEnd Sub[/font][/color]``` Link to comment Share on other sites More sharing options...
Wortel Angels Posted March 7, 2013 Share Posted March 7, 2013 Thats for an .ini ;-)You need to add it on addchar if you got this else search where Player(Index).Name is then you should find something where everything is added what will be saved(I got Multi chars and its waaay back where i used eo 2.0 or 3.0) Link to comment Share on other sites More sharing options...
blkcrow Posted March 7, 2013 Share Posted March 7, 2013 you shouldnt change anything in subs SavePlayer and LoadPlayer just add the variable Hair in the Player UDT Link to comment Share on other sites More sharing options...
Kemerd Posted March 8, 2013 Author Share Posted March 8, 2013 What is player udt? Also, where am I supposed to save/load the hair data?Wait… I get what you're saying.. but where is everything added? (EDIT: Sorry for double-posting. I was using my phone. EDIT EDIT: Thanks mod for fixing it.)Also I have in addChar```Player(index).Hair = Hair```and at the end of the sub, it calls for SaveCharLink to tutorial I'm using. [http://www.touchofdeathforums.com/community/index.php?/topic/123485-csde-character-customization-gender-hair/](http://www.touchofdeathforums.com/community/index.php?/topic/123485-csde-character-customization-gender-hair/)I'm also using Eclispe Reborn, and it could also be used to EO 3.0 (I think.) Link to comment Share on other sites More sharing options...
Ertzel Posted March 8, 2013 Share Posted March 8, 2013 In modTypes you need to add the hair variable to the bottom of```Private Type PlayerRec``` Link to comment Share on other sites More sharing options...
Kemerd Posted March 8, 2013 Author Share Posted March 8, 2013 Thanks. And by that do you mean the original code? What am I supposed to declare as a byte or string or whatever.ByVal Hair As LongThat? Then do I add it in the binary opening the the #f? Where am I supposed to add it? (Sorry, I'm just confused.) Thanks Link to comment Share on other sites More sharing options...
Ertzel Posted March 8, 2013 Share Posted March 8, 2013 You don't have to add it anywhere except for adding```ByVal Hair As Long```at the bottom of```Private Type PlayerRec```The loading/saving does it for the whole rect, so you don't need to change that. Link to comment Share on other sites More sharing options...
Kemerd Posted March 8, 2013 Author Share Posted March 8, 2013 >! So I just declare that… and bam? Cool. Thanks. I'll test it out.>! But I only have>! Public Type TempPlayerRec>! and at the beginning is..>! Public Player(1 To MAX_PLAYERS) As PlayerRec>! I have the error>! [background=rgb(250, 250, 250)]Compile Error: Expected: line number or label or statement or end of statement[/background]>! [background=rgb(250, 250, 250)]It already delclares hair as a long. (before, in the orginal tut) So….[/background]>! [background=rgb(250, 250, 250)]And [/background] Player(index).Hair, is equal to hair with is declared in modPlayer>! ```>! Sub SetPlayerHair(ByVal index As Long, ByVal Hair As Long)>! If index <= 0 Or index > MAX_PLAYERS Then Exit Sub>! [u][b][i] Player(index).Hair = Hair[/i][/b][/u]>! End Sub>! ```>! It's aslo delcared in…>! ```>! 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)>! ``` Ok. I got the server. Now I have a problem with the texture in the client. D383d or something. I'll try to fix it. Thanks! ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) Oh. Just had to replace that with gTexture instead of G3DT… Link to comment Share on other sites More sharing options...
Ertzel Posted March 8, 2013 Share Posted March 8, 2013 I'm very confused by your last post. The stuff in the spoiler says you had a problem but then below it you say the server is working, so which is it? Also yes, if you already added the variable hair to the player rect, then of course you don't need to re-add it…PS, when you post code put it into the code tags and you can't add special things inside code tags like bolded letters. 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