- Joined
- Dec 9, 2014
- Messages
- 92
Hi,
When a unit is spawned in my map I give it an expiration timer of 120 seconds. However when the unit reaches a region I am using 'replace unit using the old unit's relative life and mana' (ship turns to land unit) and the replaced unit does not have the expiration timer.
How can I detect and transfer over the remaining expiration time, is there any way to do this? I thought about using timers for each unit that updates the remaining time in a hashtable for each but that seems demanding since there will be 100s of units on the map at any one time. Is there an alternative where I can replace the units model and keep the timer?
When a unit is spawned in my map I give it an expiration timer of 120 seconds. However when the unit reaches a region I am using 'replace unit using the old unit's relative life and mana' (ship turns to land unit) and the replaced unit does not have the expiration timer.
How can I detect and transfer over the remaining expiration time, is there any way to do this? I thought about using timers for each unit that updates the remaining time in a hashtable for each but that seems demanding since there will be 100s of units on the map at any one time. Is there an alternative where I can replace the units model and keep the timer?