Visual Novel Maker

Visual Novel Maker

Concatenation - String + Variables
Hi.

How can I concatenate string with a variable and use that concatenation as variable value to search for an image in an especific folder and show this image? I used to make it work on TyranoBuilder using "&" before the variable but I don't know how to do it on VNM.

Like:

enemy_new = "enemy" + numberVariable + ".png"

If numberVariable is for example 3, enemy_new variable will be enemy03.png now.

I want it to read enemy_new variable, search for the right image and show enemy03.png, how I do that ?

Thank in advance.





< >
Showing 1-4 of 4 comments
Kentou  [developer] Dec 25, 2018 @ 5:43pm 
Hi,

in current version, the Text Variable command has no operations to work with numbers. Because in most cases, that is unnecessary because you can use text codes such as {GN:MyNumber} to display numbers in text. For Example: enemy_{GN:EnemyNumber}

However, those codes are only processed if a text is displayed. In case of using a text variable as a file name, they have no effect. To achieve the same without script you can use lists as a helper:

Text Variable | Target: Text | Text: G[0001: File Name] | Operation: Set | Source: Value | -------------------------- enemy_ ========================== Add to List | List: G[0001: File Name Parts] | Value: Text | G[0001: File Name] | ========================== Add to List | List: G[0001: File Name Parts] | Value: Number | 5 | ========================== Join List | List: G[0001: File Name Parts] | Order: Normal | Store in: G[0001: File Name] | Separator: ========================== Show Picture | Number: 0 | File: G[0001: File Name] | Anchor: Center | Position: Predefined | Top-Left | Duration: 0ms | Continue ==========================

After this the text variable File Name contains enemy_5 as text which then can be used with Show Picture to show a picture dynamically. A file extension such as .png is not required, VN Maker figures that out automatically.

Alternatively, you can use a Script command with the following scripts:

GameManager.variableStore.strings[0] = "enemy_" + GameManager.variableStore.numbers[0];

After that scripts, the text variable 0001 contains the text enemy_<value of number variable 0001>.

Let me know if that helps you out.
Last edited by Kentou; Dec 25, 2018 @ 5:45pm
lordmortarkingdom Dec 26, 2018 @ 2:27pm 
Thank you ! I'll try the examples you gave me.

One more question, what language is that script ?
Last edited by lordmortarkingdom; Dec 27, 2018 @ 8:43am
Kentou  [developer] Dec 28, 2018 @ 6:41am 
Hi, the script language inside Script command is JavaScript.
lordmortarkingdom Dec 28, 2018 @ 7:22am 
Thanks !!

Could you bring some light on this topic as well ?

https://steamcommunity.com/app/495480/discussions/0/1742226629860980563/

Before I start the real hard work on VNM.

Thanks so much.
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Dec 24, 2018 @ 1:40pm
Posts: 4