Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

move LoopService.js compilation from google sheets to internal #23

Open
rossjrw opened this issue Nov 13, 2019 · 9 comments · May be fixed by #35
Open

move LoopService.js compilation from google sheets to internal #23

rossjrw opened this issue Nov 13, 2019 · 9 comments · May be fixed by #35
Labels
enhancement do something better

Comments

@rossjrw
Copy link
Member

rossjrw commented Nov 13, 2019

probably python or something

would certainly make the spreadsheet way easier to manage.

data from the sheet is already being moved to src/js/events.json - just need to convert it into dialogue.coffee and events.coffee

@rossjrw
Copy link
Member Author

rossjrw commented Nov 21, 2019

@rossjrw
Copy link
Member Author

rossjrw commented Dec 27, 2019

fuck you open pyxl, hello pandas

it doesn't matter how long the intermediary file is!!!!! fuck yes, use object notation. there's no longer any reason to have this weird implicit "starting with 2 numbers means this, but if there's no numbers then this happens, unless the first string is 'auto', and a number at the end means this, and"

stop being a fucking idiot. just use a dict. delay, duration, message, function. list of dicts. boom. bosh. done.

dumbass.

like seriously what the fuck even is this?

@rossjrw
Copy link
Member Author

rossjrw commented Dec 27, 2019

#4 is VERY relevant

@rossjrw
Copy link
Member Author

rossjrw commented Dec 27, 2019

just so I have it somewhere permanent, the new structure will be this:

dialogue: {
  event_name: {
    precommand: (aic) ->
      do_a_thing()
    lines: [
      {
        delay: 0
        duration: "auto"
        text: "Line 1"
        options: [
          {
            text: "Button title"
            opinion: -1
            destination: "event_name"
            conditions: [
              (aic) -> some_status is true
            ]
            oncommand: (aic) ->
              do_a_thing()
          }
          { ... }
        ]
      }
      { ... }
    ]
    postcommand: (aic) ->
      do_a_thing()
  }
  another_event_name: { ... }
}

(noting that rossjrw/cluedo uses a slightly different sheet structure in which options are associated with a line of speech instead of an event (cluedo event = maitreya interaction), and each line of speech has its own row. would be very useful to implement this here once it is finished. this also adds oncommands, which execute on selection of the command but before the next interaction/frame)

as opposed to it currently, which has separate sections for a) the lines b) the options' button / text output c) a functional section that has a) precommands b) postcommands c) a function that recieves how long the messages will take to write, waits that long, and then calls on the options to appear

and all this is done in 3 competely separate sections in LoopService.js, so there's 3 items per interaction. it's fucking stupid but "it's fine because it's generated by a spreadshet"

who the fuck writes a javascript-outputting spreadsheet? me, apparently

@rossjrw
Copy link
Member Author

rossjrw commented Dec 27, 2019

the above structure would necessitate implementation of #27

@rossjrw
Copy link
Member Author

rossjrw commented Dec 29, 2019

look at how ridiculously better this is https://github.com/rossjrw/cluedo/blob/a7e33c96cacc014994160594dc5d808084a4b286/dist/events.temporary.js

compare with old: https://github.com/rossjrw/maitreya/blob/2598c27eb4b06b44e57829d438e1f77ebc809d9b/src/js/LoopService.js

old is likely more space-efficient but good god I do not give one fuck

@rossjrw
Copy link
Member Author

rossjrw commented Jan 2, 2020

this doesn't matter for cluedo, so I'll be leaving it to later, but the character should be made an attribute of each line or each event as well. then a single loop function can handle all events instead of having one per character.

@rossjrw
Copy link
Member Author

rossjrw commented Jan 3, 2020

turns out that seemingly 99% of maitreya.coffee is just to parse LoopService into something actually useful instead of a cancerous mess. the cancer has been cured so most of maitreya.coffee can be deleted (and therefore most of cluedo.coffee as well). it might even be possible to make it entirely project-independent, at which point it could be moved to something like engine.coffee and anything specific in init.coffee

@rossjrw
Copy link
Member Author

rossjrw commented Jan 5, 2020

in order for chatLog to not need to be initialised for each conversation, it has become a dict with keys log and options, each of which is a list of dicts with keys conversation, cssClass, text (and destination for options). html will be responsible for filtering out what messages and options it wants from those lists.

@rossjrw rossjrw added the enhancement do something better label Apr 14, 2021
@rossjrw rossjrw linked a pull request Apr 14, 2021 that will close this issue
27 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement do something better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant