Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    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. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. 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. 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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Inserting police impounds into a stripped scm


Xune

Recommended Posts

I'm trying to put police impounds back into a stripped scm with a view to understand how the code modfies the barren police stations that otherwise appear. However, I'm having some difficulty. I've trawled through the original main file and have found these sections of code that appear relevant:

 

 

 

DEFINE OBJECT POLICE_BARRIER           ; Object number -386DEFINE OBJECT KMB_SHUTTER              ; Object number -387DEFINE OBJECT SFCOPDR                  ; Object number -388

 

 

These objects are referred to in the External script at the bottom. I've placed these under :Second_Segment and re-numbered them 1, 2 & 3 respectively, as well as changing DEFINE OBJECT to 4.

 

 

DEFINE EXTERNAL_SCRIPT_NAME IMPOUND;  71

 

 

This is placed under :Fourth_Segment and is re-numbered 0 and DEFINE EXTERNAL_SCRIPTS is set to 1.

 

 

0914: init_external_script  71 (IMPOUND)004F: create_thread ��IMPND_L_1

 

 

These two pieces were found when searching for likely keywords. The code that appears immediately above and below them in the original scm doesn't appear to be related.

 

 

:IMPND_L_103A4: name_thread 'IMPND_L':IMPND_L_20001: wait  100 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false ��IMPND_L_10100D6: if  004A3:   unknown $1866 ==  1004D: jump_if_false ��IMPND_L_280926: $EXTERNAL_SCRIPT_STATUS = external_script_status  71 (IMPOUND) 00D6: if  00038:   $EXTERNAL_SCRIPT_STATUS ==  0;; integer values004D: jump_if_false ��IMPND_L_2800D6: if  000FE:   actor $PLAYER_ACTOR  0 ()near_point  1579.425 -1636.463  14.5812 radius  120.0  120.0  80.0004D: jump_if_false ��IMPND_L_230004: $1865 =  1;; integer values:Impound_Garages_External_Script_Control08A9: load_external_script  71 (IMPOUND) 00D6: if  008AB:   external_script  71 (IMPOUND) loaded004D: jump_if_false ��IMPND_L_220913: run_external_script  71 (IMPOUND) :IMPND_L_220002: jump ��IMPND_L_28:IMPND_L_2300D6: if  00038:   $1865 ==  1;; integer values004D: jump_if_false ��IMPND_L_28090F: end_external_script  71 (IMPOUND) 0004: $1865 =  0;; integer values:IMPND_L_2800D6: if  004A3:   unknown $1866 ==  2004D: jump_if_false ��IMPND_L_570926: $EXTERNAL_SCRIPT_STATUS = external_script_status  71 (IMPOUND) 00D6: if  00038:   $EXTERNAL_SCRIPT_STATUS ==  0;; integer values004D: jump_if_false ��IMPND_L_5700D6: if  000FE:   actor $PLAYER_ACTOR  0 ()near_point -1624.771  679.6637  8.569 radius  120.0  120.0  80.0004D: jump_if_false ��IMPND_L_4800D6: if  00038:   $1522 ==  0;; integer values004D: jump_if_false ��IMPND_L_470004: $1865 =  2;; integer values08A9: load_external_script  71 (IMPOUND) 00D6: if  008AB:   external_script  71 (IMPOUND) loaded004D: jump_if_false ��IMPND_L_470913: run_external_script  71 (IMPOUND) :IMPND_L_470002: jump ��IMPND_L_57:IMPND_L_4800D6: if  00038:   $1522 ==  2;; integer values004D: jump_if_false ��IMPND_L_520004: $1522 =  0;; integer values:IMPND_L_5200D6: if  00038:   $1865 ==  2;; integer values004D: jump_if_false ��IMPND_L_57090F: end_external_script  71 (IMPOUND) 0004: $1865 =  0;; integer values:IMPND_L_5700D6: if  004A3:   unknown $1866 ==  2004D: jump_if_false ��IMPND_L_790926: $EXTERNAL_SCRIPT_STATUS = external_script_status  71 (IMPOUND) 00D6: if  00038:   $EXTERNAL_SCRIPT_STATUS ==  0;; integer values004D: jump_if_false ��IMPND_L_7900D6: if  000FE:   actor $PLAYER_ACTOR  0 ()near_point -1624.771  679.6637  8.569 radius  120.0  120.0  80.0004D: jump_if_false ��IMPND_L_740004: $1865 =  2;; integer values08A9: load_external_script  71 (IMPOUND) 00D6: if  008AB:   external_script  71 (IMPOUND) loaded004D: jump_if_false ��IMPND_L_730913: run_external_script  71 (IMPOUND) :IMPND_L_730002: jump ��IMPND_L_79:IMPND_L_7400D6: if  00038:   $1865 ==  2;; integer values004D: jump_if_false ��IMPND_L_79090F: end_external_script  71 (IMPOUND) 0004: $1865 =  0;; integer values:IMPND_L_7900D6: if  004A3:   unknown $1866 ==  3004D: jump_if_false ��IMPND_L_1010926: $EXTERNAL_SCRIPT_STATUS = external_script_status  71 (IMPOUND) 00D6: if  00038:   $EXTERNAL_SCRIPT_STATUS ==  0;; integer values004D: jump_if_false ��IMPND_L_10100D6: if  000FE:   actor $PLAYER_ACTOR  0 ()near_point  2284.592  2466.838  12.2306 radius  120.0  120.0  80.0004D: jump_if_false ��IMPND_L_960004: $1865 =  3;; integer values08A9: load_external_script  71 (IMPOUND) 00D6: if  008AB:   external_script  71 (IMPOUND) loaded004D: jump_if_false ��IMPND_L_950913: run_external_script  71 (IMPOUND) :IMPND_L_950002: jump ��IMPND_L_101:IMPND_L_9600D6: if  00038:   $1865 ==  3;; integer values004D: jump_if_false ��IMPND_L_101090F: end_external_script  71 (IMPOUND) 0004: $1865 =  0;; integer values:IMPND_L_1010002: jump ��IMPND_L_2

 

 

