Fortress Forever

Go Back   Fortress Forever > Community > General Discussion

Closed Thread
 
Thread Tools Display Modes
Old 05-29-2008, 07:46 PM   #1
Spider-Waffle
 
Join Date: Jul 2007
Posts Rated Helpful 0 Times
How was auto jump feature coded?

I'm trying to get a HL single player mod made with a really good auto jump feature like FF has. I was wondering how it works. Does it spam +jump commands, or does it have a way telling when you hit ground and makes you jump as soon as you hit it?

What does it do to be more effective than a +jump;wait;-jump script or an auto hot key macro? I'm not wondering about the hold key and then it jumps feature, that's obvious how to code; I'm wondering how it was made to keep your time spent the ground to a minimum. Less time on the ground than a basic spamming script or macro. And is it possible to have the time on the ground be zero?

Last edited by Spider-Waffle; 05-29-2008 at 11:31 PM.
Spider-Waffle is offline  


Old 05-29-2008, 08:11 PM   #2
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
what the hell is a "spider waffle"??
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline  


Old 05-29-2008, 08:27 PM   #3
v3rtigo
Lock 'n Loll!
 
v3rtigo's Avatar
 
Join Date: Sep 2007
Location: 2fort
Class/Position: Scout, Spy, Sniper
Gametype: CTF
Posts Rated Helpful 0 Times
Well, my tiny brain says it might be a variable that switches off after the player is on the ground for 0.x seconds and that turns on when you jump. Either way, it's nothing like a script...

.. I think

I'd actually like to know too, is a code snippet possible?
v3rtigo is offline  


Old 05-29-2008, 08:33 PM   #4
Circuitous
Useless
Retired FF Staff
 
Join Date: Jun 2005
Class/Position: D Soldier, O Scout
Gametype: AvD
Posts Rated Helpful 9 Times
Send a message via AIM to Circuitous Send a message via MSN to Circuitous Send a message via Yahoo to Circuitous Send a message via Skype™ to Circuitous
Are you mother-fuckers coders?

No?

Then why are you replying?
__________________
Look at all those dead links.
Circuitous is offline  


Old 05-29-2008, 08:38 PM   #5
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
The real question is why is this a thread and not a PM?
__________________
#FF.Pickup ¤ Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington
squeek. is offline  


Old 05-29-2008, 08:49 PM   #6
Circuitous
Useless
Retired FF Staff
 
Join Date: Jun 2005
Class/Position: D Soldier, O Scout
Gametype: AvD
Posts Rated Helpful 9 Times
Send a message via AIM to Circuitous Send a message via MSN to Circuitous Send a message via Yahoo to Circuitous Send a message via Skype™ to Circuitous
I was wondering that myself but it was already here and he probably doesn't know who to PM.
__________________
Look at all those dead links.
Circuitous is offline  


Old 05-29-2008, 09:53 PM   #7
tu!
 
tu!'s Avatar
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
less whining more question answering...?!
tu! is offline  


Old 05-29-2008, 10:36 PM   #8
Suite307
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
Circuitous you need to calm teh feck down.
Suite307 is offline  


Old 05-29-2008, 11:03 PM   #9
Agent Buckshot Moose
Wiki Standards Team
Wiki Team
 
Agent Buckshot Moose's Avatar
 
Join Date: Mar 2007
Location: Geokill's closet
Class/Position: Sniper/Demoman
Gametype: CTF
Affiliations: :e0: Co-leader
Posts Rated Helpful 6 Times
Well I don't know the structure of the HL1 or HL2 SDK, but the easiest way I can think of to implement something like this is so (this is all pseudocode btw):

Code:
//a global variable to figure out if we're supposed to be jumping
bool jumping = false;

//in where ever key presses are handled
void processKeyDown(int key) {
     if (key == SPACE_BAR) //would replace this constant with a call to get the "jump key"
          jumping = true;
}

void processKeyUp(int key) {
     if (key == SPACE_BAR) //would replace this constant with a call to get the "jump key"
          jumping = false;
}

//the jump function --- this executes the entire process of moving the camera up & down.
void jump() {
     jumping = false;
     //move the camera up and down and deal with other stuff
}

