Jump to content
  • 0

Valid functions for TES5Edit?



Hello - I am just beginning to write scripts to copy specific types of records with qualification criteria more complex than can be defined in the define filter function.  I am able to get some basic scripts to work, but I am running into trouble understanding what pascal functions are and are not available for use in TES5Edit scripting.  


A specific example is LeftStr().  I get an "undeclared identifier" error when using that function.  However, SameText() works.  Both are part of the Pascal sysutils library.  


I've checked here: https://www.creationkit.com/TES5Edit_Scripting_Functions


But that has functions specific to TES5Edit.


Any insight is appreciated.  Thanks!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

To start off xEdit's script system is not full pascal, it uses an interpreter.

If you need a specific function that doesnt appear to work then you may have to make it.

mteFunctions has many useful functions that people use, I have ran into several scenarios where I needed to make my own functions.


If you want to know everything that is a available, check the TES5Edit Github and look at wbScriptAdapter.pas and wbScriptAdapterMisc.pas


Also, for some reason not all of the wiki edits show up unless you are logged in.



You could use 

s := Copy(str, 1, i)

instead of 

s := LeftStr(str, i)
Link to comment
Share on other sites

  • 0

Awesome - Copy worked, and so did my script.  I am bulk copying over specific FX movstatic types (fog, mist, etc) in that have XEMI defined in dungeons, so I can remove the XEMI elements and make things very dark while still keeping the FX.  


I wasn't able to trace the functions included in wbScriptAdapter.pas and wbScriptAdapterMisc.pas.  I see the specific defined TES5Edit functions and procedures as well as the included libraries from what looks like JVCL.  But wasn't able to trace, for example, why SameText() works and LeftStr() does not.  


Either way, I'm good now - just thinking for future reference.  Thanks for your help!

Link to comment
Share on other sites

  • 0

xEdit uses Jvinterpreter that provides access to numerous base functions and classes (check files starting with JvInterpreter_*)



wnScriptAdapter* units add xEdit specific functions and what is missing in the base Jv but used by already existing scripts. if you want something from Pascal/Delphi that is still missing, then I can add it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.