Lua code on blocks for functions...

    Joined
    Jul 3, 2013
    Messages
    103
    Reaction score
    0
    • Community Content - Bronze 1
    • Legacy Citizen 2
    • Legacy Citizen
    • Purchased!
    I think it would be a good idea to have lua code be with blocks too so we can make light switches to turn off a section of lights, that is to include light switches and buttons etc. also a good thing with CES's suggestion post about signs we could have something like minecraft's computer craft where it is like a monitor displaying text so the lua will display text input into the monitor. Also we could do the same with doors, turning turrets on and off, undocking a ship or turret, and activating other things...
     

    Ithirahad

    Arana'Aethi
    Joined
    Nov 14, 2013
    Messages
    4,150
    Reaction score
    1,330
    • Purchased!
    • Top Forum Contributor
    • Legacy Citizen 8
    I support this, but there should be an easier, more non-computer-nerd-friendly way to link together different toggle blocks...
     

    CES

    Joined
    Jan 24, 2014
    Messages
    109
    Reaction score
    0
    It could work the way we link blocks now, such as linking computers to AMCs.
     
    Joined
    Jul 3, 2013
    Messages
    103
    Reaction score
    0
    • Community Content - Bronze 1
    • Legacy Citizen 2
    • Legacy Citizen
    • Purchased!
    Ya but this way we have ways to make gates... but I guess that would work with the gates too...
     
    Joined
    Jul 10, 2013
    Messages
    61
    Reaction score
    25
    • Community Content - Bronze 2
    • Purchased!
    • Legacy Citizen 8
    First the LUA script upport hould be refined, allowing to do more without causing weird stuff to happen.

    Once the scripting features are finalized, then schema could try to create a flow graph UI for those without programming knownledge.

    Of course, everything is subject to change, so we might never know if at some point schema might see LUA support as more of an issue to the game\'s development, and thus decide to remove it. (Of course this is just a personal thought)
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    X3-Reunion did it (I made a thread here: http://star-made.org/content/computer-blocks-which-support-custom-code-pre-selected-functions )



    Basically it had \"input fields\" for variables inside text (comments).

    You use an editor to fill these fields. On save, the text(-id) and fields are mapped to \"returnValue = functionX, variable1, variable2\" and executed by a parser (imagine java-bytecode and some functions in C++)



    It is newbe-friendly, because everything is not hirachically sorted but also has no programming stuff (except variables).

    I am not too much against LUA, but it has it\'s downsides - here are three examples:

    • Indexing starts with 1 (personally don\'t like, because it is different from everything else - Java, C++, PHP, JavaScript, ...)
    • \"text\"..\" concatenation\"..\" multiple\"..\" times\" cause the system to update the hash=string table 4 times - in runtime. That is especially bad with automatically generated names.
    • Return values can have anything - from boolean to integer, etc. Someone changes his code and you notice it first if you use your function for a ship with the name \"_WITH_UNDERSCORES_\" - your stuff crashes while it worked x days before with the older version.
     
    Joined
    Jun 24, 2013
    Messages
    18
    Reaction score
    0
    I like complicated nerdy things! It makes me feel as though I have to work harder.

    (is this just me being nerdy?)