yhdgms1 / novely

Engine that will let you create interactive stories with ease
https://novely.deno.dev
ISC License
21 stars 3 forks source link

Clothing #21

Closed yhdgms1 closed 6 months ago

yhdgms1 commented 6 months ago

There should be a way to set character different clothes.

yhdgms1 commented 6 months ago

Creating universal thing is kinda i dont know

const engine = novely({
 ...,
 characters: {
  A: {
    // Emotions is about different thing, right?
    emotions: {
      sad: 'asd.png',
      // practically useless
      with_hat: [
        'asd.png',
        'awd'
      ]
    },

    // bad
    clothes: {},
    // does not look right
    styling: {
      // universal
      with_hat: 'awd',
      sad: {
        // for that emotion
        with_hat: 'awd'
      }
    }
  }
 }
})

It is possible, instead of targeting config, add a new action that will show character.

engine.script({
  start: [
    engine.action.showArbitraryCharacter({
      id: 'A',

      extendFrom: 'emotion-id',

      // how would preload deal with that?
      extendWith: (state) => {
       // data() for storing hats and etc
       // or string
        return [
          'hat_for_emotion'
        ]
      },

      classes?: 'animate__animated animate__repeat animate__shakeX',
      style?: 'left: 15%'
    }),
  ],
});

The thing is if I want to make a selection of like items I dont know how I would do that. Custom rendering system? How do I get current character style then? If not, then how would I use renderer's character? Will mess things up and still will need to know character state

yhdgms1 commented 6 months ago

But adding a lot of things to the core is not what I want. There will be #20 custom actions support in the future that will solve problem partially.

Adding everything is not wanted because of complexity. And it would be really problematic to create renderer from zero when there is a lot of things and apis. Moving thing to renderer gives more flexibility.