• 🏆 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!

Special Effects Area

Status
Not open for further replies.
Level 4
Joined
Jul 24, 2006
Messages
62
Okay i dont even have a clue how to start this one;

  • Show Building Area
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Elven Arcane Spire
    • Actions
      • Set CoOrds = (Position of (Constructed structure))
      • Special Effect - Create a special effect at CoOrds using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Special Effect - Create a special effect at (CoOrds offset by (256.00, 0.00)) using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Special Effect - Create a special effect at (CoOrds offset by (-256.00, 0.00)) using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Special Effect - Create a special effect at (CoOrds offset by (0.00, -256.00)) using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Special Effect - Create a special effect at (CoOrds offset by (0.00, 256.00)) using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Special Effect - Create a special effect at (CoOrds offset by (181.00, 181.00)) using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Special Effect - Create a special effect at (CoOrds offset by (181.00, -181.00)) using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Special Effect - Create a special effect at (CoOrds offset by (-181.00, 181.00)) using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Special Effect - Create a special effect at (CoOrds offset by (-181.00, -181.00)) using Doodads\Cinematic\EnergyField\EnergyField.mdl
Heres my problem, when the building is destroyed i want the special effects to disappear.
My first thought would be to delete all special effects within 256 of the destroyed building, problem is there may be overlap with other special effects.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set My_Hash = (Last created hashtable)
  • Untitled Trigger 069
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Farm
    • Actions
      • Set Temp_Loc_1 = (Position of (Triggering unit))
      • Set Temp_Loc_2 = (Temp_Loc_1 offset by (256.00, 0.00))
      • Set Temp_Loc_3 = (Temp_Loc_1 offset by (-256.00, 0.00))
      • Set Temp_Loc_4 = (Temp_Loc_1 offset by (0.00, -256.00))
      • Special Effect - Create a special effect at Temp_Loc_2 using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key effect_1) of (Key (Triggering unit)) in My_Hash
      • Special Effect - Create a special effect at Temp_Loc_3 using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key effect_2) of (Key (Triggering unit)) in My_Hash
      • Special Effect - Create a special effect at Temp_Loc_4 using Doodads\Cinematic\EnergyField\EnergyField.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key effect_3) of (Key (Triggering unit)) in My_Hash
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
      • Custom script: call RemoveLocation(udg_Temp_Loc_2)
      • Custom script: call RemoveLocation(udg_Temp_Loc_3)
      • Custom script: call RemoveLocation(udg_Temp_Loc_4)
  • Untitled Trigger 070
    • Events
      • Unit - A unit Dies
    • Conditions
      • *possbile unit type check here*
    • Actions
      • Special Effect - Destroy (Load (Key effect_1) of (Key (Triggering unit)) in My_Hash)
      • Special Effect - Destroy (Load (Key effect_2) of (Key (Triggering unit)) in My_Hash)
      • Special Effect - Destroy (Load (Key effect_3) of (Key (Triggering unit)) in My_Hash)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in My_Hash
 
Last edited:
Level 4
Joined
Jul 24, 2006
Messages
62
Your are a Demi-God amongst mortals! You will be elevated to full God status when i have implelemented the triggers and everything is working, yes i do have this power (thanks)
 
Level 4
Joined
Jul 24, 2006
Messages
62
Okay still Demi-God atm,

  • Create Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Myhash = (Last created hashtable)
  • Showing Area
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Elven Arcane Spire
    • Actions
      • Set TempLoc1 = (Position of (Constructed structure))
      • Set TempLoc2 = (TempLoc1 offset by (0.00, 256.00))
      • Set TempLoc3 = (TempLoc1 offset by (-256.00, 0.00))
      • Set TempLoc4 = (TempLoc1 offset by (256.00, 0.00))
      • Special Effect - Create a special effect at TempLoc2 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect1) of (Key (Triggering unit)) in Myhash
      • Special Effect - Create a special effect at TempLoc3 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect2) of (Key (Triggering unit)) in Myhash
      • Special Effect - Create a special effect at TempLoc4 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect3) of (Key (Triggering unit)) in Myhash
      • Custom script: call RemoveLocation(udg_TempLoc1)
      • Custom script: call RemoveLocation(udg_TempLoc2)
      • Custom script: call RemoveLocation(udg_TempLoc3)
      • Custom script: call RemoveLocation(udg_TempLoc4)
  • Spire Destruction
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Elven Arcane Spire
    • Actions
      • Special Effect - Destroy (Load (Key Effect1) of (Key (Triggering unit)) in Myhash)
      • Special Effect - Destroy (Load (Key Effect2) of (Key (Triggering unit)) in Myhash)
      • Special Effect - Destroy (Load (Key Effect3) of (Key (Triggering unit)) in Myhash)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Myhash
For some reason on the death of the building only one effect is being removed - is there some silly thing ive not noticed? (I've used the fire lord missile as its easier to see where the location of the effect is during testing)
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
What do these values represent?

  • Key Effect1
  • Key Effect2
  • Key Effect3
If they aren't constant values then the code will not work because the numbers aren't going to line up. Try changing these values to constant numbers, such as 1 2 3 and then use the same numbers in the "Spire Destruction" trigger.
 
What do these values represent?

  • Key Effect1
  • Key Effect2
  • Key Effect3
If they aren't constant values then the code will not work because the numbers aren't going to line up. Try changing these values to constant numbers, such as 1 2 3 and then use the same numbers in the "Spire Destruction" trigger.

if I'm right they would store the special effects.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
  • Hashtable - Save Handle Of(Last created special effect) as (Key Effect1) of (Key (Triggering unit)) in Myhash
  • Save Handle Of (Last created special effect)
This specifies the handle to save, as an effect input.

  • as (Key Effect1)
This specifies the child-key as an integer input.

  • of (Key (Triggering unit))
This specifies the parent-key as an integer input.

  • in Myhash
This specifies the hashtable as a hashtable variable input.

(Last created special effect) is used to specify the effect handle, not (Effect Key1). Instead, (Effect Key1) simply refers to the child-key that is used to reference (Last created special effect) from its hash-location. If (Key Effect1) is anything other than a constant number, then when he references (Key Effect1) again then it will not return the same hash-coordinate, causing the code to not work as he wants it to.
 
The special effects are stored when you use the (Last created special effect) value. The "Key Effect1" would have to be a constant integer. Try exchanging the values for 1, 2, and 3 and see if that doesn't give you your desired effect.

I think Effect1 is a string so Key(Effect1) would be constant anyways. but yeah he can try to use 1,2,3...
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Yea you're right I think it is the "Get String ID" function, I was confused because there are no parenthesis around the string as there are on the "Get Handle ID" function for the handle. You're right, in this case it would return a constant integer in which case it should work. This is why I was asking what these variables were in the first place, I thought "Key Effect1" was the variable name.
 
Level 4
Joined
Jul 24, 2006
Messages
62
Just to clarify

Effect1, EFfect2, Effect3 are all variables of type Handle
Temploc1, Temploc2, Temploc3 are all variables of type point

Ive been messsing around with the trigger, and the problem is only the last created effect is destroyed.

I think its a problem with saving the handles in the hash table but dont know how to fix it :\
 
Level 4
Joined
Jul 24, 2006
Messages
62
if i make them of type string they cant be referenced in that function, also i cant input a constant into the function either

Success :D :D :D got it working, thanks for peoples help, will upload final triggers now
 
Last edited:
Level 4
Joined
Jul 24, 2006
Messages
62
The only way i've been able to get it to work so far is this, it may not be the most memory efficient way but it works:

  • Create Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set SpireEffectHash1 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set SpireEffectHash2 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set SpireEffectHash3 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set SpireEffectHash4 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set SpireEffectHash5 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set SpireEffectHash6 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set SpireEffectHash7 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set SpireEffectHash8 = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set SpireEffectHash9 = (Last created hashtable)
  • Showing Area
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Elven Arcane Spire
    • Actions
      • Set TempLoc1 = (Position of (Constructed structure))
      • Set TempLoc2 = (TempLoc1 offset by (0.00, 256.00))
      • Set TempLoc3 = (TempLoc1 offset by (181.00, 181.00))
      • Set TempLoc4 = (TempLoc1 offset by (256.00, 0.00))
      • Set TempLoc5 = (TempLoc1 offset by (-256.00, 0.00))
      • Set TempLoc6 = (TempLoc1 offset by (0.00, -256.00))
      • Set TempLoc7 = (TempLoc1 offset by (-181.00, 181.00))
      • Set TempLoc8 = (TempLoc1 offset by (-181.00, -181.00))
      • Set TempLoc9 = (TempLoc1 offset by (181.00, -181.00))
      • Special Effect - Create a special effect at TempLoc1 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect1) of (Key (Constructed structure)) in SpireEffectHash1
      • Special Effect - Create a special effect at TempLoc2 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect2) of (Key (Constructed structure)) in SpireEffectHash2
      • Special Effect - Create a special effect at TempLoc3 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect3) of (Key (Constructed structure)) in SpireEffectHash3
      • Special Effect - Create a special effect at TempLoc4 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect4) of (Key (Constructed structure)) in SpireEffectHash4
      • Special Effect - Create a special effect at TempLoc5 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect5) of (Key (Constructed structure)) in SpireEffectHash5
      • Special Effect - Create a special effect at TempLoc6 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect6) of (Key (Constructed structure)) in SpireEffectHash6
      • Special Effect - Create a special effect at TempLoc7 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect7) of (Key (Constructed structure)) in SpireEffectHash7
      • Special Effect - Create a special effect at TempLoc8 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect8) of (Key (Constructed structure)) in SpireEffectHash8
      • Special Effect - Create a special effect at TempLoc9 using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
      • Hashtable - Save Handle Of(Last created special effect) as (Key Effect9) of (Key (Constructed structure)) in SpireEffectHash9
      • Custom script: call RemoveLocation(udg_TempLoc1)
      • Custom script: call RemoveLocation(udg_TempLoc2)
      • Custom script: call RemoveLocation(udg_TempLoc3)
      • Custom script: call RemoveLocation(udg_TempLoc4)
      • Custom script: call RemoveLocation(udg_TempLoc5)
      • Custom script: call RemoveLocation(udg_TempLoc6)
      • Custom script: call RemoveLocation(udg_TempLoc7)
      • Custom script: call RemoveLocation(udg_TempLoc8)
      • Custom script: call RemoveLocation(udg_TempLoc9)
  • Spire Destruction
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Elven Arcane Spire
    • Actions
      • Special Effect - Destroy (Load (Key Effect1) of (Key (Triggering unit)) in SpireEffectHash1)
      • Special Effect - Destroy (Load (Key Effect2) of (Key (Triggering unit)) in SpireEffectHash2)
      • Special Effect - Destroy (Load (Key Effect3) of (Key (Triggering unit)) in SpireEffectHash3)
      • Special Effect - Destroy (Load (Key Effect4) of (Key (Triggering unit)) in SpireEffectHash4)
      • Special Effect - Destroy (Load (Key Effect5) of (Key (Triggering unit)) in SpireEffectHash5)
      • Special Effect - Destroy (Load (Key Effect6) of (Key (Triggering unit)) in SpireEffectHash6)
      • Special Effect - Destroy (Load (Key Effect7) of (Key (Triggering unit)) in SpireEffectHash7)
      • Special Effect - Destroy (Load (Key Effect8) of (Key (Triggering unit)) in SpireEffectHash8)
      • Special Effect - Destroy (Load (Key Effect9) of (Key (Triggering unit)) in SpireEffectHash9)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SpireEffectHash1
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SpireEffectHash2
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SpireEffectHash3
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SpireEffectHash4
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SpireEffectHash5
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SpireEffectHash6
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SpireEffectHash7
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SpireEffectHash8
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in SpireEffectHash9
 
Status
Not open for further replies.
Top