Skyrim
0 of 0

File information

Last updated

Original upload

Created by

nem-e5i5

Uploaded by

neme5i5

Virus scan

Safe to use

33 comments

  1. neme5i5
    neme5i5
    • member
    • 19 kudos
    Sticky
    Major update for PexCLI becoming PexGUI - nothing changed in Pex.dll, however deploy modality are different, now you can create your own dll and get PexGUI load it for you, ask for more info, I'm to lazy to do a proper tutorial right now.

    Note: now compatible with Mod Organizer, see description
  2. neme5i5
    neme5i5
    • member
    • 19 kudos
    Sticky
    Hi, don't forget that you can discuss and ask questions about the pex file format as well! We are between modders here ;-)
    You can also ask questions about C# in general if you are unfamiliar with this language.
  3. budroi
    budroi
    • supporter
    • 0 kudos
    I am sorry if this has been answered somewhere.
    It is proven that I tend to be blind when reading through posts.
    I try to run pexgui with the hookmmerse.dll through MO.
    Program runs fine using the argument mentioned in OP.
    I tell it to do its business and it comes back with the popup saying complete after a min or two.
    Then when i close out the program MO spits an error at me about not being able to write because MO does not support 64 bit applications.
    And at the end the pexgui appears to have done nothing.
    Or at least it seems like nothing because nothing was put in the MO override folder or the pex folder.
    Also it seems that the scripts were never hooked unless hookmmerse does not change the time stamp on when a file was last changed.
    At least. the supposedly modified scripts are not at the top when I sort by "last modified"

    Any help would be greatly appreciated.
    1. budroi
      budroi
      • supporter
      • 0 kudos
      Nevermind, It appears that the 64 bit error is a false positive.
      When I ran PexGUI today it generated a log saying what it did and now the modified scripts are in the PexGUI Mod Organizer install folder.
      I have not tested in game to verify it worked but the files are in the correct place and everything so I am going to assume it will work as intended now.
    2. budroi
      budroi
      • supporter
      • 0 kudos
      tested and functioning sorry for false alarm
  4. squidhm3
    squidhm3
    • premium
    • 6 kudos


    I don't know what I'm doing wrong. Using MO, I've got the argument copy-pasted with the relevant pathways put in their proper places but it crashes. First few lines of the console message

    Unhandled Exception: System.Windows.Markup.XamlParseException: Initialization of 'PexGUI.MainWindow' threw and exception. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program'.

    I'm not a coder, just a user trying to get this to work, it's late and it's worn me out trying to interpret both the basic install instructions and this error, and I don't know what to do *sob*. Please help me figure this out. Weird thing is when I forgot to put the proper paths and accidentally copied the example argument it launched fine but obviously not seeing anything. Here's my argument line, my MO folder being in Skyrim directory.

    -mo "C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Mod Organizer\mods" "C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Mod Organizer\overwrite" "C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Mod Organizer\mods\Pex and PexCLI - Papyrus assembler and disassembler\scripts"

     
    Edit: I deleted the argument, it works now.


    Mine just crashes when I try to do a LOT of scripts at once, so now I have to figure out which scripts I WANT to have it include. Bah, NMM was easier in that respect. HOWEVER, I like M.O. better
  5. Karretch
    Karretch
    • member
    • 0 kudos
    I don't know what I'm doing wrong. Using MO, I've got the argument copy-pasted with the relevant pathways put in their proper places but it crashes. First few lines of the console message

    Unhandled Exception: System.Windows.Markup.XamlParseException: Initialization of 'PexGUI.MainWindow' threw and exception. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program'.

    I'm not a coder, just a user trying to get this to work, it's late and it's worn me out trying to interpret both the basic install instructions and this error, and I don't know what to do *sob*. Please help me figure this out. Weird thing is when I forgot to put the proper paths and accidentally copied the example argument it launched fine but obviously not seeing anything. Here's my argument line, my MO folder being in Skyrim directory.

    -mo "C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Mod Organizer\mods" "C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Mod Organizer\overwrite" "C:\Program Files (x86)\Steam\SteamApps\common\Skyrim\Mod Organizer\mods\Pex and PexCLI - Papyrus assembler and disassembler\scripts"

     
    Edit: I deleted the argument, it works now.
  6. xscottr
    xscottr
    • member
    • 0 kudos
    1) Do I have to use this with mod organizer? I do not like MO! If not How can I use it?
    2) I am needing to use this mod: HooKmmerse
    which is telling me I need to use this mod: PexCLI or GUI neither of which clearing define their installation and use.
    3) the only reason I wish to sue these mods is because I was told they will help me resolve script conflicts that scale body parts in game.

  7. squidhm3
    squidhm3
    • premium
    • 6 kudos


     
    In response to post #21023649.
     

    "Run once and done"
     


    Thank you!
  8. squidhm3
    squidhm3
    • premium
    • 6 kudos
    Out of curiousity, does PexGUI need to be running WITH Skyrim? Or is this a "run once and done" utility? I apologize for the noob question, but that part is unclear to me :?
    1. neme5i5
      neme5i5
      • member
      • 19 kudos
      "Run once and done"
  9. MistakenMystic
    MistakenMystic
    • supporter
    • 48 kudos
    hmm... I just can't seem to get any functionality out of this tool.

    I have it installed as needed. When I set up the executable in MO it runs, though there is a secondary console running behind with the listing of all the scripts being loaded. (that wasn't mentioned in the description but I assume it is part of the design)

    According to your comment a few posts down there is the CTRL+A, CTRL+click, SHIFT+click, and folder selection tab. I can't see that anywhere. All variations of those keypresses result in nothing, I have to manually deselect 100's of scripts in the window.

    Then when I "hit the button", all that happens is message box saying "Operation completed!" and then the 'Overwrite folder has a zero-length log file in it and nothing on the scripts folder.

    What have I missed?
    All I want to do is examine some compiled scripts to see how others have done their scripting.
    1. neme5i5
      neme5i5
      • member
      • 19 kudos
      Hi, make the difference between Pex.dll (for devs) and PexGUI.exe (for users)

      Pex.dll: allows you to scan/patch files through a language like C# or VB.NET
      PexGUI.exe: used to apply patches created by modders (no scan possible here, it has to be transparent for the user)

      It is a disassembler, indeed. You can use it to scan script files but there is already some tools doing that better, the real purpose of that is more script patching.

      now concerning keyboard shortcuts, you may have missed an update, double check that.
    2. MistakenMystic
      MistakenMystic
      • supporter
      • 48 kudos
      ahh... yes I have missed an update. I only have 0.2.0.0. Sorry about that.

      So from what you are saying I may actually be looking for another tool if all I want to do is examine scripts. Not a problem, I will probably come back to this tool when my own scripting is up to a standard I think warrants it.

      Thank you for your prompt response.
  10. eladwen146
    eladwen146
    • premium
    • 0 kudos
    Im so confused, i did everything that you said to do in the description, double checked, and im still not able to get it to work, When ever i start it up using MO it just says "PEXGUI has stopped working" :s
    1. eladwen146
      eladwen146
      • premium
      • 0 kudos
      Oh I am such a idiot forget my last comment. added in too many ". e.g. (overwrite" ""C:\Progra). Instead of (overwrite" "C:\Progra).
  11. silvericed
    silvericed
    • premium
    • 127 kudos
    Very powerful tool. So, assembled Papyrus is something similar to .Net CIL.
    Was just thinking about automating things (things like injecting JValue.release into appropriate places).

    Although detect whether an Int is an object or just regular Int will be pain in ass..
    1. neme5i5
      neme5i5
      • member
      • 19 kudos
      Hi, in fact assembled papyrus is barely a pre-lexed script file, there is nothing like CIL (Intermediate langage that get compiled to machine code before execution). I'd even say that papyrus is the worst I've ever seen in this category (I'm sure bethesda asked a random trainee to do it)
      Good luck concerning your problem. Consider that you can also add metadata in the code and then do your detection at run time if doing it at compile time is too tricky. See also c++ shared_ptr, it's similar t what you want to implement
    2. silvericed
      silvericed
      • premium
      • 127 kudos
      Hi,

      Thanks for clarification

      > Consider that you can also add metadata in the code and then do your detection at run time if doing it at compile time is too tricky

      I though, I can declare my own metadata/flag in TESV_Papyrus_Flags file and then mark methods returning JC-objects?
      And sorry for late interest, just recently discovered `Required` tab which first lead me to Hook Immerse and then here
    3. neme5i5
      neme5i5
      • member
      • 19 kudos
      If you want to detect a function returning a JC-object, you can use the field Function.docString and add as much formated metadata as you want here, but you will not be able to access them at run time. Here is a little incomplete code explaining how I see that:

      public static class dllmain
      {
      //those functions create a new JC-object instance
      public static readonly List<KeyValuePair<string, string>> JFunction;


      //this is the static dll intitialization
      static dllmain()
      {
      JFunction = new List<KeyValuePair<string, string>>()
      {
      new KeyValuePair<string, string>("jmap", "object"),
      /*...*/
      };
      }

      public static bool install(PexFile value)
      {
      int i = 0;
      foreach (var o in value.pexObjects.data)
      foreach(var p in o.data.numStates)
      foreach (var q in p.functions)
      {
      List<Instruction> newBody = new List<Instruction>(q.f.instructions.Length);
      foreach (var ins in q.f.instructions)
      {
      newBody.Add(ins);

      if (ins.code == Opcode.callstatic)
      {
      if (JFunction.Contains(
      new KeyValuePair<string, string>(
      (ins.args[0].data as PexStringRef).GetValue(value.stringTable).ToLowerInvariant(),
      (ins.args[1].data as PexStringRef).GetValue(value.stringTable).ToLowerInvariant())))
      //we are facing an instanciation, let Jcontainers know that this variable name is now a JC object
      {

      newBody.Add(
      new Instruction()
      {
      code = Opcode.callstatic,

      args = new List<VData>()
      {
      new VData(new PexStringRef()), /*object name*/
      new VData(new PexStringRef()), /*function name*/
      new VData(new PexStringRef(), true), /*store return to this identifier, not optional, there is some blank identifier for functions returning nothing*/
      new VData(2), /*function argument count as VDATA int*/
      new VData(ins.args[2].data, false), /*first arg as string, we notify that this name retains this pointer */
      new VData(ins.args[2].data, true) /*Here we give the value of the pointer instead of the name*/
      /*equivalent to myobject.myfunction("mynewptr", mynewptr)*/
      }
      });
      }
      }
      else if (ins.code == Opcode.assign
      /*&& check for int to int in order to exclude a lot of cases (and save proc time)*/)
      //We may be facing a jobjectref2 = jobjectref (increase ref count, add jobjectref2 to jref table)
      //OR jobjectref = someuselessint (decrease ref count, remove jobjectref from jref table)
      //notify Jcontainers about that
      {

      }
      else if (ins.code == Opcode.op_return)
      {
      //put the return after our new instruction
      newBody.RemoveAt(newBody.Count - 1);
      newBody.Add(new Instruction() { /*release all local variables, since the function is returning*/ });
      newBody.Add(ins);
      }
      }
      q.f.instructions = newBody.ToArray();
      }
      return true;
      }
      }
    4. silvericed
      silvericed
      • premium
      • 127 kudos
      @neme5i5

      Thank you a lot! This is more clear for me now.
  12. falloutboy65
    falloutboy65
    • premium
    • 0 kudos
    This mod sounds very interesting and helpful.

    I was trying to get it running with your HooKmmerse mod, unfortunately it always crashes - but I don't think that's a surprise:
    I use MO and followed your instructions so that part should work.
    What I was wondering:
    Currently I have 1206 mods in my \mods folder, obviously only a part of it activated in MO.

    When I click into the pex list, all of the pex files are activate and I have about 1million+1 pex files to deactivate, one by one.
    Would it be possible to improve this part by adding the possibility to deselect all of them so I can select the ones I am interested (tried CTRL+A and other combinations).
    At least I assume that all pex files highlighted blue are selected.

    Further usability improvements for MO users may be to add a tree on the left showing the folders so I can select only the ones I am interested in - maybe with tick-boxes?

    Sorry if I am getting ahead of myself - I'd love to test this mod to see how it can improve the many mods I use, bound to conflict in a lot of areas...

    anyway keep up the good work.
    1. neme5i5
      neme5i5
      • member
      • 19 kudos
      Hi I'm always happy to listen to everyone, I'll add the feature you are looking for
      edit: note that if a file is selected it does not mean that this file will be edited, it just means that it'll be scanned and edited if it contains a matching pattern
    2. neme5i5
      neme5i5
      • member
      • 19 kudos
      Done.
      added: CTRL+A, CTRL+click, SHIFT+click, folder selection tab
      If you have more suggestions I'm still listening, user-friendlyness has never been my cup of tea
    3. falloutboy65
      falloutboy65
      • premium
      • 0 kudos
      Thanks a lot nem5i5,

      that is a great improvement, makes it way more manageable.
      Now I just need to get it to run with HooKmmerse :/ it always crashes when I select the dll for install... but that's for the other mod to report in..

      small UI improvement suggestion (very low prio):
      - resizability of the left pane (while it is good that I can resize the main window I'd like to expand the size of the left pane without expanding the right part)

      What I am not quite clear on: is it important that I chose the mods in the "correct" order - follow the mod list from top to bottom or is that irrelevant?
      What I mean is:
      I have 3 mods that know change the same body part. I select the first and the third in the list and remember the 2nd one after that.
      In the right lower pane, the scripts will be listed in the order I have selected the mods, not how they show in the left pane (I realize they are "only" listed alphabetically) or do I have to make sure I select them in the order I have them in MO?

      If everything works correct, should I expect new pex files in the MO\overwrite\script folder?
    4. neme5i5
      neme5i5
      • member
      • 19 kudos
      Hi, It's irrelevant, order does not matter. You should not expect any file in the overwrite folder since the new files are asigned to PexGUI.
    5. falloutboy65
      falloutboy65
      • premium
      • 0 kudos
      thanks for the update - no more crash!

      one small thing though you might either want to adapt or mention on the frontpage.
      The foldername of your mod cannot have a space.

      "{mod organizer directory}\mods\Pex and PexCLI - Papyrus assembler and disassembler\scripts"
      will result in the tool searching for scripts in
      "{mod organizer directory}\mods\Pex\scripts"
      and must obviously fail.

      Initially I thought the summary dialog for the three path was simply cut short due ot my path being rather long but it turns out it really cuts off after \Pex.
      I tested by removing all spaces both in the foldername and the paths and it works and creates the files in

      " D :\Games\Steam\SteamApps\common\skyrim\ModOrganizer\mods\PexandPexCLI-Papyrusassembleranddisassembler\scripts" (well, that's my example obviously - Oh darn, now the NSA knows where I store my Skyrim Mods!! )

      Thanks again - finally I can play around with it in depth on the weekend
    6. neme5i5
      neme5i5
      • member
      • 19 kudos
      Hi again, actually I know that and that's the purpose of the quotes surounding each path, actually they are not optional unless your path is, as you said, without any whitespace
    7. falloutboy65
      falloutboy65
      • premium
      • 0 kudos
      well, I set it up exactly as I wrote here the 3 paths with quotes, still it cuts it off when pointing to the script folder (last path)...
      All applications fail to recognize paths with spaces if not surrounded by quotes (at least in the windows world afaik) which is why I pointed it out.
      Unless I should have used single quotes (would be unusual though) instead of double-quotes in the arguments area. The same path, locating the exe (while having spaces) works fine (same for the HooKmmerse dll).

      For reference this was my full 'arguments' entry:
      -mo "D:\Games\Steam\SteamApps\common\skyrim\ModOrganizer\mods" "D:\Games\Steam\SteamApps\common\skyrim\ModOrganizer\overwrite" "D:\Games\Steam\SteamApps\common\skyrim\ModOrganizer\mods\Pex and PexCLI - Papyrus assembler and disassembler\scripts"