Replaced worker mine gold from rally point

sunshinex3

You can change this now in User CP.
Reaction score
7
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?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Try issuing a right-click command instead of a move command.
 

sunshinex3

You can change this now in User CP.
Reaction score
7
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
Reaction score
889
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.
Reaction score
7
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
Reaction score
889
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.
Reaction score
7
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
Reaction score
889
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.
Reaction score
7
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
Reaction score
889
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.
Reaction score
7
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
Reaction score
889
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.
Reaction score
7
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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • 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!
  • 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

      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