• 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.

[Solved] Trigger not functioning properly.

Status
Not open for further replies.
Level 4
Joined
Jan 14, 2017
Messages
75
I created a trigger for a nova spell using the help of a Youtube video. Unfortunately the video was made in 2008 (when there was the 10 minute limit) and it didn't have enough time to completely show how to do all the triggers because of the limit. I created this (I labeled the cut out parts), but the game crashed when I clicked on the spell that starts the trigger:
paint.JPG
I know the constant looping can make the game crash, but I don't know how to fix it. What are the errors in the trigger?
 
Level 8
Joined
Jan 28, 2016
Messages
486
I recreated your trigger in one of my maps to see for myself if this would crash my map and it didn't (which is what I was expecting). There must be something else causing the crash when you cast the spell. What that is, I don't know.

What I did encounter was that the second loop was sort of glitching with the first; it would work but it would loop from 1 to 6 instead of 1 to 12. I changed the loop action to use a integer variable instead of Integer A and that fixed it. I've posted the code at the bottom of the post (I used a generic dummy unit and added the Flame Strike to it).

On a side note, you trigger has numerous location leaks in both loops. Take a look at Memory Leaks to help you out with future triggers. Also, you can post triggers instead of screenshots by copying the trigger as text and pasting it between [TRIGGER][/TRIGGER] tags. There's this guide which explains it better: How to easily post triggers.

  • Test
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fire Nova (Neutral Hostile)
    • Actions
      • For each (Integer TempInteger) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Point = (Position of (Triggering unit))
          • Set Position = (Point offset by 250.00 towards (60.00 x (Real(TempInteger))) degrees)
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Position facing Default building facing degrees
          • Unit - Add Flame Strike (Dummy) to (Last created unit)
          • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike Position
          • Unit - Add a 0.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation( udg_Point )
          • Custom script: call RemoveLocation( udg_Position )
      • Wait 0.40 seconds
      • For each (Integer TempInteger) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Point = (Position of (Triggering unit))
          • Set Position = (Point offset by 400.00 towards (30.00 x (Real(TempInteger))) degrees)
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Position facing Default building facing degrees
          • Unit - Add Flame Strike (Dummy) to (Last created unit)
          • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike Position
          • Unit - Add a 0.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation( udg_Point )
          • Custom script: call RemoveLocation( udg_Position )
 
Level 4
Joined
Jan 14, 2017
Messages
75
I did this, but it still crashed. Here's what I wrote:
  • Fire Nova
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fire Nova (Neutral Hostile)
    • Actions
      • For each (Integer TempInteger) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Point = (Position of (Triggering unit))
          • Set Position = (Point offset by 250.00 towards (60.00 x (Real(TempInteger))) degrees)
          • Unit - Create 1 Nova Dummy for (Owner of (Triggering unit)) at Position facing Default building facing degrees
          • Unit - Add Flame Strike (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike Position
          • Unit - Add a 0.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation( udg_Point )
          • Custom script: call RemoveLocation( udg_Position )
      • Wait 0.40 seconds
      • For each (Integer TempInteger) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Point = (Position of (Triggering unit))
          • Set Position = (Point offset by 400.00 towards (30.00 x (Real(TempInteger))) degrees)
          • Unit - Create 1 Nova Dummy for (Owner of (Triggering unit)) at Position facing Default building facing degrees
          • Unit - Add Flame Strike (Neutral Hostile) to (Last created unit)
          • Unit - Order (Last created unit) to Human Blood Mage - Flame Strike Position
          • Unit - Add a 0.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation( udg_Point )
          • Custom script: call RemoveLocation( udg_Position )
 
Last edited:
Level 8
Joined
Jan 28, 2016
Messages
486
I don't know how you did
  • Unit - Add Flame Strike (Dummy) to (Last created unit)
so I did
  • Unit - Add Flame Strike (Neutral Hostile) to (Last created unit)

That shouldn't make a difference. I made a custom Flame Strike to use in that trigger, so it's essentially the same thing. Also, you can edit posts to avoid double posting (apparently it's against the rules; there should be an option at the bottom of each of your posts).

There's most likely another trigger that is causing your crash or possibly even some data from the Object Editor (a certain unit, ability, etc.) so try basing the spell on another ability to see if that works. Otherwise, I've added a simple test map to show that it does work.
 

Attachments

  • Fire Nova.w3x
    17.6 KB · Views: 49
Status
Not open for further replies.
Top