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

CLEO Mod Help


HayashibaraN
 Share

Recommended Posts

Hello Everyone!

 

As you have probably deduced by now, I am a new member. So, allow me to introduce myself. My name is HayashibaraN (Short for Hayashibara Namida), and I aspire to become a decent (or maybe even advanced tounge.gif ) scripter for my own benefit and for the benefit of others. Although I have alot of coding experience with GM, I realize that the road to becoming a GTASA scripter is not the most smooth. I am ready to take the time to learn this new language and step into the world of GTASA Modding.

 

As of now, I only have a few days experience with Sannybuilder and all that, and it's been pretty straightforward. I have read various tutorials and spent quite some time pouring through MAIN.scm and other decompiled CLEO scripts and I pretty much get the gist of opcodes and such.

 

But onto the actual problem at hand:

 

 

// 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 'AMBIENTSOUNDS' :AMB1wait 0 0AAE: release_mp3 $HMP3 0AAC: $HMP3 = load_mp3 "CLEO\AMBIENT\BATTLE.MP3" 0AAD: set_mp3 $HMP3 perform_action 1wait 117000 msjump @AMB10A93: end_custom_thread 

 

 

What I wanted to accomplish with this code was this:

 

-Loop an MP3 sound clip of a battle raging in the background

-Loop an MP3 sound clip of an indoor ambience sound

-Only play the battle sound when outside

-Only play the indoor ambience when inside

 

However, the problem with this is:

 

1) I am unsure of how to only play sounds when indoors/ outdoors

2) The game seems to crash/ hang upon exit. What hapens exactly is that I hear a windows "error sound" and the screen turns black. I must hold ALT+F4 to close everything, including SA.

 

Aside from that, I wanted to code several other things, but do not know the opcode(s) necessary:

 

1) Make it foggy all the time

2) Ped Riot All the time (think the stateofemergency cheat)

3) Spawn Waltons in traffic with a Gang Member in the back (equipped with with an AK47 or an RPG).

 

 

Other things to note:

 

I have edited the data files to make sure that any car of any type is rare. And that peds are scarce and most of the time non-existant. Not even police vehicles spawn.

 

 

Edited by HayashibaraN
Link to comment
Share on other sites

spaceeinstein

Instead of waiting 117 seconds, you could check if the mp3 is finished playing instead.

 

You can check if the player is in an interior by getting his current interior and constantly checking if the current interior is 0 (outside) or not 0 (inside).

Link to comment
Share on other sites

 

Instead of waiting 117 seconds, you could check if the mp3 is finished playing instead.

 

You can check if the player is in an interior by getting his current interior and constantly checking if the current interior is 0 (outside) or not 0 (inside).

What is the opCode for checking if the MP3 has finished? And what are the opCodes for checking whether or not the player is inside or outside?

 

EDIT: Not sure I need the MP3 opCode, since 117 seconds is the EXACT length of the clip.

 

EDIT2: Hmmm, I have tried peicing some sort of detection code for the ambience.

Doesn't work.

 

 

// 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::AMB1 //This whole label loads the MP3 and inits integers needed for the scriptwait 0 0AAE: release_mp3 $HMP3 0AAC: $HMP3 = load_mp3 "CLEO\AMBIENT\BATTLE.MP3" 0AB9: get_mp3 $HMP3 state_to [email protected] //Calls and stores the status of the MP3 we have just loaded077E: get_active_interior_to [email protected] //Calls and stores the active interior to the integer "[email protected]"//The opCodes below check to see whether or not to play the damn MP3 file (so it doesn't repeat each and every step)if [email protected] ==  -1  // Checks if the MP3 is not playing (stopped)jump @AMB2    //Playif [email protected] == 2  // Checks if the MP3 is not playing (paused)jump @AMB4    //Check whether to resume at AMB4:AMB2 //Plays the MP30AAD: set_mp3 $HMP3 perform_action 1jump @AMB1:AMB3 //Resumes the MP30AAD: set_mp3 $HMP3 perform_action 3jump @AMB4:AMB4if [email protected] ==  0  // Checks if player is in an interior or not by checking the integer "[email protected]"jump @AMB3else_jump @AMB5 //jumps to the part of the script that pauses the ambience sound if insideif [email protected] == -1 //Plays MP3 if it is stoppedjump @AMB2 :AMB5 //Pause the MP30AAD: set_mp3 $HMP3 perform_action 2jump @AMB1

 

 

