Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8305439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:06:59+00:00 2026-06-08T18:06:59+00:00

Background I am currently creating an XNA application that utilizes LuaInterface so that I

  • 0

Background

I am currently creating an XNA application that utilizes LuaInterface so that I can control the application with Lua scripts.


What I Want

I’ve noticed that a lot of things will probably be ‘time’ based in my development. Such things may include showing information and then removing it after x amount of seconds, end a game in defeat if it takes x amount of seconds, or even used in easing a camera a certain distance every x seconds. I wanted to implement the wait function in Lua as opposed to my application, but at this point, I’m open to input (because I can’t seem to get it to work).


What I’ve Tried So Far

inv.lua

 _G.Wait=(function(t)
    local dest=Time.ElapsedMilliseconds+t*1000
    while Time.ElapsedMilliseconds<dest do
        gel:UIUpdate()
    end
    return true
 end)

 --Aliases
 _G.wait=Wait

gELua.vb

Public Sub UIUpdate()
    Application.DoEvents()
    Game.Tick()
End Sub

(Where Game is My XNA Game Object)


So Why Doesn’t My Idea Work?

The current problem is that, even though I’m calling Game.Tick() every time to keep everything going, the XNA part of my application stops receiving input.


So, my question is, is there a better way to do this? I thought it was working pretty well until I encountered the problem with user input. Have any of you implemented something like this that worked well?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:07:00+00:00Added an answer on June 8, 2026 at 6:07 pm

    What you want is for your game loop to continue running – but not call “Update” (that’s inside a lua script) for an object. If each of your objects are different scripts, then this is fairly simple. A “Wait(time)” method will only tell your game engine that “this” object doesn’t want to be updated for time milliseconds. The engine will note that down and continue calling Update and Render for all the other scripts (objects).

    The next time it comes around to Update/Render the “waiting” object, it will skip the “Update” call and call only Render instead. When the timeout expires – you can resume calling Update on the object. If possible – you could resume execution of the Update method from the next line you suspended it from. This would make writing the script simple, like a C# “async” method.

    Of course – this depends heavily on how your scripts interact with the rest of your engine. If the described solution does not work for you, I would request you to describe how your scripts interact with the engine in greater detail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background Currently, I am working on a Rails application. I have different products that
Background I am creating a Source List for my application and I want it
Background : I'm currently, for my University, creating some simple apps showcasing the possible
Background : I'm currently writing a greasemonkey script that embeds/modifies a specific page's html.
I am currently working on creating an application similar to the Contacts app on
I'm currently teaching myself python (coming from no programming background, but a lot of
I'm working on creating an HTML form that has an image in the background.
As a training exercise, I am creating a counter that runs in a background
A little background first as to why I need this. I am currently creating
I am currently creating an application which signals readiness to other devices using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.