collapse

Author Topic: Coding a character with two different sides (Two Face)  (Read 764 times)

0 Members and 1 Guest are viewing this topic.

Offline drtremor

  • New Member
  • *
  • Posts: 6
  • Last Login:June 30, 2017, 09:17:30 AM
    • Email
Coding a character with two different sides (Two Face)
« on: January 05, 2012, 12:56:34 PM »
I didn't know where to post this. I need to know how to take a character and make him/her have different sprites depending which side of the screen he/she is on. Example: Two-Face. I want the character to look one way on the 1st player side, but when he jumps over to the 2nd player, to show the other side. Does anyone know how to code this???
« Last Edit: January 05, 2012, 01:23:24 PM by Acey »



Offline Acey

  • Infinity Administrator
  • *
  • Posts: 9579
  • Country: United States us
  • Last Login:December 05, 2022, 10:43:15 PM
  • "Victory means nothing, the fight is everything."
    • Infinity Wiki - Acey
    • Email
Re: Sprite Question
« Reply #1 on: January 05, 2012, 01:22:49 PM »
I didn't know where to post this. I need to know how to take a character and make him/her have different sprites depending which side of the screen he/she is on. Example: Two-Face. I want the character to look one way on the 1st player side, but when he jumps over to the 2nd player, to show the other side. Does anyone know how to code this???

Techniques used to code a character like this have been seen on characters such as Gill from Street Fighter 3. It requires double sets of animations, one for each side of the body, then it would use a trigger such as a preset variable to tell the engine which of the two animations to use in each situation.

Offline drtremor

  • New Member
  • *
  • Posts: 6
  • Last Login:June 30, 2017, 09:17:30 AM
    • Email
Re: Coding a character with two different sides (Two Face)
« Reply #2 on: January 05, 2012, 01:39:26 PM »
I know that already. My question was "does any one know how to code it?" as in, what's the trigger code?

Offline Infinite Power

  • The End All Be All
  • Contributor
  • ****
  • Posts: 747
  • Last Login:January 27, 2020, 09:36:52 AM
  • Energy Doesn't Die
    • Infinite Fighting Forum
Re: Coding a character with two different sides (Two Face)
« Reply #3 on: January 05, 2012, 01:58:23 PM »
I know that already. My question was "does any one know how to code it?" as in, what's the trigger code?
;this would go in your characters overrides -2

[state -2,facing1]
type=varset
trigger1=facing=1
var(x)=1
[state -2,facing-1]
type=varset
trigger1=facing=-1
var(x)=2

x= whatever var you want to use.

so if you were to put a new move in your command for player facing one way it would look like this.

[State -1, move]
type = ChangeState
value = xxxx
triggerall = var(x)=1; or facing the other side-; var(x)=2
triggerall = command = "movename"
triggerall = statetype != A
trigger1 = ctrl

Now Die, Mortal.

Offline Acey

  • Infinity Administrator
  • *
  • Posts: 9579
  • Country: United States us
  • Last Login:December 05, 2022, 10:43:15 PM
  • "Victory means nothing, the fight is everything."
    • Infinity Wiki - Acey
    • Email
Re: Coding a character with two different sides (Two Face)
« Reply #4 on: January 05, 2012, 02:18:31 PM »
I know that already. My question was "does any one know how to code it?" as in, what's the trigger code?

Of course you knew that. I just threw together a tutorial that may be of some use to you:

Two Sided Character Tutorial

Offline Acey

  • Infinity Administrator
  • *
  • Posts: 9579
  • Country: United States us
  • Last Login:December 05, 2022, 10:43:15 PM
  • "Victory means nothing, the fight is everything."
    • Infinity Wiki - Acey
    • Email
Re: Coding a character with two different sides (Two Face)
« Reply #5 on: January 05, 2012, 02:23:01 PM »
[State -1, move]
type = ChangeState
value = xxxx
triggerall = var(x)=1; or facing the other side-; var(x)=2
triggerall = command = "movename"
triggerall = statetype != A
trigger1 = ctrl

I wouldn't recommend a changestate though because it would require having 2 statedefs for ever single move in the character.

Offline drtremor

  • New Member
  • *
  • Posts: 6
  • Last Login:June 30, 2017, 09:17:30 AM
    • Email
Re: Coding a character with two different sides (Two Face)
« Reply #6 on: January 05, 2012, 05:33:29 PM »
Where's the tutorial. I couldn't find it.  :(

Offline shootYr.

  • [Magnum]
  • Contributor
  • ****
  • Posts: 1112
  • Last Login:September 11, 2012, 07:27:16 PM
  • What're you gonna do to me?...
Re: Coding a character with two different sides (Two Face)
« Reply #7 on: January 05, 2012, 05:46:32 PM »
How could you not find it when it's in a hyperlink 2 posts above yours?

Offline ExeLord

  • Smirking mage
  • RMM Contributor
  • ****
  • Posts: 1469
  • Country: Russian Federation ru
  • Last Login:October 16, 2024, 07:55:45 AM
Re: Coding a character with two different sides (Two Face)
« Reply #8 on: January 05, 2012, 05:47:45 PM »
2drtremor: Click on "Two Sided Character Tutorial" in Acey's post or this one.
What consumer society is?

"Where greyness prevails, the black always take the power." (c) "Its Hard to be God" - brothers Strugatskie.

Offline drtremor

  • New Member
  • *
  • Posts: 6
  • Last Login:June 30, 2017, 09:17:30 AM
    • Email
Re: Coding a character with two different sides (Two Face)
« Reply #9 on: January 05, 2012, 06:42:26 PM »
Lol. Sorry, I didn't know it was a link. I thought were telling me what to search. Thanx guys.

Offline Infinite Power

  • The End All Be All
  • Contributor
  • ****
  • Posts: 747
  • Last Login:January 27, 2020, 09:36:52 AM
  • Energy Doesn't Die
    • Infinite Fighting Forum
Re: Coding a character with two different sides (Two Face)
« Reply #10 on: January 05, 2012, 06:54:25 PM »
I wouldn't recommend a changestate though because it would require having 2 statedefs for ever single move in the character.

well  I was just giving a way to be done you could just use the same changestate in the CMD and use Ifelse(var(x)=1,xxxx,yyyy) in the statedef for the anims and hitdef. 

Now Die, Mortal.

Offline Acey

  • Infinity Administrator
  • *
  • Posts: 9579
  • Country: United States us
  • Last Login:December 05, 2022, 10:43:15 PM
  • "Victory means nothing, the fight is everything."
    • Infinity Wiki - Acey
    • Email
Re: Coding a character with two different sides (Two Face)
« Reply #11 on: January 05, 2012, 06:55:23 PM »
Lol. Sorry, I didn't know it was a link. I thought were telling me what to search. Thanx guys.

And if you have any other questions as you get deeper into the process feel free to post them here.

@ Reezy, very good point.

Offline drtremor

  • New Member
  • *
  • Posts: 6
  • Last Login:June 30, 2017, 09:17:30 AM
    • Email
Re: Coding a character with two different sides (Two Face)
« Reply #12 on: January 07, 2012, 04:38:39 AM »
@ Acey
The tutorial says this:

As you can see, the "ifselse" code says that if the character is facing left use animation 10200, otherwise use animation 200. Do this for all the state defs in your char's CNS files but the really tricky one's will be in the common1.cns file because they don't have the normal "anim" line of code.

But it doesn't explain how to code the common.cns

Offline Acey

  • Infinity Administrator
  • *
  • Posts: 9579
  • Country: United States us
  • Last Login:December 05, 2022, 10:43:15 PM
  • "Victory means nothing, the fight is everything."
    • Infinity Wiki - Acey
    • Email
Re: Coding a character with two different sides (Two Face)
« Reply #13 on: January 07, 2012, 09:57:42 AM »
@ Acey
The tutorial says this:

As you can see, the "ifselse" code says that if the character is facing left use animation 10200, otherwise use animation 200. Do this for all the state defs in your char's CNS files but the really tricky one's will be in the common1.cns file because they don't have the normal "anim" line of code.

But it doesn't explain how to code the common.cns

Read the section called "common1.cns"

You need to do the process, then it will all make sense.

Offline O Ilusionista

  • Since 1999 and kicking :)
  • IMT Content Architect
  • *
  • Posts: 12476
  • Country: Brazil br
  • Last Login:November 11, 2024, 12:35:15 PM
  • OpenBOR & Mugen addicted
    • BMT - Brazil Mugen Team
    • Email
Re: Coding a character with two different sides (Two Face)
« Reply #14 on: January 07, 2012, 10:24:23 AM »
on Mugen 1.0, coding Gill  (or any other char who have two different colors) is way easier. You just make him change the palette based on his facing. No need to double the sprites

Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

D2TD VS Showcase Thread by D2TD
[November 24, 2024, 09:12:03 AM]


Marvel vs. Capcom: Eternity of Heroes REMAKE Game Update 1.3.0 - N.A.O.H. by LightFlare
[November 21, 2024, 09:44:09 PM]


Terrordrome: Rise of the Boogeymen Extended Version ( jeepers creepers) version by leonardo
[November 19, 2024, 10:22:47 PM]


Hill of the Nameless(1.1 Only) by Vegaz by LightFlare
[November 19, 2024, 10:50:39 AM]


Golden Axe Returns by gokudo99
[November 19, 2024, 03:59:31 AM]


Barkley Shut Up and Jam! Stages by Vegaz by LightFlare
[November 12, 2024, 11:26:21 AM]


[BOR] _Avengers United Battle Force_ by O Ilusionista
[November 11, 2024, 12:35:24 PM]


Eternal Lament Stage 1.1 & 1.0 by O Ilusionista
[November 11, 2024, 12:34:54 PM]


MatreroG's Stages W.I.P. Concepts by MatreroG
[November 11, 2024, 07:00:56 AM]


Spooky House(1.1 Only/AIGS) by Vegaz by LightFlare
[October 31, 2024, 11:31:36 AM]

* IMT Calendar

November 2024
Sun Mon Tue Wed Thu Fri Sat
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 [26] 27 28 29 30

SimplePortal 2.3.5 © 2008-2012, SimplePortal