Picture troubles @_@ [SOLVED]

http://textadventures.co.uk/forum/samples/topic/5566/how-to-control-how-images-are-displayed

I have this link saved in case I want to mess with pictures or anything. So I tried to implement a new one that I drew using this...

("<img src="" + GetFileURL("https://s31.postimg.org/kpb4dqfor/Goblin_NPC_Hannah_Picksnap.jpg") + "" style="display: block; margin-left: auto; margin-right: auto;" />")

Which came from this...

msg ("<img src="" + GetFileURL("gravestone.png") + "" style="display: block; margin-left: auto; margin-right: auto;" />")
msg ("You are in a room. A large room, entirely white, nothing here but a gravestone.")
msg ("Your gravestone.")

But when I tried to look at the picture in the game. It said...

Error running script: Missing ')'

^--- I'm not exactly sure where to put that. Can anyone help :) ?


I think it has something to do with the double quotes***, not the ')', but this is a bit too confusing for me to figure out the what's the correct syntax is... sighs. Pixie. Jay, Pertex, or whoever else will probably be needed to figure it out... (I had enough trouble with just understanding the correct syntax is the 'lvl' lvlup Library... but this uses a bit different structure than it, so I'm not sure how to fix it up for you)

.*** the 2 types of chunks being used together:
" TEXT "
along with
.+ VARIABLE +


try removing the semicolon after the last 'auto'.

if that doesn't work, then try this... err, I can't get it to post as I still am having trouble with this forum's 'markdown' laguage, arg

you may need to remove some of the double quotes and/or you may need to put the escape character ('') on the left side of some of the double quotes, like this: .", but without the dot/period in front of it.

using Pixie's guide's link in your post, look at this:

msg ("<img src=\"" + GetFileURL("gravestone.png") + "\" />")

so, try this (maybe this might work... I hope):

msg ("<img src=\"" + GetFileURL + "(\"https://s31.postimg.org/kpb4dqfor/Goblin_NPC_Hannah_Picksnap.jpg\")\" style=\"display: block; margin-left: auto; margin-right: auto\" />")

great pic, btw!, hehe:D


---great pic, btw!, hehe:D---

Thanks!! :D I appreciate it.

After trying...
("<img src="" + GetFileURL("https://s31.postimg.org/kpb4dqfor/Goblin_NPC_Hannah_Picksnap.jpg") + "" style="display: block; margin-left: auto; margin-right: auto" />")

I'm still getting this error...

Error running script: Missing ')'

I appreciate the help so far, btw! I'm not very savvy when it comes to HTML or whatever that language is for linking pictures xD

I wish there was a way to manipulate it in the same way without using an outside URL.


try this...

msg ("<img src=\"" + GetFileURL + "(\"https://s31.postimg.org/kpb4dqfor/Goblin_NPC_Hannah_Picksnap.jpg\")\" style=\"display: block; margin-left: auto; margin-right: auto\" />")

or try it with the semicolon back on the last auto:

msg ("<img src=\"" + GetFileURL + "(\"https://s31.postimg.org/kpb4dqfor/Goblin_NPC_Hannah_Picksnap.jpg\")\" style=\"display: block; margin-left: auto; margin-right: auto;\" />")

Is there a way to make it do the block; margin left: auto; margin-right: auto; based on this...

{img:Apoca-Title Sequence 3.gif}

Trying your new suggestion :)

Nah, the extra slashes turn it into an expression in both cases:
Error running script: Error compiling expression '"("<img src=\"" + GetFileURL + "(\"https://s5.postimg.org/aaicoyvur/NPC_Goblin_Hannah_P_Color05_min_2.jpg\")\" style=\"display: block; margin-left: auto; margin-right: auto;\" />")"': SyntaxError: Unexpected character: \Line: 1, Column: 17


You only need GetFileURL when you want to display a image from the quest directory. If you want to show am image from the internet you can call it directly:

  msg ("<img src=\"https://s31.postimg.org/kpb4dqfor/Goblin_NPC_Hannah_Picksnap.jpg" style=\"display: block; margin-left: auto; margin-right: auto;\" />")

Thanks Pertex :D ...is there a way to do what I'm doing without linking a picture to the internet?


What are you doing or what do you want to do? :-)


Well, I want to add a picture to the game without making it online if possible (in case someone plays it without internet). For example...

<center.>{img:Apoca-Title Sequence 3.gif}</.center> ((I know the periods aren't supposed to be there))

But I was wondering if it's possible to do...

display: block; margin-left: auto; margin-right: auto

to a picture I add to the game without it being a URL.

So it'll appear like...

texttexttexttexttexttexttexttexttexttexttexttexttexttexttext ---------- P
texttexttexttexttexttexttexttexttexttexttexttexttexttexttext ---------- I
texttexttexttexttexttexttexttexttexttexttexttexttexttexttext ---------- C
texttexttexttexttexttexttexttexttexttexttexttexttexttexttext ---------- T
texttexttexttexttexttexttexttexttexttexttexttexttexttexttext ---------- U
texttexttexttexttexttexttexttexttexttexttexttexttexttexttext ---------- R
texttexttexttexttexttexttexttexttexttexttexttexttexttexttext ---------- E

An example is, to display text beside a picture which is displayed when a character looks at an NPC. Does that make sense?


Indent code with 4 spaces or surround it with three backticks, as per the formatting help next to where you post. You'll have a much easier time posting code samples.


Any ideas :D? ((also thank you Alex, I'm getting better with it now)) ^_^


Pertex or anyone :3


you can't do it with the textprocessor but if you follow the instructions of The Pixie's tutorial you can do:

msg("<img src=\"" + GetFileURL("Goblin_NPC_Hannah_Picksnap.jpg") + "\" style=\"float:right; padding:15px;\" />")
msg("This is your text")
msg("Hello")

If I understand you right, you want the image in your game file, in the .quest file that gets uploaded.

Download the image and save it in the same folder as your game. Then this should work (note that I added 4 backslashes):

msg("<img src=\"" + GetFileURL("Goblin_NPC_Hannah_Picksnap.jpg") + "\" style=\"display: block; margin-left: auto; margin-right: auto;\" />")

If that works, you can change the style attribute to get it in the right place (in fact Pertex has done that as I write this).


I appreciate it everyone! :D It's working great now. Thank you, thank you! :3

I was also forgetting to make it an "expression" too.