[JASS] an item level up system?

Level 13
Joined
May 11, 2008
Messages
1,198
just that. i've seen countless useless item systems, and some systems that were useful, usually stacking or recipe systems...a few alternate inventory systems have been intriguing but always faulty.

anyway, what i was thinking was...wouldn't it be cool to have certain kinds of items that would get stronger as time went on? but how would you deal with leveling them up? i guess there's a lot of different ways you could do this...

one idea with leveling up an item...is to increase the charge count for the item to level it up. but wouldn't this restrict it to being only for items that don't have active abilities?

another thought though, is...how do we know when to level up the item? how would the item gain experience? would we have to use our own variables to keeptrack ofexperience, andthen level up the item? and if so, what circumstances would indicate an increase in experience for the item?

i just can't really figure out exactly how to do it...and as far as i know, no one made a system like this. if you need an explanation of what i'm talking about, look at materia in final fantasy 7. it levels up with ap. so monster kills give exp and ap...right? even money...so maybe we need to simplyadd on an extra resource for use only by items to do this? and it would also use a custom bounty system for the ap or whatever we call it.
 
Level 15
Joined
Oct 16, 2010
Messages
943
Modify the custom value of the item to keep tack of experience OR create a hashtable that holds an integer value and uses the item handle as a key.

Then remove the item and create one that is exactly the same but a little better (you'd have to create multiple kinds of the same item in the object editor (one for each level)) whenever you want it to level up.
 
Level 13
Joined
May 11, 2008
Messages
1,198
hmm...yeah...the charges indicating level would have the nice advantage of improving the visual clarity in that respect. when checking ally or enemy items seeing the charge count will make it unnecessary to read the tooltip of the item itself, which would require mousing over the icon of the item.

it's a simple matter to check if item is permanent, and if so, make the item charge go up by one when you use the item to keep the number represent the item level.

well, there are a number of different item types to use, doesn't have to be permanent...was just trying to use an example. campaign or artifact would probably be best types to use for this special type of item. artifacts are only a few to deal with, and campaign are all unusable items, only one of them has abilities.

edit: it's not much...but here is what i have so far:
Code:
scope ItemManipulation initializer I
function ItemInSlotCampaign takes integer x, unit y returns boolean
return UnitItemInSlot(y, x) != null and GetItemType(UnitItemInSlot(y, x))==ITEM_TYPE_CAMPAIGN
endfunction
function GetCampaignItem takes integer x, unit y returns item
if ItemInSlotCampaign(x,y) then
return UnitItemInSlot(y,x)
endif
return null
endfunction
function SetItemAP takes integer apgain, unit hero returns nothing
local item itm=GetCampaignItem(0,hero)
call SetItemUserData(itm,GetItemUserData(itm)+apgain)
set itm=GetCampaignItem(1,hero)
call SetItemUserData(itm,GetItemUserData(itm)+apgain)
set itm=GetCampaignItem(2,hero)
call SetItemUserData(itm,GetItemUserData(itm)+apgain)
set itm=GetCampaignItem(3,hero)
call SetItemUserData(itm,GetItemUserData(itm)+apgain)
set itm=GetCampaignItem(4,hero)
call SetItemUserData(itm,GetItemUserData(itm)+apgain)
set itm=GetCampaignItem(5,hero)
call SetItemUserData(itm,GetItemUserData(itm)+apgain)
endfunction
private function f takes nothing returns nothing
if GetItemType(GetManipulatedItem())==ITEM_TYPE_CAMPAIGN then
call SetItemCharges(GetManipulatedItem(),GetItemCharges(GetManipulatedItem())+1)
endif
endfunction
private function I takes nothing returns nothing
local trigger t = CreateTrigger(  )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddAction( t, function f )
endfunction
endscope

suggestions welcome...
right now i'm trying to figure out how i want to give ap...
was thinking of trying to keep it simple... maybe make the hero actually kill a unit to gain ap, and perhaps make a ap gain table for forest monsters...lane creeps, and a table for hero levels or whatever. ideas are welcome.

after i figure out how im giving out ap i need to find out how i'm going to level up the items more exactly, for like how much ap do they need to gain levels and so on, but that's rather minor i suppose.
 
Last edited:
Top