RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Request] Minimized menu HUD on map/on screen

0 Members and 2 Guests are viewing this topic.

**
Rep: +0/-0Level 82
There is no end to learning!
I have been hunting every nook and corner of every RMVX forum,but have not come across anything like this.I saw many huds showing HP and MP of the characters on map,but I want a small menu hud to show on map.Just like a minimized menu which when clicked will pull up the menu screen.This is especially for those players who are new to RPG and don't know that by pressing 'esc' it can bring up the game menu.something like or even remotely similar to aveyond 3-



I know this also calls for mouse script,but I found the simple mouse system already.So any script that works with the mouse script and that pulls up a minimized menu from the map will be extremely appreciated.

P.S: if the above is not possible then at least something like this mock up will also do-

« Last Edit: April 28, 2010, 10:42:33 PM by zubin73 »
"A thing of beauty is a joy forever" - Keats

****
Rep:
Level 83
What mouse script are you using? you should post a link.
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com


**
Rep: +0/-0Level 82
There is no end to learning!
I'm using Woratana's simple mouse script.

If the above system is not possible then at least a compact menu bar that always shows on the map and will expand when clicked, will also do.I mean anything that can allow access to the menu from the map will do for me,just any script or system.
« Last Edit: April 28, 2010, 09:09:25 PM by zubin73 »
"A thing of beauty is a joy forever" - Keats

****
Rep:
Level 83
That mock up img that you posted looks like its just a map sprite underlay. (idk about VX but in XP its an easy pull off.) - lol shows how much i use VX.

is that first menu picture you posted in XP?

[edit] can't you call the menu with in the mouse script by using right click? and making the menu compressed is easy.

I would try to make this but i don't have the time, i can how ever make the compressed menu.

Code: [Select]
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_command_window
    @menuback_sprite = Sprite.new
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    @gold_window = Window_Gold.new(0, 360)
    @status_window = Window_MenuStatus.new(160, 0)
    @status_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @menuback_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @command_window.update
    @gold_window.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)     # Disable item
      @command_window.draw_item(1, false)     # Disable skill
      @command_window.draw_item(2, false)     # Disable equipment
      @command_window.draw_item(3, false)     # Disable status
    end
    if $game_system.save_disabled             # If save is forbidden
      @command_window.draw_item(4, false)     # Disable save
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command Selection
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1,2,3  # Skill, equipment, status
        start_actor_selection
      when 4      # Save
        $scene = Scene_File.new(true, false, false)
      when 5      # End Game
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    @status_window.visible = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_selection
    @status_window.visible = false
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  #--------------------------------------------------------------------------
  # * Update Actor Selection
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end

don't bother with the credit i really didn't do that much the original menu script.  Perhaps this can hold you over till some one makes the HUD menu.
« Last Edit: April 29, 2010, 04:22:02 PM by Mr_Wiggles »
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com


**
Rep: +0/-0Level 82
There is no end to learning!
Yeah the first menu was in XP just for example.I'll use your script today and get back with the results.Thanks for the effort,much appreciated.
"A thing of beauty is a joy forever" - Keats

**
Rep: +0/-0Level 82
There is no end to learning!
Umm I used the script,it's good but it doesn't show the additional menus I had created like party changer,quest journal,etc.and the important fact is that I STILL have to press the escape key to bring the menu.What I wanted is not a compact menu only as there are many scripts available.
I wanted the compact menu(preferably icons which when hovered will display the menu) to be visible all times on the map,WITHOUT pressing the escape key.newbies to RPG don't know that pressing the escape key would pull the menu.so they begin the game and don't know how to access equipments,items,etc.this utility is meant to help them out.
"A thing of beauty is a joy forever" - Keats

****
Rep:
Level 83
Ah well i didn't know that you had other scrips that affected the Menu, and that you wanted icons to show aside them as well. You should have included that you had those scripts. If you added those into the Menu script before, just look at what i changed in the the script from the original and change the menu script with your additions in it.

Also weird cause with that mouse input script you wanted to use for the HUD, when you right click it opens the menu, its basically Input::B
« Last Edit: April 30, 2010, 10:00:01 PM by Mr_Wiggles »
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com


**
Rep: +0/-0Level 82
There is no end to learning!
I know right clicking does open the menu,but non-rpg players may not figure that out.That's why I'm keen on a menu that is all time visible on the map/screen and players can click on them any time to bring up the menu.

Never mind,is there a way to create a floating event that is fixed on one corner of the screen and work when clicked?I could create the menu from that.
"A thing of beauty is a joy forever" - Keats

****
Rep:
Level 83
well its worth a shot, set it to through, and parallel cause it needs to update its location to be in the corner of the screen. then you'll have to possibly use some script conditional branches to check the location of the mouse and if it is clicked on the event.
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com


**
Rep: +0/-0Level 82
There is no end to learning!
Thanks,but how do I make it stick to that corner?I mean how do I set it's location variable so that it updates itself to remain on corner?rest I'll be able to manage I hope.
"A thing of beauty is a joy forever" - Keats

***
Rep:
Level 82
aka DigiDeity
Hay,
I would like to try to make such a menu but you have to tell me all menuitems which can be called by the menu.
Like Items,Equip,Status etc and also the prefered order of those menuitems. ^^

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


**
Rep: +0/-0Level 82
There is no end to learning!
so sweet of you :-* !Menu items are actually dependent on what do I want to include and sometimes it is included in the last moment.But anyway,a functional menu would work for the time being.

the menu items are-items,equip,profile,quests,party,save, and game end.the order is in the same sequence as mentioned.it would be really nice if you could make them look like icons which expand when clicked,rather than my second mock up(which was crude).Thanks in advance  :)
« Last Edit: May 01, 2010, 10:42:44 AM by zubin73 »
"A thing of beauty is a joy forever" - Keats

***
Rep:
Level 82
aka DigiDeity
Ok, there is one problem which isn't as easy. ^^
If you want to add Items it would be harder then you/I think. :P
I don't know how much you understand about RGSS but I ask some questions to becomse sure I've understand you.
You want that a small "MenuHUD" will be shown on a corner of the screen and if the Player click on one of the Icons for Items etc. the Scene become called.
($scene = ClickedScene.new)
That would be possible.
Another question ist if you want the Actor HUD also(The "Face,HP and MP of the party members).
The next point is how do imagined to choose the party member for example the Statusscene or Equip etc.?
If you have only 1 member it wouldn't be a problem but with more then 1 member maybe a "problem". A solution would be to call the scene for the first party member and the player can switch between the member with Q/W.

So enough questions.

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


**
Rep: +0/-0Level 82
There is no end to learning!
Quote
You want that a small "MenuHUD" will be shown on a corner of the screen and if the Player click on one of the Icons for Items etc. the Scene become called.
($scene = ClickedScene.new)

yes you are right,small menu icons or images will be shown on one corner of the screen to call the entire menu.The only thing that needs to be done is the implementation of the icons on the map,the menu layout actually remains unchanged when called.

Actor HUD not required because that would eat up some screen space.However you can keep an option just in case if I change my mind :P :)

