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 → New game, old engine...
New game, old engine...
2003-03-22, 5:35 AM #1
ok, you knwo all those nasty puzzels sloving games? like brokensowrd? or bioforge? where the camera is postioned in the room, and as you walk about you watch yourself moving, and when you go into a new room or part of the same one(a new secotr) you see a vew from a different camera!
this is what i want to do in my new MP level RPG, but only when in externail view, so you can shose whether to have it or not.
So basicaly what i want is a cog that will...

Not work when you have internail view online.
will work when you have externail veiw online.
If your in a perticular secotr it shows one camera view, while allowing you to walk around.
and will work for a infanite number of secotrs(or atleast a good few) per cog.

------------------
I am pjb.
Another post......
another moment of my life wasted.....
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-03-22, 6:41 AM #2
OK... Starting up the engine! Are the COGs moving?
[http://www.loria.fr/~roegel/gears-fast.gif]
Good! Lets start cogging!

We shall make a cog for each room. A room can have more than one sector. First the symbols:
Code:
symbols

message    entered

sector     rsector1
sector     rsector2
sector     rsector3
sector     rsector4
sector     rsector5
sector     rsector6
sector     rsector7
sector     rsector8

thing      rcam1
thing      rcam2
thing      rcam3
thing      rcam4
thing      rcam5
thing      rcam6
thing      rcam7
thing      rcam8

int        i    local

For every rsector you enter, the view will change to one of the rcams.
Now you want external to be external, right? Then this will be a little tricky. You will have to place you "ghost" cameras in a perticular way. You must know how steep the external camera looks. How steep does it look down on you. Then when you place your ghosts, place them at the up/down angle you want minus the external camera angle. If anybody else can explain better, please post now!
Time for the code!
Code:
code
entered:
        for(i=1; i<9; i=i+1)
        {
          If(GetSenderRef()==rsector1)
          {
            SetCameraFocus(1,rcam1);
          }
        }
return;

I think that's all! Now, SetCameraFocus() makes the view view through a different thing but the player. If you want the view to view though the player, simply replace rcam1 with GetLocalPlayerThing(). The number before that indicates what camera should set its focus. 1 is ex, and 0 is in. If you wish to switch between the 2, simply use this syntax: SetCurrentCamera(number);

/Edward
Edward's Cognative Hazards
2003-03-22, 7:37 AM #3
Code:
# 03/2003 GBK
Symbols
Message Startup
Message Crossed

Surface Adjoin0 LinkID=0
Surface Adjoin1 LinkID=1
Surface Adjoin2 LinkID=2
Surface Adjoin3 LinkID=3
Surface Adjoin4 LinkID=4
Surface Adjoin5 LinkID=5
Surface Adjoin6 LinkID=6
Surface Adjoin7 LinkID=7
Surface Adjoin8 LinkID=8
Surface Adjoin9 LinkID=9
Surface Adjoin10 LinkID=10
Surface Adjoin11 LinkID=11
Surface Adjoin12 LinkID=12
Surface Adjoin13 LinkID=13
Surface Adjoin14 LinkID=14

Thing Cam0=-1
Thing Cam1=-1
Thing Cam2=-1
Thing Cam3=-1
Thing Cam4=-1
Thing Cam5=-1
Thing Cam6=-1
Thing Cam7=-1
Thing Cam8=-1
Thing Cam9=-1
Thing Cam10=-1
Thing Cam11=-1
Thing Cam12=-1
Thing Cam13=-1
Thing Cam14=-1

End
Code
Startup:
Setcamerafocus(1, Cam0);
Stop;
Crossed:
Setcamerafocus(1, Cam0[Getsenderid()]);
Stop;
End



Try that one. Its based on adjoins. When the player crosses an adjoin, the view is switched to the corrosponding camera. On startup, external view will be tranferred to Cam0.

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');
And when the moment is right, I'm gonna fly a kite.
2003-03-22, 7:40 AM #4
If you need additional cameras, use this one for the rest...

Code:
# 03/2003 GBK
Symbols
Message Crossed

Surface Adjoin0 LinkID=0
Surface Adjoin1 LinkID=1
Surface Adjoin2 LinkID=2
Surface Adjoin3 LinkID=3
Surface Adjoin4 LinkID=4
Surface Adjoin5 LinkID=5
Surface Adjoin6 LinkID=6
Surface Adjoin7 LinkID=7
Surface Adjoin8 LinkID=8
Surface Adjoin9 LinkID=9
Surface Adjoin10 LinkID=10
Surface Adjoin11 LinkID=11
Surface Adjoin12 LinkID=12
Surface Adjoin13 LinkID=13
Surface Adjoin14 LinkID=14

Thing Cam0=-1
Thing Cam1=-1
Thing Cam2=-1
Thing Cam3=-1
Thing Cam4=-1
Thing Cam5=-1
Thing Cam6=-1
Thing Cam7=-1
Thing Cam8=-1
Thing Cam9=-1
Thing Cam10=-1
Thing Cam11=-1
Thing Cam12=-1
Thing Cam13=-1
Thing Cam14=-1

End
Code
Crossed:
Setcamerafocus(1, Cam0[Getsenderid()]);
Stop;
End


It doesnt switch the camera on startup....

------------------
Createthingatpos(GBK, 0, '0 0 0', '0 0 0');
And when the moment is right, I'm gonna fly a kite.
2003-03-22, 11:29 AM #5
Thanx GBK! :-)

------------------
I am pjb.
Another post......
another moment of my life wasted.....
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-03-24, 2:59 PM #6
A nifty effect to add would be to have the camera always looking at the player:
Code:
symbols
thing player local
thing camera=-1

message startup
message pulse

end

code

startup:

player = GetLocalPlayerThing();
SetPulse(.01);
Return;

pulse:

SetThingLook(camera, VectorNorm(VectorSub(GetThingPos(player), GetThingPos(camera))));
Return;
end


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

↑ Up to the top!