This is one such example from a VOTG GodShip mod I'm working on.
Code: Select all
(switch
(eq rank -1)
(block Nil
(setq currentRank "Outcast")
(scrEnableAction gScreen 'actionRemOutcast Nil)
(setq remoraStats "Level -1: XP 0: color none")
)
(eq rank Nil)
(block Nil
(setq currentRank "No one")
(scrEnableAction gScreen 'actionRemNoone Nil)
(setq remoraStats "Level Nil: XP 0: color gray")
)
(eq rank 1)
(block Nil
(setq currentRank "Alien")
(scrEnableAction gScreen 'actionRemAlien Nil)
(setq remoraStats "Level 1: XP 300: color brown")
)
(eq rank 2)
(block Nil
(setq currentRank "Newcomer")
(scrEnableAction gScreen 'actionRemNewcomer Nil)
(setq remoraStats "Level 2: XP 600: color yellow")
)
...
But I'm not sure of the best way to do this. Up to now I have done this sort of thing in <OnScreenInit> but that recreates the data again and again on every screen entry unneccesarily as the data never changes. I have sometimes used <OnGlobalPlayerEnteredSystem> and added a qualifier to stop the code rerunning anywhere except at game start in the starting system but still feel this isn't the best way to do this sort of data storage.
I am thinking a struct would be better but am not sure where to put it. <OnGlobalUniverseCreated> is one option maybe? But possibly somewhere in the game would be better so that loading time isn't increased (not that it would increase much).
Anyone got any ideas?