HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Addons

11-19-2003, 04:02 AM#1
Oinkerwinkle
I'm trying to make addons, like the Terran had them. Essentially it works, but there is one instance in which it does not. Here is a flow-chart type thing of what I'm dealing with so far.
Code:
Begin Construction ------> Complete
                     --> Cancel from Addon
                     --> Cancel from Addon-er
                     --> Addon dies
                     --> Addoner dies
Everything there works except the addon death. Bizzarrely enough, the addon death and and addon cancel use the same trigger, just with two events. One event makes it work, one doesn't. Here is my trigger.
Code:
Cancel from add on
    Events
        Unit - A unit Cancels construction
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Addon
    Actions
        Trigger - Turn off (This trigger)
        Unit Group - Pick every unit in (Units within 10.00 of ((Position of (Triggering unit)) offset by (-224.00, 96.00)) matching ((Unit-type of (Matching unit)) Equal to Adder Onner)) and do (Actions)
            Loop - Actions
                Selection - Clear selection for (Owner of (Triggering unit))
                Selection - Add (Picked unit) to selection for (Owner of (Triggering unit))
                Game - Force (Owner of (Triggering unit)) to press Escape/Cancel
        Selection - Clear selection for (Owner of (Triggering unit))
        Game - Display to (All players) the text: Cancelled
        Trigger - Turn on (This trigger)
Thanks for any help.
11-19-2003, 06:53 AM#2
Newhydra
Try using dying unit instead of triggering unit...(and split it into two triggers or use an if statement creativly)
11-19-2003, 01:36 PM#3
Vexorian
Quote:
Originally posted by Newhydra
Try using dying unit instead of triggering unit...(and split it into two triggers or use an if statement creativly)


For the last time, (triggering unit) is always better than the other event response triggers, also please specify which event works.
11-19-2003, 05:17 PM#4
Newhydra
It is not always better vex. Many times things don't work if you use triggering unit, and changing them to use the specific response will work (it may be the case with unit death). I assumed that it doesn't work when the unit dies, and thus changing it from triggering unit to dying unit would be a logical thing to try(since things aren't working). If his problem was with the canceling I'll have to look into it more.

However, in this case his problem is unrelated to that. I just made a trigger
Events:
Unit - A unit Dies
Unit - A unit Cancels construction
Conditions: -
Actions: Unit Group - Pick every unit in (Units in (Region centered at (Position of (Triggering unit)) with size (300.00, 300.00))) and do (Actions)
Loop - Actions
Unit - Kill (Picked unit)
Game - Display to (All players) the text: (Name of (Cancelled structure))
Unit - Create 1 (Unit-type of (Triggering unit)) for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees


And it works fine.
11-20-2003, 02:45 AM#5
Oinkerwinkle
I got it to work, thanks for all the help. I'm not sure exactly what the critical change was, though.