Lua as replacement for BOS/COB
Moderator: Moderators
Re: Projectiles
tbh a full lua solution would be best if only so that oneday when lua animation is possible, we need not bother with cob at all
Re: Projectiles
will be in 0.80AF wrote:tbh a full lua solution would be best if only so that oneday when lua animation is possible, we need not bother with cob at all
Re: Projectiles
aha =) What details or APIs can be expected and how can we expect lua animations to be structured? Will it basically eb a cob/bos clone mish-mashed with a gadget? Or is there room for a different paradigm (not referring to IK)
A design if you will
edit:: and perhaps a thread fork too
A design if you will
edit:: and perhaps a thread fork too
Re: Projectiles
iirc, they already said it will be totally unrelated with the gadget handler - it will not run inside the same Lua instance. It will just be COB written in Lua of BOS.
Re: Projectiles
Don't know who said that but he's wrong.
It will run in LuaRules Lua state. However, it will not use the gadget handler for callIns.
I plan to provide docs at some point, don't feel like typing them out in this post, but in very short I refactored Spring so there's a CUnitScript which can have any implementation.
I created three, CCobInstance, CLuaUnitScript and CNullUnitScript. LuaRules code can then replace a unit's script with a CLuaUnitScript.
(a framework is to be written for this, because with Lua unit scripts, the engine does not manage threads, but the framework should manage them, using coroutines.)
Callouts are very similar to COB although I removed all WTFs I found. (inverted X axis, TA angles (now radians), etc.)
For more either ask specific questions or just wait a bit till I made more documentation.
It will run in LuaRules Lua state. However, it will not use the gadget handler for callIns.
I plan to provide docs at some point, don't feel like typing them out in this post, but in very short I refactored Spring so there's a CUnitScript which can have any implementation.
I created three, CCobInstance, CLuaUnitScript and CNullUnitScript. LuaRules code can then replace a unit's script with a CLuaUnitScript.
(a framework is to be written for this, because with Lua unit scripts, the engine does not manage threads, but the framework should manage them, using coroutines.)
Callouts are very similar to COB although I removed all WTFs I found. (inverted X axis, TA angles (now radians), etc.)
For more either ask specific questions or just wait a bit till I made more documentation.
Re: Lua as replacement for BOS/COB
Split from projectile discussion.
Feel free to ask questions about this new feature, which will be in 0.80 if it's up to me.
Feel free to ask questions about this new feature, which will be in 0.80 if it's up to me.
- thesleepless
- Posts: 417
- Joined: 24 Oct 2007, 04:49
Re: Lua as replacement for BOS/COB
this sounds great, and long overdue for spring.
finally we'll be able to develop units on linux natively =)
looking forward to it.
finally we'll be able to develop units on linux natively =)
looking forward to it.
Re: Lua as replacement for BOS/COB
Cool, Does this mean I can make a Mono implementation for C# ?I plan to provide docs at some point, don't feel like typing them out in this post, but in very short I refactored Spring so there's a CUnitScript which can have any implementation.
Re: Lua as replacement for BOS/COB
iirc, Mono is really hard to sandbox. So if you did, it would be a security issue.Agon wrote:Cool, Does this mean I can make a Mono implementation for C# ?I plan to provide docs at some point, don't feel like typing them out in this post, but in very short I refactored Spring so there's a CUnitScript which can have any implementation.
Re: Lua as replacement for BOS/COB
I would highly doubt the use of mono for unit scripting.
I meant it should be easier now to plug in entirely new ways to animate units. (e.g. skeletal animation, inverse kinematics)
I meant it should be easier now to plug in entirely new ways to animate units. (e.g. skeletal animation, inverse kinematics)
Re: Lua as replacement for BOS/COB
If someone wants to make it, what's the point of blocking?I would highly doubt the use of mono for unit scripting.
BTW, Unity is using mono commercially as its primary scripting platform, so some people find it good enough...
Re: Lua as replacement for BOS/COB
I wouldn't block it but IMO it's a total waste of time.jcnossen wrote:If someone wants to make it, what's the point of blocking?I would highly doubt the use of mono for unit scripting.
BTW, Unity is using mono commercially as its primary scripting platform, so some people find it good enough...
Just consider, all LuaRules/LuaGaia code can _not_ be written in mono, and then you start making unit animation scripts in mono? It's the wrong tool for the wrong job...
If anything I'd first make it possible to write AIs in mono (or did we have that already?)
When that has stabilized one could redo LuaUI, LuaRules and LuaGaia in mono (boring pointless work but I won't block it), and only then it makes sense to do unit animations in mono too.
(But IMO time is far better spent actually making better ways to animate units then manually typed move and turn commands in yet another language.)
Re: Lua as replacement for BOS/COB
+ 1But IMO time is far better spent actually making better ways to animate units then manually typed move and turn commands in yet another language.
- bobthedinosaur
- Blood & Steel Developer
- Posts: 2702
- Joined: 25 Aug 2004, 13:31
Re: Lua as replacement for BOS/COB
Are there any lua text editors that can run a bug check since there is no compiling? Im just imagining the transition to be hard from working with scriptor for so long.
- thesleepless
- Posts: 417
- Joined: 24 Oct 2007, 04:49
Re: Lua as replacement for BOS/COB
just run it through the lua commandline interpreter and it'll tell you whether there are any syntatical errorsbobthedinosaur wrote:Are there any lua text editors that can run a bug check since there is no compiling? Im just imagining the transition to be hard from working with scriptor for so long.
Re: Lua as replacement for BOS/COB
This is merged in master now.
Framework and documentation still needs to be written so it can not easily be used currently, but it gives nice opportunity to see if it happens to break COB or other things as side effect.
For the brave/curious people, in this file there is a big comment that could be considered prototype documentation
Framework and documentation still needs to be written so it can not easily be used currently, but it gives nice opportunity to see if it happens to break COB or other things as side effect.
For the brave/curious people, in this file there is a big comment that could be considered prototype documentation

Re: Lua as replacement for BOS/COB
Why number axes?
Re: Lua as replacement for BOS/COB
You can define some vars like x_axis=1, y_axis=2, z_axis=3 and use those instead. Everything being numbers is good, now it's possible to loop through them for ex. (though I don't know why one would want to do this).
A sample tank script (so it's not very complex) using this new system would be good, I'm still not sure how exactly I should do wait-for-turn with it based on those comments.
A sample tank script (so it's not very complex) using this new system would be good, I'm still not sure how exactly I should do wait-for-turn with it based on those comments.