Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> [SOLVED] Cap level, Block level and exp
Chaos17
post Jun 9 2012, 08:58 AM
Post #1


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Beginner




Hello,

I've found this script to setup a level cap through a variable.
CODE
Idvariableslevel = #Numéro de la variable qui contient le niveau max.
class Game_Actor < Game_Battler
def max_level
return $game_variables[Idvariableslevel]
end
end


It works well but I've a problem.
The script doesn't stop my hero to gain exp after he reached the max level.
So the player can bank exp until the max level is unlocked.
I can't allow the player to gain 10 levels at once just because I allowed him to stock exp.

Someone suggested me a solution but the problem with this new code is that it prevent my hero to gain exp before reaching max level and I want it to do the contratry : block exp after max level is reached.

CODE
class Game_Actor < Game_Battler
alias lcap_change_exp change_exp
def change_exp(exp, show)
            return if max_level?
            lcap_change_exp
  end
end


EDIT : Problem Solved
CODE
################################################################################
#
#        Niveau Maximum des héros d'après le contenue d'une variable.
#
#-------------------------------------------------------------------------------
#--- Version 1.0 du 18 mars 2012
#--- Réalisé par Jean Monos
#--- Pour Rpg Maker Vx Ace
#--- Distribution / modification autorisé sans autorisation
#-------------------------------------------------------------------------------
# Credits : Monos, Kaila, Yami, Trihan and mobychan - created and fixed a bug with cap level script.

Idvariableslevel = 002 #Numéro de la variable qui contient le niveau max.
class Game_Actor < Game_Battler
  def max_level
    return $game_variables[Idvariableslevel]
  end
end

class Game_Actor < Game_Battler
  alias lcap_change_exp change_exp
  def change_exp(exp, show)
    if self.level < max_level
      lcap_change_exp(exp, show)
    end
  end
end


This post has been edited by Chaos17: Jun 9 2012, 09:47 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Tsukihime
post Jun 9 2012, 10:42 AM
Post #2


Level 25
Group Icon

Group: Revolutionary
Posts: 560
Type: None
RM Skill: Undisclosed
Rev Points: 25




Not really sure what the difference between this script and the one you tried to write.

This post has been edited by Tsukihime: Jun 9 2012, 10:43 AM


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   
LostSamurai
post Jun 9 2012, 03:39 PM
Post #3


Atrius
Group Icon

Group: Revolutionary
Posts: 144
Type: Musician
RM Skill: Advanced




I'm glad you solved your problem. I would also like to point out the humor in the fact that there are five people credited for a script which is only 14 lines of code.


__________________________
Oh dear... it seems I may have one more project left in me before I retire... more info soon.

My Website

Ikode: The World of Infinity
Ikode 2: The Supreme Dragon
Ikode 3: Broken Mirror

The Two Moons (Joke RPG)
Go to the top of the page
 
+Quote Post
   
Chaos17
post Jun 9 2012, 04:07 PM
Post #4


Level 1
Group Icon

Group: Member
Posts: 5
Type: None
RM Skill: Beginner




QUOTE
Not really sure what the difference between this script and the one you tried to write.

The main the difference is in the second code.
Original lines which were the cause of my troubles
CODE
        return if max_level?
        lcap_change_exp

Were changed into these
CODE
    if self.level < max_level
      lcap_change_exp(exp, show)

QUOTE
I'm glad you solved your problem. I would also like to point out the humor in the fact that there are five people credited for a script which is only 14 lines of code.

That wasn't a point of humour from me. tongue.gif
The first two person are the creators, the other 3 people did :
Yami > found out what to code to help me but unfortunally his script had a major flaw
Trihan > found out what to correct in Yami script but he also had a flaw
mobychan > corrected the flaw that Trijhan had.

Each person brought their stone to the edifice smile.gif
So I am very thankfull to all these people that took their time to help me.


This post has been edited by Chaos17: Jun 9 2012, 04:15 PM


__________________________
Go to the top of the page
 
+Quote Post
   
amerk
post Jun 12 2012, 12:33 PM
Post #5


Level 56
Group Icon

Group: Global Mod
Posts: 1,784
Type: None
RM Skill: Undisclosed
Rev Points: 15




Glad you solved your issue, but it does lead to a more interesting idea... being able to bank EXP. Imagine if you could bank all your EXP and then you can delegate it out to all your party members however way you want in order to help some earn higher or lower levels than others.

In any case, sorry to have gone off topic.


__________________________
Go to the top of the page
 
+Quote Post
   
Tsukihime
post Jun 13 2012, 10:28 AM
Post #6


Level 25
Group Icon

Group: Revolutionary
Posts: 560
Type: None
RM Skill: Undisclosed
Rev Points: 25




exp bank would be interesting, but the amount of effort required to balance it would probably be crazy.
For example, instead of distributing my exp, I just power-up one girl to lv 50 when the expected average party level was 20 lol.


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   
Shadyone
post Jun 14 2012, 08:21 AM
Post #7


