bon ben la ça change tout... c'est pas ben ben plus compliqué
//:://///////////////////////////////////////////// //:: NW_O2_SKELETON.nss //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Turns the placeable into a skeleton if a player comes near enough. */ //::////////////////////////////////////////////// //:: Created By: Brent //:: Created On: January 17, 2002 //::////////////////////////////////////////////// void ActionCreate(string sCreature, location lLoc) { CreateObject(OBJECT_TYPE_CREATURE, sCreature, lLoc); } void main() { //Voici la premiere ligne a ajouté... int dejaExec= GetLocalInt(OBJECT_SELF,"dejaExec"); //Ou en accès BD (je te mets le code en commentaire) //int dejaExec = GetCampaignInt("NOM_CAMPAGNE","dejaExecObjetTransform"); /*la faut dire qu'avec le campaignInt (dans ce code si) tu peux pas utilisé ça pour plusieurs placeable qui utilise ce script car il vont tout accédé à la même variable*/ if(dejaExec == 0){ object oCreature = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC); if (GetIsObjectValid(oCreature) == TRUE && GetDistanceToObject(oCreature) < 10.0) { effect eMind = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD); string sCreature = "Grifferampante"; location lLoc = GetLocation(OBJECT_SELF); DelayCommand(0.3, ActionCreate(sCreature, lLoc)); ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eMind, GetLocation(OBJECT_SELF)); SetPlotFlag(OBJECT_SELF, FALSE); //Voici la deuxième ligne à ajouter SetLocalInt(OBJECT_SELF,"dejaExec",1); //Ou en accès BD //SetCampaignInt("NOM_CAMPAGNE","dejaExecObjetTransform",1);
} } }
Une autre chose que tu pourrais faire mais la il y a juste toi pour savoir si ça pourrait marché c'est de faire le test avec ceci
if(GetPlotFlag() == 1) { // ton code }
comme tu fait SetPlotFlag(OBJECT_SELF, FALSE) je présume que avant il était a TRUE...
Ou encore... (ben oui il y plein de possibilité) je pense que c'est des meilleurs idée car ça utilise le destroyobject() (ça permet de libérer le processeur car je présume que tu met ton code dans le onHeartBeat()...) tu créé deux objet un qui est la par parrure (que tu veux pas détruire) et l'autre qui est invisible qui exécute ton code lui tu pourras faire un destroyobject dessu(de la façon la plus efficace cité plus haut)
Bon c'est sur qu'il reste probablement 1258 autres façon de faire met pourquoi pensé à de mauvaise façon de faire
__________________
Florynth ... bientôt un monde sera miens...
|