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
(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 :).
m_KeepEntranceRooms = ScriptableObject.CreateInstance<GenericRoomTable>();
m_KeepEntranceRooms.includedRoomTables = new List<GenericRoomTable>(0);
m_KeepEntranceRooms.includedRooms = new WeightedRoomCollection()
{
elements = new List<WeightedRoom>() {
//we will place the entrance to our floor here.
}
};
SecretFloorNameEntranceInjector = new ProceduralFlowModifierData()
{
annotation = "Secret Floor Entrance Room",
DEBUG_FORCE_SPAWN = false,
OncePerRun = false,
placementRules = new List<ProceduralFlowModifierData.FlowModifierPlacementType>() {
ProceduralFlowModifierData.FlowModifierPlacementType.RANDOM_NODE_CHILD
},
roomTable = m_KeepEntranceRooms,
// exactRoom = SewersInjectionData.InjectionData[0].exactRoom,
exactRoom = null,
RequiresMasteryToken = false,
chanceToLock = 0,
selectionWeight = 1,
chanceToSpawn = 1,
RequiredValidPlaceable = null,
prerequisites = new DungeonPrerequisite[0],
CanBeForcedSecret = true,
RandomNodeChildMinDistanceFromEntrance = 0,
exactSecondaryRoom = null,
framedCombatNodes = 0,
};
CastleInjectionData.InjectionData.Add(SecretFloorNameEntranceInjector);
m_KeepEntranceRooms.includedRooms = new WeightedRoomCollection()
{
elements = new List<WeightedRoom>() {
//we will place the entrance to our floor here.
}
};
m_KeepEntranceRooms.includedRooms = new WeightedRoomCollection()
{
elements = new List<WeightedRoom>() {
ModRoomPrefabs.GenerateWeightedRoom(ModRoomPrefabs.Keep_Entrance_Room, Weight: 1f)
}
};