Moving player up into the air

Post » Tue Jun 19, 2012 6:25 pm

Translating the player is weird...if you only translate the character once, it seems to work...but if you try it a second time, the character will often "snap back" to where the first translation started. And turning on keyframed motion doesn't work - tried it, and I still fall after each translation (and because the translations are of varying lengths at varying speeds, calculating where one ends to begin the next probably is never going to work. I can't catch the OnTranslationFinished very easily either.

And the Autodeath on falling thing is just dumb...I literally gave myself +50,000 health, and I still can die from falling around 20 feet.
User avatar
natalie mccormick
 
Posts: 3415
Joined: Fri Aug 18, 2006 8:36 am

Post » Wed Jun 20, 2012 1:00 am

Redwood, can you use the OnTranslationFailed() event to see if it gets called after your second translation?
This could indicate that it got another translation request. From where I have no idea, but it could be causing the anp back.
User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am

Post » Tue Jun 19, 2012 9:34 pm

And the Autodeath on falling thing is just dumb...I literally gave myself +50,000 health, and I still can die from falling around 20 feet.
Agreed. I just don't get this :S
I hope there is a way to work around it.
User avatar
Marilú
 
Posts: 3449
Joined: Sat Oct 07, 2006 7:17 am

Post » Tue Jun 19, 2012 9:32 pm

Translating the player is weird...if you only translate the character once, it seems to work...but if you try it a second time, the character will often "snap back" to where the first translation started. And turning on keyframed motion doesn't work - tried it, and I still fall after each translation (and because the translations are of varying lengths at varying speeds, calculating where one ends to begin the next probably is never going to work. I can't catch the OnTranslationFinished very easily either. And the Autodeath on falling thing is just dumb...I literally gave myself +50,000 health, and I still can die from falling around 20 feet.

Use Godmode...That seems to work lol.

I have been fooling around with it a bit. At first I have tried to match your script, but having so many activators made my head spin around, so I have just created a Self Spell using yours as a base that moves the player around...

I haven't been able to arrive at the desired place...lol, but at least I am getting multiple translations.


Spoiler
scriptName ShanaCannon2MEffectScript extends ActiveMagicEffect{Scripted magic effect for CANNON.}import utility	; For Random Float ?;======;  PROPERTIES  / =============/Activator Property ShanaCannonGoalActivator  Auto;======;  VARIABLES  / =============/ObjectReference MoveWhat 		; TargetObjectReference CannonTarget 	; Cannon Target; Middle Coordenates, Flying Speed and Distance to Goal; Angles do not seem to do anythingFloat DXFloat DYFloat DZFloat NewAngleXFloat NewAngleYFloat NewAngleZFloat FlySpeed ; How fast to move.Float GoalDistance;================;   EVENTS	 /=============/Event OnEffectStart(Actor Target, Actor Caster)	Debug.Trace("	OnEffectStart ")	; Sets Stuff		MoveWhat = Target	CannonTarget = MoveWhat.PlaceAtMe(ShanaCannonGoalActivator,1)	CannonTarget.MoveTo(MoveWhat, MoveWhat.X + 1000.0, MoveWhat.Y + 1000.0, 0.0,false)				GoalDistance = MoveWhat.GetDistance( CannonTarget )	Debug.Trace("		Initial Distance between Player and Goal: " + GoalDistance )		ComputeNextTranslationData()	FlySpeed = FlySpeed * 10 	; Let's go faster first time	MoveWhat.TranslateTo( DX  , DY , DZ , NewAngleX, NewAngleY, NewAngleZ, FlySpeed , 20.0)	RegisterForUpdate(1) ; Since we can't catch the OnTranslationComplete, have to guess.		Debug.Notification(" You should be turning God mode on by now...")EndEventEvent OnUpdate() ; Start moving the player with translates	GoalDistance = MoveWhat.GetDistance( CannonTarget )	Debug.Trace("		FlySpeed: " + FlySpeed + " Distance between Player and Goal: " + GoalDistance )		if GoalDistance < 200.0 ; At the destination case.		Debug.Trace(" We are there! ") ; No way I am getting here...		EndThisThing()		UnRegisterForUpdate()	endifEndEventEvent OnTranslationAlmostComplete()	GoalDistance = MoveWhat.GetDistance( CannonTarget )	Debug.Trace("	Translation Almost Complete ! Distance : " + GoalDistance )	ComputeNextTranslationData()	MoveWhat.TranslateTo( DX  , DY , DZ , NewAngleX, NewAngleY, NewAngleZ, FlySpeed , 100.0)EndEventEvent OnEffectFinish(Actor Target, Actor Caster)	Debug.Trace("	OnEffectFinish")	EndThisThing()EndEventFunction EndThisThing()	if CannonTarget		CannonTarget.Disable()		CannonTarget.Delete()	endif	Debug.Notification("Doooooooooooown!")	wait(2)	MoveWhat.StopTranslation()EndFunctionFunction ComputeNextTranslationData()	DX = ( (CannonTarget.X - MoveWhat.x) / 2.0 ) + RandomFloat(-200.0,200.0)	DY = ( (CannonTarget.Y - MoveWhat.y) / 2.0 ) + RandomFloat(-200.0,200.0)	DZ = (CannonTarget.Z - MoveWhat.z) / 2.0 + ( GoalDistance / 1000 )	NewAngleX = MoveWhat.GetAngleX() + RandomFloat(-360.0,360.0)	NewAngleY = MoveWhat.GetAngleY() + RandomFloat(-360.0,360.0)	NewAngleZ = MoveWhat.GetAngleZ() + RandomFloat(-360.0,360.0) ; Tumble at random	FlySpeed = MoveWhat.GetDistance( CannonTarget ) / 20.0EndFunction; We never get these events...Event OnTranslationComplete()	Debug.Trace("	Translation Complete") ; can't get this to fire by using translations of cannon object - it doesn't translate. Ever.EndEventEvent OnTranslationFailed()	Debug.Trace("	Translation Failed")EndEvent

