Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Strange Entity behaviour - respawning Entity?!  (Read 3319 times)

0 Members and 1 Guest are viewing this topic.

IvanErtlov

  • Supporter
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Strange Entity behaviour - respawning Entity?!
« on: November 12, 2007, 03:57:25 PM »

Hi all, working through our testers reports I found another very strange issue:

We have Entities representing Items, such as an empty bucket called "eimerstand" that becomes an Item "Eimerleer" when picked up. In the scene, where the bucket stands, it`s linked to the item and everything works fine.
Code: [Select]
on "Take"
{
actor.GoToObject(this);
Game.TakeItem("Eimerleer");
}

Works great. I pick up the item, it dissapears in the scene, and the Item "Eimerleer" is in my inventory.
I can change to other scenes, come back, everything is fine - the empty bucket is still gone.

But now it becomes VERY strange:
When I destroy the bucket "Eimerleer" in my inventory, through creating another item out of it (filling it with wheat), the empty bucket in the scene respawns after I change the scene and return. Here`s the script located in the script of the wheat:

Code: [Select]
on "Eimerleer"
{
  actor.GoTo(450,675);
  actor.TurnTo(DI_UP);
  Game.DeleteItem("Eimerleer");
  actor.Talk("Perfekt!");
  Game.TakeItem("Eimergetreide");
 
}

I also tried

Code: [Select]
on "Eimerleer"
{
  actor.GoTo(450,675);
  actor.TurnTo(DI_UP);
  Game.DeleteItem("Eimerleer");
  actor.Talk("Perfekt!");
  Game.TakeItem("Eimergetreide");
 Game.DeleteEntity("Eimerstand");
 
}

During reading the boards, I´ve learnt that "DeleteItem" and "DeleteEntity" removes them permanently from the game. But whatever I do, the Entity always respawns in the original location after the destruction of the item representing it. (No matter if I drop or delete it)

Do I have some logical error inside I did not get?


« Last Edit: November 12, 2007, 03:59:47 PM by IvanErtlov »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Strange Entity behaviour - respawning Entity?!
« Reply #1 on: November 12, 2007, 04:05:35 PM »

Well, if a scene entity is linked to an inventory item and you delete the item, the entity should NOT re-appear. The code seems to me to be ok. But maybe I'm missing something...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

IvanErtlov

  • Supporter
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Re: Strange Entity behaviour - respawning Entity?!
« Reply #2 on: November 12, 2007, 04:20:19 PM »

It`s really strange.

I have the same thing with apples, picked from the ground and later destroyed to make apple slices. As long as I have the apples in my inventory, they do not respawn. When I destroy them in front of the respawn location, they do not respawn before I haven`t visited another scene. Same code used as with the bucket....

Edit:

With another object, where exactely the same coding approach was used, it works perfectly.
« Last Edit: November 12, 2007, 04:23:17 PM by IvanErtlov »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Strange Entity behaviour - respawning Entity?!
« Reply #3 on: November 12, 2007, 04:29:30 PM »

Aren't you explicitly showing the entity somewhere in your code? (setting its .Active property to true)
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

IvanErtlov

  • Supporter
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Re: Strange Entity behaviour - respawning Entity?!
« Reply #4 on: November 12, 2007, 05:07:25 PM »

No, but I already found a solution - "Remember Node State" is obviously deactivated by default. If activated, my scripts work fine.
« Last Edit: November 12, 2007, 06:00:31 PM by IvanErtlov »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Strange Entity behaviour - respawning Entity?!
« Reply #5 on: November 13, 2007, 10:31:51 AM »

Hmm, it should work either way, though...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.044 seconds with 21 queries.