• 🏆 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!

Harvesting Ideas

Status
Not open for further replies.
Level 13
Joined
Oct 16, 2010
Messages
731
Hi,

Looking for a bit of help or suggestions with harvesting in my map. The plan is that you are 1 hero that uses different tools for different things. My plan was that if you had a pickaxe you would be able to harvest stones and if you had an axe you would be able to harvest trees.

I was planning that you'd be able to harvest them without the correct tools but you'd get more for using the right tool. However, for what I can see you can't detect when a destructible takes damage or what unit killed the destructible (which was going to be my 2nd plan).

I've done a bit of research but I can't seem to find anything that really fits what I'm after. Does anyone have any suggestions??
 
Level 13
Joined
Oct 12, 2016
Messages
769
You could always use units with special unit classifications instead of destructables for some things, and use different "gather" abilities for different tools (Pillage comes to mind, for attacking a unit/structure).

You could tick off "Ancient" in the target list, and give the "Ancient" classification to certain things so only certain abilities work on certain things.

Hell, you could even give the hero two separate harvest abilities for trees, based on whether or not it has a pickaxe, axe, or both.
 
Level 11
Joined
Mar 9, 2017
Messages
506
Could always develop a trigger that checks if the proper tool was in the unit's inventory when the destructible was destroyed and then based on that, the trigger will give out resources
 
Level 8
Joined
Mar 19, 2017
Messages
248
Correct me if i'm wrong but you can't detect damage on destructibles, unless you make a system that registers them and track their life periodically (in this case life loss), but even then i don't know how would you access the unit that damaged the destructible.

You can use orders and spells tho. What you can do is the following to immitate harvest in an almost trigger free way:
1. Add the unit a modified Channel based ability. Why? because Channel will allows you to customize the order id, all the while providing the ability to make it invisible (but usable via triggers). Modify the ability so it is a targeting ability, with 0.0 followthrough, that only targets debris and trees, with 100~200 cast range, and you can choose to make it visible or not. If you fear that the user will continiously orders smart onto the harvestables, or will continiously stop (this is very dumb and you are basically asking the unit to stop, so this is not a bug), maybe tick the disable abilities options and add 0.1~0.5 followtrough time. You can add cooldown, mana cost (maybe simulate exhaustion w/e), etc.
2. Trigger: you have to make a trigger that tracks whenever a unit with this Channel ability orders "smart" on a target (this reorder method is competely optional, you can just hope that the user casts the Channel spell directly if you deciced to make it visible). You can also track "attack" order if you want.
Orders can track the target item, unit, or destructible (all of these are "widgets"/objects), so there is no problem here. The actions of this order event trigger should be: 1. reorder the unit to use the order id of the Channel ability (let's say "acidbomb") onto the smart ordered destructable (this will make the unit cast the modified Channel spell, so whenever you want to access a harvesting event you just have to track the "A unit starts the effect of -Modified Channel- ability", and in this other trigger you can make the comparissons to know if the caster has the right tools to harvest or not, incorporate chances, getting the killer by getting the caster, etc, you also have easy access to the target destructible via the "target destructible of ability being cast", access to ability levels, etc.); 2. damage the destructible in the second trigger ( via "set life").

Cons: this will track one spell cast at a time (read: one harvest hit), so it will not issue automatic harvesting (since grinding and harvesting is boring this is a con). Ofc you can trigger this, but complexity will arise.


EDIT: here is an incredibiliy fast made, hopefully useful, harvest "protosystem" (to be fair is just some vague idea that i needed to see if it works).
 

Attachments

  • d.w3x
    18.8 KB · Views: 45
Level 13
Joined
Oct 16, 2010
Messages
731
Thanks for the responses guys, I used the concept of the last one but instead I've created a channelled harvest ability that periodically deals damage to the tree/stone and gives resources. The idea is you can leave this channelling till the tree/stone dies then cast on something else.

Now my new problem is that it only seems to channel for about 1.5 seconds??? The follow through time has been 180 seconds, 20 seconds, 10 seconds and it makes no difference. My trigger to stop the loop fires when it finishes and stops casting, when I took out the "stops casting" event it still fires. So the spell is actually finishing?? Any idea why this would be?
 
Status
Not open for further replies.
Top