...and so are the puns...
When the PC and all companions are dead, I want the screen to fade to red and then return to main menu. I also want the PC and each companions to say a tragic final phrase as they breathe their last. So far, the only thing that happens is the game returns to the main menu.
Here's the script below. It is placed on the "OnPlayerDeath" event. Object "oBlaerdrig" is the companion. Right now I just want to get it working for the PC. I'll worry about the companion later. This is particularly frustating because in my last module, I used a very similar script and had no problems with it.
__________
void main()
{
object oPlayer = OBJECT_SELF;
object oPC = GetFirstPC();
object oBlaerdrig = GetObjectByTag("blaerdrig");
FloatingTextStringOnCreature("My God it's full of stars...", oPlayer, FALSE, 3.0);
if (GetIsDead(oBlaerdrig))
{
FadeToBlack(oPlayer, FADE_SPEED_SLOW, 0.0, COLOR_RED_DARK);
DelayCommand(3.0, EndGame(""));
}
}
My death script is killing me!
Débuté par
M. Rieder
, déc. 14 2010 01:52
#1
Posté 14 décembre 2010 - 01:52
#2
Posté 14 décembre 2010 - 02:30
Add in a FALSE into GetFirstPC - object oPC = GetFirstPC(FALSE);
That will return the player's currently controlled PC.
Then try applying the TextString and FadeToBlack to oPC and not oPlayer.
"My God, it's full of stars..." - nice lol.
That will return the player's currently controlled PC.
Then try applying the TextString and FadeToBlack to oPC and not oPlayer.
"My God, it's full of stars..." - nice lol.
Modifié par _Knightmare_, 14 décembre 2010 - 02:32 .
#3
Posté 15 décembre 2010 - 12:25
I tried adding the FALSE and it still didn't work. I just checked my old script and found that I used the function GetLastPlayerDied(). When I substituted that in, it worked.
_________________________
void main()
{
object oPlayer = GetLastPlayerDied();
object oBlaerdrig = GetObjectByTag("blaerdrig");
if (GetIsDead(oBlaerdrig))
{
FloatingTextStringOnCreature("My God, it's full of stars...", oPlayer, FALSE, 3.0);
DelayCommand(3.0, FadeToBlack(oPlayer, FADE_SPEED_SLOW, 0.0, COLOR_RED_DARK));
DelayCommand(5.0, EndGame(""));
}
}
_________________________
void main()
{
object oPlayer = GetLastPlayerDied();
object oBlaerdrig = GetObjectByTag("blaerdrig");
if (GetIsDead(oBlaerdrig))
{
FloatingTextStringOnCreature("My God, it's full of stars...", oPlayer, FALSE, 3.0);
DelayCommand(3.0, FadeToBlack(oPlayer, FADE_SPEED_SLOW, 0.0, COLOR_RED_DARK));
DelayCommand(5.0, EndGame(""));
}
}





Retour en haut






