[Solved] Purely cosmetic wood gathering spell

Level 2
Joined
Dec 15, 2019
Messages
11
Hello folks !

I want to create a spell very similar to the vanilla ability Gather which allows, as everyone knows, a peasant to gather wood (and gold but it's not important there). But I want this spell to be purely cosmetic. I want my peasants to go to the nearest tree, to hit it with their axes, to go back to the lumber mill and to do it again but without giving any lumber to the player (purely cosmetic).

I am looking for an answer for 4h now and I know how to use Jass so don't hesitate to give me complicated leads.

Thanks in advance !

[EDIT]

Here is what I've already tried :
  • Set the Damage To Tree to 0 and/or the Wood Capacity to 0 (The peasant can no longer target the trees)
  • Create a trigger which detects when a tree is attacked (There is no A Destructable is attacked event)
 
Last edited:
Level 2
Joined
Dec 15, 2019
Messages
11
Hello !

Sadly I already tried that. The minimum value of this input is 1
Plus I tried to set the "Wood capacity" of the ability to 0 but the peasant can just no longer use the ability on the trees

[EDIT] I added the "What I've already tried" to the main topic
 
Last edited:
Level 8
Joined
Jul 30, 2018
Messages
434
The minimum value of this input is 1

You can put larger and smaller numbers on the field by holding down Shift when clicking, and putting 0 is quite possible. However, that ends up the peasant not ever getting its cargo full, so the pile never appears on the his shoulder and neither does he ever go to his Town Hall to return the lumber.

Anyway, gathering can be quite tricky to manipulate, since there are no trigger events for it and the conditions are not very accurate if you try to get which unit returns or gathers the resource. Maybe make the peasants be actually owned by another player and then just change their color so that they look like they belonged to right player?
 
Level 22
Joined
Feb 18, 2014
Messages
3,423
Try this :
  • Cosmetic Lumber System
    • Events
      • Unit - A unit comes within 270.00 of Lumbermill 0003 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Peasant
      • (Current order of (Triggering unit)) Equal to (Order(resumeharvesting))
    • Actions
      • Unit - Replace (Triggering unit) with a Peasant using The old unit's relative life and mana
      • Unit - Order (Last replaced unit) to Harvest Nearby Lumber
 
Level 2
Joined
Dec 15, 2019
Messages
11
Your idea is very interesting Warseeker !

Sadly, it would'nt have worked with what I planned to do. I started on a completly different system to replace this one as it seems to be unfeasible.

But thanks for your help ! (And I'm glad I learned that shift-clic trick, Sabe, thanks a lot !)
 
Level 22
Joined
Feb 18, 2014
Messages
3,423
There is also another way to do this is by setting the lumber upkeep to a higher level.
  • Lumber Upkeep
    • Events
      • Player - Player 1 (Red) types a chat message containing 1 as An exact match
    • Conditions
    • Actions
      • Player - Set Player 1 (Red) Lumber upkeep to 100
 
Top