Jump to content
  • Advertisement
Sign in to follow this  

Strange Python Syntax Error

This topic is 2835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been rewriting my code to use an already existing scripting language as opposed to extending the one I already had and I'm about to give it a run for the first time but I'm facing a strange issue.

The script interpreter is throwing an exception complaining about character mismatch which doesn't really make sense. Here is the exact error line as returned to me by the JVM:

Exception in thread "main" SyntaxError: ("mismatched character 's' expecting '='", ('<iostream>', 44, 49, '\t\t\tif (GlobalStatesAndVariables.keys[index] and !self.mProcessedKeys[index]):\n'))

and here is the allegedly offending code:

def ProcessKeys(self):
for i in range(MotionModule.NUM_OF_IDS):
if self.keyMappings == GlobalStatesAndVariables.NULL:

index = self.keyMappings
if (GlobalStatesAndVariables.keys[index] and !self.mProcessedKeys[index]): # the error points between 'n' and 'd' of the first index variable
self.mEntity.mMotionModule.SetMotion(i, true)
self.mProcessedKeys[index] = true
elif (!GlobalStatesAndVariables.keys[index] and self.mProcessedKeys[index]):
self.mEntity.mMotionModule.SetMotion(i, false)
self.mProcessedKeys[index] = false

I can't put my finger on what the interpreter is complaining about. Any ideas?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!