Issue with passage not existing

Hello, I'm getting an error with the following script. It aims to allow for the setting of the players name. I can't seem to find what's wrong with it. Any help is much appreciated.
Script:

[[game.resetVars]]:
@clear
[Begin](menu)

[menu]:
Your name is [{name_first}](m.name_first) [{name_last}](m.name_last)

[m.name_first]:
@clear
<input type="text" id="name_first">
+++set
    squiffy.set("name_first", jQuery("#name_first").val());
    squiffy.story.passage("menu");

[m.name_last]:
@clear
<input type="text" id="name_last">
+++set
    squiffy.set("name_last", jQuery("#name_last").val());
    squiffy.story.passage("menu");

Error:

WARNING: null line 35: In section 'game.resetVars', passage 'menu' there is a link to a passage called [m.name_last], which doesn't exist

EDIT:
I solved the issue by removing the continue links and moving the scripts to the top. One thing I forgot is that all scripts in a section/passage must be located at the top. This caused some weird conflict with the continue link that completely broke that passage. With that knowledge in mind, I was able to fix it and make a functioning name input system.
Script:

[[game.resetVars]]:
@clear
[Begin](menu)

[menu]:
Your name is [{name_first}](m.name_first) [{name_last}](m.name_last)

[m.name_first]:
@clear
<input type="text" id="name_first" value="{name_first}">

[confirm](m.name_first.confirm)

[m.name_first.confirm]:
    squiffy.set("name_first", jQuery("#name_first").val());
    squiffy.story.passage("menu");

[m.name_last]:
@clear
<input type="text" id="name_last" value="{name_last}">

[confirm](m.name_last.confirm)

[m.name_last.confirm]:
    squiffy.set("name_last", jQuery("#name_last").val());
    squiffy.story.passage("menu");

I'm going to keep this up as a resource since I haven't seen many recent threads that use HTML input boxes for attribute values.


Log in to post a reply.

Support

Forums