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.

Just a Small Script...

Status
Not open for further replies.
Please Could I have a script the same as FF12's Sky Pirates Den. For those who don't know what I'm talking about...

In the menu there should be a new option, (FF12 was Sky Pirate's Den) called awards. There would be a new award for a switch. So eg.

If switch 50. Behemoth King Dead- Is activated. An award would be displayed there with an picture of the Behemoth King. When you press 'C' it should have a message saying something like: "Awarded For Defeating The Behemoth King"

If Switch 50 Behemoth King Dead is not activated. Then a question mark should show over it.

Thankyou for listening and I eagerly await a reply

8-) :D 8-)

Amos36

http://i60.photobucket.com/albums/h12/Ikongamer/2-3.jpg[/IMG]
 
Bump again
Please??? It's only a little request!!!
I've waited for about two weeks now...
If you need any details I'll be happy to give them to you...
All those 40 people who have read this post and not said anything I wonder why you actually bother reading my post???
 
I read.

Some more questions to help you get your request solved faster:

1. What menu system are you using? If you're not using the default one and you don't provide the link for the CMS, how could people work out on your request?

2. Using any menu system, sketch out how the menu system should be after "Award" is added (i.e. where you want it to be placed).

3. Do you use ONLY one award? So there won't be any other awards?

4. Sketch out how the award window should look like when selecting it from menu (i.e. the position, texts, and so on).

5. Are you sure switch 50 is used for that purpose?

Hope that helps.
 
Thanks...
Sorry, I'm a newb at this...

I'm using the default menu system...

Switch 50 was merely an example... So you can change it to whatever...

There will be many different awards. So just example on in the script and I can change it...
 
You didn't answer question #2 and #4.

Usually accessing game switches are not recommended via script, but let's see which one is easier to tell the script award X has been rewarded.

I'll consider taking your request after I know how the layout of Award window should look like.
 
I would like...

1. In the main menu...
. I use the standard menu...
. It should be found under status... But before save...
(Save in my menu is greyed out... I don't use that save... I made save-points...)

2. In the award menu...
. It will fill the whole page...
. At the top, it should say, "AWARDS"
. There will be quite a few awards... So the menu should have a scroll down bar...
. There should be a cursor over the award which you are viewing... That's how you scroll down... By pressing down/ up...
. There should be two awards per row...

3. The actual awards should be...
. A switch should be activated to show an award...
. At the top there is a pic to do with the award...
. Underneath the pic, there should be the title you've gained... Eg. Beastslayer, Saviour, High Summoner...
. Underneath that is a description, eg. Awarded for defeating the Behemoth King, or for Saving Dunhil... etc...

4. Awards that haven't been collected yet...
. The picture will be a blacked out one, (Silouette) of the real one... (If you can do that in a script it would help but I could obviously do it...)
. The Title would simply display '????'
. There should be no description...

I hope this can clear things up...

-----------------------------------------------------------------
| AWARDS
|
| Behemoth Pic Shii-Shii (NPC) Pic
|
| Beastslayer Saviour
|
| Awarded for defeating Awarded for saving Dunhil...
| The Behemoth King...
|
| Award Two Pic Blacked Out Picture Of Sir Soloman
|
| Blah ????
|
| Blah
|
|
-----------------------------------------------------------------

Is that good enough?
Cos' I drew out a thing on bitmap but it tis' too big and I can't scale it down...

Please Reply... Thanks for actually listening and considering my request...

Cheers...

:D :D
 
I would like...

1. In the main menu...
. I use the standard menu...
. It should be found under status... But before save...
(Save in my menu is greyed out... I don't use that save... I made save-points...)

2. In the award menu...
. It will fill the whole page...
. At the top, it should say, "AWARDS"
. There will be quite a few awards... So the menu should have a scroll down bar...
. There should be a cursor over the award which you are viewing... That's how you scroll down... By pressing down/ up...
. There should be two awards per row...

3. The actual awards should be...
. A switch should be activated to show an award...
. At the top there is a pic to do with the award...
. Underneath the pic, there should be the title you've gained... Eg. Beastslayer, Saviour, High Summoner...
. Underneath that is a description, eg. Awarded for defeating the Behemoth King, or for Saving Dunhil... etc...

4. Awards that haven't been collected yet...
. The picture will be a blacked out one, (Silouette) of the real one... (If you can do that in a script it would help but I could obviously do it...)
. The Title would simply display '????'
. There should be no description...

I hope this can clear things up...
Can't Show Two in a row so could you imagine for me???

-----------------------------------------------------------------
| AWARDS
|
| Behemoth Pic
|
| Beastslayer
|
| Awarded for defeating
| The Behemoth King...
|
| Blacked Out Picture Of Sir Soloman
|
| ????
|
|
|
|
-----------------------------------------------------------------

Is that good enough?
Cos' I drew out a thing on bitmap but it tis' too big and I can't scale it down...

Please Reply... Thanks for actually listening and considering my request...

Cheers...

:D :D

BTW! I would like two awards per row...
(Sorry, I couldn't make that crap diagram work)
 
Wait, are you sure there are two awards displayed at the same time? If you do that, the award pics will be very small in height. See this...

Normal RMXP games are 640 x 480 in size. I used a help window to display AWARD text, so the remaining area will be 480 - 64, 416px in height. Divide it by two and you'll get 208px each award. That includes award picture, title, and description. Title will consume 32px, and description will consume about 32-64px (assuming it's 1-2 lines long). The picture itself will only get 112-144px in height. This doesn't count vertical spaces of texts, so the actual size will be lesser.

I offer you this: After selecting Award from main menu, instead of displaying all awards info at once, just display all award titles (which if not yet gained, shown dimmed/in gray). Player can choose a award title and press decision button (defaults to RMXP's C button) to see the details, incl. pictures, titles, and descriptions only if player has gained the award. Otherwise, either player can't pick it or the screen will display black/silhouette picture (I don't know if it's doable via script, but I'll try) , "????" title, and no description.

Which one would you like?

Oh, and also, if you notice, actually my script request stattion is currently closed, but I keep my promise of considering your request. Is it OK if maybe I'll finish it in about two weeks?
 
Hi again...

Again, I must say how kind you are to do this for me...

I like the second idea! That sounds better...

Final details...

I would like some awards to be triggered by more than one switch... Would you be able to do that? (It's ok if you can't, I don't know anything about scripting lol... So I wouldn't know...)

If you could do two example awards so I know how to add new awards that would be great!

You don't need to add many comments to the script... It would need a small introduction and a few brief notes about things like setting up awards and stuff though...

I will fully credit you...

Amos368 -) :D

P.S- I don't really care how long it takes... As long as it's done... If you have further questions, I check this thread regularly...

EDIT- If you can make the pictures turn black/ turn into a sillouette... That'd be great... But if you can't I can obviously do that for you...
 
(This is not a double post... I have waited 72 hours and I want the person to see this)

If you have any further questions, I'll answer, by PM or by this post, I check regualarly...

Forget about turning the pic black btw... I can do that easily, for it would only cause you more trouble...

Oh! And as a sort of payment, I'll give you an amazing evil mutant monster graphic that is amazing... Isn't rtp style BUT it works perfectly with it...

Amos36
 
Hmm... I'm glad you give that last detail now. Nothing is impossible, you know ;)

I'll try it for now. Check back next Sunday (May 20), I might have something for you.

EDIT:

Well, I apparently finished it in 3 hours. Here is it:

Code:
=begin
************
AWARD SCREEN
************
by ?xshara?n

Version History
---------------
Dates are in dd-mm-yyyy

v1.0: 13-05-2007
First release. Standard features requested by Amon36.

Features
--------
- Adds a new menu under "Status" called "Awards"
- Enlists all awards in the game.
  Awards that are not yet received will be shown in ???? with no description.
- Have up to three lines of description.
- Switch activators may be defined more than one.
Two examples included.

Known bugs
----------
- "Awards" replaces "Save" menu, since addition of this will need
  redesign of left portion of default menu.
- Currently only works with DBS.

Compatibility
-------------
- Should work with any scripts that doesn't modify these classes:
class Scene_Menu method main, update_command
class Scene_End method update, command_cancel
- Should not work with SDK.
- Doesn't work with any CMS (see Support on merging).

Support
-------
If there is any errors to this script, let me know. Provide the line number of
the error, what it says (exactly as appears on your screen before the game closes),
and how did you create the error. You can also provide the code of that line
(recommended). For example:

Awards line 99 NameError
Undefined variable name or method "update" for <#Window_Award>
Code: @award_window.update

If there is script incompatibility and you want me to merge, please
provide me the conflicting script (at least a link to the Internet
where I can find it; not a dead link please!) and I'll try merging them.
This also applies to CMS.

DO NOT ASK me to convert this script to SDK-compatible, I prefer not to.

These and any suggestions should be e-mailed to
hoshiro [dot] exsharaen [at] gmail [dot] com
Replace each bracketed words with appropriate symbols.

Enjoy! ;)
=end

=begin
************
Installation
************
Just make a new page above Main and copy-paste this script to the new page.

********
SETTINGS
********
There is only one setting: the awards themselves. Awards are stored in AWARDS
constant below. Each awards will use the following format:

award_id =>
  {
  :title            => "Your title here",
  :activator        => [<game switches ID(s) here>],
  :active_pic_name  => "picture filename",
  :dimmed_pic_name  => "dimmed picture filename",
  :description      => "Awards description here"
  }
  
See the examples of using this format.

To keep in mind:
award_id is used only to distinguish each awards (so they are unique each other)
and doesn't affect the way they are activated.
Use numbers or strings (numbers are recommended) for award_id.

:activator is a collection (array) of game switches you use to activate the award.
Keep in mind that they are defined between brackets [].
Separate each switch ID by a comma.

:description can have up to three lines. Separate each line by "\n"
(without quotes). To make reading easier, you can split lines as exampled below.

=end

AWARDS =
{
0 =>
  {
  :title            => "Beastslayer",
  :activator        => [1],
  :active_pic_name  => "rune1",
  :dimmed_pic_name  => "rune1 dimmed",
  :description      => "Awards for beating yourself ;P"
  },
1 =>
  {
  :title            => "Dragonslayer",
  :activator        => [2, 3],
  :active_pic_name  => "rune1",
  :dimmed_pic_name  => "rune1 dimmed",
  :description      => "Awards for beating a dragon.\n" + 
    "This is a long description, let's see if it fits to one line...\n" +
    "It fits! You can write longer description for awards up to 3 lines!"
  }
}

# SETTINGS END HERE

class Window_Award < Window_Selectable

  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    @item_max = AWARDS.size
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # Draw all award title
    y = 0
    AWARDS.each {|key, value|
      detail = AWARDS[key]
      # Activated?
      activated = true
      for switch in detail[:activator]
        unless $game_switches[switch]
          activated = false
          break
        end
      end
      # If activated, draw award title, else draw "????"
      title = activated ? detail[:title] : "????"
      self.contents.draw_text(4, y, 640, 32, title)
      y += 32
    }
  end
end

class Window_AwardDetail < Window_Base
  def initialize(award_index)
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @award_index = award_index
    refresh
  end
  
  def refresh
    self.contents.clear
    # Get award
    award = AWARDS[@award_index]
    # Activated?
    activated = true
    for switch in award[:activator]
      unless $game_switches[switch]
        activated = false
        break
      end
    end
    # Draw award name if activated
    title = activated ? award[:title] : "????"
    self.contents.font.bold = true
    self.contents.font.italic = true
    self.contents.draw_text(0, 0, 640, 32, title, 1)
    # Draw award picture
    pic_type = activated ? award[:active_pic_name] : award[:dimmed_pic_name]
    award_pic = RPG::Cache.picture(pic_type)
    src_rect = Rect.new(0, 0, 400, 300)
    self.contents.blt(120, 40, award_pic, src_rect)
    # Draw description
    y = 348
    if activated
      # Split lines
      award[:description].each_line {|line|
      self.contents.font.bold = false
      self.contents.font.italic = false
      # Draw each description line
      self.contents.draw_text(0, y, 640, 32, line)
      y += 32
      }
    end
  end
end

class Scene_Award
  def initialize(index = 0)
    @index = index
  end
  def main
    # Make award window
    @award_window = Window_Award.new
    @award_window.index = @index
    @help_window = Window_Help.new
    @help_window.set_text("AWARDS", 1)
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose award window
    @award_window.dispose
    @help_window.dispose
  end
  def update
    @award_window.update
    @help_window.update
    # Cancel selection and return to menu scene
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(4)
      return
    end
    # Enters award detail scene
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Switch to award detail screen
      $scene = Scene_AwardDetail.new(@award_window.index)
      return
    end
  end
end

class Scene_AwardDetail
  def initialize(award_index = 0)
    @award_index = award_index
  end
  
  def main
    @award_detail_window = Window_AwardDetail.new(@award_index)
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose award window
    @award_detail_window.dispose
  end
  
  def update
    # Go back to award selection screen
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to award selection screen
      $scene = Scene_Award.new(@award_index)
      return
    end
  end
end

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s7 = "Awards"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s7, s6])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    # Make steps window
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  
  alias award_update_command update_command
  def update_command
    if Input.trigger?(Input::C)
      case @command_window.index
      when 4 # awards menu
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to award screen
        $scene = Scene_Award.new
        return
