A place to have fun with Mugen
 
PortalHomeFAQMemberlistSearchRegisterComic WIP TrackerDownloadsLog inChat
Translate the Website
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Latest topics
» Tekken chuchoryu proyect
by chuchoryu Today at 1:46 am

» WIP Valkyrie Marvel by Regisc and Cristianomelo w/video preview 11/18
by Sledge Today at 1:45 am

» Riddick
by ParaDo0x Today at 1:29 am

» Axel Stone by Nexus Games/Shin Mako & SeanAlty - 100 Youtube Subs Release
by skhsato123 Today at 12:42 am

» SvC Allen Snider + Kim Dragon revamp!!
by skhsato123 Today at 12:42 am

» I would like to give BIG "thank you" to all sprite artists!
by chuchoryu Yesterday at 9:57 pm

Special Features at MMV








Share | 
 

 Having MUGEN detect if a character is at a certain screen position?

View previous topic View next topic Go down 
AuthorMessage
Minun



Posts : 142
Join date : 2015-03-08

PostSubject: Having MUGEN detect if a character is at a certain screen position?   May 17th 2015, 8:33 am

For my game, I want characters to lose a quarter of their health when touching the edge of a stage from specific moves (Charge attacks, final smashes, and throws at certain health ratios)

I need to  have MUGEN detect for screen position on certain stages. But is there any method of doing so?
Back to top Go down
View user profile
borewood2013



Posts : 3162
Join date : 2014-08-11

PostSubject: Re: Having MUGEN detect if a character is at a certain screen position?   May 19th 2015, 11:38 am

Please look at KFM's "Fast Kung Fu Palm" EX special move.

When it hits P2, it sends P2 to a custom get-hit state that makes P2 fly to the opposite wall and then bounce off.

KFM's "Fast Kung Fu Palm" [Statedef 1020]:
[State 1020, 6]
type = HitDef
...............
...............
...............
p2stateno = 1025    ;Make p2 go to state 1025 on hit
p2facing = 1        ;Force to face p1

Look at [Statedef 1025] and follow its ChangeState to [Statedef 1026]:
[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65  ;;;<---------------- this is how you tell MUGEN to detect when P2 is going to the back edge of a MUGEN stage
trigger2 = FrontEdgeBodyDist < 65  ;;;<---------------- this is how you tell MUGEN to detect when P2 is going to the front edge of a MUGEN stage
value = 1
movecamera = 0,1

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20  ;;;<---------------- this is how you tell MUGEN to detect when P2 is going to the back edge of a MUGEN stage
trigger2 = FrontEdgeBodyDist <= 20  ;;;<---------------- this is how you tell MUGEN to detect when P2 is going to the front edge of a MUGEN stage
value = 1027

Then you can use the LifeAdd state controller in [Statedef 1027] to make P2 "lose a quarter of their health":


Code:
[State 1027, LifeAdd]
type = LifeAdd
;;;triggerall = Life != 0 && Alive != 0
trigger1 = Time = 1
value = -Ceil(LifeMax / 4)
absolute = 1
persistent = 0
ignorehitpause = 1

>> I need to  have MUGEN detect for screen position on certain stages. But is there any method of doing so?
Hmmmmmmmmm.........some MUGEN triggers like ScreenPos and StageVar can do the job..... study
Back to top Go down
View user profile https://onedrive.live.com/?cid=7DB65F02B0BBD12E
 
Having MUGEN detect if a character is at a certain screen position?
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
The Mugen Multiverse :: Mugen :: Mugen Help-
Jump to: