Moving player up into the air

Post » Tue Jun 19, 2012 12:22 pm

In one of the vanilla quests, specifically the one where you do the bidding of the Daedric Prince Meridia (I think it is), you stand in front of her statue and suddenly you fly straight up into the sky. I tried to look at this quest, as I wanted to replicate the effect.. but I cannot seem to find out how they did it. Did they move the player or did they move a collision box upon which the player is standing? And how?

Any info on this would be very helpful for me!
User avatar
Kevin Jay
 
Posts: 3431
Joined: Sun Apr 29, 2007 4:29 am

Post » Wed Jun 20, 2012 2:06 am

http://www.creationkit.com/TranslateTo_-_ObjectReference
http://www.creationkit.com/SplineTranslateTo_-_ObjectReference

Either one of These 2 functions will give you the effect you want. Just modify the 'float afZ' variable and you are set. The speed should be between 500-1000, depend on how high you want to shoot the player upward
User avatar
Tamika Jett
 
Posts: 3301
Joined: Wed Jun 06, 2007 3:44 am

Post » Tue Jun 19, 2012 10:59 pm

http://www.creationkit.com/TranslateTo_-_ObjectReference
http://www.creationkit.com/SplineTranslateTo_-_ObjectReference

Either one of These 2 functions will give you the effect you want. Just modify the 'float afZ' variable and you are set. The speed should be between 500-1000, depend on how high you want to shoot the player upward
Cool, thank you :D What is the actual difference between the two? I'm not native English, so I didn't quite catch the exact difference.
User avatar
James Rhead
 
Posts: 3474
Joined: Sat Jul 14, 2007 7:32 am

Post » Tue Jun 19, 2012 4:42 pm

TranslateTo uses a straight line always, SplineTranslateTo uses a spline, which is a kind of curve that you can make "more curve" with the tangentMagnitude field.

You can check the script at the quest DA09 (DA09Script) to see how they did it there. It looks like they translated the player, disabled controls and enabled a collision plane below it.

Another option instead of enabling a collision plane, is disabling havok. Check the script I posted http://www.gamesas.com/topic/1353446-can-you-script-movement/page__view__findpost__p__20398274. Depending for what I guess you would still want to disable controls.
User avatar
Oyuki Manson Lavey
 
Posts: 3438
Joined: Mon Aug 28, 2006 2:47 am

Post » Tue Jun 19, 2012 8:03 pm

TranslateTo uses a straight line always, SplineTranslateTo uses a spline, which is a kind of curve that you can make "more curve" with the tangentMagnitude field.

You can check the script at the quest DA09 (DA09Script) to see how they did it there. It looks like they translated the player, disabled controls and enabled a collision plane below it.

Another option instead of enabling a collision plane, is disabling havok. Check the script I posted http://www.gamesas.com/topic/1353446-can-you-script-movement/page__view__findpost__p__20398274. Depending for what I guess you would still want to disable controls.

The first thing I tried was this:

Spoiler



Scriptname blablabla
{flying}

objectReference property gdadotHeartExitMarker auto
objectReference property gdadotHeartExitMarkerTop auto
objectReference property PlayerRef auto

Event OnActivate(ObjectReference akActionRef)

PlayerRef.TranslateToRef(gdadotHeartExitMarker, 150)
utility.wait(2.5)

PlayerRef.TranslateToRef(gdadotHeartExitMarkerTop, 4000)
utility.wait(4.5)
PlayerRef.StopTranslation()

endEvent

It tried to do something like the DA09 script, but obviously I wasn't doing it right at all :P

So I took a look at your link, and tried to modify that script into something I could use.. but I'm still not getting any results.. which I am not surprised of.

Spoiler



Scriptname blablabla
{flying}


objectReference property gdadotHeartExitMarker auto
objectReference property gdadotHeartExitMarkerTop auto
objectReference property PlayerRef auto


objectReference CastFromHereRef
float X
float Y
float Z
float height = 600.0


;=============== EVENTS /=============/
Event OnActivate(ObjectReference akActionRef)
Debug.Trace(" OnEffectStart ")
CastFromHereRef = PlayerRef
CastFromHereRef.setMotionType( CastFromHereRef.Motion_Keyframed )
X = gdadotHeartExitMarker.X
Y = gdadotHeartExitMarker.Y
Z = gdadotHeartExitMarker.Z
CastFromHereRef.SplineTranslateTo(X, Y, Z + height, CastFromHereRef.GetAngleX(), CastFromHereRef.GetAngleY(), CastFromHereRef.GetAngleZ(), 300, 200)
EndEvent

endEvent

I want the player to fly up from the gdadotHeartExitMarker, either just to a specified height, or to another marker which I have placed above (the gdadotHeartExitMarkerTop)
As you can see, I really have no idea what I am doing... at all :o

I placed the script on a lever, I went into properties and set my properties to the references I wanted.
Also, both my script variants were compiled successfully.

Can anyone help me progress from here? I feel really lost. :(
User avatar
MARLON JOHNSON
 
Posts: 3377
Joined: Sun May 20, 2007 7:12 pm

Post » Tue Jun 19, 2012 1:54 pm

On SplineTranslateTo - Is there any way to change how a spline is generated with a script, or are they all generated at runtime based on the start point, end point, and tangent variable? I don't see any Spline script in the wiki...I would think a true spline would have at least 3 defined points in it instead of just two.
User avatar
Micah Judaeah
 
Posts: 3443
Joined: Tue Oct 24, 2006 6:22 pm

Post » Wed Jun 20, 2012 2:26 am

If you are adding the script to an Activator the player has to activate, you can use akActionRef and don't need to have a property with the player reference. In both scripts you have posted, I do not see anything wrong, so maybe the problem is in the properties setting, or that the references are not enabled ingame.

On a side note, if you set the motion to keyframed, remember to change it to dynamic after, or you will get stuck there :P

Try this, look for the notifications on the screen and if you get them but you still don't move, add notifications to see the objectReference properties, check if they are enabled, their positions, etc

Scriptname blablabla{flying}objectReference property gdadotHeartExitMarker autoobjectReference property gdadotHeartExitMarkerTop autoEvent OnActivate(ObjectReference akActionRef)  Debug.Notification(" Activated! ")  Debug.Notification(akActionRef)  akActionRef.TranslateToRef(gdadotHeartExitMarker, 150)  utility.wait(2.5)  akActionRef.TranslateToRef(gdadotHeartExitMarkerTop, 4000)  utility.wait(4.5)  akActionRef.StopTranslation()endEvent
User avatar
Leanne Molloy
 
Posts: 3342
Joined: Sat Sep 02, 2006 1:09 am

Post » Wed Jun 20, 2012 1:21 am

On SplineTranslateTo - Is there any way to change how a spline is generated with a script, or are they all generated at runtime based on the start point, end point, and tangent variable? I don't see any Spline script in the wiki...I would think a true spline would have at least 3 defined points in it instead of just two.

I think what it does in the critter.psc script ( and in critterbird.psc one ) is generating intermediate nodes and then use the translate functions to have a more complex movement, but that script gives me headache so I cannot be sure :P

I guess it's a second degree curve defined with two points and forcing the tangent to some value at some point using the tangent magnitude, but honestly I haven't checked in game to be sure :P
User avatar
Alexander Lee
 
Posts: 3481
Joined: Sun Nov 04, 2007 9:30 pm

Post » Tue Jun 19, 2012 5:04 pm

I tried that, but nothing whatsoever happens... Absolutely nothing :(

http://i197.photobucket.com/albums/aa253/GrandDukeAdense/Skrmklipp.png

The lever I use is only a placeholder, but that shouldn't affect anything, right? I also reload from a savegame made prior to me creating the script every time I go in-game to test.
User avatar
Cartoon
 
Posts: 3350
Joined: Mon Jun 25, 2007 4:31 pm

Post » Tue Jun 19, 2012 9:14 pm

I tried that, but nothing whatsoever happens... Absolutely nothing :(

http://i197.photobucket.com/albums/aa253/GrandDukeAdense/Skrmklipp.png

The lever I use is only a placeholder, but that shouldn't affect anything, right? I also reload from a savegame made prior to me creating the script every time I go in-game to test.

Do you have the debug options of the ini file enabled and are you seeing the Debug.Notifications lines in game? Just to be sure that it is entering in the OnActivate event. I'm afraid I've worked more with spells than with activators, so I am not sure what else can be.
User avatar
Melanie Steinberg
 
Posts: 3365
Joined: Fri Apr 20, 2007 11:25 pm

Post » Tue Jun 19, 2012 12:15 pm

When I tried TranslateTo on the player, I move very very slowly, even with a high speed set, or the screen just goes blue...do I need to change movement type to Keyframed to move the player fast? And what's with the blue screen of not-death?
User avatar
JESSE
 
Posts: 3404
Joined: Mon Jul 16, 2007 4:55 am

Post » Wed Jun 20, 2012 4:52 am

When I tried TranslateTo on the player, I move very very slowly, even with a high speed set, or the screen just goes blue...do I need to change movement type to Keyframed to move the player fast? And what's with the blue screen of not-death?

No idea about the blue screen...The only effect I get comes because I modified a healing spell...as far as I know... I have just tried the following with TranslateTo and it worked.


scriptName ShanaMovesUpEffectScript extends ActiveMagicEffect{Scripted magic effect blablabla.};====;  VARIABLES   /=============/objectReference CastFromHereReffloat Xfloat Yfloat Zfloat height = 600.0;===============   EVENTS	 /=============/Event OnEffectStart(Actor Target, Actor Caster)	Debug.Trace("	OnEffectStart ")	CastFromHereRef = Target as ObjectReference	;CastFromHereRef.setMotionType( CastFromHereRef.Motion_Keyframed )	X = CastFromHereRef.X	Y = CastFromHereRef.Y	Z = CastFromHereRef.Z	;CastFromHereRef.SplineTranslateTo(X, Y, Z + height, CastFromHereRef.GetAngleX(), CastFromHereRef.GetAngleY(), CastFromHereRef.GetAngleZ(), 600)	CastFromHereRef.TranslateTo(X, Y, Z + height, CastFromHereRef.GetAngleX(), CastFromHereRef.GetAngleY(), CastFromHereRef.GetAngleZ(), 600)EndEventEvent OnEffectFinish(Actor Target, Actor Caster)	Debug.Trace("	OnEffectFinish")	;CastFromHereRef.setMotionType( CastFromHereRef.Motion_Dynamic )EndEvent
So now I do not understand why I changed movement type or end using SplineTranslateTo instead, although I remember I had some issues before switching...

One thing I have just noticed while using the script I had with the SplineTranslateTo version though is that it goes wild if I cast the spell while moving lol. As in going down, then up and then launching the player against the ground with a huge force...I guess it has to do with the curve generated when you have moved a little distance with too little tangeng magnitude...TranslateTo works even when moving though.

Also, I forgot to mention the reason why I used variables to save the caster coordinates, was just to shorten the function call line that otherwise would not fit in my screen... In case anyone was wondering :tongue:
User avatar
[ becca ]
 
Posts: 3514
Joined: Wed Jun 21, 2006 12:59 pm

Post » Wed Jun 20, 2012 12:31 am

Alright, I got it working now. I only needed to add a "extends ObjectReference" at the top! Thank you for your help :D

Now I've got two more questions..

First one: How does one play a sound effect through papyrus? I just don't get how it's done :( I wish to play this sound: FXExplosionCatapultNear

Second one: I want to know how to kill a certain NPC when another one dies. I only need to know how to write the line which kills it (along with any properties etc that are required) Its ref ID is "gdadotShadowHandRef01"
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm

Post » Wed Jun 20, 2012 4:11 am

I still can't get mine to work...I'm trying to translate the player through a series of points to a destination (This script answers your question about sounds, by the way)

First thing it does (Correctly) is toss the player high in the air...it then tries to move him to the target in a series of translastions...I'm using the controller activator to "time" the movements...but the OnTranslationComplete() event is not firing, so I'm trying to "Guess" how long each translation will take.

The problem? The player keeps popping back to where I first cast the spell for no readily discernable reason. (The spell puts a ton of extra HP on the player so he can survive a few rough bounces, for testing purposes)
Spoiler
Scriptname BallisticLaunchingScript extends ObjectReference{Lancelot, Galahad, and I jump out of the rabbit...}import gameimport utilityimport RedwoodsToolsfloat property BaseForce auto ; Default basic force.float Forcebool StopMoving = FalseObjectReference FlyTarget ; a marker to make the splines for the flying segmentObjectReference MoveWhatActivator Property FlyTargetType Auto ; The object type being used to keep track of the "next" position to fly to.Float FlySpeedSound BoomSound Whooshfloat DXfloat DYfloat Dzfloat RotXfloat RotYfloat RotZfunction 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(A,0.0,0.0,-5000.0)        Force = DistanceBetween(A,B) / 30.0        if Force > 80.0            Force = 80.0        endifendfunctionFunction MoveToNextPoint()    FlySpeed = DistanceBetween(Gvar.Node,FlyTarget) / 2.0    FlyTarget.MoveTo(FlyTarget,DX,DY,DZ) ; Player will have moved by now.    FlyTarget.SetAngle(Flytarget.GetAngleX()+RotX,Flytarget.GetAngleY()+RotY,Flytarget.GetAngleZ()+RotZ)EndFunctionFunction ComputeNextPoint()    if !FlyTarget        FlyTarget = MoveWhat.PlaceAtMe(FlyTargetType,1)        FlyTarget.MoveTo(MoveWhat,0.0,0.0,0.0,false)    endif    DX = (Gvar.Node.X - FlyTarget.x) / 2.0    DY = (Gvar.Node.Y - FlyTarget.y) / 2.0    if GetDistance(Gvar.Node) > 2000        DZ = (Gvar.Node.Z - FlyTarget.z) / 2.0 + 1000    else        DZ = (Gvar.Node.Z - FlyTarget.z) / 2.0 + 100    endif    RotX = RandomFloat(-360.0,360.0)    RotY = RandomFloat(-360.0,360.0)    RotZ = RandomFloat(-360.0,360.0) ; Tumble at randomEndFunctionfunction FireCannon(float ForceFactor) ; Use the FusRohDah Cannon!    PushActorAway(MoveWhat,Force*ForceFactor)endFunctionEvent OnInit()    MoveWhat = Game.GetPlayer()    FindCannonPosition(MoveWhat,Gvar.Node) ; Find start position for the cannon    PlayCannon(MoveWhat)    FireCannon(1.0)    RegisterForSingleUpdate(4)    Wait(2.0)    ComputeNextPoint()    EndEventEvent OnUpdate(); Start moving the player with translates    if !StopMoving        if MoveWhat.GetDistance(Gvar.Node) < 400.0            StopMoving = True            Delete()        else            MoveToNextPoint()            MoveWhat.TranslateToRef(FlyTarget,FlySpeed)            MoveTo(MoveWhat)            TranslateToRef(FlyTarget,FlySpeed) ; The cannon target follows the player to try to catch the OnTranslationCompleated Event            ComputeNextPoint() ; Start doing the math for next point now, no time to lose!            RegisterForSingleUpdate(2.0)        endif    endifEndEventEvent OnTranslationComplete()    Debug.Notification("Translation Complete") ; Never fires.EndEventEvent OnTranslationAlmostComplete()        MoveToNextPoint()EndEventSound Property WhooshSound AutoSound Property BoomSound AutoNodeVariableScript Property GVar Auto

Oh, and despite the 50,000 extra hitpoints, I do keep dying even on short drops on some occasions...I've even tried toggling on god mode invulnerablity and it STILL kills me from falling.
User avatar
GRAEME
 
Posts: 3363
Joined: Sat May 19, 2007 2:48 am

Post » Tue Jun 19, 2012 10:14 pm

I still can't get mine to work...I'm trying to translate the player through a series of points to a destination (This script answers your question about sounds, by the way)

First thing it does (Correctly) is toss the player high in the air...it then tries to move him to the target in a series of translastions...I'm using the controller activator to "time" the movements...but the OnTranslationComplete() event is not firing, so I'm trying to "Guess" how long each translation will take.

The problem? The player keeps popping back to where I first cast the spell for no readily discernable reason. (The spell puts a ton of extra HP on the player so he can survive a few rough bounces, for testing purposes)
Spoiler
Scriptname BallisticLaunchingScript extends ObjectReference{Lancelot, Galahad, and I jump out of the rabbit...}import gameimport utilityimport RedwoodsToolsfloat property BaseForce auto ; Default basic force.float Forcebool StopMoving = FalseObjectReference FlyTarget ; a marker to make the splines for the flying segmentObjectReference MoveWhatActivator Property FlyTargetType Auto ; The object type being used to keep track of the "next" position to fly to.Float FlySpeedSound BoomSound Whooshfloat DXfloat DYfloat Dzfloat RotXfloat RotYfloat RotZfunction 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(A,0.0,0.0,-5000.0)		Force = DistanceBetween(A,B) / 30.0		if Force > 80.0			Force = 80.0		endifendfunctionFunction MoveToNextPoint()	FlySpeed = DistanceBetween(Gvar.Node,FlyTarget) / 2.0	FlyTarget.MoveTo(FlyTarget,DX,DY,DZ) ; Player will have moved by now.	FlyTarget.SetAngle(Flytarget.GetAngleX()+RotX,Flytarget.GetAngleY()+RotY,Flytarget.GetAngleZ()+RotZ)EndFunctionFunction ComputeNextPoint()	if !FlyTarget		FlyTarget = MoveWhat.PlaceAtMe(FlyTargetType,1)		FlyTarget.MoveTo(MoveWhat,0.0,0.0,0.0,false)	endif	DX = (Gvar.Node.X - FlyTarget.x) / 2.0	DY = (Gvar.Node.Y - FlyTarget.y) / 2.0	if GetDistance(Gvar.Node) > 2000		DZ = (Gvar.Node.Z - FlyTarget.z) / 2.0 + 1000	else		DZ = (Gvar.Node.Z - FlyTarget.z) / 2.0 + 100	endif	RotX = RandomFloat(-360.0,360.0)	RotY = RandomFloat(-360.0,360.0)	RotZ = RandomFloat(-360.0,360.0) ; Tumble at randomEndFunctionfunction FireCannon(float ForceFactor) ; Use the FusRohDah Cannon!	PushActorAway(MoveWhat,Force*ForceFactor)endFunctionEvent OnInit()	MoveWhat = Game.GetPlayer()	FindCannonPosition(MoveWhat,Gvar.Node) ; Find start position for the cannon	PlayCannon(MoveWhat)	FireCannon(1.0)	RegisterForSingleUpdate(4)	Wait(2.0)	ComputeNextPoint()	EndEventEvent OnUpdate(); Start moving the player with translates	if !StopMoving		if MoveWhat.GetDistance(Gvar.Node) < 400.0			StopMoving = True			Delete()		else			MoveToNextPoint()			MoveWhat.TranslateToRef(FlyTarget,FlySpeed)			MoveTo(MoveWhat)			TranslateToRef(FlyTarget,FlySpeed) ; The cannon target follows the player to try to catch the OnTranslationCompleated Event			ComputeNextPoint() ; Start doing the math for next point now, no time to lose!			RegisterForSingleUpdate(2.0)		endif	endifEndEventEvent OnTranslationComplete()	Debug.Notification("Translation Complete") ; Never fires.EndEventEvent OnTranslationAlmostComplete()		MoveToNextPoint()EndEventSound Property WhooshSound AutoSound Property BoomSound AutoNodeVariableScript Property GVar Auto

Oh, and despite the 50,000 extra hitpoints, I do keep dying even on short drops on some occasions...I've even tried toggling on god mode invulnerablity and it STILL kills me from falling.

This is the script I use:

Spoiler


Scriptname blabla extends ObjectReference
{This is where the stuff happens. Including flying exit.}


Sound FirstSound
objectReference property gdadotHeartExitMarker auto
objectReference property gdadotHeartExitMarkerTop auto

function SoundStuff(objectreference akActionRef)
FirstSound = QSTMS06PotemaBanish
FirstSound.Play(akActionRef)
endfunction

Event OnActivate(ObjectReference akActionRef)
Debug.Notification(" Activated! ")
Debug.Notification(akActionRef)
SoundStuff (akActionRef)
akActionRef.TranslateToRef(gdadotHeartExitMarker, 2050)
utility.wait(0.4)
akActionRef.TranslateToRef(gdadotHeartExitMarkerTop, 10000)
utility.wait(10)
akActionRef.StopTranslation()
Debug.Notification (" Translation over ")
endEvent

My translation works fine.. You method of doing it seems more complex. But you are trying to include rotation etc as well?

My sounds, however do not work :/ I tried to replicate what you did, but the scrip fails to compile. It says " variable QSTMS06PotemaBanish is undefined"
User avatar
Emily Jones
 
Posts: 3425
Joined: Mon Jul 17, 2006 3:33 pm

Post » Wed Jun 20, 2012 3:27 am

This is the script I use:

Spoiler


Scriptname blabla extends ObjectReference
{This is where the stuff happens. Including flying exit.}


Sound FirstSound
objectReference property gdadotHeartExitMarker auto
objectReference property gdadotHeartExitMarkerTop auto

function SoundStuff(objectreference akActionRef)
FirstSound = QSTMS06PotemaBanish
FirstSound.Play(akActionRef)
endfunction

Event OnActivate(ObjectReference akActionRef)
Debug.Notification(" Activated! ")
Debug.Notification(akActionRef)
SoundStuff (akActionRef)
akActionRef.TranslateToRef(gdadotHeartExitMarker, 2050)
utility.wait(0.4)
akActionRef.TranslateToRef(gdadotHeartExitMarkerTop, 10000)
utility.wait(10)
akActionRef.StopTranslation()
Debug.Notification (" Translation over ")
endEvent

My translation works fine.. You method of doing it seems more complex. But you are trying to include rotation etc as well?

My sounds, however do not work :/ I tried to replicate what you did, but the scrip fails to compile. It says " variable QSTMS06PotemaBanish is undefined"

I gave up on rotation for now...just trying to get the location thing to work. But even though I'm moving the Cannon object (the spell just drops the item with this script on it) from the same location, at the same speed, To the same location, I never get an OnTranslationComplete() event.
User avatar
Jodie Bardgett
 
Posts: 3491
Joined: Sat Jul 29, 2006 9:38 pm

Post » Tue Jun 19, 2012 2:39 pm

I gave up on rotation for now...just trying to get the location thing to work. But even though I'm moving the Cannon object (the spell just drops the item with this script on it) from the same location, at the same speed, To the same location, I never get an OnTranslationComplete() event.
My script dropped me halfway through at first too, but that was because my Translation ended too quickly. I added some more wait time before ending the translation, and I was good to go.

Btw, do you know why my sounds cause the script not to compile? :/
User avatar
Alba Casas
 
Posts: 3478
Joined: Tue Dec 12, 2006 2:31 pm

Post » Tue Jun 19, 2012 12:59 pm

My script dropped me halfway through at first too, but that was because my Translation ended too quickly. I added some more wait time before ending the translation, and I was good to go.

Btw, do you know why my sounds cause the script not to compile? :/

Your script does not know what QSTMS06PotemaBanish is. Try using a Sound Property QSTMS06PotemaBanish auto if that's the name in the editor.
User avatar
Victor Oropeza
 
Posts: 3362
Joined: Sun Aug 12, 2007 4:23 pm

Post » Wed Jun 20, 2012 12:45 am

This is the script I use:
Spoiler
Scriptname blabla extends ObjectReference {This is where the stuff happens. Including flying exit.} Sound FirstSound objectReference property gdadotHeartExitMarker auto objectReference property gdadotHeartExitMarkerTop auto function SoundStuff(objectreference akActionRef) FirstSound = QSTMS06PotemaBanish FirstSound.Play(akActionRef) endfunction Event OnActivate(ObjectReference akActionRef) Debug.Notification(" Activated! ") Debug.Notification(akActionRef) SoundStuff (akActionRef) akActionRef.TranslateToRef(gdadotHeartExitMarker, 2050) utility.wait(0.4) akActionRef.TranslateToRef(gdadotHeartExitMarkerTop, 10000) utility.wait(10) akActionRef.StopTranslation() Debug.Notification (" Translation over ") endEvent
My translation works fine.. You method of doing it seems more complex. But you are trying to include rotation etc as well? My sounds, however do not work :/ I tried to replicate what you did, but the scrip fails to compile. It says " variable QSTMS06PotemaBanish is undefined"

Are you assigning the property to a Sound Marker? Sound Markers are what it expects...The Sound Marker should have a pick list for a sound DESCRIPTOR, which is where the actual sound or sounds are located.

Step 1: Under audio, make a new Sound Marker, call it "MyPotemaSound" - In the pick list, pick your QSTMS06PotemaBanish - Then in the properties of your script, assign "MyPotemaSound" to the property.
User avatar
Noraima Vega
 
Posts: 3467
Joined: Wed Jun 06, 2007 7:28 am

Post » Tue Jun 19, 2012 6:07 pm

My script dropped me halfway through at first too, but that was because my Translation ended too quickly. I added some more wait time before ending the translation, and I was good to go. Btw, do you know why my sounds cause the script not to compile? :/

If I could get OnTranslationComplete to fire, I could start the next translation the instant the previous one stops...but it never fires.

I guess I should just turn gravity off for the player once the translations begin, and never turn it on again until he reaches his destination. If I can only figure out how to turn gravity off...anyone know the Papyrus equivalent of TCL?
User avatar
Sophh
 
Posts: 3381
Joined: Tue Aug 08, 2006 11:58 pm

Post » Tue Jun 19, 2012 1:50 pm

If I could get OnTranslationComplete to fire, I could start the next translation the instant the previous one stops...but it never fires.

I guess I should just turn gravity off for the player once the translations begin, and never turn it on again until he reaches his destination. If I can only figure out how to turn gravity off...anyone know the Papyrus equivalent of TCL?

You can use SetMotionType as above for that.

As for your script, wow that looks funny! lol

I am trying to understand what your problem can be but it's hard to say without seeing it... I guess I should try it and have some havok fun hehe,
User avatar
Kayla Oatney
 
Posts: 3472
Joined: Sat Jan 20, 2007 9:02 pm

Post » Tue Jun 19, 2012 2:40 pm

You can use SetMotionType as above for that.

As for your script, wow that looks funny! lol

I am trying to understand what your problem can be but it's hard to say without seeing it... I guess I should try it and have some havok fun hehe,

It's actually based on a spell misfire script on a teleport spell attempt by a somewhat incompetent wizard...Think Jzargo's scrolls and the weird polymorphs by your classmates at WinterHold U.
User avatar
JESSE
 
Posts: 3404
Joined: Mon Jul 16, 2007 4:55 am

Post » Tue Jun 19, 2012 7:44 pm

OK, So setting movement to Keyframed is supposed to make it so ONLY translates and movetos and the like will move me?

Well it doesn't work. As soon as I stop translating, gravity takes hold and I do a Wile-E-Coyote.
User avatar
Jonathan Windmon
 
Posts: 3410
Joined: Wed Oct 10, 2007 12:23 pm

Post » Tue Jun 19, 2012 1:44 pm

OK, been at this most of the day and it's starting to really annoy me...

This activator refuses to Translate...I've checked and checked, and I can't find any reason why it shouldn't move, but it won't, except with MoveTo() commands, which won't give me an OnTranslationCompleted() event to work with.

It has no model to pin it down to dynamic motion, as far as I can tell it's just an ordinary everyday activator object.

Spoiler
Scriptname BallisticLaunchingScript extends ObjectReference{Lancelot, Galahad, and I jump out of the rabbit...}import gameimport utilityfloat Forcebool StopMoving = FalseBool FirstUpdate = TrueFlightNodeTargetScript FlyTarget ; 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 FlySpeed ; 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(A,0.0,0.0,-5000.0)		Force = A.GetDistance(B) / 30.0		if Force > 80.0			Force = 80.0		endifendfunctionfunction FireCannon(float ForceFactor) ; Use the FusRohDah Cannon!;	PushActorAway(Game.GetPlayer(),Force * ForceFactor)endFunctionEvent OnInit()	MoveWhat = Game.GetPlayer()	SetMotionType(Motion_Keyframed) ; Shouldn't be necessary for a bare bones activator, but just to be sure...	FindCannonPosition(MoveWhat,Gvar.Node) ; Find start position for the cannon	if !FlyTarget		FlyTarget = (PlaceAtMe(FlyTargetType,1) as FlightNodeTargetScript)		FlyTarget.MoveTo(FlyTarget,0.0,0.0,8000)	endif	PlayCannon(MoveWhat)	FireCannon(1.0)	MoveTo(FlyTarget) ; Both objects should now be at the same place. - Verified.	RegisterForSingleUpdate(4)	FlyTarget.StartComputing(self) ; Start the FlyTarget thinking about where it should go next.EndEventEvent OnUpdate() ; Start moving the player with translates	if MoveWhat.GetDistance(Gvar.Node) < 200.0 ; At the destination case.		MoveWhat.SetMotionType(MoveWhat.Motion_Dynamic)		Delete()	else		MoveWhat.SetMotionType(MoveWhat.Motion_Keyframed) Try to defy gravity...doesn't work.		FlySpeed = FlyTarget.MoveToNextPoint() ; Move FlyTarget to it's next positionDebug.Notification("CannonToFlyMarker: " + GetDistance(FlyTarget))Debug.Notification("Speed: " + FlySpeed)		TranslateToRef(FlyTarget,FlySpeed) ; This call is doing nothing.; Flytarget gets further and further away until it reaches the destination, but the cannon object stays put.		MoveWhat.StopTranslation() ; Hover for a moment.;		MoveWhat.TranslateToRef(FlyTarget,FlySpeed/1.25) ; Move me to the fly object. Currently disabled for bug checking.		RegisterForSingleUpdate(2.0) ; Since we can't catch the OnTranslationComplete, have to guess.	endifEndEventEvent OnTranslationComplete()	Debug.Notification("Translation Complete") ; can't get this to fire by using translations of cannon object - it doesn't translate. Ever.EndEventEvent OnTranslationAlmostComplete()EndEventSound Property WhooshSound AutoSound Property BoomSound AutoNodeVariableScript Property GVar Auto

This is driving me nutz...I KNOW you can move Activators with translations, because the very first spell I made relied heavily on doing so, and it still works!
User avatar
jason worrell
 
Posts: 3345
Joined: Sat May 19, 2007 12:26 am

Post » Tue Jun 19, 2012 3:50 pm

If I understood it correctly, one translation does not actually have to end for another one to begin. So you can just put lots of wait commands between your translations, and only stop the translation when you are completely done.

EDIT: I did a few tests, trying to create an elevator going down. Firstly, just translating the elevator did not work, because it collision was still in the same place, so the player was left standing in the air. So I decided to translate the player as well, with disabled player controls. It worked surprisingly well until I reached the bottom where I ended the translation and the player died. While translating, it does seem like the player is actually falling (those animations play) so he kinda falls to his death.

EDIT2: Maybe this happens because the player is "inside" the object he translates to? I remember attemping to climb mountains with my horse, when suddenly it would fall into the cliffs.. and without falling any considerable distance I would just die and have to reload..
User avatar
Bedford White
 
Posts: 3307
Joined: Tue Jun 12, 2007 2:09 am

Next

Return to V - Skyrim