I have crossed upon yet another problem. I have created an item that, on use, leads to the spawning of a teleporter at exactly the point where the party is standing.
Not always, but sometimes, the game crashes on me. This is my code for teleporter creation:
Code: Select all
spawn("teleporter", party.level, party.x, party.y, 0, "returnTeleporter")
returnTeleporter:setTriggeredByMonster(false)
returnTeleporter:setTriggeredByItem(false)
returnTeleporter:setTeleportTarget(15,15,0,1)
When testing I found out that when spawning the teleporter at a different location (everywhere but where the party is standing) and the party goes through everything works smoothely.
So I suspect that the fact that I first spawn the teleporter and then define where it is teleporting to sometimes leads to the teleporter porting the party to a not yet specified location and that crashes the game.
So, my Question: Is there a way to "set up" the teleporter (or any other object) first and then spawn it?