Comments (2)
I hacked now together some basic javascript for this and bound it to C++ via QuickJS. Highly experimental.
With the following "event code" which is valid Javascript
$msg("Javascript!!1");
$showpic("Punkt").id(1).x(0).y(180);
for (let i = 0; i <= 360; ++i) {
$movepic().id(1).x(i / 360 * 320).y(Math.sin(to_rad(i)) * 120 + 120);
$wait(0);
}
Generated event code:
I generate the following event which shows a Sinus curve: (sorry for the flicker)
simplescreenrecorder-2021-02-02_21.29.58.mp4
from editor.
I also had this in my mind.
My idea would be using a Javascript engine that is used as a macro-language to emit event code. The Editor executes it to generate the event commands.
Semantic (reserved variable prefixes):
$
Event code (Appears as event command)_
constant stuff (evaluated during compile time)
Example:
for (let i = 0; i < 3; ++i) {
$V(i, '=', i*2);
}
$C("---");
for (let i = 1; i < 3; ++i) {
$V(i, '+', $V[i]);
$C("+++");
let val = 100;
$V(5, '=', 100 + _db.monsters[2].attack); // OK. DB is Constant expression
$V(5, '=', $game.party.actor[1].level); // OK. Fetches party actor 1 level at runtime
This is evaluated while typing. Functions prefixed with $ appear in event code.
This would emit:
@CtrlVariable(V1 = 0)
@CtrlVariable(V1 = 2)
@CtrlVariable(V1 = 4)
@Comment(---)
@CtrlVariable(V1 + V1)
@CtrlVariable(V2 + V2)
@Comment(+++)
@CtrlVariable(V5 = 140) <- Evaluated at compile time, monster attack in DB was 40
@CtrlVariable(V1 = Actor 1 Level)
Errors:
$V(5, '=', 100 + $game.party.actor[1].level); // Error $game is not constant
let val = $V[3] // Error $V is not a constant
from editor.
Related Issues (20)
- A more flexible textbox HOT 2
- Windows: Automatically collect Qt DLLs when installing HOT 1
- Test compatibility with Qt6 HOT 6
- Suggestion: Add some filters to cmake HOT 7
- Error at building time HOT 2
- Enumerate event editor rows HOT 1
- Feature Request - "Quick Edit" on Event Editor HOT 7
- Suggestions - Modernizing Editor's UI HOT 3
- Make "Action Button" non-exclusive for player event
- Auto-save and revert to a previous backup
- flatpak distribution
- Path to RTP Dialog Covered by Splash at Startup HOT 4
- I got issue while open the project via Qt. HOT 6
- Command to add links outside the game HOT 3
- Evaluate "Glaze" JSON library
- Pathfinder / A* algo HOT 4
- Multiple event selection
- failure to build HOT 2
- Panorams with plain colours applied from the editor itself
- Unable to build with newer versions of libclf HOT 2
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 editor.