| 01-31-2006, 08:30 AM | #1 |
Maybe this question was asked many times before but I didn’t found an answer... How can I make it that when a unit walk behind an enemy unit the enemy can’t see him? I want to create a system that allow you to sneak behind enemies if you don’t want to fight or just want to make a surprise attack. |
| 01-31-2006, 10:21 AM | #2 |
There are few ways to accomplish this. You could make unit always invisible and make enemy units cast Far Sight in front of them, or have in front some dummy units who detect invisible units. Or make enemy units neutral, but when they detect a unit in front of them, they change ownership to enemy etc. |
| 01-31-2006, 11:25 AM | #3 |
I would give Jacek rep but it says I have to spread it around. Anti-spamming feature? The above reply is straight to the point and accomplishes what the poster intended, albeit not very efficiently due to wc3 engine restrictions. Generally, Harel, you will want to incorporate Jass codes if you plan to do this as it is a little process intensive and has very high repetition cycles. Cleaning memory leaks and ensuring efficient coding are vital in situations such as these. I will recommend the 2nd alternative as it doesn't involve dummy unit spell casting/movement/displacement orders. The drawback of the 2nd alternative is that the coding is longer and more tedious. |
| 01-31-2006, 12:43 PM | #4 |
Thanks Azazel. Yes spread around is antispam feature. |
| 02-01-2006, 12:13 PM | #5 |
Thanks Jacek but my problem is detecting when the unit is behind the enemy (I know it sounds like I am a noob). What I wand to do is add a peon classification to the units to remove their auto acquire at map initialization and if the party member is behind the enemy (and there is no party member in front of him) to remove the peon classification. |
| 02-01-2006, 12:22 PM | #6 |
So basicly you want something like stealth? I'll look into it, and get back to you later. |
