Sleep spells put npc's to sleep for pretty long time (1 rnd per lvl) but for some reason the sleepers get up while sleeping (they keep the sleeping status fine but stand instead of lie down) - nothing wrong with the script so hard to find a solution - went so far as to add knockdown status to every sleeping creature for the duration - but then only SOME of the creatures affected stay on the ground and some get up after about 1 round.. Are sleep and knockdown hardcoded broken? Is there a way to fix this? (a way that would apply for all creatures)
npc's during sleep get up
Débuté par
psiiijay
, mai 26 2015 10:18
#1
Posté 26 mai 2015 - 10:18
#2
Posté 26 mai 2015 - 06:51
i remember 'fixing' this, but only for the single spellscript Tasha's Hideous Laughter.
I believe it involved a knockdown, along with using SetCommandable(FALSE) for a duration
I believe it involved a knockdown, along with using SetCommandable(FALSE) for a duration
if (!iSave)
{
int bCommandable = GetCommandable(oTarget);
if (!bCommandable) SetCommandable(TRUE, oTarget);
int iDur = GetCasterLevel(OBJECT_SELF);
float fDur = RoundsToSeconds(iDur);
fDur = ApplyMetamagicDurationMods(fDur);
AssignCommand(oTarget, ClearAllActions(TRUE));
AssignCommand(oTarget, PlayVoiceChat(VOICE_CHAT_LAUGH));
AssignCommand(oTarget, ActionSpeakString("I never heard THAT one !! hahahahah", TALKVOLUME_TALK));
AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING));
effect eVis = EffectVisualEffect(VFX_HIT_SPELL_ENCHANTMENT);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_SPELL_TASHA_LAUGHTER);
effect eLaugh = EffectKnockdown();
eLaugh = EffectLinkEffects(eLaugh, eDur);
DelayCommand(0.1f, SetCommandable(FALSE, oTarget));
if (iDur > 1)
DelayCommand(6.f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLaugh, oTarget, fDur - 6.f));
if (bCommandable)
DelayCommand(fDur, SetCommandable(TRUE, oTarget));
}i believe that keeps target down, which was tested by running my PC back and forth over target. I guess something similiar'd need to be done in the Sleep spellscript ...
#3
Posté 28 mai 2015 - 04:14
Yeah, I'm petty sure that function did the trick
#4
Posté 08 juin 2015 - 01:09
if (!iSave)
{
if (iDur > 1)
DelayCommand(6.f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLaugh, oTarget, fDur - 6.f));
if (bCommandable)
DelayCommand(fDur, SetCommandable(TRUE, oTarget));
}Hi KevL,
What does the 6.f mean?
Is it the same thing as 6.0?
Cheers,
Lance.
#5
Posté 08 juin 2015 - 01:23
yep, just helps me keep me head on straight (the .f always stands out).
#6
Posté 08 juin 2015 - 01:38
yep, just helps me keep me head on straight (the .f always stands out).
Phew!
Cheers, Lance.
#7
Posté 08 juin 2015 - 01:43
Additional info... It stands for "float" and it can be used to write an integer without a decimal point that the compiler knows to interpret as a float. Alternatively, you can just add a ".0" to your number. So for any float, you can write it as 6f, 6.f, 6.0f, or 6.0, but not as 6 with no decimal point. Maybe you can write it as "6." and leave off the 0, I don't know.
#8
Posté 08 juin 2015 - 02:57
yep, 6. works





Retour en haut






