Print Page | Close Window

Gender Tutorial

Printed From: Mirage Source
Category: Tutorials
Forum Name: Temporary Archive (Read Only)
Forum Discription: Temporary 3.0.3 archive tutorials, will be deleted when converted.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=232
Printed Date: 20 December 2006 at 5:53pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Gender Tutorial
Posted By: Sync
Subject: Gender Tutorial
Date Posted: 11 February 2006 at 3:42pm
Difficulty: Medium 4/5

Originaly Posted By: Asrrin29

*special thanks to romeo for this one

This is my first tutorial... I hope it helps out a few people, post to tell me if you like it or not.


BTW.. this is all 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 one and add another..

[code:1:80bb0db5b6] Class(i).MaleSprite = GetVar(FileName, "CLASS" & i, "MaleSprite")
Class(i).FemaleSprite = GetVar(FileName, "CLASS" & i, "FemaleSprite") [/code:1:80bb0db5b6]


Ok now you gotta do it for saving the classes if they don't exist..

Find this sub " Sub SaveClasses() "

Look for
[code:1:80bb0db5b6]Call PutVar(FileName, "CLASS" & i, "Sprite", STR(Class(i).Sprite))[/code:1:80bb0db5b6]

now we gotta get it to save both MaleSprite and FemaleSprite so... change one and add another...

[code:1:80bb0db5b6]
Call PutVar(FileName, "CLASS" & i, "MaleSprite", STR(Class(i).MaleSprite))
Call PutVar(FileName, "CLASS" & i, "FemaleSprite", STR(Class(i).FemaleSprite)) [/code:1:80bb0db5b6]

Alrite... moving on to the next sub

now find " Type ClassRec "

Now in here it will say.. [code:1:80bb0db5b6]Sprite As Integer[/code:1:80bb0db5b6]

You need to change this and add another one (hmm heard that before...)

[code:1:80bb0db5b6]MaleSprite As Integer
FemaleSprite As Integer[/code:1:80bb0db5b6]

OK now.. heheheh.

Find this sub " Sub AddChar "

You will see this code

[code:1:80bb0db5b6]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 [/code:1:80bb0db5b6]

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

Change the code to this..

[code:1:80bb0db5b6]If Player(Index).Char(CharNum).Sex = SEX_MALE Then
Player(Index).Char(CharNum).Sprite = Class(ClassNum).MaleSprite
Else
Player(Index).Char(CharNum).Sprite = Class(ClassNum).FemaleSprite
End If [/code:1:80bb0db5b6]

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

open classes.ini

now you will see your classes.. like this

[code:1:80bb0db5b6]
[CLASS1]
Name=Romeoisgod
Sprite= 9
STR= 1
DEF= 3
SPEED= 3
MAGI= 13
[/code:1:80bb0db5b6]

Hmm, this won't work... there is no MaleSprite and FemaleSprite... we'll have to change that.

[code:1:80bb0db5b6]
[CLASS0]
Name=Romeoisgod
MaleSprite= 30
FemaleSprite= 28
STR= 8
DEF= 7
SPEED= 5
MAGI= 0
[/code:1:80bb0db5b6]


now by simply changing what MaleSprite and FemaleSprite equal you can change the sprite of the gender :P

hehe, I know I'm awesome, alrite, this finishes my FIRST tutorial.. I hope it helps alot...

heh, works alot better than the one that +1 to the sprite

If you have ANY problems, please PM me, or reply here and I'll help you out!

good luck =)



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