PDA

View Full Version : Broken RotatePivot()


Emon
03-23-2003, 11:55 AM
Right, so I decided to dig up this stale Space Noxx II level that I never finished, and I'm trying to attach my sun light to my skybox in some fashion. Actually attaching it didn't make it rotate around the pivot point of the skybox, so I tried RotatePivot() instead. It doesn't work either... My template is basically a ghost with light and 0x1 thingflags, and move=path as well as the needed frames.

Inside the pulse, the position of the sun is printed out, but it never changes (which is clearly visible while playing).


# Jedi Knight COG Script
#
# SunAttach.COG
#
# Created by Emon. E-Mail: emon1337@yahoo.com - ICQ: 35960628
# Feel free to use this COG as long as credit is given in the readme file.
#
# Originally attached sun to starbox, discarded in favor of pivot rotation.
#
#
# This COG is not supported by LucasArts Entertainment Co.

symbols

thing Sun
flex RotateTime

message startup
message pulse

end

# ================================================== ======================================

code

startup:

SetPulse(RotateTime);
Return;

pulse:

PrintVector(GetThingPos(Sun));
RotatePivot(Sun, 0, RotateTime);
Return;
end


What could be wrong?

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.

GuNbOy
03-23-2003, 01:18 PM
RotatePivot(); will rotate the sun around its own pivot, not around something else's.

Also, the move should be move=physics unless you are going to use frames to move it, which would be a lot easier IMO. Also the tpye=weapon should be used if you want to set the velocity or use ApplyForce() and have it use relative axis instead of world axis.

------------------
I'm just an old man with a skooma problem.

Emon
03-23-2003, 01:56 PM
No, RotatePivot() rotates around a frame in the object, which you specify. I got it working, since before I didn't realize you needed to specify PYR in the frame for it to work. Only trouble now is getting it to match up with the sun in my skybox.

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.

gbk
03-23-2003, 02:28 PM
Attachthingtothingex(Sun, Skybox, 0xE);

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');

[This message has been edited by GBK (edited March 23, 2003).]

Emon
03-23-2003, 07:21 PM
I did that, GBK, it didn't work. It does not make the sun light pivot around the center of the skybox, and that pivot is in a totally different area of the map.

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.

Emon
03-23-2003, 07:27 PM
Well I converted my skybox to a skysphere (made in 3ds max by spherizing the textured cube, no distortions or misalignments at all), or more specifically, a starsphere. Not only does it look much better, but aligning the light is much easier.

Then I realized a few minutes before posting this that instead of trying to find the proper values for RotatePivot() (for the frame that specifies pivot) to match up with the (2/4/6) angvel on my starsphere ((2/4/6) wasn't the same for the frame on the RotatePivot()), I can simply use another RotatePivot() on my starsphere, and once I find good values for that, I'll just use them on the moving light. http://forums.massassi.net/html/redface.gif

------------------
Bassoon, n. A brazen instrument into which a fool blows out his brains.