• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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