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
888
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
888
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
888
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
888
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
888
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
888
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.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top