LED Question

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: Ade, prospero

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

Re: LED Question

Postby prospero » Sun Apr 08, 2018 8:33 pm

:( btw. The code tags don't seem to be preserving the indents.

Kn1MS
Whelp
Posts: 20
Joined: Sun Apr 08, 2018 6:26 pm

Re: LED Question

Postby Kn1MS » Sun Apr 08, 2018 8:34 pm

***edit. You beat me to it. :D Could be missing import os that is the trouble
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")
So... The problem must be hidden elsewhere. Gonna investigate further.

Geez, that code is totally broken D:

Kn1MS
Whelp
Posts: 20
Joined: Sun Apr 08, 2018 6:26 pm

Re: LED Question

Postby Kn1MS » Sun Apr 08, 2018 8:38 pm

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:
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
Does it mean original BOD lib misses something?

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'

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

Re: LED Question

Postby prospero » Mon Apr 09, 2018 12:13 am

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....

Image

(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.

Kn1MS
Whelp
Posts: 20
Joined: Sun Apr 08, 2018 6:26 pm

Re: LED Question

Postby Kn1MS » Mon Apr 09, 2018 12:26 am

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....

Image
Here's what I have:
Image
btw. What are you using as a code editor?
IDLE 3.6
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.
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

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

Re: LED Question

Postby prospero » Mon Apr 09, 2018 2:03 am

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.......

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

Re: LED Question

Postby prospero » 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. :roll:

User avatar
Tomash
Dragon
Posts: 246
Joined: Sat Oct 25, 2008 11:23 am
Location: Russia
Contact:

Re: LED Question

Postby Tomash » Mon Apr 09, 2018 7:56 am

"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.

User avatar
Tomash
Dragon
Posts: 246
Joined: Sat Oct 25, 2008 11:23 am
Location: Russia
Contact:

Re: LED Question

Postby Tomash » 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")

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

Re: LED Question

Postby prospero » Mon Apr 09, 2018 10:59 am

Thanks Tomash. I was over-thinking that a bit. :lol:

Kn1MS
Whelp
Posts: 20
Joined: Sun Apr 08, 2018 6:26 pm

Re: LED Question

Postby Kn1MS » Mon Apr 09, 2018 2:03 pm

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. :roll:
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. :roll:
I looked into sys_init.py, everything seems to be in place:
Image
Any other map runs smoothly, I don't really understand why there might be something like this.
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")
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. :shock:
Unfortunately, these lines changed nothing... The game somehow refuses to look into Widgets folder, same error here:
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
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 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'
I suppose there shouldn't be something like that... BladeInit script didn't work?
Cfg.py now looks like that: https://puu.sh/zZui6/8fa3bcf889.png

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

Re: LED Question

Postby prospero » Mon Apr 09, 2018 2:17 pm

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

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

Re: LED Question

Postby prospero » Mon Apr 09, 2018 2:22 pm

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. :lol: Otherwise it's not needed.

Kn1MS
Whelp
Posts: 20
Joined: Sun Apr 08, 2018 6:26 pm

Re: LED Question

Postby Kn1MS » Mon Apr 09, 2018 2:30 pm

It works! It's alive!
Image
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.

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

Re: LED Question

Postby prospero » Mon Apr 09, 2018 3:22 pm

:D That's Great! Pleased you got it running. :D

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


Return to “Severance BoD: Modding Community”

Who is online

Users browsing this forum: No registered users and 2 guests

cron