@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?
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?
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.
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
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