Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Floats and GetPosition


DsoS
 Share

Recommended Posts

Okay, I'm not sure what I'm doing wrong with this snippet of script here, but I cannot get it to compile.

I added the L## for the error codes that are showing, they are NOT in the actual script :lol:


L64 STATE PostActivation

L65	Event OnTranslationComplete()

L66

L67	float FallingWalkWay01 = FallingWalkWay01POS.GetPositionZ()

L68

L69		if FallingWalkWay01POS ==  11000 ; check to see if the object is at 11,000 units

L70			FallingWalkWay01.Disable

L71		endif

L72	

L73	EndEvent

L74 EndState


Error thrown in the CK:

Starting 1 compile threads for 1 files...

Compiling "aaDSoSKznarzulchandVoidsPlatformFall"...

i:\steam\steamapps\common\skyrim\Data\Scripts\Source\aaDSoSKznarzulchandVoidsPlatformFall.psc(67,26): variable FallingWalkWay01POS is undefined

i:\steam\steamapps\common\skyrim\Data\Scripts\Source\aaDSoSKznarzulchandVoidsPlatformFall.psc(67,46): none is not a known user-defined type

i:\steam\steamapps\common\skyrim\Data\Scripts\Source\aaDSoSKznarzulchandVoidsPlatformFall.psc(67,7): variable FallingWalkWay01 already defined as a property

i:\steam\steamapps\common\skyrim\Data\Scripts\Source\aaDSoSKznarzulchandVoidsPlatformFall.psc(67,7): type mismatch while assigning to a float (cast missing or types unrelated)

i:\steam\steamapps\common\skyrim\Data\Scripts\Source\aaDSoSKznarzulchandVoidsPlatformFall.psc(69,5): variable FallingWalkWay01POS is undefined

i:\steam\steamapps\common\skyrim\Data\Scripts\Source\aaDSoSKznarzulchandVoidsPlatformFall.psc(69,25): cannot compare a none to a int (cast missing or types unrelated)

i:\steam\steamapps\common\skyrim\Data\Scripts\Source\aaDSoSKznarzulchandVoidsPlatformFall.psc(70,20): Disable is not a property on script objectreference or one of its parents

No output generated for aaDSoSKznarzulchandVoidsPlatformFall, compilation failed.


Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on aaDSoSKznarzulchandVoidsPlatformFall


Any idea where I am not understanding this at?

Edited by DsoS
Link to comment
Share on other sites

(67,26): variable FallingWalkWay01POS is undefined

A: You have not defined it as a variable.

(67,46): none is not a known user-defined type

A: Since the variable on this line is not defined, you get some bonus errors.

(67,7): variable FallingWalkWay01 already defined as a property

A: You have previously defined this variable as a property elsewhere in your script so you cannot now define it as a 'float'.

(67,7): type mismatch while assigning to a float (cast missing or types unrelated)

A: Since the variable on this line is not defined, you get some bonus errors.

(69,5): variable FallingWalkWay01POS is undefined

A: It still has not been defined as a variable.

(69,25): cannot compare a none to a int (cast missing or types unrelated)

A: Since the variable on this line is not defined, you get some bonus errors.

(70,20): Disable is not a property on script objectreference or one of its parents

A: Since the variable on this line is not defined, you get some bonus errors.

Link to comment
Share on other sites

Okay, I've been working on the script and getting it closer to working... I get no compiler errors, however I can not get the last part of my script to work.


Scriptname aaDSoSKznarzulchandVoidsPlatformFall extends ObjectReference  

{If player activates the button it causes the azuras star platforms to fall every other one. Will need to disable afterwards.}


Sound property QSTAstrolabeButtonPressX auto

Sound property MyFallingSound auto

ObjectReference property objSelf auto hidden

ObjectReference property FallingWalkWay01 auto

ObjectReference property FallingWalkWay02 auto

ObjectReference property FallingWalkWay03 auto

ObjectReference property FallingWalkWay04 auto

Explosion Property aaDSoSFallingDustExplosion01 Auto

Explosion Property aaDSoSArenaDeathFireBallExp Auto


import debug

import utility


event onCellAttach()

	objSelf = self as objectReference

	playAnimation("Open")

endEvent


auto state open

	event onActivate(objectReference actorRef)

		if actorRef == game.getPlayer()

			;goToState("waiting")

			playAnimationAndWait("Trigger01","done")

			if QSTAstrolabeButtonPressX

				QSTAstrolabeButtonPressX.play(objSelf)

				placeAtMe(aaDSoSArenaDeathFireBallExp);Creates an Explosion with no damage and no force.

				Wait(0.3)

				Delete()

				wait(1.0)

				game.shakeCamera(NONE, 1)

				MyFallingSound.play(Self)

				FallingWalkWay01.placeAtMe(aaDSoSFallingDustExplosion01)

				FallingWalkWay01.TranslateTo(-5968.0000, 25680.0000, 11000.0000, 0.0000, 0.0, 45.0, 1000, 1000)

				wait(1.0)


				game.shakeCamera(NONE, 1)

				MyFallingSound.play(Self)

				FallingWalkWay02.placeAtMe(aaDSoSFallingDustExplosion01)

				FallingWalkWay02.TranslateTo(-6016.0000, 25984.0000, 11000.0000, 0.0000, 0.0, 90.0, 1000, 1000)

				wait(1.0)


				game.shakeCamera(NONE, 1)

				MyFallingSound.play(Self)

				FallingWalkWay03.placeAtMe(aaDSoSFallingDustExplosion01)

				FallingWalkWay03.TranslateTo(-6048.0000, 26272.0000, 11000.0000, 0.0000, 0.0, 135.0, 1000, 1000)

				wait(1.0)


				game.shakeCamera(NONE, 1)

				MyFallingSound.play(Self)

				FallingWalkWay04.placeAtMe(aaDSoSFallingDustExplosion01)

				FallingWalkWay04.TranslateTo(-5808.0000, 26416.0000, 11000.0000, 0.0000, 0.0, 225.0, 1000, 1000)

				wait(5.0)

				GoToState("PostActivation")

			EndIf


		EndIf

	endEvent