I have added a randomFloat to the Next Translation Point so it moves me a bit, also the spell is a 15 seconds one so it has time to move me around a bit.

I guess I must be doing something very wrong because the distances are quite big... In my case, unless I call StopTranslation I keep floating in the air...

Also I've moved the TranslateTo to the OnTranslationAlmostComplete Event, but before it was in the OnUpdate one and was working too.

You can see how it enters in the AlmostComplete event in the log here :
Spoiler

[03/07/2012 - 12:19:45PM] OnEffectStart
[03/07/2012 - 12:19:45PM] Initial Distance between Player and Goal: 19437.437500
[03/07/2012 - 12:19:47PM] Translation Almost Complete ! Distance : 28673.527344
[03/07/2012 - 12:19:47PM] FlySpeed: 9718.718750 Distance between Player and Goal: 28741.095703
[03/07/2012 - 12:19:48PM] FlySpeed: 1437.160400 Distance between Player and Goal: 27994.492188
[03/07/2012 - 12:19:50PM] FlySpeed: 1437.160400 Distance between Player and Goal: 26590.257813
[03/07/2012 - 12:19:51PM] FlySpeed: 1437.160400 Distance between Player and Goal: 25213.882813
[03/07/2012 - 12:19:52PM] Translation Almost Complete ! Distance : 24251.683594
[03/07/2012 - 12:19:52PM] FlySpeed: 1208.288452 Distance between Player and Goal: 24177.503906
[03/07/2012 - 12:19:53PM] FlySpeed: 1208.288452 Distance between Player and Goal: 25243.306641
[03/07/2012 - 12:19:54PM] Translation Almost Complete ! Distance : 26213.066406
[03/07/2012 - 12:19:54PM] FlySpeed: 1208.288452 Distance between Player and Goal: 26244.794922
[03/07/2012 - 12:19:55PM] FlySpeed: 1312.085205 Distance between Player and Goal: 25484.130859
[03/07/2012 - 12:19:55PM] Translation Almost Complete ! Distance : 25433.904297
[03/07/2012 - 12:19:56PM] FlySpeed: 1271.424561 Distance between Player and Goal: 25587.326172
[03/07/2012 - 12:19:56PM] Translation Almost Complete ! Distance : 25616.785156
[03/07/2012 - 12:19:57PM] Translation Almost Complete ! Distance : 25769.771484
[03/07/2012 - 12:19:57PM] FlySpeed: 1288.430542 Distance between Player and Goal: 25747.652344
[03/07/2012 - 12:19:57PM] Translation Almost Complete ! Distance : 25614.359375
[03/07/2012 - 12:19:58PM] Translation Almost Complete ! Distance : 25606.962891
[03/07/2012 - 12:19:58PM] FlySpeed: 1280.009155 Distance between Player and Goal: 25616.341797
[03/07/2012 - 12:19:58PM] Translation Almost Complete ! Distance : 25669.074219
[03/07/2012 - 12:19:59PM] Translation Almost Complete ! Distance : 25752.414063
[03/07/2012 - 12:19:59PM] FlySpeed: 1287.428955 Distance between Player and Goal: 25676.382813
[03/07/2012 - 12:19:59PM] Translation Almost Complete ! Distance : 25530.312500
[03/07/2012 - 12:20:00PM] Translation Almost Complete ! Distance : 25606.513672
[03/07/2012 - 12:20:00PM] FlySpeed: 1280.354492 Distance between Player and Goal: 25655.167969
[03/07/2012 - 12:20:00PM] Translation Almost Complete ! Distance : 25801.701172
[03/07/2012 - 12:20:01PM] Translation Almost Complete ! Distance : 25695.617188
[03/07/2012 - 12:20:01PM] FlySpeed: 1284.759888 Distance between Player and Goal: 25676.927734
[03/07/2012 - 12:20:01PM] Translation Almost Complete ! Distance : 25688.144531
[03/07/2012 - 12:20:02PM] OnEffectFinish
User avatar
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Wed Jun 20, 2012 12:27 am

