08-31-2018, 04:20 AM
(This post was last modified: 08-31-2018, 04:21 AM by DerVVulfman.)
Okay, I got something for you.
The Scene_Menu script is your basic main menu. But it doesn't draw your characters.... It is handled by the Windows_ codes. Or more specifically right now the Window_MenuStatus class. But the Window_MenuStatus class doesn't hold the actual code that draws your character. It's the Window_Base class.
Window_Base is the 'base' class that holds a lot of resuable code that other Windows_ classes can access. And of that code, the one you would be looking at is the draw_actor_graphic method starting at line 108. We call the groups of code within a class as a 'method'. Another way of saying a function or subroutine as they're known in other programming languages.
The default draw_actor_graphic method looks like this:
Now assuming you are using the old Game_Variables, you can use code like this. Bare in mind, the below code takes the current actor's Charactername and includes the value of the game variable itself... IE: If aluxes's character is 001-Fighter01 ... and the value of Game_Variable 1 is 0, the system will look for 001-Fighter010. And if his character is 001-Fighter01 and the value in Game Variable 1 is 23, then it would look for 001-Fighter0123.
Now if you want to keep the default draw_actor_graphic method untouched, you could just add a new method, just so long as it is within Window_Base.
The Scene_Menu script is your basic main menu. But it doesn't draw your characters.... It is handled by the Windows_ codes. Or more specifically right now the Window_MenuStatus class. But the Window_MenuStatus class doesn't hold the actual code that draws your character. It's the Window_Base class.
Window_Base is the 'base' class that holds a lot of resuable code that other Windows_ classes can access. And of that code, the one you would be looking at is the draw_actor_graphic method starting at line 108. We call the groups of code within a class as a 'method'. Another way of saying a function or subroutine as they're known in other programming languages.
The default draw_actor_graphic method looks like this:
Code:
def draw_actor_graphic(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)
endNow assuming you are using the old Game_Variables, you can use code like this. Bare in mind, the below code takes the current actor's Charactername and includes the value of the game variable itself... IE: If aluxes's character is 001-Fighter01 ... and the value of Game_Variable 1 is 0, the system will look for 001-Fighter010. And if his character is 001-Fighter01 and the value in Game Variable 1 is 23, then it would look for 001-Fighter0123.
Code:
def draw_actor_graphic(actor, x, y)
# get a value from the Game_Variable matching your hero
pic = $game_variables[actor.id]
# Take the actor's graphic and include the value from the variable
charname = actor.character_name + pic.to_s
# Draw it with the new character name with the suffix
bitmap = RPG::Cache.character(charname, 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)
endNow if you want to keep the default draw_actor_graphic method untouched, you could just add a new method, just so long as it is within Window_Base.

![[Image: QrnbKlx.jpg]](https://i.imgur.com/QrnbKlx.jpg)
![[Image: sGz1ErF.png]](https://i.imgur.com/sGz1ErF.png)
![[Image: liM4ikn.png]](https://i.imgur.com/liM4ikn.png)
![[Image: fdzKgZA.png]](https://i.imgur.com/fdzKgZA.png)
![[Image: sj0H81z.png]](https://i.imgur.com/sj0H81z.png)
![[Image: QL7oRau.png]](https://i.imgur.com/QL7oRau.png)
![[Image: uSqjY09.png]](https://i.imgur.com/uSqjY09.png)
![[Image: GAA3qE9.png]](https://i.imgur.com/GAA3qE9.png)
![[Image: 2Hmnx1G.png]](https://i.imgur.com/2Hmnx1G.png)
![[Image: BwtNdKw.png%5B]](https://i.imgur.com/BwtNdKw.png%5B)