Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Updating a window on the map, How to?
Adrien.
post Jan 2 2012, 02:19 PM
Post #1


Bet Mapper
Group Icon

Group: Banned
Posts: 1,632
Type: Mapper
RM Skill: Advanced




I am curious (we really need a rgss3 learning area or something - any ways) when people make gold windows, step counters or hp/mp bars for the map screen how are they getting them to contently update? I have found a few update methods but they do nothing for me..


__________________________



Games I am working on | Each image is a link to the game
Go to the top of the page
 
+Quote Post
   
Night5h4d3
post Jan 2 2012, 02:39 PM
Post #2


The past tense
Group Icon

Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed




It hasn't changed, you need to call the .update method for each window every frame from the current scene script. Though if you really want to create/update a window from the map; use a common event that calls:

CODE
>wait 1 frame
> call script: "@mywindow.update"


As a parallel process.


__________________________
Got 30 minutes? Then you've enough time to play this awesome game:

- potentially promising project page
- thanks holder
My growing space of user-bars:

about me:







I made the following!





Go to the top of the page
 
+Quote Post
   
Adrien.
post Jan 2 2012, 02:51 PM
Post #3


Bet Mapper
Group Icon

Group: Banned
Posts: 1,632
Type: Mapper
RM Skill: Advanced




how would I do this via the script as If I am writing an extension? I am not sure where the call for waiting a specific amount of frames is before calling the update.


__________________________



Games I am working on | Each image is a link to the game
Go to the top of the page
 
+Quote Post
   
Night5h4d3
post Jan 2 2012, 04:58 PM
Post #4


The past tense
Group Icon

Group: +Gold Member
Posts: 1,199
Type: Scripter
RM Skill: Undisclosed




Okay, I'm completely lost on what you're trying to achieve, if you want to create a window from the map, you use a common event to update it. if you're creating a window from scripts (as in Scene_Item or something) then you shouldn't need to call the .update method, but make sure your class is an extension of Scene_Base if you do that.


__________________________
Got 30 minutes? Then you've enough time to play this awesome game:

- potentially promising project page
- thanks holder
My growing space of user-bars:

about me:







I made the following!





Go to the top of the page
 
+Quote Post
   
Adrien.
post Jan 2 2012, 05:33 PM
Post #5


Bet Mapper
Group Icon

Group: Banned
Posts: 1,632
Type: Mapper
RM Skill: Advanced




I am probably doing a lot wrong here, how ever as it stands this creates a window that writes: Gold: 0. if i walk over an event with gold and collect the gold the window doesn't update. (this window is displayed on the map while the character walks around). if I open the menu, then the window updates....What am I doing wrong?

Also, the draw_window_content method, see how I switch between system and normal color? there has to be a way better way of doing that.....


make better sense?


CODE
class Window_Show_InfoMap < Window_Base
  
  def initialize
    super(0, 0, 300, fitting_height(2))
    refresh
  end
  
  def refresh
    contents.clear
    draw_window_content
  end
  
  def draw_window_content
    cx = text_size(16).width
    change_color(system_color)
    draw_text(x+10, y+10, 50, line_height, "Gold: ")
    change_color(normal_color)
    draw_text(x+50, y+10, 10, line_height, $game_party.gold, 2)
  end
  
end

class Scene_Map
  
  alias adrien_window_show_infomap_start_a start
  def start
    adrien_window_show_infomap_start_a
    create_show_infomap
  end
  
  def create_show_infomap
    @show_infomap_window = Window_Show_InfoMap.new
    @show_infomap_window.x = 200
    @show_infomap_window.y = 0
  end
  
end


__________________________



Games I am working on | Each image is a link to the game
Go to the top of the page
 
+Quote Post
   
X-M-O
post Jan 3 2012, 12:40 AM
Post #6


Level 82
Group Icon

Group: Director
Posts: 6,347
Type: None
RM Skill: Undisclosed




Closed per user request.


__________________________
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th May 2013 - 04:41 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker