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.

Conditional branch for Unarmed and Level up

Status
Not open for further replies.
Anyone know what the RGSS statement should I use for the following conditional branch?

- If particular actor doesn't have any weapon equipped (I want the actor to equip a default weapon when he is not equipped with anything at all)
- When the actor has level up, I wanted some message and things to appear as soon as he gains a level

Please help 8-), I know its easy for the RGSS pros
 
- If particular actor doesn't have any weapon equipped (I want the actor to equip a default weapon when he is not equipped with anything at all)
You can use, replacing XXX for your actor id
Code:
$game_actors[[B][COLOR=Red]XXX[/COLOR][/B]].weapon_id != 0
- When the actor has level up, I wanted some message and things to appear as soon as he gains a level
1. Define a common event with tyour message and the thing you want to appear
2. Add the following script above Main in the script editor, replacing XXX for your common event id:
Code:
class Game_Actor
  alias kinnison_gmactor_level= level=
  def level=(level)
    if self.level < level
      $game_temp.common_event = [B][COLOR=Red]XXX[/COLOR][/B]
    end
    kinnison_gmactor_level=(level)
  end
end
 
Kinnison;315572 said:
Thanks tibuda. I like it that you put my name as the variable name :D

Coolie! 8-)

It's a SDK convention to use the scripter name when aliasing a method, but when I'm filling requests I prefer to use the requester name.
 
Status
Not open for further replies.

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