party members will be changed using a common event that calls the 'prexus' script for party changing,which itself opens in a new screen showing all party members.can't say about the equip scene though,it should be like the default one I assume.

tell me something,are you going to hardcode each menu item?because just in case if I use a custom menu script where by I can add more menu items later,do I have to change the script codes for it as well to show the change on screen?I mean can we leave some place for customization here so that custom menu items can be filled in if required?we can choose the icon for each menu item and use common events or scripts to call them.I'm using Modern algebra's quest journal,yanfly's custom script and prexus party changer which affects the menu items.I may add more scripts in future, if required, that affects the menu item,so thought of asking if there will be any room for customization.Thanks a lot again for taking interest in it.
"A thing of beauty is a joy forever" - Keats

***
Rep:
Level 82
aka DigiDeity
OK I tried to keep it as simple as possible. :)
Try this (not done) version:
Code: [Select]
module Deity
  module MapMouseHUD
    # Just add as many Items as you wish(or place you have ^^)
    # to add an Item just write more of those lines:
    # Iconindex, ["Scenename","Sceneparameter"],choose_actor,"Discrition"],
    ITEMS = [
    [2,["Scene_Item",""],false,"Item"],
    [13,["Scene_File","true, false, false"],false,"Save"],
    [7,["Scene_Equip","0"],true,"Equip"],
    [35,["Scene_Status","0"],true,"Status"],
    [17,["Scene_End",""],false,"End"],
    ] #<= Do not delete!   
    X = 0 # X-Coordinate
    Y = 360 # Y-Coordinate
    SLOT_COLORS = [
    Color.new(250,250,250,250), #Edge
    Color.new(100,100,100,200) # Fillcolor
    ] #<= Do not delete!   
  end
end
include Deity::MapMouseHUD
class Scene_Map
  alias start_mapmousehud start unless $@
  def start
    start_mapmousehud
    @mmhud = Window_MapMouseHUD.new(X,Y,ITEMS)
  end
  alias update_mapmousehud update unless $@
  def update
    update_mapmousehud
    @mmhud.update
  end
  alias terminate_mapmousehud terminate unless $@
  def terminate
    terminate_mapmousehud
    @mmhud.dispose
  end
end
class Window_MapMouseHUD < Window_Base
  def initialize(x,y,items = [])
    super(x,y,32+items.length+items.length*24,56)
    @items = []
    @help = Window_Base.new(x,y-56,100,56)
    @help.visible = false
    draw_items(items)
  end
  def draw_items(items)
    for i in 0...items.length
      draw_icon(items[i][0],i + i*24, 0)
      @items.push(MapMouseHUD_Item.new(self.x + 16 + i + i*24,self.y+16,items[i][1],items[i][2],items[i][3]))
    end
  end
  def draw_icon(icon_index, x, y, enabled = true)
    self.contents.fill_rect(x,y,24,24,SLOT_COLORS[0])
    self.contents.fill_rect(x+1,y+1,22,22,SLOT_COLORS[1])
    bitmap = Cache.system("Iconset")
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
  end
  def update
    if Mouse.click?(3)
      for i in @items
        p(i.x.to_s + " " + i.y.to_s)
      end
    end
    if Mouse.click?(1)
      for i in @items
        if i.hit?
          i.call_item_scene
        end
      end
    else
      for i in @items
        if i.hit?
          if !@help.visible
            @help.visible = true
          end
          @help.contents.clear
          @help.contents.draw_text(0,0,68,24,i.desc,1)
          break
        else
          if @help.visible
            @help.visible = false
            @help.contents.clear
          end
        end
      end
    end
  end
  def dispose
    @items = []
    @help.dispose
    self.contents.dispose
    super
  end
end
class MapMouseHUD_Item
  attr_reader :x
  attr_reader :y
  attr_reader :desc
  def initialize(x,y,scene,choose_actor,description)
    @x = x
    @y = y
    @scene = scene
    @choose = choose_actor
    @desc = description
  end
  def hit?
    if Mouse.pos != nil
      return Mouse.pos[0] >= @x && Mouse.pos[0] <= @x+24 && Mouse.pos[1] >= @y && Mouse.pos[1] <= @y+24
    else
      return false
    end
  end
  def call_item_scene
    $scene = eval("#{@scene[0]}.new(#{@scene[1]})")
  end
end

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


**
Rep: +0/-0Level 82
There is no end to learning!
Awesome,just awesome...I've been looking for this,love you  ;D
by the way,can you explain the new menu item adding part a bit?

and why is this "not done" version,just curious..mainly because it is awesome and I have no problem with bugs with so many other scripts loaded.it serves the purpose right.
"A thing of beauty is a joy forever" - Keats

***
Rep:
Level 82
aka DigiDeity
Quote
by the way,can you explain the new menu item adding part a bit?
OK as first I'll explain how to add new items to the "menu".
On the top of the script you'll find:
Quote
    ITEMS = [
    [2,["Scene_Item",""],false,"Item"],
    [13,["Scene_File","true, false, false"],false,"Save"],
    [7,["Scene_Equip","0"],true,"Equip"],
    [35,["Scene_Status","0"],true,"Status"],
    [17,["Scene_End",""],false,"End"],
    ] #<= Do not delete!

The red number is the index of an icon from the IconSet. Just count the icons from left to right and start with 0 not 1.

The green part is an array with 2 values. The first is the name of the Scene which will be called if you click on this Icon. This name you'll find most of the times at the begining of every script. The second value are the parameters which have to be given while you call a scene. This are also at the begining of the scene. For example you wannt to open the status scene. Open the Script Editor go to "Scene_Status" and you have the name then open this script and you'll see:
(Line 12)  def initialize(actor_index = 0)
here you can see that you only "need" an actor index of a party member. If you dont write any parameter it will take the first (0) party member.

The blue value is boolean it means it can be true or false. If the Scene deal with a character which have to be choosen you have to write true else false. At this version of the script it hasn't any sens but maybe in the future versions. ^^

At least the yellow part is the discription which will be written in to the small window over the "menu". It should be short I think.


The 5 Items I've added are just to test or to show you the current state of the script. You can delete them and add your own.


Quote
and why is this "not done" version,just curious..mainly because it is awesome and I have no problem with bugs with so many other scripts loaded.it serves the purpose right.
I'm glad that there no bugs. :P
I've added this notice cause there still some parts which have to become better. For exmaple you can choose the width of the window in which the discription is written. Or that this window move to the icon and notice if it have to be drawn under the "menu" if it's out of screen.
I wannt to add the actor window,also. Maybe we'll get some more ideas.

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


