AWorks Input Module

You might want to explain a little bit more about the conflicts you encounter when you use these two scripts together, especially since they don't have any common relation to each other. Is there some kind of syntax/method error you encounter when you use them both? Does your game start acting funny? Does your timers stop working? What exactly happens?
hey vgvgf!
I really enjoy your script, but i got one problem:

when i whirl around the mouse in the screen the fps drops down to 19...
And in a shooting game, where run the 8-ways, you need to whirl the mouse around, to aim fast at plenty of enemies.

greetings to everybody, but mario, i hate him...^^
Hello again, I've been playing around a bit more with this script, and noticed a difference in array input.

A single array still works as the return value is true when at least one of virtual keys in the array are true for the corresponding method, but sub-arrays don't work. in your old script the Sub-Arrays will have true value only when all of its values are true for the corresponding method. Now however, it returns an error:

"Cannot convert Array into Integer"

Are you planning to include support for sub-arrays again?
Are you also planning to reintroduce key combos?

Thank you,

Draycos Goldaryn
DraycosGoldaryn wrote:
Now however, it returns an error:

"Cannot convert Array into Integer"



As I said in my post, 4 posts back, I am also getting this error:

"Script' =Library(ALibrary)' line 677: TypeError occurred. cannot convert Fixnum into Array"

When using the this script with the script I posted in my last post. And as Kain Nobel pointed out, they are two unrelated scripts.
@Fenwick, delete this method in the ALibrary class. I will delete it in future version, but provisionaly, just all people delete it, as it may cause conflictts with some other scripts too.
  1.  #---------------------------------------------------------------------------
  2.   # * Insert
  3.   #---------------------------------------------------------------------------
  4.   def insert(i, obj)
  5.     if i == 0
  6.       obj + self
  7.     elsif i == self.size
  8.       self + obj
  9.     elsif self.size < i
  10.       self + Array.new(i - self.size) +  obj
  11.     else
  12.       self[0, i - 1] + obj + self[i, self.size]
  13.     end
  14.   end
Expand to see the code.

It seems that RMXP Ruby already has the .insert and I am overwritting with a custom function of mine. It is a bit weird, because Ruby doesn't have any .insert function, Enterbrain added it to RGSS.

Quote:
I tried what you did with the p/print thing before, it only works the first time I do it, after that it doesn't work very well. The problem lies within the fact that Ruby vs C is too slow. I definately noticed this when I made my Sprite_MouseCursor class, which automatically hides the real cursor; I notice the system cursor takes about 2 or 3 seconds to hide itself when the sprite pops up, when it should be instant the sprite cursor is initialized but oh well.
It works for me, and all the time not only the first one.

Quote:
hey vgvgf!
I really enjoy your script, but i got one problem:

when i whirl around the mouse in the screen the fps drops down to 19...
And in a shooting game, where run the 8-ways, you need to whirl the mouse around, to aim fast at plenty of enemies.
That's a problem with RPG Maker in general. I have tried whirling the mouse over the Game.exe window with and without my script, and in both cases the fps drop down. However, after changing the Game.exe proccess priority to high the fps only drop in 1 frame, insteand of in 15 frames dropped with normal priority. Or that at least happends for in my computer. Try adding f0tz!baerchen antilag script.

Quote:
greetings to everybody, but mario, i hate him...^^
And who is mario? Mario the plumber who saved the Mushroom Kingdom? That's the only mario that comes to my head right now, and I hate it too, hehe.

Quote:
Hello again, I've been playing around a bit more with this script, and noticed a difference in array input.

A single array still works as the return value is true when at least one of virtual keys in the array are true for the corresponding method, but sub-arrays don't work. in your old script the Sub-Arrays will have true value only when all of its values are true for the corresponding method. Now however, it returns an error:

"Cannot convert Array into Integer"

Are you planning to include support for sub-arrays again?
Are you also planning to reintroduce key combos?
I have removed the special Array Input formats, because almost nobody used them and they were a bit time consuming. However, I want to add them again, but in new separated methods. Also, I am working on a new Key Combos system, the old one didn't convinced me much, it was difficult to use, and bad coded. I will make a simple and better one for next version.


