View previous topic :: View next topic |
Author |
Message |
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Fri Mar 17, 2017 6:20 pm Post subject: D3D Hook question. |
|
|
I want to create a button or image in game, and I found this tutorial by Dark Byte (http://forum.cheatengine.org/viewtopic.php?t=552281). However, after I enabled d3d hook and copied the code from DB's post, nothing happened when I clicked "Execute script" in the Lua script window. I changed nothing in the code example.
Did I do something wrong?
_________________
**************
A simple example is better then ten links. |
|
Back to top |
|
|
usernotfound Expert Cheater Reputation: 0
Joined: 21 Feb 2016 Posts: 115
|
Posted: Sat Mar 18, 2017 9:06 am Post subject: |
|
|
Are you sure the game is using DirectX?
Try this
Code: | D3D = createD3DHook()
BtImg = createPicture()
BtImg.loadFromFile(button_image) -- path or var containing your image
BtTex = D3D.createTexture(BtImg)
BtSpr = D3D.createSprite(BtTex)
BtSpr.x = 1
BtSpr.y = 1
D3D.OnClick = function()
-- do stuff
end |
|
|
Back to top |
|
|
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Sun Mar 19, 2017 2:00 am Post subject: |
|
|
usernotfound wrote: | Are you sure the game is using DirectX?
Try this
Code: | D3D = createD3DHook()
BtImg = createPicture()
BtImg.loadFromFile(button_image) -- path or var containing your image
BtTex = D3D.createTexture(BtImg)
BtSpr = D3D.createSprite(BtTex)
BtSpr.x = 1
BtSpr.y = 1
D3D.OnClick = function()
-- do stuff
end |
|
Yes, I double checked it, it uses DirectX 9.0c.
Do I have to do anything else other than copy and paste your code to the LUA Script window? Your code does not work, just like DB's.
The game is a single player game on steam, and I put it into window mode when I play it.
BTW, I don't know if this matters, the "set custom crosshair" function also does not work, but the "lock mouse in game window" function does work.
Update:
Well, the image did show up. However, it only showed up when I selected a sub menu, like opening an inventory or something. It did not show on the main menu, which is strange. The image was always there, because when I clicked that area, the OnClick function is triggered. It was just not visible, like something blocked it or was on top of it, or different layers, etc... I can only guess...
_________________
**************
A simple example is better then ten links. |
|
Back to top |
|
|
Filipe_Br Master Cheater Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Sun Mar 19, 2017 5:52 am Post subject: |
|
|
You must activate D3D Hook as soon as the game is started, if you enter a match or mission, D3D Hook will no longer work.
_________________
... |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25252 Location: The netherlands
|
Posted: Sun Mar 19, 2017 6:46 am Post subject: |
|
|
that shouldn't matter.
but it's possible it uses some weird rendering technique.
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Dr.Disrespect Grandmaster Cheater Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Mon Mar 20, 2017 1:06 pm Post subject: |
|
|
@Dark Byte
@Filipe_Br
Thank you all. I think what DB said is probably the right answer.
_________________
**************
A simple example is better then ten links. |
|
Back to top |
|
|
|