May 23, 2012, 02:36:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: small problem with jump  (Read 938 times)
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« on: August 27, 2009, 03:30:54 PM »

Hi!

When I press the jump button my character jumps up in the air. I want the jump animation to just play once.

But, to have the character jump for a while and not just drop I need space to be pressed continuosly. But this makes the jump anim repeat.

Any ideas?
Logged
zknack
Full Member
***
Posts: 207


View Profile
« Reply #1 on: August 27, 2009, 04:13:08 PM »

Is there a speed modifier for the jumping in the character.gsl file?

At work right now, but thought I remembered one?
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #2 on: August 27, 2009, 06:52:25 PM »

Quote
if (params.stringValue == "Jump")
      {
         if (params.floatValue >= 0.5f && lastJumpPressed < 0.5f)
            jumpPressed = true;
         lastJumpPressed = params.floatValue;
         return true;
      }

this is all I have for jump I think
Logged
zknack
Full Member
***
Posts: 207


View Profile
« Reply #3 on: August 27, 2009, 07:09:37 PM »

I'm hoping Squat or Gekido will chime in here, as they've tweaked with jump a *lot* thus far...
Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #4 on: August 27, 2009, 10:15:25 PM »

There should be a variable called something like "OnGround" that disables the jump button while he's in the air. There's much more to the jump code than what you've shown. That's just to take in the actual input. Look further into the code for another instance of the term "jump" and it should come up.

I wish I could help a lot more, but honestly my character doesn't jump properly at all and he never has. Right out of the box, using the templates and projects that came with GC, when I press jump all I get is an immediate teleport to the apex of the jump and then the character floats down. I really don't know wtF is wrong with the code as I've looked it over and over and I can't solve it. In all honesty, it's made GC completely and utterly goddamn useless to me and I have absolutely no plans to further pursuse a project on it while this is true. It's 98% of the reason I dont' do anything on this engine anymore. Sorry, but it's really really pissed me off to the Nth degree.

What you'd need to do in theory is track that the jump is continuously pressed and then keep the jump code running...but add an extra check so that when the jump button is released that it stops the upward force and settles it. That way you should effectively get a higher jump when holding the button.
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #5 on: August 28, 2009, 02:07:01 AM »

actually my character jumps good except that when holding in spacebar to make the character go all the way up the anim has maybe repeated itself 4 times and keeps doing it on the way down. If i still hold down space it keeps "jumping" on the ground
Logged
Ron
Sr. Member
****
Posts: 326


View Profile
« Reply #6 on: August 28, 2009, 03:36:45 AM »

Something simple, you probably already have it but just in case in your players opr file the last numerical value is a  flag for looping animations or just playing once.

AddAnimRange 0.83 1.03 0 ToShifter

I have mine set a 0 so the driver only makes the arm movement to the shifter one time. If I wanted it to loop, just put in a 1 instead.

If its not that, like squat said, just set a flag in your player script and turn it on and off.
Logged
Squat
Hero Member
*****
Posts: 592


View Profile
« Reply #7 on: August 28, 2009, 03:45:15 AM »

If you want Pixel, and none of these tips work, you can upload your character files and we can take a look at it. If you're worried, you can password protect it or keep it in a secure location and PM whoever you trust...like me. HA! Technically, the onground thing should disable the ability to jump again while jump is in progress. I know that when I disabled that part of the code, I could jump repeatedly and I'd launch into outer space, which is exactly what I've been trying to stop from happening. In the end, I think my problem is mostly due to collisions with render objects that are rather complex...I think.

I really really hate the default character script. It's busted as all hell and I'm starting to get very impatient with expecting any kind of updates..or the character examples we were promised sometime in early 2009. If 2013 rolls by with no help, I'm probably gonna give up all hope.
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #8 on: August 28, 2009, 04:07:40 AM »

Ok, at work now but I will post something later on.

I agree that the templates are somewhat...incomplete and hardly even works for the default lego man. If the lego man is not 100% how can someone expect us to make other characters at least 80%?

Let's hope the polishing face is coming up because the core of the engine is probably almost done now
Logged
zknack
Full Member
***
Posts: 207


View Profile
« Reply #9 on: August 28, 2009, 10:25:32 AM »

Another option with the jump animation issue (I know, this will sound horrid) is play the animation slower or
manually tweak the length in your animation app.

There are many higher end games that utilize a longer jump animation that is always the same length- but have a 'landing' animation play when the raycast value between player and ground hits less than 1 unit.


I think were I to re-write the jump I would just utilize a vertical 'add_force', that cues the jump up animation,
and play the landing animation when the raycast value equals less than 1 unit.

My secondary thoughts. Maybe they help, maybe no.
 
Logged
gekido
Guest
« Reply #10 on: October 15, 2009, 12:40:31 PM »

Most games break the jump animation into multiple seperate animations - there is the 'start to jump' animation, which is the actual crouch / starting motion, then there is the 'hang time' animation for when the character is actually in the air, and then finally there is a land animation.

you can also alternately set whether you want an animation to loop or not at the end - this is what things like death animations do for example - you wouldn't want your death animation to loop over and over either.

Just simply put this line after the LoadAnimation call in your OPR file:

AnimLooped 0

For example, this is what I have defined in my soldier dude:

LoadAnimation Jump Jump.FBX
AnimLooped 0

LoadAnimation Land Land.FBX
AnimLooped 0

LoadAnimation Fall Fall.FBX
AnimLooped 0

LoadAnimation LandHard FallLandHard.FBX
AnimLooped 0
Logged
pixel_legolas
Hero Member
*****
Posts: 786


View Profile
« Reply #11 on: October 15, 2009, 02:29:52 PM »

Yes, that is quite handy but still need the code for making something happen once with a key Smiley

If for example my knight has made a swing and you have "make anything that hits the sword loose x HP" then you don't want it to deduct x HP forever if holding down a key. It should only deduct x HP once per keystroke Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!