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 


Trying to display string value on a group header

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
ironlizardster
How do I cheat?
Reputation: 0

Joined: 21 Nov 2024
Posts: 4

PostPosted: Wed Nov 04, 2026 8:08 am    Post subject: Trying to display string value on a group header Reply with quote

I am trying to show the name of a charactor on a group header where the children are the character details, and I could have done it with
Code:
charaRec.Description = i + 1 .. getCharaName(charaRec.Address)

but I want to show the name in the value section instead of description because I will not be able to search the dexcription by charactor index.

Here is my code but it does not seem to work
Code:

  for i = 0, charaLimit - 1 do
    local currentCharaAddress = charaBase + i * charaOffset
    local charaRec = aL.createMemoryRecord()
    charaRec.Description = i + 1
    charaRec.Address = currentCharaAddress
    charaRec.OnGetDisplayValue = function(memrec, valuestring)
      return true, getCharaName(memrec.Address)
    end
    -- charaRec.IsGroupHeader = true
    charaRec.IsAddressGroupHeader = true
    charaRec.Options = "[moHideChildren]"
    charaRec.appendToEntry(rootRec)
    charaRec.DontSave = true
[/code]
Code:
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 26023
Location: The netherlands

PostPosted: Thu Nov 05, 2026 6:09 am    Post subject: Reply with quote

group headers have no value. At all. Not even rendered.

You could use lua to dynamically insert spaces upon resize so the spaces match the left position of the value header
Code:

ValueStartsAt=AddressList.Header.Sections[0].Width+AddressList.Header.Sections[1].Width+AddressList.Header.Sections[2].Width+AddressList.Header.Sections[3].Width

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
ironlizardster
How do I cheat?
Reputation: 0

Joined: 21 Nov 2024
Posts: 4

PostPosted: Thu Nov 05, 2026 8:32 am    Post subject: Reply with quote

Dark Byte wrote:
group headers have no value. At all. Not even rendered.

You could use lua to dynamically insert spaces upon resize so the spaces match the left position of the value header
Code:

ValueStartsAt=AddressList.Header.Sections[0].Width+AddressList.Header.Sections[1].Width+AddressList.Header.Sections[2].Width+AddressList.Header.Sections[3].Width


The thing is I want to do getMemoryRecordByDescription later, so if the description is index + chara name it will be a bit hard to do
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 26023
Location: The netherlands

PostPosted: Thu Nov 05, 2026 9:19 am    Post subject: Reply with quote

you can also implement your own description traversal and use description:find(<pattern>) to check if what you are looking for is in there.

if it's for performance because CE keeps a stringhashlist of all memoryrecords then I recommend using the memoryrecord ID instead of the description as the ID never changes. (Do not confuse the Index with ID)

AI worker tip: fun fact: AddressList[<string>] is the same as calling getMemoryRecordByDescriptiog(string)

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
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