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.

Last Help Needed

I have basically all the scripts i need, except i do have little issues with them.

I'm wondering if anyone would review all my scripts and check to make them work together whatsoever.

Since I'm not really the best scripter.

This would be my last request.

I can post a link to a project with all my scripts if i obtain a reply.
 
Cassandrainbows":2eaaagkh said:
It is XP thanks i hope you can clear this out.

I only have 2 Bugs

Bug 1 : (Minor) : A little bit of lag with the menus

Bug 2 : (Medium) : HP/SP Numbers no longer show in menu or battle.

If you can fix the compatibility issues within these scripts i would be dearly grateful.

Heres a Link to the scripts.

http://www.mediafire.com/download/r7fhm ... ityFix.zip
With the HP/SP text, did you still want the pink bar next to the heart to represent HP as well as the one underneath? This bar is the one overriding the original text. I can place the text back on top if you'd like, but then you still have the two HP bars.
Likewise for the SP bar as well.
 
I find two Bars being a Minor bug really, if you want to make it one, i believe the one with the heart and magic symbol would be best.

Aslong as everything works and it looks fine, with the numbers is all :) thanks for the reply too.

If you have to get rid of that HP bar so that theres only 1, so be it.
 
Yeah, been looking at it for a bit. It's a little tricky because there's so many custom scripts.
I'm just working out some final text drawing bugs at the second then I can send you a script to fix the bar problem.

I don't know what causes the lag, unfortunately.

EDIT: Place this above main
Code:
class Window_Base

  def draw_actor_hp(actor, x, y, width = 144, text = true)

    # Draw hp bar

    bitmap = RPG::Cache.acms_menusprite("HP")

    rect = Rect.new(x + BAR_PADDING, y, (width - 2 * BAR_PADDING) * actor.hp / actor.maxhp, bitmap.height)

    self.contents.stretch_blt(rect, bitmap, Rect.new(0, 0,

      bitmap.width * actor.hp / actor.maxhp, bitmap.height), opacity)

    bitmap = RPG::Cache.acms_menusprite("Gauge")

    rect = []

    w = bitmap.width / 3

    for i in 0...3

      rect << Rect.new(i * w, 0, w, bitmap.height)

    end

    self.contents.blt(x, y, bitmap, rect[0], opacity)

    i = w

    while i < width - 2 * w

      self.contents.blt(x + i, y, bitmap, rect[1], opacity)

      i += w

    end

    rect[1].width = (width - 1) % w + 1

    self.contents.blt(x + i, y, bitmap, rect[1], opacity)

    i += (width - 1) % w + 1

    self.contents.blt(x + i, y, bitmap, rect[2], opacity)

    # Draw hp name

    rect = self.contents.text_size($data_system.words.hp)

    self.contents.draw_text(x, y + (bitmap.height - rect.height) / 2, 32, 32, $data_system.words.hp, opacity)

    

    self.contents.font.color = Color.new(255,255,255)

    sz = self.contents.font.size

    self.contents.font.size = 18

    self.contents.font.bold = true

    self.contents.draw_text_outline(x-16, y-8, width, 32, sprintf("%4d/%4d", actor.hp, actor.maxhp),2)

    self.contents.font.size = sz

    self.contents.font.bold = false

    return unless text

    # Draw hp

   # self.contents.mp_draw_text(x + 32 + 8, y, width, 32, sprintf("%4d/%4d", actor.hp, actor.maxhp),0)

  end

 

  def draw_actor_sp(actor, x, y, width = 144, text = true)

    # Draw sp bar

    bitmap = RPG::Cache.acms_menusprite("SP")

    rect = Rect.new(x + BAR_PADDING, y, (width - 2 * BAR_PADDING) * actor.sp / actor.maxsp, bitmap.height)

    self.contents.stretch_blt(rect, bitmap, Rect.new(0, 0,

      bitmap.width * actor.sp / actor.maxsp, bitmap.height), opacity)

    bitmap = RPG::Cache.acms_menusprite("Gauge")

    rect = []

    w = bitmap.width / 3

    for i in 0...3

      rect << Rect.new(i * w, 0, w, bitmap.height)

    end

    self.contents.blt(x, y, bitmap, rect[0], opacity)

    i = w

    while i < width - 2 * w

      self.contents.blt(x + i, y, bitmap, rect[1], opacity)

      i += w

    end

    rect[1].width = (width - 1) % w + 1

    self.contents.blt(x + i, y, bitmap, rect[1], opacity)

    i += (width - 1) % w + 1

    self.contents.blt(x + i, y, bitmap, rect[2], opacity)

    # Draw sp name

    rect = self.contents.text_size($data_system.words.sp)

    self.contents.draw_text(x, y + (bitmap.height - rect.height) / 2, 32, 32, $data_system.words.sp, opacity)

    

    self.contents.font.color = Color.new(255,255,255)

    sz = self.contents.font.size

    self.contents.font.size = 18

    self.contents.font.bold = true

    self.contents.draw_text_outline(x-16, y-8, width, 32, sprintf("%4d/%4d", actor.sp, actor.maxsp),2)

    self.contents.font.bold = false

    self.contents.font.size = sz

 

    #return unless text

    # Draw sp

  end

