Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (vicknick, 7th_zorro, 1 invisible), 890 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 4 1 2 3 4
Re: Falling Damage [Re: Ruben] #456984
12/17/15 20:08
12/17/15 20:08
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Okay, I am sure that I can figure out how to inflict falling damage on the player now. Thank you again Wjbender! :-)

Re: Falling Damage [Re: Ruben] #456985
12/17/15 20:09
12/17/15 20:09
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

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: Wjbender] #456986
12/17/15 20:17
12/17/15 20:17
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
I am sure I was missing the hints. I really do appreciate all the help you all give, helping this struggling programmer along.

Re: Falling Damage [Re: Ruben] #456987
12/17/15 21:46
12/17/15 21:46
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline 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):

Code:
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 Offline
Senior Member
Dico  Offline
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
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
>= is nested inside of <= ..again


Compulsive compiler
Re: Falling Damage [Re: Wjbender] #456990
12/18/15 01:50
12/18/15 01:50
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
It looks like I will have to go by distance to give falling damage to the player, rather than time. The time_elapsed value seems to change, when done over and over again with the same exact scenario.

Re: Falling Damage [Re: Ruben] #456991
12/18/15 02:33
12/18/15 02:33

M
Malice
Unregistered
Malice
Unregistered
M



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: Ruben] #456992
12/18/15 02:52
12/18/15 02:52
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
I finally got it to work! Thank you all for your help, especially Wjbender. Your advice started the avalanche of me figuring it out. Thank you.

Re: Falling Damage [Re: Dico] #456993
12/18/15 02:53
12/18/15 02:53
Joined: Jun 2010
Posts: 590
California
Ruben Offline OP
User
Ruben  Offline OP
User

Joined: Jun 2010
Posts: 590
California
Originally Posted By: Dico
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.
Page 3 of 4 1 2 3 4

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1