This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-02-11 13:33:00

Turbanator
Scratcher
Registered: 2009-02-11
Posts: 8

Problem with comboing and button mashing....

Hey,

I can't seem to do combinations without it cycling through all the other programmed animations. Does anyone have any suggestions on how to fix it? To further explain, the Hadouken (which is D, DF, F, and any punch) when pressed, goes through everything else....crouching, moving forward, and using the ordinary punch. Any help on this would be greatly appriciated.

Thanks,

Turbanator

P.S.- The reason why I haven't uploaded the file is because I do not want it to be released until its ready. When it's ready, it'll be free for remixing....


http://i201.photobucket.com/albums/aa123/Akeme5/Turb.png

Offline

 

#2 2009-02-11 13:41:42

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Problem with comboing and button mashing....

Oh cool a street fighter game  smile

What I usually do is this
in this code I will assume that a hadoken is 9 frames

When I recieve (hadoken)
goto costume hadoken
wait .1 seconds
repeat 9
next costume
wait .1 seconds

.1 Is the animation delay.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2009-02-11 14:22:03

mrweston
Scratcher
Registered: 2007-12-13
Posts: 100+

Re: Problem with comboing and button mashing....

Do you mean, though, that it's going through the crouch, forward, punch, etc. animations when you press the combo keys in order, but you don't want those to happen -- only the combo move at the end? That's gonna be tricky.  smile

If you make those moves not happen as you're performing the combo key sequence (easy enough to do -- make those keys not do anything, and have the combo move wait until it hears the right keys in the right order), then that part will work, but now your regular crouching and moving and such doesn't.

The way it works in "real" games is by checking to see if the combo keys are pressed within a small window of time; if so, it animates the combo instead of the normal moves. You could try to do that with your Scratch version, but it'd be... difficult, especially when using a keyboard as the input device -- really hard to press the right keys fast enough to make something like that work. Maybe a system of mouse gestures?

Offline

 

#4 2009-02-11 16:54:34

Turbanator
Scratcher
Registered: 2009-02-11
Posts: 8

Re: Problem with comboing and button mashing....

archmage wrote:

Oh cool a street fighter game  smile

What I usually do is this
in this code I will assume that a hadoken is 9 frames

When I recieve (hadoken)
goto costume hadoken
wait .1 seconds
repeat 9
next costume
wait .1 seconds

.1 Is the animation delay.

Yup, a Street Figher game. I'm pretty sure you're the guy to be asking for this, seeing as how you have that kickass SSB game in progress. I'm not quite sure how to do this though. Do I need "Broadcast Hadouken" right underneath the command for the Hadouken and then that script following thereafter? Because I tried that, and it gave me the same result. BTW, I haven't programmed the crouch yet, because I figured I may as well solve this.

mrweston wrote:

The way it works in "real" games is by checking to see if the combo keys are pressed within a small window of time; if so, it animates the combo instead of the normal moves. You could try to do that with your Scratch version, but it'd be... difficult, especially when using a keyboard as the input device -- really hard to press the right keys fast enough to make something like that work. Maybe a system of mouse gestures?

Mouse jestures? Man, I'm trying to go for authenticity here, otherwise I could have simply made the Hadouken another button. But thanks for the suggestion...


http://i201.photobucket.com/albums/aa123/Akeme5/Turb.png

Offline

 

#5 2009-02-11 17:06:46

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Problem with comboing and button mashing....

Ok, when the commands for the hadoken is entered, broadcast the hadoken message and run the scripts I posted above. It should not run though the cotumes if you  put in my code correctly. Or it may be that you have other scripts that are changing the costumes incorrectly.

Putting combos in is also tricky.

Bascially for combos, you give the user a time limit to enter each key in a sequence and if all the keys are pressed fast enough then the command is preformed.

so a hadoken in scratch would look kinda like this I guess

variable contConbo=0

