Question about Point Variables

Finestdeath

New Member
Reaction score
10
Is it possible to reuse Point Variables?

For example, I create a point variable named Wave1Point. So I will be using it in a trigger called Wave1. At the end of that trigger, I will be destroying the PointVariable, 'Wave1Point'. Can I reuse 'Wave1Point' in the following triggers to come? (Wave2, Wave3, etc) Or do I have to use a different Point Variable for different triggers? (Wave1Point for Wave1, Wave2Point for Wave2, etc).

If its confusing, feel free to say.
 

Avaleirra

Is back. Probably.
Reaction score
128
I'm only 60% sure, but my guess is no. You will need to create a new variable.
 

Finestdeath

New Member
Reaction score
10
Even if I were to destroy it before reusing it again? Damn! Looks like I have to create alot of variables :(
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
You can always reuse your variables, there shouldn't be any problems with it x), as long as they are not SPECIFIC points in the map that you want to keep (e.g knockback system or something)

I'll give you my spawning example:
Trigger:
  • Spawn Left Hounds
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Center of Start Left <gen>)
      • Unit - Create 1 Hell Hound for Player 11 (Dark Green) at TempPoint facing 90.00 degrees
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Set TempPoint2 = (Center of Starting Area <gen>)
      • Unit - Order (Last created unit) to Attack-Move To TempPoint2
      • Custom script: call RemoveLocation(udg_TempPoint2)

Trigger:
  • Spawn Right Hounds
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint2 = (Center of Start Right <gen>)
      • Unit - Create 1 Hell Hound for Player 11 (Dark Green) at TempPoint2 facing 90.00 degrees
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Set TempPoint = (Center of Starting Area <gen>)
      • Unit - Order (Last created unit) to Attack-Move To TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)


These two run at the EXACT same time, and i had no failures to spawn or attack at all ^^

I even have about 7 waves based on this (turning on and off triggers when the wavecount reaches a certain point) so, yes you can reuse your variables as much as you want, as long as you destroy them so they don't leak ^^
 

Komaqtion

You can change this now in User CP.
Reaction score
469
No, as long as you destroy the variable (Always), then it's ok to use the same variable again ;)

This is the basic Temp_Point variable you're talking about right ?
I mean, you can use a single Point variable for every point in the entire map, as long as you destroy it right away ;)
 

Zwiebelchen

You can change this now in User CP.
Reaction score
60
It doesnt work anymore, if there is a time-span between creating and destroying the point. When this is the case, then you can lose reference to the point when having two units cast the spell at the same time.

You'd need to use locals in this case
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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