| 09-03-2005, 10:02 AM | #1 | |
Alright, I have a spell based off of Holy Light that heals an amount of life depending on a random number between 1 and 10. If it gets 1, the unit targeted is healed 100, and so on. I have 3 levels of this ability, each having ten numbers that give greater healing. Quote:
When the spell is cast, I made a seperate special effect trigger, which does nothing else other then make the spell more flashy. This is when we get to the problem. When I cast the second level of the ability, I seem to get the numbers from both the first and second levels. And, on the third, all three. Nothing changes between the levels, but only the healing effect. I tried changing the random numbers, having level 1 have numbers 1-10, level 2 having 11-20, and 3 having 21-30. But the same thing ends up happening. Sometimes, nothing happens at all when I cast the spell. If I didn't know any better, the spell leaks. I'm starting to think that something is wrong with the conditions, but I don't know exactly what. Can someone help? |
| 09-03-2005, 10:42 AM | #2 |
You could make this much more easier with just using something like this Set HealingEffect = Random number between 1-10 Unit - Order (Triggering unit) to damage (Triggering unit) for HealingEffect * 100 using attack type Spells and damage type Universal. Holy Light Events Unit - Unit <gen> Starts the effect of an ability Conditions (Ability being cast) Equal to Holy Light Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Level of Holy Light for (Casting unit)) Equal to 1 Then - Actions Set HealingEffect = Random number between 1-10 Unit - Order (Casting unit) to damage (Target unit of ability being cast) for (HealingEffect * 100) using attack type Spells and damage type Universal. Else - Actions Do nothing If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Level of Holy Light for (Casting unit)) Equal to 2 Then - Actions Set HealingEffect = Random number between 11-20 Unit - Order (Casting unit) to damage (Target unit of ability being cast) for (HealingEffect * 100) using attack type Spells and damage type Universal. Else - Actions Do nothing |
| 09-03-2005, 11:48 PM | #3 |
It's an easier way, but will it fix the spell from combining the random numbers into each level? That's where most of the problem is. I found something out. If I changed the random numbers to 11-20 amd 21-30, then the healing multiplier, or 100, would be multiplied by 30, or anyother number between those, healing 3000 or something around there. lol, don't want that to happen. Now that I think I'm forced to change all the random numbers back to 1-10, I will retest the spell for about 15 times, and see what results I get. EDIT: Okay, I tested the leveling, and it seems that the leak of not getting anything at all from the healing is gone, but I'm still getting the mix of levels. Is that fixable? because I can still use the spell as it is, just that you have a really low chance of getting healed 2000 or 100, and a VERY high chance of getting healed around 800, when it's suppose to be even. |
| 09-04-2005, 06:43 AM | #4 |
Your problem is that you choose a new random number in each if-then-else, so you have a 35% chance that none of the healing effects will happen, and a 1% chance that two or more of them will. First choose a fixed random number and set it to a variable, and then use that variable. It's even better if you follow Thunder_Eye's advice and don't use so many if-then-elses, but just do the thing mathematically. What's supposed to be the difference between levels anyway, if you don't want the level 3 spell to heal more? |
| 09-04-2005, 08:16 AM | #5 |
Anitarf, I did change the trigger according to what ThunderEye said. Thank you very much, my friend. I didn't say so earlier, but most of the heroes in my map, when they touch their maximum level only have about 1.5k to 3k. Level 1 Holy Light has a multiplier of 100, level 2 has 150, and 3 has 200. If I was to have lv 3 have random numbers 21 - 30, then I would get this: 21 x 200 = 4.2k health 22 = 4.4 23 = 4.6 24 = 4.8 25 = 5.0 26 = 5.2 27 = 5.4 28 = 5.6 29 = 5.8 30 = 6.0 These numbers exceed ALL of the heroes max HP. But, if I keep all the random numbers between 1 - 10, then the max number in level 3 is only 2000, which is exceptional. Therefore, the max health recovered on level 1 is 1000, and level 2 is 1500. If you think about it, all melee healing abilities do not heal a hero's HP to the max, with the exception of low level and/or low str heroes. I'd prefer having mine follow the same rules. I'm not sticking on topic really. We're all missing the main point of me making this thread. Is it possible to make the levels not have stacked chances? |
| 09-04-2005, 11:16 AM | #6 | |
Ok now I see how you want it. I would use this: Quote:
If you get confused by all the HealingEffect - HealingEffect.. It's beacause first it neutralizes the effect, and then add the healing. The only difference in them is that in lvl 1 it multiplies 1-10 with 100 and in lvl 2 1-10 with 150. You just need to do the same thing with lvl 3, just change the number to 200 EDIT: I just noticed an error in the trigger that would heal the unit, instead it would damage it. But that's fixed now. |
| 09-05-2005, 03:43 AM | #7 |
Cool, I just tested it and it worked as I wanted it. Thanks a lot, ThunderEye. |
| 09-05-2005, 09:32 AM | #8 |
No problemo ![]() |
| 09-05-2005, 09:17 PM | #9 |
What I wanted to say, but didn't quite get around to saying it, was this: if you can input the random number into the heal equation directly instead of having 10 if-then-elses, then you can also input the level of the ability into the equation without having if/then/elses. I assumed the multiplier was constant, so I thought you were supposed to use different random number ranges for different levels, however, having the skill level affect the multiplier instead of the random number doesn't change the fact that you can avoid if-then-elses. |
