Jump to content

Problems with a knockdown script: IsAttacking VS OnHit?


ArtB

Recommended Posts

Hello all. I am working on a simple mod to make some enemies do more knockdowns. Right now I am just trying to get a basic version to work but already ran into a wall.

 

Currently they knock down just by attacking, even if them miss. I guess this is because I am using IsAttacking but am not how to make them only knockdown when their hits actually connect. I know there is an OnHit function in OBSE but not sure how it works. Couldn't find any examples.

 

Anyway here is the code I have so far:

Scn AAAGoblin

Short KDChance
Float Cooldown
Ref MyTarget

Begin Gamemode
	

set Mytarget to GetCombatTarget

	
If Cooldown > 0
     Set Cooldown to (Cooldown - GetSecondsPassed)
Else
     If IsAttacking ==1							;While attacking? Not on hit?
			Set KDChance to (100/99 * GetRandomPercent)                
			If KDChance <= 100				;100% Chance for testing
            PushActorAway MyTarget 5			                ;Knockdown and Force
               Set Cooldown to 1                                        ;1 second cooldown
          endif
     endif
endif

end

I am a novice. Input from veteran coders is appreciated!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...