Giter VIP home page Giter VIP logo

xedit-lib's Introduction

xedit-lib

Project to make a DLL exposing XEdit functionality to an application in any language.

contact

If you're looking for support or want to contribute, join the Modding Tools discord server.

You can view project progress and user stories on the trello board.

xedit-lib's People

Contributors

matortheeternal avatar narukaze132 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xedit-lib's Issues

GetElementIndex seems to not be exported?

The GetElementIndex method declared to be an "API function" here seems to be omitted from the ELEMENT HANDLING METHODS section here, and seems to be missing from the dll. I'm not sure whether this is intended, and it's not blocking me. Just thought to raise this in case it was accidentally missed.

Thanks for xedit-lib by the way!

Perhaps globals could be configurable?

Hi Mator,

I am currently working on python bindings for xedit-lib. One thing I noticed is that xedit-lib hardcodes ProgramPath global to the location of ParamsStr(0) (see here). This value seems to get used when constructing the path to the Skyrim.Hardcoded.dat files. As a result, to make unit tests pass (where the invoked command looks like pytest -v ..., which runs in python), I have to copy the Skyrim.Hardcoded.dat file to my %localappdata%\Programs\Python\Python37 folder. I imagine a regular python app may have the same issue.

You mentioned earlier on discord that the Hardcoded.dat files are going away soon, so I think for the time being I can wait for that. It'll still be a while before I feel that this python wrapper, or any python-based application I make with it, would be ready for release, and I think for me this is a release blocker but doesn't hinder me from development or testing for the time being. (Any thoughts or guidance would be greatly appreciated)

Making this post mostly because I'm now wondering whether some of these values in general could be made more configurable... perhaps through an optional environment variable override? Or to expose a SetGlobal method? Hence this post.

Thanks,
leontristain

GetEnumOptions/Union Types interaction

I'm using xedit-lib to crawl xedit's definitions for fields. Under ARMO/VMAD/Scripts/[array_element]/Properties/[array_element]/Value there's a union type for the values with a bunch of different options (int, float, bool, string, etc). If the plugin has a Bool here, the types that return are:

VT: vtEnum
ET: etUnion
DT: dtUnion

since bools are just True/False enums and union types have their own element type & def types. The problem is that calling GetEnumOptions on this will throw an exception since xedit-lib is probably expecting:

VT: vtEnum
ET: etValue
DT: dtInteger

GetValue() works as expected and returns True for the union enum.

I don't know if there are any other types with this issue; I'm not sure if there's a union which has a flag or reference type as a direct option.

(incidentally, this bug causes zedit to fail to load enum options for union enums)

"Fake" exceptions in log when calling Records.GetRecord

Adding the option to GetRecord for ignoring masters is working great, but the xelib log is showing a lot of "fake" exceptions, perhaps it should suppress the Failed to find record... exceptions when it's not looking in masters and the FormID originates from one?

SetLinksTo doesn't resolve unions

I was trying to do add a Condition via script, like this:

let conditionElem= xelib.AddElement(record, 'Conditions\\.');
xelib.SetIntValue(conditionElem, 'CTDA\\Type', 10010000);
xelib.SetFloatValue(conditionElem, 'CTDA\\Comparison Value', 1.0);
xelib.SetValue(conditionElem, 'CTDA\\Function', 'HasPerk');
xelib.SetValue(conditionElem, 'CTDA\\Run On', 'Reference');
xelib.SetValue(conditionElem, 'CTDA\\Reference', 'Player [00000014]');
xelib.SetLinksTo(conditionElem, 'CTDA\\Parameter #1', thePerk);

The last line gives me the error:
"Error: Failed to set reference at: zPatch.esp\1000ACB2\Conditions[1], "CTDA\Parameter #1"
Element cannot hold references."
It obviously can, Parameter #1 must be a reference to the perk.
This works as a workaround:

xelib.SetValue(conditionElem, 'CTDA\\Parameter #1', xelib.GetHexFormID(thePerk));

Update xEdit code to v4.x

Will result in the following:

  • "Proper" ESL support
  • Fixes for Fallout 4 record copying
  • Various other bugfixes (?)

Smooth out >255 plugin support

It turns out that in updating XEditLib to x64, I made it so loading >255 plugins works. There are just a few things that need to be smoothed out:

  1. Fix sorting of plugin files on the tree view. ✔
  2. Fix FormID display? (would require displaying 9+ characters on larger formIDs) ✔
  3. Fix API functions (GetFormID, SetFormID, GetRecord, and path resolution)

Parsing formID out of display value doesn't work when FULL contains a '['

Passing 'SomeEditorID "A FULL name with an unmatched [" [ARMO:DEADBEEF]' to something that expects a FormID results in an error; specifically complaining that the supplied value isn't an integer.

Passing 'SomeEditorID "A FULL name with matched []" [ARMO:DEADBEEF]' to something that expects a FormID works ok.

How to Build?

What do I need to do to get this to build and run successfully? Normally, I'm pretty good at this kind of stuff, but I'm not sure how to proceed here. I got as far as running the tests, but it evidently doesn't get very far:

XEditLib v1.0.6203.55988
Loading Skyrim.esm (1/7)
Exception loading Skyrim.esm
Assertion failure (C:\Users\Joe\src\xedit-lib\lib\xedit\wbImplementation.pas, line 11710)
Fatal Error: <EAssertionFailed: >

Running it through a debugger and continuing past that assertion, it doesn't run much longer before terminating with an access violation. This is probably not going to come as a surprise, but I've never seen Delphi stuff before, so I'm not entirely sure where to go from here.

My kneejerk guess is that I'm running a newer version of Delphi than what you're on.

Some system details:

  1. Delphi: Embarcadero® Delphi 10.1 Berlin Version 24.0.25048.9432
  2. OS: Windows 10 Pro Anniversary Edition, x64 (Version 1607, OS Build 14393.447)
  3. Compiled zlib with: Embarcadero C++ 7.20 for Win32

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.