Skip to content

Instantly share code, notes, and snippets.

-- Format BackgroundEffects
-- Scripts edited by: Daniel Duhme
-- also known as: Danielu Yoshikoto
-- If used, give credits and not claim your own
-- Format 3+, for croping 4x3 media to fill a 16x9 screen + have it not loop.
-- www.buu-page.de
local cColor1 = color(Var "Color1");
local t = Def.ActorFrame {
LoadActor(Var "File1") .. {
-- OnCommand=cmd(x,SCREEN_CENTER_X;y,SCREEN_CENTER_Y;scaletocover,0,0,SCREEN_WIDTH,SCREEN_HEIGHT;diffuse,cColor1;loop,false);
-- This is a simple example of streaming live score data to a file.
-- It is meant to be loaded as an actor in the out transition layer of
-- ScreenGameplay.
-- Save it to Graphics/live_score_report.lua in a theme and edit
-- BGAnimations/ScreenGameplay decorations.lua to load it.
-- If BGAnimations/ScreenGameplay decorations.lua doesn't exist, here is an
-- example:
-- return Def.ActorFrame{
-- LoadActor(THEME:GetPathG("", "live_score_report.lua")),
-- }
# Print hilighted messages with MSGLEVEL_PUBLIC to active window
# for irssi 0.7.99 by Kyzentun based on showhilight.pl by Pawe³ 'Styx' Chuchma³a
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = "0.1";
%IRSSI = (
authors => "Kyzentun",
contact => "",
name => "kyzhilight",
local player= Var("Player")
local texframe= false
local texture= false
local tex_width= 128
local sprite_width= 16
local life_sprite= false
local life_poses= {}
local function redraw_lives(self)
for i, pos in ipairs(life_poses) do
life_sprite:xy(pos[1], pos[2]):Draw()
local hw= _screen.w * .5
local low_pos= _screen.h + 16
local fly_count= 200
local flies= {}
local curr_fly= 1
local function unzip_fly(offset)
local b = GAMESTATE:GetSongBeat()
if (b >= 224 and b <= 288) or b >= 422 then
-- A simple screen for showing the player how fast they're mashing a button.
-- press_history will store the times that the button was pressed.
local press_history= {}
-- Values for max_press_age, semi_recent_age, and recent_age may need twerking
-- to excite users.
-- Any button press older than max_press_age will be from history. This
-- controls the maximum possible resolution of the nps measurement. With a 10
-- second history, the nps cannot be measure more finely than two significant
-- figurines. (x.x)
-- This simple example looks at input events to set text on the screen
-- showing one button that is being pressed. Because it doesn't use a list
-- of text actors, if multiple buttons are pressed it will only show info for
-- the last one.
-- The Config Key/Joy screen lists all buttons in the current game mode.
-- button_text and game_button_text will be set to actors when those actors
-- are created. These local variables exist to skip the hassle of calling
-- GetChild.
-- This provides a few key shortcuts for common editing tasks like changing
-- the current speed mod, toggling assist clap, and toggling between normal
-- music rate and half music rate.
-- This is intended as ScreenEdit overlay.lua. If the theme you are using
-- already has ScreenEdit overlay.lua, consult the theme author about adding
-- this functionality.
-- lua is easier for this stuff than C++, and doesn't require making a new
-- release, so I don't feel like putting this in the general edit mode.
-- I'm going to assume any themer reading this can recognize a command to add to an actor.
-- Setting up an option that the player can select to turn this on or off is left as an exercise, though it won't do anything if they don't have normal hidden turned on.
LifeChangedMessageCommand= function(self, param)
local new_offset= scale(param.LifeMeter:GetLife(), 0, 1, -1, 3)
GAMESTATE:GetPlayerState(param.Player):GetPlayerOptions("ModsLevel_Song"):HiddenOffset(new_offset)
end,

Purpose

The lua config system is designed to provide a way to save configuration settings on a per-profile and machine wide basis as lua tables.

Why lua and not ini?

ini is not suited for complex data structures. ini can only store a single layer of data, sections with entries. Lua can store any reasonable data structure.

Where is data saved to?