PDA

View Full Version : Trouble Testing Custom Weapons



TychoVII
11-05-2009, 11:01 PM
I'm no programmer by any means, just an artist trying to get his weapons into the game. In UT3 I know the basic process behind doing it, but I can't get the same process to work in the UDK.

The old way was to copy the UTWeap_Shockrifle and UTAttachment_Shockrifle and modify a few lines to use my own custom meshes. I've done the same thing in the UDK and I put my modified scripts in the /Development/Src/MyMods... folder. I added MyMods to the UTEditor.ini and modified the line:

'ModPackagesInPath=..\..\UTGame\Src'

to this:
'ModPackagesInPath=..\..\Development\Src'.

I'm not quite sure where to put my packages before building now, so I threw them into the Content folder under TestPackages. I used Frontend to recompile it, opened up the editor and placed a Weapon Factory in a simple level, but my weapon doesn't show up in the weapons list.

I tried moving my packages to the Unpublished folder, but then Frontend gives me a bunch of warnings about not being able to find the assets.

This non-programmer could sure use a little help. Thanks in advance :)

jernst
11-05-2009, 11:17 PM
you could just import your weapons with the same names in the same groups, in the same package, thus overwriting the original, say shock rifle with your mesh.

I do this all the time to test different player characters and such locally.

quick example:
package name : ShockRifle
Group name : Mesh
SkelMesh name : SK_ShockRifle

just import your weapon in same upk, same grp, and name yours the same, and it will overwrite

TychoVII
11-05-2009, 11:46 PM
I've always heard that you're never supposed to modify or write over the original packages or scripts.

ambershee
11-05-2009, 11:47 PM
Personally, I'd never overwrite them. I'm not sure code goes in the 'MyMods' folder however. Have you checked the UDN docs on how to compile?

TychoVII
11-06-2009, 12:19 AM
Ok I got it working.

[EDIT]: [Not working completely. Having some more errors on compile. Scroll down to see them.]

ambershee: you were right, I did not check the UDK documentation on compiling. It instructs you to remove a semicolon from the UTEngine.ini

Don't know why they have it commented out, but they tell you what exactly to do here:

http://udn.epicgames.com/Three/DevelopmentKitProgramming.html#Configuring,%20Comp iling%20and%20Testing

Just have to figure out why the Shockrifle code keeps giving me compile errors. Commenting out the troubled lines allows it to compile just fine and then my weapon shows up in the editor, but the weapon doesn't play any of its animations. Anyways, at least it's showing up :)

BorisK
11-06-2009, 12:24 AM
so TychoVII where does ur coding go and where do ur weapon packages go?

TychoVII
11-06-2009, 12:40 AM
The packages seem to work in /UTGame/Content/TestPackages
I guess 'Content' will sort of be like the new 'Published'

Your custom scripts seem to work in /Development/Src/MyMods
But that only works if you edit the UTEditor.ini AND the UTEngine.ini

UTEditor.ini:
[ModPackages]
ModPackagesInPath=..\..\UTGame\Src
ModOutputDir=..\..\UTGame\Unpublished\CookedPC\Scr ipt

--change to--

[ModPackages]
ModPackagesInPath=..\..\Development\Src
ModOutputDir=..\..\UTGame\Unpublished\CookedPC\Scr ipt
ModPackages=MyMod

UTEngine.ini:
;ModEditPackages=MyMod

Remove the semicolon. It's commented out by default.

TychoVII
11-06-2009, 02:00 AM
I've gotten the weapon to show up in game, but I still can't get the script to compile properly. I keep getting the following error:

Warning/Error Summary
---------------------
C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\RKWeap_44Magnum.u c(311) : Error, BEGIN OBJECT: name MeshSequenceA redefined: Begin Object class=AnimNodeSequence Name=MeshSequenceA

