• Advertisement
Sign in to follow this  

LUA C# variables

This topic is 4307 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

Hello! i've been using LUA in my C#-project to use simple commands like LoadMap() and LoadState() and up until now i've only modified variables througth functions. the problem is that i want to be able to jump out of a script for a while and into the render-loop, then jump right back into the script where i was. script example: LockEverything(); FadeOut(); //Fading out the screen in like 3 sec LoadMap(); FadeIn(); FadeOut() sets a variable that indicates it's time to draw the fade-effect but to do this i have to (offcourse) run the render-loop for a while. So, what i want to do is to wait for the FadeOut() to finish before I call LoadMap. Which would be the best way to solve this?

Share this post


Link to post
Share on other sites
Advertisement
When Lua calls a function, it waits for the function's return value. Taking that into consideration, you can have the FadeOut function fade the screen within itself and Lua will just wait for it to complete and return a value. If you just put the fading code within a for loop with some System.Threading.Thread.Sleep() calls, you'll beable to get the desired effect you're looking for.

Share this post


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

  • Advertisement