New to Rimworld modding and I'm having an issue with XML.

Started by LanceCasselli, March 04, 2021, 02:02:03 AM

Previous topic - Next topic

LanceCasselli

Hello, I'm new Rimworld modding and I'm wondering what I'm doing wrong with the <li Class=""> command. I'm trying to make a mod for a mod, which might be a bad start to modding, but oh well. I'm trying to add in a new lightsaber and some force abilities into Jecrell's Star Wars mods. I've succeeded in making his mods dependencies for my mod, but now I can't get the game to notice when I'm trying to call a class from XML. Can someone tell me what this method/function is doing and most importantly, what I'M doing wrong?

LanceCasselli

My code might be wrong with what I'm trying to do, but that's not my main concern right now. My main concern is just trying to get the bloody thing loaded up into the game.

Chicken Plucker

Hey there buddy, I personally can't be much help with C# cause I don't have enough experience with it, but just in case you don't have it on, do you have JecsTools enabled and harmony with this? It may be that, otherwise that's my only suggestions so my apologies for not offering much help.

LanceCasselli

Aye, those are all enabled in my modlist. My main concern isn't so much the code, but rather how to get XML working. I'll worry about the code later unless it's my main problem right now. Thanks though.

RawCode

i hope this video with answer to your question will explain why posting code as image is very wrong

LanceCasselli

Ah, yeah, sorry. I posted it as an image because I was having an issue copying all the code to have the correct indentation into a log/txt file. That, and it was like 1:00 in the morning and I had a really hard time dealing with it at that point. But, I'm absolutely sure I'm using a namespace. Here, I'll attach two .txt files with everything and see if that can clear a lot of stuff up. I know I'm using the namespace I wrote in for my "mod extension". Do I have to declare one in XML or just use the one I have in C#?

Also, I have toyed about with the file since I posted the screenshot in the first post, so the name type under <li Class="LCSaber"> might be different, but it should be something similar like LC_Lightsaber. Or it could be the same, I don't know right now, I'm playing with it and my main concern is just figuring out how to load my custom assets, along with my code, into the game.

RawCode

check your namespace, you are using "SWSaber." in XML but your code is "LCSaber"

LanceCasselli

Aye, the code is using SWSaber as a parent, but the object I'm making needs technically two parents, so I don't dupe the classes. I'm trying to get XML to recognize both LCSaber and SWSaber. I'm calling more than just that one script.

RawCode

you can't have two parents, object\class may extend only one class, multiple inheritance are not allowed.

LanceCasselli

Ah, okay. That makes sense now. So I can't inherit from two classes, I must only inherit from one? Alright then. Thank you.