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. Forum Support

    3. Suggestions

[SA] (Help) external scripts to cleo mission


xelono
 Share

Recommended Posts

Hello everyone, I need help

How could this code be converted into a functional cleo code ?? I must mention that this is an external script of the main.scm but since I am working on a mod (total conversion) the main.scm has been erased from scratch and I need some general options, like the videogame machines (not so important) and especially the Sprunk vending machines (cj_ext_sprunk, id 955) and Candy (cj_ext_candy, id 956). They must be those models, since the other models have been deleted.

 

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 
thread 'VENDING' 
[email protected] = 0 
if 
  [email protected] == 1 
jf @VENDING_84 
[email protected] = Object.Init(955, 918.6228, -2213.3665, 10.077)
[email protected] = Object.Init(1546, 0.0, 0.0, 0.0)

:VENDING_84
wait 0 
01BD: $CURRENT_TIME_IN_MS2 = current_time_in_ms 
if 
03CA:   object [email protected] exists 
jf @VENDING_1595 
if 
0977:   player_in_radius_of_object [email protected] external_script_trigger 
jf @VENDING_1500 
if 
   Player.Defined($PLAYER_CHAR)
jf @VENDING_1407 
if 
  [email protected] == 0 
jf @VENDING_177 
04ED: load_animation "VENDING" 
[email protected] += 1 

:VENDING_177
if 
  [email protected] == 1 
jf @VENDING_402 
if 
04EE:   animation "VENDING" loaded 
jf @VENDING_391 
0400: store_coords_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 from_object [email protected] with_offset 0.0 -1.0 0.5 
if 
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 radius 0.6 0.6 1.0 on_foot 
jf @VENDING_384 
if or
   Object.Model([email protected]) == 955
   Object.Model([email protected]) == 955
   Object.Model([email protected]) == 955
jf @VENDING_350 
03CF: load_wav 42601 as 4 
0512: show_permanent_text_box 'SLOT_04'  // ~k~~VEHICLE_ENTER_EXIT~ Buy Snack: $1
jump @VENDING_370 

:VENDING_350
03CF: load_wav 42600 as 4 
0512: show_permanent_text_box 'SLOT_05'  // ~k~~VEHICLE_ENTER_EXIT~ Buy Drink: $1

:VENDING_370
07CC: set_player $PLAYER_CHAR can_enter_exit_vehicles 0 
[email protected] += 1 

:VENDING_384
jump @VENDING_402 

:VENDING_391
04ED: load_animation "VENDING" 

:VENDING_402
if 
  [email protected] == 2 
jf @VENDING_1226 
if 
04EE:   animation "VENDING" loaded 
jf @VENDING_1215 
0400: store_coords_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 from_object [email protected] with_offset 0.0 -1.0 0.5 
if or
   Object.Model([email protected]) == 956
   Object.Model([email protected]) == 956
   Object.Model([email protected]) == 956
jf @VENDING_522 
03CF: load_wav 42601 as 4 
jump @VENDING_531 

:VENDING_522
03CF: load_wav 42600 as 4 

:VENDING_531
if 
00FF:   actor $PLAYER_ACTOR sphere 0 in_sphere $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 radius 0.6 0.6 1.0 on_foot 
jf @VENDING_1192 
if 
00E1:   player 0 pressed_key 15 
jf @VENDING_1185 
if 
   Player.Controllable($PLAYER_CHAR)
jf @VENDING_1185 
if 
   Player.Money($PLAYER_CHAR) > 0
jf @VENDING_1157 
if 
03D0:   wav 4 loaded 
jf @VENDING_1150 
$TEMPVAR_ANGLE = Object.Angle([email protected])
0400: store_coords_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 from_object [email protected] with_offset 0.0 -0.2 0.6 
[email protected] = Object.Init(1546, $TEMPVAR_FLOAT_1, $TEMPVAR_FLOAT_2, $TEMPVAR_FLOAT_3)
$TEMPVAR_ANGLE = Object.Angle([email protected])
0615: define_AS_pack_begin $3395 
0400: store_coords_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 from_object [email protected] with_offset 0.2 -1.0 0.0 
0804: AS_actor -1 walk_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 angle $TEMPVAR_ANGLE radius 0.4 animation "VEND_USE" IFP_file "VENDING" 4.0 LA 0 LX 0 LY 0 LF 1 LT 0 
if or
   Object.Model([email protected]) == 955
   Object.Model([email protected]) == 955
   Object.Model([email protected]) == 955
