Skip to content

Conditional Text / Page Data Model Changes / Image Support (?) #36

@amiantos

Description

@amiantos
  • It would be really great to do conditional text on pages. I believe I've been reluctant to include it because I want to keep Gamebook Engine relatively simple, and believe that being constrained forces creativity and so on. But at the same time, it's annoying to have to create two different decisions that lead to two different pages. On the other hand, having to write two separate pages may inspire you creatively... I don't know!
  • If we were to consider conditional page content, I think a change to a block-based data model for pages would be good. For example...
{
    "page": {
        "uuid": "...",
        "type": "ending",
        "consequences": [],
        "decisions": [],
        "content": [
            {
                "uuid": "...",
                "type": "markdown",
                "content": "Start of page content...",
                "match_style": "match_all",
                "rules": []
            },
            {
                "uuid": "...",
                "type": "markdown",
                "content": "Some special content",
                "match_style": "match_all",
                "rules": [
                    {
                        "uuid": "...",
                        "attribute_uuid": "...",
                        "value": 1,
                        "type": "equal"
                    }
                ]
            },
            {
                "uuid": "...",
                "type": "markdown",
                "content": "...and the rest of the content",
                "rules": []
            }
        ]
    }
}

We can imagine other types of blocks... {"type": "image", "url": "https://..."} perhaps? (But obviously embedding images from the web isn't something that would actually work. Gamebooks with images would have to be distributed in a zip/container similar to Apple Work suite files... anyway...)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions