Code Monkey home page Code Monkey logo

Comments (5)

pistacchio avatar pistacchio commented on August 20, 2024

I just missed term.grabInput(true);
I live the issue here, in case someone wants to try something similar :)

from terminal-kit.

cronvel avatar cronvel commented on August 20, 2024

@pistacchio Fine, tell me if you manage to build some great tools ;)

Off topic: I have looked at Dedalus, I'm curious to see if there is some game somewhere using that engine?

I have started a similar project few month ago: Spellcast.
It is a more generalist scripting language with a completely different approach, that can do CYOA, Visual Novel, text-based RPG, or anything needing a scenario engine.

from terminal-kit.

pistacchio avatar pistacchio commented on August 20, 2024

@cronvel Hi! There have been some works in the last few IFComp written in Dedalus. I haven't maintained it any further (still I think it has some potential), but I worked on another system, Steller. I haven't documented it yet, but this is the way you write a story: https://github.com/pistacchio/steller.js/blob/master/example/story.js

I'm quite satisfied with the result, it is fully tested and stable and, I think, powerful. While working in it, I found it quite annoying to write all the structure in JSON. I started working on a new file format that could give the power of ES6 objects (Javascript functions, getters, setters and so on) with the simplicity of YAML and called it Jaml. I haven't released it yet, but, since I've found out about it days ago, it really reminds me of KFG, which is amazing and I might as well ditch it all together and use KFG. What is missing, for my purposes, is a tight integration of code within data, just like ES6 objects allow to do.

Since I wanted to use it to write interactive fictions, here is a typical example: every room has a description. I expect it to be a string. It can be something simple like

...
myroom: {
    description: "A large room with red walls",
    ...
}

but maybe it's all black for some reason or the description is dynamic and based on some variables:

...
myroom: {
    get description()  {
        if (story.heroIsBlind) return "It's pitch black";
        return `A large room with red walls. You see ${story.numberOfStatues} statues`;
    },
    ...
}

Getters solve the problem nicely and you can still always ask the room.description.

from terminal-kit.

cronvel avatar cronvel commented on August 20, 2024

@pistacchio Hi! If you are interested, I can do A Cloak of Darkness in Spellcast Scripting, once I got some time for that. It might interest you!

KFG supports tags for the code part. The system using it have to describe them and turn them into actual code.

Spellcast Scripting has defined many many tags, and is a complete programming language dedicated to scenario. I already coded some complex RPG system with that.

Steller looks promising too, a bit more dev-oriented compared to Dedalus. Would like to see that in action! ;)

from terminal-kit.

Rush avatar Rush commented on August 20, 2024

Thanks for the tips in this thread but the example doesn't put the remote telnet terminal in interactive mode, at least not on terminal-kit 2.4.0. Any tips why?

const tkit = require('terminal-kit');
const net  = require('net');

const server = net.createServer(socket => {
    const term = tkit.createTerminal({
        stdin:  socket,
        stdout: socket,
    });

    term.clear();
    term.red('Welcome!');

    term.on('key', key => {
        console.log(key);
    });

    term.grabInput(true);

    // THIS WORKS
    // socket.on('data', data => {
    //     console.log(data);
    // });
});

// Listen on port 8888
server.listen(8888);

I want to build a CLI. Or should I set the terminal to interactive mode myself?

from terminal-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.