Finally did it ..
- Tyne
- Pimp DC Devver
- Posts: 1684
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Wed Oct 17, 2001 7:44 pm
- Location: Canada, Ontario
- Has thanked: 0
- Been thanked: 1 time
- Contact:
Finally did it ..
Proper ladders in Quake complete with climbing animation, they'll appear in my survival horror mod Codename: Envenom. They work good!
EDIT: Forgot to mention, don't mind how ugly that ladder is - it's just a test level with a half assed job done on the ladder, the one in the first level looks a million times better and more realistic.
EDIT: Forgot to mention, don't mind how ugly that ladder is - it's just a test level with a half assed job done on the ladder, the one in the first level looks a million times better and more realistic.
-
- QuakeDev Respected
- Posts: 592
- Joined: Thu Mar 14, 2002 1:15 am
- Has thanked: 0
- Been thanked: 6 times
Looks very cool!
Create your own Dreamcast games using the Quake-Engine:
http://quakedev.dcemulation.org/develop/getstarted.htm
http://quakedev.dcemulation.org/develop/getstarted.htm
-
- DCEmu Ex-Mod
- Posts: 1416
- Joined: Sat Mar 09, 2002 1:21 pm
- Location: Disney World
- Has thanked: 0
- Been thanked: 0
- Tyne
- Pimp DC Devver
- Posts: 1684
- Joined: Wed Oct 17, 2001 7:44 pm
- Location: Canada, Ontario
- Has thanked: 0
- Been thanked: 1 time
- Contact:
Here's how I did it:
I have a trigger called "trigger_ladder", you need to set which direction the player climbs UP the ladder or else it'll just turn you around when you run into the trigger.
Once the trigger is touched it does 4 things:
- Sets corporals y angle to the ladders constantly
- Adds to corporal that his ladder_finished time is 0.1 (other.ladder_finished = time + 0.1;)
- Checks if the player (you) is pressing UP and if Corporal is 8 units at the top of the trigger it releases him off the ladder and sets "noladder" time + 0.5; and forces a FL_ONGROUND on Corporal
- It's exactly the same thing for going down although it does a droptofloor(); when he touches the bottom 8 units while you're holding down.
Now since the ladder is setting ladder_finished + 0.1; I have it checking if (corporal.ladder_finished > time && corporal.noladder_finished < time) and if that's TRUE then it does the following:
- Sets Corporal's X velocity and Y velocity to 0 constantly
- Turns off Corporal running flag so after you're done climbing he walks
- Sets his movetype to FLY (important)
- Checks if the player is pressing UP or DOWN and to move his Z velocity accordingly
- If the user isn't pressing up or down then just set his velocity to '0 0 0'
and remember that as long as Corporal is touching a trigger it's .touch function is called EVERY frame so having the ladder do a time of 0.1; is more then enough.
That's the movement completed, but animation now comes into play!
In corporals movement frames I added to the top:
// if on a ladder and NOT on the ground, play climbing frames
if (self.ladder_finished > time && !self.flags & FL_ONGROUND)
Player_Climb();
Then have Player_Climb(); cycle through the models climbing frames if the user is pressing UP or DOWN.. if you want to break out of Player_Climb(); to have him walk again I did the following:
if (self.ladder_finished < time || self.flags & FL_ONGROUND)
Player_Move();
and that's how it's done :P .. If you want me to post the full code then just ask.
This is another example of why my 2D camera kicks ass, you can check key presses done by the player and do stuff accordingly giving you a TON more freedom to do stuff then with regular quake.
I have a trigger called "trigger_ladder", you need to set which direction the player climbs UP the ladder or else it'll just turn you around when you run into the trigger.
Once the trigger is touched it does 4 things:
- Sets corporals y angle to the ladders constantly
- Adds to corporal that his ladder_finished time is 0.1 (other.ladder_finished = time + 0.1;)
- Checks if the player (you) is pressing UP and if Corporal is 8 units at the top of the trigger it releases him off the ladder and sets "noladder" time + 0.5; and forces a FL_ONGROUND on Corporal
- It's exactly the same thing for going down although it does a droptofloor(); when he touches the bottom 8 units while you're holding down.
Now since the ladder is setting ladder_finished + 0.1; I have it checking if (corporal.ladder_finished > time && corporal.noladder_finished < time) and if that's TRUE then it does the following:
- Sets Corporal's X velocity and Y velocity to 0 constantly
- Turns off Corporal running flag so after you're done climbing he walks
- Sets his movetype to FLY (important)
- Checks if the player is pressing UP or DOWN and to move his Z velocity accordingly
- If the user isn't pressing up or down then just set his velocity to '0 0 0'
and remember that as long as Corporal is touching a trigger it's .touch function is called EVERY frame so having the ladder do a time of 0.1; is more then enough.
That's the movement completed, but animation now comes into play!
In corporals movement frames I added to the top:
// if on a ladder and NOT on the ground, play climbing frames
if (self.ladder_finished > time && !self.flags & FL_ONGROUND)
Player_Climb();
Then have Player_Climb(); cycle through the models climbing frames if the user is pressing UP or DOWN.. if you want to break out of Player_Climb(); to have him walk again I did the following:
if (self.ladder_finished < time || self.flags & FL_ONGROUND)
Player_Move();
and that's how it's done :P .. If you want me to post the full code then just ask.
This is another example of why my 2D camera kicks ass, you can check key presses done by the player and do stuff accordingly giving you a TON more freedom to do stuff then with regular quake.
-
- QuakeDev Mod
- Posts: 1233
- Joined: Wed Oct 17, 2001 7:44 pm
- Location: Indpls, IN USA
- Has thanked: 0
- Been thanked: 0
- Contact:
-
- DCEmu Ex-Mod
- Posts: 1416
- Joined: Sat Mar 09, 2002 1:21 pm
- Location: Disney World
- Has thanked: 0
- Been thanked: 0
Yeah, it is all greek to me. However, considering that you need to set the direction, would it be possible to convert this "ladder" into a fence and do horizontal climbing. I guess it would be just as possible to have an invisible step where the character simply strafes while against the fence, but I was just curious.
Formerly Known As "Chalavet".....