Thanks all for the support, I am currently working on this script, for adding the new functions I mentioned. Also, I am thinking on realeasing the dll sources codes, what do you think about that?
i try to use this for key names:
  1.  
  2. GetKeyNameText = Win32API.new("user32","GetKeyNameText", 'LPI', 'I')
  3. MapVirtualKey = Win32API.new("user32","MapVirtualKey", 'II', 'I')
  4. #Buffer
  5. name = " " * 256
  6. #Den VirtualKeyCode angeben
  7. A = 65
  8. #Den LPARAM feststellen
  9. a = MapVirtualKey.call(A, 0) << 16 | 1 << 24 # or without | 1 << 24
  10. #Funktion aufrufen
  11. GetKeyNameText.call(a, name, 256)
  12. puts name.strip #=> A[NUL]
Expand to see the code.

but is doesnt fuction...
have you a idea how you can get the "localised" key?
i mean as sample
"@" if you press Q-key with right alt (alt gr)
or öäü as OEM keys

if not i try to make keyboard layouts itself
yeah, exactly the it's a meeee, mario!^^
and i tried fotzi's antilag script, and the problem keeps dropping the fps...
and the higher priority can'T solve the problem either.

But hey, I heard of someone around here... a programming God called vagsdh or some random name like that who might possibly solve the problem with his overwhelming skillzzzzzzz^^

Might he? ;)
@hanmac, see my old writting script: Aleworks Writting Lite.

@Caldaron, I will see if I can reduce the proccessing in the DLL for the next version, so it will be faster. Also, I don't belive in programming Gods, and I don't know him, but if you say, maybe he can.
ok this is good working stuff... but the demo crashs wich my system (liunx + wine)

i try to convert it to your lib v3
hello again.

vgvgf, There are a few other functions from your old input module that is not present in this one that I find a use for. I have added them from your old one to this one, but was wondering if there is a faster way of doing them?

they are:

Input.activated? #for determining status of caps lock, num lock, scroll lock, and insert
Input.key_click #I renamed it to Input.trigger to simulate a key trigger
Input.key_release #I renamed to Input.release to simulate releasing a key that was pressed
Input.key_press #I renamed to Input. press to simulate pressing a key

Thank you,

Draycos Goldaryn
Quote:
ok this is good working stuff... but the demo crashs wich my system (liunx + wine)

i try to convert it to your lib v3
It uses Win32 APIs, maybe wine can't emulate it.

@DraycosGoldaryn, I have not inlcuded them, maybe because I started the script from 0(Not Keys module, but Input) and I have forgotten to add them. Add them from the previous version, they should work fine. Maybe there is a beter way for pressing keys with hooks, but by now I don't know how. I still have to learn hooks... I really have to.


Some bad and good news. I will stop working in this script, that are the bad news. However I am working in something better, ARGSS a rewritting of the Game.exe and RGSS102E.dll(See link in my signature), which will include better Input methods, that are the good news. Also, I will still giving support for this script.
if found a "bug" the method rtp_path, returns "" also in your demo

its normal?
@vgvgf : Aw man, you're done with the script? You said a few posts up you'll probably release the DLL open source, can you please? Also, so long as I have your permission, may I decide to continue this script later on if I choose to? I'll always leave your name as the origional creator of the script, respectively, but there are other features I might officially add to future versions.

Also, if I repost it (since I can't continue your topic) I want to add the old features from the Aleworks, such as the Name/Number Input windows and whatever else you had.

@hanmac : Works fine in my project, I'm pretty sure we have the same versions but incase...

AWorks.get_rtp_path() Spoiler
  1.    #-------------------------------------------------------------------------
  2.   # * Get RTP Path
  3.   #-------------------------------------------------------------------------
  4.   def get_rtp_path(rtp = 0)
  5.      API::RGSSGetPathWithRTP.call(API::RGSSGetRTPPath.call(rtp))
  6.   end
Expand to see the code.


You call it like...

AWorks.get_rtp_path(n)

...Where 'n' is the Numeric index of the RTP path (1, 2, 3... RTP1, RTP2, RTP3 in Game.ini file), so other words AWorks.get_rtp_path("Standard") will probably only return an empty String (""), you'd have to call AWorks.get_rtp_path(1).
@hanmac, it should work as Kain Nobel mentioned it.

@Kain Nobel, yes I am done with this script, but because I am with something better. I have released the sources codes some time ago, but seems that I haven't announced it well. The file with them can be found in my signature, but I will add here also, in case I modify my signature.
AWorks DLL Sources Codes MSVC6 Project
If you have any problem understanding the sources, or adding new features don't hesitate on asking me. Also, you are free to modify them, I haven't added any kind of license, but as long as I am credited(At least with a "based on AWorks library/input" or "based on vgvgf's work"), there won't be any problem. Also, you should credit poccil too and ERZENGEL if you really want to, he didn't helped me with this library directly, but I was able to learn more C programming for making it. And, if you want to change the dll name, just do so. No need to keep AWorks.dll name on it.
AWorks.get_rtp_path(1) returns "C"...
i dont think that this is the path



some thinks from the old have i rebuild in my test.. i dont know if Kain could it better ..
The latest version of the XP AWorks.dll works fine, so by chance maybe you're using the VX version? I haven't tried the VX one, so maybe there is a problem with that method (function) in VX's DLL file, for example he could've coded it to look for the XP RTP path and not VX on accident, maybe. If thats the case, you'll have to ask him to fix the DLL because I know nothing about encrypted DLL files.

Either way, its a problem with the DLL and not the script(s) themselves. Sorry I couldn't help you anymore than that, otherwise I would fix it for ya :P

Yeah, I can try to rebuild the addons from the old Aleworks project I'll let you know if/when I get around to finishing it. I really need to anyways, its holding up a script request I volunteered on for a "Talking and Answers" system, I feel bad because that guy has been waiting too long for it to be finished lol. The only thing holding that up is I have to write a window that allows you to type stuff in it, so I'll try and get to that sometime this week.
you are right ... its a bug in the rgss2 libary
posible i find a way to look in the registy
That's not a bug, it's just that Enterbrain changed the behavior of that API in the RGSS2 library for getting the RTP path. Now, I remember having seen that while testing my library in VX, some time ago. It just returns the first character of the path, "C" from "C:/...". If my memory isn't bad, AWorks.get_rtp_path(2) would return the second character, and so on.
nope .... (2) returns ""
i write a bugfix for rmvx..
using the ini & the registy reader
hey vgvgf!

I LOVE YOU!


Just wanted youto know that xD
EDIT: I was having a problem with one of my scripts, where Input.trigger? was popping an error... I fixed my script, so the problem doesn't occur anymore.

Anybody who wants to use this system with my "Battle.EscapeExp&Gold" script but are having problems with the Input.trigger? method in the AWorks Input Library when they put the script in, please PM me for the new version. I have no idea why the error occurs, since it has nothing to even do with Input.trigger? but at the very least it doesn't happen anymore.
Hello! :)

Hey I'm having an issue with AWorks, I was wondering if it'd be easy for you to fix or not, and if you wouldn't mind resolving this issue. Basically, without the script I can use my XBox360 controller (or other gamepads that work with RM) just fine, but with your script it doesn't respond to the controller whatsoever.

I don't need to assign anything besides the standard buttons (C, B, A, X, Y, Z, L, R) from the Input module that a controller normally responds to by default assignment (whatever you can normally assign when you press F1 to edit your keys).

Since you assign the Input keys from the HKEY in the registry, I don't think that would be where the issue is, if I'm correct that HKEY holds both keyboard and controller data. However, I think since you rewrote Input methods .trigger?, .press?, .repeat? that might be the area you'd need to address for this issue. I'd fix it myself with your open source code, but I don't have much knowledge behind programming in C and making a DLL.

Anyways, I appologize if I'm buggin' ya and I hope you can fix this for me, or if you'd be able to give me some advice how I could do it myself. Later man!

By the way... Spoiler
Trebor777 made a Joypad module for Aleworks a couple years back, which has the important Win32API calls incase you don't feel like digging.
:) Kain, the joypad module:) was originally created by Vgvgf :), we worked on it together.
@Kain Nobel, as Trebor said, we worked on the joypad script together. I have though on adding joypad functions to AIM, but as I don't have any joypad for my PC to test with, it is really difficult... Also, I am not working on this script anymore. ARGSS will have a good joypad support, so I prefer working on ARGSS rather than in this script.

A quick solution for being able to use the joypad, is modifing the AIM ruby script for having the original methods working and the new ones separated. Just make an alias for Input.update, insteand of overwritting it, and rename the new .press?, .trigger? and .repeat? methods to something different.
I hope this topic isn't too outdated, I just have a question: does your script have a way to check the mouse position relative to the window itself? It would be nice to have a means to drag messageboxes around. lol

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=59160