YeTi Posted May 7, 2005 Share Posted May 7, 2005 (edited) 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 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. 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. 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. 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. 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 September 13, 2005 by Suction Testicle Man R.I.P. Chi Shingi Meiyo 21/09/2005 - 07/03/2007 Andolini Mafia Family 16/08/2008 - Current Link to comment Share on other sites More sharing options...
Urban Legend Posted May 8, 2005 Share Posted May 8, 2005 Nice tutorial Link to comment Share on other sites More sharing options...
YeTi Posted May 8, 2005 Author Share Posted May 8, 2005 Thanks man. I love credit. R.I.P. Chi Shingi Meiyo 21/09/2005 - 07/03/2007 Andolini Mafia Family 16/08/2008 - Current Link to comment Share on other sites More sharing options...
grovespaz Posted June 3, 2005 Share Posted June 3, 2005 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? Link to comment Share on other sites More sharing options...
YeTi Posted June 3, 2005 Author Share Posted June 3, 2005 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? 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. R.I.P. Chi Shingi Meiyo 21/09/2005 - 07/03/2007 Andolini Mafia Family 16/08/2008 - Current Link to comment Share on other sites More sharing options...
gothic101 Posted July 1, 2005 Share Posted July 1, 2005 Dude, you have no idea how much that helped me, I shall recomend you for a karma star. Link to comment Share on other sites More sharing options...
Roald Posted July 1, 2005 Share Posted July 1, 2005 Any chance you'll write something like this for GTA SA? Link to comment Share on other sites More sharing options...
flitcroft101 Posted July 1, 2005 Share Posted July 1, 2005 I hope so i wanna learn coding. Link to comment Share on other sites More sharing options...
YeTi Posted July 4, 2005 Author Share Posted July 4, 2005 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. R.I.P. Chi Shingi Meiyo 21/09/2005 - 07/03/2007 Andolini Mafia Family 16/08/2008 - Current Link to comment Share on other sites More sharing options...
GTAFool12 Posted July 4, 2005 Share Posted July 4, 2005 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? Link to comment Share on other sites More sharing options...
YeTi Posted July 6, 2005 Author Share Posted July 6, 2005 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. R.I.P. Chi Shingi Meiyo 21/09/2005 - 07/03/2007 Andolini Mafia Family 16/08/2008 - Current Link to comment Share on other sites More sharing options...
DuPz0r Posted July 16, 2005 Share Posted July 16, 2005 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. Link to comment Share on other sites More sharing options...
dertyjerzian Posted September 13, 2005 Share Posted September 13, 2005 edit: I was wrong. But the Archive has this linked as the SA tut. Link to comment Share on other sites More sharing options...
YeTi Posted September 13, 2005 Author Share Posted September 13, 2005 (edited) 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 September 13, 2005 by YeTi R.I.P. Chi Shingi Meiyo 21/09/2005 - 07/03/2007 Andolini Mafia Family 16/08/2008 - Current Link to comment Share on other sites More sharing options...
smallcombe Posted July 3, 2008 Share Posted July 3, 2008 (edited) nice tut helped me alot thnx... Edited July 25, 2008 by smallcombe Link to comment Share on other sites More sharing options...
Stormydayz Posted March 25, 2009 Share Posted March 25, 2009 Excellent tutorial YeTi. Easy to follow and I learned alot. Link to comment Share on other sites More sharing options...
jaky2008 Posted November 29, 2009 Share Posted November 29, 2009 BUMP Wow this is really easy NOT, damn games are impossible to mod Link to comment Share on other sites More sharing options...
Wikus Posted November 29, 2009 Share Posted November 29, 2009 thanks man this is really easy thanks Link to comment Share on other sites More sharing options...
adeldex Posted August 25, 2010 Share Posted August 25, 2010 Thx man, now am sure what am doing Link to comment Share on other sites More sharing options...
The-Prince Posted February 3, 2011 Share Posted February 3, 2011 you the best man thanks ^^ you should continue ^^ Link to comment Share on other sites More sharing options...
Rameez_Iqbal Posted October 20, 2012 Share Posted October 20, 2012 in which file cheat codes are located? I want to change them... Link to comment Share on other sites More sharing options...
parvez Posted September 23, 2019 Share Posted September 23, 2019 please make a tutorial on "place an actor at a place and put him in the car of player_actor" please Link to comment Share on other sites More sharing options...
ZAZ Posted September 29, 2019 Share Posted September 29, 2019 On 9/23/2019 at 5:24 PM, parvez said: please make a tutorial on "place an actor at a place and put him in the car of player_actor" please {$CLEO .cs} :PutActorinPlayercar thread 'A2PLAYC' while true wait 0 if 0256: player $PLAYER_CHAR defined then if and 00DF: actor $PLAYER_ACTOR driving 0AB0: key_pressed 8//-----------------------press Backspace then 03C0: 0@ = actor $PLAYER_ACTOR car 0376: 1@ = create_random_actor_at 0.0 0.0 100.0 036A: put_actor 1@ in_car 0@ wait 2000 01C2: remove_references_to_actor 0@ end end end CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
parvez Posted September 30, 2019 Share Posted September 30, 2019 17 hours ago, ZAZ said: {$CLEO .cs} :PutActorinPlayercar thread 'A2PLAYC' while true wait 0 if 0256: player $PLAYER_CHAR defined then if and 00DF: actor $PLAYER_ACTOR driving 0AB0: key_pressed 8//-----------------------press Backspace then 03C0: 0@ = actor $PLAYER_ACTOR car 0376: 1@ = create_random_actor_at 0.0 0.0 100.0 036A: put_actor 1@ in_car 0@ wait 2000 01C2: remove_references_to_actor 0@ end end end thanks bro Link to comment Share on other sites More sharing options...