The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.


Reply
 
Thread Tools
  #1    
Old December 25th, 2012, 02:06 AM
WinterKirby's Avatar
WinterKirby
 
Join Date: Dec 2012
Age: 2
Gender: Male
Nature: Mild
So, I'm trying to add in effects for new moves, but I've run into some trouble.

Here's the code:
Code:
class PokeBattle_Move_138 < PokeBattle_Move
  def pbEffect(attacker,opponent)
    if attacker.hp==attacker.totalhp
      @battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
      return -1
    end
    if attacker.pbTooHigh?(PBStats::DEFENSE) &&
       attacker.pbTooHigh?(PBStats::SPDEF)
      @battle.pbDisplay(_INTL("{1}'s stats won't go higher!",attacker.pbThis))
      return -1
    end
    @battle.pbAnimation(@id,attacker,nil)
      hpgain=(attacker.totalhp/2).floor
      attacker.pbRecoverHP(hpgain)
      @battle.pbDisplay(_INTL("{1} regained health!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::DEFENSE)
      @battle.pbCommonAnimation("StatUp",attacker,nil)
      attacker.pbIncreaseStatBasic(PBStats::DEFENSE,1)
      @battle.pbDisplay(_INTL("{1}'s Defense rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::SPDEF)
      @battle.pbCommonAnimation("StatUp",attacker,nil)
      attacker.pbIncreaseStatBasic(PBStats::SPDEF,1)
      @battle.pbDisplay(_INTL("{1}'s Special Defense rose!",attacker.pbThis))
    end
      return 0
    end
  end
end
The move is supposed to raise the user's Defense and Sp. Defense, and restores 1/2 of the user's max HP. However, when I run, I'm told that that there's a syntax error at line 7589. Which is the second to last "end." So I tried a little more tweaking, into this:

Code:
class PokeBattle_Move_138 < PokeBattle_Move
  def pbEffect(attacker,opponent)
    if attacker.hp==attacker.totalhp ||
      attacker.pbTooHigh?(PBStats::DEFENSE) &&
      attacker.pbTooHigh?(PBStats::SPDEF)
      @battle.pbDisplay(_INTL("But it failed!",attacker.pbThis))
      return -1
    end
    @battle.pbAnimation(@id,attacker,nil)
      hpgain=(attacker.totalhp/2).floor
      attacker.pbRecoverHP(hpgain)
    end
    if !attacker.pbTooHigh?(PBStats::DEFENSE)
      @battle.pbCommonAnimation("StatUp",attacker,nil)
      attacker.pbIncreaseStatBasic(PBStats::DEFENSE,1)
      @battle.pbDisplay(_INTL("{1}'s Defense rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::SPDEF)
      @battle.pbCommonAnimation("StatUp",attacker,nil)
      attacker.pbIncreaseStatBasic(PBStats::SPDEF,1)
      @battle.pbDisplay(_INTL("{1}'s Special Defense rose!",attacker.pbThis))
    end
    return -1
  end
end
And again, there's a syntax error, which is now on the last "end" (line 7585)

I honestly have no idea what I'm doing. Someone help me.

Last edited by WinterKirby; December 25th, 2012 at 02:35 AM.
Reply With Quote
  #2    
Old December 25th, 2012, 11:08 AM
Luka S.J.'s Avatar
Luka S.J.
S.J.Ware HD
 
Join Date: Dec 2008
Age: 20
Gender: Male
Nature: Adamant
Quote:
Originally Posted by WinterKirby View Post
So, I'm trying to add in effects for new moves, but I've run into some trouble.

Here's the code:
Code:
class PokeBattle_Move_138 < PokeBattle_Move
  def pbEffect(attacker,opponent)
    if attacker.hp==attacker.totalhp
      @battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
      return -1
    end
    if attacker.pbTooHigh?(PBStats::DEFENSE) &&
       attacker.pbTooHigh?(PBStats::SPDEF)
      @battle.pbDisplay(_INTL("{1}'s stats won't go higher!",attacker.pbThis))
      return -1
    end
    @battle.pbAnimation(@id,attacker,nil)
      hpgain=(attacker.totalhp/2).floor
      attacker.pbRecoverHP(hpgain)
      @battle.pbDisplay(_INTL("{1} regained health!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::DEFENSE)
      @battle.pbCommonAnimation("StatUp",attacker,nil)
      attacker.pbIncreaseStatBasic(PBStats::DEFENSE,1)
      @battle.pbDisplay(_INTL("{1}'s Defense rose!",attacker.pbThis))
    end
    if !attacker.pbTooHigh?(PBStats::SPDEF)
      @battle.pbCommonAnimation("StatUp",attacker,nil)
      attacker.pbIncreaseStatBasic(PBStats::SPDEF,1)
      @battle.pbDisplay(_INTL("{1}'s Special Defense rose!",attacker.pbThis))
    end
      return 0
    end
  end
end
These two ends shouldn't be there.
__________________
[STOPPED] Pokemon Blue Chrome
[DEVELOPING] S.J.Ware
[DEVELOPING] Tykanite
Reply With Quote
Reply
Quick Reply

Sponsored Links


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 06:39 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.