Hey guys, oddly enough, I ran into another road block about this inventory system. I got a lot of things tweaked out to my liking and its running very smoothly. I love how easy it is to add items. I got a ton of neat custom items. The thing is though when I want to take things to the next level a bit, I can't quite do it. Namely when I try to make a set, I dont know where to start.
It's too bad Anachron has been innactive for a bit, so everyone's questions about it are kind of fading away into the darkness. So I wanted to just bring this to a thread here, for anyone interested in brainstorming with me about making set items. There is virtually no documentation about it in the map, but I immersed myself in the code for a while, and I'm convinced it's functional. Not exactly sure where or how to create the sets, so lets try an example...
For simplicity's sake, we'll try 3 of the pre-made items that Anachron made in the test map. Let's say, Claws of Atack +15, Claws of Attack +15 (thats right TWO!) and Hood of Cunning. My goal is to add set bonus once you have 2/3 and additional bonuses if you get all three.
I'm not all that sure about the area of code is needed to understand the commands needed to declare a set, the req item types and the quantites, but im guessing its something like what's found in the trigger: CISet.
And for those of you unfamiliar with how Anachrons system applies item bonuses to champions, it's through a text macro or something where you just add a value to the desired field. Here's the first three right out of the "Items" trigger (which also happen to be the very items in my fantasy item set, imagine that!)
That's what items are like without any set properties. I dont' know if you are supposed to put information about any set they belong to in alongside these bases stats or if you're supposed to create the set externally and just reference the req id's and stuff in a different section.
So we know what mods to add, lets just say +extra damage for the claws, and +extra int for the helm if you complete this fancy dancy set, the trick is... how and where do we code it in?
Ok I think you guys get the idea, any help or input would go a loooong way, thanks for reading!!
It's too bad Anachron has been innactive for a bit, so everyone's questions about it are kind of fading away into the darkness. So I wanted to just bring this to a thread here, for anyone interested in brainstorming with me about making set items. There is virtually no documentation about it in the map, but I immersed myself in the code for a while, and I'm convinced it's functional. Not exactly sure where or how to create the sets, so lets try an example...
For simplicity's sake, we'll try 3 of the pre-made items that Anachron made in the test map. Let's say, Claws of Atack +15, Claws of Attack +15 (thats right TWO!) and Hood of Cunning. My goal is to add set bonus once you have 2/3 and additional bonuses if you get all three.
I'm not all that sure about the area of code is needed to understand the commands needed to declare a set, the req item types and the quantites, but im guessing its something like what's found in the trigger: CISet.
JASS:
public static method create takes nothing returns thistype
local thistype this = thistype.allocate()
set .ID = thistype.index
set thistype.instances[thistype.index] = this
set thistype.index = thistype.index +1
set .SaveTable = Table.create()
set .items = Table.create()
set .ReqIDS = Table.create()
set .ReqAmount = Table.create()
call .save()
return this
endmethod
public method addReq takes integer id, integer amount returns nothing
set .ReqIDS[.ind] = id
set .ReqAmount[.ind] = amount
set .ind = .ind +1
endmethod
//: ===-------------------------------------------------------------------
//: Add another bonus
public method incBonus takes unit u returns nothing
local integer times = .SaveTable[GetHandleId(u)]
set .SaveTable[GetHandleId(u)] = times +1
call .OnApply.execute(this, u)
static if LIBRARY_CIBonus then
call .applyBonus(u)
endif
endmethod
And for those of you unfamiliar with how Anachrons system applies item bonuses to champions, it's through a text macro or something where you just add a value to the desired field. Here's the first three right out of the "Items" trigger (which also happen to be the very items in my fantasy item set, imagine that!)
JASS:
set ci = CreateCustomItem('hcun')
set ci.class = ITEM_CLASS_HELMET
set ci.as = 35
set ci.agy = 12
set ci.dest = 'it04'
set ci.icon = "ReplaceableTextures\\CommandButtons\\BTNHoodOfCunning.blp"
set ci.name = "Hood of Cunning"
set ci.desc = "Increases attasckspeed by 35%\n and agility by 12."
set ci = CreateCustomItem('ratf')
set ci.class = ITEM_CLASS_HAND
set ci.dmg = 15
set ci.dest = 'coat'
set ci.icon = "ReplaceableTextures\\CommandButtons\\BTNClawsOfAttack.blp"
set ci.name = "Clawns of Attack +15"
set ci.desc = "This item increases your damage \nby 15 if carried."
That's what items are like without any set properties. I dont' know if you are supposed to put information about any set they belong to in alongside these bases stats or if you're supposed to create the set externally and just reference the req id's and stuff in a different section.
So we know what mods to add, lets just say +extra damage for the claws, and +extra int for the helm if you complete this fancy dancy set, the trick is... how and where do we code it in?
Ok I think you guys get the idea, any help or input would go a loooong way, thanks for reading!!