Jump to content

Need help with a mod I'm making.


Zagan

Recommended Posts

I'm currently trying to make a modlet that will set the value of Hidden to False in an xml file. The problem is it works when I start a new game, however when I leave and come back it's Hidden again.

 

I have tried set xpath and append xpath with many variations to get to the path of the

 

/property[@name=Hidden]/@value">false</set> or append but after dozens (and I mean dozens) of different ways to get there it just does not consistently work every time I re-enter the game in SP or on my server.

 

Sure, I can just manually edit the xml file and it will work for me everytime. But I want to make this stupid thing work as a modlet because now it's become an obsession and it's driving me crazy. I can be found for days sitting here screaming "IT SHOULD WORK!, WHY DOES IT NOT WORK???"

 

So if any of you modding wizards think you can help me end this madness so I can complete this modlet and release it I would very much appreciate it. It's my first one and it will be cool when it works. It should work right? I'm just trying to change 1 stupid word...1 word, 1 word, that's all, just 1 word....

Link to comment
Share on other sites

Yeah, just tried that. I have even verified files and uninstalled and reinstalled the game. Still not working.

 

My other mods work fine, I have tried it with them and without them in the mods folder too.

Link to comment
Share on other sites

I might be completely wrong in this but I thought it was said that modlets load in alphabetical order. If one of your other mods is changing your mod then maybe try putting a Z in front of your mod name so it loads last. EG if modlet is called Hidden then call it ZHidden.

 

I might have this comletely wrong too so if someone knows different they can chime in and give me a kick in the butt for the incorrect info. :)

Link to comment
Share on other sites

OK, so I renamed the mod folder and put a "!" in front of the name so my mod would load first and guess what?

That didn't work either....lol

 

Look, I'm just trying to change the 3 hidden paint textures in the painting.xml from "Hidden=true" to false.

 

So if someone has a simple code for that that works then please tell me. That's all I need.

 

<config>
<set xpath="/painting/property[@name='Hidden']/@value">false</set>
</config>

 

I've been trying this one and many, many variations and I can't find one that works. This one should cover the whole painting.xml (Am I right?).

I get no errors, but it doesn't seem to work.

Link to comment
Share on other sites

OK, so I renamed the mod folder and put a "!" in front of the name so my mod would load first and guess what?

That didn't work either....lol

 

Look, I'm just trying to change the 3 hidden paint textures in the painting.xml from "Hidden=true" to false.

 

So if someone has a simple code for that that works then please tell me. That's all I need.

 

<config>
<set xpath="/painting/property[@name='Hidden']/@value">false</set>
</config>

 

I've been trying this one and many, many variations and I can't find one that works. This one should cover the whole painting.xml (Am I right?).

I get no errors, but it doesn't seem to work.

 

No, that's incorrect.

 

The painting.xml has <paints> and <paint> as nodes. This is probably closer to being correct:

 

 
         <set xpath="/paints/paint/property[@name='Hidden']/@value">true</set>

Link to comment
Share on other sites

Yeah, i know that and I tried that code, the thing you are missing is a painting/ in front of it because that tells the command which xml you are editing, right?

 

And I wasn't really going for 1 particular node, I was covering the whole xml document with that code. You should also look at the painting.xml because the nodes are not arranged like they are in the items.xml

 

<config>
<append xpath="/painting">
	<paint id="61" name="txName_Drywall_tan_baseboard">
		<property name="TextureId" value="216"/>
		<property name="Group" value="txGroupMasonry"/>
		<property name="PaintCost" value="2" />
		<property name="Hidden" value="false" />
	</paint>
	<paint id="138" name="txName_Drywall_orange">
		<property name="TextureId" value="430"/>
		<property name="Group" value="txGroupPainted"/>
		<property name="PaintCost" value="1" />
		<property name="Hidden" value="false" />
	</paint>
	<paint id="148" name="txName_Tarpaper">
		<property name="TextureId" value="571"/>
		<property name="Group" value="txGroupWood"/>
		<property name="PaintCost" value="3" />
		<property name="Hidden" value="false" />
	</paint>
</append>
</config>

 

Now this code works, but only on a new save and you have to MAKE a paint brush for the textures to become visible in the paint menu. However, once you exit the game and come back if you open the paint menu again the textures are gone and if you make a new paint brush they are not in the menu either. That is why I was trying to do it with a </set> command. But that doesn't seem to work either. Is there some other command like maybe replace or something that would work?

 

Geez, if nothing else I'm learning a lot of wrong ways to do coding...lol Oh and BTW, thank you guys for the help.

Link to comment
Share on other sites

