Script enabling a follower to turn into a dragon?

Post » Sat Nov 17, 2012 3:21 pm

As part of the story in a mod me and some other guys are putting together (we consider it more of an unofficial expansion), we're going to need our follower to be able to turn into a dragon. We're going through great lengths to make sure we implement our story into the existing lore seamlessly, just wanted to point out that the dragon shapeshifting is lore friendly, no just random dragon madness for the sake of it.

However, this is far beyond what any of us are capable of doing. It may not even be possible with the CK for all we know. We're learning alot of what we need to do as we go. I figured it would have to be some sort of power or shout, but i dont know we would go about actually making it happen, nor what we would do for the animation of him shifting. Any ideas, or help, or if you can just flatout do it for us, would be greatly appreciated. Anyone that contributes will be given due credit when its released.
User avatar
Farrah Barry
 
Posts: 3523
Joined: Mon Dec 04, 2006 4:00 pm

Post » Sat Nov 17, 2012 5:28 pm

Bump?
User avatar
Rhi Edwards
 
Posts: 3453
Joined: Fri Jul 28, 2006 1:42 am

Post » Sat Nov 17, 2012 1:59 pm

You can do it - I think - but it will almost certainly involve a fair bit of work ...

1. Create an NPC in the CK that is your actual companion/follower (you did this already, I assume)
2. Create a new Voice Type (MyFollowersVoice)
3. Make your NPC Actor use that voice type (you may have to change lots of Conditions on dialogue you already made - and depending on how you did Follower Dialogue, quite a lot of changes)
4. Create a clone of a Dragon Actor (NPC)
5. Change the voice of the dragon-clone to your new voice

If the Dragon-Cone-NPC has scripts or packages on the actual character (not on aliases that use the dragon) then you will need to look at and potentially edit those.

If it is bad enough, because dragons are different than anything else ... then you may need a cloned Dragon-Race, with some racial-abilities added or removed ... A talking-dog-follower is pretty easy, but the dogs don't fly nor breath fire, nor die in very pretty ways ...

In your scripts, when you want the change to occur, you simply disable the original actor and "place" the cloned dragon back in it's place (use a magic effect, and/or shaders to disguise the replacement). Then switch that around when you want them to change back.

When I say "simply" ... you may well have lots of issues with quest-aliases no longer filling ... so you would need to "force" any aliases for the original-follower to now use the dragon-follower (by setting and testing a global variable, maybe?).

You would very probably also need to look at your dialogue-conditions, to check that you have not used Race, or the actual NPC as a reference in the dialogue conditions (just the voice type we setup earlier, plus any Quest-at-Stage type conditions, plus any follower aliases)

Note that the idea is to fill the same alias with whichever of the two "follower states" is active - and just use the alias in your quests/scripts.

As to how the dragon travels along with the PC ... No idea, never seen a dragon walk far, never tried to control where one flies to ... probably possible, though ... You'll have to see what happens with a simple test of the "Follow Me" and "Wait Here" functions.


If you have planned from the start for all of this to work, then I think it will work. If you are trying to retrofit it ... Well I would start over because that's likely to be a bit of a nightmare ...


If you just try to change race, from humanoid to a dragon, everything will just go pear-shaped, I think ... You could try it, but experience of other posts on here says it won't work.
User avatar
Eddie Howe
 
Posts: 3448
Joined: Sat Jun 30, 2007 6:06 am

Post » Sat Nov 17, 2012 5:07 pm

I'll give that a try tomorrow probably and see what happens. As for the follow/wait commands, its really supposed to be more of just a combat ability, not something you really interact with too much when its in the dragon form.

We also played around with the idea of him staying a dragon after the initial transformation, and not being something that he can just switch on and off. But then the follower would essentially be just another Odahviing, so it would be more of a last resort if we cant figure this out.
User avatar
Emily Rose
 
Posts: 3482
Joined: Sat Feb 17, 2007 5:56 pm

Post » Sat Nov 17, 2012 9:45 am

So the follower will shapeshift into the dragon on its own and not need to interact with the player? Let me try and pull something together. A pot of coffee first, of course. I'll update when I'm done with some screenshots.

Okay, so I have it working - to an extent. The person will transform into a dragon that will fight with you until combat's over. The code isn't very well written - sorry! - and it'll surely need to be adjusted to your mod. I tested it on an NPC that was created just to test this, he was not an actual follower, but that shouldn't matter a whole lot. The scripts will be in spoilers below the steps.

