Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → GetThingSector doesn't return -1 =(
GetThingSector doesn't return -1 =(
2001-12-13, 2:40 PM #1
I'm trying to find out if my ghost camera isn't in a sector. It'll cause HOM if it is, so I want it to move closer to the player if it's not in a sector. Problem is, GetThingSector(thing) returns the last sector that the thing was in if it's not in a sector. [http://forums.massassi.net/html/frown.gif] Any ideas?

------------------
-Hell Raiser
Cogging type person that does, umm, stuff.
"Free, your, mind."
-Hell Raiser
2001-12-13, 2:43 PM #2
Well, I pretty much drew a blank here, but possibly try giviing it a HYPER small collide size and turning collide on. Perhaps? Just a thought. Other than that I'm out man. Sry.
2001-12-13, 2:45 PM #3
I've tried doing that, making the camera fire away from the player real fast so it'll stop at walls, but it's all jittery and stuff. [http://forums.massassi.net/html/frown.gif] The ghost template doesn't move, so I set the offset in fireprojectile(), it's the only way I could get a non-jittery camera and believe me, I've tried lots of different things....

------------------
-Hell Raiser
Cogging type person that does, umm, stuff.
"Free, your, mind."

[This message has been edited by Hell Raiser (edited December 13, 2001).]
-Hell Raiser
2001-12-13, 9:10 PM #4
Fire a ghost projectile from the camera every time you want it to move closer, it will return a -1 if the cameras not in a sector.
2001-12-14, 6:25 AM #5
No, it doesn't. Just tried what you suggested, fire a ghost from the camera, and check the ghost (hell, I checked the camera too) and the both did not return -1.

------------------
-Hell Raiser
Cogging type person that does, umm, stuff.
"Free, your, mind."
-Hell Raiser
2001-12-14, 7:40 AM #6
Would there be a way to do it with vectors? Create a ghost object at the 'curpos' of the camera, then check the sector of the created ghost?

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-14, 8:47 AM #7
No really good idea, but:

You could try firing a fast projectile from the player in the direction that you want the camera to be. The projectile will be destroyed when it hits a wall and the camera-ghost can be created at it's position - and inside a sector.

If a pulse checking the distance between the projectile and the player finds that the proj is farther away than the camera should be, then create the camera at the projectile's location.

I know that's all hypothetical and I doubt it's even workable, but it's the best I can think of. [http://forums.massassi.net/html/frown.gif]

------------------
Incognito
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-12-14, 8:47 AM #8
I changed the 3rd person POV to cycle through 4 different distances (the pos being a ghost) when F1 is pressed, and not allowing 1st person. I tried creating another ghost from the ghost camera, but it didn't work. GetThingSector will return the last sector that the thing was in, or the last sector returned or something, anything but -1. =\

------------------
-Hell Raiser
Cogging type person that does, umm, stuff.
"Free, your, mind."
-Hell Raiser
2001-12-14, 8:50 AM #9
Hrmmmmmm, if it hits a wall, and it's within the distance I want, create the camera there, if it's further away than the pos I want, just create it at the pos. Interesting.........

------------------
-Hell Raiser
Cogging type person that does, umm, stuff.
"Free, your, mind."
-Hell Raiser

↑ Up to the top!