[Solved] $var Teleportation upon death

Tonkatsu

Villager
Member
Joined
Mar 28, 2014
Messages
9
Reaction score
0
First Language
French
Primarily Uses
Hello everyone,

I'm new here, but didn't saw any introduction topic so i'm gonna do it quicly here.

My name's Corentin, i'm French, 23 years old and i'm just starting at RPG Maker VX Ace.

I found this pretty awesome website while I was looking for some tips.

So~

I'm attempting to create a unique savepoint system, which allow the player to save one location at the time, in the aim to be used upon death.

Well, seems easy but I don't understand why it's not working like I want to :/.

That's why I'm asking for some advice.

Currently, I'm saving "@x" & "@y" into 2 variables with an event, and I want to use them while the party is dead.

Screenshots:




Like that, I was sure it will work just fine, but not really..

When my party is dead i got:

So what I'm trying to do seems not featured by the native script

here:






If I use numbers instead of variables it work properly, but this is not what I am looking for.

I've already tried to write it in others ways without any success..

Any idea will be appreciate <(^-^)>

02:00 am here tho.. Good night/day peoples
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Issues:

- moveto won't take you to a different map, just the same coordinates on the current map, so if your save point is at 50,50 and the current map is only 25,25, you'll get an error

- var19 and $var19 are not the same - this is what is causing your error - the script is using $var19 which is never set

- @x and @y have no meaning inside a script call. Script is a method of Game_Interpreter, and @x and @y are properties of the event - two different classes. At best, you would need to use $game_map.events[@event_id].x and $game_map.events[@event_id].y instead

However, why not just set three variables (one for the map, two for the position) to store the coordinates instead of using global variables? Then instead of trying to figure out how to do the transfer (because Game_Interpreter does some snazzy stuff with yielding and fading and checking battles), just turn on a switch in your death check, and have a common event conditioned by that switch that does the transfer using those variables, then turns the switch off again.

Savepoint Event:

Code:
Control Variables: [0001: SaveMap] = Game Data > Other > Map IDControl Variables: [0002: Savepoint X] = Game Data > Character > This Event's > Map XControl Variables: [0003: Savepoint Y] = Game Data > Character > This Event's > Map y
Death Script:
Code:
$game_switches[1] = true if $game_party.all_dead
(switch 1 is used here, but put in whatever number is appropriate)
 

Tonkatsu

Villager
Member
Joined
Mar 28, 2014
Messages
9
Reaction score
0
First Language
French
Primarily Uses
Hi,

moveto won't take you to a different map
I should find out since it's not asking for the Map ID.. But hope sometimes don't make me realize xD

var19 and $var19 are not the same
Aw, I'm glad to learn that. I was thinking "$var" is used to call a variable into a script and this was the same "var" without.

Then instead of trying to figure out how to do the transfer just turn on a switch in your death check
Hope I will be able to search for other ways to do things on my own by the time, you saved me some time.

Savepoint Event [OK]

Done with Hero's > Map X 'cause i don't want to be in a wall ^^

Death Script [OK]

$game_switches[x] = true/false  will be really handfull!

Thanks for your help!
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
variables are accessed through $game_variables[id]
 

Tonkatsu

Villager
Member
Joined
Mar 28, 2014
Messages
9
Reaction score
0
First Language
French
Primarily Uses
Ahah, thanks for the tip.

I'm taking all of them.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

Fomar0153

Arkz
Restaff
Joined
Mar 13, 2012
Messages
1,327
Reaction score
473
First Language
English
Primarily Uses
RMMZ
Re-opened at OP's request.
 

Tonkatsu

Villager
Member
Joined
Mar 28, 2014
Messages
9
Reaction score
0
First Language
French
Primarily Uses
Hi,
 
Thanks for re-opened it.
 
 
 
Ok then I will make a quick recap here:
 
With Shaz's help, I was able to modify the death result:

 

#--------------------------------------------------------------------------# * Determine if Game Is Over# Transition to the game over screen if the entire party is dead.#--------------------------------------------------------------------------def check_gameover#SceneManager.goto(Scene_Gameover) if $game_party.all_dead?$game_switches[7] = true if $game_party.all_dead?endand of course with a death's event setup wich looks like:

End BGM
End BGS

Print picture death

Wait 120 frames

Teleportation $var

Full heal party

Switch death OFF

Clear picture

_____________

It's ok.

At least when i was testing it with my event board causing death status to my party.

Today I wanted test my fight ability and i discovered that the death event is not call when i lose.

So, here we go:

To start on something I tried to modify the "Scene_Gameover", without any success, the best i got was to be stuck in the battle or black screen..

  #--------------------------------------------------------------------------  # * Transition to Title Screen  #--------------------------------------------------------------------------  def goto_title    #fadeout_all    #SceneManager.goto(Scene_Title)$game_switches[7] = true    endI've put a lot of Scene_Gameover in commentary and try other ways but, na it won't work

2nd round, i found this in "BattleManager":

#--------------------------------------------------------------------------  # * Defeat Processing  #--------------------------------------------------------------------------  def self.process_defeat    $game_message.add(sprintf(Vocab::Defeat, $game_party.name))    wait_for_message    if @can_lose      revive_battle_members      replay_bgm_and_bgs      SceneManager.return    else      SceneManager.goto(Scene_Gameover)    end    battle_end(2)    return true  endI'v try with @can_lose = true

    if @can_lose      revive_battle_members      $game_switches[7] = true      #replay_bgm_and_bgs      #SceneManager.returnand without:

    else      #SceneManager.goto(Scene_Gameover)      $game_switches[7] = trueor

    else      #SceneManager.goto(Scene_Gameover)      SceneManager.goto(Scene_Base)    end'cause this is where the working rule is..

I've done a lot of dumb try and I'm still wrong , I don't think "Game_Battler" and "Game_BattlerBase" are involved, that's why I ask for an advice if someone got one ^^
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I don't understand this:


"At least when i was testing it with my event board causing death status to my party.


Today I wanted test my fight ability and i discovered that the death event is not call when i lose."


What are you actually trying to accomplish? How did you test it previously? When does it work? When doesn't it work?
 

Tonkatsu

Villager
Member
Joined
Mar 28, 2014
Messages
9
Reaction score
0
First Language
French
Primarily Uses
Umh, I'll post some screen i guess, it will be more easy for me to explain

So, here is my SavePoint Common Event:


The player will be able to save is position by using a savepoint monument:


I aim than the player is not eject onto the title screen whenever he die, by a trap OR a fight OR whatever.

 

Then, when i was testing our previous modification, i was using this:


With this Death Event, it worked just fine. I was guessing it's perfect 'cause there is only one Death state..

But, when i'm game over into a fight, it seems the

  def check_gameover    #SceneManager.goto(Scene_Gameover) if $game_party.all_dead?    $game_switches[7] = true if $game_party.all_dead?  endthan we used is not enought because i'm just eject at the title screen.

Bonus, my beautiful test map !



[EDIT]  here is a quick video to watch if i'm not explaining it right :/

[EDIT2] Finally i made it on my own, i'm proud of me *-*

  #--------------------------------------------------------------------------  # * Defeat Processing  #--------------------------------------------------------------------------  def self.process_defeat    $game_message.add(sprintf(Vocab::Defeat, $game_party.name))    wait_for_message    if @can_lose      revive_battle_members      replay_bgm_and_bgs      SceneManager.return    #else      #SceneManager.goto(Scene_Gameover)    end    battle_end(2)    #return true    SceneManager.return    $game_switches[7] = true  endThanks for your help
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top