• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Learning some from building character list. Could someone help me?

darkshin

New old member
Joined
Dec 14, 2010
Messages
231
Reaction score
21
Hello everybody !!
I'm having fun learning some and coding with this client.
By changing some aspects and making it more personal, I've been betting some challenges (At least for my self)

So: I've readed this topic: https://otland.net/threads/this-new-character-list.227564/
That's all about copying a character list from an pokeServer.
Then I've tried to build up a character list like the one in the post, and after it I want to upgrade it to one of my own, but... I've tried understanding more about the code, and when I tried to add more contents to the character list: i.e character's ingame outfit "last used". I've realized that seems to be already a functions in characterlist.lua in this passage from Create funct:

local focusLabel
for i,characterInfo in ipairs(characters) do
local widget = g_ui.createWidget('CharacterWidget', characterList)
for key,value in pairs(characterInfo) do
local subWidget = widget:getChildById(key)
if subWidget then
if key == 'outfit' then -- it's an exception
subWidget:setOutfit(value) (it goes on)


So, I tried to change this value, and no results at all, tried to add new functions based on the code at game_outfits/outfit.lua, and also no results at all.

I've started to think that somehow in character list, they are able to retrieve information from server's character data and reproduce in text form. But, in outfit.lua they simply get the information while connected to the server and use g_game functions to access the outfit's information.

Could you guys help me to understand more about it?
I think that here lies to key for me to proceed on coding and having fun :)

Update:
It crossed my mind that I just can't get gain acess ingame data without making a sucessful connection to it.
The passage below in characterlist.lua shows that it retrieves informations stored in last-used-xxx (color green)

g_game.loginWorld(G.account, G.password, charInfo.worldName, charInfo.worldHost, charInfo.worldPort, charInfo.characterName)

loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to game server...'))
connect(loadBox, { onCancel = function()
loadBox = nil
g_game.cancelLogin()
CharacterList.show()
end })

-- save last used character
g_settings.set('last-used-character', charInfo.characterName)
g_settings.set('last-used-world', charInfo.worldName)

But, once Again, I wonder, where are the variables inside g_game.loginWorld ? I can't find any file named 'charInfo' or functions inside client sources. So far, I can't be sure if I can just add a randomly charInfo.whatever into the code.

Correct and enlighten me, if im wrong, please.
 
Last edited:
Back
Top