Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Reload this Page [Question] Scripting Moxie?

Notices
For all updates, view the main page.

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 August 25th, 2013 (04:23 PM).
woobowiz woobowiz is offline
 
Join Date: Jun 2013
Gender: Male
Posts: 3
I'm very new to this forum, and I'm not aware if this has been asked.

I recently wanted to script in some during battle effects as well as moves, I'm currently working on Moxie, as it's a least concern priority to get working for most people.

I would assume I would have to put the script code somewhere between lines 2522 and 2532 in the PokeBattle_ActualScene script?

Code:
# This method is called whenever a Pokémon faints.
  def pbFainted(pkmn)
    frames=pbCryFrameLength(pkmn.pokemon)
    pbPlayCry(pkmn.pokemon)
    frames.times do
      pbGraphicsUpdate
      pbInputUpdate
    end
    @sprites["shadow#{pkmn.index}"].visible=false
    pkmnsprite=@sprites["pokemon#{pkmn.index}"]
    pkmnsprite.visible=false
    if @battle.pbIsOpposing?(pkmn.index)
      ycoord=(@sprites["battler0"].visible && @battle.doublebattle) ? 118 : 130
      tempvp=Viewport.new(0,0,Graphics.width,ycoord+@foeyoffset)
    else
      tempvp=Viewport.new(0,0,Graphics.width,224+@traineryoffset)
    end
    tempvp.z=@viewport.z
    tempsprite=SpriteWrapper.new(tempvp)
    tempsprite.x=pkmnsprite.x
    tempsprite.y=pkmnsprite.y
    tempsprite.bitmap=pkmnsprite.bitmap
    tempsprite.visible=true
    pbSEPlay("faint")
    20.times do
      tempsprite.y+=8
      pbGraphicsUpdate
      pbInputUpdate
    end
    # I assume I have to insert the code here?
    tempsprite.dispose
    tempvp.dispose
    8.times do
      @sprites["battler#{pkmn.index}"].opacity-=32
      pbGraphicsUpdate
      pbInputUpdate
    end
    @sprites["battler#{pkmn.index}"].visible=false
    pkmn.pbResetForm
  end
Reply With Quote
  #2    
Old August 26th, 2013 (04:59 PM).
dexter1o6 dexter1o6 is offline
 
Join Date: Jul 2013
Age: 27
Gender: Male
Posts: 64
Looks about right to me. But I must say I'm not very experienced with including moves and abilities. Is there any other ability that is triggered when the opponent faints? And if so, has it been implemented yet? And if so, where was that ability implemented?

Otherwise I would say, make a backup, fiddle with the code, test it, and if it works, post it among resources/scripts or something, and if it doesn't, post it here with some questions. You can always switch back to the backup.
Reply With Quote
  #3    
Old August 27th, 2013 (05:11 AM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 3,964
PokeBattle_ActualScene is for the visual stuff. It's not where effects go.

Moxie sounds like it occurs at the same time that Destiny Bond occurs. That's a good place to start. Search for DestinyBond.
__________________
Reply With Quote
  #4    
Old August 27th, 2013 (02:13 PM).
dexter1o6 dexter1o6 is offline
 
Join Date: Jul 2013
Age: 27
Gender: Male
Posts: 64
When you say destiny bond, I think of Aftermath. Since this is an ability just like moxie, it should be at the same place. Also, if I remember correctly, Aftermath works already works. So you can search for Aftermath as well.
Reply With Quote
  #5    
Old August 28th, 2013 (05:14 PM).
woobowiz woobowiz is offline
 
Join Date: Jun 2013
Gender: Male
Posts: 3
So I mixed a bit of code from Aftermath and Speed Boost

and squeezed it after Mummy (I would assume Mummy would activate first because of this so Moxie gets negated?)

Code:
if isConst?(target.ability,PBAbilities,:MUMMY) && user.hp>0
        if !isConst?(user.ability(true),PBAbilities,:MULTITYPE) &&
           !isConst?(user.ability(true),PBAbilities,:WONDERGUARD) &&
           !isConst?(user.ability(true),PBAbilities,:MUMMY)
          user.ability=getConst(PBAbilities,:MUMMY) || 0
          pbDisplay(_INTL("{1} was mummified by {2}!",user.pbThis,target.pbThis(true)))
        end
      end
      if isConst?(user.ability,PBAbilities,:MOXIE) && user.hp>0 && target.hp<=0
        if !user.pbTooHigh?(PBStats::ATTACK)
          user.pbIncreaseStatBasic(PBStats::ATTACK,1)
          pbCommonAnimation("StatUp",i,nil)
          pbDisplay(_INTL("{1}'s Moxie raised its Attack!",user.pbThis))
        end 
      end
Reply With Quote
  #6    
Old August 28th, 2013 (08:35 PM).
dexter1o6 dexter1o6 is offline
 
Join Date: Jul 2013
Age: 27
Gender: Male
Posts: 64
You may want to test that assumption in an actual game.
Reply With Quote
  #7    
Old August 29th, 2013 (06:17 PM).
woobowiz woobowiz is offline
 
Join Date: Jun 2013
Gender: Male
Posts: 3
Well I know for certain Moxie works, but I haven't a clue how to simulate the Mummy test case.
Reply With Quote
  #8    
Old August 29th, 2013 (07:44 PM).
dexter1o6 dexter1o6 is offline
 
Join Date: Jul 2013
Age: 27
Gender: Male
Posts: 64
Have a pokemon with moxie defeat a pokemon with mummy in one (physical) blow. That should do for testing.
Reply With Quote
  #9    
Old September 3rd, 2013 (04:45 PM).
Giu's Avatar
Giu Giu is offline
 
Join Date: Jan 2010
Gender: Male
Nature: Modest
Posts: 110
Hi there. Did you guys get moxie working fine?
I tried to make it work using woobowiz idea, but I still get no effects, it seems like I'm missing something. What should be done in order to add it properly?
Thank you all.
Reply With Quote
  #10    
Old September 5th, 2013 (11:41 AM).
AmethystRain's Avatar
AmethystRain AmethystRain is offline
Crystaline
 
Join Date: Apr 2012
Gender: Female
Posts: 234
Yeah, Woobowiz did actually!
Here, I'll put up the script she gave me for future users
Quote:
So Moxie's code is applied directly after Mummy's code in the PokeBattle_Battle script. The code for Moxie should start at line 1966.
Code:
if isConst?(user.ability,PBAbilities,:MOXIE) && user.hp>0 && target.hp<=0

        if !user.pbTooHigh?(PBStats::ATTACK)

          user.pbIncreaseStatBasic(PBStats::ATTACK,1)

          pbCommonAnimation("StatUp",user,nil)

          pbDisplay(_INTL("{1}'s Moxie raised its Attack!",user.pbThis))

        end

end
__________________
With Love, Your Shadow~
Proud owner of Reborn and spearhead of the Pokemon Reborn game~
Reply With Quote
  #11    
Old September 5th, 2013 (12:49 PM).
Giu's Avatar
Giu Giu is offline
 
Join Date: Jan 2010
Gender: Male
Nature: Modest
Posts: 110
Quote originally posted by AmethystRain:
Yeah, Woobowiz did actually!
Here, I'll put up the script she gave me for future users
Thank you so much! Now I've noticed that the original script had only a little difference from this one that prevented it from working. Now it is working perfectly fine.
Thank you and Woobowiz. :D
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

Forum Jump


All times are UTC -8. The time now is 05:08 PM.