Error in 5.0 Windows client? if clause doesn't work properly. But code works in online editor!!

Hi there!

Newbie question: I am using offline client and start coding learning squiffy. There are some mistakes in client, are they?
If I run the below code, only the else clause would be displayed in output section of windows client. Even if I build game it doesn't work.

Trying same code online: everything is fine.

I am using squiffy 5.0 client with chrome browser. Can you help?

Dax

@set inventory=0
@start Room 1

[[]]:
@clear

[[Inventory]]:
{if inventory<1:You are carrying nothing.}{else:You are carrying:
}

[[Room 1]]:
@set inventory=0
Room 1

{Inventory}

Go to [[Room 2]]

[[Room 2]]:
@set inventory=3
Room 2

{Inventory}

Back to [[Room 1]]


No one? Am I the only one that works with the windows client? O.O


Hello,

I'm not very well-versed in Squiffy or JS, but since no one else has seen this one yet, I thought I'd at least provide a little' feedback'.

It appears to do what you've coded it to do in mine.

{if inventory<1:You are carrying nothing.}{else:You are carrying:
}
[[Room 2]]:
@set inventory=3
Room 2

NOTE: The screen is cleared with each click:

Room 1

You are carrying nothing.

Go to Room 2


Room 2

You are carrying:

Back to Room 1


Room 1

You are carrying nothing.

Go to Room 2


Room 2

You are carrying:

Back to Room 1


Here's by version of Squiffy's ABOUT:

Squiffy 5.0
Build 5.0.0

http_parser 2.5.0, node 4.1.1, v8 4.5.103.29, uv 1.7.4, zlib 1.2.8, ares 1.10.1-DEV, modules 46, openssl 1.0.2d, electron 0.34.3, atom-shell 0.34.3, chrome 45.0.2454.85

Copyright © 2015 Alex Warren


The only 'trick' I know, is to print the variables in each section to keep track of what's going astray.

[[Inventory]]:
{if inventory<1:You are carrying nothing.}{else:You are carrying:
}

(THIS LINE FOR TESTING) Inventory: {inventory}

Room 1

You are carrying nothing.

(THIS LINE FOR TESTING) Inventory: 0

Go to Room 2



Room 2

You are carrying:

(THIS LINE FOR TESTING) Inventory: 3

Back to Room 1


Is it printing the actual either clause?

Or is it not printing anything after displaying the message 'You are carrying:' in your client?

I only ask because there is no text to print in the either statement.

[[Inventory]]:
{if inventory<1:You are carrying nothing.}{else:You are carrying:
}

Room 1

You are carrying nothing.

Go to Room 2


Room 2

You are carrying:

Back to Room 1


If I alter it slightly, though:

[[Inventory]]:
{if inventory<1:You are carrying nothing.}{else:You are carrying: {inventory} thing{if not inventory<>1:s}.
}

(THIS LINE FOR TESTING) Inventory: {inventory

Room 1

You are carrying: 0 things.

(THIS LINE FOR TESTING) Inventory: 0

Go to Room 2


Room 2

You are carrying: 3 things.

(THIS LINE FOR TESTING) Inventory: 3

Back to Room 1


Thanks Richard.
Can't post screenshot (stupid me??)

But if I run the code in client it gives :

You are carrying: 0 things

even though var inventory = 0 which is <1 (I think)

Same code in online editor works fine. I've contacted textadventure.co.uk, but didn't get an answer.


Hmm...
I wondered if I might have missed an update, so I just downloaded the Squiffy installer from this site, installed, and ran your code. Still worked fine.

I'm running it in WIndows 10.

I'll knock the dust off of my Windows 7 machine and see how it works on it.


Screenshots:
I save all the screenshots I want to post here to a Gist comment on GitHub, then link to them.

image


inventory = 0 < 1

My deduction is the same as yours: this is less than 1.


I've contacted textadventures.co.uk, but didn't get an answer.

Someone will most assuredly reply soon.

They just updated the Quest online and offline editor, along with the server and other things, so it may take them a little longer right now than it usually would.


Sorry I couldn't help!

If I run into the same bug under Windows 7, I'll post an update.


Just have the Same Squiffy Build in windows 10 Last update.
Can't explain, why that Happens On my machine. Tried it On windows 7 prof: Same (wrong) result.
Maybe its my javascript version? O.o I'll will proof it.
Don't want to throw my adventure Plans down the garbage shaft ;-)
Squiffy seems the best tool to write games, that could be played On every device without needing a Special player. That's why I am trying to use it.
Well. We'll see.
Have a nice evening!


In Windows 7:

image

image


NOTE: Don't mind the inventory counts in the debugger. I went to Room 2 and back one time before I took the screenshots.


I get the same exact output in Windows 10, so I won't post redundant pictures.


I have been keeping Java updated recently. I have no idea if it has anything to do with it, though...
(Speak of the devil! It just prompted me to update! No joke!)


PLUS I've got Visual Studio installed in both machines. You get a LOT of little things that enable your system to do all sorts of things when you install Visual Studio...


I hope someone who can help you comes along.

Good luck, and good evening to you, too!


That's really confusing. Just tried it again on my Win7Pro System with updated Java and Chrome Version 59.
Because Java Installer gave an alert after installation, because of a function, which is not longer supported by google chrome, I've tried a build under firefox. Same result: if clause went wrong.
I can't explain such things.

Maybe I "should not use squiffy" ;-)

But I don't give up and wait for an answer from textadventures.co.uk. Maybe they are finished sometime with serverupdate.

Thanks for your great support Richard!


Just got an idea:

I've compared index.html our little example from client version with downloaded version from online editor.

Online editor give the code:

Created with Squiffy 5.1.0

Offline Editor says:

Created with Squiffy 5.0.0

O.o


I am totally confused now. I've just downloaded squiffy again (same version as installed), installed it again.... and tataaaaa!
it works!

OK. I'll take it, as is. Let's start writing! :-)


I am totally confused now. I've just downloaded squiffy again (same version as installed), installed it again.... and tataaaaa!
it works!

OK. I'll take it, as is. Let's start writing! :-)

👍

Richard Headkid likes this.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums