Problème de Script : Lien de deux Effect - Urgent

Répondre
Partager Rechercher
Et bien rebonjour à tous

Voila je vous recontact car j'ai maintenant un problème dans un script devant me permettre de faire de NPC des morts pétrifié. En gros je veux montrer la présence d'une créature au pouvoir de pétrification dans le coin , en mettant un campement ou les gens sont tous mort pétrifiés.

J'ai récupéré pour cela un script que j'ai vu dans le module Witch's wake permettant de donner à un NPC l'apparence d'un mort, et je lui est rajouté l'effet de STONESKIN, malheureusement mais NPC meurent bien mais ne veulent pas du tout se transormer en pierre. Si quelqu'un pouvait m'aider ca serait très simpa.

Je vous mets ici, un bout du code. Le bout de code ou je pense que le problème se trouve. Mais si vous désirez le code complet, dites le moi et je le mettrais.

Code PHP:

//Kill them so only their corpses will be seen.
    
int iHitPoints GetMaxHitPoints();
    
effect eKill EffectDamage(iHitPoints 10);
    
effect estone EffectVisualEffect(VFX_DUR_PROT_GREATER_STONESKIN);
    
ApplyEffectToObject(DURATION_TYPE_INSTANTestoneOBJECT_SELF);
    
ApplyEffectToObject(DURATION_TYPE_INSTANTeKillOBJECT_SELF); 
Je pense qu'il te manque un Delay command, vu que tu les tue en leur applicant une transformation en pierre... donc ils meurent... ils sont remplacés par des cadavres, c'est un objet diferent a qui il faut attribuer le Stoneskin...

