Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Reload this Page [Question] Move Descriptions in Battle? (Plus My Introduction)

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 June 16th, 2012 (09:29 PM).
Jenna573's Avatar
Jenna573 Jenna573 is offline
Retired Pokemon Master
 
Join Date: Jun 2012
Location: USA
Gender: Female
Nature: Bold
Posts: 5
Send a message via Skype™ to Jenna573
Hello, all. Before I ask my question, I might as well introduce myself. Name's Jen. I'm new to this site as well as to Pokemon Essentials/RPG Maker in general. I am not really good with coding, but I am good with numbers and logic in general, so as long as I see a string of code in action, I can use trial and error to figure out what it does, at least on some level. It's a lot of guess work for me, but it's better than nothing.

Despite being unable to code independently, and having minimal artistic skill, if any, I've managed to MS-Paint myself some minor menus and icons and threw in the animated Black and White sprite-pack that was provided on this site. I've got a very long road ahead of me, with far too many questions that need answering. I'll be trying my hardest to figure them out on my own, but I feel like I might have a general idea of what is needed for this particular one, so I decided to ask it formally.

I'm interested in placing a move's info/description on the fight menu during battle. I think I've found the string(s) of code that call for the info to be displayed, at least in the pokemon summary screen. Could this be placed into the 'PokeBattle_ActualScene' script to make it display there as well? (Please correct me if ActualScene isn't even the right script. I had the right one earlier, but I've been working on my game for several hours since and may have gotten it mixed up.)

The piece of code I think might work is this:
Code:
class PokemonTemp
  attr_accessor :pokemonMoveData

  def pbOpenMoveData
    if !self.pokemonMoveData
      pbRgssOpen("Data/moves.dat","rb"){|f|
         self.pokemonMoveData=f.read
      }
    end
    if block_given?
       StringInput.open(self.pokemonMoveData) {|f| yield f }
    else
       return StringInput.open(self.pokemonMoveData)
    end
  end
end
I'm sure it has to be modified quite a bit before it would be suitable, but there's no way for me to even begin a trial and error with this. Anyone care to help? I have searched the site, but maybe I'm searching for all the wrong terms?

I've attached my example screenshot. Thanks in advance!
Attached Thumbnails
Pre-Alpha Pre-Demo Preenshot HELP.jpg‎  
Reply With Quote
  #2    
Old June 17th, 2012 (03:45 AM).
Nickalooose Nickalooose is offline
--------------------
 
Join Date: Mar 2008
Gender: Female
Posts: 1,161
First of all, Hello Jen, welcome to PokéCommunity haha... I'm the same as you, I don't know much, well I know a little now, most of the time I'm wrong, but I trial and error quite the same, the best way to learn, so well done for your attempts.

Now, this is everything on how would look into this and what I would do, this is not neccessarily correct, but what I would look for, is the move description.

Code:
    drawTextEx(overlay,4,218,238,5,
       pbGetMessage(MessageTypes::MoveDescriptions,moveid),
       Color.new(64,64,64),Color.new(176,176,176))
You're right, in PokemonSummary, was where you would find this, everything here is still needed to be changed and defined later on.

