Swimming as a mode for flying?

Post » Tue Jun 19, 2012 5:38 pm

I'm sure someone is already ahead of me on this but I had an idea: If you can swim in real time and traverse all three axises in water why can't you do it above water? Is there someway this could be accomplished?

I'm working on a flying form for my vampire mod. A Bat Form.

What I would like the power/spell to do is change the player race, add effects, adjust player speed and allowing hovering and/or flying.

I can do everything but the flying part.
User avatar
mollypop
 
Posts: 3420
Joined: Fri Jan 05, 2007 1:47 am

Post » Wed Jun 20, 2012 9:39 am

Yes... a viable "flying" script ( or magic effect/enchantment ) would be most interesting. As far as I know, the last Elder Scrolls game were you could actually fly via spell or enchanted item ( as opposed to simply using the the TCL console command ), was Morrowind.
User avatar
Anthony Rand
 
Posts: 3439
Joined: Wed May 09, 2007 5:02 am

Post » Wed Jun 20, 2012 1:41 am

What I'd like to determine is how the game knows when to turn the player over to a 'swimming state'. Is it a script? Is it a hardcoded engine thing? My terminology svcks but hopefully I'm understood.

If it's something that can be called out by quest, spell or script it would make for a nice way to add flying without using togglecollision or lengthy (and clunky) translates.
User avatar
NAtIVe GOddess
 
Posts: 3348
Joined: Tue Aug 15, 2006 6:46 am

Post » Wed Jun 20, 2012 6:30 am

One of my hired followers somehow entered a bugged state once where he was swimming above ground... essentially just like you are describing. I don't know how to recreate it.. but I will tell you it looked so awesome I wanted to make a MOD that I could do it myself. Perhaps you will beat me to it!! (I'm not currently attempting it)
User avatar
DAVId Bryant
 
Posts: 3366
Joined: Wed Nov 14, 2007 11:41 pm

Post » Tue Jun 19, 2012 6:02 pm

One of my hired followers somehow entered a bugged state once where he was swimming above ground... essentially just like you are describing. I don't know how to recreate it.. but I will tell you it looked so awesome I wanted to make a MOD that I could do it myself. Perhaps you will beat me to it!! (I'm not currently attempting it)

That's very interesting. Perhaps then what happened is the package or the animations for that actor were bugged and the engine had him 'swimming' above ground. I hope to find a solution somehow.
User avatar
Johnny
 
Posts: 3390
Joined: Fri Jul 06, 2007 11:32 am

Post » Tue Jun 19, 2012 10:11 pm

I would DL this MOD if you make it!
User avatar
Steve Bates
 
Posts: 3447
Joined: Sun Aug 26, 2007 2:51 pm

Post » Wed Jun 20, 2012 3:54 am

Simply checking the "Can Fly" box doesn't do it I take it?
User avatar
^~LIL B0NE5~^
 
Posts: 3449
Joined: Wed Oct 31, 2007 12:38 pm

Post » Wed Jun 20, 2012 6:38 am

Simply checking the "Can Fly" box doesn't do it I take it?

Lol no. I was hoping it would be that easy. That was the first box I checked when I first messed around with races.

No something special must be happening when the player enters water that the engine is handling itself i'd guess. I looked at water creatures like Slaughterfish and Horkers and found nothing unique about their animations or models. They could just as easily work on land as they do in water but for example obviously slaughterfish can not enter onto land.

I was looking at water in cells as well and have yet to see anything special. Of course there's still a fair amount of noob in me.
User avatar
Miss Hayley
 
Posts: 3414
Joined: Tue Jun 27, 2006 2:31 am

Post » Wed Jun 20, 2012 3:29 am


No something special must be happening when the player enters water that the engine is handling itself i'd guess. I looked at water creatures like Slaughterfish and Horkers and found nothing unique about their animations or models. They could just as easily work on land as they do in water but for example obviously slaughterfish can not enter onto land.



Yes.. I've accidentally spawn fish on land in a MOD I was working on. They just swim on land.

Have you tried something like this in a script?

