Forum

Q3 jumppad

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Q3 jumppad

Postby lukas2288 » Fri Jun 19, 2009 4:57 am

Hello qc guys,
when you load a q3 map in darkplaces with jumppads (q3dm17 for example)you can move on air but in q3 engine you cannot.Is there some way how to fix it in quake1 trigger_push?
________
NARUTO ADVICE
Last edited by lukas2288 on Tue Mar 08, 2011 12:48 am, edited 1 time in total.
lukas2288
 
Posts: 42
Joined: Sun Jun 14, 2009 4:40 pm

Postby Spike » Fri Jun 19, 2009 6:50 am

set the player's teleport_time field.
This field is meant to prevent the player from changing their velocity for a period of time. But you will need to calculate when the player will land.


Actually, in Q3 you can change your velocity. The issue is that in Q1 if you try accelerating contrary to your current velocity you stop very fast, while in q3 you keep your speed but slowly change direction.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

try this

Postby SpannA » Wed Jul 01, 2009 1:51 am

This is my Quake3 mod it has jumppads in it
viewtopic.php?t=1384

and the source is with it . good luck
SpannA
 
Posts: 16
Joined: Mon Jan 12, 2009 10:35 pm
Location: Auckland

Postby Scrama » Fri Aug 28, 2009 6:37 am

I try to improve trigger_push to save direction of player movement.
Original code (triggers.qc\trigger_push_touch) looks like
Code: Select all
other.velocity = self.speed * self.movedir * 10;

I've added 1/10 of old entity velocity
Code: Select all
other.velocity = other.velocity * 0.1 + self.speed * self.movedir * 10;

but in game it kicks me up only for a half of height. My 'debug' code now looks like
Code: Select all
      //   scrama: save direction
      bprint("velocity ");
      bprint(vtos(other.velocity));

      vel1 = other.velocity * 0.1;
      bprint(" -> ");
      bprint(vtos(vel1));

      vel2 = self.speed * self.movedir * 10;
      bprint(" \n ");
      bprint(vtos(vel2));

      other.velocity = vel1 + vel2;
      bprint(" \nresults  ");
      bprint(vtos(other.velocity));
      bprint("\n");

And all vectors are fine:
velocity '320.0 23.1 0.0' -> '32.0 2.3 0.0'
'0.0 0.0 1070'
results '32.0 2.3 1070'

WTF and what to do?

Also, I've changed SetMoveDir as
Code: Select all
void() SetMovedir =
{
   local vector   org;
   local entity   t;
   
   if ((self.classname == "trigger_push")&&(self.target))
   {
      t = find (world, targetname, self.target);
      if (t)
         {
            org = self.mins + self.size * 0.5;
            org = normalize(t.origin - org);
            self.movedir = org;
            return;
         }
   }
   if (self.angles == '0 -1 0')
      self.movedir = '0 0 1';
   else if (self.angles == '0 -2 0')
      self.movedir = '0 0 -1';
   else
   {
      makevectors (self.angles);
      self.movedir = v_forward;
   }
   
   self.angles = '0 0 0';
};

But it works only in new maps, of couse...
User avatar
Scrama
 
Posts: 20
Joined: Fri Aug 28, 2009 6:16 am
Location: Siberia, Omsk

Postby Spike » Fri Aug 28, 2009 7:25 am

Q3 jumppads are coded such that the player will stike the targetted point.
This means that you need to consider gravity and its affect over the duration needed to get from a to b.
I don't know the required formula, but that's what your code lacks.
Spike
 
Posts: 2892
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 1 guest