Re: Converting Python Scripts to meet PEP-8 (and bugs)
Posted: Sat Aug 10, 2013 12:24 pm
And the winner is:
plate = resp.value[0].getSceneObject().getResponderState()
This is in tldnSlavePrisonDoors.py in the IEvalPlateAndPaddles section. Testing revealed that this is returning values that do not match the "supposedly" corresponding values for the pressure plates in the AgeSDL. The SDL values might be correct but this routine returns erroneous values that give a mismatch between the plates and paddles.
I'm not sure how to proceed at this point. I don't know how to figure out which sceneobject is which or know why Cyan wrote the routine this way. It could probably be rewritten to just use the AgeSDL (brute force method.. ugly, but it works).
The only other thing is purely cosmetic... getting the plates the SDL says are depressed to appear depressed.
EDIT: replacing this statement with one to use just the SDL variables seems to work... I can now open and close the gate using the levers. I need to test more to see if anything else breaks because of the change.
fix: plate = ageSDL[padSDLToplateSDL[PadSDL]][0]
Note: this fixes the paddles but does not handle you stepping on a plate that is supposed to be already depressed. This breaks the game. Stepping on a plate that is not already depressed causes the inner doors to close but stepping off makes them open again. Now I know why they tried to use responder states.
plate = resp.value[0].getSceneObject().getResponderState()
This is in tldnSlavePrisonDoors.py in the IEvalPlateAndPaddles section. Testing revealed that this is returning values that do not match the "supposedly" corresponding values for the pressure plates in the AgeSDL. The SDL values might be correct but this routine returns erroneous values that give a mismatch between the plates and paddles.
I'm not sure how to proceed at this point. I don't know how to figure out which sceneobject is which or know why Cyan wrote the routine this way. It could probably be rewritten to just use the AgeSDL (brute force method.. ugly, but it works).
The only other thing is purely cosmetic... getting the plates the SDL says are depressed to appear depressed.
EDIT: replacing this statement with one to use just the SDL variables seems to work... I can now open and close the gate using the levers. I need to test more to see if anything else breaks because of the change.
fix: plate = ageSDL[padSDLToplateSDL[PadSDL]][0]
Note: this fixes the paddles but does not handle you stepping on a plate that is supposed to be already depressed. This breaks the game. Stepping on a plate that is not already depressed causes the inner doors to close but stepping off makes them open again. Now I know why they tried to use responder states.