**
Rep: +0/-0Level 82
There is no end to learning!
No probs,will wait for your updated version :) for the time being,it will serve me perfectly.Your name will be on top of all the others in my credits because you just created this script on my request.btw I've PMed you something,let me know what you think...
"A thing of beauty is a joy forever" - Keats

***
Rep:
Level 82
aka DigiDeity
Already answered thank you again for the offer. ^^
If you have some ideas let me know so long I will finish the script.

Quote
Your name will be on top of all the others in my credits because you just created this script on my request.
It makes me glad to read this. ^^

______
EDIT:
______
I made a litle update just try it out:
Code: [Select]
module Deity
  module MapMouseHUD
    # Menu Settings #
    # Just add as many Items as you wish(or the place you have ^^)
    # to add an Item just write more of those lines:
    # Iconindex, ["Scenename","Sceneparameter"],choose_actor,"Discrition"],
    ITEMS = [
    [2,["Scene_Item",""],false,"Item"],
    [13,["Scene_File","true, false, false"],false,"Save"],
    [7,["Scene_Equip","0"],true,"Equip"],
    [35,["Scene_Status","0"],true,"Status"],
    [17,["Scene_End",""],false,"End"],
    ] #<= Do not delete!   
    X = 0 # X-Coordinate
    Y = 360 # Y-Coordinate
    # To change the colors you have to change the 4 numbers
    # the numbers have to be between 0 and 255.
    # they change the whole color like this:
    # (red,green,blue,opacity)
    SLOT_COLORS = [
    Color.new(250,250,250,250), #Edge
    Color.new(100,100,100,200) # Fillcolor
    ] #<= Do not delete! 
    # Discription Settings #
    DISCRIPTION_WIDTH = 120
    SLIDE_TO_ICON = false # If the discription window have to slide to
                         # the marked icon.
    DISCRITION_Y = 14 # Correct the discrition window position (can be negative)
                      # with this constant you can move the window up and down
    DISCRIPTION_OPACITY = 100 # Opacity of the discription window
    # Other Settings #
    RETURN_TO_MAP = true # Should you go to the map after use items etc.?
                         # (only default scenes)
  end
end
include Deity::MapMouseHUD
class Scene_Map
  alias start_mapmousehud start unless $@
  def start
    start_mapmousehud
    @mmhud = Window_MapMouseHUD.new(X,Y,ITEMS)
  end
  alias update_mapmousehud update unless $@
  def update
    update_mapmousehud
    @mmhud.update
  end
  alias terminate_mapmousehud terminate unless $@
  def terminate
    terminate_mapmousehud
    @mmhud.dispose
  end
end
class Window_MapMouseHUD < Window_Base
  def initialize(x,y,items = [])
    super(x,y,32+items.length+items.length*24,56)
    @items = []
    if self.y - 56 < 0
      @help = Window_Base.new(x,y+112+DISCRITION_Y,DISCRIPTION_WIDTH,56)
    else
      @help = Window_Base.new(x,y-56+DISCRITION_Y,DISCRIPTION_WIDTH,56)
    end
    @help.visible = false
    @help.opacity = DISCRIPTION_OPACITY
    draw_items(items)
  end
  def draw_items(items)
    for i in 0...items.length
      draw_icon(items[i][0],i + i*24, 0)
      @items.push(MapMouseHUD_Item.new(self.x + 16 + i + i*24,self.y+16,items[i][1],items[i][2],items[i][3]))
    end
  end
  def draw_icon(icon_index, x, y, enabled = true)
    self.contents.fill_rect(x,y,24,24,SLOT_COLORS[0])
    self.contents.fill_rect(x+1,y+1,22,22,SLOT_COLORS[1])
    bitmap = Cache.system("Iconset")
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
  end
  def update
    if Mouse.click?(1)
      for i in @items
        if i.hit?
          i.call_item_scene
        end
      end
    else
      for i in @items
        if i.hit?
          if !@help.visible
            @help.visible = true
          end
          @help.x = i.x if SLIDE_TO_ICON
          @help.contents.clear
          @help.contents.draw_text(0,0,DISCRIPTION_WIDTH-32,24,i.desc,1)
          break
        else
          if @help.visible
            @help.visible = false
            @help.contents.clear
          end
        end
      end
    end
  end
  def dispose
    @items = []
    @help.dispose
    self.contents.dispose
    super
  end
end
class MapMouseHUD_Item
  attr_reader :x
  attr_reader :y
  attr_reader :desc
  def initialize(x,y,scene,choose_actor,description)
    @x = x
    @y = y
    @scene = scene
    @choose = choose_actor
    @desc = description
  end
  def hit?
    if Mouse.pos != nil
      return Mouse.pos[0] >= @x && Mouse.pos[0] <= @x+24 && Mouse.pos[1] >= @y && Mouse.pos[1] <= @y+24
    else
      return false
    end
  end
  def call_item_scene
    $scene = eval("#{@scene[0]}.new(#{@scene[1]})")
  end
end
if RETURN_TO_MAP
class Scene_File
 def return_scene
   if @from_title
     $scene = Scene_Title.new
   elsif @from_event
     $scene = Scene_Map.new
   else
     $scene = Scene_Map.new
   end
  end
end
class Scene_Equip
 def return_scene
   $scene = Scene_Map.new
 end
end
class Scene_Status
 def return_scene
   $scene = Scene_Map.new
 end
end
class Scene_Item
 def return_scene
   $scene = Scene_Map.new
 end
end
class Scene_Skill
 def return_scene
   $scene = Scene_Map.new
 end
end
class Scene_End
 def return_scene
   $scene = Scene_Map.new
 end
end
end

Deity
« Last Edit: May 01, 2010, 06:25:31 PM by Deity »
Greetings
DigiDeity

├Work┤
├Contact┤


**
Rep: +0/-0Level 82
There is no end to learning!
1) Hey Deity,came across the first bug while clicking on the menu items on map.here's the screenshot-


2)another thing,when I click on any of the icons,the character starts to move in that direction.any fix for this?

3) biggest problem-can't add more menu items,returns an error.I added-
[177,["Scene_Quest","0"],false,"Quests"] for quest journal menu item and
[47,["Scene_Party","0"],false,"Party"] for party changing.

Both returned errors.I checked the scripts of party changer and quest logger but I seem to get the right function.still for your reference,I'm pasting the two scripts I'm using for quest journal and party changing.may be you can tell me how to call them from the menu hud if I'm doing wrong :)

Modern algebra's Quest Journal script-

