YesNoOk
avatar

Audience Code (kudos to chizurx) (Read 6299 times)

Started by #Shaun, September 19, 2007, 05:06:39 pm
Share this topic:
Audience Code (kudos to chizurx)
New #1  September 19, 2007, 05:06:39 pm
  • *****
  • corner push pusher
Didn't see this in the forums, so....

This code will enable you to have an audience/crowd/groupie/whateverthefuck to watch you while you fight.  Just like in KOF98, the audience will react to your actions, depending on what they are. It's up to you to find the sprites you wanna use as an audience, as well as creating your own animation files.

I'm trying to make a standard with these group numbers.  When you found the audience sprites you wanna use, group 'em like this:



8000 - idle stance (gawker vision)

8001 - you beat up on the opponent and the audience cheers on; this sprite is used for cheering AND cheering for a won match, but yours doesn't have to be

8002 - the opponent beats up on you and the audience is upset

8003 - you win a match and the audience cheers in victory

8004 - you lose a match and the audience wishes you were never born

Audience code:


;=============================================================================
; Audience (Idle/Gawker Mode )===============================================================
;=============================================================================

;this indicates that you audience will stand in whatever anim you have him in until something happens in the match.
[Statedef 8000]
type = S; stand
movetype = I; idle
physics = S
velset = 0,0
anim = 8000; animation of idle mode
sprpriority = -4



;when you get hit, hit the opponent, lose a match, or win a match, your "gawker" state is cancelled out. these assertspecials are used to initialize specific attributes on your audience. member out of its "gawker" state and into whatever state they're assigned to react to. These assertspecials are used for all the states your audience member will be in, so expect to see them in other areas in this code. Also, the assertspecials can take away certain attributes of your audience member for example:



