Forum

problem with my ladder

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

problem with my ladder

Postby Nahuel » Fri Dec 02, 2011 3:17 pm

hello forum, I'm trying to make my own ladder (almost a clone of quoth). And so far the ladder works quite well. But I have a small problem, when I press the buttons strafe left or strafe right, the player up or down the ladder as if he were pressing forward or backward buttons.
Here you can see a piece of code in playerprethink

Code: Select all
if (self.velocity)
{
local float up;
up = normalize(self.velocity) * v_forward;

if (up > 0)
{            

     if (self.angles_x > 10)
    {         
    self.velocity = '0 0 160';
    }
    if (self.angles_x < 10)         
    {
    self.velocity = '0 0 -80';
    }
}
if (up  < 0)
{            
    if (self.angles_x > 10)
    {         
    self.velocity = '0 0 -160';
    }
    if (self.angles_x < 10)         
    {
    self.velocity = '0 0 80';
    }
}
}



playerprethink uses "makevectors (self.v_angle);" but I see that "up = normalize (self.velocity) * v_forward," does not detect if I press "forward" or "backward" only works with the player's angles. Is there any way that the game knows if I press the button "forward" or "backward" than the "strafe left" or "strafe right "?? What solution or suggestion can you give me ? Thanks in advanece :)


PD = i am not using darkplaces, so i cant use "movement"
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: problem with my ladder

Postby Baker » Fri Dec 02, 2011 3:27 pm

I don't claim to know how to solve complaints about how the ExtraR4 ladders work. But want to point out a couple of alternate implementations of ladders :

[ 1) The ladders in Rubicon 2. Although I do not feel those are as intuitive. http://www.celephais.net/levels/files/r ... ec_src.zip I would assume that Metslime didn't use ExtrasR4 ladders for a reason, but don't claim to know what that would be. 2) Poking around in Xonotic git repository and see how they do ladders ... http://dev.xonotic.org/projects/3/wiki/Git ... but since you stated you aren't using DarkPlaces I do not believe that'd be an option.]
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: problem with my ladder

Postby Nahuel » Fri Dec 02, 2011 3:45 pm

Baker wrote:I don't claim to know how to solve complaints about how the ExtraR4 ladders work. But want to point out a couple of alternate implementations of ladders :

[ 1) The ladders in Rubicon 2. Although I do not feel those are as intuitive. http://www.celephais.net/levels/files/r ... ec_src.zip I would assume that Metslime didn't use ExtrasR4 ladders for a reason, but don't claim to know what that would be. 2) Poking around in Xonotic git repository and see how they do ladders ... http://dev.xonotic.org/projects/3/wiki/Git ... but since you stated you aren't using DarkPlaces I do not believe that'd be an option.]

Hello Baker, actually my ladder is based a bit on Rubicon 2 ladder code, I just changed the "button2" stuff and deleted other. I am coding my ladder to work on most engines, Darkplaces included.
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: problem with my ladder

Postby Seven » Fri Dec 02, 2011 4:11 pm

Hello Nahuel,

I once had a similar issue like you have now.
You say, that you dont use DP, so the .vector movement is no option (just as you said).

But Spike gave me another way to detect it.
Please read here:
viewtopic.php?f=2&t=4236

I hope this helps you a bit.
Have fun climbing ladders ;)

Best wishes,
Seven
Seven
 
Posts: 301
Joined: Sat Oct 06, 2007 8:49 pm
Location: Germany

Re: problem with my ladder

Postby Nahuel » Fri Dec 02, 2011 4:26 pm

thanks Seven, but that does not work. I do not know where is exactly the problem. I guess I should use something other than v_forward (or v_right) * self.velocity.
perhaps using "makevectors (self.angles)" but the truth is that I do not know how.
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 492
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: problem with my ladder

Postby goldenboy » Fri Dec 02, 2011 7:03 pm

Using clip brushes to simulate ladders is an age old trick that works in all engines.

Tbh I think that DP and FTE should be fixed to accept the extras ladder code - it's a problem with their physics.
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Re: problem with my ladder

Postby metlslime » Fri Dec 02, 2011 11:55 pm

Baker wrote:I would assume that Metslime didn't use ExtrasR4 ladders for a reason, but don't claim to know what that would be.


Actually, it's just that i wrote my ladder code a long time ago, before Extras existed. Nothing against the Extras ladder!
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Re: problem with my ladder

Postby Spike » Sat Dec 03, 2011 1:24 pm

the extra's ladder code a) setorigins the player into solid walls. b) requires that the server ticks over at a fixed and low 20 fps.

putting the player into solid walls is silly, as it'll just be moved out again (potentially jerky even in vanilla). requiring a fixed framerate can also fail with non-default cvar settings even in vanilla engines (and has never been reliable with quakeworld's defaults).
its not bug-free just because it appears to work in winquake. You could fix it with tracebox+frametime checks (I admit that not all engines have tracebox, thus fte's unsticking code is now more aggressive than any other qw engine purely to attempt to work around extras' ladder code).
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