Citrus-Shock

Veteran
Veteran
Joined
Sep 12, 2015
Messages
40
Reaction score
22
First Language
English
Primarily Uses
Hello!


I've been looking for a plugin that can allow a player to time travel in my game. I haven't found anything, but I was hoping I could find some pointers here.

This is what I had in mind for the plugin.
 


1. Say the player presses an assigned button on the keyboard. Lets say "A" for simplicity.
2. A command window will pop up with "Travel to..." with the options "Travel to Past", "Travel to Present", "Travel to Future", and "Return".
3. When the player selects, for example "Travel to Past" all it would do is transfer the player to a different, altered version of the map that they are in now.
4. I'd like it to have it set where the player would be in the same co-ordinate that they were at in the previous map. For example, if the player was at (8, 9) on map "Future", they'd still be at
(8, 9) on map "Past".

EDIT:
Blugh, my post keeps getting published before I'm ready to. Habitually pressing the Tab Button to indent.

So, if this can be Evented, that'd be fantastic! If it'd be more efficient to script it, I'm open to learning Java and will gladly listen to pointers.

Thank you for reading!

Have a lovely day/night, where/whenever you may be!
 
Last edited by a moderator:

bladedvoid

Villager
Member
Joined
Jan 2, 2017
Messages
13
Reaction score
2
First Language
English
Primarily Uses
1. Yanfly's Button Common Events plugin will let you trigger an event using a button on the keyboard. (Make sure you don't forget to get Yanfly's Core Engine, otherwise it won't work)


2. In the event that gets triggered by the button press, make text saying "Travel to..." then make choices with past, present, future, return.


3. Make it transfer to different maps that you make (the altered versions) when they select the correct choice.
 

Acolyte

Veteran
Veteran
Joined
Sep 3, 2012
Messages
43
Reaction score
43
First Language
English
Primarily Uses
N/A
You could just event it. Make a "Time Travel" variable, then make a choice box that changes that variable for each choice.


For instance, you could have Time Travel = 1 for Past, Time Travel = 2 for Present, and Time Travel = 3 for future. Then make whatever event is transferring the player change depending on the variable.
 

Citrus-Shock

Veteran
Veteran
Joined
Sep 12, 2015
Messages
40
Reaction score
22
First Language
English
Primarily Uses
@bladedvoid
Ahhh! Thank you for that, I didn't even think about that plugin. I'll give it a look and see if it may work.
 


@Acolyte
So, would it be set as a parallel process in the event editor? Could I make the player co-ordinates be a variable that would be sensitive to the event?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
Event it.  Don't need a plugin for this.


Use Control Variables twice to put the player's current X and Y coordinates into two variables.  Then set a third variable to the 'travel to' map id, based on whether they want to go to the past or the future (and maybe where they are now).  Then just use a Transfer Player event, with your 3 variables as the destination.


What happens if the travel to the past, then hit the key again and choose Travel to Past?  How many maps are you going to have in a sequence?  
 

Citrus-Shock

Veteran
Veteran
Joined
Sep 12, 2015
Messages
40
Reaction score
22
First Language
English
Primarily Uses
@Shaz
Thank you very, very much. Deeply appreciated.

Ah! I can't believe I forgot to mention that in the first post.
I was hoping that it could be either: A. Have a message pop up with "You cannot travel any further in this direction" or B. Just put the player back at the same "Past" map if the message is not doable. 
I only plan on having a set of 3 maps, for one map/location. As in, if you have a "Forest" set, there'd be "Forestpast", "Forestpresent", and "Forestfuture". Is that what you were asking?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
Yep.  So when deciding what map to send the player to, you'd get the current map ID into a third variable (the same way you got the player coordinates into the other two), and then you'd do a Conditional Branch to see if the player can go back or forward any further.  If they can, update the 'to' map id and do the transfer, otherwise show the message.


So your event might be something like this:

Code:
Control Variables [1: Player X] = Game Data > Player's > Map X
Control Variables [2: Player Y] = Game Data > Player's > Map Y
Control Variables [3: Map ID] = Game Data > Other > Map ID

Show Choices: Travel to Past, Travel to Present, Travel to Future, Return
When Travel to Past
  Conditional Branch: Variable [3: Map ID] = Forest Past map id (use a number here)
    Text: You cannot go back any further
  Else
    Control Variables [3: Map ID] = Forest Past map id (use a number here to set the variable)
    Transfer Map: Variable [3: Map ID], X: Variable [1: Player X], Y: Variable [2: Player Y]
  End
When Travel to Present
  (don't really need to do anything here - no transfer needed)
When Travel to Future
  Conditional Branch: Variable [3: Map ID] = Forest Future map id (use a number here)
    Text: You cannot go forward any further
  Else
    Control Variables [3: Map ID] = Forest Future map id (use a number here to set the variable)
    Transfer Map: Variable [3: Map ID], X: Variable [1: Player X], Y: Variable [2: Player Y]
  End
End Choice



This gets a bit more complicated if you have multiple areas - forest, caves, wilderness, etc, as you then have to also consider what area you're in, what is the current, past and future map.  There are a few different ways you could handle this, using Label and Jump to Label to handle each 'area', using conditional branches to separate each area, having a different common event for each area and only enabling the one you're currently in (this would use more common events, but it would keep the events themselves nice and simple).  See how you go on your own, then come back if you need further help.
 

Citrus-Shock

Veteran
Veteran
Joined
Sep 12, 2015
Messages
40
Reaction score
22
First Language
English
Primarily Uses
@Shaz
Wow! That's quite a bit to digest, but I think I've got it.
Thanks a ton, I've been troubled about how I would get this particular mechanic to work for a while now.

I'm gonna go ahead and what I can do with this newfound information, thank y'all again!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
It will look much more simple when you actually do it.  The color coding and lack of comments that I added by way of explanation will make it read more easily :)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
Not quite.  The first 3 lines are good.  After that, you keep setting variable 3 to the current map's ID.  You don't need to do this, because it's already been set, and you don't want to transfer the player to the same map they're on.  So get rid of all of those extra Control Variables that come with the 'You cannot travel' messages.


