lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm using Lua for game scripting. I'd like to have the script call a command, pause execution until it is finished, then resume at the next statement.

For example for an NPC:
PickupWeapon()
EquipWeapon()
MoveTo(40,40)
GuardLocation()

Obviously I don't want it equipping a weapon before it has picked it up.
From studying the documentation I think coroutines and threads are what
I should be looking into, but I wanted to ask before I head done a possibly wrong approach.

Thanks.

-Jack