IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the GTA IV Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules Attention:

The Mod Showroom is only for posting previews/downloads of completed or near finished mods.
All help topics should be posted in the Editing Discussion forums. Help topics and mod requests posted here will be locked or binned. Thank you.
GTAGarage.com : Free mod hosting, attach your files and screenshots to your topics
GTAModding.com : A wiki for everything related to GTA modding, including documentation and tutorials

Pages: (5) [1] 2 3 ... Last »  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> [REL | CODE] Chop Shop, Now open for business :-)
 
Viper187  
Posted: Jun 24 2005, 20:03
Quote Post


Crazy Snake
Group Icon
Group: Members
Joined: Oct 17, 2002

XXXXX



I remember someone in the game mentioning using CJ's garage as a chop shop at one point. I got ocram88 to help me figure out the code for making cars drive into a garage the way they do on the missions for that one, and I set this up so it activates once you complete the regular missions (Puncture Wounds was the last?). While in a car (and not on a mission), a red circle will appear in front of the garage door. Just drive over there to chop your wheels and earn a little cash. It's just a little mod, but I thought it was kind of neat. By default, it gives 1/4th the car's monetary value from handling.cfg. This can be easily changed (see @2), but it seemed like plenty. I didn't get into checking the car's health or if it's wrecked, because my car immunities mod would mess that up anyway by keeping it perfect with 32000 health. lol

Big thanks to ocram88 for putting together most of the actual garage code. smile.gif

add this line with the other create_thread lines near the top of MAIN:
CODE

004F: create_thread ££SNAKECHOP00


Then find:

CODE

;-------------Mission 0---------------
; Originally: Initial 1


and add BEFORE it:

CODE

:SNAKECHOP00
0001: wait  0 ms
00D6: if  2
0038:   $STEAL_MISSIONS_PASSED ==  4;; integer values
0038:   $ON_MISSION ==  0;; integer values
00DF:   actor $PLAYER_ACTOR driving
004D: jump_if_false ££SNAKECHOP00

:SNAKECHOP01
00D6: if  1
0103:   actor $PLAYER_ACTOR stopped_near_point_in_car -2033.175  178.6755  27.8516 radius  4.0  4.0  4.0 sphere  1  
83B0:   NOT   garage 'HBGDSFS' door_open
004D: jump_if_false ££SNAKECHOP00
0360: open_garage 'HBGDSFS'
0811: @0 = actor $PLAYER_ACTOR car
00AB: put_car @0 at -2033.175 178.6755 30.0
0175: set_car @0 z_angle_to  90.0
01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)
015F: set_camera_position  -2037.175 188.6755  33.8516  0.0  0.0  0.0
0158: camera_on_vehicle @0  15  2
0001: wait  2000 ms
0615: @114
05B9: unknown_action_sequence -1  1000
05D1: unknown_action_sequence -1 @0 -2044.0  178.6755  27.8359  7.0  0  0  3
0633: unknown_action_sequence -1
0616: @114
0618: $PLAYER_ACTOR @114
061B: @114
062E: $PLAYER_ACTOR  1560 @105
0001: wait  3500 ms
0361: close_garage 'HBGDSFS'
0001: wait  2000 ms
016A: fade  0 ()  1000 ms
0001: wait  1000 ms
03E6: remove_text_box
016A: fade  1 (back)  1000 ms
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at  -2033.175 178.6755 27.8516
0441: @1 = car @0 model
00A6: destroy_car @0
01C3: remove_references_to_car @0
01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
09E1: @1 @2
0016: @2 /=  4;; integer values
0109: player $PLAYER_CHAR money += @2
01E3: text_1number_styled 'IE30' @2  5000 ms  1
0002: jump ££SNAKECHOP00


This post has been edited by Viper187 on Jun 24 2005, 20:36
Users WebsitePMAOLICQ
  Top
 

 
Knightmare  
Posted: Jun 24 2005, 20:11
Quote Post


