| 07-07-2003, 06:00 AM | #1 |
This is a tricky problem. Let me explain the system I am using: When the bad guys kill a good unit, it randomly (10%) creates a unit of type "Slave" for the owner of killing unit. These slave units are worker class and have the harvest ability. The bad guys then can use these slaves to harvest gold, etc. BUT...I would like these slaves to be rescuable in the sense that when a good hero comes within X range, it switches control to the owner of triggering unit. These slaves could then be returned to a region for a reward. The problem, of course, is that these slaves are created in-game and not pre-placed. Therefore I cannot use the "Unit comes within range" trigger. Now, I tried to do it backwards by putting the hero in a unit array and then using "Hero[1] comes within range" but it won't let me select the variable; it is greyed out. Any ideas? Oh, I'm using the 1.10 RoC editor. Hakujin |
| 07-07-2003, 06:22 AM | #2 |
Event- Unit comes into play of type slave Actions- Unit- Make entering unit rescueable Unit- Set rescue range for entering unit |
| 07-07-2003, 07:17 PM | #3 |
Why dont u make it so a slave needs to be attacked to be rescued, that way sumone wudnt be able to just run into the enemies and take all their slaves with no effort, AND it wud be easier trigger wise |
| 07-08-2003, 12:24 AM | #4 |
this may work condition - every 1 second of game time Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Slave)) and do (Unit Group - Pick every unit in (Units within 150.00 of (Position of (Picked unit)) matching ((Unit-type of (Matching unit)) Equal to Your Heroes)) and do (Unit - Change ownership of (Matching unit) to (Owner of (Picked unit)) and Change color)) only way i can figure to do it is to make it look for specific heroes, but there should be a way to do it with any unit |
| 07-08-2003, 02:03 AM | #5 |
You could do the Unit comes in range of (Hero) Then use a condition to see that the unit coming into range is of the type slave... If the hero approaches a slave, they both come withing range of each other so you can use your hero as the preplace unit instead ;) |
| 07-08-2003, 08:13 AM | #6 |
Dinadan, That was the way I was going to do it, but WE won't let me select a variable for "Unit comes within Range of." If it allowed me to, I would just but use a Hero unit array. Maybe I need to wait for the new USM... Good ideas above but the only one I can use that allows player-generated units to capture slaves would be "Unit is attacked." I'll code that as a stopgap. Thanks everyone! Any other ideas? Hakujin |
