Raised This Month: $51 Target: $400
 12% 

Conservation of Momentum fix 1.0.1 - Elevators fix


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Gameplay       
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 11-02-2014 , 10:48   Conservation of Momentum fix 1.0.1 - Elevators fix
Reply With Quote #1

Conservation of Momentum Fix - v1.0.1 by Kidev
A simple physic fix


Description:

Tired of getting fall damage because you jumped in an elevator? In real life, jumping in an elevator moving down or up at a constant speed will be the same as if you jumped on the floor. But in Gold Src games, it's bugged. This plugin simply fixes it.


Note:

- In some Gold Src games (like Opposing Force, in the monorail for exemple), jumping while you're in an entity moving forward will push you back. To fix this, simply replace in the source code
PHP Code:
new const giAxis] = { 00}; 
by
PHP Code:
new const giAxis] = { 11}; 
Known bugs:

- If you jump quickly in a moving entity (bhop), some jumps may still be bugged.


Changelog:

Code:
v1.0.1  @ 02/11/14
* Code optimized 
v1.0.0  @ 02/11/14
^ First public release
Credits:

HamletEagle - For some optimizations
fysiks - For some optimizations


Current version (stable):
Attached Files
File Type: sma Get Plugin or Get Source (momentumfix_1.0.1.sma - 642 views - 1.3 KB)

Last edited by Kidev; 11-20-2014 at 19:01.
Kidev is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-02-2014 , 10:53   Re: Conservation of Momentum Fix
Reply With Quote #2

This remind me about Physic subject in secondary school.
Quote:
Originally Posted by -Kid- View Post
In real life, jumping in an elevator moving down or up at a constant speed will be the same as if you jumped on the floor. But in Gold Src games, it's bugged. This plugin simply fixes it.
Maybe, in Gold Src games there is an external force that acted upon the system which make it bugged. ;)

Nice, -Kid-.

Last edited by zmd94; 11-02-2014 at 11:12.
zmd94 is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 11-02-2014 , 11:01   Re: Conservation of Momentum Fix
Reply With Quote #3

You picked a nice issue. Good job. Keep working on it.
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-02-2014 , 11:26   Re: Conservation of Momentum Fix
Reply With Quote #4

Code:
for ( i = 0; i < 3; i++ ) {         flEntPlayerIsOnSpeed[ i ] = flSpeed[ i ]; }
This should work too:
Code:
flEntPlayerIsOnSpeed = flSpeed

Also you should check if AMXX_VERSION_NUM < 183 and define MAX_PLAYERS.

GoldSrc engine has some bugs, glad to see that there are peoples which try to fix them.
__________________

Last edited by HamletEagle; 11-02-2014 at 11:27.
HamletEagle is offline
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 11-02-2014 , 14:38   Re: Conservation of Momentum Fix
Reply With Quote #5

Thank you all!
Quote:
Originally Posted by HamletEagle View Post
you should check if AMXX_VERSION_NUM < 183 and define MAX_PLAYERS.
I'm modifying this right now.
__________________

Last edited by Kidev; 11-02-2014 at 16:55.
Kidev is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-02-2014 , 15:14   Re: Conservation of Momentum Fix
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
This should work too:
Code:
flEntPlayerIsOnSpeed = flSpeed
That is not the proper way to assign arrays.

In this case, you can simply do this:
Code:
entity_get_vector(iEnt, EV_VEC_velocity, flEntPlayerIsOnSpeed);
__________________
fysiks is offline
Old 11-02-2014, 16:55
Kidev
This message has been deleted by Kidev. Reason: fail
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 11-02-2014 , 17:42   Re: Conservation of Momentum Fix
Reply With Quote #7

Here it is, updated.
__________________
Kidev is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 11-02-2014 , 18:55   Re: Conservation of Momentum Fix
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
That is not the proper way to assign arrays.

In this case, you can simply do this:
Code:
entity_get_vector(iEnt, EV_VEC_velocity, flEntPlayerIsOnSpeed);
Can you explain why? I don't know how exactly that can be wrong also, it's correct but wrong (?)
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-02-2014 , 20:24   Re: Conservation of Momentum fix 1.0.1 - Elevators fix
Reply With Quote #9

Array assignment is valid when both arrays have the same size. This is just another compiler tip among others.
__________________

Last edited by Arkshine; 11-03-2014 at 05:18.
Arkshine is offline
Kidev
Veteran Member
Join Date: Jun 2010
Location: France
Old 11-03-2014 , 07:00   Re: Conservation of Momentum fix 1.0.1 - Elevators fix
Reply With Quote #10

Ok it's good to know! But it wasn't needed here finally since the method I used was redundant. I changed it.
__________________

Last edited by Kidev; 11-03-2014 at 07:02.
Kidev is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:36.


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