A bundle of questions

DuelPlayer

Member
Reaction score
21
First question:
Whats wrong with this trigger???
Trigger:
  • Storm Field
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Storm Field
    • Actions
      • Set Temp_Point[1] = (Target point of ability being cast)
      • Set Temp_Player[1] = (Owner of (Triggering unit))
      • Set Temp_Unit_Group[1] = (Units within 500.00 of Temp_Point[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True))))
      • Destructible - Pick every destructible within 500.00 of Temp_Point[1] and do (Actions)
        • Loop - Actions
          • Destructible - Kill (Picked destructible)
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • Set Temp_Real[1] = (Temp_Real[1] + 45.00)
          • Set Temp_Point[2] = (Temp_Point[1] offset by 500.00 towards Temp_Real[1] degrees)
          • Unit - Create 1 Storm Bolt Dummy for Temp_Player[1] at Temp_Point[2] facing Temp_Point[1]
          • Unit - Order (Last created unit) to Move To Temp_Point[1]
          • Unit - Add a 1.25 second Generic expiration timer to (Last created unit)
          • Set Temp_Point[2] = (Load 0 of 0 in (Last created hashtable))
      • Unit - Create 1 Dummy Caster for Temp_Player[1] at Temp_Point[1] facing Default building facing degrees
      • Unit - Add Dummy Force Field Stun (Neutral Hostile 1) to (Last created unit)
      • Unit - Set level of Dummy Force Field Stun (Neutral Hostile 1) for (Last created unit) to (Level of Storm Field for (Triggering unit))
      • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • For each (Integer A) from 0 to (Number of units in Temp_Unit_Group[1]), do (Actions)
        • Loop - Actions
          • Set Temp_unit[1] = (Random unit from Temp_Unit_Group[1])
          • Set Temp_Point[2] = (Position of Temp_unit[1])
          • Unit - Move Temp_unit[1] instantly to Temp_Point[1]
          • Unit - Cause (Casting unit) to damage Temp_unit[1], dealing (100.00 + ((500.00 - (Distance between Temp_Point[2] and Temp_Point[1])) / 2.00)) damage of attack type Spells and damage type Normal
          • Unit Group - Remove Temp_unit[1] from Temp_Unit_Group[1]
          • Set Temp_unit[1] = (Load 0 of 0 in (Last created hashtable))
          • Set Temp_Point[2] = (Load 0 of 0 in (Last created hashtable))
      • Set Temp_Real[1] = 0.00
      • Set Temp_Point[1] = (Load 0 of 0 in (Last created hashtable))
      • Unit Group - Remove all units from Temp_Unit_Group[1]
      • Set Temp_Unit_Group[1] = (Load 0 of 0 in (Last created hashtable))

Basically this spell has 500 aoe and when casted all enemy units in the aoe get moved to middle. And i normally used Set (variable) = (Load 0 of 0 in (Last created hashtable)) to remove leaks, well do not comment it in first question. The main problem is that when i first casted it happen as i expected but when i cast it 2nd, 3rd ... times sometimes only one unit moved to middle and received the damage. Help me look if i missed out any leaks or bug. Btw, this spell is MUI. And all triggers using the variables in this trigger are MUI too.

2nd Question:
Just asking!!
Is
Trigger:
  • Set (variable) = (Load 0 of 0 in (Last created hashtable))

Same as custom script removal of variables?
Because if it is not found in hashtable, so i expect it to be null

3rd Question:
Is there any ways to detect that a tree died? In event?
Because i saw the event
Trigger:
  • Destructible - A destructible within (Entire map) dies

But there is a note it only works for first 64 trees it detected.
I was thinking to pick all trees in entire map and add in the event of Destructible - (Picked destructibles) dies
But i was afraid that pick destructibles only work for first 64 picked destructibles.

Lastly, if you help me solve +rep :thup:
 

canons200

New Member
Reaction score
50
i don't think Set (variable) = (Load 0 of 0 in (Last created hashtable)) will null, it just set your variable to the NEW value, as the value load 0 of 0 in hashtable.

