Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Error after Game.DeleteEntity()  (Read 3488 times)

0 Members and 1 Guest are viewing this topic.

robot

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 38
    • View Profile
Error after Game.DeleteEntity()
« 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!
Logged

Andrej (Blue Arc)

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 73
    • View Profile
Re: Error after Game.DeleteEntity()
« Reply #1 on: October 10, 2010, 04:54:09 PM »

Are you sure you are using Scene.getNode("obj"); instead of right syntax Scene.GetNode("obj")?
Logged

robot

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 38
    • View Profile
Re: Error after Game.DeleteEntity()
« Reply #2 on: October 11, 2010, 06:40:21 PM »

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...
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Error after Game.DeleteEntity()
« Reply #3 on: October 12, 2010, 12:04:51 AM »

is the script attached to the entity, you're deleting?
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

robot

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 38
    • View Profile
Re: Error after Game.DeleteEntity()
« Reply #4 on: October 14, 2010, 07:29:52 PM »

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:

Code: [Select]
var t = Scene.GetNode("obj");
t.Active=false;
Game.DeleteEntity(t);

Scene.GetNode("region1");

it crashes in the last line...
Logged
 

Page created in 0.017 seconds with 20 queries.