Jump to content

[request] skilled modders to look into mod compatibility issues.


Recommended Posts

Ah it does indeed load based on the mod folder name. Now I can see the bug. That explains everything.

Also changing the backpack-amulet priority to -1 also fixes the problem. I can't be sure but it could also fix similar compatibility issues for other mods.

Link to comment
Share on other sites

This makes sense if B&A is instantiating the badge objects so modifying the badge class in SimpleHUD is being done 'too late', as it were. I have been making some modifications to SimpleHUD to use AddClassPostConstruct and it has been working without setting any priorities for the mods, which leads me to believe that the AddClassPostConstruct method adds functionality after the objects have been constructed (hence the name, I guess).

 

Mouse if you want to use my code I can send it to you when I'm finished. I still need to implement the temperature update you did the other day, and I also want to use the fancy mod config screen that was added in API 6 to toggle temperatures. I would also like to change the numbers to red or green if they're increasing or decreasing, but I'll leave that for another programming exercise for another day.

Link to comment
Share on other sites

I know I can make it so only select badges are affected and that's great and all BUT consider this. Person A makes mod B that adds badge C using the normal method. The way I set it up makes sure that badge C is affected by my HUD mod so nothing special needs to be done. No special code has to be written to make it compatible. Nobody has to do any kind of priority settings. Everybody's happy. This seems like the most logical way to go about it.

Link to comment
Share on other sites

And btw, his way of returning the original functions value is still better even if at the moment said functions have no return values, for the sake of future compatibility.

 

Yes! I thought that was brilliant when I saw Mouse doing that.

 

I know I can make it so only select badges are affected and that's great and all BUT consider this. Person A makes mod B that adds badge C using the normal method. The way I set it up makes sure that badge C is affected by my HUD mod so nothing special needs to be done. No special code has to be written to make it compatible. Nobody has to do any kind of priority settings. Everybody's happy. This seems like the most logical way to go about it.

 

