Copy pasting chapters

Discussion in 'Suggestions' started by TheDespaxas, Apr 1, 2017.

  1. TheDespaxas

    TheDespaxas Really Really Experienced

    The ability to copy and paste a chapter, with title, text, end question, conditions and score changes.

    It would help to change stuff quickly when still in draft mode and allow to duplicate chapters more easily (having a few changes to make rather than to enter the score changes one by one)
     
    Last edited: Apr 2, 2017
  2. Nemo of Utopia

    Nemo of Utopia CHYOA Guru

    This would be quite helpful for me to have as an option.
     
  3. dirtytyke

    dirtytyke Experienced

    Copy/paste, or even being able to fully rearrange chapters would be awesome.
    Sometimes I've wanted to add a chapter within an already existing thread but there's no real way to do it.

    Imagine if you could simply enable an advanced edit mode on the story map and drag copy/move chapters elsewhere, along with all their child chapters.
     
  4. gene.sis

    gene.sis CHYOA Guru

    Currently, it is technically "impossible" to rearrange chapters.

    For rearranging chapters, you could take a look at the suggestions
    Moving/reordering chapters,
    Newer threads posted to top.,and
    Resort Story Options
     
  5. dirtytyke

    dirtytyke Experienced

    Yea, I saw after I'd mentioned that, that someone else mentioned Friedman stated it would require a major overhaul.

    I am curious why that's the case. Without knowing anything about how chyoa is set up, beyond the fact that every chapter possess an ID, it does seem like it'd be a simple change to the database logic. I am assuming each chapter simply has a list of child ID's and one parent ID, or more likely simply there's a table that maps chapterID's to each other along with direction. If that's the case it seems like it'd be easy to do. Implementing a drag/drop interface might be more difficult, but I'm not sure why it's impractical.
     
  6. gene.sis

    gene.sis CHYOA Guru

    Oh, that wasn't completely correct.
    It would be possible to move chapters from one parent chapter to another.
    It is just impossible to rearrange the order of the child chapter of one parent.

    Every chapter has its own database row which has a unique number. Currently, sibling chapters get ordered by that key and it doesn't make sense to change them. It is also not possible to make the number smaller as there are already other chapters with that number.
    Every chapter has the ID of the parent chapter and a value for "left" and "right" which is used to create the story map tree, though I'm not yet deep enough into that issue to explain it in detail.
    Child IDs aren't stored.
     
  7. dirtytyke

    dirtytyke Experienced

    Really? That sounds like a costly way of doing it. So, every chapter view requires a lookup of every single chapter in the story to see if they are a child?
    I'd have assumed there'd be a list of child ID's for each chapter. Obviously that'd make the chapter creation process more costly, but does that matter if it's in favour of speeding up page load for reading/editing?

    I was meaning moving the chapter so it is a child of a different parent, rather than just changing sibling order. I guess some people would want to do that too though, and could be useful for having options more logically presented, especially in a gamemode story.

    Anyway, I'm kind of getting this thread off-topic here as it's specifically suggesting copy/paste.
     
  8. gene.sis

    gene.sis CHYOA Guru

    Well, you search the parent ID column for the chapter ID.
    It also uses indexes which should speed up things a lot.
     
  9. Nemo of Utopia

    Nemo of Utopia CHYOA Guru

    Ok, but how is the Game Mode data stored for each user on each story, and how are the modifiers and requirements recorded in each chapter? Why must they be copied one at a time instead of being able to grab entire chapters wholesale, game data included? I really don't see what makes that task so difficult...
     
  10. gene.sis

    gene.sis CHYOA Guru

    Save games are stored in a separate table together with the current and previous chapter.

    there is a column in the chapters table

    What do you mean?


    I didn't see what it would make difficult to implement a direct link to send another user a message.
    Then I worked on it for some days and voila! ... we still don't have it. I mean, it's just a link, isn't it?
     
  11. Nemo of Utopia

    Nemo of Utopia CHYOA Guru

    Ok, my knowledge of programming is, rudimentary, I studied it some in high school and college which was a decade ago now, but please bear with me: say you were to program an applet, it calls a chapter within the story similar to how the chapter linking system presently works but then diverges completely: instead of linking to the chapter it takes a snapshot of that chapters current data file: erases chapter number, parent chapter, all saved games, and all child chapters: then assigns a new chapter number, the linked from chapter as a new parent, and saves the new file in the appropriate place in the story tree database: click, boom, cloned chapter...

    No, it's an applet, which is far more complex.
     
    Last edited: Aug 31, 2018
  12. gene.sis

    gene.sis CHYOA Guru

    Yes, basically... create a new chapter with a new ID and destination parent ID and copy the rest of the chapter's database row there. Then update the story map positions of all chapters of the story.
    There is no save game data on chapters and as stated before, child chapters aren't stored for a chapter.
     
    Last edited: Aug 31, 2018
  13. Nemo of Utopia

    Nemo of Utopia CHYOA Guru

    Right!

    Doesn't very similar code to do almost all of this already exist in the base "create chapter" commands for the database?

    So with minimal modification...
     
    madmaniac likes this.
  14. gene.sis

    gene.sis CHYOA Guru

    Well, rather read the row, change parentID, set some values to 0 and write the row a with new number.
    So probably not that complicated.
    Then some way for the author to assign the parent of the copy.

    So if there are enough likes and Friedman doesn't have other objections, that shouldn't be much of a problem.
     
  15. Nemo of Utopia

    Nemo of Utopia CHYOA Guru

    Yay! I'm helping!