YesNoOk
avatar

SOLVED: Spawned helper issues. (Read 155 times)

Started by Maistral, November 12, 2011, 02:36:35 pm
Share this topic:
SOLVED: Spawned helper issues.
New #1  November 12, 2011, 02:36:35 pm
  • avatar
  • **
  • Whatever.
Hello guys, been a while. Had to reformat PC due to.. some undesirable "guests"  ;D, and since I got lazy to continue coding my character, I had to stop the project for a while.

Anyway, I continued now, tweaked certain stuff and those. I have some questions though. Hopefully some of the guys who were answering my noob questions would answer again :D



As usual, I have my spawned helper (puppet). I coded to limit its movement space (ie. controlling the puppet's Y limits, such as this):
Code:
pos y >= -100 && pos y <= 1

Used that in the puppet directional control code and ended up well, the puppet won't go off-screen anymore.


The problem is this. I wanted the puppet to get hit "realistically" (ie. When it gets hit by kunai, it'll budge a little, but when it gets punched, by, say, Sakura, it'll fly like a tard to the other side of the screen). So experimenting, I ended up with these bunch of codes:

Code:
;Hit movement
[State 2020, HitVelSet]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 2020, HitVelSet]
type = HitVelSet
trigger1 = Time = 0 && pos y >= -100 && pos y <= 1
y = 1

[State 2020, VelAdd]
type = VelAdd
trigger1 = time = 0
x = -GetHitVar(animtype)

[State 2020, VelAdd]
type = VelAdd
trigger1 = time = 0 && pos y >= -100 && pos y <= 1
y = GetHitVar(animtype)    ;GetHitVar(yaccel)

[State 5100, VelSet]
type = VelSet
trigger1 = pos y < -100 && pos y > 0
y = 0

It ended up fine, but there's one, small problem.

Say for example, the puppet gets hit by an overwhelming downward force. True, the puppet flies downward, but it ends up going off-screen (y >>> 0). I don't know any other way of solving this because I think I tried all else. Any help?



MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks

Last Edit: November 12, 2011, 06:50:17 pm by Maistral
Re: Spawned helper issues.
#2  November 12, 2011, 05:52:46 pm
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
Code:
[State x]
Type=Velset
Trigger1=Pos Y>0
Y=0

[State x]
Type=Posset
Trigger1=Pos Y>0
Y=0

[State x]
Type=Velset
Trigger1=Pos Y<-100
Y=0

[State x]
Type=Posset
Trigger1=Pos Y<-100
Y=-100
Then the same thing for Y<-100.
This should stop it from moving in the Y direction if it would leave the area.
Re: Spawned helper issues.
#3  November 12, 2011, 06:43:43 pm
  • avatar
  • **
  • Whatever.
Oh! so that's it.

I knew about the VelSet, but didn't know about the PosSet. Thanks sir :D


MUGEN CHARACTERS
Sabaku no Temari [100%] = RELEASED!
Akasuna no Sasori [100%] = RELEASED!
Namikaze Minato [5%] = ON HOLD
Uzumaki Naruto [5%] = Coding basic attacks