Jump to content

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


hex_ratt

Recommended Posts

Wow that looks very promising, so If I understand it correctly basically what you did is changing the gravity on the player when the ring is equipped, then use that to hover up, take off the ring and thats the part that I dont get, how does it slowly falls down ? shouldnt you fall instantly to the ground when you take off the ring ?

Im going to mess with that stuff right noww hehe thanks a lot.

Edit: After reading it properly I see it sets the gravity mul, that explains why it does fall slowly, one thing tho where did u find that setting ?

Edited by porroone
Link to comment
Share on other sites

  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

Well after that bit of code (removing gravity) my ring works perfect now I might even make an official release, I just need to find a better animation, the one im using right now its kind of glitchy.

Edit: here is the code im currently using, this one works perfect.

Scriptname __PlyFly extends ObjectReference

Idle property JumpFall auto
Armor property DuneFlyingRing auto
Actor property Player auto
import utility
import form
import game
import debug
import actor
float bearing
float elevation
float speed
float posx
float posy
float posz
float move
float dtime

Event OnEquipped(Actor Player)
Debug.MessageBox("motherf***er")
Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",0)
while Player.IsEquipped(DuneFlyingRing)
	Fly()
endWhile
endEvent

Event OnUpdate()              
if Player.IsRunning() && move == 1   
	debug.notification("am i running")
	Fly()
endIf
endEvent
Event OnTranslationComplete()
move = 0
Fly()
endEvent

function 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()
endIf
endFunction


Event OnUnequipped(Actor Player)
Player.StopTranslation()
Debug.MessageBox("unequipped")
Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35)
endEvent	

Edited by porroone
Link to comment
Share on other sites

I found the Setting inside the TESV.exe with a Hex Editor. But one question about your new script, the Actor Property Player, you do set it to PlayerRef right? Because nothing happens when attaching the script to the ring or another armor.
Link to comment
Share on other sites

Yea I do use PlayerRef, maybe you need to define the Armor property aswell, I always do it in case, but I think that attaching the script to the ring should call the OnEquipped event when the player equips the ring, in any case use a Debug.MessageBox to see if its triggering it.
Link to comment
Share on other sites

Ok after what you said I did some debugging and turns out you are right, the script needs to be attached to the actor instead of the ring, which kind of sucks, anyway around it ?

Edit: ok this is driving me nuts, I cant get it working now.

Edited by porroone
Link to comment
Share on other sites

What if you add a player race modifier to dragon race and change the jumpfall to the dragon hover animation?

I've only done very, very light scripting so not sure how to implement it.

Would be a way to get dragon transorfmations work, albeit the camera would have to be fixed as well as the fact that you can only fly.

Link to comment
Share on other sites

Well for some reason I cant get it working now, I made a standalone mod (My original ring was inside a custom mod I had) and it just doesnt work, god knows why.

 

I assume you checked your properties? Other than that, try a Use Info on your original ring, activators, etc.

Link to comment
Share on other sites

Well after doing some debugging I know exactly whats wrong, basically it doesnt get the ring, thats why the IsEquipped function doesnt run anything, funny thing adding a 2nd script that returns the ring works, so I think ill stick to that.

Edit: Well I just have no idea on how to call the damn ring inside the script if the script is inside the ring, tried adding the armor as "Armor property FlightRing auto" then went to properties, look for the damn ring there, ok, save, I have a debug.MessageBox that shows me the name of the item and it returns None, if I try with "self" which usually returns the object is running the script it returns something like name of the script + inContainer or something like that, but still the IsEquipped function doesnt recognaise it as valid, so the only way I see to do this is adding the script to the player, its the only way this can work.

Edit2: Anyway the actor thing works but I cant seem to play the animations and I dont know why, here is the new working code, needs to be added to Player:

Scriptname __PlyFly extends Actor

Idle property flyAnim auto
Armor property RingFF auto
Actor property Player auto
import utility
import form
import game
import debug
import ObjectReference

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


Event OnObjectEquipped(Form RingFF, ObjectReference akObjectReference)
Player = Game.GetPlayer()
if Player.IsEquipped(RingFF)
	Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",0)
	while Player.IsEquipped(RingFF)
		Fly()
	endWhile
endIf
endEvent


function Fly()

if Player.IsRunning()
	posx = Player.GetPositionX()
	posy = Player.GetPositionY()
	posz = Player.GetPositionZ()
	bearing = Player.GetAngleZ()
	elevation = Player.GetAngleX()
	if Player.IsSprinting()
		speed = 5000
	else
		speed = 1000
	endIf
	

	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*2))
	PlayIdle(flyAnim)
	Player.TranslateTo(posx,posy,posz,Player.GetAngleX(),Player.GetAngleY(),Player.GetAngleZ(),speed,1)
	
else
	Player.StopTranslation()
endIf

endFunction


Event OnObjectUnequipped(Form RingFF, ObjectReference akObjectReference)
Player.StopTranslation()
Utility.SetIniFloat("fInAirFallingCharGravityMult:Havok",1.35)
endEvent

Edited by porroone
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...