jf @VENDING_872 
0A1A: actor -1 perform_walk_animation "VEND_EAT_P" IFP "VENDING" framedelta 4.0 loopA 0 lockX 0 lockY 0 lockF 0 -1 ms // versionC 
jump @VENDING_1014 

:VENDING_872
07E4: get_model 1546 dimensions_cornerA_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 dimensions_cornerB_to $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 
$TEMPVAR_FLOAT_2 /= 2.0 
$TEMPVAR_FLOAT_2 += 0.027 
070A: AS_actor -1 attach_to_object [email protected] offset 0.062 $TEMPVAR_FLOAT_2 0.0 on_bone 5 16 perform_animation "VEND_USE_PT2" IFP_file "VENDING" time 0 
070A: AS_actor -1 attach_to_object [email protected] offset 0.062 $TEMPVAR_FLOAT_2 0.0 on_bone 5 16 perform_animation "VEND_DRINK2_P" IFP_file "VENDING" time 0 

:VENDING_1014
0616: define_AS_pack_end $3395 
0618: assign_actor $PLAYER_ACTOR to_AS_pack $3395 
061B: remove_references_to_AS_pack $3395 
Player.Money($PLAYER_CHAR) += -1
03E6: remove_text_box 
if or
   Object.Model([email protected]) == 955
   Object.Model([email protected]) == 955
   Object.Model([email protected]) == 955
jf @VENDING_1092 
03CF: load_wav 42601 as 4 
jump @VENDING_1101 

:VENDING_1092
03CF: load_wav 42600 as 4 

:VENDING_1101
if 
03D0:   wav 4 loaded 
jf @VENDING_1127 
0949: link_wav 4 to_actor $PLAYER_ACTOR 
03D1: play_wav 4 

:VENDING_1127
008B: [email protected] = $CURRENT_TIME_IN_MS2 // (int) 
[email protected] += 3000 
[email protected] += 1 

:VENDING_1150
jump @VENDING_1185 

:VENDING_1157
Actor.StorePos($PLAYER_ACTOR, $TEMPVAR_FLOAT_1, $TEMPVAR_FLOAT_2, $TEMPVAR_FLOAT_3)
018C: play_sound 1053 at $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 

:VENDING_1185
jump @VENDING_1208 

:VENDING_1192
03E6: remove_text_box 
07CC: set_player $PLAYER_CHAR can_enter_exit_vehicles 1 
[email protected] = 1 

:VENDING_1208
jump @VENDING_1226 

:VENDING_1215
04ED: load_animation "VENDING" 

:VENDING_1226
if 
  [email protected] == 3 
jf @VENDING_1340 
062E: get_actor $PLAYER_ACTOR task 1560 status_store_to $416 // ret 7 if not found 
if 
04A3:   $416 == 7 // == constant 
jf @VENDING_1340 
0623: add 5 to_integer_stat 245 
$3396 = Actor.Health($PLAYER_ACTOR)
$3396 += 30 
Actor.Health($PLAYER_ACTOR) = $3396
Object.RemoveReferences([email protected])
03E6: remove_text_box 
07CC: set_player $PLAYER_CHAR can_enter_exit_vehicles 1 
008B: [email protected] = $CURRENT_TIME_IN_MS2 // (int) 
[email protected] += 1500 
[email protected] += 1 

:VENDING_1340
if 
  [email protected] == 4 
jf @VENDING_1400 
if 
001E:   $CURRENT_TIME_IN_MS2 > [email protected] // (int) 
jf @VENDING_1400 
0687: clear_actor $PLAYER_ACTOR task 
04EF: release_animation "VENDING" 
[email protected] = 0 

