Invincibility

Started by Chon Wang, February 24, 2004, 05:58:48 PM

Previous topic - Next topic

Chon Wang

Make your char invincible.

; Use states -2 or -3 and a variable

; sets
[State -3]
type = VarSet
var(5) = 300 ; time (in gameticks) of invincibility
trigger1 = stateno = 1000 ; a condittion

; countdown
[state -3]
type = VarAdd
var(5) = -1
trigger1 = var(5)

; invincible
[state -3]
type = NotHitBy
value = SCA
trigger1 = var(5)

; resets
[State -3]
type = VarSet
var(5) = 0
trigger1 = var(5) < 0
There only exists three kind of people: the ones who knows how to count and the other ones that can´t count.

Valodim

#1
imho, every mugen creator should be able to think of that code himself :P

anyway...

[State -1, -2 or -3]
type = NotHitBy
trigger1 = !Var(X)
trigger1 = condition
trigger1 = !Var(X):=(timeinticks)
trigger2 = Var(X)
trigger2 = 1||Var(X):=(Var(X)-1)
value = SCA

pwned ::)

By the way, your code doesn't at all look like code written for a tut...

Chon Wang

I like this code don´t matter how it´s written :P
There only exists three kind of people: the ones who knows how to count and the other ones that can´t count.

Valodim

#3
so it's not written by you...?

Chon Wang

Yes, it´s written by me. I might have not understand your reply, because of my bad English: "By the way, your code doesn't at all look like code written for a tut...".
There only exists three kind of people: the ones who knows how to count and the other ones that can´t count.

Valodim


Matmut

#6
@Deku Nut: Don't forget the brackets :)

trigger1 = !(Var(X):=(timeinticks))

Valodim

are those needed? I don't know but guessed not...

Matmut

Yep. It gives a parsing error otherwise.

BTW, Valodim's code has more sense because invicibility time continues decreasing even if it is triggered one more time, unlike Chon Wang's.

Valodim

actually, his loops from -1 to 0 within one tick...

[sign=4]my code pwns[/sign]

Winane

#10
Um, no, his code never results in var(5) holding the value -1 (nor anything less).  Which, by the way, makes his last controller rather useless.
Still quite busy.

(Yes, I intend to deal with that stuff eventually, but kinda can't just yet, sorry. :/ )

Messatsu

#11
Maybe it is a backup in case Mugen forgets how to work and decrements when var(5) has no value. :huh:  It would be more economical to place the first state controller in state 1000.

Quote from: Bastard Wolf on May 12, 2008, 05:02:05 PM
Many people risk their lives everyday by having Mugen.

Chon Wang

Well, the last State isn´t useless because it can be anything that the creator would want to use, not necessarily a stateno trigger.
There only exists three kind of people: the ones who knows how to count and the other ones that can´t count.

Messatsu

... in this example it is.

Quote from: Bastard Wolf on May 12, 2008, 05:02:05 PM
Many people risk their lives everyday by having Mugen.

Chon Wang

Quote from: Messatsu on February 26, 2004, 08:55:28 PM
... in this example it is.

It was obvious, but just like you can see in my first post i´ve put "a condition", not "the condition"  ::)
There only exists three kind of people: the ones who knows how to count and the other ones that can´t count.

Valodim

[sign=2]we need a mod for this board.[/sign]

Messatsu

#16
me? :grin:

Chon Wang:
QuoteWhich, by the way, makes his last controller rather useless.
A state controller is this: [blah]
type = hiddentrigger ;)
trigger1 = 1


Not this
trigger1 = stateno = 1000 ; a condittion

This is what is refered to as useless
; resets
[State -3]
type = VarSet
var(5) = 0
trigger1 = var(5) < 0


As mentioned, var(5) (with the code presented) doesn't ever equal -1.

Quote from: Bastard Wolf on May 12, 2008, 05:02:05 PM
Many people risk their lives everyday by having Mugen.

Valodim

Quote from: Messatsu on February 27, 2004, 12:20:52 AM
me? :grin:

if the gmods did their job, we'd not need a mod here :tongue2:

Chon Wang

#18
Well, i think i know what a state and a trigger are  ;D

When var(x) < 0 you can´t trigger var(x)? I mean, trigger1 = var(x) returns to sfalse if var(x) <= 0 or only when var(x) = 0?

And in case of using a different triggerization? Like gametime = 95 and !var(5)? Would it be useless?

If not, I think a better solution should be:

; sets
[State -3]
type = VarSet
var(5) = 300 ; time (in gameticks) of invincibility
trigger1 = gametime = 95 ; a condittion
trigger1 = !var(5)

; countdown
[state -3]
type = VarAdd
var(5) = -1
trigger1 = var(5) > 0

; invincible
[state -3]
type = NotHitBy
value = SCA
trigger1 = var(5) > 0

Edit: changed a trigger.
There only exists three kind of people: the ones who knows how to count and the other ones that can´t count.

Valodim

Quote from: Deku Nut on February 24, 2004, 06:03:44 PM
[State -1, -2 or -3]
type = NotHitBy
trigger1 = !Var(X)
trigger1 = condition
trigger1 = !Var(X):=(timeinticks)
trigger2 = Var(X)
trigger2 = 1||Var(X):=(Var(X)-1)
value = SCA

:laugh: