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

How to: inflict self-damage during mining.

Status
Not open for further replies.

Vex

Vex

Level 3
Joined
Dec 1, 2007
Messages
33
Hi, I'll be short and concise about my request.

I have a vulnerable mineral field and a harvester unit.

Is it possible to add some sort of property to the mineral field, so that it inflicts
damage to itself whenever mined or mineral count drops?

I'm talking about a solution that doesn't involve using a scripted listener that
triggers whenever something is mined.
Preferably some sort of behavior or other "magic tricks" using the Data Editor.

Thanks for any replies!
 
I guess it'd be possible if you made the minerals vulnerable and made a trigger to order workers to attack the minerals instead of harvest. But you would have an issue with actually acquiring minerals.

Another way is using a trigger that reads the mineral's count, bases it off of a max number, and uses a % to set the mineral's health.

But I can't think of anything that could be done with the data editor..

Maybe create a behavior that is added to the minerals every time someone gather's on it.. and the behavior damages the unit in question. You would have to do the math yourself for how much damage it would take.

So like for example if the mineral field has 1500 minerals in it, and each SCV takes 5 minerals, create a behavior that is added to the minerals (which has 1500 hp) that takes 5 health from it after the gather is completed.

I would do this with triggers. I'm not sure if it's possible with the data editor tbh.
 
  • Like
Reactions: Vex

Vex

Vex

Level 3
Joined
Dec 1, 2007
Messages
33
I see, thanks. If it's not possible with the data editor and behaviors, I think I'll just work around it another way. It's just a small part of the grand puzzle ^^
 

Vex

Vex

Level 3
Joined
Dec 1, 2007
Messages
33
Might be. I've been testing some actor events, but with no luck so far. I'll post back if I manage to make something that works.

It seems like such a trivial problem, but I really don't have much experience with the data editor.
 
Level 5
Joined
Jun 3, 2010
Messages
100
Shit! I misread that entirely, all my below post is a total waste of time. I didn't realize you wanted it to do dmg to itself lmao :(

I created a new harvest ability and attempted to link an Effect, similar to the Medivac Healbeam, that drain Life vitals and not energy; but did not actually put a heal value. I then tried to create a validator that would trigger on a unit only while harvesting. But unfortunately, it doesn't appear that you can create Target Filters, so you are limited to selecting "Worker" at best.

I'm guessing that a Trigger might run into the same problem unless you can add some sort of "Unit is Harvesting" detection. Anyways, I thought I'd share the info to provide a little more insight and also just in case someone has a workaround. :)

edit: Just had another thought, try and add a weapon to the minerals. that attack at .1 range (melee). Set the attack speed and dmg to make it work how you like.

edit: Adding an attack to the mineral fields is tougher than I thought. Everything appears in order, but something about how the Mineral Field units are setup is getting in the way of allowing them to actually attack. Anyways, while I was messing around, I realized that it would be really annoying hearing that your units are under constant attack. :D
 
Last edited:

Vex

Vex

Level 3
Joined
Dec 1, 2007
Messages
33
Hey, I found the information about the medivac thingie interesting. Like the harvest ability does a negative healing on its target, which can only be mineral fields anyway. Gonna try and check if it works.

But yeah, it may sound like a weird request. Truth to be told, I'm making a dungeon keeper type of map, and want to utilize the default worker ai for aquiring new target (resource nodes) in close range when they run out. Like every selected dirt block is converted into a mineral field with the dirt block model look and invisible mineral count. "Workers" are then sent to a bunch of "mineral blocks" to clear them out. Also going to use it for reinforcement of wall and floor cells; create invisible mineral fields without collision. When harvested or "killed" they will have a floor or wall death model that is not invisible.

Maybe not the best solution, but think it's viable ^^

Oh yeah, the reason for the request is because I want normal units to be able to attack the blocks, and its health to be modified when a worker is digging. Like a half-dug block will have 50% hp.
 
I skimmed through that quickly, gotta go soon.
From the sounds of it you can just make the unit attack the block everytime it goes to harvest.
Again, done with triggers, sorry.

Event -> Ability (gather) is used at any stage.
Conditions ->
Actions -> Issue (Triggering unit) to attack (recipient) of ability.

Can't think of the proper functions for the action right now.
Instead of triggering unit, use the function that recalls the unit that cast the ability, and for recipient use a function that recalls the targeted unit.
 
Status
Not open for further replies.
Top