Squiffy gives errors
p3aul
19 Jun 2015, 23:43Hi! I've written a small test program to try out Squiffy 2. I am using the command line version on my desktop. When I try to compile it gives me errors saying my sections and passages don't exist. here is the file
[[start]
You are in a small room you can see a[key] here and a [small book] you can go [[North]] or [[West]]
[key]
a small brass key
[small book]
The book is red and won't open
[[ West]]
Your in another small room. there is nothing here
You can go to [[start]]
[[North]]
you are in narrow dark passage. You can go
[[start]]
Alex
20 Jun 2015, 04:54Look at West, it has a space at the start.
p3aul
20 Jun 2015, 05:12That might be the problem and I will correct it. but I have a more major? problem. I was using Chrome instead of Firefox!
p3aul
20 Jun 2015, 05:19Well I corrected it but I still have the problem and it won't run correctly in Firefox either. here is the output of the compiler.:
C:\Adventure\Squiffy>squiffy test.squiffy
Squiffy 3.0.1
Loading C:\Adventure\Squiffy\test.squiffy
Writing story.js
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a section called [[North]], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a section called [[West]], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a section called [[West]], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a section called [[start]], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a section called [[North]], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a section called [[start]], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a passage called [[start], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a passage called [key], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a passage called [small book], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a passage called [key], which doesn't exist
WARNING: C:\Adventure\Squiffy\test.squiffy line 1: In section '_default' there is a link to a passage called [small book], which doesn't exist
Writing index.html
Writing style.css
Done.
Alex
20 Jun 2015, 06:32Oh, you're missing colons after your definitions. e.g.
[[West]]:
[[West]]:
p3aul
20 Jun 2015, 18:41Ok thanks. It compiles now but instead of progressing through each link, everything is laid out all at once. I've changed it a little so I will show the script as well as the output:
Script:
Output:
Thanks,
Paul
Script:
[[start]]:
You are in a small room you can see a[key] here and a [small book] you can go [[North]] or [[West]]
[key]:
a small brass key
[small book]:
The book is red and won't open
[[West]]:
Your in another small room. there is a [small can] here
You can go to [[start]]
[small can]:
This is a small bean can.
[[North]]:
you are in narrow dark passage. You can go
[[start]]]
Output:
[start You are in a small room you can see akey here and a small book you can go North or West
key a small brass key
small book The book is red and won't open
West Your in another small room. there is nothing here You can go to start
North you are in narrow dark passage. You can go start
You are in a small room you can see akey here and a small book you can go North or West
Your in another small room. there is nothing here You can go to start
You are in a small room you can see akey here and a small book you can go North or West
Your in another small room. there is nothing here You can go to start
Your in another small room. there is a small can here You can go to start
Thanks,
Paul
p3aul
21 Jun 2015, 04:53help?
thanks
thanks
p3aul
21 Jun 2015, 05:15OK I figured it out! I can't name the first room I start in, hence I can't go back to the beginning. Just one more question.
Is there a word, command or section that marks the end? Where several sections might lead to?
Now that it's Working (and I even used Chrome, by mistake!) I think it could make some nice little games for my Grandchildren!
Is there a word, command or section that marks the end? Where several sections might lead to?
Now that it's Working (and I even used Chrome, by mistake!) I think it could make some nice little games for my Grandchildren!
Alex
22 Jun 2015, 10:07You don't need to do anything special to mark the end of the game. If you have a section that has no links, play will stop there.
p3aul
23 Jun 2015, 02:40OK I see thanks, Another question. I've uploaded the game to my website. At the [[END]] section I inform the player that the game has ended and he can close his browser. Ok, When I create another tab or a new window and proceed to play the game again. The whole game is laid out before me just as it was when I ended the game and closed my browser. I tried putting @clear in the [[END]] section as the last line, but all that does is clear all the previous sections and leases the game still open so that when I open another tab and try playing the game again I am brought back to the END section and the game won't start again until I click on Restart link. What can I do that will insure a fresh start each time the game is opened?
Thanks,
Paul
Thanks,
Paul
Alex
23 Jun 2015, 19:55I've answered this over at IF Answers. (By the way, if you post there, there's no need to post here too.)
p3aul
24 Jun 2015, 07:17OK I posted here first and then decided it was supposed to be over there. Personally I don't like that form of a forum. I have had bad experiences with that forum ie.. "Stackoverflow" due to arrogant mods.