You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 23, 2024. It is now read-only.
I want to teleport a random enemy to the starting room when I press the bomb button.
Here's my mod:
necrolua.hook("c_Player::p_UseBomb", function(func, self)
print"c_Player::p_UseBomb"print"inside mod 1"localm_GetRandomEnemy=necrolua.get("c_Enemy::m_GetRandomEnemy")
print"inside mod 2"localenemy=m_GetRandomEnemy()
print"inside mod 3"enemy.x=0enemy.y=0print"inside mod 4"func(self)
end)
When I press the bomb button, it crashes:
c_Player::p_UseBomb
inside mod 1
calling nl_symbol("c_Enemy::m_GetRandomEnemy")
[←[33mNecroLuaAPI.dll←[0m][←[32mLua←[0m] nl_luainit.lua:429: nl_get :: cast("__cdecl c_Enemy* (*)()", 20917504)
inside mod 2
inside mod 3
mods\0luatest\lua\init.lua:22: 'struct c_Enemy' has no member named 'x'
stack traceback:
mods\0luatest\lua\init.lua:22: in function <mods\0luatest\lua\init.lua:14>
[C]: in function 'xpcall'
nl_luainit.lua:456: in function <nl_luainit.lua:455>
[←[33mNecroLuaAPI.dll←[0m] nl_payload.c:176: Mod API finalized.
[NecroLua.exe] nl_launcher.c: 58: Done with exit code 0x00000001
I seem to have successfully called GetRandomEnemy from lua, but I don't know what to do now.