Trigger redirection differences?

Started by Sheng Long, October 23, 2013, 08:31:18 PM

Previous topic - Next topic

Sheng Long

What's the difference between using something like EnemyNear, and EnemyNear(0)? I'm reading the docs, but this is all I get:

Quote
- EnemyNear
Redirects the trigger to the nearest opponent.

- EnemyNear(n)
n should be a well-formed expression that evaluates to a non- negative integer. The trigger is redirected to the n'th-nearest opponent.

I'm still a little confused. If I use EnemyNear(0), does that check if there are 2 players vs 1 player team vs, and the nearest enemy is ID 1, while the other enemy is ID 0, the trigger only checks if ID 0 is near the character? And does regular EnemyNear checks for both ID 0 and ID 1?
And what happens if I use something higher than 0 or 1 as the EnemyNear(n) trigger?

I'm just trying to clarify, getting my notes right.

"You must defeat my flaming
dragon punch to stand a chance."

Ricepigeon

Ive always used enemynear(0) but I do believe that enemynear and enemynear(0) are functionally identical.

Алексей

Those two statements are the same, but the difference lies in the fact that you can specify an index greater than 0. That's why it exists. I suppose you can consider "enemynear" to be a shortcut for "enemynear(0)."

-[Все слова это только слова.]-

Sheng Long

So what's the difference? EnemyNear does any nearest enemy, enemynear(0) does a specific enemy with ID 0? Or does both EnemyNear, and EnemyNear(0) do the exact same thing? If they're the same, what's the point if identifying it with a # does nothing?

"You must defeat my flaming
dragon punch to stand a chance."

Алексей

"enemynear" will redirect to the nearest enemy found, whereas "enemynear(n)" will redirect to the nearest nth enemy found. If there are a total of 2 enemies on the stage, "enemynear " will return the nearest to you; the closest. But let's say, for example, you use "enemynear(1)." Now, this will redirect to the second closest enemy found.

See, "enemynear" has nothing to do with playerIDs. It redirects based on proximity as the name would suggest. :P

Yes, "enemynear" and "enemynear(0)" redirect to the same enemy.

-[Все слова это только слова.]-

Sheng Long

So what you're saying is, EnemyNear, and EnemyNear(0) pretty much do the same thing, but EnemyNear(1) or any # higher checks for the next nearest enemy that is not 0? If it's set at (5), it will check for any 5th enemy and higher, but nothing lower than 5?

"You must defeat my flaming
dragon punch to stand a chance."

Алексей

Yes and no. Giving enemynear a parameter greater than 0, will redirect to the nth nearest enemy found. Not check "n" and higher, but exactly that index, if you will. It would be so much easier to explain this using "Arrays," like those found in various programming and scripting languages. XD

Anyways, I think you got it down.

-[Все слова это только слова.]-

Sheng Long

But by default,  0, or 0th enemy is basically any enemy near?
If that's the case then there's no difference to bother. Right?

"You must defeat my flaming
dragon punch to stand a chance."

Bastard Mami

not any, but the one who is closest; it will only return teh data of one enemy.