View Full Version : New game, old engine...
[SF]pjb
03-22-2003, 08:35 AM
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.....
Edward
03-22-2003, 09:41 AM
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:
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
entered:
for(i=1; i<9; i=i+1)
{
If(GetSenderRef()==rsector1[i])
{
SetCameraFocus(1,rcam1[i]);
}
}
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[i] 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
# 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');
If you need additional cameras, use this one for the rest...
# 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');
[SF]pjb
03-22-2003, 02:29 PM
Thanx GBK! :-)
------------------
I am pjb.
Another post......
another moment of my life wasted.....
GuNbOy
03-24-2003, 05:59 PM
A nifty effect to add would be to have the camera always looking at the player:
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.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.