LUA functions question

Hello, I’m real new to modding on this, but I am putting together a mod and I am using some LUA functions, or trying to.

Most things are working great, I have custom iuse function working.
However, when I use the item, I want it to place a buff on the player for a few seconds.

For example, if I use player:add_effect("dazed", 10) or any other effect I get a: bad argument #1 to ‘add_effect’ (userdata expected, got string)

I checked the class_definitions.lua and it says that the function is exposed. But, am I maybe on a build that doesn’t have it working yet? I am running 0.C-18364-g5a5f641 and the LUA engine seems to see the function. I have tried this both in the mod code and directly from the LUA command line in game.

Am I missing something, or is this not entirely working yet?

Thanks for any info you could offer.

Aha, I figured it out. According to PR 14920, you have to wrap the effect_id in a efftype_id(“string”) to make it work.

Testing a player:add_effect(efftype_id("dazed"),10) gives the correct result now.