Eartquakes that can knock pcsnpcs off their feet

Post » Sun Nov 18, 2012 1:13 pm

think it's possible to make an area earthquake that can knock creatures off their feet?
User avatar
Brιonα Renae
 
Posts: 3430
Joined: Mon Oct 22, 2007 3:10 am

Post » Sun Nov 18, 2012 7:11 am

Well, it's possible to send them flying miles into the air when they get clubbed by a giant ... so a bit of staggering around after an earthquake should be easy (though actually making it appear as though the world is shaking might be a little bit tricky ... almost certainly possible though)
User avatar
Barbequtie
 
Posts: 3410
Joined: Mon Jun 19, 2006 11:34 pm

Post » Sun Nov 18, 2012 4:19 am

You can knock them by pushactoraway (http://www.creationkit.com/PushActorAway_-_ObjectReference). You need to provide an object they'll be push from, but the object could the the actor itself. I recommend a 0 strenght.

For shaking the screen use shakecamera (http://www.creationkit.com/ShakeCamera_-_Game) and if you want to shake a controller, there is the shakecontroller function (http://www.creationkit.com/ShakeController_-_Game)
User avatar
Donald Richards
 
Posts: 3378
Joined: Sat Jun 30, 2007 3:59 am

Post » Sun Nov 18, 2012 5:29 am

Definitely possible. In my Quake and Tremor spells, I plant an invisible activator underneath each actor and use PushActorAway to knock them up away from it with diminishing force based on how far they are from the player. For Quake, nearby actors are flung a fair distance, far away ones are just knocked over. With Tremor, nearby enemies are flung a short distance, far away ones are just staggered using a short-range KnockAreaEffect. Each activator also has a timer set based on the distance from the player, so there's the sense of a shockwave actually traveling through the ground.

Here's the code for the stagger effect (this is attached to a Self-targeted Spell with a large Area):
Spoiler

Scriptname ELEM_Earth_Shock_Effect_Script extends activemagiceffect{Shockwave Effect that staggers all enemies within a large radius with a delay based on the distance};--=== Imports ===--Import UtilityImport Game;--=== Properties ===--Activator Property FXEmptyActivator autoActor Property PlayerRef AutoExplosion Property FXdustDropMedExplosion AutoImpactDataSet Property FXDragonLandingImpactSet AutoImpactDataSet Property VOCShoutPush01ImpactSet Auto;--=== Variables ===--Actor Player;--=== Events ===--Event OnInit()Player = PlayerRefEndEventEvent onEffectStart(Actor akTarget, Actor akCaster);Debug.Trace(self + ": started!")ObjectReference PushPoint = akTarget.PlaceAtMe(FXEmptyActivator)Float WaitTime; 1 km = ~70000 units, so say the shockwave travels at 0.1km/s (1/50 the speed in real life)Float Distance = akTarget.GetDistance(akCaster); Debug.Trace(self + ": Distance: " + Distance)WaitTime = Distance / 7000; Debug.Trace(self + ": Wait: " + WaitTime)Float StaggerMag = ((21333.333 - Distance) / 21333.333)Float PushMag = StaggerMag * 5; Debug.Trace(self + ": PushMag: " + PushMag)Wait(WaitTime)akTarget.PlaceAtMe(FXdustDropMedExplosion)PushPoint.MoveTo(akTarget)PushPoint.KnockAreaEffect(StaggerMag,50)PushPoint.MoveTo(akTarget,0,0,50)PushPoint.PlaceAtMe(FXdustDropMedExplosion)PushPoint.Delete()EndEventEvent onEffectFinish(Actor akTarget, Actor akCaster);Debug.Trace(self + ": Finished!")EndEvent

To actually knock the actors up in the air or to the ground, replace
PushPoint.KnockAreaEffect(StaggerMag,50)
with
PushPoint.PushActorAway(akTarget,PushMag)

Just FYI, you have to tune PushMag carefully. Even 0 will ragdoll the actor, 15 will fling most NPCs high enough to take fall damage, and 50 will send even a Giant flying high enough to probably kill it. Negative values will pull the actor toward the pushpoint instead of pushing them away (see Actor Magnet, Midas Magic Black Hole, etc).

Here's the fling-away-from-the-caster effect (a general purpose script with a tunable range):
Spoiler

Scriptname ELEMPushActorBlastScript extends ActiveMagicEffect{Pushes actors away based on radius.}Float Property AreaOfEffect autoInt Property PushForce autoBool Property KnockOut = False autoFloat Property KnockOutTime = 1.5 autoSpell Property ELEM_Cond_Stunned AutoActor TargetActor CasterBool Finished = FalseEvent OnEffectStart(actor akTarget, actor akCaster)Target = akTargetCaster = akCasterIf Target == Game.GetPlayer()  ReturnEndIfFloat Radius = AreaOfEffect / 2Radius = Radius * 21.33333 ; Convert Feet to UnitsFloat Distance = Caster.GetDistance(Target)If Distance < Radius  Float PushMag = ((Radius - Distance) / Radius) * PushForce  Debug.Trace(self + ": Blast Radius is " + Radius + ". Distance to target" + Target + " is " + Distance + ". Applying PushMag " + PushMag + ".")  Caster.PushActorAway(Target, PushForce)  If KnockOut   RegisterForSingleUpdate(KnockOutTime)   Target.AddSpell(ELEM_Cond_Stunned)  EndIfElse  Debug.Trace(self + ": Blast Radius is " + Radius + ". Distance to target" + Target + " is " + Distance + ". No force applied.")EndIfEndEventEvent onUpdate()Finished = TrueEndEventEvent OnEffectFinish(actor akTarget, actor akCaster)Finished = TrueEndEvent

Here is the effect:
http://www.youtube.com/watch?v=oHJJXzA3e5o
User avatar
Claudz
 
Posts: 3484
Joined: Thu Sep 07, 2006 5:33 am

Post » Sun Nov 18, 2012 3:07 am

You might want to have a look at Explosion objects in the CK, they can knock people down (use a very large radius with very low force and use one of the Knock Down Living Actors options) and since the vanilla Fireball attack also has a shake camera included, that can be defined somewhere as well (Impact Data sets?). An Explosion doesn't need a model to go with it and you can define the sounds as well. Seems perfect to me to simulate an earthquake.

It's generally better to not use scripts if you can help it, due to their delays.
User avatar
Kirsty Wood
 
Posts: 3461
Joined: Tue Aug 15, 2006 10:41 am

Post » Sun Nov 18, 2012 4:47 pm

You're right, of course, and where built-in effects like Explosions can be used, they should be. The downside of Explosions is that they are inflexible. If I want all actors within draw distance staggered with a delay based on distance (like a shockwave), scripting is the only option. Likewise, if I want a spell to fling all nearby actors up, instead of away, I must use a script.

Another downside to using a large radius force explosion, particularly with a high force value, is that it knocks around ALL havok objects within radius, which may not be desirable.

Right tool, right job and all that.
User avatar
gandalf
 
Posts: 3400
Joined: Wed Feb 21, 2007 6:57 pm

Post » Sun Nov 18, 2012 8:21 am

Definitely possible. In my Quake and Tremor spells, I plant an invisible activator underneath each actor and use PushActorAway to knock them up away from it with diminishing force

....
Damn fine stuff, matey :)
User avatar
Rude_Bitch_420
 
Posts: 3429
Joined: Wed Aug 08, 2007 2:26 pm

Post » Sun Nov 18, 2012 2:32 am

thanks everyone. I have been without internet for 3 days so sorry for slow reply.
what I mean is to attach a script to an area (even a region on the mainland map, rather than a separate cell) and have there a randomized earthquake.
User avatar
Bellismydesi
 
Posts: 3360
Joined: Sun Jun 18, 2006 7:25 am


Return to V - Skyrim