Underground Mugen community specializing in advanced Mugen stages, screenpacks & Graphics


You are not connected. Please login or register

Helper Projectile Tutorial by Ynvaser

Go down  Message [Page 1 of 1]

1 Helper Projectile Tutorial by Ynvaser on Fri Mar 07, 2014 9:43 am

Demitri

avatar


This tut helped me back in the day, and is still pretty useful.
ynvaser on: August 11, 2008 wrote:
Hi guys!

This is my very first tutorial. It explains a kind of easy thing, a helper used as a projectile.
It has many benefits, since you can create very crazy things, like the projectile follows the enemy, or blows up and creates many frags, etc. In this tutorial, you will learn the simplest (plain projectile with random direction) To understand this, you will need to know the basics, such as summoning helpers, making anims, creating a simple move, and knowing what's what. If you don't know these, either read  Cyanide's Narutorials, or try to figure the basics out from Elecbyte's tutorials, located in your docs folder of MUGEN.

You must add this to your character's projectile launcher state (where it shots):
;...
Code:
[State 420, Helper]         ;This summons helper
type = Helper
trigger1 = Time = 11        ;It summons when the state is at the 11th tick. Change as needed.
helpertype = normal         ;Normal, so not player XD
name = "Renzoku Projectile" ;Give it a name, it's a good thing.
ID = 9001                   ;The indentification number of the helper
stateno = 9001              ;The helper's stateno. If you change it in the helper's state, change it here too.
pos = 50, -44               ;The position where the helper appears
postype = p1                ;It defines from where it counts the distance.
facing = 1                  ;If you change facing with your char, the projectile won't go backwards :P
keyctrl = 0                 ;Keep this at 0.
ownpal = 1                  ;This means that the parent's PalFX's won't affect the helper.
;...

Here's my Goku's Renzoku Projectile State (Copy/Pasteable):
;-Renzoku Projectile   ;I like to give them names
;(Used in StateNo 420) ;This is good to keep your helpers organized
[Statedef 9001]        ;Change the value to fit your needs
type = A
movetype = A
physics = N
anim = 9014            ;Change the anim to your projectile's anim. It must contain at least 1 clsn1 box.
velset = 0,0
ctrl = 0
poweradd = 0
juggle = 10            ;Change this to fit your char
facep2 = 0
hitdefpersist = 0
movehitpersist = 0
hitcountpersist = 0
sprpriority = 3       ;Adjust it, if you want the proj to be behind or in front of everyone.

[State 9001, AssertSpecial]  ;This sctrl won't let the helper's shadow cast.
type = AssertSpecial
trigger1 = 1
flag = NoShadow

[State 9001, PlayerPush] ;This disables the clsn2's pushing effect.
type = PlayerPush
trigger1 = 1
value = 0

[State 9001, NotHitBy]  ;This won't let the projectile get hit.
type = NotHitBy
trigger1 = 1
value = SCA

;Don't change the order of the following 3 sctrl's.
[State 9001, VarRandom] ;This var randomizes the y velocity of the helper.
type = VarRandom
trigger1 = (!Time)
v = 0
range = -2,2

[State 9001, VarRandom] ;This var serves as a speed booster to the x velocity.
type = VarRandom
trigger1 = (!Time)
v = 1
range = 2,0

[State 9001, VelSet] ;This sctrl sets the velocity of the helper.
type = VelSet
trigger1 = (!Time)
x = 15+(Var(1))      ;As you see, the base velocity is 15, but with the +var(1), it's either 15,16, or 17.
y = (Var(0))         ;There's no base, the var(0) defines the y velocity completely.

[State 9001, HitDef] ;The heart of The code. It defines how the the projectile hits.*
type = HitDef        ;*Because i suppose you know the basics, I won't bother explain all.
trigger1 = 1
attr = S, NA
hitflag   = MAFDP
guardflag = MA
animtype = Hard
priority = 7, Hit
damage = 10,5
pausetime = 5,5
guard.pausetime   = 15,20
sparkno   = S6150
guard.sparkno = S6150
sparkxy   = 0,40
hitsound = S1,12
guardsound = S1,12
ground.type = High
air.type = Trip
ground.slidetime = 25
ground.hittime = 25
air.hittime   = 25
ground.velocity   = -8
guard.velocity = -8
air.velocity = -8,-3.5
airguard.velocity = -8,-3.5
ground.cornerpush.veloff = 0
fall.xvelocity = -1
fall.yvelocity = -3
fall.recover = 0
air.fall = 1
down.velocity = -1,-2
down.bounce   = 1
id = 701
getpower = 0
givepower = 25
palfx.time = 12
palfx.mul = 256,256,256
palfx.add = 200,50,10
palfx.sinadd = 175,25,5,4
envshake.time = 12
envshake.freq = 120
envshake.ampl = -4
persistent = 0

[State 9001, DestroySelf]              ;The finale. It destroys the helper in specific circumstances
type = DestroySelf
trigger1 = MoveContact             ;First condition. It destroys when the projectile hits.
trigger2 = FrontEdgeBodyDist < -30 ;Second condition. It destroys when the x distance from the nearest*
ignorehitpause = 1                       ;*vertical wall is smaller than -30 (so when the distance is -31 or smaller)
If you used this tutorial in your character, I would like to see my name in the credits list.
I hope you learned much from it!

Also a note from Vyn
vyn on: August 11, 2008 wrote:
wouldnt recomend to use the nothitby in actual characters, this is an invinsible projectile, use a hitoverride to avoid cloning problems which i guess is the point of having a nothitby, tough it only has sca, this projectile can probably be grabbed, would be funny XD

u can summarize ur random variables with random% to simplify the code

Code:
[State 9001, VelSet]
type = VelSet
trigger1 = (!Time)
x = 15+(random%3)    
y = 0+(random%5)


________________________________________________________________________________________________________________________________________________________________________

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum