Quantcast

Jump to content

» «
Photo

CLEO 3 Cruise control mod

4 replies to this topic
fatmanone
  • fatmanone

    Player Hater

  • Members
  • Joined: 15 Mar 2009

#1

Posted 15 March 2009 - 08:05 PM Edited by fatmanone, 21 March 2009 - 10:40 PM.

Hello everyone, here is my primitive attempt for a cruise control mod in GTASA.
It has some issues and I don't think I'll be able to fix them, maybe anyone else?
Anyway here it is:
Install it as usual in CLEO and while driving a vehicle (prefererable a car) press C to enable cruising at the current speed and X or SPACE to stop cruising and revert to normal.

Drawbacks are: The car acts like is driven by magic, that is will not decrease speed while colliding with stuff and of course will take damage. It behaves strange while flipped as in the car will drag on its back as soon as you exit it (while flipped). The speed is actually lower than the current speed - I have no idea how to calculate the correct value for it (edit: now I do biggrin.gif ).


Anyway, enjoy.


CODE


{$CLEO}
0000:

var
   $cruiseOn:int = 0
end

while true
   wait 10
   
   if
       not Actor.Driving($PLAYER_ACTOR)
   then
       $cruiseOn = 0;
   end
   
   
   if and
       $cruiseOn > 0
       Actor.Driving($PLAYER_ACTOR)
   then
       045A: draw_text_1number 131.75 24.4 GXT 'NUMBER' number 28@  // ~1~
       03C0: 8@ = actor $PLAYER_ACTOR car
       if  and
           09D0:   car 8@ on_wheels
           81F3:   not car 8@ in_air
           81F4:   not car 8@ flipped
       then
           Car.SetSpeedInstantly(8@,28@)
       end  
                                                       
   
   end





   if
       0AB0:   key_pressed 0x43
   then
       
       if and
           $cruiseOn == 0
           Actor.Driving($PLAYER_ACTOR)
       then
           03C0: 8@ = actor $PLAYER_ACTOR car
           046C: 26@ = car 8@ driver
           if
               003B:   26@ == $PLAYER_ACTOR // (int)
           then
               $cruiseOn = 1
               02E3: 28@ = car 8@ speed
               03E3: set_texture_to_be_drawn_antialiased 1
               033F: set_text_draw_letter_size 0.6 2.0
               045A: draw_text_1number 131.75 224.4 GXT 'NUMBER' number 28@  // ~1~
           end
       end
   else
       if or
           0AB0:   key_pressed 0x58
           0AB0:   key_pressed 0x20
       then
           $cruiseOn = 0
       end    
   end
end










Edit:

Since v 0.1 was kinda lame (cars moved like zombies of sort), here is v 0.2. It features a background tool written in c# that scans a file created by the cleo script which contains the cruise control status, the desired speed and the current speed. The exe sends keys for acceleration or brake intermittently in order to maintain the desired speed (I presume you would still have arrow UP and DOWN as acc and brk). I like this more since it's real and the car reacts to the environment normally. There are some tuning options as teh timer interval, the pipe file, etc. Just try and see.

Use the key 'C' to set and unset the cruise mode. Insist a little, it may not work at the slightest touch.
Install is straightforward, just copy the content form
I included the full source code of both the cleo script and the c# app, so anyone with ideas, please go ahead and help yourselves, just let me know 'coz I really wanna see some improved variant.

Anyway, stay tuned as I am researching into v 0.3 which will use a dll for speed set. The only drawback that might pop up is the fact that it would not be possible to send the keys to the process, but I'll workaround it I guess (anyone knows more about dll's in gtasa through cleo, is welcome to comment or PM or whatever).


Edit2
V0.2.1 is out now.
Updated the .NET application by adding some more tuning options. Enjoy!

james227uk
  • james227uk

    One Spartan Army

  • Andolini Mafia Family
  • Joined: 05 Feb 2008

#2

Posted 22 March 2009 - 03:24 PM

Errmmmm.... this is the vehicles section

omega5002
  • omega5002

    GTA SA Lover

  • Members
  • Joined: 25 Nov 2007

#3

Posted 22 March 2009 - 03:30 PM

Even though this CLEO script is related to vehicles and I find it to be cool, it would be more appropiate to have it moved to the mission mods showroom because this is a script mod, not a vehicle mod.

fatmanone
  • fatmanone

    Player Hater

  • Members
  • Joined: 15 Mar 2009

#4

Posted 22 March 2009 - 06:26 PM

I have no idea how to move the post to other sections. If any of the admins are reading this maybe they can help. Thanks.

omega5002
  • omega5002

    GTA SA Lover

  • Members
  • Joined: 25 Nov 2007

#5

Posted 22 March 2009 - 09:37 PM

Don't worry, the admins will move it for you and probably very soon




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users