搜索
  • TA的每日心情
    郁闷…
    2020-12-25 12:59
  • 签到天数: 157 天

    [LV.7]社区八爷

    发表于 2020-6-29 07:48:33 170 浏览 0 回复

    Changing vehicle handling

    1. Changing vehicle handling
    2. Filed under: Development by maxorator — 7 Comments
    3. February 18, 2012
    4. Several functions for changing vehicle handling data have been added for plugins and scripts to use. Handling can be set separately for a model index and a specific vehicle. Handling is managed as a set of rules, each of which replace the default value of some handling parameter for some model index or a specific vehicle. If both apply for some vehicle, then the rules for that specific vehicle are used. Superior grip, flying and driving on water can also be set with these functions. Next comes the list of functions. I will shortly explain what each of these functions does.

    5. int ResetAllVehicleHandlings(void);
    6. unsigned int ExistsHandlingRule(int nModelIndex, int nRuleIndex);
    7. int SetHandlingRule(int nModelIndex, int nRuleIndex, double fValue);
    8. double GetHandlingRule(int nModelIndex, int nRuleIndex);
    9. int ResetHandlingRule(int nModelIndex, int nRuleIndex);
    10. int ResetHandling(int nModelIndex);
    11. unsigned int ExistsInstHandlingRule(int nVehicleId, int nRuleIndex);
    12. int SetInstHandlingRule(int nVehicleId, int nRuleIndex, double fValue);
    13. double GetInstHandlingRule(int nVehicleId, int nRuleIndex);
    14. int ResetInstHandlingRule(int nVehicleId, int nRuleIndex);
    15. int ResetInstHandling(int nVehicleId);
    16. ResetAllVehicleHandlings resets all handling rules in the server. ResetHandling resets all handling rules that were set for a model index using SetHandlingRule. ResetInstHandling resets the rules that had been set for a vehicle using SetInstHandlingRule. ResetHandlingRule and ResetInstHandlingRule can be used to reset specific handling settings for a specific model index or vehicle.

    17. ExistsHandlingRule will tell you if a specific handling setting has changed for this model using SetHandlingRule. ExistsInstHandlingRule does the same for specific vehicle instances.

    18. GetHandlingRule will return the value that was set using SetHandlingRule or if hadn’t been changed, the default value for that model index. GetInstHandlingRule returns the value that was set for that specific vehicle or otherwise it simply calls GetHandlingRule internally. These functions always return the value that is currently effective for that model or vehicle index.

    19. SetHandlingRule and SetInstHandlingRule are the functions that are used to actually apply new handling settings to vehicles. Note that only changed values are sent to clients, therefore it is best to keep changes as low as possible if you want to minimize bandwidth usage. Whenever you want to set a value to its original value, use the Reset* functions instead of using Set* functions with default value, since then those changes are basically deleted, causing the bandwidth usage to decrease.

    20. These are the rule indices that can be used with those functions:

    21. 1 Mass
    22. 2 DimensionsX
    23. 3 DimensionsY
    24. 4 DimensionsZ
    25. 5 CentreOfMassX
    26. 6 CentreOfMassY
    27. 7 CentreOfMassZ
    28. 8 PercentSubmerged
    29. 9 TractionMultiplier
    30. 10 TractionLoss
    31. 11 TractionBias
    32. 12 NumberOfGears
    33. 13 MaxSpeed
    34. 14 Acceleration
    35. 15 DriveType
    36. 16 EngineType
    37. 17 BrakeDeceleration
    38. 18 BrakeBias
    39. 19 SteeringLock
    40. 20 SuspensionForceLevel
    41. 21 SuspensionDampening
    42. 22 SeatOffset
    43. 23 DamageMultiplier
    44. 24 SuspensionUpperLimit
    45. 25 SuspensionLowerLimit
    46. 26 SuspensionBias
    47. 27 SuspensionAntiDive
    48. 28 Flags
    49. 29 LightsFront
    50. 30 LightsRear
    51. 31 SuperiorGrip
    52. 32 FlyingMode
    53. 33 DriveOnWater
    54. Flying/boat/bike specific handling rules cannot be changed yet, but will likely be implemented as well.

    55. –maxorator
    复制代码

    两点半社区 @ 230club.com
    回复

    使用道具 举报

    返回列表
    您需要登录后才可以回帖 登录 | 加入社区

    本版积分规则

    登录或注册到社区吧!

    运营团伙

    幻想乐趣工作室

    官方QQ群

    37880111(做饭+女装交流)

    扫一扫快速加入

    群号652692981

    快速回复 返回顶部 返回列表