C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\RKWeap_44Magnum.u c(395) : Error, BEGIN OBJECT: name ForceFeedbackWaveformShooting1 redefined: Begin Object Class=ForceFeedbackWaveform Name=ForceFeedbackWaveformShooting1


All I've done is copied the UTWeap_Shockrifle script and changed its name to RKWeap_44Magnum (both in file name and at the top of the script). Why would this code work perfectly fine in the shockrifle script, but not an exact duplicate of it?

I tried commenting out the problem lines and the script DOES compile without errors and my weapon DOES show up in the editor, but its animations do not work.

I'm baffled now.

BorisK
11-06-2009, 02:15 AM
have you tried UTWeap_Magnum or WP_Magnum
i doubt that should make a difference tho lol

marilol
11-06-2009, 03:09 AM
I've gotten the weapon to show up in game, but I still can't get the script to compile properly. I keep getting the following error:

Warning/Error Summary
---------------------
C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\RKWeap_44Magnum.u c(311) : Error, BEGIN OBJECT: name MeshSequenceA redefined: Begin Object class=AnimNodeSequence Name=MeshSequenceA

C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\RKWeap_44Magnum.u c(395) : Error, BEGIN OBJECT: name ForceFeedbackWaveformShooting1 redefined: Begin Object Class=ForceFeedbackWaveform Name=ForceFeedbackWaveformShooting1


All I've done is copied the UTWeap_Shockrifle script and changed its name to RKWeap_44Magnum (both in file name and at the top of the script). Why would this code work perfectly fine in the shockrifle script, but not an exact duplicate of it?

I tried commenting out the problem lines and the script DOES compile without errors and my weapon DOES show up in the editor, but its animations do not work.

I'm baffled now.

You need to remove the Class=

So it would look like this:


Begin Object Name=ForceFeedbackWaveformShooting1
blablabla
End Object

or it might be the name you need to remove, Im pretty tired right now so theres a big chance I muddled them up.

TychoVII
11-06-2009, 04:24 AM
marilol: Thankyou for the suggestion! It half worked :)

Things are starting to get interesting now. I removed the "class=" from both lines I was getting errors from. It fixed one, but not the other. Now I'm getting the following error:

Warning/Error Summary
---------------------
C:\UDK\UDK-2009-11\Development\Src\MyMod\Classes\RKWeap_44Magnum.u c(311) : Error, BEGIN OBJECT: No base template named MeshSequenceA found in parent class UTWeap_ShockRifleBase: Begin Object Name=MeshSequenceA


The damn thing complains that it's being redefined, then when I don't define it, it complains that it's NOT being defined! What gives Epic? :P

TychoVII
11-06-2009, 07:26 PM
Sorry to bump this, but I'm really stuck here. I can't figure out why I get an error no matter what I name this class. It makes no sense to me. I could really use some help on this.

danimal'
11-07-2009, 02:23 PM
Just a suggestion, but it's pretty hard to help with that little of information, at the very least post your defaultproperties{} so we can see it. Usually, like the class problem, you need to take info out. You actually generally shouldn't wholesale copy defaultproperties{} from another gun.

danimal

TychoVII
11-07-2009, 06:25 PM
Well I got it working 100%.

Instead of duplicating the shockrifle script, I created a new script and extended off of UTWeap_Shockrifle. Then I just added a few lines in the defaultproperties to tell it to use my mesh. It compiles just fine now. Thanks for the suggestions guys.

G0rdon
11-07-2009, 06:38 PM
Is there any reload system sample out there?

i wanted to add some awesome guns with epic reload anims :p

TOP-Proto
11-07-2009, 07:02 PM
i got this problem too. (and im not a noob coder lol)


class TacticalAssault_BASEWeapons extends UTWeapon
config(TACustomWeapons);


class TacticalAssault_Weapon extends TacticalAssault_BASEWeapons;

defaultproperties
{
Begin Object class=AnimNodeSequence Name=MeshSequenceA
End Object
}

can someone confirm this is a bug or if im just sleep deprived :P

Ortzinator
11-08-2009, 12:31 PM
I'm also trying to get a weapon working, but I'm unsure how to actually get it in the game to test. (Console command?)

marilol
11-08-2009, 12:43 PM
I'm also trying to get a weapon working, but I'm unsure how to actually get it in the game to test. (Console command?)
giveweapon UTGame.UTWeap_ShockRifle

so if I made a chainsaw in my mymod folder:

giveweapon mymod.chainsaw

chainsaw being the name of the file. Thats a console command.

As for TOP-Proto I have no idea why its causing that, I will have to try this myself.

geodav
11-08-2009, 01:50 PM
just starting myself, don't use the code from UT3 as it throws errors all over the place, use the code that comes with UDK, i build a test map and added a weapon pick-up base that way you can check your weapon in game

danimal'
11-08-2009, 02:55 PM
Rule #1 when you get errors and aren't sure what it does or what you're doing: comment it out.

For anyone wanting to test out their weapon, there's several different ways (see above), I personally favor this, and making this gametype the default gametype (UTEngine.ini specifies default gametype I think):



class YourGametype extends UTTeamGame; //could be UTDeathMatch, etc etc.

defaultproperties
{
DefaultInventory[0] = class'MyMod.UTWeap_YourGun'
}


That way I can just compile with Make (from FrontEnd), and Launch and test.

danimal

SpartanDonut
11-08-2009, 03:42 PM
When you get this working, could you PLEASE take a moment to write a quick tutorial of the steps you took? Also, is there any preparation you have to do to the mesh to get it to work in UDK?

Thanks!

TychoVII
11-08-2009, 06:39 PM
Geodav has already made a phenomenal video tutorial for getting your custom weapon to replace one of UT3's weapons. If you follow all the steps in his video you will get a custom weapon working in the UDK, but there are a couple steps you have to take differently. I've already pointed out what those steps are earlier in this thread.

BorisK
11-10-2009, 11:55 PM
The packages seem to work in /UTGame/Content/TestPackages
I guess 'Content' will sort of be like the new 'Published'

Your custom scripts seem to work in /Development/Src/MyMods
But that only works if you edit the UTEditor.ini AND the UTEngine.ini

UTEditor.ini:
[ModPackages]
ModPackagesInPath=..\..\UTGame\Src
ModOutputDir=..\..\UTGame\Unpublished\CookedPC\Scr ipt

--change to--

[ModPackages]
ModPackagesInPath=..\..\Development\Src
ModOutputDir=..\..\UTGame\Unpublished\CookedPC\Scr ipt
ModPackages=MyMod

UTEngine.ini:
;ModEditPackages=MyMod

Remove the semicolon. It's commented out by default.

do you have to say /UTGame/Content/TestPackages/CustomWeapons ????

SpartanDonut
11-11-2009, 01:56 AM
Geodav has already made a phenomenal video tutorial for getting your custom weapon to replace one of UT3's weapons. If you follow all the steps in his video you will get a custom weapon working in the UDK, but there are a couple steps you have to take differently. I've already pointed out what those steps are earlier in this thread.

Sweet! I shall have to check it out.

TOP-Proto
02-20-2010, 11:28 AM
Well I got it working 100%.

Instead of duplicating the shockrifle script, I created a new script and extended off of UTWeap_Shockrifle. Then I just added a few lines in the defaultproperties to tell it to use my mesh. It compiles just fine now. Thanks for the suggestions guys.

this will not work when you come to package your game as the shockrifle is part of the utcontent pack that your not allowed to package with your game

TOP-Proto
02-20-2010, 11:33 AM
furthermore i also believe this is a bug.

Begin Object class=AnimNodeSequence Name=MeshSequenceA
End Object

should work. if it doesnt i think its fixed by replacing all the UT .u files with the RELEASE versions, or its something to do with cooking and the cook cache.