How do you call a function in Gamebook

Terrence
Once you create a function in Gamebook, how do you call it from a particular page?

Thanks,

T.

Avantar
Jaynabonne answered this question here if I am not mistaken: viewtopic.php?f=10&t=4762&p=31321&hilit=text+processor+call+function#p31321

Terrence
Thanks Avantar. That seems to refer to using a link.

For example, I have a sound file. I want the sound file to play when the reader comes to a certain page. A function has been added to the game, which plays the sound file. But how do I call the function from the page?

This is just an example. I mean any function that I've added to the Functions section of the Gamebook, not necessarily one that plays an audio file.

T.

Pertex
When the type of your page is "Script+Text" or "Script" you can add a new script. In the script adder choose "Scripts/Call function" and insert the name of your function.

Terrence
Oh my. I had the page set to text. Thank you so much.

Avantar
Maybe I misunderstood:

I did think you would like to call a function from the text processor. The example from jaynabonne in the link I gave, basically put a clickable link in the page that calls a function.
<a class="cmdlink"  onclick="ASLEvent('SomeFunction','null')">This link will play some sound when clicked</a><br>


The function is 'SomeFunction' and the link will display: This link will play some sound when clicked

Sorry for the misunderstanding. :)

Terrence
You did not misunderstand Avantar. I should have provided more information. Once I changed the page type, I then had the tool I needed to call the function. Thank you again.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums