Modding Tutorials :: Your First Weapon
This tutorial will explain how you can make your first weapon.
We will make a simple weapon, lets call it Plasma Pistol, and it will be a simple pistol that shoots plasma like the plasma gun.
Since this might be your first ever mod, I will take it easy and will try to explain it so you understand everything
Before we start, your will need to extract DeusEx's classes if you haven't done that yet before, if you have, skip this paragraph, if not, read it. Open the SDK (UnrealEd) and go to the classes browser, at the bottom, click on 'Extract All' then click yes if the SDK asks are you sure to do so. Once you have done that, you should notice that you now have more folders in your DeusEx folder, these are just the package's folders. You have just extracted DeusEx's clases, you might always want to refer to this if you ever want to learn or see how they did something.
OK, lets start, make a new folder in your DeusEx folder, for now, and name it MyFirstMod. So i.e. C:/DeusEx/MyFirstMod/.
In that folder, make another one, called 'classes' and it must be called that. It just means that all the classes (the coding files) will be in here. If they are not here, they will not be compiled in the mod.
Once you have made the classes folder, inside it, make a new txt file, name it 'PlasmaPistol.uc'. Now open that class in your favourite editor, which can be notepad, word, WOTgreal (www.wotgreal.com) or whatever. When you open it, add the following:
//====================================================
// My First Weapon
//====================================================
class PlasmaPistol extends WeaponPistol; //Subclasses the original pistol.
Defaultproperties
{
AmmoName=Class'DeusEx.AmmoPlasma'
ProjectileClass=Class'DeusEx.PlasmaBolt'
FireSound=Sound'DeusExSounds.Weapons.PlasmaRifleFire'
AltFireSound=Sound'DeusExSounds.Weapons.PlasmaRifleReloadEnd'
CockingSound=Sound'DeusExSounds.Weapons.PlasmaRifleReload'
SelectSound=Sound'DeusExSounds.Weapons.PlasmaRifleSelect'
ItemName="Plasma Pistol"
Description="."
beltDescription="P PISTOL"
}
That's it, ok, now for the hard part, no no, not hard for you, hard for me - to teach you easy stuff
What we just did was use the original WeaponPistol and changed a few things, but we didn't modify the weaponPistol - we made a new one that uses WeaponPistol's things. We subclassed our new class from that weapon; making it use whatever is in WeaponPistol except if we change anything in our new class, which we did.
If you are wondering, any lines with '//' in front of it, will not be read in compilation or in the game, it's a comment, made by coders so they can remember things or that they want to tell me what its doing. Usually classes have a header at the top, like I have, it makes it look pretty :p.
The defaultproperties section is in every class; it changes properties on that class and/or the parentclass (the class that it is subclassed from). In this class, we have changed a few things.
AmmoName is the class of the ammo that the weapon will use. For our class, we are using 'Class'DeusEx.AmmoPlasma' which is the Plasma ammo.
ProjectileClass is the class of the projectile, ok, lets get something here that a lot of people get confused. AmmoName is different from ProjectileClass. The ammo class is nothing much, just tells the game the name and description of the ammo. But the projectile is the real thing on most of the weapons, if the ammo uses special functions (eg, the plasma has green effects coming out of it while it is being fired), it will be probably in the projectileclass, ammoName just contains information on the name, description, model etc. So we have the projectileclass as 'DeusEx.PlasmaBolt'.
FireSound, AltFireSound, CockingSound, SelectSound are the sound of the weapons. We are going to make the weapon sound like the plasma gun, so we are going to use the same ones as the plasma guns (the plasma gun's class is WeaponPlasmaGun.uc).
ItemName is the name of the weapon, very simple, we are gonna use 'PlasmaPistol'.
The description is, well, duh, the description of the weapon, im bad at doing this, so you do it
BeltDescription is the name to be displayed in the HUD at the bottom right under the weapon. Notice how its always Caps so its big and clear to read plus its not too long or it will get cut off and unreadable.
Well, congrats, you did your first weapon! And I hope you understood a lot (and I hope I have less spelling mistakes this time, lol)
But wait! It's not over! We still need to compile our package to use and play!
Now that the class is finished, save it, and its always best if you save at any time, not just as the end. Once saved, go to your system folder, ie C:/DeusEx/System/. Open up 'DeusEx.ini'. In that file, look/search for the following:
[Editor.EditorEngine]
….
…..
…..
EditPackages=IpServer.
Now add below that a new line that says:
EditPackages=MyFirstMod
Now you will need to run ucc make, this is the program used to compile codes for mods and packages. To run this, Open up your /System/ Folder, now go to start->run and type 'command'. That should've opened a MS Prompt and the directory is your system folder (if not, change it so it is, to do so, I think you type "cd/deusex/system" or whatever your deusex directory is). Now type 'ucc make'. That will run the program like I said before. Once it finished, the package is done! Give your self a pat on the back. Now we are going to put the weapon to use!
The package of the mod is MyFirstMod.u unless you changed it throughout the tutorial, go load UnrealEd (the SDK) and make a small map or load another map you made, now add a WeaponPistol, but don't, instead, add a PlasmaPistol which is subclassed after WeaponPistol. Now test the map and test the weapon. Remember if you are going to release this map, you will need to include this weapon package with the map, it is needed since you added it to a map.
I just showed you the SDK, but there is another way I know, which is summon cheat way, it requires cheating (*shudder*). Firstly, go find out how to cheat, Im not going to tell you(www.cheatingplanet.com)
Once you know how, you should also know how the 'summon' cheat work, once you know how, in the game, activate cheats and then type:
Summon MyFirstMod.PlasmaPistol
That will make the weapon drop infront of you - ready to kick ass with.
Congrats, you just did your first weapon! Good work
I got so confused when i was up to this bit:
now you will need to run ucc make, this is the program used to compile codes for mods and packages. To run this, Open up your /System/ Folder, now go to start->run and type 'command'. That should've opened a MS Prompt and the directory is your system folder (if not, change it so it is, to do so, I think you type "cd/deusex/system" or whatever your deusex directory is). Now type 'ucc make'. That will run the program like I said before. Once it finished, the package is done!
Open up your /System/ Folder
Where is this?
cd/deusex/system
do i type that in the command prompt? but it didnt work

So anyone got any ideas?? Thanks
