
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.







La date/heure actuelle est 07/05/2025 18:54:27
La Bibliothèque de Neverwinter Nights Index du Forum »
La Bibliothèque Binaire du NWScript - Neverwinter Nights
Voir le sujet précédent ¤ Voir le sujet suivant | |
---|---|
Auteur | Message |
samhuin Ecuyer Messages: 43 |
me revoila
bon j'ai chercher toute la soiree pour que ca fonctione mais ca marche pas comme j'aimerai je m'explique, j'aimerai une fois que les perso sont mort qu'il soit teleporter directement dans leur cite selon leur race, ou si ils ont une ethnie special, par exemple les drows, chez les eux. j'aimerai aussi qu'ils arrive avec seulement 1pv , pour eviter qu'il retourne au combat imediatement. et puit pour couroner le tous il faut eviter que si il deco/reco il puisse recuperer tous leur point de vie.(soit en les bloquant dans une salle pendant X temps, soit en leur remetant leur point de vie comme avant qu'il deconecte. j'ai donc trouver plusisieus script qui m'interresser mais le resultat et assez negatif voir meme nul. puisqu'il respawn pour la plus part du temps sur place, et qu'il ne sauvegarde pas la mort. je vous remet donc les script que j'ai utiliser. pour sauvegarder la mort j'ai utiliser se script http://www.system-tek.com/nwinter/phpbb2/viewtopic.php?t=5158&highlight=mort voila mon OnPlayerRespawn enfin celui dont je me suis baser je l'ai telement modifier que je prefere vous mettre celui d'origine NWScript :
#include "nw_i0_plot" #include "x0_i0_common" /***************************** ****************************** *********** * CONSTANTS ****************************** ****************************** **********/ /***************************** ****************************** *********** * FUNCTION PROTOTYPES ****************************** ****************************** **********/ // Raise & heal the player, clearing all negative effects void Raise(object oPlayer); // Applies an XP and GP penalty // to the player respawning void ApplyPenalty(object oDead); /***************************** ****************************** *********** * FUNCTION DEFINITIONS ****************************** ****************************** **********/ // Raise & heal the player, clearing all negative effects void Raise(object oPlayer) { effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPlayer); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer); // Remove negative effects RemoveEffects(oPlayer); //Fire cast spell at event for the specified target SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer); } // * Applies an XP and GP penalty // * to the player respawning void ApplyPenalty(object oDead) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); int nHD = GetHitDice(oDead); // * You can not lose a level with this respawning int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) nNewXP = nMin; SetXP(oDead, nNewXP); int nGoldToTake = FloatToInt(0.10 * GetGold(oDead)); // * a cap of 10 000gp taken from you if (nGoldToTake > 10000) { nGoldToTake = 10000; } AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)); DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)); } et puis je me suis dit que j'allait recuperer le systeme de mon portaile que vous m'avez aider a faire pour renvoyer les joueurs. mais ca marche pas super dans ce cas. alors je me suis dit que je devait faire passer les joueurs par une salle avant puits leur faire prendre le portaile. ce qui me permetrait de les faire attendre x*lvl temps avant qu'il puisse respawn. voila si vous pouvez me donner un grand coup de pied, enfin coup de main se serait super cool. Dernière édition par samhuin le 19/11/2005 22:52:31; édité 1 fois
|
Revenir en haut | ![]() ![]() ![]() |
Ivellios Légende vivante Messages: 447 Localisation: Poitiers |
Pour les races pourquoi ne réutilise tu pas ça ?
Tu dit que ça marche pas super mais il faudra expliquer en quoi ![]() _________________ Scripts, systèmes, fonctions,... c'est par ici... Pyjama pour castor, une vocation, un avenir sûr |
Revenir en haut | ![]() ![]() ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
pour le portaile ca marche tres bien, le script je parler juste dans le cas du respawn auto dans leur cite.
|
Revenir en haut | ![]() ![]() ![]() |
Black Knight Grand Maître Chanteur du Conseil ![]() Messages: 1031 Localisation: Fin fond du trou du cul du monde |
Et bein ? tu reprand le meme script mais tu remplace le GetLastUsedBy , par le truc Respawn (GetLastPressButtonRespawn je crois)
_________________ [http] |
Revenir en haut | ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
ah oui ce n'est pas idiot je vais tester ca desuite
|
Revenir en haut | ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
je n'est plus le choix de respawn quand je meur, j'ai du effacer une fonction mais je la trouve pas.
voila mon script a leur actuel mon OnPlayerDeath NWScript :
#include "nw_i0_plot" #include "x0_i0_common" /***************************** ****************************** *********** * CONSTANTS **************************** ** ****************************** **********/ /***************************** ****************************** *********** * FUNCTION PROTOTYPES **************************** ** ****************************** **********/ // Raise &amp; heal the player, clearing all negative effects void Raise(object oPlayer); // Applies an XP and GP penalty // to the player respawning void ApplyPenalty(object oDead); /***************************** ****************************** *********** * FUNCTION DEFINITIONS **************************** ** ****************************** **********/ // Raise &amp; heal the player, clearing all negative effects void Raise(object oPlayer) { effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPlayer); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer); // Remove negative effects RemoveEffects(oPlayer); //Fire cast spell at event for the specified target SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer); } // * Applies an XP and GP penalty // * to the player respawning void ApplyPenalty(object oDead) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); int nHD = GetHitDice(oDead); // * You can not lose a level with this respawning int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) nNewXP = nMin; SetXP(oDead, nNewXP); int nGoldToTake = FloatToInt(0.10 * GetGold(oDead)); // * a cap of 10 000gp taken from you if (nGoldToTake > 10000) { nGoldToTake = 10000; } AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)); DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)); } void main() { object oPlayer = GetLastPlayerDied(); //---------------------------- ------------------------------ -------------// // On met une balise de mort au pj qui vient de mourir. // //---------------------------- ------------------------------ -------------// // sert a declarer une balise pour "marquer" le pj a la mort. SetCampaignInt("NOM_DE_TON_MOD","balise_mort",TRUE,oPlayer); //---------------------------- ------------------------------ -----------// { object oPlayer = GetLastPlayerDied(); // * increment global tracking number of times that I died SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1); // * BK: Automation Control. Autopcs ignore death if (GetLocalInt(oPlayer, "NW_L_AUTOMATION") == 10) { Raise(oPlayer); DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF)); return; // Raise and return }}} et mon OnPalyerRespawn NWScript : #include "nw_i0_plot" // * Applies an XP and GP penalty // * to the player respawning void ApplyPenalty(object oDead) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); int nHD = GetHitDice(oDead); // * You can not lose a level with this respawning int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) nNewXP = nMin; SetXP(oDead, nNewXP); int nGoldToTake = FloatToInt(0.10 * GetGold(oDead)); // * a cap of 10 000gp taken from you if (nGoldToTake > 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 main() { object oRespawner = GetLastRespawnButtonPresser(); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); RemoveEffects(oRespawner); //* Return PC to temple object oPC = GetLastRespawnButtonPresser(); //Ici on change pour que sa marche sur le bouton respawn int iRace = GetRacialType(oPC); string sSub = GetSubRace(oPC); if(iRace == 1 && sSub == "Drow" /* || iRace == 0 &amp;&amp; sSub == "Duergar" etc*/) { AssignCommand(oPC,ActionJumpToObject(GetWaypointByTag("WP_"+sSub))); } else { AssignCommand(oPC,ActionJumpToObject(GetWaypointByTag("WP_"+IntToString(iRace)))); } //---------------------------- ----------------------------// // Positionement des balises a " FALSE " // //---------------------------- ----------------------------// SetCampaignInt("Le_Commencement","balise_mort",FALSE,oRespawner); } |
Revenir en haut | ![]() ![]() ![]() |
Sith Vicious Grand Sage du Conseil ![]() Messages: 693 |
Dans ton OnDeath rajoute :
NWScript :
PopUpDeathGUIPanel(oPlayer); Avec ça tu pourra avoir le bouton respawn. |
Revenir en haut | ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
hum je rajoute donc la ligne
NWScript :
Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème. ou NWScript :
PopUpDeathGUIPanel(oPlayer); mais j'ai un probleme de compialtation apres, ca vient du ); je comprend pas trop si vous pouvez m'expliquer |
Revenir en haut | ![]() ![]() ![]() |
Black Knight Grand Maître Chanteur du Conseil ![]() Messages: 1031 Localisation: Fin fond du trou du cul du monde |
Faut pas juste marque oPlayer.... Faut marque tout le reste, ils se sont trompe dans le script donc tu met tout ce qui est marque si tu prefere :
NWScript : Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème. _________________ [http] |
Revenir en haut | ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
bon ca avance, maintenant le joueurs peux respawn, mais il respawn sur place.
NWScript :
#include "nw_i0_plot" #include "x0_i0_common" /***************************** ****************************** *********** * CONSTANTS **************************** ** ****************************** **********/ /***************************** ****************************** *********** * FUNCTION PROTOTYPES **************************** ** ****************************** **********/ // Raise &amp; heal the player, clearing all negative effects void Raise(object oPlayer); // Applies an XP and GP penalty // to the player respawning void ApplyPenalty(object oDead); /***************************** ****************************** *********** * FUNCTION DEFINITIONS **************************** ** ****************************** **********/ // Raise &amp; heal the player, clearing all negative effects void Raise(object oPlayer) { effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPlayer); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer); // Remove negative effects RemoveEffects(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 PopUpGUIPanel( object oPC, int nGUIPanel ); // * Applies an XP and GP penalty // * to the player respawning void ApplyPenalty(object oDead) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); int nHD = GetHitDice(oDead); // * You can not lose a level with this respawning int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) nNewXP = nMin; SetXP(oDead, nNewXP); int nGoldToTake = FloatToInt(0.10 * GetGold(oDead)); // * a cap of 10 000gp taken from you if (nGoldToTake > 10000) { nGoldToTake = 10000; } AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)); DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)); } void main() { object oPlayer = GetLastPlayerDied(); //---------------------------- ------------------------------ -------------// // On met une balise de mort au pj qui vient de mourir. // //---------------------------- ------------------------------ -------------// // sert a declarer une balise pour "marquer" le pj a la mort. SetCampaignInt("NOM_DE_TON_MOD","balise_mort",TRUE,oPlayer); //---------------------------- ------------------------------ -----------// PopUpDeathGUIPanel(oPlayer,TRUE, TRUE, TRUE); { object oPlayer = GetLastPlayerDied(); // * increment global tracking number of times that I died SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1); // * BK: Automation Control. Autopcs ignore death if (GetLocalInt(oPlayer, "NW_L_AUTOMATION") == 10) { Raise(oPlayer); DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF)); return; // Raise and return }}} voila ou j'en suis, par contre je vient de m'apercevoir qu'il n'y a pas l'option attend non plus. |
Revenir en haut | ![]() ![]() ![]() |
Black Knight Grand Maître Chanteur du Conseil ![]() Messages: 1031 Localisation: Fin fond du trou du cul du monde |
Fuat mettre le point de spawn aussi
![]() NWScript : #include "nw_i0_plot" #include "x0_i0_common" /***************************** ****************************** *********** * CONSTANTS **************************** ** ****************************** **********/ /***************************** ****************************** *********** * FUNCTION PROTOTYPES **************************** ** ****************************** **********/ // Raise &amp; heal the player, clearing all negative effects void Raise(object oPlayer); // Applies an XP and GP penalty // to the player respawning void ApplyPenalty(object oDead); /***************************** ****************************** *********** * FUNCTION DEFINITIONS **************************** ** ****************************** **********/ // Raise &amp; heal the player, clearing all negative effects void Raise(object oPlayer) { effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectResurrection(), oPlayer); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer); // Remove negative effects RemoveEffects(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 PopUpGUIPanel( object oPC, int nGUIPanel ); // * Applies an XP and GP penalty // * to the player respawning void ApplyPenalty(object oDead) { int nXP = GetXP(oDead); int nPenalty = 50 * GetHitDice(oDead); int nHD = GetHitDice(oDead); // * You can not lose a level with this respawning int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) nNewXP = nMin; SetXP(oDead, nNewXP); int nGoldToTake = FloatToInt(0.10 * GetGold(oDead)); // * a cap of 10 000gp taken from you if (nGoldToTake > 10000) { nGoldToTake = 10000; } AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE)); DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE)); DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE)); } void main() { object oPlayer = GetLastPlayerDied(); //---------------------------- ------------------------------ -------------// // On met une balise de mort au pj qui vient de mourir. // //---------------------------- ------------------------------ -------------// // sert a declarer une balise pour "marquer" le pj a la mort. SetCampaignInt("NOM_DE_TON_MOD","balise_mort",TRUE,oPlayer); //---------------------------- ------------------------------ -----------// PopUpDeathGUIPanel(oPlayer,TRUE, FALSE, TRUE); { object oPlayer = GetLastPlayerDied(); location lRespawn = GetLocation(GetWaypointByTag("RESPAWN")); AssignCommand(oPlayer, ActionJumpToLocation(lRespawn)); // * increment global tracking number of times that I died SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1); // * BK: Automation Control. Autopcs ignore death if (GetLocalInt(oPlayer, "NW_L_AUTOMATION") == 10) { Raise(oPlayer); DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF)); return; // Raise and return }}} _________________ [http] |
Revenir en haut | ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
hum mon point de spawn etait dans le scritp du onplayerrespawn, mais je respawn toujours sur place. je comprend plus rien.
j'ai essayer aussi avec ce que tu ma donner toujours pareille. |
Revenir en haut | ![]() ![]() ![]() |
Black Knight Grand Maître Chanteur du Conseil ![]() Messages: 1031 Localisation: Fin fond du trou du cul du monde |
A saye je vien de comprendre, je sais pas pourquoi ta mis un script comme sa dans le OnDeath, enleve ton script OnDeath, et remet l'ancien a ca place x0_mod_def_ondeath Je crois, enfin celui qui etait au depart et mes mon script dans le OnPlayer Respawn. Puis créer le point RESPAWN pour la teleportation
_________________ [http] |
Revenir en haut | ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
Ca avance mais ces toujours pas ca, maintenant quand le perso meur,le bouton reaparait en boucle, meme apres 50 clic.
Je comprend plus rien du tout. |
Revenir en haut | ![]() ![]() ![]() |
Sith Vicious Grand Sage du Conseil ![]() Messages: 693 |
ah ben si tu mets un PopUpGUIPanel() dans le respawn forcément ça risque de faire bizare
![]() |
Revenir en haut | ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
Euh, je fait comment alors?
|
Revenir en haut | ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
J'ai donc enlever le PopUpGUIPanel(), celui qui se trouver dans les dernieres lignes mon perso meur bien, le bouton respawn apparait, et je respawn toujours sur place
![]() le script s'acharne contre moi. |
Revenir en haut | ![]() ![]() ![]() |
Sith Vicious Grand Sage du Conseil ![]() Messages: 693 |
Avec tous les scripts qu'il y a dans le topic je pige plus grand chose.
Poste le script actuel dans le OnRespawn et dit comment tu nommes les WP en fonction de la race//subrace on va pas se laisser emm... par un script non mais sans blague ![]() |
Revenir en haut | ![]() ![]() ![]() |
Black Knight Grand Maître Chanteur du Conseil ![]() Messages: 1031 Localisation: Fin fond du trou du cul du monde |
Est ce que tu as créer au moin le WP : "RESPAWN" ? Car si tu l'a pas fait bein voila quoi...
Sinon oué remet nous le script car la je me pomme tout seul ![]() _________________ [http] |
Revenir en haut | ![]() ![]() ![]() |
samhuin Ecuyer Messages: 43 |
oui j'ai bien cree le point respawn.
j'ai repris le script dudebut, avec celui d'origine, et en le modifiant petit a petit, pour le moment tous ce qui est integree fonctione. il me reste plus qu'a integrer 2 chose le script pour etre toujours mort apres une deco/reco, et un systeme qui penalise le joueurs avec divers sort pour l'empecher de retourner au combat tant qu'il na pas dormis je n'est d'ailleur pas encore trouver de script pour faire ca. |
Revenir en haut | ![]() ![]() ![]() |
Sith Vicious Grand Sage du Conseil ![]() Messages: 693 |
juste une idée comme ça, essaye GetObjectByTag à la place de GetWayPointByTag.
|
Revenir en haut | ![]() ![]() ![]() |


Page 1 sur 1 ¤
Vous ne pouvez pas poster de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas voter dans les sondages de ce forum