Jump to content

Need help with ISSimpleFurniture


blindcoder

Recommended Posts

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

  • 7 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...