Suggestions for porting old sequential BASIC code?

BlitzMax Forums/BlitzMax Beginners Area/Suggestions for porting old sequential BASIC code?

The real problem continues to be how to nest the sequential logic into an event loop. I continue to try variants and so far haven't had success.

That's because you've moved on from hard-coding logic to thinking about something that's more like an engine from which you can make your content distinct, which is a significant leap.

I made progress on something in a similar vein (a multiple choice adventure thingy) and it worked by using TMap entries as function pointers, each function being a 'location' that was allowed to use a set of sub-functions as a sort of scripting language. (Scripting within BlitzMax source files is obviously not ideal as having to compile scripts defeats part of the object of using them but it was more expedient than writing a LUA interface). BUT ANYWAY, for something like that the game-loop basically goes...

While...
>Run the script for the current location.
>(The location script says 'show this text and present these options').
>Check if the user picked an option and if so alter the current location.
...Wend

...which is very simple because the system was essentially a retarded form of hypertext, but hopefully it gives you a sense of how to start separating the engine from the content. The first step is really to plan out and identify everything that needs to be supported by the engine (much as it is tempting to just dive in and code) because once you know that you're in a much better position to decide how the content should be stored and processed.