Jump to content

Proof that a player can fly in Skyrim well may be more like swimming


hex_ratt

Recommended Posts

Well I fixed most of the errors, you still get the T animation sometimes, when transition from animation to animation if rendering an area, i dont know if there is a fix for that, it doesnt do it with vanilla animations so I guess it must be outhere somewhere, anyway I just need to check a couple things and ill probably make an oficial release, in any case if I cannot fix the bugs, the people that come behind me might or at least point me out in the right direction.
Link to comment
Share on other sites

  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

Oh jeez, this is getting crazier and crazier by each second, here is my latest script, trying to create an animation graph from scripting and cordinating it with the movement...

Scriptname __PlyFly extends activeMagicEffect

Armor property RingFF auto
Actor property Player auto
import utility
import form
import game
import debug
import ObjectReference
import Math
perk property NoFallDmg auto
Action property JumpS auto
race DefaultRace
race[] property FlyableRace auto
race[] property NormalRace auto
GlobalVariable property DirF auto
GlobalVariable property DirB Auto
GlobalVariable property DirR auto
GlobalVariable property DirL Auto
idle property idleplayer auto
float bearing
float elevation
float speed
float posx
float posy
float posz
int i

Event OnEffectStart(Actor Player, Actor Caster)
Player = GetPlayer()
DefaultRace = Player.GetRace()
CheckRace()
SetIniFloat("fInAirFallingCharGravityMult:Havok",0)
if Player.IsEquipped(RingFF)
	while Player.IsEquipped(RingFF)
		Fly()
	endWhile
endIf
endEvent

function CheckRace()
While i < 9
	if DefaultRace == NormalRace[i]
		Player.SetRace(FlyableRace[i])
	endif
	i += 1
endWhile
endFunction

function Fly()

	posx = Player.GetPositionX()
	posy = Player.GetPositionY()
	bearing = Player.GetAngleZ()
	elevation = Player.GetAngleX()
	posz = Player.GetPositionZ()
	if Player.IsSprinting() && DirF.GetValueInt() == 1
		speed = 3000
		sendAnimationEvent(Player,"SprintStart")
		posx += sin(bearing)*speed
		posy += cos(bearing)*speed
		posz -= sin(elevation)*speed
		Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
	else
		speed = 1000
		sendAnimationEvent(Player,"sprintStop")
		
	endIf
	if DirF.GetValueInt() == 1 && DirB.GetValueInt() == 0 && DirL.GetValueInt() == 0 && DirR.GetValueInt() == 0
		sendAnimationEvent(Player,"blendMoveStop")
		
		posx += sin(bearing)*speed
		posy += cos(bearing)*speed
		posz -= sin(elevation)*speed
		Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
	endif
	if DirF.GetValueInt() == 0 && DirB.GetValueInt() == 1 && DirL.GetValueInt() == 0 && DirR.GetValueInt() == 0
		sendAnimationEvent(Player,"moveStart")
		speed = 600
		posx -= sin(bearing)*speed
		posy -= cos(bearing)*speed
		posz += sin(elevation)*speed
		Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
	endif
	if DirF.GetValueInt() == 0 && DirB.GetValueInt() == 0 && DirL.GetValueInt() == 1 && DirR.GetValueInt() == 0
		sendAnimationEvent(Player,"moveStart")
		speed = 600
		posx += sin(bearing - 90)*speed
		posy += cos(bearing - 90)*speed 
		posz -= sin(elevation)*speed
		Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
	endif
	if DirF.GetValueInt() == 0 && DirB.GetValueInt() == 0 && DirL.GetValueInt() == 0 && DirR.GetValueInt() == 1
		sendAnimationEvent(Player,"moveStart")
		speed = 600
		posx += sin(bearing + 90)*speed 
		posy += cos(bearing + 90)*speed
		posz -= sin(elevation)*speed
		Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
	endif
	if DirF.GetValueInt() == 0 && DirB.GetValueInt() == 0 && DirL.GetValueInt() == 0 && DirR.GetValueInt() == 0 && !Player.IsSprinting()
		if Speed > 0
			debug.Notification(Speed)
			Speed -= 1
			Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
			if Player.IsRunning()
				sendAnimationEvent(Player,"moveStart")
			elseif Player.IsSprinting()
				sendAnimationEvent(Player,"sprintStart")
			endIf
		else
			Player.StopTranslation()
			sendAnimationEvent(Player,"moveStop")
			sendAnimationEvent(Player,"IdlePlayer")
			Speed = 0
		endIf
	endIf
	
