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

How to harvest minerals like a wisp? { Wc3, WarCraft III, wisp }

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
I´ve been struggling to get this thing to work. So I once again turn to the forums... It is a WC3 related thing, so to say, so perhaps many here knows the answear by instinct ;)

How can a worker harvest minerals like a wisp harvests tree in WC3?

The worker drills and drills and drills on the mineral patch... Unlike the Wisp, the mineral patch will lose minerals every xxx seconds and those minerals are added to the player. But the worker never carries stuff back and forth.

Optional twists:

- How can it be limited to only one worker per mineral patch? (Like only 1 wisp could be at one tree)

- Just like a green number floated in the air to indicate the wood gathered by the Wisp, can a blue number/symbol/icon/something float in the air everytime a worker collects minerals?

- How can the effectivnes of the workers be increased if there is a command center nearby?

Since I have become better with the editor, you don´t have to write everything in full detail. I just need some guidance how to make this possible..
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
Hmm... If I remember well, doodoads can have a custom value. Use that as a resource limit and make a system by triggers...

Or you can use a unit if there arent too many of those minerals. A netural invulnerable unit on which your workers can use a channelled ability, than use triggers to make the work and use unitLife as minerals left

Hope it's enough as I'm in a hurry ^^
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Triggers? Nonsense - most of the logic can be implemented via Data Editor (I suspect entirely, but I'm still learning some tricks here).

You've picked quite a tricky thing to develop here, Kabel, but I like a challenge. I have been able to implement a simple mechanism through which units auto-gather. Didn't have much time to spend on it, but I thought this might do for now.

Basically, we implement a target ability that affects only minerals (I simply replaced the SCV Gather ability then with it, so that SCVs can use it only). The ability then simply enables a channeling effect (Persistent - also used by Graviton Beam, for example). The effect never expires - notice the Persist Until Destroyed flag.

Now, every .125 seconds, this effect refreshes a special buff behavior on the target minerals. That buff behavior, in turn, activates the mineral collecting every couple of seconds (you can switch from there the duration between two collectings - see Stats:period field). The called effect is a set effect, that both alters the mineral patch's mineral amount, and gives the owner of the SCV an equal amount of minerals. Modify the amount from these two abilities.

The system also prohibits two SCVs from gathering from the same resource patch. This is done via a simple validator that checks the existence of our buff Behavior on the mineral patch (during the collecting).

There are a few restrictions to the present implementation:
- It does not restrict other workers to attempt and gather some resources at the same time.
- The flying text effect is not yet implemented. I was stubborn enough not to use triggers. You are free of course to play with triggers if you prefer, but I have a feeling there is a Data Editor solution to this (not 100% sure - maybe Dr. Super Good can shed some light here).
- SCVs do not implicitly attempt to mine fields if you right click on them. I have not tampered with this behavior yet, but I have a feeling it's rather easy to do.
- Does not implement the boosted mechanism. The main idea there would be to:
1. Make Command Centers cast an aura on all SCVs nearby
2. Create an additional behavior for collecting minerals, but faster than the first.
3. Replace the Apply Behavior effect with a Switch Effect. Depending on the presence of the aura on the worker (use validator here), apply one behavior or the other on the minerals.
4. Make sure you modify the current validator for checking if a mineral patch is being mined! Since you can have two behaviors, use a combine validator to combine two other validators that each check for one of the behaviors (for the combine, use OR).
 
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
- The flying text effect is not yet implemented. I was stubborn enough not to use triggers. You are free of course to play with triggers if you prefer, but I have a feeling there is a Data Editor solution to this (not 100% sure - maybe Dr. Super Good can shed some light here).
Apparently its an actor which generates the floating text. Atleast that was the solution someone else reached who had resource income text difficulties.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Bah... I hate actors - overcomplicates matters! Thanks for the idea though.

Kabel... here is the solution I could come up with. It's not perfect, but you can feel free to tweak it any way you want. The text at this point pops up on top of the SCV, not the mineral patch. I also fixed a problem with simultaneous SCVs attempting to grab the same mineral patch. Now it should work correctly.
 

Attachments

  • TestSCV.SC2Map
    43.6 KB · Views: 152
Level 10
Joined
Nov 5, 2008
Messages
536
Bah... I hate actors - overcomplicates matters! Thanks for the idea though.

Kabel... here is the solution I could come up with. It's not perfect, but you can feel free to tweak it any way you want. The text at this point pops up on top of the SCV, not the mineral patch. I also fixed a problem with simultaneous SCVs attempting to grab the same mineral patch. Now it should work correctly.

How can I thank you? I asked for a carrot and I got a buffé! This is more then I imagined. It works wonderful!

One silly question, how do I get the ability to activate by only right clicking on a mineral patch?

It would be perfect it each worker can just be right clicked on each individual mineral patch to start gather that particular one.

Cause right now I need to press the ability first and then target the individual mineral patch.

It is not a big deal and you don´t have to do this for me. I have tried for an hour but I can´t get it to work. Perhaps is it not possible to do with this type of ability?
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Nice one muhaha.
Kabel, no problem man. Just be careful to apply the (NotBeingHarvested) validator to Ability: Smart Validators field too. If you wish to implement the kind of standard behavior (such that the SCV changes mineral field if taken), you will probably have to do some more data editor coding - searching an available mineral patch in the area for example, but only after reaching the target and preparing to channel.
 
Level 10
Joined
Nov 5, 2008
Messages
536
I tried your method of how to make a command center increase the effectivness of workers. I could not pull it of so I developed my own method.

1. Make Command Centers cast an aura on all SCVs nearby
2. Create an additional behavior for collecting minerals, but faster than the first.
3. Replace the Apply Behavior effect with a Switch Effect. Depending on the presence of the aura on the worker (use validator here), apply one behavior or the other on the minerals.
4. Make sure you modify the current validator for checking if a mineral patch is being mined! Since you can have two behaviors, use a combine validator to combine two other validators that each check for one of the behaviors (for the combine, use OR).

I have created 2 similar abilities. (Based on Continuous Harvest you presented in your test map)

In the second ability I have replaced some of your effects and behaviours with new ones, the only difference being that they generate minerals faster.

I add both abilities to the SCV. They are both on the same command card.

I create a seach area effect which is linked to an Apply behaviour - effect. The search area effect is given to the command center. Units nearby is effected by the Apply behaviour effect which gives them a buff. When they have the buff, ability # 2 is enabled and ability # 1 is disabled. Hence, the better ability kicks in when near a command center.

1. Would this solution work? (Or would it actually be an inferior method compared to your solution?)
2. How can I disable one of the abilities on the SCV from start?


(Because the natural state of the better ability must be that it is disabled. It will only be enabled when it gets the buff from the command center aura. Perhaps it is super easy, but I can´t find a field for it. I´ve also been trying with requirements, to make a requirement disable an ability when the requirement is met..)
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Requirements are your answer. You need to use the following type of requirement for the ability enabled by the buff.

Show - Add Node - Greater Than
Add Two More Nodes - [Count Behavior, Buff, In Progress Or Better At Unit], [Constant, 0]

For the ability disabled by the buff, simply verify equality with 0 (not greater than).

To give a requirement to an ability look for the Ability: Commands field. Execute entry, select from Requirements the correct requirement.

That's all you need, and it will work the way you want it. Nice solution, though maybe a bit difficult to manage this way (I still prefer the effects approach, but that's just me).
 
Level 10
Joined
Nov 5, 2008
Messages
536
Just a minor question:

I have added the harvest ability to both the drone and probe. It works great for both of them. They harvest like a wisp.

But the "drill" animation won´t play for them when they harvest. They just look at the minerals. I´ve added the same stuff in the SCV actor to the drone and probe.

Is it something inside the ability, behaviour or the effects that needs to be changed?
Or is it just that drones and probes requires different actor changes?
 
Status
Not open for further replies.
Top