//where ever the game loop is
void gameLoop() {
     //....
     if ((jumping) && (player.isOnGround()) //can't jump in midair
          jump();
     //....
}
Now the idea behind this is that when you press space to jump, and assuming you're on the ground, you will jump. Any time you press and hold the space bar again in the air, the if condition in the main game loop for jumping will fail because you're not on the ground. But of course as soon as you land, both will be successful and it will jump again. The jump function sets jumping to false so you are required to press the button again. Remove that if you just want to hold space to continuously jump over and over.

Now I just thought this up off the top of my head and of course actually implementing it into an HL Mod will probably be different, but that's the basics of it I think. It's not like I tested this or anything and it may have problems. But hopefully that should point you in the right direction.
Agent Buckshot Moose is offline  


Old 05-29-2008, 11:08 PM   #10
פֿяαιп βαмαgεפ
Annoying people since 1986
 
פֿяαιп βαмαgεפ's Avatar
 
Join Date: Sep 2007
Location: Belgium a.k.a. absurdistan
Class/Position: O fatty, pyro - D engy, pyro
Gametype: CTF
Affiliations: This space for rent.
Posts Rated Helpful 1 Times
Send a message via MSN to פֿяαιп βαмαgεפ
Quote:
Originally Posted by GambiT
what the hell is a "spider waffle"??
פֿяαιп βαмαgεפ is offline  


Old 05-29-2008, 11:11 PM   #11
GeoKill----->
Community Member
Server Owner
Beta Tester
Forum Moderator
 
GeoKill----->'s Avatar
 
Join Date: Mar 2007
Location: Hawthorne, California
Class/Position: Soldier/Spy/Scout
Gametype: AvD
Affiliations: :e0:Eternal Order Leader
Posts Rated Helpful 12 Times
Not sure how that answer his question but ok.....
__________________

:e0: Will live on Forever
Support FF:
GeoKill-----> is offline  


Old 05-29-2008, 11:22 PM   #12
Gator-
FF God
 
Gator-'s Avatar
 
Join Date: May 2007
Location: TX
Class/Position: Scout O, Medic O, Demo D/O, Soldier D
Gametype: CTF 4v4
Affiliations: [milkwood] ( GoodFellas )
Posts Rated Helpful 1 Times
Send a message via AIM to Gator- Send a message via MSN to Gator- Send a message via Yahoo to Gator-
Circuitous needs to ban himself. Great way to represent a struggling mod. Grow up. No, this is not your first time insulting / attacking people. Do you not have something better to do? How sad.
Gator- is offline  


Old 05-29-2008, 11:37 PM   #13
Spider-Waffle
 
Join Date: Jul 2007
Posts Rated Helpful 0 Times
What I really want to know is if it spams jump, how was is made to spam jump extra fast, or if it can tell when your on the ground and jumps one time at the exact right time, how does it do this? Or maybe it uses some method which is neither of these.

I was thinking there must be some flag in HL which lets the jump event happen, some variable which indicates when you're on jumpable ground. Seems like you could use this.


I didn't make this a PM because I don't know who knows how the code works, or who wrote it.
Spider-Waffle is offline  


Old 05-29-2008, 11:45 PM   #14
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Quote:
Originally Posted by Spider-Waffle
I didn't make this a PM because I don't know who knows how the code works, or who wrote it.
Jiggles would be your best bet with anything code-ish.
__________________
#FF.Pickup ¤ Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington
squeek. is offline  


Old 05-30-2008, 12:06 AM   #15
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
spider-waffle, i wasnt being mean when i asked what it was, it was a joke/honest question, is it a term for something?

there are several ppl you can pm who can help you, or send you to the person who can. but please, dont hesitate to make a thread for a valid question such as this.

we're glad to help when we can, sorry i know nothing about this, but if you get a mapping/texture problem come to me!
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline  


Old 05-30-2008, 12:06 AM   #16
Jester
Fortress Forever Staff
 
Jester's Avatar
 
Join Date: Sep 2007
Class/Position: O: Scout
Affiliations: {NFO} - New Family Order
Posts Rated Helpful 0 Times
My guess is that it is jumping whenever the player hits the ground, not spamming jump. Spamming jump would give the player lag in other commands(shooting, etc).
Jester is offline  


Old 05-30-2008, 12:29 AM   #17
Circuitous
Useless
Retired FF Staff
 
Join Date: Jun 2005
Class/Position: D Soldier, O Scout
Gametype: AvD
Posts Rated Helpful 9 Times
Send a message via AIM to Circuitous Send a message via MSN to Circuitous Send a message via Yahoo to Circuitous Send a message via Skype™ to Circuitous
PM Jiggles and see if he can answer you.

Useless posts deleted, unnecessary thread locked.
__________________
Look at all those dead links.
Circuitous is offline  


Old 05-30-2008, 12:31 AM   #18
GeoKill----->
Community Member
Server Owner
Beta Tester
Forum Moderator
 
GeoKill----->'s Avatar
 
Join Date: Mar 2007
Location: Hawthorne, California
Class/Position: Soldier/Spy/Scout
Gametype: AvD
Affiliations: :e0:Eternal Order Leader
Posts Rated Helpful 12 Times
lolz what was the point of deleting the post when your locking it...
__________________

:e0: Will live on Forever
Support FF:
GeoKill-----> is offline  


Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:18 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.