end

 

class Bitmap

  def draw_text_outline(x,y,w,h,s,align=0)

    c = font.color.dup

    font.color = Color.new(0,0,0)

    draw_text(x,  y+1 ,w  ,h,s,align)

    draw_text(x+2,y+1 ,w,h,s,align)

    

    draw_text(x+1,y   ,w,h  ,s,align)

    draw_text(x+1,y+2 ,w,h,s,align)

    

    font.color = c

    mp_draw_text(x+1,  y+1 ,w,h,s,align)

  end

end

 

 

class Window_Status < Window_Base

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    draw_actor_graphic(@actor, 16, 48)

    draw_actor_name(@actor, 40, 0)

    #draw_actor_class(@actor, 160, 0)

    draw_actor_level(@actor, 160, 0)

    draw_actor_state(@actor, 224, 0)

    draw_actor_hp(@actor, 64, 44, 192, true)

    draw_actor_sp(@actor, 64, 64, 192, true)

    

    self.contents.font.color = system_color

    self.contents.draw_text(0, 88, 40, 32, "EXP")

    self.contents.draw_text(128, 88, 40, 32, "NEXT")

    self.contents.font.color = normal_color

    self.contents.draw_text(24, 88, 80, 32, @actor.exp_s, 2)

    self.contents.draw_text(152, 88, 80, 32, @actor.next_rest_exp_s, 2)

    draw_actor_parameter(@actor, 0, 120, 0)

    draw_actor_parameter(@actor, 0, 144, 1)

    draw_actor_parameter(@actor, 0, 168, 2)

    draw_actor_parameter(@actor, 0, 192, 3)

    draw_actor_parameter(@actor, 0, 216, 4)

    draw_actor_parameter(@actor, 0, 240, 5)

    draw_actor_parameter(@actor, 0, 264, 6)

    draw_item_name($data_weapons[@actor.weapon_id], 120, 120, 136)

    draw_item_name($data_armors[@actor.armor1_id], 120, 152, 136)

    draw_item_name($data_armors[@actor.armor2_id], 120, 184, 136)

    draw_item_name($data_armors[@actor.armor3_id], 120, 216, 136)

    draw_item_name($data_armors[@actor.armor4_id], 120, 248, 136)

  end

end
 
Maybe the lag is the overflow of menu's in the ACMS, as i have a custom Equip Menu, it might collide with the ACMS Equip Menu, Hopefully the Missionmenu (quest log) works aswell as the level up menu, those are probably the things that cause menu lags, possible in the inanimated menus, the ACMS(animated menu) is still applying (in the background but you don't see it) causing lag, although lag is really not the issue at hand for me it's mainly making everything work together (compatibility).

Thanks for your response and Script, I will def try it out.
If theres anything you add/need to add, do let me know :)
 
Cassandrainbows":1fq56t1f said:
Script line 35 : ''Return unless text'' Syntax Error when launching the game.

In your script that i added above main, thanks still.
There shouldn't be a capital R in return, if that's exactly what line 35 had. The code I posted worked fine, try copying it over again.
If that still doesn't work for some magical reason, you can use this. It is literally just what I wrote before without some of the useless garbage.
Code:
class Window_Base

  def draw_actor_hp(actor, x, y, width = 144, text = true)

    # Draw hp bar

    bitmap = RPG::Cache.acms_menusprite("HP")

    rect = Rect.new(x + BAR_PADDING, y, (width - 2 * BAR_PADDING) * actor.hp / actor.maxhp, bitmap.height)

    self.contents.stretch_blt(rect, bitmap, Rect.new(0, 0,

      bitmap.width * actor.hp / actor.maxhp, bitmap.height), opacity)

    bitmap = RPG::Cache.acms_menusprite("Gauge")

    rect = []

    w = bitmap.width / 3

    for i in 0...3

      rect << Rect.new(i * w, 0, w, bitmap.height)

    end

    self.contents.blt(x, y, bitmap, rect[0], opacity)

    i = w

    while i < width - 2 * w

      self.contents.blt(x + i, y, bitmap, rect[1], opacity)

      i += w

    end

    rect[1].width = (width - 1) % w + 1

    self.contents.blt(x + i, y, bitmap, rect[1], opacity)

    i += (width - 1) % w + 1

    self.contents.blt(x + i, y, bitmap, rect[2], opacity)

    # Draw hp name

    rect = self.contents.text_size($data_system.words.hp)

    self.contents.draw_text(x, y + (bitmap.height - rect.height) / 2, 32, 32, $data_system.words.hp, opacity)

    

    self.contents.font.color = Color.new(255,255,255)

    sz = self.contents.font.size

    self.contents.font.size = 18

    self.contents.font.bold = true

    self.contents.draw_text_outline(x-16, y-8, width, 32, sprintf("%4d/%4d", actor.hp, actor.maxhp),2)

    self.contents.font.size = sz

    self.contents.font.bold = false

  end

 

  def draw_actor_sp(actor, x, y, width = 144, text = true)

    # Draw sp bar

    bitmap = RPG::Cache.acms_menusprite("SP")

    rect = Rect.new(x + BAR_PADDING, y, (width - 2 * BAR_PADDING) * actor.sp / actor.maxsp, bitmap.height)

    self.contents.stretch_blt(rect, bitmap, Rect.new(0, 0,

      bitmap.width * actor.sp / actor.maxsp, bitmap.height), opacity)

    bitmap = RPG::Cache.acms_menusprite("Gauge")

    rect = []

    w = bitmap.width / 3

    for i in 0...3

      rect << Rect.new(i * w, 0, w, bitmap.height)

    end

    self.contents.blt(x, y, bitmap, rect[0], opacity)

    i = w

    while i < width - 2 * w

      self.contents.blt(x + i, y, bitmap, rect[1], opacity)

      i += w

    end

    rect[1].width = (width - 1) % w + 1

    self.contents.blt(x + i, y, bitmap, rect[1], opacity)

    i += (width - 1) % w + 1

    self.contents.blt(x + i, y, bitmap, rect[2], opacity)

    # Draw sp name

    rect = self.contents.text_size($data_system.words.sp)

    self.contents.draw_text(x, y + (bitmap.height - rect.height) / 2, 32, 32, $data_system.words.sp, opacity)

    

    self.contents.font.color = Color.new(255,255,255)

    sz = self.contents.font.size

    self.contents.font.size = 18

    self.contents.font.bold = true

    self.contents.draw_text_outline(x-16, y-8, width, 32, sprintf("%4d/%4d", actor.sp, actor.maxsp),2)

    self.contents.font.bold = false

    self.contents.font.size = sz

  end

