displaying image from hosting site, error

egoproctor
01 Dec 2018, 01:24I am trying to test loading images from menu selections,
menuList = NewStringList()
list add (menuList, "test")
list add (menuList, "showing")
list add (menuList, "menus")
show menu ("Welcome to Chapel Perilous", videos.videoList, true) {
ShowYouTube (result)
wait {
show menu ("Test menu after videos", menuList, true) {
if (result = "test") {
msg ("test")
}
else if (result = "showing") {
msg ("showing")
}
else if (result = "menus") {
msg ("menus")
}
else {
msg ("How did that happen")
}
}
}
}
wait {
msg ("boo")
}
I would like each of the msg ("") to be an image from an html link using the instructions here:
http://docs.textadventures.co.uk/quest/images.html
Hosting images elsewhere
One way to circumvent the size limitation is to host your images on another site, such as DeviantArt or Imgur. You can do that easily, using the technique above. In fact, it is even easier; you just add the full address, rather than having to use GetFileURL.
msg ("<img src='http://www.mydomain.com/images/kitten.png' />")
msg ("<img src='http://www.mydomain.com/images/kitten.png' style=\"display: block; margin-left: auto; margin-right: auto;\" />")
I just want to test this image in the tag
https://i.imgur.com/vmFz0gn.jpg
when I try to add the code, to any given menu option for output
msg ("<img src = ' https://i.imgur.com/vmFz0gn.jpg ' />")
a dialogue in the web editor says, Sorry, and internal error has occurred.
?
What am I supposed to do with this scenario?

DarkLizerd
01 Dec 2018, 02:55Just a guess... could the extra spaces be the problem???
msg ("")
or:
msg ("")
Did any of the images load? or did just the last example?

DarkLizerd
01 Dec 2018, 03:01Hmm... I just copied your links to show the extra space I was asking about...
But it didn't matter for the forum, (as you can see...) It loaded (shows) the picture each time...
But I don't know about in Quest... (Checking now).
Hmm... it works in Quest too...
But there was a delay on loading... but then again, I'm on a slower satellite connection, DSL should be even quicker.

DarkLizerd
01 Dec 2018, 03:32It could be an issue with the web version...
I have the desktop version and everything works.
(But I would not put any money on it...)
mrangel
01 Dec 2018, 03:44It's a bug in the web editor.
You will get an error on exiting code view if your code contains a string which contains the character <
(possibly also >
, but that seems to be okay sometimes).
4 options to work around this (use whichever you understand):
- Miss out the
<
and>
when you edit in code view, and then add them in the GUI editor - Use numeric values (so your code looks like
msg (Chr(60) + "img src=\"https://i.imgur.com/vmFz0gn.jpg\" /" + Chr(62))
) - Make a text processor command to turn
{lt}
and{gt}
into the<
and>
characters - override the javascript function
addText
so that it replaces«
with<
and»
with>
; and then you can use « and » when entering HTML within your Quest code. (This is my preferred method; but is only really useful if your keyboard is set up toi easily type «)

egoproctor
01 Dec 2018, 05:51Thanks mrangel, and thanks DarkLizard
I just went with option 2 CHR()60) + " " + Chr(62)
for some reason it is very familiar to me, perhaps from working in C years ago.
on to the next issue, do I have access to certain API features inside Quest, for another thread