• 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] THREE Problems, Special Effect and two bugs with a dummy

Status
Not open for further replies.
Level 4
Joined
Dec 12, 2012
Messages
96
I'm trying to create a superb item that when acquired, creates multiple special effects on the acquiring unit, creates a dummy that casts skill on random units in 2000 range of the acquiring unit. But I have 3 problems here:

1) Special Effect - Purgebufftarget can't be destroyed whatever I do.
2) Whenever the item is acquired, instead of only creating only 1 dummy initially, it creates two.
3) Dummy has more than 1 second interval between casting the Chain Lightning (ability of the item and only targets 1 unit at a time and supposedly to cast this skill every 1 second) on random units within 2000 range.

*I currently set the dummy's model into footman so i can see it spawning. If you want a test map, i could provide it.*

1st Trigger: Acquiring item
  • Acquiring DZ
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Triggering unit) has an item of type Diamond of Zeus) Equal to True
    • Actions
      • Set DZunit = (Triggering unit)
      • Set DZpoint = (Position of DZunit)
      • Trigger - Run DZdummy <gen> (checking conditions)
      • Trigger - Run DZsfx <gen> (checking conditions)
2nd Trigger: DZ Dummy create
  • DZdummy
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 DummyDZ for (Owner of DZunit) at (Position of DZunit) facing Default building facing degrees
      • Set DZdummy = (Last created unit)
      • Unit Group - Pick every unit in (Units within 2000.00 of (Position of DZunit)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an enemy of (Owner of DZunit)) Equal to True
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
            • Then - Actions
              • Set DZtargetunit = (Picked unit)
            • Else - Actions
      • Unit - Order DZdummy to Orc Far Seer - Chain Lightning DZtargetunit
      • Wait 0.50 seconds
      • Unit - Remove DZdummy from the game
      • Trigger - Run (This trigger) (checking conditions)
3rd Trigger: Special Effects
  • DZsfx
    • Events
    • Conditions
    • Actions
      • Special Effect - Create a special effect at (Position of DZunit) using Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
      • Set DZsfx4 = (Last created special effect)
      • Wait 0.10 seconds
      • Special Effect - Destroy DZsfx4
      • Special Effect - Create a special effect at ((Position of DZunit) offset by ((Random real number between -100.00 and 100.00), (Random real number between -100.00 and 100.00))) using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
      • Set DZsfx = (Last created special effect)
      • Wait 0.20 seconds
      • Special Effect - Create a special effect at ((Position of DZunit) offset by ((Random real number between -100.00 and 100.00), (Random real number between -100.00 and 100.00))) using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
      • Set DZsfx2 = (Last created special effect)
      • Sound - Play PurgeTarget1 <gen> at 100.00% volume, attached to DZunit
      • Wait 0.50 seconds
      • Set DZsound = (Last played sound)
      • Special Effect - Create a special effect at ((Position of DZunit) offset by ((Random real number between -100.00 and 100.00), (Random real number between -100.00 and 100.00))) using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
      • Set DZsfx3 = (Last created special effect)
      • Wait 1.00 seconds
      • Special Effect - Destroy DZsfx
      • Special Effect - Destroy DZsfx2
      • Special Effect - Destroy DZsfx3
      • Sound - Stop PurgeTarget1 <gen> Immediately
      • Wait 1.00 seconds
      • Trigger - Run (This trigger) (checking conditions)
4th Trigger: Removes all when hero drops the item
  • [TRIGGER]
  • DZ reset
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Diamond of Zeus
    • Actions
      • Set DZunit = No unit
      • Set DZtargetunit = No unit
      • Set DZdummy = No unit
      • Sound - Destroy DZsound
[/TRIGGER]

5th Trigger: This is so far how i fix the dummy double creation
  • Destroy bug dummies
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to DummyDZ
    • Actions
      • Wait 3.00 seconds
      • Unit - Remove (Triggering unit) from the game
 
Level 13
Joined
Mar 29, 2012
Messages
542
You have leaks, fixing example :
  • Fixed
    • Events
    • Conditions
    • Actions
      • Set TempLoc = (Position of DZunit)
      • Set TempPlayer = (Owner of DZunit)
      • Unit - Create 1 Footman for TempPlayer at TempLoc facing Default building facing degrees
      • Set DZdummy = (Last created unit)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 2000.00 of TempLoc) and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit belongs to an enemy of TempPlayer) Equal to True
              • (TempUnit is A structure) Equal to False
              • (TempUnit is Mechanical) Equal to False
            • Then - Actions
              • Set DZtargetunit = TempUnit
            • Else - Actions
      • Unit - Order DZdummy to Orc Far Seer - Chain Lightning DZtargetunit
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Wait 0.50 seconds
      • Unit - Remove DZdummy from the game
      • Trigger - Run (This trigger) (checking conditions)
Removing leaks :
Location leak - Remove it by saving to a variable and remove it with 'call RemoveLocation(udg_variable)'
Group leak - Remove it by saving to a variable and destroy it with 'call DestroyGroup(udg_variable)' or with 'set bj_wantDestroyGroup = true' for more efficient

By the way, what this for ?? :
  • Trigger - Run (This trigger) (checking conditions)
 
Level 4
Joined
Dec 12, 2012
Messages
96
Removing leaks :
Location leak - Remove it by saving to a variable and remove it with 'call RemoveLocation(udg_variable)'
Group leak - Remove it by saving to a variable and destroy it with 'call DestroyGroup(udg_variable)' or with 'set bj_wantDestroyGroup = true' for more efficient

Maybe this is the solution too for the special effects, that one is getting on my nerve. Thanks.

By the way, what this for ?? :
  • Trigger - Run (This trigger) (checking conditions)

This is to repeat the trigger so it would cast the chain lightning every 0.5 second. It's kinda similar with Cloak of Flames or Immolation, but only targets one unit a time and with chain lightning. :D
 
Level 4
Joined
Dec 12, 2012
Messages
96
I'm sorry for the double post but how do I change the prefix to SOLVED? I already solved this problem.


  • DZdummyCast
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Set DZpoint = (Position of DZunit)
      • Unit Group - Pick every unit in (Units within 2000.00 of DZpoint) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of (Owner of DZunit)) Equal to False
              • ((Unit-type of (Picked unit)) is A structure) Equal to False
              • ((Unit-type of (Picked unit)) is A structure) Equal to False
            • Then - Actions
              • Set DZtargetunit = (Picked unit)
              • Unit - Order DZdummy to Special Archimonde - Finger Of Death DZtargetunit
            • Else - Actions
      • Wait 0.10 seconds
      • Unit - Move DZdummy instantly to DZpoint
      • Set DZtargetunit = No unit
Every 0.4 seconds, finger of death is automatically cast upon units within 2000 range of the item beholder.
 
Status
Not open for further replies.
Top