;this indicates that your audience member will not twist and turn like an impatient ass
[State 8000, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noautoturn

;this is to make sure that your audience doesn't cast a shadow. it'll look awkward in some stages if they did...
[State 8000, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

;just like the noautoturn. this will make sure that he/she doesn't wander off somewhere when you move about the stage and the camera pans to and fro (or however that's spelled)
[State 8000, 2]
type = screenbound
trigger1 = time  >= 0
value = 0
movecamera = 0,0

;the changestates indicate which state your audience will be in when you gethit, the opponent gets hit, you win, and you lose.

[State 8000, 3]
type = changestate
trigger1 = p2movetype = H ;if player 2 gets hit, the audience will praise you
value    = 8001

[State 8000, 3]
type = changestate
trigger1 = parent,movetype = H; if YOU get hit, the audience will be disappointed
value    = 8002

[State 8000, 3]
type = changestate
trigger1 = win; if you win the match, the audience should show an even more delighted expression
value    = 8003

[State 8000, 3]
type = changestate
trigger1 = lose; if you lose the match, the audience should show an even more disappointed expression
trigger2 = drawgame
value    = 8004

[State 8000, 4]
type = destroyself
trigger1 = roundstate = 4


;this statedef indicates what your audience's behavior will be when you beat up on the opposing player

;===========================================================================
;Player 2 (Get Hit)  =======================================================
;===========================================================================
[Statedef 8001]
type = S
movetype = I
physics = S
velset = 0,0
anim = 8001; animation of p2 getting knocked around
sprpriority = -4

[State 8001, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

[State 8001, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noautoturn

[State 8001, 2]
type = screenbound
trigger1 = time  >= 0
value = 0
movecamera = 0,0

[State 8001, 3]
type = changestate
trigger1 = win
value    = 8003

[State 8001, 3]
type = changestate
trigger1 = lose
trigger2 = drawgame
value    = 8004

[State 8001, 3]
type = changestate
trigger1 = p2movetype != H
value    = 8000


;this statedef indicates what your audience's behavior will be when the opposing player beats up on you

;===========================================================================
; Player 1 (Get Hit)  ======================================================
;===========================================================================
[Statedef 8002]
type = S
movetype = I
physics = S
velset = 0,0
anim = 8002
sprpriority = -4

[State 8002, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

[State 8002, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noautoturn

[State 8002, 2]
type = screenbound
trigger1 = time  >= 0
value = 0
movecamera = 0,0

[State 8002, 3]
type = changestate
trigger1 = win
value    = 8003

[State 8002, 3]
type = changestate
trigger1 = lose
trigger2 = drawgame
value    = 8004

[State 8002, 3]
type = changestate
trigger1 = parent,movetype != H
value    = 8000;when you're done getting knocked around/knocking the opponent around, the audience will transfer back to its idle state



;this statedef shows the audience doing some cheer of victory if you win

;===========================================================================
; Win  =====================================================================
;===========================================================================
[Statedef 8003]
type = S
movetype = I
physics = S
velset = 0,0
anim = 8003
sprpriority = -4

[State 8003, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

[State 8003, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noautoturn

[State 8003, 2]
type = screenbound
trigger1 = time  >= 0
value = 0
movecamera = 0,0

;......and if you lose, the audience will do something that indicates you lose the match

;===========================================================================
; Lose  ====================================================================
;===========================================================================
[Statedef 8004]
type = S
movetype = I
physics = S
velset = 0,0
anim = 8004
sprpriority = -4

[State 8004, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noshadow

[State 8004, 1]
type = AssertSpecial
trigger1 = Time >= 0
flag = noautoturn

[State 8004, 2]
type = screenbound
trigger1 = time  >= 0
value = 0
movecamera = 0,0




;this is the helper.  you need this.  without it your audience will not appear on screen.
;===========================================================================
; Audience Helper (Initializer)
; -- This helper gives the audience sprites access to appear on-screen.
; -- Without a helper you won't see shit.  Make sure they're added
;===========================================================================
[statedef -3]; please make sure you define the state def.
[State -3, (the name of your audience member)]
type = Helper
trigger1 = NumHelper(8000) = 0
name = "the name of your audience member"
id = 8000

;position the audience wherever you want.  if you want to have multiple audience members, be sure to change the x-axis (110 is the x-axis) accordingly so that your audience doesn't overshadow one another.
pos = 110, -8

postype = back;puts them in the background
stateno = 8000;puts the audience into the fight.  this will be the idle animation
helpertype = normal
keyctrl = 0
ownpal = 1;if you've got other colors not officially affiliated with your fighter, let the audience member show up with his own palette. otherwise, go nuts.
Last Edit: November 01, 2007, 03:38:11 pm by #Shaun
Re: Audience Code (kudos to chizurx)
#2  September 20, 2007, 03:25:33 am
  • ***
good stuff, nvr thought about adding an audience ^^

o but, wat about instead of changestates, changeanims... 4 example
Quote
[State 8000, 3]
type = changestate
trigger1 = p2movetype = H ;if player 2 gets hit, the audience will praise you
value    = 8001
could b

[State 8000, 3]
type = changeanim
trigger1 = (p2movetype = H)  && (anim != 8001)
value    = 8001
saves time coding :)
Re: Audience Code (kudos to chizurx)
#3  September 21, 2007, 04:21:46 pm
  • *****
  • corner push pusher
Audience code revised (with gifs)!

Yeah, I guess you're right.  Different strokes for different folks!
Re: Audience Code (kudos to chizurx)
#4  September 21, 2007, 08:38:01 pm
  • ****
  • "Moyashi tsuku shite yaru..."
Actually I was going to use Saisyu and Shingo as strikers and spectators. Good to see people are eager to share their knowledge.  :) But I think I'll be using my head to make my own code anyway.
Re: Audience Code (kudos to chizurx)
#5  October 20, 2007, 09:16:32 pm
  • **
  • Conic Team nod your head
    • www.freewebs.com/conicteam/
How do you add the audience to mugen?
Re: Audience Code (kudos to chizurx)
#6  October 29, 2007, 08:28:22 pm
  • ***
  • Nice Is Different From Good
    • www.freewebs.com/mommamugen/
Could you post a screenshot example? :D

Warner es demasiado agradable ser malo