I need some coding help in my CS Rally Mod
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 |
Re: I need some coding help in my CS Rally Mod
Please first provide the source code.
|
Re: I need some coding help in my CS Rally Mod
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) |
Re: I need some coding help in my CS Rally Mod
Quote:
For steering with A and D, you can alter player _v_angles while he is holding down those buttons. |
Re: I need some coding help in my CS Rally Mod
Quote:
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 :( |
Re: I need some coding help in my CS Rally Mod
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.
|
Re: I need some coding help in my CS Rally Mod
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. |
Re: I need some coding help in my CS Rally Mod
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 |
Re: I need some coding help in my CS Rally Mod
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). |
| All times are GMT -4. The time now is 03:07. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.