For the purpose of saving you from looking all around the screenshots, I've boxed in the focal points with an annoying shade of orange.

Step one: Attach the script to the NPC. Make sure he's an ally - as is typical with all followers, but you can never be too careful! http://imageshack.us/f/59/84521219.jpg/

Step two: Create the awesome dragon who's going to be aiding you.
a. Set up its traits and attach the script. http://imageshack.us/f/96/58283872.jpg/
b. Set up its relationship. http://imageshack.us/f/689/42872993.jpg/
c. Set up the AI Data. http://imageshack.us/f/15/54882378.jpg/
d. Give it some dragon spells to throw at enemies! http://imageshack.us/f/825/83892714.jpg/

Step three: Create a cell to store our scaly friend in. http://imageshack.us/f/163/33042628.jpg/

Okay, now you just need the scripts! Don't forget to set up the properties. For the dragon ally script the Actor is the human and vice versa.

HumanollyScript
Spoiler
Scriptname apHumanollyScript extends Actor  Actor Property apDragonForm  Auto  bool property apCanTransform Autoevent oninit()	apCanTransform = trueendeventevent ondeath(actor apKiller)	apCanTransform = falseendevent; Testing block - uncomment if you don't feel like starting combat every time;event onactivate(objectreference apRef);	;turn into a dragon;	apDragonForm.moveto(self);	apDragonForm.enable();	disable();endeventevent oncombatstatechanged(actor apTarget, int apState)	if apState == 1		registerforsingleupdate(0.5)	endifendeventevent onupdate()	if getcombatstate() == 1		if getavpercentage("health") <= 0.50 && apCanTransform == true			;turn into a dragon			apDragonForm.moveto(self)			apDragonForm.enable()			disable()		endif		registerforsingleupdate(0.5)	else		unregisterforupdate()	endifendevent
A few comments on that one. The guy only transforms when he's at or below 50% health. I used oncombatstatechanged with a "while apState == 1" but it was very ineffective. I also had a check set up to see if the guy already transformed - so he couldn't transform right when he comes back, just in case - but it ended up (somehow) that when in dragon form he'd never turn back. Quite the opposite effect! I trust you guys will improve this script greatly, I'd like to see the finished product!

DragonAllyScript
Spoiler
Scriptname apDragonAllyScript extends Actor  Actor Property apHumanForm  Auto  bool property apIsDead Autoevent oninit()	apIsDead = falseendeventevent ondeath(actor apKiller)	apIsDead = trueendeventevent oncombatstatechanged(actor apTarget, int apState)	if apState == 0 && apIsDead == false		; combat has ended, return to human form		;apHumanForm.moveto(self)		apHumanForm.enable()		disable()	endifendevent
Short and sweet. Works like a charm.

It's pretty cool to see a dragon flying around to help you out. He even perches! Not sure how exactly, as I thought that would have to do with the dragon script, but he does indeed.

If you want to add some transforming effects check http://www.gamesas.com/topic/1397755-need-a-special-effect-for-my-my-temptress-vixen/page__p__21253084#entry21253084 thread out. Good luck and happy modding.
User avatar
Lauren Graves
 
Posts: 3343
Joined: Fri Aug 04, 2006 6:03 pm

Post » Sat Nov 17, 2012 12:34 pm

Its awesome you got it working. The DragonScript wouldn't work for me, so I just copied the human script and changed things around for him turn back into the NPC when the combatstage is set to 0, but still didnt work. Also tried doing it with his health < 1.0 (am i correct in assuming thats 'less than 100%'), just to see if he would turn back after hitting him. Can only get him to turn back on activation.

The perching is just part of the dragon race and dragon combat styles i believe, no need for scripting the dragon actions.

EDIT: Got it all working great. The dragon script had a comment in a line that was messing everything up. Thanks for the help! Gunna mess with some transformation effects and see if i cant get a forced landing scripted in there before it swaps actors.
User avatar
Bones47
 
Posts: 3399
Joined: Fri Nov 09, 2007 11:15 pm

Post » Sat Nov 17, 2012 5:43 am

Those Image shack images are really poor quality, at least on my pc... :) I tried to view them and even expand them but can't make out what they look like readable wise...
This is a pretty cool idea, script looks impressive as well...
User avatar
Deon Knight
 
Posts: 3363
Joined: Thu Sep 13, 2007 1:44 am


Return to V - Skyrim