Modding Tutorials: Quest Packs & New Guilds

Discuss modding questions and implementation details.
User avatar
harbinger451
Posts: 155
Joined: Mon Apr 13, 2020 4:08 pm
Contact:

Re: Modding Tutorials: Quest Packs & New Guilds

Post by harbinger451 »

This looked super simple, but I am assuming it's so simple that I am overthinking it? Some mods, like Archeologist and Roleplay&Realism have new quests packed into the dfmod file, so I know it's possible but I can't find any script in those mods that refer to loading those quests/questlist.
Hey Ralzar, did you ever solve this problem of packaging a quest pack as a dfmod ... I 'm trying to do it now but can't figure out the script. I looked at Hazelnut's Archaeologists mod script and tried whittling it down from that, but with little success.

I really need help with this ... someone ... anyone?

This is what I got so far ... but I don't even know if I'm on the right track.

Code: Select all

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

namespace ProstitutesAndLovers
{
	public class ProstitutesAndLoversMod : MonoBehaviour
	{
		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<ProstitutesAndLoversMod>();
		}

		void Awake()
		{
			InitMod();
			mod.IsReady = true;
		}

		public static void InitMod()
		{
			Debug.Log("Begin mod init: Prostitutes And Lovers");

			{
				if (!QuestListsManager.RegisterQuestList("ProstitutesAndLovers"))
					throw new Exception("Quest list name is already in use, unable to register Prostitutes And Lovers quest list.");
			}

			Debug.Log("Finished mod init: Prostitutes And Lovers");
		}

	}
}
EDIT: I was on the right track ... just tested it and the script totally works.
Image

User avatar
harbinger451
Posts: 155
Joined: Mon Apr 13, 2020 4:08 pm
Contact:

Re: Modding Tutorials: Quest Packs & New Guilds

Post by harbinger451 »

So I am building a couple of new guilds, but I'm having problems with the FactionFile.GuildGroup values. The Archaeologist Guild uses GGroup0 and the prostitutes guild in the Love and Lust mod uses GGroup1, so I thought I'd use GGroup2 for my first effort (placing a guild of bawdy houses into the game that act as a front for espionage and blackmail), but I get the following error in the console when trying to compile the scripts into a dfmod...
Assets\Game\Mods\RedLanternMod.cs(40,67): error CS0117: 'FactionFile.GuildGroups' does not contain a definition for 'GGroup2'
Same goes for GGroup3 (I was hoping to also do a Bards guild). When I use GGroup1 it goes fine with no error message. I really don't want to step on any toes by using either GGroup0 or GGroup1. Am I missing something here?

The relevant section of code goes...
public static void InitMod()
{
Debug.Log("Begin mod init: RedLantern");

if (RegisterFactionIds())
{
if (!GuildManager.RegisterCustomGuild(FactionFile.GuildGroups.GGroup2, typeof(RedLanternGuild)))
throw new Exception("GuildGroup GGroup2 is already in use, unable to register Red Lantern Guild.");

Services.RegisterGuildService(1020, GuildServices.Quests);
Services.RegisterGuildService(1021, GuildServices.Training);
Services.RegisterGuildService(1022, GuildServices.BuyPotions);
Services.RegisterGuildService(1023, GuildServices.MakePotions);
Services.RegisterGuildService(1024, GuildServices.Spymaster);
}
else
throw new Exception("Faction id's are already in use, unable to register factions for Red Lantern Guild.");

Debug.Log("Finished mod init: RedLantern");
}
Image

User avatar
harbinger451
Posts: 155
Joined: Mon Apr 13, 2020 4:08 pm
Contact:

Re: Modding Tutorials: Quest Packs & New Guilds

Post by harbinger451 »

I did a bit of searching and it appears that the usable GGroup numbers are GGroup0 (taken), GGroup1 (taken), GGroup8, GGroup12, GGroup13, GGroup16, GGroup18, GGroup19, GGroup20 and GGroup21.

I tried GGroup8 and GGroup12 and, although I got no error messages compiling the dfmods (which was nice), in game when you try to join the guild a "Joining guild GGroup1 is not implemented" message comes up. No idea why. Not using GGroup1 anywhere in the code. All guild NPCs were assigned to the right factions for GGroup8 or GGroup12. This is giving me a major headache.

EDIT: I got it sorted. GGroup8 is working. Turns out I was being dim and missed a spot in the RegisterFactionIds code where the GGroup number had to be stated and I hadn't changed it to match the one I was trying to use. Oh well, you live and learn.
Image

User avatar
Hazelnut
Posts: 3010
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Modding Tutorials: Quest Packs & New Guilds

Post by Hazelnut »

Glad you got it sorted. Do let me know if I can help, though I'm not around as much I am still out here. :)
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply