YesNoOk
avatar

Invincibility  (Read 19508 times)

Started by Chon Wang, February 24, 2004, 05:58:48 pm
Share this topic:
Invincibility
#1  February 24, 2004, 05:58:48 pm
  • *
  • Catch me if you can!
    • mugenko.mgbr.net
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.
Last Edit: February 24, 2004, 06:01:47 pm by Chon Wang
Re:Invincibility
#2  February 24, 2004, 06:03:44 pm
  • ******
    • Germany
    • valodim@stratum0.org
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...
Last Edit: February 24, 2004, 06:04:30 pm by Deku Nut
Re:Invincibility
#3  February 24, 2004, 06:10:47 pm
  • *
  • Catch me if you can!
    • mugenko.mgbr.net
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.
Re:Invincibility
#4  February 24, 2004, 06:24:24 pm
  • ******
    • Germany
    • valodim@stratum0.org
so it's not written by you...?
Last Edit: February 24, 2004, 06:26:03 pm by Deku Nut
Re:Invincibility
#5  February 24, 2004, 06:27:58 pm
  • *
  • Catch me if you can!
    • mugenko.mgbr.net
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.
Re:Invincibility
#6  February 24, 2004, 07:01:36 pm
  • ******
    • Germany
    • valodim@stratum0.org
okay :)
Re:Invincibility
#7  February 25, 2004, 12:18:12 am
  • ***
@Deku Nut: Don't forget the brackets :)

trigger1 = !(Var(X):=(timeinticks))
Last Edit: February 25, 2004, 12:20:13 am by Shoma
Re:Invincibility
#8  February 25, 2004, 12:26:01 am
  • ******
    • Germany
    • valodim@stratum0.org
are those needed? I don't know but guessed not...
Re:Invincibility
#9  February 25, 2004, 12:40:14 am
  • ***
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.
Re:Invincibility
#10  February 25, 2004, 12:45:13 am
  • ******
    • Germany
    • valodim@stratum0.org
actually, his loops from -1 to 0 within one tick...

[sign=4]my code pwns[/sign]
Re:Invincibility
#11  February 25, 2004, 12:59:58 am
  • *****
  • Tends to lose track of things a lot. :/
    • www.mugenguild.com/~winane/
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. :/ )
Last Edit: February 25, 2004, 01:00:24 am by Digu Nut
Re:Invincibility
#12  February 25, 2004, 12:33:17 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
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.


Many people risk their lives everyday by having Mugen.
Last Edit: February 25, 2004, 12:37:15 pm by Messatsu
Re:Invincibility
#13  February 26, 2004, 07:46:47 pm
  • *
  • Catch me if you can!
    • mugenko.mgbr.net
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.
Re:Invincibility
#14  February 26, 2004, 08:55:28 pm
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
... in this example it is.


Many people risk their lives everyday by having Mugen.
Re:Invincibility
#15  February 26, 2004, 09:18:01 pm
  • *
  • Catch me if you can!
    • mugenko.mgbr.net
There only exists three kind of people: the ones who knows how to count and the other ones that can´t count.
Re:Invincibility
#16  February 26, 2004, 09:23:20 pm
  • ******
    • Germany
    • valodim@stratum0.org
[sign=2]we need a mod for this board.[/sign]
Re:Invincibility
#17  February 27, 2004, 12:20:52 am
  • ******
  • In after lock
    • mugenguild.com/~messatsu/index.html
me? :grin:

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

Not this
Code:
trigger1 = stateno = 1000 ; a condittion

This is what is refered to as useless
Code:
; 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.


Many people risk their lives everyday by having Mugen.
Last Edit: February 27, 2004, 12:29:13 am by Messatsu
Re:Invincibility
#18  February 27, 2004, 12:50:14 am
  • ******
    • Germany
    • valodim@stratum0.org
Re:Invincibility
#19  February 27, 2004, 04:02:07 pm
  • *
  • Catch me if you can!
    • mugenko.mgbr.net
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.
Last Edit: February 27, 2004, 04:04:58 pm by Chon Wang
Re:Invincibility
#20  February 27, 2004, 04:04:32 pm
  • ******
    • Germany
    • valodim@stratum0.org