Alright, what did I do yesterday? Well, two things from my little list that I made recently. At least, a variant of one.
First, I wanted to make sure that when gathering or returning resources was interrupted, you could order a worker to drop the stuff at a building. When you right click a building that you own, the script will check if the selected unit has resources and whether the building is the kind of building that will accept the resource type that the unit is carrying. If it is, the unit will get the task of returning to that building and dropping the resources. If that is done, he'll go idle.
The second thing is that once a resource is depleted, it is no longer useful and only causes annoyance for the player to find out which of the 17 felled trees have wood left. Now, the object will have its alpha decrease to zero over the course of a couple of seconds. When the alpha is zero, the object is transparent and is destroyed.
I am going to change this later though. Right now, this only works for resources. I'm going to move the functionality to the worldobject script and have it apply to dead units and broken buildings too. Furthermore, I think I will make a dead-and-depleted model for those objects, like a skeleton, a ruin of tree stump. That object could then be removed more slowly. Most importantly, I now know how to make it work.
No comments:
Post a Comment