Author Topic: Blocking PC Respawn in Certain Areas  (Read 331 times)

Legacy_Rowwena

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Blocking PC Respawn in Certain Areas
« on: June 27, 2012, 12:42:41 am »


               Hi,

I am looking for some help with this.  I have set up a system I like for allowing the PC to change the location where she/he will respawn on death. This all works as intended.

My problem is that I am trying to set up on particular area in the Mod where respawning is not an option - if the player dies here it is game over.

I know that a module can be set to disallow respawn, but is there a way to make just one area block the respawn option?

Any help would be appreciated.

Thanks
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Blocking PC Respawn in Certain Areas
« Reply #1 on: June 27, 2012, 01:14:57 am »


               Open the Script  x2_death.   It is a script for the OnPlayerdeath.  It has some good examples on how to do what you are asking.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Blocking PC Respawn in Certain Areas
« Reply #2 on: June 27, 2012, 01:18:08 am »


               Yes, in the module's death event script you can get the area that the PC died in. And you can use that information in a couple of ways:

(1) Create a function in the OnDeath module script that checks the area of death against a list to determine if there is no respawn for a death in this area. And if no respawn is allowed, set a SKIN int on the PC that identifies them as permanently dead.
(2) instead of creating a list of permadeath areas, set a var on the area that identifies it as such. If this variable is found on death, also set it on the PC skin.

Followup: in the respawn check for the permadeath int on the PC Skin, and if it is found do not allow them to respawn. (It would also be good to inform the player as to why and what is happening.)

So...  to wrap up you need to modify the death script and the respawn script. Perhaps you could handle all of this in the respawn script, but that would not allow you to move these bodies to another location.

I took this a step farther with a customizable death system and allowed special death scripts to be called based on killer or area of death. So I could have special death cutscenes based upon killer, or unique death behaviors in certain areas consecrated to dark gods or whatever.
               
               

               
            

Legacy_Rowwena

  • Jr. Member
  • **
  • Posts: 62
  • Karma: +0/-0
Blocking PC Respawn in Certain Areas
« Reply #3 on: June 27, 2012, 03:30:23 am »


               Thank You!