Ren'Py In-Game Wiki-Like Glossary or Codex

Avalonica

Newbie
Oct 11, 2017
40
20
Hello. I have some issues with "In-Game Wiki-Like Glossary or Codex" found on

I have everything setup and working, but when using the "lock system" I must manually do this for all articles I want unlocked:
$ persistent.wiki_unlocked.add("wiki_test1")
$ persistent.wiki_unlocked.add("wiki_test2")
$ persistent.wiki_unlocked.add("wiki_test3")

But how do I have these commands run "directly". Is there not any way to auto-run them?

Another part of the code I don't understand is:
default persistent.wiki_unlocked = { "wiki_index" }

Why does not this line work:
default persistent.wiki_unlocked = { "wiki_index","wiki_test1","wiki_test2","wiki_test3"}

or this:
default persistent.wiki_unlocked = { "wiki_test1" }
default persistent.wiki_unlocked = { "wiki_test2" }
default persistent.wiki_unlocked = { "wiki_test3" }

I am sure there must be some way to get this to work more optimal than how I have it working now :unsure:

Hmm, is there any way to actually have the entire "In-Game Wiki-Like Glossary or Codex" unlocked from start and instead order a few "articles" locked i.e. a reversed form of the current system.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,978
16,236
Is there not any way to auto-run them?
I'm not sure to understand what you want here.


Why does not this line work:
default persistent.wiki_unlocked = { "wiki_index","wiki_test1","wiki_test2","wiki_test3"}
This one should works.

default persistent.wiki_unlocked = { "wiki_test1" }
default persistent.wiki_unlocked = { "wiki_test2" }
default persistent.wiki_unlocked = { "wiki_test3" }
This one also works, but it don't do what you seem to think. Each line recreate the persistent.wiki_unlocked set, giving it a different default value.
You have to use the add method to update persistent.wiki_unlocked by adding it the given value.
If you have to add more than one value, you have to use this :
Code:
$ persistent.wiki_unlocked.update( { "wiki_test1", "wiki_test2", "wiki_test3" } )
 

Avalonica

Newbie
Oct 11, 2017
40
20
Hmm, yes
Code:
$ persistent.wiki_unlocked.update( { "wiki_test1", "wiki_test2", "wiki_test3" } )
works perfect (thanks) and I use it in splashscreen to activate the articles.

But what I really want to achieve is to order the wiki from the get-go without using this code in the splashscreen
Code:
$ persistent.wiki_unlocked.update( { "wiki_test1", "wiki_test2", "wiki_test3" } )
Is there no way of order the wiki "directly" to start using the selected articles?
Code:
default persistent.wiki_unlocked = { "wiki_index" }
default persistent.wiki_unlocked.update = ( { "wiki_test1", "wiki_test2", "wiki_test3", "wiki_test4" } )
This one sadly did not work.

Why is there no easier way of directly order the wiki to unlock articles with the "$ persistent.wiki_unlocked.update( { "wiki_test1", "wiki_test2", "wiki_test3" } )"...? Because the "$ persistent.wiki_[...]" must execute by code otherwise a new player will not have the selected wiki articles unlocked.

What I really meant with all of this is, how do I order "selected" articles to directly be activated without resorting to this line:
Code:
$ persistent.wiki_unlocked.update( { "wiki_test1", "wiki_test2", "wiki_test3" } )
Sorry for long post :eek:
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,978
16,236
What I really meant with all of this is, how do I order "selected" articles to directly be activated without resorting to this line:
Code:
$ persistent.wiki_unlocked.update( { "wiki_test1", "wiki_test2", "wiki_test3" } )
There's no way to do this without a full rewriting of the wiki. It need to know that "this article" have to be shown, and for this, you need to tell it.