HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger issues, please help.

03-08-2004, 01:18 AM#1
Thrall_89
Alrighty, heres the problem: On my map, your main "hero" is a ship (mechanical unit) and I made a nice little Repair Bay for you to go to to get repaired for free, basically I'm trying to set the trigger so that it takes your "masons" (repairers) from a little hidden region and moves them over next to your Ship once you enter the Repair Bay region, and once you leave the region (or reach full HP) your Masons get moved back to the little hidden area, I got the trigger to semi-work. I got it to take the units from the region, send them over to your ship, even repair it without trouble... but for some reason it doesnt wan't to send them back to there original area. Heres the trigger. (I highlighted the parts that I THINK may be the source of trouble) The Yellow Highlighted parts are just little notes to help you not to get confused.

Code:
Events: Unit - A unit enters Dry Dock <gen> [color=Yellow](Dry Dock is the repair area)[/color]

Conditions: ((Owner of (Triggering unit)) controller) Equal to (Player 1 (Red) controller)  [color=Yellow](Triggering Unit being the Ship)[/color]

Actions
    Unit Group - Pick every unit in (Units in Player1 Masons <gen>) and do (Actions)
        Loop - Actions
            Unit - Move (Picked unit) instantly to (Center of Dry Dock <gen>)
            Unit - Order (Picked unit) to Human Peasant - Activate Repair
            Unit - Order (Picked unit) to Human Peasant - Repair (Triggering unit)
            [color=DarkRed]Wait until (((Dry Dock <gen> contains (Triggering unit)) Equal to False) or ((Percentage life of (Triggering unit)) Equal to 100.00)), checking every 1.00 seconds
            Unit - Move (Picked unit) instantly to (Center of Player1 Masons <gen>)[/color] [color=Yellow](The Red Highlighted places are the areas I think i may have troubles, the Picked Unit are the Masons from the little side-region)[/color] 



Their it is... hope you can understand it... please help, I've been working on it for quite awhile now, and I have thus far had no luck in getting the end part to work.
03-08-2004, 01:38 AM#2
Zethiros
Oh, oh!
Try this, create another trigger that has no events, or conditions, and has one action (call it MoveMasons):

Code:
Unit Group - Pick every unit in (Units in Dry Dock <gen>) matching (Matching unit equal to RepairMan) and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to (Center of Player1 Masons<gen>)

Create another trigger that looks like this (call it RedBoatLeave):
Code:
Events - A unit leaves (Dry Dock <gen>)
[///Make another event, "units life = 100%", or something (I don't know if this condition exists..?\\\]
Conditions - Leaving unit equal to HeroBoat
Actions - Run MoveMasons ignoring conditions


Also, from the other trigger, remove this:
Code:
Unit - Move (Picked unit) instantly to (Center of Player1 Masons <gen>)
function, and this function:
Code:
Wait until (((Dry Dock <gen> contains (Triggering unit)) Equal to False) or ((Percentage life of (Triggering unit)) Equal to 100.00)), checking every 1.00 seconds
so it reads like this:
Code:
Events: Unit - A unit enters Dry Dock <gen> (Dry Dock is the repair area)

Conditions: ((Owner of (Triggering unit)) controller) Equal to (Player 1 (Red) controller)

Actions
Unit Group - Pick every unit in (Units in Player1 Masons <gen>) and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to (Center of Dry Dock <gen>)
Unit - Order (Picked unit) to Human Peasant - Activate Repair
Unit - Order (Picked unit) to Human Peasant - Repair (Triggering unit)

That way, the second trigger I told you to create activates the first (when the boat leaves the region, or gets full health), and the first orders all the RepairMen to move to the Player1 Masons region.

If that doesn't work, tell me and I'll try to look over what I said again.
03-08-2004, 05:10 AM#3
Pyrus
How about an alternative. Make the dry dock neutral allied and give it the repair ability set on autocast. Or modify the health touch (obsidian statue) so it costs no mana and change the sound.
03-09-2004, 12:50 AM#4
Thrall_89
Well Zethiros, your method would in theory work... but there are a few issues. I suppose its partially my fault since I didn't say that the trigger has to work with multiple players using it at once. So a few of the methods that you listed such as:
Events - A unit leaves (Dry Dock <gen>)
[///Make another event, "units life = 100%", or something (I don't know if this condition exists..?\\\]
Conditions - Leaving unit equal to HeroBoat
Actions - Run MoveMasons ignoring conditions


wouldn't really work... although I did just have a thought on how I may be able to get it too work. Also, I suppose I could just give each player a different repair bay or something, that would solve the major issues. I'll check back later and let you know if it worked or not. Thanks again Zethiros.
03-09-2004, 01:17 AM#5
Zethiros
Sorry, I assumed that there was seperate repair bays for each player.
Tell me if it doesn't work, I'll try to help. ;)

-Edit, if you wanted to know: you can put trigger code into boxes like I did (to make it easier to read, and to not have to use color tags) by using [.code]text[/code].

^_^
03-09-2004, 01:25 AM#6
Thrall_89
Alrighty, well, my idea didn't work because I couldn't order the masons to:

Code:
Unit Group - Pick every unit in (Units in Player1 Masons <gen>) and do (Actions)
    Loop - Actions
        Unit - Move (Picked unit) instantly to (Center of Dry Dock <gen>)
        Unit - Order (Picked unit) to Human Peasant - Activate Repair
        Unit - Order (Picked unit) to Human Peasant - [color=DarkOliveGreen]Repair (Triggering unit)[/color]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Dry Dock <gen> contains (Triggering unit)) Equal to False
            Then - Actions
                Unit - Move (Picked unit) instantly to (Center of Player1 Masons <gen>)
            Else - Actions
                Trigger - Add to (This trigger) the event (Time - Every 0.10 seconds of game time) 

