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

Rally Point Mistaking Enemy Structure As Terrain?

Status
Not open for further replies.
Level 5
Joined
Jan 5, 2008
Messages
145
This trigger works but when i set a rally point on a enemy structure it thinks its not a structure how can i fix this? heres the trigger
  • Rally Point Buildings ONLY
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Rally-Point of (Triggering unit) as a unit) is A structure) Equal to True
        • Then - Actions
          • Game - Display to (Player group((Owner of (Trained unit)))) for 10.00 seconds the text: One of your buildin...
          • Cinematic - Ping minimap for (Player group((Owner of (Trained unit)))) at (Position of (Trained unit)) for 10.00 seconds
          • Camera - Pan camera for (Owner of (Trained unit)) to (Position of (Trained unit)) over 2.00 seconds
          • Unit - Remove (Trained unit) from the game
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 1.00)
        • Else - Actions
          • Do nothing
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
It doesn't think it's not a structure. If you right-click enemy structure, the rally point will not be set on the structure, but on the ground underneath (you can easily tell, as the flag is not on side, like for allied structures, but directly in the middle). In that case, "Rally Point as unit" returns "no unit" (as the rally point is on location) and therefore the condition is false.
If you, however, use the ability "set rally point" on enemy structure, it will be set on the structure and the trigger will work.

EDIT: In order to make it work in-game, you should catch "smart" (right click) orders that buildings receive and convert them to "rallypoint" orders)

I was wrong, sorry, you just can't set rally point on enemy units or structures
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
Well yeah, you can't target enemy structures for rally points (my idea why: when you targeted enemy hero, your units will be automatically ordered to attack him when they are built, so effectivelly allowing you to "track" enemy hero)
So what you'll need is to catch "smart" (right click) orders that training units receive and save them somewhere (hashtable) and then order the units with trigger when they are trained.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
  • Order trigger
    • Unit - a unit is issued order targeting an object
  • Conditions
    • (Triggering unit) is a structure equals to true
  • Actions
    • Hashtable - Save (Target unit of issued order) as (Key rally point) of (Key (Triggering Unit)) in HandleTable
where HandleTable is a hashtable you created in some init trigger
then
  • train
  • Events
    • Unit - A unit Finishes training a unit
  • Actions
    • Set rallyP = (Load (Key rally point) of (Key (Triggering unit)) in HandleTable)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • rallyP Not equal to No unit
      • Then - Actions
        • Unit - Order (Trained unit) to Right-Click rallyP
      • Else - Actions
Actions
 
Level 5
Joined
Jan 5, 2008
Messages
145
ok also i need to know what types of variables rallyP is i have it as a handle right now,Key Rally Point is an interger. and Handletable is an hashtable is that correct?
 
Level 5
Joined
Jan 5, 2008
Messages
145
yes it works but i have to basicly combine this trigger
  • Rally Point Buildings ONLY
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Rally-Point of (Triggering unit) as a unit) is A structure) Equal to True
        • Then - Actions
          • Game - Display to (Player group((Owner of (Trained unit)))) for 10.00 seconds the text: One of your buildin...
          • Cinematic - Ping minimap for (Player group((Owner of (Trained unit)))) at (Position of (Trained unit)) for 10.00 seconds
          • Camera - Pan camera for (Owner of (Trained unit)) to (Position of (Trained unit)) over 2.00 seconds
          • Unit - Remove (Trained unit) from the game
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 1.00)
        • Else - Actions
          • Do nothing
With this one
  • Train Hashtable
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set rallyP = (Load KeyRallyPoint of (Key (Triggering unit)) in Hashtable)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Not equal to No unit
        • Then - Actions
          • Unit - Order (Trained unit) to Right-Click rallyP
        • Else - Actions
i want them combined so when you train a unit and the rally point isnt on a structure you get an error messege saying fix this rally point. the hashtable trigger works but i need the error message in their somehow or you can make units while the rally point is on the ground.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
  • Train Hashtable
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set rallyP = (Load KeyRallyPoint of (Key (Triggering unit)) in Hashtable)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (rallyP is A structure) Equal to True
        • Then - Actions
          • Unit - Order (Trained unit) to Right-Click rallyP
        • Else - Actions
          • Game - Display to (Player group((Owner of (Trained unit)))) for 10.00 seconds the text: One of your buildin...
          • Cinematic - Ping minimap for (Player group((Owner of (Trained unit)))) at (Position of (Trained unit)) for 10.00 seconds
          • Camera - Pan camera for (Owner of (Trained unit)) to (Position of (Trained unit)) over 2.00 seconds
          • Unit - Remove (Trained unit) from the game
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 1.00)
 
Level 5
Joined
Jan 5, 2008
Messages
145
ok i did that
  • Train Hashtable
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set rallyP = (Load KeyRallyPoint of (Key (Triggering unit)) in Hashtable)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (rallyP is A structure) Equal to True
        • Then - Actions
          • Unit - Order (Trained unit) to Right-Click rallyP
        • Else - Actions
          • Game - Display to (Player group((Owner of (Trained unit)))) for 10.00 seconds the text: One of your buildin...
          • Cinematic - Ping minimap for (Player group((Owner of (Trained unit)))) at (Position of (Trained unit)) for 10.00 seconds
          • Camera - Pan camera for (Owner of (Trained unit)) to (Position of (Trained unit)) over 2.00 seconds
          • Unit - Remove (Trained unit) from the game
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 1.00)
And now i get an error message from everything i cant send any units. sorry for all this trouble. ill put your name in the map :p so idk whats wrong with this. i can send you the map and you can see it yourself. just promise not to mess it up :(
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
Make sure that the Key "rally point" is spelled exactly same in the order trigger as in the training trigger (or you could use a specific number instead of string hash (the "String ID" function converts the string into a number, so if you use a different spelling (even upper/lower case), it will result into a different number)
 
Level 5
Joined
Jan 5, 2008
Messages
145
Their spelled Exactly The Same! heres all 3 triggers"just incase i messed up the first one"
  • Int Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
  • Order Hashtable
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Hashtable - Save Handle Of(Target unit of issued order) as (Key RallyPoint) of (Key (Triggering unit)) in Hashtable
  • Train Hashtable
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set rallyP = (Load (Key RallyPoint) of (Key (Triggering unit)) in Hashtable)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (rallyP is A structure) Equal to True
        • Then - Actions
          • Unit - Order (Trained unit) to Right-Click rallyP
        • Else - Actions
          • Game - Display to (Player group((Owner of (Trained unit)))) for 10.00 seconds the text: One of your buildin...
          • Cinematic - Ping minimap for (Player group((Owner of (Trained unit)))) at (Position of (Trained unit)) for 10.00 seconds
          • Camera - Pan camera for (Owner of (Trained unit)) to (Position of (Trained unit)) over 2.00 seconds
          • Unit - Remove (Trained unit) from the game
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 1.00)
Did i do anything wrong?
 
Level 5
Joined
Jan 5, 2008
Messages
145
ok so this should be correct?
  • Int Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set datatable = (Last created hashtable)
  • Order Hashtable
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • Hashtable - Save Handle Of(Target unit of issued order) as (Key RallyPoint) of (Key (Triggering unit)) in datatable
  • Train Hashtable
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Set rallyP = (Load (Key RallyPoint) of (Key (Triggering unit)) in datatable)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (rallyP is A structure) Equal to True
        • Then - Actions
          • Unit - Order (Trained unit) to Right-Click rallyP
        • Else - Actions
          • Game - Display to (Player group((Owner of (Trained unit)))) for 10.00 seconds the text: One of your buildin...
          • Cinematic - Ping minimap for (Player group((Owner of (Trained unit)))) at (Position of (Trained unit)) for 10.00 seconds
          • Camera - Pan camera for (Owner of (Trained unit)) to (Position of (Trained unit)) over 2.00 seconds
          • Unit - Remove (Trained unit) from the game
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 1.00)
 
Status
Not open for further replies.
Top