man tongues
Group Icon
Group: $outh $ide Hoodz
Joined: Nov 18, 2001

XXXXX



Damn, that's awesome.

Good work smile.gif
PMAOL
  Top
 

 
Viper187  
Posted: Jun 24 2005, 20:38
Quote Post


Crazy Snake
Group Icon
Group: Members
Joined: Oct 17, 2002

XXXXX



Small edit. I made it so you have to be stopped in the sphere instead of just touching it.

This line:
CODE

0100:   actor $PLAYER_ACTOR near_point_in_car -2033.175 178.6755 27.8516 radius  4.0  4.0  4.0 sphere  1

changed to:
CODE

0103:   actor $PLAYER_ACTOR stopped_near_point_in_car -2033.175  178.6755  27.8516 radius  4.0  4.0  4.0 sphere  1  

Users WebsitePMAOLICQ
  Top
 

 
GodGell  
Posted: Jun 24 2005, 21:33
Quote Post


shlurp my burger, sir
Group Icon
Group: Members
Joined: Oct 31, 2003

hg.gif

XXXXX



as i've said on IRC, i modified your mod a bit. now it doesnt give you the 4th of the cars monetary value, but instead it checks the car's health, and gives you that percentage of the original monetary value (that is, if your car has 100% health, you get 100% money, if its 50% health, you get 50% money, etc)

somewhere before destroy_car:

CODE
0227: @3 = car @0 health


before add_player_money, replace the @2 /= 4 part with this:

CODE
0016: @3 /= 100
0068: @2 *= @3;; integer values


smile.gif
Users WebsitePMMSN
  Top
 

 
tsc  
Posted: Jun 25 2005, 18:58
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 25, 2005

XXXXX



I was hoping someone would put out a mod like this. Great job. Unfortunately I can't get it to work. I followed the directions in the readme file for the scm editor I'm using, I followed your directions, and the code even compiles. However, when I hit "compile and add to GTA" it tells me to install GTA. I have GTA installed. When I just compile your code, I get the message that main.scm was created in a separate folder. I tried just copying that main.scm file to data/script/ and the game locks up whenever I load a game or start a new one.

Any advice you could give me would be appreciated. I've been looking forward to a mod like this.
PM
  Top
 

 
Viper187  
Posted: Jun 25 2005, 23:02
Quote Post


Crazy Snake
Group Icon
Group: Members
Joined: Oct 17, 2002

XXXXX



1. use Barton's SA Builder v0.33 (if you're not already) and only "Compile" not "Compile & copy"
2. open the SCM/TXT file from the directory it's in (data\scripts) and it'll compile to there.
3. the builder makes both main.scm AND script.img. copy both if you insist on compiling elsewhere.
Users WebsitePMAOLICQ
  Top
 

 
tsc  
Posted: Jun 26 2005, 07:44
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 25, 2005

XXXXX



Unreal. I'm doing everything perfectly, but every time I load a new game or a saved game the game crashes and I get the error message: gta_sa.exe has encountered a problem blah blah blah.

I'm using barton's mission builder 0.33 and added the lines...
0A4A=2,%1h% %2h%
0A4B=0,
...to SASCM.ini

I open main.scm, it makes main.txt. I make the additions to this code. I compile, no errors. I copy main.scm and script.img to c/pf/rg/data/script/ open the game click new game and crash every time.

Anyone out there want to share their main.scm/script.img files with just this change to it? I'm offering 5 million karma points as compensation for my sanity.
PM
  Top
 

 
GodGell  
Posted: Jun 26 2005, 15:26
Quote Post


shlurp my burger, sir
Group Icon
Group: Members
Joined: Oct 31, 2003

hg.gif

XXXXX



QUOTE (tsc @ Jun 26 2005, 09:44)
Anyone out there want to share their main.scm/script.img files with just this change to it? I'm offering 5 million karma points as compensation for my sanity.

