• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] "Harvest" item from trees

Status
Not open for further replies.
Level 4
Joined
Feb 7, 2015
Messages
67
I am trying to create a trigger combination to "harvest" item from trees.
Basically every time it procs, instead of getting lumber, the trigger will add an item (like a wooden log) into the harvester's inventory. I already searched and tried for hours, several alternatives i've tried :
  • Sentinel can't be used, because sentinel is hard coded to stuck into the tree until the tree dies whereas i need the tree to be alive.
  • Eat tree is no good either because it is hard coded to kill the tree.
  • Tried making multiple custom spells that is bound to target a tree only to find error message "must target a tree" whereas the tree is not selectable.
  • Tried making custom trigger which procs when an event "a destructible is attacked", but doesn't work. Only works when killed. Duh.

Of course if no solution is given probably i will just create a dummy tree unit and a spell to hit that tree. Won't be fun though with 5000 selectable trees in game :(
 
Level 11
Joined
May 16, 2016
Messages
730
I am trying to create a trigger combination to "harvest" item from trees.
Basically every time it procs, instead of getting lumber, the trigger will add an item (like a wooden log) into the harvester's inventory. I already searched and tried for hours, several alternatives i've tried :
  • Sentinel can't be used, because sentinel is hard coded to stuck into the tree until the tree dies whereas i need the tree to be alive.
  • Eat tree is no good either because it is hard coded to kill the tree.
  • Tried making multiple custom spells that is bound to target a tree only to find error message "must target a tree" whereas the tree is not selectable.
  • Tried making custom trigger which procs when an event "a destructible is attacked", but doesn't work. Only works when killed. Duh.

Of course if no solution is given probably i will just create a dummy tree unit and a spell to hit that tree. Won't be fun though with 5000 selectable trees in game :(
What about making the aoe or at least target point ability.
 
Level 4
Joined
Feb 7, 2015
Messages
67
You can dispel sentinel. So maybe dispelling it, when you add the item could be an option.
Thank you for the input, i don't know that is possible. I'm sure it could work although map will be very trigger heavy. Will test this.

If you're using 'Eat tree', you can use a 0.01 wait/timer and whenever the skill is used you resurrect the tree with its old HP.
I've tried that, but never tried ressurecting the trees. I'm sure it's possible, but i need the trees to be alive somehow. Still, thanks for the input.

What about making the aoe or at least target point ability.
It might work, i've never thought of that, probably will try that.
 
Level 11
Joined
May 16, 2016
Messages
730
I've tried that, but never tried ressurecting the trees. I'm sure it's possible, but i need the trees to be alive somehow. Still, thanks for the input.
Chip and Dale comes to help. This is spell based on Eat Tree but it doesn't kill tree until the tree gets enough damage. The damage is set in the "USE" trigger.
 

Attachments

  • Chop Tree.w3x
    17.6 KB · Views: 43
Level 4
Joined
Feb 7, 2015
Messages
67
Chip and Dale comes to help. This is spell based on Eat Tree but it doesn't kill tree until the tree gets enough damage. The damage is set in the "USE" trigger.

Thank you for your help :) your trigger has been very insightful.

I have a question though, if i have like, 100 footmen harvesting the tree with that affect the map's performance? Because the trigger clear the hash table like 100 times every second :S
I am trying to create Harvest Moon like system in W3 so i guess it may affect performance...

However even if somehow the idea of harvest moon in W3 just simply doesn't work as no trigger is capable for doing that without affecting performance, I already learn something new :thumbs_up:.
 
Level 11
Joined
May 16, 2016
Messages
730
Thank you for your help :) your trigger has been very insightful. I really learn something new :thumbs_up:.
I have a question though, if i have like, 100 footmen harvesting the tree with that affect the map's performance? Because the trigger clear the hash table like 100 times every second :S
You never achieve the event then all 100 peasants do it in the SAME time. There is a very small time range between every choping of every peasant. It enough to not overload the system. Plus I palce the condition which doesn't let you to overload the memory.

EDIT: Oh, you mean periodic problem? No as you can see the unit is added to the group and immediatly removes from it. The system clean hash only if someone is in group. It doesn't clean if no units in the harvest_group.
 
Last edited:
Level 4
Joined
Feb 7, 2015
Messages
67
You never achieve the event then all 100 peasants do it in the SAME time. There is a very small time range between every choping of every peasant. It enough to not overload the system. Plus I palce the condition which doesn't let you to overload the memory.

Yeah probably it is better to just make it as a target of point ability... I'm sure using Eat Tree will work but if i issue like, 10 peasants targeting a same tree in the same time the 9 remaining peasants will lose the target as the tree already died. Will +1 rep again but i have to +1 rep another 5 people. Thanks a lot even if in the end the eat tree probably won't not work i really learn something new :D:D
 
Level 11
Joined
May 16, 2016
Messages
730
Yeah probably it is better to just make it as a target of point ability... I'm sure using Eat Tree will work but if i issue like, 10 peasants targeting a same tree in the same time the 9 remaining peasants will lose the target as the tree already died. Will +1 rep again but i have to +1 rep another 5 people. Thanks a lot even if in the end the eat tree probably won't not work i really learn something new :D:D
Try this one.
If you use right click then all units comes to chop tree.
If you use eattree (click on ability icon and choose the target) then single unit comes.
Now the group won't loose the target.
But it still use chop only one time. However clicking on trees is kinda fun.
I also added ABILITY variable so you can import it easier.
 

Attachments

  • Chop Tree.w3x
    20.2 KB · Views: 38
Last edited:
Level 4
Joined
Feb 7, 2015
Messages
67
Try this one.
If you use right click then all units comes to chop tree.
If you use eattree (click on ability icon and choose the target) then single unit comes.
Now the group won't loose the target.
But it still use chop only one time. However clicking on trees is kinda fun.
I also added ABILITY variable so you can import it easier.

Bro i got this error. Trigger function does not exist in database : IssueTargetOrderD
I think clicking trees is going to be fun, but after chicken, cows, sheep, horses, etc i think i'm going to create autocast lol.
a66615c9-fb11-408f-a380-88b7a72c5199
upload_2017-3-20_21-42-57.png
 
Status
Not open for further replies.
Top