Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,902 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

YeTi

YeTi's Coding Tutorial Part Two

Recommended Posts

YeTi

YeTi's VC Coding Tutorial Part Two

 

Introduction

 

Right so before i start this tutorail will be picking up were i left off in part one so i'd advise you to read that first.

 

Aim

 

What i aim to teach you in this tutorial is:

 

How to place weapons.

How to place vehicles.

How to understand the codes for each of these.

 

Backup

 

I cannot stress enough how important it is to backup your files. Just remember what i said in part 1 "copy it and paste it into a folder in my documents call this folder what ever you want just remember were it is".

 

Weapons

 

Note melee weapons follow a different code i will not be explaining this.

 

First I will explain the code.

 

Open up BW's Vice City Mission Builder.

Then click file, open file and then just look for your main.scm NOT the one that you copied to a different location but the one that is in the vice city install folder.

Wait for it to open it does take a while so don't worry if it looks as if its screwing up its not. It will then give you a report just click ok. Now click edit/find and type in colt. It should just highlight the word colt and scroll down a bit, this is not the one that you want so press F3 twice. It should now scroll down the screen and highlight the word colt in a different line:

 

 

032B: $7D0 = create_weapon_pickup #COLT45  15 ammo  34 at -228.4 -1318.2  9.1

 

 

This line its a weapon pick up code. Right so now I will explain each of the bits of this code bear in mind that i explained all of the bits of a basic code in detail in part 1:

 

 

032B:

 

 

Is the opcode.

 

 

$7D0

 

 

Is the name that rockstar has given to that line of code.

 

 

= create_weapon_pickup

 

 

this is what the code does it is creating weapon pickup.

 

 

#COLT45

 

 

this is what weapon pickup the code is creating it is creating a colt45 weapon pickup.

 

 

15

 

 

this is just if the code makes the pickup free or not I THINK that 15 is free and 1 is not free so:

 

 

15

 

 

 

should be a free pickup and

 

 

1

 

 

 

should be a buyable pickup.

 

 

ammo  34

 

 

Is how much ammo the weapon has. This weapon has got 34 ammo.

 

 

at -228.4 -1318.2  9.1

 

 

-228.4 is the x position in the game

-1318.2 is the y position in the game

9.1 is the z position in the game

 

Right so that is all of that code explained I hope you understood it?

 

Now lets put our own weapon pickup in the game ok?

 

Copy all of the code line and then just add a new line underneath the original code (you can do this by pressing enter but make sure that none of the code is highlighted), then paste your copied code into your newly created space. It should just fill in the line and not add another but it sometimes does if it does just go to the end of your added line and press delete.

 

Right so now lets edit our code.

 

You need to leave the opcode as it is because as I said before its unique to pickups and is needed in the game.

 

 

$7D0

 

 

this bit we will change as I said before it is the name that rockstar has given to this line of code so lets give our new line of code its own name. Lets call it

 

 

$myweapon1

 

 

ok you need to leave the $ sign in front of the name.

 

so now our code should look like this

 

 

032B: $myweapon1 = create_weapon_pickup #COLT45  15 ammo  34 at -228.4 -1318.2  9.1

 

 

You need to leave

 

 

create_weapon_pickup

 

 

but this bit we will change we don't want a colt 45 we want a m4.

 

 

#m4

 

 

There should be a full list of weapon names in your version of BW's mission builder.

 

so our new code should now look like this

 

 

032B: $myweapon1 = create_weapon_pickup #m4  15 ammo  34 at -228.4 -1318.2  9.1

 

 

This bit we will leave the same

 

 

15

 

 

because if you remember this tells the game to give us a free weapon and we don't want to pay for it.

 

this bit we will alter

 

 

ammo  34

 

 

we dont want 34 ammo with our weapon we want 500 ammo with our weapon so we will type

 

 

ammo 500

 

 

so our new code should so far look like this

 

 

032B: $myweapon1 = create_weapon_pickup #m4  15 ammo  500 at -228.4 -1318.2  9.1

 

 

now the final bit we will alter is this

 

 

at -228.4 -1318.2  9.1

 

 

if you remember this is the position in the game so because we are adding our own weapon pickup we don't want it in the same place as the proper one do we?

 

No of course not so this is where steve-m's player position comes in handy. Just minimize everything and open up Steve-m's player position and play vice city. I have chosen a position for my bribe I will place it here

 

user posted image

 

Now the coordinates that Steve-m's player position gives me is 214.793, -1275.360, 11.112. So my code would be

 

 

032B: $myweapon1 = create_weapon_pickup #m4  15 ammo  500 at 214.793 -1275.360 11.112

 

 

Now your own added code should look like mine if you used my coordinates if not then the same but with different coordinates.

 

Now go to Run-Compile Copy&Run GTA Vice. It will take a while but be patient it will give you some sort of error message I cant remember it exactly but its something to do with something not matching and you have to change some thing just change it so that all of the something's must match.

 

