Aller au contenu

Photo

UserDefinned Death


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Q.dot

Q.dot
  • Members
  • 22 messages
You know how in the defualt user defined death, how it says "do not use for critical code, does not fire reliably all the time"

Well I don't know how to use my critical code any other way. It does work but not all of the time.

The following code is not the whole script, but the segment that is "critical"

if (sSelfTag == "ChampionoftheViod")
{object oPortal = GetObjectByTag("ZEP_PORTAL_Red_VD02");
effect evSummonPortal = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1);
//effect evCutsceneInvis = EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);
effect eLoop = GetFirstEffect(oPortal);

ApplyEffectAtLocation(DURATION_TYPE_INSTANT,evSummonPortal,GetLocation(oPortal));

while (GetIsEffectValid(eLoop))
{
if (GetEffectType(eLoop)==EFFECT_TYPE_VISUALEFFECT)
DelayCommand(1.0f,RemoveEffect(oPortal,eLoop));

eLoop = GetNextEffect(oPortal);
}
}

Bear in mind I'm going for a generic approach when each time it fires it checks the tag of the creature calling the script, this I can cut down on scripts, and also oPortal was given cutscene invisablity in the on area enter script, this way didn't have to creat it from an existing custom blueprint which cuts down on blueprints as well.

Anyway my question is how do stuff like spawn a portal when the boss dies reliably?

Modifié par Q.dot, 28 janvier 2011 - 10:42 .


#2
Shadooow

Shadooow
  • Members
  • 4 471 messages
fire the script from different object like this:



object oDeathWorkaround = GetObjectByTag("blabla);

ExecuteScript("the_code_above",oDeathWorkaround);

#3
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Or, just use the standard death script - it does fire reliably. No need for the user defined hook.

Funky

#4
Shadooow

Shadooow
  • Members
  • 4 471 messages
Yea sure, you actually have to use default script for my workaround, but sometimes you have to use my workaround, for example, if you want to delay anything there since delay in OnDeath do not work (when body disappear, delay will too).

LightFoot8 is right, the assign is better, forget my suggestion :whistle:

Modifié par ShaDoOoW, 28 janvier 2011 - 08:18 .


#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

ShaDoOoW wrote...

Yea sure, you actually have to use default script for my workaround, but sometimes you have to use my workaround, for example, if you want to delay anything there since delay in OnDeath do not work (when body disappear, delay will too).


In that case you just assign the delayed command to the area you are in.

#6
Q.dot

Q.dot
  • Members
  • 22 messages
thanks guys I've decided to use the ExecuteScript Funtion to run a generic script on the portal, and in that script it checks the tag of object self which is the portal so yeah, it works a 100% now