Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatic transmission
11-06-2006, 12:17 AM,
#10
 
Here is the patch

Code:
Index: include/vamosworld.h
===================================================================
--- include/vamosworld.h    (revision 1323)
+++ include/vamosworld.h    (working copy)
@@ -109,6 +109,7 @@
    bool camneedupdate;
    bool MPH;
    bool auto_clutch;
+    bool auto_trans;
    bool display_hud;
    bool input_graph_enabled;
    bool car_shadows_enabled;
Index: src/vamosworld.cc
===================================================================
--- src/vamosworld.cc    (revision 1323)
+++ src/vamosworld.cc    (working copy)
@@ -1432,6 +1432,36 @@
            DoOp(GetCar(CONT_PLAYERLOCAL), "clutch", autoclutch, 0.0, true, timefactor, fps);
        }
    }
+
+    // Automatic Transmission
+    if (auto_trans)
+    {
+        // only autoshift when no shift pending and we are not in neutral or reverse gear
+        if (!GetCar(CONT_PLAYERLOCAL)->car->ShiftPending() &&
+            GetCar(CONT_PLAYERLOCAL)->car->gear() > 0)
+        {
+            // shift up when engine speed exceeds peak speed
+            if (GetCar(CONT_PLAYERLOCAL)->car->engine()->rotational_speed() >
+                GetCar(CONT_PLAYERLOCAL)->car->engine()->peak_engine_speed()
+                           &&
+                GetCar(CONT_PLAYERLOCAL)->car->engine()->last_rotational_speed() <GetCar>car->engine()->peak_engine_speed())
+            {
+                GetCar(CONT_PLAYERLOCAL)->car->shift_up();
+            }
+
+            // shift down when engine speed below fixed value
+            // however, we do not auto shift down from 1st gear to neutral
+            if (GetCar(CONT_PLAYERLOCAL)->car->gear() > 1
+               &&
+                GetCar(CONT_PLAYERLOCAL)->car->engine()->rotational_speed() <200>car->engine()->last_rotational_speed() > 200.0)
+            {
+                GetCar(CONT_PLAYERLOCAL)->car->shift_down();
+            }
+        }
+    }
}

void VAMOSWORLD::DoOp(Vamos_World::Car_Information * c, string dofunction, float dovalue, float dotime, bool held, float timefactor, float fps)
@@ -2096,6 +2126,7 @@
    settings.Get( "display.show_hud", display_hud );
    settings.Get( "display.mph", MPH );
    settings.Get( "control.autoclutch", auto_clutch );
+    settings.Get( "control.autotrans", auto_trans );
    settings.Get( "display.input_graph", input_graph_enabled );
    settings.Get( "display.car_shadows", car_shadows_enabled );
    settings.Get( "control.button_ramp", button_ramp );
Index: data/settings/options.config
===================================================================
--- data/settings/options.config    (revision 1323)
+++ data/settings/options.config    (working copy)
@@ -1,4 +1,4 @@
-num_options = 41
+num_options = 42

[ option-00 ]
cat = game
@@ -520,3 +520,14 @@
default = 1
values = replays

+[ option-41 ]
+cat = control
+name = autotrans
+title = AutoTransmission
+desc = Enable/disable automatic transmission
+type = bool
+default = true
+values = bool
+true = On
+false = Off
+
Index: data/skins/simple/menus/ControlsOptions
===================================================================
--- data/skins/simple/menus/ControlsOptions    (revision 1323)
+++ data/skins/simple/menus/ControlsOptions    (working copy)
@@ -1,5 +1,5 @@
name = ControlsOptions
-widgets = 11
+widgets = 12
background = box.png
dialog = false

@@ -21,7 +21,7 @@
name = TouchCompWheel
setting = joystick.touchcomp
values = options
-center = 0.5, 0.29
+center = 0.5, 0.25
width = auto
height = auto
fontsize = 6
@@ -32,6 +32,20 @@

[ widget-02 ]
type = toggle
+name = AutoTransToggle
+setting = control.autotrans
+values = options
+center = 0.5, 0.29
+width = auto
+height = auto
+fontsize = 6
+enabled = 1
+selected = 0
+default = 0
+cancel = 0
+
+[ widget-03 ]
+type = toggle
name = AutoClutchToggle
setting = control.autoclutch
values = options
@@ -44,7 +58,7 @@
default = 0
cancel = 0

-[ widget-03 ]
+[ widget-04 ]
type = toggle
name = ABSToggle
setting = game.antilock
@@ -58,7 +72,7 @@
default = 0
cancel = 0

-[ widget-04 ]
+[ widget-05 ]
type = toggle
name = TCSToggle
setting = game.traction_control
@@ -72,7 +86,7 @@
default = 0
cancel = 0

-[ widget-05 ]
+[ widget-06 ]
type = floatwheel
name = ButtonRampWheel
setting = control.button_ramp
@@ -86,7 +100,7 @@
default = 0
cancel = 0

-[ widget-06 ]
+[ widget-07 ]
type = button
name = ActionControlMapButton
text = Assign Controls
@@ -102,7 +116,7 @@
default = 0
cancel = 0

-[ widget-07 ]
+[ widget-08 ]
type = button
name = JoystickOptionsButton
text = Joystick Options
@@ -118,7 +132,7 @@
default = 0
cancel = 0

-[ widget-08 ]
+[ widget-09 ]
type = button
name = MouseOptionsButton
text = Mouse Options
@@ -134,7 +148,7 @@
default = 0
cancel = 0

