Jump to content

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


hex_ratt

Recommended Posts

The race-swapping trick, as I understand, was also used by JoshNZ in his AP mod. The default features thing applies there, too, but there's *got* to be a way to keep that from happening. After all, when a PC turns into a vampire (a new race), they don't switch to default features.
Link to comment
Share on other sites

  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

Thats an excellent point now that you mention it, ill take a look on how they do the transformation, see if I can get something out of it, thanks a lot for the idea ! :D

Edit: got it to keep the facial traits but for some reason the hair resists xD

Edit2: Ok AlCiao deserves an award for the best feedback ever, got it working keeping all the character's traits, I just duplicated the Vamp race, removed the vampire traits, and used that as a base, in case anyone finds himself in a similar situation. Thanks a lot AlCiao, now I really have all I need to get this to work, the only thing left to do is to improve the custom animations.

Edited by porroone
Link to comment
Share on other sites

Ok, got it working!! the only issue now it wont be compatible with custom races, but if needed I could add compatibility, shouldnt be too hard.

This is how my code looks like now, I still need to add some animevents to it but its almost completed:

Scriptname __PlyFly extends activeMagicEffect

Armor property RingFF auto
Actor property Player auto
import utility
import form
import game
import debug
import ObjectReference
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
float bearing
float elevation
float speed
float posx
float posy
float posz
int i

Event OnEffectStart(Actor Player, Actor Caster)
Player = Game.GetPlayer()
DefaultRace = Player.GetRace()
CheckRace()
Utility.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()
sendAnimationEvent(Player,"idlePlayer")
if DirF.GetValueInt() == 1 || DirB.GetValueInt() == 1 || DirR.GetValueInt() == 1 || DirL.GetValueInt() == 1 
	sendAnimationEvent(Player,"moveStart")
	posx = Player.GetPositionX()
	posy = Player.GetPositionY()
	bearing = Player.GetAngleZ()
	elevation = Player.GetAngleX()
	posz = Player.GetPositionZ()
	if Player.IsSprinting()
		speed = 2000
	else
		speed = 1000
	endIf
	if DirF.GetValueInt() == 1
		posx += math.sin(bearing)*speed
		posy += math.cos(bearing)*speed
		posz -= math.sin(elevation)*speed
	elseif DirB.GetValueInt() == 1
		posx -= math.sin(bearing)*speed
		posy -= math.cos(bearing)*speed
		posz += math.sin(elevation)*speed
	elseif DirL.GetValueInt() == 1
		posx += math.sin(bearing - 90)*speed
		posy += math.cos(bearing - 90)*speed 
		posz -= math.sin(elevation)*speed
	elseif DirR.GetValueInt() == 1
		posx += math.sin(bearing + 90)*speed 
		posy += math.cos(bearing + 90)*speed
		posz -= math.sin(elevation)*speed
	endIf
	Player = Game.GetPlayer()
	Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
else
	
	Player.StopTranslation()
endIf
endFunction

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

Link to comment
Share on other sites

Ok, got it working!! the only issue now it wont be compatible with custom races, but if needed I could add compatibility, shouldnt be too hard.

This is how my code looks like now, I still need to add some animevents to it but its almost completed:

Scriptname __PlyFly extends activeMagicEffect

Armor property RingFF auto
Actor property Player auto
import utility
import form
import game
import debug
import ObjectReference
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
float bearing
float elevation
float speed
float posx
float posy
float posz
int i

Event OnEffectStart(Actor Player, Actor Caster)
Player = Game.GetPlayer()
DefaultRace = Player.GetRace()
CheckRace()
Utility.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()
sendAnimationEvent(Player,"idlePlayer")
if DirF.GetValueInt() == 1 || DirB.GetValueInt() == 1 || DirR.GetValueInt() == 1 || DirL.GetValueInt() == 1 
	sendAnimationEvent(Player,"moveStart")
	posx = Player.GetPositionX()
	posy = Player.GetPositionY()
	bearing = Player.GetAngleZ()
	elevation = Player.GetAngleX()
	posz = Player.GetPositionZ()
	if Player.IsSprinting()
		speed = 2000
	else
		speed = 1000
	endIf
	if DirF.GetValueInt() == 1
		posx += math.sin(bearing)*speed
		posy += math.cos(bearing)*speed
		posz -= math.sin(elevation)*speed
	elseif DirB.GetValueInt() == 1
		posx -= math.sin(bearing)*speed
		posy -= math.cos(bearing)*speed
		posz += math.sin(elevation)*speed
	elseif DirL.GetValueInt() == 1
		posx += math.sin(bearing - 90)*speed
		posy += math.cos(bearing - 90)*speed 
		posz -= math.sin(elevation)*speed
	elseif DirR.GetValueInt() == 1
		posx += math.sin(bearing + 90)*speed 
		posy += math.cos(bearing + 90)*speed
		posz -= math.sin(elevation)*speed
	endIf
	Player = Game.GetPlayer()
	Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
