Mirage Source

Free ORPG making software.
It is currently Thu Mar 28, 2024 5:52 pm

All times are UTC


Forum rules


Make sure your tutorials are kept up to date with the latest MS4 releases.



Post new topic Reply to topic  [ 1412 posts ]  Go to page 1, 2, 3, 4, 5 ... 57  Next
Author Message
 Post subject: Race Sprites Tut
PostPosted: Sat Aug 22, 2009 8:13 pm 
Offline
Regular

Joined: Sun Sep 30, 2007 9:59 pm
Posts: 27
So what this tutorial will basically do is let you choose a sprite for the male version of a race and the female version of a race! :) This is all server side too. I use MS 3.07 for this tut.

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 remove the Sprite as Integer.

Next I add a new Rec called RaceRec

Type RaceRec
Name As String * NAME_LENGTH
MSprite as Integer
FSprite as Integer
Stat(1 To Stats.Stat_Count - 1) As Byte
End Type

Next I copy the LoadClasses(modDatabase) as a new sub and renamed it to LoadRaces. I also change all Class() to Race().

Now, in the LoadClasses (modDatabase), look for the line :

Code:

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

and remove it.

Now, in the LoadRaces (modDatabase), look for the line :

Code:

Race(i).Sprite = Val(GetVar(FileName, "Race" & i, "Sprite"))

and replace it with:

Code:

Race(i).MSprite = Val(GetVar(FileName, "RACE" & i, "MSprite"))
Race(i).FSprite = Val(GetVar(FileName, "RACE" & i, "FSprite"))

Next I copy the SaveClasses(modDatabase) to make a new sub called SaveRaces. I rename the Class() to Race().

In sub SaveClasses (modDatabase), look for :

Code:

Call PutVar(FileName, "CLASS" & i, "Sprite", CStr(Class(i).Sprite))

and remove it

In sub SaveRaces (modDatabase), look for :

Code:

Call PutVar(FileName, "RACE" & i, "Sprite", CStr(Race(i).Sprite))

and replace it with :

Code:

Call PutVar(FileName, "RACE" & i, "MSprite", CStr(Race(i).MSprite))
Call PutVar(FileName, "RACE" & i, "FSprite", CStr(Race(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 remove (in your classes.ini) :

Quote:

Sprite=###

And that you make a new ini file called races.ini that basically have same stuff as classes.ini before the remove, but that the follow change:

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. But you need to add "RaceNum" after ClassNum in AddChar. 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 = Race(RaceNum).MSprite
Else
Player(Index).Char(CharNum).Sprite = Race(RaceNum).FSprite
End If


And there you go! You now have a female and male sprite for each race and that you basically create a Race System! :)


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Aug 22, 2009 8:33 pm 
Offline
Persistant Poster

Joined: Fri Jun 26, 2009 10:15 pm
Posts: 701
Google Talk: FAProductions
Use code tags please.


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sun Aug 23, 2009 3:45 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Not sure if it's like this because you didn't use code tags, but make sure you format your code properly, otherwise it's too much trouble to actually go through and read.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sun Aug 23, 2009 4:08 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
It's formatted. You can see the spaces when you quote it.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sun Aug 23, 2009 4:20 am 
Offline
Knowledgeable

Joined: Sun Jan 13, 2008 5:59 pm
Posts: 107
It feels like copy and paste Dx


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sun Aug 23, 2009 7:01 pm 
Offline
Pro
User avatar

Joined: Sun Aug 05, 2007 2:26 pm
Posts: 547
yea, thats how a tutorial will look if you copy and paste the exact text from another forum (not the bbcode).

_________________
GIAKEN wrote:
I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Wed Dec 01, 2021 9:30 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:45 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Econ


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:46 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
122.29


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:47 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Bett


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:49 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Bett


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:50 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Dark


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:51 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Fann


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:52 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Jewe


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:53 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Jean


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:54 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Herv


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:55 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Krem


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:56 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Gran


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:57 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Dhab


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 3:59 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
BOOK


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 4:00 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Orie


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 4:01 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Bris


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 4:02 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Tefa


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 4:03 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Jame


Top
 Profile  
 
 Post subject: Re: Race Sprites Tut
PostPosted: Sat Jan 08, 2022 4:04 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Fisk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1412 posts ]  Go to page 1, 2, 3, 4, 5 ... 57  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group