Making the Entrance
We are now onto the last part of our floor tutorial! Congratulations. You've almost finished. now we just need to make the entrance.
For this example, I will make a pit to load the floor, but you can use other things as well.
Make the entrance of your floor in RAT. Do not add any pits.
Go back to ModRoomPrefabs and add a new PrototypeDungeonRoom
public static PrototypeDungeonRoom Keep_Entrance_Room;Ideally, we want our room to have an icon, if we want this we go add new objects to our asset bundle, one empty gameobject, and one texture (the icon).
Go into ModPrefabs and add public static GameObject Entrance_Icon;
in InitCustomPrefabs drop
Entrance_Icon = ModAssets.LoadAsset<GameObject>("Entrance_Icon");
ItemAPI.ItemBuilder.AddSpriteToObject(Entrance_Icon, ModAssets.LoadAsset<Texture2D>("Entrance_Icon"), false, false);inside the InitCustomRoom add
Keep_Entrance_Room = RoomFactory.BuildFromResource("DPSMod/Resources/ModRooms/Keep_Entrance_Room.room");
Keep_Entrance_Room.associatedMinimapIcon = ModPrefabs.Entrance_Icon; //not required
(Tiny pumpkin is the room icon lol. its blurry here but i just forgot to change its filter mode to point)
now we head back towards FloorNameDungeonFlows
inside InitDungeonFlows
This section has to do with our entrance
here we add our room
we can add more rooms if we want some variance and it will randomly select one of these rooms.
Add this to your toolbox:
now we need a new object in our assetbundle. we will place this in our entrance room. Go to ModPrefabs and add public static GameObject FloorNameEntrance;
Get it like so
FloorNameEntrance = ModAssets.LoadAsset("FloorNameEntrance");
you can add a sprite to this object if you wish.
create a new file called KeepEntranceControllerthat inherits from BraveBehaviour, IPlaceConfigurable.
just copy AAAALLLLLLLL this in
make sure to change values according to your needs.
now we head back to ModPrefabs and do
And in ModRoomPrefabs do
tada! congratulations, you have just done one of the hardest things in modding! nice work and i cant wait to see the results :).
Last updated
Was this helpful?