Need help with a scene switching script (solved)

Update: I’m trying to make a flexible script for travelling through different scenes. There are 4 rooms (A,B,C,D) and 3 doors. If someone more experienced in Python could look it over, I’d appreciate any suggestions. I can post a more detailed description of how the system is supposed to work if necessary.

http://christopherschons.com/temp/blender/DemoSceneSwapTest.blend

You start out in RoomA, looking at the door to roomB. If you turn round and jump up, you will see the door to room C. Each door has a corresponding empty that sets the position of the player if you enter through it.

I can’t really tell what’s going on there. Cute though. You should be able to figure it out using the print statement. Using an ID, if it’s a number, is a problem because it doesn’t tell you much. Although, if there are hundreds of rooms, you might need to do something like that.

It seems to work fine for me. I see no problem at all with the transition from C to A.

Oops. I meant to write A to C. Here’s the error message I get when I enter room C

Here’s the error message I get when entering room C:

PYTHON SCRIPT ERROR:
Traceback (most recent call last):
File “enterRoom”, line 6, in ?
SystemError: error return without exception set

Here’s the code it’s referencing:


1  import GameLogic as g
2  cont = g.getCurrentController()
3  own = cont.getOwner()
4
5  own.setPosition(g.enterPos)
6  own.setOrientation(g.enterOrt)

g.enterPos and g.enterOrt are globals determined by the last door gone through.

Ah, I noticed the error message but I’ve never seen that error before and have no clue what it might be talking about.

Got it working now. I made it so the setEntrance controls the new position of the player. I updated the file if anyone wants to look at it. I’ll probably make a better looking demo file when I get the chance.