How to advance from one script to the next?

B

Brackleforth

Guest
Hello,

I'm working on a visual novel engine. The game has an array of strings that display one at a time for the first scene. What I want to do next is, when the text in one array has all been read, advance the script containing the strings to the next script. The purpose for this is to better organize my ideas - one script per major scene.

If I've just reached the end of the array in scr_story1, how can I advance to scr_story2 ?
I intend to keep the same naming convention indefinitely, so there must be a way to get the name of the current script, advance the number at the end of its name by 1, then execute the result. I feel like this is possible but I can't visualize what to do.

Thanks for reading. I appreciate any help!
 

Jakylgamer

Member
story_state is the script to execute
story_arc is the index number
Code:
story_state = asset_get_index("scr_story"+string(story_arc)); //get the script name
script_execute(story_state);
then all you do is change story_arc to +1 to advance.
 
B

Brackleforth

Guest
So I needed to use asset_get_index. That's so useful! Thank you very much! :)
 
Top