Mods not working in 0.10.24 builds

Discuss modding questions and implementation details.
Post Reply
User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Mods not working in 0.10.24 builds

Post by Ralzar »

Yup, I removed that line and now the light gets removed. Only problem is, it probably removes a bunch of other lights as well since I no longer limit the method to only remove the torch lights.

Also, the method for adding light to the torch objects is not working either?

Edit: scratch that. All the code works now as long as I comment out
if (dfLights.gameObject.name == "DaggerfallLight [Dungeon]")
in the method for removing vanilla lights.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Mods not working in 0.10.24 builds

Post by Ralzar »

Oh wow. Ok I identified the problem.


In Unity Editor:
dfLights.gameObject.name = "DaggerfallLight [Dungeon]"


In Live:
dfLights.gameObject.name = "DaggerfallLight [Dungeon](Clone)"



So I changed this in my code. Now the mod works in Live but does not work correctly in the Editor.

Which is an obvious improvement, but will be hard to compensate for when developing mods...

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Mods not working in 0.10.24 builds

Post by Ralzar »

Climates & Calories turned out to be an easy fix, as long as there's not smaller parts of the mod not working that I haven't spotted yet.
It actually needed the change I erroneously assumed Torch Taker needed.
I simply changed

[Invoke(StateManager.StateTypes,Start, 0)]

to

[Invoke(StateManager.StateTypes.Game, 0)]



But maybe someone has any suggestions for a better way to do the torch detection in my post above? Where it works in both live and editor?

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Mods not working in 0.10.24 builds

Post by BadLuckBurt »

As seen on Discord:

Code: Select all

If(gameObject.name.StartsWith("DaggerfallLight [Dungeon]"))
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Mods not working in 0.10.24 builds

Post by Ralzar »

Ok new oddity:


I have quite a few lines of RegisterCustomActivation for clicking on fireplaces in dungeons to rest by them.

If I start the game and load a save inside a dungeon: those custom activations no longer work.

Code: Select all

            PlayerActivate.RegisterCustomActivation(mod, 101, 0, Camping.RestOrPackFire);
            PlayerActivate.RegisterCustomActivation(mod, 101, 5, Camping.RestOrPackFire);
            PlayerActivate.RegisterCustomActivation(mod, 210, 0, Camping.RestOrPackFire);
            PlayerActivate.RegisterCustomActivation(mod, 210, 1, Camping.RestOrPackFire);
            PlayerActivate.RegisterCustomActivation(mod, 41116, Camping.RestOrPackFire);
            PlayerActivate.RegisterCustomActivation(mod, 41117, Camping.RestOrPackFire);

Summary of testing:

1 Start game and load save inside dungeon: clicking fire does NOT work
2 Leave dungeon. Enter dungeon: clicking fire works
3 Load save from step 1: clicking fire works
4: Make new save: clicking fire works.
5: Load new save: clicking fire works.
6: Exit game, Start game, load new save: clicking fire does NOT work

If the savegame loading function loads a dungeon, something is changed so flats do not identify in the same way.
There is no errors in Unity Editor. Everything looks fine. But nothing happens if you click one of the flats.
Exit the dungeon and enter again and the flats are clickable again.

User avatar
Interkarma
Posts: 7251
Joined: Sun Mar 22, 2015 1:51 am

Re: Mods not working in 0.10.24 builds

Post by Interkarma »

Are you using any event(s) to trigger your method that performs registration of custom activation?

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Mods not working in 0.10.24 builds

Post by Ralzar »

Interkarma wrote: Sun Jul 05, 2020 10:41 pm Are you using any event(s) to trigger your method that performs registration of custom activation?
I do not feel I’m qualified to answer that, so I’ll just link the code:

https://github.com/Ralzar81/Climates-Ca ... es.cs#L143

When a campfire sprite is clicked, the mod is supposed to run the method RestOrPackFire. But if the sprite was loaded by restoring savedata, the mod does not recognise the clicked item as a campfire and does not run the method.

RestOrPackFire:
https://github.com/Ralzar81/Climates-Ca ... ng.cs#L123

User avatar
Interkarma
Posts: 7251
Joined: Sun Mar 22, 2015 1:51 am

Re: Mods not working in 0.10.24 builds

Post by Interkarma »

Sounds like an internal issue perhaps. The code process of transitioning into a dungeon from outside and setting up dungeon when loading a save are slightly different. This would best be answered by TheLacus as the designer of this system. Would you mind making an Issue report on git outlining this issue and tagging @TheLacus in description?

https://github.com/Interkarma/daggerfall-unity/issues

If you guys are unable to get a solution together, I'll take a look at the issue when I can.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Mods not working in 0.10.24 builds

Post by Ralzar »

Interkarma wrote: Sun Jul 05, 2020 11:27 pm Sounds like an internal issue perhaps. The code process of transitioning into a dungeon from outside and setting up dungeon when loading a save are slightly different. This would best be answered by TheLacus as the designer of this system. Would you mind making an Issue report on git outlining this issue and tagging @TheLacus in description?

https://github.com/Interkarma/daggerfall-unity/issues

If you guys are unable to get a solution together, I'll take a look at the issue when I can.
Cool. I submitted an issue.

Funny thing is, you can fix the issue while playing by doing the following:

While inside dungeon and experiencing the error:
1: Save
2: Leave dungeon
3: Enter dungeon
4: Load the save

Because then the actual dungeon is loaded by transitioning into it and the loading of the savegame just handles any variations in monsters, loot content etc.
Last edited by Ralzar on Mon Jul 06, 2020 6:46 am, edited 1 time in total.

User avatar
Interkarma
Posts: 7251
Joined: Sun Mar 22, 2015 1:51 am

Re: Mods not working in 0.10.24 builds

Post by Interkarma »

Hey mate! Sorry, this isn't what I had in mind. :) I was referring to the custom activation issue specifically. I don't like "shotgun" issues that spray a whole bunch of things that may or may not be related. We like to focus on one specific problem per issue.

The issues with your other mods seem to have been resolved on your end. Is there anything else required there?

I'll close that issue and create one on your behalf for the custom activation problem.

Post Reply