I encountered an issue while using Rive


The image above is the code I wrote

在我运行过程中他出现了错误


I wrote it according to the official document, but it still doesn’t work

Hi!

What versions are you using of extension-rive, and Defold?
I just verified with the latest rive extensino 4.0.0 and Defold 1.10.1 and all the examples in the test app works.

Can you provide a repro case project?
Also what platform are you on?

(Also, please don’t post text in images as then it’s hard to search for, and also harder to read)

Okay, I’m sorry I used this method. I will pay attention later. My debold version is 1.10.0 and the Rive plugin version is 3.10.0

This is the entire content of my main.script

local riveModel = “#rivemodel
– Get input focus then start the splash statemachine.
function init(self)

msg.post(".", "acquire_input_focus") 

– – Set the boolean value “Trigger 1” to true
– go.set(“#SPLASH1”, “NewGameOn”, true)

– – Set the numeric value “Number 1” to 0.8
– go.set(“#SPLASH1”, “NewGameOn”, 0.8)
– rive.play_state_machine(“#SPLASH1”, “NewGameOn”, nil, rive_event_handler)
– rive.play_state_machine(“#SPLASH1”, “Quit”)

-- Start the State Machine named "State Machine 1"
-- rive.play_state_machine(riveModel, "State Machine 1")

– print(“rive:”,rive)

– rive.play_anim(“#rivemodel”, “Run”, go.PLAYBACK_ONCE_FORWARD, options, function(self, message_id, message, sender)
– run()
– end)


– rive.play_state_machine(riveModel, “Run”, {}, function ()
– print(123)
– end)

– – Set the boolean value “Trigger 1” to true
– go.set(“#rivemodel”, “Trigger 1”, true)

– – Set the numeric value “Number 1” to 0.8
– go.set(“#rivemodel”, “Number 1”, 0.8)

– – Read the input value of the current State Machine
– local v = rive.get_state_machine_input(“#rivemodel”, “Number 1”)

– – Set the input value of the current State Machine
– rive.set_state_machine_input(“#rivemodel”, “Number 1”, 0.5)

– – Set the input value of a nested artboard
– rive.set_state_machine_input(“#rivemodel”, “Number 1”, 0.5, “My_Nested_Artboard”)

– – Same as the example above, to go even deeper, separate the scopers with slashes!
– rive.set_state_machine_input(“#rivemodel”, “Number 1”, 0.5, “My_Nested_Artboard/My_Inner_Nested_Artboard”)
end

You can put code inside three backticks ` like so:

my code

I already saw what you posted, but do you have an actual project you can share here?

I tried using the official debold first GitHub - defold/sample-rive-game: Sample project showing how to use Rive animations in Defold The project cannot be started in my environment, and I want to try copying some code and writing it according to the official documentation, but it still cannot be started. Can you take a look at how the official project starts? If it can be started, I can refer to this project. Thank you

1 Like

Thanks.
I have now updated the sample project to work with Defold 1.10.1 and extension-rive 4.0.0.
Please update the sample project and try again.

3 Likes

okay, thank you

1 Like

I upgraded to the corresponding version according to your method, but it still doesn’t work

INFO:DLIB: Log server started on port 64756
INFO:ENGINE: Target listening with name: MSI - 172.16.31.111 - Windows
INFO:ENGINE: Engine service started on port 64757
INFO:GRAPHICS: Installed graphics device 'ADAPTER_FAMILY_OPENGL'
INFO:ENGINE: Defold Engine 1.10.1 (d8e6e73)
INFO:DLIB: Initialized Remotery (ws://127.0.0.1:17815/rmt)
INFO:ENGINE: Loading data from: build/default
INFO:RIVEEXT: Registered Rive extension

INFO:SOUND: Mix format:
INFO:SOUND:   wFormatTag:       fffe  IEEE_FLOAT/PCM/EXTENSIBLE: 3 / 1 / fffe
INFO:SOUND:   nChannels:        2
INFO:SOUND:   nSamplesPerSec:   48000
INFO:SOUND:   nAvgBytesPerSec:  384000
INFO:SOUND:   nBlockAlign:      8
INFO:SOUND:   wBitsPerSample:   32
INFO:SOUND:   -> Format:        3  IEEE_FLOAT/PCM/EXTENSIBLE: 3 / 1 / fffe
INFO:SOUND:   DSP backend: SSE
INFO:SOUND: Sound
INFO:SOUND:   nSamplesPerSec:   48000
INFO:ENGINE: Initialised sound device 'default'
INFO:RIVEEXT: ==== GL GPU: NVIDIA GeForce RTX 4070 Laptop GPU/PCIe/SSE2 ====

OpenGL 3.3 not supported. Minimum supported version is 4.2.
INFO:RIVEEXT: Display Factor: 1.5
Assertion failed: rive_factory, file upload/defold-rive/src/res_rive_data.cpp, line 91
INFO:CRASH: Successfully wrote Crashdump to file: C:\Users\xunye\AppData\Roaming\Defold/_crash
ERROR:CRASH: CALL STACK:

ERROR:CRASH:  0 0x7FF76AC954E0 dmCrash::GenerateCallstack D:\a\defold\defold\engine\crash\src\backtrace_win32.cpp:144
ERROR:CRASH:  1 0x7FF76B0AD51C raise /tmp/job15263141667900980900/minkernel/crts/ucrt/src/appcrt/misc/signal.cpp:547
ERROR:CRASH:  2 0x7FF76B09CCF4 abort /tmp/job15263141667900980900/minkernel/crts/ucrt/src/appcrt/startup/abort.cpp:71
ERROR:CRASH:  3 0x7FF76B09BC1C common_assert_to_stderr<wchar_t> /tmp/job15263141667900980900/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:186
ERROR:CRASH:  4 0x7FF76B09B734 _wassert /tmp/job15263141667900980900/minkernel/crts/ucrt/src/appcrt/startup/assert.cpp:443
ERROR:CRASH:  5 0x7FF76AA319C0 dmRive::ResourceType_RiveData_Create /tmp/job15263141667900980900/upload/defold-rive/src/res_rive_data.cpp:93
ERROR:CRASH:  6 0x7FF76ACC9CC0 dmResource::DoCreateResource D:\a\defold\defold\engine\resource\src\resource.cpp:803
ERROR:CRASH:  7 0x7FF76ACCA4A0 dmResource::CreateAndLoadResource D:\a\defold\defold\engine\resource\src\resource.cpp:953
ERROR:CRASH:  8 0x7FF76ACC4440 dmResource::Get D:\a\defold\defold\engine\resource\src\resource.cpp:1038
ERROR:CRASH:  9 0x7FF76AA31300 dmRive::ResourceTypeCreate /tmp/job15263141667900980900/upload/defold-rive/src/res_rive_scene.cpp:85
ERROR:CRASH: 10 0x7FF76ACC9CC0 dmResource::DoCreateResource D:\a\defold\defold\engine\resource\src\resource.cpp:803
ERROR:CRASH: 11 0x7FF76ACCA4A0 dmResource::CreateAndLoadResource D:\a\defold\defold\engine\resource\src\resource.cpp:953
ERROR:CRASH: 12 0x7FF76ACC4440 dmResource::Get D:\a\defold\defold\engine\resource\src\resource.cpp:1038
ERROR:CRASH: 13 0x7FF76AA31650 dmRive::ResourceType_RiveModel_Create /tmp/job15263141667900980900/upload/defold-rive/src/res_rive_model.cpp:69
ERROR:CRASH: 14 0x7FF76ACC9CC0 dmResource::DoCreateResource D:\a\defold\defold\engine\resource\src\resource.cpp:803
ERROR:CRASH: 15 0x7FF76ACCA4A0 dmResource::CreateAndLoadResource D:\a\defold\defold\engine\resource\src\resource.cpp:953
ERROR:CRASH: 16 0x7FF76ACC4440 dmResource::Get D:\a\defold\defold\engine\resource\src\resource.cpp:1038
ERROR:CRASH: 17 0x7FF76AC42500 dmGameObject::AcquireResources D:\a\defold\defold\engine\gameobject\src\gameobject\res_gameobject.cpp:66
ERROR:CRASH: 18 0x7FF76AC429C0 dmGameObject::ResGameObjectCreate D:\a\defold\defold\engine\gameobject\src\gameobject\res_gameobject.cpp:166
ERROR:CRASH: 19 0x7FF76ACC9CC0 dmResource::DoCreateResource D:\a\defold\defold\engine\resource\src\resource.cpp:803
ERROR:CRASH: 20 0x7FF76ACCA4A0 dmResource::CreateAndLoadResource D:\a\defold\defold\engine\resource\src\resource.cpp:953
ERROR:CRASH: 21 0x7FF76ACC4440 dmResource::Get D:\a\defold\defold\engine\resource\src\resource.cpp:1038
ERROR:CRASH: 22 0x7FF76AE09F40 dmGameSystem::ResFactoryCreate D:\a\defold\defold\engine\gamesys\src\gamesys\resources\res_factory.cpp:83
ERROR:CRASH: 23 0x7FF76ACC9CC0 dmResource::DoCreateResource D:\a\defold\defold\engine\resource\src\resource.cpp:803
ERROR:CRASH: 24 0x7FF76ACCA4A0 dmResource::CreateAndLoadResource D:\a\defold\defold\engine\resource\src\resource.cpp:953
ERROR:CRASH: 25 0x7FF76ACC4440 dmResource::Get D:\a\defold\defold\engine\resource\src\resource.cpp:1038
ERROR:CRASH: 26 0x7FF76AC42500 dmGameObject::AcquireResources D:\a\defold\defold\engine\gameobject\src\gameobject\res_gameobject.cpp:66
ERROR:CRASH: 27 0x7FF76AC429C0 dmGameObject::ResGameObjectCreate D:\a\defold\defold\engine\gameobject\src\gameobject\res_gameobject.cpp:166
ERROR:CRASH: 28 0x7FF76ACC9CC0 dmResource::DoCreateResource D:\a\defold\defold\engine\resource\src\resource.cpp:803
ERROR:CRASH: 29 0x7FF76ACCA4A0 dmResource::CreateAndLoadResource D:\a\defold\defold\engine\resource\src\resource.cpp:953
ERROR:CRASH: 30 0x7FF76ACC4440 dmResource::Get D:\a\defold\defold\engine\resource\src\resource.cpp:1038
ERROR:CRASH: 31 0x7FF76AC42FC0 dmGameObject::AcquireResources D:\a\defold\defold\engine\gameobject\src\gameobject\res_collection.cpp:62
ERROR:CRASH: 32 0x7FF76AC43960 dmGameObject::ResCollectionCreate D:\a\defold\defold\engine\gameobject\src\gameobject\res_collection.cpp:262
ERROR:CRASH: 33 0x7FF76ACC9CC0 dmResource::DoCreateResource D:\a\defold\defold\engine\resource\src\resource.cpp:803
ERROR:CRASH: 34 0x7FF76ACCA4A0 dmResource::CreateAndLoadResource D:\a\defold\defold\engine\resource\src\resource.cpp:953
ERROR:CRASH: 35 0x7FF76ACC4440 dmResource::Get D:\a\defold\defold\engine\resource\src\resource.cpp:1038
ERROR:CRASH: 36 0x7FF76AD7CFD0 dmEngine::Init D:\a\defold\defold\engine\engine\src\engine.cpp:1549
ERROR:CRASH: 37 0x7FF76AD7BCE0 dmEngineCreate D:\a\defold\defold\engine\engine\src\engine.cpp:2419
ERROR:CRASH: 38 0x7FF76AD82830 dmEngine::RunLoop D:\a\defold\defold\engine\engine\src\engine_loop.cpp:68
ERROR:CRASH: 39 0x7FF76AC7F010 engine_main D:\a\defold\defold\engine\engine\src\engine_main.cpp:152
ERROR:CRASH: 40 0x7FF76B051BE4 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
ERROR:CRASH: 41 0x7FFF54A6E8C0 BaseThreadInitThunk <unknown>:0
ERROR:CRASH: 42 0x7FFF56A914D0 RtlUserThreadStart <unknown>:0
ERROR:CRASH: 

You need to change the minimum OpenGL version in the project settings

3 Likes

I’m truly grateful. I’ve configured my version, and it’s now operating smoothly. Thanks a million!

1 Like

I was going to ask if we have this documented somewhere and checked the Rive extension page, and indeed we do! :+1:

It is also logged in the output.

1 Like