Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to Xbox Chaos: Modding Evolved

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

DemolitionTurtle

Support
Error With Ksoft.tool: Ksoft.lowlevel.dll Not Working

32 posts in this topic

Hello XboxChaos,

 

I am an active member of the Halo racing community and we absolutely love Synth's Race mod. I'm interested in how the process happened and I'm looking into trying to make gametypes for myself.

 

I have looked around the website but I cannot find a link to the software that is used, or a simple getting-started tutorial. I would be very grateful if somebody could link me these things!

 

Again, I only want to mod custom gametypes, nothing else.

 

Thanks for the help!

 

- DemolitionTurtle

 

EDIT: I've had some issues with installing this (not recognising the KSoft.LowLevel.dll), so if you are reading this and have the same issue, please read the first 2 pages of this thread (fix is on page 2: you need to install the x86 version of the C++ Redistribute).

Share this post


Link to post
Share on other sites

Here's a little primer I've been working on - it's a WIP but it might help

KSoft http://www.halomods.com/ips/index.php?/files/file/32-ksofttool/

Programming logic:

A basic understanding of coding logic is kinda required for scripting in Megalo. You've got your boolean logic functions; AND, OR, and NOT, and you've got your conditional functions; IF something is true THEN do something specific, or in some cases just DO this UNTIL that happens. Beyond that there are advanced functions like variables - a labeled chunk of memory that can be used to store a value and to recall said value. And then you have your complex functions like timers and text output that are long complex pieces of code that are used commonly so they're pre-built into the language so you can just "say their name" and you've got all that code at your disposal, functionally. Generally they handle manipulating and taking data from (or sending it to) obscure variables that control hardware specific functionality like getting time from the system clock, LEDs, speakers, (in robots) motors via control boards, and in gaming and modern software to the user's interface. Obviously that's where the meat is, but you need the basic functions to be able to get the fancy stuff to do anything useful. So you would want to code something like; IF a particular variable meets some criteria THEN send information from another variable to a particular function.

If you can format what you want the computer (or xbox) to do into that sort of structure, you can learn almost any programming language. You just need to figure out the syntax - the order it expects the phrasing to come in, the particular names it uses for each thing, and the way it wants everything laid out.

KSoft's Syntax:

Each gametype is broken down into three main sections;

The <Base> section contains values for basic gametype settings - the title, description, icon, team names, spawn settings, map object palette settings, and loadout palettes.

Next is the <Megalo> section which contains in-game constants like strings (text used in-game, with foreign-language alternatives included), player trait sets, user defined options which actually interface to the in-game gametype options, a few MM-specific values, loadouts again, and weapon tuning.

Then the last section is <MegaloScript>, and that is where the scripting goes. It starts off defining variables and labels to be used in scripts, and then it gets into <Triggers>.

A trigger is a little chunk of script that will execute or check to see if it should execute every game tick (which is several times per second). This can be controlled/restricted using;

trigType, which can associate a trigger with a significant game event like a host change or the game starting,

execMode, which can be used to have a trigger run once for each iteration of some type of entity in the game such as players, objects, or teams, and

objectFilter, which can be used to restrict the trigger to running on objects with a particular label.

Then within each trigger you have <Elements>, each of which will start with <E and end with </E>.

Here's an example;

<Trigger name="Trigger3">  <Elements>    <E type="Condition" name="Comparison" unionGroupID="-2">      <Param type="VarReference" varRefKind="Custom" varRefType="TeamsEnabled" />      <Param type="VarReference" varRefKind="Custom" varRefType="Int16">1</Param>      <Param type="ComparisonType">Equal</Param>    </E>    <E type="Action" name="ActivateTrigger">      <Param type="TriggerReference">        <T type="Trigger" trigType="Subroutine" execMode="OnObjectFilter" name="Trigger3_Subroutine4" objectFilter="ffa_spawn">          <Elements>            <E type="Action" name="DeleteObject">              <Param type="ObjectReference" varRefType="ExplicitObjectType" dataType="Iterator.Object" />            </E>          </Elements>        </T>      </Param>    </E>  </Elements></Trigger>
Here you can see the first element in the trigger is type="Condition" and the next is type="Action". Those are the two types of elements.

