I created a mod that enable you to spawn almost any item or mob in game. Requires RP Loader!
Requires Alpha 1 Release 14!
Showcase video:
This a little preview (outdated) .
Usage:
Mod adds to campstand two new buttons with enable you to spawn : Spawner and Spawner2.Spawners can change in to most of items or mobs in game ,spawners in to furniture and nature ,spawners-2 in to bolts,toys and creatures.
TIP:
After spawner changed into something else doesn’t use his popup menu that stays.
Do you know how to make it generate a list of items for usage at runtime? and how were you planning on dealing with the potentially hundreds of items by full release? It should be possible to make a list of items at least, I know that the code can find a list of the factions so it should be feasible at least.
For now,no but i will find a way. The problem is items have no things like tags i will need to find way to filter them,also some items require special spawn atributs.
I think i will do a interface similar to that from workshop with categories.
I would probably try reading the manifest’s entities section and work with a few white/blacklists, for example excluding all _proxy entities, while including only those within entities/construction, entities/furniture et cetera. That should get you the majority of all items.
I created a simple mod that create manifest.log file with list of all entities that are not _proxy ,it is quite messy code so i will need to clean it up but it work.
(This just for demonstration if you are not a moder don’t use it !)
Require RP loader
Heh, not quite the most elegant reason but I can see where I have to add work ;). In the current repos version of RP I’ve added access to all mods that are recognized (i.e. all mods with a manifest) to be saved within rp.available_mods. This way, the manifests are already there for you (and you don’t need to dir). A few things, however (keep in mind - just tips!):
io.output() sets the output for everything. This means that RP would now log into your manifest.log too. It’s better to io.open('manifest.log', 'w') and use the file handle returned by that to log your process (using a local print version similar to what you do). I really wish we had the loggers available to us, but alas. I might add something rp-ish to make this process easier.
The check for manifest.rp is going to fail for Stonehearth because it (obviously) isn’t using rp. Simply checking for manifest.radiant and manifest.radiant.entities should do the trick.
for key,value in pairs(requirement) do: pairs already gives you value (which is identical to requirement[key]. You don’t need to save it in another variable (s)
Splitting is not required. What you will need is the entity name (i.e. the key; “dining_table” for example would then resolve to “stonehearth:dining_table”, not any part of the path.
I’ll give an item spawner a shot. It will be nice to see if I can get the JS integration a bit further (and to mess around with commands).
I would do the exact same, however - modifying other’s code is a great way to learn a language (or concepts). So far I’ve been the one modifying however, I haven’t seen anyone doing this on my code… Feels a bit odd
I just did a quick “mod spotlight” of this. Very fun and promising, so keep it up and I will gladly try out later releases as well Hope you enjoy the video, I sure enjoyed the mod!
I should start poking around the files… I have some knowledge of Lua thanks to the ComputerCraft mod for Minecraft, although different and somewhat out of date most of the concepts still apply, Either way very lovely mod! If I could thumbs up more than once well…