Custom Spell has no icon and no duration

Discuss modding questions and implementation details.
Post Reply
kiskoller
Posts: 36
Joined: Fri Sep 27, 2019 11:13 am

Custom Spell has no icon and no duration

Post by kiskoller »

First of all, I love the game, love the project, the code is clean and fun to read. I've just started modding today and already made good progress and I had a really good time.

Here is my problem, with which I require assistance:

I made a "Detect Quest" spell, which is accessible from the SpellMaker. When cast inside a dungeon, the compass will render the direction where the quest target is, kinda like Quest Markers in Oblivion. It works essentially the same as the Detect Magic/Enemy/Treasure spells already in the game.

My problems are:

1. There is no SpellIcon visible when the spell is active, even though I specifically set to be one.
2. The spell does not expire properly.

I basically copied the code in the Detect Treasure spell and I don't see any logical errors in mine, yet it does not work.

Here is my repo:
https://github.com/dakoller123/DaggerFa ... tTarget.cs

What am I missing?

Obviously the code is still Work in Progress, it does not deal with the fact that quest targets can be outside of dungeons, one dungeon can have multiple quest targets, etc... but this version should already work with such limitations. And it does, I can see the little red line in the compass pointing to the quest target, but it never goes away and I don't see the spell icon when the buff should be on.

I've tried adding some Debug.Log lines but can't seem to find the log target file either.

Any help would be really appreciated :)

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: Custom Spell has no icon and no duration

Post by DunnyOfPenwick »

The code that shows the icon is in the HUDActiveSpells.cs class (UserInterface).

I suggest running in debug mode and putting a breakpoint in your Effect Start() method. After that is triggered, add/enable another breakpoint to the HUDActiveSpells.cs UpdateIcons() method and try to see why the icon isn't showing.

kiskoller
Posts: 36
Joined: Fri Sep 27, 2019 11:13 am

Re: Custom Spell has no icon and no duration

Post by kiskoller »

Found the solution!

In Start() I forgot to add this line: base.Start(manager, caster);

A rookie mistake on my part, but now it works just as I expected.

Post Reply