Bienvenue sur JeuxOnLine - MMO, MMORPG et MOBA !
Les sites de JeuxOnLine...
 

Panneau de contrôle

Recherche | Retour aux forums

JOL Archives

Desactiver le "Death panel" !

Par Kray le 10/7/2002 à 9:29:39 (#1784953)

Bon, j'ai trouvé une parade aux dires de Tonton qui affirmaient qu'il était impossible de désactiver le "Death Panel", qui apparait à chaque mort de PJ. Non, ça ne le fait pas disparaitre physiquement, mais c'est tout comme.

La fonction PopUpDeathGUIPanel !

// Spawn in the Death GUI.
// The default (as defined by BioWare) can be spawned in by PopUpGUIPanel, but
// if you want to turn off the "Respawn" or "Wait for Help" buttons, this is the
// function to use.
// - oPC
// - bRespawnButtonEnabled: if this is TRUE, the "Respawn" button will be enabled
// on the Death GUI.
// - bWaitForHelpButtonEnabled: if this is TRUE, the "Wait For Help" button will
// be enabled on the Death GUI.
// - nHelpStringReference
// - sHelpString
void PopUpDeathGUIPanel(object oPC, int bRespawnButtonEnabled=TRUE, int bWaitForHelpButtonEnabled=TRUE, int nHelpStringReference=0, string sHelpString=")
Je pense que c'est assez clair ;)

Par Styx31 le 10/7/2002 à 10:14:30 (#1785137)

Donc je présume qu'il faut modifier le scrit OnDeath par défaut du module pour pouvoir intercepter l'affichage ?

Par Kray le 10/7/2002 à 10:16:49 (#1785141)

Je sais pas si c'est OnPlayerDeath ou OnPlayerDying :doute:

Par Styx31 le 10/7/2002 à 10:20:43 (#1785156)

Et bien il va falloir aller vérifier par nous mêmes ;)

Par Lumina le 10/7/2002 à 13:11:58 (#1786022)

OnPlayerDeath je pense.
OnPlayerDying est un evenement spécialement créé par Bioware qui permet par défaut de simuler un personnage dans le coma jusqu'à -10pdv de maniere automatique (nul besoin de se fatiguer à scripter, c'est déja prévu de base par Bioware).

Par tonton le grognon le 10/7/2002 à 14:24:46 (#1786450)

va donc voir le script qui est pas defaut sur le on dying avant de dire des betises.... la gestion des pts de vie negatif par bioware (qui est d'ailleur foireuse) est traité justement quand le script ondying n'est pas la...

void main()
{
/* AssignCommand(GetLastPlayerDying(), ClearAllActions());
AssignCommand(GetLastPlayerDying(),SpeakString( "I Dying"));
PopUpGUIPanel(GetLastPlayerDying(),GUI_PANEL_PLAYER_DEATH);
*/
// * April 14 2002: Hiding the death part from player
effect eDeath = EffectDeath(FALSE, FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, GetLastPlayerDying());
}

ca pour moi ca gere surement pas les pts de vie negatifs....


Pour kray, ca confirme juste ce que je disais (relis mon message qui en parle) tu peux desactiver les OPTIONS du deathpannel, mais tu ne peux pas desactiver le deathpanel par lui meme.. et tu ne peux pas reconfigurer les boutons pour l'usage que tu desires (ce qui etait la question dans le message que tu evoques...)

mais si tu ne veux pas de death panel du tous, il te suffit de virer les script ondeath et ondying par defaut, et le joueur verra son cadavre mais ilo ne pourra plus rien faire et aucun panneau n'apparaitra... il ne lui restera plus qu'a deco...:D

Par Kray le 10/7/2002 à 14:58:44 (#1786622)

Tiré d'un post sur Althea/dev:
Le système de base est ainsi fait :

OnDying:

//::///////////////////////////////////////////////
//:: Dying Script
//:: NW_O0_DEATH.NSS
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This script handles the default behavior
that occurs when a player is dying.
DEFAULT CAMPAIGN: player dies automatically
*/
//:://////////////////////////////////////////////
//:: Created By: Brent Knowles
//:: Created On: November 6, 2001
//:://////////////////////////////////////////////


void main()
{
/* AssignCommand(GetLastPlayerDying(), ClearAllActions());
AssignCommand(GetLastPlayerDying(),SpeakString( "I Dying"));
PopUpGUIPanel(GetLastPlayerDying(),GUI_PANEL_PLAYER_DEATH);
*/
// * April 14 2002: Hiding the death part from player
effect eDeath = EffectDeath(FALSE, FALSE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, GetLastPlayerDying());
}


OnDeath:
//::///////////////////////////////////////////////
//:: Death Script
//:: NW_O0_DEATH.NSS
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This script handles the default behavior
that occurs when a player dies.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent Knowles
//:: Created On: November 6, 2001
//:://////////////////////////////////////////////
/*
void ClearAllFactionMembers(object oMember, object oPlayer)
{
// AssignCommand(oMember, SpeakString("here"));
AdjustReputation(oPlayer, oMember, 100);
SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
object oClear = GetFirstFactionMember(oMember, FALSE);
while (GetIsObjectValid(oClear) == TRUE)
{
ClearPersonalReputation(oPlayer, oClear);
oClear = GetNextFactionMember(oMember, FALSE);
}
} */
void Raise(object oPlayer)
{
effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);

effect eBad = GetFirstEffect(oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);

//Search for negative effects
while(GetIsEffectValid(eBad))
{
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
{
//Remove effect if it is negative.
RemoveEffect(oPlayer, eBad);
}
eBad = GetNextEffect(oPlayer);
}
//Fire cast spell at event for the specified target
SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
}

void main()
{
object oPlayer = GetLastPlayerDied();

// * Handle Spirit of the Wood Death
string sArea = GetTag(GetArea(oPlayer));
/*
if (sArea == "MAP_M2Q2F2" && GetDistanceBetweenLocations(GetLocation(GetObjectByTag("M2Q2F2_M2Q2G")), GetLocation(oPlayer)) < 5.0 && GetLocalInt(GetModule(),"NW_M2Q2E_WoodsFreed") == 0)
{
int bValid;

Raise(oPlayer);
string sDestTag = "WP_M2Q2GtoM2Q2F";
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint)));
return;

}
*/
// * in last level of the Sourcestone, move the player to the beginning of the area
// * May 16 2002: or the main area of the Snowglobe (to prevent plot logic problems).
// * May 21 2002: or Castle Never
if (sArea == "M4Q1D2" || sArea == "M3Q3C" || sArea == "MAP_M1Q6A")
{

//Raise(oPlayer);
//string sDestTag = "M4QD07_ENTER";
//object oSpawnPoint = GetObjectByTag(sDestTag);
// AssignCommand(oPlayer, DelayCommand(1.0, JumpToLocation(GetLocation(oSpawnPoint))));
// * MAY 2002: Just popup the YOU ARE DEAD panel at this point
DelayCommand(2.5, PopUpDeathGUIPanel(oPlayer,FALSE, TRUE, 66487));
return;
}

// * make friendly to Each of the 3 common factions
AssignCommand(oPlayer, ClearAllActions());
// * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation
if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10)
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer);
}
if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10)
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer);
}
if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10)
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
}

DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));

}


OnRespawn://::///////////////////////////////////////////////
//:: Generic On Pressed Respawn Button
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// * June 1: moved RestoreEffects into plot include
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: November
//:://////////////////////////////////////////////
#include "nw_i0_plot"

// * Applies an XP and GP penalty
// * to the player respawning
void ApplyPenalty(object oDead)
{
int nXP = GetXP(oDead);
int nHD = GetHitDice(oDead);
int nPenalty = 50 * nHD;
// * You can not lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;

int nNewXP = nXP - nPenalty;
if (nNewXP 10000)
{
nGoldToTake = 10000;
}
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));

}

///////////////////////////////////////////////////////////////////////
// this function resets variabls and clears the arenas in the fighter
// 'gauntlet' subplot in chapter one
///////////////////////////////////////////////////////////////////////

void ClearArena(object oPC,string sArena)
{
if(sArena == "Map_M1S4C")
{
DestroyObject(GetObjectByTag("M1S04CHRUSK02"));
DestroyObject(GetObjectByTag("M1S4CBeast"));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4HruskDef",0);
}
else if(sArena == "Map_M1S4D")
{
DestroyObject(GetObjectByTag("M1S04CFASHI02"));
DestroyObject(GetObjectByTag("M1S4DBeast"));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4FashiDef",0);
CreateItemOnObject("M1S04IBADGELVL01",oPC);
}
else if(sArena == "Map_M1S4E")
{
DestroyObject(GetObjectByTag("M1S04CAGAR02"));
DestroyObject(GetObjectByTag("M1S4EBeast"));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4AgarDef",0);
CreateItemOnObject("M1S04IBADGELVL02",oPC);
}
else if(sArena == "Map_M1S4F")
{
DestroyObject(GetObjectByTag("M1S04CCLAUDUS02"));
DestroyObject(GetObjectByTag("M1S4FBeast",0));
DestroyObject(GetObjectByTag("M1S4FBeast",1));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4ClaudusDef",0);
CreateItemOnObject("M1S04IBADGELVL03",oPC);
}
SetLocalInt(oPC,"NW_L_M1S4Won",FALSE);
SetLocalInt(GetModule(),"NW_G_" + sArena + "_Occupied",FALSE);
}