Yep. I agree. My updates modify the Badge class post-construct, so anything using the Badge type is updated. It seems to work just fine, even though the specific badges are instantiated as sub-classes (I didn't have to modify the sub-classes at all).

 

There's also no need to modify mod priorities or anything, which I think is kinda hackish. Mods should just work, as you say, the developer/user shouldn't have to update priority numbers based on whichever other mods the player happens to have loaded at the time.

 

I have my updates complete if you want to see them.

 

modmain.lua: http://pastebin.com/WJqbCqGz

modinfo.lua: http://pastebin.com/9QTCNCPF

 

Changes:

  • Updated the function overrides to use AddClassPostConstruct for better compatibility.
  • Added a configuration option to the mod config screen so the player doesn't have to modify a lua to turn off the clock temperature display in the game.
I didn't update the version number or the author in modinfo.lua. You can do that if you want to use this to update your own mod.
Link to comment
Share on other sites

Yes! I thought that was brilliant when I saw Mouse doing that.

 

 

Yep. I agree. My updates modify the Badge class post-construct, so anything using the Badge type is updated. It seems to work just fine, even though the specific badges are instantiated as sub-classes (I didn't have to modify the sub-classes at all).

 

There's also no need to modify mod priorities or anything, which I think is kinda hackish. Mods should just work, as you say, the developer/user shouldn't have to update priority numbers based on whichever other mods the player happens to have loaded at the time.

Call me pessimist, but i don't think that game will change in nearest future after multiplayer update. Multiplayer update is not about UI for sure.

Priority is not hackish, its just way to control load order and sometimes its only way to do your dirty things.

For example Better Console have

priority = 2^10
:-)
Link to comment
Share on other sites

Yes! I thought that was brilliant when I saw Mouse doing that.

I can't take credit for that. Squeek created the original method and it seems mostly bullet proof so that has always been my go to method. And considering Squeek recommends modders to use it over the AddXPostInit's, and I use it so much, it's strange how it's always my mods that have to be made compatible for other mods, not the other way around. Especially since some mods have huge glaring compatibility issues with entire sub-genres of mods and flat-out require said mods to make changes just so the two can play nice together. Even in this situation, there are still people saying the B&A mod crashes for them and so far the only time anyone says SHUD doesn't work is when they're using it with B&A at the same time. Common sense suggests where the problem lies and outside of the people who are experiencing the crashes, I see no one pressuring that modder to change anything. Ugh, anyways, /unexpectedrant

 

Mods should just work, as you say, the developer/user shouldn't have to update priority numbers based on whichever other mods the player happens to have loaded at the time.

I couldn't agree more. The whole thing is fragile, tedious, stinks of a classism mentality and shouldn't be necessary at all.

I have a quick question though, have you tried making a new badge to be sure it works? I tested SHUD by making a badge for Beatrice and it worked without issue. I ended up heavily modifying it afterwards so it would display how I wanted it to but it worked oob, so to speak.

Link to comment
Share on other sites

Ranty rant.

I hope you know I meant no offense to you by asking you for help first. I think you're a good coder who is active in the community, so you were a good choice to ask for help. If it was determined that it wasn't your mod that was causing the incompatibility, I fully intended to ask the other author to update his mod. As it turned out, my trying to change his mod didn't make things work, but changing yours did. I think I made the right call asking you for help before the other guy.

Also I didn't mention it because I didn't think it was relevant, but I tried a couple different backpack mods and they all exhibited the same symptoms. Nobody's other badge mod had these symptoms with B&A (but I liked your interface better so I wanted to use yours). I did my research and your mod seemed to be the outlier. But I still think you're a good coder!

 

I have a quick question though, have you tried making a new badge to be sure it works? I tested SHUD by making a badge for Beatrice and it worked without issue. I ended up heavily modifying it afterwards so it would display how I wanted it to but it worked oob, so to speak.

Well I tested it with Woodie switching forms and it worked OOB. I will try it with beatrice, and there's a thirst mod that creates a new badge, I'll check that out too and report back.

Link to comment
Share on other sites

So I tried these two mods and it turns out they both don't work "out of box". But there's good reasons!

Thirst mod doesn't actually use the Badge widget, it uses the base Widget class so an edge case would have to be coded in, just like with the moisture widget, if you wanted to add support for that mod.

Beatrice mod also didn't work with my changes. When I hovered over the badge, it would have both the inside/outside-bee-count text and the max-bee-count numbers in there at the same time (screenshot). I looked into the code and I found a small bug (no pun intended) in Beatrice.

You're overriding the OnGainFocus and OnLoseFocus functions in Beatrice but you're not using the "best practice" of saving the old OnGainFocus and OnLoseFocus functions first. In fact, Beatrice only works with your original SimpleHUD "by coincidence". I suspect that Beatrice didn't actually work "OOB" with SimpleHUD, and you had to add the status.beebadge.isfocused=<boolean> lines in there to make it work. In my update to your SimpleHUD mod, I changed the isfocused variable to isFocused, which broke the requirement that Beatrice is relying on the external mod variable name. Beatrice shouldn't rely on a variable name from an external mod, but it does.

But it's an easy fix! You can remove those lines and save the old versions of the overridden functions to make Beatrice completely agnostic of any SimpleHUD mods. It works by itself, it works with your old version of SimpleHUD, and it works with my updated version of SimpleHUD. It just works. =)

Here's what you should change: http://pastebin.com/RF8LSHXn

I'm sorry to keep asking you to change your mods, but this seems like a good improvement to me.

Link to comment
Share on other sites

I hope you don't think I was attacking you directly.

No that rant just kind of came out of no where. Usually people are asking me to make my mods compatible with another overrated mod that does things like overwrite default files and crashes on it's own and all that. Anyways, it felt good to get it off my chest even if it wasn't intentional.

 

Also I didn't mention it because I didn't think it was relevant, but I tried a couple different backpack mods and they all exhibited the same symptoms. Nobody's other badge mod had these symptoms with B&A (but I liked your interface better so I wanted to use yours). I did my research and your mod seemed to be the outlier.

That actually is relevant. I assumed B&A was the only instance of the bug occurring. However it's possible there's some code sharing going on between all of those mods, in which case, it would make sense if they all experienced the same bug. I'm not saying that is the case, I'm just saying I've seen that kind of thing happen quite a bit.

 

Well I tested it with Woodie switching forms and it worked OOB. I will try it with beatrice, and there's a thirst mod that creates a new badge, I'll check that out too and report back.

Beatrice mod also didn't work with my changes. When I hovered over the badge, it would have both the inside/outside-bee-count text and the max-bee-count numbers in there at the same time (screenshot). I looked into the code and I found a small bug (no pun intended) in Beatrice.

Well like I said, I basically forced Beatrice's badge to behave the way I want it to so SHUD and SHUD-like mods won't be able to change how it's displayed(in theory anyways). I very specifically made it so it would behave in a very SHUD like fashion without requiring SHUD to be installed. Anyhow, it would probably be better for you to just make your own badge to test it against. widgets/hungerbadge and widgets/healthbadge can serve as pretty good templates.

In any case, I'm not going to wait for anyone else to change their priority to -1. I'm just going to change mine to 00110000. For every mod I make. They will all be dead last and unimportant. Miserable little second class peasants piddling away their days in a mod world made for it's kings by it's kings. (That's a joke btw.)

Link to comment
Share on other sites

Anyhow, it would probably be better for you to just make your own badge to test it against. widgets/hungerbadge and widgets/healthbadge can serve as pretty good templates.

I made a mod that includes three badges:

  • a count-up every .5 seconds to a maximum of 100
  • a krampus meter
  • an atmospheric moisture meter (to predict when it will rain/snow.. I'm not sure that's been done before but it was fun to stumble upon it!)
They all work without any mods, and they all work "out of the box" with my updates to your SimpleHUD mod. Here's the code if you want to take a gander: http://pastebin.com/TMxktZj2

 

In any case, I'm not going to wait for anyone else to change their priority to -1. I'm just going to change mine to 00110000. For every mod I make. They will all be dead last and unimportant. Miserable little second class peasants piddling away their days in a mod world made for it's kings by it's kings. (That's a joke btw.)

Hah!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...