Quantcast

Jump to content

» «
Photo

YeTi's Coding Tutorial Part Two

20 replies to this topic
YeTi
  • YeTi

    S'up Bitches?

  • Andolini Mafia Family
  • Joined: 28 Mar 2005

#1

Posted 07 May 2005 - 01:56 AM Edited by Suction Testicle Man, 13 September 2005 - 12:38 PM.

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:

CODE
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:

CODE
032B:


Is the opcode.

CODE
$7D0


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

CODE
= create_weapon_pickup


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

CODE
#COLT45


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

CODE
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:

CODE
15



should be a free pickup and

CODE
1



should be a buyable pickup.

CODE
ammo  34


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

CODE
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.

CODE
$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

CODE
$myweapon1


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

so now our code should look like this

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


You need to leave

CODE
create_weapon_pickup


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

CODE
#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

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


This bit we will leave the same

CODE
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

CODE
ammo  34


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

CODE
ammo 500


so our new code should so far look like this

CODE
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

CODE
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

CODE
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.

CODE
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.2032
014C: 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:

CODE
014B:

CODE
014C:


These are both opcodes they are both needed.

CODE
$7C8


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

CODE
init_parked_car_generator


This tells the game to start the car generator.

CODE
set_parked_car_generator


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

CODE
#ADMIRAL


This tells the game which car to generate.

CODE
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.

CODE
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.

CODE
$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.

CODE
$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

CODE
$mycar


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

so now our code should look like this

CODE
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.2032
014C: 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

CODE
init_parked_car_generator


But this bit we will change

CODE
#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

CODE
#INFERNUS


so now our code should look like this

CODE
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.2032
014C: set_parked_car_generator $mycar cars_to_generate_to  101


CODE
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.

CODE
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:

CODE
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 0
014C: set_parked_car_generator $mycar cars_to_generate_to  101


We will leave all of this line.

CODE
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.

CODE
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 0
014C: 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

Urban Legend
  • Urban Legend

    No, f*ck no.

  • Members
  • Joined: 04 Jan 2005
  • None

#2

Posted 08 May 2005 - 02:45 PM

biggrin.gif Nice tutorial

YeTi
  • YeTi

    S'up Bitches?

  • Andolini Mafia Family
  • Joined: 28 Mar 2005

#3

Posted 08 May 2005 - 06:05 PM

Thanks man. I love credit.

grovespaz
  • grovespaz

    Group: Morons

  • Members
  • Joined: 22 Feb 2004

#4

Posted 03 June 2005 - 09:14 AM

Nice for Newbs, although here is an error in it:
QUOTE
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

YeTi
  • YeTi

    S'up Bitches?

  • Andolini Mafia Family
  • Joined: 28 Mar 2005

#5

Posted 03 June 2005 - 01:36 PM

QUOTE (grovespaz @ Jun 3 2005, 10:14)
Nice for Newbs, although here is an error in it:
QUOTE
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.

gothic101
  • gothic101

    Player Hater

  • Members
  • Joined: 31 Jan 2005

#6

Posted 01 July 2005 - 05:51 PM

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

Roald
  • Roald

    Hustler

  • Members
  • Joined: 30 Nov 2004

#7

Posted 01 July 2005 - 07:50 PM

Any chance you'll write something like this for GTA SA?

flitcroft101
  • flitcroft101

    wat

  • Members
  • Joined: 08 Jan 2005

#8

Posted 01 July 2005 - 07:56 PM

I hope so biggrin.gif i wanna learn coding.

YeTi
  • YeTi

    S'up Bitches?

  • Andolini Mafia Family
  • Joined: 28 Mar 2005

#9

Posted 04 July 2005 - 09:56 AM

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.

GTAFool12
  • GTAFool12

    Custom Member Title

  • Members
  • Joined: 09 Jan 2005

#10

Posted 04 July 2005 - 04:39 PM

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?

YeTi
  • YeTi

    S'up Bitches?

  • Andolini Mafia Family
  • Joined: 28 Mar 2005

#11

Posted 06 July 2005 - 12:10 PM

QUOTE (GTAFool12 @ Jul 4 2005, 17:39)
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.

DuPz0r
  • DuPz0r

    The One & Only

  • Members
  • Joined: 24 Jun 2005
  • None

#12

Posted 16 July 2005 - 11:42 AM

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.

dertyjerzian
  • dertyjerzian

    I have a custom member title. I call it "Solid Snake"

  • BUSTED!
  • Joined: 08 Jun 2005

#13

Posted 13 September 2005 - 11:09 AM

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

YeTi
  • YeTi

    S'up Bitches?

  • Andolini Mafia Family
  • Joined: 28 Mar 2005

#14

Posted 13 September 2005 - 12:32 PM Edited by YeTi, 13 September 2005 - 12:57 PM.

QUOTE (dertyjerzian @ Sep 13 2005, 12:09)
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.

smallcombe
  • smallcombe

    smally

  • Members
  • Joined: 03 Jul 2008

#15

Posted 03 July 2008 - 12:52 PM Edited by smallcombe, 25 July 2008 - 12:31 PM.

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

Stormydayz
  • Stormydayz

    Player Hater

  • Members
  • Joined: 20 Jan 2009

#16

Posted 25 March 2009 - 11:52 AM

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

jaky2008
  • jaky2008

    Mack Pimp

  • Members
  • Joined: 13 May 2009

#17

Posted 29 November 2009 - 10:13 AM

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

Wikus
  • Wikus

    GTA Tales of Vice city leader and GTA Virus Alert texturer

  • Members
  • Joined: 07 Oct 2009

#18

Posted 29 November 2009 - 11:32 AM

thanks man this is really easy thanks

adel_dexter
  • adel_dexter

    D3XTEr 187

  • Members
  • Joined: 02 Nov 2007

#19

Posted 25 August 2010 - 03:36 AM

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

The-Prince
  • The-Prince

    Street Cat

  • Members
  • Joined: 04 May 2010

#20

Posted 03 February 2011 - 01:58 PM

you the best man biggrin.gif thanks ^^
you should continue ^^

Rameez_Iqbal
  • Rameez_Iqbal

    Player Hater

  • Members
  • Joined: 01 Apr 2011

#21

Posted 20 October 2012 - 05:19 AM

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




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users