XML Script Parser in AS3

Started by
11 comments, last by Selacius 10 years, 3 months ago

The currentStatus integer is what you use to track the status within the game (it's a value you'll maintain). I assumed that you were using status codes to track progress within the game (the qstset node). I imagined that you're keeping this status value somewhere and you need to compare it to what's in the XML data. In other words, I made a big fat assumption about what status is used for.

That being said, the status parameter for all the methods isn't used right now -- I included it so that you could pass it (if you had it) to the processNPCNode method which passes it it on to the handler methods. Each of those includes the value of the related status value from the current XML node so that, if you use this info somehow, you can use it somehow :)

Otherwise, it should be safe to remove or default to some value.

Advertisement

So I have been trying your code but seem to have an issue with the automated portion. It's working, however I am having issues with it processing too much. Take the first portion of the NPCAction code from above. It should display the text and then wait for a user input before moving onto the qstchk nodes. However, with the for statement, it's processing it all at once.
Not sure how to resolve this for the purposes I am looking for.

I've resolved the issue I was having. I replaced the for statement with a while statement which looks to ensure a pause variable is false. The pause variable is triggered to true when the text or choices command is triggered. It is working exceptionally well, I am slowly implementing more commands. I will post the full script when complete. Thanks again for the help.

This topic is closed to new replies.

Advertisement