besides, i only see you load, where you save the hashtable?
 

DuelPlayer

Member
Reaction score
21
i don't think Set (variable) = (Load 0 of 0 in (Last created hashtable)) will null, it just set your variable to the NEW value, as the value load 0 of 0 in hashtable.

besides, i only see you load, where you save the hashtable?

And i normally used Set (variable) = (Load 0 of 0 in (Last created hashtable)) to remove leaks, well do not comment it in first question.

If label is not found, this function returns to NULL.

If it set to new value, then why is the sentence there in hashtable?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
But you don't only clean leaks by nulling them, you also need to remove the pointer, like for locations you have to first (At least) use [ljass]call Rem,oveLocation(<Variable>)[/ljass], and then null the variable... It's not enough to simply just null it :p

And then, to your problem with it not works, you need to pick the units in the group, not just randomlyuse them like this:
Trigger:
  • For each (Integer A) from 0 to (Number of units in Temp_Unit_Group[1]), do (Actions)


But pick them using the action "Unit Group - Pick Every Unit In Unit Group And Do Multiple Actions", and change Tempunit[1] to (Picked unit) ;)

And then for your third question, yes you should make another trigger and pick all destructibles, because that actions works for all of them, and not just 64 first ;)
 

DuelPlayer

Member
Reaction score
21
But you don't only clean leaks by nulling them, you also need to remove the pointer, like for locations you have to first (At least) use [ljass]call Rem,oveLocation(<Variable>)[/ljass], and then null the variable... It's not enough to simply just null it :p

And then, to your problem with it not works, you need to pick the units in the group, not just randomlyuse them like this:
Trigger:
  • For each (Integer A) from 0 to (Number of units in Temp_Unit_Group[1]), do (Actions)


But pick them using the action "Unit Group - Pick Every Unit In Unit Group And Do Multiple Actions", and change Tempunit[1] to (Picked unit) ;)

And then for your third question, yes you should make another trigger and pick all destructibles, because that actions works for all of them, and not just 64 first ;)

I used hashtable trick because i am lazy for custom script.
If I wanted to use custom script, i dont even need to null them
Hashtable trick also can null points.
I just want to know if hashtable trick will work?

I tried Pick Every Unit in Unit Group before, i used it at first then i realised it won't work so i tried the 2nd method which is currently in the trigger.

I will try it later. +rep if it works
 

Komaqtion

You can change this now in User CP.
Reaction score
469
It will work, if used correctly :p

And no, the "hashtable trick" isn't enough...
 

DuelPlayer

Member
Reaction score
21
But i tried it wont work
And can you explain why the current method wont work?
Since it worked for first time but failed after first.

How can u prove that hashtable trick wont work?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
But i tried it wont work
And can you explain why the current method wont work?
Since it worked for first time but failed after first.

Please, take my word for it, using "Pick every unit..." WILL WORK !

Show me how you use it, please :D

How can u prove that hashtable trick wont work?

I have told you, it isn't enough to just null the variable ! You need to remove the pointer too... That's why your trick won't work, as it just null the variable.
 

DuelPlayer

Member
Reaction score
21
Well oddly the trigger worked... I wondering whats wrong with me??
Why did i changed the trigger at first?
All i can conclude is that I am either hallucination or else i must use temp_unit 1
+rep

What you mean by pointer??
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Great to hear ;)

Well, by pointer I mean when you null a variable, you're just making sure it doesn't have a value, meaning that it doesn't "point" at anything XD
So, when I say you need to remove the pointer, I mean the actual handle that you're variable is holding, e.g a location...

So, if you're just nulling the variable, you're not removing the created locations which is just lying there and can't be used ever again, and a leak has been created ;)

That's why you need to remove that handle also (This is actually much more important than nulling the variable :p) using (In this example with locations) [ljass]call RemoveLocation(<Variable>)[/ljass]
 

DuelPlayer

Member
Reaction score
21
But i think hashtable trick because i has not detect any lags from spells yet.
Maybe when massive lag happens then i shall change.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top