Pinned Example: CustomItemLoader

    • Intermediate

    We've posted a status update with some first screenshots of the new terrain generation. There is also a new update available for the Java version!

    • Example: CustomItemLoader

      Difficulty: Intermediate

      This plugin enables you to create new custom items (tools or melee weapons) easily. Just place all relevant item files (as well as a "ItemDefinition.txt" file) into a separate folder in the "Items" subfolder. This plugin contains a "baseball bat" example item.
      Files
    • Can we get some more documentation so we can add in food items, among other things? I would love to add candy which can be consumed like strawberries, and such. The way I can use these plugins is by reverse-engineering things in template form with seeing a similar pattern, I would use that template to do similar things. I need more documentation to look at so I can make sense of things.

      A list of animations currently in Rising World, and etc. How do we consume the candy, what animation do I use, and etc?
      [Threads of Interest - [My Suggestions] "On The List" | [Kitsu Test World ]
    • ArcticuKitsu wrote:

      Can we get some more documentation so we can add in food items, among other things? I would love to add candy which can be consumed like strawberries, and such. The way I can use these plugins is by reverse-engineering things in template form with seeing a similar pattern, I would use that template to do similar things. I need more documentation to look at so I can make sense of things.

      A list of animations currently in Rising World, and etc. How do we consume the candy, what animation do I use, and etc?
      yes right and how can we add another bow,crossbow or rifle? Maybe new clothes too?
    • Cluas wrote:

      It's working fine. Just one thing: I can NOT make a name for my item, when i try to use spaces in the name. Is this intended?
      Yes and no. Basically this is just a limitation of the CustomItemLoader, to keep the code as simple as possible (since the main purpose of this plugin is to serve as an example plugin) ;) But if you create a custom plugin, you can change the name with this function (which supports spaces as well as multiple languages): CustomItem.setLocalizedNames()

      Cluas wrote:

      Oh one more: is there a way to copy the text from the console?
      Unfortunately that's not possible, however, if you want to copy the coordinates from the debugitem or debugplayerbody commands, you can just press Return (press Shift+Return to copy the rotation to clipboard) :)

      ArcticuKitsu wrote:

      Can we get some more documentation so we can add in food items, among other things?
      Unfortunately this can't be done with the CustomItemLoader. This plugin only works for very basic tools and weapons. If you want to create food or more complex items, you have to create a new plugin for that. You could use the Backpacks plugin as a reference, since it works in a similar way (instead of opening the backpack, you just have to remove the food item from the inventory, update the health/hunger/thirst of the player and maybe play an eating sound effect).
      You can also check out the documentation, it also contains some example code: javadoc.rising-world.net/net/r…ts/custom/CustomItem.html

      ArcticuKitsu wrote:

      A list of animations currently in Rising World, and etc. How do we consume the candy, what animation do I use, and etc?
      The CustomItemLoader plugin contains a list of all animations (as a txt file) ;) Alternatively you can find all animations here: javadoc.rising-world.net/net/r…/api/utils/Animation.html

      _Joe_ wrote:

      yes right and how can we add another bow,crossbow or rifle? Maybe new clothes too?
      Unfortunately clothes cannot be added through the API at the moment, since they would require some additional preparation (you have to set up proper rigging / skin weighting, which would only work if you have access to the player model skeleton)...
      However, if you want to add firearms, you can check out the potato cannon example plugin. Instead of firing a potato, you can use the World.spawnProjectile() method to fire an actual projectile ;)
    • red51 wrote:

      you have to create a new plugin for that. You could use the Backpacks plugin as a reference, since it works in a similar way (instead of opening the backpack, you just have to remove the food item from the inventory, update the health/hunger/thirst of the player and maybe play an eating sound effect).
      You can also check out the documentation, it also contains some example code: javadoc.rising-world.net/net/r…ts/custom/CustomItem.html
      I may struggle horribly with this. When I gain a proper day off I may fiddle with this because I promised one person I'd make a Candy Factory with consumables so I have to see this through. I may have to ask for help though if it pains me to much, but thanks for helping me with what you could.

      Was hoping to use strawberries and corn to make candy, to then consume it, but I guess that may prove to be "difficult", or just "messy". Hopefully I can figure it out later..... :S

      red51 wrote:

      The CustomItemLoader plugin contains a list of all animations (as a txt file)
      I probably should have noticed this earlier. Missing out on the obvious, or something. That should help. Thanks
      [Threads of Interest - [My Suggestions] "On The List" | [Kitsu Test World ]
    • Hi, also ich würde mal um Hilfe bitten :D Ich habe jetzt das Waffen-Modell im Spiel und es ist über eine Werkbank craftbar.
      Die Position in den Händen stimmt auch und die Animationen funktionieren nun auch wunderbar. Über die Code zeilen von der potatogun konnte ich schon Kartoffeln mit veränderten werten sehr schnell schießen aber der Sound hat sich dabei aufgehangen.

      Ich möchte eine Automatik-Schnellfeuerwaffe haben die solange m14 Projektile schießt bis ich die linke Maustaste wieder los lasse (oder im Idealfall das Magazin leer ist) :whistling: . Kannst du mir @red51 oder jemand anderes vielleicht mal bei dem Teil an code helfen? :| Wäre sehr lieb :)
    • @_Joe_: Erstelle am besten einen separaten Thread dazu, weil es hierbei ja um ein eigenständiges Plugin gehen würde welches nicht direkt mit dem CustomItemLoader zusammenhängt ;) Grundsätzlich ist das Animations-Handling momentan etwas eingeschränkt, d.h. für ein durchgehendes Schießen ist momentan nur eine Loop-Animation geeignet (was bei der normalen M14 Animation leider nicht der Fall ist).
    • red51 wrote:

      ArcticuKitsu wrote:

      Was hoping to use strawberries and corn to make candy, to then consume it, but I guess that may prove to be "difficult", or just "messy". Hopefully I can figure it out later....
      It's really not that complicated, basically it just requires a few lines of code. If you have any questions, don't hesitate to ask :) I can provide some example code if you want ;)
      Hi Red.....

      As I have just started work on my Prehistoric Rising World mod and I was wondering if you could show the code for using strawberries and corn to make Candy and then consume it.

      I could use the example code for things i have planned myself.
      Prehistoric Rising World - 2019
      Dinosaurs existed 65 million years ago and Man evolved 700,000 years ago.
      But what if this was not the case and Dinosaurs and Man actually existed together?

      26th April Environment Files added to page 1
      22nd May Environment Sound V2
      added to page 1
    • red51 wrote:

      DanielBoone wrote:

      I was wondering if you could show the code for using strawberries and corn to make Candy and then consume it.
      Maybe create a new topic for that, since that would be basically a new, separate plugin (which isn't related to the CustomItemLoader) :)
      New topic now created. Thanks.
      Prehistoric Rising World - 2019
      Dinosaurs existed 65 million years ago and Man evolved 700,000 years ago.
      But what if this was not the case and Dinosaurs and Man actually existed together?

      26th April Environment Files added to page 1
      22nd May Environment Sound V2
      added to page 1