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

Customization System


Kemerd
 Share

Recommended Posts

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 #f

End 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 #f

End Sub

[/font][/color]
```
Link to comment
Share on other sites

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 SaveChar

Link 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

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 Long

That? 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

>! 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...