Locust ability

Blink'd

New Member
Reaction score
0
The locust ability is fun and all, but it also makes things alot more complicated in the GUI. I don't know if the same problem also exists in JASS or anything else, but i am quite sure it does.

Now this is the scenario:
There is this building (Lets say its a Lumber mill) when you build it, it spawns a couple of units (peasants) wich automaticly gather wood for you. I dont want those units to be used for anything else except gathering wood so i gave them the ability locust.

Everything is working so far, except for this:
Once the Lumber mill dies the gathering peasants will still be there and they cant gather wood because the mill is destroyed. So the peasants must also die when the Lumber mill dies. But the Peasants won't respond to;( Pick every unit within Range of Lumber mill ) because they cannot be picked with the ability Locust on them. I haven't found any other solution on the problem then a solution with that triggerin part in it.

If anyone could find an alternative solution for this problem, or can fix the problem i have with the ( Pick every unit within Range of Lumber mill ) i would appreciate it.
 
and instead of locust, you can use unselect :p
so will work any other thing, except select of a player
 
Unselect is indeed to slow, because if the player is able to move the peasant for one second, they won't gather wood anymore, and the loop of actions will be broken.

@Nexor;

After a quick look trough the GUI i couldnt find the;

Pick every unit of unit-type Command
 
I found it. But now a new problem pops up.
This is what i had in the first trigger:

Trigger:
  • Spawn Kill Lumbermill
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Lumber Mill
    • Actions
      • Unit Group - Pick every unit in (Units within 400.00 of (Position of (Dying unit))) 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 Peasant
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
              • Do nothing


Now i must have something like this:

Trigger:
  • Spawn Kill Lumbermill
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Lumber Mill
    • Actions
      • Unit Group - Pick every unit in (Units of type Peasant) 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 Within 400 of Lumber Mill
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
              • Do nothing


Aparently
(Unit-type of (Picked unit)) Equal to Within 400 of Lumber Mill
Does not exist.
 
Pick every unit in range MATCHING CONDITION... in matching condition you put "unit-type of matching unit equal to peasant....

also remove that Do Nothing
why?
because do nothing DO NOTHIGN! :nuts:
 
You can set at the condition, to apply more conditions using the Boolean - And function. there you can set both conditions.
 
You can set at the condition, to apply more conditions using the Boolean - And function. there you can set both conditions.

he don't need it... that "And - all conditions are true" is just to do something like this:

Trigger:
  • .
    • if
      • Or
        • and
          • unit say hi
          • player say hi
      • or
        • and
          • unit say bye
          • player say bye
    • then
    • else


the 'default' condition part in warcraft is set to "all conditions NEED to be true or don't will run
 
Trigger:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Peasant) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between (Position of (Triggering unit)) and (Position of (Triggering unit))) Less than or equal to 400.00
            • Then - Actions
            • Else - Actions


Something like this, it leaks two points and one unitgroup though, you have to remove those.
 
Trigger:
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Peasant) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between (Position of (Triggering unit)) and (Position of (Picked unit))) Less than or equal to 400.00
            • Then - Actions
            • Else - Actions

Slight event response error, you want "Picked Unit" for the second one.
 
@Laiev: If you dont put "Do nothing" there, the game crashes when the picked unit is not a peasant.

@Nexor: And thanks for the sample of the action, that was the only thing missing to seal the deal.

Thanks you people :p
 
@Laiev: If you dont put "Do nothing" there, the game crashes when the picked unit is not a peasant.

@Nexor: And thanks for the sample of the action, that was the only thing missing to seal the deal.

Thanks you people :p

Do nothing is a stupid function which blizzard create just because have nothing more to do -.-'

Your WE is broken[2]
 
Wrong. If you use the singular/one line If/Then/Else, then you HAVE to fill all slots, which is why Do Nothing is there.
 
Wrong. If you use the singular/one line If/Then/Else, then you HAVE to fill all slots, which is why Do Nothing is there.

Not too right....

you can just put a custom script //comenthere just to warcraft don't read it
 
I was just doing a test map, so i wasn't really paying much attention to the little things, and adding a "Do Nothing" Action there was enough to fix it.
 
The locust ability is fun and all, but it also makes things alot more complicated in the GUI. I don't know if the same problem also exists in JASS or anything else, but i am quite sure it does.

Now this is the scenario:
There is this building (Lets say its a Lumber mill) when you build it, it spawns a couple of units (peasants) wich automaticly gather wood for you. I dont want those units to be used for anything else except gathering wood so i gave them the ability locust.

Everything is working so far, except for this:
Once the Lumber mill dies the gathering peasants will still be there and they cant gather wood because the mill is destroyed. So the peasants must also die when the Lumber mill dies. But the Peasants won't respond to;( Pick every unit within Range of Lumber mill ) because they cannot be picked with the ability Locust on them. I haven't found any other solution on the problem then a solution with that triggerin part in it.

If anyone could find an alternative solution for this problem, or can fix the problem i have with the ( Pick every unit within Range of Lumber mill ) i would appreciate it.

havn't read all comments but whenever i create units with locust ability i put them into a unit group.... when i want them removed i removed them through the unit group.

Etc; make an UnitGroup Array, and "register" every Lumber Mill to a designated Array slot. When you create a Lumber Mill, save all created "Locust Peseants" to that Lumber Mill's Array slot.

When a Lumber Mill dies, pick all units in the UnitGroup Slot for that Lumber Mill and kill all units.

edit// Not sure how you spawn those Peseants, but to put them in the unit group I think you have to use "last created unit" for "Locust" using units.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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