SaburoX

Veteran
Veteran
Joined
Jan 27, 2013
Messages
96
Reaction score
8
Primarily Uses
I know I can load a scene in VX Ace with the script call SceneManager.call(X).
So my question is, how do you call a scene but jump to a specific index or category, or otherwise automate moving in that scene?

I'm trying to put together a tutorial sequence, and I can load Scene_Item. That'll load the item menu as intended, and the cursor will be on the first option in the index (items). How can I move it to the second index listing (weapons)?

Assuming there's a way to do that, a follow question would be if the method applies to stuff that might be actor specific like skills.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
398
Reaction score
99
First Language
English
Primarily Uses
So you actually don't want to load Scene_Item. I know that sounds weird but stay with me. See the "Scene" is responsible for two main things responding to user input and drawing graphics to the screen. That's an incredibly simplified view of it, but it helps to think of that way in this instance because what you really want is to use Scene_Item's graphics but not respond to normal user input.

I would recommend you make your own Scene called like Scene_Item_Tutorial or something. You can reuse Scene_Item's windows and everything but have your code driving the displays. In fact, you might even be able to subclass Scene_Item to have it load everything for you.
 

SaburoX

Veteran
Veteran
Joined
Jan 27, 2013
Messages
96
Reaction score
8
Primarily Uses
I thought that might be the case. I actually do know of a Tutorial Scene script, but it's got a conflict with the Scene Interpreter script I'm already using where the message windows don't get disposed properly and start behaving strangely. I might've been able to fake the effects with just the latter, but then the question is how to take control of the menu cursor from the player.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
398
Reaction score
99
First Language
English
Primarily Uses
but then the question is how to take control of the menu cursor from the player.

Yea, that takes a bit of digging to figure out. What we want to do is trace through the code to find where it takes user input, and then see what it does to move the cursor. That will let us both ignore the user's input and move the cursor ourselves.

So first, start at Scene_Item and look for the 'update' method. That gets called every frame. Well, it doesn't have one, so look in the superclass Scene_ItemBase. It also doesn't have one, but if you continue the chain, you'll reach the base class Scene_Base which calls 'update_basic' which calls 'update_all_windows'.

Ok, so if the scene isn't handling input, then the windows probably are. It's pretty obvious that we're probably looking for a 'Window_Item' but just to be sure we can go back to the Scene_Item and see which windows it uses. The scene creates two windows: Window_ItemList and Window_ItemCategory. So now let's investigate those.

As before if we go looking for an update method, we won't find one but we can search the superclasses again. This leads us to Window_Selectable. Scrolling through it we find the 'update' method, which calls 'process_cursor_move'. Success! This method takes the user input and then calls methods to actually move it. So with this knowledge, we can now write our own scene with our own version of Window_ItemList that overwrites this method and restricts user input to nothing.
 

SaburoX

Veteran
Veteran
Joined
Jan 27, 2013
Messages
96
Reaction score
8
Primarily Uses
I can actually restrict user input with eventing. When I said "take control" I meant forcing the cursor to move, which I assumed has something to do with the cursor_down or the input.trigger? codes.
I guess I'm just surprised there's no simple script call for that and that I'd need to make something completely from scratch for such a simple thing. Thanks for the advice, though!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,006
First Language
Tagalog
Primarily Uses
RMVXA
You don't actually need to move in the "scene"... The item selected is actually a part of Window_ItemList (if I remember correctly), so you just need to call the instance of Window_ItemList in that scene, and then make it call the .select(index) method. The only problem here is that most window member of scenes are actually private so you normally can't access them if you're calling from outside of that scene.

How you do it would also depend on how you're doing it. For example, normally you can't use an event to do it since events don't actually run inside the menu. Like if for example you used an event to call the Item scene, the next stuff in your event won't actually run until you exit the menu.

Just for reference, the script call that you'd want is this (assuming you're not calling it from directly inside the Scene_Item class)

Scene_Manager.scene.item_window.select(index)

but item_window is a private member of the scene so you would need to add this script first into your scripts window, else it would error as it won't be able to find item_window

class Scene_Item
def item_window
return @item_window
end
end

As I said above though, you might not be able to use that script call at all if you're calling this via an event, unless you have a Scene Interpreter script which would allow events to run inside scenes that aren't Scene_Map or Scene_Battle

PS: I re-read your post and realized you don't want to move in the item_window but rather in the category window. Use this instead

Scene_Manager.scene.category_window.select(index)

and this script

class Scene_Item
def category_window
return @category_window
end
end
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

I've been viewing trailers and product banners on Steam as part of studying marketing for videogames, specifically JRPGs. There's a huge gap between the top and bottom in terms of quality and even a mixed review game can have a much better look than a game with great reviews. I can see why skilled publishers become attractive (for hire) to many aspiring game devs.
Celebrating a milestone over at Twitter
Sneak peak of my upcoming update! Who's holding her, you may ask? Find out tonight!
10.PNG
BCj
Finished another GUI! Turn indicator wasn't made by me.

ff981f8dc50b03cf58038c644334b454.jpg


3cb092fdc00087acfa0a190fd891f0ed.jpg

Forum statistics

Threads
115,260
Messages
1,088,417
Members
149,859
Latest member
yhiriend
Top