2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Falling Damage
[Re: Ruben]
#456985
12/17/15 20:09
12/17/15 20:09
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
there are little hints in the reply's , places here and there without trying to be embarrassing ,such to try and nudge you towards seeing it , but don't worry happens to anyone.
Compulsive compiler
|
|
|
Re: Falling Damage
[Re: Ruben]
#456987
12/17/15 21:46
12/17/15 21:46
|
Joined: Jun 2010
Posts: 590 California
Ruben
OP
User
|
OP
User
Joined: Jun 2010
Posts: 590
California
|
Okay, I feel I am getting close, but not quite a cigar. When the player jumps and falls downward, or falls downward in mid-air after stepping off a ledge, the game is now beeping like crazy, when I use the below code, and stops beeping when the player's feet land on the floor (which is good):
action player_code()
{
...
DEBUG_VAR(my.GRAVITY_VAR, 225); // DECREMENTING RAPIDLY
// WHEN FALLING.
if(my.GRAVITY_VAR < -3.80)
{
beep(); // BEEP IS WORKING WHEN PLAYER IS FALLING,
// BEEPING LIKE CRAZY WHEN PLAYER FALLS
timer(); // TIMER SHOULD START WHEN PLAYER FALLS
if(my.GRAVITY_VAR >= -3.80)
{
time_elapsed = timer(); // TIMER SHOULD END WHEN
// PLAYER LANDS ON GROUND,
// AND RECORD TIME IN
// time_elapsed VARIABLE
}
}
DEBUG_VAR(time_elapsed, 275); // DISPLAYS time_elapsed
// VARIABLE, WHICH IS
// STAYING AT 0, EVEN
// AFTER PLAYER DROPS
c_move(me, move_vec, vector(0, 0, my.GRAVITY_VAR), USE_POLYGON |
IGNORE_PASSABLE | GLIDE);
if(c_trace(my.x, vector(my.x, my.y, my.z - my.FEET_HEIGHT), IGNORE_ME |
IGNORE_PASSABLE | IGNORE_PASSENTS | USE_POLYGON))
{
...
}
...
}
When the player falls downward, I notice the player's my.GRAVITY_VAR value rapidly decrementing below -3.80, to anywhere like -24 or so, until the player's feet land on the ground, to where my.GRAVITY_VAR goes back above or at -3.80 or so. The only problem is that time_elapsed is staying at 0. The timer does not seem to be starting. Does anyone see a glaring problem that I am just not noticing, that is making the timer not start, or work?
Last edited by Ruben; 12/17/15 21:53.
|
|
|
Re: Falling Damage
[Re: Ruben]
#456988
12/17/15 21:52
12/17/15 21:52
|
Joined: Feb 2012
Posts: 371
Dico
Senior Member
|
Senior Member
Joined: Feb 2012
Posts: 371
|
|
|
|
Re: Falling Damage
[Re: Dico]
#456989
12/17/15 21:54
12/17/15 21:54
|
Joined: Mar 2012
Posts: 927 cyberspace
Wjbender
User
|
User
Joined: Mar 2012
Posts: 927
cyberspace
|
>= is nested inside of <= ..again
Compulsive compiler
|
|
|
Re: Falling Damage
[Re: Ruben]
#456991
12/18/15 02:33
12/18/15 02:33
|
Malice
Unregistered
|
Malice
Unregistered
|
I'm not allowed to say this, because a moderator admonished me before. But if you pay me, I'll just write it, with a timer for fall time to damage rate.
But for free info, when using timers, makes sure time_step is in place, also you need extra steps to keep the frame rate in line, last if testing in window mode - for heavens sake lock the fps to 60 or you random fps shift can be as large as -100/+100 fps
Last edited by Malice; 12/18/15 02:35.
|
|
|
Re: Falling Damage
[Re: Dico]
#456993
12/18/15 02:53
12/18/15 02:53
|
Joined: Jun 2010
Posts: 590 California
Ruben
OP
User
|
OP
User
Joined: Jun 2010
Posts: 590
California
|
if you can send to me image that show me your level i will tell you if that work for you or not and i will understand too what you want to do exactly. I am sorry Dico, I did not mean to seem like I was ignoring you. I tried to send some images from my local computer, with no luck. I am guessing I have to send the images from a website.
Last edited by Ruben; 12/18/15 02:54.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|