:VENDING_1400
jump @VENDING_1493 

:VENDING_1407
if 
  [email protected] > 0 
jf @VENDING_1493 
if 
  [email protected] > 1 
jf @VENDING_1452 
03E6: remove_text_box 
07CC: set_player $PLAYER_CHAR can_enter_exit_vehicles 1 

:VENDING_1452
if 
  [email protected] > 2 
jf @VENDING_1475 
Object.RemoveReferences([email protected])

:VENDING_1475
04EF: release_animation "VENDING" 
[email protected] = 0 

:VENDING_1493
jump @VENDING_1588 

:VENDING_1500
if 
  [email protected] > 0 
jf @VENDING_1586 
if 
  [email protected] > 1 
jf @VENDING_1545 
03E6: remove_text_box 
07CC: set_player $PLAYER_CHAR can_enter_exit_vehicles 1 

:VENDING_1545
if 
  [email protected] > 2 
jf @VENDING_1568 
Object.RemoveReferences([email protected])

:VENDING_1568
04EF: release_animation "VENDING" 
[email protected] = 0 

:VENDING_1586
end_thread 

:VENDING_1588
jump @VENDING_1683 

:VENDING_1595
if 
  [email protected] > 0 
jf @VENDING_1681 
if 
  [email protected] > 1 
jf @VENDING_1640 
03E6: remove_text_box 
07CC: set_player $PLAYER_CHAR can_enter_exit_vehicles 1 

:VENDING_1640
if 
  [email protected] > 2 
jf @VENDING_1663 
Object.RemoveReferences([email protected])

:VENDING_1663
04EF: release_animation "VENDING" 
[email protected] = 0 

:VENDING_1681
end_thread 

:VENDING_1683
jump @VENDING_84 
end_thread 

:VENDING_1692
wait 2500 
jump @VENDING_1692 

 

Edited by xelono
Link to comment
Share on other sites

2 hours ago, ZAZ said:

What's the method  (code) to initialize the external script 'VENDING' ?

yes it is 'VENDING', but for some reason when I try to insert the external code in my main.scm, the game was hanging. I just wanted this script, so I did not have to load the 77 external script, maybe it requires the 77 to work or something similar.

Link to comment
Share on other sites


 

2 hours ago, xelono said:

yes it is 'VENDING',

I asked if you know the method to initialize the external script

So no, i assume you don't know anything

 

Does total conversion mean a total conversion of the map?

If yes, then you can't use a main.scm with all the external scripts for total conversion because a lot of objects don't exist anymore

You have to start with a total stripped main and then add the external scripts one by one

It also needs to recreate the required objects

 

 

 

Link to comment
Share on other sites

  • 1 year later...

@ZAZ
Hi!
@xelono doing a total convertion with main.scm, but I'm just doing new MPACK based on stripped.txt (clean scr.scm)
So I've been trying to recover some important external scripts, 


I just tried to Define objects:

Spoiler

DEFINE OBJECTS 9
DEFINE OBJECT SANNY BUILDER 3.2.2     
DEFINE OBJECT BARREL4                  // Object number -1
DEFINE OBJECT VENDMACHFD               // Object number -14
DEFINE OBJECT VENDMACH                 // Object number -15
DEFINE OBJECT VENDIN3                  // Object number -16
DEFINE OBJECT CJ_SPRUNK1               // Object number -17
DEFINE OBJECT CJ_CANDYVENDOR           // Object number -18
DEFINE OBJECT CJ_EXT_CANDY             // Object number -19
DEFINE OBJECT CJ_EXT_SPRUNK            // Object number -20

 

 then, I have Defined external script I need:

Spoiler

DEFINE EXTERNAL_SCRIPTS 1 // Use -1 in order not to compile AAA script
DEFINE SCRIPT VENDING_MACHINE AT @VENDING // 0

 

I have added initiation strings in main thread:

Spoiler

