AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect trimping in scripts? (https://forums.alliedmods.net/showthread.php?t=282609)

mediumq 05-11-2016 23:26

Detect trimping in scripts?
 
I've just started familiarizing my self with amx scripting, so forgive me if this is a stupid question.

I'm trying to determine how to detect when a player double jumps off a ledge, or a ramp. Basically i'm trying to figure out how to tweak the physics so players can ramp slide, trimp again in TFC.

I haven't found a specific plugin that does that exactly. I've searched the forums and haven't found anything related to hl1 or TFC specifically.

Any help would be greatly appreciated.

abdobiskra 05-12-2016 13:12

Re: Detect trimping in scripts?
 
what do you mean about trimping ?
What is your problem Exct !

mediumq 05-13-2016 11:26

Re: Detect trimping in scripts?
 
I was able to figure this out. By measuring on_ground height, before a jump, and on_ground height after a jump, i was able to determine if a player was jumping to a higher level. I was also able to determine the time of the jump, since things like trimping, and ramp sliding is typically a quick short jump. i was able to use both of these data points, to then calculate a proper jump height increase.

Code:

static Float:jump_height = 273.333

if(time_dif < 0.3){
    velocity[2] += height_diff / time_dif + jump_height+160
}else if(height_diff < 75 && time_dif < 0.5){
    velocity[2] += height_diff / time_dif + jump_height+140
}else if(height_diff < 105 && time_dif < 0.6){
    velocity[2] += height_diff / time_dif + jump_height+120
}else {
    velocity[2] += jump_height
}

leaving out some of the variable declarations, but that's basically the core logic.

fysiks 05-14-2016 02:51

Re: Detect trimping in scripts?
 
So . . . what is "trimping"????

gabuch2 05-14-2016 18:57

Re: Detect trimping in scripts?
 
Quote:

Trimping = Quake technique that makes you jump higher if you jump on an inclined surface (e.g. a ramp). Some of your horizontal velocity is transfered into vertical velocity. This is not the same as sliding/rampsliding


All times are GMT -4. The time now is 18:39.

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