• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

attack move creeps

Status
Not open for further replies.
Level 2
Joined
Oct 6, 2007
Messages
19
this is the map: (<X>spawnbuilding, <:>path of the creeps, <,>rest of the map
(1).........(2)
X::::::::::X
::,,,,,,,,,,,::
::,,,,,,,,,,,::
::,,,,,,,,,,,::
X::::::::::X
(3).........(4)
how do I make 5 creeps walk from 1, 2, 4, 3 and another 5 creeps from 1, 3, 4, 2??
pls help me because without it i can´t finish the map
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
hmm interesting question
first create a variable with 4 array named goregions
put 4 regions to each point and set them to goregions
goregions[1] = region in 1
goregions[2] = region in 2
goregions[3] = region in 3
goregions[4] = region in 4
then add custom value 1 to first creep group
and 2 to second creep group
then order 1sts to move regions[1] and 2nds to move regions[3]

another event unit enters region 3
if unit type is creep
if custom value of entering unit is 1
order it to move goregions[1]
else order it to move goregions[4]

hmm wait you dont need variables to do this anyway goodluck +rep if it works AND if you want to give
 
Level 35
Joined
Oct 9, 2006
Messages
6,394
first create a variable with 4 array named goregions
put 4 regions to each point and set them to goregions
goregions[1] = region in 1
goregions[2] = region in 2
goregions[3] = region in 3
goregions[4] = region in 4
If you dont know how this is done, then it is done in actions: set variable.
Make sure that the variable you make is for regions.
(For the group trigger I suggest you would have to make two group variables also)

then add custom value 1 to first creep group
and 2 to second creep group
then order 1sts to move regions[1] and 2nds to move regions[3]
This could be done by making them groups insted, and then just make the condition check if the triggering unit belonged to Group 1 or 2, (dunno if you mean you make them groups first and then add value or if you just pick them and add value)

another event unit enters region 3
if unit type is creep
if custom value of entering unit is 1
order it to move goregions[1]
else order it to move goregions[4]

Here you go:
  • Events
    • Unit - A unit enters region 3
  • Conditions
    • And - All Conditions are true
      • Owner of Triggering Unit Equal to Player 12 Brown
      • Custom Value of Triggering Unit Equal to 1
  • Actions
    • Order Triggering unit to Move to (Region 1)
This could be done with the "if else action" also, but I prefer having those in separete triggers, as it makes it more simpel when adding more to the trigger.
Do the same thing with the other units, just where the condition checks if they got value 2 or so. (Or what group they are from, if your using groups)

hmm wait you dont need variables to do this anyway goodluck +rep if it works AND if you want to give
Generally it is more polite not to ask for rep at all....
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
What I would do, mattie, is;

If [unit should move clockwise] set Custom Value = region array index
If [unit should move counterclockwise] set Custom Value = region array index + 4

Then, when a unit enters any of the regions;

If - Custom value < 5
----Order the unit to move to Regions[Custom Value] //This can be 1/2/3/4
Else
----Order the unit to move to Regions[9-Custom Value] //this can be 5/6/7/8, resulting in 4/3/2/1
[end of if-statement]
set Custom Value = Custom Value + 1


EDIT: Red_Baron beat me to it, but my way saves triggers and such ;)
 
Status
Not open for further replies.
Top