Post New Thread
Results 1 to 4 of 4

Thread: Help with Patrol Trigger

  1. #1
    100 Point Level bryan57s's Avatar
    Join Date
    Dec 2007
    Posts
    187

    Help with Patrol Trigger

    I'm trying to get two custom units named guards (They are almost identical to footmen in the regular game) to patrol back and forth identically to each other. The problem I've been having is that the guards patrol parallel to each other at first, but then they get out of rhythm.

    I had them start on the same vertical line as each other by giving them the same X axis degrees when I created them. The trigger to create the guards is as follows : Events - Map Initialization
    Actions -
    Unit - Create 1 Guard for Neutral Hostile at (Point(-1645.20, -3205.90)) facing Default building facing degrees.
    Unit - Create 1 Guard for Neutral Hostile at (Point(-1645.20, -3393.40)) facing Default building facing degrees.

    I then made sure they would take a straight path by making the points they patrol to have the same Y axis degrees. I also made sure the points they patrolled to were lined up by making them have the same X axis degrees. I selected the created Guards by creating regions where they would appear and using the Unit Group function to make them patrol. The trigger to make them patrol is as follows:
    Events - Map Initialization
    Actions -
    Wait 1.00 seconds
    Unit Group - Order (Units in Region 000 <gen>) to Patrol To (Point(-2541.70, -3205.90))
    Unit Group - Order (Units in Region 001 <gen>) to Patrol To (Point(-2541.70, -3393.40))

    Does anyone know a way I could make them align much more perfectly?
    The file is attached if you want to check it out. It's only the beginning of a map.
    Attached Files
    ______________________________
    It is not the strongest opponent that wins, but the strongest willed.

    They have the plant, but we have the power.

  2. #2

    It looks pretty close to me. Simplest method to achieve what you want would be to make a trigger that checks for either guard entering region 001 or 000 and then orders it to halt until the other one enters the region, then order both to resume patrolling. You could also do a "Wait until" Action which waits until the X-coordinate of one equals the X-coordinate of the other before resuming patrol. Either way should work.

    Also I believe the pathing algorithm is what is causing the discrepancy, I tried removing the rock doodads you placed and there was no deviation.
    ______________________________
    Quote Originally Posted by nelfandmeisimba
    Now tediously microing units with sophisticated mechanics is quite another thing, and is why I'll always enjoy WC3's micro emphasized game play more so than SC2's accountant like game play.

  3. #3
    100 Point Level bryan57s's Avatar
    Join Date
    Dec 2007
    Posts
    187

    Thanks for the help! I got rid of the doodads, but another problem came up. I'm trying to make it so that once a ghoul reaches a certain region, it revives any other ghouls that may have died and teleports them to him. I thought it would be cool if when the ghouls teleported, it looked like they were being summoned via diamond of summoning (the cool green line), Also, I couldn't figure out how to resurrect regular units (not heroes) without the spell resurrection. I decided to make an invisible dreadlord teleport in, create two items for him, one that uses an item form of resurrection, and a diamond of summoning. I was then going to have him use the items and teleport out. I tried it, and it didn't work. I tried switching some things around, like the amount of time in between the actions, but it doesn't seem to work. There is probably a much simpler way to do this, but I can't find it. The trigger is called first graveyard under graveyards if you would be so kind as to help me out.
    Attached Files
    ______________________________
    It is not the strongest opponent that wins, but the strongest willed.

    They have the plant, but we have the power.

  4. #4

    In the actual game corpses cannot be resurrected after a certain time period ("decay time"). Have you checked that? You might do some debugging with the "For Unit in Group..." actions, those can be helpful for say selecting all units in a group and the printing their names on the screen to give you a better idea of what's going on.

    Also in your trigger you are targeting the item on the "Center of Playable Map Area", I don't see anything there or why that would be relevant to bringing back the corpses? The spell "Resurrection" is also missing from the drop down list of Human Hero spells, so I don't know where that spell "Resurrection" in the item Ability list is even coming from. It would probably be a lot simpler to just create a new ghoul for a player who loses their ghoul.
    ______________________________
    Quote Originally Posted by nelfandmeisimba
    Now tediously microing units with sophisticated mechanics is quite another thing, and is why I'll always enjoy WC3's micro emphasized game play more so than SC2's accountant like game play.

Post New Reply

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts