#How can i create a modifier that feed from a kv file?
1 messages · Page 1 of 1 (latest)
I typically prefer using non-KV files and instead setting up lua tables. Because it is not an ability, you are not forced to use KV and also don't get the benefits of KV (e.g. the very usefu GetAbilitySpecialValueFor func)
So instead you can just write a lua file that sets up modifier values, and you can require the file on the modifier file to have access to it.
It's a different approach but it should work
If you insist to work with KVs still, then you'll want the LoadKeyValues() function, which you pass the path to the KV file that you want to load, then it would be loaded into lua tables (which reinforces that the above approach is better, imo)
Using KV to store values purely for a modifier adds a step you dont need
thanks a lot! I really appreciate any help, Its kind of a weird modifier that get levels based on the type of heroes that you have near or on your team, if they have beard or if they are female for example, and based on the level (that number of teammates with that trait) the values are different, i got them working setting them up on the modifier but i want to be able to retrieve that information for the tooltip so i can explain whats going on, probably i need to get into panorama i dont really know xD
How many values do you need to display on the tooltip? Modifiers have 2 properties that can return custom number values to be used in the mosifier tooltip, plus you can use any of the normal number properties in the tooltip
yeah, i was able to use Tooltip1 and 2, but i did one that have like 5 values or so
i was like super happy because once you get into the api is incredible, in my mind if i created the files correctly i was going to be able to read the values, i was so mistaken xD
Well you werent mistaken, its just not parsed to the client
sorry for my english btw
Since the localisation is all done in engine, it only reads specific parts of the modifier, so its disjointed from the modifier class itself
What I mean is, the addon_language files dont have a direct reference to the class that its creating the tooltip for, it only has the values given via KV (for abilities) or values given via properties (for modifiers)
Which is why if you have a modifier.value, you cant display that in the tooltip using the addon_english file
yeah i was thinking of that, because with the properties and tooltip its a breeze so what you are saying have total sense now
You can use panorama to fix this and display whatever you want
ill check panorama them, hiding the modifiers and appling the icon and tooltip with panorama, time to learn... again xD