blindcoder Posted March 29, 2015 Share Posted March 29, 2015 Hi everyone. I'm trying to simplify some of my mod code by using ISSimpleFurniture instead of extending ISBuildingObject but can't get it to work at all This is my code: local simpleStill = ISSimpleFurniture:new("ISSimpleFurnStill", "media/textures/destill1a_east-west.png", "media/textures/destill1a_south-north.png"); simpleStill:setSouthSprite("media/textures/destill1a_north-south.png"); simpleStill:setEastSprite("media/textures/destill1a_west-east.png"); simpleStill.player = player; simpleStill.modData["need:SaltWater.RubberHose"] = 1; simpleStill.modData["need:SaltWater.BigFunnel"] = 1; simpleStill.modData["need:SaltWater.SwivelGrillStand"] = 1; simpleStill.modData["need:Base.RoastingPan"] = 1; simpleStill.modData["need:Base.Pot"] = 1; simpleStill.canBeAlwaysPlaced = true; getCell():setDrag(simpleStill, player);As far as I can tell, this should work. The still also appears in the world, but it is not visible anymore after re-loading the map. I have copied this code from the building menu code which is practically identical: local furniture = ISSimpleFurniture:new("Small Table with Drawer", sprite.sprite, sprite.northSprite); furniture.modData["need:Base.Plank"] = "5"; furniture.modData["need:Base.Nails"] = "4"; furniture.modData["need:Base.Drawer"] = "1"; furniture:setEastSprite(sprite.eastSprite); furniture:setSouthSprite(sprite.southSprite); furniture.isContainer = true; furniture.player = player getCell():setDrag(furniture, player);Where is my error, I can't seem to find it Link to comment Share on other sites More sharing options...
blindcoder Posted March 29, 2015 Author Share Posted March 29, 2015 Okay, so apparently it IS there, but the sprite isn't rendered and the name isn't set (worldobjects:getName() returns nil). Why? Okay, no, it's not there. but the square is blocked. Edit 2: But I _can_ dismantle it? WTF? Link to comment Share on other sites More sharing options...
RobertJohnson Posted March 29, 2015 Share Posted March 29, 2015 Guess the textures which aren't in texture packs aren't saved then... Will take a look blindcoder 1 Link to comment Share on other sites More sharing options...
blindcoder Posted March 29, 2015 Author Share Posted March 29, 2015 Guess the textures which aren't in texture packs aren't saved then... Will take a look *Phew* If it's just that, that'd be cool, because I was starting to worry about my ability to understand code Link to comment Share on other sites More sharing options...
RobertJohnson Posted March 29, 2015 Share Posted March 29, 2015 Try to open UI2.pack and repack it with your stuff (using awesome EP tools ) Link to comment Share on other sites More sharing options...
blindcoder Posted March 29, 2015 Author Share Posted March 29, 2015 Can you give me some directions? No matter what I do, when I click on Pack Viewer -> Open Pack -> Extract Images then select a target directory I don't get any images saved in the selected directory. Link to comment Share on other sites More sharing options...
blindcoder Posted March 29, 2015 Author Share Posted March 29, 2015 I have managed to create and load my own saltWater.pack file, but no luck yet extracting UI2.pack. Link to comment Share on other sites More sharing options...
blindcoder Posted March 29, 2015 Author Share Posted March 29, 2015 Note, also with the .pack file the still was gone after reload, even though the sprites appeared in-game until I saved and reloaded. Link to comment Share on other sites More sharing options...
blindcoder Posted March 29, 2015 Author Share Posted March 29, 2015 Okay, I just swapped UI2.pack out for saltWater.pack but to no avail.The square is blocked after reloading, but there's no IsoThumpable. Link to comment Share on other sites More sharing options...
TheZ Posted October 2, 2022 Share Posted October 2, 2022 Hey, the topic is here since 2015... but I'm actually facing the same issue you described here. Did you manage to find which was causing this behavior and how to solve it actually? Thank you. Link to comment Share on other sites More sharing options...
TheZ Posted October 6, 2022 Share Posted October 6, 2022 (edited) Okay, to anyone who is interested, my problem was caused by creating texture packs in TileZed from a separated pngs. After i switched to spritesheets instead and recreated my texture pack out of this - problem has been resolved. Edited October 6, 2022 by TheZ DirtySanchez and Pandorea 2 Link to comment Share on other sites More sharing options...
Pandorea Posted October 7, 2022 Share Posted October 7, 2022 Thank you for posting your solution to the problem! Sure it'll help somebody else down the line Link to comment Share on other sites More sharing options...
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