Replaced worker mine gold from rally point

sunshinex3

You can change this now in User CP.
i can get a replaced unit to "move" to original units rally point
Trigger:
  • PEON
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Fel Peon (FelOrc)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in (Units in (Playable map area)).) Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Rally-Point of (Triggering unit) as a point)
          • Unit - Replace (Trained unit) with a Fel Peon (FelOrc0.0) using The old unit's relative life and mana
          • Unit - Order (Last replaced unit) to Move To (Rally-Point of (Triggering unit) as a point)
          • Custom script: call RemoveLocation (udg_TempPoint)
        • Else - Actions


but its a worker unit and if the player wants it to mine gold or collect wood... well it wont because it was just issued the order to "move" to point... so what am i missing how do I get a replaced worker to harvest wood or mine gold from a rally point?
 

sunshinex3

You can change this now in User CP.
ok but it still saves point as a point, is their a way around that?

EDIT:
I tried it any way the unit stands next to the gold mine or tree its still counted as a "move to" order
Trigger:
  • PEON Copy
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Fel Peon (FelOrc)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in (Units in (Playable map area)).) Equal to True
        • Then - Actions
          • Set VariableSet TempPoint = (Rally-Point of (Triggering unit) as a point)
          • Unit - Replace (Trained unit) with a Fel Peon (FelOrc0.0) using The old unit's relative life and mana
          • Unit - Order (Last replaced unit) to Right-Click (Rally-Point of (Triggering unit) as a point)
          • Custom script: call RemoveLocation (udg_TempPoint)
        • Else - Actions
 
Last edited:

Ghan

Administrator - Servers are fun
Staff member
The trouble is that you don't know what the thing is where the rally point is set. Not going to be easy, then.

You could get clever and do something like "pick every unit in (units within 1 of rally point)" and see if you get anything returned.
In the case of a tree, you'd want to look for destructibles - there's a similar action something like "pick every destructible in circle and do actions" that might work.

Then, depending on whether you find anything in the groups returned from those pick functions, you can write some logic to figure out what to do with the unit.
 

sunshinex3

You can change this now in User CP.
damn so close.... the first part work whether it be to right click the destructible or right click gold mine or move to point.... but it never goes past the first and I don't know why...

Trigger:
  • PEON Copy
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Fel Peon (FelOrc)
    • Actions
      • Set VariableSet TempPoint = (Rally-Point of (Triggering unit) as a point)
      • Unit - Replace (Trained unit) with a Fel Peon (FelOrc0.0) using The old unit's relative life and mana
      • Unit Group - Pick every unit in (Units within 50.00 of TempPoint.) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Gold Mine
            • Then - Actions
              • Unit - Order (Last replaced unit) to Right-Click (Picked unit)
            • Else - Actions
              • Destructible - Pick every destructible within 50.00 of TempPoint and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Picked destructible) Equal to (Rally-Point of (Triggering unit) as a destructible)
                    • Then - Actions
                      • Unit - Order (Last replaced unit) to Right-Click (Picked destructible)
                    • Else - Actions
                      • Unit - Order (Last replaced unit) to Move To TempPoint
      • Custom script: call RemoveLocation (udg_TempPoint)
 

Ghan

Administrator - Servers are fun
Staff member
If the "Pick every unit" part doesn't find any units, then it won't execute any of the actions underneath it, meaning it will never hit the "Else" part of the If statement. You'll need to pull the destructible section out to the same level as the unit section.
You could just create a quick boolean flag and toggle it in the unit section. If it has been toggled, then skip the destructible section.
 

sunshinex3

You can change this now in User CP.
do you mean give the peon(unit) an ability that can be toggled on and off and this will be a condition?
 

Ghan

Administrator - Servers are fun
Staff member
No, I mean something like this:


