Jump to content


Photo

Leveling effect


  • Please log in to reply
5 replies to this topic

#1 Darklight2

Darklight2

    GMC Member

  • GMC Member
  • 7 posts
  • Version:GM8

Posted 10 March 2012 - 09:27 PM

I'm working on a rpg with basic leveling system, e.g.
if global.level >= 120{global.level = 2}

and I'm really stuck on how to make some sort of indication that you've levelled up, like a word above your character saying "LEVEL UP" or something like that.
Please don't tell me to redesign the level system, I spent hours typing it up to level 100. :P
  • 0

#2 mrokke96

mrokke96

    GMC Member

  • New Member
  • 256 posts
  • Version:GM8

Posted 10 March 2012 - 11:20 PM

I'm working on a rpg with basic leveling system, e.g.

if global.level >= 120{global.level = 2}

and I'm really stuck on how to make some sort of indication that you've levelled up, like a word above your character saying "LEVEL UP" or something like that.
Please don't tell me to redesign the level system, I spent hours typing it up to level 100. :P

you could just make a new variable thats called levelup(in create event set to false), and then when you gained enough XP to go up a level or how you've done your level-system you set that to true. and in step event;
if levelup = true
{
   alarm[0] = 60;
   show_message(250,250,'Level Up!');
}
and in alarm[0];
levelup = false;

I think that should work without you have to change anything
  • 0

#3 xxgamenoobxx

xxgamenoobxx

    GMC Member

  • New Member
  • 35 posts
  • Version:GM8

Posted 10 March 2012 - 11:44 PM

well i've been working on mine recently, and all you need is a standard simple equation to make your xp max go up. i just use that. setting the xpmax for the next level up per level would take forever.
for example
if global.xp > xpmax
global.level +=1
global.xp -=global.xpmax
global.xpmax += 1000+((global.level*10)^2)

that's all i did. :D
  • 0

#4 Darklight2

Darklight2

    GMC Member

  • GMC Member
  • 7 posts
  • Version:GM8

Posted 11 March 2012 - 12:59 AM


I'm working on a rpg with basic leveling system, e.g.

if global.level >= 120{global.level = 2}

and I'm really stuck on how to make some sort of indication that you've levelled up, like a word above your character saying "LEVEL UP" or something like that.
Please don't tell me to redesign the level system, I spent hours typing it up to level 100. :P

you could just make a new variable thats called levelup(in create event set to false), and then when you gained enough XP to go up a level or how you've done your level-system you set that to true. and in step event;
if levelup = true
{
   alarm[0] = 60;
   show_message(250,250,'Level Up!');
}
and in alarm[0];
levelup = false;

I think that should work without you have to change anything


It tests the exp in the step event so as soon as levelup is set to false, it would instantly be set back to true. :/
  • 0

#5 RangerX

RangerX

    GMC Member

  • GMC Member
  • 916 posts
  • Version:GM8.1

Posted 11 March 2012 - 01:48 AM

Count the XP on a seperate variable (each time you add XP, add to that variable). When that variable reaches the level up number, display the level up text and reset that variable for counting to 0.
  • 0

#6 brett14

brett14

    GMC Member

  • GMC Member
  • 1150 posts
  • Version:GM8

Posted 11 March 2012 - 02:18 AM

Initialize these at game startup
global.currentlevel=1;
global.currentxp=0;
global.nextxp=10;
global.haslevel=false;

add a script, add_xp
global.currentxp+=argument0;
while(global.currentxp>global.nextxp){
global.currentxp-=global.nextxp;
global.currentlevel+=1;
global.nextxp*=1.3;//Change this. This makes it as you level higher, it becomes harder to level up
global.haslevel=true;
<CONTROLLEROBJECT>.alarm[0]=60;//any alarm, set it to how many steps you want. Set it to the object that draws the player
}
Simply call this script, and pass how much xp you would like to add. If you add 100xp, you may level 3 or 4 times. This will take into account xp overflow (putting in more xp than required to level)


In the players alarm event
global.haslevel=false;

In the draw event
if(global.haslevel){
draw_text(x,y-32,"Leveled up!#Level: "+string(global.currentlevel));
}


Something along those lines. I typed it on post, so there are possibly errors in the code.

Enjoy
~~Brett14;

Edited by brett14, 11 March 2012 - 02:23 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users