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 


Changing text of record when game shuts down
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 590

PostPosted: Sun Apr 05, 2020 7:55 am    Post subject: Reply with quote

mgr.inz.Player wrote:
Code:
-- a collection of memory records and default description
HeroProfessionMemoryRecords = {}
for i=1,99 do
  local mr = getTableEntry('Hero '..i..' Profession')
  if mr~=nil then
    local mrInfo = { mr=mr, defaultDesc=mr.Description }
    HeroProfessionMemoryRecords[1+#HeroProfessionMemoryRecords] = mrInfo
  end
end

function pSXRunning(sender)
   GameExeFile = "psxfin.exe"

I ran this earlier without any other code running to "restore" the records to a default condition. No record description was changed
Code:

 HeroProfessionMemoryRecords = {}
 for i=1,20 do
   mr = getTableEntry('Hero '..i..' Profession')
   --print(mr)
   if mr~=nil then
     mrInfo = { mr=mr, defaultDesc=mr.Description }
     print(mrInfo)
     HeroProfessionMemoryRecords[1+#HeroProfessionMemoryRecords] = mrInfo
   end
 end
 


I can only assume that defaultDesc had not been a value/description, but only an assumption. It does find 20 records in the 400+ records, so that is good, but no records were changed.

The reason was to find a way around the CloseCE without saving, as I would put the piece of code at the beginning and have it run. Further functions would then run without errors. In answer to your profession comment, I probably could use a data table at the begging to use for profession descriptions.
Back to top
View user's profile Send private message Yahoo Messenger
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 590

PostPosted: Sat Apr 11, 2020 10:06 am    Post subject: Reply with quote

mgr.inz.Player:
No thoughts on re-righting the Description on those 20 records when the table opens up? Your code found them but didn't change the Description.
Back to top
View user's profile Send private message Yahoo Messenger
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Apr 11, 2020 12:33 pm    Post subject: Reply with quote

Code:
local mr = getTableEntry('Hero '..i..' Profession')

MR must have description exactly like this:
'Hero 1 Profession'

It will skip MR which has additional chars, e.g.:
'Hero 1 Profession is whatever'


We can solve it other way. Put all 'Hero XX Profession is whatever' to a group/header. Change description of this header to "bunch of heroes". Then use this script:
Code:
local mr = getTableEntry("bunch of heroes")

for i=0,mr.Count-1 do
  mr[i].Description = 'Hero '..(i+1)..' Profession'
end

_________________
Back to top
View user's profile Send private message MSN Messenger
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 590

PostPosted: Sat Apr 11, 2020 1:11 pm    Post subject: Reply with quote

That really sounded like it would work, however here is a screen shot after the code was run in the "immediate" window. No errors in the code but as one can see the Descriptions haven't been changed.

ETA:
It works, there is no issue.
Thanks.



4-11-2020 2-02-07 PM.png
 Description:
 Filesize:  124.45 KB
 Viewed:  1152 Time(s)

4-11-2020 2-02-07 PM.png


Back to top
View user's profile Send private message Yahoo 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
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