Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: robot on November 14, 2008, 02:39:35 PM
-
i have a question and i don't know if this is a bug or not:
ok, there is a script attached to an object in the scene editor.
in this script there is another script attached (with the attachScript method). i have implemented a on "talk" event there.
now my problem is that ....this.CanHandleEvent("Talk").... in the first script gives me false.
i thought wme is script multitasking or is it only possible to handle the events in only one script (which is applied in the scene editor)
you know what i mean?
-
If you call CanHandleEvent before attaching the other script, it will return false. But once the other script is attached, it should return true.
-
this is the code for the first script:
#include "scripts\base.inc"
Game.AttachScript("scenes\04_wegweiser\scr\zelt_talk.script");
Game.Msg(this.CanHandleEvent("Talk"));
on "LookAt"
{
...
the second one (zelt_talk.script)
#include "scripts\base.inc"
////////////////////////////////////////////////////////////////////////////////
on "Talk"
{
...
}
the CanHandleEvent gives me still false ???
-
You're attaching the script to Game. It should be:
this.AttachScript("blah blah");
-
oh thanks a lot. i think i'm working to long on it...