• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Mining animation

Status
Not open for further replies.
Level 2
Joined
Apr 30, 2019
Messages
20
Hi, I have downloaded gold ore model and replace gold mine model with it.

I'm wondering is anyway to stop workers and peons from default mining and do another thing ?

Let me explain.

As default , they go inside the mine take gold (10 golds) and get out and return to base.
I don't want they enter mine as its new model is an gold ore.

I want something to make them play their working animation for 10 times and then return back with gold
Like tree chopping.

Please help me
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
Not directly possible in Warcraft III. You will need to trigger the desired mechanics which is not a trivial thing to do.

For a trigger based system you will need a system to represent units carrying resources. This would mean mapping some sort of structure to the unit which contains information such as how much gold they are carrying. To make it look like the worker is carrying gold you will either need to change its animation prefix/suffix to use the gold carrying animations, if that is possible, or use a custom gold sack model which you attach to the unit by triggers and keep track of with the carrying structure. When the worker is ordered to a gold drop off and is near the point you will need to clean the carrying structure from it and give the player the appropriate amount of gold.

Then you need a system to do the actual mining. The simplest would be to pause the unit in place for some amount of time when ordered to the gold ore and near it. During this stage it is made to face the gold ore and loops the mining animation. After the desired amount of time passes then gold is removed from the gold ore unit (if possible) and the worker is given the previously described carry structure to represent that it is now holding gold.

Finally a system is needed to automate this process so the workers go to the gold ore to mine and back to the nearest gold drop off point. This may require keeping track of which workers are automated and to which mines they work.

Now on top of the above full trigger solution there may be a hacky hybrid approach one could try. If one can detect when a unit enters a gold mine then one could make the gold ore a fake gold mine with near instant gold pickup. When a unit picks up gold from the gold ore you then pause them, make them face the gold ore and play their mining animation for some amount of time. After that time expires you unpause them and if necessary order them to return resources. This would allow one to use the standard gold carrying system instead of having to trigger ones own which could reduce the required work considerably, however there may be technical issues with this approach.
 
Level 2
Joined
Apr 30, 2019
Messages
20
Not directly possible in Warcraft III. You will need to trigger the desired mechanics which is not a trivial thing to do.

For a trigger based system you will need a system to represent units carrying resources. This would mean mapping some sort of structure to the unit which contains information such as how much gold they are carrying. To make it look like the worker is carrying gold you will either need to change its animation prefix/suffix to use the gold carrying animations, if that is possible, or use a custom gold sack model which you attach to the unit by triggers and keep track of with the carrying structure. When the worker is ordered to a gold drop off and is near the point you will need to clean the carrying structure from it and give the player the appropriate amount of gold.

Then you need a system to do the actual mining. The simplest would be to pause the unit in place for some amount of time when ordered to the gold ore and near it. During this stage it is made to face the gold ore and loops the mining animation. After the desired amount of time passes then gold is removed from the gold ore unit (if possible) and the worker is given the previously described carry structure to represent that it is now holding gold.

Finally a system is needed to automate this process so the workers go to the gold ore to mine and back to the nearest gold drop off point. This may require keeping track of which workers are automated and to which mines they work.

Now on top of the above full trigger solution there may be a hacky hybrid approach one could try. If one can detect when a unit enters a gold mine then one could make the gold ore a fake gold mine with near instant gold pickup. When a unit picks up gold from the gold ore you then pause them, make them face the gold ore and play their mining animation for some amount of time. After that time expires you unpause them and if necessary order them to return resources. This would allow one to use the standard gold carrying system instead of having to trigger ones own which could reduce the required work considerably, however there may be technical issues with this approach.
Thanks for reply.

I found another way that it works probably good.
Since in my map i don't use lumber I switch gold and lumber icons and name ( actually i removed lumber from map ) and change model of trees to gold ore. it looks he's mining.

Only problem i got is that peons and peasants carry lumbers not gold bag.
 
Level 29
Joined
Feb 18, 2014
Messages
3,584
Only problem i got is that peons and peasants carry lumbers not gold bag
I'm afraid you will have to modify their work animation manually. Which means duplicate their gold harvesting animation and rename one of them to Stand Lumber, Attack Lumber, etc...

Here's an example of a peasant carring a gold bag when harvesting lumber :
 

Attachments

  • peasant.mdx
    160.5 KB · Views: 30
  • peasant_Portrait.mdx
    35.9 KB · Views: 27
Level 2
Joined
Apr 30, 2019
Messages
20
Thanks guys now i have peasant and peons mining.

But now i think it will good to change mining sound. It's like chop woods , Any idea ?

I got mining sounds already.
 
Level 2
Joined
Apr 30, 2019
Messages
20
Replace the axe hitting wood sound with that of metal hitting stone? By replace I mean in import manager.

I try it by importing , but every time I save map and test it , no sound play , In world editor when I play sound in sound editor it's replaced by default one.

Before I save map , I test sounds and they were replaced by my mining ones.

I'm so confused at this. :eek:

Files are WAV , the same name and path , but not works.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
Files are WAV , the same name and path , but not works.
My previous post stupidly assumed it was part of the peasant animation. It is actually a combat hit sound which one can easily change.

Try changing the "Combat - Armor Type" of the Gold Ore destructable to be "Stone". Then change the "Combat - Attack 2 - Weapon Sound" of the worker unit to something like "Metal Light Chop" or "Metal Medium Chop" depending on how burly the worker unit is.

Note that there appears to be some minor bug with combat sound playback. It might not always play the hit sound in the tests I ran, but at least when it does it sounds like a pick hitting stone rather than an axe hitting wood.
 
Status
Not open for further replies.
Top