http://www.mediafire.com/file/myuv10hvzji/Quest%20Journal%20script%20by%20modern%20algebra.txt

Prexus party changer script-

http://www.mediafire.com/file/zgkoo2jtjkk/Party%20Changer%20script-gsorby%20and%20prexus.txt

4) how can I show the other characters in equip,status and skill?it only shows the first character.

edit:while playing around with the script,I noticed that if i change the order of the menu items,no errors show up.I used three menu items to display on map-menu,save and end.when they are in this order-menu,save,end;the game returned errors at those lines where they were defined.then I changed the order to end,save and menu and no error has popped up so far :)
« Last Edit: May 02, 2010, 07:12:13 AM by zubin73 »
"A thing of beauty is a joy forever" - Keats

***
Rep:
Level 82
aka DigiDeity
1. Can't understand. This line is correct until you've added some Menuitems which change the lines but line 126 is okay. ^^
    Wirte the line out of your Script and discribe what you done.

2. It would be possible but I have to overwrite Woratanas Mouse Script. ^^

3. [177,["Scene_Quest",""],false,"Quests"]  works perfectly. I think you forgot the "comma" behind every item. Maybe you show me the given error.
Quote
edit:while playing around with the script,I noticed that if i change the order of the menu items,no errors show up.I used three menu items to display on map-menu,save and end.when they are in this order-menu,save,end;the game returned errors at those lines where they were defined.then I changed the order to end,save and menu and no error has popped up so far Smiley
This would fit to my suggestion. ^^

4. Ehm like I said at this version only with Q and W. You switch in the Scene between the characters. I have no ideas how do it better. :P

Deity

=============
EDIT
=============

Ok I've written a new update.
It looks this kind:

Try it out.

1. The new Script.
Code: [Select]
module Deity
  module MapMouseHUD
    # Menu Settings #
    # Just add as many Items as you wish(or the place you have ^^)
    # to add an Item just write more of those lines:
    # Iconindex, ["Scenename","Sceneparameter"],choose_actor,"Discrition"],
    ITEMS = [
    [144,["Scene_Item",""],false,"Item"],
    [176,["Scene_File","true, false, false"],false,"Save"],
    [32,["Scene_Equip","0"],true,"Equip"],
    [137,["Scene_Status","0"],true,"Status"],
    [213,["Scene_End",""],false,"End"],
    ] #<= Do not delete!   
    X = 0 # X-Coordinate
    Y = 360 # Y-Coordinate
    # To change the colors you have to change the 4 numbers
    # the numbers have to be between 0 and 255.
    # they change the whole color like this:
    # (red,green,blue,opacity)
    SLOT_COLORS = [
    Color.new(250,250,250,250), #Edge
    Color.new(100,100,100,200) # Fillcolor
    ] #<= Do not delete! 
    # Discription Settings #
    DISCRIPTION_WIDTH = 120
    SLIDE_TO_ICON = true # If the discription window have to slide to
                         # the marked icon.
    DISCRITION_Y = 14 # Correct the discrition window position (can be negative)
                      # with this constant you can move the window up and down
    DISCRIPTION_OPACITY = 100 # Opacity of the discription window
    # Actor Window Settings #
    ACTOR_AUTO = true # Auto fit to the menu.
    ACTOR_WIDTH = 300 # Width of the window if ACTOR_AUTO = false.
    ACTOR_X = 0
    ACTOR_Y = 0
    # Cursor Settings#
    CURSOR_COLOR = Color.new(255,100,100,255) # Color of the Cursor.
    # Other Settings #
    RETURN_TO_MAP = true # Should you go to the map after use items etc.?
                         # (only default scenes)
    CONTROLL_SWITCH_ID = 1 # Visible control of menu
  end
end
include Deity::MapMouseHUD
module Mouse
  def Mouse.pos
    x, y = Mouse.screen_to_client(*Mouse.global_pos)
    width, height = Mouse.client_size
    begin
      if (x >= 0 and y >= 0 and x < width and y < height)
        return x, y
      else
        return -100,-100
      end
    rescue
      return -100,-100
    end
  end
end
class Scene_Map
  alias start_mapmousehud start unless $@
  def start
    start_mapmousehud
    @mmhud = Window_MapMouseHUD.new(X,Y,ITEMS)
  end
  alias update_mapmousehud update unless $@
  def update
    update_mapmousehud
    @mmhud.update if !$game_map.interpreter.running? && !$game_message.visible && $game_switches[CONTROLL_SWITCH_ID]
    if $game_switches[CONTROLL_SWITCH_ID] && !$game_message.visible
      @mmhud.change_visibility(true)
    else
      @mmhud.change_visibility(false)
    end
  end
  alias terminate_mapmousehud terminate unless $@
  def terminate
    terminate_mapmousehud
    @mmhud.dispose
  end
end
class Window_MapMouseHUD < Window_Base
  def initialize(x,y,items = [])
    super(x,y,32+items.length+items.length*24,56)
    @items = []
    @actors = []
    @scene = nil
    if self.y - 56 < 0
      @help = Window_Base.new(x,y+112+DISCRITION_Y,DISCRIPTION_WIDTH,56)
    else
      @help = Window_Base.new(x,y-56+DISCRITION_Y,DISCRIPTION_WIDTH,56)
    end
    @cursor = [Sprite.new,Sprite.new]
    @cursor[0].visible = false
    @cursor[1].visible = false
    @c_id = nil
    @help.visible = false
    @help.opacity = DISCRIPTION_OPACITY
    x = ACTOR_X
    y = ACTOR_Y
    width = ACTOR_WIDTH
    if ACTOR_AUTO
      x = self.x + self.width
      y = self.y
      width = 544 - self.width - self.x
    end
    @actor = Window_Base.new(x,y,width,56)
    @help.z = @actor.z + 1
    self.visible = $game_switches[CONTROLL_SWITCH_ID]
    @actor.visible = $game_switches[CONTROLL_SWITCH_ID]
    draw_items(items)
    draw_party
    create_cursor
  end
  def create_cursor
    @cursor[0].bitmap = Bitmap.new(24,24)
    @cursor[0].bitmap.fill_rect(0,0,@cursor[0].bitmap.width,@cursor[0].bitmap.height,CURSOR_COLOR)
    @cursor[0].bitmap.clear_rect(2,2,@cursor[0].bitmap.width-4,@cursor[0].bitmap.height-4)
    @cursor[1].bitmap = Bitmap.new((@actor.width-32) / $game_party.members.size,24)
    @cursor[1].bitmap.fill_rect(0,0,@cursor[1].bitmap.width,@cursor[1].bitmap.height,CURSOR_COLOR)
    @cursor[1].bitmap.clear_rect(2,2,@cursor[1].bitmap.width-4,@cursor[1].bitmap.height-4)
    @cursor[0].z = 101
    @cursor[1].z = 101
    @cursor[0].x = -1000
    @cursor[1].x = -1000
  end
  def draw_items(items)
    @items = []
    self.contents.clear
    for i in 0...items.length
      draw_icon(items[i][0],i + i*24, 0)
      @items.push(MapMouseHUD_Item.new(self.x + 16 + i + i*24,self.y+16,items[i][1],items[i][2],items[i][3]))
    end
  end
  def draw_party
    @actors = []
    @actor.contents.clear
    a = 0
    platz = (@actor.width-32) / $game_party.members.size
    for i in $game_party.members
      x = a*(platz)
      draw_member(x,a,platz)
      @actors.push(MapMouseHUD_Character.new(@actor.x + 16 + x,@actor.y + 16,a,platz))
      a += 1
    end
  end
  def draw_member(x,id,platz)
    actor = $game_party.members[id]
    width = platz - 20
    @actor.draw_actor_hp_gauge(actor,x+20,-8,width)
    @actor.draw_actor_mp_gauge(actor,x+20,0,width)
    bitmap = Cache.character(actor.character_name)
    sign = actor.character_name[/^[\!\$]./]
    if sign != nil and sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    n = actor.character_index
    src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
    head = Bitmap.new(cw,ch)
    head.blt(0,0, bitmap, src_rect)
    @actor.contents.blt(x,0,head,Rect.new(0,0,cw,ch))
  end
  def draw_icon(icon_index, x, y, enabled = true)
    self.contents.fill_rect(x,y,24,24,SLOT_COLORS[0])
    self.contents.fill_rect(x+1,y+1,22,22,SLOT_COLORS[1])
    bitmap = Cache.system("Iconset")
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
  end
  def hit?
    if Mouse.pos != nil
      return Mouse.pos[0] >= self.x && Mouse.pos[0] <= self.x+self.width && Mouse.pos[1] >= self.y && Mouse.pos[1] <= self.y+self.height
    else
      return false
    end
  end
  def actor_hit?
    if Mouse.pos != nil
      return Mouse.pos[0] >= @actor.x && Mouse.pos[0] <= @actor.x+@actor.width && Mouse.pos[1] >= @actor.y && Mouse.pos[1] <= @actor.y+@actor.height
    else
      return false
    end
  end
  def change_visibility(switch)
    @actor.visible = switch
    self.visible = switch
  end
  def update_items
    id = 0
    for i in @items
      if i.hit?
        if !i.choose
          i.call_item_scene
          @scene = nil
          @c_id = nil
        else
          @c_id = id
          @scene = i.scene[0]
        end
      end
      id += 1
    end
  end
  def update_actors
    for i in @actors
      if i.hit?
        i.call_item_scene(@scene)
        @scene = nil
        @c_id = nil
      end
    end
  end
  def update_cursor(item = nil)
    if item != nil
      if item.methods.include?("desc")
        @cursor[0].x = item.x
        @cursor[0].y = item.y
      else
        @cursor[1].x = item.x
        @cursor[1].y = item.y
      end
    elsif @c_id != nil
      @cursor[0].x = @items[@c_id].x
    end
    update_cursor_visibility
  end
  def update_cursor_visibility
    if hit? || @c_id != nil
      @cursor[0].visible = true
    else
      @cursor[0].visible = false
    end
    @cursor[1].visible = actor_hit?
  end
  def update
    return if Mouse.pos.nil?
    update_cursor
    if Mouse.click?(1)
      if @scene == nil || @c_id != nil
        update_items
      end
      if @c_id != nil
        update_actors
      elsif !actor_hit?
        @scene = nil
        @c_id = nil
      end
    else
      for i in @items + @actors
        if i.hit?
          update_cursor(i)
          if !@help.visible
            @help.visible = true
          end
          @help.x = i.x if SLIDE_TO_ICON
          @help.contents.clear
          if i.methods.include?("desc")
            text = i.desc
          else
            text = i.name
          end
          @help.contents.draw_text(0,0,DISCRIPTION_WIDTH-32,24,text,1)
          break
        else
          if @help.visible
            @help.visible = false
            @help.contents.clear
          end
        end
      end
    end
  end
  def dispose
    @items = []
    @actors = []
    @scene = nil
    @c_id = nil
    @help.dispose
    @actor.dispose
    for i in @cursor
      i.dispose
    end
    self.contents.dispose
    super
  end
end
class MapMouseHUD_Item
  attr_reader :x
  attr_reader :y
  attr_reader :desc
  attr_reader :scene
  attr_reader :choose
  def initialize(x,y,scene,choose_actor,description)
    @x = x
    @y = y
    @scene = scene
    @choose = choose_actor
    @desc = description
  end
  def hit?
    if Mouse.pos != nil
      return Mouse.pos[0] >= @x && Mouse.pos[0] <= @x+24 && Mouse.pos[1] >= @y && Mouse.pos[1] <= @y+24
    else
      return false
    end
  end
  def call_item_scene
    $scene = eval("#{@scene[0]}.new(#{@scene[1]})")
  end
end
class MapMouseHUD_Character
  attr_reader :x
  attr_reader :y
  attr_reader :name
  def initialize(x,y,mem_id,width)
    @x = x
    @y = y
    @width = width
    @id = mem_id
    @name = $game_party.members[@id].name
  end
  def hit?
    if Mouse.pos != nil
      return Mouse.pos[0] >= @x && Mouse.pos[0] <= @x+@width && Mouse.pos[1] >= @y && Mouse.pos[1] <= @y+24
    else
      return false
    end
  end
  def call_item_scene(scene)
    $scene = eval("#{scene}.new(#{@id})")
  end
end
if RETURN_TO_MAP
class Scene_File
 def return_scene
   if @from_title
     $scene = Scene_Title.new
   elsif @from_event
     $scene = Scene_Map.new
   else
     $scene = Scene_Map.new
   end
  end
end
class Scene_Equip
 def return_scene
   $scene = Scene_Map.new
 end
end
class Scene_Status
 def return_scene
   $scene = Scene_Map.new
 end
end
class Scene_Item
 def return_scene
   $scene = Scene_Map.new
 end
end
class Scene_Skill
 def return_scene
   $scene = Scene_Map.new
 end
end
class Scene_End
 def return_scene
   $scene = Scene_Map.new
 end
end
end

