• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Damage taken event for a destructible?

Status
Not open for further replies.
Level 23
Joined
Nov 29, 2006
Messages
2,482
I know there is a register damage event for units.
But is there for damaging a destructible?
As far as I know there are only two destructible events (those in trigger editor), but the best is hidden inside though.

I don't really code Jass yet, but I looked at JassCraft and couldn't find anything similiar to what I searched for there either.

I've also searched this forum, but found no match in my criteria

Is there someone who knows? Alternative solutions perhaps?
/Regards
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Yes the first one is a good idea, I know, but then comes the next problem.
Trees cant be created in different variations with that, and it would not look that fun, if all my destructibles use the same variation.

The other one, Ive though of as well, but it doesn't work for what I need it, since it can can't register damage taken. And it should, anyway, have a damage source and a unit triggering it.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
I still got your point. But you simply just can't extract a tree into a unit.
Thats the problem like Im saying, trees, do not have any mdx file variations...

I was thinking to do this with some other destrructibles, such as the Rock Chunks.
However the issue is the trees :/
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
I think he needs to detect when they get damaged instead of how much they get damaged

Even if units are ok
I dont think you can harvest them...
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Yes, its not the damage itself which is important but as Need_O2 says, I need to know when.

I was thinking of making a resource system where you can harvest 4 different resources instead of just gold and lumber (stone and food).
But for this Im using this custom system, so that when a "unit" destructible is damaged, I can set a integer variable to increase +1, and if it reaches a certain number the worker will go back to base and then back again.

But still, no other way to use all variations of a specific tree, when its a unit dummy?
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Umm unit uses harvest ability ?

Well I can't do that, since I have both gold/lumber/food/stone to harvest. And I need it to be separate from each other.
Besides, in that way you could abuse it, since you could first harvest 9 lumber and then 1 gold, and then when returning it back, gain 10 gold

You can always ask an experienced modeler to extract the variations or make you custom models.

Yea I suppose if there is no other way (I didnt plan or think to extract too much in the map you see)...
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Well yes, but still, I need a way to separate harvest lumber, from gold/food/stone/lumber.
Ive also this problem that if its food the unit is harvesting, then it should return it to the Townhall or a "Granary", and if its gold/lumber/stone, it should return it to the town hall or a "Storage Pit". But well, I know this could be separated by making the food as gold mining ability, and the rest as lumber ability. But that wont look good, when you see a worker entering a berry bush...

Also the thing about the rest (gold/stone/lumber) is that you can abuse it, and warcraft itself will never recognize if its a tree or not. Harvesting, so far has only worked on "tree", which makes it more difficult. And yes the abuse, would be that you simply targets a stone chulk first, and then goes to a nearby tree, harvesting it, and gains 10 lumber instead of 10 stone. (and vice versa)

A third thing too, is that when harvesting your peasant automatically changes his animation. And even if I tried to remove the animation tags by triggers, they're still there. (Could have been doing it wrong though. I tested to remove Ready Lumber etc, in the exact strings the world editor said they were)
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Yea that sound like a good idea... If actually tried to do a dummy spell like that using "eat tree", but didnt take advantage of that you can revive the destructible again.
However, I find more and more complications on all the new ideas.
The sound should not be be heared when eating the tree. (can remove it I suppose, but then I need to play the custom sound when the destructible shouldnt revive again.
Also, I would need it to trigger everytime the destructible dies and order the unit to attack another tree.

Hm and what if the worker is suppose to eat a tree, when another one is trying to eat the same tree (eat would referr to the "harvest system"), would make the second unit to stop.
This would mean I have to check when and who, which is targeting the tree...

Although, this systems sounds like a solution Its complicated. But if there is no other alternative, then I suppose that is what I have to try.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
i've found an other way.
use the elf ability 'Aesn' or 'Aesr' and edit the fields about mana, range of the spell, animation, during of the cast ...
and catch this event : EVENT_PLAYER_UNIT_SPELL_EFFECT, then order the unit to back to townhall
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
:eek: by using sentinel?

That wont work dude, thus there are several problems with it.
>it will make a destructible invulnerable.
>it cant be cast on a tree by "right-clicking on the tree as "harvest" and "eat tree"
>the owl wont be removed even if you change effect.
>you cant harvest a tree twice.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
:eek: by using sentinel?

That wont work dude, thus there are several problems with it.
>it will make a destructible invulnerable.
>it cant be cast on a tree by "right-clicking on the tree as "harvest" and "eat tree"
>the owl wont be removed even if you change effect.
>you cant harvest a tree twice.

No test the map and you will see what i want say but there is an effect during the cast the unit can't move with right click
 

Attachments

  • testSentinel.w3x
    16.9 KB · Views: 51
Level 23
Joined
Nov 29, 2006
Messages
2,482
Yea, but try to remove the "harvest" ability first, and you see that you cant target a tree without it. And still, I want the unit to "chop" the tree, not just stand there for several seconds being interruptable unless you press stop/hold.

It was a suggestion though, but it wont work properly.
You should be able to return "resources" even if you dont have finished casting the spell.
I mean, you should be able to return 3 lumber even if you can have 10.
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
Yea, but try to remove the "harvest" ability first, and you see that you cant target a tree without it. And still, I want the unit to "chop" the tree, not just stand there for several seconds being interruptable unless you press stop/hold.

It was a suggestion though, but it wont work properly.
You should be able to return "resources" even if you dont have finished casting the spell.
I mean, you should be able to return 3 lumber even if you can have 10.

you can fix three things :
- add to unit an item harvest ability
- catch the begin of the spell, and start a timer to know the time elapsed if the unit stop the spell
- play attack animation

But for the interruptable order you can't fix it, btw there is not only the hold and stop order, but i know it's not enough, it's just to told you
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Well Troll-Brain, I don't like your idea =)
It could be made much simpler I think (somehow) and not in your way.

Anyway, a suggestion is always a good suggestion when it inspires you to make an alternative idea. And you did so. I think, with your help, I've created the system.
(Inspiration as told).

+rep for you, and for Volvox, who was trying to help me. And I think you manage without this rep Need_O2. After all, you didnt help that much ;9

~Post Closed(?)~

/regards
 
Status
Not open for further replies.
Top