Speed Limiter

Use this forum to report bugs or ask for help

Moderator: kilo

Speed Limiter

Postby horo » Tue Oct 07, 2014 4:45 am

Hello,

I've notice that there is a speed limiter control button, so I deduced that there is a speed limiter.
I'm currently trying to set it up to 40kmph but unfortunately I'm completely clueless about how to set it up. Could you explain me how to use it ?

Best,
horo
 
Posts: 13
Joined: Thu May 15, 2014 3:40 am

Re: Speed Limiter

Postby Cobb » Tue Oct 07, 2014 12:05 pm

Horo
The speed limiter is for the pit lane, i think its set to 80km/h (going from memory)
Simply activate it as you enter the lane and you can mash the accelerator and you wont go faster. Once your out you can deactivate it and your back to normal.
Basically its there to stop you breaking the pit lane speed limit.
Hope this helps
Cheers
Cobb
Cobb
 
Posts: 32
Joined: Wed Mar 12, 2014 1:41 am

Re: Speed Limiter

Postby horo » Thu Oct 09, 2014 5:22 am

Do you know where this value is set in the code ? I would like to change it.
horo
 
Posts: 13
Joined: Thu May 15, 2014 3:40 am

Re: Speed Limiter

Postby madbad » Sun Oct 12, 2014 8:10 am

horo wrote:Do you know where this value is set in the code ? I would like to change it.


Hi Horo.
I've taken a look at it and the values seems to be hardcoded (this mean that for changes you make to take effect you have to recompile the game) in
Code: Select all
/trunk/src/modules/track/trackv1/track4.cpp

At the line 904-905 you find
Code: Select all
//Set pitlane speed limit
pits->speedLimit = GfParmGetNum(TrackHandle, path2, TRK_ATT_SPD_LIM, (char*)NULL, 25.0);


I've tried lowering it from the current
25 = that generate a => 87 game speed limit
to
15 =that generate a => 51 game speed limit
So changing it do actually change the used speed limit.
Cheers, MadBad
User avatar
madbad
 
Posts: 118
Joined: Sat Jan 22, 2011 3:45 pm

Re: Speed Limiter

Postby MiniJoe » Mon Oct 13, 2014 7:41 am

Code: Select all
//Set pitlane speed limit
pits->speedLimit = GfParmGetNum(TrackHandle, path2, TRK_ATT_SPD_LIM, (char*)NULL, 25.0);

The code above will actually load the 'speed limit' from the track xml file. If the speed limit is NOT in the xml, it uses the last argument (25.0) as a default. So you don't have to change the code.

None of the track XML files in sourceforge seem to have this defined.
You can edit the XML file ( I added the last line in the code block below to CorkScrew.xml). No need to recompile the program.
Code: Select all
<section name="Main Track">
    <attnum name="width" unit="m" val="12.0" />
    <attnum name="profil steps length" unit="m" val="8.0" />
    <attstr name="profil" in="linear,spline" val="linear" />

    <section name="Pits">
      <attnum name="speed limit" val="20" />
       ...

I am not sure what why the car's speed is allowed to be approx. 3.4 times the set limit. (Bug?)
MiniJoe
 
Posts: 98
Joined: Fri Mar 16, 2012 1:32 am

Re: Speed Limiter

Postby MiniJoe » Mon Oct 13, 2014 7:23 pm

MiniJoe wrote:I am not sure what why the car's speed is allowed to be approx. 3.4 times the set limit. (Bug?)

The pit lane speed limit can be set on a per track basis by adding a line to the track's XML file.
For example:
in the Pits section add:
<attnum name="speed limit" val="40" />
I assumed Kilometers Per Hour as the unit. As pointed out by others, this is actually Meters Per Second.
To specify in KPH, add the unit attribute:
<attnum name="speed limit" unit="km/h" val="40" />
MiniJoe
 
Posts: 98
Joined: Fri Mar 16, 2012 1:32 am


Return to Problems, Fixes & Help

Who is online

Users browsing this forum: No registered users and 6 guests

cron