something like this in your episode's global luna.lua file should work (modify the section with the comment to fetch the achievement you need):
Code: Select all
local previousStars = mem(0x00B251E0, FIELD_WORD)
local currentStars = mem(0x00B251E0, FIELD_WORD)
local starCountTable = {
1, 30, 60, 90, 120, 241, 242
}
function onTickEnd()
currentStars = mem(0x00B251E0, FIELD_WORD)
if(currentStars > previousStars) then
for _, v in ipairs(starCountTable) do
if(currentStars == v) then
-- test the current star count here and call collect()
break
end
end
end
previousStars = currentStars
end
this is the most barebones version that handles all the logic by itself
if you have achievement conditions set up, it can be streamlined, but you'd need to elaborate on your episode's achievement structure to get any help with that