Aller au contenu

Photo

How To Stop The Respawn Button After PC Death


  • Veuillez vous connecter pour répondre
10 réponses à ce sujet

#1
Morbane

Morbane
  • Members
  • 1 883 messages
 I know there is a simple solution - I just don't remember what it is.

Thanks

#2
The Fred

The Fred
  • Members
  • 2 516 messages
I think you can just alter the OnDeath script to suit your needs.

#3
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I made a custom UI and just took out the XML code that made the respawn button. Works great. If you want it, let me know.

#4
Morbane

Morbane
  • Members
  • 1 883 messages
M. Rieder - I would like that - thanks for the offer!

PM me

#5
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Morbane, what exactly do you want to happen when the player dies? As Fred stated, you could just write a custom OnPlayerDeath script. For example, I have one area that when the player dies, they are instead considered captured. So my script checks the tag of the area the player is in. If it is correct, I jump them to a prison cell, else (they are is some other area) execute the default OnPlayerDeath script.

#6
Morbane

Morbane
  • Members
  • 1 883 messages

Morbane, what exactly do you want to happen when the player dies?


I want no respawn button to appear.

#7
The Fred

The Fred
  • Members
  • 2 516 messages
But you do want the Death GUI to appear? Can't you just turn off the respawn button via script? It's supposed to support permanent deaths and things.

#8
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I remember trying to script it an was unable to with NWScript. Of course that does not mean it cannot be done, but I decided to resort to xml scripting and I was able to do it that way. If there is an NWScript way to do it, I would be interested.

#9
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Ha ha ha! This is what happens when you spend over a year on a project. I just went looking for my custom xml document and coulldn't find it. So I looked at my death script and it turns out I did us NWScript to disable the respawn button!

Here's the code:

void GUI()
{
DisplayGuiScreen(GetFirstPC(),"SCREEN_PARTY_DEATH",FALSE);
SetGUIObjectDisabled(GetFirstPC(),"SCREEN_PARTY_DEATH","BUTTON_RESPAWN",TRUE);
SetGUIObjectHidden(GetFirstPC(),"SCREEN_PARTY_DEATH","BUTTON_RESPAWN",TRUE);
SetGUIObjectDisabled(GetFirstPC(),"SCREEN_PARTY_DEATH","BUTTON_WAIT_FOR_HELP",TRUE);
SetGUIObjectHidden(GetFirstPC(),"SCREEN_PARTY_DEATH","BUTTON_WAIT_FOR_HELP",TRUE);
}


The above function will display the death screen without the "respawn" button. Just put it into your death script and you should be good to go.

#10
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Note:

I use GetFirstPC() as the identifier here. You should not do that. You should use

GetLastPlayerDied();

#11
The Fred

The Fred
  • Members
  • 2 516 messages
Hmm, I thought you would be able to use the old NWN1 death GUI function, but I guess that works just as well (and it would be doing the same thing anyway).