Remember to start a new game. You have to start a new game after every bit of editing in the main.scm file.

 

As you can see is wrong but if you remember we had the same problem in part one. And if you remember we solved the problem by raising the z position up by 0.5.

 

user posted image

 

But as you can see it doesn't work in this case so we will try raising our position by another 0.5 on the z position.

 

user posted image

 

Which as you can see works.

 

Cars

 

First I will explain each bit of the code.

 

Open up BW's Vice City Mission Builder.

Then click file, open file and then just look for your main.scm NOT the one that you copied to a different location but the one that is in the vice city install folder.

Wait for it to open it does take a while so don't worry if it looks as if its screwing up its not. It will then give you a report just click ok. Now click edit/find and type in admiral. It should just highlight the word admiral scrolling down a bit this is the one that you want.

 

 

014B: $7C8 = init_parked_car_generator #ADMIRAL  8  8  0 alarm  50 door_lock  0  0  10000 at -401.2715 -534.6655  11.7534 angle  149.2032014C: set_parked_car_generator $7C8 cars_to_generate_to  101

 

 

this line its a vehicle spawn code. Right so now I will explain each of the bits of this code:

 

 

014B:

 

 

014C:

 

 

These are both opcodes they are both needed.

 

 

$7C8

 

 

this is basically just a name that rockstar has given to that line of code.

 

 

init_parked_car_generator

 

 

This tells the game to start the car generator.

 

 

set_parked_car_generator

 

 

This tells the game to generate the car and close the car generator

 

 

#ADMIRAL

 

 

This tells the game which car to generate.

 

 

8  8  0 alarm  50 door_lock  0  0  10000

 

 

So now this bit is a little more complicated.

 

the 8 8 bit is the colour of the car.

 

im not sure what the 0 is.

 

alarm 50 is the chance in percentage how likely the alarm is to go off, in this case its a 50% chance it will go off and a 50% chance it will not go off.

 

door_lock 0 is the chance in percentage how likely the door is to be locked, in this case its a 0% chance it will will be locked.

 

im not sure what the 0 is.

 

10000 is the cars health NEVER PLAY ABOUT WITH THIS BECAUSE I DON'T THINK ANYBODY UNDERSTANDS HOW TO MAKE IT WORK.

 

 

at -401.2715 -534.6655  11.7534 angle  149.2032

 

 

Is the position with an angle bit this time. The angle bit just tells the car which angle to face 0 is north, 180 is south etc.

 

 

$7C8 cars_to_generate_to  101

 

 

$7C8 is the car you are telling it to generate

 

cars_to_generate_to 101 tells the game how often to spawn a car there. 101 is always and 0 is never.

 

Right so i think thats all the code explained.

 

Lets make our own now.

 

Copy all of the code line and then just add a new line underneath the original code (you can do this by pressing enter but make sure that none of the code is highlighted), then paste your copied code into your newly created space. It should just fill in the line and not add another but it sometimes does if it does just go to the end of your added line and press delete.

 

Right so now lets edit our code.

 

You need to leave the opcodes as it is because as I said before its unique to that particular process and is needed in the game.

 

 

$7C8

 

 

this bit we will change as I said before it is the name that rockstar has given to this line of code so lets give our new line of code its own name. Lets call it

 

 

$mycar

 

 

ok you need to leave the $ sign in front of the name.

 

so now our code should look like this

 

 

014B: $mycar = init_parked_car_generator #ADMIRAL  8  8  0 alarm  50 door_lock  0  0  10000 at -401.2715 -534.6655  11.7534 angle  149.2032014C: set_parked_car_generator $mycar cars_to_generate_to  101

 

 

Remember you have to change the name everywere in the code.

 

You need to leave

 

 

init_parked_car_generator

 

 

But this bit we will change

 

 

#ADMIRAL

 

 

If we are making our own code we dont want a crap admiral we want a cool vehicle like the infernus so we will change this to

 

 

#INFERNUS

 

 

so now our code should look like this

 

 

014B: $mycar = init_parked_car_generator #INFERNUS  8  8  0 alarm  50 door_lock  0  0  10000 at -401.2715 -534.6655  11.7534 angle  149.2032014C: set_parked_car_generator $mycar cars_to_generate_to  101

 

 

 

8  8  0 alarm  50 door_lock  0  0  10000

 

 

Some of this we will change.

 

8 8 we will leave the same as this is the colour.

0 alarm 50 we will change this to 0 alarm 0 this will deactivate the alarm so it will never go off.

door lock 0 0 we will leave as it is because it means that the door will never be locked.

10000 remember what i said you always leave this.

 

 

at -401.2715 -534.6655  11.7534 angle  149.2032

 

 

if you remember this is the position in the game so because we are adding our own car we don't want it in the same place as the proper one do we?

 

No of course not so this is where steve-m's player position comes in handy. Just minimize everything and open up Steve-m's player position and play vice city. I have chosen a position for my car I will place it at the top of ocean beach mall near the shotgun.

 

