Author Topic: Feature idea: "Embedded" scripting  (Read 1545 times)

0 Members and 1 Guest are viewing this topic.

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Feature idea: "Embedded" scripting
Note: this is not a feature request by any means. This is just something I think could be cool.

So, basically, why does scripting have to be confined to scripting.tbl? I think if it was possible to define scripts in ships.tbl or weapons.tbl, it would open up a lot of awesome possibilities.

For ships.tbl, defining scripts for stuff like "when ship turns in direction", "alters thrust", "fires weapon", etc could be the start of a comprehensive replacement for the animation code that is in the engine right now.

For weapons.tbl, being able to define script snippets that are run when a weapon is fired or impacts on a target could be a gateway to more awesome effects, not to mention more varied hit effects than just "target takes damage and gets whacked around a bit".
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Feature idea: "Embedded" scripting
i should note that this _has_ been done with the engine to some degree at some point, but the idea was kinda rolled back because it was thought that a centralized scripting system would be better. i kinda thought it was a pretty cool idea at the time.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

  

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Feature idea: "Embedded" scripting
There is a place for centralized scripting, of course. But I can't see a reason why we can't have both, really.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Feature idea: "Embedded" scripting
you would need both. you need a global place to run generic stuff, stuff like gui code and parsers and whatnot. where scripting really lacks is with specific stuff. take laser guided missiles for example. for it to work with a centralized system (which i have done mind you, and which you will get as soon as i get my svn repo in order), you need to run loops to find and operate the weapons, run a meta system so you can keep track of what that weapon is doing while it exists, you have to do a lot of stuff that the engine already does (so your doing it twice). if its embedded in such a way that every weapon has its own little scripting namespace where you can keep variables and run code for that weapon only, it would GREATLY reduce scripting overhead and would generally make for a smoother integration with the engine..

this would also solve another major problem with scripting, code organization. i keep a folder in my fsroot where i keep a central copy of any commonly used script (parser, ect) and use lua facilities to run the file from any mod dir that requires it. this conflicts with he direction the engine is going (making proper use of user folders). if i could use more decentralized code, then i can say byebye to huge script files.

found a modular table that had used an embedded script
http://pastebin.com/pLZfJh6y
« Last Edit: May 01, 2010, 10:09:53 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN