Aller au contenu

Photo

OnPlayerDeath OnPlayerRespawn issues


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

#1
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
Another noob to NWN2 problem here.

Trying to use the OnPlayerRespawn event and can't get it to work.

I've discovered that there is a script being run off the button of the default OnDeath GUI panel that pops up when a player dies. This script is what handles the respawning? I don't know anything about scripting GUIs yet. All I want is to be able to use the Module event "OnPlayerRespawn".

So when a player dies...they click respawn...my respawn script in the OnPlayerRespawn fires.

Does this event even still work?

All help very much appreciated.

#2
kevL

kevL
  • Members
  • 4 074 messages
hi GoG,

Does this event even still work?

no. :(

here's a bit of code for use in onPlayerDeath that calls up a GUI box:

DisplayMessageBox(oPC, 0, GetStringByStrRef(181408), "gui_kg_mod_respawn", "", FALSE, "", 6603, "not OK", 0, "");

It's been a while since i worked on this, and my code is a mess. "gui_kg_mod_respawn" is the script that raises PC, jumps to respawn pt, applies penalties ..

#3
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
Awesome. Thanks kevl. That did the trick. Took me a few to realize that I needed to define the spawner as OBJECT_SELF in the script and not the respawn button presser but that is exactly what I needed. To bad it had to be another big change like that from NWN1. Confusing for people who switch over.

#4
dethia

dethia
  • Members
  • 146 messages
The onrespawn event doesn't work, but you can add your changes to the gui script that is fired when players hit the respawn button.

#5
kevL

kevL
  • Members
  • 4 074 messages
oops, sorry bout that GoG - like i say, my code is a mess .. it's still in the state it was when I read the footnote on p.591 ...........

( tks for the backup / confirmation, dethia )