Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to gain items at level up?

Etern

Member

I was wondering how I can make it so that the main character gains certain items when he levels up, according to switches being on. Thank you for helping me, in advance.
 
you just need to declare a variable that keeps track of the player's level:

Code:
control variables: [char level] == [Char 1]'s level

Now you just need a nested conditional that will shut itself off after the switch is pulled (we don't want to keep recieving the item)

Code:
#here we have a conditional that will run if the character reaches level eleven
Conditional Branch: [char level] == 11 
Conditional Branch: [level eleven event switch] == off

#now the actions
Change items: [awesome level eleven item], +1 
show text: You got an awesome level eleven item!!!

#now lets turn the event off
control switch: [level eleven event switch] == on
branch end
branch end
 

Etern

Member

The way I see this is that it will take a lot of conditional branches, because I would have to do it for every level. It is always the same items gained at level up, so would it not be possible to make it so that when [Char Level] +1, you gain the items? I do not quite know how to do this. Thanks for the help though.
 
In the intro of your game, you should set variable 0001:Level to 2.

Create a common event, parallel process:

Code:
Control Variable: 0002:Current Level = Hero's Level
Conditional Branch: 0002:Current Level >= 0001:Level
   #add items
   Control Variable: 0003:Varname = 0002:Current Level
   Control Variable: 0003:Varname + 1
   Control Variable: 0001:Level = 0003:Varname
End Conditional Branch

That should make sure you get items whenever the hero's level increases. Didn't test it, but it should work.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top