|
 |
|
|
|
|
|
Attention:
This is for the discussion and releasing of tutorials for modifying GTA. Anything that isn't a tutorial will be deleted without notification.
- Please read the Official Modification Forum Rules & Procedure BEFORE posting!
- Data topics: The following topics contain information for formatting and writing tutorials.
- Requests are to be made in the pinned topic.
- New topics to this forum are subject to moderation, and will not appear immediately. Pending approval by a moderator, if a topic is deemed unsuitable it will be deleted without notification.
|
GTAGarage.com free mod hosting from GTANet, simply login with your GTAForums account details
GTAModding.com GTANet's modding wiki
GTA Modding Chatroom provided by irc.gtanet.com (Don't have an IRC client? Click here)
|
littleguna's Coding Tutorial [Coding | VC]
 |
|
 |
| |
timmy2004  |
Posted: Thursday, Nov 4 2004, 01:24
|
Gangsta

Group: Members
Joined: Aug 5, 2004


|
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!!!!!!!!!!!!!!) (u will need it to code vice city).
In this tutorial I will show u 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:
| CODE | | 032B: $471 = create_weapon_pickup #COLT45 |
as u can see, there are a whole lot of:
| CODE | | 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:
| 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 u 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:
| CODE | | 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:
| CODE | | 0213: $495 = create_pickup -86 |
(you should see heaps of these lines) the one u just searched for should look like this:
| CODE | | 0213: $495 = create_pickup -86 (HEALTH) type 15 at -113.2 -975.7 10.4 |
as u 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 u want then change the coordinates to whatever u 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:
| CODE | | 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:
| CODE | | 014B: $457 = init_parked_car_generator #ADMIRAL |
the whole line should look like 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 |
and it will have this line underneath it:
| CODE | | 014C: set_parked_car_generator $457 cars_to_generate_to 101 |
lets take a look at this code:
| 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
| CODE | 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:
| CODE | | 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
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
timmy2004  |
Posted: Thursday, Nov 4 2004, 08:05
|
Gangsta

Group: Members
Joined: Aug 5, 2004


|
| QUOTE (RCagent @ Nov 4 2004, 06:27) | | Thanks man! You probably saved me, and probably others from creating numerous topics about how to change the players spawn point ect. | thats ok, np, i might post more s*** like this later
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
timmy2004  |
Posted: Thursday, Nov 4 2004, 08:54
|
Gangsta

Group: Members
Joined: Aug 5, 2004


|
| QUOTE (aad @ Nov 4 2004, 08:38) | LOL this is really an tutorial for noobs but it may help some people maybe you should make another one of creating actors and stuff. i dont need an tutorial Just joking good work litleguna | thanks aad, i might post my second tutorial here soon
@gansta killer: can u please add this to your tutorial archive?
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
BCspeed34  |
|
Evolve

Group: $outh $ide Hoodz
Joined: Jun 24, 2004


|
erm, i wish i could download it, but the link doesnt work try this:
http://www.mm2x.com/upload
EDIT: btw tim, great tut, it may get me back into coding
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Pages:
(2) [1] 2
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|