View unanswered posts | View active topics It is currently Fri Dec 27, 2024 10:48 pm



Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
 Custom Control functions 
Author Message
User avatar

Joined: Mon Jul 16, 2007 9:50 am
Posts: 1512
Location: Tallahassee, FL
Reply with quote
Post 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.


Thu Feb 19, 2009 7:38 pm
Profile YIM
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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.


Thu Feb 19, 2009 8:17 pm
Profile WWW
User avatar

Joined: Fri Apr 27, 2007 4:55 pm
Posts: 1178
Location: America!
Reply with quote
Post 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).


Sat Feb 21, 2009 10:12 pm
Profile
User avatar

Joined: Mon Jun 04, 2007 5:55 am
Posts: 1627
Location: Ohio
Reply with quote
Post 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.


Sat May 16, 2009 5:58 am
Profile YIM WWW
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post 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


Sat May 16, 2009 7:30 am
Profile
User avatar

Joined: Fri May 11, 2007 4:30 pm
Posts: 1040
Location: England
Reply with quote
Post 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.


Sun May 17, 2009 12:49 pm
Profile
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post 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.


Sun May 17, 2009 3:31 pm
Profile

Joined: Fri Nov 02, 2007 11:39 pm
Posts: 21
Reply with quote
Post Re: Custom Control functions
Can I use these functions to write a file of the input?


Mon Sep 28, 2009 11:32 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Custom Control functions
yes though you're going to have to package I/O libraries with whatever you use


Mon Sep 28, 2009 11:33 pm
Profile

Joined: Fri Nov 02, 2007 11:39 pm
Posts: 21
Reply with quote
Post Re: Custom Control functions
so can i set it to write this file to a server?


Mon Sep 28, 2009 11:38 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Custom Control functions
if you also package the internet libraries yes


Mon Sep 28, 2009 11:39 pm
Profile

Joined: Fri Nov 02, 2007 11:39 pm
Posts: 21
Reply with quote
Post Re: Custom Control functions
what should i package the servers with?
(In a rte?)


Mon Sep 28, 2009 11:43 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Custom Control functions
viewtopic.php?f=24&t=12079


Mon Sep 28, 2009 11:50 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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).


Tue Sep 29, 2009 5:28 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: Custom Control functions
He didn't mention screengrabbing, so I'm not sure how that's relevant.


Tue Sep 29, 2009 5:31 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 17 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.024s | 13 Queries | GZIP : Off ]