There are many types of conditions, but the most common are name="Comparison" which just checks if two variables share a particular relationship - equal, not equal, greater than, etc. Each condition has a unionGroupID which tells the engine if the condition should be grouped up with other conditions before it. Each group will execute together in order and will allow the code to continue executing within the branch or trigger if a "true" comes out of it. -2 starts a new group and -3 includes the condition within the previous group. Basically you can say "this and that must both be true" by using -2 in both, or you can say "either this or that must be true" by using -2 for the first one and -3 for the second.

There are lots of Actions too, but they're far more evenly used. Some common ones you're going to want to get used to are name="Branch", which is used to contain a virtual trigger, allowing for triggers within triggers within triggers to handle complex operations, and name="VariableOperation" which is used to store or modify information in a variable. Beyond that there are more then 200 conditions and actions, all of which can be found in your KSoft directory; KSoftDirectory\KSoft\Games\Halo4\Definitions\MegaloScriptDatabase_newdefs.xml

And lastly you have parameters. These are associated with each element, and can be applied by including them on the first line of the element like this; <E type="Condition" name="Comparison" unionGroupID="-2"> (where type, name and unionGroupID are parameters of E) or they can be applied within the tag structure like this;

<E type="Condition" name="Comparison" unionGroupID="-2">

<Param type="VarReference" varRefKind="Custom" varRefType="TeamsEnabled" />

<Param type="VarReference" varRefKind="Custom" varRefType="Int16">1</Param>

<Param type="ComparisonType">Equal</Param>

</E>

with each parameter having it's own set of parameters. Some parameters need to be applied the first way, and others need to be applied the second. It depends on what they do, and how much data they involve.

aaaand that's KSoft's syntax in a nutshell. It's a bit backwards compared to other languages, but if you spend enough time trying to read it you get used to it and it makes sense.

Edited by Gordon
DemolitionTurtle likes this

Share this post


Link to post
Share on other sites

Thank you so much Gordon.

 

That was really helpful, I'm going to go and have a play around with that now. I've done programming in other languages so everything seems to make sense. I do have one question though: how do you get gametypes to/from your Xbox?

 

Thanks again ;D

Share this post


Link to post
Share on other sites

You can format a USB flash drive in your Xbox to work as a memory card. There are several programs available,  such as ModioHorizon, and XTAFUSB, which allow you to access the files on your USB-Xbox-Memory Unit from your PC.

 

There are others out there which do the same, but those are the first that came to mind. There are also probably some more up-to-date links for Horizon and XTAFUSB, if you Google, the links were some I just found quickly.

DemolitionTurtle likes this

Share this post


Link to post
Share on other sites

You can format a USB flash drive in your Xbox to work as a memory card. There are several programs available,  such as ModioHorizon, and XTAFUSB, which allow you to access the files on your USB-Xbox-Memory Unit from your PC.

 

There are others out there which do the same, but those are the first that came to mind. There are also probably some more up-to-date links for Horizon and XTAFUSB, if you Google, the links were some I just found quickly.

 

Thanks, I've downloaded USBXTAF and set up my USB memory stick.

 

What do I copy over to the computer? Is it just any gametype that I want to modify, and then I copy it back into the Halo 4 directory on my HDD when I'm done?

 

Thanks for the help!

 

EDIT:

 

I think I've copied the gametypes over, but when I try to decompile them I get an error (that disappears almost instantly) with loads of question marks and at the bottom it says "Error: failed to initialise". Can anyone help with this?

Edited by DemolitionTurtle

Share this post


Link to post
Share on other sites

I am not familiar with KSoft, but if it works the same as the DLL i am using you need to extract the gametype from the CON file.
Basically all information that is saved to a file in an Xbox, is saved in what is known as a Container (CON) file.
Others know more than me about CON files and the info in them, but the idea is you need to extract the goodness from inside (the actual save file), in this case, the gametype.
 
To do this I use Modio, it allows you to extract the CON file and extract the gametype from the CON file easily.

 
Here's how:

  • Just open Modio click "Open a save...", select the file you extracted (will be named something like "gfai2xsdcvy545555imwszqgtcysgxrmv12ihzeba") and then click Open.
  • A new window will open with two tabs: 'General File Info', and 'File Contents', open the File Contents tab and you will see a file named "variant"
  • Right click it and select "Extract File".
  • Save the file somewhere. This is the one you want to use with KSoft.

When you are done editing or whatever, repeat steps 1 - 3, but instead of selecting "Extract File", select "Replace File" instead. Then select the file you edited in KSoft. This will replace the contents of the CON file with the newly edited gametype. Then continue with this last step:

  • [VERY IMPORTANT] If you do not want your file to corrupt, then make sure you click the button "Rehash and Resign" under the General File Info tab AFTER you injected the edited save.

Hope I helped, also remember I am using an outdated version of Modio from about a year ago, so the layout maybe slightly different and the name of the buttons and the tabs etc. may also be slightly different.
 
Cya!  :biggrin:

Edited by wtfisupwithmyname
DemolitionTurtle likes this

Share this post


Link to post
Share on other sites

I am not familiar with KSoft, but if it works the same as the DLL i am using you need to extract the gametype from the CON file.

Basically all information that is saved to a file in an Xbox, is saved in what is known as a Container (CON) file.

Others know more than me about CON files and the info in them, but the idea is you need to extract the goodness from inside (the actual save file), in this case, the gametype.

 

To do this I use Modio, it allows you to extract the CON file and extract the gametype from the CON file easily.

 

Here's how:

  • Just open Modio click "Open a save...", select the file you extracted (will be named something like "gfai2xsdcvy545555imwszqgtcysgxrmv12ihzeba") and then click Open.
  • A new window will open with two tabs: 'General File Info', and 'File Contents', open the File Contents tab and you will see a file named "variant"
  • Right click it and select "Extract File".
  • Save the file somewhere. This is the one you want to use with KSoft.

When you are done editing or whatever, repeat steps 1 - 3, but instead of selecting "Extract File", select "Replace File" instead. Then select the file you edited in KSoft. This will replace the contents of the CON file with the newly edited gametype. Then continue with this last step:

  • [VERY IMPORTANT] If you do not want your file to corrupt, then make sure you click the button "Rehash and Resign" under the General File Info tab AFTER you injected the edited save.

Hope I helped, also remember I am using an outdated version of Modio from about a year ago, so the layout maybe slightly different and the name of the buttons and the tabs etc. may also be slightly different.

 

Cya!  :biggrin:

 

Thanks so much for the help! I've extraced the Variant file, but I still get the same errors as before :(

 

If I use the batch file from Synth's KSoft Repack I get the error with all of the question marks, and if I use it straight from the command line nothing happens.

 

Which DLL are you using? Maybe I should give that one a try instead.

 

Thanks for the help! :D

Share this post


Link to post
Share on other sites

I believe that there are several things that you have to install to your computer for the program to work. I remember this caused issues around the program's launch.

 

1. .NET Framework 4.5 - http://www.microsoft.com/en-us/download/details.aspx?id=30653

 

2. Microsoft Visual C++ 2012 Redistributable Package (x86) - http://www.microsoft.com/en-us/download/details.aspx?id=30679

 

3. A patch for .NET Framework 4.5
 
Edited by shanez1215
DemolitionTurtle likes this

Share this post


Link to post
Share on other sites

By the way, I'm getting an error that says that KSoft.Tool.exe is not a recognized command or program when I decode with the new KSoft. The repack that Synth made works fine.

 

Or is the new KSoft not compatible with .variants from the old one?

DemolitionTurtle likes this

Share this post


Link to post
Share on other sites

 

I believe that there are several things that you have to install to your computer for the program to work. I remember this caused issues around the program's launch.

 

1. .NET Framework 4.5 - http://www.microsoft.com/en-us/download/details.aspx?id=30653

 

2. Microsoft Visual C++ 2012 Redistributable Package (x86) - http://www.microsoft.com/en-us/download/details.aspx?id=30679

 

3. A patch for .NET Framework 4.5
 

 

 

Thanks, but I've already installed all of them... Do you have any other solutions that I could try?

 

Thanks :D

Share this post


Link to post
Share on other sites

By the way, I'm getting an error that says that KSoft.Tool.exe is not a recognized command or program when I decode with the new KSoft. The repack that Synth made works fine.

 

Or is the new KSoft not compatible with .variants from the old one?

That likely means it can't find KSoft. Make sure it's pointing to the right directory

DemolitionTurtle likes this

Share this post


Link to post
Share on other sites

That likely means it can't find KSoft. Make sure it's pointing to the right directory