Trigger:
  • PEON Copy
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Fel Peon (FelOrc)
    • Actions
      • Set VariableSet TempPoint = (Rally-Point of (Triggering unit) as a point)
      • Set VariableSet Flag = False
      • Unit - Replace (Trained unit) with a Fel Peon (FelOrc0.0) using The old unit's relative life and mana
      • Unit Group - Pick every unit in (Units within 50.00 of TempPoint.) and do (Actions)
        • Loop - Actions
          • Set VariableSet Flag = True
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Gold Mine
            • Then - Actions
              • Unit - Order (Last replaced unit) to Right-Click (Picked unit)
            • Else - Actions
      • If (All Conditions are True then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Flag Equal to False
        • Then - Actions
          • Destructible - Pick every destructible within 50.00 of TempPoint and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked destructible) Equal to (Rally-Point of (Triggering unit) as a destructible)
                • Then - Actions
                  • Unit - Order (Last replaced unit) to Right-Click (Picked destructible)
                • Else - Actions
                  • Unit - Order (Last replaced unit) to Move To TempPoint
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
 

sunshinex3

You can change this now in User CP.
never seen a flag before let me check that out, i tried this kinda thing with a integer system that didn't pan out.
Even Closer Now!!!!
your trigger gets gold and wood but if I'm telling the peon to "move to" location it stands there.
Trigger:
  • PEON Original Copy Copy
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Fel Peon (FelOrc)
    • Actions
      • Set VariableSet TempPoint = (Rally-Point of (Triggering unit) as a point)
      • Set VariableSet TempBool = False
      • Unit - Replace (Trained unit) with a Fel Peon (FelOrc0.0) using The old unit's relative life and mana
      • Unit Group - Pick every unit in (Units within 50.00 of TempPoint.) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Gold Mine
            • Then - Actions
              • Set VariableSet TempBool = True
              • Unit - Order (Last replaced unit) to Right-Click (Picked unit)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBool Equal to False
        • Then - Actions
          • Destructible - Pick every destructible within 50.00 of TempPoint and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked destructible) Equal to (Rally-Point of (Triggering unit) as a destructible)
                • Then - Actions
                  • Unit - Order (Last replaced unit) to Right-Click (Picked destructible)
                • Else - Actions
                  • Unit - Order (Last replaced unit) to Move To TempPoint
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
 
Last edited:

Ghan

Administrator - Servers are fun
Staff member
Again, if there are no units or destructibles near the point (when the rally point is just out on the map somewhere), then it won't do anything in the Loop - Actions portion.
Try adding the flag toggle to the destructible section as well, then create another similar If/then/else block where you check if the flag is false again, and if it is, do the move to point command.
 

sunshinex3

You can change this now in User CP.
figured it!!! all you man this works i don't if its what your talking about but i bet its close
you did it!!! now that i have this figured out i can finally get the zerg dones to work tooo!!!! thank you so much!!!

Trigger:
  • PEON Original GoldWood Copy
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Fel Peon (FelOrc)
    • Actions
      • Set VariableSet TempPoint = (Rally-Point of (Triggering unit) as a point)
      • Set VariableSet TempBool = False
      • Set VariableSet TempBool2 = False
      • Unit - Replace (Trained unit) with a Fel Peon (FelOrc0.0) using The old unit's relative life and mana
      • Unit Group - Pick every unit in (Units within 50.00 of TempPoint.) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Gold Mine
            • Then - Actions
              • Set VariableSet TempBool = True
              • Set VariableSet TempBool2 = True
              • Unit - Order (Last replaced unit) to Right-Click (Picked unit)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBool Equal to False
        • Then - Actions
          • Destructible - Pick every destructible within 50.00 of TempPoint and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked destructible) Equal to (Rally-Point of (Triggering unit) as a destructible)
                • Then - Actions
                  • Set VariableSet TempBool2 = True
                  • Unit - Order (Last replaced unit) to Right-Click (Picked destructible)
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBool2 Equal to False
        • Then - Actions
          • Unit - Order (Last replaced unit) to Move To TempPoint
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)

I'm not a programmer, are their any leaks in this?
 

Ghan

