Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Mahak on August 11, 2010, 09:54:37 pm
-
Does anyone know why I can't substitute a keyboard keypress with (MOUSE_LEFT_BUTTON) in script? Am I using wrong syntax?
Example:
$KeyPress: t
$On Key Pressed:
[
Blah blah blah scripty scripty etc. etc.
That works fine. But if I replace 't' (or any other keyboard key) with MOUSE_LEFT_BUTTON it won't work.
Tried a few different combinations of syntax to no avail.
Anyone have any clues? I'm guessing I may have to call up some kinda mouse state or something, but I'm a plebe with that kinda thing...
M.
-
Did you make sure that the mouse button wasn't already assigned? I believe that is a default secondary input.
-
What's wrong with using io.isMouseButtonDown(MOUSE_LEFT_BUTTON) in an On Frame hook?
-
Reckon I have to just teach myself a little more scripting. I'm just trying to mash up stuff with existing scripts, but I think I just have to write my own from the ground up. Thats ok - it's something I've been putting off for ages, but I need to know how to do it.
I'll read some tutorials & faqs and stuff before I start whining again!
Cheers all.
M.
-
One handy tip is to use the "Output scripting to scripting.html" switch in the Launcher's Dev Tool feature list. This will create a file called scripting.html in your FS2 folder, which contains all lua API functions the engine supports.
-
Well thats just made my day. A cheat sheet! Awesome.
Once again, hardlight community forums ftw!