| View previous topic :: View next topic |
| Author |
Message |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 590
|
Posted: Sun Apr 05, 2020 7:55 am Post subject: |
|
|
| 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 |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 590
|
Posted: Sat Apr 11, 2020 10:06 am Post subject: |
|
|
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 |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Apr 11, 2020 12:33 pm Post subject: |
|
|
| 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 |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 590
|
Posted: Sat Apr 11, 2020 1:11 pm Post subject: |
|
|
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.
| Description: |
|
| Filesize: |
124.45 KB |
| Viewed: |
1153 Time(s) |

|
|
|
| Back to top |
|
 |
|