Page 1 of 1

Help with making a weapon..

PostPosted: Mon Apr 23, 07 8:23 am
by Karkian
Hey guys i wanna make my own weapon i followed deusexgaming but i got confused half way here is the tutorial:

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

PostPosted: Mon Apr 23, 07 9:35 am
by Andrievskaya Veronika
Firstly, where your Deus Ex installed (full path) ?

For example i have three copies of DX installed :lol:

(I:\DeusEx\ D:\DeusEx\ C:\Games\DeusEx\)

PostPosted: Mon Apr 23, 07 11:15 am
by synthetic
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!



/System/ folder is the folder in your Deus Ex folder, where all the important stuff is stored.

Rest is pretty straight forward:

"start->run" type ' command ' and from there use CD command to navigate to your Deus Ex folder, so simply put

cd c:\deusex\system and change the last part where ever your deus ex folder is located

I hope that helps :)

CD stands for Change Directory if i remember right..

when you are in that directory do as the guy says and type "ucc make", if you fucked up with code or files somewhere the log there will show, overall this is all pretty simple.

PostPosted: Tue Apr 24, 07 2:34 am
by Karkian
My Deusex path is the default one C:\\ blah blah :wink: Ill try what undead said :wink:

PostPosted: Tue Apr 24, 07 3:05 am
by Karkian
Sorry for double posting but you know how i type cd c:\deusex\system do i type this in the windows thingy like at the top? ill give u a picture :lol:


This is the school computer by the way :)


Image


So Do i type that c:\deusex\system on the bit that says H:\ I Think right?! :?

Thanks For The Help Everyone

Peace,

Garman

PostPosted: Tue Apr 24, 07 7:03 am
by Karkian
Hey Guys I Did it i made that Plasma Pistol Im gonna try out making some other ones for fun anyone know where i can get the code of other weapons say Assault Rifle?? so i can edit it thanks :D

PostPosted: Tue Apr 24, 07 7:45 am
by Andrievskaya Veronika
Start UnrealEd, open LOG window. Then type there:

Code: Select all
Class spew All


or click the "Export All" button (in Class Browser) :)

This will export all scripts from all packages Then you can take any script in your DeusEx\Classes\ folder :)

Да, я тоже начинала с такого туториала....

PostPosted: Tue Apr 24, 07 9:21 am
by Karkian
Okay thanks ill check that out :wink:

But what is this:
Да, я тоже начинала с такого туториала....


:? lol,

but thanks for the tip :wink:

PostPosted: Tue Apr 24, 07 9:28 am
by synthetic
she said she also started off with that tutorial :p, i believe

PostPosted: Tue Apr 24, 07 10:55 pm
by Karkian
How do you know? can you understand? oh and another question if i want to make another weapon do i make a new folder and edit deusex.ini again and stuff or what?

:?

PostPosted: Wed Apr 25, 07 6:52 am
by Karkian
Im stuck, im trying to make a weapon called AssaultThrowingKnives (An assaultgun which shoots knives out) i tried changing it to this:

Code: Select all
//====================================================
// AssaultThrowingKnives
//====================================================
class AssaultThrowingKnives extends WeaponShuriken; //Subclasses the original shuriken.

Defaultproperties
{
AmmoName=Class'DeusEx.AmmoShuriken'
AltFireSound=Sound'DeusExSounds.Weapons.AssaultGunReloadEnd' CockingSound=Sound'DeusExSounds.Weapons.AssaultGunReload'
SelectSound=Sound'DeusExSounds.Weapons.AssaultGunSelect'
ItemName="AssaultThrowingKnives"
Description="."
beltDescription="ATKNIVES"
}



BUT, it doesnt work so if i add it it's a Throwing Knife picture thingy and when i use it , it is EXACTLY a throwing knife and i changed:

Code: Select all
class AssaultThrowingKnives extends WeaponShuriken;


TO

Code: Select all
class AssaultThrowingKnives extends WeaponAssaultGun;



And this time it's a AssaultRifle EXACTLY i dont get it how do i make it an assaultgun but shoots Throwing knives out?

Thanks,

Garman

:wink:

PostPosted: Wed Apr 25, 07 7:14 am
by Dae
¥[RTK]¥Gårmåñ wrote:How do you know? can you understand? oh and another question if i want to make another weapon do i make a new folder and edit deusex.ini again and stuff or what?

:?

[REN]UNDEAD is Estonian and some Estonians do understand Russian.

You don't need to create another folder. Not necessarily. You can put a new .uc class to the existing one.

PostPosted: Wed Apr 25, 07 7:18 am
by Dae
What about your second question, your class should extend WeaponAssaultGun
Code: Select all
class AssaultThrowingKnives extends WeaponAssaultGun;


and in defaultproperties you should add
Code: Select all
AmmoName=Class'AmmoShuriken'
ProjectileClass=Class'Shuriken'

PostPosted: Wed Apr 25, 07 7:30 am
by clyzm
~[A]Daedalus~ wrote:What about your second question, your class should extend WeaponAssaultGun
Code: Select all
class AssaultThrowingKnives extends WeaponAssaultGun;


and in defaultproperties you should add
Code: Select all
AmmoName=Class'AmmoShuriken'
ProjectileClass=Class'Shuriken'


Don't forget "binstantHit=false" :P

PostPosted: Thu Apr 26, 07 2:24 am
by Karkian
wah, so what would it look like?