user posted image

 

Now the coordinates that Steve-m's player position gives me is 58.481, -939.647, 23.150 I will use angle 0. So my code so far would be:

 

 

014B: $mycar = init_parked_car_generator #INFERNUS  8  8  0 alarm  50 door_lock  0  0  10000 at 58.481 -939.647 23.150 angle 0014C: set_parked_car_generator $mycar cars_to_generate_to  101

 

 

We will leave all of this line.

 

 

014C: set_parked_car_generator $mycar cars_to_generate_to  101

 

 

Now your own added code should look like mine if you used my coordinates if not then the same but with different coordinates.

 

Now go to Run-Compile Copy&Run GTA Vice. It will take a while but be patient it will give you some sort of error message I cant remember it exactly but its something to do with something not matching and you have to change some thing just change it so that all of the something's must match.

 

Remember to start a new game. You have to start a new game after every bit of editing in the main.scm file.

 

 

014B: $mycar = init_parked_car_generator #INFERNUS  8  8  0 alarm  50 door_lock  0  0  10000 at 58.481 -939.647 23.150 angle 0014C: set_parked_car_generator $mycar cars_to_generate_to  101

 

 

Which as you can see works.

 

user posted image

 

That's it for this tutorial I have covered what I said I would I may write more later if I get bored.

 

Please don't flame me for this I know some bits are crap and there is likely spelling mistakes I have admitted that so please no flaming.

 

I have also done another VC Coding tutorial. Heres a link.

 

YeTi's VC Coding Tutorial Part One

 

Since writing this i have wrote another two tutorials on SA Coding. Here is a link to them.

 

YeTi's SA Coding Tutorial Part One

 

 

YeTi's SA Coding Tutorial Part Two

 

YeTi

Edited by Suction Testicle Man

Share this post


Link to post
Share on other sites
Urban Legend
biggrin.gif Nice tutorial

Share this post


Link to post
Share on other sites
YeTi

Thanks man. I love credit.

Share this post


Link to post
Share on other sites
grovespaz

Nice for Newbs, although here is an error in it:

 

I have chosen a position for my bribe I will place it here

What bribe? Oh, that one from part 1 of th tut? tounge.gif

Share this post


Link to post
Share on other sites
YeTi
Nice for Newbs, although here is an error in it:

 

I have chosen a position for my bribe I will place it here

What bribe? Oh, that one from part 1 of th tut? tounge.gif

I'll admit i did basically copy my first tut for a outline on this but after reading through it i cannot find that particular quote. Can you point out approxamatly were it is.

Share this post


Link to post
Share on other sites
gothic101

Dude, you have no idea how much that helped me, I shall recomend you for a karma star.

Share this post


Link to post
Share on other sites
Roald
Any chance you'll write something like this for GTA SA?

Share this post


Link to post
Share on other sites
flitcroft101

I hope so biggrin.gif i wanna learn coding.

Share this post


Link to post
Share on other sites
YeTi
I hadn't thought about it to be honest. Sure i'll start writing it later. I'll aim to release it on the weekend.

Share this post


Link to post
Share on other sites
GTAFool12
Thank you because I am a newb at modding and coding and I want to learn. Also is there a player position thing for GTA3 and SA?

Share this post


Link to post
Share on other sites
YeTi
Thank you because I am a newb at modding and coding and I want to learn. Also is there a player position thing for GTA3 and SA?

There is for GTA3 check Steve-M.com then go to downloads i think.

 

I don't think one has been made for sa yet.

Share this post


Link to post
Share on other sites
DuPz0r

Yeti, i would really love to see a tutorial for SA.

I want to know how to add items, weapons and so on in certian locations.

Share this post


Link to post
Share on other sites
dertyjerzian

edit: I was wrong. But the Archive has this linked as the SA tut.

Share this post


Link to post
Share on other sites
YeTi

 

edit: I was wrong.  But the Archive has this linked as the SA tut.

Yeah your right.

 

Anyway i've PM'd STM about it hopefully he'll fix it for me.

 

EDIT: STM has fixed it.

Edited by YeTi

Share this post


Link to post
Share on other sites
smallcombe

nice tut helped me alot thnx... colgate.gif

Edited by smallcombe

Share this post


Link to post
Share on other sites
Stormydayz

Excellent tutorial YeTi. Easy to follow and I learned alot.

Share this post


Link to post
Share on other sites
jaky2008

BUMP

Wow this is really easy NOT, damn games are impossible to mod sneaky2.gif

Share this post


Link to post
Share on other sites
Wikus

thanks man this is really easy thanks

Share this post


Link to post
Share on other sites
adeldex

Thx man, now am sure what am doing biggrin.gif

Share this post


Link to post
Share on other sites
The-Prince

you the best man biggrin.gif thanks ^^

you should continue ^^

Share this post


Link to post
Share on other sites
Rameez_Iqbal

in which file cheat codes are located? I want to change them...

Share this post


Link to post
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

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.