• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] [SOLVED] My custom scaling fireball sometimes crashes the game

Level 3
Joined
Apr 22, 2019
Messages
16
For some explanation of what my variables are and such:

  1. FireballDamage is a real variable meant to store the damage ammount based on certain ''stats''
  2. FeralDruid is a unit variable defined when picking a certain hero
  3. HeroSpellPower is an array tracking my ''custom stat'' over 6 different Heroes
  4. FireballScaling is an array defined in map int where FireballScaling[1] = 0.5 [2] = 1 [3] = 2
11041bd7-1719-48ff-9a26-57f60ab25c51.jpg


Now for the issue, for most of the time it works correctly with the damage ammount on the spell, but after a varying ammount of casts the game crashes and i can't figure out what the issue might be.

I'm an amateur at using GUI and know little to none about JASS, i use a few custom scripts here and there to remove TempLoc and such.
Anyone with more experience able to give a helping hand of explaining what might be happening here? If you need more information i'm happy to share!
 
Now for the issue, for most of the time it works correctly with the damage ammount on the spell, but after a varying ammount of casts the game crashes and i can't figure out what the issue might be.
I would be careful with modifying fields in response to that Event since the ability has already "started it's effect". Warcraft handles things like this in stages and the timing can be very important. I'm not saying that's the reason why it crashed, but it's something to think about. Crashes are often due to infinite loops or by providing a bad value (a negative timer interval for example).

With that in mind I would try a solution like this:
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Fireball (Fire Druid Night Elf)
  • Actions
    • Set Variable Abil_Lvl = (Level of (Ability being cast))
    • Set Variable Abil_PN = (Player number of (Owner of FeralDruid))
    • Set Variable FireballDamage = (FireballScaling[Abil_Lvl] x HeroSpellPower[Abil_PN])
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • FireballDamage Greater than 0.00
      • Then - Actions
        • Ability - Set Ability: (Unit FeralDruid's Ability with Ability Code: Fireball (Fire Druid Night Elf))'s Real Level Field: Initial Damage ('Esh5') of Level: (Abil_Lvl - 1) to FireballDamage
      • Else - Actions
        • Game - Display text to (All players) with message: WARNING, TRYING TO SET BAD FIREBALL DAMAGE!
1) The Event happens prior to the effects being executed.
2) We ensure that we aren't trying to provide a "bad" amount of damage to the ability.
3) I use some more variables for the sake of clarity but maybe they'll help. I never liked using (Triggering player) in these types of Events.


Also, here's how you can post your trigger instead of using a picture (please do this in the future):
 
Last edited:
Thanks for response!

I will try out this trigger now and test around for awhile and see if a crash occurs or not.
Another quick question, do you suggest using Begins casting abillity or starting effect event if i base a spell of Channel abillity?, if it matters the spell is consider as intant no target

I will look into the ''How To Post Your Trigger'' and do that for any future Trigger issues i might stumble upon.

Best regards.
 
Last edited:
Another quick question, do you suggest using Begins casting abillity or starting effect event if i base a spell of Channel abillity?, if it matters the spell is consider as intant no target
So the Event "Begins casting" occurs almost immediately but it depends on the type of ability:

1) For a targeted ability like Storm Bolt, it will happen the moment you get into range of your target.
If you're already in range then you'll also need to turn to face your target (there's some leeway afaik).

2) For an instant ability like Thunder Clap, it will happen the moment you press the ability button.

Also, the Event happens at the same time that your "Cast Point" begins:
1754471216697.png

If you're unaware, Cast Point is a field you can find on each Unit which determines how long they have to wait before casting a spell. It exists to help sync the unit's cast animation with their spells, so for example the Archmage's staff will be fully extended outwards when it comes time to summon a water elemental.

This Cast Point and more importantly the Ability you were trying to cast can be interrupted with a new order like "Stop". This means that the "Begins Casting" Event is often dangerous to use for custom spells since the user can control it and cause it to run on command (cast, cancel, cast, cancel, etc). My above trigger is an exception since the Actions don't produce any negative outcome when spammed.

So you should almost always be using "Starts the effect of an ability" unless you're doing something special.

Sadly the crash seems to stil occur so i'll have to keep investigating into my map.
Some other things to rule out:
1) Bad model, remove any custom art from the ability. These can cause all sorts of unexpected behavior.
2) Other triggers interfering. This one is unlikely since you'd expect the crash to happen on the first cast if this were the case.
 
Last edited:
Okey so after trying around and googling for awhile i found an old post that might be usefull to limit down my issue.

I forgot to mention my spell is based on Shadowstrike to make the spell a targeted abillity without a stun (only way i found how to)



DoT spells with 0 damage interval would cause extreme lag, so massing them would most probably cause a crash...

Dr Super Good

This is most prominent with shadow strike. Its interval is its casting time field or something unusual so people foolishly think 0 casting delay is instant cast whereas the spell is always instantcast but it causes a heavy lag loop for the duration of the spell (especially as it deals 0 damage so runs all on damage events for the target). This does not cause a crash usually but can slow the system down into an unresponsive state (sort of a crash but could potentially get out of it with enough time).
Decay Power is set to 99999
Decaying damage 0
Initial Damage 0
Movement speed factor 0
Casting time 0
Duration Normal & Hero 0.001

Can this perhaps be creating my issue?
The crash seems to be popping up a window basicly saying the game has stop responding and not technicly insta crash.
 
The issue is almost certainly related to the really low Duration value. I would switch to Acid Bomb and set the Duration to say 0.10 seconds.

Or, if you're comfortable with triggers you can use custom triggered missiles. I provide an easy to use example here:
That links to a great system and here's an even easier to understand example on how to use it:
  • Fireball Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YOUR ABILITY
    • Actions
      • -------- Missile Properties: --------
      • Set VariableSet MissileSource = (Casting unit)
      • Set VariableSet MissileTarget = (Target unit of ability being cast)
      • Set VariableSet MissileOwner = (Owner of MissileSource)
      • Set VariableSet MissileModel = Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
      • Set VariableSet MissileCollision = 75.00
      • Set VariableSet MissileStartZ = 60.00
      • Set VariableSet MissileFinishZ = 60.00
      • Set VariableSet MissileSpeed = 900.00
      • -------- Arc should be between 0.00 and 80.00: --------
      • Set VariableSet MissileArc = 15.00
      • -------- Missile Events: --------
      • Set VariableSet Missile_onFinish = Fireball Missile Impact <gen>
      • -------- Launch Missile: --------
      • Trigger - Run MissileCreate <gen> (ignoring conditions)
  • Fireball Missile Impact
    • Events
    • Conditions
    • Actions
      • -------- Use the Missile variables here to manage what should happen when the Missile hits it's Target: --------
      • Unit - Cause MissileSource to damage MissileTarget, dealing 75.00 damage of attack type Spells and damage type Normal
"YOUR ABILITY" could be based on Channel or any other "do nothing" ability since the plan is to trigger all of the effects yourself.
 
Last edited:
Using Acid bomb as my base seems to work fine and i cant crash the game of the testing i had time to do for now.

I would consider this as being resolved. Thanks so much! i would like to give you +rep but i dont know how ^^
 
Back
Top