Modchart - AlsoGhostglowDev/Ghost-s-Utilities GitHub Wiki

modchart.lua

A semi-complex modchart system equipped with simple common modifiers.

local modchart = require 'ghostutil.modchart'

Strum Modifiers

Here is a list of modifiers you can use for each respective strums. Each strums has it's own unique modifiers and can be resetted with modchart.resetStrumModifiers.

General Modifiers:

  • enabled,
  • position / pos,
  • offset,
  • direction (note direction),
  • speed (scroll speed),

Wiggle Modifier: (wiggleMod):

  • enabled,
  • frequency (speed),
  • phase (time position),
  • magnitude (distance),
  • offset (time offset),
  • func
Information Example 1 Example 2
Preview
frequency {x: 5, y: 5} {x: 6, y: 12}
magnitude {x: 25, y: 25} {x: 50, y: 15}
func {x: sine, y: cosine} {x: sine, y: cosine}
View Example

modchart.toggle()
modchart.toggleStrums()

modchart.setModifier(index, 'wiggle.enabled', true)
modchart.setModifier(index, 'wiggle.frequency', 5, 'xy')
modchart.setModifier(index, 'wiggle.magnitude', 25, 'xy')
modchart.setModifier(index, 'wiggle.func', modchart.ModFunctions.COSINE, 'y')

Shake Modifier: (shakeMod):

  • enabled,
  • magnitude (distance),
  • func
Information Example
Preview
magnitude {x: 3, y: 3}
View Example

modchart.toggle()
modchart.toggleStrums()

-- replace the index with the strum index.
modchart.setModifier(index, 'shake.enabled', true)
modchart.setModifier(index, 'shake.magnitude', 3, 'xy')

Hidden & Sudden Modifier: (hiddenMod & suddenMod):

  • enabled,
  • startStep,
  • startAlpha,
  • endAlpha

Note that these two modifiers aren't meant to be used with each other.

Information Hidden Modifier Sudden Modifier
Preview
startStep 3 5
startAlpha 1 0
endAlpha 0 1
View Example

modchart.toggle()
modchart.toggleStrums()
for i = 0, 7 do 
    -- hidden mod
    modchart.setModifier(i, 'hidden.enabled', true)
    modchart.setModifier(i, 'hidden.startStep', 2)
    modchart.setModifier(i, 'hidden.endAlpha', 0.1)

    -- sudden mod
    modchart.setModifier(i, 'sudden.enabled', true)
    modchart.setModifier(i, 'sudden.startStep', 4)
    modchart.setModifier(i, 'sudden.endAlpha', 0.5)
end

Boost & Brake Modifier: (boostMod & brakeMod):

  • enabled,
  • startStep,
  • speed

Note that these two modifiers aren't meant to be used with each other.

Information Boost Modifier Brake Modifier
Preview
startStep 5 5
speed 2 0.1

Boost's Preview may not be as visible, but it speeds up to speed at a certain point.

View Example

modchart.toggle()
modchart.toggleStrums()
for i = 0, 7 do 
    -- boost mod
    modchart.setModifier(i, 'boost.enabled', true)
    modchart.setModifier(i, 'boost.speed', 2)

    -- brake mod
    modchart.setModifier(i, 'boost.enabled', true)
    modchart.setModifier(i, 'brake.speed', 0.1)
end


Fields

ModFunctions: ModFunctions
Refer to ModFunctions.
ScrollType: ScrollType
Refer to ScrollType.
enabled: boolean
The toggle switch for the modchart manager.
strums: table<StrumMod>
Refer to StrumMod.
Contains the modifiers for each strums. Indices from 1 to 4 are opponent's strums respectively and indices from 5 to 8 are the player's strums respectively.

time: number
The global time for the modchart manager.
defaultStrumData: table<StrumMod>
Refer to StrumMod.
Contains the default strum modifiers for each respective strum. Do not change this.

trackedTweens: dictionary<string, ModTweenData>
Refer to ModTweenData.
trackedScrollTweens: dictionary<string, ModScrollTweenData>
Refer to ModScrollTweenData.

Methods

toggle(): void

Toggles the modchart.enabled value.

─────────────────────────

toggleStrums(): void

Toggles the enabled modifier on every strums.

─────────────────────────

getModifier(index: number, data: string): dynamic

Fetches the specified strum's modifier data.

Parameters:

  • index: The strum index, ranges from 0 to 7.
  • data: The modifier data to fetch.

Returns: The modifier's value.

─────────────────────────

setModifier(index: number, data: string, value: dynamic, ?axis: string): void

Sets the specified strum's modifier data.

Parameters:

  • index: The strum index, ranges from 0 to 7.
  • data: The modifier data to set.
  • value: The new value for the strum's modifier.
  • axis (optional): The axis, if needed.
    (can be x, y, xy)

─────────────────────────

setDefaultOffsets(): void

Resets all the strums' position and offsets back to the default value.

─────────────────────────

tweenModifier(tag: string, index: number, modifier: string, ?axis: string, value: number, ?duration: number, ?ease: string): void

Tweens the specified strum's modifier.

Parameters:

  • tag: The tween's tag.
  • index: The strum's index.
  • modifier: The modifier to tween.
  • axis (optional): The axis, if needed. Keep it as nil if not needed.
    (can be x, y, xy)
  • value: The end value for the modifier to tween at.
  • duration (optional): Determines how long the tween will take, defaults to 1.
  • ease (optional): Determines the ease used on the tween. Refer to FlxEase. Defaults to 'linear'.
View Example

-- turning off the shakeMod slowly.
-- replace index with something else.
modchart.tweenModifier('coolShakey', index, 'shake.magnitude', 'xy', 0, 3, 'cubeIn')

─────────────────────────

cancelTween(tag: string): void

Cancels a GhostUtil modifier/scroll tween.

Parameters:

  • tag: The tag of the tween to cancel.

─────────────────────────

resetStrumModifiers(index: number): void

Resets the specified strum's modifiers back to the default values.

Parameters:

  • index: The strum's index

─────────────────────────

resetModifiers(): void

Resets all the strum's modifiers back to the default values.

─────────────────────────

setTime(newTime: number): void

Sets a new time for modchart.time.

Parameters:

  • newTime: The time to set it to.

─────────────────────────

resetTime(): void

Resets modchart.time back to 0.

─────────────────────────

update(deltaTime: number): void

Updates the strum's modifiers. Internal function, handled internally.

Parameters:

  • deltaTime: The amount of time in seconds that passed since last frame.

─────────────────────────

updateNoteModifiers(deltaTime: number): void

Updates the each strums' note modifiers. Internal function, handled internally.

Parameters:

  • deltaTime: The amount of time in seconds that passed since last frame.

─────────────────────────

tweenScroll(tag: string, isDownscroll: boolean, index: number, ?duration: number, ?ease: string, ?moveNotes: boolean)

Tweens the specified strum's scroll.

Important

This only works if modchart.enabled and the strum's modifier "enabled" is true.

Parameters:

  • tag: The tween's tag.
  • isDownscroll: If it should tween to downscroll, this value is inversed if downscroll is turned on.
  • index: The strum's index.
  • duration (optional): Determines how long the tween will take, defaults to 1.
  • ease (optional): Determines the ease used on the tween. Refer to FlxEase. Defaults to 'linear'.
  • moveNotes (optional): If the function should also move the strums to their appropriate y position.
View Example

modchart.toggle()
modchart.toggleStrums()

for i = 0, 7 do 
    -- tweens the user's strum to downscroll.
    -- (or upscroll if the user has the downscroll option on.)
    modchart.tweenScroll('scrollDown'.. i, true, i, 4, 'expoInOut', true)
end


GhostUtil 3.0.0Docs 3.0.0, Revision 1

a Lua Library made by GhostglowDev; for Psych Engine
© 2025 GhostglowDevGhost's Utilities
Licensed under the MIT License.

⚠️ **GitHub.com Fallback** ⚠️