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...

[Sky] Problem: TranslateTo for Moving Obj


Nahkin
 Share

Recommended Posts

Greetings together :D. I thought again hey let's make a awsome scripted house ;). Therefor I will inlcude some cool new scripts. Sadly I am struggling atm with the following script. I will explain in short what it should do and what the variables stand for.

 

Description:

I would like to move a statue or any other object out of a water or earth with some nice effects and sound. I used the base script form Ustengrav Statues. The problem is now that I want to move the statue or pillars down again with the same effect.

The whole thing should be enabled or disabled with a simple leveler or button from the vanilla game.

 

The script:

Scriptname AAMovingObjectScript extends ObjectReference  

keyword Property LinkCustom01 auto
keyword Property LinkCustom02 auto
keyword Property LinkCustom03 auto
keyword Property LinkCustom04 auto

bool Property HasBeenLoaded = FALSE auto hidden

objectreference Property WaterRings auto hidden
objectreference Property StartingRef auto hidden
objectreference Property WaterSplash auto hidden
objectreference Property RumbleSound auto hidden

float Property EndPosX auto hidden
float Property EndPosY auto hidden
float Property EndPosZ auto hidden

float Property StartPosX auto hidden
float Property StartPosY auto hidden
float Property StartPosZ auto hidden

float Property EndAngleX auto hidden
float Property EndAngleY auto hidden
float Property EndAngleZ auto hidden

EVENT OnCellLoad()
	if (HasBeenLoaded == FALSE)
		WaterRings = GetLinkedRef(LinkCustom01)
		StartingRef = GetLinkedRef(LinkCustom02)
		WaterSplash = GetLinkedRef(LinkCustom03)
		RumbleSound = GetLinkedRef(LinkCustom04)

		EndPosX = self.GetPositionX()
		EndPosY = self.GetPositionY()
		EndPosZ = self.GetPositionZ()

		StartPosX = StartingRef.GetPositionX()
		StartPosY = StartingRef.GetPositionY()
		StartPosZ = StartingRef.GetPositionZ()

		EndAngleX = self.GetAngleX()
		EndAngleY = self.GetAngleY()
		EndAngleZ = self.GetAngleZ()

		self.MoveTo(StartingRef)
		WaterRings.Disable()
		Watersplash.Disable()
		RumbleSound.Disable()

		HasBeenLoaded = TRUE
	endif
endEVENT

EVENT OnActivate(ObjectReference akActionRef)
      	WaterRings.Enable(1)
	utility.Wait(1)
	TranslateTo(EndPosX, EndPosY, EndPosZ, EndAngleX, EndAngleY, EndAngleZ, 75)
	utility.Wait(1)
	RumbleSound.Enable()
	WaterSplash.Enable(1)
	utility.Wait(2)
	WaterSplash.Disable(1)
	utility.Wait(2)
	WaterRings.Disable(1)
	utility.Wait(1)
	RumbleSound.Disable()

	if(StartPosX != EndPosX)
		WaterRings.Enable(1)
		utility.Wait(1)
		TranslateTo(StartPosX, StartPosY, StartPosZ, 0, 0, 0, 75)
		utility.Wait(1)
		RumbleSound.Enable()
		WaterSplash.Enable(1)
		utility.Wait(2)
		WaterSplash.Disable(1)
		utility.Wait(2)
		WaterRings.Disable(1)
		utility.Wait(1)
		RumbleSound.Disable()
	endif
endEVENT

LinkCustom01 --> this one is used for the water effect or what else. It get's enabled and disabled

LinkCustom02 --> this one holds the statue or pillar which is used as reference, where the activator get's placed

LinkCustom03 --> again a water effect

LinkCustom04 --> the sound

 

EndPos --> is where it should get translated to

StartPos --> is the reference Statue or pillar directly under the normal statue.

 

If you load the cell the statue get's placed to the position where the other one is under it. Than the function is called to raise it up.

I have a terrible headache now, because I tried nearly all if clauses and booleans but can't get a switch to work :D. I mean it should rise up and down again ^^.

 

If you need further explanation or a test cell.esp I can upload it here ^^.

 

 

Problems:

The next problem is that the object or static has no collision once its Translated...

I read that the function has the problem to remove the collision and the solution would be to make the object a movable static.

But what shall I do if the statue should also be a activator??

 

 

I hope you can help me and thanks in advance :D.

Edited by Nahkin
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...