Calling a function from a dialog [solved]

Started by HandsFree, Wed 20/03/2013 23:32:13

Previous topic - Next topic

HandsFree

I have a function view_from_tree() that I want to call from a dialog.
@3
  view_from_tree();
return

I thought the function should be in the global script, but when I put it there I got error in dialog: Undefined token view_from_tree(). So I tried putting the function in the room script from where the dialog is called, but that gives the same error.

How should I do this?
thanks

Khris

#1
You have to import the function in GlobalScript.ash:

Code: ags
import function view_from_tree();


In the global dialog script, when you type "vie", the auto-complete window should pop up and suggest your function, among others.
If it doesn't, at that point you already know there's going to be the undefined token error.


cat

I know this is quite old, but I just found it useful and wanted to say
- this still works with current AGS
- thanks Khris!

SMF spam blocked by CleanTalk