View previous topic :: View next topic |
Author |
Message |
hydris Newbie cheater Reputation: 0
Joined: 09 Jan 2013 Posts: 19
|
Posted: Fri Jul 24, 2015 3:58 am Post subject: D3D OnClick |
|
|
I've been using http://forum.cheatengine.org/viewtopic.php?t=552281
as a reference to get started, so far the only thing stopping me from making a menu is OnClick() being a nil value (besides that OnKeyDown isn't compatible with DINPUT8 so it's out of the picture- I still hope I can get key inputs somehow with isKeyPressed() in for the in-game menu but maybe that belongs in another thread).
The Lua functions seems to have changed since the time of that tutorial.
I got
Code: |
function onOpenProcess()
reinitializeSymbolhandler() --wait until process is fully attached
autoenable_favorites() --this is for something else
hook = createD3DHook()
end
|
If I try to do Code: |
hook.OnClick(option_click)
|
I get
Quote: | attempt to call field 'OnClick' (a nil value)
Script Error
|
Can post the entire set of functions if needed. I got the functions in the cheat table, and I'm testing stuff by calling functions in Lua Engine. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Fri Jul 24, 2015 5:58 am Post subject: |
|
|
The d3dhook doesn't have an onClick property
the d3dobjects like sprites do _________________
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 |
|
|
hydris Newbie cheater Reputation: 0
Joined: 09 Jan 2013 Posts: 19
|
Posted: Fri Jul 24, 2015 6:06 am Post subject: |
|
|
Thank you, that clears some stuff up.
Append:
I saw
Code: | D3DHOOK class:
The d3dhook functions provide a method to render graphics and text inside the game, as long as it is running in directx9, 10 or 11
createD3DHook(textureandcommandlistsize OPTIONAL, hookmessages OPTIONAL)
Hooks direct3d and allocates a buffer with given size for storage of for the rendercommand list
hookmessages defines if you want to hook the windows message handler for the direct3d window. The d3dhook_onClick function makes use of that
If no size is provided 16MB is used and hookmessages is true
Note: You can call this only once for a process
It returns a d3dhook object
properties
Width: Integer : The width of the screen (readonly)
Height: integer: The height of the screen (readonly)
DisabledZBuffer: boolean : Set this to true if you don't want previously rendered walls to overlap a newly rendered object (e.g map is rendered first, then the players are rendered)
WireframeMode: boolean : Set this to true if you don't want the faces of 3d objects to be filled
MouseClip: boolean : Set this if to true if you have one of those games where your mouse can go outside of the gamewindow and you don't want that.
OnClick: function(d3dhook_sprite, x, y)
A function to be called when clicked on an sprite (excluding the mouse)
x and y are coordinates in the sprite object. If sprites overlap the highest zorder sprite will be given. It does NOT care if a transparent part is clicked or not
Note: If you set this it can cause a slowdown in the game if there are a lot of sprites and you press the left button a lot
OnKeyDown: function(virtualkey, char)
function(vkey, char) : boolean
A function to be called when a key is pressed in the game window (Not compatible with DirectInput8)
Return false if you do not wish this key event to pass down to the game
|
So I thought it did. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Fri Jul 24, 2015 1:21 pm Post subject: |
|
|
Oh yes, it does. (I wrote the previous message when on mobile and didn't really remember)
Anyhow, you assign the hook function, not call it
so:
hook.OnClick=option_click
and then in option_click figure out which object is clicked _________________
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 |
|
|
|