Jump to content

My Vice City Coding Tutorial


LittleGuna
 Share

Recommended Posts

Welcome to my Vice City coding tutorial for beginners!

Tutorial 1

Ok, this tutorial is strictly for beginners. Before we start I hope that you have BW’s Mission builder Version 1.3 (MUST BE VERSION 1.3!!!!!!!!!!!!!!) (you will need it to code vice city).

You can download BW's Mission Builder here.

In this tutorial I will show you how to place cars, health, weapons, and show you how to change the starting position of the player, etc. In the next tutorial (tutorial 2) these things will be explained more and you will learn how to place money, actors and markers. And by the end of it, you will know how to make a car spawn by pressing a button and a simple bodyguard mod.

Lesson one: Weapons

Ok, in BW’s mission builder, open up the file called main.scm in the vice city data folder

Then goto search, and search for this line:

032B: $471 = create_weapon_pickup #COLT45
As u can see, there are a whole lot of:
create_weapon_pickup
Things, this is where all the weapons are placed in the game. But before u create your own weapon you must understand the code:
032B: $471 = create_weapon_pickup #COLT45  15 ammo  34 at -228.4 -1318.2  9.1
-the ‘032B’ part is called the opcode (this can be ignored at the moment) -the ‘$471’ is what rockstar games decided to name this particular weapon (every thing that u create must have a name) -the ‘create_weapon_pickup’ is what the code is telling the game to do -the ‘#COLT45’ is the weapon that it is creating -the ‘15’ is the type (this can be ignored at the moment) -the ‘ammo 34’ is how much ammo the weapon has -the ‘at -228.4 -1318.2 9.1’ are the coordinates that you want the weapon to be created So to create your own weapon copy that piece of code that I just showed you and paste it under it’s self so that you have two of the same codes, you will soon modify this and make your own weapon. -Ok, first of all give your new weapon a different name, like ‘$myweapon’ instead of ‘$471’ -Then change the ‘#COLT45’ part to another weapon that you like, e.g. ‘#UZI’. Here are some names of weapons that you can choose: #UZI #COLT45 #M60 #M4 #GRENADE #TEC9 #SNIPER there are just some of the weapons, (but don’t choose any melee weapon because they use a different opcode). -Then change the ‘ammo 34’ part to whatever u want, like ‘ammo 999’ -Then change the coordinate part of the code to a coordinate of your choice. I have chosen: ‘at 402.428 -465.688 9.918’ (outside the Washington beach police station) -If you want to get coordinates then download a coordinate reader, like ‘Player Pos’ So I ended up with a piece of code that looks like this:
032B: $myweapon = create_weapon_pickup #UZI  15 ammo  999 at  402.428 -465.688 9.918
you can now test it by going to: ‘Copy, Compile, Run GTA Vice’ BUT YOU MUST START A NEW GAME!!!!!!!!!!!!!! It should work! Lesson two: Pickups (health) I hope u still have mission builder open. Ok, search for the line:
0213: $495 = create_pickup -86
(you should see heaps of these lines) The one u just searched for should look like this:
0213: $495 = create_pickup -86 (HEALTH) type  15 at -113.2 -975.7  10.4
As you can see it is much similar to the weapon placing we did in lesson one. It has an opcode, a name, the thing that tells the game what to do, the pickup that we are placing, a type (type 1 is buyable health and type 15 is free (I think)), and the coordinates. I don’t think I need to explain in further detail. So copy that line and paste it under its self So just like before, change the name to whatever you want then change the coordinates to whatever you want, I have chosen 206.666 -491.721 11.351 (outside the hardware store near the police station) so now my code should look like this:
0213: $mypickup = create_pickup -86 (BRIBE) type  15 at  206.666 -491.721 11.351
Copy, compile, run. Start new game! Lesson three: Cars Cars are a bit more tricky (some parts of this I don’t even know what they are) , but you should be able to do it if you stick to this tutorial. But if at any time you get lost, just skip to the next lesson. Search for this line:
014B: $457 = init_parked_car_generator #ADMIRAL
The whole line should look like this:
014B: $457 = init_parked_car_generator #ADMIRAL  8  8  0 alarm  50 door_lock  0  0  10000 at -401.2715 -534.6655  11.7534 angle  149.2032
Dnd it will have this line underneath it:
014C: set_parked_car_generator $457 cars_to_generate_to 101
Lets take a look at this code:
014B: $457 = init_parked_car_generator #ADMIRAL  8  8  0 alarm  50 door_lock  0  0  10000 at -401.2715 -534.6655  11.7534 angle  149.2032


014C: set_parked_car_generator $457 cars_to_generate_to  101
It is a little similar to the other things we have been doing; it has an opcode, a name, a piece of code that tells the game what to do (init_parked_car_generator), it has what car we are creating (in this case it is an admiral), the ‘8 8’ is the color, I’m not sure what the ‘0’ before the alarm is, it also says ‘alarm 50’ this means that there is 50% chance that the alarm is on and ‘door_lock 0’ this means that there is 0% chance of a locked door, I don’t know what the other ‘0’ is for, but I think the 10000 is the cars health, and obviously the ‘at -401.2715 -534.6655 11.7534 angle 149.2032’ is the coordinates and the angle (angle 0 is facing north and angle 180 is facing south, it goes all the way up to angle 360). The line after it, is a line that tells the car to acutely appear, it has an opcode, code that tells the game what to do (set_parked_car_generator), the $457 is the name of the car that you want to appear (101 is always appear and 0 is never appearing) So to create your own car copy those lines and paste them underneath the ones you just copied. Then you need to edit the following to your standards: You can edit the $457 to name that you want like; $car. Then you can change ‘#ADMIRAL’ to a much better car, here are some: #banshee #hotring #PCJ600 #POLICE Then you can change the 8 8 to another color, just choose 0 0 (it means random color). Change the door lock and alarm to 0 and 0 (so that we can actually get in the car). Leave the other zero alone and leave the 10000 alone too. Change the coordinates to what ever you want and change the angle to what ever you want. I have chosen; With the next line, just change the $457 to what ever you called the car. But leave the rest So my code should look like this
014B: $car = init_parked_car_generator #PCJ600  0  0  0 alarm  0 door_lock  0  0  10000 at -401.2715 -534.6655  11.7534 angle  149.2032

014C: set_parked_car_generator $car cars_to_generate_to  101
Copy, compile, run And start a new game Lesson 4: Changing the players starting position, (this is easy) Search for this line:
0053: $PLAYER_CHAR = create_player #NULL at

This line creates the player; it should be near the top.

The coordinintas after it tell the player where to start the game. I have chosen; -369.9 -537.1 18.3 (near the hard ware store, next to the health that we placed earlier)

Compile copy run (like always)

That’s it just start a new game

This is the end of tutorial 1

For questions or comments me email me at: eetmorechikin2003@hotmail.com

Länk till kommentar
Dela på andra sidor

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gäst
Skriv inlägg...

×   Innehåll kopierat inklusive formatering.   Ta bort formatering

  Only 75 emoji are allowed.

×   Din länk har expanderats till ett media-block.   Visa länk istället

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...