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

Happy Holidays from the GTANet team!

problem to convert my mod to cleo


piotre_94
 Share

Recommended Posts

Hello everybody!

 

I have a problem with my first cleo mod can you help me pleaze, the game crash just after press key 17.

This line

thread @BARRIL_3 

 

is the problem but i don't find a another way

 

 

thread "BARRIL_1"                                                                                               :BARRIL_1                                                                              wait  0 ms                                                                      if  Player.Defined($PLAYER_CHAR)else_jump @BARRIL_1                                                       00D6: if 1                                                                                       00E1:   key pressed  0  17                                                                       00DF:   actor $PLAYER_ACTOR driving                                                004D: jump_if_false @BARRIL_1                                                         03C0: [email protected] = actor $PLAYER_ACTOR car                                                              0407: create coordinate [email protected] [email protected] [email protected] from car [email protected] offset  0.0 -2.5  1.0                              0174: [email protected] = car [email protected] z_angle                                                                       0009: [email protected] +=  90.0// floating-point values                                                        02CE: [email protected] = ground z [email protected] [email protected] [email protected]                                                                     000B: [email protected] += 0.1                                                                                                                                                                                               Model.Load(1225)                                                               thread @BARRIL_3:BARRIL_303A4: name thread "BARREL":BARRIL_4wait  10 msif                                                                                       Model.Available(1225)                                                                              004D: jump_if_false @BARRIL_4                                                                   0004: [email protected] = 0  // integer values                                                                              [email protected] = Object.Create(1225, [email protected], [email protected], [email protected])                                               0177: set object [email protected] z angle to  [email protected]                                                               01C7: remove_object_from_mission_cleanup_list [email protected]                                                 0007: [email protected] = [email protected]                                                                                    000F: [email protected] -= 2.0                                                                                  000B: [email protected] += 2.0                                                                                  0007: [email protected] = [email protected]                                                                                    000F: [email protected] -= 2.0                                                                                  000B: [email protected] += 2.0                                                                                                                                                                                 :BARRIL_50001: wait  250 ms                                                                                   00D6: if 0                                                                                       0019:   [email protected] > 15000                                                                              004D: jump_if_false @BARRIL_5                                                               0249: release_model 1225                                                               0108: destroy object [email protected] 0002: jump @BARRIL_10459: end_thread_named 'BARRIL' 

 

 

my mod works with BW's but not with Cléo

Link to comment
Share on other sites

It looks like you either took your inspiration from the Stinger-drop mod that I made for VC, or from the SA conversion of that mod, made by demonj0e. Since most of your code seems to be a carbon-copy of that code.

 

A couple of months ago I released a CLEO version of it for SA.

In addition to the Stinger-Drop mod, I've used this same construction also for a Mine-drop mod.

 

You've seem to have messed up the overall structure. The idea is that there are two threads: a sniffer thread that is normally running, and checks whether the player is in a car and presses a button.

If he does, a thread is created, that creates the object, and monitors it, after a specified amount of time, the object is removed and the thread is ended.

Of these object-threads several can exist in parallel. One for each of the objects dropped.

 

The problem with making it in a CLEO, is that you can't create multiple threads very well, that's why in my CLEO implementations, there are two files, one for the sniffer-thread and one for the object-threads.

bS8xA.png
Link to comment
Share on other sites

Thank you !

 

I just finish my cleo mod with your help biggrin.gif

 

If it can interest someone I post it

 

create a file "barril.txt"

 

{$VERSION 3.1.0027}{$CLEO .s}:BARRIL_thread0004: [email protected] = 0                                                                             [email protected] = Object.Create(1225, [email protected], [email protected], [email protected])                                               0177: set object [email protected] z angle to  [email protected]                                                               01C7: remove_object_from_mission_cleanup_list [email protected]                                                 0007: [email protected] = [email protected]                                                                                    000F: [email protected] -= 2.0                                                                                  000B: [email protected] += 2.0                                                                                  0007: [email protected] = [email protected]                                                                                    000F: [email protected] -= 2.0                                                                                  000B: [email protected] += 2.0                                                                                  repeat                                                                                                 wait  250until [email protected] > 15000                                                                                                                                                   0249: release_model 1225                                                               0108: destroy object [email protected]: end_custom_thread

 

 

and create a new one "barril_drop.txt"

 

{$VERSION 3.1.0027}{$CLEO .cs}thread "BARRIL_1":BARRIL_1                                                                            03A4: name thread "BARRIL"                                                                                                                                                                      :BARRIL_2                                                                               wait  0 ms                                                                      if   Player.Defined($PLAYER_CHAR)else_jump @BARRIL_2                                                      00D6: if 1                                                                                       00E1:   key pressed  0  17                                                                       00DF:   actor $PLAYER_ACTOR driving                                                004D: jump_if_false @BARRIL_2                                                         03C0: [email protected] = actor $PLAYER_ACTOR car                                                              0407: create coordinate [email protected] [email protected] [email protected] from car [email protected] offset  0.0 -2.5  1.0                              0174: [email protected] = car [email protected] z_angle                                                                       0009: [email protected] +=  90.0// floating-point values                                                        02CE: [email protected] = ground z [email protected] [email protected] [email protected]                                                                     000B: [email protected] += 0.10A92: create_custom_thread "barril.s" [email protected] [email protected] [email protected] [email protected]  250 ms                                                                                   0002: jump @BARRIL_2

 

 

Then compile and have fun tounge.gif