lol, are you sure you made the appropriate changes? you must add the create_thread where the original ones are, and you must add the thread itself above mission 0, also be careful not to accidentally put the thread inside another one.
Users WebsitePMMSN
  Top
 

 
tsc  
Posted: Jun 26 2005, 15:37
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 25, 2005

XXXXX



Yes sir. I'm positive I did it right. I just do a search for "create_thread" and add the first line of code there. Then I do a search for "Originally: Initial 1" and copy/paste the lines of code right above it. I can't believe I can't get this to work, it's a piece of cake.
PM
  Top
 

 
GodGell  
Posted: Jun 26 2005, 15:45
Quote Post


shlurp my burger, sir
Group Icon
Group: Members
Joined: Oct 31, 2003

hg.gif

XXXXX



QUOTE (tsc @ Jun 26 2005, 17:37)
Yes sir. I'm positive I did it right. I just do a search for "create_thread" and add the first line of code there. Then I do a search for "Originally: Initial 1" and copy/paste the lines of code right above it. I can't believe I can't get this to work, it's a piece of cake.

hmm, that's strange. do you compile, then copy the main.scm to SA? smile.gif
Users WebsitePMMSN
  Top
 

 
demonj0e  
Posted: Jun 26 2005, 19:10
Quote Post


Sa Coder In Training
Group Icon
Group: Members
Joined: Apr 5, 2005

uk.gif

XXXXX



what missions usses the chop shop?
Users WebsitePMMSNAOL
  Top
 

 
tsc  
Posted: Jun 26 2005, 19:39
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 25, 2005

XXXXX



Finally, I got it to work. Well at least I was able to load a new game. I guess I won't know if it worked until after the Wang Cars missions. I'm not able to load a saved game after making the changes. That's normal right? To test this mod did you have to play through all those missions again?

I do want to modify the amount of money you get for each car though. Let's say I wanted to make it so you only get 10% of the value of the car delivered. Will the following code changes work?

changing: 0016: @2 /= 4;; integer values
to: 0016: @2 /= 10;; integer values

Thanks for your help and this mod.
PM
  Top
 

 
GodGell  
Posted: Jun 26 2005, 19:52
Quote Post


shlurp my burger, sir
Group Icon
Group: Members
Joined: Oct 31, 2003

hg.gif

XXXXX



QUOTE (tsc @ Jun 26 2005, 21:39)
Finally, I got it to work. Well at least I was able to load a new game. I guess I won't know if it worked until after the Wang Cars missions. I'm not able to load a saved game after making the changes. That's normal right? To test this mod did you have to play through all those missions again?

I do want to modify the amount of money you get for each car though. Let's say I wanted to make it so you only get 10% of the value of the car delivered. Will the following code changes work?

changing: 0016: @2 /= 4;; integer values
to: 0016: @2 /= 10;; integer values

Thanks for your help and this mod.

yes, unfortunately the slightest change of main.scm causes the savegames not to work.
"0016: @2 /= 10"
will give you the 10th of the original value.

i suggested a bit of modification to the value above, which gives you money based on how much damaged the car is, i'd suggest you to use that one as it's more realistic. smile.gif
Users WebsitePMMSN
  Top
 

 
tsc  
Posted: Jun 26 2005, 20:02
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 25, 2005

XXXXX



Hmmm, how about a combination of both:

somewhere before destroy_car:

CODE
0227: @3 = car @0 health


before add_player_money, replace the @2 /= 4 part with this:

CODE
0016: @3 /= 100
0068: @2 *= @3 /=10;; integer values


Is this code correct if I want it to check the health and still give only 10% of the value after the check?

I want to leave in the 10% part because it's not really realistic to get 10,000 dollars for delivering a Sanchez to a chop shop.
PM
  Top
 

 
GodGell  
Posted: Jun 26 2005, 20:07
Quote Post


shlurp my burger, sir
Group Icon
Group: Members
Joined: Oct 31, 2003

hg.gif

XXXXX



QUOTE (tsc @ Jun 26 2005, 22:02)
Hmmm, how about a combination of both:

somewhere before destroy_car:

CODE
0227: @3 = car @0 health


before add_player_money, replace the @2 /= 4 part with this:

CODE
0016: @3 /= 100
0068: @2 *= @3 /=10;; integer values


Is this code correct if I want it to check the health and still give only 10% of the value after the check?

I want to leave in the 10% part because it's not really realistic to get 10,000 dollars for delivering a Sanchez to a chop shop.

nope, that code isn't correct, sadly SCM is a very primitive language.

CODE

0016: @3 /= 100
0068: @2 *= @3
0016: @2 /= 10


i think it would be much more realistic to get 80% of the cars value.
and you get 10k for a sanchez if it's monetary value is 10k.
Users WebsitePMMSN
  Top
 

 
tsc  
Posted: Jun 26 2005, 20:15
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 25, 2005

XXXXX



Ok thanks. You have to do the operations on @2 one at a time. The reason I said 10k for a Sanchez is that's how much it was for delivering one in mint condition on the import/export missions. I assumed we were getting 100% value for each car on those missions.

One more question, I noticed you went from 0016 to 0068 and then back to 0016 with:

0016: @3 /= 100
0068: @2 *= @3
0016: @2 /= 10


Are you allowed to do that, instead of going to a higher number like 0072?

EDIT: Studying the code, I'm seeing some patterns that might answer my own question. Every command to "wait" is preceeded by a 0001. I'm guessing every command to divide must be preceeded by a 0016. Is that correct? Then every command to multiply must be preceeded by a 0068?

This post has been edited by tsc on Jun 26 2005, 20:36
PM
  Top
 

 
tsc  
Posted: Jun 26 2005, 20:46
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 25, 2005

XXXXX



I'm looking at this part of the code:

:SNAKECHOP00
0001: wait 0 ms
00D6: if 2
0038: $STEAL_MISSIONS_PASSED == 4;; integer values
0038: $ON_MISSION == 0;; integer values
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££SNAKECHOP00

If I removed 0038: $STEAL_MISSIONS_PASSED == 4;; integer values

...and changed: 00D6 if 2 ... to: 00D6 if 1

...would I be able to deliver cars to the chop shop before doing any missions if I combined this with SANGA or the open-up SA mods? Any and all help appreciated.


PM
  Top
 

 
GodGell  
Posted: Jun 26 2005, 21:01
Quote Post


shlurp my burger, sir
Group Icon
Group: Members
Joined: Oct 31, 2003

hg.gif

XXXXX



QUOTE (tsc @ Jun 26 2005, 22:46)
I'm looking at this part of the code:

:SNAKECHOP00
0001: wait 0 ms
00D6: if 2
0038: $STEAL_MISSIONS_PASSED == 4;; integer values
0038: $ON_MISSION == 0;; integer values
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false ££SNAKECHOP00

If I removed 0038: $STEAL_MISSIONS_PASSED == 4;; integer values

...and changed: 00D6 if 2 ... to: 00D6 if 1

...would I be able to deliver cars to the chop shop before doing any missions if I combined this with SANGA or the open-up SA mods? Any and all help appreciated.

yes. smile.gif
Users WebsitePMMSN
  Top
 

 
Viper187  
Posted: Jun 26 2005, 21:17
Quote Post


Crazy Snake
Group Icon
Group: Members
Joined: Oct 17, 2002

XXXXX



QUOTE (tsc @ Jun 26 2005, 20:15)
Ok thanks. You have to do the operations on @2 one at a time. The reason I said 10k for a Sanchez is that's how much it was for delivering one in mint condition on the import/export missions. I assumed we were getting 100% value for each car on those missions.

One more question, I noticed you went from 0016 to 0068 and then back to 0016 with:

0016: @3 /= 100
0068: @2 *= @3
0016: @2 /= 10


Are you allowed to do that, instead of going to a higher number like 0072?