2. Edited "Simple Mouse System" from Woratana (Replace it with your's if you want that the player can't move under the menu)
Code: [Select]
#==============================================================================
# [VX] SMS - Simple Mouse System
#------------------------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Released on: 14/04/2008 (D-M-Y)
# ? Version: 1.5
#
# ? Credit: DerVVulfman, Near Fantastica, and Freak Boy [Mouse Input Module]
# lambchop, shun, Cybersam, Astro_mech, and Mr.Mo [Super Simple Mouse System]
# - Modern Algebra, Zeriab, Patrick Lester [Path Finding]
# - Near Fantastica, Fuso [Path Finding]
#
# - I will not be able to script this without those people and scripts above
#-----------------------------------------------------------------------------
#====[REQUIRE]=====
# - DerVVulfman's Mouse Input Module
# - Modern Algebra's Path Finding [version 2.0]
#
#====[FEATURE]=====
# - Support to use mouse in many scenes / windows
# - Mouse Pointer
# - Click on map to move player with Path Finding
# - Click on event to go talk/interact with that event
# - Click on event to walk to that event and interact
# - You can choose scene(s) that don't want to use mouse
# - You can turn mouse ON/OFF automatically by call script:
# $scene.no_mouse = (true/false) # True to turn off mouse

#====[MOUSE TAGS]=====
# Put one (or more) of these tags in the event command 'Comment..'
# [mauto] : This event will run automatically after click on it
# [mnone] : This event will not be determine as event when click on it
# (a.k.a. Player will not interact with it)

# [mtop] : Player will always stop at tile above this event when click on it
# [mleft] : Same as [mtop], but left side
# [mright] : Same as [mtop], but right side
# [mdown] : Same as [mtop], but below
#------------------------------------------------------------------------------

module Mouse
#==============================================================================
# MOUSE SETUP PART
#----------------------------------------------------------------------------
Scroll_Delay = 30 # (in Frames)
# Mouse Delay when scroll up or down the list

Path_Finding_Iteration = 0 # (Integer, 0 for no limit)
# How deep you want path finding to process until find the way
# less number will be able to find only easy path, less lag
# high number will be able to find complicated path, possible to increase lag

Scene_No_Mouse = []
# Scene(s) that you don't want to use mouse
# e.g. Scene_No_Mouse = [Scene_File, Scene_Map, Scene_Title]

Auto_Find_Destination = true
# It will automatically find the cloeset destination on map
# when click on unpassable tile.
#==============================================================================
end

#==============================================================================
# ** Mouse Input Module
#==============================================================================
class << Mouse
  show_cursor = Win32API.new('user32', 'ShowCursor', 'l', 'l')
  show_cursor.call(0)

  $mousec = Sprite.new
  $mousec.z = 10001
  $mousec.x = $mousec.y = 1000
  $mouse_icon = $base_cursor = 'foxkeh_cursor'
  $mousec.bitmap = Cache.system($base_cursor)
  $mouse_duration = -1
  $mouse_changed = false
 
  alias wor_mouse_upd_mouse update unless $@
  def Mouse.update
    wor_mouse_upd_mouse
    if $scene.no_mouse
      $mousec.visible = false if $mousec.visible
      return
    else; $mousec.visible = true if !$mousec.visible
    end
    if $mouse_old_icon.nil? or $mouse_old_icon != $mouse_icon
      $mouse_old_icon = $mouse_icon
      $mousec.bitmap = Cache.system($mouse_old_icon)
    end
    if @pos.nil?
      $mousec.x = 1000 if $mousec.x != 1000
      $mousec.y = 1000 if $mousec.y != 1000
    else
      $mousec.x = @pos[0] if $mousec.x != @pos[0]
      $mousec.y = @pos[1] if $mousec.y != @pos[1]
    end
  end
 
  def Mouse.map_pos
    return nil if @pos == nil
    x = ($game_map.display_x / 256) + (@pos[0] / 32)
    y = ($game_map.display_y / 256) + (@pos[1] / 32)
    return [x, y]
  end
end

#==============================================================================
# ** Input
#==============================================================================
class << Input
  alias wor_input_upd_mouse update unless $@
  alias wor_input_trig_mouse trigger? unless $@
  alias wor_input_rep_mouse repeat? unless $@
  def Input.update
    wor_input_upd_mouse
    Mouse.update
  end
 
  def Input.trigger?(input)
    return wor_input_trig_mouse(input) if Mouse.pos.nil?
    if input == Input::B and !$scene.no_mouse
      return (wor_input_trig_mouse(input) or Mouse.click?(2))
    elsif input == Input::C and !$scene.no_mouse
      if $scene.is_a?(Scene_Map) and !$game_message.visible
        return wor_input_trig_mouse(input)
      else
        return (wor_input_trig_mouse(input) or Mouse.click?(1))
      end
    else
      return wor_input_trig_mouse(input)
    end
  end
 
  def Input.repeat?(input)
    if input == Input::B and !$scene.no_mouse
      return (wor_input_rep_mouse(input) or Mouse.click?(2))
    else
      return wor_input_rep_mouse(input)
    end
  end
end
#==============================================================================
# ** Graphics
#==============================================================================
class << Graphics
  alias wor_graph_fadeout_mouse fadeout unless $@
  def Graphics.fadeout(frames = 1)
    $mousec.visible = false if !$mousec.nil?
    wor_graph_fadeout_mouse(frames)
  end
end
#==============================================================================
# ** Window_Selectable
#==============================================================================
class Window_Selectable < Window_Base
  alias wor_winsel_ini_mouse initialize
  alias wor_winsel_upd_mouse update
  def initialize(*args)
    wor_winsel_ini_mouse(*args)
    @scroll_wait = 0
    @cursor_wait = 0
  end

  def update
    wor_winsel_upd_mouse
    update_mouse if self.active and self.visible
  end
 
  def update_mouse
    @cursor_wait -= 1 if @cursor_wait > 0
    (0..@item_max - 1).each do |i|
      irect = item_rect(i)
      irx = self.x + 16 + irect.x - self.ox
      iry = self.y + 16 + irect.y - self.oy
      move_cursor(i) if Mouse.area?(irx, iry, irect.width, irect.height)
    end
  end

  def move_cursor(index)
    return if @index == index
    @scroll_wait -= 1 if @scroll_wait > 0
    row1 = @index / @column_max
    row2 = index / @column_max
    bottom = self.top_row + (self.page_row_max - 1)
    if row1 == self.top_row and row2 < self.top_row
      return if @scroll_wait > 0
      @index = [@index - @column_max, 0].max
      @scroll_wait = Mouse::Scroll_Delay
    elsif row1 == bottom and row2 > bottom
      return if @scroll_wait > 0
      @index = [@index + @column_max, @item_max - 1].min
      @scroll_wait = Mouse::Scroll_Delay
    else
      @index = index
    end
    return if @cursor_wait > 0
    Sound.play_cursor
    @cursor_wait += 2
  end
end
#==============================================================================
# ** Window_MenuStatus
#==============================================================================
class Window_MenuStatus < Window_Selectable
  def item_rect(index)
    return Rect.new(0, index * 96, contents.width, 96)
  end
