Mirage Source

Free ORPG making software.
It is currently Thu Mar 28, 2024 3:32 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  [ 1703 posts ]  Go to page 1, 2, 3, 4, 5 ... 69  Next
Author Message
PostPosted: Fri Jul 31, 2009 7:52 pm 
Offline
Knowledgeable
User avatar

Joined: Sun Nov 19, 2006 6:59 pm
Posts: 213
Custom Experience Values
Difficulty: 1/5 - This is a fairly easy tutorial, and is entirely Copy and Paste!
Alright, so there used to be a tutorial for this on the old forums, but I beleive it is gone, so I decided to write my own. What this does is let's you set the experience required for every level. Alright so first things first, create a file called experience.ini and place it in the Data folder of the server side. The format of the .ini file should be like so :
Code:
[EXP]
MaxLevel=100
Exp1=1500
Exp2=2000
Exp3=2500
....
Exp99=1000000
Exp100=100500

It is basically saying that to level up at level 1, you need 1500 experience points. Note however that once you have reached the last level, even if you get the required ammount of experience points, you will not level up.

Attachment:
File comment: Sample experience.ini file
experience.zip [558 Bytes]
Downloaded 530 times


Now for the code itself!

Server Side
modTypes
    Look for the following line :
    Code:
    Public Spell(1 To MAX_SPELLS) As SpellRec

    and under it add :
    Code:
    Public ExpReq() As Long

modGeneral
    In sub LoadGameData, under the line :
    Code:
        Call SetStatus("Loading spells...")
        Call LoadSpells

    Add the following :
    Code:
        Call SetStatus("Loading experience values...")
        Call LoadExperience


modDatabase
    Anywhere in the module, add the following sub :
    Code:
    Public Sub LoadExperience()
        Dim FileName As String
        Dim I As Long
       
        FileName = App.Path & "\data\experience.ini"
       
        ReDim ExpReq(1 To (Val(GetVar(FileName, "EXP", "MaxLevel")) - 1)) As Long
       
        For I = 1 To UBound(ExpReq)
            ExpReq(I) = Val(GetVar(FileName, "EXP", "EXP" & I))
        Next I
    End Sub


    Next up, look for the GetPlayerNextLevel function and replace it with the following :
    Code:
    Public Function GetPlayerNextLevel(ByVal Index As Long) As Long
        GetPlayerNextLevel = ExpReq(GetPlayerLevel(Index))
    End Function

modGameLogic
    Lastly, find the sub CheckPlayerLevelUp. Right under the line :
    Code:
        If GetPlayerExp(Index) >= GetPlayerNextLevel(Index) Then

    Add the following code snippet, this will prevent players from leveling over the max level:
    Code:
            If GetPlayerLevel(Index) = UBound(ExpReq) Then
                Call SetPlayerExp(Index, GetPlayerNextLevel(Index))
                Exit Sub
            End If


And there you go! You can now place your own custom experience values! Another simple way to do this is through the GetPlayerNextLevel function, if you replace it with your own formula, thus eliminating the need for a file :). Enjoy! Try it out, and if you have any questions or need any help, feel free to ask! :)

_________________
Image


Top
 Profile  
 
PostPosted: Sat Aug 01, 2009 4:13 pm 
Offline
Persistant Poster
User avatar

Joined: Tue May 30, 2006 2:07 am
Posts: 836
Location: Nashville, Tennessee, USA
Google Talk: rs.ruggles@gmail.com
+5 Rating for this old-school-style tutorial. Fool proof. Thanks, Joke.

_________________
I'm on Facebook! Google Plus My Youtube Channel My Steam Profile

Image


Top
 Profile  
 
PostPosted: Sun Aug 09, 2009 1:56 pm 
Offline
Regular

Joined: Sun Sep 30, 2007 9:59 pm
Posts: 27
What next is the Exp Share for parties.


Top
 Profile  
 
PostPosted: Wed Dec 01, 2021 9:22 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  
 
PostPosted: Fri Jan 07, 2022 6:52 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 6:53 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 6:54 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 6:55 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 6:56 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 6:57 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 6:59 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:00 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:01 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:02 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:03 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:04 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:05 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:06 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:08 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:09 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:10 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:11 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:12 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:13 pm 
Offline
Mirage Source Lover

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


Top
 Profile  
 
PostPosted: Fri Jan 07, 2022 7:14 pm 
Offline
Mirage Source Lover

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


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

All times are UTC


Who is online

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