Print Page | Close Window

Gender/Races

Printed From: Mirage Source
Category: Tutorials
Forum Name: Submitted Tutorials
Forum Discription: Tutorial submissions for MSE are posted here, waiting for approval
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=335
Printed Date: 20 December 2006 at 6:04pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Gender/Races
Posted By: SoccerPeter
Subject: Gender/Races
Date Posted: 26 February 2006 at 10:54am
NOT DONE YET

Difficulty
: Medium 4/5

Originaly Posted By: Asrrin29 w/ his Special Thanksto : Romeo
Redone In MSE/Added Races with Gender: SoccerPeter

Server Side

Ok Find this sub " Sub LoadClasses() "

There should be something that looks like this.

Class(i).Sprite = GetVar(FileName, "CLASS" & i, "Sprite")


You need to change this to:


        Class(i).RaceOneMaleSprite = Val(GetVar(FileName, "CLASS" & i, "RaceOneMaleSprite"))
        Class(i).RaceOneFemaleSprite = Val(GetVar(FileName, "CLASS" & i, "RaceOneFemaleSprite"))
        Class(i).RaceTwoMaleSprite = Val(GetVar(FileName, "CLASS" & i, "RaceTwoMaleSprite"))
        Class(i).RaceTwoFemaleSprite = Val(GetVar(FileName, "CLASS" & i, "RaceTwoFemaleSprite"))


Okay now you got to do it for saving the classes if they don't exist.

Find this sub " Sub SaveClasses() "

Look for
Call PutVar(FileName, "CLASS" & i, "Sprite", STR(Class(i).Sprite))


Now you have got to get it to save both MaleSprite and FemaleSprite and the Male and Female Race so change it to:


Call PutVar(FileName, "CLASS" & i, "RaceOneMaleSprite", STR(Class(i).RaceOneMaleSprite))
Call PutVar(FileName, "CLASS" & i, "RaceOneFemaleSprite", STR(Class(i).RaceOneFemaleSprite))
Call PutVar(FileName, "CLASS" & i, "RaceTwoMaleSprite", STR(Class(i).RaceTwoMaleSprite))
Call PutVar(FileName, "CLASS" & i, "RaceTwoFemaleSprite", STR(Class(i).RaceTwoFemaleSprite))


Now find " Type ClassRec "

Now in here it will say..
Sprite As Integer


You need to change this to:

RaceOneMaleSprite As Integer
RaceOneFemaleSprite As Integer
RaceTwoMaleSprite As Integer
RaceTwoFemaleSprite As Integer


OK now.. heheheh.

Find this sub " Sub AddChar "

You will see this 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


Now... this isn't what we want.. we don't want both genders and both races to be the same sprite...

Change the code to this..


    If Player(Index).Char(CharNum).Sex = RACEONE_SEX_MALE Then
        Player(Index).Char(CharNum).RaceOneMaleSprite = Class(ClassNum).RaceOneMaleSprite
    End If
    If Player(Index).Char(CharNum).Sex = RACEONE_SEX_FEMALE Then
        Player(Index).Char(CharNum).RaceOneFemaleSprite = Class(ClassNum).RaceOneFemaleSprite
    End If
    If Player(Index).Char(CharNum).Sex = RACETWO_SEX_MALE Then
        Player(Index).Char(CharNum).RaceTwoMaleSprite = Class(ClassNum).RaceTwoMaleSprite
    End If
   
    If Player(Index).Char(CharNum).Sex = RACETWO_SEX_FEMALE Then
        Player(Index).Char(CharNum).RaceTwoFemaleSprite = Class(ClassNum).RaceTwoFemaleSprite
    End If


In sub clearplayer change
Change Player(Index).Char(i).Sprite = 0


       Player(Index).Char(i).RaceOneMaleSprite = 0
        Player(Index).Char(i).RaceTwoMaleSprite = 0
        Player(Index).Char(i).RaceOneFemaleSprite = 0
        Player(Index).Char(i).RaceTwoFemaleSprite = 0


In Sub ClearChar change

Player(Index).Char(CharNum).Sprite = 0


    Player(Index).Char(CharNum).RaceOneMaleSprite = 0
    Player(Index).Char(CharNum).RaceOneFemaleSprite = 0
    Player(Index).Char(CharNum).RaceTwoMaleSprite = 0
    Player(Index).Char(CharNum).RaceTwoFemaleSprite = 0


And in Sub SavePlayer
change    
all PutVar(FileName, "CHAR" & i, "Sprite", STR(Player(Index).Char(i).Sprite))


Call PutVar(FileName, "CHAR" & i, "RaceOneMaleSprite", STR(Player(Index).Char(i).RaceOneMaleSprite))
        Call PutVar(FileName, "CHAR" & i, "RaceOneFemaleSprite", STR(Player(Index).Char(i).RaceOneFemaleSprite))
        Call PutVar(FileName, "CHAR" & i, "RaceTwoFemaleSprite", STR(Player(Index).Char(i).RaceTwoMaleSprite))
        Call PutVar(FileName, "CHAR" & i, "RaceTwoFemaleSprite", STR(Player(Index).Char(i).RaceTwoFemaleSprite))


Ok in Sub LoadPlayer change

Player(Index).Char(i).Sprite = Val(GetVar(FileName, "CHAR" & i, "Sprite"))


       Player(Index).Char(i).RaceOneMaleSprite = Val(GetVar(FileName, "CHAR" & i, "RaceOneMaleSprite"))
        Player(Index).Char(i).RaceOneFemaleSprite = Val(GetVar(FileName, "CHAR" & i, "RaceOneFemaleSprite"))
        Player(Index).Char(i).RaceTwoMaleSprite = Val(GetVar(FileName, "CHAR" & i, "RaceTwoMaleSprite"))
        Player(Index).Char(i).RaceTwoFemaleSprite = Val(GetVar(FileName, "CHAR" & i, "RaceTwoFemaleSprite"))


ok now find this(because it should only appear once)
Invalid Sex (dont laugh)


change that prevent hackinging If then statement to

           ' Prevent hacking
             If (Sex < RACEONE_SEX_MALE) Or (Sex > RACETWO_SEX_FEMALE) Then
                 Call HackingAttempt(Index, "Invalid Sex (dont laugh)")
                 Exit Sub
             End If


Ok, Now last but not least, this is the most important.. heh

open classes.ini

now you will see your classes.. like this


[CLASS1]
Name=Warrior
Sprite= 9
STR= 1
DEF= 3
SPEED= 3
MAGI= 13


Hmm, this won't work... there is nothing defining the sprite... we'll have to change that.


[CLASS0]
Name=Warrior
RaceOneMaleSprite= 30
RaceOneFemaleSprite= 28
RaceTwoMaleSprite= 1
RaceTwoFemaleSprite= 2
STR= 8
DEF= 7
SPEED= 5
MAGI= 0


Now unto clientside

Find
' Sex constants

Change it to
' Sex constants
Public Const RACEONE_SEX_MALE = 0
Public Const RACEONE_SEX_FEMALE = 1
Public Const RACETWO_SEX_MALE = 2
Public Const RACETWO_SEX_FEMALE = 3

(oh woops and do this with server side also)


now by simply changing what RaceOneMaleSprite, RaceOneFemaleSprite,RaceTwoFemaleSprite,RaceTwoMaleSprite equal you can change the sprite of the gender/race 



good luck =)



Replies:
Posted By: Sync
Date Posted: 26 February 2006 at 12:54pm
Ah, a 1/2 tutorial? lol, I cant approve that. This stays here for completion.



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info