joeyslucky22 Posted December 2, 2014 Posted December 2, 2014 From my post on reddit: I just couldn't wait any longer so I made a few in blender + photoshop and put together the tileset in TileZed.I'm not a complete inept n00b when it comes to coding, I've got the basics down, but after 4 hours of attempting to get my mod working, I threw in the towel.If anyone here is capable or interested in modding sleeping bags into PZ, here are my source files (Tileset / Icons / TileZed building / Blender Files):http://joeflashedme.com/pz/JoeysLucky22_SleepingBags.zip Feel free to use them however and wherever you wish. The two sleeping bags with spiffio on them have a drawing from the PZ artist so don't use those if you plan on using these in any other unrelated projects. Anyways, here is what I was trying to do:Build & pack a sleeping bag as you would a tentCraft a sleeping bag with:recipe Make Sleeping Bag Kit {Pillow,Sheet,RippedSheets = 10,Result:SleepingBagKit,Time:50.0,} I was looking through the camping LUAs and tried to replicate tents but failed miserably. If anyone does manage to get these working properly in game, my hats off to you! Let me know too because I just want to have sleeping bags in PZ already! Geras, Gustav and false_chicken 3
Gustav Posted December 2, 2014 Posted December 2, 2014 From my post on reddit: I just couldn't wait any longer so I made a few in blender + photoshop and put together the tileset in TileZed.I'm not a complete inept n00b when it comes to coding, I've got the basics down, but after 4 hours of attempting to get my mod working, I threw in the towel.If anyone here is capable or interested in modding sleeping bags into PZ, here are my source files (Tileset / Icons / TileZed building / Blender Files):http://joeflashedme.com/pz/JoeysLucky22_SleepingBags.zip Feel free to use them however and wherever you wish. The two sleeping bags with spiffio on them have a drawing from the PZ artist so don't use those if you plan on using these in any other unrelated projects. Anyways, here is what I was trying to do:Build & pack a sleeping bag as you would a tentCraft a sleeping bag with: recipe Make Sleeping Bag Kit {Pillow,Sheet,RippedSheets = 10,Result:SleepingBagKit,Time:50.0,}I was looking through the camping LUAs and tried to replicate tents but failed miserably. If anyone does manage to get these working properly in game, my hats off to you! Let me know too because I just want to have sleeping bags in PZ already!These should certainly be part of the base/vanilla Game! I'm especially impressed with the Spiffo sleeping bags! And whats up with that Table?
Guest Posted December 2, 2014 Posted December 2, 2014 The secret likely lies in how Romain implemented tents. Just do a search of the Lua folders in something like NotePad++; it should take you to the right place.Take a look at RoboMat's old sleeping mod, too.
joeyslucky22 Posted December 3, 2014 Author Posted December 3, 2014 The secret likely lies in how Romain implemented tents. Just do a search of the Lua folders in something like NotePad++; it should take you to the right place.Take a look at RoboMat's old sleeping mod, too. Oh yeah, I've been digging around in the LUAs the last couple days and am just trying to wrap my head around how tents work or how I would implement a custom script without butchering the original. The files I found to contain tent behaviors were:..\ProjectZomboid\media\scripts\camping.txt..\ProjectZomboid\media\lua\server\Camping\camping.lua..\ProjectZomboid\media\lua\server\Camping\BuildingObjects\campingTent.lua..\ProjectZomboid\media\lua\client\Camping in the campingTent.lua I see where it's referencing a sprite (o:setNorthSprite("TileIndieStoneTentFrontLeft")) but I haven't got a clue on how to call a custom sprite. I'm not even sure how any of these scripts are called to begin with. If I were to make a new "sleepingbags.lua" script, how would I call those scripts in-game? Thanks for the tip on RoboMat's mod EnigmaGrey! Their LUAs seem to only be in the /shared folder. Would I need any scripts in there? I'm not sure this is what I was looking for to help get me started. I'm a real novice when it comes to scripting so it's difficult for me to figure out what's exactly needed or where to even start but any other help to point me in the right direction would be greatly appreciated!
Guest Posted December 3, 2014 Posted December 3, 2014 In this case you'd place the sprite in \mods\sleepingbags\media\textures\ for single objects in a png file. For tilesheets it's . . . well, haven't quite figured that out yet. You use Tiled to pack tilesheets into a texturepack then place it in \texturepacks\ rather than \textures.To call them from the game, it's going to depend on what the base object is, I believe. For example, ISBuildMenu.doBuildMenu = function(player, context, worldobjects, test) local square = nil; local buildOption = context:addOption(getText("ContextMenu_Build"), worldobjects, nil); local subMenu = ISContextMenu:getNew(context); context:addSubMenu(buildOption, subMenu); ISBuildMenu.buildCompostBinMenu(subMenu, player)endISBuildMenu.buildCompostBinMenu = function(subMenu, player) local sprite = {} sprite.sprite = "media/textures/compostbin.png" sprite.northSprite = "media/textures/compostbin.png" sprite.eastSprite = "media/textures/compostbin.png" local crateOption = subMenu:addOption("Compost Bin", worldobjects, ISBuildMenu.onCompostBin, square, sprite, player) endISBuildMenu.onCompostBin = function(worldobjects, square, sprite, player) local compostBin = ISWoodenContainer:new(sprite.sprite, sprite.northSprite); compostBin.renderFloorHelper = true compostBin.canBeAlwaysPlaced = true; compostBin:setEastSprite(sprite.eastSprite); compostBin.player = player getCell():setDrag(compostBin, player);endThis is all new to me, so. Shared should be fine. Both Shared and Client are loaded when the game boots up, or when a mod is selected in single player.
Omegapl Posted December 3, 2014 Posted December 3, 2014 (edited) Like EnigmaGrey said tilesheets are used to make texture packs . I don't know how to import packed texture in lua.I was bored this evening so I remade RoboMat's mod into sleeping bags but I got stuck and I couldnt load these textures Edit: I managed to load packed textures but they dont have proper names anymore. Their names are just numbers with same prefix. Becouse textures in sprite sheet are placed irregularly its hard to find out position in which they should appear on the map Edited December 3, 2014 by Omegapl joeyslucky22 1
false_chicken Posted December 4, 2014 Posted December 4, 2014 The bags look great! I hope to see this functional some day.
joeyslucky22 Posted December 6, 2014 Author Posted December 6, 2014 Like EnigmaGrey said tilesheets are used to make texture packs . I don't know how to import packed texture in lua.I was bored this evening so I remade RoboMat's mod into sleeping bags but I got stuck and I couldnt load these textures Edit: I managed to load packed textures but they dont have proper names anymore. Their names are just numbers with same prefix. Becouse textures in sprite sheet are placed irregularly its hard to find out position in which they should appear on the map Ahhh right. Now I remember something about custom tiles only working when added to newtilesdefinition.tiles When "_Joeyslucky22_SleepingBags" is added, it's given the GID of 161. So the first tile is "161000". My guess is that since each tile has a unique GID, they need to be added to the current tileset as to not overwrite any existing tiles. *sigh* So a new tileset mod will only work if no other mods with a custom tileset are installed? If that's the case, that kind of sucks
wintermuteai1 Posted March 17, 2016 Posted March 17, 2016 hey there, created these and used your icon: http://theindiestone.com/forums/index.php?/topic/18729-sleeping-bag-mod/ enjoy!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now