end
#==============================================================================
# ** Window_NameInput
#==============================================================================
class Window_NameInput < Window_Base
  alias wor_winnam_upd_mouse update
  def update
    wor_winnam_upd_mouse
    if self.active and self.visible
      (0..TABLE[@mode].size - 1).each do |i|
      irect = item_rect(i)
      irx = self.x + 16 + irect.x - self.ox
      iry = self.y + 16 + irect.y - self.oy
      @index = i if Mouse.area?(irx, iry, irect.width, irect.height)
      end
    end
  end
end
#==============================================================================
# ** Window_PartyCommand
#==============================================================================
class Window_PartyCommand < Window_Command
  def update_mouse
    (0..@item_max - 1).each do |i|
    irect = item_rect(i)
    irx = self.viewport.ox + 16 + irect.x - self.ox
    iry = 288 + 16 + irect.y - self.oy
    self.index = i if Mouse.area?(irx, iry, irect.width, irect.height)
    end
  end
end
#==============================================================================
# ** Window_ActorCommand
#==============================================================================
class Window_ActorCommand < Window_Command
  def update_mouse
    (0..@item_max - 1).each do |i|
    irect = item_rect(i)
    irx = self.viewport.ox + 288 + 16 + irect.x
    iry = 288 + 16 + irect.y
    self.index = i if Mouse.area?(irx, iry, irect.width, irect.height)
    end
  end
end
#==============================================================================
# ** Window_Message
#==============================================================================
class Window_Message < Window_Selectable
  def update_mouse
    (0..@item_max - 1).each do |i|
      irect = item_rect(i)
      irx = self.x + 16 + irect.x - self.ox
      iry = self.y + 16 + irect.y - self.oy + ($game_message.choice_start * WLH)
      self.index = i if Mouse.area?(irx, iry, irect.width, irect.height)
    end
  end
end

#==============================================================================
# ** Scene_Base
#==============================================================================
class Scene_Base
  alias wor_scebase_posstr_mouse post_start
  alias wor_scebase_preter_mouse pre_terminate
  attr_accessor :no_mouse
 
  def post_start
    if !$mousec.nil?
      $mousec.visible = true
      @no_mouse = false
      # If this scene is in Scene_No_Mouse
      Mouse::Scene_No_Mouse.each do |sce|
        if $scene.is_a?(sce)
          $mousec.visible = false
          @no_mouse = true
        end
      end
    end
    wor_scebase_posstr_mouse
  end
 
  def pre_terminate
    $mousec.visible = false if !$mousec.nil?
    wor_scebase_preter_mouse
  end
end
#==============================================================================
# ** Scene_File
#==============================================================================
class Scene_File < Scene_Base
  alias wor_scefil_upd_mouse update
  def update
    (0..@item_max - 1).each do |i|
      ix = @savefile_windows[i].x
      iy = @savefile_windows[i].y
      iw = @savefile_windows[i].width
      ih = @savefile_windows[i].height
      if Mouse.area?(ix, iy, iw, ih)
        @savefile_windows[@index].selected = false
        @savefile_windows[i].selected = true
        @index = i
      end
    end
    wor_scefil_upd_mouse
  end
end
#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
  alias wor_scemap_upd_mouse update
 
  def update
    wor_scemap_upd_mouse
    if !@no_mouse
      # IF left click
      if Mouse.click?(1) and !$game_message.visible and
        !$game_map.interpreter.running? and !@mmhud.hit? and !@mmhud.actor_hit?
        mouse_xy = Mouse.map_pos
        return if mouse_xy.nil?
        old_direction = $game_player.direction
        $game_player.turn_toward_pos(mouse_xy[0], mouse_xy[1])
        # IF click near player, and there's trigger to event, run event
        return if ($game_player.front?(mouse_xy[0],mouse_xy[1]) and
      $game_player.check_action_event)
        $game_player.clear_path
        $game_player.mouse_force_path(mouse_xy[0], mouse_xy[1])
      # IF middle click
      elsif Mouse.click?(3) and !$game_message.visible and
        !$game_map.interpreter.running?
        mouse_xy = Mouse.map_pos
        return if mouse_xy.nil?
        $game_player.clear_path
        $game_player.turn_toward_pos(mouse_xy[0], mouse_xy[1])
      end
    end
  end
end
#==============================================================================
# ** Game_Character
#==============================================================================
class Game_Character
  def mouse_force_path(x, y, auto_check = ($game_map.events_xy(x, y).size > 0))
    ori_x, ori_y = x, y
    path_xy = $game_map.find_dest_xy(x, y, @x, @y)
    return if path_xy.nil?
    x, y = path_xy[0] ,path_xy[1]
    # Force_move from MA's path finding
    if map_passable?(x,y)
      path = $game_map.find_path (self.x, self.y, x, y, false,
      Mouse::Path_Finding_Iteration, self)
      path.reverse!
      # Turn toward destination
      newmove = RPG::MoveCommand.new
      newmove.code = 45 # Script..
      newmove.parameters = ["turn_toward_pos(#{ori_x},#{ori_y})"]
      path.push newmove
      # Add script to check if there's event trigger
      if auto_check
        newmove = RPG::MoveCommand.new
        newmove.code = 45
        newmove.parameters = ['check_action_event']
        path.push newmove
      end
      # Add an end command
      path.push (RPG::MoveCommand.new (0))
      move_route = RPG::MoveRoute.new
      move_route.list = path
      move_route.repeat = false
      force_move_route (move_route)
    end
  end
 
  def clear_path
    @move_route_index = 0
    @move_route = RPG::MoveRoute.new
    @move_route.repeat = false
  end

  def turn_toward_pos(x,y)
    sx = distance_x_from_pos(x)
    sy = distance_y_from_pos(y)
    if sx.abs > sy.abs                    # Horizontal distance is longer
      sx > 0 ? turn_left : turn_right
    elsif sx.abs < sy.abs                 # Vertical distance is longer
      sy > 0 ? turn_up : turn_down
    end
  end

  def distance_x_from_pos(x)
    sx = @x - x
    if $game_map.loop_horizontal?
      if sx.abs > $game_map.width / 2
        sx -= $game_map.width
      end
    end
    return sx
  end
 
  def distance_y_from_pos(y)
    sy = @y - y
    if $game_map.loop_vertical?
      if sy.abs > $game_map.height / 2
        sy -= $game_map.height
      end
    end
    return sy
  end
 
  def front?(x,y)
    case @direction
    when 2; return true if (x == @x-1 and y == @y)
    when 4; return true if (x == @x and y == @y-1)
    when 6; return true if (x == @x and y == @y+1)
    when 8; return true if (x == @x+1 and y == @y)
    end
    return false
  end