endFunction

Event OnEffectFinish(Actor Player, Actor Caster)
Player.StopTranslation()
SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35)
Player.SetRace(DefaultRace)
endEvent

 

I really need skse lol.

Edited by porroone
Link to comment
Share on other sites

Great work man! You did it, must be a great feeling to have pulled it through andnow be rewarded with such a success. Would be great if you add a version with the alduin wings. Great work on the anims as well. Kudos to you bro

 

 

I personally hope that there will be some way to make the game calculate a bigger distance somehow. Bringing the only small tear to my eye to see how above average speed kills the game emmersion...

Link to comment
Share on other sites

Great work man! You did it, must be a great feeling to have pulled it through andnow be rewarded with such a success. Would be great if you add a version with the alduin wings. Great work on the anims as well. Kudos to you bro

 

 

I personally hope that there will be some way to make the game calculate a bigger distance somehow. Bringing the only small tear to my eye to see how above average speed kills the game emmersion...

Thanks a lot for your continuous support from day 1 hehe, about making the game calculate bigger distances... it is possible to do raising the uGridsToLoad to 7,9 or if you have a hell of a computer to 11, buf I found out that raising the ugrids increase the chance of the T animations, render issues I really dont understand.

Link to comment
Share on other sites

  • 2 weeks later...

Good to have something, right now I am stuck on one more of those nasty quests with an objective on the other side of that mountain over there. I spend a lot of time trying just to reach things, hopefully this should be a quick and dirty way to fix that.

 

However in Morrowind I loved the dwemer skyglider, precisely because it was unwieldy and hard to master. Apparently that one didn't use actual flying but more like super jumps. In any case I rather equip a ring then transform into a dragon if I cannot have flying machine.

Link to comment
Share on other sites

  • 3 weeks later...

Hello folks, long time no see. I thought I would share my latest script with you, its working with idle events now and skse, I even added combat:

Scriptname __PlyFly extends activeMagicEffect

Armor property RingFF auto
Armor property IceRingFF auto
Armor property FireRingFF auto
Armor property ShockRingFF auto

Actor property Player auto

import utility
import form
import game
import debug
import ObjectReference
import Math
import input
import CombatStyle
import spell

int property Forward = 0x11 auto
int property Back = 0x1F auto
int property Left = 0x1E auto
int property Right = 0x20 auto
int property Up = 0x39 auto
int property Down = 0x1D auto
int property slow = 0x2A auto
int property fast = 0x38 auto
int property keepit = 0x2E auto
int property attackswitch = 0x13 auto
int property attackleft = 0x100 auto
int property attackright = 0x101 auto
int property combatstart = 0x2C auto
int property keepmoving = 0x2E auto

spell righthand
spell lefthand
spell property explodePlayer auto

int isfwdanim
int sprintanimc
int backanimc
int leftanimc
int rightanimc
int keepgoing
int attackaniml
int attackanimr
int attackmode
float ringmagicka
float ringhealth
float ringstamina
float damage

perk property NoFallDmg auto

float bearing
float elevation
float speed
float posx
float posy
float posz

bool flyup
bool flydown
bool idleplay
bool combatplay
bool removeperknow

Event OnEffectStart(Actor Player, Actor Caster)
Player = GetPlayer()
Player.AddPerk(NoFallDmg)
SetIniFloat("fInAirFallingCharGravityMult:Havok",0)
EnablePlayerControls()
ringmagicka = Player.GetAV("Magicka")
ringhealth = Player.GetAv("health")
if Player.IsEquipped(RingFF) || Player.IsEquipped(FireRingFF) || Player.IsEquipped(IceRingFF) || Player.IsEquipped(ShockRingFF)
	while Player.IsEquipped(RingFF) || Player.IsEquipped(FireRingFF) || Player.IsEquipped(IceRingFF) || Player.IsEquipped(ShockRingFF)
		Fly()
	endWhile