end

 

class Bitmap

  def draw_text_outline(x,y,w,h,s,align=0)

    c = font.color.dup

    font.color = Color.new(0,0,0)

    draw_text(x,  y+1 ,w  ,h,s,align)

    draw_text(x+2,y+1 ,w,h,s,align)

    

    draw_text(x+1,y   ,w,h  ,s,align)

    draw_text(x+1,y+2 ,w,h,s,align)

    

    font.color = c

    mp_draw_text(x+1,  y+1 ,w,h,s,align)

  end

end

 

 

class Window_Status < Window_Base

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    draw_actor_graphic(@actor, 16, 48)

    draw_actor_name(@actor, 40, 0)

    #draw_actor_class(@actor, 160, 0)

    draw_actor_level(@actor, 160, 0)

    draw_actor_state(@actor, 224, 0)

    draw_actor_hp(@actor, 64, 44, 192, true)

    draw_actor_sp(@actor, 64, 64, 192, true)

    

    self.contents.font.color = system_color

    self.contents.draw_text(0, 88, 40, 32, "EXP")

    self.contents.draw_text(128, 88, 40, 32, "NEXT")

    self.contents.font.color = normal_color

    self.contents.draw_text(24, 88, 80, 32, @actor.exp_s, 2)

    self.contents.draw_text(152, 88, 80, 32, @actor.next_rest_exp_s, 2)

    draw_actor_parameter(@actor, 0, 120, 0)

    draw_actor_parameter(@actor, 0, 144, 1)

    draw_actor_parameter(@actor, 0, 168, 2)

    draw_actor_parameter(@actor, 0, 192, 3)

    draw_actor_parameter(@actor, 0, 216, 4)

    draw_actor_parameter(@actor, 0, 240, 5)

    draw_actor_parameter(@actor, 0, 264, 6)

    draw_item_name($data_weapons[@actor.weapon_id], 120, 120, 136)

    draw_item_name($data_armors[@actor.armor1_id], 120, 152, 136)

    draw_item_name($data_armors[@actor.armor2_id], 120, 184, 136)

    draw_item_name($data_armors[@actor.armor3_id], 120, 216, 136)

    draw_item_name($data_armors[@actor.armor4_id], 120, 248, 136)

  end

end
 
Alright thanks, I'll put it in my USB tomorrow so i can test it, I'll give you news tomorrow if anything works fine or not, and I believe the line 35 Return Unless Text the R is minimal, so that little fix should prolly do the trick, are you testing all the other scripts to see if everything works?
 
I can't post the fixed project because my net is too slow and it will take all day.
Put the script I gave you above main and it should work. I took it straight from the demo, because I built it there.
 
Sorry for the late late reply, i had no internet for all that time and so i couldn't even get to try it, I will do so now that i have internet at home again :D, Hopefully you're still around and will forgive this Late thanks, I really thank you for trying to help me out with scripting wether in the end it works or not, even though I'm pretty sure it will work, It is kind of you to have put time on it.

Time for me to test this and start going HAM on my RPG :D
 
Sorry for the triple post, but hey, THANKS ALOT, i just tested the last script you posted and A1, even the battle events work, thanks Alot ZenVirZan, I owe you one.

If you wish to discuss projects, or assist me on mine or just talk, you can contact me directly if you want :)
I do have a few optional tweaks but they aren't really big needs so it's all good.

Thanks alot again, and your script does work :D (Even though you knew alrdy)
 

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