Best way for "eating" points (packman like) with triggers?

Kazuga

Let the game begin...
Reaction score
110
Hi there, I'm currently working on a packman map but I just got stuck when making one of the easiest parts... I want so when a packman unit comes withing a certian amount of range of one of 50-100 point units, a certian trigger will run. Though for some reason I just can't figure how to do this...

All help are welcome.
Good night.
 

Kazuga

Let the game begin...
Reaction score
110
I would have to use one event for each and every unit x number of "packmans"...
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
Unrelated to the question: If your going to make this map, spell the name properly. It's not packman, it's Pacman. There is no k in it.

Ontopic: If your things that Pacman eats are preplaced, you could make a region around each one and detect Pacman entering the region.

Another way would be a perodic trigger, picking every unit/destructible/whatever you use for points in an area around Pacman.
 
S

Slate.Master

Guest
Code:
Teste
    Events
        Unit - A unit comes within 80.00 of Pac-Man
    Conditions
        (Unit-type of (Triggering unit)) Equal to Point
    Actions

Just add the required actions.
 

Slapshot136

Divide et impera
Reaction score
471
ah well then something like this:

event - a unit enters (playable map area)
conditions - unit type of (triggering unit) is equal to (packman)
actions - trigger add event - add (unit within x range of (triggering unit)) to (packman trigger)

or you can pick every packman on the map every second or so and check all the units that are in range.. the above trigger is probably more efficient tho
 

Syndrome

You can change this now in User CP.
Reaction score
126
how bout using Immolation to 'eat' [actually kill] the dots.
then use a trigger to detect if all the Coins are eaten [dead]
 

Kazuga

Let the game begin...
Reaction score
110
Unrelated to the question: If your going to make this map, spell the name properly. It's not packman, it's Pacman. There is no k in it.

Ontopic: If your things that Pacman eats are preplaced, you could make a region around each one and detect Pacman entering the region.

Another way would be a perodic trigger, picking every unit/destructible/whatever you use for points in an area around Pacman.

Thanks for correction. However that would make around 50 to 100 regions wich would be alot of work for something that simple. Sure it works but I believe there is better methods...

how bout using Immolation to 'eat' [actually kill] the dots.
then use a trigger to detect if all the Coins are eaten [dead]
Clever, then I just put the enemies to air so that they aren't affected by the it:rolleyes:.
 
A

Aveng3r

Guest
Clever, then I just put the enemies to air so that they aren't affected by the it:rolleyes:.

But you can change the Target Allows? Or use a different ability like Bladestorm.
 

Kazuga

Let the game begin...
Reaction score
110
But you can change the Target Allows? Or use a different ability like Bladestorm.

Why use bladestorm? Permanent immolation is better since you don't have to activate it. Also with targets allowd you can't change it to a specific type of unit.
 

Frozenwind

System maker
Reaction score
99
If you don't wanna add millions of events wc3 has some function for you:

'Trigger - Add Event'

Just pick every unit of type pacman and add an event for them [elapsed game time = 0.00seconds, or once you create your pacman (if you create, I advise you to use 'Last Created Unit')]:
Code:
Unitgroup - pick every unit of type 'pacman'
    Trigger - add 'Unit comes within 70 range of (Picked Unit)' to trigger "take a coin!"

Condition in your "take a coin!" trigger would be an unittype comparison like mentioned be4:
Slate.Master said:
(Unit-type of (Triggering unit)) Equal to Point
 

OneBadPsycho

10100111001
Reaction score
93
Do something like this if you want your Pacman to be facing the point to collect it:

Red : Change this.
Code:
Collect Point
    Events
        Unit - A unit comes within [COLOR="Red"]Range[/COLOR] of [COLOR="Red"]Unit[/COLOR]
    Conditions
        (Unit-type of ([COLOR="Red"]Unit within range[/COLOR])) Equal to [COLOR="Red"]Point[/COLOR]
        (Facing of ([COLOR="Red"]Unit[/COLOR])) Equal to (Angle from (Position of ([COLOR="Red"]Unit[/COLOR])) to (Position of ([COLOR="Red"]Target[/COLOR])))
        (Facing of ([COLOR="Red"]Unit[/COLOR])) Less than or equal to ((Angle from (Position of ([COLOR="Red"]Unit[/COLOR])) to (Position of ([COLOR="Red"]Target[/COLOR]))) + [COLOR="Red"]20.00[/COLOR])
        (Facing of ([COLOR="Red"]Unit[/COLOR])) Greater than or equal to ((Angle from (Position of ([COLOR="Red"]Unit[/COLOR])) to (Position of ([COLOR="Red"]Target[/COLOR]))) - [COLOR="Red"]20.00[/COLOR])
    Actions
        Add actions...
(Dunno if its the way to specify the angle) :p
 

Frozenwind

System maker
Reaction score
99
OneBadPsycho, almost.
There is a small problem:
Angle between point can be negative. This means it can be -150° instead of 210°.
So you're function would be:

Code:
Collect Point
    Events
        Unit - A unit comes within Range of Unit
    Conditions
        (Unit-type of (Unit within range)) Equal to Point
        OR
            AND
                (Facing of (Unit)) Less than or equal to ((Angle from (Position of (Unit)) to (Position of (Target))) + 20.00)
                (Facing of (Unit)) Greater than or equal to ((Angle from (Position of (Unit)) to (Position of (Target))) - 20.00)
            AND
                (Facing of (Unit)) Less than or equal to ((Angle from (Position of (Unit)) to (Position of (Target))) + 380.00)
                (Facing of (Unit)) Greater than or equal to ((Angle from (Position of (Unit)) to (Position of (Target))) + 340.00)
    Actions
        Add actions...
 

Mmage

New Member
Reaction score
7
Use immolate, wont require any triggers to help kill the dots, just change the unit type of the dots and ghosts (like ancients/trees) and if you need to, change the error messages in game interface.
 
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