CoOp:Anything
Search any game and see how much of it you can play with friends: every co-op mod, its stage, quality and community rating.
编译Rust源码到原神千星奇域节点图。Compile Rust code to Genshin-Impact Miliastra-Wonderland Node Graph.
Translation pending
GamesGitHub @mzverseOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Repository information has not been collected yet.
No updates detected yet. GitHub releases will appear here.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗非官方的 rustc codegen 后端:把目标 crate 的 Rust 代码编译成原神千星奇域的节点图资产文件 .gia。
目前仅支持服务器节点图。
📖 完整文档:https://mzverse.github.io/rust2genshin/
[!NOTE] 本文档正在迁往文档站。下面残留的章节(兼容性、关于节点图等)会逐步移走,迁移期间以文档站为准。
#[event_listener]
pub fn on_tab_selected(event: TabSelectedEvent) {
log(event.guid); // 打印Guid
event.entity.delete(); // 删除本实体
}
#[unsafe(no_mangle)] // 导出此函数为复合节点
pub fn solve(a: f32, b: f32, c: f32) -> f32 {
(- b + delta(a, b, c).sqrt()) / (2. * a)
}
fn delta(a: f32, b: f32, c: f32) -> f32 {
b * b - 4. * a * c
}
需要 rustup、cargo 和 protoc。nightly 工具链由 rust-toolchain.toml 钉死,rustup 首次运行时会连同三个组件一起装好。
git clone https://github.com/mzverse/rust2genshin
cd rust2genshin
cargo run -p build-demo --bin beyond-server
产物是 target/genshin-unknown-beyond-server/release/rust2genshin_demo.gia。
节点图写在 demo/src/lib.rs(demo 只是示例目标 crate)。改包名、换成自己的 crate 等步骤见上手。
写法细节(导出、事件、内置事件清单)见文档站:
i8/i16、#[repr(u32)]、递归调用、dyn节点图的语义(数据流、循环、控制流、变量修改事件)是「为什么代码会编译成这样」的那一层,已迁入架构栏: