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.

Help with Selwyn's Window Cursor

Status
Not open for further replies.
I have tried posting in Selwyn's thread as well as pming Selwyn and I have not had any response yet.

First of all, here is the link to Selwyn's thread.
http://www.rmxp.org/forums/showthread.php?t=738&page=3

Currently, there is no cursor in the save or load windows. I would like to know what I would need to do to add the cursor in these windows. Since I am using a windowskin with no highlight box, it would be difficult for the player to select a save slot or load a game that is not in the first slot.
 
Selwyn must be in a really weird time zone.
Theoretically, you'll have to find the code that creates the cursor in all the other windows and copy it into a similar place in window_savefile
I'm no good with rgss, but I do alot of work in the save/load business, so I'll download the script and have a go.
 
The problem is that window_savefile doesn't use the window_selectable.
I'll look into this, but some help from a pro scripter would help
EDIT: I really can't do this. scene_file is now the problem :/
It's the "File" window That is selected, not like a normal selection window.
 

Anonymous

Guest

Easy 'nuff.

First, add this to Window_SaveFile#initialize

Code:
    @cursor = Sprite.new
    @cursor.bitmap = RPG::Cache.picture("cursor")
    @cursor.z = 10000
    @cursor.x = x
    @cursor.y = y + 24
    @cursor.visible = false

Then replace the #update_cursor method with this

Code:
  def update_cursor
    if @selected
      @cursor.visible = true
    else
      @cursor.visible = false
    end
  end
 
I had to change def update_cursor to def update_cursor_rect for it to work on the save window. However, when I tried to save my game, I received an error in the scene_save script stating that no marshal_dump is defined for class sprite_character. The weird thing is that even though I received that error, it still saved the file. But then when I try to load the file, it states that the end of the file has been reached. This error is in the scene_load script.
 

Anonymous

Guest

There doesn't seem to be a way that that error could be caused by that change. Could you post the line that the problem is on?
 
It was around line 81 of both the save and load scene scripts. I decided to test the script in a new project and I didn't have a problem saving or loading. However, the cursor remained on screen.

Also, where exactly am I supposed to add the code snippet you gave me? Does it go right after def initialize, or after @file_exist before it does the if @file exist conditions? Or is it the very last thing under window savefile initialize before the final end statement.

And, when I replace the def_update_cursor_rect, it's within the window save file script, right?

As far as the other problem I had, one of my other scripts must be interfering.
 

Anonymous

Guest

Sorry, you need to dispose it. My bad.

Add

Code:
  def dispose 
    super
    @cursor.dispose
  end

You can put it anywhere in the initialize method, I'd personally put it right under the call to super.
 
Closing at alexia's request:

This topic has been resolved. If alexia or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
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