• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Attempting to modify a grid in XUi...

I'm trying something that a user of my mods requested, adding a second row to the dew collectors. Apparently I am using the XML incorrectly.

Code:
<set xpath="/windows/window[@name='windowDewCollector']/rect[@name='content']/grid[@name='queue']/rows/@value">2</set>

Not sure how to modify the "rows" value after accessing the named grid. Yes, I know it's simple, but it's late and I am tired. Forgive me!

 
Okay, it's something else. I am setting it correctly now but not getting a second row. I also modified the window height value and even doubled it, but no second row. Are dew collectors in C# instead of XML and thus cannot be modded much?

Code:
<set xpath="/windows/window[@name='windowDewCollector']/rect[@name='content']/grid[@name='queue']/@rows">2</set>
 
@doughphunghus and @The_Great_Sephiroth It does require C#.

In vanilla, the size of the dew collector container is fixed in C# to be constant values. My mod includes Harmony patches that will read from the dew collector block's "<properties>" tags and set them accordingly.

It also has to be set in the XML because they have to match, and there's no way to do that (easily) with Harmony patches.

Feel free to use my mod for that. You can just comment out or remove the properties that deal with the weather.

(But maybe wait a bit, because I'm actually working on an update as we speak. It won't change anything about the size of the container, but it should make the weather calculations more accurate.)

 
@doughphunghus and @The_Great_Sephiroth It does require C#.

In vanilla, the size of the dew collector container is fixed in C# to be constant values. My mod includes Harmony patches that will read from the dew collector block's "<properties>" tags and set them accordingly.

It also has to be set in the XML because they have to match, and there's no way to do that (easily) with Harmony patches.

Feel free to use my mod for that. You can just comment out or remove the properties that deal with the weather.

(But maybe wait a bit, because I'm actually working on an update as we speak. It won't change anything about the size of the container, but it should make the weather calculations more accurate.)
Thank you, but isn't Harmony the big "hook" program for Unity Engine that allows one to use C# libraries? I am trying to keep this in XML format because I believe if you use Harmony you have to disable EAC and I am not sure about VAC. I wouldn't want to be the cause of a user being banned because he or she forgot to play without EAC. If I am mistaken, please feel free to enlighten me! I've been wrong before!

 
Thank you, but isn't Harmony the big "hook" program for Unity Engine that allows one to use C# libraries? I am trying to keep this in XML format because I believe if you use Harmony you have to disable EAC and I am not sure about VAC. I wouldn't want to be the cause of a user being banned because he or she forgot to play without EAC. If I am mistaken, please feel free to enlighten me! I've been wrong before!


Harmony works with any compiled C# executable, it's not specific to Unity. But otherwise you're correct. Like all C# mods, it requires EAC to be disabled, and for the mod to be installed on clients and servers.

But as I said, there's no way to do it otherwise. The amount of slots is hard-coded in the vanilla game's compiled executable.

EDIT: Just in case you're curious, it's set in the constructor (this is the game's code, not mine):

public TileEntityDewCollector(Chunk _chunk) : base(_chunk)
{
this.containerSize = new Vector2i(3, 1);
}




(And even if it was not C# code, it would need to be installed on the server anyway, so it's unlikely a user would get booted.)

 
Last edited by a moderator:
I'm a C++ guy. I've never liked languages that place a billion libraries between the kernel and my app. I do know and have used C# in another Unity game, but I feel at home in the Unreal Engine since I can do C++ like I used to in the Quake 2 and Half-Life era.

So what about VAC? VAC doesn't mind Harmony hooking into Unity games?

 
Back
Top