=begin
      when 5  # save
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
        return
=end
      when 5  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
        return
      end
    end
    award_update_command
  end
end
=begin
class Scene_Save
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)
    # Play save SE
    $game_system.se_play($data_system.save_se)
    # Write save data
    file = File.open(filename, "wb")
    write_save_data(file)
    file.close
    # If called from event
    if $game_temp.save_calling
      # Clear save call flag
      $game_temp.save_calling = false
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # Switch to menu screen
    $scene = Scene_Menu.new(5)
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
    # Play cancel SE
    $game_system.se_play($data_system.cancel_se)
    # If called from event
    if $game_temp.save_calling
      # Clear save call flag
      $game_temp.save_calling = false
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # Switch to menu screen
    $scene = Scene_Menu.new(5)
  end
end
=end
class Scene_End
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update command window
    @command_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(5)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # to title
        command_to_title
      when 1  # shutdown
        command_shutdown
      when 2  # quit
        command_cancel
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # *  Process When Choosing [Cancel] Command
  #--------------------------------------------------------------------------
  def command_cancel
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to menu screen
    $scene = Scene_Menu.new(5)
  end
end

Sorry, I was tempted to write that "long" introduction :P

Anyway, I was about to ask you but for now I'll use this assumption. You stated that you disallowed saving from menu, so I consider Save menu is useless. I replaced it with Awards. If you still want to include Save in the menu, I have to reconstruct left portion of the menu. Just tell me how would you like it to be (e.g. step window removed or merged with gold window, smaller text, and so on).

Should there be any errors, let me know.
 
Oh! So your PM was to say it was finished! Thanks... I'll just try it out... Thanks so much!!! Thanks Thanks Thanks!
Also, yes, I scrapped the save option because I use save points... That was extra helpful... *Takes a look at the script*

EDIT- It works amazing! Thanks so much!

One question though...

You know the pic and the discription...

Well...

Is there any way I could centre them horizontally...

So...

Awards

Pic

Blah

Or is that not possible...

It's just because some of my awards are small... So Aqua, The first award...

It's pic is aquatic one, which Is tiny! On the screen...

I'm probably just being picky... But it would look much nicer...

If you can't then I don't mind...

Oh yes!!! Your reward!!! I'll PM You a link to a cheap website I'll set up...

(It's actually an award for defeating it in there... It's massive so there's no prob with him)

I could resize all my images if you can't but it would be much easier...

2ND EDIT-

About your reward...
Check here for the pic...
Yes, the site is crap, yes, the game is my one...

LINK WAS REMOVED BY ME FOR IT WAS ONLY INTENDED FOR EXSHARAEN...

Enjoy
 
I did forgot to use any size of pictures; I used 400x300 instead. Now it displays correctly, center-aligned horizontally, regardless of size. Of course, if it's larger than 400x300, it will be cropped.

I also added a feature that prevent game from closing in case the picture file doesn't exist. The award detail will show a black box, with white text "Picture not available" in the middle, instead.

Last, a feature to align the description text. Now you can make them left-, center-, or right-aligned. It defaults to left, but I make it center as you ask.

Here is the new script (replace my old one with this):

Code:
=begin
************
AWARD SCREEN
************
by ?xshara?n

Version History
---------------
Dates are in dd-mm-yyyy

v1.0: 13-05-2007
First release. Standard features requested by Amon36.

v1.1: 13-05-2007
Fixed picture alignment. Now picture in any size is centered horizontally.
Added new feature to prevent game closing if picture is not found.
Added new option to align description text.

Features
--------
- Adds a new menu under "Status" called "Awards"
- Enlists all awards in the game.
  Awards that are not yet received will be shown in ???? with no description.
- Have up to three lines of description.
- Switch activators may be defined more than one.
- Game will not close if any picture is missing. A black box will be
  displayed instead.
Two examples included.

Known bugs
----------
- "Awards" replaces "Save" menu, since addition of this will need
  redesign of left portion of default menu.
- Currently only works with DBS.

Compatibility
-------------
- Should work with any scripts that doesn't modify these classes:
class Scene_Menu method main, update_command
class Scene_End method update, command_cancel
- Should not work with SDK.
- Doesn't work with any CMS (see Support on merging).

Support
-------
If there is any errors to this script, let me know. Provide the line number of
the error, what it says (exactly as appears on your screen before the game closes),
and how did you create the error. You can also provide the code of that line
(recommended). For example:

Awards line 99 NameError
Undefined variable name or method "update" for <#Window_Award>
Code: @award_window.update

If there is script incompatibility and you want me to merge, please
provide me the conflicting script (at least a link to the Internet
where I can find it; not a dead link please!) and I'll try merging them.
This also applies to CMS.

DO NOT ASK me to convert this script to SDK-compatible, I prefer not to.

These and any suggestions should be e-mailed to
hoshiro [dot] exsharaen [at] gmail [dot] com
Replace each bracketed words with appropriate symbols.

Enjoy! ;)
=end

