Wintermute Engine Forum
Wintermute Engine => Bug reports => Not a bug => Topic started by: cremen on May 06, 2008, 08:15:40 PM
-
Is it right behavior?
for WME_DEMO
at OldGuy.script i added code:
on "LeftClick"
{
GoToObject();
if( this.HasItem("Book") ){
this.DropItem("Book");
Game.TakeItem("Book");
};
}
on "Book"
{
GoToObject();
Game.Interactive = false;
Game.DropItem("Book");
this.TakeItem("Book");
Game.Interactive = true;
}
and then i give this guy book (Lovely WME Tutorial, i think) and after go to street, and go back... his inventory empty... is it right? (hey, OldGay, give back my book!!!)
P.S. sorry for my pure English.
-
Old guy in WME demo is only loaded in a single scene. When you leave the scene, the entity is destroyed and reloaded later when you revisit the scene.
-
i.e. at other hand, i must using actor and not entity for it?
-
no. in other words you have to make the entity global and not attached to Scene.
-
ok. thanks. i'll try it.
-
ok i do it. it's work. but i found a little bug (?)
i created global variable:
global Inventories; // at base.inc
// at scene_init.script
if( Inventories["ENT_Box"] == null ){
Inventories["ENT_Box"] = Game.CreateEntity("ENT_Box");
}
// at region
if( Inventories["ENT_Box"].HasItem("Some_Item") ){ // <- this code did't compile, syntax error... BUT!
// do some, but..
}
// at region
var ent = Inventories["ENT_Box"];
if( ent.HasItem("Some_Item") ){ // <- this code compiled, and work...
// do some,
}
i think it is'nt but, but i must...
-
It's not a bug, it's a known limitation of the current script compiler.