Jump to content

Photo

Disabling 'L'


  • Please log in to reply
5 replies to this topic

#1 Joe123

Joe123

    Retired

  • Members

Posted 19 September 2007 - 01:51 PM

I just need an FFC script that disables the use of the L button for a screen. I tried doing it myself, but seeing as I don't really know how to script, it didn't work.

#2 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 19 September 2007 - 01:56 PM

That's way too easy.

CODE
import "std.zh"
ffc script stop_L
void run()
{
Link->InputL()=false;
waitframe();
}


That SHOULD work. If not, take out the () in InputL.

#3 Joe123

Joe123

    Retired

  • Members

Posted 19 September 2007 - 02:08 PM

The idea was that it was easy, I just want to be able to turn off the roll script in a certain room. It was so easy, I even tried it myself icon_razz.gif. Ah well.
CODE
ffc script stop_L{
void run()
{
Link->InputL = false;
Waitframe();
}
}

You missed the brace to open the script.
However, when I try to compile it, it says I have an undeclared waitframe

EDIT: apparently that's because it needed a capital letter to start. However, it does nothing when I try it.

Edited by Joe123, 19 September 2007 - 02:11 PM.


#4 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 19 September 2007 - 03:21 PM

QUOTE(Joe123 @ Sep 19 2007, 03:08 PM) View Post

The idea was that it was easy, I just want to be able to turn off the roll script in a certain room. It was so easy, I even tried it myself icon_razz.gif. Ah well.
CODE
ffc script stop_L{
void run()
{
Link->InputL = false;
Waitframe();
}
}

You missed the brace to open the script.
However, when I try to compile it, it says I have an undeclared waitframe

EDIT: apparently that's because it needed a capital letter to start. However, it does nothing when I try it.

Oops. My bad. To tell you the truth, I haven't done any ZScripting lately. XD Also, it SHOULD stop the effects of pressing "L". Doing InputL = false; should tell it that L isn't being pressed. O_o.

...Oh wait! I've got it now! It only runs once.

CODE
ffc script stop_L
{
void run()
{
while(true)
{
Link->InputL = false;
Waitframe();
}
}
}


When you do "while(true)", the script keeps looping as long as you keep it running. Stop it with Quit();, and it won't loop again. Nice trick, huh?

#5 Joe123

Joe123

    Retired

  • Members

Posted 19 September 2007 - 04:12 PM

Thankyou, works fine now icon_smile.gif

When I tried to script it, it was the same as your first one. Then I tried to use a while loop, and realised I didn't really know how to, and so it didn't work very well.

This makes the Roll script by Beefster a LOT more useable.

Edited by Joe123, 19 September 2007 - 04:14 PM.


#6 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 19 September 2007 - 05:32 PM

QUOTE(Joe123 @ Sep 19 2007, 05:12 PM) View Post

Thankyou, works fine now icon_smile.gif

When I tried to script it, it was the same as your first one. Then I tried to use a while loop, and realised I didn't really know how to, and so it didn't work very well.

This makes the Roll script by Beefster a LOT more useable.

Heh, you're welcome. Half the time, the reason a script doesn't work even though it looks perfectly okay is that it quits right after it goes through it once. Remember, people! while(true) is your friend for looping a script as long as it's active!


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users