Quantcast

Jump to content

» «
Photo

littleguna's Coding Tutorial

38 replies to this topic
timmy2004
  • timmy2004

    Gangsta

  • Members
  • Joined: 05 Aug 2004

#1

Posted 04 November 2004 - 01:24 AM

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: [email protected]

RCagent
  • RCagent

    Trick

  • Members
  • Joined: 02 May 2004

#2

Posted 04 November 2004 - 06:27 AM

Thanks man! You probably saved me, and probably others from creating numerous topics about how to change the players spawn point ect.

timmy2004
  • timmy2004

    Gangsta

  • Members
  • Joined: 05 Aug 2004

#3

Posted 04 November 2004 - 08:05 AM

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 smile.gif

aad
  • aad

    3d artist

  • Feroci Racing
  • Joined: 15 Mar 2004
  • None

#4

Posted 04 November 2004 - 08:38 AM

LOL this is really an tutorial for noobs biggrin.gif
but it may help some people
maybe you should make another one of creating actors and stuff. biggrin.gif
i dont need an tutorial tounge.gif tounge.gif tounge.gif
Just joking good work litleguna

timmy2004
  • timmy2004

    Gangsta

  • Members
  • Joined: 05 Aug 2004

#5

Posted 04 November 2004 - 08:54 AM

QUOTE (aad @ Nov 4 2004, 08:38)
LOL this is really an tutorial for noobs biggrin.gif
but it may help some people
maybe you should make another one of creating actors and stuff. biggrin.gif
i dont need an tutorial tounge.gif tounge.gif tounge.gif
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?

what_a_beast
  • what_a_beast

    the thing hunter

  • Members
  • Joined: 25 Nov 2004

#6

Posted 09 December 2004 - 12:20 PM

where can i get
QUOTE
BW’s Mission builder Version 1.3

thanx 4 any help

fatcat92
  • fatcat92

    Dumbass, Yes, I am Dumbass.

  • BUSTED!
  • Joined: 20 Jul 2004

#7

Posted 09 December 2004 - 11:21 PM

QUOTE (what_a_beast @ Dec 9 2004, 12:20)
where can i get
QUOTE
BW’s Mission builder Version 1.3

thanx 4 any help

You can get it here

http://home.no.net/barton57/

bmxer8118
  • bmxer8118

    Player Hater

  • BUSTED!
  • Joined: 06 Dec 2004

#8

Posted 13 December 2004 - 05:15 AM

Hi, ive been working on a prog with tuturials on how to mod San Andreas. If I get some good comments, I will add how to do everything under "Things to do in san andreas" in the program.

Please download and tell me what you think!

http://www.geocities...REASSECRETS.zip

timmy2004
  • timmy2004

    Gangsta

  • Members
  • Joined: 05 Aug 2004

#9

Posted 13 December 2004 - 05:31 AM

QUOTE (bmxer8118 @ Dec 13 2004, 05:15)
Hi, ive been working on a prog with tuturials on how to mod San Andreas. If I get some good comments, I will add how to do everything under "Things to do in san andreas" in the program.

Please download and tell me what you think!

http://www.geocities...REASSECRETS.zip

It doesn't work, even when you right click and goto 'Save Target As' the archive is currupted. sad.gif

BCspeed34
  • BCspeed34

    CEO

  • $outh $ide Hoodz
  • Joined: 24 Jun 2004

#10

Posted 13 December 2004 - 05:32 AM

erm, i wish i could download it, but the link doesnt work try this:

http://www.mm2x.com/upload

smile.gif

EDIT: btw tim, great tut, it may get me back into coding
smile.gif

timmy2004
  • timmy2004

    Gangsta

  • Members
  • Joined: 05 Aug 2004

#11

Posted 13 December 2004 - 05:37 AM

QUOTE (BCspeed34 @ Dec 13 2004, 05:32)
btw tim, great tut, it may get me back into coding

Thanks!

I think I will post my second tut later on, I have written heaps of tuts for VC (coding, mapping, etc) I might realese them soon.

bmxer8118
  • bmxer8118

    Player Hater

  • BUSTED!
  • Joined: 06 Dec 2004

#12

Posted 13 December 2004 - 10:20 PM Edited by bmxer8118, 13 December 2004 - 10:32 PM.

Ok guys thanks and sorry for the bullcrap, this should work:

Hi, ive been working on a prog with tuturials on how to mod San Andreas. If I get some good comments, I will add how to do everything under "Things to do in san andreas" in the program.

Please download and tell me what you think!

http://www.mm2x.com/...reasSecrets.zip

(When it asks you which video to play in the program choose clip0012.avi in the SanAndreasSecrets folder)

timmy2004
  • timmy2004

    Gangsta

  • Members
  • Joined: 05 Aug 2004

#13

Posted 16 December 2004 - 02:16 PM

That was OK, but only good for people that have a DVD burner.

Maybe you should create your own thread on it.

Alucard_HllSng
  • Alucard_HllSng

    Ashes to ashes, dust to dust...

  • Members
  • Joined: 06 Dec 2004

#14

Posted 19 December 2004 - 11:57 AM

So timmy2004 where is your second tutorial? Then are you going to realise it?

nielsvandenbroek
  • nielsvandenbroek

    Player Hater

  • Members
  • Joined: 17 Sep 2004

#15

Posted 20 December 2004 - 05:35 PM

if i open up main.scm and search for
032B: $471 = create_weapon_pickup #COLT45
i get the message match not found,
even when i only try 032B: $471
that error appears, what can I do about this?

