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

[Trigger] 1 spell works 1 don't

Status
Not open for further replies.
Level 6
Joined
Sep 13, 2008
Messages
261
I have two scripts that are based off the same ability. One was from a tutorial the other was mine.

This is the one from the tutorial it is on hit when holding item.
  • Fire Circle
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacking unit) has an item of type Fire Amulet) Equal to True
    • Actions
      • Set Chance_Fire_Circle = (Random integer number between 1 and 5)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Chance_Fire_Circle Equal to 2
        • Then - Actions
          • Set Distance = (Facing of (Attacking unit))
          • For each (Integer A) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set Distance = (Distance + 30.00)
              • Unit - Create 1 Dummy Alpha for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Distance degrees
              • Unit - Add Fire Circle to (Last created unit)
              • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Last created unit)) offset by 256.00 towards Distance degrees)
              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
        • Else - Actions

This one is when I use an ability. I based it on divine shield. It only shows one skill instead of one in each direction like the first script.
  • Blood Nova
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Blood Nova
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Set Distance = (Facing of (Casting unit))
          • For each (Integer B) from 1 to 12, do (Actions)
            • Loop - Actions
              • Set Distance = (Distance + 30.00)
              • Unit - Create 1 Dummy Alpha for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Distance degrees
              • Unit - Add Blood Circle to (Last created unit)
              • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Last created unit)) offset by 256.00 towards Distance degrees)
              • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
        • Else - Actions
If you can fix the script or explain why it won't work I thank you. I'm not worried about leaks it's a small map between friends.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
You have no condition, I ain't sure but I realy think you need a condition. (In the If/Then/Else action).

You could also just remove the If/Then/Else action and make it like this:
  • Actions
  • Set Distance = (Facing of (Casting unit))
  • For each (Integer B) from 1 to 12, do (Actions)
  • Loop - Actions
  • Set Distance = (Distance + 30.00)
  • Unit - Create 1 Dummy Alpha for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Distance degrees
  • Unit - Add Blood Circle to (Last created unit)
  • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Last created unit)) offset by 256.00 towards Distance degrees)
  • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
 
Level 9
Joined
Oct 28, 2007
Messages
435
Are the two dummy abillities the same (did you copy one from the initial one) else you could have missed something like: to0 large mana cost for the dummy unit, or not far enought cast range...

Try adding the action that each time it activates it displays the game message like BLA or something.You can then realise where the fault is, the trigger might not even run!

BTW: Make it on ability effect! Else you can get some other wierd bugs and people can fudge it sometimes (cast the ability, but not lose mana or anything)
 
Level 6
Joined
Sep 13, 2008
Messages
261
Are the two dummy abillities the same (did you copy one from the initial one) else you could have missed something like: to0 large mana cost for the dummy unit, or not far enought cast range...

Try adding the action that each time it activates it displays the game message like BLA or something.You can then realise where the fault is, the trigger might not even run!

BTW: Make it on ability effect! Else you can get some other wierd bugs and people can fudge it sometimes (cast the ability, but not lose mana or anything)

The effect definitely goes in the first one does ill add it in to see how many execute.

I based off the same skill for activation with no mana cost etc.

I also tried adding in a condition and that didn't help. I'll post up shortly how many times it triggers.

The ability triggers all 12 times but the direction of the Projectile doesn't change.


EDIT:
Both the dummy abilities are based off of locus swarm. The only difference in the ability is the missile art which i changed from Black dragonwhelp to a blood model.

Again I repeat spell triggers 12 times, only 1 projectile seems to be there. First skill works fine second skill is the one I have the problem with.


EDIT2:
Bump. Map is nearing being finished. Would really like to sort it out before the end. :pal:
 
Last edited by a moderator:
Level 17
Joined
Jun 12, 2007
Messages
1,261
Oh I think I found it!

You use, for each (Integer B).
But u never fill in any Integer B.

I gues removing the if/then/else condition, and the each integer B should also be removed. That way it should work I gues.

You also use it in the upper trigger, I'm not familiar with that action since I never use it, but it makes sence to me.
 
Level 6
Joined
Sep 13, 2008
Messages
261
Oh I think I found it!

You use, for each (Integer B).
But u never fill in any Integer B.

I gues removing the if/then/else condition, and the each integer B should also be removed. That way it should work I gues.

You also use it in the upper trigger, I'm not familiar with that action since I never use it, but it makes sence to me.

Read the title the first ability works and the second doesn't.
I can remove the for each integer B but then i have to add an extra twelve sets of actions for one spell.

As far as I know I can't specify and integer B, but if you know how let me know.

Please read whole post before offering suggestions on how to fix it.

Edited In
The second trigger triggers 12 times correctly it just casts the ability in one direction instead of in seperate directions each of the 12 times.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Another possiable cause is the dummy unit not rotating fast enough to cast it so it dies before it is in position to cast. I doubt this thou.

Also use the event begins effect of an ability, maybe that is the reason.

Finally also make sure the ability can actually be cast on the ground, maybe you changed the targets which have made it unable to be cast.
 
Level 6
Joined
Sep 13, 2008
Messages
261
Thanks for suggestions but it is supposed to create 12 seperate dummies all casting in a different direction.
And it does activate all 12 actions, so i don't think it would be begins effect of an ability problem.
I'll double check the skill but I think it's same base ability.

Edited In
I checked the abilities. The dummies are all casting ability based off of locus swarm only difference is name and missle art.
 
Level 6
Joined
Sep 13, 2008
Messages
261
why not just make the second trigger just a loop instead of a if then else statement with no condition would be easyer

I thought (For Each Variable)action was GUI's version of looping an action.

Edited In
I have alot of leaks in my map and removing leaks isn't that important to me since this is just a map for friends while I learn to map. Leaks will be removed last if, and win I release map to the public.
 
Last edited:
Level 6
Joined
Sep 13, 2008
Messages
261
it is im saying keep it all the way you have it just remove the if then else because you dont have a condition so its point less to have

After I make it work like the first spell, I will worry about removing unnecessary parts. I prefer to change as little from original ability as I can till this one works.
 
Level 6
Joined
Sep 13, 2008
Messages
261
you wont be changing really anything from the first one cuz your just using it for the actions so its not going to matter but you should try it to see if it will work


I modified the trigger, it now does exactly the same thing.
It now looks like this after ur suggestion.
  • Blood Nova modified
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Blood Nova
    • Actions
      • Set Distance = (Facing of (Casting unit))
      • For each (Integer B) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Distance = (Distance + 30.00)
          • Game - Display to (All players) for 30.00 seconds the text: Blood Nova Has been...
          • Unit - Create 1 Dummy Alpha for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Distance degrees
          • Unit - Add Blood Circle to (Last created unit)
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm ((Position of (Last created unit)) offset by 256.00 towards Distance degrees)
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
 
Level 6
Joined
Sep 13, 2008
Messages
261
Also use the event begins effect of an ability, maybe that is the reason.
QUOTE]

Problem solved. Indeed that was the reason. It did not keep it from triggering but for some reason(probably the time it takes to spawn units) it kept it from spawning anymore than one unit.

The new trigger looks like this.
  • Blood Nova
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blood Nova
    • Actions
      • Set Distance = (Facing of (Casting unit))
      • For each (Integer B) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Distance = (Distance + 30.00)
          • Set TempPoint[1] = (Position of (Casting unit))
          • Unit - Create 1 Dummy Alpha for (Owner of (Casting unit)) at TempPoint[1] facing Distance degrees
          • Unit - Add Blood Circle to (Last created unit)
          • Set TempPoint[2] = (TempPoint[1] offset by 256.00 towards Distance degrees)
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm TempPoint[2]
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_TempPoint[1])
          • Custom script: call RemoveLocation(udg_TempPoint[2])

I hope that it's leak free and to your liking.

Thank you everyone couldn't have done it withought you.
 
Last edited:
Status
Not open for further replies.
Top