Do_dance undefined token tutorial

Started by SinSin, Sun 15/06/2008 20:38:58

Previous topic - Next topic

SinSin

I am currently working my way through the tutorial for scripting on AGS 2.7 and have gotten as far as part 2  everything is starting to sink in but i have come across this undefined token malarchy
Currently I have
Code: ags
 function do_dance () {       
   cEgo.LockView(10);
   cEgo.Animate(2, 5);
   cEgo.UnlockView();
 } 

At the very top of my Global script
and I have
Code: ags
function hotspot4_a() {// script for Hotspot 4 (Hotspot 4): Interact hotspot
do_dance();  

In my interact hotspot4 script

Why should i be getting an undefined token message when i have created a function of exactly the same name

Thanx in advance Sin
Currently working on a project!

GarageGothic

#1
Because the function is in the global script and the hotspot is in the room script. You need to "import function do_dance();" in the global header  to be able access it from room scripts (you can also import it in the room script if you only use it in that one room, but then you may as well move the whole funciton to the room script).

SMF spam blocked by CleanTalk