
LED Question
Re: LED Question

Re: LED Question
My config file looks like this at the moment:
Code: Select all
import os
import MemPersistence
# Cleaning paks to prevent skating
try:
os.remove("../../Maps/FirstMap/pak/BODPak.dat")
os.remove("../../Maps/FirstMap/pak/pf.pak")
print"Pak removed"
except:
print"Pak NOT removed"
pass
# Loadscreen
LoadBar.ECTSProgressBar(333,"BladeProgress.jpg")
# Cleaning character data
try:
Bladex.DeleteStringValue("MainChar")
props=MemPersistence.Get("MainChar")
props[2]["Objects"] = []
props[2]["Weapons"] = []
props[2]["Shields"] = []
props[2]["Quivers"] = []
props[2]["Keys"] = []
props[2]["SpecialKeys"] = []
props[2]["Tablets"] = []
props[2]["InvLeft"] = None
props[2]["InvLeft2"] = None
props[2]["InvRight"] = None
props[2]["InvLeftBack"] = None
props[2]["InvRightBack"] = None
except:
pass
execfile("DefFuncs.py")
Geez, that code is totally broken D:
Re: LED Question
Oh, it seems that the problem resolved itself... somehow... Anyway, I got a new error with loadbar, but I think I can handle this one.
Now there's something interesting:
We-e-e-ell, I moved those widgets from ..\\LIB\\Widgets to LIB folder, then tried to run the map. And I've got a new error, geez...
Now there's something interesting:
Does it mean original BOD lib misses something?Traceback (innermost last):
File "Cfg.py", line 36, in ?
execfile("DefFuncs.py")
File "DefFuncs.py", line 1, in ?
import GameText
File "..\..\Lib\GameText.py", line 4, in ?
import Scorer
File "..\..\Lib\Scorer.py", line 4, in ?
import ScorerWidgets
ImportError: No module named ScorerWidgets
We-e-e-ell, I moved those widgets from ..\\LIB\\Widgets to LIB folder, then tried to run the map. And I've got a new error, geez...
Traceback (innermost last):
File "Cfg.py", line 36, in ?
execfile("DefFuncs.py")
File "DefFuncs.py", line 1, in ?
import GameText
File "..\..\Lib\GameText.py", line 4, in ?
import Scorer
File "..\..\Lib\Scorer.py", line 213, in ?
wObjectsFrame=ScorerWidgets.B_ObjectsFrame(wFrame,"ObjectsFrame",125,65,char)
File "../../Lib/Widgets\ScorerWidgets.py", line 493, in __init__
self.SetChar(char)
File "../../Lib/Widgets\ScorerWidgets.py", line 614, in SetChar
self.inv=char.GetInventory()
AttributeError: 'None' object has no attribute 'GetInventory'
Re: LED Question
It is probably something very simple but the problem is I can't spot an error because the code
posted is not formatted as code. I don't know why the code tags don't work.
Here's a picture anyway....

(ignore the yellow highlight)
btw. What are you using as a code editor?
What ever you do DON'T move source files around. And don't edit them apart from enabling the
Debug in Reference.py. It's easy to forget what you have done and you will screw the whole game up.
posted is not formatted as code. I don't know why the code tags don't work.
Here's a picture anyway....

(ignore the yellow highlight)
btw. What are you using as a code editor?
What ever you do DON'T move source files around. And don't edit them apart from enabling the
Debug in Reference.py. It's easy to forget what you have done and you will screw the whole game up.
Re: LED Question
Here's what I have:

IDLE 3.6
Alright, I'll put everything back. I'm pretty sure none of those widgets could overwrite something.
So, I got that ScorerWidget back to its Widget folder and once again there's that "no module" error. D:
Pak NOT removed
Traceback (innermost last):
File "Cfg.py", line 36, in ?
execfile("DefFuncs.py")
File "DefFuncs.py", line 1, in ?
import GameText
File "..\..\Lib\GameText.py", line 4, in ?
import Scorer
File "..\..\Lib\Scorer.py", line 4, in ?
import ScorerWidgets
ImportError: No module named ScorerWidgets
Re: LED Question
Strange. It seems like the Lib/Widgets folder is somehow out of scope.
There is somewhere in the load routine where all the filepaths are defined. I'll have look.......
There is somewhere in the load routine where all the filepaths are defined. I'll have look.......
Re: LED Question
Only one explanation I can see. There isn't a file in Lib/Widgets named ScorerWidgets.py
Check to see there is/isn't one.
The filepaths are defined in Scripts/sys_init.py
the line is: sys.path.append("../../Lib/Widgets")
But there is no reason I can think of why this has been missed as the file must have been executed
or none of the folder would be visible to the interpreter.
Check to see there is/isn't one.
The filepaths are defined in Scripts/sys_init.py
the line is: sys.path.append("../../Lib/Widgets")
But there is no reason I can think of why this has been missed as the file must have been executed
or none of the folder would be visible to the interpreter.

Re: LED Question
"No module named" message appears not only in case of actually lack of module but also if module contains an error which breaks the import process.
Re: LED Question
Your cfg.py lack the line
execfile("../../Scripts/BladeInit.py")
So the file pj.py is not exed -> the object "Player1" is not created -> Library module ScorerWidgets fails to get access to such object -> proccess is broken.
also your cfg.py lack lines
execfile("../../Scripts/sys_init.py")
Bladex.ReadLevel("name of your lvl file")
execfile("../../Scripts/BladeInit.py")
So the file pj.py is not exed -> the object "Player1" is not created -> Library module ScorerWidgets fails to get access to such object -> proccess is broken.
also your cfg.py lack lines
execfile("../../Scripts/sys_init.py")
Bladex.ReadLevel("name of your lvl file")
Re: LED Question
Thanks Tomash. I was over-thinking that a bit. 

Re: LED Question
ScoreWidgets.py is in Widgets folder, I checked it. In fact, I tried to move those files to LIB folder, but then you suggested to put them back to prevent game from breaking.prospero wrote: ↑Mon Apr 09, 2018 2:18 am Only one explanation I can see. There isn't a file in Lib/Widgets named ScorerWidgets.py
Check to see there is/isn't one.
The filepaths are defined in Scripts/sys_init.py
the line is: sys.path.append("../../Lib/Widgets")
But there is no reason I can think of why this has been missed as the file must have been executed
or none of the folder would be visible to the interpreter.![]()

I looked into sys_init.py, everything seems to be in place:

Any other map runs smoothly, I don't really understand why there might be something like this.
Thanks a lot! Added these lines to cfg, this moment doesn't seem to be obvious at all. I wonder how you guys could figure this out.Tomash wrote: ↑Mon Apr 09, 2018 8:11 am Your cfg.py lack the line
execfile("../../Scripts/BladeInit.py")
So the file pj.py is not exed -> the object "Player1" is not created -> Library module ScorerWidgets fails to get access to such object -> proccess is broken.
also your cfg.py lack lines
execfile("../../Scripts/sys_init.py")
Bladex.ReadLevel("name of your lvl file")

Unfortunately, these lines changed nothing... The game somehow refuses to look into Widgets folder, same error here:
So I tried to put those ScoreWidgets and ExtraWidgets scripts to LIB folder and then launched the map. Now I get this:Pak NOT removed
Traceback (innermost last):
File "Cfg.py", line 36, in ?
execfile("DefFuncs.py")
File "DefFuncs.py", line 1, in ?
import GameText
File "..\..\Lib\GameText.py", line 4, in ?
import Scorer
File "..\..\Lib\Scorer.py", line 4, in ?
import ScorerWidgets
ImportError: No module named ScorerWidgets
I suppose there shouldn't be something like that... BladeInit script didn't work?Pak NOT removed
Traceback (innermost last):
File "Cfg.py", line 36, in ?
execfile("DefFuncs.py")
File "DefFuncs.py", line 1, in ?
import GameText
File "..\..\Lib\GameText.py", line 4, in ?
import Scorer
File "..\..\Lib\Scorer.py", line 213, in ?
wObjectsFrame=ScorerWidgets.B_ObjectsFrame(wFrame,"ObjectsFrame",125,65,char)
File "../../Lib/Widgets\ScorerWidgets.py", line 493, in __init__
self.SetChar(char)
File "../../Lib/Widgets\ScorerWidgets.py", line 614, in SetChar
self.inv=char.GetInventory()
AttributeError: 'None' object has no attribute 'GetInventory'
Cfg.py now looks like that: https://puu.sh/zZui6/8fa3bcf889.png
Re: LED Question
Where have you added the code? The sequence is important.
You should have:
execfile("..\\..\\Scripts\sys_init.py")
Bladex.ReadLevel("MyMapLevel.lvl")
execfile("..\\..\\Scripts\BladeInit.py")
.... before
execfile("DefFuncs.py")
.......... and all the other files you have made
You should have:
execfile("..\\..\\Scripts\sys_init.py")
Bladex.ReadLevel("MyMapLevel.lvl")
execfile("..\\..\\Scripts\BladeInit.py")
.... before
execfile("DefFuncs.py")
.......... and all the other files you have made
Re: LED Question
btw.... All that Player reset code is not really essential. It's just that if you are playing
a main game level and exit and load a custom map, you will get the Player from the main
game instead of the one intended in the custom map.
Otherwise it's not needed.
a main game level and exit and load a custom map, you will get the Player from the main
game instead of the one intended in the custom map.

Re: LED Question
It works! It's alive!

Thank you! I would've never fixed all these things if not for you, guys! It seems like BoD modding community is at its decline, but it's good to know that there are some old school pros who still keep the knowledge of mapping.

Thank you! I would've never fixed all these things if not for you, guys! It seems like BoD modding community is at its decline, but it's good to know that there are some old school pros who still keep the knowledge of mapping.
Re: LED Question


You may depend that whatever foul-ups you get, I've probably had them before.
