Mirage Source http://www.miragesource.net/forums/ |
|
Class Sprite for Male and Female http://www.miragesource.net/forums/viewtopic.php?f=183&t=4433 |
Page 1 of 47 |
Author: | JokeofWeek [ Tue Sep 23, 2008 3:36 am ] |
Post subject: | Class Sprite for Male and Female |
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! |
Author: | timster0 [ Fri Jan 23, 2009 1:14 am ] |
Post subject: | Re: Class Sprite for Male and Female |
How would I make it so when you create a new char you select which sprite you want to be? |
Author: | Forte [ Mon Jan 26, 2009 12:35 am ] |
Post subject: | Re: Class Sprite for Male and Female |
timster0 wrote: How would I make it so when you create a new char you select which sprite you want to be? There's a tutorial for that. Search for it |
Author: | Coke [ Mon Jan 26, 2009 1:11 am ] |
Post subject: | Re: Class Sprite for Male and Female |
timster0 wrote: How would I make it so when you create a new char you select which sprite you want to be? The very last part of the tutorial tells you exactly how to do this. Read please. |
Author: | Forte [ Mon Jan 26, 2009 2:02 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Fox, I may be wrong but I thought me meant it as the way MRPGE did it, with 2 arrows so you can select from a list of sprites to choose from |
Author: | Coke [ Mon Jan 26, 2009 2:05 pm ] |
Post subject: | Re: Class Sprite for Male and Female |
Oh, thats easy then. You code it. |
Author: | wanai [ Wed Dec 29, 2021 4:29 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Econ |
Author: | wanai [ Wed Dec 29, 2021 4:30 am ] |
Post subject: | Re: Class Sprite for Male and Female |
55.2 |
Author: | wanai [ Wed Dec 29, 2021 4:31 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Bett |
Author: | wanai [ Wed Dec 29, 2021 4:32 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Bett |
Author: | wanai [ Wed Dec 29, 2021 4:33 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Side |
Author: | wanai [ Wed Dec 29, 2021 4:34 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Lieb |
Author: | wanai [ Wed Dec 29, 2021 4:35 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Walk |
Author: | wanai [ Wed Dec 29, 2021 4:36 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Jorg |
Author: | wanai [ Wed Dec 29, 2021 4:38 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Juli |
Author: | wanai [ Wed Dec 29, 2021 4:39 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Fair |
Author: | wanai [ Wed Dec 29, 2021 4:40 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Bigb |
Author: | wanai [ Wed Dec 29, 2021 4:41 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Prov |
Author: | wanai [ Wed Dec 29, 2021 4:42 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Zero |
Author: | wanai [ Wed Dec 29, 2021 4:43 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Weee |
Author: | wanai [ Wed Dec 29, 2021 4:44 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Jame |
Author: | wanai [ Wed Dec 29, 2021 4:45 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Xerx |
Author: | wanai [ Wed Dec 29, 2021 4:46 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Dine |
Author: | wanai [ Wed Dec 29, 2021 4:48 am ] |
Post subject: | Re: Class Sprite for Male and Female |
Duns |
Page 1 of 47 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |