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.

[Resolved] Picture during Battle

Status
Not open for further replies.

Jackal

Member

Hi there

I'm using this japanese RTAB System with Minkoffs SideView script and want to add some little design.
As known, the Battlestatus windows is transparent. I made my own battlebars and would like to show them during the battle.

Thats the code i use:

Code:
def draw_picture(picture, x, y)
bitmap = RPG::Cache.picture("dragonhead.png")
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

The problem is, wherever i put it in, i can't see it during the battle. i tried it in every single class i found and i still see nothing.

Where I have to put this in?
 
Maybe...?
Code:
def draw_picture(picture, x, y)
  bitmap = RPG::Cache.picture(picture)
  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

I didn´t understand so much your problem, but in the way this script looks you missed to refer the RPG::Cache picture load to the name you pass to the method. It will always return a basic empty 32x32 bitmap when an invalid path and/or filename is passed (this is made to avoid errors in such cases. It won´t stop the game just because Dragonhead.png doesn´t exist, ya'know? ^^)
 

Jackal

Member

but the dragonhead.png does exist. when i make an event and call that as a script, I can see the picture on the screen. But during the battle, there is nothing. I tried it to put it in the RTAB System and in Minkoffs Animated Battler Script, but i still don't see anything.
 
So what´s the point to be obligated to pass a picture name anyway?
BTW...
Code:
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
This calculation is really confusing.
Code:
self.contents.blt(x - (cw / 2), y - (ch / 2), bitmap, src_rect)
Maybe you should post the script this piece is in, and hopefully it would help.
 

Jackal

Member

I should redefine my question for better understanding :D

OK. So, What I use:
(The scripts are here: http://www.rmxp.org/forums/showthread.php?t=4732)
- RTAB
- Animated Battlers - Enhanced
- BattleStatus Modification (RTAB Version) v 1.1

So, the BattleStatus Windows is normally transparent, when you use the Animated Battlers Script. I would like to show a picture there.

My problem is, that I don't know where to put the code in, so the picture would be shown. The picture is kind of a background for the names and hp/mp bars of the battlers.
 

Kaito

Member

You don't need that code...
First...In the RTAB script...Find:
Code:
    @spriteset = Spriteset_Battle.new
under there, put:
Code:
  @background =  Sprite.new
  @background.bitmap = RPG::Cache.picture("YerPicName") 
  @background.x = yerxvalue
  @background.y = yeryvalue
Then...Find:
Code:
    @message_window.dispose
Under there, put:
Code:
@background.dispose
Next...Find:
Code:
@spriteset.update
Under there...Put:
Code:
@background.update

And you're done. ^-^
 

Jackal

Member

Tried it, but still not working.
Could it be possible that this Animated Battler Script makes some conflicts?

I just removed the Animated Battler Script, and look there, it works, i can see my picture, but now i haw no sideview ks :D
 
Try changing the viewport or z value. I doubt that's it, but it's worth a shot.

The other possibility is that one of the addons overwrites the RTAB method you're trying to modify.
 
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