RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA] Level Cap

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 57
RMRK Junior
Hello,

I've found this script to setup a level cap through a variable.
Code: [Select]
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: [Select]
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
« Last Edit: June 09, 2012, 09:48:54 AM by Chaos17 »

**
Rep:
Level 56
RMRK Junior
Try changing "return if max_level?" to "if self.level < max_level". That should make the actor only gain exp if their level is less than the max.
It's more like a big ball of wibbly wobbly...timey wimey...stuff.

**
Rep:
Level 57
RMRK Junior
Hello,

Thanks for your reply, I wrote this :
Code: [Select]
class Game_Actor < Game_Battler
alias lcap_change_exp change_exp
def change_exp(exp, show)
           if self.level < max_level
            lcap_change_exp
  end
end

But I got this error.

**
Rep:
Level 56
RMRK Junior
You need another "end" after the call to lcap_change_exp:

Code: [Select]
class Game_Actor < Game_Battler
    alias lcap_change_exp change_exp
    def change_exp(exp, show)
        if self.level < max_level
            lcap_change_exp
        end
    end
end
It's more like a big ball of wibbly wobbly...timey wimey...stuff.

**
Rep:
Level 57
RMRK Junior
This line made game bug >  lcap_change_exp
Code: [Select]
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
        end
    end
end
I tried to remove it and I got the same problem as before, the hero doesn't gain anymore exp before reaching max level.


I tried this to :
Code: [Select]
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
    def change_exp(exp, show)
        if self.level < max_level
        end
    end
end
But got the same problem as above.

Am I copy pasting the code wrong or what ?  :-[
« Last Edit: June 09, 2012, 04:43:09 PM by Chaos17 »

***
Rep:
Level 65
Working on Monster Leader
Contestant - GIAW 9
Using this works for me:

Code: [Select]
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




**
Rep:
Level 56
RMRK Junior
Oh sugarplum fairies, I missed that the alias call didn't provide the same arguments as the original. Well-spotted!
It's more like a big ball of wibbly wobbly...timey wimey...stuff.

**
Rep:
Level 57
RMRK Junior
Thank you very much guys.  :tpg:
I am so happy.

**
Rep:
Level 56
RMRK Junior
Feel free to translate your happiness into nice shiny +rep for us! :D
It's more like a big ball of wibbly wobbly...timey wimey...stuff.

**
Rep:
Level 57
RMRK Junior
Feel free to translate your happiness into nice shiny +rep for us! :D
Sorry for asking here but PM ddidn't work.
I don't know how to give rep point, do you ?

*
Rep:
Level 97
Secret Santa 2013 ParticipantSecret Santa 2012 Participant2011 Most Successful Troll
You have to have more than 75 posts to give rep.

**
Rep:
Level 57
RMRK Junior
Okay, that's unfornate then.

***
Rep:
Level 65
Working on Monster Leader
Contestant - GIAW 9
you need a certain amount of posts(I don't know how much)
Then you'll see something like this:
Code: [Select]
[+][-]
next so everybody's Rep values
+ for rep up and - for rep down ;)
« Last Edit: June 09, 2012, 06:59:22 PM by mobychan »




**
Rep:
Level 56
RMRK Junior
Heh, I was only kidding anyway, don't worry. ^_^
It's more like a big ball of wibbly wobbly...timey wimey...stuff.