Switchable
agirdhar
01 Jun 2015, 06:22I'm just starting out - using the webapp
I created a lamp and then enabled switching, but I added a script in switchable and when I try to switch on lamp, it outputs this "You can't switch #obejct# on; switch on the #object; switch on; turn on it."
The script is a question and then a switch statement which delivers various messages based on the response to the question.
I created a lamp and then enabled switching, but I added a script in switchable and when I try to switch on lamp, it outputs this "You can't switch #obejct# on; switch on the #object; switch on; turn on it."
The script is a question and then a switch statement which delivers various messages based on the response to the question.
HegemonKhan
01 Jun 2015, 06:54I'd recommend going through as much of the entire tutorial as you can, as even if it seems boring and~or simple, it really helps you to get familiar with quest and code~if logic mentality~thinking, which you'll need regardless of whether you work with the code or not, as it's required for game making:
http://docs.textadventures.co.uk/quest/tutorial/
as to specifically your question, here is the 'switchable' part in the tutorial:
http://docs.textadventures.co.uk/quest/ ... ripts.html (the 'if' Scripting for your 'switchable' 'tv' Object)
http://docs.textadventures.co.uk/quest/ ... jects.html (scroll down to find the 'switchable' section)
http://docs.textadventures.co.uk/quest/ ... _game.html (initially setting up the 'tv' Object, scroll down to the 'tv' Object section)
http://docs.textadventures.co.uk/quest/ ... notes.html (if you don't see the 'switchable' Tab)
http://docs.textadventures.co.uk/quest/ ... hable.html
http://docs.textadventures.co.uk/quest/ ... tchon.html
http://docs.textadventures.co.uk/quest/ ... hedon.html
http://docs.textadventures.co.uk/quest/ ... tchon.html
http://docs.textadventures.co.uk/quest/ ... choff.html
http://docs.textadventures.co.uk/quest/ ... choff.html
http://docs.textadventures.co.uk/quest/ ... hedon.html
http://docs.textadventures.co.uk/quest/ ... lagon.html
http://docs.textadventures.co.uk/quest/ ... agoff.html
http://docs.textadventures.co.uk/quest/tutorial/
as to specifically your question, here is the 'switchable' part in the tutorial:
http://docs.textadventures.co.uk/quest/ ... ripts.html (the 'if' Scripting for your 'switchable' 'tv' Object)
http://docs.textadventures.co.uk/quest/ ... jects.html (scroll down to find the 'switchable' section)
http://docs.textadventures.co.uk/quest/ ... _game.html (initially setting up the 'tv' Object, scroll down to the 'tv' Object section)
http://docs.textadventures.co.uk/quest/ ... notes.html (if you don't see the 'switchable' Tab)
http://docs.textadventures.co.uk/quest/ ... hable.html
http://docs.textadventures.co.uk/quest/ ... tchon.html
http://docs.textadventures.co.uk/quest/ ... hedon.html
http://docs.textadventures.co.uk/quest/ ... tchon.html
http://docs.textadventures.co.uk/quest/ ... choff.html
http://docs.textadventures.co.uk/quest/ ... choff.html
http://docs.textadventures.co.uk/quest/ ... hedon.html
http://docs.textadventures.co.uk/quest/ ... lagon.html
http://docs.textadventures.co.uk/quest/ ... agoff.html

jaynabonne
01 Jun 2015, 07:06That error message is unusual and points to some problem I don't know how to diagnose.
I edited an existing web game of mine, and did the following:
1) Created a "lamp" object
2) Under the lamp's Features tab, I turned on Switchable
3) Under the Switchable tab that appears, I selected "Can be switched on and off".
4) I added a script under "After switching on the object"
and that all works. If I try to switch on something that isn't switchable, it just says "You can't turn it on."
Did you by chance try to add the ability to switch the lamp on as a verb at some point? I don't know if the error message you list above has the typo in what's printed out or if you introduced the typo when posting, but there is a typo there which makes me suspect the verb has been corrupted/overridden somehow. Even without the typo, it shouldn't be printing out an entire pattern like that.
If you did add a bad overriding verb at some point to the lamp, you might be able to remove it and have it work. Or you might not. There seems to be a problem removing verbs in the web editor.
I edited an existing web game of mine, and did the following:
1) Created a "lamp" object
2) Under the lamp's Features tab, I turned on Switchable
3) Under the Switchable tab that appears, I selected "Can be switched on and off".
4) I added a script under "After switching on the object"
and that all works. If I try to switch on something that isn't switchable, it just says "You can't turn it on."
Did you by chance try to add the ability to switch the lamp on as a verb at some point? I don't know if the error message you list above has the typo in what's printed out or if you introduced the typo when posting, but there is a typo there which makes me suspect the verb has been corrupted/overridden somehow. Even without the typo, it shouldn't be printing out an entire pattern like that.
If you did add a bad overriding verb at some point to the lamp, you might be able to remove it and have it work. Or you might not. There seems to be a problem removing verbs in the web editor.
The Pixie
01 Jun 2015, 07:22jaynabonne wrote:...
If you did add a bad overriding verb at some point to the lamp, you might be able to remove it and have it work. Or you might not. There seems to be a problem removing verbs in the web editor.
The problem is that the on-line editor does not give you access to verbs. This was discussed also in this thread.
viewtopic.php?f=10&t=5248
agirdhar
02 Jun 2015, 22:22jaynabonne, I tried to add it as a verb when it wasn't working initially, but I got an error that said 'switch #object on' already exists, or something to that effect. So I removed the verb and all I have turned on is the switchable.
Is there any other way around this error?
Is there any other way around this error?