AdTec_224
  • AdTec_224

    Peon

  • Members
  • Joined: 22 Sep 2004
  • None

#16

Posted 20 December 2004 - 11:39 PM

nielsvandenbroek: open up the main.scm in Mission builder v1.3 and try and search for:

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


That should solve your problems

Newbie41
  • Newbie41

    / -Adio- \

  • BUSTED!
  • Joined: 31 Dec 2004

#17

Posted 10 January 2005 - 02:21 AM

what code do you use to make tommy able to drink and dance at the malibu club?

nesse
  • nesse

    nesse

  • Members
  • Joined: 21 Jan 2005

#18

Posted 22 January 2005 - 11:21 AM

Very good tutorial biggrin.gif

timmy2004
  • timmy2004

    Gangsta

  • Members
  • Joined: 05 Aug 2004

#19

Posted 29 January 2005 - 09:30 AM

QUOTE (newbie3951 @ Jan 10 2005, 02:21)
what code do you use to make tommy able to drink and dance at the malibu club?

It was a whole bunch of code. Search in the opcode database to find it.

QUOTE
Very good tutorial
Thanks.

Gta_ Gamer
  • Gta_ Gamer

    Player Hater

  • Members
  • Joined: 14 Feb 2005

#20

Posted 20 March 2005 - 01:24 AM

where do u get bws thing

shocker275
  • shocker275

    Rat

  • Members
  • Joined: 19 Jun 2003

#21

Posted 21 March 2005 - 11:36 PM

QUOTE (timmy2004 @ Nov 4 2004, 08:05)
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 smile.gif

Oh thanks a lot man I've been looking for stuff like this.

I'm looking forward to more! smile.gif

Guest_Timmy2006m_*
  • Guest
  • Joined: --

#22

Posted 22 March 2005 - 07:41 PM

Oh right you want to know where to get bartons mission builder have a look in his sig.

You wont be able to get the v3 any more the only one you can get now is the v5. xmas.gif oh i am not santa smile.gif

shocker275
  • shocker275

    Rat

  • Members
  • Joined: 19 Jun 2003

#23

Posted 22 March 2005 - 10:57 PM

QUOTE (Timmy2006m @ Mar 22 2005, 19:41)
Oh right you want to know where to get bartons mission builder have a look in his sig.

You wont be able to get the v3 any more the only one you can get now is the v5. xmas.gif oh i am not santa smile.gif

Are you timmy2004 on a duplicate account?

And did you skip v4? tounge.gif

Guest_Timmy2006m_*
  • Guest
  • Joined: --

#24

Posted 23 March 2005 - 06:49 PM

No i am not timmy 2004.What do you mean skip v4

htsb8
  • htsb8

    Crackhead

  • Members
  • Joined: 17 Mar 2005

#25

Posted 26 March 2005 - 04:24 PM

Very Nice!
i have been looking for it for long time,thanks very very much !

and then?Coding Tutorial 2?

timmy2004
  • timmy2004

    Gangsta

  • Members
  • Joined: 05 Aug 2004

#26

Posted 28 March 2005 - 09:15 PM

Thanks, I've got number 2 somewhere...

If I do find it, I'll post it I swear!

And no, that other guy isn't me, I told him not to have that name because people wiuld think I have a 2nd account, but he can have have whatever name he wants I guess, I cant stop him.


-Sweden pwns you.

stevegta
  • stevegta

    Player Hater

  • Members
  • Joined: 27 Mar 2005

#27

Posted 29 March 2005 - 02:17 AM

Hey very good tutorial for noobs (like myself).
Although, im having a problem when I press compile and copy. I get this error:

'The number of conditions used doesn't match the IF command parameter.
Use 00D6: IF 3 if all of the conditions must match, or
00D6: IF 23 if just one of the conditions must match'

And the screen goes to:

':Label0F6850
00D6: if 24
8248: NOT model #COLT45 available
83D0: NOT wav 1 loaded
83D0: NOT wav 2 loaded
8248: NOT model #FAKETARGET available
004D: jump_if_false £Label0F6877
0001: wait 0 ms
0002: jump £Label0F6850'

I somewhat understading of what this means, but I don't wanna mess around with the file and screw Vice City up. Does any one know what is wrong or what I'm supposed to do?

Thanks a lot.

choofa
  • choofa

    Dance onn Cocaiin.. LSD.. XTC!!

  • Members
  • Joined: 28 May 2004

#28

Posted 01 April 2005 - 05:55 AM

I am trying to learn this for my skatepark mod so I can make the player start at the food shop and also have bikes next to him.
I do the possion

CODE
0053: $PLAYER_CHAR = create_player #NULL at  -978.636 -764.989  13.0689


I Compile Copy & Run and it comes up as

CODE
The number of conditions used doesn't match the IF command parameter.

Use 00D6: IF 3 if all of the conditions must match, or 00D6: IF 23 if just one of the conditions must match


What is goign on?

Jumper
  • Jumper

    I killed Kenny

  • Members
  • Joined: 29 Jun 2004

#29

Posted 01 April 2005 - 06:24 AM

Very nice tutor, it`s written very easily, definitly for ppl who open main.scm first time (like me) Great job

YeTi
  • YeTi

    S'up Bitches?

  • Andolini Mafia Family
  • Joined: 28 Mar 2005

#30

Posted 09 April 2005 - 04:22 PM

nice tutorial just got to ask whens part 2 coming out confused.gif

@stevegta:
QUOTE
00D6: if 24

i got the same message just change the 24 to 3 it works perfect then




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users