Change the picture with a verb?

jmnevil54
16 Feb 2021, 17:57

In my FightCraft Hardcore, a Minecraft text adventure, there are pictures. I want it so the picture frame changes pictures after the player harvests wheat. Can you change the picture with a verb?

Game here. http://textadventures.co.uk/games/view/kn5lvk1qqkef8rsarzuwbw/fightcraft-hardcore


mrangel
16 Feb 2021, 19:29

You mean the standard picture frame?

The function you want is SetFramePicture and it takes a single argument, which is the filename.

If you want to set it to an externally hosted image, you'd use JS.setPanelContents instead – its argument is an HTML string, so you'd have to give it the whole <img> tag.


jmnevil54
16 Feb 2021, 22:40

What is an argument and what does the code look like?


mrangel
16 Feb 2021, 22:47

Arguments is just another word for parameters. In javascript, you can use the special variable arguments within a function to get an array of all the parameters that were passed.

SetFramePicture ("somefile.jpg")

jmnevil54
17 Feb 2021, 03:42

I'll see what I can do. Thank you.