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.