[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - changing view point?

changing view point?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

changing view point?

Postby RooT » Tue Sep 13, 2005 4:55 am

what im trying to do is have an entity in the map "info_camera" direct the view of all clients. the camera is stationary, and everyone sees the arena from this position. the main problem im having is setting the players view position.

________________
| o |
| |
| / o |
| . [
| \ |
| o |
|_______________|

. = camera spot
o = clients
[ = door
/ and \ are the angle that the camera can see, it doesnt move.


so what from what i understand i need to spawn a camera entity for each client (because i want different rooms to activate this same type of camera in their own room, while some clients may be in others) i used a chase cam and tried to edit it to simply move to a spot on the map but it didnt work right. so im at the point of just trying to code an origin into the file, making it imposible to map for and thus not very useful. if you have any ideas let me know, prefferably by private message so i can write back easier. thanks
-Root one

Mod Status:
Turret Defense: 30%
UPS: 45%
User avatar
RooT
 
Posts: 40
Joined: Wed Sep 07, 2005 1:28 am

Postby Error » Tue Sep 13, 2005 5:19 am

RooT: you should definately come to the IRC chatroom on the irc.anynet.org server. in #qc
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby Spike » Tue Sep 13, 2005 6:55 am

Sounds like you want something like alone in the dark.
Where there's one camera in each room (or two, for those hard to reach areas...).

Are these cameras ever going to actually move?
If not, you can just position a camera entity, and use the svc_setview protocol, which is designed to set a player's view entity. So you send it to the moving player, send the camera entity, and the player will see from the camera entity rather than thier own. A handy trick. To undo it, just set the view back to the player.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Sajt » Tue Sep 13, 2005 8:37 am

The biggest thing to know is: the camera entity NEEDS a model (set with setmodel), because otherwise the entity is not sent to the clients, so when you use SVC_SETVIEW it will be pointing to a nonexistant entity.

Get a null model (model of 1 tiny polygon), or better, a null sprite (fully transparent sprite) and use that.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

god damnitttt

Postby RooT » Tue Sep 13, 2005 5:58 pm

hah i cant get this to work, so far i have this:

entity (entity cli) Find_Camera = //called pre_think if self.foundcam = 0
{
local entity spot;

self.weaponmodel = ""; //For cam view
spot = findradius(cli.origin, 50000); // find command, this is were i think im messing up, because im not sure what exaclty this does. i believe if searches the specified radius from cli.origin for any entities, and that entity becomes spot. so spot is checked for its classname, wich the camera has as "cam" so it should be found?
while (spot)
{
sprint(cli,"Searching for camera"); //reports that an entity is found
// cli.SVC_SETVIEW = spot; //tried to use that? lol doesnt work tho
if (spot.classname == "cam") // so an entity with cam classname (only the camera)
{
cli.camfound = 1; //will stop searching in client.qc
sprint(cli,"Camera found!");
return;
}
spot = spot.chain; //if no cam found, try another entity?
}
sprint (cli,"No camera!\n"); //if all ent's are not camrea
cli.camfound = 1;
};

void () info_camera = //put in through map editor
{
self = spawn();
setmodel (self,"progs/v_shot.mdl"); // just so i can see it
self.classname = "cam"; //classname used to find in above
setorigin (self, self.origin);
self.movetype = MOVETYPE_NONE;
self.solid = SOLID_NOT;
};//this whole thing may be worng, not sure hah

well you can see i have some idea of what im doing, but maybe not the best. i want when a client's .camfound != 1 it should search for a camera on the map and return that cameras view to the client. ughh this is so aggrivating and essential to this mod lol. well thanks for all your help so far everyone
-Root one

Mod Status:
Turret Defense: 30%
UPS: 45%
User avatar
RooT
 
Posts: 40
Joined: Wed Sep 07, 2005 1:28 am

Postby Spike » Tue Sep 13, 2005 9:41 pm

somewhere in defs.qc:
float SVC_SETVIEW = 5;


Instead of '// cli.SVC_SETVIEW = spot;':
msg_entity = cli;
WriteByte(MSG_ONE, SVC_SETVIEW);
WriteEntity(MSG_ONE, spot);
cli.angles = spot.angles;
cli.fixangle = TRUE;



in info_camera, strip out the line self = spawn()
inside spawn functions, self is spawned by the engine, and it's fields are filled with the map data.


Personally I'd use the find builtin instead of findradius, but that's just me.

Of course, that code will allow only one camera, but should give _a_ result.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 3 guests