if down pressed{
set contCombo to 0
repeat(10){
if (key forward and key down pressed){
set contCombo to 1
}
wait0.02 seconds
}
if  (contCombo=1){
set contCombo to 0
repeat(10){
if (key forward pressed){
set contCombo to 1
}
wait0.02 seconds
}
if  (contCombo=1){
set contCombo to 0
repeat(10){
if (key punch key pressed){
set contCombo to 1
}
wait0.02 seconds
}
}
if (contCombo=1){
broadcast Hadoken
}
}








If you want I can make a demonstration.

Last edited by archmage (2009-02-11 17:22:42)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#6 2009-02-12 23:40:19

Turbanator
Scratcher
Registered: 2009-02-11
Posts: 8

Re: Problem with comboing and button mashing....

Hey I appreciate how fast you got back to me. Unfortunately, I tried that so many times and it did not work. I even conferred with a friend, but this is as far as we got;

http://www.filesavr.com/sfcartest62

Please, nobody release it online until I am done with it. I do not want any remixes of broken things. But please, Archmage, can you fix this program up?

Last edited by Turbanator (2009-02-12 23:40:34)


http://i201.photobucket.com/albums/aa123/Akeme5/Turb.png

Offline

 

#7 2009-02-13 00:40:52

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Problem with comboing and button mashing....

I can't download your file.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#8 2009-02-13 12:45:41

Turbanator
Scratcher
Registered: 2009-02-11
Posts: 8

Re: Problem with comboing and button mashing....

Sorry, there appears to be a problem with that hosting server. Try this link;

http://www.zshare.net/download/555725172d39fa05/


http://i201.photobucket.com/albums/aa123/Akeme5/Turb.png

Offline

 

#9 2009-02-13 15:14:58

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Problem with comboing and button mashing....

here
SFCartest6.2.sb - 6.97MB

It works but the combo timing is kinda weird. There is nothing you can really do about it though because scratch has built in block lag that makes timing things perfectly really difficult.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#10 2009-02-14 13:44:28

Turbanator
Scratcher
Registered: 2009-02-11
Posts: 8

Re: Problem with comboing and button mashing....

Thank you so much!
Just a question, can I send you a version for bug testing/fixing when I'm done?


http://i201.photobucket.com/albums/aa123/Akeme5/Turb.png

Offline

 

#11 2009-02-14 13:51:11

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Problem with comboing and button mashing....

I guess so, but I think that you should try to test and fix it on your own.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#12 2009-02-14 16:04:06

Turbanator
Scratcher
Registered: 2009-02-11
Posts: 8

Re: Problem with comboing and button mashing....

Thank you.
Could you explain how I would make the crouching function a hold down function?
I circled what you did and what I attempted to do;

http://i39.tinypic.com/2jgxdz.png

The crouch can now cancel halfway or whenever the user takes their finger off the down button, but when the down button is held down, it cycles through all the frames, whereas I want to make it like a fighting game, so that if the button is held down, the character stays crouching until the user stops pressing crouch.

Also, I would like to figure out how to do crouching and aerial attacks...I tried using your SSB fighting style program for reference, but it was too different from mine.
I think after that, my program will be complete for its deadline on Tuesday.

Oh, and BTW, is there a way to insert multiple spirtes? For this intro I created, after ripping the sprites from a ROM, I had to insert each individual sprite (200+ sprites!) as opposed to Windows, where you can select multiple files with ctrl or choosing a selection with the mouse.

Last edited by Turbanator (2009-02-14 16:04:50)


http://i201.photobucket.com/albums/aa123/Akeme5/Turb.png

Offline

 

#13 2009-02-14 16:39:42

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Problem with comboing and button mashing....

It should stay crouched if the stance variable is 10 and the down key is pressed. Your code for setting the stance variable is probably flawed.

You can also insert multiple sprites if you import an animated gif.

As for crouching and aerial attacks, make it so that the attack keys set off different attacks if the character is standing, crouched, or in the air.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#14 2009-02-14 18:17:43

Turbanator
Scratcher
Registered: 2009-02-11
Posts: 8

Re: Problem with comboing and button mashing....

I couldn't figure out either or...
Please, can you help me fix it one last time?
I put in 1 crouch punch (The Light Crouching Punch) and it did not work...
I figure if you help me with this one type of punch then I should be able to figure out the rest of them myself.
I'm really sorry to keep bothering you like this, its just that I haven't had proper sleep in a couple of days and this project is due on Tuesday...

SFCartest-ver0.62.sb - 21.83MB


Thank you in advanced, and thank you for your work thus far;

-Turbanator


http://i201.photobucket.com/albums/aa123/Akeme5/Turb.png

Offline

 

#15 2009-02-15 18:48:27

Turbanator
Scratcher
Registered: 2009-02-11
Posts: 8

Re: Problem with comboing and button mashing....

Please, I don't know if you got this post, and I don't mean to bump this topic, but I really, really , need your help...or anyone elses...


http://i201.photobucket.com/albums/aa123/Akeme5/Turb.png

Offline

 

Board footer