-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scripting MVP #255
Scripting MVP #255
Conversation
f64d6ff
to
6907ab8
Compare
OK, this is ready for review! We want to wait for jakobhellermann/bevy_mod_js_scripting#23 before merging, but we should have that done within a day. This PR removes the Additionally, you can add scripts to the game without tying them to an item, just by listing them in the |
I just updated to use the latest master version of It's a big update, though, so I'll wait for @odecay to give at least a casual approval. A quick summary of what's included:
Also, all scripts can be hot reloaded, so I'm literally able to modify the game while it's running, which is quite fun and incredibly useful! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went over the code, I dont understand the ops.rs file. The api for scripting as I understand it seems pretty nice though. I was expecting to see some system that dealt with the events that were being registered like 'ScriptItemThrowEvent. I see they are fired in
fighter_state`, am I missing another system that deals with those events on the rust side or is that all thats needed to run the js/ts?
Maybe I overdid it, but I pushed a commit with a ton of comments to There are a couple things in there, specifically around
That's what the This function will read all the Later, we will also need to add another JS op for getting the throw events ( or maybe we should merge both events into the same struct so that we don't need two different kinds of events? 🤔 ). For anything that the out-of-the-box scripting API doesn't do yet, we can just create our own custom JS ops that can do anything we want, so it's super easy to add new functionality to the scripting interface which is cool. |
64c4370
to
8c7ce8a
Compare
Does the scripting wiki need any updates? And is this still valid?
|
I wrote it as if this was already merged so it's up-to-date as soon as this is merged.
Yeah, the demo script I linked to will exist once this is merged and that is heavily commented, acting somewhat like a tutorial. Now that you mention it, though, I don't like the wording very much. I'll just refer to the demo script as the tutorial. That will also help make sure it stays up-to-date because the game will error when we run it if something is wrong in that file. |
I updated the wiki with your Deno explanations over in Jumpy-land 👌 LGTM? |
Looks great, and good idea, thanks! |
- Add scripts to game meta
000ae6d
to
45100de
Compare
bors merge |
bors retry |
63eee99
to
c686b9c
Compare
Canceled. |
bors retry |
Closes #253.