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

DEFINE EXTERNAL_SCRIPTS


X-Team
 Share

Recommended Posts

Cam somebody explain me how to use External Scripts and how do they look like?

 

DEFINE EXTERNAL_SCRIPTS 0 //that means that in the game are not external scripts!

 

when I set DEFINE EXTERNAL_SCRIPTS 1 how to call the script?

 

Like in DEFINE MISSIONS or not?

 

 

DEFINE MISSIONS 1DEFINE MISSION 0 AT @Missionstart_mission 0 //starts mission at the start of game:Mission//mission code

 

 

Is External Script executed automatically?

 

Parachute is external script then video games in GTA SA?

Parachute is executed if player is in the AIR!

 

I don't know how to write, define or to execute external scripts?

They're very useful!

 

An example and help PLEASE!

 

THANKS

Link to comment
Share on other sites

 

Cam somebody explain  me how to use External Scripts and how do they look like?

 

DEFINE EXTERNAL_SCRIPTS 0  //that means that in the game are not external scripts!

 

when I set DEFINE EXTERNAL_SCRIPTS 1 how to call the script?

 

Like in DEFINE MISSIONS or not?

 

 

DEFINE MISSIONS 1DEFINE MISSION 0 AT @Missionstart_mission 0 //starts mission at the start of game:Mission//mission code

 

 

Is External Script executed automatically?

 

Parachute is external script then video games  in GTA SA?

Parachute is executed if player is in the AIR!

 

I don't know how to write, define or to execute external scripts?

They're very useful!

 

An example and help PLEASE!

 

THANKS

To install a extern script in the decompiled script of main.scm need first to define extern script in the list at the top

The number in the first line should be the total amount of listed extern scripts

 

DEFINE EXTERNAL_SCRIPTS  2DEFINE SCRIPT PLAYER_PARACHUTE AT @Label_PLAYER_PARACHUTE  //  0  player using parachuteDEFINE SCRIPT Extern_Action AT @Label_Extern_Action  //  1  Test_Extern_Script

 

 

the DEFINE SCRIPT-line have 3 infos

1. the name wich is used in the extern-script-starter script (but i believe its not important)

2. The Adress(Label) of the extern script

3. the number wich is used in the extern-script-starter script, and this is important

 

// 1 Test_Extern_Script is a comment but "Label_Extern_Action " script becomes the number 1 because of the position in the list

the first exern script becomes ciro, the second 1, the third 2 and so on.

 

The extern scripts are placed in the last part of the main.

The first one beginns where the last mission script ends.

They should be added in the same order like in the list

After compiling you get main.scm and script.img, the exern scripts are in script.img

 

Now, you need a extern-script-starter thread:

 

004F: create_thread @Extern_Script_Starter_1

 

 

:Extern_Script_Starter_103A4: name_thread 'EXSS':Extern_Script_Starter_20001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @Extern_Script_Starter_200D6: if  00038:   $TEXS1 ==  0  // integer values004D: jump_if_false @Extern_Script_Starter_200D6: if  000FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2503.5  -1673.5  13.35 radius  2.0  2.0  1.0004D: jump_if_false @Extern_Script_Starter_7:Extern_Script_Starter_50926: $Script_Status = external_script_status  1 (Extern_Action) 00D6: if  00038:   $Script_Status ==  0  // integer values004D: jump_if_false @Extern_Script_Starter_608A9: load_external_script  1 (Extern_Action)00D6: if  008AB:   external_script  1 (Extern_Action) loaded004D: jump_if_false @Extern_Script_Starter_60913: run_external_script  1 (Extern_Action) :Extern_Script_Starter_60002: jump @Extern_Script_Starter_8:Extern_Script_Starter_7090F: end_external_script  1 (Extern_Action) :Extern_Script_Starter_80002: jump @Extern_Script_Starter_2

 

 

 

The $Script_Status check should check if the Extern_Script is running to protect durable script starts.

But the check with using 0926 wont work correct in my tests, so I used a normal global var to check the script status

00D6: if 0

0038: $TEXS1 == 0 // integer values

$TEXS1 is 0 by default and the extern_script includes:

0004: $TEXS1 = 1

at start

and at the end:

0004: $TEXS1 = 0 // integer values

004E: end_thread

 

the extern script:

 

//-------------------------------------------------:Label_Extern_Action// Originally: Test_Extern_Script03A4: name_thread "TEXS"  0004: $TEXS1 =  10247: request_model #BALLAS10247: request_model #AK470247: request_model #TRIBOSS:Load_Extern_models0001: wait  0 ms00D6: if  20248:   model #BALLAS1 available0248:   model #TRIBOSS available0248:   model #AK47 available004D: jump_if_false @Load_Extern_models009A: [email protected] = create_actor  7 #BALLAS1 at  2506.5  -1664.5  13.450173: set_actor [email protected] z_angle_to  180.001B2: give_actor [email protected] weapon  30 ammo  99999  // Load the weapon model before using this02E2: set_actor [email protected] weapon_accuracy_to  1000223: set_actor [email protected] health_to  300005E2: AS_actor [email protected] kill_actor $PLAYER_ACTOR0632: release_group $PLAYER_GROUP009A: [email protected] = create_actor  8 #TRIBOSS at  2506.5  -1674.5  13.450173: set_actor [email protected] z_angle_to  180.001B2: give_actor [email protected] weapon  30 ammo  99999  // Load the weapon model before using this02E2: set_actor [email protected] weapon_accuracy_to  1000223: set_actor [email protected] health_to  50000631: put_actor [email protected] in_group $PLAYER_GROUP07CB: [email protected]  00249: release_model #BALLAS10249: release_model #TRIBOSS0249: release_model #AK47:Extern_Loop_10001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @Test_Extern_Script_End00D6: if  08118:   NOT   actor [email protected] dead004D: jump_if_false @Test_Extern_Script_End00D6: if  00104:   actor $PLAYER_ACTOR near_actor [email protected] radius  80.0  80.0  10.0 sphere  0004D: jump_if_false @Test_Extern_Script_End0002: jump @Extern_Loop_1:Test_Extern_Script_End01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian0004: $TEXS1 = 0  // integer values004E: end_thread

 

 

 

 

Instead of an extern-script-starter thread can be used a special extern-script-starter code

which is associated with an objekt.

 

0929: init_external_script_trigger 9 (FOOD_VENDOR) with_object_model #ICESCART_PROP priority 100 radius 70.0 type -1

 

Those objects must be placed by IPL and must be available in data\object.dat

and must be available in the object list at the top of the main.scm

 

 

 

 

 

 

 

 

 

 

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