TheRiotInside

Extra Ordinaire
Veteran
Joined
Sep 3, 2012
Messages
270
Reaction score
124
First Language
English
Primarily Uses
It's been entire WEEKS since I've requested scripting help for good old outdated RMXP; a situation that I will rectify immediately!

So here's the scoop. I've been wanting to add a skill tree system into my game, very much akin to Borderlands (detailed below for those unfamiliar). I haven't found a satisfactory RMXP script for this, but I realized that it isn't that difficult to use events to make a system like this. I haven't done a whole lot of testing or work on this yet, but I'm trying to figure out a roadblock that I've come across.

The thing is, the whole system would take place on a separate map (one map for each of the party members with button inputs simulating menu movement via move routes and pictures and branches and all that). If I transfer the player to the skill tree "map" then once I leave the menu (and return to the map I was on) the events would be reset, Erase Event commands (for monsters on-screen) would not be remembered, etc.

When you enter the main menu, map processing freezes and resumes when exiting the menu. My question is, is there a way for me to transfer to another map and then return, while maintaining the previous map's current state as if I just entered/exited a menu?

Example: I do things on a map. I enter the main menu. I click something in the Skills tab to look at the skill trees. On-screen it looks like I just enter another menu, while in the background, the menu is actually closing and I am transferred to the skill tree map. I back out of the skill tree. On-screen it looks like I just go back to the skills tab, while in the background, I am transferred back to the still-frozen map I was on, and the main menu opens back up. I leave the main menu, and the map resumes as normal.

Another way to ask: Can my map still be frozen if something within my main menu actually takes me to another map and back?

This will eventually turn into a request for the small edit required to add the skill tree access from the Skills tab, but I just want to tackle the mentioned map logistics first.

Sorry if this is confusing; any help is appreciated. Thanks in advance!

http://www.borderlands2.com/us/skilltree/siren.html
That is a link to an online version of the Borderlands 2 in-game skill tree. I know that my particular question doesn't involve the actual skill tree, but I'm showing it just as a kind of "fyi" thing, haha.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
398
Reaction score
99
First Language
English
Primarily Uses
Yes, this can be done. Whenever you go to a new map, the game loads the map from the corresponding map file in the Data folder. This is then used to create Game Event objects which are used on the map and which hold information on an events on-screen x/y coordinates as well as it's erased status. So when you load a map, it essentially re-initializes all of the events to their default state. The game doesn't change Switches and Variables though, so those will still affect an events state. 

The easiest way I found to get around this is by saving the Game Event objects to a dummy global variable prior to changing maps, then when you return to the map you can reload the events as they were. Then it's just a matter of clean up to get the sprites working again. I can go into more detail if you'd like, but I assume you're about to ask for the menu edit.

P.S. I just remember that Zack Phoenix and I had a discussion about skill trees done using maps in XP. You can read the topic here if you're interested: XP Skill Tree
 
Last edited by a moderator:

TheRiotInside

Extra Ordinaire
Veteran
Joined
Sep 3, 2012
Messages
270
Reaction score
124
First Language
English
Primarily Uses
Thanks for the quick reply!

I would very much be interested in more detail about storing the map information. Basically I want it to appear as if I was just going through the menu the whole time, so when I return to the map, everything should be where I left it. Not sure how cleanly I can get it to work. Like, if an event was in the middle of parallel processing or the middle of a custom move route; would the event processing itself stay paused like it does in the menu, or will the event's location be memorized, but it's processing start over from the beginning?

...Maybe a script would be easier, haha.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
398
Reaction score
99
First Language
English
Primarily Uses
So far I've been able to get events that have moved (like people/monsters walking around) to stay where they are rather than reverting to their starting point, I've gotten erased events to stay erased, and I've gotten an parallel event to continue where it left off (I made an event that counted, so it waited for 1 second then said "1" in a message box, then "2", etc.) As far as getting everything to work cleanly... well I still have problems. Not un-fixable problems, but problems nonetheless. The events tend to briefly appear in their starting positions then snap to where they're supposed to be; the same goes for the counting event, he'll say "1" initially regardless of where he left off then jump back to whatever number he was on in the sequence.

I'll definitely post a script; it's just not ready. Also, in it's final form how do you want to implement this? You mentioned accessing it from the Skills menu? Because I can conceivably do the transferring completely via scripting or just let you use event calls with script fill-ins. 
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,512
Reaction score
11,998
First Language
English
Primarily Uses
RMVXA
For events Shaz had a script which remembers their position. I'm on my phone so can't give a link.

EDIT

Sorry just realized you ate using CO and that script is for Ace.
 
Last edited by a moderator:

TheRiotInside

Extra Ordinaire
Veteran
Joined
Sep 3, 2012
Messages
270
Reaction score
124
First Language
English
Primarily Uses
So far I've been able to get events that have moved (like people/monsters walking around) to stay where they are rather than reverting to their starting point, I've gotten erased events to stay erased, and I've gotten an parallel event to continue where it left off (I made an event that counted, so it waited for 1 second then said "1" in a message box, then "2", etc.) As far as getting everything to work cleanly... well I still have problems. Not un-fixable problems, but problems nonetheless. The events tend to briefly appear in their starting positions then snap to where they're supposed to be; the same goes for the counting event, he'll say "1" initially regardless of where he left off then jump back to whatever number he was on in the sequence.

I'll definitely post a script; it's just not ready. Also, in it's final form how do you want to implement this? You mentioned accessing it from the Skills menu? Because I can conceivably do the transferring completely via scripting or just let you use event calls with script fill-ins. 
That sounds promising! Yeah, my goal was to have a little thing saying "Skill Tree: Press __" or something like that tucked away in the Skills tab somewhere (probably on the bottom) that would take you to the skill tree of the current party member (since you can cycle through your party members' skill lists with the Q and W keys). Leaving the skill tree would take you right back to the Skills tab.

If it was all done with scripting, however, that would enable use of regular menu windows and all that, which would fit in better and be a bit more seamless, not to mention avoiding the map headaches. If somebody decides to make a fully scripted skill tree, I would not be opposed to using it, haha.

Thanks for all the help so far, guys.
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
398
Reaction score
99
First Language
English
Primarily Uses
Alright so it took me awhile because I spent far too long down a rabbit hole. But here you go:

#==============================================================================# ** Map Memory#------------------------------------------------------------------------------# This module allows the saving of map event data so that events don't revert# when changing maps## Author:# Mobius XVI## License/Legal# This script is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported license. # In addition, this script is only authorized to be posted to the forums on RPGMakerWeb.com.# Further, if you do decide to use this script in a commercial product, I'd ask that you let me # know via a post or a PM. Thanks.## Usage:# Simply place "Map_Memory.transfer_player" (without the quotes) in a script# call prior to transferring the player and the map's events will be # memorized and automatically reloaded the next time you return to the map#==============================================================================module Map_Memory # Initialize event memory hash @@events_memory = Hash.new # Method called via script to save current map state def Map_Memory.transfer_player map_id = $game_map.map_id events = $game_map.events.clone @@events_memory[map_id] = events end # Method for public access for event memory hash def Map_Memory.event_memory @@events_memory end # Method for deleting saved events def Map_Memory.delete(key) @@events_memory.delete(key) endend #Module End# Changes to class Game_Mapclass Game_Map # Make events publically accesible attr_accessor :events # events #alias setup method alias map_memory_setup setup # define new method def setup(map_id) # call old method map_memory_setup(map_id) # recall events event_memory = Map_Memory.event_memory[map_id] # restore events unless there are none saved unless event_memory == nil @events = event_memory refresh Map_Memory.delete(map_id) end end end #Class End 
Basically, you can use this with or without another script. All you have to do is make the script call "Map_Memory.transfer_player" BEFORE you transfer the player, and this script will memorize the map's events. Then the next time you come back to the map it'll appear exactly the same, but the time after that it won't (unless you make the script call again). So that way you can continue to use erase event commands and can reset events like normal.
 
Last edited by a moderator:

TheRiotInside

Extra Ordinaire
Veteran
Joined
Sep 3, 2012
Messages
270
Reaction score
124
First Language
English
Primarily Uses
Okay, this is pretty neat so far. Here is the testing I've done:

Event with custom move route:  Event was moving around, while I talked to another to transfer me to another map. When I came back, the first event picked up right where he left off (exactly what would happen in the main menu).

Event on Parallel Process with a Move Route event command: Same results as before, so far so good.

Transfer mid-event: This was interesting. I made the transfer event display a message before and after the transfer command. The event actually continued processing after the transfer, displaying the second message after I moved to the other map. While not an intended side-effect, this opens the door up for some interesting event work in the future!

So far it seems to do exactly what I need! As usual, you have come through for me, haha. I'll make a new topic regarding the Skill menu edits when I have the details 100%, but this is a great step in the right direction. I'm going to have to start compensating you for your wonderful work here pretty soon!
 

MobiusXVI

Game Maker
Veteran
Joined
Mar 20, 2013
Messages
398
Reaction score
99
First Language
English
Primarily Uses
Believe it or not, you already have. Many of the fixes you've asked for I plan to use myself. I'd just never noticed them before.
 

Latest Threads

Latest Profile Posts

Day 2 of my redesign journey, as a follow up from the previous post :kaothx:
pXiRJSm.jpg

This is Cedric's son, Apollo!
New pet peeve: Telling tech support personnel what something is doing, only for them to tell me (in excessively condescending tones) what it should be doing. Yes, I know what it should be doing, and if it was doing that, I wouldn’t be talking to you and your attitude problem about it right now, would I? >.<
uglywolf wrote on Khulse's profile.
Hello.
The rules I makes pun about on your last thread is about "Verify Files" before anything else, if the stuff comes from STEAM. Which means, if it could be fixed with just that, there is no need to redownload the whole stuff.
But glad the reinstall worked, hope you enjoy it and your days too.
uh oh, I just tapped into a fresh, deep vein of nightmare fuel right here guys:

Forum statistics

Threads
115,433
Messages
1,089,824
Members
150,191
Latest member
baskbask
Top