Comments (4)
Do you have the gdnlib
and gdns
resources set up? Some examples can be found here: https://github.com/godot-rust/gdnative/tree/master/examples/rpc
from gdnative.
Yes I did setup the gdnlib
and gdns
and it still not exposing the Rust functions in GDScript.
[general]
singleton=false
load_once=true
symbol_prefix="godot_"
reloadable=true
[entry]
Windows.64="res://rust/rust.dll"
[dependencies]
Windows.64=[ ]
[gd_resource type="NativeScript" load_steps=2 format=2]
[ext_resource path="res://rust/rust.gdnlib" type="GDNativeLibrary" id=1]
[resource]
resource_name = "Features"
class_name = "Features"
library = ExtResource( 1 )
from gdnative.
The resources seem to be alright, but Godot's handling of globally nameable script classes is known to be a bit temperamental. Try saving the project and re-opening it. If that fails then perhaps you can load the gdns
explicitly in your GDScript.
If you still have any further problems, please provide the entire output (stdout + stderr) of the Godot editor.
from gdnative.
Thanks for the help, I solved it.
Because Command Prompt
or stdout
hint me an error about overflow.
Godot Engine v3.5.1.stable.official.6fed1ffa3 - https://godotengine.org
OpenGL ES 3.0 Renderer: NVIDIA GeForce GTX 1650/PCIe/SSE2
Async. shader compilation: OFF
loaded Features!
thread '<unnamed>' panicked at 'attempt to multiply with overflow', src\lib.rs:17:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ERROR: gdnative-core: method panicked (check stderr for output)
at: <unset> (<unset>:0)
ERROR: Panic message: attempt to multiply with overflow
at: <unset> (C:\Users\Administrator\.cargo\registry\src\github.com-1ecc6299db9ec823\gdnative-core-0.11.3\src\private.rs:199)
Null
At: res://gd/sekai.gd:6:_ready()
Then I fixed the overflow by using wrapping_mul
#[method]
fn arr_gen(&mut self, amount: i32) -> Vec<i32>
{ let mut ret = Vec::new();
for _ in 0..amount
{ self.num = self.num.wrapping_mul(0xd1342543de82ef95);
ret.push((self.num & 0x7fffffff) as i32); }
ret }}
from gdnative.
Related Issues (20)
- Property Hint don't work properly using godot-rust v0.11.2 with Godot 3.5.1 HOT 2
- The draw_rect() "width" argument has no effect when "filled" is "true" warning HOT 4
- "This godot-rust version is only compatible with Godot 3.4.x; detected version 3.5.1-stable (official)." HOT 4
- Debug builds don't work on web HOT 1
- Multi-threading on web HOT 1
- `gdnative-core` reports versions mismatches even with `custom-godot` enabled
- Support custom versions of GDNative headers
- Investigate no_std, improve core / std consistency HOT 6
- Simplify the `InitHandle` API HOT 4
- `Ref::upcast` should not require `SafeAsRaw`
- Outdated GDNative API: `determinant` method in Transform2D is not implemented HOT 1
- Rust Analyzer breaks without "one-class-one-file" feature. Enable "one-class-one-file" by default. HOT 1
- Godot-rust is hard depending on fragile parts of the Godot API and panicking if anything changes. HOT 1
- Vector4i doesn't implement "into Variant" HOT 2
- Outdated links in error message HOT 3
- NixOs Development Environment HOT 1
- `serde_yaml` end of life HOT 1
- GDNativeCallbacks is not unsafe to implement, but the deprecated macros think it is
- Rust's newly added `assert_unsafe_precondition` makes GDNative .dlls that are compiled in debug mode crash on startup HOT 4
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 gdnative.