Skip to content

v0.25.0 — Red Exclamation

Pre-release
Pre-release
Compare
Choose a tag to compare
@yhdgms1 yhdgms1 released this 16 Mar 19:06
· 236 commits to main since this release
a54e409

New State

Previously novely would return a state function that is used to receive and set state.

const { action, state } = engine;

engine.script({
 start: [
  action.function(() => {
    // Set state
    state({ weather: 'Sunny' })
    // Receive state
    console.log(state())
  })
 ]
})

Now state is passed directly into actions

const { action } = engine;

engine.script({
 start: [
  action.function(({ state }) => {
    // Set state
    state({ weather: 'Cloudy' })
    // Receive state
    console.log(state())
  })
 ]
})

New Say Action

New Say action, unlike of Dialog, that was used to make characters say their lyrics, does not allow non-characters to say lyrics, also it does not provide functionality to show mini-character near the text.

engine.script({
  start: [
    action.say('Character', 'Hello')
  ]
})

Rename of unwrap to templateReplace

Unwrap used to be a function that is used internally, but exported to use with global data instead of local state. Now it is just renamed to have a more descriptive name.

engine.data({ tea: 'Strawberry' })

// Before (deprecated)
engine.unwrap('I like tea with {{tea}}')
// After
engine.templateReplace('I like tea with {{tea}}')