Giter Club home page Giter Club logo

Comments (2)

rdeioris avatar rdeioris commented on July 23, 2024

@iUltimateLP you can use coroutines. Start by wrapping (you have various ways) the sequence of moves in a coroutine:

local robot = {}

function robot.actions()
  -- get the currently running coroutine
  coro = coroutine.running()
  print('actions!')
  -- pass the 'coro' to the blueprint to allow resuming later
  robot_up(coro)
  print('first step done')
  -- this yield will suspend the coroutine, it will be resumed by the previous blueprint
  coroutine.yield()

  -- and again...
  robot_up(coro)
  print('second step done')
  coroutine.yield()

  -- and again...
  robot_up(coro)
  print('end of coroutine')
end

return robot

the robot_up function is a blueprint event (note how it calls the resume over the passed coroutine):

immagine

you can directly spawn coroutine from blueprint/c++ (otherwise just use lua):

immagine

from luamachine.

iUltimateLP avatar iUltimateLP commented on July 23, 2024

Great, thanks for your detailed answer!

from luamachine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.