Link to comment
Share on other sites

KyanoAng3l0

 

It looks like you either took your inspiration from the Stinger-drop mod that I made for VC, or from the SA conversion of that mod, made by demonj0e. Since most of your code seems to be a carbon-copy of that code.

OR he thought of it by himself, having no knowledge about the existence of another mod of the same concept. Yeah it looks like a carbon copy mainly because there's no other or alternate way of coding it, is there?

 

You can't really immediately blame that he/she's ripping or taking ideas because it could be true that he/she thought of it himself/herself or thought of it the same way as you did when you made and released your own mod of the same/similar concept. But as a modder, I learned that before releasing a mod I should make sure that there's no other mod of the same concept already released and uploaded, otherwise I would be blamed for ripping. To be honest, back then, the word "ripping" doesn't exist or doesnt' apply in the modding world as long as both mods are in the same language and are for the same game. suicidal.gif

 

Nice Stinger-drop mod though. Too bad very single key available is used by the superpower mods I've installed/made.

Edited by angeloelibz24
Link to comment
Share on other sites

My god... The only thing he said, is that he thinks that the topic creator used the code of others and messed it up. Is that blaming for ripping? No... He haven't said a thing about ripping or about "theft". He only said that it looks like the code of others, but that it is messed up. He provided a link so he could compare them if he wanted to. Nobody said a damn thing about ripping or theft, so your offtopic post is useless. Ontopic now.

Link to comment
Share on other sites

 

Thank you !

 

I just finish my cleo mod with your help  biggrin.gif

 

 

No problem smile.gif

 

Adapting existing code (be it original or other peoples code) is an excellent way to learn SCM coding.

You should how ever be careful, that if you want to release it as an Mod you should ask permission of the original author,

if you're re-using a lot of his/her code. (Should you want to release this, you have my permission, credits would be appreciated however)

 

The code looks good, and the idea of dropping barrels sound like fun. icon14.gif

In the berril.txt file you could have removed a bit more of the existing code, as much of it is not needed in your mod.

 

{$VERSION 3.1.0027}{$CLEO .s}:BARRIL_thread0004: [email protected] = 0                                                                            [email protected] = Object.Create(1225, [email protected], [email protected], [email protected])                                              0177: set object [email protected] z angle to  [email protected]                                                              01C7: remove_object_from_mission_cleanup_list [email protected]                                                wait 15000                                                                                                                                                  0249: release_model 1225                                                              0108: destroy object [email protected]: end_custom_thread

 

 

@angeloelibz24:

I didn't accuse him of ripping, I just pointed out that he copied most of his code from my mod, but I've got no problem with that in this case.

And yes, he could have though about it myself, but there are so many ways to do it and to choose your constant that it would be very coincidental, that he came up with this code all by himself. Especially since a multi-threaded solution, is not the first thing people that just started modding think about. If you want to discuss this further, send me a PM, as I don't want to mess up this topic.

Edited by PatrickW
bS8xA.png
Link to comment
Share on other sites

I didn't know a similair code already exist. And if I had known this before, I didn't work on it during 2 days.

 

Now I'm looking for an opcode like:

 

04F7: status_text $10949  0 line  1 'NNNNNN'

 

 

but I don't want to use a "$" variable for my cleo mod

 

How can i do that for cleo?

 

I try to convert an another code I make before on BW's

Link to comment
Share on other sites

gtasearcher

A "$" is the denotion of a global variable.

 

Global variables shouldn't be used in CLEO [other than $PLAYER_ACTOR, $PLAYER_CHAR, $ONMISSION] because they can interfere with main.scm ones; in rest, they're almost the same as locals, but they can be used to communicate in multiple threads.

 

You can replace any global with a local [@].

 

BUT BE CAREFUL.

 

Things like text status and timers need globals, in

04F7: status_text $10949  0 line  1 'NNNNNN'

you should think of an unesed global in the main.scm, and use it instead of $10949, like $CLEO_VARIABLE_USED_FOR_TEXT_STATUS smile.gif

Link to comment
Share on other sites

If I create a new global variable like : $CLEO_VARIABLE_USED_FOR_TEXT_STATUS.

I'm not sur i can load the game after save without crash

 

Does it really works?

Link to comment
Share on other sites

gtasearcher
If I create a new global variable like : $CLEO_VARIABLE_USED_FOR_TEXT_STATUS.

I'm not sur i can load the game after save without crash

 

Does it really works?

If you put it in a CLEO, yes wink.gif

Link to comment
Share on other sites

I don't think that it is safe to just use a newly invented Global variable name. Sannybuilder will have to map that onto a memory location in the Global variable storage and it's very likely (maybe even certain) that the same location is already occupied by one of the global variables in the main.scm.

 

Depending on which global this is in the main.scm, the results can vary between crashes or minor changes in behavior.

 

The only variables that are safe to be used in a CLEO mods, are the ones that are defined in the Customvariables.ini file. As that file fixates the mapping between a Global Variable name and it's memorylocation. But these all have a predefined meaning, so they aren't useful in this situation.

 

If you must use an Global in a CLEO scripts (certain opcodes require one), a safe option is to use a named variable from the Customvariables.ini file, that isn't actually used in the main.scm. (e.g. $SECOND_PLAYER).

Another option might be to use the numerical name of one of the unused globals. e.g. $707 (numerical names have an implicit mapping onto a memory location).

 

 

 

 

 

 

bS8xA.png
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.