Hello! I am quite new to making fan games, however I have some experience coding. Therefore I thought I would make an item as practice.
The item in question warps the player to a pre-determined location (for instance, back home or to a secret base kind of thing) and when used again it warps the player back to the location it was originally used. (Think something along the lines of the Explorer Kit from DPP).
It is not fleshed out much, no fancy animations or anything but it works well. For this item to function, 3 variables and 1 switch are used, of which the IDs can be edited to serve your need. The code can be found below and needs to be inserted into the PItem_ItemEffects script section.
Any suggestions or improvements to the code are welcome!
# Names of variables used to store mapID and x,y pos before transport
# Switch number whether on destination or overworld
# mapID and x,y pos of transport destination
$game_temp.player_new_map_id = $game_variables[mapvar]
$game_temp.player_new_x = $game_variables[xvar]
$game_temp.player_new_y = $game_variables[yvar]
$game_temp.player_new_map_id = pocketmapID
$game_temp.player_new_x = pocketmapX
$game_temp.player_new_y = pocketmapY
Slowly gaining experience with Essentials
Scripting, eventing, mapping mostly
I did a script similiar for the same item infact.
the transferUnderground bit does all the bits you have in your script there just seperately.
the enter and exit are just used to like the escape rope to decide where to go and no need to record it for variables.
really like the script though, works functionally the same and way more plug-and-play than my one