• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Trigger causes game to crash.

Status
Not open for further replies.
Level 5
Joined
May 1, 2009
Messages
52
Im attempting to create a passive ability which increases a hero's mana regeneration when their mana is below 200.

i couldnt find a way to detect when a variable stored unit's mana drops below or above 200 so i tried to work around it a bit.

mana regeneration is based on sobi mask, when i set it to a regeneration lower than 10 the game crashes as soon as my hero reaches between 190-200 mana

if i set the mana regeneration to a much higher number the game doesnt crash however instead if i regenerate mana above 200 it will force my mana back down to 200 and then remove the ability.

ex if i regenerate 50 mana per second and have 180 mana, my mana will go to 230 and then back down to 200 before the ability is removed.

i'm really confused by this behavior, if anyone knows a fix to this or just an easyer way to have an event that can detect a variable unit's mana.


  • Sell
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Selling unit)) Equal to Forge of Souls
      • (Unit-type of (Sold unit)) Equal to Mana Guardian
    • Actions
      • Set ManaGuardian = (Sold unit)
      • Unit - Move (Sold unit) instantly to Spawn
      • Trigger - Add to Mana Regeneration ACT <gen> the event (Unit - (Sold unit)'s mana becomes Less than 200.00)
      • Trigger - Add to Mana Regeneration DEACT <gen> the event (Unit - (Sold unit)'s mana becomes Greater than or equal to 200.00)
  • Mana Regeneration ACT
    • Events
    • Conditions
    • Actions
      • Unit - Add Mana Regeneration to ManaGuardian
  • Mana Regeneration DEACT
    • Events
    • Conditions
    • Actions
      • Unit - Remove Mana Regeneration from ManaGuardian
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
The only thing I can imagine is an ifinite loop. Maybe it also has something to do with sobi mask ability. This ability regenerates in percent and only works on heroes as far as I know. It's probably not that well made by Blizzard given that it only works on heroes, so there could be some other problems.

I would use a unit group instead.
A unit sells the item:
add unit to group "ManaGroup"

Periodic event every 0.1 seconds
pick every unit in "ManaGroup"
if mana > 200
set mana = mana - x
else
set mana = mana + x
 
Status
Not open for further replies.
Top