I would then start looking here, PokeBattle_ActualScene.
Code:
  def refresh(index,moves)
    return if !moves
    self.contents.clear
    moveboxes=_INTL("Graphics/Pictures/battleFightButtons")
    pbSetNarrowFont(self.contents)
    for i in 0...4
      next if i==index
      next if moves[i].id==0
      x=((i%2)==0) ? 4 : 192
      y=((i/2)==0) ? 0 : 42
      self.contents.blt(x,y,@buttonbitmap.bitmap,Rect.new(0,moves[i].type*46,192,46))
      movename=[[_INTL("{1}",moves[i].name),x+96,y+8,2,
         PokeBattle_Scene::MENUBASECOLOR,PokeBattle_Scene::MENUSHADOWCOLOR]]
      pbDrawTextPositions(self.contents,movename)
    end
    for i in 0...4
      next if i!=index
      next if moves[i].id==0
      x=((i%2)==0) ? 4 : 192
      y=((i/2)==0) ? 0 : 42
      self.contents.blt(x,y,@buttonbitmap.bitmap,Rect.new(192,moves[i].type*46,192,46))
      self.contents.blt(416,14,@typebitmap.bitmap,Rect.new(0,moves[i].type*28,64,28))
      texts=[[_INTL("{1}",moves[i].name),x+96,y+8,2,
         PokeBattle_Scene::MENUBASECOLOR,PokeBattle_Scene::MENUSHADOWCOLOR]]
      ppcolors=[PokeBattle_Scene::MENUBASECOLOR,PokeBattle_Scene::MENUSHADOWCOLOR,
                PokeBattle_Scene::MENUBASECOLOR,PokeBattle_Scene::MENUSHADOWCOLOR,
                Color.new(248,192,0),Color.new(144,104,0),  # Yellow (1/2 or lower)
                Color.new(248,136,32),Color.new(144,72,24), # Orange (1/4 or lower)
                Color.new(248,72,72),Color.new(136,48,48)]  # Red (zero)
      ppfraction=(4.0*moves[i].pp/moves[i].totalpp).ceil
      texts.push([_INTL("PP: {1}/{2}",moves[i].pp,moves[i].totalpp),
         448,44,2,ppcolors[(4-ppfraction)*2],ppcolors[(4-ppfraction)*2+1]])
      pbDrawTextPositions(self.contents,texts)
    end
  end
end
You see the highlighted bits, this is where I would check, this is where it's finding the move type and name... I feel I'm getting close to what I want to achieve... (remember, whatever you edit, TAKE NOTE)... You're going to have to find your new position and graphics yourself, I'm trying to point you in the right direction here as I don't have any of the same graphics you do.

Maybe this is a good place to start while you have no answers, as long as you take note on what you done, when you edit something, if it doesn't work, you can just remove it easily... I saw nobody gave you an answer and I wanted to help even when I have no idea what I'm doing, let's hope you can work this out or someone can help you completely, sorry I could'nt do any of this for you though.
Reply With Quote
  #3    
Old June 17th, 2012 (05:02 PM).
Jenna573's Avatar
Jenna573 Jenna573 is offline
Retired Pokemon Master
 
Join Date: Jun 2012
Location: USA
Gender: Female
Nature: Bold
Posts: 5
Send a message via Skype™ to Jenna573
Thanks for responding. As far as
Quote originally posted by Nickalooose:
Code:
    drawTextEx(overlay,4,218,238,5,
       pbGetMessage(MessageTypes::MoveDescriptions,moveid),
       Color.new(64,64,64),Color.new(176,176,176))
goes, I don't think that "MoveDescriptions" is a valid command or protocol. Like other code in that script, I'd need to define it myself in order to have the script understand what I'm even referring to. (Unless I am mistaken, then please correct me) Example:
Code:
self.contents.blt(x,y,@buttonbitmap.bitmap,Rect.new(0,moves[i].type*25,300,25))
      movename=[[_INTL("{1}",moves[i].name),x+190,y-4,2,
         PokeBattle_Scene::MENUBASECOLOR,PokeBattle_Scene::MENUSHADOWCOLOR]]
      pbDrawTextPositions(self.contents,movename)
The bottom line calls for "self.contents" and "movename" to be listed. self.contents was defined earlier up in the script, but movename can be seen as defined in the second line of that code. I basically need to do this with something like "movedata" or whichever, but am uncertain of what to write, as I simply do not understand this language.To be honest, I don't even know what language it is. (Python? etc?) I don't understand what simple and often reoccurring things like "_INTL" mean, which doesn't help.
Reply With Quote
  #4    
Old June 17th, 2012 (08:09 PM). Edited June 17th, 2012 by Nickalooose.
Nickalooose Nickalooose is offline
--------------------
 
Join Date: Mar 2008
Gender: Female
Posts: 1,161
It's ruby, rgss... _INTL is usually a print message, for example:

Kernel.pbMessage(_INTL("{1} used {2}.",pkmn.name,pkmn.move))

Could possibly print a message saying something like:

Pikachu used Thundershock.

defining something to an array is easy, an array is something that could hold any kind of data, be it numbers, words, code, anything (as far as I can tell anyway).

name
move
happiness
gender
species

Are all holding data being defined somewhere to do what they do.

So

If I had this
Code:
def SimpleEquasion

 $game_variables[333]=4
 number=6
 something=$game_variables[333]
 hey=pkmn.name

 if something+number==10
  Kernel.pbMessage(_INTL("{1} got this correct.",hey))
 else
  Kernel.pbMessage(_INTL("Wrong.  Try again!"))
 end
end
hey is defined to be a Pokémon name, i.e. Pikachu, Dragonite, Celebi etc. Although it would be easier to just put "pkmn.name" instead of "hey".

The green lines are defining "something" to "something".
The blue lines are working out the something I defined earlier.
The red lines are everything else, here they would start the "def" and end it.

So, making something read from moves.txt would look similar,

movedata=PBMoveData.new(moveid)
move=moveid


Although I'm pretty sure you should be using:

(pbGetMessage(MessageTypes::MoveDescriptions,i)) maybe moveid instead of i

I'm not sure because mine doesn't work properly, but check your editor for adding moves to Pokémon, if there is a description there, search in PokemonEditor script section for the line of code that would have MessageTypes::MoveDescriptions, in.

It is pretty late (early in all fairness, but when I read this I wanted to comment before I forget), I've just finished work and I'm kind of tired so I don't want to do this script for you right now, even though I haven't looked into this and text positioning is not my area of expertice (although I have been putting that off for my game haha, maybe I should learn soon, maybe)... I'm giving you the bases of what you could try and where to look, without your screen, graphics and everything else, I can't attempt this myself, as we discovered earlier, I'm a trial and error kind of girl, and you said you were to.

Everything that was shown to you would need to of been edited nonetheless, you would've needed to define what overlay did and textpos, it wasn't as simple as using what I gave you... I'm trying my hardest to learn this language myself and I am new to this and I could teach you a few of the easy things, like :variables, :switches, :arrays, :reading from .txt files, :use of _INTL, :use of command and cmd, :using >, <, =, +, -, /and *, :using && and ||, :using if, when, for, case, else, elsif and rand... The list is quite long, but, I'm still very new to this, there is so much to learn, as you probably can see.

Luckily for me I had someone who kind of taught me along the way, and, Maruno and FL . are also doing a good job with explaining and pointing in the right direction for things.

When I get up in about 8-9 maybe 10, hours, if you still haven't worked this out and nobody else has answered you, I'll look into this a bit more, maybe.
Reply With Quote
  #5    
Old June 17th, 2012 (11:11 PM).
Jenna573's Avatar
Jenna573 Jenna573 is offline
Retired Pokemon Master
 
Join Date: Jun 2012
Location: USA
Gender: Female
Nature: Bold
Posts: 5
Send a message via Skype™ to Jenna573
WOW. Thank you. That last response was incredibly helpful. Just from you saying
Quote:
It's ruby, rgss... _INTL is usually a print message, for example:

Kernel.pbMessage(_INTL("{1} used {2}.",pkmn.name,pkmn.move))

Could possibly print a message saying something like:

Pikachu used Thundershock.
I was able to understand the entire block of example code you provided. Thank you so much.

Right now it's 3am over here and I'm quite tired myself, but when I wake up I'll be working on it some more. When you said you weren't good at text positioning, did you mean getting text to appear at all, or simply mapping it's coordinates using the x/y axis provided in this language? The latter is incredibly simple for me to do, and if you need help with that I'd be glad to be able to give something back, if possible.