EDIT: Studying the code, I'm seeing some patterns that might answer my own question. Every command to "wait" is preceeded by a 0001. I'm guessing every command to divide must be preceeded by a 0016. Is that correct? Then every command to multiply must be preceeded by a 0068?

The numbers are opcodes. They determine what it actually to be done. The text actually means nothing. The builder just grabs that number, and the vars in the right order (if needed) and builds that. Alos note that math ops are data type specific most times. opcodes.txt included with Barton's SA Builder has a complete list of all ops, but some still lack descriptions.
Users WebsitePMAOLICQ
  Top
 

 
tsc  
Posted: Jun 27 2005, 08:45
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 25, 2005

XXXXX



Works great, thanks Viper and GodGell. The only way I found of testing it is with the Never Wanted cheat. I changed the code to make the chop shot available from the start of the game. Unfortunately, I was unable to combine this mod with the San Andreas Opened Up mod because decompiling SAOU and then recompiling it gave me the dreaded Label0195A0 error. Hopefully, in the future, the author will provide his source code so we can just plug it into our original main.scm file and combine the mods of our choosing.

Back to this mod: I'd love to see the chop shop have a list, like the import/export missions had a chalkboard with 10 cars listed for import. Even if the chop shop only listed one car at a time, I think it would be cool. Perhaps take the model of the chalkboard from the import/export missions, drop it right outside the garage, and display the car name that's needed for import. Is there a way to do this? Maybe choose a car model from random and have it displayed on the chalk board? If this is possible, maybe put it on a timer, to where the car model changes every day so you have to be quick about finding that particular model.

Just throwing out some ideas of what I'd like to see in this mod. I wish I was talented enough to do this on my own. Thanks again and keep up the good work.


EDIT: looking at the code for IMPEXPM in the main.txt after decompiling main.scm I found this: 029B: @27 = init_object #NF_BLACKBOARD at 0.0 0.0 0.0 ... and this: 029B: @27 = init_object #NF_BLACKBOARD at -1573.881 135.3845 2.535

Looking at the code for the chop shop I'm assuming the sphere outside the garage is at -2033.175 178.6755 27.8516 So, putting in this line of code would put the blackboard right outside the garage: 029B: @27 = init_object #NF_BLACKBOARD at 2033.175 178.6755 27.8516

Is that correct so far?

EDIT 2: I think instead of making the car on the list random, just make a list of most of the car I.D.'s in order and just go down the line one right after the other, and when it gets to the end of the list, looping back to the first car again. The timer would pretty much make it random enough unless you stole the car on the list every day. From the vehicles.ide file it looks like the I.D.'s for the cars start at 400 for a Landstalker and end around 609 for a boxburg van. Some of these id's won't be able to be used for stealing though like the I.D.'s for boats.

EDIT 3: If we dropped the timer idea and just decided to make a list of cars and go through the list one at a time, maybe something like this?:

0811: @10 = "CAR_ON_LIST"

...obviously not even close but just a general idea, there must be a way to make a list of cars and then add 1 each time a car is delivered to get to the next car, then looping back to the beginning when we reach the end of the list

Then put in the following after making sure we're in the radius of the sphere:

0811: @11 = actor $PLAYER_ACTOR car
00D6: if 1
0103 @11 = @10 ;;<--@10 being the car on the list

..if false maybe throw in a:

00BB: text_lowpriority 'IE23' 3000 ms 1 ; ~s~This vehicle is not required for export.

004D: jump_if_false ££SNAKECHOP00
0441: @12 = car @11 model
09E1: @12 @13
0016: @13 /= 10
0109: player $PLAYER_CHAR money += @13
01E3: text_1number_styled 'IE30' @13 5000 ms 1

"CAR_ON_LIST" + 1 then an if statement to see if we reached the end of the list and need to loop back to the beginning.

0002: jump ££SNAKECHOP00

This post has been edited by tsc on Jun 27 2005, 11:47
PM
  Top
 

 
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages: (5) [1] 2 3 ... Last » Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG
     

 
     
Message Boards and Forums Directory