How do you call a function in Gamebook

Terrence
20 Nov 2014, 01:43
Once you create a function in Gamebook, how do you call it from a particular page?

Thanks,

T.

Avantar
20 Nov 2014, 06:44
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
20 Nov 2014, 14:32
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
20 Nov 2014, 15:54
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
20 Nov 2014, 16:10
Oh my. I had the page set to text. Thank you so much.

Avantar
20 Nov 2014, 17:02
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
20 Nov 2014, 17:39
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.