Dragon Crash Landing ?

Post » Wed Jun 20, 2012 9:46 am

I'm poking around in the code, trying to figure out how dragon crashing works.

I've seen it a few times, when weak enough a dragon can land in an uncontrolled manner, skidding across the ground and creating a big dirt trail behind it. there's custom sounds, fx and everything, it's definitely intended functionality, though it seems rarely used. I'm having little luck in figuring out exactly when or how it works.

what i've found so far is an object, DragonMarkerCrashStrip which from the looks of it is what the dragons need nearby to crash land on. There's a total of about 50 of them, places all around skyrim.

The only reference to them that i can find so far though, is a set of scripts and assets for an E3 demo, presumably where they showed a dragon crashing.
In actual production scripts, the only similar thing i've found is some commented-out code about animation states, that seemed to be concerned with making a falling dragon bleed, and was abandoned. I also know about the ability to set false the variable that allows them to fly (dragonrend does it) however this doesn't cause a crash, it only causes them to land normally as soon as they can.

I've found that it can be pretty reliably caused ingame, by dealing a dragon a massive amount of damage while it's in the air, or on a perch. But endless hours of searching the CK, scripts and packages, have turned up zero information about how this behaviour is controlled.

I'm wondering if anyone might know more on the issue. point me towards a script, ai package etc, that might be relevant? any information is appreciated.


My ultimate aim is to be able to trigger it, at will, through a script. but i've no idea what command(s) would get me there. So far the only idea i have is to massively increase it's max HP, so that it's at a low HP percentage. that should trigger it, but it's a rather inelegant solution
User avatar
Amber Ably
 
Posts: 3372
Joined: Wed Aug 29, 2007 4:39 pm

Post » Wed Jun 20, 2012 1:50 pm

I wonder if those Dragon Landing Strips can be scripted to appear, then that would "bring the dragon down". The reason I say this is I have had these dragons crash land all over the place and I can't see where 50 landing strips across the map can account for that. Perhaps those ones already designated are just placed near dragon spawn points. As the crash landing does not always happen right on top of me like I would expect in a fight.
User avatar
Lindsay Dunn
 
Posts: 3247
Joined: Sun Sep 10, 2006 9:34 am

Post » Wed Jun 20, 2012 12:02 pm

I wonder if those Dragon Landing Strips can be scripted to appear, then that would "bring the dragon down". The reason I say this is I have had these dragons crash land all over the place and I can't see where 50 landing strips across the map can account for that. Perhaps those ones already designated are just placed near dragon spawn points. As the crash landing does not always happen right on top of me like I would expect in a fight.

hii.
I don't know if they can be, but i think they aren't. The presence of the script isn't what brings the dragon down, they just act as the location to do it IF it's damaged enough. I believe the low health is what triggers it. Plenty of times i've fought near strips and not seen a crash, because the right conditions didn't occur.

Personally i think 50 is more than enough to account for things. They're mostly placed around the nested dragon areas (the ones that perch on word walls), near dragon graves, and in towns and cities. In my experience i've not seen a dragon crash when it wasn't in one of these areas. There aren't really that many. How many nested dragons are there? 15-20 i think. 9 hold capitals, roughly 8-ish smaller villages.

I actually made a shout that did 99999 damage, for testing purposes. i tried it on a random dragon and it flew to what must have been a crash strip, quite a long way away.


In any case, the crash scripts are used, but what tells them to be used? There must be some kind of logic in the ck, or in scripts, that says "If your health is low and you're flying, look for the nearest crash strip and start this animation". once i can find where that is, i can figure out how to make it happen on command.
User avatar
Gavin boyce
 
Posts: 3436
Joined: Sat Jul 28, 2007 11:19 pm

Post » Wed Jun 20, 2012 12:33 pm

Sometimes if you completely kill a dragon in midair, it will fly around and never land, even though it has no health. Unless they fixed that in a recent patch.
User avatar
Aman Bhattal
 
Posts: 3424
Joined: Sun Dec 17, 2006 12:01 am

Post » Wed Jun 20, 2012 7:29 pm

here's one I found.

Scriptname MQ104DragonCrashScript extends ObjectReference  {script for trigger on dragon crashmight be temp if this gets hooked up to animation events}Quest Property MQ104  Auto  ObjectReference Property TriggerActor Auto{which actor triggers this?}import gameimport debugauto STATE waiting    EVENT onTriggerEnter(objectReference triggerRef)        if triggerRef == TriggerActor            int flyingState =  (triggerRef as Actor).GetFlyingState()            bool allowedToFly = (triggerRef as Actor).IsAllowedToFly()            trace(self + ": " + TriggerActor + " entered, flying state = " + flyingState + ", allowedToFly=" + allowedToFly )            ; when actor enters the trigger at the right time, initiate the scene            if MQ104.GetStageDone(65) == 1 && MQ104.GetStageDone(80) == 0 && flyingState == 0                MQ104.SetStage(70)                gotoState("hasBeenTriggered")            endif        endif    endEVENTendSTATESTATE hasBeenTriggered    ; this is an empty state.endSTATE
User avatar
Sheila Esmailka
 
