Setting Your Spawn Location

● ARCHIVED · READ-ONLY
Started by Ruiran 1 posts View original ↗
  1.  Tutorial : How to set your spawn location
     ​
     ​
     ​
     ​
    1.Introduction

    Spoiler
    By default VXA doesn't allow you to respawn after you die during a battle, but instead forces you to use your latest save. Today I will show you, in a couple of simple and easy to understand steps, how to set your spawn location (Manually and Automatically) so after a battle you respawn in said location.Note:You don't really need this tutorial for scripted/evented fights as VXA allows you to continue after death if you chose to allow so. 
    2.The Tutorial

      A. Variables !

    For this whole process you will need 3 variables (Map ID, X and Y) and 1 common event.

    First start by making 3 variables, one designating the Map Id the player should respawn in, and one designating the X and Y locations :

    Spoiler
    5oXLl.png
    Now make it so when you enter a Map, in which the player would respawn, that the event that took you to the Map changes the X and Y location to your desired respawn point and the Map ID variable to the current Map ID. Like so :

    Spoiler
    5oXUz.png

    Now for the common event, just make add a Transfer Player Command that transfers the player to the Designated spawn point:

    Spoiler
    5oY24.png



       B.Scripting

    This part is easy to do and it consists on making 2 small changes to the Battle Manager script : 

    The first change is to make it so that you respawn by default (this can be probably done via Eventing but I'm to lazy to try that). To do that simple change can_lose ( l.11 ) to true , that will make it so you can't 'die'.

    def self.setup(troop_id, can_escape = true, can_lose = true)The second change would be to make it so that the common event is called when you are defeated in battle, and to do so we will add a small line to Line 249,

    $game_temp.reserve_common_event(1) That will call the event, and run it when possible : so your script should look something like this now:

    Spoiler
    58yvn.png
    Sorry if I'm not the best at explaining things but I hope this has helped you in some way.