Tutorials

 Reply to this postStart new topic

[TUT]Mission Coding Pt. 2

Deji
post Jun 7 2009, 01:19 AM
Post #1


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Okay, despite what I said last time, Sanny is the best for coding wub.gif so go get it! And if you want, install CLEO so you dont have to start a new game when making carspawn mods biggrin.gif

Okay, if you're editing main.scm then press Ctrl + F and type: CHUNKY.

Now, if editing main.scm you will see the lines...

CODE
09E2: $5185 = parked_car_generator_w_numberplate #BULLET 24 40 1 alarm 0 door_lock 0 0 10000 plate "_CHUNKY_" at -2354.6 983.0 49.3 angle 189.4
014C: set_parked_car_generator $5185 cars_to_generate_to 0


Again, splitting them down...

CODE
09E2:


Is the opcode.

CODE
$5185


Is the name of the car being created.

CODE
parked_car_generator_w_numberplate


Is random useless text describing the function.

CODE
#BULLET


Is the car model.

CODE
24 40 1


Are parameters. 24 = the colour of the car. 40 = Secondary colour of the car. 1 = Now this is pretty cool, it changes whether CJ gainse cop heat from using it. I believe either 15, 16 or 0 disables it. Can't remember atm tongue.gif

CODE
alarm 0 door_lock 0 0 10000


Alarm 0 = Whether the alarm is on or off. door_lock 0 = Whether the door is locked or not. 0 = Dunno. 10000 = Dunno.

CODE
plate "_CHUNKY_"


The licence plate! Underscores are left as blanks (Spaces) and the plate MUST have 8 digits, otherwise the game will not like it.

CODE
at -2354.6 983.0 49.3


The x,y,z coords of the car.

CODE
angle 189.4


The angle, which rotates the vehicle.

CODE
014C: set_parked_car_generator $5185 cars_to_generate_to 0


014C = The opcode. $5185 = Says which vehicle to associate this line to. 0 = How often the car spawns 101 = All the time/ 0 = Never/ 50 = Half the time.


So, if we wanted a Banshee in the center of the game with the licence plate "CJ" that doesn't have an alarm or lock then we'd put:

CODE
09E2: $MYCAR1 = parked_car_generator_w_numberplate #BANSHEE 0 0 1 alarm 0 door_lock 0 0 10000 plate "___CJ___" at 0.0 0.0 0.0 angle 0.0
014C: set_parked_car_generator $MYCAR1 cars_to_generate_to 101


Finito!


--------------------
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

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