Posts: 3404
Joined: Wed Aug 22, 2007 2:31 am

Post » Wed Jun 20, 2012 12:31 pm

From my experience all you have to do is turn off the dragons IsAllowedToFly state. Just make this call on the dragon:

DragonActor.SetAllowFlying(false)

That should do it. At least the console version of the same works on dragons, unless it was sheer coincidence that I typed it in and it immediately crash landed where it usually would have in that region/cell.

-MM
User avatar
Josh Lozier
 
Posts: 3490
Joined: Tue Nov 27, 2007 5:20 pm

Post » Wed Jun 20, 2012 5:58 pm

here's one I found.

Scriptname MQ104DragonCrashScript extends ObjectReference  {script for trigger on dragon crashmight be temp if this gets hooked up to animation events}Quest Property MQ104  Auto  ObjectReference Property TriggerActor Auto{which actor triggers this?}import gameimport debugauto STATE waiting	EVENT onTriggerEnter(objectReference triggerRef)		if triggerRef == TriggerActor			int flyingState =  (triggerRef as Actor).GetFlyingState()			bool allowedToFly = (triggerRef as Actor).IsAllowedToFly()			trace(self + ": " + TriggerActor + " entered, flying state = " + flyingState + ", allowedToFly=" + allowedToFly )			; when actor enters the trigger at the right time, initiate the scene			if MQ104.GetStageDone(65) == 1 && MQ104.GetStageDone(80) == 0 && flyingState == 0				MQ104.SetStage(70)				gotoState("hasBeenTriggered")			endif		endif	endEVENTendSTATESTATE hasBeenTriggered	; this is an empty state.endSTATE

Thanks for the effort ^^ unfortunately this doesn't help much. I did a bit of poking around, and what this script does is checks if the dragon is dead, and if so removes a temporary instance of the crash strip which exists only for that quest. The quest in question is Dragon Rising, where the dragon attacks the tower outside whiterun and you go with irileth to fight it.

the script does make reference to animation events though. I don't know what those are or how they work. does anyone have any information on those? I had a look through everything animation related that i could find, and i was able to find crashlanding animations for the dragon, on it's model file. but i couldn't find any logic that triggers them, or any conditions attached to it.
User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am

Post » Wed Jun 20, 2012 11:00 am

From my experience all you have to do is turn off the dragons IsAllowedToFly state. Just make this call on the dragon:

DragonActor.SetAllowFlying(false)

That should do it. At least the console version of the same works on dragons, unless it was sheer coincidence that I typed it in and it immediately crash landed where it usually would have in that region/cell.

-MM
it must have been coincidence. I've tried that in a scripted spell already. it makes the dragon land normally, as soon as they can. no crashing. Was the dragon maybe heavily injured when you tried it?

I can't get this command to work from the ingame console though. You said "the console version of the same" ? What ingame command does the same as this? Perhaps there's a difference and only the ingame one causes a dragon to crashland. more info needed! ^^
User avatar
Devils Cheek
 
Posts: 3561
Joined: Sun Aug 13, 2006 10:24 pm

Post » Wed Jun 20, 2012 7:53 am

anyone?

i have previously asked about this topic on the tesnexus forums, unfortunately didn't get much help there either. nobody seems to have a clue
User avatar
Loane
 
Posts: 3411
Joined: Wed Apr 04, 2007 6:35 am

Post » Wed Jun 20, 2012 5:07 pm

There's 3 functions worth looking at.
[Set|Get|Clear]ForcedLandingMarker()

Not sure if setting those to a perch or landingMarker will force that to be used when AllowFlying goes false.
User avatar
Pumpkin
 
Posts: 3440
Joined: Sun Jun 25, 2006 10:23 am

Post » Wed Jun 20, 2012 8:41 am

it seems that If you SetForcedLandingMarker() to a LocationRef and cut the dragon wing with SetAllowFlying(false), he crash.

I've noticed this when digging on my mods...
User avatar
Amy Melissa
 
Posts: 3390
Joined: Fri Jun 23, 2006 2:35 pm

Post » Wed Jun 20, 2012 12:43 pm

Ok, i'm trying out the forced landing marker now.



so far i;ve tried setting it to the player (and setting allowflying false)


this causes him to land normally on my head >.<



So maybe it has to be the proper marker? I&#39;ve written a script to make him land on the nearest crash strip. it seems to be funcitoning as, when i use it, he lands very rapidly within a few seconds, at an unnatural speed



but despite that, the landing is still normal. no crashland. am i missing something here?



here&#39;s my code:




