Does OnKnockout work properly?

Post » Mon Aug 10, 2009 1:18 pm

I'm trying to make an "alternative solution" to HH_BeroSupport quest. One of possibilities involves making Garding weaker and easier to be defeated by a non-fighter character. At certain moment (while yet in the Haunted Manor) I decrease Garding's fatigue to below zero, making him fall down. After that, when I go to the Arena, GardingScript immediately throws out a message that I've defeated him, even though none of us makes a step. I've implanted a test message into GardingScript:
if ( OnKnockout == 1 )	messagebox "Knockout"   ; <== here	Set DuelActive to 0	Journal HH_BeroSupport 70	SetFight 0	StopCombatendif
,and it demonstrated that OnKnockout is indeed the one command that misfired there. Even though I ensure that he raises to his feet again before I leave the cell, so when I'm on Arena, he has full stamina and OnKnockout shouldn't respond. If I do not make Garding fall by fatigue before, everything is all right. Has anybody seen OnKnockout behaving incorrectly and can it be circumvented? There are reasons for me to not want to discard that fall.
User avatar
Jake Easom
 
Posts: 3424
Joined: Sun Jul 29, 2007 4:33 am

Post » Mon Aug 10, 2009 4:09 pm

I noticed similar behavior with "onpchitme" on Graring and his companions(Bloodmoon, the guys who make ice armor). The issue can be fixed by setting "onpchitme" back to 0.

The fix might be the same here, but I'm not sure. The script on Graring and companions declares the "onpchitme" variable, while the script on Garding does not declare "onknockout". If you can't change the "onknockout" value, you may have to change his script to test for his fatigue falling below a certain level; however, this is a more resource-intensive test.
User avatar
Robert Garcia
 
Posts: 3323
Joined: Thu Oct 11, 2007 5:26 pm

Post » Mon Aug 10, 2009 7:14 pm

I've used it without any troubles, but used a fix;

If ( actor_a-> OnKnockOut == 1 )     actor_b-> stopCombat, actor_a     journal xxx_a 20     set done to 1endif

User avatar
Britney Lopez
 
Posts: 3469
Joined: Fri Feb 09, 2007 5:22 pm

Post » Mon Aug 10, 2009 5:51 pm

I think the problem is, OnKnockout function registers, but is never "consumed" until in cell "Vivec, Arena Pit" due to the
if ( GetPCCell "Vivec, Arena Pit" == 0 )	; ....	returnendif
on top of gardingScript. Moving the OnKnockout block on top would probably work.
if ( OnKnockout )	if ( GetPCCell "Vivec, Arena Pit" )		Set DuelActive to 0		Journal HH_BeroSupport 70		SetFight 0		StopCombat	endifendifif ( GetPCCell "Vivec, Arena Pit" == 0 )	;if you're not in the arena yet, is very bad to kill him, also no reason to run rest of script yet	if ( OnDeath == 1 )		Journal HH_BeroSupport 200	endif	returnendif
If you don't want to touch gardingScript, I'd try inserting a dummy OnKnockout block just to consume/reset the event inside a targeted global script used to decrease Garding's fatigue to below zero in the Haunted Manor, something like this
begin gardingTScript; usage: garding->startscript "gardingTScript"if ( OnKnockOut )	stopscript gardingTScript	returnendif	ModCurrentFatigue -1000end
it may work.
[EDIT]typo
User avatar
Charity Hughes
 
Posts: 3408
Joined: Sat Mar 17, 2007 3:22 pm

Post » Mon Aug 10, 2009 3:39 pm

Abot, thanks, the dummy OnKnockout worked.
User avatar
Rachael
 
Posts: 3412
Joined: Sat Feb 17, 2007 2:10 pm


Return to III - Morrowind