0929: init_external_script_trigger 8 (VENDING_MACHINE) with_object_model #VENDMACHFD priority 100 radius 6.0 type -1 
0929: init_external_script_trigger 8 (VENDING_MACHINE) with_object_model #VENDMACH priority 100 radius 6.0 type -1 
0929: init_external_script_trigger 8 (VENDING_MACHINE) with_object_model #VENDIN3 priority 100 radius 6.0 type -1 
0929: init_external_script_trigger 8 (VENDING_MACHINE) with_object_model #CJ_SPRUNK1 priority 100 radius 6.0 type -1 
0929: init_external_script_trigger 8 (VENDING_MACHINE) with_object_model #CJ_CANDYVENDOR priority 100 radius 6.0 type -1 
0929: init_external_script_trigger 8 (VENDING_MACHINE) with_object_model #CJ_EXT_CANDY priority 100 radius 6.0 type -1 
0929: init_external_script_trigger 8 (VENDING_MACHINE) with_object_model #CJ_EXT_SPRUNK priority 100 radius 6.0 type -1 

...
Actually I have tried "0929: init_external_script_trigger 0 (VENDING_MACHINE)"  since I though I have placed this external script in 0 position, when I have defined it. But after it crashed same way, I tried 8

 
And, of course, I have added external script (just copied if from original main.scm):

Spoiler

//-------------External script 8 (VENDING_MACHINE)---------------

:VENDING
thread 'VENDING' 
...

 

During the game, when Player comes closer to the vending machnies
game crashes (or hangs dead) 

Basicaly I'm just recreating the same enviroment as in original main.scm to initiate and can't figure out why it can't work.
Beg on Your suggestion If You please..

P.S.
since I'm begginer in coding I supose myself obviously doing something wrong:
editing custom scr.scm - compling it I recieve new small script.img - do I need to use it with new scr.scm or keep using original big script.img?

Edited by Ryabaahd
Link to comment
Share on other sites

11 hours ago, ZAZ said:

main.scm with external script for Mpack requires an exepatch

Thanks for reply, do not really catch what do You mean? 
I have a v1.0 US if we talk about gta_sa.exe

Link to comment
Share on other sites

Mission packs are experimental waste of Rockstar Games in San Andreas. They are never used in the original game, but they can be used for modding. Mission packs are used to get additional script content into the game.

 

By default the game skips the external script header in the script file, so it is impossible to use external scripts. However Seemann and some guys of the SannyBuilder community created a patch for that . Using this patch you can place your script.img archive file including your external scripts in the "%San Andreas%\data\script" directory of the game and rename it to "script<num>.img" where "<num>" corresponds to the number of your mission pack.

 

The parachute script can also be implemented as regular thread, without the need of external script

Edited by ZAZ
Link to comment
Share on other sites

5 hours ago, ZAZ said:

Mission packs are experimental waste of Rockstar Games in San Andreas. They are never used in the original game, but they can be used for modding. Mission packs are used to get additional script content into the game.

 

By default the game skips the external script header in the script file, so it is impossible to use external scripts. However Seemann and some guys of the SannyBuilder community created a patch for that . Using this patch you can place your script.img archive file including your external scripts in the "%San Andreas%\data\script" directory of the game and rename it to "script<num>.img" where "<num>" corresponds to the number of your mission pack.

 

The parachute script can also be implemented as regular thread, without the need of external script

Thanks! 
If I use this method of recovering parachute external script in main.scm - it works right, just like in original game,
but when I do it in MPACK with Seeman's patch it works with problem, I have read SannyBuilder community forums (since it's russian) that this patch cannot fully recover all external scripts working mechanics and may have problems, but still most of features able to work OKay. 
The problem faced in MPACK1 (scr.scm+script1.img): 
When player picks up the gun_para camera moves very close to character and its unable to shoot from weapons, jump forward (only upward, like in water) and can't get in vehicles. Skydiving works and parachute deploy mechanics also works fine, but character planning to the ground very fast (like some bug from original game, when it's failed to deploy parachute) characher movement cannot be fully realised (you can't slow it down by pressing 'back' movement button) and when character touches the gound he dies.

I've never tried the thread method of parachute.

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.