endIf
endEvent

function Fly()
if IsKeyPressed(Keepit)
	Keepgoing += 1
	if Keepgoing > 1
		Keepgoing = 0
		ReleaseKey(keepgoing)
	endIf
endIF
if IsKeyPressed(Forward) || IsKeyPressed(Fast) || IsKeyPressed(Back) || IsKeyPressed(Left) || IsKeyPressed(Right) || IsKeyPressed(Up)  || IsKeyPressed(Down) || IsKeyPressed(KeepIt) || keepGoing == 1
	ToggleAnimAndMove()
else
	Player.StopTranslation()
	ReleaseKey(keepgoing)
endIf
if IsKeyPressed(attackleft) || IsKeyPressed(attackright) && attackmode == 1
	Combat()
else
	attackaniml = 0
	attackanimr = 0
	Player.InterruptCast()
endIf
if !IsKeyPressed(Right) && !IsKeyPressed(Forward) && !IsKeyPressed(Left) && !IsKeyPressed(Back) && !IsKeyPressed(Up) && !IsKeyPressed(Down) && !Keepgoing && !IsKeyPressed(attackleft) && !IsKeyPressed(attackright)
	if IsKeyPressed(attackswitch)
		attackmode += 1
		if attackmode > 1
			attackmode = 0
		endIf
	endIf
	if attackmode == 1 
		holdKey(combatstart)
		if combatplay == false
			sendAnimationEvent(Player, "zFNISc100")
			idleplay = false
			combatplay = true
		endif
	endif
	if attackmode == 0
		if idleplay == false
			releaseKey(combatstart)
			sendAnimationEvent(Player, "zFNISc090")
			combatplay = false
			idleplay = true
		endif
	endif
	isfwdanim = 0
	sprintanimc = 0
	backanimc = 0
	leftanimc = 0
	rightanimc = 0
	flyup = false
	flydown = false
	Player.StopTranslation()
	Speed = 0
else
	idleplay = false
	combatplay = false
endIf
endFunction

function Combat()

if IsKeyPressed(attackleft) && attackmode == 1 && Player.GetAV("Magicka") > 10
	lefthand = Player.GetEquippedSpell(0)
	lefthand.Cast(Player)
	Notification(lefthand.GetCostliestEffectIndex())

	Player.DamageActorValue("Magicka",ringmagicka/75)
	if attackaniml == 0
		sendAnimationEvent(Player,"zFNISc098")
		attackaniml = 1
	endIf
endIf
if IsKeyPressed(attackright)  && attackmode == 1 && Player.GetEquippedSpell(0) && Player.GetEquippedSpell(1) && Player.GetAv("Magicka") > 10
	righthand = Player.GetEquippedSpell(1)
	righthand.Cast(Player)
	lefthand = Player.GetEquippedSpell(0)
	lefthand.Cast(Player)

	Player.DamageActorValue("Magicka",ringmagicka/45)
	if attackanimr == 0
		sendAnimationEvent(Player,"zFNISc099")
		attackanimr = 1
		attackaniml = 0
	endIf
endIf
if Player.GetAV("Magicka") < 10
	DestroyRing()
endIf

endFunction

Function ToggleAnimAndMove()
posx = Player.GetPositionX()
posy = Player.GetPositionY()
bearing = Player.GetAngleZ()
elevation = Player.GetAngleX()
posz = Player.GetPositionZ()

