Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Help with a Cleo mod


jackusCTB
 Share

Recommended Posts

I'm such a noob in cleo scripting, but I'm trying to write a cleo script which when you press "W" the hydra thrust is automatically set to horizontal.

that's the code

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'NOVTOL' wait 0 if   Actor.DrivingVehicleType($PLAYER_ACTOR, #HYDRA)03C0: [email protected] = actor $PLAYER_ACTOR car if 00E1:   player 0 pressed_key 16   not Car.Wrecked([email protected])if  [email protected] == 0 0745: set_hydra [email protected] thrust_to_horizontal 

 

 

As soon as i press "new game", the game crashes.

i also want to add the function that when you press "~k~~VEHICLE_TURRETDOWN~", instead of going vertical, the thrust goes horizontal. i was thinking to:

 

wait 000E1 player 0 pressed_key 300745: set_hydra [email protected] thrust_to_horizontal

 

i appreciate every correction and.. thanks

Link to comment
Share on other sites

Read a tutorial. And it isn't a good idea either, if you get into a hydra you can't take off vertical any more, this makes the hydra mission impossible.

Link to comment
Share on other sites

TheGodfather.

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'NOVTOL':NEW_1wait 0if Actor.DrivingVehicleType($PLAYER_ACTOR, #HYDRA)03C0: [email protected] = actor $PLAYER_ACTOR carif00E1:   player 0 pressed_key 16 not Car.Wrecked([email protected]):NEW0745: set_hydra [email protected] thrust_to_horizontal jump @:NEW_1

 

 

I don't know whether it will work or not because I haven't got the time to check just have a look whether it works or not.

 

Link to comment
Share on other sites

hey dude, thanks again smile.gif there's an error in the last line: jump @:NEW_1 -should be-> jump @NEW_1, btw it doesn't work sad.gif

Link to comment
Share on other sites

Why do you want to build a scrypt for this stuff when there are controls that can do it? Here's your code:

 

{$CLEO }0000: NOPwhile true   repeat       wait 250   until 0256:   player $PLAYER_CHAR defined        while true           wait 1000           if and               00DD:   actor $PLAYER_ACTOR driving_car_with_model #HYDRA               00E1:   player 0 pressed_key 17           then               03C0: [email protected] = actor $PLAYER_ACTOR car                 0745: set_hydra [email protected] thrust_to_horizontal               if                      8256:   not   player $PLAYER_CHAR defined                then       break               end           end       endend

 

Sorry about the high level code. if you don't like it then convert it to low with SB. Press and hold fire to activate hydra horizontal.

Link to comment
Share on other sites

thanks man, the high code won't be a problem.... i think

by the way, i forgot to say if you could add the function that when you're trying to change hydra's thrust from horizontal to vertical, you cant

Link to comment
Share on other sites

It looks like that there's no opcode that can do the opposite then 0745. I think you already know this but there's a control for forcing hydra to thrust vertical slowly. Other then that I don't know. Try searching the memory findings for gta sa in III other section, maybe you find something.

 

Link to comment
Share on other sites

Assuming that hydra handle is at [email protected], loop this code and the hydra will always be thrusting horizontal.

 

0A97: [email protected] = get_car_struct [email protected]: [email protected] += 0x86C0A8C: write_memory [email protected] size 2 val 0 vp 0

 

  • Like 1
Link to comment
Share on other sites

@Link2012, as you said, I compiled your code into cleo and I got this:

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------0000: NOP :NONAME_20A97: [email protected] = car [email protected] struct [email protected] += 2156 0A8C: write_memory [email protected] size 2 value 0 virtual_protect 0 jump @NONAME_2 

 

But as soon as the menu (Start Game, Option and Exit) appears, the game crashes. correct me if i'm wrong.

-----

@JACK JONES nope, you've misunderstood. i meant that when you press the key to change hydra's thrust FROM horizontal TO vertical, you can't. basically the hydra's thrust, also if you want to change it's direction, you cant. do you get my point?

Link to comment
Share on other sites

Yes, they are variables, Did you come from another programming language? tounge.gif

Anyway read a tutorial because this language syntax is very uncommon.

 

You can get the handle in several ways, I will list some of these ways

1. Creating a new vehicle, you will get as result the vehicle handle

e.g:

 

00A5: [email protected] = create_car #PONY at 0.0 0.0 0.0

 

[email protected] Now has the recently created pony handle.

 

2. Getting player vehicle

Like what JACK_JONES did in his code.

If player was driving a hydra then it gets the player vehicle handle with

 

03C0: [email protected] = actor $PLAYER_ACTOR car

 

 

3. Others...

Link to comment
Share on other sites

It's up to you. But you should know that one variables can't store more than one information:

e.g.: If u have vehicle handle in [email protected] and replace the value at [email protected] to do some calculation, You lost the hydra handle.

Link to comment
Share on other sites

all right. may i know where did you learn scripting with cleo and especially the variables things? anyway no, i don't come from any programming language, unfortunately sad.gif

Edited by jackusCTB
Link to comment
Share on other sites

Begin reading ZaZ's tutorial:

http://www.gtaforums.com/index.php?showtopic=403594

Then, your next base for informations of "how was it done?" is the main.scm, decompile it and see how R* did something in a mission.

You can also learn from other people code, if the source code for the script is available it's better, if not you have to decompile the script.

Read also the Sanny Builder help (F12).

 

The rest you will discover logically and naturally.

Link to comment
Share on other sites

@JACK JONES: Finally I did what I wanted to do. If it's helpful for someone, especially if you don't use a S/VTOL aircraft but you use a standare plane, like the A-10 Thunderbolt II <3, this script might be useful. Here's your edited code by me:

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------0000: NOP :NONAME_2wait 250   Player.Defined($PLAYER_CHAR)jf @NONAME_2 :NONAME_19wait 0 if and  Actor.DrivingVehicleType($PLAYER_ACTOR, #HYDRA)00E1:   player 0 pressed_key 16 jf @NONAME_84 03C0: [email protected] = actor $PLAYER_ACTOR car 0745: set_hydra [email protected] thrust_to_horizontal if   not Player.Defined($PLAYER_CHAR)jf @NONAME_84 jump @NONAME_129 :NONAME_84if and  Actor.DrivingVehicleType($PLAYER_ACTOR, #HYDRA)00E1:   player 0 pressed_key 3 jf @NONAME_19 03C0: [email protected] = actor $PLAYER_ACTOR car 0745: set_hydra [email protected] thrust_to_horizontal jump @NONAME_19 :NONAME_129jump @NONAME_2

 

Edited by jackusCTB
Link to comment
Share on other sites

By looking into the address found by Link2012 I made you a new code that alow to quckly change horizontal and vertical seeting of the hydra by pressing 2 diferent buttons (I did that because with your code the plane can never fly vertical so if you are in the middle of some buildings the hydra won't be able to get out). So here's the code:

 

{$CLEO}0000: NOPwhile true   wait 250   if and       0256:   player $PLAYER_CHAR defined       00DD:   actor $PLAYER_ACTOR driving_car_with_model #HYDRA    thenbreak   endendwhile truewait 0   while true       wait 0       03C0: [email protected] = actor $PLAYER_ACTOR car        0A97: [email protected] = get_car_struct [email protected]       000A: [email protected] += 0x86C       if and           00DD:   actor $PLAYER_ACTOR driving_car_with_model #HYDRA           00E1:   player 0 pressed_key 1    // press stear up to change to fast horizontal (better be very high in the air)       then           0A8C: write_memory [email protected] size 4 value 0 virtual_protect 0  // hydra is now horizontal   break       end   end       while true           wait 0           03C0: [email protected] = actor $PLAYER_ACTOR car            0A97: [email protected] = get_car_struct [email protected]           000A: [email protected] += 0x86C           if and               00DD:   actor $PLAYER_ACTOR driving_car_with_model #HYDRA               00E1:   player 0 pressed_key 6  // press hendbrake if you want fast hydra vertical seeting           then               0A8C: write_memory [email protected] size 4 value 5000 virtual_protect 0  // hydra thrusts vertical now       break           end       endend

 

You could change the buttons as you like.

Link to comment
Share on other sites

again, thanks smile.gif you're very skilled. That has nothing to do with the script but is there a way to make the Sparrow able to shoot unguided rockets like the hunter? thanks again.

Link to comment
Share on other sites

Well there are 2 ways for that:

1) to find the address that contain the IDE of a car which have the ability to fire hunter projectiles and then write sparrow value in it,

2) to put 2 invisible actors on the places you want the projectiles to be fired.

Number 1 way would be the best but I don't have that address. Try the mem documentation in III other.

Number 2 way recquire building a little complicated code (start reading the opcode database).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.