Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Field Researcher
Original Poster
#1 Old 14th Feb 2017 at 12:53 PM
Default How does the game connect XML files and code?
i am trying to make my own invention bench without overwriting the other one.. I do have problems finding out where exactly the game reads the XML file that contains the objects that can be invented.
It seems to be in the class InventionData because it has the blabla get value schematic, not in the invention bench itsself, the invention bench just uses InventionData as an object type.

Seems to me, like I would have to write my own InventionData class (differently names of course) and then override all the functions using InventionData to use mine.. but how would I get my own Inventiondata to read my file, while the normal Inventiondata still reads the default XML? How do I connect them? And is there an easier way to do this?
Advertisement
Inventor
#2 Old 14th Feb 2017 at 2:44 PM
I guess you need to script to find out the best way. Usually in my mods i use the same technic as you suggested above. I create a new static class that usually call the parseData(xmlfilename) method from the original class to load the custom data. I guess you can do the same in inventiondata
Field Researcher
Original Poster
#3 Old 14th Feb 2017 at 4:15 PM
Inventiondata does not have a parsedata method.. so the file must be parsed somewhere else.. how do i found where that is in reflector?
Inventor
#4 Old 14th Feb 2017 at 10:33 PM
Quote: Originally posted by KittyTheSnowcat
Inventiondata does not have a parsedata method.. so the file must be parsed somewhere else.. how do i found where that is in reflector?


Recursive search. Pick a related class and start looking for what you want recursively. Most of the reflectors have the search feature to help you.
Field Researcher
Original Poster
#5 Old 15th Feb 2017 at 6:27 AM
So far I have found the different parse methods.. But i can't find the link between them and the inventing.. I'll keep looking
Scholar
#6 Old 15th Feb 2017 at 3:34 PM
I'm confused can't you create your own workbench by inheriting (or extends) stuff from EA's work bench and then add and modify the inherited methods. That way the game keeps the original EA workbench and you get a new workbench which is like EA's workbench but with some modifications made by you.
I think this would work.

Also I think the reason you're not finding the parse methods is because they're private you have to make them public by de-compiling the dll to il and make them public. The core modding tutorial will tell you how to do that.

I hope I didn't say anything stupid. I mean I am pretty new to mod making but that's how people make their own custom moodlets and interactions, by inheriting from EA made classes.
Field Researcher
Original Poster
#7 Old 15th Feb 2017 at 6:09 PM
That is exactly what i am trying to do, but to override the methods i have to figure out how they work first^^ I have now found out that the parsing of the file is done in the Inventing skill not the bench, so I will probably have to overwrite all the methods which use the data.. The thing is I am not the kind of person who tries stuff out, I always need to understand as many pieces of the puzzle as possible. And I want to understand, how exactyl you go from the xml to the inventing, because I would like my own workbench to have a tuning file too. I am alsways tuning everything about my game and I can't imagine making a mod without the possibility for other people to tune it.
Field Researcher
Original Poster
#8 Old 15th Feb 2017 at 6:38 PM
Chainreaction answered my questions on NRAAS =)
Scholar
#9 Old 16th Feb 2017 at 9:13 PM
Quote: Originally posted by KittyTheSnowcat
Chainreaction answered my questions on NRAAS =)


That's great. Another idea I had was that you should check out how store objects have interactions added to them. Those have their own tuning right??
Back to top