That green-highlighted area didn't work because I was using seperate triggers to que up that trigger, so it had no "Triggering Unit" to target. So, please by all means feel free to knock around some ideas (and, if need be, I am willing to set up seperate repair bays, that isn't too much of a big deal)
03-09-2004, 01:26 AM#7
Thrall_89
lol, oops, it would seem that I put that little Box Coding that you left me in the wrong way... hmm.. o, well... again, feel free to throw around ideas here people!
03-09-2004, 01:35 AM#8
Zethiros
Hehe, easy mistake. ;)
All you did was leave the . before code.
Just delete that, and it should work.
I put that there, because if I didn't, then it would have made the code box and you couldn't have seen the tags.
03-09-2004, 01:37 AM#9
Thrall_89
Code:
Unit Group - Pick every unit in (Units in Player1 Masons <gen>) and do (Actions)
Loop - Actions
Unit - Move (Picked unit) instantly to (Center of Dry Dock <gen>)
Unit - Order (Picked unit) to Human Peasant - Activate Repair
Unit - Order (Picked unit) to Human Peasant - [color=DarkGreen]Repair (Triggering unit)[/color]If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Dry Dock <gen> contains (Triggering unit)) Equal to False
Then - Actions
Unit - Move (Picked unit) instantly to (Center of Player1 Masons <gen>)
Else - Actions
Trigger - Add to (This trigger) the event (Time - Every 0.10 seconds of game time)

Ok, hopefully it has worked now... anyway, please people this trigger is getting me incredibly angry (I'm a bit of a perfectionist so I won't quite until this issue is solved... although in this instance I am willing to settle for multiple Repair Bays if necessary)
03-09-2004, 01:43 AM#10
Zethiros
...
I'm confused about what you added this for:
Code:
Trigger - Add to (This trigger) the event (Time - Every 0.10 seconds of game time)
and if what you [code]'ed was 1, or 2 triggers?
Personally, I think you should just do seperate repair bays.
03-09-2004, 02:31 AM#11
Pyrus
I assume you want the user to see the masons when they are repairing so why not make them invisible. Make them neutral allied and turn off shared vision. or use the hide function to hide them when not in use.

if worse comes to worse you could just leave the masons there.

or maybe it is a syntax error or a variable problem. run through the actual code with dry data. im not a trigger expert so im sorry i cant help much.
03-09-2004, 10:58 PM#12
Thrall_89
Quote:
Originally Posted by Zethiros
...
I'm confused about what you added this for:
Code:
Trigger - Add to (This trigger) the event (Time - Every 0.10 seconds of game time)
and if what you [code]'ed was 1, or 2 triggers?
Personally, I think you should just do seperate repair bays.

Well, basically the thought behind it was that because of this part...

Code:
If - Conditions
(Dry Dock <gen> contains (Triggering unit)) Equal to False
Then - Actions
Unit - Move (Picked unit) instantly to (Center of Player1 Masons <gen>)

because that part wouldn't continuely check it, I had to add the Repeat Timer so that it would keep checking... but it still doesn't work. Anyway, I'll keep trying, I AM going to add multiple Repair Bays in the hope that that will simplify this a bit.
03-09-2004, 11:00 PM#13
Thrall_89
oops, lol, put the / at the end in the wrong spot >_< o well, ill get it...
03-10-2004, 12:09 AM#14
Thrall_89
YES!!!! :o o_O ^_^ :D :8 It's done, I got the trigger to work! Although I feel partially defeated since I had to make seperate repair bays (I realize its not THAT big a deal, but I'm a perfectionist). So *que dramatic music*... here it is:
Code:
Player1 Repair Bay
    Events
        Unit - A unit enters Player1 Dry Dock <gen>
    Conditions
        ((Owner of (Triggering unit)) controller) Equal to (Player 1 (Red) controller)
    Actions
        Unit Group - Pick every unit in (Units in Player1 Masons <gen>) and do (Actions)
            Loop - Actions
                Unit - Move (Picked unit) instantly to (Center of Player1 Dry Dock <gen>)
                Unit - Order (Picked unit) to Human Peasant - Activate Repair
                Unit - Order (Picked unit) to Human Peasant - Repair (Triggering unit)
                Wait 1.50 game-time seconds
                Unit - Order (Picked unit) to Human Peasant - Repair (Triggering unit)
                Wait 1.50 game-time seconds
                Unit - Order (Picked unit) to Human Peasant - Repair (Triggering unit)
        Wait until (((Player1 Dry Dock <gen> contains (Triggering unit)) Equal to False) or ((Percentage life of (Triggering unit)) Greater than or equal to 100.00)), checking every 1.00 seconds
        Unit Group - Pick every unit in (Units in Player1 Dry Dock <gen> owned by Player 9 (Gray)) and do (Actions)
            Loop - Actions
                Unit - Move (Picked unit) instantly to (Center of Player1 Masons <gen>)

Well, I hope your pleased, thanks for all your ideas Zethiros they really helped me get this! Thanks again, fear not friends... I shall be back later when I find yet another trigger for my soon-to-be map that gives me a migrain when I merely think about it, lol!
03-10-2004, 12:12 AM#15
Thrall_89
Oh, by the way, you may have been confused as to why I put multiple actions that target the trigger unit after a few seconds. These were simply safety prodocals, because once the unit starts to repair you, for some reason it would stop repairing if you went behind it, so I set the trigger like that so that if the repairer stops repairing you, it will start up again after 1.5 seconds.