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

[Spell] Polar Offset not working?!?!

Status
Not open for further replies.
Level 2
Joined
Dec 3, 2012
Messages
6
This is really freaking me out.

I have a dummy spell (based on channel) and a trigger.

Once the spell is cast the trigger is supposed to create some Tree Wall destructibles.... but it is not working... I am using polar offset from where the ability is targeting as the point but it keeps defaulting to the center of the map for some reason... it is really annoying... :confused:

here is the trigger....
  • Nature Tree Spawn
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Nature Stimulation
    • Actions
      • Set TempPoint = (Target point of ability being cast)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Destructible - Create a Tree Wall at (TempPoint offset by (Random real number between 25.00 and 50.00) towards (Random real number between 1.00 and 359.00) degrees) facing (Random angle) with scale (Random real number between 0.80 and 1.20) and variation (Random integer number between 1 and 10)
      • Custom script: call RemoveLocation(udg_TempPoint)
any help would be greatly appreciated...
 
Your leak the offset, also use "A unit Starts the effect of an ability":

  • Detonador sin nombre 001
    • Acontecimientos
      • Unidad - A unit Starts the effect of an ability
    • Condiciones
      • (Ability being cast) Equal to Nature Stimulation
    • Actions
      • Set Temp = (Position of (Triggering unit))
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop: Acciones
          • Set Temp_Offset = (Temp offset by 256.00 towards (Random angle) degrees)
          • Destructible - Create a Tree Wall at Temp_Offset facing (Random angle) with scale 1.00 and variation 0
          • Custom script: call RemoveLocation(udg_Temp_Offset)
      • Custom script: call RemoveLocation(udg_Temp)
Edit: Well, defskull answered fast.
 
Level 2
Joined
Dec 3, 2012
Messages
6
wow...

wow I feel dumb...

Thanks defskull!

Still new to this stuff, pointing me in the right direction to make this MUI and leak free would be awesome.

I have been looking around online for tutorials on this and found little that I completely understand so far.

EDIT:
You beat me to asking for it... thanks
 
Level 2
Joined
Dec 3, 2012
Messages
6
MUI and Leaks?

So is this MUI and take care of the leaks?

  • Nature Tree Spawn
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Nature Stimulation
    • Actions
      • Hashtable - Save Handle Of(Target point of ability being cast) as 0 of (Key (Casting unit)) in locHashTable
      • For each (Integer A) from 1 to 15, do (Actions)
        • Loop - Actions
          • Hashtable - Save Handle Of((Load 0 of (Key (Casting unit)) in (Last created hashtable)) offset by (Random real number between 100.00 and 200.00) towards (Random angle) degrees) as 1 of (Key (Casting unit)) in locHashTable
          • Destructible - Create a Tree Wall at (Load 1 of (Key (Casting unit)) in locHashTable) facing (Random angle) with scale (Random real number between 0.80 and 1.20) and variation (Random integer number between 1 and 10)
      • Hashtable - Clear all child hashtables of child (Key (Casting unit)) in locHashTable
Thanks guys for the awesome help so far!
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Just like hayaku said, as long as your spells (or triggers) that has instant effect (takes effect immediately, does not need to wait for any other matter), the spell would be by default, MUI, even if it's casted by more than 1 units at a time.

Because apparently, Warcraft III uses single-threaded mechanism to fire trigger order so it can never collide with the restriction; the trigger has instant effect (like yours).

By the way, you don't need to use hashtable for this simple trigger, lol.
Just use it normally.
 
Status
Not open for further replies.
Top