• 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.

[Trigger] Moving all units except one?

Status
Not open for further replies.
Level 10
Joined
Aug 22, 2008
Messages
359
I'm currently making a cinematic series, wich I believe will be pretty good (I'm not a total noob, I got some skills in cinematic ;P). However there is one thing I need help with.

It's in a small town, so there's alot of villagers walking around, the triggers for that looks like this: (example)

helpva4.png


Now my problem is that the main character is also in that region, so it moves too, but I don't want him to randomly walk around, so how do I make that all units in the region but him do as the trigger says?

I hope you understand what I mean, thx.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
  • Actions
    • Set tempgroup = (Units in Rect 015 <gen>)
    • Set unit = (Random unit from tempgroup) matching (Unit-type of (Matching Unit) not equal to *your main character*)
    • Set temppoint = Random point in Rect 012 <gen>
    • Unit - Order unit to move to temppoint
    • Custom script: call RemoveLocation(udg_temppoint)
    • Custom script: call DestroyGroup(udg_tempgroup)
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
You can't get it any easier. These are basic triggers.


Set tempgroup = (Units in Rect 015 <gen>)
This is a 'Set Variable' Action (Unit Group Variable)
Set unit = (Random unit from tempgroup) matching (Unit-type of (Matching Unit) not equal to *your main character*)
This is a 'Set Variable' Action (Unit Variable)
Set temppoint = Random point in Rect 012 <gen>
This is a 'Set Variable' Action (Point Variable)
Unit - Order unit to move to temppoint
This is a regular Action
Custom script: call RemoveLocation(udg_temppoint)
Custom script: call DestroyGroup(udg_tempgroup)

These are Custom Scripts. You simply copy the texts 'call RemoveLocation(udg_temppoint' and 'call DestroyGroup(udg_tempgroup)', and paste them in a Custom Script Action.

If you need more info about any part of this, just ask and I'll explain further about them or give you a link that can provide understandable and detailed info about them.
 
Status
Not open for further replies.
Top