What you do in the 'else' blocks depends on where you want to send them based on the current map.


Let's say you've go the following:


1 - Forest Past


2 - Forest Current


3 - Forest Future


If they're on map 3 (Forest Future) and they choose Travel to Past, are you going to send them to map 1 or map 2?  Will they go to the 'Past' map, or just back one step from where they currently are?


If they're going to the Past map, then you need to set the variable to 1, not to the current map from Game Data.  Just enter the value 1.


If they're going to go just one step back, just subtract 1 from the map id variable (assuming your 3 maps will always have sequential numbers).


If they're on map 1 (Forest Past) and they choose Travel to Future, are you going to send them to map 2 or map 3?  Will they go to the 'Future' map, or just forward one step from where they currently are?


If they're going to the Future map, then you need to set the variable to 3, not to the current map from Game Data.  Just enter the value 3.


If they're going to go just one step forward, just add 1 to the map id variable (making the same assumption as above).
 

Citrus-Shock

Veteran
Veteran
Joined
Sep 12, 2015
Messages
40
Reaction score
22
First Language
English
Primarily Uses
@Shaz
:dizzy: :dizzy: :dizzy: :dizzy: :dizzy: :dizzy:

Even the concept of time travel is complicated.
If the player is on the Future map, and they select "Past" they will go to the Past map. Vice versa if the player is on the Past map, and selects the Future option

So, what event commands should I be putting in that space? Working on one 'When' block at a time, seems like a good place to start.

asjdahfjld sorry, I'm a bit dense. I couldn't understand just from looking at your messages.

swirlyeyes.png
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
okay - that makes it easier.


If they select Travel to Past, and the map variable is not 1, do Control Variables [3:Map ID] = 1


If they select Travel to Future, and the map variable is not 3, do Control Variables [3:Map ID] = 3
 

Citrus-Shock

Veteran
Veteran
Joined
Sep 12, 2015
Messages
40
Reaction score
22
First Language
English
Primarily Uses
@Shaz

Oh boy, I think I found something funny with the command.

So, when I went to test the command, I went ahead and selected the "Travel to the Past" option, and it correctly transferred the character... but it transferred the character to the 3rd map I made.

Sidenote for humor, this is a horror game, so when I selected "Travel to the Past" and saw this

spoop.png


It was a bit spoopy. (I still need to work on map 3)

Same thing when I select a different option, it took me to map 1.
It must be something wrong with the command.
Some good news is that the exact coordinates thing works.  If the player is on (3, 4) in one map, after the map transfer they'll still be on (3, 4).

So, I think that's enough for one night, it's almost 2am over here. I'm gonna go to bed and be back at it in the morning.
 
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
First Language
English
Primarily Uses
RMMV
There's nothing wrong with the command (imagine - if Transfer took you to the wrong map, don't you think dozens of people would be complaining about it?)  The map ID is displayed in the center panel at the bottom - in your editor, you've got Map 7 selected, but you've called it Map 4.


You might be better off NOT calling your maps Map1, Map2, Map3, etc.  Call them Forest Past, Forest Present, Forest Future.  Then it won't be so confusing.


The Transfer command uses a map number, not a map name.
 

Citrus-Shock

Veteran
Veteran
Joined
Sep 12, 2015
Messages
40
Reaction score
22
First Language
English
Primarily Uses
@Shaz

I GOT IT TO WORK! :D

After fiddling with the mechanics for a good while, it's working properly. (Though it might have more to do with how long it took me to learn it.)
Character is being transferred to the proper maps.

Here's a quick screenshot of the correct command layout for "Travel to Past"

AAAAA.png



So, just from understanding the structure of the Command, it looks like the common event page is gonna be pretty big. It's gonna be a lot of work to set up 50+ conditional branches for each Choice, but I'm pretty excited about it.

Thank you so much for your patience while helping me, it's very appreciated!!
 

Latest Threads

Latest Posts

Latest Profile Posts

Who's a fan of firearms? The 5 on the bottom row (not including the green laser ones) I made pretty recently. I plan for most of these to be in my project.

Screenshot 2021-09-28 165924.png
Doing RPG Maker News for 28th September 2021

RMMV - Skip script errors:

For game developer testing purposes.
You know, I really get to farm likes since I post all of @Avery and @hiddenone 's blog tutorials on the forums...
Back from a very long hiatus with a new project woo
This is my battler placeholder image trying out art styles too I want to fake a backview battle system
I think I will want portraits and battle sprites to be 2D and stick to pixel art for overworld not 100%sure but pretty sure its easier to make pixel art for overworld sprites, events and maps and stuff.
Placeholder.png

Forum statistics

Threads
115,441
Messages
1,089,951
Members
150,229
Latest member
Mythphnx
Top