YesNoOk
avatar

[Solved] If enemy hitted is not a Helper (Read 286 times)

Started by jjmugen, November 21, 2011, 05:23:01 pm
Share this topic:
[Solved] If enemy hitted is not a Helper
#1  November 21, 2011, 05:23:01 pm
  • **
Hi, guys.

I'm working on a technique that works this way: Player sends a projectile (implemented with a Helper). This projectile can hit enemy and change his own state. But I want that projectile just change his own state if player hitted is not a helper (only if it's the real p2).

I have tried this:

Code:
[State 0, ChangeState]
type = ChangeState
trigger1 = movehit && enemynear,!IsHelper
value = 2925
ctrl = 0

But there's is a parsing error during execution because of the "enemynear,!IsHelper"

How can I make condition: "Trigger if movehit and enemy hitted is not a Helper" ? 

Thanks
Last Edit: November 22, 2011, 03:52:54 pm by jjmugen
Re: If enemy hitted is not a Helper
#2  November 21, 2011, 10:34:26 pm
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
The ! is at the wrong spot.
It's !enemynear,Ishelper.

However :
-You are supposed to use target,Ishelper instead. It doesn't matter what the nearest enemy is (helpers are not enemies, anyway), if what you are hitting is not the nearest enemy. What matters is the player you hit, and you check that with the target redirection.
-You might hit more than one target (either in simul or if the opponent has cloning abilities). In this case, you can at most check one of them for being a helper or not. So you should either make it always or never change if there is more than one target, or you should make the attack unable to hit more than one target.
-You might have zero targets. (if the move hits a hitoverride) To avoid debug spam, you need to make sure there is at least one target in a triggerall line.

I'd suggest using this for the change condition :

Trigger1=(Movehite=1) && (numtarget>0)

Why? Because hitting projectiles or anything that has a hitoverride active doesn't become a target. So if you have a target you either managed to hit a player or a player clone, as non-clone helpers always need to use hitoverride.
Also, if the thing you hit did have an active hitoverride, then it's impossible to tell if it's a helper or a player.
Last Edit: November 21, 2011, 10:38:47 pm by Seravy
Re: If enemy hitted is not a Helper
#3  November 22, 2011, 03:52:39 pm
  • **
The ! is at the wrong spot.
It's !enemynear,Ishelper.

However :
-You are supposed to use target,Ishelper instead. It doesn't matter what the nearest enemy is (helpers are not enemies, anyway), if what you are hitting is not the nearest enemy. What matters is the player you hit, and you check that with the target redirection.
-You might hit more than one target (either in simul or if the opponent has cloning abilities). In this case, you can at most check one of them for being a helper or not. So you should either make it always or never change if there is more than one target, or you should make the attack unable to hit more than one target.
-You might have zero targets. (if the move hits a hitoverride) To avoid debug spam, you need to make sure there is at least one target in a triggerall line.

I'd suggest using this for the change condition :

Trigger1=(Movehite=1) && (numtarget>0)

Why? Because hitting projectiles or anything that has a hitoverride active doesn't become a target. So if you have a target you either managed to hit a player or a player clone, as non-clone helpers always need to use hitoverride.
Also, if the thing you hit did have an active hitoverride, then it's impossible to tell if it's a helper or a player.

Oh, this is so useful info.

Thanks a lot