| 06-12-2004, 08:16 AM | #1 |
I am making a map in a castle defense sense. There is a big road where each wave of enemies travels down towards the castle, and then there is a trigger at the front of the castle door. It uses a boolean factor. If the door is dead, the boolean is true. If the door is alive, then it is false. My trigger is: A unit enters a region (region in front of door) cond. owner of triggering unit equal to player 12 (monster waves) and "boolean for door" equal to false actions: order triggering unit to attack door. The trigger works fine, but your units are aloud to come out and fight the other units that are attacking your door. Granted, they attack-move to the region where the door is, so if your units come out before they start attacking the door they will fight. But if they reach the region and start attacking the door, i can just take my units out and kill the units attacking the door without them fighting back. i would like to know how to make the units still attack the door as their priority, but if a unit comes near them, they attack it instead. |
| 06-12-2004, 09:26 AM | #2 |
Well, you could add every monster unit that enters the door region to a unit group. Then, you would have another unit group for player controlled units in the door region. If that group is empty (this means that no player units are in the door region), then order the monster unit group to attack the door, otherwise order them to attack move. The triggers would look something like this: 1. E: A unit enters region (RegionInFrontOfDoor) C: Owner of (entering unit) equal to (player 12 (monster waves)) and BooleanForDoor equal to false A: Unit group - Add (entering unit) to (MonstersAtTheGate) If ((random unit from (DefendersAtTheGate)) equal to (no unit)) then order (entering unit) to attack (door) 2. E: A unit enters region (RegionInFrontOfDoor) C: Owner of entering unit equal to (player X (defender)) A: Add (entering unit) to (DefendersAtTheGate) Unit group - pick every unit in (MonstersAtTheGate) and order (picked unit) to attack-move to the gate 3. E: Every 1 seconds of game-time C: A: Unit group - Pick every unit in (DefendersAtTheGate) and do actions actions: If ((picked unit) is in (RegionInFrontOfDoor) equal to (false)) then (remove (picked unit) from (DefendersAtTheGate)) If ((random unit from (DefendersAtTheGate)) equal to (no unit)) then (pick every unit in (MonstersAtTheGate) and do (order (picked unit) to attack (door)) Something like this... you may also need a trigger that removes dead defenders from the unit group, and of course a trigger that, when the door dies, orders all units in (MonstersAtTheGate) to attack further. This way, monsters will attack the gate if no defenders are there to fight them, if the defenders come they will fight them and they will not follow the defenders if they all run away. Hope this helps. |
| 06-12-2004, 04:53 PM | #3 |
Thanks a bunch, I'll try it right now. |
| 06-13-2004, 12:04 AM | #4 |
Anitar, I think your going through a whole lot of unnessecary pain. Why dont you just make a building that looks like the gate, give it however many hit points, and order the computer to attack to it? |
| 06-13-2004, 09:09 AM | #5 |
a) that "gate" then cannot be opened (I don't know if Civ needs that, but anyway) b) without triggers, attackers can still be lured away from the gate if they just use a-move. c) it's not really that much pain ^_^ (well, I just had to add a third reason) |
| 06-13-2004, 12:32 PM | #6 |
a) Sure it can. Just kill the 'gate' unit and revive as nessecary. b) Wouldnt the computer only attack to where it is commanded? If not, just order it to attack the gate. c) Well, not pain, its just sort of a time saver. |
| 06-13-2004, 05:46 PM | #7 |
well, I already did the trigger and it really wasnt that much pain. but i have a new question now, how do you make a unit so that it doesnt take up space. you know, like so that it passes through any buildings you have made? i was thinking of keeping it at 0 movement height and then giving flying movement, but i was wondering if there was a better solution. |
| 06-13-2004, 05:57 PM | #8 |
I believe there is a trigger action "unit - disable pathing" which makes the unit ignore collision. Other units can still collide with it, I think... johnfn b) If it were ordered to attack the gate, then we have the same problem as before, attackers ignoring defenders if they came out to fight them. Anyway, I don't mean to argue, there may indeed be a faster way, but these triggers aren't that slow either, they were the first thing that came to my mind, and they work (hopefully :). |
| 06-14-2004, 09:08 PM | #9 |
Yes they did work, I'm going to see if the pathing one works now. I lost contact with the site halfway through making the trigger, but i was able to get it working. the thing that really helped was just the overall idea of unit groups. |
| 06-14-2004, 09:18 PM | #10 |
I found a trigger called 'turn collision off/on'. I'm trying to make it so that my units can pass through the large gate without it having to be opened for enemies. but the collision thing didnt work. right now the idea is: event: unit enters playable map area cond. [or] any conditions are true- owner of entering unit = to player 1 [red] owner of entering unit = to player 2 [blue] etc... actions: turn collision off for entering unit help? |
| 06-16-2004, 05:03 AM | #11 |
Make a region on one side of the door and one on the other, then make a building, one that looks like a leveler, give it two abillities one to transport units from each side to other, then make this triggers: Event- a unit starts the effect of an abillity Condition-abillity beign cast equal to transport (from inside to out) Actions-Unit group pick every units in regionx owned by owner of casting the do move units(instantly) to regiony. |
| 06-16-2004, 03:45 PM | #12 |
Well I already decided it would be simpler if I just had the gate open. I was trying to avoid that though because the way i do gates i need a unit group for each one, and i didnt want to have to make another 4 unit groups... oh well. i'll give you some rep anyway. |
