Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: robot on October 10, 2010, 12:04:36 PM
-
hi there ::wave
i have a problem here (maybe it is a bug):
in a script a sprite entity will be deleted with Game.DeleteEntity("entity1");
after that the error occurs at this command: Scene.getNode("obj");
the order of the objects in the sceneEdit is following:
...
entity
entity1
entity2
object
...
it is interesting that the error doesn't occur when i place the "object" before the entities:
...
object
entity
entity1
entity2
...
has it something to do with the z-order?
it is realy confusing!
-
Are you sure you are using Scene.getNode("obj"); instead of right syntax Scene.GetNode("obj")?
-
yes, the syntax is correct.
it seems that i can not call objects that are after the deleted entity.
hmm, when there isn't a solution i think i have to inactivate them and not to delete them...
-
is the script attached to the entity, you're deleting?
-
hi! thanx for your answer.
yes, the script is attached to this entity. but the delete command is the last command in this script...
and the error occurs later in an other script. maybe its a little to much scripts involved there so i made another test
and i can reproduce the error:
i created a new scene with one entity object and a region.
in the scene_init script i added following code:
var t = Scene.GetNode("obj");
t.Active=false;
Game.DeleteEntity(t);
Scene.GetNode("region1");
it crashes in the last line...