Administrator - Servers are fun
Staff member
I'm not a programmer, are their any leaks in this?
Yeah, unit groups will leak. (Assuming none of that has been fixed in Reforged... I haven't done any research on that)
You should create a unit group variable, set it, do the Pick every unit actions, then remove it to clean up the data similar to what you've done with the point.

I don't actually recall if destructible groups leak. Probably search the forums here to find answers on that one.
 

sunshinex3

You can change this now in User CP.
Complete Trigger Allowing Replaced Unit to Use Training or Summoning Units Rally Point.
Trigger:
  • PEON Original GoldWood Copy
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Fel Peon (FelOrc)
    • Actions
      • Set VariableSet TempPoint = (Rally-Point of (Triggering unit) as a point)
      • Set VariableSet TempBool = False
      • Set VariableSet TempBool2 = False
      • Set VariableSet TempUnitGroup = (Units within 50.00 of TempPoint.)
      • Unit - Replace (Trained unit) with a Fel Peon (FelOrc0.0) using The old unit's relative life and mana
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Gold Mine
            • Then - Actions
              • Set VariableSet TempBool = True
              • Set VariableSet TempBool2 = True
              • Unit - Order (Last replaced unit) to Right-Click (Picked unit)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBool Equal to False
        • Then - Actions
          • Destructible - Pick every destructible within 50.00 of TempPoint and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked destructible) Equal to (Rally-Point of (Triggering unit) as a destructible)
                • Then - Actions
                  • Set VariableSet TempBool2 = True
                  • Unit - Order (Last replaced unit) to Right-Click (Picked destructible)
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBool2 Equal to False
        • Then - Actions
          • Unit - Order (Last replaced unit) to Move To TempPoint
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempUnitGroup)

Thax a lot Ghan!!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Have been talking to a childhood friend who is an Artist and is interested in doing some game music. He has a studio in his house. Yes!
  • The Helper The Helper:
    Going to try and get my friend into the homebrew game indie market he is real interested
  • Varine Varine:
    Does reforged require the port forwarding? Is that even still a thing?
  • The Helper The Helper:
    I do not think that is a thing anymore
  • The Helper The Helper:
    Battle.net is different now and I do not think they are using the same network code
  • The Helper The Helper:
    I am sure they are not
  • tom_mai78101 tom_mai78101:
    Lately, news aren't as enticing as they seemed. Or maybe I'm getting old and desensitized.
  • jonas jonas:
    I think news are more serious recently
  • tom_mai78101 tom_mai78101:
    More serious doesn't necessarily mean it's more interesting. :(
  • The Helper The Helper:
    I find that news.google.com has lots of interesting science stuff going on and the Space X stuff with Starship is super cool too
  • The Helper The Helper:
    plus the boring company and physics stuff happening now but I am more into the science now but there is still some crazy news I see out there using Reddit as a news source though and aggregate services like news.google and stuff and put AP in there I always read the news and yes sometimes it is not as interesting as others
  • The Helper The Helper:
    At some point I am going to look at Xenforo and see if it integrates with Hubspot at all. Would love to look at forum under a full marketing account in Hubspot since I have access to that stuff with my current gig
  • Ghan Ghan:
    Kind of surprised it wouldn't have its own forum product offering.
  • Ghan Ghan:
    That said, when Blizzard switched forum software, they went with Discourse, not xenForo.
  • jonas jonas:
    I think news.google shows you personalized news
  • midnight8 midnight8:
    any of the peeps in here run youtube channels? Figure of all the peeps in this forum, got to be some other geeks like me with channels
  • Ghan Ghan:
    I can say I've uploaded a YouTube video.
    +1
  • The Helper The Helper:
    I can say I know someone that uploaded a youtube video :)
  • jonas jonas:
    A friend of mine has a channel where he uploads some of the crazy machines he has built. Like when he plugged an electric motor into a 3d printed gearbox, attached it to his bycicle and then drove 50mph with it.
  • The Helper The Helper:
    You should post a link to his channel in General Discussion I would definitely check it out

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top