Journal #5851

Posted 14 years ago2009-06-07 18:19:45 UTC
Tetsu0 Tetsu0Positive Chaos
OMFG! After 3 days (Probably totaling about 15 hours) I finally got the camera-rigging in my map working properly!
So I now have the foundation for my first SP source map layed out.
It will be a Zelda-Like map. The old-skool zeldas Where you can explore a screen only so far, then once you reach the edge of the screen, the camera scrolls to the next screen/room so on and so forth.

I can't beleive how simple it was. Let me tell you guys how i accomplished this:

So the way my test map is layed out, i have 9 rooms each numbered with a room number just like it is on a keypad:

X-direction: 1-2-3
Y-direction: 1-4-7

I have a func_movelinear set on the X-direction with it's origin in line with the middle of room 1. I have the max distance set to 1408, because that's the distance from room 1 to room 3. I have another func_movelinear set up similar for the Y-direction. If you can't see that, here's a visual:
User posted image
So when you move from room 1 to room 2, the camera is parented to "screen_x" and the "SetPosition" of "screen_x" is set to .5. Since room 2 is half the distance to room 3, "screen_x" (and the parented viewcontrol [Camera] ) move to room 2.
Say if you wanted to move to room 5 from room 2, the camea is then parented to the "screen_Y" entity, and then it's setposition is set to .5 as well.

Every time you parent the camera to another object it stays in the same position while being parented.

I was trying to move the parented object the whole time while i only needed to move the camera...

Anyway. Now i can focus on the mind-games within the game instead of the mechanics. Which i have functioning!
Here's a screenshot
User posted image
Don't pester me about the lighting, that'll come later. I wanted to get the mechanics down before i messed with looks.

5 Comments

Commented 14 years ago2009-06-07 18:29:35 UTC Comment #48799
Cool. You should look at my zelda tiles example map >_>
Commented 14 years ago2009-06-07 18:38:14 UTC Comment #48797
Here's to figuring out new things. Congrats.

I've been trying to experiment with water for a water themed map that I have in mind for TF2. I managed to get scrolling water working thanks to Kaspergs old CSS map to which I decompiled, ZING.
Commented 14 years ago2009-06-07 18:39:05 UTC Comment #48800
Are you making it around being an ant-lion? If so that may be kick-ass!
Commented 14 years ago2009-06-07 20:39:53 UTC Comment #48798
@ Penguin - Saw that it was awesome!
@ Habboi - Thank you :) i've never worked so hard on getting one thing to work.
@ Saw - Yes, you play as an antlion
Commented 14 years ago2009-06-08 15:17:21 UTC Comment #48801
very cool can't wait to plai it!

You must log in to post a comment. You can login or register a new account.