Author Topic: Changing Hero on death behavior?  (Read 93 times)

Yeury

  • Newbie
  • *
  • Posts: 4
    • View Profile
Changing Hero on death behavior?
« on: November 04, 2017, 07:25:41 am »
What script handles what happens when the hero dies? Right now what happens is basically the map restarts and my hero's health is restored but I would like to teleport him to another map upon death.

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1053
    • View Profile
Re: Changing Hero on death behavior?
« Reply #1 on: November 04, 2017, 12:19:48 pm »
You can define the event game:on_game_over_started() to do what you want instead of just restarting the game (which is the default).
See http://www.solarus-games.org/doc/1.5/lua_api_game.html#lua_api_game_on_game_over_started