//////////////////////////////////////////////////////////////////////////////


void main()
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects(oRespawner);
//* Return PC to temple



string sDestTag = "NW_DEATH_TEMPLE";
string sArea = GetTag(GetArea(oRespawner));
/*
CHAPTER 1 SPECIAL CASE
*/
if (sArea == "MAP_M1S3B")
{
sDestTag = "M1_WIZSPAWN";
}
else
if (sArea == "Map_M1S4E" || sArea == "Map_M1S4C" || sArea == "Map_M1S4D" || sArea == "Map_M1S4F")
{
sDestTag = "M1_FIGSPAWN";
ClearArena(oRespawner,sArea);
}
else
/*
CHAPTER 2 SPECIAL CASE
*/
/*
if (sArea == "MAP_M2Q2F2" && GetDistanceBetweenLocations(GetLocation(GetObjectByTag("M2Q2F2_M2Q2G")), GetLocation(oRespawner)) J'avais mal lu ton message précédent alors... Désolé :( M'enfin, chuis sur que c'est possible. :p

Par Lumina le 10/7/2002 à 15:45:31 (#1786837)

Provient du message de tonton le grognon
va donc voir le script qui est pas defaut sur le on dying avant de dire des betises...
Effectivement, j'avais mal interpreté ceci :
OnPlayerDying

Trigger: A player has been reduced below 0 hit points

Use: GetLastPlayerDying() The difference between this and OnPlayerDeath is that here the PC is out of HP but hasn't officially 'died' yet.

Default: The standard script placed here is "nw_o0_dying" which applies EffectDeath to the player and kills him officially to trigger the OnPlayerDeath event. If this script was removed, a player would bleed to death before officially dying at -10 hit points.

Je pensais qu'en supprimant le script du module officiel, on tombait sur les regles officielles par défaut. Mais en faisant l'essai, en fait il ne se passe rien et il faut soit-meme scripter ce qui se passe.

Mais bon, je ne dis pas que des bétises, et sur les sous-races j'ai désormais 3 bons arguments pour montrer que ma méthode est bien meilleure que celle d'Archaegeo même si il est un type extraordinairement génial et tout et tout et tout :p

Par ZeDuckMaster le 10/7/2002 à 15:51:07 (#1786848)

moi d'après ce que je viens de lire, il n'y aurait qu'un seul bouton qui soit customisable dans le death panel, c'est le bouton respawn, par l'intermediaire de l'evenement du script OnRespawn ...

Par tonton le grognon le 10/7/2002 à 19:14:22 (#1787751)

ma méthode est bien meilleure que celle d'Archaegeo


ce qui m'etonne, c'est que quand on lit la doc/faq de leurs site, ils disent justement qu'ils ont utilisé ta methode.... donc ya un truc que je pige plus.... va falloir que je regarde ca de plus pres...soit ils ont modifie ca rescement...soit c'etait la methode de depart et ils l'ont changé apres pour une raison ou une autre...

JOL Archives 1.0.1
@ JOL / JeuxOnLine