=begin
************
Installation
************
Just make a new page above Main and copy-paste this script to the new page.

********
SETTINGS
********
There is only one setting: the awards themselves. Awards are stored in AWARDS
constant below. Each awards will use the following format:

award_id =>
  {
  :title            => "Your title here",
  :activator        => [<game switches ID(s) here>],
  :active_pic_name  => "picture filename",
  :dimmed_pic_name  => "dimmed picture filename",
  :description      => "Awards description here"
  }
  
See the examples of using this format.

To keep in mind:
award_id is used only to distinguish each awards (so they are unique each other)
and doesn't affect the way they are activated.
Use numbers or strings (numbers are recommended) for award_id.

:activator is a collection (array) of game switches you use to activate the award.
Keep in mind that they are defined between brackets [].
Separate each switch ID by a comma.

:description can have up to three lines. Separate each line by "\n"
(without quotes). To make reading easier, you can split lines as exampled below.

All pictures goes to \Graphics\Pictures of your game folder. Maximum size is
400px x 300px; any picture larger than that will be cropped.

=end

# All awards goes here
AWARDS =
{
0 =>
  {
  :title            => "Beastslayer",
  :activator        => [1],
  :active_pic_name  => "rune1",
  :dimmed_pic_name  => "rune1 dimmed",
  :description      => "Awards for beating yourself ;P"
  },
1 =>
  {
  :title            => "Dragonslayer",
  :activator        => [2, 3],
  :active_pic_name  => "rune11", # example of picture not found
  :dimmed_pic_name  => "rune11 dimmed",
  :description      => "Awards for beating a dragon.\n" + 
    "This is a long description, let's see if it fits to one line...\n" +
    "It fits! You can write longer description for awards up to 3 lines!"
  }
}

# Description text alignment
# 0 = left, 1 = center, 2 = right
# Defaults to 0 (left)
DESC_ALIGNMENT = 1

# SETTINGS END HERE

class Window_Award < Window_Selectable

  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    @item_max = AWARDS.size
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # Draw all award title
    y = 0
    AWARDS.each {|key, value|
      detail = AWARDS[key]
      # Activated?
      activated = true
      for switch in detail[:activator]
        unless $game_switches[switch]
          activated = false
          break
        end
      end
      # If activated, draw award title, else draw "????"
      title = activated ? detail[:title] : "????"
      self.contents.draw_text(4, y, 608, 32, title)
      y += 32
    }
  end
end

