Not logged inOpenClonk Forum
Up Topic General / Help and Questions / Scripting without the editor
- - By Marky Date 2016-10-09 21:06
I want to use a keypad and give it simple script callbacks for entering a correct or wrong code, I am writing this in script. Therefore, I want to use SetCodeActions(), but I do not know what parameters to use. My best guess for now is that I have to pass a UserAction, but I have no idea how to define such an action. Is there a function for that?
Parent - - By Sven2 [us] Date 2016-10-09 21:31
You could simply do:

var my_keypad = CreateObject(Keypad, ...);
my_keypad.OnCorrectCodeEntered = this.CustomKeypadAction;
...
private func CustomKeypadAction(object clonk)
{
  // this == keypad and clonk== the clonk who entered the code
}
Parent - By Marky Date 2016-10-09 21:49
Ok thank! It was just not clear that you can enter functions into that. I'll expand the comment above that function when I get to it.
Up Topic General / Help and Questions / Scripting without the editor

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill