November 20, 2009, 05:18:26 PM *
The Mugen Fighters Guild Forum Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: 2009-10-28
M.U.G.E.N 1.0 RC5 released
 
   Home   Chat Recent Archive Help Members Login Register  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: auto target p4 when p2 is dead?  (Read 72 times)
kooloo
User
**
Offline Offline



View Profile Email
« on: November 06, 2009, 01:09:09 PM »

one of the character uses the code below:

[State 1301, pos]
type = PosSet
trigger1 = time = 0
x = enemy,pos X
y = 0

However in simul mode, this code triggers a problem coz the character will only fly to P2 instead of P4 even when P2 is long dead..

I tried

[State 1301, pos]
type = PosSet
trigger1 = time = 0
trigger1 = P2 != life
x = P4,pos X

but it didn't work.

Any suggestions ?
y = 0
Logged
Byakko
Contributor
******
Offline Offline



View Profile
« Reply #1 on: November 06, 2009, 01:11:54 PM / November 06, 2009, 08:11:54 PM »

Try changing "enemy" for "enemynear".
Logged

If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Rajaa
Global Moderator
*****
Offline Offline



I'm a girl, treat me different on the internet.


View Profile WWW
« Reply #2 on: November 06, 2009, 01:18:26 PM / November 06, 2009, 02:18:26 PM »

^That won't work. To solve this you'll either need to use enemynear(0) and enemynear(1) and detect when one or the other is dead using an abundance of triggers and sctrls.

The simple way is to use p2bodydist x or p2dist x, this always works for any enemy player that's near you, the "p2" is just for show. Works for player 4 as well. Whoever you're facing. Disregards dead players automatically.

I'd change the "posset"" to a" posadd" then use "p2dist x" as a trigger. That would work.

x = p2dist x

also I don't think p2 != life is legitimate at all. '!p2life or p2life=0' works, though.
Logged

I am a girl, you should treat me different on the internet and let me get away with stuff that normal people wouldn't. This is what you must do because I am a girl.
kooloo
User
**
Offline Offline



View Profile Email
« Reply #3 on: November 06, 2009, 11:17:07 PM »

Thanks man !!

I tried this:

[State 1301, pos]
type = Posadd
trigger1 = time = 0
trigger1 = p2life !=0
x = p2dist x
y = 0

[State 1301, pos]
type = Posadd
trigger1 = time = 0
trigger1 = p2life =0
x = p4dist x
y = 0


But it didn't work. the character still targets the deadbody rather than the alive enemy..

Any suggestions ?
Logged
Rajaa
Global Moderator
*****
Offline Offline



I'm a girl, treat me different on the internet.


View Profile WWW
« Reply #4 on: November 07, 2009, 07:54:14 AM / November 07, 2009, 08:54:14 AM »

P4dist x/y, is not a legitimate trigger and it will crash mugen. Only, p2dist x/y. Remove the life triggers, they are not needed and your thinking about it too hard. To ignore dead opponents is built into p2dist triggers, you don't need to use any other triggers to insure this.

[State 1301, pos]
type = Posadd
trigger1 = time = 0
x = p2dist x
y = 0

This should be fine.
Logged

I am a girl, you should treat me different on the internet and let me get away with stuff that normal people wouldn't. This is what you must do because I am a girl.
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

1Emulation Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC lighttpd
Page created in 0.087 seconds with 21 queries.