| 02-26-2008, 01:01 AM | #1 |
Hi!!! One of the projects i'm working on now is a mixture of the most known card games (magic, yu-gi-oh etc). And nothing fancy here you get 6 cards (as items) in a unit and you place them on the arena when you use them.. Monsters, buffs, debuffs, trapcards and the usuall card gaming stuff.. The problem that i came accros with this project and i'm not sure if it can be solved has to do with the armor and tha attack dmg values.. What i want to make is each armor point to cut of only 1 attack dmg point. For example: You have a unit with 10 points of attack and another unit with 10hp and 2 armor points. What i want is if the first unit (with the 10 attack dmg) attacks the second (with the armor) to inflict on it only 8 dmg (which means to take from that unit only 8hp). More mathematic: hpl -> hp lost from the attacked unit dmg -> attack dmg of the attacking unit a -> armor value of the attacked unit and the equation: hpl=dmg-a i hope that is clear (cause i asked some friends with more experience than me and it took me about an hour to make them understand this simple in my opinion thing). I tried diferrente things like messing with the gameplay constants and changing their values but i still couldn't make the armor to calculate the dmg absorbed in a real value and not in %.. Im not sure if this can be done actually and the more time i spend on this i started to beleive that it can't... I searched if there is any helpfull tutorial on this site but no luck.. though i might misskiped some tutorials that might help me or didn't noticed them.. So if you have any sudjestion or you have noticed some intresting tutorials on this matter i'll be glad to hear it. The answers that i'm expecting are in some way to change the gameplay constnats and things like that (i want to avoid triggering on that matter). * Thnx for reading this thread and helping me * * i hope i can help you too in the future * ![]() |
| 02-26-2008, 01:16 AM | #2 |
You would have to trigger it, but it wouldn't be that bad. There are plenty of attack detection engines around, find one and then you can detect whenever a unit takes damage from an attack. From there you can add life back to him based on how much armor he has (you'll also have to do some triggering so you know how much armor he has). Sorry that wasn't very specific, but you should be able to search around and figure it out ^^. Ask if you need some more details though. |
| 02-26-2008, 02:26 AM | #3 |
Or you can use hardened skin? Or is there some weird set of conditions involved with that? |
| 02-26-2008, 02:53 AM | #4 |
Hardened skin would work if you kept it inside of a disabled spellbook and updated the level on the ability to be equal to however many points of armor you have. Honestly though, you're probably better off just in total control of all of the aspects of damage detection via triggers, it opens up so many windows. |
| 02-26-2008, 03:10 AM | #5 | |
Quote:
Depends how simple he's looking to be, though, doesn't it? I mean, if it would be useful to him, of course it's better to use damage detection, but if he's looking for a simple and quick solution, then hardened skin is probably better. |
| 02-26-2008, 03:21 AM | #6 |
Maybe I'm just biased towards wanting to control every aspect of something as intricate as damage detection. :p Your point is valid though, and the option is indeed available to him if he wants to use it! |
| 02-26-2008, 02:31 PM | #7 |
First thnx for helping me and for the time you spent on my problem!!! :) From what you said i beleive it's better to trigger it... Now a friend told me an idea that involves many game caches (that have the units and their attack and armor values). He actually told me to use dummy units to dmg the attacked unit based on these values from the cache and just play the animation on the actuall attacking unit. But i thing that needs a lot of memory and if every player is attacking at least 1 time per round then i beleive it will crash or something. So i aborted this solution (without being totaly sure that i'm right) Now i have some dmg detecting engines but i haven't seen any armor detecting engines so i thought i save the unit's armor in the unit value variable or in some other variable.. But mean while i came up with some other ideas like instead of giving back the hp the attacked unit must have after the attack i could use a dummy unit for any attacked unit to take the dmg and then calculate how much dmg the real unit must take. These ways are prety similar so i'm expanding my question to if you now which of these ways is better (in memory) to use or if you have any improvements to these ways or other ways are also welcome. Thnx again for reading this thread!! |
| 02-26-2008, 03:27 PM | #8 | |
Quote:
|
| 02-26-2008, 05:20 PM | #9 |
Isn't there a function in WEU that get a units defence? That would be very easy ... |
| 02-26-2008, 07:52 PM | #10 |
or you could change the armor type %per armor. |
| 02-26-2008, 08:39 PM | #11 |
well i spent many hours on trying to find the righ combination of % numbers and stuff but there is no way to make it cut of only 1 dmg per armor point.. Unfortunately blizzard does not provide an armor calculating function in the editor otherwise it would be really easy to make this.. Anyway i did some progress using triggers and the idea with the hardened skin (which it turn out to be great) even though i wasn't very positive on that. I'll check also the systems Belphegor666 (thnx dude) sudjested and try to combine anything that is better with the progress i've done so far. What i actually have now is a custom ability (based on hardened skin) which has 20 lvls (at least so far i only have cards with max defence 20) and i give that ability to every unit. Now because there is no way to initially fix the lvl of the ability to each unit, i have to make a trigger to get it. So since there are no units that get xperience from killing and i actually don't need that feature at all in this mode i use the point value of every unit to get the ability to the right lvl. For example i've given to all the units from the object editor the custom defence ability and set the point value of every unit to the amount of armor i want them to have. So when the units are summoned a trigger sets the lvl of the defence ability equal to the point value of that unit. The problem that appeared is that the opponent couldn't see the armor value of the unit so he couldn't possibly know if he can beat that unit with one of his. The sollution was simple: i set from the gameplay constants the armor dmg reduction multiplier to 0 and then from the object editor i set the armor of the unit to the armor it should have.. In other words what i did was to disable the dmg reduction ability of the armor and just use it for visual purposes (only to show the right number in the unit stats area). I'm not posting a code for this cause i think it's easy to imagine it and because there are many factors that give to these triggers functionality that cannot be shown in the code and if someone reads only teh code will not understand what is actually happening. But if you want the code or a description of waht i did (for your project or from curiocity) i'll be glad to give it to you the best way i can!! One last thing i want to say on this is that the reason that i used the hardened skin ability way (proposed to me by Rising Dusk) to manage the armor is that when the palyers are using buff or debuff cards that has to do with armor it's easy to set the lvl of the ability and cahnge the armor and it uses very few triggers which makes it faster. I only added this last part because i thing it is a bit helpfull to those who might want to make something similar and to show all the further expantions that this way might have and all the possibilities it offers.. In other words i recomend it for something similar!!! Thnx to all the dudes that read this post and reply to it!!!!! |