Scriptname KillingWord extends activemagiceffect
ObjectReference property DragonMarkerCrashStrip auto
Event OnEffectStart(actor Target, actor Caster)
ObjectReference landspot = Game.FindClosestReferenceOfTypeFromRef(DragonMarkerCrashStrip, Game.GetPlayer(), 99999.0)
Target.SetForcedLandingMarker(landspot)
Target.SetAllowFlying(false)
EndEvent
User avatar
Anna Kyselova
 
Posts: 3431
Joined: Sun Apr 01, 2007 9:42 am

Post » Wed Jun 20, 2012 8:48 am

my post is full of html wtf. the site messed up >.<
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Wed Jun 20, 2012 3:31 pm

trying again: Ok, i&#39;m trying out the forced landing marker now.

so far i;ve tried setting it to the player (and setting allowflying false)
this causes him to land normally on my head >.<

So maybe it has to be the proper marker? I&#39;ve written a script to make him land on the nearest crash strip. it seems to be funcitoning as, when i use it, he lands very rapidly within a few seconds, at an unnatural speed

but despite that, the landing is still normal. no crashland. am i missing something here?

here&#39;s my code:


Scriptname KillingWord extends activemagiceffect  ObjectReference property DragonMarkerCrashStrip autoEvent OnEffectStart(actor Target, actor Caster)ObjectReference landspot = Game.FindClosestReferenceOfTypeFromRef(DragonMarkerCrashStrip, Game.GetPlayer(), 99999.0)Target.SetForcedLandingMarker(landspot)Target.SetAllowFlying(false)EndEvent
User avatar
Auguste Bartholdi
 
Posts: 3521
Joined: Tue Jun 13, 2006 11:20 am

Post » Wed Jun 20, 2012 3:14 pm

Found to crash dragon every time like this :

With MQCallDragon Quest adding this Quest Alias :
  • adding a Folow Player Package to DRAGON Reference Alias
  • a Location Alias on Find Matching Location with Condition : Self - GetDistance - 'PlayerRef' < 5000 AND Self - LocationHasRefType - 'LocationCenterMarker' == 1 AND Self - LocationHasKeyword - 'LocTypeHabitation' == 1
  • a ReferenceAlias on Location Alias Reference with preview Loc Alias and RefType = LocationCenterMarker
  • and on DRAGON Reference Alias add a Script like this :
Scriptname DRDragonLandOnNoCombat extends ReferenceAliasPackage Property MyPkFolowPlayer  AutoReferenceAlias Property MyRefAlias  AutoEvent OnPackageStart(Package akNewPackage)	   if (akNewPackage == MyPkFolowPlayer)			   Actor Drag = Self.GetActorRef()			  Drag.SetForcedLandingMarker(MyRefAlias.GetRef())			  Drag.SetAllowFlying(false)	   endifendEvent

Don't know if it's Keyword 'LocTypeHabitation' who making crash or what... (I'll try investigate when have sometime)
User avatar
renee Duhamel
 
Posts: 3371
Joined: Thu Dec 14, 2006 9:12 am

Post » Wed Jun 20, 2012 2:01 pm

Cool!

To answer your question yes, it's entirely possible that it was also damaged at the time and just have been coincidence. I the time I was merely fooling around with the console naively trying to figure out how flying worked and whether I could get my character flying just via console commands, and wondering what effect they had on actual flying creatures.

-MM
User avatar
Scott
 
Posts: 3385
Joined: Fri Nov 30, 2007 2:59 am

Post » Wed Jun 20, 2012 10:51 am

Found to crash dragon every time like this :

With MQCallDragon Quest adding this Quest Alias :
  • adding a Folow Player Package to DRAGON Reference Alias
  • a Location Alias on Find Matching Location with Condition : Self - GetDistance - 'PlayerRef' < 5000 AND Self - LocationHasRefType - 'LocationCenterMarker' == 1 AND Self - LocationHasKeyword - 'LocTypeHabitation' == 1
  • a ReferenceAlias on Location Alias Reference with preview Loc Alias and RefType = LocationCenterMarker
  • and on DRAGON Reference Alias add a Script like this :
Scriptname DRDragonLandOnNoCombat extends ReferenceAliasPackage Property MyPkFolowPlayer  AutoReferenceAlias Property MyRefAlias  AutoEvent OnPackageStart(Package akNewPackage)	   if (akNewPackage == MyPkFolowPlayer)			   Actor Drag = Self.GetActorRef()			  Drag.SetForcedLandingMarker(MyRefAlias.GetRef())			  Drag.SetAllowFlying(false)	   endifendEvent

Don't know if it's Keyword 'LocTypeHabitation' who making crash or what... (I'll try investigate when have sometime)

this is a bit over my head >.< but don't worry, i'll learn fast. i'll do some poking around to try to decipher this, see what's making it tick. I don't see too many thigns different from what was mentioned before though. maybe you're right about the keyword.
User avatar
Breanna Van Dijk
 
Posts: 3384
Joined: Mon Mar 12, 2007 2:18 pm


Return to V - Skyrim