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

Build a Waygate Problem

Status
Not open for further replies.
Level 3
Joined
Aug 29, 2004
Messages
57
I have a small trigger problem. You see I have a map that is chock full of destructibles (Every piece of space is filled.). Now I have a trigger that checks if a player builds a waygate. If he does then the trigger will then kill some destructibles in a circle in a random point within a region and create a sister waygate at that point. Then it will link the two up via 'set waygate destination'. For some reason I can't get my trigger to work. The created waygate never appears in the right region and is not linked to the built one. Neither do any destructibles die at all. Does anyone know how to create a trigger that can accomplish what's described above??
 
Level 6
Joined
Aug 29, 2004
Messages
159
This should work like diddly

Waygate
Events
Unit - A unit Finishes construction
Conditions
(Unit-type of (Triggering unit)) Equal to Waygate
Actions
Set WayGatePoint = (Random point in WayGateRegion <gen>)
Destructible - Pick every destructible within 500.00 of WayGatePoint and do (Destructible - Kill (Picked destructible))
Unit - Create 1 Waygate for (Owner of (Triggering unit)) at WayGatePoint facing Default building facing degrees
Unit Group - Pick every unit in (Units within 50.00 of WayGatePoint matching ((Unit-type of (Picked unit)) Equal to Waygate)) and do (Neutral Building - Set (Triggering unit) destination to (Position of (Picked unit)))

I haven't actually tried it, but it should work just fine
You need a variable WayGatePoint and a region WayGateRegion (i like to keep my variables and regions self explanitory :wink: )

Hope that helps
Bort
 
Level 6
Joined
Aug 29, 2004
Messages
159
ironhelm said:
isnt it possible to decrese the collison size so he wont need to destroy destructables?

Probably is but then where would his units go :roll: ? See it is a waygate... need some room around it for your guys

Bort
 
Level 3
Joined
Aug 29, 2004
Messages
57
One final thing guys. Bort's trigger code works nicely, however it won't link the built waygate and the newly created waygate together upon completion of building one. After tinkering around and examining the trigger I still can't figure out what's wrong.
 
Level 6
Joined
Aug 29, 2004
Messages
159
Bort said:
Unit Group - Pick every unit in (Units within 50.00 of WayGatePoint matching ((Unit-type of (Picked unit)) Equal to Waygate)) and do (Neutral Building - Set (Triggering unit) destination to (Position of (Picked unit)))

Umm...

Change that so it reads something like (dont have worldedit open)
Pick every unit in (Units within 50.00 of WayGatePoint matching ((Unit-type of (Picked unit)) Equal to Waygate)) and do Set Waygate=Picked unit
(Neutral Building - Set (Constructed Structure) destination to (Position of (Waygate)))

Umm... that should work.. substituting 'triggering unit' with 'constructed structure'.. and setting the other waygate as a new variable just in case. Oh yeah the new variable is Waygate a unit variable

Hope that fixes the problem
Bort
 
Level 3
Joined
Aug 29, 2004
Messages
57
....You're not going to like this Bort but your latest solution doesn't seem to work either. Neither does using 'last created unit group', 'units in region matching condition' or changing the ownership of the waygates to neutral. Also there is no difference change in results when using 'constructed structure' as opposed to 'triggering unit'. I'm starting to think this is impossible.
 
Level 7
Joined
Jul 30, 2004
Messages
451
Nogusta said:
....You're not going to like this Bort but your latest solution doesn't seem to work either. Neither does using 'last created unit group', 'units in region matching condition' or changing the ownership of the waygates to neutral. Also there is no difference change in results when using 'constructed structure' as opposed to 'triggering unit'. I'm starting to think this is impossible.

Code:
Waygate
    Events
        Unit - A unit Finishes construction
    Conditions
        (Unit-type of (Constructed structure)) Equal to Waygate
    Actions
        Set pointDest = (Random point in (Playable map area))
        Destructible - Pick every destructible within 512.00 of pointDest and do (Actions)
            Loop - Actions
                Destructible - Kill (Picked destructible)
        Unit - Create 1 Waygate for (Owner of (Constructed structure)) at pointDest facing Default building facing degrees
        Neutral Building - Enable (Last created unit) //Not sure if this is needed
        Neutral Building - Set (Constructed structure) destination to (Position of (Last created unit))
        Neutral Building - Set (Last created unit) destination to (Position of (Constructed structure))

as long as ur constructed waygate has the waygate abilities this will work
 
Level 3
Joined
Aug 29, 2004
Messages
57
Oh my god. Finally the mystery is over. From the information I've gathered I finally found the missing part of the trigger. Raptor's trigger doesn't work alone it just needed a single line:
'neutral building Enable (constructed structure)' and poof it works. Thx guys I really owe you all one this time.
 
Status
Not open for further replies.
Top