1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Interface Console Concept

Discussion in 'Programming (In-game)' started by ScriptyNoob, Jan 10, 2015.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. ScriptyNoob

    ScriptyNoob Apprentice Engineer

    Messages:
    133
    Hi everyone, I have an idea, how to stop hell debugging and improve usability :thumb:

    [​IMG]

    [​IMG]
    [​IMG]

    Code:
    // Console concept
    void Main(IMyProgrammableBlock refProgrammableBlock, string command) // or another method pass commands
    {    
        switch (command)
        {
            case "BeaconName":
                var beacon = GridTerminalSystem.GetBlockWithName("Hello World");
                refProgrammableBlock.WriteConsole("Name is: " + beacon.CustomName); // WriteConsole pseudocode
            return;
            case "ThisComputerName":
                refProgrammableBlock.WriteConsole("This comp name: " + refProgrammableBlock.CustomName);
            return;
            default: break;
        }
    }
    
    //-----------------
    //WriteConsole realization in IMyProgrammableBlock
    public void WriteConsole(string text)
    {
        if(PlayerLocalAccess) {
            // do something
        }else{
            return; // do nothing, because remote command
        }
    }
    //------------------
    //Block comunication
    //Player access console in block A
    void Main(IMyProgrammableBlock refProgrammableBlock, string command) // or another method pass commands
    {
        if(command.Equals('checkB'))
        {
            var blockB = GridTerminalSystem.GetBlockWithName("B");
            var response = blockB.SendCommand('how are u?');
            refProgrammableBlock.WriteConsole("Block B response: " + response);
        }
    }
    // Block B
    string Main(IMyProgrammableBlock refProgrammableBlock, string command) // or another method pass & return commands
    {
        if(command.Equals('how are u?')){
            return "I'm ok";
        }
        
        return "bad command";
    }
    
    What do you think about this?
     
  2. a2457

    a2457 Senior Engineer

    Messages:
    1,366
    THIS is IT!

    This is what is needed exactly.
    nothing less, nothing more.

    Want it :) +1
     
  3. tiberiusjojo

    tiberiusjojo Trainee Engineer

    Messages:
    27
    Agreed, it would be a lot easier to debug if I had instant access to what variables were rather then having to rewrite the code every time to change an antenna or beacon just to get one value.

    Looks fantastic.
     
  4. Digi

    Digi Senior Engineer

    Messages:
    2,393
    Yes, totally this!

    Additionally if you press *use* on the programmable block it will show you the console directly.
     
  5. TheBarret

    TheBarret Trainee Engineer

    Messages:
    17
    This would be usefull indeed, did you already made a prototype of it running?

    also gives you the option to run seperate functions and routines instead of pressing buttons.


    Want +1
     
  6. Malware

    Malware Master Engineer

    Messages:
    9,867
    Yes please! (although I wish we could get it rendered to the model texture for improved immersion) Including Digi's *use* suggestion.

    I have never liked the distinction between *use* and *console*.
     
  7. uronacid

    uronacid Trainee Engineer

    Messages:
    7
    Console would be sweet for debugging. Please.
     
Thread Status:
This last post in this thread was made more than 31 days old.