Adding ctypes to ToEE python?

Discussion in 'General Modification' started by Sitra Achara, Jun 8, 2008.

Remove all ads!
  1. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    One of the most frustrating things about ToEE modding is that many low-level operations are unavailable to you - from simple things like panning the camera and reading/adjusting NPC factions, to more complex things like working with pointers and whatnot.

    Now, while surfing the web, trying to understand python a little better, I've come across a python module called "ctypes" that among other things allows one to use pointers in python (apparently this module is already included with newer versions of python than ToEE is using). The thing is, I have no idea if and how this thing can be integrated into ToEE - I'm just a semi-programmer/scripter, and a good portion of the installation instructions is chinese to me (presumably it's trivial for experienced programs). Can some of the programmer types shed some light on this?
     
  2. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,743
    Likes Received:
    374
    "ctypes" rings a bell to me too, probably while hunting for a "learn Python in 20 minutes!" website ;) My appalingly limited understanding is that the python interpretter functions through one of the .dlls. I have wondered myself whether other python functions could be added by importing another .dll. I think that would be relatively simple to do, for someone who knows what they are doing, but that surely ain't me.

    If the ToEE python .dll is an older version of a standard, upgrading to a newer version should be straightforward?
     
  3. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    There's a python22.dll file in the main folder, but unfortunately replacing it with python25.dll didn't work. I think the game only uses pyToEE22.dll, which is a modified version of python22.dll. (replacing that one with python25.dll didn't work either, in fact ToEE quit to desktop)
     
  4. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,743
    Likes Received:
    374
    Yeah, Temple.dll imports pyToEE22.dll, but not python22.dll. I tried to get into pyToEE22.dll to have a look if that, in turn, imports python22.dll, but it crashed my disassembler on 2 PCs :sadblinky I'll have to try it with a different program. I still think someone who knows what they are doing could tack on an import command for another .dll.
     
Our Host!