Picking up Locusts?

San-D

New Member
Reaction score
15
I have a little problem the following trigger is not working:

Code:
Begin
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Forst Gift 
    Actions
        Set Caster = (Casting unit)
        Destructible - Pick every destructible in (Region centered at (Position of (Casting unit)) with size (3500.00, 3500.00)) and do (Actions)
            Loop - Actions
                Set Destructable = (Picked destructible)
                Unit - Create 1 Forest Dummy for (Owner of (Casting unit)) at (Position of Destructable) facing Default building facing degrees
        Set Spirit270to90 = (Units within 4000.00 of (Position of Caster) matching (((Unit-type of (Matching unit)) Equal to Forest Dummy) and (((Angle from (Position of Caster) to (Position of (Matching unit))) Greater than 270.00) and ((Angle from (Position of Caster) to (Position of 
        Unit Group - Order Spirit270to90 to Move To (Position of Caster)

It creates the dummies, but it doesnt move those who are from 270 to 90 degrees of the caster!
 

Ghostwind

o________o
Reaction score
172
"Destructible" is a useless global that makes your spell non-MUI... why have it? Even if picked destructible leaks, think about it, you have one use of that in your trigger, so it doesn't minimize the leak at all, it just puts it in another unnecessary line of code.
 

San-D

New Member
Reaction score
15
um...wut?:confused:
my question is: is this line the problem:

Set Spirit270to90 = (Units within 4000.00 of (Position of Caster) matching (((Unit-type of (Matching unit)) Equal to Forest Dummy) and (((Angle from (Position of Caster) to (Position of (Matching unit))) Greater than 270.00) and ((Angle from (Position of Caster) to (Position of Matching unit) Lesser than 90.00))

because it doesnt move the units!
 

Ghostwind

o________o
Reaction score
172
Although this probably won't help you much, just to make the trigger more efficient, replace this:

Code:
Set Destructable = (Picked destructible)
Unit - Create 1 Forest Dummy for (Owner of (Casting unit)) at (Position of Destructable) facing Default building facing degrees

With this:

Code:
Unit - Create 1 Forest Dummy for (Owner of (Casting unit)) at (Position of (Picked destructible)) facing Default building facing degrees

Because it only leaks once, and makes your spell MUI.
MUIness > Removal of 1 leak.
 

Flare

Stops copies me!
Reaction score
662
MUIness > Leak removal.

No offense, but what kind of mad notion is this? You would rather be able to cast the spell multiple times than have horrific lag half-way through the game?

His trigger is MUI anyway. Assigning the destructible to a variable won't make a difference unless he adds a wait (THEN the MUI would be out the window). Assigning variables to units/destructibles/other non-leaky things in a wait-less trigger doesn't make it any less MUI...

And, there's alot more than 1 leak. It leaks once for EVERY destructible in that group. You have 400 destructibles, you have 400 leaks. You'll need to set the destructible's position to a variable, refer to that when spawning your dummy, then destroy the point all within the group. And the actions below the group leak as well (creating a unit group without a var, not referring to a point var when using points).

Ahm, can you post the rest of this?
Code:
(Angle from (Position of Caster) to (Position of

It's the second condition for the Spirit270to90 group. Also, instead of giving a group order, try "Pick every unit in unit group and do action: Order picked unit to move to (point)
 

San-D

New Member
Reaction score
15
Code:
Set Spirit270to90 = (Units within 4000.00 of (Position of Caster) matching (((Unit-type of (Matching unit)) Equal to Forest Dummy) and (((Angle from (Position of Caster) to (Position of (Matching unit))) Greater than 270.00) and ((Angle from (Position of Caster) to (Position of Matching unit) Lesser than 90.00))
 

San-D

New Member
Reaction score
15
What I meant to say and did not write down was that I think the problem is that the dummy is a Locust and maybe thats why it cant be picked up by "Pick every unit in unit group" function

SO CAN ANYONE TELL ME WHY THEY DONT MOVE (THE UNITS THAT ARE WITHIN THE RANGE OF 90->270 DEGREES OF CASTER)?
 

Ghostwind

o________o
Reaction score
172
No offense, but what kind of mad notion is this? You would rather be able to cast the spell multiple times than have horrific lag half-way through the game?

1 leak =! Lag.
Also, putting in a global doesn't remove that leak, it just moves it.

What I meant to say and did not write down was that I think the problem is that the dummy is a Locust and maybe thats why it cant be picked up by "Pick every unit in unit group" function

You should search for "Units of type (dummy)"
 

San-D

New Member
Reaction score
15
i understood what u said bu I just want to point out - Im not swapping destructables with dummies, I am creating dummies above trees(just gotta ad a destructable type comparison)
 

Ghostwind

o________o
Reaction score
172
Can't you just pick all of the destructibles (looks like you have that down already) and create 1 unit at its position facing the caster?

And there is no destructible group option. There might be in jass, though.
 

San-D

New Member
Reaction score
15
NO I CANT! The idea of the ability is to sort out those dummies, which are generaly to the unit's left, from those who are on the unit's right and make them do different things! If I use every destructable, there is no point!
 

Flare

Stops copies me!
Reaction score
662
Then do this within the Pick every Destructible loop, after creating the forest dummy

Code:
Add (Last Created Unit) to Spirit270to90

Then, you can just pick every unit in that group, check the angles between dummies position and casters position (not as a UG condition, but as an If/Then/Else within the UG loop). If the angles are correct, do what needs to be done within the Then part of the if/then/else
 

San-D

New Member
Reaction score
15
Listen, heres my code:

Code:
Begin
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Forst Gift 
    Actions
        Set Caster = (Casting unit)
        Destructible - Pick every destructible within 3500.00 of (Position of Caster) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Angle from (Position of Caster) to (Position of (Picked destructible))) Greater than or equal to 90.00
                        (Angle from (Position of Caster) to (Position of (Picked destructible))) Less than 270.00
                    Then - Actions
                    Else - Actions

how to continue so that i create dummies on the left and mark them Group1 and dummies on the right marked Group2? I cant make it any clearer!
I KNOW THERE ARE LEAKS, PLEASE GIVE THEM A REST FOR NOW!!!!
 

Flare

Stops copies me!
Reaction score
662
In your Then actions, create your unit and add it to (Group used for units on the left).

In your Else actions, create your unit and add it to (Group used for units on the right).

Your conditions look fine, and if units aren't between 90 and 270 degrees, they are on the caster's right side I believe.

And there's no need to use caps, we are only trying to help you get the trigger working as well as possible.
 

San-D

New Member
Reaction score
15
K

Code:
Begin
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Forst Gift 
    Actions
        Set Caster = (Casting unit)
        Destructible - Pick every destructible within 3500.00 of (Position of Caster) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Angle from (Position of Caster) to (Position of (Picked destructible))) Greater than or equal to 90.00
                        (Angle from (Position of Caster) to (Position of (Picked destructible))) Less than or equal to 270.00
                    Then - Actions
                        Unit - Create 1 Forest Dummy for Player 1 (Red) at (Position of (Matching destructible)) facing Default building facing degrees
                        Unit Group - Add (Last created unit) to Spirit90to270
                    Else - Actions
                        Unit - Create 1 Forest Dummy for Player 1 (Red) at (Position of (Matching destructible)) facing Default building facing degrees
                        Unit Group - Add (Last created unit) to Spirit270to90
        Unit Group - Pick every unit in Spirit90to270 and do (Unit Group - Order Spirit90to270 to Move To (Position of Caster))

Problem N3: It only moves the Dummies from 2nd quadrant (90->180), somehow it doesnt read the conditions right! I experimented with the values and changing left/right to up/down (90,270 to 0,180) and it doest work at all!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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