Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get hitted when à object hit you whith certain speed
nkmol Offline
Senior Member

Posts: 252
Threads: 19
Joined: Feb 2011
Reputation: 4
#1
Get hitted when à object hit you whith certain speed

I'm wondering if it possibe to gain damage by a object that's hitting you whith a x amount of speed. If so, would be possible to measure one part of the model?

Let me explain, like you got a ball whith a rope. The rope and THE ball are attached to each other. Also, THE ball and THE rope are attached to à ceiling.
Would it be possible to measure the speed of that ball, when it release THE ceiling?

I hope you understanded my question :p
Thanks,
Nkmol Big Grin
07-20-2011, 02:07 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#2
RE: Get hitted when à object hit you whith certain speed

Very interesting! I feel spoiler'd but that's ok Smile I like your idea, sir.

Unfortunately there is no function (that I'm aware of) to check for the speed of a prop. You can, however, use some clever scripting.

As soon as you release the ball from the ceiling and it starts flying to the player, start a timer. Tweak it so that the timer ends as soon as the ball slows down to the speed at which you do NOT want it to cause player damage.

Then, use this function called by the collision between the ball and the player.

void BallCollidePlayer(string &in parent, string &in child, int state)
{
    //ball is parent, player is child

    if(GetTimerTimeLeft("ballspeedtimer") > 0) { //Player Gets Damaged! }
    else //Do whatever happens if the player touches it while it is slow (such as LESS player damage)
}

(This post was last modified: 07-20-2011, 02:35 PM by palistov.)
07-20-2011, 02:34 PM
Find
nkmol Offline
Senior Member

Posts: 252
Threads: 19
Joined: Feb 2011
Reputation: 4
#3
RE: Get hitted when à object hit you whith certain speed

yes interesting Smile
thanks for the advice, i'll experimate a lil Angel
07-20-2011, 03:48 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#4
RE: Get hitted when à object hit you whith certain speed

No problem! Glad to have helped Smile

07-20-2011, 03:57 PM
Find




Users browsing this thread: 1 Guest(s)