if IsKeyPressed(Forward) || Keepgoing == 1
	if Keepgoing == 1
		HoldKey(keepmoving)
	endIF
	If IsKeyPressed(slow) 
		speed = 400
	elseif isfwdanim == 0 && !IsKeyPressed(attackright) && !IsKeyPressed(attackleft) && !IsKeyPressed(Fast) && !IsKeyPressed(Back) && !IsKeyPressed(Left) && !IsKeyPressed(Right) && !IsKeyPressed(Up)  && !IsKeyPressed(Down)
		sendAnimationEvent(Player,"zFNISc092") 
		speed = 1000
		sprintanimc = 0
		isfwdanim = 1
	elseif sprintanimc == 0 && !IsKeyPressed(attackright) && !IsKeyPressed(attackleft) && IsKeyPressed(Fast) && !IsKeyPressed(Back) && !IsKeyPressed(Left) && !IsKeyPressed(Right) && !IsKeyPressed(Up)  && !IsKeyPressed(Down)
		sendAnimationEvent(Player,"zFNISc095")
		speed = 2000
		isfwdanim = 0
		sprintanimc = 1
	elseif IsKeyPressed(attackright) || IsKeyPressed(attackleft)
		speed = 1000
	endif
	posx += sin(bearing)*speed
	posy += cos(bearing)*speed
	posz -= sin(elevation)*speed
else
	isfwdanim = 0
	sprintanimc = 0
endif
if IsKeyPressed(Back)
	If IsKeyPressed(slow) 
		speed = 200
	elseif backanimc == 0 && !IsKeyPressed(attackright) && !IsKeyPressed(attackleft) && !IsKeyPressed(Forward) && !IsKeyPressed(Left) && !IsKeyPressed(Right) && !IsKeyPressed(Up) && !IsKeyPressed(Down)
		sendAnimationEvent(Player,"zFNISc091")
		speed = 600
		backanimc = 1
	elseif IsKeyPressed(attackright) || IsKeyPressed(attackleft)
		speed = 600
	endif
	posx -= sin(bearing)*speed
	posy -= cos(bearing)*speed
	posz += sin(elevation)*speed
else
	backanimc = 0
endif
if IsKeyPressed(Left) 
	If IsKeyPressed(slow) 
		speed = 200
	elseif leftanimc == 0 && !IsKeyPressed(attackright) && !IsKeyPressed(attackleft) && !IsKeyPressed(Forward) && !IsKeyPressed(Back) && !IsKeyPressed(Right) && !IsKeyPressed(Up) && !IsKeyPressed(Down)
		sendAnimationEvent(Player,"zFNISc093")
		leftanimc = 1
		speed = 600
	elseif IsKeyPressed(attackright) || IsKeyPressed(attackleft)
		speed = 600
	endif
	posx += sin(bearing - 90)*speed
	posy += cos(bearing - 90)*speed 
	posz -= sin(elevation)*speed
else
	leftanimc = 0
endif
if IsKeyPressed(Right) 
	If IsKeyPressed(slow) 
		speed = 200
	elseif rightanimc == 0 && !IsKeyPressed(attackright) && !IsKeyPressed(attackleft) && !IsKeyPressed(Forward) && !IsKeyPressed(Left) && !IsKeyPressed(Back) && !IsKeyPressed(Up) && !IsKeyPressed(Down)
		sendAnimationEvent(Player,"zFNISc094")
		rightanimc = 1
		speed = 600
	elseif IsKeyPressed(attackright) || IsKeyPressed(attackleft)
		speed = 600
	endif
	posx += sin(bearing + 90)*speed 
	posy += cos(bearing + 90)*speed
	posz -= sin(elevation)*speed
else
	rightanimc = 0
endif
if IsKeyPressed(Up) 
	if flyup == false && !IsKeyPressed(attackright) && !IsKeyPressed(attackleft) && !IsKeyPressed(Right) && !IsKeyPressed(Forward) && !IsKeyPressed(Left) && !IsKeyPressed(Back) && !IsKeyPressed(Down)
		sendAnimationEvent(Player,"zFNISc096")
		flyup = true
	endIf
	If IsKeyPressed(slow)
		speed = 600
	else
		speed = 1000
	endif
	posz += speed
else
	flyup = false
endif
if IsKeyPressed(Down)
	if flydown == false && !IsKeyPressed(attackright) && !IsKeyPressed(attackleft)  && !IsKeyPressed(Up) && !IsKeyPressed(Right) && !IsKeyPressed(Forward) && !IsKeyPressed(Left) && !IsKeyPressed(Back)
		sendAnimationEvent(Player,"zFNISc097")
		flydown = true
	endIf
	If IsKeyPressed(slow)
		speed = 600
	else
		speed = 1000
	endif
	posz -= speed
	
else
	flydown = false
endif
Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
endFunction

Function DestroyRing()
Debug.Notification("The ring explodes consumed by flames.")
Player.DamageActorValue("Health",ringhealth/2)
removePerkNow = true
ReleaseKey(combatstart)
explodePlayer.Cast(Player)
Player.StopTranslation()
if Player.IsEquipped(RingFF)
	Player.RemoveItem(RingFF)
EndIf
if Player.IsEquipped(FireRingFF)
	Player.RemoveItem(FireRingFF)
EndIf
if Player.IsEquipped(IceRingFF)
	Player.RemoveItem(IceRingFF)
EndIf
if Player.IsEquipped(ShockRingFF)
	Player.RemoveItem(ShockRingFF)
endIf
endFunction

Event OnEffectFinish(Actor Player, Actor Caster)
Player.StopTranslation()
SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35)
ReleaseKey(CombatStart)
sendAnimationEvent(Player,"moveStop")
if removeperknow == false
	RemoveFallPerk()
Else
	Player.RemovePerk(NoFallDmg)
endIf
endEvent

Function RemoveFallPerk()
Debug.Notification("You have 5 seconds of no falling damage.")
Wait(5)
Player.RemovePerk(NoFallDmg)
endFunction

 

And here is a video of what all this bunch of code does lol:

 

http://www.youtube.com/watch?v=qGnu8vs9v-s

Link to comment
Share on other sites

Haha, I was just about the revive this thread. Looking real good there poronne! Am I seeing new custom animations there?

 

 

This might be a little out of context, but I think you guys should mess a little with itensivying the distant fog a little as well. I mean looking at the distant LOD clipping isn'treally much of a joy. Maybe there would also be a way to use the Blur effect that Dynavision uses during flight.

 

 

 

Anyway, I just ran across this post on the official forums:

 

Has anyone else stumbled upon this? If you install the 1.6 beta patch and do a saveini console command (which forces the game to create an .ini file with ALL the configurable settings), some VERY interesting settings pop up:

 

[general]

fPlayerFlyingMountBaseTargetSpeed=700.0000

 

[Verlet]

bUseConstantStepDelta=1

bUseRotationBasedTransformUpdate=1

uiNumIter=50

fGravity=-1500.0000

uCapeClothNumPin=12

fVerticalCapsuleOffset=50.0000

 

Does this mean that FLYING DRAGON MOUNTS (!!!) and verlet integration (think flails and morningstars, capes, 'bendable' trees, flabby giants) are confirmed? I think so. Any .ini setting means that the game already has relevant code regarding them... all we need is the Dawnguard DLC to actually add the content.

 

For those skeptical about it: the law of conservation applies. Why would Bethesda deliberately add stuff to the game (that's pretty much inaccessible right now) that's nearly undiscoverable... if not for Dawnguard? It's not uncommon to 'prep' the game code before a DLC comes. Remember that the Construction Kit got broken with patch 1.6 due to new subrecords and headers added to base game files.

 

Also, remember that we already have the following things from the GameJam:

1. Ranged killcams

2. Enhanced underwater effects

3. Kinect support

4. Mounted combat.

 

This is a very promising find IMO. This means that we could see even MORE of the gamejam goodies in upcoming patches and DLC.

 

Source

 

Could this be of any use for you guys?

Link to comment
Share on other sites

it looks like dawnguard will have good flying/wing animations. I sure would love a mod that allowed dragon wings to pop out of my back at a whim so I could take to the sky and fight a dragon mid air ^.^
Link to comment
Share on other sites

Yes it could definetly be of use. I havent downloaded the latest beta but I am pretty sure to allow mounted combat they had to unlock the x-axis of mounts. Still there is the issue of playing the animations you want without the game crashing.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...