[PROGRAM] Logitech G15 LCD Stats Applet V1.40 : Update 16/11/2006

The place to discuss scripting and game modifications for X³: Reunion.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Kortako
Posts: 230
Joined: Sat, 22. Jul 06, 05:10
x4

Post by Kortako »

Both the Combat and Trade rank aren't correct for me, so maybe the combat rank for him just happens to be coincidentally the same at the moment? The combat rank was like 80% off for me, while the trade rank was about 1 and a half ranks off.
MisterElite
Posts: 125
Joined: Wed, 4. Feb 04, 11:08
x3

Post by MisterElite »

Cool
what a nice Tool
works great for me
good work Cycrow
Java Jawa
Posts: 3591
Joined: Sat, 5. Feb 05, 11:23
x3tc

Post by Java Jawa »

Fantastic - I only got my G15 yesterday [22.01.2007] and you've made my day! I've got applets for BF2, BF2142, Guild Wars and now X3! TYVM Cycrow.
i7 940 @ 2.93GHz
6GB DDR3 Corsair Dominator 1600MHz RAM
XFX GTX 295 1792MB GPU
ASUS Rampage II Extreme MoBo w/ X-Fi
Logitech G19, G9, Z-2300 THX speakers
Sennheiser PC350 headphones
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

if its not jsut the % that is off on the ranks, then it must be using the wrong boundries, i'll have to find out the real ones so i can correct it
User avatar
NZ-Wanderer
Posts: 1627
Joined: Thu, 5. Aug 04, 01:57
x4

Post by NZ-Wanderer »

Ohhhhhhhhhhhhhh

THANK YOU for creating this script...

I bought myself the G15 for Xmas, so will be able to put your script to very good use as at the moment no games I got have scripts for them (apart from X3 now)..
LintMan
Posts: 39
Joined: Tue, 2. Jan 07, 04:48
x3

Post by LintMan »

Does anyone have this working in Vista? The G15 display runs the X3 applet fine, but it says "No game found". But the game seems to be running the script OK, because it is generating the log09003.txt file, and the information in it looks OK. In the G15 configuration, the port number is set to 09003, so it matches.

I'm guessing this is some wierd permissions/ownership issue, but I have ownership and full access enabled on the all the files in the X3 dir and X3 G15 LCD dir. I'm stumped. Is there anything else it might be getting hitched on? I've really gotten used to the extra display and miss it a lot!
User avatar
X2-Eliah
Posts: 4369
Joined: Thu, 12. Oct 06, 16:30
x4

Post by X2-Eliah »

Hmm- Ithought G15 hasn't got a Vista driver yet, but i could be wrong...
BTW, yes, in my game the trade ranks are off for about 300%, combat seems to be ok for now..
LintMan
Posts: 39
Joined: Tue, 2. Jan 07, 04:48
x3

Post by LintMan »

I downloaded and installed the XP one, and it seems to be working fine - all the standard LCD applets work fine, except for the CPU display on the performance monitor, which stays blank.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

i dont have vista, so i cant really test it, but if its actually displaying the no game found, then at leasst its loading up fine, so the problem must be when its trying to read the log file.

u could try copying the log file to another directory and setting the directory in the LCD to that one, this will at least show if ur having directory access issues.

other than that without vista i cant really test it
LintMan
Posts: 39
Joined: Tue, 2. Jan 07, 04:48
x3

Post by LintMan »

I ended up getting it to work, then I turned UAC off because I was still having issues loading save games, and it stopped working again, and another log file, log09001.txt with some "purged" lines in it showed up. I deleted that stuff, but no luck. Then after another reboot, it started working again.

Damn, I forgot how annoying being an early OS adopter is!
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

the log9001 file is from the ship installer, its seling the installer thats its purged some ships from your save game so it can be removed from the installer
Risky
Posts: 867
Joined: Mon, 29. Mar 04, 15:24
xr

Post by Risky »

Thanks for this, I thought of having a go last year but never go much past logging a hello world!

I don't have the logitech keyboard but have a CrystalFontz 634 which seems a god candiate. At the moment I'm seeing if I can use the text reader of the software to do the trick but to get anything good I may have to write some code.

Just a couple of questions on reading the logfile

Code: Select all

Pilot: Risky II
Ships: 1
Stations: 0
Account: 41059
Time: 61453
Argon: Argon Confirmed Friend:195
Boron: Boron Trusted Courtier:112
Split: Split Shameless Creature:-23
Paranid: Paranid Unholy Nomad:-35
Teladi: Teladi Company Helper (L):89
Goner: Goner Believer:100
ShipClass: 0:0:0:0:1:0:0:0:0
Bars: 100:100:2050:2050
ShipName: Your Buster
ShipEnv: Atreus' Clouds
Target: Boron Passenger Shuttle Manta:100:100:175:104
Combat: Rookie:42
Trade: Petty Vendor:35
Insurance: 0
I'm guessing the Bars line is Hull Left, Hull Total, Shields Left, Sheids Total?
And where were you picking up the Lasers level?
Finally, do you have a quick link to the lookup to conovert the race rank values to percentages?


Many thanks, Risky.
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

for the race rep i could never get the percentages to work right, they always seemed to be off compared to the game and i could never make sense of how it actually worked.

the problem i had, was say the boundries between the race rep were 0 - 100, u would think 50% would be 50, but in the game isn't was something completly different

as for the Bars, the first value is the hull percentage, the 2nd is the shield percentage, the 3rd is the current laser level, and the 4th is the maximum laser energy.

this is the code i was using

Code: Select all

String CX3Data::GetRankPercentage ( String &rank )
{
	long amt = rank.GetToken ( 2, ':' ).ToLong();
	long upper = 0, lower = 0, r = 0;

	long checkamt = 0;
	while (1)
	{
		switch ( r )
		{
			case 0:
				checkamt = 2;
				break;
			case 1:
				checkamt = 5;
				break;
			case 2:
				checkamt = 10;
				break;
			case 3:
				checkamt = 20;
				break;
			case 4:
				checkamt = 50;
				break;
			case 5:
				checkamt = 70;
				break;
			case 6:
				checkamt = 90;
				break;
			case 7:
				checkamt = 130;
				break;
			case 8:
				checkamt = 150;
				break;
			case 9:
				checkamt = 250;
				break;
			case 10:
				checkamt = 450;
				break;
			case 11:
				checkamt = 700;
				break;
			case 12:
				checkamt = 900;
				break;
			case 13:
				checkamt = 1000;
				break;
			case 14:
				checkamt = 1400;
				break;
			case 15:
				checkamt = 2000;
				break;
			case 16:
				checkamt = 2500;
				break;
			case 17:
				checkamt = 6000;
				break;
			case 18:
				checkamt = 9000;
				break;
			case 19:
				checkamt = 16000;
				break;
			case 20:
				checkamt = 25000;
				break;
			case 21:
				checkamt = 44000;
				break;
			case 22:
				checkamt = 60000;
				break;
			case 23:
				checkamt = 86000;
				break;
			case 24:
				checkamt = 140000;
				break;
			case 25:
				checkamt = 280000;
				break;
			case 26:
				checkamt = 420000;
				break;
			case 27:
				checkamt = 500000;
				break;
			case 28:
				checkamt = 700000;
				break;
			case 29:
				checkamt = 1000000;
				break;
			case 30:
				checkamt = -1;
				break;
		}
		lower = upper;
		upper = checkamt;
		if ( (amt < checkamt) || (r >= 30) )
			break;
		++r;
	}

//	--upper;
	float a = (float)upper - lower;
	float b = (float)amt - lower;

	float p = ((b / a) * 100);
	int iP = (int)p;

	String fullRank = rank.GetToken ( 1, ':' );
	if ( checkamt >= 0 )
	{
		fullRank += " (";
		fullRank += String((long)iP);
		fullRank += "%)";
	}
	return fullRank;
}
Risky
Posts: 867
Joined: Mon, 29. Mar 04, 15:24
xr

Post by Risky »

I'll see how it goes but I suppose I could log a few data points on rep % vs the number and see if I can work out the curve.
DutchJuggernaut
Posts: 5
Joined: Sun, 12. Nov 06, 13:02
x3

Post by DutchJuggernaut »

Cycrow wrote:well it'll only work if u have the logitech g15 keyboard with the built in lcd display.

i got one today so i thought ill have a go at accessing the lcd display :)
This is great man!
Risky
Posts: 867
Joined: Mon, 29. Mar 04, 15:24
xr

Post by Risky »

Looking at the script code it is possible to get the basic rank stats out direct to for either CrystalControl2 or in this case LCD Smartie just by reformatting the output on the script to tidy it for display.

In this case I'm just getting three basic screens up and will leave the combat stuff for now.....
Risky
Posts: 867
Joined: Mon, 29. Mar 04, 15:24
xr

Post by Risky »

I'm logging data on the race ranks to try and get the relationships worked out. As you suspected it looks a bit curvy at the moment.

I could do with some more points so if anyone else feels up to comparing the script output to their in-game ranks for a while and sending me the data , I might be able to get there.

(In my case there's a bit of a rankings gap between my old savegames and the restart data).


EDIT: It turns out to be log scales but I haven't worked out how this is fudged for values close to zero.
Risky
Posts: 867
Joined: Mon, 29. Mar 04, 15:24
xr

Post by Risky »

OK I need some more data to be sure but the formulae

X<=-10 ............=1-LOG(-X)
-10<X<10..........=(10+X)/20
X>=10...............=2*LOG(X)-1

ratings based on Argon Citizen 0% = 0

Give close to the right ratings (though up to 4% over so there may be some hidden truncation in there somwhere)

However I need some more readings as this is onl based on the following data:

Code: Select all

Race Lev   Prc    Pts
P    -1    46%    -35
S    -1    64%    -23
B     0    35%     -3
A     0    50%      0
B     2    63%     67
T     2    88%     89
G     3    0%     100
B     3    8%     112
G     3    12%    116
G     3    12%    116
A     3    15%    120
A     3    61%    211
B     3    65%    222
A     3    70%    235
A     3    73%    245
A     3    77%    255
A     3    80%    265
A     3    83%    275
T     6    72%   7443
B     6    90%   9076
P     6    95%   9640
S     7     9%  11165
A     9     9% 112174
Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22438
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow »

u know u can just write a script to test it how u want.

u can use the set notority command and set it to what ever u like.

then u can just set it and check what it displays under the stats so u can compare it with any figure u like
Risky
Posts: 867
Joined: Mon, 29. Mar 04, 15:24
xr

Post by Risky »

Good point. Will do.

Return to “X³: Reunion - Scripts and Modding”