Alright, so what this tutorial will basically do is let you choose a sprite for the male version of a class and the female version of a class!
This is all server side too
Go look for the following lines, in modTypes :
Code:
Type ClassRec
Name As String * NAME_LENGTH
Sprite As Integer
Stat(1 To Stats.Stat_Count - 1) As Byte
End Type
and replace the Sprite as Integer with :
Code:
MSprite as Integer
FSprite as Integer
Now, in sub LoadClasses (modDatabase), look for the line :
Code:
Class(i).Sprite = Val(GetVar(FileName, "CLASS" & i, "Sprite"))
and replace it with :
Code:
Class(i).MSprite = Val(GetVar(FileName, "CLASS" & i, "MSprite"))
Class(i).FSprite = Val(GetVar(FileName, "CLASS" & i, "FSprite"))
.
In sub SaveClasses (modDatabase), look for :
Code:
Call PutVar(FileName, "CLASS" & i, "Sprite", CStr(Class(i).Sprite))
and replace it with :
Code:
Call PutVar(FileName, "CLASS" & i, "MSprite", CStr(Class(i).MSprite))
Call PutVar(FileName, "CLASS" & i, "FSprite", CStr(Class(i).FSprite))
So far so good
It's all pretty self explanatory, you're just changing the single sprite variable to two variables, one that holds the female sprite and one that holds the male sprite, and you're properly loading/saving it
Make sure you change (in your classes.ini) :
Quote:
Sprite=###
to :
Quote:
MSprite=Male Sprite ###
FSprite=Female Sprite ###
.
Now, we have to make sure the code in the part where the player is actually assigned the proper sprite. This is done in sub AddChar. Now, MS already has a system like this, but the problem with it is it assigns the player the same sprite, whether the player chooses Male or Female. This is represented by these lines :
Code:
If Player(Index).Char(CharNum).Sex = SEX_MALE Then
Player(Index).Char(CharNum).Sprite = Class(ClassNum).Sprite
Else
Player(Index).Char(CharNum).Sprite = Class(ClassNum).Sprite
End If
Just replace those lines with :
Code:
If Player(Index).Char(CharNum).Sex = SEX_MALE Then
Player(Index).Char(CharNum).Sprite = Class(ClassNum).MSprite
Else
Player(Index).Char(CharNum).Sprite = Class(ClassNum).FSprite
End If
And there you go! You now have a female and male sprite for each class!