margoh
{{ user.title }}
- Joined
- Apr 1, 2013
- Messages
- 806
- Solutions
- 18
- Reaction score
- 350
Hello,
I'm trying to get to work 'my' opcode, but it seems not working.
I have added in my module this:
But I get error in terminal:
In init() and terminate() functions I have added to register and unregister code.
Also I have question: How should function in the extendedopcode.lua look like, not for this, but some basic (server side)?
I'm using latest source of TFS 1.1 and OTC 0.6.6
Hope someone can give me some tips.
Thanks in advance, margoh
I'm trying to get to work 'my' opcode, but it seems not working.
I have added in my module this:
Code:
function onVocationChange(player, opcode, buffer)
local msg = InputMessage.create()
msg:setBuffer(buffer)
local player = g_game.getLocalPlayer()
if not player then return end
local vocName = msg:getData()
player:setVocation(vocations[vocName][1])
profileWindow:recursiveGetChildById('portraitPanel'):setImageSource(vocations[vocName][2])
end
Code:
ERROR: Unable to send extended opcode 1, extended opcodes are not enabled
ERROR: protected lua call failed: LUA ERROR:
/game_profile/profile.lua:193: attempt to index field '?' (a nil value)
stack traceback:
[C]: ?
/game_profile/profile.lua:193: in function </game_profile/profile.lua:188>
In init() and terminate() functions I have added to register and unregister code.
Also I have question: How should function in the extendedopcode.lua look like, not for this, but some basic (server side)?
I'm using latest source of TFS 1.1 and OTC 0.6.6
Hope someone can give me some tips.
Thanks in advance, margoh