• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

GUI Unit Indexer Issue

Status
Not open for further replies.
Level 4
Joined
Apr 16, 2018
Messages
47
Ok I started to try the gui unit indexer by bribe. Problem is I can't seem to get things to work apparently...

Trying to store each units destination, I stop them manually so they stop moving and have a periodic timer I am trying to see if it is working to make them continue moving to the destination I stored for them.

Problem is, they don't move and I don't know why or what I am doing wrong, swear I put it in just like I seen demonstrated... They run when spawned, just the periodic never makes them move again.

Anyone have any idea why its not working? xD

  • Spawn Unit
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet Temp_Loc00 = (Center of RedLaneSpawn <gen>)
      • Set VariableSet Temp_Loc01 = (Center of RedLaneEnd <gen>)
      • Unit - Create 1 Runner Template for Player 24 (Peanut) at Temp_Loc00 facing Temp_Loc01
      • AI - Ignore (Last created unit)'s guard position
      • Set VariableSet Runners_Destination[(Custom value of (Last created unit))] = Temp_Loc01
      • Unit Group - Add (Last created unit) to Runners_UnitGroup
      • Unit - Order (Last created unit) to Move To Runners_Destination[(Custom value of (Last created unit))]
      • Custom script: call RemoveLocation (udg_Temp_Loc00)
      • Custom script: call RemoveLocation (udg_Temp_Loc01)

  • Periodic Move Order
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Tick
      • Unit Group - Pick every unit in Runners_UnitGroup and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (String((Custom value of (Picked unit))))
          • Unit - Order (Picked unit) to Move To Runners_Destination[(Custom value of (Picked unit))]
 
Level 15
Joined
Feb 7, 2020
Messages
397
I think you're going to need a separate trigger with the unit index event to set the destination variable (attached).

Basically, change the condition to 'UDexUnits[UDex] is of unit type Runner Template'.

Then set the variable 'Runners_Destination[UDex] = [Center of RedLaneEnd]'.

In your current GUI setup, I think the unit is created and the unit index script has not yet set the custom value.
 

Attachments

  • dothis.jpg
    dothis.jpg
    15.8 KB · Views: 13
Level 4
Joined
Apr 16, 2018
Messages
47
I think you're going to need a separate trigger with the unit index event to set the destination variable (attached).

Basically, change the condition to 'UDexUnits[UDex] is of unit type Runner Template'.

Then set the variable 'Runners_Destination[UDex] = [Center of RedLaneEnd]'.

In your current GUI setup, I think the unit is created and the unit index script has not yet set the custom value.
I will consider trying that in moment, but the reason I haven't is because I am confused why the initial movement works if the variable is not set ? It references the set destination fine, but does not do so when referenced from another trigger? xD

Also, if I did the conditioning that way. I would need at LEAST like 50 or so conditions, 1 for each unit. xD
 
Last edited:
Level 15
Joined
Feb 7, 2020
Messages
397
I will consider trying that in moment, but the reason I haven't is because I am confused why the initial movement works if the variable is not set ? It references the set destination fine, but does not do so when referenced from another trigger? xD

Also, if I did the conditioning that way. I would need at LEAST like 50 or so conditions, 1 for each unit. xD
Oh, I see. Try setting the destination directly to the region instead of the temp loc
 
Level 4
Joined
Apr 16, 2018
Messages
47
That did it. Thank you. Sucks though, I was hoping to be able to use the trigger across multiple spawns and players and all that, make it more module. No I will prob have to duplicate it instead and if any issues occur fix on each one instead of just one. T.T Shoulda worked fine other way, but darn... May be able to do if statements checking which to set. Idk might be a work around gotta go for now though. Thank you.
 
Level 15
Joined
Feb 7, 2020
Messages
397
That did it. Thank you. Sucks though, I was hoping to be able to use the trigger across multiple spawns and players and all that, make it more module. No I will prob have to duplicate it instead and if any issues occur fix on each one instead of just one. T.T Shoulda worked fine other way, but darn... May be able to do if statements checking which to set. Idk might be a work around gotta go for now though. Thank you.
I think you can still make it modular. Your destination location was targeting a location, which is a pointer. Removing the original location results in the destination variable targeting a null value (it doesn't clone its contents in the GUI set variable function).

You can get around this by setting the destination variable as a new location and then getting the X and Y of the temporary location.

JASS:
Set VariableSet Untitled_Variable_001 = (Point((X of Untitled_Variable_001), (Y of Untitled_Variable_001)))
 

Attachments

  • points.jpg
    points.jpg
    29.6 KB · Views: 9
Status
Not open for further replies.
Top