EBrowser problem.

Talk about Severance Blade of Darkness modifications and maps here. No tips or tech support questions please, use the forum above. Note that the game is rated 18 so some content may be unsuitable for younger readers.

Moderators: prospero, Ade

Post Reply
User avatar
prospero
Ancient Dragon
Posts: 1804
Joined: Wed Nov 21, 2001 1:42 am
Location: United Kingdom

EBrowser problem.

Post by prospero »

Has anyone used the EBrowser on a Windows 10 system?

I just tried starting it on my new PC and I get an error:

Code: Select all

Traceback (innermost last):
  File "..\..\Scripts\EBrowser.py", line 1966, in OBGui
    root = Tkinter.Tk()
  File "..\..\Lib\PythonLib\lib-tk\Tkinter.py", line 886, in __init__
    self.tk = _tkinter.create(screenName, baseName, className)
TclError: Can't find a usable init.tcl in the following directories: 
    {} ./lib/tcl8.0 ./lib/tcl8.0 ./library ./library ./tcl8.0/library ./tcl8.0/library



This probably means that Tcl wasn't installed properly.
Seems a bit mad as it's the same code I've been using for 20 years.

User avatar
Sryml
Dragon
Posts: 206
Joined: Tue Aug 28, 2012 12:50 pm
Location: China
Contact:

Re: EBrowser problem.

Post by Sryml »

Hi pro, :)

I tried to find the answer from the internet and I found this to be caused by the path finding of "tcl". It should be caused by a different system. Adding a path to "sys.path" does not solve it.

I tried to rename "Blade/Lib/PythonLib/Tcl" on the win7 system so that the program could not find it and it went wrong. The message it displays on the console is:

TclError: Can't find a usable init.tcl in the following directories:
../../Lib/PythonLib/TCL/lib/tcl8.0 ./lib/tcl8.0 ./lib/tcl8.0 ./library ./library ./tcl8.0/library ./tcl8.0/library


At this point I observed that it is different from the error message of win10. On win7, the path of tcl is one more than win10 ../../Lib/PythonLib/TCL/lib/tcl8.0. So EBrowser works fine in win7 system.

Win10's tcl path is of the form "./xxx/xxx", which means that tcl can only be stored in the current working directory "os.getcwd()", that is, to make win10 run EB normally, we have to Tcl Copy to each map folder. :roll:

Fortunately, we don't need to do this. There is an environment variable "TCL_LIBRARY" that solves this problem all at once, and it works fine in win7/10.

What we need to do is to extract the entire Tcl folder "Blade/Lib/PythonLib/Tcl" and move it to a place that will not be deleted by mistake. I put it on the C drive and then add the environment variable "TCL_LIBRARY". The value is the root of "init.tcl".

Use the command line directly, for example:

Code: Select all

setx /M TCL_LIBRARY "C:\Tcl\lib\tcl8.0"

Fear can hold you prisoner. Hope can set you free.
My YouTube: https://www.youtube.com/channel/UCg0SHO ... P3FdZLWzpQ

User avatar
prospero
Ancient Dragon
Posts: 1804
Joined: Wed Nov 21, 2001 1:42 am
Location: United Kingdom

Re: EBrowser problem.

Post by prospero »

That's Brilliant!!! :D



Worked first time. I am soooooooooooooo happy. 8)


Thank You So Much.

User avatar
Sryml
Dragon
Posts: 206
Joined: Tue Aug 28, 2012 12:50 pm
Location: China
Contact:

Re: EBrowser problem.

Post by Sryml »

Hi pro,
Recently I found a problem, only one [TCL_LIBRARY] environment variable is allowed in the system. This means that IDLE of python3 cannot coexist with EBrowser of BoD, they will conflict. :roll:

But now I know two solutions:
1. Modify the file ../Scripts/EBrowser.py
root = Tkinter.Tk() is used to create a window
Only need to modify the working directory before it, and then restore to the old working directory after creation

oldcwd = os.getcwd()
os.chdir("../../Lib/PythonLib/Tcl")
root = Tkinter.Tk()
os.chdir(oldcwd)


There are two places to modify, initialize and shortcut key function OBGui

2. Modify the file ../Lib/PythonLib/DLLs/tcl80.dll
Edited in hexadecimal, I forcibly modified the last search path to
../../Lib/PythonLib/Tcl/lib/tcl8.0

Address 0005562D to 00055665, a total of 57 bytes
Replace with
2E2E202E2E204C696220507974686F6E4C69622054636C206C69622074636C247665725D0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A

Image

Now they work very well. :)
Fear can hold you prisoner. Hope can set you free.
My YouTube: https://www.youtube.com/channel/UCg0SHO ... P3FdZLWzpQ

User avatar
cieply
Dragon
Posts: 350
Joined: Wed Jun 26, 2013 3:43 pm

Re: EBrowser problem.

Post by cieply »

You don't need to change global environment to add variable. Every instance of shell has it's own copy of environment and works locally.

All you need to do is to start program from script.
-- bod-tcl.bat --
set TCL_LIBRARY "C:\PATH\TO\Tcl\lib\tcl8.0"

Bin\blade.exe [options]

See also SET - Display, set, or remove CMD environment variables.
l'aria fresca,
vino puro, ...

User avatar
Sryml
Dragon
Posts: 206
Joined: Tue Aug 28, 2012 12:50 pm
Location: China
Contact:

Re: EBrowser problem.

Post by Sryml »

Perfect, I did not expect local environment variables to be valid. :o
It can even use relative paths
set TCL_LIBRARY=..\..\Lib\PythonLib\Tcl\lib\tcl8.0
Start "" Blade.exe -console
Fear can hold you prisoner. Hope can set you free.
My YouTube: https://www.youtube.com/channel/UCg0SHO ... P3FdZLWzpQ

User avatar
cieply
Dragon
Posts: 350
Joined: Wed Jun 26, 2013 3:43 pm

[code]

Post by cieply »

By the way, I think I fixed code formatting in WoWDraenor theme. If you use it and can check that code boxes work now it would be great.
l'aria fresca,
vino puro, ...

Post Reply