- Joined
- Nov 13, 2006
- Messages
- 1,814
if we have a map where a creep can drop 0-x item, so can drop nothing or more item, also boss can drop more item, what is the most efficient way and same time the most eye candy way to preventing the too much item on ground (this could cause lagg, also ground not visible coz of too much item and this make harder if u find something)
1.
Create a dummy unit (no attack, same look like default items model, so treasure chest) and add items to them and add ~2-5min expiration timer, if u right click then in full screen u can choose what item do u want take from treasure box dummy unit.
so boss if drop 4 item, then create this treasure box dummy unit where boss died and add all item to unit, add expiration timer to dummy unit, dummy unit owner is the killer, when dummy unit die then create another dummy unit with exp. timer but for player neutral pasive (this unit not respawn anymore) but from neutral pasive dummy treasurebox unit every player could take the items, until from 1st only the killer player.
2. make all droped item to invisble and make periodic trigger where u check what unit is currently selected, if have a unit selected to player then pick every item in 800 range, if item vs unit distance is lower than 600 then make item visible, else make item hidden
3. when items dropped add to a periodic timer, and make 2 integer array, 1 for timer (timer count back by 1 until reach 0, timer index is the added item index, if its reach the 0 then remove item) another integer array for keep track the owner, after timer lower than 60 make owner to 0, so all player can pick the item.
like:
adding when dropped items like this way
index=index+1
item_array[index]=last created item
item_owner[index] = killer player
item_timer[index] = 300
4. tell your ideea about how to make it look cool and same efficient
1.
Create a dummy unit (no attack, same look like default items model, so treasure chest) and add items to them and add ~2-5min expiration timer, if u right click then in full screen u can choose what item do u want take from treasure box dummy unit.
so boss if drop 4 item, then create this treasure box dummy unit where boss died and add all item to unit, add expiration timer to dummy unit, dummy unit owner is the killer, when dummy unit die then create another dummy unit with exp. timer but for player neutral pasive (this unit not respawn anymore) but from neutral pasive dummy treasurebox unit every player could take the items, until from 1st only the killer player.
2. make all droped item to invisble and make periodic trigger where u check what unit is currently selected, if have a unit selected to player then pick every item in 800 range, if item vs unit distance is lower than 600 then make item visible, else make item hidden
3. when items dropped add to a periodic timer, and make 2 integer array, 1 for timer (timer count back by 1 until reach 0, timer index is the added item index, if its reach the 0 then remove item) another integer array for keep track the owner, after timer lower than 60 make owner to 0, so all player can pick the item.
like:
adding when dropped items like this way
index=index+1
item_array[index]=last created item
item_owner[index] = killer player
item_timer[index] = 300
4. tell your ideea about how to make it look cool and same efficient