You could also use IsInAir and GetFallTimer to detect when an actor is falling, and temporarily toggle the god mode on for that actor. Then when it lands (IsOnGround or FallTimer of 0) you toggle the godmode off. You could even use GetTerrainHeight to only toggle the godmode on for a split second, just before they hit the ground.
Problem with this it's still player based (GodMode is), need something Actor based. I don't want to actually see if the actor is falling, I want to prevent damage in certain situations. Currently ResetFallDamageTimer is player only and you can't tell it's active, reading it with GetFallTimer is fine, but again, there's no way to do this on any other actor, disabling the damage would be better since the actor wouldn't be inflicted with damage on landing and would probably be easier to accomplish than resetting an actor's damage timer (since the player is probably the only one with one).
It requires some math, but the GetPos function could allow you to calculate the current velocity of an actor. Just record the positions on two intervals, and record the difference between them. Not sure how to set the velocity though, but you could alternately place a small invisible plane model with collision under the actor to make them stop mid-air. Most flying mount mods use that technique to create the flying.
Well, the thing is, it'd be nice to actually control the velocity, being able to move an actor or slow it down. There just is no control over velocity at all. I can figure the velocity out with GetPOS, thats a piece of cake, but again, knowing and not being able to change it, is frustrating. Each actor that moves has a velocity, using a push away, that actor goes flying through the air, a velocity is applied, that would be nice to get at. Another nice idea with getting access to velocity would be wind, being able to make wind push people/things around, that'd be fun, we could have tornadoes.
It's not perfect, but you can override an animation by calling a SpecialIdle animation with higher priorities than the current one playing. Higher than 65 is probably always enough. You can do this by copying a vanilla anim to the IdleAnims folder, opening it in NifSkope, select the root node, and then in the Block Details window, expand the Extra Data List. For each bone, there is a priority number under it.
The thing is, overriding a specific animation would be very useful for those making weapons and such that would only alter the animations necessary to make the weapon look better when in use. The togglespecialanim is not 100% encompassing, you can't do it with every animation group in the list.
IIRC any actor/creature with a Confidence value of 0 will flee at the sight of an enemy. A workaround could be to place a restrained invisible (not the spell, just the alpha value) Creature near that big weapon with a faction that is an enemy to those you want to make run away.
Actually, that doesn't work, ForceFlee looks for threats nearby and a confidence of 0 is rare in-game (Deer are not at 0) and having a negative disposition to something doesn't class it as a threat. I've tested this with Deers, set their disposition to the actor to a negative 100 by faction and the Deer just sits stands there like it's stuffed. ForceFlee repeatedly does nothing, nor will it make the Deer flee. You have to Actor.StartCombat Deer then Deer.ForceFlee for it to work (because Actor is the threat). That sort of situation will later make the Deer come back and attack the Actor (not something wanted), plus it'll also throw both actors into battle. ForceFlee also has no "threat" input (meaning "fake this as a threat ref"), if it did, I'd not ask for this.
You can use GetTargets for that:
GetTargets - for an actor in combat, returns an Array of actors which the game considers potential targets of the calling actor at that particular moment.
(targets:Array) reference.GetTargets
Actually, GetNthEnemy is not what you're listing, those are "possible" targets, I'm talking about current Enemies of the actor, those in combat with the actor. There currently is no 100% guaranteed way to tell if all the actors nearby are fighting an actor, plus, no way to tell who's fighting an actor if they're nowhere to be found (as in an enemy who's stuck in the woods and you're still in battle). You could GetNthEnemy like GetNthFollower only for the actor's current enemies.
if Actor.GetCombatTarget != Player
if Actor.GetShouldAttack Player == 0
if Actor.GetDisposition Player > Actor.GetActorValue Aggression
are all working options.
And all don't work... GetIsAttacking basically says "Is Actor A is being attacked by Actor B?" not the
Current Combat Target. GetShouldAttack is also not going to tell me if Actor B is currently fighting Actor A. GetNthEnemy here could be used to test for this if needed. But basically it would look down the list of enemies to see if these two are in combat with each other whether they're one on one or they're in a group combat situation and have each other on their "to kill list".
Just using GetDisposition allows you to do exactly what you want.
Umm, no. OnDisposition basically alters how the disposition of actor to actor happens. Perfect example: An Ogre comes to town, someone SEEs the Ogre, the OnDisposition block is run with the Ogre and the Actor listed along with the two dispositions (for both ways). The code then determines that the Ogre is present and the other isn't an Ogre, well, the Ogre hasn't saved the princess, has never been in town before, so then checks the gender of the other actor, if female, flees, if male, grabs a weapon and starts a fight, both dispositions are set at -100 on the way out.
Currently, there is no inner AI injection method, to alter/change the behavior of any actor to actor situation. Each time an actor sees another, they test at least Disposition (there are hundreds of other factors here, but disposition is the easiest), but currently, all we can do is add factions to alter disposition, but it won't alter behavior on that disposition. You can't make anyone with -100 Disposition fight you without help (a script on the actor that causes a startcombat and we don't want to do that to every actor on the game). The OnDisposition block would make it so you'd be an enemy or friend based on your code. Another example would be Playable Creatures, you could have a flag to say "Live as one", meaning the OnDisposition would make humans attack you like you were the real thing. The creature's enemies and friends would be yours as well.
Disposition plays a minor roll in the decision on how an actor reacts at that moment, if not in Disposition, another block to control reactions would be fine. The AI in the engine is so bottled up, it's annoying and there still isn't anything globally we have access to that'd let us alter the behavior of the masses without resorting to massive token deposits (which adds bloat and performance loss).
To: GuruSR, Maegfear
As for Walk, Run, Idle, etc., OBSE already has functions which makes same behavior.
Actor.toggleSpecialAnim "Characters/Egyptian/WalklLkeAnEgyptian.kf" 1Actor.update3d
As for Attack, Recoil, and Stagger, I also have the almost same wish.
Why I was asking for an OverrideAnim, makes sense to override an existing anim with one you want.
GuruSR.