Bos <-> Lua interpreter
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Bos <-> Lua interpreter
Is such a thing possible? I'm talking about something that would actively interpret bos into lua unit scripting.
It's already done for FBI to lua, even though that is a much less complicated example.
Is this doable?
It's already done for FBI to lua, even though that is a much less complicated example.
Is this doable?
Last edited by Forboding Angel on 21 Mar 2012, 05:30, edited 1 time in total.
Re: Bos <-> Lau interpreter
Something like that? http://springrts.com/phpbb/viewtopic.php?f=67&t=23391
Re: Bos <-> Lau interpreter
Forb, you... you even commented in that thread.
...What has become of you, Forb? Have the long outback summers and the seraphic concert nights finally taken their toll? Has the Forboding Angel we knew and loved been reduced to a shadow of his former self, a mostly-the-same Forboding Angel who can't even remember an obscure forum thread from two years ago!?
Oh, rue this day!

...What has become of you, Forb? Have the long outback summers and the seraphic concert nights finally taken their toll? Has the Forboding Angel we knew and loved been reduced to a shadow of his former self, a mostly-the-same Forboding Angel who can't even remember an obscure forum thread from two years ago!?
Oh, rue this day!

- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Bos <-> Lua interpreter
I do not want a converter. I am talking of a realtime interpreter (a parser if you will), like what is used in base content to parse FBI files.
http://pastebin.com/T8fEDbJJ
http://pastebin.com/T8fEDbJJ
-
- Moderator
- Posts: 2464
- Joined: 12 Oct 2007, 09:24
Re: Bos <-> Lua interpreter
What does interpreter even mean? Both are already interpreted by the engine.
Re: Bos <-> Lua interpreter
With loadstring you can excecute lua code that is stored as a string.
Not sure if that works for unitscripts.
If yes, you could read in the .bos file, do a lot of search&replace (basically what the converter site does), store in a string and run it.
Or wait, make a gadget that parses the .bos file, follows its instruction line by line and uses Spring.UnitScript.CallAsUnit to animate the unit. (Not sure how callins would work?)
What this would be good for, i do not know.
Not sure if that works for unitscripts.
If yes, you could read in the .bos file, do a lot of search&replace (basically what the converter site does), store in a string and run it.
Or wait, make a gadget that parses the .bos file, follows its instruction line by line and uses Spring.UnitScript.CallAsUnit to animate the unit. (Not sure how callins would work?)
What this would be good for, i do not know.
It actively interprets. Like, with electrolytes!What does interpreter even mean?
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Bos <-> Lua interpreter
Ideally, so that you could use bos or lua and not have to compile either.
Following that notion, you could come up with an active converter to dump a lus script from a bos script.
Following that notion, you could come up with an active converter to dump a lus script from a bos script.
Re: Bos <-> Lua interpreter
I do not want a converter.
an active converter to dump a lus script from a bos script.


you do not need to compile anything if you use lua.so that you could use bos or lua and not have to compile either.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Bos <-> Lua interpreter
The point is, you could just edit bos instead of compiling it. Doesn't seem like too far fetched of an idea.
The end result could be a converter (considering that the end result is bos interpreted to lus, it isn't a big leap), but what I am asking about is an interpreter/parser.
One thing troubles me though. It seems like if this were more or less trivial, it would have already been done.
The end result could be a converter (considering that the end result is bos interpreted to lus, it isn't a big leap), but what I am asking about is an interpreter/parser.
One thing troubles me though. It seems like if this were more or less trivial, it would have already been done.
Re: Bos <-> Lua interpreter
Im not sure I understand the why here. Why is compiling bos such a bad thing? it compiles fast, the compiler is pretty smart and filters out a lot of mistakes that would require launching the game first to check for.
Re: Bos <-> Lua interpreter
why not just use a proper lua unit script?
Re: Bos <-> Lua interpreter
Writing a parser from scratch would seem to me like a hard and long task.
Hopefully there's already someone lese over the great wild internet who already coded some sort of C code parser in Lua, then made it free and open source.
If you'd grab it and were able to understand and modify it, that already would be a good starting point.
You would then have to add the support of a couple bos specific syntax (move, turn, signal, etc...), and tweak it a little.
Then you would have to code how to translate the parser output into Lua unit script.
Since you want a fully automatic tool, unlike CarRepairer bos2lua which outputs a draft requiring manual cleaning, then you'd have to also perform tedious and arduous debugging.
So unless there's a super clever dev getting super bored for weeks, I don't see that happening.
The benefit/work ratio seem stupidly low to me.
Hopefully there's already someone lese over the great wild internet who already coded some sort of C code parser in Lua, then made it free and open source.
If you'd grab it and were able to understand and modify it, that already would be a good starting point.
You would then have to add the support of a couple bos specific syntax (move, turn, signal, etc...), and tweak it a little.
Then you would have to code how to translate the parser output into Lua unit script.
Since you want a fully automatic tool, unlike CarRepairer bos2lua which outputs a draft requiring manual cleaning, then you'd have to also perform tedious and arduous debugging.
So unless there's a super clever dev getting super bored for weeks, I don't see that happening.
The benefit/work ratio seem stupidly low to me.
Re: Bos <-> Lua interpreter
1. Remove all cob support from engine
2. Execute anyone who 'writes bos in lua'
3. See how many people take this post seriously
2. Execute anyone who 'writes bos in lua'
3. See how many people take this post seriously
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Bos <-> Lua interpreter
You guys are aware that I asked this out of curiosity, right?