HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Weird mana bug

08-02-2004, 11:49 PM#1
th15
This is what's happening: My non-hero units have a dummy ability based off roar that costs 15 mana to use. Whenever used, a trigger that runs when "A unit has finished casting an ability" does the actual spell effect. Unfortunately everytime I use the spell the unit's mana gets set to (Max unit mana - 15).

The same happens for ALL of my human units with mana-cost required spells. They NEVER run out of mana, their mana is always set to Max mana - cost of spell whenever I try to cast any spell.

All my units have max mana initial, 50 max mana and 0 mana regen.

Has anyone encountered this before? It's jsut weird.
08-03-2004, 01:53 AM#2
Arksword(sv)
I've never had this problem, but I may have a solution, (I doubt a great map maker like you would make this mistake though.) This is the only thing I can come up with now that I thought about it. Maybe you have another trigger that sets mana like that, but it has the same conditions as the trigger that executes the spell. So when the spell is cast, both triggers happen, maybe?
08-03-2004, 05:20 AM#3
BBDino
I have a feelign its your mana cost triggers, $5 it says
set units current mana = max mana - cost of spell

If your spells are using the usual mana cost fields (no trig) check
- any trigegrs that relate to casting in anyway
-any triggers that relate to casting in any way
08-03-2004, 04:27 PM#4
Anitarf
Since you are using "finishes casting an ability" (probably not related to your problem, but why don't you use "starts the effect of an ability"), the mana is certainly used up before the trigger actions run; that means, if there is any trigger that would set the unit's mana to max, that trigger must have "begins casting an ability" event, or even the order event, I don't know; these are the triggers you should check first, if you have any. An alternative is that the mana is set to (max - 15) after the spell already uses it's mana, but it seems less likely; for this, you would have to check all triggers that run on "starts the effect,..." and "finishes casting...".

It has to be a trigger problem, I mean, the game engine can't run that bad?