| 06-24-2003, 06:29 PM | #1 |
Sometimes it would be necessary to change the way damage is calculated. I wanted to change the damage system to the one of Warcraft II. The problem is that I was unable to find any trigger/Jass script that: 1) returns the "last received damage" of a unit 2) returns the minimum damge, the maximum damage and the armor of a unit What I want to know is whether this is possible or not and if it is a little help on how to achive it. If I know these thing I would be able to change the damage system (at least I hope I could then). |
| 06-24-2003, 06:41 PM | #2 |
Guest | Um, I guess you could use some weird, modified Thorns aura. Other than that, I have no idea. |
| 06-24-2003, 07:31 PM | #3 | |
Quote:
This can also be a way, but I want to try the thing i figured out. |
| 06-25-2003, 01:59 AM | #4 |
hmm good idea..thorns aura would kinda be the way..but using ur way..i never seen this work before..could you do a thorns aura made with JASS which could return minimum damage? |
| 06-25-2003, 02:15 AM | #5 |
Guest | Look in blizzard.j and common.j Its in one of those. |
| 06-25-2003, 03:50 AM | #6 |
Well... Let's check this out... It's a rather difficult method.. But it might work.. I tried this with someone else and after some manipulation I believe they got it to work... Ohh.. That's right.. Someone wanted to know about how to create a mana shield.. Lemme see if I can find the data and info I gave him.. Looking.... Code:
damage = healthvar - health of unit after being attacked; if manaleft > damage manaleft = manaleft - damage; else damage = damage - manaleft; manaleft = 0; healthleft = healthleft - damage; healthvar = healthleft; Found it... I gave that to him. :) Basically.. To get healthvar, you would have to stor health's in an array.. Then have them accessed whenever someone attacks them.. Then they update it whenever they regain any health or when they get attacked or whatever.. Like I said.. it's tedious.. And would actually be more work than anything. (Bear in mind the system above after the damage = is based about having a mana shield...) |
| 06-25-2003, 06:43 PM | #7 | |
Quote:
I haven't found any funtion that returns what i search. @playamarz: I think I understand what you mean. I should store all damage and armor values into arrays. That would be a pain in the ***. I think about it. |
| 06-26-2003, 12:40 AM | #8 |
Yeah man.. it would be too much of a pain in the arse to do actually.. Or.. I just thought of this.. have the unit dmg at a 1-1 dmg.. Then when "unit attacks other unit" Take away certain dmg.. based off unit blah blah blah.. |
| 06-26-2003, 04:59 AM | #9 | |
Guest | Quote:
The intire game engine is programmed into those. From picking up items, to starting units, to gravity, its all in those. Just make sure that what your searching for is correct. |
| 06-26-2003, 06:09 PM | #10 | |
Quote:
I know this already! But I found nothing I asked here (read the first post). @playamarz: Your system works fine for a specific unit, but when it comes down to a generic change there is one problem: How can I get at least the unit type of the attacker? |
| 06-26-2003, 06:36 PM | #11 | |
Guest | Quote:
|
| 06-26-2003, 06:37 PM | #12 |
Very helpful, SpectreReturns. Instead, can't you tell me a function name? |
| 06-26-2003, 06:45 PM | #13 |
Guest | Nope, cus I dont know it, I just know that its in there. |
| 06-26-2003, 07:35 PM | #14 |
I can only tell you the following: 1) I cannot find anything that looks like what i search for. 2) Why should Blizzard work hard to create such a function if they don't enable it in the Editor as trigger? Blizzard added all functions that make sense in triggers to the editor. 3) Maybe some Jass-professional knows the answer. 4) How did you your Damage system in that project you posted in a thread here (basically I understood how it works, but how do you identify the attacker and how do you access the unit attacked and so on)? I thought about these things and the only thing left is that I need to know the type of the attacking unit. There is unfortunately no unit event "Unit attacks another unit". |
| 06-26-2003, 11:01 PM | #15 |
It's rather simple.. But don't look only in the events.. It's located in the... Unit attacks another unit.. or A unit is attacked.. Set Variable = Unit Attacking. Then what I'd do.. Is make a dmg system.. that takes the point value in the "unit editor) Where is says Points = whatever.... Then I'd use that to identify it.. Cause yu can find the point value through some manipulation of the editor... Point value of Attacking Unit.. Something like that... |