endState


State Waiting

EndState


STATE PostActivation

	Event OnTranslationComplete()


	Float OBJPosZ = FallingWalkWay01.GetPositionZ()

	Float FinalPosZ = getPositionZ()


		If FinalPosZ == 11000

			FallingWalkWay01.Disable()

		EndIf


	EndEvent

EndState


What is suppose to happen is once "FallingWalkWay01" object is at 11,000 units on the Z Position, it needs to be disabled.

It does not disable.

This is my first time trying to use Floats and I think I'm getting something backwards.

I have compiled it successfully (multiple times) and tested it in game (multiple times) and the "FallingWalkWay01" refuses to disable.

I'll need to do this for all "FallingWalkWayXX" Objects

Link to comment
Share on other sites

I'll try that Willie. Thank you very much.

----

The Cell I'm using this in, I'm way out of the 10,000 units and it appears to work correctly.

My most distant (from 0,0,0) used object (a switch) is at the following coords:

X: -6176.0000

Y: 28592.0000

Z: 19200.0000

My highest object on the Z position is 19648.0000

I've ran through this cell 20+ times with no issues. yet.

Link to comment
Share on other sites

I figured it out... I keep forgetting that when you use anything to move a object with collision, the collision does NOT move with it.

So even though the object moves and hits the certain point, it will never disable due to the collision not hitting the Z position (or any position)

so I revised the script a little and have this now:

Scriptname aaDSoSKznarzulchandVoidsPlatformFall extends ObjectReference  

{If player activates the button it causes the azuras star platforms to fall every other one. Will need to disable afterwards.}


Sound property QSTAstrolabeButtonPressX auto

Sound property MyFallingSound auto

ObjectReference property objSelf auto hidden

ObjectReference property FallingWalkWay01 auto

ObjectReference property FallingWalkWay02 auto

ObjectReference property FallingWalkWay03 auto

ObjectReference property FallingWalkWay04 auto

Explosion Property aaDSoSFallingDustExplosion01 Auto

Explosion Property aaDSoSArenaDeathFireBallExp Auto


import debug

import utility


event onCellAttach()

    objSelf = self as objectReference

    playAnimation("Open")

endEvent


auto state open

    event onActivate(objectReference actorRef)

        if actorRef == game.getPlayer()

            ;goToState("waiting")

            playAnimationAndWait("Trigger01","done")

            if QSTAstrolabeButtonPressX

                QSTAstrolabeButtonPressX.play(objSelf)

                placeAtMe(aaDSoSArenaDeathFireBallExp);Creates an Explosion with no damage and no force.

                Wait(0.3)

                Delete()

                wait(1.0)

                game.shakeCamera(NONE, 1)

                MyFallingSound.play(Self)

                FallingWalkWay01.placeAtMe(aaDSoSFallingDustExplosion01)

                FallingWalkWay01.TranslateTo(-5968.0000, 25680.0000, -11000.0000, 0.0000, 0.0, 45.0, 1000, 1000)

                wait(1.0)


                game.shakeCamera(NONE, 1)

                FallingWalkWay01.Disable()

                MyFallingSound.play(Self)

                FallingWalkWay02.placeAtMe(aaDSoSFallingDustExplosion01)

                FallingWalkWay02.TranslateTo(-6016.0000, 25984.0000, -11000.0000, 0.0000, 0.0, 90.0, 1000, 1000)

                wait(1.0)


                game.shakeCamera(NONE, 1)

                FallingWalkWay02.Disable()

                MyFallingSound.play(Self)

                FallingWalkWay03.placeAtMe(aaDSoSFallingDustExplosion01)

                FallingWalkWay03.TranslateTo(-6048.0000, 26272.0000, -11000.0000, 0.0000, 0.0, 135.0, 1000, 1000)

                wait(1.0)


                game.shakeCamera(NONE, 1)

                FallingWalkWay03.Disable()

                MyFallingSound.play(Self)

                FallingWalkWay04.placeAtMe(aaDSoSFallingDustExplosion01)

                FallingWalkWay04.TranslateTo(-5808.0000, 26416.0000, -11000.0000, 0.0000, 0.0, 225.0, 1000, 1000)

                wait(1.0)

                FallingWalkWay04.Disable()

            EndIf


        EndIf

    endEvent

endState


State Waiting

EndState


It may not be the best, but it works.

Edited by DsoS
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...