Comments (5)
I just missed term.grabInput(true);
I live the issue here, in case someone wants to try something similar :)
from terminal-kit.
@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.
@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.
@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.
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)
- terminalkit.TextBox is not a constructor HOT 3
- document: InlineInputField only widthPercent breaks input
- Redraw window every "frame" HOT 1
- Word/Line wrap ERROR when x,y,width or height of TextBox are non integers
- Unable to draw the correct image in vscode dark-mode terminal!
- Can't run after packed with pkg HOT 3
- Cannot input after using term.inputField() HOT 4
- Issue: Terminal stuck in while-loop when initating another terminal with stdin/stdout
- Form control event and validation
- form render issue - hide/show control
- Erase Everything - How? HOT 1
- Possible EventEmitter memory leak
- Multiple Documents in Same Terminal Screen
- support for fonts HOT 1
- term.table does not work in Azure pipeline HOT 6
- term.table does not work in Azure pipeline HOT 1
- Unable to bundle code with dependencies HOT 5
- inputField Inline support? HOT 1
- Documentation request: cannot chain .inputField
- Unable to add left padding to singleLineMenu? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terminal-kit.