-[ widget-09 ]
+[ widget-10 ]
type = button
name = ControlsOptionsOKButton
text = OK
@@ -150,7 +164,7 @@
default = 1
cancel = 0

-[ widget-10 ]
+[ widget-11 ]
type = button
name = ControlsOptionsCancelButton
text = Cancel
Index: data/skins/simple/menus/InGameControlsOptions
===================================================================
--- data/skins/simple/menus/InGameControlsOptions    (revision 1323)
+++ data/skins/simple/menus/InGameControlsOptions    (working copy)
@@ -1,5 +1,5 @@
name = InGameControlsOptions
-widgets = 11
+widgets = 12
background = box.png
dialog = false

@@ -21,7 +21,7 @@
name = InGameTouchCompWheel
setting = joystick.touchcomp
values = options
-center = 0.5, 0.29
+center = 0.5, 0.25
width = auto
height = auto
fontsize = 6
@@ -32,6 +32,20 @@

[ widget-02 ]
type = toggle
+name = InGameAutoTransToggle
+setting = control.autotrans
+values = options
+center = 0.5, 0.29
+width = auto
+height = auto
+fontsize = 6
+enabled = 1
+selected = 0
+default = 0
+cancel = 0
+
+[ widget-03 ]
+type = toggle
name = InGameAutoClutchToggle
setting = control.autoclutch
values = options
@@ -44,7 +58,7 @@
default = 0
cancel = 0

-[ widget-03 ]
+[ widget-04 ]
type = toggle
name = InGameABSToggle
setting = game.antilock
@@ -58,7 +72,7 @@
default = 0
cancel = 0

-[ widget-04 ]
+[ widget-05 ]
type = toggle
name = InGameTCSToggle
setting = game.traction_control
@@ -72,7 +86,7 @@
default = 0
cancel = 0

-[ widget-05 ]
+[ widget-06 ]
type = floatwheel
name = InGameButtonRampWheel
setting = control.button_ramp
@@ -86,7 +100,7 @@
default = 0
cancel = 0

-[ widget-06 ]
+[ widget-07 ]
type = button
name = InGameActionControlMapButton
text = Assign Controls
@@ -102,7 +116,7 @@
default = 0
cancel = 0

-[ widget-07 ]
+[ widget-08 ]
type = button
name = InGameJoystickOptionsButton
text = Joystick Options
@@ -118,7 +132,7 @@
default = 0
cancel = 0

-[ widget-08 ]
+[ widget-09 ]
type = button
name = InGameMouseOptionsButton
text = Mouse Options
@@ -134,7 +148,7 @@
default = 0
cancel = 0

-[ widget-09 ]
+[ widget-10 ]
type = button
name = InGameControlsOptionsOKButton
text = OK
@@ -150,7 +164,7 @@
default = 1
cancel = 0

-[ widget-10 ]
+[ widget-11 ]
type = button
name = InGameControlsOptionsCancelButton
text = Cancel
Reply


Messages In This Thread
Automatic transmission - by rookie1 - 11-05-2006, 10:58 AM
[No subject] - by thelusiv - 11-05-2006, 02:20 PM
[No subject] - by cotharyus - 11-05-2006, 06:51 PM
[No subject] - by joevenzon_phpbb2_import3 - 11-05-2006, 06:51 PM
[No subject] - by reece146 - 11-05-2006, 07:19 PM
[No subject] - by rookie1 - 11-05-2006, 08:50 PM
[No subject] - by thelusiv - 11-05-2006, 09:19 PM
[No subject] - by rookie1 - 11-05-2006, 11:03 PM
[No subject] - by thelusiv - 11-05-2006, 11:27 PM
[No subject] - by rookie1 - 11-06-2006, 12:17 AM
[No subject] - by thelusiv - 11-06-2006, 12:54 AM
[No subject] - by rookie1 - 11-06-2006, 01:03 AM
[No subject] - by thelusiv - 11-06-2006, 01:29 AM
[No subject] - by rookie1 - 11-06-2006, 02:07 AM
[No subject] - by thelusiv - 11-06-2006, 02:27 AM
[No subject] - by rookie1 - 11-06-2006, 02:36 AM
[No subject] - by thelusiv - 11-06-2006, 03:30 AM
[No subject] - by reece146 - 11-06-2006, 12:02 PM
[No subject] - by joevenzon_phpbb2_import3 - 11-07-2006, 01:25 AM
[No subject] - by reece146 - 11-07-2006, 11:11 AM
[No subject] - by joevenzon_phpbb2_import3 - 11-08-2006, 03:00 AM
[No subject] - by rookie1 - 11-08-2006, 03:41 AM
[No subject] - by thelusiv - 11-08-2006, 12:14 PM
[No subject] - by thelusiv - 11-10-2006, 02:57 AM
[No subject] - by thelusiv - 11-10-2006, 03:33 AM
[No subject] - by thelusiv - 11-11-2006, 03:24 AM
[No subject] - by joevenzon_phpbb2_import3 - 11-11-2006, 01:41 PM
[No subject] - by cotharyus - 11-11-2006, 05:15 PM
[No subject] - by joevenzon_phpbb2_import3 - 11-11-2006, 08:40 PM
[No subject] - by cotharyus - 11-11-2006, 09:57 PM
[No subject] - by rookie1 - 11-12-2006, 01:07 AM
[No subject] - by thelusiv - 11-12-2006, 04:21 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)