YesNoOk
avatar

How do you make a helper (beam) hit many times? (Read 907 times)

Started by Ryon, May 28, 2011, 10:01:48 pm
Share this topic:
How do you make a helper (beam) hit many times?
#1  May 28, 2011, 10:01:48 pm
  • *****
  • "The Future is Now"
So i'm working on SSJ Gohan, and everything is all gravy up until i hit a major snag.
give or take once this snag is out of the way, I can release him.

basically. i'm coding his Masenko super, as a helper, its a beam, the animation has 2 parts.
-Beam (the whole moving and staying out)
-Beam End (the beam shrinking and disappearing)

Gohan has 1 animation
-Masenko pose

on its own if Gohan fires it with out interruption it looks and works perfectly. Shown Below.


HOWEVER, here is the problem, IF the opponent were to shoot a projectile, the beam would simple skip out to the end phase where it shrinks.


I used a hitoverride code , and i asked Neocide for help regarding this but no luck to how i want it.
But what i want is for the beam to EAT PROJECTILES, and keep going instead of getting destroyed itself.

I'm hoping Cyanide or anyone who would know can help me with this. PLEASE AND THANK YOU.

Here is my Projectile code.
Code:
;===========================================================================
;Projectile
[Statedef 300]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -50
ctrl = 0
velset = 0,0
anim = 300
sprpriority = -1

