Main Menu
  • Welcome to The RPG Maker Resource Kit.

How would I put a battler in my CMS? [resolved]

Started by Atracious, March 13, 2007, 01:33:05 PM

0 Members and 1 Guest are viewing this topic.

Atracious

I am learning how to script and i plan on making a CMS, but i want to have the battler show up in one menu, or at least the face, how would i do this? Thanks for the help in advance!  ;D
"Facts are useless. You could use facts to prove anything that's even remotely true." Homer Jay Simpson

"I do not know what weapons WWIII will be fought with but i know WWIV will be fought with sticks and stones" Albert Einstein

"It's better to have loved and lost than never to have loved at all." from In Memoriam, by Alfred, Lord Tennyson.

"all your base are belonging to us!" awful fantasy 3

"the grapes damb it, it's alway's the grapes!"

Funny anagrams:
Desperation=A rope ends it
Mother in law=Woman hitler
Lottery machine=Money lost in 'em
Election results=Lies lets recount
Dormitory=Dirty room
Snooze alarms=Alas! No more Z's
Eleven plus two=Twelve plus one
Cosmetic surgery="Yes, I correct mugs."
The IRS=Theirs!
Public relations=Crap, built on lies
Astronomer=Moon starer
Dementia="Detain me."
Internet chat rooms=The moron interacts
The eyes!=They see!

Currently making:
http://rmrk.net/index.php/topic,13132.0.html

blazinhandle

you would have to have a Window_Base definition of what exactly u want to draw....

this is for faces:

  #--------------------------------------------------------------------------
  # * Draw Face Graphic
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y)
    if $game_party.actors.size != 0
      bitmap = RPG::Cache.picture("Faces/" + actor.character_name)
      self.contents.blt(x - 40, y - 80, bitmap, Rect.new(0, 0, 80, 80))
    end
  end
  def draw_actor_graphicb(actor, x, y)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end


but you need to have a folder called "Faces" inside of your "pictures" folder. In that Faces folder you'll need to have the faces you want but they must be 80x80.

THEN

in your CMS you'll just have to draw them with something like this:

draw_actor_graphic(@actor, X POSITION WHERE U WANT THE FACE PLACED, Y POSITION WHERE U WANT THE FACE PLACED)

as you can see....it says "draw_actor_graphic" and ur prolly thinking "don't i need to draw the face graphics?" Well, what you did in the Window_Base (you did place the coding above in window_base didn't you?) was redo the draw_actor_graphic to draw faces (I just have it titled draw face graphic in my comments so I can remember ;)) There you go!

Atracious

#2
Quote from: blazinhandle on March 13, 2007, 05:36:13 PM
[spoiler]you would have to have a Window_Base definition of what exactly u want to draw....

this is for faces:

  #--------------------------------------------------------------------------
  # * Draw Face Graphic
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_graphic(actor, x, y)
    if $game_party.actors.size != 0
      bitmap = RPG::Cache.picture("Faces/" + actor.character_name)
      self.contents.blt(x - 40, y - 80, bitmap, Rect.new(0, 0, 80, 80))
    end
  end
  def draw_actor_graphicb(actor, x, y)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end


but you need to have a folder called "Faces" inside of your "pictures" folder. In that Faces folder you'll need to have the faces you want but they must be 80x80.

THEN

in your CMS you'll just have to draw them with something like this:

draw_actor_graphic(@actor, X POSITION WHERE U WANT THE FACE PLACED, Y POSITION WHERE U WANT THE FACE PLACED)

as you can see....it says "draw_actor_graphic" and ur prolly thinking "don't i need to draw the face graphics?" Well, what you did in the Window_Base (you did place the coding above in window_base didn't you?) was redo the draw_actor_graphic to draw faces (I just have it titled draw face graphic in my comments so I can remember ;)) There you go!
[/spoiler]
so what do i do with this? I'm pretty noob, I just went through the "read this before asking for help" thing and noticed there wasn't anything on Battlers :| Sorry for being a noob! And 80x80 is kinda small...
Also i don't want it to affect the existing battlers...
"Facts are useless. You could use facts to prove anything that's even remotely true." Homer Jay Simpson

"I do not know what weapons WWIII will be fought with but i know WWIV will be fought with sticks and stones" Albert Einstein

"It's better to have loved and lost than never to have loved at all." from In Memoriam, by Alfred, Lord Tennyson.

"all your base are belonging to us!" awful fantasy 3

"the grapes damb it, it's alway's the grapes!"

Funny anagrams:
Desperation=A rope ends it
Mother in law=Woman hitler
Lottery machine=Money lost in 'em
Election results=Lies lets recount
Dormitory=Dirty room
Snooze alarms=Alas! No more Z's
Eleven plus two=Twelve plus one
Cosmetic surgery="Yes, I correct mugs."
The IRS=Theirs!
Public relations=Crap, built on lies
Astronomer=Moon starer
Dementia="Detain me."
Internet chat rooms=The moron interacts
The eyes!=They see!

Currently making:
http://rmrk.net/index.php/topic,13132.0.html

Tsunokiette

draw_actor_battler(actor_id,x,y)

?

Sorry I have to chuckle.

OVERCOMPLICATION
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They're bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I'm the only one, I'm the only one."

blazinhandle

Quote from: atracious on March 14, 2007, 01:48:41 AM
so what do i do with this? I'm pretty noob, I just went through the "read this before asking for help" thing and noticed there wasn't anything on Battlers :| Sorry for being a noob! And 80x80 is kinda small...
80x80 is small, so just adjust sizes in here by replacing the 80s with your desired size(but you need to adjust the position of it):
self.contents.blt(x - 40, y - 80, bitmap, Rect.new(0, 0, 80, 80))
Put this in the script called "Window_Base" using the script editor and Replace it for the default "draw_actor_graphic":
[spoiler]  def draw_actor_graphic(actor, x, y)
    if $game_party.actors.size != 0
      bitmap = RPG::Cache.picture("Faces/" + actor.character_name)
      self.contents.blt(x - 40, y - 80, bitmap, Rect.new(0, 0, 80, 80)) # Or w/e size u want
    end
  end
  def draw_actor_graphicb(actor, x, y)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
[/spoiler]

Quote from: atracious on March 14, 2007, 01:48:41 AM
Also i don't want it to affect the existing battlers...
Quote from: atracious on March 14, 2007, 01:48:41 AM

Put this in window_base just as you did before:
  def draw_actor_battler(actor, x, y)
    battler = RPG::Cache.picture("Battlers/" + actor.character_name)
    bw = battler.width
    bh = battler.height
    src_rect = Rect.new(0, 0, bsw, bsh)
    self.contents.blt(x - bsw / 23, y - bsh, battler, src_rect)
  end


Now in window_status or window_menustatus or w/e window u want to draw the battler in...just place this in it:

draw_actor_battler(actor, X POSITION, Y POSITION)

Atracious

Quote from: Tsunokiette on March 14, 2007, 02:18:19 AM
draw_actor_battler(actor_id,x,y)

?

Sorry I have to chuckle.

OVERCOMPLICATION
I have to laugh back, I've tried that before, it doesn't work, that's why i made this topic. I get this:

"Facts are useless. You could use facts to prove anything that's even remotely true." Homer Jay Simpson

"I do not know what weapons WWIII will be fought with but i know WWIV will be fought with sticks and stones" Albert Einstein

"It's better to have loved and lost than never to have loved at all." from In Memoriam, by Alfred, Lord Tennyson.

"all your base are belonging to us!" awful fantasy 3

"the grapes damb it, it's alway's the grapes!"

Funny anagrams:
Desperation=A rope ends it
Mother in law=Woman hitler
Lottery machine=Money lost in 'em
Election results=Lies lets recount
Dormitory=Dirty room
Snooze alarms=Alas! No more Z's
Eleven plus two=Twelve plus one
Cosmetic surgery="Yes, I correct mugs."
The IRS=Theirs!
Public relations=Crap, built on lies
Astronomer=Moon starer
Dementia="Detain me."
Internet chat rooms=The moron interacts
The eyes!=They see!

Currently making:
http://rmrk.net/index.php/topic,13132.0.html

Blizzard

  def draw_actor_battler(actor, x, y)
    if actor != nil and actor.battler_name != ""
      bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
      cw = bitmap.width
      ch = bitmap.height
      src_rect = Rect.new(0, 0, cw,ch)
      self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
    end
  end


You need to ADD THIS to Window_Base first. xD And it's "battler", not "battle".

Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!

Atracious

 :tpg: OMG IT WORKS! thank you Blizzard, Tsunokiette, and blazinhandle!
"Facts are useless. You could use facts to prove anything that's even remotely true." Homer Jay Simpson

"I do not know what weapons WWIII will be fought with but i know WWIV will be fought with sticks and stones" Albert Einstein

"It's better to have loved and lost than never to have loved at all." from In Memoriam, by Alfred, Lord Tennyson.

"all your base are belonging to us!" awful fantasy 3

"the grapes damb it, it's alway's the grapes!"

Funny anagrams:
Desperation=A rope ends it
Mother in law=Woman hitler
Lottery machine=Money lost in 'em
Election results=Lies lets recount
Dormitory=Dirty room
Snooze alarms=Alas! No more Z's
Eleven plus two=Twelve plus one
Cosmetic surgery="Yes, I correct mugs."
The IRS=Theirs!
Public relations=Crap, built on lies
Astronomer=Moon starer
Dementia="Detain me."
Internet chat rooms=The moron interacts
The eyes!=They see!

Currently making:
http://rmrk.net/index.php/topic,13132.0.html