YesNoOk
avatar

Using a Helper as a trampoline/spring board... (Read 676 times)

Started by OrochiWeapon2000, May 03, 2008, 11:25:52 am
Share this topic:
Using a Helper as a trampoline/spring board...
#1  May 03, 2008, 11:25:52 am
  • ***
  • Small characters can kick big ass.
    • USA
I've been trying to create a helper that the player can "jump onto" that will allow them to jump higher/further than normal.

The way I have it set up so far is that the helper will first go into it's "Ready" position, and when the player reaches a certain distance from it, the helper will then go into it's "Launcher" state. Here's what the code for the helper on this one:

[mcode];===========================================================================
; Rush Coil (Prep)
;===========================================================================
[Statedef 1115]
type = S
movetype = I
physics = N
velset = 0,0
anim = 1115
ctrl = 0
sprpriority = -4

[State 1115]
type = ScreenBound
trigger1 = 1
value = 0

[State 1115]
type = NotHitBy
trigger1 = 1
value = SCA

[State 1115]
type = ChangeState
triggerall = (Root,StateType = A) && (Root,Vel Y > 0)
trigger1 = RootDist X >= -8 && RootDist X <= 8 && RootDist Y >= -12
value = 1116

[State 1115]
type = ChangeState
trigger1 = Time = 48
value = 1105

[State 1115]
type = VarSet
trigger1 = !Time
var(8) = 0

[State 1115]
type = ChangeState
triggerall = RoundState = 2
trigger1 = Root,StateNo = 3050
trigger2 = Root,StateNo = 3100
value = 3110

;===========================================================================
; Rush Coil (Launcher Anim)
;===========================================================================
[Statedef 1116]
type = S
movetype = I
physics = N
velset = 0,0
anim = 1116
ctrl = 0
sprpriority = -4

[State 1116]
type = PlaySnd
trigger1 = !Time
value = 1115,0

[State 1116]
type = ScreenBound
trigger1 = 1
value = 0

[State 1116]
type = NotHitBy
trigger1 = 1
value = SCA

[State 1115]
type = VarSet
trigger1 = !Time
var(8) = 1

[State 1116]
type = ChangeState
trigger1 = !AnimTime
value = 1105
[/mcode]

The Helper itself seems to behave properly, but I'm having trouble getting the Player to go into his air jump state immediately after the helper goes into it's "Launcher" state.

I tried adding:
[mcode][State 50]
type = ChangeState
triggerall = (IsHelper(1100),StateNo = 1116)
trigger1 = !Time
value = 45
ctrl = 0
[/mcode]
to State 50, but that didn't work. I also tried adding that piece to State -2 and still I got nothing. I've tried this as well:
[mcode][State -2]
type = ChangeState
triggerall = (IsHelper(1100),StateNo = 1116)
triggerall = (StateType = A && Vel Y > 0)
triggerall = MoveType != H
trigger1 = !Time
value = 45
ctrl = 0
[/mcode]
It's seems that I'm going about this the wrong way or something. Any suggestions?

Thanks in advance.
Re: Using a Helper as a trampoline/spring board...
#2  May 03, 2008, 12:18:25 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Quote
[State 50]
type = ChangeState
triggerall = (IsHelper(1100),StateNo = 1116)
trigger1 = !Time
value = 45
ctrl = 0

Problem is pretty easy actually. Ishelper, is designed to check which helper the current player is. Not if a helper is doing thing X.

This one is mentioned in Exp.txt so i can understand you not knowing about it.

You want, helper(1100), stateno = 1116

You'd use ishelper if you had 2 helpers with different ID's in the same state to make them do specific stuff


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: Using a Helper as a trampoline/spring board...
#3  May 03, 2008, 12:48:43 pm
  • *****
    • Mexico
Don't forget to add a triggerall that uses trigger numhelper (numhlper(id) != 0) or else it will spam the debug.
Re: Using a Helper as a trampoline/spring board...
#4  May 03, 2008, 05:28:23 pm
  • ******
  • [E]
    • Mexico
and I think you need to put that sctrl in st-2, because I don't think the charatcer will enter state50 on that specific condition.
Re: Using a Helper as a trampoline/spring board...
#5  May 04, 2008, 06:13:42 am
  • ***
  • Small characters can kick big ass.
    • USA
Thanks for the help guys ;D. Now the only problem left is that it's still not triggered automatically the instant the helper goes into it's launcher state. Oddly enough, if you're holding back, up, or forward, it'll trigger, but only after Rockman lands on the ground.

I added this to StateDef -2:
[mcode];=====================================================================
; Rush Coil (Bounce)
;=====================================================================
[State -2]
type = ChangeState
triggerall = NumHelper(1100) != 0
triggerall = (Helper(1100),StateNo = 1116)
trigger1 = !Time
value = 40
ctrl = 0
[/mcode]

And this is the jump state:
[mcode];=====================================================================
; Jump Start
;=====================================================================
[Statedef 40]
type = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40]
type = VarSet
trigger1 = !Time
sysvar(1) = 0

[State 40]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40]
type = VelSet
trigger1 = !AnimTime
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40]
type = VelSet
triggerall = (Helper(1100),StateNo = 1116)
trigger1 = !AnimTime
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x))*1.15)
y = const(velocity.jump.y)*1.25

[State 40]
type = ChangeState
trigger1 = !AnimTime
value = 50
ctrl = 1
[/mcode]

Did I forget something else?
Re: Using a Helper as a trampoline/spring board...
#6  May 04, 2008, 07:42:14 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
trigger1 = !Time

That line will affect your characters time = 0 function. Not the helpers. Obviously while you're traveling through state 50 time is only 0 once. It's certainly not 0 at the point where you'd be coming DOWN on the launch pad is it?

Try vel Y> 0 instead.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.