Sign in to follow this  
trevaaar

How do I do this?

Recommended Posts

I'm working on a small old-school SNES-style RPG in C#, probably using Lua for scripting (since I already know Lua). What I want to be able to do is write something like
engine.show_message('this is a message')
and not have the function return until the user has dismissed the message. I'm using LuaInterface for my C#-to-Lua binding.

Share this post


Link to post
Share on other sites
The co-routine merely 'remembers your place' in the Lua code (in this example, the end of the show_message function) while you're back executing the C# code. Then when you need to continue with the script, the C# engine resumes the coroutine, which continues, presumably leaving show_message and calling the next function.

Check out this thread which might give you some ideas.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this