HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Kodo Food

06-25-2003, 10:48 AM#1
Mr. Thermistor
I need to implement a virtual instant kill when a unit is devoured by a Kodo Beast.
I remove the supply of that unit when it is devoured, yet how would I return the supply used of the player if the Kodo Beast is killed?

There will be several of these on screen and they need to be monitored individually.
06-25-2003, 09:45 PM#2
Guest
Well for the insta kill, just spell edit devour so its Data12 is '999999'.

I dont really get whawt ur trying to do for the other part.
06-25-2003, 11:04 PM#3
pvxc
I think what they mean is that they want Devour to take away the food of the unit (say the unit was a Tauren, they would have 5 food taken up, but when the kodo dies, the food returns.

You could put the Kodos in a unit array, and make corresponding integer array, where the Kodo is added into the unit array, and gets a corresponding part in the integer array (using same index).

Then, when the unit is devoured (use the instakill above), to take away the food, place a unit of the same unit-type in some corner, and HIDE it, putting it into another array with same index as the devouring kodo in the Kodo array and integer array. When the Kodo dies, remove the Hidden unit.
06-25-2003, 11:16 PM#4
dataangel
Kodos are ground units. This means that if you change their flying height, it has no effect in game.

Setup a trigger to detect say, a tauren being devoured. Remove the supply for that unit, and set the kodo's flying height to its current flying height + 5. Then detect when a kodo dies, and set the player's supply to be their current supply + flying height of kodo. This way the flying height stores how much supply the kodo has eaten, and when the kodo dies all of that supply is returned.

To 'return' the supply at that point, do something like pvxc did. Just do "Unit Create (flying height of kodo) custom unit that takes up 1 food." Then add another trigger, Custom unit that takes up 1 food enters playable map area, hide entering unit.