Jump to content

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 comment
Share on other sites

I've also transfered the external script impound however it's too big to show here.

Edited by Xune
Link to comment
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 comment
Share on other sites

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 comment
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 comment
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 comment
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 comment
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 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
  • 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.