Forum

so... i got that radar finally working...

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

so... i got that radar finally working...

Postby ceriux » Thu Oct 09, 2008 6:15 pm

and im kinda disappointed :( the radar works, but what it does is spawn a sprite where the spawn is and the sprite moves like you do in that position... it wasnt really what i thought it was :/ but oh well, atleast i did it ...

i also made my rocket launcher throw exploding body parts! :D
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Wazat » Thu Oct 09, 2008 8:26 pm

Yay! :D

With some alteration and using the right engine, you should be able to make that radar follow the player everywhere he goes with MOVETYPE_FOLLOW, and be visible only to him (in deathmatch, etc) using drawonlytoclient.
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby ceriux » Thu Oct 09, 2008 8:42 pm

i dont think iv ever even seen the 2nd thing you've listed before o.o i think i might get the first thing your talking about would it be something with this?




radar.owner = self;
radar.movetype = MOVETYPE_FOLLOW;
radar.nextthink = self + 3;
radar.think = MOVETYPE_FOLLOW (self);
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby Wazat » Thu Oct 09, 2008 9:18 pm

Not quite, but close. There are two ways to make it follow you. You're merging them together, which won't work. Here are examples:

1) Set its owner to the player, and its think to a function like this:
Code: Select all
void RadarFollow()
{
 makevectors(self.owner.v_angle);
 self.origin = self.owner.origin + v_forward*40 + v_right*20;
 self.think = RadarFollow();
 self.nextthink = time;

// Then the radar does its normal think stuff here

}


This will look jittery as the player moves, but it will work without special engine support.

2) Use MOVETYPE_FOLLOW, which is supported by engines like DP:

Code: Select all
radar.movetype = MOVETYPE_FOLLOW;
radar.solid = SOLID_NOT;
radar.aiment = player;
radar.punchangle = radar.angles;
radar.view_ofs = '40 20 0'; // I may be doing this wrong, haven't used this feature in a while


// then the radar uses its normal think without anything special.  For example:
radar.think = radar_think;
radar.nextthink = time;


If you want to use MOVETYPE_FOLLOW and .drawonlytoclient, you'll need to download the DP engine (or another similar engine) and look at its dpextensions.qc. That has the various features listed with (somewhat difficult) instructions on their use (it's also a file you'll need to add to your mod).
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Wazat
 
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Postby ceriux » Thu Oct 09, 2008 9:22 pm

so far, what iv been adding into my mod only works with DP hehe like the flash light i saw it work partially on another engine but barely, darkplaces seems to be the only one it works atleast partially right on.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest