The Daily Click ::. Forums ::. Klik Coding Help ::. Continuous firing in MMF?
 

Post Reply  Post Oekaki 
 

Posted By Message

Serenade



Registered
  18/12/2003
Points
  15
13th January, 2004 at 16:41:50 -

I have created a series of menus using active objects and I have it setup like this. You hit one option, another menu with choices comes up. And all of that works, the menus too except that MMF is continuously detecting the Fire1 from my control regardless if it joystick or keyboard. Imagine this, if you've played FFTactics or any other RPG with successive menus, this is what happens. You press "Data". then another menu appears asking to "Save" or "Load". Then you get to choose between the options. My dilemma is that it keeps reading the input so it just goes ahead pressing whatever option would come up next. Ughh I need help on how to restrict the control of the joystick so that it detects one click at a time.

 
"Absolute destruction is the only true perfection."

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
13th January, 2004 at 16:45:31 -

just use the ignore control and restore control commands
ex
player presses fire 1
-ignore control
-set a flag to on/off

flag is on/off (whichever you choose) + every 1 second
-restore control

 
Craps, I'm an old man!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
13th January, 2004 at 16:46:46 -

Are you switching frames between menus?

 
Craps, I'm an old man!

Serenade



Registered
  18/12/2003
Points
  15
13th January, 2004 at 17:01:56 -

I just tried what you said and it's still succesively reading the input, and no it's all happening in one frame.

 
"Absolute destruction is the only true perfection."

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
13th January, 2004 at 17:09:09 -

ok, then switch the every 1 second thing to time is greater than XX seconds.
ex.
Timer is greater than 1 second
-Restore control

 
Craps, I'm an old man!

Serenade



Registered
  18/12/2003
Points
  15
13th January, 2004 at 17:23:54 -

It 's still not working. Let me describe it better.

Main Menu Counter = 1.
Player presses Fire1.
- Move (Menu2) to X/Y.
- Make (Menu2) visible.

then...

Menu2 Counter = 1.
Menu2 is visible.
Player presses Fire1.
- Move (Menu3) to X/Y.
- Make (Menu3) visible.
- Move (Menu2) to X/Y.
- Make (Menu2) invisble.

You see, it's going all the way to Menu3 because it keeps reading the input, it is displaying Menu2 properly, however it just keeps reading it.


 
"Absolute destruction is the only true perfection."

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
13th January, 2004 at 17:31:56 -

ok, you're not actually switching frames there, so here's a way to do it.
You're going to need a counter

When the player chooses a menu and presses the fire button, set the counter to 5 (or whatever)
then

Counter > 0
-ignore control

Counter = 0
-restore control

every .20 seconds +
Counter > 0
-sub 1 from counter

your events should look like this
Menu2 Counter = 1
etc. etc.
Counter = 0
presses fire 1
-set counter to 5
-rest of your events.

------------------------
If this one doesn't work, then I don't know what will.

 
Craps, I'm an old man!

Serenade



Registered
  18/12/2003
Points
  15
14th January, 2004 at 01:41:29 -

Many hours later...

Shab, that last piece of code you posted worked, I had to do some altering but for the most part it's controlling the joystick like a dream. I frickin' love you man, you don't know how long I've been working on this crap. I am going to sleep one happy mofo tonight.

Shab, you da man!

 
"Absolute destruction is the only true perfection."

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
14th January, 2004 at 09:05:34 -

It should also work if you swap the events around

 
gone fishin'

Rycon



Registered
  20/09/2002
Points
  996
14th January, 2004 at 21:56:02 -

This problem happens with the mouse, say you click one place to bring a menu up and down, it will do both.

You should use a alterable value serenade (save a little memory), instead of a counter object. Ive solved this problem with less code, but it really doesnt matter unless your program is really complicated.

 
We are the music makers, we are the dreamers of dreams...
   

Post Reply



 



Advertisement

Worth A Click