Thanks. I found the error. The batch files don't direct the computer to the folder that KSoft.Tool is in. They just reference KSoft.Tool.exe directly.

Edited by shanez1215

Share this post


Link to post
Share on other sites

You don't really have to extract the variant file from its container since KSoft has a .bat file for CON files.

Open each .bat file with Notepad, and add this line at the top of each file:

cd %~dp0\

Share this post


Link to post
Share on other sites

Ok, I have tried changing the directory and it can definitely find it, as when I don't put all of the arguments in it brings up the list of help commands with each argument that you need.

 

BTW, running it as an administrator doesn't work either.

 

Also, I managed to keep the error window open and find the error, and it turns out that KSoft.LowLevel.dll isn't working, but the file is definitely there. I've attached a picture of the error below.

 

Here is one error with it not initialising (using Synth's repacked version):

KSoftError1_zps044f692c.png

 

And here is another error with it initialising, but having an error while processing the game variant (using the original KSoft):

KSoftError2_zpsbb9125f9.png

 

Both of these errors seem to be related to the KSoft.LowLevel.dll. I have installed the patches and restarted my PC but to no avail.

 

Thanks for the help everyone! :biggrin:

post-13888-0-75906200-1382908360_thumb.p

Edited by DemolitionTurtle

Share this post


Link to post
Share on other sites

Did you extract the files from the 7z archive?

 

Yes, and I've tried re-extracting them and re-downloading the whole archive too.

 

At the moment I'm trying to set it up on another PC to see if that works.

Share this post


Link to post
Share on other sites

Open each .bat file with Notepad, and add this line at the top of each file:

cd %~dp0\

Did you try this?

Share this post


Link to post
Share on other sites

Did you try this?

 

Yeah, but it just gives the same error as before :(

 

EDIT: By the way, just for reference, this is the batch file that I've been using:

cd C:\Users\Mitch\Mitch\Documents\HaloModding\Tools\KsoftKSoft.Tool.exe -env=blam -tool=gvar -mode=decode -game=Halo4 "-path=C:\Users\Mitch\Mitch\Documents\HaloModding\OtherGametypes\RaceVar3" "-name=TestOne" -switches=1PAUSE

EDIT 2: Ok, I'm getting the same error on my other computer. It's possibly a bad/corupted KSoft.LowLevel.dll file :( By the way, I'm using KSoft 1.4, downloaded from here.

Edited by DemolitionTurtle

Share this post


Link to post
Share on other sites

What OS are you using? Looks like Windows 7 from the screenshots but I can't say for sure. I would suggest checking if you're running a 64-bit copy or an x86 (32-bit) copy and making sure you have all of the appropriate copies of the patches installed, as iirc it will let you install the wrong patch for one or two of them. Then I would say re-extract a fresh copy of KSoft to C:\Ksoft or something similarly simple and use the.bat files included. Just stick a container or variant file into the KSoft folder and then drag/drop it into the bat. 

DemolitionTurtle likes this

Share this post


Link to post
Share on other sites

Here is one error with it not initialising (using Synth's repacked version):

KSoftError1_zps044f692c.png

 

And here is another error with it initialising, but having an error while processing the game variant (using the original KSoft):

KSoftError2_zpsbb9125f9.png

 

Both of these errors seem to be related to the KSoft.LowLevel.dll. I have installed the patches and restarted my PC but to no avail.

You mention you were using the original tool here, but later you mention that you're using the 1.4 download, but don't mention the extact error you're getting. Are you positive you're using 1.4 (and not the previous release accidently) and are you positive you have installed the VC++ 2012 redistributables, as linked in the readme.txt? If so, could you post the exact error you're getting with 1.4?

1.4 comes with prefabucated .bat files which you can just drag and drop most game variant files onto and it should spit out an .xml file or .game file.

Edited by kornman00

Share this post


Link to post
Share on other sites

Dammit - now it's doing it to me. I got a new PC. Windows 8 x64. I installed the SlimDX runtime (both x86 and x64, separately and together), the C++ library, and the (Win 8 x64) .NET Runtime patch. It ships with .NET Runtime 4.5 so it wouldn't let me install that. Then I extracted KSoft (lastest version) onto the C drive (and renamed the folder) and threw a copy of the on-disc Infinity Rumble's variant.game file in there and used the appropriate .bat file. Here's what I'm looking at;

8YpZPgm.png

Edited by Gordon
DemolitionTurtle likes this

Share this post


Link to post
Share on other sites

What OS are you using? Looks like Windows 7 from the screenshots but I can't say for sure. I would suggest checking if you're running a 64-bit copy or an x86 (32-bit) copy and making sure you have all of the appropriate copies of the patches installed, as iirc it will let you install the wrong patch for one or two of them. Then I would say re-extract a fresh copy of KSoft to C:\Ksoft or something similarly simple and use the.bat files included. Just stick a container or variant file into the KSoft folder and then drag/drop it into the bat. 

 

Yeah, it's Windows 7 64-bit. I have tried all of the patches (64-bit), but it still isn't working. I just installed nearly 100 Windows updates that amounted to 1GB, but that was not the problem either :(

 

I have extracted it to C:\KSoft and used the .bat files, but I still get the same error.

 

 

You mention you were using the original tool here, but later you mention that you're using the 1.4 download, but don't mention the extact error you're getting. Are you positive you're using 1.4 (and not the previous release accidently) and are you positive you have installed the VC++ 2012 redistributables, as linked in the readme.txt? If so, could you post the exact error you're getting with 1.4?

1.4 comes with prefabucated .bat files which you can just drag and drop most game variant files onto and it should spit out an .xml file or .game file.

 

Yeah, it's definitely 1.4 (I've just re-downloaded it and re-extracted it to make sure) and I have all of the patches for C++, .Net etc.

 

I'll post the error that I got with the included .bat files (I get the same error too when manually typing it in) below.

 

 

Dammit - now it's doing it to me. I got a new PC. Windows 8 x64. I installed the SlimDX runtime (both x86 and x64, separately and together), the C++ library, and the (Win 8 x64) .NET Runtime patch. It ships with .NET Runtime 4.5 so it wouldn't let me install that. Then I extracted KSoft (lastest version) onto the C drive (and renamed the folder) and threw a copy of the on-disc Infinity Rumble's variant.game file in there and used the appropriate .bat file. Here's what I'm looking at;

 

 

I am no longer alone in this world! :D

 

I'm getting the exact same error as you, I've posted it below along with my KSoft folder.

 

KSoftError3_zpsefd29fe9.png

 

Also, would it be worth one of you uploading a game variant or container file that you know works, so I can make sure that I haven't extracted it wrong or something.

 

 

And just for reference, this is the error that I get when trying to encode an XML gametype file back into an actual gametype (this one was with the CTF gametype from here):

 

KSoftError4_zpsa1f412b6.png

Share this post


Link to post
Share on other sites

 

Also, would it be worth one of you uploading a game variant or container file that you know works, so I can make sure that I haven't extracted it wrong or something.

Probably not - I don't think invalid variants would throw that particular error, and I'm getting the same error after testing with several different (confirmed functional on my other PC) variants. 

DemolitionTurtle likes this

Share this post


Link to post
Share on other sites

GOT IT! Dayumn, that took about 5 hours longer than it should have (unfortunately, I'm not even exaggerating). Despite the fact that my PC's 64-bit, you need the 32-bit version (VSU3\vcredist_x86.exe) of the Microsoft Visual C++ 2012 Redistributable Package.

 

I was just going through the readme to make sure (again) that I had all of the dependencies (I'd already tried them all about 3 times to make sure), but I figured I'd try the 32-bit version just to see what it did.

 

I'd recommend specifying this in the Readme for future versions (I know it says x86 in brackets, but I just figured that the link was to the x86 version, and I needed the 64-bit version).

 

I hope this fixes your issue too Gordon! :D

 

EDIT: Also, is there any way I can change the thread title to reflect this issue so if people in future have the same issue they can find it?

 

Again, thanks so much for the help everyone, it really means a lot when so many people try to fix an error that a completely random guy that's popped out of nowhere has! I'm gonna do some moddin'!

 

Now, where would you recommend be the best place to start? Following some tutorials, or just messing around with the base gametypes? :biggrin:

Edited by DemolitionTurtle
Gordon likes this

Share this post


Link to post
Share on other sites

EDIT: Also, is there any way I can change the thread title to reflect this issue so if people in future have the same issue they can find it?

What would you like the title to be changed to?

Share this post


Link to post
Share on other sites