HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[Help] A "Mining" Trigger

06-22-2008, 03:09 AM#1
deathdrivex
As title states, I'm still triggering for a while until I finish this project before I start on JASS.

The thing is, I dont see an event for when a "Destructible" is attacked and etc. I made a basic trigger for when a unit actually kills it, and everytime that specific destructible dies, it should say a message "You destroyed a rock!". Problem is, the message does not appear after destroying the rock, so I'm not sure what would the problem be.

I also wanted to check in why the damn editor DOES NOT have an event when "Event - Unit is attacking" and etc.

The result I'm going for is that, if a unit carries a Mining Pick and destroys an Ore Deposit (edited rock chuncks), item should appear at spot where destructible is destroyed and the Mining Pick loses charges. (The charges also dont drop some reason since it doesnt register the destructible dying, and the damn item drop not doing anything, and the message not popping up).
06-22-2008, 03:18 AM#2
MercyfulJester
There was some problem with using destructibles for these kinds of things, I'd suggest making the Rock Chunks a unit.
06-22-2008, 03:20 AM#3
deathdrivex
Dam...this is gonna take alot more time then...well, thanks for help anyway.

If anyone else can add-on to other methods to use, please do so.
06-22-2008, 03:25 AM#4
MercyfulJester
Event - A unit dies

Condition - Unit type of (dying unit) equal to (Rock Chunks)

Action - Create (Item) in (Position of dying unit)


Is basically how you'd go about doing it.


Edit: You could always copy/paste your triggers here, might help.
06-22-2008, 03:30 AM#5
deathdrivex
I know that, but I meant without the making it into a unit.

The only Idea I came up with was to move a unit to within a region containing the doodad. Then if player types "-mine", make the hero unit play an attacking animation facing the doodads. During that time, the unit has a chance to lose durability in the Mining Pick and also a chance to get an Ore/Rock/Etc. from the Ore deposit. And then I kill one of the Deposits showing that its been used up.

^Does this method work? Its only a "Mining" thing after all like trying to mine rocks/crystals inside Monster Hunter Freedom.
06-22-2008, 03:42 AM#6
MercyfulJester
The problem seemed to be that you cannot detect who is killing/attacking the destructible, at least with plain GUI. I don't know, if your method works for you then it works, but if the Rock Chunk would be a unit you could detect Attacking Unit and Killing Unit and whatnot. You could stop the mining unit from attacking if it doesn't have a mining pick or something too.
06-22-2008, 03:51 AM#7
deathdrivex
My method works. Requires a region though. The thing only works via if you carry Mining Pick and etc. I also set the number of times you can use a mining spot before it has no more resources. And in duetime, will have more after a long wait period.
06-22-2008, 05:58 AM#8
Veev
Just use units. The way you're doing it is sloppy and inefficient (and convoluted). Why would you ever have a player type "-mine" to mine... When they can attack a unit with a rock model. Check if the attacking unit has a mining pick, if it does, then randomize and see if they get an item... ... And even better, when the rock dies, you can create a simple trigger in JASS to revive them after a period of time... Please don't use your method. It will make me lose even more sleep at night.

I mean, you can set the custom value of each mining spot to like, a random number between 5 and 7. And each time you mine it, set custom value = custom value - 1. If custom value = -1 then remove rock ... Please, do not use your method.

I mean seriously? Typing -mine to mine? This isn't linux, you don't need to type out commands to get the effect you want
06-22-2008, 06:39 AM#9
deathdrivex
Funny, I set it to the up key on my keyboard to make it easier and it worked still. And no, I hardly used any triggering to do the stuff, very simple. :0

Also, my map already has way too many custom units that it would be a ***** to add even more for each type of rock chunk variation and etc + the different colored ones for the ores. Then even more for crystals and whetstones.