Modding Discussion Opening the fridge from another spot in the house.

Discussion in 'Mods' started by Xelias, Oct 5, 2016.

  1. Xelias

    Xelias Space Hobo

    While digging around decompiled code I noticed there is a switch defined to trigger events in the farm house. Seems like an odd way to do it, but basically the tile that is used for the bottom half of the fridge (173 in the 'untitled' tile sheet) is set so when right clicked it will trigger the fridge interface assuming the player is close enough to the tile.

    This is tied to the building layer so how I went about doing it was copying the cabinet tiles to the front layer, and then making what were the tiles on the building layer copies of the bottom half of the fridge. So now I can use the cabinets to open the fridge :D.

    It appears the same setup is used to turn on the fireplace. So it could also be used to make a 'switch' somewhere else in the house to turn on/off the fireplace


    Original post:
    I'm new to C# but not modding in general, but I'm getting stumped on what I'm trying to accomplish...

    What I'd like to do is allow the fridge to be accessed from each of the tiles containing cabinets, as they are currently just there for looks. This would be Pos 1, 14 through Pos 1, 19 in FarmHouse2.tbin.

    upload_2016-10-4_18-12-21.png

    What I'm having an issue with is that the game seems to place the fridge with floating point values (it's located at 3f, 7f), yet the map files themselves are defined with integers, so I'm getting a little confused on what I should be referencing exactly...

    Any thoughts on what the proper direction to take to achieve this would be?
     
      Last edited: Oct 5, 2016
    • Borodin

      Borodin Master Astronaut

      Try checking out the code in AccessChestAnywhere. Since the refrigerator is a glorified chest in one sense, that might help.
       
        Xelias likes this.
      • Xelias

        Xelias Space Hobo

        I'll give it a look, thanks.
         

        Share This Page