[State 300, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 0

[State 300, Projectile]
type = Projectile
trigger1 = animelem = 2
projanim = 305
projhitanim = 306
projscale = 1,1
offset = 40,-57
velocity = 5,0
projpriority= 5
ProjID = 300
numhits = 1
attr = S,NP
damage = 50,10
guardflag = MA
animtype  = Hard
getpower = 61,61
pausetime = 0,13
guard.pausetime = 0,11
sparkno = s9001
hitsound   = S1,0
guardsound = S36, 0
ground.type = Low
ground.slidetime = 14
ground.hittime = 15
guard.velocity = -4
ground.velocity = -4,-5
air.animtype = high
air.velocity = -3,-1
airguard.velocity = -0.5
fall = 1

[State 300, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

and this is my helpers codes
Code:
;===========================================================================
;Masenko (Gohan)
[Statedef 1000]
type    = S
movetype= A
physics = S
poweradd= -1000
ctrl = 0
velset = 0,0
anim = 1000
sprpriority = -1

[State 1000,Beam]
type = Helper
trigger1 = animelem = 2
helpertype = normal
name = Masenko
ID = 1000
stateno = 1001
pos = 25,-57
postype = p1
ownpal = 1

[State 1000, 5]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;Masenko (Beam)
[Statedef 1001]
type    = S
movetype= A
physics = N
anim = 1001
sprpriority = 2

[state 1001,hitoverride]
type = Hitoverride
trigger1 = 1
attr = SCA,NP,SP,HP
slot = 0
time = 9999
stateno = 1002

[State 1001, sprpriorty]
type = SprPriority
trigger1 = 1
trigger2 = movecontact
value = 5

[State 1001, 2]
type = HitDef
trigger1 = time >=0
priority = 7,Hit
attr = S,HP
animtype  = Heavy
damage    = 10
guardflag = MA
pausetime = 1,2
sparkno = s9999
sparkxy = -10,0
hitsound   = S1,0
guardsounkd = 6,0
ground.type = High
getpower = 0
ground.slidetime = 12
ground.hittime  = 16
ground.velocity = -6,0
air.velocity = -2.5,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1

[State 1001, 5]
type = ChangeState
trigger1 = parent, stateno != 1000
value = 1002

[State 1001, 5]
type = ChangeState
trigger1 = Time = 30
value = 1002

;Masenko (Beam End)
[Statedef 1002]
type    = S
movetype= A
physics = N
anim = 1002
sprpriority = 3

[State 1001, 5]
type = destroyself
trigger1 = animtime = 0

GT

Re: How do you make a helper (beam) hit many times?
#2  May 28, 2011, 10:06:44 pm
  • *****
    • USA
    • Skype - gt_ruby
I think it's because of this

Quote
[state 1001,hitoverride]
type = Hitoverride
trigger1 = 1
attr = SCA,NP,SP,HP
slot = 0
time = 9999
stateno = 1002

If your projectile is hit with another projectile it will go into the end state. Change stateno to 1001 or maybe comment it out.

Also, for projectiles projpriority and projremove would probably be useful here.
Yeah Titiln, in fact, You Made Him
Re: How do you make a helper (beam) hit many times?
#3  May 28, 2011, 10:45:22 pm
  • *****
  • "The Future is Now"
Hot damn that actually worked.. i always had that idea in mind but i didnt know it actually works.

let me do further testing and see how it works out.
Re: How do you make a helper (beam) hit many times?
#4  May 29, 2011, 12:32:06 am
  • *****
  • "The Future is Now"
OK sorry for a double post, after trying out the move agianst a Kiko attack, it works, however the animation resets itself.
is there anyway i can have the animation continue with out resetting?

here is a look at what i mean.
Re: How do you make a helper (beam) hit many times?
#5  May 29, 2011, 01:07:13 am
  • ****
    • Chile
Maybe you need your beam in 3 states: the first while the beam increases is size, the second when the beam actually hits, dut doesn't have a "size" change, and the third, when the beam dissapears.

The first state should be very fast no longer than 5 tics. The second uses the hitoverride and hitby controllers. So, you redirect to the hit state, not the increasing state.

EDIT: You may want also to change the first state to the second when you reach p2 position, making it more "real".
Re: How do you make a helper (beam) hit many times?
#6  May 29, 2011, 01:09:27 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Should your beam even be able to be hit? I mean, do you want it to stop or should it keep going regardless? If it's keep going regardless, remove the clsn2's?


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: How do you make a helper (beam) hit many times?
#7  May 29, 2011, 01:18:47 am
  • *****
  • "The Future is Now"
i removed the CLSN2's, and the beam doesnt stop the projectiles they phase thru each other unaffectively.

i have to do some sprite editing but i have another idea of how to do.

Gohan
 - Masenko Pose
 - Explod (the burst from his hands)
 - projectiles 30 (actual middle of beam)
 
thats it, so it would basically be a bunch of projectiles that follow each other closely so look like the center of a beam, that way it can easily powerstruggle a bunch of projectiles, and if i draw the sprites correctly it should be able to end properly to.

i'll make a spritesheet and show you what i mean.
Re: How do you make a helper (beam) hit many times?
#8  May 29, 2011, 01:46:31 am
  • *
    • www.youtube.com/user/XRedDragonClawsX
This is to address the animation resetting in the beam helper. Since the helper uses a 'hitoverride' controller, every time the helper enters the specified state number, it will play animation 1001 upon each entrance it makes into the state. The solution is to remove 'anim = 1001' from under the [Statedef 1001] entry and use a 'ChangeAnim' controller.

Changes in code will have a '*'.

Code:
;Masenko (Gohan)
[Statedef 1000]
type = S
movetype= A
physics = S
poweradd= -1000
ctrl = 0
velset = 0,0
anim = 1000
sprpriority = -1

[State 1000, Beam Helper]
type = Helper
trigger1 = AnimElem = 2
helpertype = normal
name = "Masenko" ;Name needed quotes*
ID = 1000
stateno = 1001
pos = 25,-57
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0

[State 1000, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------------------------------------------------

;Masenko (Beam Helper)
[Statedef 1001]
type = S
movetype = A
physics = N
;anim = 1001 ;This is what's causing the anim to reset. Delete this line.*
sprpriority = 2

;Use this controller instead*
;[State 1001, ChangeAnim: Beam me up!]
;type = ChangeAnim
;trigger1 = Anim != 1001
;value = 1001

[state 1001, HitOverride]
type = Hitoverride
trigger1 = 1
attr = SCA,NP,SP,HP
slot = 0
time = 9999
stateno = 1002 ;Change this to 'stateno = 1001'*

;Controller trigger change*
[State 1001, SprPriority]
type = SprPriority
trigger1 = MoveContact
value = 5

[State 1001, HitDef: Shoop Da Whoop]
type = HitDef
trigger1 = time >= 0
priority = 7,Hit
attr = S,HP
animtype  = Heavy
damage    = 10
guardflag = MA
pausetime = 1,2
sparkno = s9999
sparkxy = -10,0
hitsound   = S1,0
guardsounkd = 6,0
ground.type = High
getpower = 0
ground.slidetime = 12
ground.hittime  = 16
ground.velocity = -6,0
air.velocity = -2.5,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1

;Needs more safety-net. Added triggers.*
[State 1001, ChangeState]
type = ChangeState
trigger1 = Parent, StateNo != 1000
trigger2 = Parent, MoveType = H
trigger3 = Parent, GetHitVar(IsBound)
value = 1002

;Can't be too safe.*
[State 1001, ChaneState: Beam End]
type = ChangeState
trigger1 = Time >= 30 ;Changed from Time = 30*
value = 1002

;-------------------------------------------------------------------------------

;Masenko (Beam End)
[Statedef 1002]
type = S
movetype = A
physics = N
anim = 1002
sprpriority = 3

;I have no idea if the anim has get-hit collision,
;so I added this here.*
[State 1002, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 1002, DestroySelf: Laz0r Completed]
type = DestroySelf
trigger1 = AnimTime = 0

Find my Mugen creations/edits here: https://www.mediafire.com/folder/4r1285v2v76jk/
Re: How do you make a helper (beam) hit many times?
#9  May 29, 2011, 02:14:39 pm
  • *****
  • "The Future is Now"
Your code makes alot of sense when i think about it. however i decided to go along with a way i've seen projectiles coded years ago by Pixteen (or Goten88 as he went by back then)

http://www.youtube.com/watch?v=O-zdHj0sFDI

I like it.