Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

ScriptName ImprovedCombatParry Extends ReferenceAlias

Import Actor

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
	If abHitBlocked
		debug.Notification("Attack blocked")
		akAggressor.SetUnconscious()
	EndIf
EndEvent

I get function undefined error for SetUnconscious() when trying to compile.

 

Another problem:

debug.SendAnimationEvent(akAggressor, "staggerStart")

When using this line instead of SetUnconscious everything compiles and I receive debug messages in-game as desired, however, stagger animation won't play.

Link to comment
Share on other sites

ScriptName ImprovedCombatParry Extends ReferenceAlias

Import Actor

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
	If abHitBlocked
		debug.Notification("Attack blocked")
		akAggressor.SetUnconscious()
	EndIf
EndEvent

I get function undefined error for SetUnconscious() when trying to compile.

 

Another problem:

debug.SendAnimationEvent(akAggressor, "staggerStart")

When using this line instead of SetUnconscious everything compiles and I receive debug messages in-game as desired, however, stagger animation won't play.

 

akAggressor in your script is an ObjectReference while SetUnconscious() is intended to be used by an actor.

While an actor can use ObjectReference functions because Actor extends ObjectReference, the reverse is not true even if the ObjectReference is indeed an actor. Cast the ObjectReference into an Actor first. Something like:

 

(akAggressor as Actor).SetUnconscious()

Link to comment
Share on other sites

Thank you, IsharaMeradin, but what about the second part of the question? Why does debug.SendAnimationEvent produce no effect?

 

All right, this is strange: getting rid of the abHitBlocked condition made NPCs stagger, but only once they had around 25% of their total health removed (does this have something to do with their resistances?). Switching from StaggerStart to BleedOutStart made the script behave normal. Just what exactly is going on here?

 

Update:

 

Stumbled upon another problem:

ScriptName ImprovedCombatParry Extends ReferenceAlias

Bool DeflectWindowActive
Bool ParryWindowActive
Actor Property PlayerRef Auto			
Spell Property Stagger Auto

Event OnInit()
	RegisterForAnimationEvent(PlayerRef, "BlockStartOut")
	RegisterForAnimationEvent(PlayerRef, "BlockStop")
	RegisterForActorAction(0)
EndEvent

Event OnActorAction(int actionType, Actor akActor, Form source, int slot)
	If akActor == PlayerRef && actionType == 0
		UnregisterForUpdate()
		DeflectWindowActive = 1
		Debug.Notification("Deflect window is active")
		RegisterForSingleUpdate(0.5)
	EndIf
EndEvent

Event OnAnimationEvent(ObjectReference akSource, string asEventName)
	If akSource == PlayerRef
		ElseIf asEventName == "BlockStartOut"
			ParryWindowActive = 1
			RegisterForSingleUpdate(0.2)
			ElseIf asEventName == "BlockStop"
				UnregisterForUpdate()
				ParryWindowActive = 0
	EndIf
EndEvent

Event OnUpdate()
	If ParryWindowActive
		ParryWindowActive = 0
		ElseIf DeflectWindowActive
			DeflectWindowActive = 0
			Debug.Notification("Deflect window is inactive")
	EndIf
EndEvent

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
	If (abHitBlocked && ParryWindowActive) || DeflectWindowActive
		Stagger.Cast(akAggressor)
	EndIf
EndEvent

Again, getting no errors when compiling, and animation events work as desired, however, actor action events do not appear to function, and I fail to see why.

Edited by nonamed817
Link to comment
Share on other sites

I need a rebalancing mod that change nearly everything (so umbalanced) but is too much asking for a stable, without bloating, and fully working mod?

 

And the second question

where can i find a list of up to date and supported mods, and about "dangerous" mods to avoid that can corrupt the game?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...