Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: IvanErtlov 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.
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:
on "Eimerleer"
{
actor.GoTo(450,675);
actor.TurnTo(DI_UP);
Game.DeleteItem("Eimerleer");
actor.Talk("Perfekt!");
Game.TakeItem("Eimergetreide");
}
I also tried
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?
-
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...
-
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.
-
Aren't you explicitly showing the entity somewhere in your code? (setting its .Active property to true)
-
No, but I already found a solution - "Remember Node State" is obviously deactivated by default. If activated, my scripts work fine.
-
Hmm, it should work either way, though...