Author Topic: BSOD Script Problem  (Read 529 times)

Offline X_TheUnknown_X

  • Posts: 325
  • Cookies: 328
  • (Semi) Retired
BSOD Script Problem
« on: April 29, 2009, 01:50:45 PM »
I'm not sure wether or not this should be posted in the Scripting forum, but, becuase it's a BSOD problem, I'm assuming it deserves to be here.
A while ago I downloaded RealTech and Realistic Torpedoes 1.2, the torpedoes mod didn't work and Glenflet sent me some replacement files that should fix the problem. However, the files aren't beta tested and they are causing BSOD.
I have been going through these files and debugging them, but there is one problem I just can't solve. It is in a few lines of code and I have isolated it to this section:
Code: [Select]
def ImportEffect(Name, InfoTarget): # i.e. scripts/Custom/RealTech/GFX/<Name>.tga
    global dir
    count = 0
    list = nt.listdir(dir)
    list.sort()
    for Effect in list:
        s = string.split(Effect, '.')
        if len(s) <= 1:
                    continue
        extension = s[-1]
        Effectfile = string.join(s[:-1], '.')
        if extension == 'tga' and (dir + Name) == Effectfile:
            Info = __import__("Custom.RealTech.GFX." + InfoTarget + "_info")
            Sx = eval("Info." + str(Effectfile) + "[0]")
            Sy = eval("Info." + str(Effectfile) + "[1]")
            fX = 0.0
            fY = 0.0
            pContainer = App.g_kTextureAnimManager.AddContainer(str(dir + str(Name) + ".tga"))
            pTrack = pContainer.AddTextureTrack(Sx * Sy)

When I get a console report, it tells me:

    s = string.split(Effect, '.')
NameError: string

Can anyone help me here? If this is supposed to be in the Scripting forum then could it please be moved?
Thanks, in advance, for any help anyone can give.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: BSOD Script Problem
« Reply #1 on: April 29, 2009, 02:03:36 PM »
Add this to the top of the file:
Code: [Select]
import string
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline X_TheUnknown_X

  • Posts: 325
  • Cookies: 328
  • (Semi) Retired
Re: BSOD Script Problem
« Reply #2 on: April 29, 2009, 02:12:55 PM »
Ah, now that worked! That must've been the last script error because the game is playing normally now, and my torpedoes are phasing properly.
Thankyou. :mrgreen: