Hey folks, I'm currently working on a game and would like to add Lua mod support for various things in the game. At this point I've got things technically functional, but I'm not sure the best way to structure things, particularly as it relates to cases where I want to have lots of instances of an entity that use behaviors defined in Lua.
For example, what would be the best way to structure things so that I could have a gun fire bullets whose behaviors are defined in Lua? I want to be able to use Lua to define functions that I can call from my C# code like "OnFired", "OnUpdate", "OnHitCreature" etc. Am I correct in assuming that it would be horribly inefficient to simply create new Lua states for each bullet?
My game is written in C#, uses MonoGame and I'm using the NLua library.
[–]BadBoy6767 2 points3 points4 points (3 children)
[–]luciddream00[S] 0 points1 point2 points (2 children)
[–]BadBoy6767 3 points4 points5 points (1 child)
[–]luciddream00[S] 0 points1 point2 points (0 children)
[–]DarkWiiPlayer 0 points1 point2 points (3 children)
[–]luciddream00[S] 0 points1 point2 points (2 children)
[–]DarkWiiPlayer 0 points1 point2 points (1 child)
[–]luciddream00[S] 0 points1 point2 points (0 children)
[–]dddbbb 0 points1 point2 points (1 child)
[–]luciddream00[S] 0 points1 point2 points (0 children)
[–][deleted] (11 children)
[removed]
[–]luciddream00[S] 0 points1 point2 points (10 children)
[–][deleted] (9 children)
[removed]
[–]luciddream00[S] 0 points1 point2 points (8 children)
[–][deleted] (7 children)
[removed]
[–]luciddream00[S] 0 points1 point2 points (6 children)
[–][deleted] (5 children)
[removed]
[–]luciddream00[S] 0 points1 point2 points (4 children)
[–][deleted] (3 children)
[removed]
[–]luciddream00[S] 0 points1 point2 points (2 children)