else
	
	Player.StopTranslation()
endIf
endFunction

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

 

So can we expect a release any time soon?

Link to comment
Share on other sites

Tomorrow I have to work all day, so ill take the laptop and in the free time I will finish up some animations and do a proper release, I was really hoping for a release of skse, which would make things easier, like in terms of installing, there is still the need to include the fInAirFallingCharGravityMult to the config, and of course the problem with collisions.
Link to comment
Share on other sites

Tomorrow I have to work all day, so ill take the laptop and in the free time I will finish up some animations and do a proper release, I was really hoping for a release of skse, which would make things easier, like in terms of installing, there is still the need to include the fInAirFallingCharGravityMult to the config, and of course the problem with collisions.

 

I'm looking forward to seeing what you'll come up with.

Link to comment
Share on other sites

Ok, got it working!! the only issue now it wont be compatible with custom races, but if needed I could add compatibility, shouldnt be too hard.

This is how my code looks like now, I still need to add some animevents to it but its almost completed:

Scriptname __PlyFly extends activeMagicEffect

Armor property RingFF auto
Actor property Player auto
import utility
import form
import game
import debug
import ObjectReference
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
float bearing
float elevation
float speed
float posx
float posy
float posz
int i

Event OnEffectStart(Actor Player, Actor Caster)
Player = Game.GetPlayer()
DefaultRace = Player.GetRace()
CheckRace()
Utility.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()
sendAnimationEvent(Player,"idlePlayer")
if DirF.GetValueInt() == 1 || DirB.GetValueInt() == 1 || DirR.GetValueInt() == 1 || DirL.GetValueInt() == 1 
	sendAnimationEvent(Player,"moveStart")
	posx = Player.GetPositionX()
	posy = Player.GetPositionY()
	bearing = Player.GetAngleZ()
	elevation = Player.GetAngleX()
	posz = Player.GetPositionZ()
	if Player.IsSprinting()
		speed = 2000
	else
		speed = 1000
	endIf
	if DirF.GetValueInt() == 1
		posx += math.sin(bearing)*speed
		posy += math.cos(bearing)*speed
		posz -= math.sin(elevation)*speed
	elseif DirB.GetValueInt() == 1
		posx -= math.sin(bearing)*speed
		posy -= math.cos(bearing)*speed
		posz += math.sin(elevation)*speed
	elseif DirL.GetValueInt() == 1
		posx += math.sin(bearing - 90)*speed
		posy += math.cos(bearing - 90)*speed 
		posz -= math.sin(elevation)*speed
	elseif DirR.GetValueInt() == 1
		posx += math.sin(bearing + 90)*speed 
		posy += math.cos(bearing + 90)*speed
		posz -= math.sin(elevation)*speed
	endIf
	Player = Game.GetPlayer()
	Player.TranslateTo(posx,posy,posz,bearing,0,elevation,speed,1)
else
	
	Player.StopTranslation()
endIf
endFunction

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

Awesome, have so many custom races I want to make able to fly, however, is there a way to make it so only those races can fly or set it as a race ability? I'm thinking set it as a power that can be mapped to the thuum slot. Would also be cool to make it require being in the air first, Say, you're running off a ledge, then take flight. I'm not a coder, so I don't know how difficult this could be to tack on, so if this is a "That will be simple enough" that's cool, but if it's a "How do you expect me to do that?" then feel free to ignore it.

Link to comment
Share on other sites

I just thought I'd note here. There's an "Ascend" animation that if someone could apply a little ragdoll to it could make for a decent type of flight anim. More like your flying through use of Power or Floating, rather then personal effort.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...