class Window_AwardDetail < Window_Base
  def initialize(award_index)
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @award_index = award_index
    refresh
  end
  
  def refresh
    self.contents.clear
    # Get award
    award = AWARDS[@award_index]
    # Activated?
    activated = true
    for switch in award[:activator]
      unless $game_switches[switch]
        activated = false
        break
      end
    end
    # Draw award name if activated
    title = activated ? award[:title] : "????"
    self.contents.font.bold = true
    self.contents.font.italic = true
    self.contents.draw_text(0, 0, 608, 32, title, 1)
    # Draw award picture
    begin
      pic_type = activated ? award[:active_pic_name] : award[:dimmed_pic_name]
      award_pic = RPG::Cache.picture(pic_type)
      src_rect = Rect.new(0, 0, 400, 300)
      # Centering image...
      pic_width = (award_pic.width > 400) ? 400 : award_pic.width
      x = (640 - pic_width) / 2 - 16
      self.contents.blt(x, 40, award_pic, src_rect)
    # In case picture doesn't exist...
    rescue Errno::ENOENT
      pic_width = 400
      x = (640 - pic_width) / 2 - 16
      # Draw a black box instead
      self.contents.fill_rect(x, 40, 400, 300, Color.new(0, 0, 0))
      self.contents.draw_text(x, 40 + 150 - 16, 400, 32, "Picture not available", 1)
    end
    # Draw description
    y = 348
    if activated
      # Split lines
      award[:description].each_line {|line|
      self.contents.font.bold = false
      self.contents.font.italic = false
      # Draw each description line
      self.contents.draw_text(0, y, 608, 32, line, DESC_ALIGNMENT)
      y += 32
      }
    end
  end
end

class Scene_Award
  def initialize(index = 0)
    @index = index
  end
  def main
    # Make award window
    @award_window = Window_Award.new
    @award_window.index = @index
    @help_window = Window_Help.new
    @help_window.set_text("AWARDS", 1)
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose award window
    @award_window.dispose
    @help_window.dispose
  end
  def update
    @award_window.update
    @help_window.update
    # Cancel selection and return to menu scene
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(4)
      return
    end
    # Enters award detail scene
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Switch to award detail screen
      $scene = Scene_AwardDetail.new(@award_window.index)
      return
    end
  end
end

class Scene_AwardDetail
  def initialize(award_index = 0)
    @award_index = award_index
  end
  
  def main
    @award_detail_window = Window_AwardDetail.new(@award_index)
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose award window
    @award_detail_window.dispose
  end
  
  def update
    # Go back to award selection screen
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to award selection screen
      $scene = Scene_Award.new(@award_index)
      return
    end
  end
end

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s7 = "Awards"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s7, s6])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    # Make steps window
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  
  alias award_update_command update_command
  def update_command
    if Input.trigger?(Input::C)
      case @command_window.index
      when 4 # awards menu
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to award screen
        $scene = Scene_Award.new
        return
=begin
      when 5  # save
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
        return
=end
      when 5  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
        return
      end
    end
    award_update_command
  end
end
=begin
class Scene_Save
  #--------------------------------------------------------------------------
  # * Decision Processing
  #--------------------------------------------------------------------------
  def on_decision(filename)
    # Play save SE
    $game_system.se_play($data_system.save_se)
    # Write save data
    file = File.open(filename, "wb")
    write_save_data(file)
    file.close
    # If called from event
    if $game_temp.save_calling
      # Clear save call flag
      $game_temp.save_calling = false
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # Switch to menu screen
    $scene = Scene_Menu.new(5)
  end
  #--------------------------------------------------------------------------
  # * Cancel Processing
  #--------------------------------------------------------------------------
  def on_cancel
    # Play cancel SE
    $game_system.se_play($data_system.cancel_se)
    # If called from event
    if $game_temp.save_calling
      # Clear save call flag
      $game_temp.save_calling = false
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # Switch to menu screen
    $scene = Scene_Menu.new(5)
  end
end
=end
class Scene_End
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update command window
    @command_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(5)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # to title
        command_to_title
      when 1  # shutdown
        command_shutdown
      when 2  # quit
        command_cancel
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # *  Process When Choosing [Cancel] Command
  #--------------------------------------------------------------------------
  def command_cancel
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Switch to menu screen
    $scene = Scene_Menu.new(5)
  end
end

Oh, and thanks for the battler. I do need more battlers for my game ;)

Let me know if your game is finished.

Enjoy ^_^
 
Perfect!

*I have removed link because It's always my reward for stuffs... Don't want everyone to have it unless someone else unless they have contributed to my game...*

If you need the link again just PM me...

Thanks again... It looks just as I wanted it! Thanks so much! Anyhoo... I'm now gonna work on my game... Since all my mates are saying how cool it is and keep asking me for my second update/version...

*Returns to designing Dunhil Canyons/River Utan*

Cheers!

Amos36
 
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