X-Team Posted November 3, 2008 Share Posted November 3, 2008 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 More sharing options...
ZAZ Posted November 3, 2008 Share Posted November 3, 2008 (edited) 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 November 3, 2008 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...