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] Need help with the Ammo Left Script. DerVVulfman

Status
Not open for further replies.
Basically i figured out how to move some of the objects in this script.


Ammo Left
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Actor Ammunition
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_ammo(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 64, 32, "Ammo")
self.contents.font.color = normal_color
self.contents.draw_text(x + 64, y, 56, 32, actor.ammo_left.to_s, 2)
end
end



#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================

class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, -9) # draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 10, 120) # draw_actor_hp(actor, actor_x, 24, 120)
draw_actor_sp(actor, actor_x, 30, 120) # draw_actor_sp(actor, actor_x, 48, 120)
if @level_up_flags
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 100, 120, 32, "LEVEL UP!") #self.contents.draw_text(actor_x, 72, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 48) #draw_actor_state(actor, actor_x, 72)
end
draw_actor_ammo(actor, actor_x,69) #draw_actor_ammo(actor, actor_x,96)
end
end
end


Here's a screen
http://i31.photobucket.com/albums/c378/ ... system.png[/IMG]

But now there's a slight problem.

When the character gains a level the actors state statud dissapears.

For example here.

http://i31.photobucket.com/albums/c378/ ... ystem2.png[/IMG]

Basically i can't seem to figure out what is wrong with it. I ommited the original lines of the script in case something went wrong.
 
I'm not very good at scripting, but I think this is your problem:

if @level_up_flags
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 100, 120, 32, "LEVEL UP!") #self.contents.draw_text(actor_x, 72, 120, 32, "LEVEL UP!")
else
draw_actor_state(actor, actor_x, 48) #draw_actor_state(actor, actor_x, 72)
end


You are telling it that If Level up, draw "Level Up", and that is it. If not Level Up, then draw Actor State.

Basically, whenever you haven't leveled up, it will draw Actor State, but if Level Up is true, then it will draw Level Up, but you omitted the Actor State portion.
 
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