Achievement Based Conditional Scripting? (2)

Hey guys, I created this topic because I have been thinking about a way to use the achievements in a new (to me) way.

So I have this idea of a story set in an Alt-Hist world where the french revolution was successful, and thought about means to explain to the reader the mainline events that happened b4 the story begins.

The problems is that I, as a reader, really dislike beginning a game with a lot of boring stuff to read before I even begin to play it!

So I thought of a compromise.

ChoiceScript already has the achievements mechanict embedded in its interpreter. And I have been thinking about using it as a way to “populate” my worldbuilding with trivia in a more… organic way.

As the player begins to play the game, every time they hit a new theminology or event that differs from our world’s counterpart. An Achievement event will trigger informing the reader that a new entry is available at the Center’s Library. (Acessible by pressing ChoiceScript Stats)

There is a catch though. I am no sure how to even begin to implement such solution… I thought about using arrays, create a series of gosub_scenes to a “library” scene were each label is one book, using strings… But I can not think how to implementing it in a trivial way.

Please help!

I searched in the forums and found this topic talking about:

You can use the code suggested on the thread:

And add it to the stats page or wherever you want to store your lore, eg:

*check_achievements
*if (seen_cleopatra_death)
    In this world, Cleopatra lived to a ripe old age of 86.

Thanks for the quick reply!

Yeah, I figured the *check_achievements is a go to to make it work.

I was also thinking on using a array to store if a book is available or not and an update_library subroutine that uses it to set the availability of said books to true. Hmmm

But how to make the books show and be readable?
Well, for the readable part I thought in creating a library_scene label and dump all my entries there.

Perhaps… If I create a second routine to store the names of the books.

I can pair the names with a lookup array that always point to the book’s corresponding label in the library_scene, and use that neat CS_lib function to, always that a new achievement is achieved, it updates the list alphabetically.

This way I can, in theory, make the books appear always in alphabetical order. Or even organize the books for groups by the first letter of each title in the stats page…

Something like: this is an abstraction

Hhh
*gosub update_unlocked
*gosub check_array_elements (unlocked_names) (array_lenght)
*comment the idea is that this func.
*comment count how many slots in
*comment the array are NOT  != ""

*if cs_ret = 0
    *comment cs_ret is from CS_lib
    No entries unlocked yet!
    *page_break
    *goto finish


*label display_letters
*title "Historical Archives"
Select starting letter:


*temp i 0
*temp_array first_letters 26 ""
*temp alphabet 27 "a" "b" (etc...)

*gosub get_letters_list (unlocked_names) (array_lenght) ("first_letters") (26)
*comment the subroutine above
*comment just counts how many
*comment of each alphabetical letter
*comment are in the names list

*gosub check_array_elements (first_letters) (26)
*choice
    *label choice_loop
    *if i < 27
        *if first_letters[i] = 0
        *set i +1
        *goto choice_loop
    *else
        # Letter ${alphabet[i]}  (${{first_letters[i]}} entries)
            *goto "entries_alphabet[i]"
        *set i + 1
        *goto choice_loop

    # Back to Main Menu
    *goto mein_menu



 

(I am not even sure if its possible to build options of a *choice statement like that. But…)

Then, in game:

*scene Western_Delhi_streets

You see graffiti: "Remember Robespierre!"

*if not achievement_granted("lib_gov_maximillian")
    *achievement "lib_gov_maximillian"
    (New archive unlocked: Maximilian Robespierre: Founding Father of India!)
    *gosub_scene array_push ("unlocked_names") ("Robespierre Reformer of India")
    *goto cont

Will open the label “lib_gov_maximillian” in library_scene

I am on the right way?

I am overthinking?