Page 1 of 1

Is it possible to manipulate string variables and have the resultant string point to an image?

Posted: Wed Jan 10, 2018 10:17 am
by envixer
Ok, so after reading the title you're probably scratching your head.

As I mentioned in my first post, I'm using background images for all bgs and sprites, and I'm using sprite images for speech bubbles and exposition text. This means that with the right naming convention I should be able to have a single function display whole segments of the story.

So what I want to do is something like this:

While screencount > 0
image scenebg = "ch1" + screendisplay + ".png"
scene scenebg
pause 0.2
if loadable ("ch1" + screendisplay + "x1.png")
image expo1 = "ch1" + screendisplay + "x1.png"
show expo1
pause 0.2
if loadable ("ch1" + screendisplay + "t1.png")
image text1 = "ch1" + screendisplay + "t1.png"
show text1
pause
if loadable ("ch1" + screendisplay + "t2.png")
image text2 = "ch1" + screendisplay + "t2.png"
show text2
pause
screendisplay += 1
screencount -=1

Ok, so this snippet likely isn't accurate, but it's a high level description of what I'm trying to achieve. If I can loop this for each chapter, I'll be set because choices are only going to happen at the end of each chapter.

Any help is greatly appreciated!

Re: Is it possible to manipulate string variables and have the resultant string point to an image?

Posted: Wed Jan 10, 2018 10:55 am
by Remix
Though it doesn't answer your entire question (the if loadable bits) you likely want to look at

default variable_name = "_variable_part"
image some_name = DynamicImage( "prefix[variable_name].png" )