Game.GetPlayer().SetAllowFlying()
That may get you off the ground. I used the console version once, and it worked.
You would just have to figure out the animation part.

http://www.creationkit.com/PlayIdle_-_Actormight work, or http://www.creationkit.com/SendAnimationEvent_-_Debug. (I linked the wiki's on each)
User avatar
Wayne Cole
 
Posts: 3369
Joined: Sat May 26, 2007 5:22 am

Post » Wed Jun 20, 2012 3:16 am

Here's a link to a post in this forum that shows some code and explains more on SendAnimationEvent

http://www.gamesas.com/topic/1350733-i-found-out-how-to-play-any-animation-at-any-time/page__hl__animation
User avatar
Jesus Sanchez
 
Posts: 3455
Joined: Sun Oct 21, 2007 11:15 am

Post » Tue Jun 19, 2012 8:56 pm

Yes.. I've accidentally spawn fish on land in a MOD I was working on. They just swim on land.

Have you tried something like this in a script?

Game.GetPlayer().SetAllowFlying()
That may get you off the ground. I used the console version once, and it worked.
You would just have to figure out the animation part.

http://www.creationkit.com/PlayIdle_-_Actormight work, or http://www.creationkit.com/SendAnimationEvent_-_Debug. (I linked the wiki's on each)

I've tried SetAllowFlying(True) but it does nothing. Maybe the swimming animations need to be added? However I've tried playidle on "SwimStart" and "swimStop" but nothing happens. Maybe because they aren't loose animations for the character? If that's the case then maybe sendanimationevent would work?
User avatar
steve brewin
 
Posts: 3411
Joined: Thu Jun 21, 2007 7:17 am

Post » Wed Jun 20, 2012 9:30 am

Okay so I got the swimming animation to work the problem is that the character never leaves the ground.

How did you get SetAllowFlying to work in the console?
User avatar
Hilm Music
 
Posts: 3357
Joined: Wed Jun 06, 2007 9:36 pm

Post » Wed Jun 20, 2012 1:06 am

I think actually it was "TFC"? That's flycam, not sure if the player moved with it or not.

So what happens if SetAllowFlying() is set, and you translate the character upwards? does he fall back down, or stay in the air?
User avatar
Stefanny Cardona
 
Posts: 3352
Joined: Tue Dec 19, 2006 8:08 pm

Post » Wed Jun 20, 2012 9:49 am

Well how about use puppeteer method (invisible player character and force animation on an actor) with this commands

GetPos SetPos  GetAngle SetAngle  

to achieve flying similar to for Oblivion mods?
http://www.youtube.com/watch?v=FeqwVZaEsgI
http://www.youtube.com/watch?v=kI__qU_Oj4s
http://www.youtube.com/watch?v=LBFU9KS5AA4

TC seems not very well applicable there due AI

Yes... a viable "flying" script ( or magic effect/enchantment ) would be most interesting. As far as I know, the last Elder Scrolls game were you could actually fly via spell or enchanted item ( as opposed to simply using the the TCL console command ), was Morrowind.
Oblivion
http://www.youtube.com/watch?v=AxdGbta3pIc
http://www.youtube.com/watch?v=3GdLRbLwm4w
User avatar
Joanne
 
Posts: 3357
Joined: Fri Oct 27, 2006 1:25 pm

Post » Wed Jun 20, 2012 5:16 am

I think the problem I had (if I remember correctly) with SetPos/GetPos and TranslateTo was that the values are fixed on the 3d grid that is the game world of skyrim. So all that happens is you fly over to that position and then perform angled maneuvers. It isn't fun in the end. Feels like you're trucking a rigged invisible flying car.

Im about to test something new with SetAllowFlying and I'll report back in a min.
User avatar
Sudah mati ini Keparat
 
Posts: 3605
Joined: Mon Jul 23, 2007 6:14 pm

Post » Wed Jun 20, 2012 2:10 am

There's a http://forums.nexusmods.com/index.php?/topic/568891-proof-that-a-player-can-fly-in-skyrim-well-may-be-more-like-swimming/ in the nexus modding forums. I only looked through the first couple of pages though.
User avatar
^~LIL B0NE5~^
 
