Hey, here's a small fix to make sure it works with events that don't have an onUpdate function explicitly defined: https://we.tl/t-GfxltyQDe5 It just changes line three to 'local modifiersFunction = ::mods_getMember(o, "onUpdate");'
Edit: Hmm, seemingly can't get it to work. Tried just putting in your file as well as repacking it with the original mod, but no settlement tooltips for me. :-(
Updating this mod for Legends (at least minimally) seems simple enough. Well, after you've spent half an hour tracking down what's wrong. :D
Legends has an extra argument for onUpdateDraftList(), gender, which specifies which female backgrounds to use depending on game setup. Adding this parameter to the script via mod detection (I hope it is possible via mod hooks?) or exception catching should fix the worst incompatibilities.
Legends also has lots of backgrounds starting with 'legend_', so your parsing function might also need a little updating.
I don't use the Legends mod, and I have a lot of stuff going on in my personal life such that I'm not inclined to take the time to figure out how to update this for it specifically.
If someone else wants to do it they're free to take my source code and modify it as they see fit, then either send it to me to update here or upload it themselves so they get all the Nexus-points or whatever.
The wiki contains a lot of outdated information, whereas this mod generates values on the fly from in-game data. So if there's a discrepancy I'd put money on this mod being correct.
The tooltips are not actually reversed: the subject of the sentence is the settlement, not your group. e.g. The town is selling items for 10% more, which means it costs you 10% to buy things.
There is discussion on the first page of comments if you want to understand my thought process for designing it this way.
Still, I agree the wording lacks clarity, and while I love this mod, I immediately modified it so I could understand the informations I was reading. I also put the % modifier at the start of every statement, for consistency sake. Feel free to use my clarified rewording (this is actually a request :p) for your future versions.
2 other notes about specific situations : 1) I didn't see any tooltip for "mirage sightings", which, accordingly to the wiki, means there is an "Ifrit" hunt contract available. Since ifrits are one of the reasons I'm not taking beast hunt contracts in southern cities, I assume this info is useful. ... well, or not, since I would NEVER have to fight serpents, and will just continue to ignore those... I had no idea how to add that (and now know what Mirages means), but if it's easy, it could be worth this small update. 2) "Bread and games" status, in a city state with Arena makes Arena fights paid more. Looks like maybe 30% to me, but the info should probably be added.
Anyway, here's my ugly code for clear statements, which could use even more cleanup than the original one :) I hope you'll consider it, my goal is just to stop people from being confused. And yeah, people focus on their company, not on settlement X or Y : mercenary is a pretty selfish job ! local generateColoredString = function ( nameAmountPair ) { //convert float into integer % local difference = nameAmountPair.amount > 1 ? (nameAmountPair.amount - 1) * 100 : (nameAmountPair.amount - 1) * -100 local diffPct = difference.tostring() + "% " local lessOrMore = nameAmountPair.amount > 1 ? "more" : "less" local badColor = this.Const.UI.Color.NegativeValue + "]" local goodColor = this.Const.UI.Color.PositiveValue + "]" local color = lessOrMore == "less" ? badColor : goodColor //this could use cleanup :/ switch(nameAmountPair.name) { // Settlement sells at higher prices case "BuyPriceMult": color = lessOrMore == "more" ? badColor : goodColor //return "Selling items to you for " + lessOrMore //return "Selling items to you for " + lessOrMore //return "" + lessOrMore + " cost for buying items here" lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher" return "" + lessOrMore + " items costs" case "SellPriceMult": //return "Buying items from you for " + lessOrMore //return "" + lessOrMore + " profit from items you sell here" return "" + lessOrMore + " profits from selling items" case "FoodPriceMult": color = lessOrMore == "more" ? badColor : goodColor //return "Buying and selling food for " + lessOrMore lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher" return "" + lessOrMore + " food supplies buying and selling prices" case "MedicalPriceMult": color = lessOrMore == "more" ? badColor : goodColor //return "Selling medical supplies to you for " + lessOrMore lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher" return "[color=" + color + diffPct + "[/color">" + lessOrMore + " medical supplies prices" case "BuildingPriceMult": //return "Buying and selling building materials for [color=" + color + diffPct + "" + lessOrMore lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher" return "[color=" + color + diffPct + "[/color">" + lessOrMore + " building materials buying and selling prices" case "IncensePriceMult": //return "Buying and selling incense for [color=" + color + diffPct + "" + lessOrMore lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher" return "[color=" + color + diffPct + "[/color">" + lessOrMore + " incense buying and selling prices" case "RarityMult": if (lessOrMore == "less") { lessOrMore = "fewer"; } return "[color=" + color + diffPct + "" + lessOrMore + " items for sale" case "FoodRarityMult": return "[color=" + color + diffPct + "[/color">" + lessOrMore + " food for sale" case "MedicalRarityMult": return "[color=" + color + diffPct + "" + lessOrMore + " medical supplies for sale" case "MineralRarityMult": return "[color=" + color + diffPct + "[/color">" + lessOrMore + " minerals for sale" case "BuildingRarityMult": return "[color=" + color + diffPct + "" + lessOrMore + " building materials for sale" case "RecruitsMult": if (lessOrMore == "less") { lessOrMore = "fewer"; } return "[color=" + color + diffPct + "[/color]" + lessOrMore + " recruits are available" } // failover, should ever be needed return nameAmountPair.name + " " + difference + "%." }
I just tested it on a new game with the current patch and it still seems to be working for me. Are you running any other mods, and if so are they working?
Same, latest mod hooks installed but nothing on tooltips when there is a situation in town. Other mods seem to work (i've only tried a couple including show enemy stats which works fine).
It is a STEAM installation, but it is not in the default location (as that sometimes causes conflicts with Programs folder or whatever), all my games installed to a custom folder.
Not sure I see any difference? Are the tooltips supposed to show up only when there is an event or at every location/settlement?
When I hover over any settlements I dont see any changed tooltips or info- not sure what I'm doing wrong I simply pasted the zip into the data folder like the rest. Should this work with existing campaigns? I only have the basegame no DLC installed thanks
I have not used the Legends mod and don't plan on supporting it. All I know it that it is a very large project that touches many parts of the code, and I don't have the inclination to dig through it to figure out the incompatibility just to then have to maintain multiple versions of this mod.
69 comments
here's a small fix to make sure it works with events that don't have an onUpdate function explicitly defined: https://we.tl/t-GfxltyQDe5
It just changes line three to 'local modifiersFunction = ::mods_getMember(o, "onUpdate");'
here you go
could you please reupload your fix? I tried it manually, but it doesn't seem to work, and your link is expired.
Thanks a lot. :-)
https://we.tl/t-AG2h0WUxZV
If someone has a different site where the link stays up for longer than a week, that'd be appreciated.
Edit: Hmm, seemingly can't get it to work. Tried just putting in your file as well as repacking it with the original mod, but no settlement tooltips for me. :-(
Legends has an extra argument for onUpdateDraftList(), gender, which specifies which female backgrounds to use depending on game setup. Adding this parameter to the script via mod detection (I hope it is possible via mod hooks?) or exception catching should fix the worst incompatibilities.
Legends also has lots of backgrounds starting with 'legend_', so your parsing function might also need a little updating.
If someone else wants to do it they're free to take my source code and modify it as they see fit, then either send it to me to update here or upload it themselves so they get all the Nexus-points or whatever.
https://web.tresorit.com/l/iDrPd#Rligh0Dohs9Y2cy0d2DuHA
The tooltips are not actually reversed: the subject of the sentence is the settlement, not your group. e.g. The town is selling items for 10% more, which means it costs you 10% to buy things.
There is discussion on the first page of comments if you want to understand my thought process for designing it this way.
I also put the % modifier at the start of every statement, for consistency sake.
Feel free to use my clarified rewording (this is actually a request :p) for your future versions.
2 other notes about specific situations :
1) I didn't see any tooltip for "mirage sightings", which, accordingly to the wiki, means there is an "Ifrit" hunt contract available.
Since ifrits are one of the reasons I'm not taking beast hunt contracts in southern cities, I assume this info is useful.
... well, or not, since I would NEVER have to fight serpents, and will just continue to ignore those...
I had no idea how to add that (and now know what Mirages means), but if it's easy, it could be worth this small update.
2) "Bread and games" status, in a city state with Arena makes Arena fights paid more. Looks like maybe 30% to me, but the info should probably be added.
Anyway, here's my ugly code for clear statements, which could use even more cleanup than the original one :)
I hope you'll consider it, my goal is just to stop people from being confused.
And yeah, people focus on their company, not on settlement X or Y : mercenary is a pretty selfish job !
local generateColoredString = function ( nameAmountPair ) {
//convert float into integer %
local difference = nameAmountPair.amount > 1 ? (nameAmountPair.amount - 1) * 100 : (nameAmountPair.amount - 1) * -100
local diffPct = difference.tostring() + "% "
local lessOrMore = nameAmountPair.amount > 1 ? "more" : "less"
local badColor = this.Const.UI.Color.NegativeValue + "]"
local goodColor = this.Const.UI.Color.PositiveValue + "]"
local color = lessOrMore == "less" ? badColor : goodColor
//this could use cleanup :/
switch(nameAmountPair.name) {
// Settlement sells at higher prices
case "BuyPriceMult":
color = lessOrMore == "more" ? badColor : goodColor
//return "Selling items to you for " + lessOrMore
//return "Selling items to you for " + lessOrMore
//return "" + lessOrMore + " cost for buying items here"
lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher"
return "" + lessOrMore + " items costs"
case "SellPriceMult":
//return "Buying items from you for " + lessOrMore
//return "" + lessOrMore + " profit from items you sell here"
return "" + lessOrMore + " profits from selling items"
case "FoodPriceMult":
color = lessOrMore == "more" ? badColor : goodColor
//return "Buying and selling food for " + lessOrMore
lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher"
return "" + lessOrMore + " food supplies buying and selling prices"
case "MedicalPriceMult":
color = lessOrMore == "more" ? badColor : goodColor
//return "Selling medical supplies to you for " + lessOrMore
lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher"
return "[color=" + color + diffPct + "[/color">" + lessOrMore + " medical supplies prices"
case "BuildingPriceMult":
//return "Buying and selling building materials for [color=" + color + diffPct + "" + lessOrMore
lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher"
return "[color=" + color + diffPct + "[/color">" + lessOrMore + " building materials buying and selling prices"
case "IncensePriceMult":
//return "Buying and selling incense for [color=" + color + diffPct + "" + lessOrMore
lessOrMore == "less" ? lessOrMore = "lower" : lessOrMore = "higher"
return "[color=" + color + diffPct + "[/color">" + lessOrMore + " incense buying and selling prices"
case "RarityMult":
if (lessOrMore == "less") { lessOrMore = "fewer"; }
return "[color=" + color + diffPct + "" + lessOrMore + " items for sale"
case "FoodRarityMult":
return "[color=" + color + diffPct + "[/color">" + lessOrMore + " food for sale"
case "MedicalRarityMult":
return "[color=" + color + diffPct + "" + lessOrMore + " medical supplies for sale"
case "MineralRarityMult":
return "[color=" + color + diffPct + "[/color">" + lessOrMore + " minerals for sale"
case "BuildingRarityMult":
return "[color=" + color + diffPct + "" + lessOrMore + " building materials for sale"
case "RecruitsMult":
if (lessOrMore == "less") { lessOrMore = "fewer"; }
return "[color=" + color + diffPct + "[/color]" + lessOrMore + " recruits are available"
}
// failover, should ever be needed
return nameAmountPair.name + " " + difference + "%."
}
It is a STEAM installation, but it is not in the default location (as that sometimes causes conflicts with Programs folder or whatever), all my games installed to a custom folder.
When I hover over any settlements I dont see any changed tooltips or info- not sure what I'm doing wrong I simply pasted the zip into the data folder like the rest. Should this work with existing campaigns? I only have the basegame no DLC installed thanks
I haven't tested on a non-DLC version but I'm pretty sure that shouldn't be the cause of any issues.