Skip to main content
nebulaModding docs
Nebula home

kit.progress

Stars beyond 120 and new star kinds counted, comets added to any galaxy, per-file flags and counters, what a star gives, new-file rules.

#About kit.progress

The kit.progress module of LumaKit gives you stars beyond 120 and new star kinds counted, comets added to any galaxy, per-file flags and counters, what a star gives, new-file rules.

To use the module, add lumakit to the needs of your mod's luma.json and write:

LumaScript
use kit.progress

#How the module works

Stars beyond the game's own counted, what getting a star does, comets added to any galaxy, flags and numbers kept per save file, new-file rules. Stars. A star of a galaxy the game knows is the game's (its own save data, GameDataFunction). A star of a galaxy a mod adds (kit.stage) is kept by the kit on the save file (svc.save: a file's copy takes it along, an erased file forgets it) and counted into the game's own total wherever the game asks for it (GameDataFunction::calcCurrentPowerStarNum, MR::getPowerStarNum), so star gates open past 120. on_star: when the game records a star as got (GameDataFunction::setGameFlagPowerStarSuccess), each mod's function is asked, newest first; the first that does not answer Star decides: Nothing (the star is not recorded) or Instead (kit.item gives that, and the star is not recorded). Comets: a comet added to a galaxy's scenario is what the game's comet schedule answers for that galaxy (GalaxyCometScheduler isCometLand, getEncounterCometName, getEncounterCometPowerStarId) while the mod is on. Flags and numbers: per file, per mod, by id; their handles' functions are also module functions (flag_get). Everything belongs to the mod that made it: its on_star and on_new_file functions and its comets go when it stops; its flags, numbers and stars stay on the file for when it is on again.

The module's source is lumakit/source/progress.lum.

#Declarations

Name Kind Description
StarGet Enum
Flag Struct
Number Struct
stars Function The game's stars and every mod's, on this file.
has_star Function
give_star Function The star recorded as got on this file, as the game records its own (so on_star functions are asked for it too).
on_star Function What getting a star does, for the calling mod: asked with the galaxy and the scenario.
add_comet Function A comet over the galaxy's scenario for as long as the calling mod is on; a second for the same galaxy by the same mod replaces the first, another mod's newer one holds it.
flag Function A per-file flag of the calling mod (following the file's copy and erase).
flag_get Function
flag_set Function Only the calling mod's own flag is set: a Flag is a plain key, so one naming another mod's is refused.
set_flag Function The calling mod's flag id set in one call.
number Function A per-file number of the calling mod: experience, achievements.
number_get Function
number_set Function Only the calling mod's own number is set, as flag_set.
number_add Function The number moved by d: its new value.
on_new_file Function The calling mod's rule for a new file (New Game+): run when the player makes a file, after the game has made it, so the function sets its flags, numbers and stars on the new file.

#StarGet

LumaScript
pub enum StarGet { Star, Nothing, Instead(g: item.Gives) }

#Flag

LumaScript
pub struct Flag {
    key: text
    fn get(self) -> bool { return flag_get(self) }
    fn set(self, value: bool) { flag_set(self, value) }
}

#Number

LumaScript
pub struct Number {
    key: text
    fn get(self) -> i64 { return number_get(self) }
    fn set(self, v: i64) { number_set(self, v) }
    fn add(self, d: i64) -> i64 { return number_add(self, d) }
}

#stars

LumaScript
pub fn stars() -> u32

The game's stars and every mod's, on this file.

#has_star

LumaScript
pub fn has_star(galaxy: text, scenario: u32) -> bool

#give_star

LumaScript
pub fn give_star(galaxy: text, scenario: u32)

The star recorded as got on this file, as the game records its own (so on_star functions are asked for it too).

#on_star

LumaScript
pub fn on_star(f: fn(text, u32) -> StarGet)

What getting a star does, for the calling mod: asked with the galaxy and the scenario.

#add_comet

LumaScript
pub fn add_comet(galaxy: text, scenario: u32, comet: stage.Comet)

A comet over the galaxy's scenario for as long as the calling mod is on; a second for the same galaxy by the same mod replaces the first, another mod's newer one holds it.

#flag

LumaScript
pub fn flag(id: text) -> Flag

A per-file flag of the calling mod (following the file's copy and erase).

#flag_get

LumaScript
pub fn flag_get(f: Flag) -> bool

#flag_set

LumaScript
pub fn flag_set(f: Flag, value: bool)

Only the calling mod's own flag is set: a Flag is a plain key, so one naming another mod's is refused.

#set_flag

LumaScript
pub fn set_flag(id: text, value: bool)

The calling mod's flag id set in one call.

#number

LumaScript
pub fn number(id: text) -> Number

A per-file number of the calling mod: experience, achievements.

#number_get

LumaScript
pub fn number_get(n: Number) -> i64

#number_set

LumaScript
pub fn number_set(n: Number, v: i64)

Only the calling mod's own number is set, as flag_set.

#number_add

LumaScript
pub fn number_add(n: Number, d: i64) -> i64

The number moved by d: its new value.

#on_new_file

LumaScript
pub fn on_new_file(f: fn())

The calling mod's rule for a new file (New Game+): run when the player makes a file, after the game has made it, so the function sets its flags, numbers and stars on the new file.

#Further reading