Posts: 3449
Joined: Wed Oct 31, 2007 12:38 pm

Post » Wed Jun 20, 2012 12:23 am

So far SetAllowFlying(), (wether set as '(true)' or not) does nothing. I tried turning on the 'flying' option for the race and then tested this spell but no dice.

There's just gotta be a way.

I do have the animation working though. My character floats a couple feet above the ground and as along as I dont jump the animation will keep playing as though my PC is swimming. However he never moves up or down.

I shall not rest until an answer is discovered!
User avatar
Gwen
 
Posts: 3367
Joined: Sun Apr 01, 2007 3:34 am

Post » Wed Jun 20, 2012 1:41 am

There's a http://forums.nexusmods.com/index.php?/topic/568891-proof-that-a-player-can-fly-in-skyrim-well-may-be-more-like-swimming/ in the nexus modding forums. I only looked through the first couple of pages though.

Did you check this out? He didn't use the SetAllowFlying() function, but he DID use TranslateTo() to move around.
User avatar
Da Missz
 
Posts: 3438
Joined: Fri Mar 30, 2007 4:42 pm

Post » Tue Jun 19, 2012 7:52 pm

Yeah I checked that out. i've used TranslateTo. It's very clunky. it isn't really flying. It's movement toward a set location.

I took a script from that thread and modified it to fit my own. It compiled but the parts added from his don't seem to do anything. I must be missing a proper target or something.

In case your curious here is the frankenstein script: (Wtih permission from the author for the parts that aren't mine.)

Scriptname DV_BatFormTraits extends ActiveMagicEffect  import Gameimport Soundimport Formimport Debugimport Utilityimport GlobalVariableimport ActorActor Property Player AutoSpell Property DVampireBatForm AutoSpell Property DVampireBatFormToggle AutoIdle Property SwimStart AutoIdle Property swimStop AutoIdle Property JumpFall Autobool Property bIsOn Autobool Property bVal AutoEffectShader Property DVCelerityShadow Autofloat bearingfloat elevationfloat speedfloat posxfloat posyfloat poszfloat movefloat dtimeEvent OnEffectStart(Actor Target, Actor Caster)ObjectReference PCVamp = GetPlayer()    if !Caster.HasSpell(DVampireBatFormToggle)    		    Caster.AddSpell(DVampireBatFormToggle)            Caster.SetAlpha(1)            Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",0)		    DVCelerityShadow.Play(Caster)                        Game.GetPlayer().SetAllowFlying()		    Game.ForceThirdPerson()            Utility.Wait(1.0)            SendAnimationEvent(PCVamp ,"JumpFall")   	 while !Caster.HasSpell(DVampireBatFormToggle)			    Fly()	    endWhile            ;bVal = True    elseif Caster.HasSpell(DVampireBatFormToggle)		    Caster.RemoveSpell(DVampireBatFormToggle)            Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35)            Caster.SetAlpha(1)            DVCelerityShadow.Stop(Caster)            Game.GetPlayer().SetAllowFlying()            Utility.Wait(1.0)            SendAnimationEvent(PCVamp ,"JumpFall")            ;bVal = False    endif        ;Toggle()    EndEventEvent OnUpdate()			  	    if Player.IsRunning() && move == 1   			    debug.notification("am i running")			    Fly()	    endIfendEventEvent OnTranslationComplete()	    move = 0	    Fly()endEventfunction Fly()	    if Player.IsRunning()			    posx = Player.GetPositionX()			    posy = Player.GetPositionY()			    posz = Player.GetPositionZ()			    bearing = Player.GetAngleZ()			    elevation = Player.GetAngleX()			    speed = 1000			    if bearing < 90					    posx += (bearing)*speed					    posy += (90 - bearing)*speed			    elseif bearing > 90 && bearing < 180					    posx +=(180 - bearing)*speed					    posy +=(90 - bearing)*speed			    elseif bearing > 180 && bearing < 270					    posx += (180 - bearing)*speed					    posy += (bearing - 270)*speed					    			    elseif bearing > 270					    posx += (bearing - 360)*speed					    posy += (bearing - 270)*speed					    			    endif			    posz = Player.GetPositionZ() - (elevation*speed)			    Player.PlayIdle(JumpFall)			    Player.TranslateTo(posx,posy,posz,Player.GetAngleX(),Player.GetAngleY(),Player.GetAngleZ(),speed,1)			    RegisterForSingleUpdate(0.2)			    if Player.IsSprinting()					    move = 0			    endIf			    else					    Player.StopTranslation()	    endIfendFunctionFunction Toggle()    if (bVal == True)        bIsOn = True    elseif (bVal == False)        bIsOn = False    endif    EndFunction
User avatar
RaeAnne
 
Posts: 3427
Joined: Sat Jun 24, 2006 6:40 pm

Post » Tue Jun 19, 2012 5:53 pm

debug.notification("am i running")


is this firing?
User avatar
kitten maciver
 
Posts: 3472
Joined: Fri Jun 30, 2006 2:36 pm

Post » Wed Jun 20, 2012 5:31 am

Also, I see that you are using the OnUpdate, which does make sense.... but you also have this part in the Effect Event:

while !Caster.HasSpell(DVampireBatFormToggle)
Fly()
endWhile
Do you need this loop too?
User avatar
Lisa
 
Posts: 3473
Joined: Thu Jul 13, 2006 3:57 am

Post » Wed Jun 20, 2012 12:04 am

I figured the loop was necessary since the spell is a toggle.

I guess you're right, now that I think of it since it is a toggle the Fly function should just simply end when the spell is cast again. I've removed the loop and just put 'Fly()' below the animation event.

I'll remove it and see what happens.

No, I didn't see "am i running" I didn't think it mattered though. I figured the original script writer added that in for his own purposes. I left it in since it should make no difference.


EDIT: Tested it. Still nothing. Script compiles. Don't get it :P Maybe because it is an extension of a magic effect the refernces should be Caster instead of Player? I don't know. I would think it doesn't matter.
User avatar
Marcus Jordan
 
Posts: 3474
Joined: Fri Jun 29, 2007 1:16 am

Post » Wed Jun 20, 2012 6:52 am

Translation also has weird issues...for long moves, it can actually move you in the wrong direction, and result in Rubberbanding behavior.
User avatar
Tanya
 
Posts: 3358
Joined: Fri Feb 16, 2007 6:01 am

Post » Tue Jun 19, 2012 7:30 pm

Maybe the function "IsRunning()" is broken, or just doesn't work on the player.

EDIT: In the OnEffectStart part of your script, you have this:

if !Caster.HasSpell(DVampireBatFormToggle)        Caster.AddSpell(DVampireBatFormToggle)    ;;;    while !Caster.HasSpell(DVampireBatFormToggle)        Fly()    endWhile    ;;;endif

So after you add the spell, that while loop would never run. You said you took out the loop, did you put in an if statement instead?
User avatar
Rach B
 
Posts: 3419
Joined: Thu Mar 08, 2007 11:30 am

Post » Wed Jun 20, 2012 8:07 am

I'm sure someone is already ahead of me on this but I had an idea: If you can swim in real time and traverse all three axises in water why can't you do it above water? Is there someway this could be accomplished?

I'm working on a flying form for my vampire mod. A Bat Form.

What I would like the power/spell to do is change the player race, add effects, adjust player speed and allowing hovering and/or flying.

I can do everything but the flying part.

Try this:
Scriptname Blah Extends ActiveMagicEffectEvent OnEffectStart(Actor akTarget, Actor akCaster)	  Debug.SendAnimationEvent(akTarget, "SwimStart")EndEventEvent OnEffectFinish(Actor akTarget, Actor akCaster)	  Debug.SendAnimationEvent(akTarget, "SwimStop")EndEvent

Of course this would need to be a spell though.

Edit: I can confirm this works!
User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am

Next

Return to V - Skyrim