Also, there's no need for you to code that part of the script FOR me. (Unless of course you are attempting the same thing in your game, already. ) I wouldn't learn as much that way.
Reply With Quote
  #6    
Old June 18th, 2012 (05:35 AM).
Nickalooose Nickalooose is offline
--------------------
 
Join Date: Mar 2008
Gender: Female
Posts: 1,161
Haha no problem, there are a few tutorials online, but they don't explain easy enough and don't get to the point, I described what _INTL does, in one sentence, if you search online it would take almost half a page of text, nobody wants that... If you need a quick explanation on how to use anything else, just ask.

As for your text positioning, I have no idea of any of it at the moment, I haven't needed it, and the thing I do need it for, isn't a priority, so haven't bothered to look in to... Any help is good help I guess haha.

Well if I do manage to figure this out before you, then I will let you know and vice versa please haha.
Reply With Quote
  #7    
Old June 18th, 2012 (11:42 AM).
Jenna573's Avatar
Jenna573 Jenna573 is offline
Retired Pokemon Master
 
Join Date: Jun 2012
Location: USA
Gender: Female
Nature: Bold
Posts: 5
Send a message via Skype™ to Jenna573
Still working on it. So far only managed to add a whole bunch of useless strings of code to the script, but one step at a time, I guess. At least it doesn't error out anymore.

If you need help with x/y positioning for text or graphics, I'd be more than happy to voice chat with you on skype. If I need to use visual examples, I can point my camera toward my monitor and zoom in on things to point them out. If you have skype, then add me. I'll add my screenname to my contact info.
Reply With Quote
  #8    
Old June 19th, 2012 (07:05 AM).
FL's Avatar
FL FL is offline
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Posts: 1,481
Quote originally posted by Nickalooose:
It's ruby, rgss... _INTL is usually a print message
Actually _I, _INTL and _ISPRINTF are Poccil made method in PBIntl script. The main reason for this method is translation. I think that 'INTL' mean international.
__________________
Reply With Quote
  #9    
Old June 19th, 2012 (01:29 PM).
Jenna573's Avatar
Jenna573 Jenna573 is offline
Retired Pokemon Master
 
Join Date: Jun 2012
Location: USA
Gender: Female
Nature: Bold
Posts: 5
Send a message via Skype™ to Jenna573
Quote originally posted by FL .:
Actually _I, _INTL and _ISPRINTF are Poccil made method in PBIntl script. The main reason for this method is translation. I think that 'INTL' mean international.
I had thought that's what it meant as well, but I didn't understand what "international" could possibly have to do with the code, so I abandoned the thought. If it doesn't relay a message within the game, exactly what command is making the appropriate messages or graphics show up? Would the codes all work without the _INTL command, or is it required to communicate these scripts to the rpg maker?
Reply With Quote
  #10    
Old June 21st, 2012 (04:58 PM).
FL's Avatar
FL FL is offline
Pokémon Island Creator
 
Join Date: Sep 2010
Gender: Male
Posts: 1,481
Quote originally posted by Jenna573:
I had thought that's what it meant as well, but I didn't understand what "international" could possibly have to do with the code, so I abandoned the thought. If it doesn't relay a message within the game, exactly what command is making the appropriate messages or graphics show up? Would the codes all work without the _INTL command, or is it required to communicate these scripts to the rpg maker?
The _INTL is a method made by Poccil in Pokémon Essentials
The '_INTL("{1} used {2}.",pkmn.name,pkmn.move)' does the same thing that '("pkmn.name+" used "+pkmn.move)', but the texts between INTL are detects by the translation system (http://pokemonessentials.wikia.com/wiki/Translating_the_game).
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links

You may also like.. (Beta)
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 04:23 PM.