The Daily Click ::. Forums ::. Klik Coding Help ::. Engine troubles
 

Post Reply  Post Oekaki 
 

Posted By Message

Brennon Redmyer



Registered
  23/11/2008
Points
  2
9th July, 2009 at 06:00:44 -

I've managed to get a near-flawless static RPG movement engine up and running in MMF2, and the leveling system, while crude, is coming along and is at best bare bones. One thing, however, that is failing to work properly is adding 5 to a "skill points" counter every time the player levels up. It seems to work okay at first, but it likes to re-add 5 for every level up every time the frame restarts, even if the player didn't level up.

Say the player does really good in a battle and nets enough experience to get from level 1 to level 4. 15 will be added to the counter (since 5 is added every level) and subtracted accordingly when the player spends them on stat raises. Say the player spends 5 altogether, leaving him with 10 leftover. He gets in another fight, wins (or runs), but doesn't level up again. Back at the map, he now has 25 skill points but still has those 5 points in the stats he spent them on.

I've tried so many things and nothing seems to work, and I really have no idea what's wrong.

I think it may be something to do with my roundabout and messy coding (I'm still fairly inexperienced, though I've been working with Clickteam programs for a good 4-5 years now). It seems so mundane of a problem but I can't figure it out! Any help at all would be appreciated and if the source is needed I'll upload, even at the expense of mockery.

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
9th July, 2009 at 08:02:13 -

It's quite hard to fix a problem like that purely from a description, because as you mentioned we're not sure about your coding, so if you could upload the source I'm sure we'd be able to help out better.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Brennon Redmyer



Registered
  23/11/2008
Points
  2
9th July, 2009 at 19:02:42 -

I figured as much, heh.
Here it is (.mfa):
http://www.sendspace.com/file/wivu6m 


 
n/a

mojofltr



Registered
  12/01/2005
Points
  133
10th July, 2009 at 14:12:49 -

Line 8 in your first frame, you set player_max_exp to 100 if the player's level is 1

Line 22, you have the player's level increase if the player_current_exp is greater than the max_exp.

Line 27, you set the player level to 1 at the start of the frame.

I'm thinking line 27 is the culprit... you may want to set this value (and possibly the others that really only need to be set once) in the properties toolbar, so that it is right at the beginning of a game, but not reset each time you play the frame.

I'm really not sure if this is the problem - I couldn't win enough battles to test very thoroughly.


 
n/a

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
10th July, 2009 at 15:53:14 -

Just on another note, you'll need to have 'two' experience counters. One is the total accumulated one, which your levels up will depend on. The other is the experience point balance, where it will drop when you spend those points but won't affect levels.

Also, the level up doesn't sound right, if the max_exp is 100, then this means you level up every 100 points? How will you reward the player for defeating harder mobs? With less exp so the level up is slower?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click