Hovering Objects

Post » Mon Mar 14, 2011 5:46 pm

Hey guys, I have some rocks that I want to hover in the air

I'm really bad at this part of scripting, but I have a faint idea on how to do it.

I want the script to work on whatever object I put it on if its possible so i have to use some sort of getself but I don't know how to use it.
User avatar
Vahpie
 
Posts: 3447
Joined: Sat Aug 26, 2006 5:07 pm

Post » Mon Mar 14, 2011 7:43 pm

Rocks don't have havok. Just placing them in the air will make them float, although you may be able to see through them if you look from below.
User avatar
^~LIL B0NE5~^
 
Posts: 3449
Joined: Wed Oct 31, 2007 12:38 pm

Post » Mon Mar 14, 2011 11:57 pm

I know but I want them to move a bit up and down :) so it looks like they are hovering not just placed in the air ;)
User avatar
[Bounty][Ben]
 
Posts: 3352
Joined: Mon Jul 30, 2007 2:11 pm

Post » Tue Mar 15, 2011 1:49 am

I know but I want them to move a bit up and down :) so it looks like they are hovering not just placed in the air ;)

Well, that'd require an animated version of the stone(s) as far as I know.
User avatar
Sxc-Mary
 
Posts: 3536
Joined: Wed Aug 23, 2006 12:53 pm

Post » Tue Mar 15, 2011 4:58 am

You may adapt http://www.gamesas.com/index.php?/topic/632323-reqwip-modfood-snippets-tips/page__view__findpost__p__13319870 to move an object up and down when activated.
Just change it to a continuous movement.
User avatar
Nims
 
Posts: 3352
Joined: Thu Jun 07, 2007 3:29 pm

Post » Tue Mar 15, 2011 4:41 am

Hmmm I don't want to activate the object myself but I guess I would make a script which activates the object when the player enters the cell?

like

Begin Gamemode If player.getincell blablabla Activateendif



But I have one more Question concerning the script you linked me to, will it work on every object i put it on or do I have to change xobject so it fits each single stone?
User avatar
Verity Hurding
 
Posts: 3455
Joined: Sat Jul 22, 2006 1:29 pm

Post » Tue Mar 15, 2011 4:38 am

I meant that you could adapt the script to keep the object moving up and down, without the need of activating it

Something like this [not tested]

begin gamemode	if xObject == 0		; First time only: set vars		;======================		; xStdSpeed positive: Object will initially go up 		; xStdSpeed negative: Object will initially go down		;======================		set xObject to GetSelf   ;  aaqqPlatform ; aaqqPaint		set xStdSpeed to -5 ; <<< Change to your liking  (units per second)		set xMaxDisplacement to 100   ; <<< Displacement limit		set xPosZ to xObject.getstartingpos z		if xStdSpeed > 0			set xPosMin to xPosZ			set xPosMax to xPosZ + xMaxDisplacement 		else			set xPosMax to xPosZ			set xPosMin to xPosZ - xMaxDisplacement 			set xStdSpeed to -xStdSpeed 		endif	endif	set xPosZ to xObject.getpos Z + xSpeed * getsecondspassed	if xPosZ > xPosMax		set xPosZ to xPosMax		set xSpeed to -xStdSpeed	endif	if xPosZ < xPosMin		set xPosZ to xPosMin		set xSpeed to xStdSpeed	endif	xObject.setpos Z xPosZ	xObject.reset3Dstateend


Note that I changed the setting of xObject to GetSelf, so it will work on the object(s) the script is attached to.

Note also that you need to turn the stone mesh into an activator (or any type of object that can have a script), because, usually, rocks are Static, which do not accept scripts.
User avatar
Tinkerbells
 
Posts: 3432
Joined: Sat Jun 24, 2006 10:22 pm


Return to IV - Oblivion