Data Realms Fan Forums
http://45.55.195.193/

Custom Control functions
http://45.55.195.193/viewtopic.php?f=73&t=13767
Page 1 of 2

Author:  Darlos9D [ Thu Feb 19, 2009 7:38 pm ]
Post subject:  Custom Control functions

So looking through the function dump, I saw all of these:
Code:
PRINT: 124  table
PRINT:     SetMousePos  function
PRINT:     DisableMouseMoving  function
PRINT:     JoyDirectionPressed  function
PRINT:     JoyButtonPressed  function
PRINT:     ForceMouseWithinPlayerScreen  function
PRINT:     AnalogMoveValues  function
PRINT:     AnyInput  function
PRINT:     AnalogAimValues  function
PRINT:     AnalogAxisValue  function
PRINT:     MouseButtonPressed  function
PRINT:     MouseButtonHeld  function
PRINT:     JoyButtonReleased  function
PRINT:     AnyJoyPress  function
PRINT:     AnalogStickValues  function
PRINT:     MouseWheelMoved  function
PRINT:     AnyJoyButtonPress  function
PRINT:     AnyMouseButtonPress  function
PRINT:     KeyHeld  function
PRINT:     TrapMousePos  function
PRINT:     AnyPress  function
PRINT:     MouseUsedByPlayer  function
PRINT:     SetMouseValueMagnitude  function
PRINT:     AnyStartPress  function
PRINT:     AnyJoyInput  function
PRINT:     WhichJoyButtonPressed  function
PRINT:     ElementHeld  function
PRINT:     KeyReleased  function
PRINT:     MouseButtonReleased  function
PRINT:     JoyButtonHeld  function
PRINT:     ElementPressed  function
PRINT:     JoyDirectionReleased  function
PRINT:     KeyPressed  function
PRINT:     ElementReleased  function
PRINT:     WhichKeyHeld  function
PRINT:     ForceMouseWithinBox  function
PRINT:     JoyDirectionHeld  function
PRINT:     GetMouseMovement  function

Clearly one could use these to add all new controls and interface stuff to CC with these things. Sadly, I'm not entirely certain how they are applied. Like, I don't know their arguments, or what objects use them. I'm not certain if these functions are typical of Lua or just CC specific. I suspect the latter, since Google isn't giving me much. Some clarification I believe is in order.

Author:  TheLastBanana [ Thu Feb 19, 2009 8:17 pm ]
Post subject:  Re: Custom Control functions

Their object is UInputMan, so for instance, UInputMan:SetMousePos();.
If you want to know what argument types they need, just type the function sans arguments into the console and it'll tell you them. If you need some examples of the keyboard functions, check out zalo's Melon Racing.

Author:  Lord Tim [ Sat Feb 21, 2009 10:12 pm ]
Post subject:  Re: Custom Control functions

You'll also need to know the key codes, which you can find with a while loop and WhichKeyPressed. I suspect they are probably also the same as Allegro's key codes. Settings.ini probably also uses the same codes, but I am not entirely sure.

When checking if a key is down, instead of WhichKeyPressed, I would use KeyHeld(int key).

Author:  Miles_T3hR4t [ Sat May 16, 2009 5:58 am ]
Post subject:  Re: Custom Control functions

if keyheld (key) would most likely work, it might be if a key on the keyboard is held, at which point it could check for something like + on the numberpad, or it could check for the key's number (which is what, 001-111 or some crap?), Or If KeyHeld could refer to "does the user have a registration key"

Just mess with each one in the console for a while and see what it does, you know, what we used to do to figure out .ini variables, what harm could come of that?


--edit

although we should have access to every function data has access to, so we could theoretically add pie-menue options, (mentioned in one of the dev logs) and some of the commands for that, might be on this list.

Author:  Daman [ Sat May 16, 2009 7:30 am ]
Post subject:  Re: Custom Control functions

Miles_T3hR4t wrote:
if keyheld (key) would most likely work, it might be if a key on the keyboard is held, at which point it could check for something like + on the numberpad, or it could check for the key's number (which is what, 001-111 or some crap?)


Do you really feel the need to bump an old topic to restate what was said?

Quote:
Or If KeyHeld could refer to "does the user have a registration key"


how about no

Quote:
although we should have access to every function data has access to


stop posting in this section

Author:  robolee [ Sun May 17, 2009 12:49 pm ]
Post subject:  Re: Custom Control functions

Lord Tim wrote:
You'll also need to know the key codes, which you can find with a while loop and WhichKeyPressed. I suspect they are probably also the same as Allegro's key codes. Settings.ini probably also uses the same codes, but I am not entirely sure.

When checking if a key is down, instead of WhichKeyPressed, I would use KeyHeld(int key).


the other day I realized that the a-z key codes are as follows: a = 1, b = 2, c = 3... z = 26

I bet all you guys feel like idiots now for having to use while loops every time, I figured it out by just messing with the numbers and seeing which key it related to.

Author:  Daman [ Sun May 17, 2009 3:31 pm ]
Post subject:  Re: Custom Control functions

robolee wrote:
Lord Tim wrote:
You'll also need to know the key codes, which you can find with a while loop and WhichKeyPressed. I suspect they are probably also the same as Allegro's key codes. Settings.ini probably also uses the same codes, but I am not entirely sure.

When checking if a key is down, instead of WhichKeyPressed, I would use KeyHeld(int key).


the other day I realized that the a-z key codes are as follows: a = 1, b = 2, c = 3... z = 26

I bet all you guys feel like idiots now for having to use while loops every time, I figured it out by just messing with the numbers and seeing which key it related to.



nope

we all already knew because IRC is a communist state where information is shared

by the way that's only UInputMan's if you didn't realize already. It is quite different for Controllers.

Author:  user74 [ Mon Sep 28, 2009 11:32 pm ]
Post subject:  Re: Custom Control functions

Can I use these functions to write a file of the input?

Author:  Grif [ Mon Sep 28, 2009 11:33 pm ]
Post subject:  Re: Custom Control functions

yes though you're going to have to package I/O libraries with whatever you use

Author:  user74 [ Mon Sep 28, 2009 11:38 pm ]
Post subject:  Re: Custom Control functions

so can i set it to write this file to a server?

Author:  Grif [ Mon Sep 28, 2009 11:39 pm ]
Post subject:  Re: Custom Control functions

if you also package the internet libraries yes

Author:  user74 [ Mon Sep 28, 2009 11:43 pm ]
Post subject:  Re: Custom Control functions

what should i package the servers with?
(In a rte?)

Author:  Grif [ Mon Sep 28, 2009 11:50 pm ]
Post subject:  Re: Custom Control functions

viewtopic.php?f=24&t=12079

Author:  mail2345 [ Tue Sep 29, 2009 5:28 am ]
Post subject:  Re: Custom Control functions

Fyi, there is no screen getting function in CC that does not lag horribly(I forgot if they work at all).

Author:  Grif [ Tue Sep 29, 2009 5:31 am ]
Post subject:  Re: Custom Control functions

He didn't mention screengrabbing, so I'm not sure how that's relevant.

Page 1 of 2 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/