[XP] Berans' Interactive Drumkit script v1.11

Started by Berans, August 21, 2008, 10:18:16 pm

Previous topic - Next topic

Blizzard

O.o; Yes, that's a weird problem. At least you don't have it anymore. xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Berans

August 22, 2008, 09:15:40 pm #21 Last Edit: August 23, 2008, 01:08:50 am by Berans
I've created a workaround for it now. It only creates the bitmap when a key is pressed the first time. That way it doesn't have to make them all at the same time, seems to fix the lag/hanging issue pretty much completely, but we'll see what happens when I have alll 48 keys set up lol...I might have to also dispose of the bitmap every time the animations finished. I'm not sure.

EDIT: So far so good, except for one rather annoying issue. The forward slash key doesn't seem to be registering with your input module. I've set it up like

SLASH = [Key['/']]

but when I ask for Input::SLASH it doesn't register at all...any ideas?
All the other keys seem to be working correctly

EDIT2: It appears I've managed to fix it through sheer accident. I'm not sure if this is unique to my computer, but the backslash and forward slash characters were swapped. i.e. If a a key up as forward slash, the input command would only register with a backslash and vice versa.
I'm gonna post up my script in a second, once I put the finishing touches on the demo :P

Blizzard

Try this: Cache all bitmaps. This will not cause lag during execution. Only using a bitmap in a sprite causes lag. Dispose the sprites you don't need, not the bitmaps. :)
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Berans

The way I'm doing now seems to cause virtually no lag actually XD so I'm happy
Any reason why the forward and backslash characters were swapped in your Custom Game Controls by the way?

Blizzard

Maybe I messed up or something else is wrong.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Berans

I hope it's not just my computer lol...because otherwise everyone else will have a discrepancy in their keys.

screaminggingin

Hey, i'm just a bit of a n00b when it comes to this stuff  :^_^': so could you provide an example of what I should type in the "CALL SCRIPT" command?
I got the first bit "$scene = Scene_Drums.new" right. But i'm still kinda unsure with what to do with the input codes and the mode thingo, how do I put it? i.e '$scene = Scene_Drums.new (122141B)"  (the 12214B being the drums, Ijustdon't know where or how to putthem in the call script...):ninja:
Thanks in advance

Starrodkirby86

Since you're going to make a rhythm code, we're going to call the script a little differently.

$scene = Scene_Drums.new(switch,code,mode)


Here's where I got it from. XD

#------------------------------------------------------------------------------
#Using the script
#------------------------------------------------------------------------------
# - To call the script, use the "script" command within any event.
#   In the script write "$scene = Scene_Drums.new", without the quotes
# - You can change the script call as follows to create a "Ryhtm code" that
#   turns on a game switch when entered correctly
#   $scene = Scene_Drums.new(switch,code,mode)
# - To use this feature, replace switch with a switch number in the game that
#   you want to affect
#   Replace code with an "input code" in the following format:
#   '14232B23B1' (include the single quotes)
#   Where 1-4 correspond to each of the drums from left to right, and B
#   corresponds to the pedal
#   Finally, you can replace mode by either 0, 1 or 2 to have a different style
#   of inputting the code
#   mode 0 means that, if you get the code wrong, nothing happens
#   mode 1 means that, if you get the code wrong, a sound plays notifying you
#   of the wrong input, and the input starts over
#   mode 2 means that, if you get the code wrong, a sound plays and the scene
#   is quit to map
#   leaving mode out automatically uses mode 0


So here's an example code:

$scene = Scene_Drums.new(1,14232B23B1,2)


This basically says if I hit the rhythm code as 14232B23B1, then switch 1 will turn on. Otherwise, if I get it wrong, then there'll be a sound and I'll return to the map. :x

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).