| 06-03-2003, 03:44 AM | #1 |
Probably a "duh" question, but how would I achieve this effect? I want, whenever a unit comes close to a certain type of neutral unit (eg not a hero), the neutral unit loads into the first unit like the first unit is a transport. It is fine if the neutral unit becomes under the control of the player that controls the first unit before loading in If that isn't possible, how would I have an item automatically get picked up by the first unit (in which case, the first unit would be a hero) when the first unit comes within a certain distance of it? |
| 06-03-2003, 04:13 AM | #2 |
"If X is in X range of X" "Change control of X" "Order unit LOAD bla bla" Couldn't be easier. Regards (You can also fake it if you do not want to actually transfer control) |
| 06-03-2003, 04:15 AM | #3 | |
Quote:
When you say fake it, do you mean i can order the unit to load anyway? |
| 06-03-2003, 11:55 AM | #4 |
Nope, you can play the move the unit to your pick-up veichle or unit and then remove the unit who moved there, play the load sound, and vouala. If you need to count on how many is loaded, just make a integer variable and make it +1 whenever someone is "loaded". Regards |
| 06-03-2003, 09:36 PM | #5 |
OK Thanks, but I want them to be able to unload, so I'm gonna go with the first one (Thanks anyway though) |
| 06-03-2003, 10:55 PM | #6 | |
Quote:
Is it possible to have it be so that unit comes within 200 of a unit-type? Say I have Peasants, and I want it so that whenever one of my heros comes within 200 range of any peasant, the peasant comes under his control and enters the hero, which is the transport. The heros will not have hero abilities or attack, just the zeppelin unload/load (the items will have the spells in charges, and the peasants will be the "weapons." I tried making a variable for unit-type, but of course, the event is looking for a unit, not a unit-type, so that didn't work. I plan to have the "Peasants" spawn in random locations over the course of the game. Basically I want to know now if there is a way to do this without making separate trigger for each peasant. |
| 06-05-2003, 08:22 PM | #7 |
Does anybody have an idea? |
| 06-06-2003, 07:40 AM | #8 |
Well, in that case, you'll have to assaign all spawned units to an unit arrays variable. Then do an if/then/else and make something like: If (unit in range) equal to UnitArray[1] do run trigger X else do nothing Then make all of these repeated for eatch index you expect the game will go up to. If you have more units, make a different trigger to run, so one makes that and one makes this... In the other trigger (that it tells WC3 to run), do Change ownership of (target in range of X of hero) (or something) to player X Order last owner shipped changed unit enter X, (I am guessing there is one for last ownership changed unit). Regards Dead-Inside |
| 06-06-2003, 07:42 AM | #9 |
Oh, and, it should be something like Event X Cond Action Spawn X in random point in region X Set UnitArray[1] = Last created unit Now, here's the tricky part, you'll probably have to use jass of some sort, you just need to increase the index automaticly every time the trigger has run trough the first to action lines. Since I'm not good with jass, not good at all, you'll have to ask someone else about this. Regards |
| 06-06-2003, 09:05 AM | #10 |
Jass is not necessary to increase the index. Do this: Set UnitArray[n] = Last created unit set n = n + 1 |
| 06-06-2003, 12:10 PM | #11 |
OPS.. Sorry. |
