Main Menu
  • Welcome to The RPG Maker Resource Kit.

Simple Script Shop

Started by Rune, May 26, 2007, 11:12:37 PM

0 Members and 3 Guests are viewing this topic.

tSwitch

#150
sorry it took so long to get Halestorm's done
but here it is


#===============================================================================
# NAMKCOR's Requested 2-Member-CMS v1.00
#-------------------------------------------------------------------------------
# Features:
# > Upgraded Item Menu
#   -- Displays all items, how many in stock, and their sell price
# > Upgraded Status Menu
#   -- Streamlined design shows all necessary character information
# > Upgraded Main Menu
#   -- Shows both characters, icons for all their equipment, location window
#      gold and time windows
#   -- Icon display designed for use with Gullaime777's Multi-Slot-Equipment
#       if you aren't using the aforementioned script, but wish to use this
#       menu, PM/email me and I'll make a version for use without it
#-------------------------------------------------------------------------------
# Compatability:
#   Most likely incompatable with other CMSes
#   Most likely SDK compatable
#   Battler display WILL bug with ANY Animated Side View CBS
#   -No Known Incompatability Issues-
#-------------------------------------------------------------------------------
# Versions History:
#   1.00 - Finished all features, most likely bug free
#-------------------------------------------------------------------------------
# Bugs and Incompatability:
#  If you find bugs or incompatability issues with this script, contact me and
#  I will do what I can to make it compatable/fix whatever bugs you find
#-------------------------------------------------------------------------------
# Contact Info:
#   RMRK - NAMKCOR
#   ChaosProject - NAMKCOR
#   IMGHQ - NAMKCOR
#   E-Mail - Rockman922@aol.com -or- rockmanamkcor@yahoo.com
#-------------------------------------------------------------------------------
# Special Thanks:
#   Halestorm5 - for giving me my first CMS request :D
#-------------------------------------------------------------------------------
# This menu was created for Halestorm5 on rmrk
# This menu is only to be posted on RPG Maker Resource Kit, Chaos Project, and
# Infernal Monkey Games IQ (rmrk.net, chaosproject.co.nr, imghq.co.nr)
# if this script is posted on any site other than the ones mentioned above
# it is stolen and I would like to be contacted immediately
#===============================================================================

#===============================================================
#DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!
#===============================================================

#-------------------------------------------------------------------------------
# Main Menu : Has : WindowStatus, Location, Gold, Time, Command Window
#-------------------------------------------------------------------------------
class Window_MenuStatus < Window_Selectable
  def initialize
    super(0, 0, 440, 240)
    @column_max = 2
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    refresh
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 10 + 200 * i
      y = 5
      actor = $game_party.actors[i]
      if actor != nil
          battler= RPG::Cache.battler(actor.battler_name, actor.battler_hue)
          self.contents.blt(25 + 200*i, 23, battler, Rect.new(0, 0, 319, 340))
          draw_actor_name(actor, x, y)
          draw_actor_hp(actor, x,150,172)
          draw_actor_sp(actor, x, 170, 172)
      end
    end
  end
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(@index * 200, 0, 200, self.height - 32)
    end
  end
end

class EQ_Window < Window_Base
  def initialize(id)
    super(0,0,220,60)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh(id)
  end
  def refresh(id)
    actor = $game_party.actors[id]
    item = actor.equipments
    for i in 0...item.size
      if item[i] != nil
        bitmap = RPG::Cache.icon(item[i].icon_name)
        self.contents.blt(30*i, 0, bitmap, Rect.new(0, 0, 24, 24))
      end
    end
  end
end

class Location_Window < Window_Base
  def initialize
    super(200,360,250,60)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    data = load_data("Data/MapInfos.rxdata")
    self.contents.draw_text(0,0,227,28,data[$game_map.map_id].name, 0)
  end
end

class Scene_Menu
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def main
    @spriteset = Spriteset_Map.new
    # Drawing up the command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    @command_window.x = 472
    @command_window.y = 30
    # When party number of people 0 is
    if $game_party.actors.size == 0
      # Nullifying the item, skill, equipment and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # In case of saving prohibition
    if $game_system.save_disabled
      # Saving is made invalid
      @command_window.disable_item(4)
    end
    @p1_window = EQ_Window.new (0)
    @p1_window.x = 25
    @p1_window.y = 290
    @p2_window = EQ_Window.new (1)
    @p2_window.x = 245
    @p2_window.y = 290
    @locationiseverything = Location_Window.new
    # Drawing up the play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 25
    @playtime_window.y = 360
    # Drawing up the Goldwyn dough
    @gold_window = Window_Gold.new
    @gold_window.x = 472
    @gold_window.y = 360
    # Drawing up the status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 25
    @status_window.y = 50
    # Transition execution
    Graphics.transition
    # Main loop
    loop do
      # Renewing the game picture
      Graphics.update
      # Updating the information of input
      Input.update
      # ??????
      update
      # When the picture changes, discontinuing the loop
      if $scene != self
        break
      end
    end
    # Transition preparation
    Graphics.freeze
    # Releasing the window
    @command_window.dispose
    @playtime_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @p1_window.dispose
    @p2_window.dispose
    @locationiseverything.dispose
    @spriteset.dispose
  end
  def update
    # Renewing the window
    @command_window.update
    @playtime_window.update
    @gold_window.update
    @status_window.update
    @p1_window.refresh(0)
    @p2_window.refresh(1)
    @locationiseverything.refresh
    @spriteset.update
    # When the command window is active,: Update_command is called
    if @command_window.active
      update_command
      return
    end
    # When the status window is active,: Update_status is called
    if @status_window.active
      update_status
      return
    end
  end
end

#-------------------------------------------------------------------------------
# Inventory : Has : description, stock window, stock selector, target selector
#-------------------------------------------------------------------------------
class Window_Help < Window_Base
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
  end
end

class Window_Item < Window_Selectable
  def initialize
     if !$game_temp.in_battle
      super(320, 64, 320, 416)
      @column_max = 1
       refresh
      self.index = 0
    else
      super(0, 64, 640, 416)
      @column_max = 2
      refresh
      self.index = 0
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    if item.is_a?(RPG::Item) and
       $game_party.item_can_use?(item.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    if !$game_temp.in_battle
      x = 4
      y = index * 32
    else
        x = 4 + index % 2 * (288 + 32)
        y = index / 2 * 32
    end     
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    if !$game_temp.in_battle
      self.contents.blt(x+256, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
      self.contents.draw_text(x, y, 212, 32, item.name, 0)
      self.contents.draw_text(x + 240, y, 16, 32, "|", 1)
    else
      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
      self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
      self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
      self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
    end
  end
end

class Window_Target < Window_Selectable
  def initialize
    super(0, 0, 336, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $fontface
    self.contents.font.size = $fontsize
    self.z += 10
    @item_max = $game_party.actors.size
    refresh
  end
  def refresh
    self.contents.clear
    for i in 0...$game_party.actors.size
      x = 4
      y = i * 116
      actor = $game_party.actors[i]
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x + 8, y + 32)
      draw_actor_state(actor, x + 8, y + 64)
      draw_actor_hp(actor, x + 152, y + 32)
      draw_actor_sp(actor, x + 152, y + 64)
      draw_actor_graphic(actor, x + 80, y + 55)
    end
  end
end

class Window_Stock < Window_Base
  def initialize
    super(0, 355,320, 125)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
 
  def update_stock(item)
    self.contents.clear
    self.contents.font.name = $fontface
    number = $game_party.item_number(item.id)
    if item != nil
      @price = item.price / 2
      self.contents.draw_text(200, 0, 24, 32, number.to_s, 2)
      self.contents.draw_text(125,40,100,32, @price.to_s,2)
    end
    self.contents.draw_text(0,40, 320, 32, "Sell Price:",0)
    self.contents.draw_text(0,0,168,32, "Stock  :", 0)
  end
end

class Scene_Item
  def main
    @spriteset = Spriteset_Map.new
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    if !$game_temp.in_battle
      @stock_window = Window_Stock.new
    end
    @item_window.help_window = @help_window
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    if !$game_temp.in_battle
      @stock_window.dispose
    end
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose
    @spriteset.dispose
  end

  alias update_old update_item
  def update_item
    @item = @item_window.item
    @spriteset.update
    if !$game_temp.in_battle
      @stock_window.update_stock(@item)
    end
    update_old
  end
end

#-------------------------------------------------------------------------------
# Status : Has : Battler/etc, Stats
#-------------------------------------------------------------------------------
class Status_Actor < Window_Base
  def initialize(actor)
    super(0, 70, 319, 340)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh(actor)
  end
  def refresh(actor)
    self.contents.clear
    draw_actor_name(actor, 0,0)
    draw_actor_class(actor,175,0)
    draw_actor_level(actor, 0, 24)
    draw_actor_graphic(actor, 210, 90)
    battler= RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    self.contents.blt(40, 75, battler, Rect.new(0, 0, 319, 340))
    draw_actor_state(actor, 105, 280)
  end
end
class Actor_Stats < Window_Base
  def initialize(actor)
    super(319,70,320,340)
    self.contents = Bitmap.new(width-32, height-32)
    refresh(actor)
  end
  def refresh(actor)
    self.contents.clear
    self.contents.draw_text(0,0,80,32,"________________")
    self.contents.draw_text(0, 0, 80, 32, "STATS")   
    draw_actor_hp(actor, 60,32,172)
    draw_actor_sp(actor, 60,64,172)
    for i in 0...6
      draw_actor_parameter(actor,60, 96+32*i, i)
    end
  end
end
class Scene_Status
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
  end
  def main
    @spriteset = Spriteset_Map.new
    # Acquiring the actor
    @actor = $game_party.actors[@actor_index]
    # Drawing up the actor's image Window and stats window
    @window_actor = Status_Actor.new(@actor)
    @window_stats = Actor_Stats.new(@actor)
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @window_actor.dispose
    @window_stats.dispose
    @spriteset.dispose
  end
end


I've almost got SirJackRex's done too


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

Rune

Looking good :)
Is that all 3 scripts in one?
Sincerely,
Your conscience.

tSwitch

yeah, to make it easy for ppl to use


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

modern algebra

Umm, no I don't think so. Maybe I will become a full-time maker once I finish a few of my own scripts. If there are any requests which look interesting which neither of you have time to do, I might take it. Otherwise, no.

Rune

Sincerely,
Your conscience.

SirJackRex

Wait, is that my cms too?

Rune

Sincerely,
Your conscience.

SirJackRex

Good, because I didn't request 2 people party member and my username isn't halestorm.

modern algebra

Is Halestorm still around? I haven't seen him in a while. Maybe someone should PM him.

And lol @ SirJackRex

If you noticed it was for Halestorm, why would you possibly think it was for you?  :P

SirJackRex

Quote from: NAMKCOR on July 11, 2007, 04:49:41 PM
yeah, to make it easy for ppl to use

I got confused because of that.

tSwitch

Quote from: SirJackRex on July 11, 2007, 05:36:40 PM
Quote from: NAMKCOR on July 11, 2007, 04:49:41 PM
yeah, to make it easy for ppl to use

I got confused because of that.

oh, well I made it for halestorm, but other people might like it, so yeah
yours 'll be done sometime either today or tomorrow


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

SirJackRex


modern algebra

Okay zzzdude, Your script is done. I am posting a topic on it. If you want the layout changed then that will not be a problem, but be specific. I have the previous version saved on my computer, so it is not a problem to do it whatever way you want.

Here is a link: http://rmrk.net/index.php/topic,18932.0.html

VampireHSS

QuoteYou want the credits moving upwards through the screen or other?
That works :)
<3 phenom
<3 Hypnotic

tSwitch

Quote from: SirJackRex on July 11, 2007, 06:24:01 PM
Thank you!  :)

it's mostly done, but due to last minute packing, it may be delayed a bit
may == 50% chance


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

Rune

Quote from: VampireHSS on July 12, 2007, 08:03:12 PM
QuoteYou want the credits moving upwards through the screen or other?
That works :)

I'll try that :P

Will start later, i'm pretty busy atm
Sincerely,
Your conscience.

crazy39

a battle system which is exactly like the original rpgmxp, only instead of turnbased, there's bar that must fill up for each character before they can attack, like ff7.  also, if you could make it so the charcters graphic changes after a certain amount of damage is taken, that would be awesome. thanks! oh, it's for rpg maker xp

modern algebra

oh dear lord that's not a simple script. In any case, check out the link I gave you in the other topic. See if that is what you're looking for. There is another one called TRTAB and another Timed-Hit Battle System which might be good to check out as well.

Rune

I have to agree, that's a pretty difficult script to make... for the first bit you could search around for an RTAB, or what modern said... for the second piece of your request... I could try it, but don't get your hopes up ;)
Sincerely,
Your conscience.

xinrua

Hey Rune no need to sound rude, or anything I can tell your realy busy at the moment, but are you done with the script for my menu yet?

Oh and I learned a bit of script, so I fixed the equip menu so it shows a picture instead of a battler, so no need for you to do that anymore!  ;8



Rune

#170
Sorry, I've been trying but I can't think of anything to get it to work properly :-\

Maybe a better scripter could finish it off for you :-\

@crazy39 - PM me the names of all the images you intend to use. And say whether they are battlers, faces, etc... ;)

@VampireHSS - You have no idea how much I hate saying this ;9 I tried, but I can't get the text to  move upwards throught the screen... :(
One idea I have... you could do this with events and pictures :P But you might not be able to access it from the menu :(

And everyone... sorry I take so long with your requests... my computer's a f**kup most of the time.
Plus, there's a lot I can't do ;9
Sincerely,
Your conscience.

modern algebra

What are you having problems with RUne? I won't be able to take it on, but I might be able to give you suggestions on how to move forward.

Rune

He wants a character's battler to be displayed depending on Window_MenuStatus's index :-\ I cant get it to work properly though :-\ all I can do is display all battlers in one place :-\
Sincerely,
Your conscience.

modern algebra

Well, in the update method, I'd say refresh the window with the battler on it everytime the index changes. So keep a variable which holds previous index, and then refresh every time it changes:. Something like this:


if previous_index != @status_window.index
  previous_index = @status_window.index
  @battler_window.refresh (previous_index)
end


And in the refresh of the battler window, have it take a new argument (index), and then take the actor from it, i.e.:


def refresh (index)
  actor = $game_party.actors[index]


and draw the battler off actor. If you can't figure it out, just send me the script I guess and I will work past that hurdle for you.

tSwitch

actually, there is no need to keep the previous one.
just have the battler display in refresh say

actor = $game_party.actors[index]
where index is the index of the menu window
without all the other stuff, as if the index doesn't change, the battler won't
that should work


FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon