 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Wyrmskull Guest
|
Posted: Sun Sep 28, 2008 12:27 pm Post subject: |
|
|
| Bump! |
|
| Back to top |
|
 |
Wyrmskull Guest
|
|
| Back to top |
|
 |
Wyrmskull Guest
|
Posted: Sun Sep 28, 2008 3:01 pm Post subject: |
|
|
This turned out to be pretty simple.
Put d3d8.dll and gpcomms.dll into Warcraft III dir.
Suppose your warcraft dir is sth like:
"C:\Program Files\Warcraft III"
| Code: |
GPP_Load()
{
global
GPP_Toggled := 0
WarcraftDir := "c:\Program Files\Warcraft III\\"
hModule := DllCall("LoadLibrary", "str", WarcraftDir . "gpcomms.dll")
OnExit, ExitSub
}
ExitSub:
DllCall("FreeLibrary", "UInt", hModule)
ExitApp
GPP_SetText(outX,outY,outText,ARGB,FontSize,Monospaced)
{
// outX outY, Word
// outText, null terminated string
// ARGB, DWord
// FontSize, Byte
// Monospaced, Boolean
OutText := OutText . "\0"
result := DllCall( "gpcomms\\GPSL_SetTextLineData", Uchar, 0x1, UShort, outX, UShort, outY, str, outText, UInt, ARGB, Int,0, Uchar, FontSize, Int,0, Uchar, Monospaced)
}
GPP_Toggle()
{
global
GPP_Toggled := 1 - GPP_Toggled
result := DllCall("gpcomms\\GPSL_ShowText", Uchar, 0x1, Int, GPP_Toggled)
}
|
I've been looking for this for ages. Now I've finally got it, in a AHK function. Yeah. |
|
| Back to top |
|
 |
Wyrmskull Guest
|
Posted: Sun Sep 28, 2008 3:05 pm Post subject: |
|
|
Errata : Watch out for double backslashes and double slashes, as i use backslash as escape char and double slash as comment
This should be correct code:
| Code: |
GPP_Load()
{
global
GPP_Toggled := 0
WarcraftDir := "c:\Program Files\Warcraft III\"
hModule := DllCall("LoadLibrary", "str", WarcraftDir . "gpcomms.dll" )
OnExit, ExitSub
}
ExitSub:
DllCall("FreeLibrary", "UInt", hModule)
ExitApp
GPP_SetText(outX,outY,outText,ARGB,FontSize,Monospaced)
{
; outX outY, Word
; outText, null terminated string
; ARGB, DWord
; FontSize, Byte
; Monospaced, Boolean
OutText := OutText . "\0"
result := DllCall( "gpcomms\GPSL_SetTextLineData",Uchar,0x1,UShort,outX,UShort,outY,str,outText,UInt,ARGB,Int,0,Uchar,FontSize,Int,0,Uchar,Monospaced)
}
GPP_Toggle()
{
global
GPP_Toggled := 1 - GPP_Toggled
result := DllCall("gpcomms\GPSL_ShowText", Uchar, 0x1, Int, GPP_Toggled)
} |
|
|
| Back to top |
|
 |
Wyrmskull Guest
|
Posted: Sun Sep 28, 2008 3:36 pm Post subject: |
|
|
Errata again: sorry, "str" type is already null terminated.
Take the OutText := OutText . "\0" part away. |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Sep 28, 2008 7:24 pm Post subject: |
|
|
| Could someone compile and pack it, please? |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Sep 28, 2008 7:26 pm Post subject: |
|
|
| where to download gpcomms.dll ? |
|
| Back to top |
|
 |
Wyrmskull Guest
|
Posted: Sun Sep 28, 2008 8:26 pm Post subject: |
|
|
I'm having some testing and building some demo app... Just give me a bit more time. The dlls are from http://www.mikoweb.eu/index.php?node=28
I used the GPP 1.5 Dx8 package |
|
| Back to top |
|
 |
BIG_RED_TEXT
Joined: 12 Jan 2008 Posts: 130
|
Posted: Mon Sep 29, 2008 3:59 am Post subject: |
|
|
awesome I got it to work, erhm, have you figured out how to clear old text? like if i write the string "this is just a example", and later write "hey you!" it will display "hey you!just a example", it doesn't delete the text that were previously there, it just overwrites the first letters your new messages cover.
I think I'll make a multi-line function too, if you're not going to do it... |
|
| Back to top |
|
 |
Wyrmskull Guest
|
Posted: Mon Sep 29, 2008 1:29 pm Post subject: |
|
|
I still haven't spent any time since I've been busy with University taxes and exams Btw to build a multiline funtion is pretty much like modifing the one I made. Do it if you want, docs are there to be read. Btw, I haven't tried cleaning the text away. I'll have a look. You can explore the DLL with some dll-export-viewer and get some info. I ain't got time atm.
Wyrm |
|
| Back to top |
|
 |
Wyrmskull Guest
|
Posted: Mon Sep 29, 2008 1:36 pm Post subject: |
|
|
I forgot yesterday I've made some more arrangement, and the multiline function. I must have been really sleepy xD Remember it's for Warcraft III here. I have no problem in clearing data, i simply call the function again and the result is there. I'm using DX 8 dll.
| Code: |
#Persistent
#EscapeChar \
#CommentFlag //
Exit
#IfWinActive, Warcraft III
GPP_Load()
{
global
GPP_Toggled := 0
WarcraftDir := "c:\\home\\portable\\wc3\\"
hModule := DllCall("LoadLibrary", "str", WarcraftDir . "gpcomms.dll" )
OnExit, ExitSub
}
ExitSub:
DllCall("FreeLibrary", "UInt", hModule)
ExitApp
GPP_SetSingleText(outX,outY,outText,ARGB,FontSize,Monospaced)
{
// outX outY, Word
// outText, null terminated string
// ARGB, DWord
// FontSize, Byte
// Monospaced, Boolean
result := DllCall( "gpcomms\\GPSL_SetTextLineData", Uchar,0x1, UShort,outX, UShort,outY, str,outText, UInt,ARGB, Int,0, Uchar,FontSize, Int,0, Uchar,Monospaced)
}
GPP_SetMultiText(outX,outY,outText,ARGB,FontSize,sizeX,sizeY,Monospaced)
{
// outX outY, Word
// outText, null terminated string
// ARGB, DWord
// FontSize, Byte
// sizeX, sizeY, Word
// Monospaced, Boolean
result := DllCall( "gpcomms\\GPML_SetTextMultilineData", Uchar,0x1, UShort,outX, UShort,outY, str,outText, UInt,ARGB, Int,0, Uchar,FontSize, Int,0, Uchar, sizeX, Uchar, SizeY, Uchar,Monospaced)
}
GPP_Toggle()
{
global
GPP_Toggled := 1 - GPP_Toggled
result := DllCall("gpcomms\\GPML_ShowText", Uchar, 0x1, Int, GPP_Toggled)
result2 := DllCall("gpcomms\\GPPIC_ShowPicturePos", Int, GPP_Toggled, Uchar, 0x30, Uchar, 0x30)
}
GPP_SetPicture(Picture)
{
result := DllCall( "gpcomms\\GPPIC_LoadNewPicture", str, Picture)
}
!1::
GPP_Load()
GPP_SetPicture("c:\\home\\img.jpg")
GPP_SetMultiText(100,100,"Stronzo\r\nStronzone", 0xFFFFFFFF, 14,200,200,1)
return
!2::
GPP_Toggle()
return
#IfWinActive,
^r::
Reload
return |
|
|
| Back to top |
|
 |
Wyrmskull Guest
|
Posted: Mon Sep 29, 2008 1:38 pm Post subject: |
|
|
| And nvm those bad words in italian... just a vulgar replacing of "lorem ipsum dolor sit amet" etc |
|
| Back to top |
|
 |
BIG_RED_TEXT
Joined: 12 Jan 2008 Posts: 130
|
Posted: Mon Sep 29, 2008 11:48 pm Post subject: |
|
|
Thanks for the update were originall planning on porting ur solution to the functions he included, but I guess you were faster. The new functions you've added, do they require the additional dlls that follow in the Archive?
I've already checked it with a dll explorer, I didn't find anything that could help... I tried running my game in Dx8 mode, and it still didn't clear the old remaining text... my current solution is this:
| Code: |
InputBox, text
Len := StrLen(text)>Len ? StrLen(text) : Len
If StrLen(text) < Len
{
Loop, % Len-StrLen(text)
text .= A_Space
Len = 0
}
; send the string 'text' to the dll as output text
|
It simply just adds additional spaces to cover the old letters...
Another issue I have is that the dll drops down my fps by 50% when i show the text:
Vsync On: 140 fps without visible text, 70 fps with visible text
Vsync Off: 60 fps without visible text, 30 fps with visible text
I don't understand why it drops to 50% of the actual rate it should have (by visible text i mean text that is toggled in the "activated" state). Tough this only happens in crowded places, but without the active text i still should get like 120 fps, but it just drops to 50% anyways, maybe i should ask the author, really weird that it drops to 50% of w/e performance it's setup to do...
btw could you convert the Readme.mdi for the "GPP 1.5 DX9 test package (DX9 only)" package? I can't convert/read it.
Really, need to find a solution for the FPS problem... |
|
| Back to top |
|
 |
Wyrmskull Guest
|
Posted: Tue Sep 30, 2008 11:53 am Post subject: |
|
|
I've found I have the same problem as you: when you set a new string over an old one, the buffer isn't cleared. I added sth like your code to clear it up before it's used. Knowing the size of the buffer which is 1023 + ending char (specified in docs), should be easy to add enough spaces/emptychars to clear
I can't actually convert that MDI again, cause I uninstalled the MDI2PDF program, which was an UGLY free DEMO not enabling me to save to pdf, so I had to take _screenshots_. You can google MDI2PDF to get the job done. MDI is an ugly microsoft file format which is not used anymore by anything.
I think the FPS problem is a permanent one: the system of a proxy-dll does sure bring lag in when functions are called. Btw, the dll is _PUBLIC DOMAIN_ but since I refuse to install VC++ environment, i can't really say what's going on in that. You find the source code in the download page. If you're quite acquinted with Microsoft IDE you could do the controls yourself. I actually need to write only in inactive moments, so I don't care about FPS, but I imagine you would like to have some king of HUD in game, some permanent/constant display of information. I can't help you much.
Wyrmskull |
|
| Back to top |
|
 |
BIG_RED_TEXT
Joined: 12 Jan 2008 Posts: 130
|
Posted: Tue Sep 30, 2008 4:49 pm Post subject: |
|
|
sth?
Maybe it is possible to compile a own version of the dll, and just fix the buffer problem, but it seems like you need to install additional stuff...
OK, thanks, luckily i have a small sandbox xD... apparently it's the same read me as the one you posted...
Yeah, that prolly makes sense, but with vsync turned off it reaches 70fps, and with it off it stays at 30 fps, maybe vsync lowers how much power the GPU should use, therefor it drops in FPS... But I guess I'll just use it to have messages popup instead of a constant display...
Btw, about the fonts, it's like you said, either 1 or 0...
Edit: btw, do you know how to call to the different layers? he claims that you're allowed to draw on 5 different layers (indexed as 0 to 4), meaning that you can use 5 multiline and single line layers... Dunno how to call it to draw on a different layer... |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|