Gamebook status-counter
blockrocker
02 May 2013, 01:45Hi!
I'm very new to Quest and quite excited about it!
I would like my first game to be a gamebook. I'm having a bit difficulty with the correct way of counting status changes.
What I would like is this: When player visits certain pages, they increase or decrease different status meters, like "health" or "kindness".
Later I would like to create the link options of certain pages based on those status values.
For example if "kindness" is > 20 add link option to stop robbery.
So far I haven't been able to figure this out. Is it even possible to do with the gamebook-mode?
Any help would be appreciated!
I'm very new to Quest and quite excited about it!
I would like my first game to be a gamebook. I'm having a bit difficulty with the correct way of counting status changes.
What I would like is this: When player visits certain pages, they increase or decrease different status meters, like "health" or "kindness".
Later I would like to create the link options of certain pages based on those status values.
For example if "kindness" is > 20 add link option to stop robbery.
So far I haven't been able to figure this out. Is it even possible to do with the gamebook-mode?
Any help would be appreciated!
Alex
02 May 2013, 08:45On pages where you want to increase/decrease status, set page type to "Script + Text" and use the "Increase counter" or "Decrease counter" commands from the Variables category.
On the page where you want the link to appear, set page type to "Script + Text" and add an "If" command. Choose "counter" from the dropdown, and then you can type in the counter name and choose the condition you want. Inside the "if", use the "Add page link" command to add links to the page.
On the page where you want the link to appear, set page type to "Script + Text" and add an "If" command. Choose "counter" from the dropdown, and then you can type in the counter name and choose the condition you want. Inside the "if", use the "Add page link" command to add links to the page.
blockrocker
02 May 2013, 09:49Hi!
I tried doing that but for some reason I get
Error running script: Error evaluating expression 'DictionaryContains(source.options, destination.name)': DictionaryContains function expected dictionary parameter but was passed 'null'
Error running script: Unrecognised dictionary type
I tried doing that but for some reason I get
Error running script: Error evaluating expression 'DictionaryContains(source.options, destination.name)': DictionaryContains function expected dictionary parameter but was passed 'null'
Error running script: Unrecognised dictionary type
Alex
02 May 2013, 10:22Make sure you choose the page name from the first drop down.
If that still doesn't work, please go to Code View (big obvious button in the web version, or on the desktop version it's one of the icons on the script toolbar) and paste your script here.
If that still doesn't work, please go to Code View (big obvious button in the web version, or on the desktop version it's one of the icons on the script toolbar) and paste your script here.
blockrocker
02 May 2013, 19:24Thank you for you support! I checked the page names but that didn't solve the problem.
Here is the code (language is finnish. sorry):
Here is the code (language is finnish. sorry):
<!--Saved by Quest 5.4.4840.17608-->
<asl version="540">
<include ref="GamebookCore.aslx" />
<game name="antti game">
<gameid>7ab97099-0586-4634-a527-bf29d1206605</gameid>
<version>1.0</version>
<firstpublished>2013</firstpublished>
</game>
<object name="alku">
<inherit name="scripttext" />
<description>Heräät sängystä yksiössäsi. Työpöydällä on tietokone. Seinällä on kartta. Tiskialtaassa on tiskaamattomia tiskejä.</description>
<options type="stringdictionary">
<item>
<key>kone käyntiin</key>
<value>Käynnistät tietokoneen</value>
</item>
<item>
<key>Tiskaaminen</key>
<value>Alat tiskaamaan</value>
</item>
</options>
<script type="script">
if (HasSeenPage(Revi kartta palasiksi)) {
RemovePageLink (alku, kartan katsominen)
}
else {
AddPageLink (alku, kartan katsominen, "Katso karttaa")
}
</script>
<object name="player">
<inherit name="defaultplayer" />
</object>
</object>
<object name="kone käyntiin">
<description>Kone käynnistyy ja työpöytä avautuu eteesi.</description>
<options type="stringdictionary">
<item>
<key>Avaa sähköposti</key>
<value>Avaa sähköposti</value>
</item>
<item>
<key>Pelaa tekstiseikkailupeliä</key>
<value>Pelaa tekstiseikkailupeliä</value>
</item>
</options>
</object>
<object name="kartan katsominen">
<description>Kartassa näkyy Virtain kaupunki ja ympäröivää metsää.</description>
<options type="stringdictionary">
<item>
<key>Sulje silmät ja tökkää karttaa sormella sokkona</key>
<value>Sulje silmät ja tökkää karttaa sormella sokkona</value>
</item>
<item>
<key>Revi kartta palasiksi</key>
<value>Revi kartta palasiksi</value>
</item>
<item>
<key>Mene sängylle istumaan</key>
<value>Mene sängylle istumaan</value>
</item>
</options>
</object>
<object name="Tiskaaminen">
<options type="stringdictionary">
<item>
<key>Tiskaa lisää 1</key>
<value>Tiskaa lisää</value>
</item>
<item>
<key>Avaa jääkaappi</key>
<value>Avaa jääkaappi</value>
</item>
<item>
<key>kone käyntiin</key>
<value>Käynnistä tietokone</value>
</item>
<item>
<key>kartan katsominen</key>
<value>Katso karttaa</value>
</item>
</options>
<description>Otat käteesi likaisen lautasen ja jynssäät sitä tiskiharjalla.</description>
</object>
<object name="Tiskaa lisää 1">
<options type="stringdictionary">
<item>
<key>Tiskaa lisää 2</key>
<value>Tiskaa lisää</value>
</item>
<item>
<key>Avaa jääkaappi</key>
<value>Avaa jääkaappi</value>
</item>
</options>
<description>Otat käteesi haarukan ja jynssäät sitä tiskiharjalla.</description>
</object>
<object name="Avaa jääkaappi">
<options type="stringdictionary">
<item>
<key>Juo appelsiinimehua</key>
<value>Juo appelsiinimehua</value>
</item>
</options>
<description>Jääkaapissa on appelsiinimehua.</description>
</object>
<object name="Tiskaa lisää 2">
<description>Otat käteesi lasin ja jynssäät sitä tiskiharjalla.</description>
<options type="stringdictionary">
<item>
<key>Tiskaa lisää 3</key>
<value>Tiskaa lisää</value>
</item>
<item>
<key>Avaa jääkaappi tiskit tehty</key>
<value>Avaa jääkaappi</value>
</item>
</options>
</object>
<object name="Juo appelsiinimehua">
<options type="stringdictionary">
<item>
<key>Juo likaisesta lasista</key>
<value>Juo likaisesta lasista</value>
</item>
<item>
<key>Tiskaa lisää 2</key>
<value>Tiskaa lisää</value>
</item>
<item>
<key>Sika</key>
<value>Juo suoraan purkista</value>
</item>
</options>
<description>Sinulla ei ole yhtään puhdasta lasia</description>
</object>
<object name="Juo likaisesta lasista">
<description>Tulet huonovointiseksi. Joudut menemään takaisin makuuasentoon sänkyysi.</description>
<options type="stringdictionary">
<item>
<key>alku</key>
<value>Nukahdat ja heräät sängystäsi.</value>
</item>
</options>
</object>
<object name="Tiskaa lisää 3">
<inherit name="scripttext" />
<options type="stringdictionary">
<item>
<key>alku</key>
<value>Mene nukkumaan</value>
</item>
</options>
<description>Tiskaat ja tiskaat, kunnes on jo ilta.</description>
<script type="script">
IncreaseCounter ("boring")
</script>
</object>
<object name="Avaa jääkaappi tiskit tehty">
<options type="stringdictionary">
<item>
<key>Juo appelsiinimehua tiskit tehty</key>
<value>Juo appelsiinimehua</value>
</item>
<item>
<key>Avaa jääkaappi tiskit tehty</key>
<value>Laita mehu takaisin jääkaappiin</value>
</item>
</options>
<description>Jääkaapissa on appelsiinimehua. Otat purkin käteesi.</description>
</object>
<object name="Juo appelsiinimehua tiskit tehty" />
<object name="Laita mehu takaisin jääkaappiin">
<description>Mehu on taas jääkaapissa</description>
<options type="stringdictionary">
<item>
<key>Tiskaa lisää 1</key>
<value>Mene tiskaamaan</value>
</item>
<item>
<key>kartan katsominen</key>
<value>Katso karttaa</value>
</item>
</options>
</object>
<object name="Sika">
<inherit name="scripttext" />
<description>Sika!</description>
<options type="stringdictionary">
<item>
<key>kone käyntiin</key>
<value>Mene käynnistämään tietokone</value>
</item>
<item>
<key>kartan katsominen</key>
<value>Katso karttaa</value>
</item>
</options>
<script type="script">
IncreaseCounter ("piggy")
</script>
</object>
<object name="Avaa sähköposti">
<options type="stringdictionary">
<item>
<key>Olet voittanut miljoonan</key>
<value>Olet voittanut 1 000 000 euroa!!</value>
</item>
<item>
<key>Seuraa lähialueesi naisista</key>
<value>Seuraa lähialueesi naisista</value>
</item>
<item>
<key>Ajattelin muistuttaa vielä</key>
<value>Ajattelin muistuttaa vielä</value>
</item>
</options>
<description>Sähköpostissa on kolme viestiä. Ehdit lukea vain yhden niistä. Valitse haluamasi viesti otsikon perusteella.</description>
</object>
<object name="Pelaa tekstiseikkailupeliä">
<description>Alat pelaamaan kiehtovaa tekstiseikkailua.</description>
<options type="stringdictionary">
<item>
<key>alku</key>
<value>Tekstiseikkailun alkuun</value>
</item>
</options>
</object>
<object name="Olet voittanut miljoonan">
<options type="stringdictionary">
<item>
<key>Klikkaa jackpotlinkkiä</key>
<value>Klikkaa linkkiä</value>
</item>
<item>
<key>Laita viesti roskapostikansioosi</key>
<value>Laita viesti roskapostikansioosi</value>
</item>
<item>
<key>Vedä tietokoneen töpseli irti seinästä</key>
<value>Vedä tietokoneen töpseli irti seinästä</value>
</item>
</options>
<description><![CDATA[Viestissä lukee:<br/>Onneksi olkoon, olet voittanut eurojackpotin päävoiton, 1 000 000 euroa! Lunasta voittosi klikkaamalla alla olevaa linkkiä!]]></description>
</object>
<object name="Seuraa lähialueesi naisista" />
<object name="Ajattelin muistuttaa vielä" />
<object name="Klikkaa jackpotlinkkiä" />
<object name="Laita viesti roskapostikansioosi" />
<object name="Vedä tietokoneen töpseli irti seinästä">
<options type="stringdictionary">
<item>
<key>Avaa jääkaappi</key>
<value>Avaa jääkaappi</value>
</item>
<item>
<key>alku</key>
<value>Mene nukkumaan.</value>
</item>
<item>
<key>kartan katsominen</key>
<value>Katso karttaa.</value>
</item>
</options>
<description>Tietokoneesi pimenee.</description>
</object>
<object name="Sulje silmät ja tökkää karttaa sormella sokkona">
<options type="stringdictionary">
<item>
<key>Lähde kohti metsää</key>
<value>Lähde kohti metsää</value>
</item>
<item>
<key>Mene sängylle istumaan</key>
<value>Mene sängylle istumaan</value>
</item>
</options>
<description>Sormesi pysähtyy osoittamaan Pukkivuoren takana olevaa metsää.</description>
</object>
<object name="Revi kartta palasiksi">
<options type="stringdictionary">
<item>
<key>Mene sängylle istumaan</key>
<value>Mene sängylle istumaan</value>
</item>
</options>
<description>Revit kartan palasiksi. Palaset putoavat lattialle.</description>
</object>
<object name="Mene sängylle istumaan">
<description>Istut sängyllä. </description>
<options type="stringdictionary">
<item>
<key>Katso sängyn alle</key>
<value>Katso sängyn alle</value>
</item>
<item>
<key>alku</key>
<value>Ala nukkumaan</value>
</item>
</options>
</object>
<object name="Lähde kohti metsää" />
<object name="Katso sängyn alle">
<options type="stringdictionary" />
<description><![CDATA[Sängyn alla marssii muurahaisia.<br/><br/>{if Revi kartta palasiksi.visited:{page:Heitä revityt kartan palaset muurahaisille:Heitä revityt kartan palat muurahaisille}}<br/>{page:Tapa muurahaiset:Tapa muurahaiset}]]></description>
</object>
<object name="Heitä revityt kartan palaset muurahaisille" />
<object name="Tapa muurahaiset">
<inherit name="scripttext" />
<description>Hakkaat muurahaiset mössöksi kengällä</description>
<script type="script">
IncreaseCounter ("piggy")
</script>
<options type="stringdictionary">
<item>
<key>Mene sängylle istumaan</key>
<value>Mene sängylle istumaan</value>
</item>
<item>
<key>Mieti</key>
<value>Mieti</value>
</item>
</options>
</object>
<object name="Mieti">
<inherit name="scripttext" />
<description><![CDATA[Mitä haluat miettiä?<br/><br/>]]></description>
<script type="script"><![CDATA[
if (GetInt(game, "piggy") > 1) {
AddPageLink (Mieti, Mitä ilkeää ja kuvottavaa voisit seuraavaksi tehdä, "Mitä ilkeää ja kuvottavaa voisit seuraavaksi tehdä")
}
else {
AddPageLink (Mieti, Mitä jännittävää voisit seuraavaksi tehdä, "Mitä jännittävää voisit seuraavaksi tehdä")
}
]]></script>
</object>
<object name="Mitä ilkeää ja kuvottavaa voisit seuraavaksi tehdä" />
<object name="Mitä jännittävää voisit seuraavaksi tehdä" />
</asl>
blockrocker
03 May 2013, 04:36Hi!
I know you are busy so don't worry if you don't have the time to respond now. I'm only bumping because I'm about to give a lesson on interactive storytelling (starting in 5 hours) and I was thinking on using Quest as one of the solutions. If I could show the students how to create a working status-system I think they would be very impressed with your software!
I know you are busy so don't worry if you don't have the time to respond now. I'm only bumping because I'm about to give a lesson on interactive storytelling (starting in 5 hours) and I was thinking on using Quest as one of the solutions. If I could show the students how to create a working status-system I think they would be very impressed with your software!
Alex
03 May 2013, 08:32What options do I need to select to reproduce the error?
blockrocker
03 May 2013, 08:50-Alat tiskaamaan
-Avaa jääkaappi
-Juo appelsiinimehua
-Juo suoraan purkista
-Katso karttaa
-Mene sängylle istumaan
-Katso sängyn alle
-Tapa muurahaiset
-Mieti
The way I undersgtood it the pages "Juo likaisesta lasista" and "Tapa muurahaiset" should result in piggy counter being 2. And the "Mieti" page should display a different option if the piggy > 1
Edit: fixed one option
-Avaa jääkaappi
-Juo appelsiinimehua
-Juo suoraan purkista
-Katso karttaa
-Mene sängylle istumaan
-Katso sängyn alle
-Tapa muurahaiset
-Mieti
The way I undersgtood it the pages "Juo likaisesta lasista" and "Tapa muurahaiset" should result in piggy counter being 2. And the "Mieti" page should display a different option if the piggy > 1
Edit: fixed one option
Alex
03 May 2013, 09:24Ah, it fails because the page has no options defined at all when the script runs, so it doesn't have an options list to add to.
You should be able to fix this by adding an option, then removing it, so that Quest sees an empty options list there.
I'll fix this properly for Quest 5.4.1.
You should be able to fix this by adding an option, then removing it, so that Quest sees an empty options list there.
I'll fix this properly for Quest 5.4.1.
blockrocker
03 May 2013, 09:31Great I will try that!
You are right on time too, I will start my lecture in 20 min
You are right on time too, I will start my lecture in 20 min

Alex
03 May 2013, 09:31Just pushed a fix for this, so another thing you can do is overwrite GamebookCore.aslx with the latest file:
https://quest.codeplex.com/SourceContro ... kCore.aslx
I have changed the RemovePageLink function at the end.
https://quest.codeplex.com/SourceContro ... kCore.aslx
I have changed the RemovePageLink function at the end.