Mirage Source

Free ORPG making software.
It is currently Thu Mar 28, 2024 3:22 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  [ 1394 posts ]  Go to page 1, 2, 3, 4, 5 ... 56  Next
Author Message
PostPosted: Wed Sep 17, 2008 12:29 pm 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
Just a basic overview of the stats.
You can also refrence http://web.miragesource.com/forums/viewtopic.php?f=5&t=3988
where i outline the original idea.

modEnumerations
Code:
' Stats used by Players, Npcs and Classes
Public Enum Stats
    Strength = 1
    Defense
    Speed
    Magic
    ' Make sure Stat_Count is below everything else
    Stat_Count
End Enum

The enum will automatically increment each item in the list. Starting at Strength = 1 so Stat_Count would equal 5.

When you add in a new stat make sure to add it is above this:
Quote:
' Make sure Stat_Count is below everything else

If Stat_Count isn't the last in the enum, it will create problems for you.

The way the current stat system works , in the PlayerRec we have
Code:
' Stats
    Stat(1 To Stats.Stat_Count - 1) As Byte


So it will automatically setup how many stats you have.
If you have any accounts and edit the Stat Enums, you will have to delete your accounts or create a converter tool.

Now to access your stats we have:
Code:
Public Function GetPlayerStat(ByVal Index As Long, ByVal Stat As Stats) As Long
    GetPlayerStat = Player(Index).Char(TempPlayer(Index).CharNum).Stat(Stat)
End Function


This function can get any stat you have.
Code:
GetPlayerStat(Index, Stats.NewStat)


VB6 has a little bit of intellisense and should automatically show a list of the Stat enums for you.

To set a stat we have
Code:
Public Sub SetPlayerStat(ByVal Index As Long, ByVal Stat As Stats, ByVal Value As Long)
    Player(Index).Char(TempPlayer(Index).CharNum).Stat(Stat) = Value
End Sub


A common use:
Code:
SetPlayerStat(Index, Stats.NewStat, GetPlayerStat(Index, Stats.NewStat + 5))


Let me know if you don't understand anything, or if i left something out.


Last edited by Jacob on Fri Sep 19, 2008 3:25 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Adding new Stats
PostPosted: Wed Sep 17, 2008 5:38 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
Why not make Strength = 0, instead of Strength = 1. If you make it equal 0, your Stat_Count would stand for the amount of stats you have. Instead of standing for the amount of stats you have +1.

And also your:
Code:
' Stats
    Stat(1 To Stats.Stat_Count - 1) As Byte

Could then be:
Code:
' Stats
    Stat(1 To Stats.Stat_Count) As Byte

Just a little simpler and better looking in my opinion.

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject: Re: Adding new Stats
PostPosted: Wed Sep 17, 2008 5:55 pm 
Offline
Pro
User avatar

Joined: Tue Nov 13, 2007 2:42 pm
Posts: 509
Because it would cause errors.

When you call GetPlayerStat(index, Stats.Strength) it would be the same as GetPlayerStat(Index, 0). Since the array doesn't start with 0 this would cause errors.

Then all the other stats would be 1 number off.


Top
 Profile  
 
 Post subject: Re: Adding new Stats
PostPosted: Wed Sep 17, 2008 6:06 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
Ah, I just looked some more on your code and noticed that you had:
Code:
ByVal Stat As Stats

It's actually better this way because now 1 will equal Strength in both the Stat Array and the Stats Enum.

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
PostPosted: Wed Dec 01, 2021 7:31 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruhttp://magnetotelluricfield.ruhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruинфоhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.rutaskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruсайтhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:48 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:49 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:50 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:51 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:52 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:53 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:54 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:56 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:57 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:58 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 9:59 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 10:00 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 10:01 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 10:02 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 10:03 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 10:04 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 10:06 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 10:07 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 10:08 am 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Sun Dec 26, 2021 10:09 am 
Offline
Mirage Source Lover

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


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 15 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