Adding a Building to the placesTable to Make it a Permanent Location

Discuss modding questions and implementation details.
Post Reply
adamatom
Posts: 32
Joined: Sun May 07, 2023 10:16 am

Adding a Building to the placesTable to Make it a Permanent Location

Post by adamatom »

As the title suggests, I am looking for the appropriate ID number to convert into hex and add to the placesTable in order to make a specific building permanent. I have added some dungeons by using the dungeons LocationId. I assume this might be possible with buildings too somehow? If I'm not mistaken DaggerfallCastle WayrestCastle etc. are treated as dungeons in the placesTable (engine limitations?).

I want to make a couple of guildhalls permanent. I want to send the player to a knightly order (order of the scarab in Totambu) in one quest in a quest chain I'm working on and a Mages Guild in another part of the chain. It would be nice to send the player to a specific building that looks impressive aesthetically, as the npcs who pc will correspond with in the quest are meant to be the leader of The Order of The Scarab and the Arch Mage of the Mages Guild (the head mage basically or whatever is lore friendly to the Iliac Bay region at the time in the canon).

Is this possible? Any other way around this? An alternative is just to code the quest to send pc to any remote knightly order when starting the quest in Totambu (haven't figured out how to send the player to a knightly order, only Mages Guild/FIghters Guild) and deal with the fact that the Mages Guild will end up being any random one in the region.

I hope this makes sense, I find it difficult to explain using the proper terms as I'm new to coding quests and scripting. Here's the code I used for the dungeons so far:

Code: Select all

using UnityEngine;
using DaggerfallWorkshop.Game;
using DaggerfallWorkshop.Game.Utility.ModSupport;
using DaggerfallWorkshop.Game.Questing;
using System;

namespace ArenaFallEnhanced
{
    public class ArenaFallEnhancedMod : MonoBehaviour
    {
        protected static string[] placesTable =
        {
            "Stonekeep_Ext,         0xC3BA, 1, -1",
            "Fanglair_Ext,          0xC3CA, 1, -1",
            "MhirchCabin_Ext,       0x5EB9, 1, -1",
            "CryptOfHearts_Ext,     0xC3C9, 1, -1",
            "MinesOfKhuras_Ext,     0xC3B7, 1, -1",
            "Stonekeep,             0xC3BB, 1, -1",
            "Fanglair,              0xC3CB, 1, -1",
            "CryptOfHearts,         0xC3CA, 1, -1",
            "MinesOfKhuras,         0xC3B8, 1, -1",
            "PrisonOfTristynak,     0x3ED9, 1, -1", 
            "TowerOfPerastyr,       0x320A, 1, -1",
            "DispothMinster,        0x3358, 1, -1",
            "MhirchCabin,           0x5EBA, 1, -1"
        };

        static Mod mod;

        [Invoke(StateManager.StateTypes.Start, 0)]
        public static void Init(InitParams initParams)
        {
            mod = initParams.Mod;
            var go = new GameObject(mod.Title);
            go.AddComponent<ArenaFallEnhancedMod>();
        }

        void Awake()
        {
            // Add additional data into the quest machine for the quests
            QuestMachine questMachine = GameManager.Instance.QuestMachine;
            questMachine.PlacesTable.AddIntoTable(placesTable);

            // Register the quest list if you put quests into the mod package
            //if (!QuestListsManager.RegisterQuestList("ArenaFallEnhanced"))
            //    throw new Exception("Quest list name is already in use, unable to register ArenaFallEnhanced quest list.");

            mod.IsReady = true;
        }
    }
}

Post Reply