et encore plus que le DelayCommand (a qui il faudra rajouter un getObjectByTag...), je pense que tu ferait mieux de faire un ActionPlayAnimation... (l'animation Dead, of course ^^)
Code PHP:

ApplyEffectToObject(DURATION_TYPE_INSTANTestoneOBJECT_SELF); 

L'effet n'est pas de type instantané, tu dois utiliser soit DURATION_TYPE_TEMPORARY (avec une durée à spécifier à la fin de la commande), soit DURATION_TYPE_PERMANENT.

Dans ton cas, il me parait évident qu'un effet permanent serait plus logique Et en passant, n'hésite pas à définir plus précisément ton effet en précisant son type. Dans ton cas :

Code PHP:

effect estone EffectExtraordinaryEffect(EffectVisualEffect(VFX_DUR_PROT_GREATER_STONESKIN)); 

En théorie, ça permettra à ton effet de n'être ni "dissipable", ni de partir pendant le sommeil (on est jamais trop prudent ).

Dernière chose : tu es sûre que ces malheureux ont eu le temps de se coucher à terre avant de se faire pétrifier ?
Bon et bien après mainte et mainte essai, je n'ai toujours pas réussit a faire mon script. Je pense que le problème vient du fait, que l'affect de pétrifiçation ne peut pas s'enclencher sur le PNJ mort. peut être que vu que ce dernier semble comme static, il n'y a aucune possibilité d'agir dessus. je ne sais pas du tout, mais bon quoi qu'il en soit ça marche pas

Que j'essaye de le pétrifier avant de le tuer ou de le tuer et le pétrifier dans les deux sens ca donne qu'un monsieur mort mais pas en pierre.


Donc voilà c'était juste histoire de vous tenir au courant comme je vous l'avais promis
Et bien disons qu'avec l'anim_death ça a pas donner grand chose çar j'ai pas du bien faire mon code vu que ca donne rien du tout. Ils sont pétrifiés, mais par contre ils meurent pas p même avec un delay commande donc je comprend pas mais bon. Si vous trouvez quelque chose dites le moi
Templier, tes pnj, tu veux t'en resservir après ou ils sont définitivement mort ?
Si ils sont définitivement mort, et que tu acceptes les Hak, il suffit de créer avec des pnj existants une série de statues, que tu glisses dans 1 hak.
Si tu veux, je te les fais.
Et bien disons que j'ai déjà penser à cette situation, mais comme le dit Jaha je suis un énervé du Hak et disons que ce dernier est maintenant un petit peu lourd. C'est pour cela que maintenant j'évite un maximum de l'alourdir. Mais ta proposition est très gentil et vraiment très cool.

Je vais tester une autre idée déjà en script, car franchement je suis sur que ce que je cherche a faire et possible. Et puis comme je le dis souvent, Impossible n'est pas Francais


Mais si je n'y arrive pas, et vu que ces PNJ sont important pour mon intrigue dans ce cas je penserais sûrement à toi.


Merci encore
ca, ca marche pas ?

Code PHP:

void main(){
//Kill them so only their corpses will be seen.
effect estone ExtraordinaryEffect(EffectVisualEffect(VFX_DUR_PROT_GREATER_STONESKIN));
    
ApplyEffectToObject(DURATION_TYPE_PERMANENTestoneOBJECT_SELF);
    
AssignCommand(OBJECT_SELF,ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT));



etonnant...
Et bien disons que là, le PNJ passe bien en pierre, meurt puis se relève et reste en pierre.

Donc ça marche un peu mieux car il garde son effet de pierre en mourant, mais disons qu'ensuite il semble un peu trop Statue vivante que statue morte


Bon je vous montre le script que j'avais fait, enfin l'un de mes script car je l'ai tellement retouché qu'au bout d'un moment

Code PHP:

//::///////////////////////////////////////////////
//:: Modified: On Spawn In
//:: from NW_C2_DEFAULT9
//:: now :el_c2_default9 for 'example of creature'
//:: By: Emmanuel Lusinchi (Sentur Signe)
//:: 08/03/2002
//:: Only one line is different
//:: And ondeath need to be active (ie un-commented)
//:://////////////////////////////////////////////
/*
    Determines the course of action to be taken
    after having just been spawned in
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 25, 2001
//:://////////////////////////////////////////////
#include "NW_O2_CONINCLUDE"
#include "NW_I0_GENERIC"

//This is the Lootable Corpse Include File
#include "EL_LOOT_INCLUDE"

void main()
{
// OPTIONAL BEHAVIORS (Comment In or Out to Activate ) ****************************************************************************
     //SetSpawnInCondition(NW_FLAG_SPECIAL_CONVERSATION);
     //SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION);
                // This causes the creature to say a special greeting in their conversation file
                // upon Perceiving the player. Attach the [NW_D2_GenCheck.nss] script to the desired
                // greeting in order to designate it. As the creature is actually saying this to
                // himself, don't attach any player responses to the greeting.

     //SetSpawnInCondition(NW_FLAG_SHOUT_ATTACK_MY_TARGET);
                // This will set the listening pattern on the NPC to attack when allies call
     //SetSpawnInCondition(NW_FLAG_STEALTH);
                // If the NPC has stealth and they are a rogue go into stealth mode
     //SetSpawnInCondition(NW_FLAG_SEARCH);
                // If the NPC has Search go into Search Mode
     //SetSpawnInCondition(NW_FLAG_SET_WARNINGS);
                // This will set the NPC to give a warning to non-enemies before attacking

     //SetSpawnInCondition(NW_FLAG_SLEEP);
                //Creatures that spawn in during the night will be asleep.
     //SetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING);
     //SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
     
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
     
//SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
                //This will play Ambient Animations until the NPC sees an enemy or is cleared.
                //NOTE that these animations will play automatically for Encounter Creatures.

    // NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
    //SetSpawnInCondition(NW_FLAG_ESCAPE_RETURN);    // OPTIONAL BEHAVIOR (Flee to a way point and return a short time later.)
    //SetSpawnInCondition(NW_FLAG_ESCAPE_LEAVE);     // OPTIONAL BEHAVIOR (Flee to a way point and do not return.)
    //SetSpawnInCondition(NW_FLAG_TELEPORT_LEAVE);   // OPTIONAL BEHAVIOR (Teleport to safety and do not return.)
    //SetSpawnInCondition(NW_FLAG_TELEPORT_RETURN);  // OPTIONAL BEHAVIOR (Teleport to safety and return a short time later.)

// CUSTOM USER DEFINED EVENTS
/*
    The following settings will allow the user to fire one of the blank user defined events in the NW_D2_DefaultD.  Like the
    On Spawn In script this script is meant to be customized by the end user to allow for unique behaviors.  The user defined
    events user 1000 - 1010
*/
    //SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);        //OPTIONAL BEHAVIOR - Fire User Defined Event 1001
    //SetSpawnInCondition(NW_FLAG_PERCIEVE_EVENT);         //OPTIONAL BEHAVIOR - Fire User Defined Event 1002
    //SetSpawnInCondition(NW_FLAG_ATTACK_EVENT);           //OPTIONAL BEHAVIOR - Fire User Defined Event 1005
    //SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);          //OPTIONAL BEHAVIOR - Fire User Defined Event 1006
    //SetSpawnInCondition(NW_FLAG_DISTURBED_EVENT);        //OPTIONAL BEHAVIOR - Fire User Defined Event 1008
    //SetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1003
    //SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT);      //OPTIONAL BEHAVIOR - Fire User Defined Event 1004
    
SetSpawnInCondition(NW_FLAG_DEATH_EVENT);            //OPTIONAL BEHAVIOR - Fire User Defined Event 1007

//////Perform the Lootable Corpse actions, with randomized VFX on corspe destruction.
    
if (d20() > 10)
    
el_SetCorpseCondition(TRUEFALSE0.0f0.0f0.0f, -1);
    else
    
el_SetCorpseCondition(TRUEFALSE0.0f0.0f0.0f, -1);
//////Format: el_SetCorpseCondition(int EL_FLAG_NO_CHEST_LOOT, int EL_FLAG_2X_CHEST_LOOT,float EL_CORPSE_TIMEOUT_NOLOOT,float EL_CORPSE_TIMEOUT_IFLOOT,float EL_CORPSE_CLEANING_DELAY, EL_ONDESTRUCTION_MESSY_EFFECT)

//Kill them so only their corpses will be seen.
    
int iHitPoints GetMaxHitPoints();
    
effect eKill EffectDamage(iHitPoints 10);
    
effect estone ExtraordinaryEffect(EffectVisualEffect(VFX_DUR_PROT_GREATER_STONESKIN));
    
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_INSTANTeKillOBJECT_SELF));
    
