Learning the code

v3n0m2212

New Member
so im away a lot of things go on behind the Scenes. lol. There is a lot i still do not understand. i have been using a win/loss counter for months now. now, out of the blue, it will not work. this is the obs message i get:


[Gulag_or_Glory_Win_Counter.lua] Failed to call hotkey_pressed for hotkey_pressed: [string "B:/OBS Stuff/Counters/Gulag or Glory/Gulag_or..."]:418: attempt to call field 'obs_scene_sceneitem_from_source' (a nil value)

can anyone explain to me what is going on here? please and thank you kindly
 
The function was in libobs/obs-scene.c. Build history shows that the function was marked as deprecated on September 27, 2024, and removed by commit d283181 https://github.com/obsproject/obs-studio/commit/d283181c837a020913c58db8b4c509fa391974dd on August 20, 2025.

The commit comment for the deprecation (4dd3cf6) says
obs_scene_sceneitem_from_source is problematic because there can be multiple items of the same source in a scene, which the function doesn't account for. In such a case, it would return the first item it finds, which often might not be what a developer expects. It was originally added for the undo/redo-operation of "Add New Source" where the UI guarantees that the item is unique, but for a general case it's not suitable.

So I'm afraid your script will need to be updated.
 

v3n0m2212

New Member
Top