Jump to content

Activate and move a static object


JaydoDre

Recommended Posts

What I want to do sounds simple enough to me: activate an object upon which it moves to the side a little (no need for animation). Any idea how this is done in ck?

 

I see that you can add triggers to objects and that there is like a thousand different ones, but I don't know which one I need or what kind of scripting is involved. I suppose basically I need to place a trigger that upon activation would teleport a static object a few inches?

Edited by Jedo_Dre
Link to comment
Share on other sites

Well, i did see videos on how to make a door open via a lever so that I can do, but what I was planning is to have a rug on top of a trapdoor. You "activate" the rug and it moves (teleports) to the side revealing the trap door (which you can then enter normally).

 

The secret passages available in Skyrim are too...not secret.

 

 

I checked out "translateto" command - that looks like what I need, as long as I can avoid using buttons and can attach it to the object itself. I got no idea how though...

Edited by Jedo_Dre
Link to comment
Share on other sites

Attach to the wall

 

Scriptname HiddenDoorScript extends ObjectReference  

Float Property StartX auto hidden
Float Property StartY auto hidden
Float Property StartZ auto hidden

Float Property EndX = 0.0 auto ; units to move along the X-axis
Float Property EndY = 0.0 auto ; units to move along the Y-axis
Float Property EndZ = 0.0 auto ; units to move along the Z-axis

Float Property StartAngX auto hidden
Float Property StartAngY auto hidden
Float Property StartAngZ auto hidden

Float Property EndAngX = 0.0 auto
Float Property EndAngY = 0.0 auto
Float Property EndAngZ = 0.0 auto

Float Property MoveSpeed = 300.0 auto
Float Property RotSpeed = 300.0 auto

bool Property isTranslating = False auto hidden


Event OnInit()
StartX = X
StartY = Y
StartZ = Z

EndX += StartX
EndY += StartY
EndZ += StartZ

StartAngX = self.getAngleX()
StartAngY = self.getAngleY()
StartAngZ = self.getAngleZ()

EndAngX += StartAngX 
EndAngY += StartAngY 
EndAngZ += StartAngZ 
endEvent

Event OnTranslationComplete()
isTranslating = FALSE
endEvent

Function Reveal()
self.stoptranslation()
isTranslating = True
self.TranslateTo(EndX, EndY, EndZ, angX, angY, angZ, MoveSpeed, RotSpeed)
endFunction

Function Hide()
self.stoptranslation()
isTranslating = True
self.TranslateTo(StartX, StartY, StartZ, angX, angY, angZ, MoveSpeed, RotSpeed)
endFunction

 

Attach this to an activator.

 

Scriptname HiddenWallButtonScript extends ObjectReference  

ObjectReference Property WallRef Auto  

Bool isHidden = true
Event OnActivate(ObjectReference akActionRef)
if(hidden)
	(WallRef as HiddenDoorScript ).Reveal()
	hidden = false
else
	(WallRef as HiddenDoorScript ).Hide()
	hidden = true
endif		
endEvent

 

Modify the values to your liking.

Edited by Sjogga
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...