ApplyEffectToObject(DURATION_TYPE_PERMANENTestoneOBJECT_SELF);

// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) *****************************************************************************************
    
SetListeningPatterns();    // Goes through and sets up which shouts the NPC will listen to.
    
WalkWayPoints();           // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
                               // 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
                               // 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
                               //    combat.
//    GenerateNPCTreasure();     //* Use this to create a small amount of treasure on the creature

Ce script vient en fait du module Witch Wake's où il marche très bien pour les PNJ mort en debut de jeu, et j'ai essayé donc de le retoucher pour mes PNJ mort pétrifiés et il semble qu'il même po trop

Donc si vous voyez d'où vient le problème je suis preneur.
arff, c'est le loop qu'il gere mal, alors ?


Et si tu essaye ca :

Code PHP:

void main(){
//Kill them so only their corpses will be seen.
effect estone ExtraordinaryEffect(EffectVisualEffect(VFX_DUR_PROT_GREATER_STONESKIN));
    
ApplyEffectToObject(DURATION_TYPE_PERMANENTestoneOBJECT_SELF);
    
AssignCommand(OBJECT_SELF,PlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,1.0,0.0));


PS : bein entendu, vire les clearAllCommand Eventuels dans tes HeartbEat au cas ou,
Répondre

Connectés sur ce fil

 
1 connecté (0 membre et 1 invité) Afficher la liste détaillée des connectés