• 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!

Excluding ambient light bar and one doing the OTC client itself?

FilipeJF

New Member
Joined
Jan 9, 2012
Messages
124
Reaction score
4
Well, I discover the OTC yesterday and today I start using it. He is so good, and perfect to my kind of Tibia Server. In my server I want to bring the old RPG to Tibia, and i need to delete the ambient light. In fact, the ambient light I've deleted, but the bar still in there, in the graphics menu. But she don't works more, and it's so good.

And now, i wanna know: Can I make OTclient my own server? Client proper? I mean, I compile it and come up with my IP into it, without the need to put the IP in the rod below where we put the password. Well, I want to make a Own Client like in the normal Tibia Client.

Sorry for the bad, very bad, english.
 
Yes it is possible. However, simply changing the LUA-Functions or configuration can easily be changed by the players again.
If you want to be sure noone besides you can change the ambient light, you can modify the sources for that.

Goto: \src\client\mapview.h

And take a look for this

Code:
 float getMinimumAmbientLight() {
return m_minimumAmbientLight;
}

Now change it to any value you would like. For example you could always set the ambient light to 0:

Code:
 float getMinimumAmbientLight() {
return 0;
}

Make sure you change the following as well:
\src\client\mapview.cpp

Change
Code:
ambientLight.intensity = std::max<int>(m_minimumAmbientLight*255, ambientLight.intensity);

to
Code:
//ambientLight.intensity = std::max<int>(m_minimumAmbientLight*255, ambientLight.intensity);

Own module for changing the Login screen:

Code:
Module
  name: phiadariasoft_login
  description: PhiadariaSoft Gameserver Login
  author: Lord Hepipud
  website: http://www.phiadariasoft.com
  version: 0.1

  autoload: true
  autoload-priority: 1000

  dependencies:
    -client_entergame

  @onLoad: |
    EnterGame.setUniqueServer("phiadaria.servegame.com", 7171, 772)

Simply create a new folder at \mods\ and inside create a file your_module.otmod (you can name it like you want).
After that copy the content from above inside the file and change the part EnterGame.setUniqueServer("phiadaria.servegame.com", 7171, 772) to the data you would like.

First paramter is the IP-Adress, second the port and third the Client Protocol - done.
Now save the file and start the Client. If the Login-Window didn't change, try to check your terminal with CTRL + T and also the loaded modules. If the module is not yet loaded -> do so and restart the client.

~~~~Lord Hepipud~~~~
 
Last edited:
Thank you Lord Hepipud, removing ambient light is one of the most sought after features with the OT client, I am sure this will help many people.
 
I don't understand. The "client" Is of my otserver or OTclient? Because into my server source I don't have it and at OTclient I don't found it. Sorry for the simple doubts, but I really didn't understand.
 
With "Client" I meant the OT Client directly. You will have to download the latest source, to the modifications directly there and compile it for yourself.

~~~~Lord Hepipud~~~~
 
I downloaded the OTclient 0.6.4, but I don't have the sources, I think. In this site, https://github.com/edubart/otclient, It's possible to download the src folder?

Edit:
pf... I found the download o_O
It's on the right side of the pag. Well, I will test it soon and I will come back to say if this works or not. Thanks.
 
Well, this works fine! Thank you (a friend tested it for me).
I have a question: how can I "hide" the folders mod, mods and modules after compiling otclient? Oh, I never compiled it, so I didn't know if this is an automatic process. But it's a doubt.
 
You are welcome.
Actually you can't hide those folders. The OTClient is actively using them to build the UI and perform different actions like updating skill data, level, wisdom...

The only way to get rid of the folders would be to implement all LUA-Code directly into the Clients core - which is hell of work.

~~~~Lord Hepipus~~~~
 
Thanks for the answer.
Now I think about it and, if these folders can not be hidden, it's pointless I hide that part of the IP interface; because the players can see the IP and, consequently, use it in another client to put ambient light in 100%.
 
Thanks for the answer.
Now I think about it and, if these folders can not be hidden, it's pointless I hide that part of the IP interface; because the players can see the IP and, consequently, use it in another client to put ambient light in 100%.
No, they can't. OTClient uses the 'modules' and 'data' folder, and you edited your ambient light setting in the src folder (otc sources) and compiled it. Now your ambient light setting is inside your OTClient.exe file, and nobody can change it without sources. When you release the client, you don't need to release 'src' folder, therefore people can't access the sources - you just need to leave the 'data' and 'modules' folders.

However it's true that they can edit the IP in modules folder, but there is no point in doing that, and the majority of regular players don't even know how to do that, so you're good.
 
Well in that case you could modify the login packets of the Client to send one additional packet which only your server can handle. In that case you could prevent players from using a different OTClient for your server.
I have done similar things with for Phiadaria. You will need the Client I compiled in order to play the Game - otherwise it wont work.

~~~~Lord Hepipud~~~~
 
But how can I could modify the login packets? I want to do that, because it's the unique and viable solution, I think, to correct that.
 
You could for example Hardcode the ProtocolVersion / ClientVersion into the sources. Now while trying to login, you check for your custom ClientVersion and if it does not fit -> break login.
Also you could set additional packets which you server will have to read away in order to make the login work,

~~~~Lord Hepipud~~~~
 
In teory, I understand it. But how, in practice, I can do this?
It's a very interesting question, but I don't understand about this things very well.
 
Hey, about light, i do what lord hepipud said, but i still can use the light bar to put in on 100%
 
For Visual Studio users:

mapview.cpp:
Replace:
Code:
ambientLight.intensity = std::max<int>(m_minimumAmbientLight*255, ambientLight.intensity);

to:
Code:
 #if !defined(NOLIGHT)
   ambientLight.intensity = std::max<int>(m_minimumAmbientLight*255, ambientLight.intensity);
#endif

Replace:
Code:
void MapView::setDrawLights(bool enable)
{
if(enable == m_drawLights)
return;
if(enable)
m_lightView = LightViewPtr(new LightView);
else
m_lightView = nullptr;
m_drawLights = enable;
}

to:
Code:
void MapView::setDrawLights(bool enable)
{
    if (enable == m_drawLights){
        return;
    }

#if defined(NOLIGHT)
    if (enable){
        m_lightView = LightViewPtr(new LightView);
        m_drawLights = enable;
    }
#else
    if (enable)
        m_lightView = LightViewPtr(new LightView);
    else
        m_lightView = nullptr;

    m_drawLights = enable;
#endif
}

Properties to project-->C/C++-->Preprocessor definitions add NOLIGHT

Enjoy.
 

Similar threads

Back
Top