OK, you are all probably wondering why on earth is this guy so worried about unhiding a paint texture. Well I'll come clean and tell you. I built a house on my server and had just finished it and was about to paint the walls inside when I got booted from the server. I quickly rejoined and when I got back in the game it had glitched and when I opened my paint menu to select a texture there was a new one there that I decided to use. Only it didn't do what I expected. Here is a short video of what it actually does.

 

https://youtu.https://youtu.be/zMNgDNJso0gbe/zMNgDNJso0g

 

This is why I really want to make a modlet for this.

Link to comment
Share on other sites

OK, you are all probably wondering why on earth is this guy so worried about unhiding a paint texture. Well I'll come clean and tell you. I built a house on my server and had just finished it and was about to paint the walls inside when I got booted from the server. I quickly rejoined and when I got back in the game it had glitched and when I opened my paint menu to select a texture there was a new one there that I decided to use. Only it didn't do what I expected. Here is a short video of what it actually does.

 

https://youtu.https://youtu.be/zMNgDNJso0gbe/zMNgDNJso0g

 

This is why I really want to make a modlet for this.

 

I wouldn't judge someone for making a mod regardless of the reason :)

 

You needed to specify the name of the XML in the SDX version of xpath, which was retired with A17.

 

Your file will run if its under Config/painting.xml, with the fixed paths I posted. Vanilla xpath requires that your patch xml file match the vanilla file name; that's how it makes it association.

Link to comment
Share on other sites

I just tried that code you suggested and it does the same thing the code I just posted. It worked on a new same game when I made a paint brush, but when I exit and quit the game and come back it no longer has the texture in the paint menu. Even if i make a new paint brush it's not there. So from what I can tell the modlet makes a change to the game only once when the game is loaded, but not every time the game is loaded.

 

Does that make sense?

Link to comment
Share on other sites

I just tried that code you suggested and it does the same thing the code I just posted. It worked on a new same game when I made a paint brush, but when I exit and quit the game and come back it no longer has the texture in the paint menu. Even if i make a new paint brush it's not there. So from what I can tell the modlet makes a change to the game only once when the game is loaded, but not every time the game is loaded.

 

Does that make sense?

 

No, it doesn't make any sense. Can you provide a log from the first and second time?

Link to comment
Share on other sites

OK, so I renamed the mod folder and put a "!" in front of the name so my mod would load first and guess what?

That didn't work either....lol

 

 

You misunderstood what I was saying. I actually wanted your mod to load last, not first. Reason being was in case a mod that loads after it cancels out your mod. That is why I was saying use a Z in front of your mods folder name. I also should have asked if you are even using any other mods.

 

 

You link didn't work.

 

https://youtu.be/zMNgDNJso0gbe/zMNgDNJso0g

Link to comment
Share on other sites

Ok Here are the log filesw you asked for, I made a new game named "test", grabbed a stack of wood and leather and made a paint brush, it had the texture in the paint menu so i exited and quit the game. Then I restarted the game and continued. Made a new brush and the texture was not there anymore. This made 3 logs so I sent you all 3, (don't know why it made 3, but there you go).

output_log__2019-06-17__13-39-50.txt

output_log__2019-06-17__13-41-02.txt

output_log__2019-06-17__13-44-02.txt

Link to comment
Share on other sites

I have been looking for something similar to that forever....well close to that. I would like the blocks to have collisiion so you can't walk or shoot through them. Sort of a 1 way mirror effect. Might have to see if there is a way for me to change it a bit.

Link to comment
Share on other sites

You misunderstood what I was saying. I actually wanted your mod to load last, not first. Reason being was in case a mod that loads after it cancels out your mod. That is why I was saying use a Z in front of your mods folder name. I also should have asked if you are even using any other mods.

 

 

You link didn't work.

 

https://youtu.be/zMNgDNJso0gbe/zMNgDNJso0g

 

Try this one;

 

 

And Yeah I have like 20 mods. I'll try putting a Z in front so it loads last like you suggested, Thanks.

Link to comment
Share on other sites

OK, I think I got it. It was a few things, some of your suggestions were very helpful, some were close but a little off, but that's OK because when combined I got there eventually and I learned a lot in the process.

 

So I would like to Thank you all for your support and taking the time to help me.

 

So...

THANK YOU Guppycur!

THANK YOU Gamida!

THANK YOU sphereii!

AND THANK YOU MadToker who was also helping me on Teamspeak.

I will be sure to include all of you in the credits when I post this mod.

Also, thanks to the people on this forum for being so kind and helpful and putting up with my n00b questions (I know that ain't EZ).

 

Now I'm gonna go take a long awaited shower b4 someone calls the health dept.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...