Jump to content

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


hex_ratt

Recommended Posts

oh and heres my "junk" code, dont say i did not warn you :P

 

Scriptname TranslateTest extends activemagiceffect Conditional

import Utility
import form
import game
import debug

event OnEffectStart(Actor Target, Actor Caster)

While(Caster.IsEquipped(FlyRing))
if (Caster.GetRace() != DragonRacePlayer)
Caster.setrace(DragonRacePlayer)
endif

int Value = FlyTest.GetValueInt()
ObjectReference CasterT = GetPlayer()

if  (Value == 0)
	ForceFirstPerson()
	FlyTest.SetValue(1)
	Wait(2)
endif

if (Value == 1)
ForceThirdPerson()
endif

SendAnimationEvent(CasterT ,"FlyStartHover")

float pX = Caster.GetPositionX()
float pY = Caster.GetPositionY()	
float pZ = Caster.GetPositionZ()
float aX = Caster.GetAngleX()
float aY = Caster.GetAngleY()	
float aZ = Caster.GetAngleZ()
float i = pz -(500)
float ci = pz + (500)

if (ax <= 0 ) ;&& Caster.HasMagicEffect(Fly)
Caster.TranslateTo(px,py,i,ax,ay,az,1000,1000)
;messagebox("<0")
Wait(1)

endif

if (ax >= 0) ; && Caster.HasMagicEffect(Fly)

Caster.TranslateTo(px,py,ci,ax,ay,az,1000,1000)
;messagebox(">0")
Wait(1)

endif
endwhile



EndEvent

event OnEffectFinish(Actor Target, Actor Caster)
Flytest.SetValue(0)
endevent
; Event onEffectFinish(Actor Target, Actor Caster )
; While(TRUE)

; endwhile
; Endevent



ObjectReference property Spawner auto
ObjectReference property PlayerRef auto
MagicEffect Property Fly auto
Idle Property FlyStartHover auto
Race Property DragonRacePlayer auto
Idle Property SwimStop auto 
int Property MoveType auto Conditional 
Idle Property CharacterMoveStart auto
Armor Property FlyRing auto 
GlobalVariable Property FlyTest auto
Int Property NewProperty  Auto  Conditional

Edited by DarkenDe
Link to comment
Share on other sites

  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

yeah the getkeypress command is really something bethesda could have added in the firstplace, or something to detect Xbox360 Controller keys (i play with one)

but lets hope that the SKSE team will come up with something we can use :P

Edited by DarkenDe
Link to comment
Share on other sites

Do you gentlemen think this could be translated to climbing applications? I'm not exactly programming oriented and the scripts make no sense to me, but what I would ask is could this be modified to move only upwards if the sprint key is pressed and the player is walking forwards, but not moving? (Assusming that your not moving means you're walking into a wall.)

 

Animations do not matter whatsoever.

Edited by Ashven
Link to comment
Share on other sites

(code)

 

That concept does look solid. However, I still think we get a OnKeyPressed function to enable state changing, unless someone can come up with a creative hack alternative. Not thinking of anything right now as far as this problem is concerned.

 

If we do manage to find an OnKeyPressed substitute, instead of making separate while loops, I would probably prefer summing up the key inputs and finding the result incidence angle, instead of having the angle controls be binary. I.e, if the player presses both the up and right arrows, the angle of incidence would be 45 degrees in the XY plane (assuming you define the horizontal and vertical speeds to be the same). Since we have real math functions now, I hope that will be somewhat easier than in Oblivion. This approach would probably lead to a much finer granularity approach and generally better results. Blending havok animations is another story entirely, and I don't really want to touch that right now.

Edited by jimhsu
Link to comment
Share on other sites

Do you gentlemen think this could be translated to climbing applications? I'm not exactly programming oriented and the scripts make no sense to me, but what I would ask is could this be modified to move only upwards if the sprint key is pressed and the player is walking forwards, but not moving? (Assusming that your not moving means you're walking into a wall.)

 

Animations do not matter whatsoever.

 

Yea that could be done easy using the translate function, but we need more functions, for example in order to climb you would need to detect if there is an object in front of the player and what kind of object it is ( we dont want it climbing players! (or maybe we do) ), then a way to mesure the object, so the it knows when stop climbing, in most object base scripting languages I worked with, had those functions, and this game does aswell they just didnt include them in papyrus.

Link to comment
Share on other sites

I agree, what i now tried is the basic fo3 and Oblivion options (Placing Collision under your feet, or placing Water etc)

 

But it does not really work, the moveto command is really resource consuming with the way i did this, but i found another neat option that i used in my progress mod seen in the video below, it is an ini setting called "fInAirFallingCharGravityMult" setting this to 0 under the [Havok] settings (the option needs to be added first) lets the player float in their current position, the default value is 1.35, and this is what i came up with using the SetIniFloat command in a script.

 

 

EDIT: Its a little bit bugged for the moment and only for testing until a GetKeyPress option will be available.

Edited by DarkenDe
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...