0 votes
by (2.4k points)

Hello there, 

I have 10 images within my images folder named from str_1 to str_10.

What I would like to achieve would be to have the image fitting the strength of the character to be printed.

I tried something like this, with huge hopes of success :

[img[`"images/str_" + $strength + ".jpg"`]]

The idea being than, when processed, it would be read as 

[img[images/str_1.jpg]]

(Or any number $strength is at the moment).

Obviously, it didn't work...
I then tried to apply this to a variable, to test if it actually did anything. It doesn't.
 

<<set $imgStrength to `"images/str_" + $strength + ".jpg"`>>

Didn't do much for me. 
So now I'm left wondering : what is the correct way to achieve this goal ?

Thanks a lot !

1 Answer

+1 vote
by (159k points)
selected by
 
Best answer

You were trying to use backquotes \ graves characters to force the pre-evaluation of your image name releated expression, and unfortunately you can only use those characters do that for Macro Arguments.

However all isn't lost because you don't need them to solve your issue as you can simple do the following

[img["images/str_" + $strength + ".jpg"]]

 

by (2.4k points)
Damn it. I was so close.
Thanks !!
...