Announcement

Collapse
No announcement yet.

RPG Inventory Starter Kit (WIP)

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

    #16
    thanks Grimred! - don't worry it'll be properly commented

    here's today's update: handling of money
    Click image for larger version

Name:	invStarterKit06.jpg
Views:	1
Size:	53.5 KB
ID:	3249865

    the pic doesn't show much but I've added much more functionality for the Gold. Gold can now be looted from/to other pawns, and can be dropped back into the world where it'll appear as a single object (in this case, a carrot) with all the amount of gold inside it - this is meant to be used as a "coins" object.
    as with other inventory items/armor/weapons, you can also drop the gold off a looting pawn directly into the ground as well.

    getting close to completing this, hopefully this week will be it

    Comment


      #17
      Just out of curiosity, can this code be easily modified for a UI with a different weapon layout?

      I am starting on a FPS-RPG style game and want to have 5 weapon slots assigned to keys 1-5.

      Key 1 will be for melee weapons. (eg. Combat Knife, Katana, Nanoblade, etc.)

      Key 2 will be for sidearms such as handguns, shotgun pistols, or other guns. (eg. Ballistic Weapons examples include the Fifty-9 Machine Pistol or BORT-85 Flare Gun)

      Keys 3 and 4 will be for all firearms, energy weapons, big guns, etc.. (eg. assault rifles, combat shotguns, sniper rifles, energy rifles, machineguns, miniguns, rocket launchers, recoilless rifles, etc.)
      These keys will also accept sidearms.

      Key 5 will be for hand grenades, satchel charges, and land mines. (eg. Pineapples, Incendiary grenades, Gas grenades, Stun grenades, Remote/Laser satchels, Switching landmines, etc.)

      The weapons and combat for the game I want to make will draw heavy inspiration from UT2004 Ballistic Weapons and Sgt. Kelly's Pack, though I made up this inventory layout idea on my own based on the loadout screen.


      P.S. Thanks for making this. I have always wanted to work on an inventory system and never knew where to begin. Can't wait for the release.

      Comment


        #18
        yes this wouldn't be too complicated to do. you'd need the weapons to be 'different' like the armor parts are different (ie. you can't equip a helm in the arms), and then add a binding per key from 1-5, that calls a function to use SetCurrentWeapon() on whatever weapon is equipped in the apropriate weapon slot

        Comment


          #19
          today's update: inventory containers
          Click image for larger version

Name:	invStarterKit07.jpg
Views:	1
Size:	72.0 KB
ID:	3249869

          now it's possible to loot containers. a container is an editor-placeable class whose contents are set directly in the editor as well.
          as with looting other Pawns looting containers also allows you to drop stuff in them, so it's possible to store items inside them as well
          money works as well in containers

          Comment


            #20
            it becomes better and better

            just some questions
            - is replication already included, or planned ?
            - how much scaleform stuff is required to create new items ( only add images ?)

            and some question about the code but I think its better to wait and look at the final result

            Comment


              #21
              some answers:
              - replication is neither included, nor planned :/ the code this game was destined for in the first place is only single player and I can't spend more time on it to handle replication which is a complex beast on its own (and on which I have only little experience)
              - all of the items' creation is handled in the editor via archetypes. once I add 'per-object icons' it'll be as easy as adding the texture from a package into a field in the item's archetype and it'll be placed in the inv screen automatically.
              if you only need to use the slot types that are already included (weapon, helm, armor, cape, bracers, gloves, boots, and max 20 packpack slots) you won't need to touch scaleform at all. if you need to change any of that you need to make changes to the scene in flash, some of the flash code (minor changes needed), and the unrealscript code.

              Comment


                #22
                ok I dont really know what 'per-object icons' is but it sounds really good

                Comment


                  #23
                  it means using a unique icon texture for every different object

                  Comment


                    #24
                    about time for a new update.

                    I've almost finished implementing unique per-item icons. the picture will explain much better than any words, so check it out:
                    Click image for larger version

Name:	invStarterKit08.jpg
Views:	1
Size:	86.5 KB
ID:	3249883

                    only a few bugs to kill and some documenting to do and I'll be able to release this

                    Comment


                      #25
                      Great work chosker, thanks for sharing this with the community.

                      As for the icons I guess it would more convenient to use a texture atlas and define the icon position and px dimensions in the item properties?

                      Comment


                        #26
                        it might be more convenient, but I won't be doing it
                        thing is I need to finish this and move on, and off the top of my head it doesn't seem like an easy thing to implement: the item's textures are swapped 'as is' using SetExternalTexture so they're not even resized or anything. and as far as I know you can't crop a texture from script (with the exception of Canvas, which isn't used here)
                        I guess I could make a mask inside the flash element and then offset the placed texture, but I thought masks didn't work in UDK scaleform?

                        Comment


                          #27
                          it's finished!

                          Comment


                            #28
                            releaseparty !

                            cant wait to try it out

                            Comment


                              #29
                              I am having a big problem with this. If the pawn in the level (or the barrel) dies, the mesh disappears and its inventory is not accessible. If I am careful and kill with splash damage instead of a direct hit, I can get the pawn's death mesh to appear, but it contorts all over the place, then slides off the edge of the floor area. The mesh never settles, and actually gains momentum after a few seconds of lying around and contorting. When I play dead, my player mesh contorts in a similar fashion. This happens regardless of whether I have physics run on my CPU or my Nvidia GPU.

                              I'm not sure if you can help fix this though. It could be something in your code, but it is just as likely my computer causing the problem. My PC has a history of sound and physics problems in games and other applications, especially in UDK. I replaced my CPU once already about a year ago because of severe physics problems. It seemed to fix it, but it's starting to look like it didn't. (I guess at least I never got another BSOD since getting the new CPU) I just upgraded my graphics card last January not realizing my computer wasn't totally fixed, so it shouldn't have anything to do with the problem. I cannot afford another computer if my system is the problem, so I hope that isn't the issue here.


                              Everything else seems to work fine as far as I can tell, including accessing the barrel's inventory. (if I don't destroy it) I can even momentarily access the dead pawn's inventory and take an item or two out of it if I can get it to stay still long enough. So this seems to be purely a ragdoll physics problem. (or dead mesh spawning problem if I directly hit the pawn instead of doing splash damage)


                              This is an amazing starter kit and I am excited to start using and modifying it, but this problem is very discouraging.


                              P.S. I just remembered that another issue is if I drop a rocket launcher onto my weapon slot when another launcher is already equipped, it doesn't equip the new launcher properly. (it stores it in the weapon slot, but it doesn't show up on the player) Unlike the jacked up ragdoll physics, this problem is tolerable. I'm just mentioning it post-script so that you are aware of it.

                              Comment


                                #30
                                oh yes I forgot to mention that, it's not something just on your end.
                                direct rocket damage destroys the pawn completely (in theory in favor of spawned gibs). I didn't mention this because I thought "who'd use the rocket launcher in their game anyway?", it's something coming off the rocket launcher code, not the Pawn itself.
                                if you do manage to kill him with splash damage like I did in the video, the character is also likely to contort all over the place, yes. I believe this is caused by the poorly done physics asset I included, as you'll see there's nothing else in the code regarding ragdoll physics than what's inherited from UTPawn. again, something off the scope of this Kit and therefore something I did quickly just for testing.

                                the weapon-for-weapon swapping problem does seem like an issue I should put my attention though. thanks for bringing it up.

                                anyway, glad you like it


                                [update]
                                I've re-worked the weapon equip-swapping and fixed it altogether.
                                I also added collision detection for the location for dropping of objects, tweaked the ragdolls a little (they still drift around the map now and then, but overall they unexpectedly act super-slowly when falling - at least they only seldom go away now), added a var to make containers invulnerable to damage, and made corpses not be gibbed anymore.

                                Comment

                                Working...
                                X