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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top