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.
 

Laiev

Hey Listen!!
Reaction score
188
and instead of locust, you can use unselect :p
so will work any other thing, except select of a player
 

Blink'd

New Member
Reaction score
0
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
 

Blink'd

New Member
Reaction score
0
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.
 

Laiev

Hey Listen!!
Reaction score
188
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:
 

Nexor

...
Reaction score
74
You can set at the condition, to apply more conditions using the Boolean - And function. there you can set both conditions.
 

Laiev

Hey Listen!!
Reaction score
188
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
 

Nexor

...
Reaction score
74
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.
 

HydraRancher

Truth begins in lies
Reaction score
197
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.
 

Blink'd

New Member
Reaction score
0
@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

Hey Listen!!
Reaction score
188
@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]
 

HydraRancher

Truth begins in lies
Reaction score
197
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.
 

Laiev

Hey Listen!!
Reaction score
188
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
 

Blink'd

New Member
Reaction score
0
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.
 

haxic

New Member
Reaction score
2
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 Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top