All references to "71 (IMPOUND)" in my new code have been changed to "0 (IMPOUND)" to correspond with it's definition under :Fourth_Segment. No other changes have been made to the code.

 

This code will compile and run however the impounds are still without police guards, wanted star penalties or police cars. I assume that either I have not ordered the code correctly or that there are still sections in the original file that I have not extracted.

 

Can someone lend a hand?

Edited by Xune
Link to post
Share on other sites
I wanted to applaud you both for your exemplary effort as well as you thorough documentation. That alone makes me want to help, but I'm on my way out the door. If you don't have your answer by time I get back, I'll try to see what I can do because I too need to learn about such things smile.gif
Link to post
Share on other sites
dertyjerzian

yes, I also will be watching this thread as many already know I am trying to put external scripts back into my stripped.

 

PS: demarest, I think I coded that stripped right before, the problem was that I did my own sprunk machine! So the game was calling mine and not recognizing it's original counterpart! I think it is not possible without the int image, so I haven't tried again yet. Anyway, back to the topic...

Link to post
Share on other sites

I noticed that the external script was making checks for.

 

0038:   $ON_MISSION ==  0&0038:   $ON_MISSION ==  1

 

 

I looked through the stripped file and saw that $ON_MISSION wasn't defined, so I searched and found these lines in the original main file

 

 

0180: set_on_mission_flag_to $ON_MISSION&0004: $ON_MISSION =  0 ;; integer values

 

 

Unfortunately adding these to the stripped file has made no difference.

 

I'm currently looking through the two main blocks of code I have found (The big one above and the external script) however nothing else has jumped out so far.

Link to post
Share on other sites
Unfortunately adding these to the stripped file has made no difference.

Nor would it in a stripped SCM, though the 2nd one is a good idea anyways just to reserve the memory.

 

I REALLY wish I had more time to throw at this confused.gif

Link to post
Share on other sites

All the way through that thread, there is a variable ($1866) which is checked for values, and runs different things depending on its value (presumably for different garages as it set variable $1865 then runs the external). The OpCode it is checking it with is unknown, so I cannot say for certain that this is the problem, HOWEVER, this variable is undefined anywhere in your code, and is therefore likely to be 0, unless you have defined it and not pasted that part of the code.

 

I will search through for other references to it.

 

Edit: first search result gave this (in MAIN, just under the external script status variable definition) :

 

0842: $1866 = unknown_player $PLAYER_CHAR data

 

This presumably sets $1866 as a reference to whatever island? he player is on.

 

Edit 2: I also just checked the sa-db, apparently 04A3 has already been speculated as a current island check, so this will back this theory up.

 

Edit 3: $1866 is used extensively throughout the rest of the code, however is only ever tested in the same way, not set.

 

Edit 4:

 

0842: set_player $player_char island_variable_to $1866

04A3: island_var $1866 == 2 ;; (island number 1, 2, 3)

 

Added to the db, but exist so you know.

Edited by Y_Less
Link to post
Share on other sites

Limited success, but I'm still in the middle of testing. Just thought I'd let ya know.

 

EDIT:

 

Ok, the impounds are now working, after a fashion. They have working barriers, however the LV one doesn't perform it's animation correctly. Wanted stars are given for entering when not in a police vehicle. The officers are spawned and carry out their scripted sequences, although I did notice that a car scripted to leave the impound made it to the barrier and then stopped, refusing to join the flow of traffic.

 

One major fault at the moment is that an impound is only being activated if you spawn on the island where it's located. Also the automatic gate and door that lead to the sublevel garages aren't being rendered, although the sound of the gate opening plays.

 

Here is the scm in text format as things currently stand. Spawn locations are indicated, just uncomment the one you want to test.

 

Hopefully now that there is something tangable to work with we can get this finished. Cheers for the help so far.

Edited by Xune
Link to post
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
  • 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.