• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

kind of ressources

Status
Not open for further replies.
Hello
here is my problem:
well, I want to change the lumber ressource to Amount of Cash. I already know how to do this, but I want to create many way to earn cash.
Example:
Ore = 2hit = 2 cash
Wood = 5 hit = 5 cash
Gold = 3 hit = 15 cash (It will be harvested like the lumber is)

So, I want to know how to create a unit who can harvest only ore, one who can harvest only wood, one who can harvest only gold, etc....

sorry for my bad english xD
If you want me to repeat, thanks to tell me^^
thanks to answer as soon as possible ;)


EDIT:
I forgot to say this:
I also need a way to create a building that can receive ore only, one that can receive wood only, one that can receive gold only,.........
 
Level 4
Joined
Aug 8, 2011
Messages
84
If I understand you correctly, you want to create multiple resource sources that are based off of lumber.

If this is the case, I don't think it will be possible to create buildings that only accept certain types of lumber, as there won't be any way to make that differentiation.

However, you could probably create units that can only harvest a certain type of lumber by triggering it. When a unit tries to harvest lumber, check if the target destructible is the type of resource that it is allowed to harvest, if it is not, then order the unit to stop.

You can easily create different types of lumber harvesting abilities for these units so that they harvest at different rates/have difference capacities also.

EDIT:
Now that I think about it, you could probably also catch whenever a unit tries to return lumber to a structure and check if the structure allows the type of lumber that the unit is supposed to harvest, if they aren't compatible make the unit stop.

To go a step further, when the unit is ordered to stop, you could have a system in place to order it to return its lumber to the nearest compatible drop-off point instead.
 
Level 4
Joined
Aug 8, 2011
Messages
84
I think if you check whenever a unit is issued an order (with no target?) whether the order ID is equal to "returnresources" (852020), that should be whenever the unit tries to return to a building.

I would then order the unit to "right click" the nearest acceptable drop-off point.

To find the nearest place to drop-off resources, I would add drop-off points to an array as they are built, this way you can easily go through each of the units in the array and check if it is an acceptable drop-off point and compare which is the closest.

EDIT:
If you don't want to use the array, you could just search the playable map for acceptable drop-offs that is on the unit's team, and decide which is closest.
 
Status
Not open for further replies.
Top