Accessing ammo variables from another program
I have recently purchased a Logitech G19 keyboard which has an LCD display built in. This LCD is often used in games to show useful status information. I would like to use my LCD screen to show me which weapons I have available in Hedgewars while it's not my turn. I'm always forgetting which weapons I have and there's no normal way to find out without opening the weapon menu during my turn.
I've downloaded the Logitech LCD SDK and read all of the info. I've created my new applet in C++ and I've got it to display "Hello world!" in the middle. Now I need to access the ammo variables in the game somehow to display them on the LCD. I have the latest SVN version of the source and I see that what I'm looking for may be in "uAmmos.pas" but it's Pascal and I don't know that language. I also don't know how to read another app's memory for the information.
Can anyone help me out? I'm using Visual Studio 2008 on Windows XP x64.
I once wrote an app for the G15 as well - wasn't that hard to do.
However I wouldn't do it using another app. Thats very restricted and won't work without admin rights if you're running Windows Vista or Seven. Instead including the functionality into Hedgewars shouldn't be that hard to do - at least as a Windows only feature (not sure about Linux/Mac support). Would be possible to use a wrapper DLL that's called from pascal and then interacts with Logitech's files.
Buy me a G19 and I might be encouraged to do it.
But ignoring all that: How do you intend to put all weapons on the small LCD display? Even with simplified graphics that might get crowded rather fast.
Hi Smaxx,
Well, Hedgewars currently has 37 weapons and the G19 screen has a resolution of 320 x 240. If I used 3 columns with 12/13 icons in each column and they had a height of about 15-20 pixels then it could fit.
Тhat's cheating, man. So someone without such keyboard has to wait for his/her turn in order to see such stats and plan his/her strategy. On the other side someone WITH this kind of thing can see it all all the time. Better not implement such thing.
As for the crowded thing - you can always use abbreviations for the weapons instead of graphics. But better make it with 3 letters for example:
Baz [oo] is equal to Bazooka with unlimited ammo
Mor [2] is equal to Mortar with 2 ammo
BB [1] is equal to Baseball-bat
...
HTML = How To Meet the Ladies
Here is my Unofficial Manual for HW. Hope you like it. Still working on it. Don't worry. Will get it finished...Sometime in the future.
I agree, what's next: "I have a second monitor that is being unused by Hedgewars so I'd consider it cool if it would instead display how I could kill my enemy in the next turn most effeciently"? :P
sheepluva <- me my code stats ->
a Hedgewars Developer
click here to message me
<- where I'm from what I speak ->
I'd display your own weapons only while you're playing - could put the announcer balloon down there as well ...
And if you have 2 keyboards attached, the balloon will fly from the dispay of the one to the display of the other.
HTML = How To Meet the Ladies
Here is my Unofficial Manual for HW. Hope you like it. Still working on it. Don't worry. Will get it finished...Sometime in the future.