Hmn...that distance definitely looks wonky...maybe it appeared under the ground and fell somehow? I noticed you used a Z variation of 0.0 (Mine uses a "Tracker Object" that moves itself up, up, and away towards the destination.

And I don't want to force the player to open the console and manually turn godmode on when casting the spell...and I haven't been able to get invulnerability to stop the autokill on falling effect...
User avatar
Charlotte Lloyd-Jones
 
Posts: 3345
Joined: Fri Jun 30, 2006 4:53 pm

Post » Tue Jun 19, 2012 3:21 pm

I think what may be happening is that the XYZ coordinates VARY as you move around in the outside world. Each Minicell in the outer world may have it's own coordinate system, and the problem occurs when you try to translate across the barrier between two of these invisible area spaces...
User avatar
Ross
 
Posts: 3384
Joined: Thu Aug 10, 2006 7:22 pm

Post » Wed Jun 20, 2012 3:44 am

Well here's an updated version that works...I dispensed with translations entirely (couldn't get them to work, I'll bet you a dollar that the coordinates DO switch from one set of axes to another as you move around outside. I got rid of the target object and just used the cannon:

On the Cannon:
Spoiler
Scriptname BallisticLaunchingScript extends ObjectReference{Lancelot, Galahad, and I jump out of the rabbit...}import gameimport utilityimport RedwoodsToolsfloat ForceBool FirstUpdate = TrueFlightNodeTargetScript property FlyTarget auto; a marker in the airActivator Property FlyTargetType Auto ; The object type being used to keep track of the "next" position to fly to.ObjectReference MoveWhat ; Me. Saves tons of function calls to Game.GetPlayer()Float property FlySpeed auto; How fast to move.Sound BoomSound Whooshfunction PlayCannon(objectreference Here)	Boom = BoomSound	Whoosh = WhooshSound	Boom.Play(Here)	Whoosh.Play(Here)endfunctionfunction FindCannonPosition(ObjectReference A, ObjectReference B) ; Do the math before we play the sounds		Moveto(B,0.0,0.0,15000.0) ; move to a point far above the destination.		Force = DistanceBetween(A,B) / 50.0		if Force > 80.0			Force = 80.0 ; If you don't cap the value, you may never come down...		endifendfunctionfunction FireCannon(float ForceFactor) ; Use the FusRohDah Cannon!	PushActorAway(Game.GetPlayer(),Force *  ForceFactor)  ; Negative value pushes you TOWARD the cannon instead of AWAY from it.endFunctionEvent OnInit()	MoveWhat = GetPlayer()	FindCannonPosition(MoveWhat,Gvar.Node) ; Find position for the cannon	PlayCannon(MoveWhat)	FireCannon(-1.0) ; Negative value pushes you TOWARD the cannon instead of AWAY from it.	RegisterForSingleUpdate(10.0) ; To give the player time to land...sometimes.EndEventEvent OnUpdate() ; Keep moving the player with Cannon Shots until he's close enough.	if MoveWhat.GetDistance(Gvar.Node) < 1000.0 ; At the destination case.		Disable()		Delete()	else		FindCannonPosition(MoveWhat,Gvar.Node) ; Find position for the cannon		PlayCannon(MoveWhat)		FireCannon(-1.0)		RegisterForSingleUpdate(10.0)	endifEndEventSound Property WhooshSound AutoSound Property BoomSound Auto ; Using VOCShoutFXFireBreathCNodeVariableScript Property GVar Auto

On the MagicEffect:

Spoiler
Scriptname NodeFusRohDahCannonPlayer extends activemagiceffect  import utilityimport GameBallisticLaunchingScript Cannonfloat FlySpeedFlightNodeTargetScript FlyTargetEvent OnEffectStart(Actor Target, Actor Caster)	ActorBase Me = Target.GetActorBase() ; What is your name?	Me.SetEssential(True)	Me.SetInvulnerable(True) ; What is your quest?	Cannon = (Target.PlaceAtMe(CannonType,1,false,false) as BallisticLaunchingScript) ; What is your favorite color?EndEventEvent OnEffectFinish(Actor Target, Actor Caster)	while Cannon		Wait(1.0) ; Don't turn invulnerability off while we're still bouncing around	endwhile	Debug.Notification("Spell Invulnerability shield Down")	ActorBase Me = Target.GetActorBase()	Me.SetEssential(False)	Me.SetInvulnerable(False)EndEventActivator property CannonType autoNodeVariableScript property Gvar Auto

It just keeps tossing you towards the destination until you're there.

Unfortunately, when you get there, you will pretty much be stuck in the sprawled-out state...for some reason, it gets trapped in that state and you never stand up, and never die...you're a living corpse.
User avatar
Kelly James
 
Posts: 3266
Joined: Wed Oct 04, 2006 7:33 pm

Post » Wed Jun 20, 2012 1:33 am

You can fall from any distance while ethereal...I bet you can copy whatever the ethereal effect does without the ghost effect.
User avatar
Christie Mitchell
 
Posts: 3389
Joined: Mon Nov 27, 2006 10:44 pm

Previous

Return to V - Skyrim