I am trying to figure out how to make an escape rope type of item for when a player is in a cave and can't get out. It needs to teleport them out of the cave to the entrance or to the last inn they stayed at. Thanks for the help.
Pokemon like escape rope
RPG Maker VXAce SupportYou need three variables: one to store the map's ID, one to store the player's X coordinate and one to store the player's Y coordinate. Before the player enters the dungeon, before they teleport, store the data to the variables in the event:
For Map ID, you go to Control Variables, then set it to Game Data > Other > Map ID. Player's X and Y coordinates are in the same place under Game Data > Character > Player > Map X / Map Y.
Set up the item in the database with an effect that calls a common event. Set up the common event to teleport the player to designation with variables: Map ID should be the variable that you stored the Map ID in, Map X should be the variable with the player's X coordinate and Map Y should be the variable with the player's Y coordinate.
When the player uses the item, it will call the common event and teleport them to the coordinates you set.
Code:
Control Variables: [001: Map ID] = Map ID
Control Variables: [002: Player X] = Player's Map X
Control Variables: [003: Player Y] = Player's Map Y
Set up the item in the database with an effect that calls a common event. Set up the common event to teleport the player to designation with variables: Map ID should be the variable that you stored the Map ID in, Map X should be the variable with the player's X coordinate and Map Y should be the variable with the player's Y coordinate.
When the player uses the item, it will call the common event and teleport them to the coordinates you set.
Ok so I have the item made and a common event named Escape Rope. I also have the variables made. Now what do I do with the map stuff. Please try to explain it more in details but also explain it to where it make sense.
every dungeon entrance event,
set those variables to the square you would want the escape rope to warp the player to.
turn on switch that allows the rope to be used.
and then have it move the player to the dungeon map.
(remember to turn off the switch with any event that makes the player leave the dungeon)
make the common event have an "if" branch checking for the switch and if the switch is off (player not in a dungeon) refund the rope with some kinda dialog "cant be used here"
set those variables to the square you would want the escape rope to warp the player to.
turn on switch that allows the rope to be used.
and then have it move the player to the dungeon map.
(remember to turn off the switch with any event that makes the player leave the dungeon)
make the common event have an "if" branch checking for the switch and if the switch is off (player not in a dungeon) refund the rope with some kinda dialog "cant be used here"
Or make the rope non consumable and put in the common event that if it is used they lose 1.
BTW could you give me a screenshot of what you mean? Might help me understand more.
You could do it something like this.
Make sure you turn the 'in dungeon' switch off when you exit the dungeon.
Make sure you turn the 'in dungeon' switch off when you exit the dungeon.
Is this what the transfer event variable stuff should look like?
How would I make it to where it transfers them to the last inn they were at, if possible?
control variable [escape map id]: set: game data: other: map id
control variable [escape map x]: set: game data: character: map x
control variable [escape map y]: set: game data: character: map y
control switch [in dungeon]: on
transfer:
sometimes using a specific number instead of game data like if dungeon entrance is inside a town and want rope to take you to world map instead. in this case set the escape map id variable to the id for the world map.
control variable [escape map x]: set: game data: character: map x
control variable [escape map y]: set: game data: character: map y
control switch [in dungeon]: on
transfer:
sometimes using a specific number instead of game data like if dungeon entrance is inside a town and want rope to take you to world map instead. in this case set the escape map id variable to the id for the world map.
You want to set the variables when the player is at the spot you want them to transfer back to. If you want to transfer them to the last inn they were at, you would set those variables before they enter the inn, or after they talk to the counter, etc., up to you.
I swear, every time you ask a question, it's almost like you're copying my game. LOL.
seriously though, wow.
I have similar situation. A rope to help you out and spells to exit dungeons.
seriously though, wow.
I have similar situation. A rope to help you out and spells to exit dungeons.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/pokemon-like-escape-rope.120703/