Edited by HayashibaraN
Link to comment
Share on other sites

 

Instead of waiting 117 seconds, you could check if the mp3 is finished playing instead.

 

You can check if the player is in an interior by getting his current interior and constantly checking if the current interior is 0 (outside) or not 0 (inside).

What is the opCode for checking if the MP3 has finished? And what are the opCodes for checking whether or not the player is inside or outside?

 

EDIT: Not sure I need the MP3 opCode, since 117 seconds is the EXACT length of the clip.

 

EDIT2: Hmmm, I have tried peicing some sort of detection code for the ambience.

Doesn't work.

 

 

Have seen this exemble at

www.gtaforums.com/index.php?showtopic=377082&st=0entry1058665513

?

Link to comment
Share on other sites

Yes, I have seen that topic. Unfortunately, I didn't really understand what was going on in the script.

 

I do not understand that "Player Defined" tidbit and I do not see how it's an example of how to play MP3's only outdoors.

Link to comment
Share on other sites

spaceeinstein

Search for interior-related opcodes to get your current interior (like check the modding wiki at least). You can ignore the player defined thing for now.

Link to comment
Share on other sites

Search for interior-related opcodes to get your current interior (like check the modding wiki at least). You can ignore the player defined thing for now.

I found this opCode, but I am not sure if this is what you were referring to. I attempted to make the "pause if inside, but resume if outside" script above, but it doesn't work. I'm not sure how frequently CLEO scripts are run, but I was assuming that it is checked every step, and tried coding it as such. Idk, I'll have another go at it and see what I can do.

 

 

077E: get_active_interior_to [email protected] 

 

Link to comment
Share on other sites

spaceeinstein

:something

wait 0

get active interior store to [email protected]

if

[email protected] == 0 // outside

jf @nextlabel

do something outside

jump @end

 

:nextlabel

do something inside (since [email protected] is not 0, you're inside)

 

:end

jump @something

Link to comment
Share on other sites

 

:something

wait 0

get active interior store to [email protected]

if

[email protected] == 0 // outside

jf @nextlabel

do something outside

jump @end

 

:nextlabel

do something inside (since [email protected] is not 0, you're inside)

 

:end

jump @something

Okay, from your post, I made 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---------------wait 00AAE: release_mp3 $HMP30AAC: $HMP3 = load_mp3 "CLEO\AMBIENT\BATTLE.MP3"0AAD: set_mp3 $HMP3 perform_action 1:something077E: get_active_interior_to [email protected]: get_mp3 $HMP3 state_to [email protected]@ == 0 // outsidejf @nextlabel//do something [email protected] == -10AAD: set_mp3 $HMP3 perform_action 1jf @end:nextlabel//do something [email protected] == 10AAD: set_mp3 $HMP3 perform_action 0:endjump @something 

 

 

However, It doesn't seem to work.

Edited by HayashibaraN
Link to comment
Share on other sites

spaceeinstein

You should practice if statements more. Like

 

 

if [email protected] == [email protected] == 1jump_if_false @next0AAD: set_mp3 $HMP3 perform_action 1:next

 

 

Should be equivalent to

 

 

if [email protected] == 0 && [email protected] == 10AAD: set_mp3 $HMP3 perform_action 1end

 

 

I think.

Link to comment
Share on other sites

You should practice if statements more. Like

 

 

if [email protected] == [email protected] == 1jump_if_false @next0AAD: set_mp3 $HMP3 perform_action 1:next

 

 

Should be equivalent to

 

 

if [email protected] == 0 && [email protected] == 10AAD: set_mp3 $HMP3 perform_action 1end

 

 

I think.

Yeah, I'm not sure what I can and cannot use in GTA codes. I was under the assumption that

"if and" was the proper way to use it.

 

So if what your saying is true, you can also use "if [email protected] == 1 || [email protected]= 4" instead of

 

"if or

[email protected] == 1

[email protected] == 4"

 

And btw thanks for all your help!

biggrin.gif

Link to comment
Share on other sites

spaceeinstein

Glad I can help out.

 

Just a note Sanny Builder can't read the equivalent. I showed the equivalent for reference.

Edited by spaceeinstein
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.