Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Dropdown Options - Is Range Possible?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Coreveen
Cheater
Reputation: 0

Joined: 12 May 2011
Posts: 41

PostPosted: Thu Mar 17, 2022 11:28 am    Post subject: Reply with quote

@ParkourPenguin
Right, yeah. Learning by example feels like the best way for me to learn and improve my understanding of really any language I dabble in. But for CE usage, clearly that needs to be Lua and assembly, if you can call it that.

Definitely sounds much easier to construct the table as one normally would and apply Lua events after. It's cool nonetheless that you can apply them during Lua creation though. Good to know.

I'll try and learn more about Lua with what documentation I can stumble upon and breakdown some existing code. Thanks again for all the help.

There is one question still. I'm genuinely curious how you would personally deal with this, but what is your solution to apply Lua events such as OnGetDisplayValue to apply to multiple (sometimes many) records that have the same description?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4775

PostPosted: Thu Mar 17, 2022 12:13 pm    Post subject: Reply with quote

Coreveen wrote:
I'm genuinely curious how you would personally deal with this, but what is your solution to apply Lua events such as OnGetDisplayValue to apply to multiple (sometimes many) records that have the same description?
See the `init_OnGetDisplayValue` function in this post:
https://forum.cheatengine.org/viewtopic.php?p=5777630#5777630

Depending on how you make your table, you could just loop through the entire address list instead of only a specific part of it as was shown in that example.
I guess I'd want to do it this way. It might be less work on my part if I decide to reorganize the table.
Code:
-- see that previous post for omitted code: specifically the table `memrec_description_to_lookup`

for i = 0, AddressList.Count - 1, 1 do
  local memrec = AddressList[i]
  local lookup = memrec_description_to_lookup[memrec.Description]
  if lookup then
    memrec.OnGetDisplayValue = lookup.OnGetDisplayValue
  end
end
If you do this, you'll have to be careful with the descriptions of memory records. e.g. if you map a description of "Health" to a lookup in the table `memrec_description_to_lookup`, every memory record with the description of "Health" will get the OnGetDisplayValue assigned to it. This might have false positives that can be resolved by using a more specific description (maybe "Enemy Health", "Player Health", etc.) or by only applying it to a specific part of the table (as was shown in that previous post).
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites