Aller au contenu

Photo

Playing a cutscene instead of Death Screen when the player dies


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

#1
FergusM

FergusM
  • Members
  • 460 messages
I can't find a way to check if the party has died and then doing stuff other than ending the game. I've played around with IsPartyDead, GM_DEAD, and I tried to look at the script for being captured by Cauthrien, but I can't figure it out.

#2
jsd313

jsd313
  • Members
  • 184 messages
This code will allow you to catch the event and then do something different with it. This must be run from your module script.

[dascript]
case EVENT_TYPE_SET_GAME_MODE:
        {
            int nGameMode = GetEventInteger(ev, 0);
            if ( nGameMode == GM_DEAD )
             {
              // YOUR EVENT HANDLING CODE HERE
             }
         }

[/dascript]

Modifié par jsd313, 30 avril 2010 - 11:18 .


#3
FergusM

FergusM
  • Members
  • 460 messages
Aha, thank you. I hadn't even considered that there would be an event for that, since there's already one for GAME_MODE_CHANGE.

#4
jsd313

jsd313
  • Members
  • 184 messages
Your welcome

#5
FergusM

FergusM
  • Members
  • 460 messages
Ah, actually, I am having some problems. GM_DEAD is 2, GM_COMBAT is 1. The code executes as soon as I enter combat. It appears that when the game switches to combat, nGameMode = 2, rather than 1 as would be expected. The event does not appear to have any other ints attached to it (they're just 0).

Modifié par FergusM, 30 avril 2010 - 11:36 .


#6
jsd313

jsd313
  • Members
  • 184 messages
Yeah you would need to customize it a bit for your module script.

#7
FergusM

FergusM
  • Members
  • 460 messages
Any pointers? I don't understand how to test that that the SET event is setting it to GM_DEAD, since the int attached to the SET event apparently isn't the game mode.

EDIT: Ah, did not see "Must be run from your module script." I'll look into that, was using the area script.

Modifié par FergusM, 01 mai 2010 - 12:41 .


#8
jsd313

jsd313
  • Members
  • 184 messages
Yeah it has to be in your module script.