end
#==============================================================================
# ** Game_Map
#==============================================================================
class Game_Map
  # Find Destination for Path Finding
  def find_dest_xy(x, y, self_x, self_y)
    has_event = false
    event_ary = events_xy(x, y)
    # Remove Event that has 'mnone'
    (event_ary).each do |i|
      event_ary.delete(i) if i.comment?('[mnone]')
    end
    # Return original x, y if there are more than 1 events,
    # or the only event has priority type 'Below Character'
    if (event_ary.size == 1 and event_ary[0].priority_type != 1) or
    event_ary.size > 1
      return [x, y]
    elsif event_ary.size == 1
      # IF there's event, check for reserved direction
      has_event = true
      if event_ary[0].comment?('[mtop]')
        return [x, y-1]
      elsif event_ary[0].comment?('[mleft]')
        return [x-1, y]
      elsif event_ary[0].comment?('[mright]')
        return [x+1, y]
      elsif event_ary[0].comment?('[mdown]')
        return [x, y+1]
      elsif event_ary[0].comment?('[mauto]')
        event_ary[0].start
        return nil
      end
    end
    # Check for passable direction or it's Same X/Y or doesn't allow auto-find
    if (event_ary.size != 1 and $game_player.map_passable?(x, y)) or (self_x == x and self_y == y) or
  (!Mouse::Auto_Find_Destination and !has_event)
      return [x, y]
    end
    # Find nearest path
    nx = (self_x - x)
    ny = (self_y - y)
    npath_real = []
    if (nx.abs < ny.abs and nx != 0) or (ny == 0) # X is closer than Y
      npath_real << (nx > 0 ? 'right' : 'left')
    else # EQUAL, or Y is closer than X
      npath_real << (ny > 0 ? 'up' : 'down')
    end
    npath_real_tran = move_translate(npath_real, x, y) # Translate word to value
    # If the fastest way is possible, return it
    if $game_player.map_passable?(npath_real_tran[0][0], npath_real_tran[0][1])
      return [npath_real_tran[0][0], npath_real_tran[0][1]]
    end
    npath = []
    # Add other possible ways
    npath << 'up' if !npath_real.include?('up')
    npath << 'left' if !npath_real.include?('left')
    npath << 'down' if !npath_real.include?('down')
    npath << 'right' if !npath_real.include?('right')
    npath = move_translate(npath, x, y) # Translate other possible ways
    (0..npath.size-1).each do |np| # Calculate distance from each point
      npath[np] =
      [npath[np], (self_x - npath[np][0]).abs + (self_y - npath[np][1]).abs]
    end
    npath = npath.sort_by {|i| i[1]} # Sort by Distance
    # Check to move~
    npath.each do |n|
      return [n[0][0], n[0][1]] if $game_player.map_passable?(n[0][0], n[0][1])
    end
    # IF there's no way to go
    return nil
  end
 
  def move_translate(ary, x, y)
    (0..ary.size - 1).each do |n|
      if ary[n] == 'up'
        ary[n] = [x, y-1]
      elsif ary[n] == 'left'
        ary[n] = [x-1, y]
      elsif ary[n] == 'right'
        ary[n] = [x+1, y]
      elsif ary[n] == 'down'
        ary[n] = [x, y+1]
      end
    end
    return ary
  end
end
#==============================================================================
# ** Game_Event
#==============================================================================
class Game_Event < Game_Character
  def comment?(comment, return_index = false )
    if !@list.nil?
      for i in 0...@list.size - 1
        next if @list[i].code != 108
        (0..@list[i].parameters.size - 1).each do |j|
          if @list[i].parameters[j].include?(comment)
            return [true, [i,j]] if return_index
            return true
          end
        end
      end
    end
    return [false, nil] if return_index
    return false
  end
end

Let me know if it's ok so.

Deity
« Last Edit: May 02, 2010, 07:31:05 PM by Deity »
Greetings
DigiDeity

├Work┤
├Contact┤


**
Rep: +0/-0Level 82
There is no end to learning!
I used the edited script...but now no HUD or anything shows up on the map :( .I don't know what is wrong.

I customized the previous menu like I had wanted and it was not showing any probs after that.I was happy with it.I made the icon call the menu itself so that the status and equip scene didn't only pull up the 1st player.

I noticed this-
Code: [Select]
CONTROLL_SWITCH_ID = 1 # Visible control of menu
what is this for?The 1st variable of my system is taken by other control switch,may be because of this it is not working?

edit:I used your scripts in another of my project and got error in this line-


then I tried it in an absolutely new project with no other scripts loaded,and there I can't see the menu hud at all!

Then I got frustrated and used your old script and your edited mouse system in that fresh project.when I clicked on any menu icon,I got this error-


Currently using the older version of your script.and it throws up error on either line 124 or 126 while play testing when ever I move the mouse into the screen from outside the window or vice versa.meaning when I use the keys instead of the mouse,the mouse normally is put away outside the game screen/window.So when I try to bring in the mouse from outside the game window into the game screen or vice versa,this error shows up.any fix for this?

my current menu item configuration is-
Code: [Select]
ITEMS = [
    [157,["Scene_End",""],false,"End"],
    [149,["Scene_File","true, false, false"],false,"Save"],
    [133,["Scene_Menu",""],false,"Menu"],
    ] #<= Do not delete!

But I still appreciate what you are doing,great work!And can't wait to implement the updated menu hud successfully.it looks great by the way!
« Last Edit: May 03, 2010, 09:33:59 AM by zubin73 »
"A thing of beauty is a joy forever" - Keats

***
Rep:
Level 82
aka DigiDeity
Ok just try the demo out.
It's important that you take the scripts of the demo in your project and replace the old one.

Deity
Greetings
DigiDeity

├Work┤
├Contact┤


**
Rep: +0/-0Level 82
There is no end to learning!
tried the demo,the equip and status icon doesn't work.also can't call the menu by pressing 'escape' if required.what I wanted is to provide shortcuts to the main menu on screen,not eliminate the menu call at all.The character huds look cute,but I think your previous menu version was better because that is what I wanted.If it is possible to include the character huds along with the previous menu system,then let me know.
Kudos to all your efforts,you are really good!
"A thing of beauty is a joy forever" - Keats

***
Rep:
Level 82
aka DigiDeity
Just read the settings at the beginning of the script and change them as you like.
If you dont want to disable the menu just write false after the right constant or open it with the standart eventcommand. ^^
At the beginning the Text say that you have to click first at "Equip" and then the char you want to see. Do you done this?

Deity
« Last Edit: May 03, 2010, 04:01:32 PM by Deity »
Greetings
DigiDeity

├Work┤
├Contact┤