• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] WURST: Change buff on new AbilityObject (compiletime)

Status
Not open for further replies.
Level 5
Joined
Mar 5, 2015
Messages
135
So I'm trying to create an ability at compiletime (because, well, it's bloody useful), but I have some problems changing the buff of the ability.

The only methods to change the buff needs a string as parameter, but I have no idea what string it wants. Thought it just needed a buff id, but nope.

It's the method

setBuffs(int level, string value) in AbilityDefinition in AbilityObjEditing that I'm trying to use.

Any ideas what the string is that it wants?

Thanks for the help in advance :)
 
Level 5
Joined
Mar 5, 2015
Messages
135
Liked your suggestion, tried it out and was about to write that it didn't work, when I realised one last thing I had to try. So it turns out that it takes a string input, and that string input has to be the ID of the buff in string format. So if I have the Blizzard buff which is 'BHbd' it has to take "BHbd" as input :) I find it a bit weird, because it doesn't seem to practical if you generate an ID for a new buff, because I can't seem to find a way to convert the ID to string format.

However, I found out about all of this from your suggestion, so thanks a lot ;) And it'll be useful for the future.
 
Level 5
Joined
Mar 5, 2015
Messages
135
Liked your suggestion, tried it out and was about to write that it didn't work, when I realised one last thing I had to try. So it turns out that it takes a string input, and that string input has to be the ID of the buff in string format. So if I have the Blizzard buff which is 'BHbd' it has to take "BHbd" as input :) I find it a bit weird, because it doesn't seem to practical if you generate an ID for a new buff, because I can't seem to find a way to convert the ID to string format.

However, I found out about all of this from your suggestion, so thanks a lot ;) And it'll be useful for the future.

Update on this:
Stumpled on an example where method setBuffs() was used.

It turns out that within in the ObjectIds package there is an int extension function int.toRawCode() which turns the ID to the string format which you need. Rather simple, just took a bit long to figure out, so I'll probably make a PR and get the some documentation on that.

Thanks again
 
Status
Not open for further replies.
Top