K@w411ii~desudesu:3<(^^)>s@$uk3Kun$0h0T~.~kyaaaa
Group Icon

Group: Revolutionary
Posts: 1,211
Type: Developer
RM Skill: Beginner
Rev Points: 20




For this exp bank idea, you could have it so you can't raise party members above a certain level during that part of the game or until you 'unlock' more levels.


__________________________







Speedtest



ISML 2012

ARENA 01: [Elucia de Lute Ima] Kasugano Sora
ARENA 02: Gasai Yuno [Aragaki Ayase]
ARENA 03: Irisviel von Einzbern [Abstained] Haruna
ARENA 04: Shimada Minami [Iwasawa Masami]
ARENA 05: [Nakagawa Kanon] Kirishima Shōko
ARENA 06: [Fear Kubrick] Himeji Mizuki
ARENA 07: [Eucliwood Hellscythe] Kanzaki H. Aria
ARENA 08: Gokō Ruri (Kuroneko) [Makise Kurisu]
ARENA 09: [Yui] Victorique de Blois
ARENA 10: [Shiomiya Shiori] Mine Riko
ARENA 11: Mikazuki Yozora [Sakura Kyōko]
ARENA 12: Charlotte Dunois [Abstained] Yuzuriha Inori
ARENA 13: [Akemi Homura] Tōwa Erio
ARENA 14: Hasegawa Kobato [Kuroi Mato]
ARENA 15: [Kōsaka Kirino] Kashiwazaki Sena
ARENA 16: [Tachibana Kanade] Nakamura Yuri
ARENA 17: Suzutsuki Kanade [Haqua du Lot Herminium]
ARENA 18: [Honma Meiko] Konoe Subaru
ARENA 19: [Nagato Yuki, Asakura Ryōko] Misaka Mikoto, Shirai Kuroko
ARENA 20: [Hiiragi Kagami] Shiina Mafuyu
ARENA 21: Ichinose Kotomi [Sanzen'in Nagi]
ARENA 22: [Last Order] Hirasawa Ui
ARENA 23: Shirai Kuroko [Izumi Konata]
ARENA 24: [Nymph] Ikaros
ARENA 25: Konjiki no Yami [Holo]
ARENA 26: [Nakano Azusa] Tōsaka Rin
ARENA 27: [Misaka Mikoto] Hirasawa Yui
ARENA 28: [Suzumiya Haruhi] Saber
ARENA 29: C.C. [Asahina Mikuru]
ARENA 30: [Sakagami Tomoyo] Index L. Prohibitorum
ARENA 31: Akiyama Mio [Oshino Shinobu]
ARENA 32: [Aisaka Taiga] Louise Vallière
ARENA 33: [Sengoku Nadeko] Katsura Hinagiku
ARENA 34: [Nagato Yuki] Senjōgahara Hitagi
ARENA 35: [Shana] Illyasviel von Einzbern
ARENA 36: Hecate [Fujibayashi Kyō]
ARENA 37: Kotobuki Tsumugi [Furukawa Nagisa]
ARENA 38: [Kamina, Yoko Littner] Natsu Dragneel, Lisanna Strauss
Go to the top of the page
 
+Quote Post
   
Tsukihime
post Jun 14 2012, 12:56 PM
Post #8


Level 25
Group Icon

Group: Revolutionary
Posts: 560
Type: None
RM Skill: Undisclosed
Rev Points: 25




"Average party level" I guess.


__________________________
My Scripts
Go to the top of the page
 
+Quote Post
   
vvalkingman
post Jun 24 2012, 10:43 PM
Post #9


The Traveling Bard ;)
Group Icon

Group: Revolutionary
Posts: 210
Type: Developer
RM Skill: Intermediate




Post is off topic but I'd like to throw out this little idea for exp bank:

Instead of average chracter level dictating how high other characters can level, just have it so the other characters can't level up higher then the character with the highest level. Something I've run into is that if you use "excess experience points" to level other characters then couldn't you de-level if you give away too many? My suggestion is that you use another variable/currency as "banked experience", perhaps it's gathered at a reduced rate from normal experience and can be used to level any character.

The mmo Shattered Galaxy used a similar idea of banked experience, where the experience your subordinate(mentor/subordinate system) gathered increased a pool of points that the mentor could use to increase the level of HIS units. At a reduced rate of 20% the subordinates gathered experience, of course.

Ex. Subordinate gained 10,000 experience points from battling; the mentor would have 2,000 experience points added to a pool of experience points which they could use on their units thanks to that subordinate.


__________________________

Thank you X-M-O for my sexy new banner! ;)

Project I'm currently racking my brain on:
"Modern Witch" Project(tentative name): 5% done
Goshiki: The Five Paths: 40% done

Projects on the backburner:
The Great Thief of Mango City: 5% done
Knights of the Black Gate: 10% done
The Venting: 74% done
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2013 - 08:01 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker