collapse

Author Topic: Coding a move based on P1 inputting a randomly generated command  (Read 652 times)

0 Members and 1 Guest are viewing this topic.

Offline Error Macro

  • Never finishes anything
  • MUGEN Content Architect
  • *****
  • Posts: 1861
  • Country: United States us
  • Last Login:May 30, 2022, 05:37:56 AM
    • :)
    • Email
I'm very confused. I can't find out how to code a move this way. If the title wasn't clear enough, its like this:
Say you preform a move, but after preforming it, you have to press the buttons displayed on the screen in a time limit.

EX: .a, x, y, y, x, a

You'd have to input the command before the time runs out. If you're successful P2 gets damaged.

Hopefully you guys understand what I'm trying to code. Any help would be appreciated!



Offline Fallen_Angel

  • Global Moderator (out of the office)
  • *****
  • Posts: 1358
  • Last Login:July 04, 2012, 03:11:05 PM
    • Email
Re: Coding a move based on P1 inputting a randomly generated command
« Reply #1 on: April 28, 2008, 08:51:55 AM »
I don't really understood....so you hit the opponent and only if you press all the buttons, you hurt the opponent??

If it is like that you could use a var to detect the combination of the commands and the time you have to activate it

like these

varset
trigger1 = time =[0,10] && command ="a"
var(30)= var(30) +1


and make that with all the commands, just modify the time and the command

you may need to reset the var to 0 when you start the statedef to avoid errors later

what the var is going to make is keeping track if you pressed the button on the right time....so it will add 1 to the var...and the trigger of the damage should be lihe triggerall = var(30) = 6

I hope that helps :thumbsup:


sig made by shullbocka

Offline Error Macro

  • Never finishes anything
  • MUGEN Content Architect
  • *****
  • Posts: 1861
  • Country: United States us
  • Last Login:May 30, 2022, 05:37:56 AM
    • :)
    • Email
Re: Coding a move based on P1 inputting a randomly generated command
« Reply #2 on: April 28, 2008, 02:48:21 PM »
The code you posted crashed mugen :( Thanks for the helping mind though.

Offline 2dgameplay

  • Forum Member
  • ***
  • Posts: 230
  • Last Login:December 14, 2009, 01:42:35 PM
  • mugen creater n training
    • Email
Re: Coding a move based on P1 inputting a randomly generated command
« Reply #3 on: April 28, 2008, 05:02:23 PM »
The code you posted crashed mugen :( Thanks for the helping mind though.

do u mean like a combo if so i think this

[State xxx, 2]
type = changestate
trigger1 = movehit
trigger1 = Command = "a"
value =  xxx

[State xxx, 2]
type = ChangeState
trigger1 = movehit
trigger1 = Command = "x
value = xxx

or somethan like that
even tho i not sure

Offline Fallen_Angel

  • Global Moderator (out of the office)
  • *****
  • Posts: 1358
  • Last Login:July 04, 2012, 03:11:05 PM
    • Email
Re: Coding a move based on P1 inputting a randomly generated command
« Reply #4 on: April 28, 2008, 11:29:43 PM »
The code you posted crashed mugen :( Thanks for the helping mind though.

 /:O...it crashed the mugen??.....create a var that reset the value to 0 ....also use displaytoclipboard, so you can watch the numbers you are getting on the var


sig made by shullbocka

Offline susandirs

  • Contributor
  • ****
  • Posts: 22
  • Last Login:June 08, 2009, 05:52:35 AM
    • Email
Re: Coding a move based on P1 inputting a randomly generated command
« Reply #5 on: April 28, 2008, 11:39:13 PM »
This would be a difficult coding job, but that being said it is possible.

I think the first thing to do would be to go find the Cat Walk bonus character.  It required the character to input a series of commands at the correct time in order to beat the bonus game.  (just like dance dance revolution)



It's truly a beautifully coded character file, and so creative too!

I'll post a little bit of the States.st file from it here:
Quote
[State 1000, Right]
type=varset
triggerall= !time
trigger1= (root,var(5)=13)
trigger2= (root,var(5)=15) && (root,var(6)%2)=1
trigger3= (root,var(5)=17) && ((root,var(6)%4)=1 || (root,var(6)%4)=2)
trigger4= (root,var(5)=18) && (root,var(6)%4)=3
trigger5= (root,var(5)=19) && (root,var(6)%4)=2
trigger6= (root,var(5)=32) && (root,var(6)%2)=1
trigger7= (root,var(5)=34) && (root,var(6)%2)=1
var(13)= 1033

See how it may set var 13 to 1033 in this state?  Well it picks that odd number because 1033 corresponds to an animation of a right-facing arrow in the .air file and it uses the variable like this:

Quote
[State 1000, Dir]
type=explod
trigger1= var(13)=[1030,1033]
trigger1= !numexplod(1030)
anim=var(13)
ID=1030
sprpriority=6
postype=p1
pos=ifelse(root,var(51),0,72),0
scale=1,1
bindtime=-1
removetime=-1
pausemovetime=-1
supermovetime=-1

Yes, you read that right.  You can actually use "Anim = Var(13)" to trigger the desired animation number.  This gives you more flexibility than having to type "Trigger1 = var(13) = 1033", so that's real cool.

So far, you can see that this code uses triggers (and earlier on, the random function) to set a particular animation in motion, and you can see that the animation number is kept track of by the variable 13.  But there still needs to be a way to record your character's button entry which corresponds to the variable (in this case, right on the directional pad).

Quote
[State 1001, Right]
type=varset
triggerall= var(13)
triggerall= playerIDexist(root,var(1))
trigger1= playerID(root,var(1)),command="fwd" && playerID(root,var(1)),facing=1
trigger2= playerID(root,var(1)),command="back" && playerID(root,var(1)),facing=-1
var(23)=1033

This entry does two things.  First, it makes sure that whether you are walking forward or backwards, whatever way you're facing, right on the directional pad will execute via trigger 1 or trigger 2.  The other thing it does is make var(23) 1033, the exact same amount it had set var(13) to earlier.  Which means if you pressed right on the directional pad, then v(13) =v(23)

So now the big payoff,... wait for it.... wait for it....


Quote
[State 1001, Hit]
type=changestate
trigger1= var(10) || var(11) || var(12) || var(13)
trigger1= var(10)=var(20)
trigger1= var(11)=var(21)
trigger1= var(12)=var(22)
trigger1= var(13)=var(23)
value= 1005
:o

Yay! it's a hit!  Or at least, it MAY be a hit, depending on whether you hit right on the directional pad to make var 13 = var 23.  All the other variables are there to check if the rest of the commands were executed correctly... because this DDR clone asks the user to perform multiple button/direction presses at the same time.

----------
So there you have it.  An incredibly over complicated and convoluted explanation of how what you're talking about could be done.

It'd be very tough, but if you can figure out then you can impress all the ladies.  ;)

Good luck!
-Susan Mugen




Offline Fallen_Angel

  • Global Moderator (out of the office)
  • *****
  • Posts: 1358
  • Last Login:July 04, 2012, 03:11:05 PM
    • Email
Re: Coding a move based on P1 inputting a randomly generated command
« Reply #6 on: April 29, 2008, 12:38:21 AM »
You partially have the idea on what the var does , but these vars are used to detect the opponents buttons and compare them with the explods that appears on screen

also


Quote
[State 1000, Right]
type=varset
triggerall= !time
trigger1= (root,var(5)=13)
trigger2= (root,var(5)=15) && (root,var(6)%2)=1
trigger3= (root,var(5)=17) && ((root,var(6)%4)=1 || (root,var(6)%4)=2)
trigger4= (root,var(5)=18) && (root,var(6)%4)=3
trigger5= (root,var(5)=19) && (root,var(6)%4)=2
trigger6= (root,var(5)=32) && (root,var(6)%2)=1
trigger7= (root,var(5)=34) && (root,var(6)%2)=1
var(13)= 1033

See how it may set var 13 to 1033 in this state?  Well it picks that odd number because 1033 corresponds to an animation of a right-facing arrow in the .air file and it uses the variable like this:

the root, means that these var is being coded on a helper depending of the results obtained from the char

Using a helper could help him if he wanted to keep track of every button he use...but he wanted the code for only one  state so coding it on the proper state could make all the work

Quote
Yes, you read that right.  You can actually use "Anim = Var(13)" to trigger the desired animation number.  This gives you more flexibility than having to type "Trigger1 = var(13) = 1033", so that's real cool.

Actually no....what is coded there is that when the var is between 1030 & 1033  the explod uses one of the direction buttons depending on the result....check the trigger
trigger1= var(13)=[1030,1033]; value between 1030 & 1033...
anim = var(13); anim of the direction

Maybe he coded it like these because the dir buttons used the same line so he wouldn't have to code one explode for each direction


sig made by shullbocka

Offline Marancv

  • Spriting Masta and
  • IMT Content Architect
  • *
  • Posts: 1945
  • Last Login:December 05, 2019, 01:31:04 PM
  • Check out My NEW SITE! ;P
    • marancv's Hidden Place
Re: Coding a move based on P1 inputting a randomly generated command
« Reply #7 on: April 29, 2008, 06:29:18 PM »
following the request i guess the perfect example to use should be the combo system of this girl(dont remember the name) of Power instinct Matrimlee, wich you connect a hit wich sets the opponent ""ready to get hit", and then appear on the screen certain command u must input correctly in a correct timming, so the result is a combo to be made, but if not, then the P2, just continue its phisycs and fall on the ground.

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

Ancient Gears Stage 1.1 & 1.0 by MatreroG
[September 20, 2024, 11:59:18 AM]


Classic VS : Balrog by ELECTRO
[September 17, 2024, 04:48:07 PM]


Justice League Metropolis Stage by Vegaz by LightFlare
[September 16, 2024, 11:57:49 AM]


Ultimate Mai Shiranui (FF2 & FF3) by nickfurry
[September 15, 2024, 02:27:53 AM]


thunderstrike eric masterson by Blagoy
[September 12, 2024, 02:41:33 PM]


Justice League Gotham Stage by Vegaz by LightFlare
[September 11, 2024, 09:41:42 AM]


Lasombra's IKEMEN Go Interactive Stages' WIP Topic and Releases by Lasombra Demon
[September 07, 2024, 03:06:46 AM]


MatreroG's Stages W.I.P. Concepts by MatreroG
[September 06, 2024, 01:27:09 PM]


Justice League Flash Stage by Vegaz by LightFlare
[September 03, 2024, 10:30:40 AM]


Raid's here! Raid kills fighters dead in MUGEN! by GTFoxN6Y
[August 31, 2024, 02:44:15 PM]

* IMT Calendar

September 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