Announcement

Collapse
No announcement yet.

[QuakeC] Troubles with .velocity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [QuakeC] Troubles with .velocity

    I try to improve trigger_push to save direction of player movement.
    Original code (triggers.qc\trigger_push_touch) looks like
    Code:
    other.velocity = self.speed * self.movedir * 10;
    I've added 1/10 of old entity velocity
    Code:
    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:
    		//	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?
    No tears please, it’s a waste of a good suffering!

  • #2
    Hey Scrama ...

    I recommend QuakeC questions be asked at Inside3d Forums :: Index

    Far more QuakeC coders there and therefore more people looking at your issue.
    Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

    So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

    Comment


    • #3
      Ok )
      No tears please, it’s a waste of a good suffering!

      Comment


      • #4
        Yea, you need to post this on the other site, but simply the new equation lacks parenthesis -

        other.velocity = (other.velocity * 0.1) + (self.speed * self.movedir * 10);

        ...but I am guessing here, and there's other combinations of parenthesis that are possible.

        Comment


        • #5
          >> but simply the new equation lacks parenthesis
          All calculations is right, i don't understand why engines (qrack, dp, bjp) kicks player with z-velocity 1070 like it is only 500-600.
          No tears please, it’s a waste of a good suffering!

          Comment


          • #6
            ticrate and fps come into the equation as well...

            Comment


            • #7
              to save the direction would be
              Code:
              	other.angles = vectoangles(other.velocity);
              www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

              Comment

              Working...
              X