Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Help with Custom Weapons

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with Custom Weapons

    I've read numerous tutorials. I have the model, the animations, everything is set up except for compiling the code. Every time it fails, doesn't matter if i did the tutorial word for word, it seems to fail. I'm simply trying to make a machine gun, but i went with the tutorial and used the shock rifle and it still fails, i did exactly as the tutorials says. (Tutorial is here http://www.lack-of.org/custom_weapon_ut3_tutorial If anyone can help, look through the tutorial (at the end where scripts are) and see what is wrong? I've scanned Google a million times and cant find another tutorial to fix the problem. If you can help me with making a simple machine gun with an altfire zoom in feature i would be so happy. Links to a working tutorial or comments to help me would be so amazing. Thanks

  • #2
    There's several things wrong with that tutorial.

    - The path names it uses are flatout wrong for the UDK, it won't find your packages if you follow it.
    - You should not outright copy the shock rifle code, sigh. Not your fault you're just trying to learn but... at most you would want to extend the shock rifle but not copy it.
    - You should follow Hourences tutorial for setting up a simple game, rather than the modpackages stuff it recommends.

    Here's my suggestion. Go follow Hourences basic game tutorial. Once you've completed it and everything works correctly, come back and do this:

    - Import your custom weapon in as a skeletal mesh into UDK so that you can view it inside the editor.
    - In the place where your UDK source files are (Hourences tutorial will go through this), just create a UTWeap_Custom.uc or something like that.
    - Have it only contain something like this:
    Code:
    class UTWeap_Custom extends UTWeap_Linkgun;
    
    defaultproperties
    {
       Begin Object Name=FirstPersonMesh // First person settings
    	SkeletalMesh=SkeletalMesh'YourPackageNameHere.UTWeap_Custom' // Defines the weapon mesh to use
       End Object
       Name="Default__UTWeap_Custom"
       ObjectArchetype=UTWeapon'UTGame.Default__UTWeapon'
    }
    That will simply have your custom gun show your custom mesh and have it behave as if its the linkgun. To actually access the gun, as the tutorial suggests you could use the weapon replacement mutator. Alternatively, you could create your own gametype which gives it to you by default with something like this:

    Code:
    class CustomGame extends UTDeathmatch;
    
    defaultproperties
    {
       DefaultInventory[0] = class'YourPackageNameHere.UTWeap_Custom'
       Name="Default__CustomGame"
    }
    Again, to set the gametype to your new CustomGame, go see Hourences basic game tutorial. Trying to do everything at once like that = crashtastic. Just get the mesh in game, nothing else. Then add in animations, effects, custom gun behavior, etc. You will notice in the gun examples that come with the UDK that they define a lot of what you'll need down in defaultproperties (like animsets). Do it slowly, one piece at a time rather than set everything up, hit go and watch it burn

    Comment


    • #3
      Thank you so much for a quick response, i will definitely look into the tutorials.

      Comment


      • #4
        Ok, It compiled but how exactly do i get it in game? Weapon Factory and mutators aren't finding it

        Comment


        • #5
          Weapon factories are separate and would have to be coded in, ignore that for now. Did you:

          - Get the skeletal mesh in UDK and can open it up and look at it
          - Finish the Hourences tut and its completely working

          I described above 2 ways to actually get it in game. I'm happy to help but you gotta actually read it and follow directions In the future, let me know what steps you did or didn't do, just saying "it doesn't work" doesn't give any info to help with!

          Comment


          • #6
            Yes, Ive completed the tutorial, and I have the mesh loaded into UDK, i can find it in the content browser. But I'm having trouble getting the gun to be default with the script you provided, I assume you put it in MyGameInfo or somewhere else?


            Warnings
            -Unresolved Reference
            -Invalid Property
            Both Warnings are in the MyGame folder regarding how i put the DefaultInventory line in MyGameInfo

            Also weapon replacement doesnt recognize my weapon so i cant find it

            Comment


            • #7
              alrite, i have got all the errors fixed except one, it keeps telling me that it cant load my .u file for the weapon, if anyone can help i will be so thankful because that seems to be the last of many hurdles to see my work in game. Thanks.
              EDIT Fixed, i changed the name and edited DefaultEditor to recognize it, but problems with the custom game are still goin Ill see if i can fix that.
              EDIT 2 I got it game works well, thank you so much for the help

              Comment


              • #8
                uhm..edited Default Editor?? Why? There is never any reason to do that..
                And the default inventory is much easier accessed via Kismet!

                Comment


                • #9
                  Quick suggestion. You may want to extend UTWeap_SniperRifle so that all the zooming code is in place for you to mod to your liking. You could then substitute meshes and animations once you get your custom weapon in the editor.

                  As a general rule, always extend the class that has the most functionality for you, it will cut down your workload a ton.

                  have fun!

                  Comment


                  • #10
                    Hopefully he means DefaultEngine. It's why I reference Hourences tut, if you vaguely understand what he's doing in there, you should recognize that you're just adding the inventory bit in your custom gametype, and where to set that up in your ini's. Though I should have kept with his naming conventions and just said add the above inventory to MyGameInfo. Glad you got it to work, it's kind of a pain to get someone who is new all the way through it, you did the right thing though, error, troubleshoot, error, troubleshot, then it works

                    Comment


                    • #11
                      I edited DefualtEditor like this "ModPackage=MyGun" so that it compiles, at least thats what i was told, and for the sniper rifle i cant extend it because it is UDK, it tells me there is no sniper class. Im sorry if im really newbish its just this is so much different from what im used to.

                      Comment


                      • #12
                        i would use the shockrifle class as a base, as the linkgun has to much extra stuff in it

                        Comment


                        • #13
                          I actually always suggest working off of just UTWeapon or UTBeamWeapon myself, unless there's some super specific function of a gun someone just has to have. Hang in there MSalinas, eventually if you keep drinking the coolaid, the unreal way will make more sense

                          There shouldn't be any need to do that change to the Editor.ini. If you really followed Hourences correctly, it compiles without errors, its been tested by hundreds. It's been my experience that people sort of skip stuff here and there or don't really follow it closely.

                          Comment

                          Working...
                          X