Raised This Month: $ Target: $400
 0% 

I need some coding help in my CS Rally Mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gema9923
Junior Member
Join Date: Jan 2007
Old 09-10-2008 , 21:27   I need some coding help in my CS Rally Mod
Reply With Quote #1

Here is my CS Rally Mod which made by me in last year

http://www.youtube.com/watch?v=q9bwz36rljM
http://www.kano-bi.com/gema/wp/?p=30

Since the the car physical is very bad
(the accer. speed is too fast , .. same speed on track and offroad
and the poor collision )
It do not feel driving a car at all.
So I stopped making this plugin.


Here is some feature that I need help..
1. Car Accelerate Calculation
2. Detecting Hiting a Wall
3. Detecting driving on grass/sand or on track(is this even possible?)
4. Use A and D to Steer .. but not mouse

My target is to make the control as realistic as possible in HL engine


Sorry for my poor english , I am from Hong Kong and English is not my first language
Thank you

Last edited by gema9923; 09-10-2008 at 21:48. Reason: typo
gema9923 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-11-2008 , 00:51   Re: I need some coding help in my CS Rally Mod
Reply With Quote #2

Please first provide the source code.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
gema9923
Junior Member
Join Date: Jan 2007
Old 09-11-2008 , 02:27   Re: I need some coding help in my CS Rally Mod
Reply With Quote #3

There is actually no source code in car moving part...
The code I used is just this

Code:
entity_set_float(id,EV_FL_friction,0.1)
gema9923 is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-11-2008 , 03:17   Re: I need some coding help in my CS Rally Mod
Reply With Quote #4

Quote:
Originally Posted by connorr View Post
Please first provide the source code.
Indeed.Maybe someone have better ways to make what you already have in plugin.

For steering with A and D, you can alter player _v_angles while he is holding down those buttons.
Alka is offline
gema9923
Junior Member
Join Date: Jan 2007
Old 09-12-2008 , 04:10   Re: I need some coding help in my CS Rally Mod
Reply With Quote #5

Quote:
Originally Posted by Alka View Post
Indeed.Maybe someone have better ways to make what you already have in plugin.

For steering with A and D, you can alter player _v_angles while he is holding down those buttons.
Thanks for the suggest .
Now the car can steer with A/D
However , how to stop the player using the mouse to looking around?
I want to view angle fixed to front thx

About the source code , I am at office now so I cannot copy to here
gema9923 is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-12-2008 , 04:56   Re: I need some coding help in my CS Rally Mod
Reply With Quote #6

Hmm, that's a problem, you must force the previous v_angle in prethink to stop mouse look.Once you pressed A or D , save the v_angle to a global then force that angle in prethink.
Alka is offline
Prajch
Senior Member
Join Date: Dec 2007
Location: anger++
Old 09-13-2008 , 00:18   Re: I need some coding help in my CS Rally Mod
Reply With Quote #7

For acceleration (if I understand what you want) you can add a bit of velocity to the player every prethink, and to simulate different levels of acceleration, you can change how much you are adding in each prethink.

For giving grass and road different feels, you MIGHT be able to use EngFunc_TraceTexture (part of Fakemeta), but unfortunately I've never seen anyone else use it so I'm not too sure how myself (or what it actually does). If you could set it up properly, then you'd just have to design the maps such that they use a specific texture for road and offroad.

[edit] After looking at the HLSDK, this might be how it works...
textureName = engfunc(EngFunc_TraceTexture, entity, startOfLine[3], endOfLine[3])
"entity" would be the entity you're interested in (0 in this case, for the world), and it would draw a line from startOfLine to endOfLine and return the name of the texture it hit, which would be stored in textureName (a string). Still haven't tested it though so this is all just theory.

Last edited by Prajch; 09-13-2008 at 00:29.
Prajch is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 09-13-2008 , 15:15   Re: I need some coding help in my CS Rally Mod
Reply With Quote #8

You can either try to add pseudo physics or study a bit to find out how it really works.
I believe accelerated objects actually use this:
(way in meters) = (acceleration in (meters/secondsē))/(2)*(time in seconds)
Now don't ask me about appropriate acceleration values. Start with something low like 3.
(speed in (meters/second)) = ???
I am not going to do this now. Too tired. X_X
BUT!! That is an amazing plugin you got there. Just wanted to say that. ;D
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Guilty Spark
Member
Join Date: Jan 2008
Location: clansolo.com
Old 09-14-2008 , 10:20   Re: I need some coding help in my CS Rally Mod
Reply With Quote #9

Here's a plugin for the Superhero Mod by K-OS that you should look into.

http://forums.alliedmods.net/showthr...light=Savage25

It contains all the physics you need and they work perfectly, K-OS is pretty good. If you want to see this in action you can head to my clan's server below and try out RC Man, which is this hero recoded but using the same physics code (which I'm not going to even attempt to understand for at least a year).
__________________
Superhero Mod ([S0|0]) - 63.209.37.33:27015
[IMG]http://img157.**************/img157/1031/guiltyspark2tn9.png[/IMG]
Guilty Spark is offline
Send a message via AIM to Guilty Spark
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 18:20.


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