1. The long-awaited results for Concept Art Contest #11 have finally been released!
    Dismiss Notice
  2. Join Texturing Contest #30 now in a legendary battle of mythological creatures!
    Dismiss Notice
  3. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  4. Hivers united and created a bunch of 2v2 melee maps. Vote for the best in our Melee Mapping Contest #4 - Poll!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

Mining animation

Discussion in 'World Editor Help Zone' started by Majid_Ne, May 16, 2019 at 4:25 AM.

  1. Majid_Ne

    Majid_Ne

    Joined:
    Apr 30, 2019
    Messages:
    20
    Resources:
    0
    Resources:
    0
    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
     
  2. Zepher

    Zepher

    Joined:
    May 14, 2019
    Messages:
    62
    Resources:
    0
    Resources:
    0
    I don't think this is possible to my knowledge.

    Try asking @Dr Super Good
     
  3. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,194
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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.
     
  4. Majid_Ne

    Majid_Ne

    Joined:
    Apr 30, 2019
    Messages:
    20
    Resources:
    0
    Resources:
    0
    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.
     
  5. Warseeker

    Warseeker

    Joined:
    Feb 18, 2014
    Messages:
    2,313
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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 :
     

    Attached Files:

  6. The_Silent

    The_Silent

    Joined:
    Feb 4, 2008
    Messages:
    2,747
    Resources:
    155
    Models:
    45
    Icons:
    89
    Packs:
    8
    Skins:
    12
    Maps:
    1
    Resources:
    155
    Use one of the custom resource systems from the spell section.
     
  7. Majid_Ne

    Majid_Ne

    Joined:
    Apr 30, 2019
    Messages:
    20
    Resources:
    0
    Resources:
    0
    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.
     
  8. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,194
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Replace the axe hitting wood sound with that of metal hitting stone? By replace I mean in import manager.
     
  9. Majid_Ne

    Majid_Ne

    Joined:
    Apr 30, 2019
    Messages:
    20
    Resources:
    0
    Resources:
    0
    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.
     
  10. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,194
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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.
     
  11. Majid_Ne

    Majid_Ne

    Joined:
    Apr 30, 2019
    Messages:
    20
    Resources:
    0
    Resources:
    0
    Thanks it works ;)